From: support
Date: Thu, 15 Dec 2022 16:33:03 +0000 (+0000)
Subject: Built motion from commit c738b9ac.|2.6.25
X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=c72e514e465dd20f42e682d6ed4c164c2367ac7c;p=motion2.git
Built motion from commit c738b9ac.|2.6.25
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index f2aabf3..a007b24 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-12-12T11:59:54.992Z",
+ "time": "2022-12-15T16:25:26.484Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 3634c12..86b7021 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-12-12T11:59:54.992Z",
+ "time": "2022-12-15T16:25:26.484Z",
"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 3bcaa63..6833ea8 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 _0x72a4=['jscripty','urlForward','browser','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]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','action','STRING','contactManager','integration'];(function(_0x2aa34a,_0x4c8fe2){var _0x1ffe88=function(_0x127172){while(--_0x127172){_0x2aa34a['push'](_0x2aa34a['shift']());}};_0x1ffe88(++_0x4c8fe2);}(_0x72a4,0x1c5));var _0x472a=function(_0x21a9cf,_0x51f954){_0x21a9cf=_0x21a9cf-0x0;var _0x5d4ba7=_0x72a4[_0x21a9cf];return _0x5d4ba7;};'use strict';var Sequelize=require('sequelize');module[_0x472a('0x0')]={'name':{'type':Sequelize[_0x472a('0x1')],'get':function(_0x305d3e){return this['getDataValue'](_0x472a('0x2'));}},'action':{'type':Sequelize[_0x472a('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x472a('0x4'),_0x472a('0x5'),'motionbar',_0x472a('0x6'),_0x472a('0x7'),_0x472a('0x8'),'bot',_0x472a('0x9')]],'msg':_0x472a('0xa')}},'comment':_0x472a('0xa')},'data1':{'type':Sequelize[_0x472a('0x3')](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['STRING'](0x1000),'comment':_0x472a('0xb')},'data3':{'type':Sequelize[_0x472a('0x3')](0x1000),'comment':_0x472a('0xc')},'data4':{'type':Sequelize[_0x472a('0x3')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x472a('0xd')},'data6':{'type':Sequelize['STRING'],'comments':_0x472a('0xe')},'data7':{'type':Sequelize[_0x472a('0xf')],'comments':_0x472a('0x10')}};
\ No newline at end of file
+var _0x68c2=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','exports','VIRTUAL','action','STRING','contactManager','integration','jscripty','browser'];(function(_0x43df41,_0x28c7eb){var _0x1aab78=function(_0x22180f){while(--_0x22180f){_0x43df41['push'](_0x43df41['shift']());}};_0x1aab78(++_0x28c7eb);}(_0x68c2,0x1e8));var _0x268c=function(_0x18f82b,_0x3ea7a0){_0x18f82b=_0x18f82b-0x0;var _0x5d8128=_0x68c2[_0x18f82b];return _0x5d8128;};'use strict';var Sequelize=require('sequelize');module[_0x268c('0x0')]={'name':{'type':Sequelize[_0x268c('0x1')],'get':function(_0x5f2a7b){return this['getDataValue'](_0x268c('0x2'));}},'action':{'type':Sequelize[_0x268c('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x268c('0x4'),_0x268c('0x5'),'motionbar',_0x268c('0x6'),'urlForward',_0x268c('0x7'),'bot',_0x268c('0x8')]],'msg':_0x268c('0x9')}},'comment':_0x268c('0x9')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x268c('0xa')},'data2':{'type':Sequelize[_0x268c('0x3')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x268c('0x3')](0x1000),'comment':_0x268c('0xb')},'data4':{'type':Sequelize[_0x268c('0x3')](0x1000),'comments':_0x268c('0xc')},'data5':{'type':Sequelize[_0x268c('0x3')](0x1000),'comments':_0x268c('0xd')},'data6':{'type':Sequelize[_0x268c('0x3')],'comments':_0x268c('0xe')},'data7':{'type':Sequelize['TEXT'],'comments':_0x268c('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 86edeb2..7358f9c 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 _0x205b=['rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','end','sendStatus','stack','name','send','body','Action','find','params','catch','eml-format'];(function(_0x17bb31,_0x2fc6f8){var _0x505c71=function(_0x5013cf){while(--_0x5013cf){_0x17bb31['push'](_0x17bb31['shift']());}};_0x505c71(++_0x2fc6f8);}(_0x205b,0x1ee));var _0xb205=function(_0x2770fe,_0x4e02ab){_0x2770fe=_0x2770fe-0x0;var _0x11c6cd=_0x205b[_0x2770fe];return _0x11c6cd;};'use strict';var emlformat=require(_0xb205('0x0'));var rimraf=require(_0xb205('0x1'));var zipdir=require(_0xb205('0x2'));var jsonpatch=require(_0xb205('0x3'));var rp=require('request-promise');var moment=require(_0xb205('0x4'));var BPromise=require(_0xb205('0x5'));var Mustache=require('mustache');var util=require(_0xb205('0x6'));var path=require('path');var sox=require(_0xb205('0x7'));var csv=require(_0xb205('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb205('0x9'));var squel=require(_0xb205('0xa'));var crypto=require(_0xb205('0xb'));var jsforce=require(_0xb205('0xc'));var deskjs=require(_0xb205('0xd'));var toCsv=require(_0xb205('0x8'));var querystring=require('querystring');var Papa=require(_0xb205('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb205('0xf'));var as=require(_0xb205('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb205('0x11'))(_0xb205('0x12'));var utils=require(_0xb205('0x13'));var config=require(_0xb205('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb205('0x15'))['db'];function respondWithStatusCode(_0x4df8fb,_0x2955d4){_0x2955d4=_0x2955d4||0xcc;return function(_0x9d4e59){if(_0x9d4e59){return _0x4df8fb['sendStatus'](_0x2955d4);}return _0x4df8fb['status'](_0x2955d4)['end']();};}function respondWithResult(_0x17ad85,_0x341a43){_0x341a43=_0x341a43||0xc8;return function(_0x208c38){if(_0x208c38){return _0x17ad85[_0xb205('0x16')](_0x341a43)[_0xb205('0x17')](_0x208c38);}};}function respondWithFilteredResult(_0x230bd7,_0x272463){return function(_0x53b122){if(_0x53b122){var _0x5588b5=typeof _0x272463['offset']===_0xb205('0x18')&&typeof _0x272463[_0xb205('0x19')]===_0xb205('0x18');var _0x3647ba=_0x53b122[_0xb205('0x1a')];var _0x3a656d=_0x5588b5?0x0:_0x272463[_0xb205('0x1b')];var _0x25b53c=_0x5588b5?_0x53b122[_0xb205('0x1a')]:_0x272463[_0xb205('0x1b')]+_0x272463['limit'];var _0x55c01d;if(_0x25b53c>=_0x3647ba){_0x25b53c=_0x3647ba;_0x55c01d=0xc8;}else{_0x55c01d=0xce;}_0x230bd7['status'](_0x55c01d);return _0x230bd7[_0xb205('0x1c')](_0xb205('0x1d'),_0x3a656d+'-'+_0x25b53c+'/'+_0x3647ba)[_0xb205('0x17')](_0x53b122);}return null;};}function patchUpdates(_0x1b88b3){return function(_0x223a2e){try{jsonpatch['apply'](_0x223a2e,_0x1b88b3,!![]);}catch(_0x26efaf){return BPromise[_0xb205('0x1e')](_0x26efaf);}return _0x223a2e[_0xb205('0x1f')]();};}function saveUpdates(_0x22cd68,_0xb784a9){return function(_0x56c1a8){if(_0x56c1a8){return _0x56c1a8[_0xb205('0x20')](_0x22cd68)['then'](function(_0x406cbf){return _0x406cbf;});}return null;};}function removeEntity(_0xaac8f3,_0x19ed30){return function(_0x110b03){if(_0x110b03){return _0x110b03[_0xb205('0x21')]()[_0xb205('0x22')](function(){_0xaac8f3['status'](0xcc)[_0xb205('0x23')]();});}};}function handleEntityNotFound(_0xea3ff3,_0x326f2a){return function(_0x109098){if(!_0x109098){_0xea3ff3[_0xb205('0x24')](0x194);}return _0x109098;};}function handleError(_0x27ac7a,_0x3767c0){_0x3767c0=_0x3767c0||0x1f4;return function(_0x47c51){logger['error'](_0x47c51[_0xb205('0x25')]);if(_0x47c51[_0xb205('0x26')]){delete _0x47c51[_0xb205('0x26')];}_0x27ac7a[_0xb205('0x16')](_0x3767c0)[_0xb205('0x27')](_0x47c51);};}exports[_0xb205('0x20')]=function(_0x5d41f3,_0x10f114){if(_0x5d41f3[_0xb205('0x28')]['id']){delete _0x5d41f3['body']['id'];}return db[_0xb205('0x29')][_0xb205('0x2a')]({'where':{'id':_0x5d41f3[_0xb205('0x2b')]['id']}})[_0xb205('0x22')](handleEntityNotFound(_0x10f114,null))[_0xb205('0x22')](saveUpdates(_0x5d41f3['body'],null))[_0xb205('0x22')](respondWithResult(_0x10f114,null))[_0xb205('0x2c')](handleError(_0x10f114,null));};exports[_0xb205('0x21')]=function(_0x4d1b3b,_0x2b2b8a){return db[_0xb205('0x29')][_0xb205('0x2a')]({'where':{'id':_0x4d1b3b[_0xb205('0x2b')]['id']}})['then'](handleEntityNotFound(_0x2b2b8a,null))[_0xb205('0x22')](removeEntity(_0x2b2b8a,null))[_0xb205('0x2c')](handleError(_0x2b2b8a,null));};
\ No newline at end of file
+var _0xf526=['count','limit','apply','update','then','error','stack','name','send','body','Action','find','params','destroy','catch','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','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','sendStatus','status','end','json','offset','undefined'];(function(_0x10b2f1,_0x46c79d){var _0x1041b2=function(_0x1ca766){while(--_0x1ca766){_0x10b2f1['push'](_0x10b2f1['shift']());}};_0x1041b2(++_0x46c79d);}(_0xf526,0x143));var _0x6f52=function(_0xe91467,_0x21708a){_0xe91467=_0xe91467-0x0;var _0x5a19d8=_0xf526[_0xe91467];return _0x5a19d8;};'use strict';var emlformat=require(_0x6f52('0x0'));var rimraf=require(_0x6f52('0x1'));var zipdir=require(_0x6f52('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6f52('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6f52('0x4'));var util=require('util');var path=require(_0x6f52('0x5'));var sox=require(_0x6f52('0x6'));var csv=require(_0x6f52('0x7'));var ejs=require(_0x6f52('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6f52('0x9'));var crypto=require(_0x6f52('0xa'));var jsforce=require(_0x6f52('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6f52('0x7'));var querystring=require(_0x6f52('0xc'));var Papa=require(_0x6f52('0xd'));var Redis=require(_0x6f52('0xe'));var authService=require(_0x6f52('0xf'));var qs=require(_0x6f52('0x10'));var as=require(_0x6f52('0x11'));var hardwareService=require(_0x6f52('0x12'));var logger=require(_0x6f52('0x13'))(_0x6f52('0x14'));var utils=require(_0x6f52('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6f52('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x347e24,_0x4da636){_0x4da636=_0x4da636||0xcc;return function(_0x1892cc){if(_0x1892cc){return _0x347e24[_0x6f52('0x17')](_0x4da636);}return _0x347e24[_0x6f52('0x18')](_0x4da636)[_0x6f52('0x19')]();};}function respondWithResult(_0x2e100e,_0x519859){_0x519859=_0x519859||0xc8;return function(_0x282287){if(_0x282287){return _0x2e100e[_0x6f52('0x18')](_0x519859)[_0x6f52('0x1a')](_0x282287);}};}function respondWithFilteredResult(_0x2e0666,_0x38eeef){return function(_0x6f51d3){if(_0x6f51d3){var _0x5588a6=typeof _0x38eeef[_0x6f52('0x1b')]===_0x6f52('0x1c')&&typeof _0x38eeef['limit']===_0x6f52('0x1c');var _0x328b45=_0x6f51d3['count'];var _0x5da93=_0x5588a6?0x0:_0x38eeef[_0x6f52('0x1b')];var _0x33abca=_0x5588a6?_0x6f51d3[_0x6f52('0x1d')]:_0x38eeef[_0x6f52('0x1b')]+_0x38eeef[_0x6f52('0x1e')];var _0x3b8590;if(_0x33abca>=_0x328b45){_0x33abca=_0x328b45;_0x3b8590=0xc8;}else{_0x3b8590=0xce;}_0x2e0666['status'](_0x3b8590);return _0x2e0666['set']('Content-Range',_0x5da93+'-'+_0x33abca+'/'+_0x328b45)[_0x6f52('0x1a')](_0x6f51d3);}return null;};}function patchUpdates(_0x5ed183){return function(_0x5d65f1){try{jsonpatch[_0x6f52('0x1f')](_0x5d65f1,_0x5ed183,!![]);}catch(_0x769162){return BPromise['reject'](_0x769162);}return _0x5d65f1['save']();};}function saveUpdates(_0x54bf01,_0x4d9911){return function(_0x15a9b1){if(_0x15a9b1){return _0x15a9b1[_0x6f52('0x20')](_0x54bf01)[_0x6f52('0x21')](function(_0x55f9cc){return _0x55f9cc;});}return null;};}function removeEntity(_0x2d6a0e,_0x20eb3c){return function(_0x65bc8f){if(_0x65bc8f){return _0x65bc8f['destroy']()['then'](function(){_0x2d6a0e[_0x6f52('0x18')](0xcc)[_0x6f52('0x19')]();});}};}function handleEntityNotFound(_0x5446fe,_0x61e5ad){return function(_0x43a2b5){if(!_0x43a2b5){_0x5446fe['sendStatus'](0x194);}return _0x43a2b5;};}function handleError(_0x507fb5,_0x11ec08){_0x11ec08=_0x11ec08||0x1f4;return function(_0x5c61fb){logger[_0x6f52('0x22')](_0x5c61fb[_0x6f52('0x23')]);if(_0x5c61fb[_0x6f52('0x24')]){delete _0x5c61fb[_0x6f52('0x24')];}_0x507fb5['status'](_0x11ec08)[_0x6f52('0x25')](_0x5c61fb);};}exports['update']=function(_0x257b20,_0x5a5842){if(_0x257b20[_0x6f52('0x26')]['id']){delete _0x257b20[_0x6f52('0x26')]['id'];}return db[_0x6f52('0x27')][_0x6f52('0x28')]({'where':{'id':_0x257b20[_0x6f52('0x29')]['id']}})[_0x6f52('0x21')](handleEntityNotFound(_0x5a5842,null))[_0x6f52('0x21')](saveUpdates(_0x257b20[_0x6f52('0x26')],null))[_0x6f52('0x21')](respondWithResult(_0x5a5842,null))['catch'](handleError(_0x5a5842,null));};exports[_0x6f52('0x2a')]=function(_0x4ec39f,_0x445ec8){return db[_0x6f52('0x27')][_0x6f52('0x28')]({'where':{'id':_0x4ec39f[_0x6f52('0x29')]['id']}})[_0x6f52('0x21')](handleEntityNotFound(_0x445ec8,null))['then'](removeEntity(_0x445ec8,null))[_0x6f52('0x2b')](handleError(_0x445ec8,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index cf3dc05..a84e81f 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 _0xe211=['exports','define','Action','tools_actions','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./action.attributes'];(function(_0x183b3c,_0x34db3b){var _0x30e020=function(_0x4985ff){while(--_0x4985ff){_0x183b3c['push'](_0x183b3c['shift']());}};_0x30e020(++_0x34db3b);}(_0xe211,0xfb));var _0x1e21=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe211[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1e21('0x0'));var util=require(_0x1e21('0x1'));var logger=require('../../config/logger')(_0x1e21('0x2'));var moment=require(_0x1e21('0x3'));var BPromise=require(_0x1e21('0x4'));var rp=require(_0x1e21('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e21('0x6'));var config=require(_0x1e21('0x7'));var attributes=require(_0x1e21('0x8'));module[_0x1e21('0x9')]=function(_0x21df74,_0x14f996){return _0x21df74[_0x1e21('0xa')](_0x1e21('0xb'),attributes,{'tableName':_0x1e21('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xed60=['util','api','moment','request-promise','path','./action.attributes','exports','Action','tools_actions','lodash'];(function(_0x5227ab,_0x514da4){var _0x3dc702=function(_0x592b15){while(--_0x592b15){_0x5227ab['push'](_0x5227ab['shift']());}};_0x3dc702(++_0x514da4);}(_0xed60,0x81));var _0x0ed6=function(_0x25d126,_0x3294c3){_0x25d126=_0x25d126-0x0;var _0x2c997f=_0xed60[_0x25d126];return _0x2c997f;};'use strict';var _=require(_0x0ed6('0x0'));var util=require(_0x0ed6('0x1'));var logger=require('../../config/logger')(_0x0ed6('0x2'));var moment=require(_0x0ed6('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ed6('0x4'));var fs=require('fs');var path=require(_0x0ed6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0ed6('0x6'));module[_0x0ed6('0x7')]=function(_0x453996,_0x12d9da){return _0x453996['define'](_0x0ed6('0x8'),attributes,{'tableName':_0x0ed6('0x9'),'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 a1195dd..530769d 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x814b,0x1a2));var _0xb814=function(_0x2e3545,_0x20a6ec){_0x2e3545=_0x2e3545-0x0;var _0xcf18f=_0x814b[_0x2e3545];return _0xcf18f;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}
\ No newline at end of file
+var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x7217,0x19e));var _0x7721=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x7217[_0x934425];return _0x31d596;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 432e009..9cf0cd1 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 _0x5016=['../../components/interaction/service','../../config/environment','./action.controller','isAuthenticated','/:id','destroy','multer','util','path','Router','fs-extra'];(function(_0x13b774,_0x20ee63){var _0x17da42=function(_0x234a4f){while(--_0x234a4f){_0x13b774['push'](_0x13b774['shift']());}};_0x17da42(++_0x20ee63);}(_0x5016,0x8a));var _0x6501=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0x5016[_0x3cae69];return _0x3128eb;};'use strict';var multer=require(_0x6501('0x0'));var util=require(_0x6501('0x1'));var path=require(_0x6501('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6501('0x3')]();var fs_extra=require(_0x6501('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6501('0x5'));var config=require(_0x6501('0x6'));var controller=require(_0x6501('0x7'));router['put']('/:id',auth[_0x6501('0x8')](),controller['update']);router['delete'](_0x6501('0x9'),auth[_0x6501('0x8')](),controller[_0x6501('0xa')]);module['exports']=router;
\ No newline at end of file
+var _0x0740=['delete','isAuthenticated','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','update'];(function(_0x1945a5,_0x50de54){var _0x5817a5=function(_0x2a5a93){while(--_0x2a5a93){_0x1945a5['push'](_0x1945a5['shift']());}};_0x5817a5(++_0x50de54);}(_0x0740,0x112));var _0x0074=function(_0x231304,_0x5e462b){_0x231304=_0x231304-0x0;var _0x377e30=_0x0740[_0x231304];return _0x377e30;};'use strict';var multer=require('multer');var util=require(_0x0074('0x0'));var path=require(_0x0074('0x1'));var timeout=require('connect-timeout');var express=require(_0x0074('0x2'));var router=express[_0x0074('0x3')]();var fs_extra=require(_0x0074('0x4'));var auth=require(_0x0074('0x5'));var interaction=require(_0x0074('0x6'));var config=require('../../config/environment');var controller=require(_0x0074('0x7'));router[_0x0074('0x8')](_0x0074('0x9'),auth['isAuthenticated'](),controller[_0x0074('0xa')]);router[_0x0074('0xb')](_0x0074('0x9'),auth[_0x0074('0xc')](),controller[_0x0074('0xd')]);module[_0x0074('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 3c2b8d7..c8b6eb7 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 _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x55e2a7,_0x99e395){var _0x5599d5=function(_0x1025bd){while(--_0x1025bd){_0x55e2a7['push'](_0x55e2a7['shift']());}};_0x5599d5(++_0x99e395);}(_0xd8fb,0x99));var _0xbd8f=function(_0x39ba52,_0x852186){_0x39ba52=_0x39ba52-0x0;var _0x3859e2=_0xd8fb[_0x39ba52];return _0x3859e2;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}};
\ No newline at end of file
+var _0x207c=['STRING','TEXT','exports'];(function(_0x59aca0,_0x8d0799){var _0x1a650f=function(_0x31c5cd){while(--_0x31c5cd){_0x59aca0['push'](_0x59aca0['shift']());}};_0x1a650f(++_0x8d0799);}(_0x207c,0x1e8));var _0xc207=function(_0x3b3362,_0x202631){_0x3b3362=_0x3b3362-0x0;var _0x223f5b=_0x207c[_0x3b3362];return _0x223f5b;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'name':{'type':Sequelize[_0xc207('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc207('0x1')]},'parent':{'type':Sequelize[_0xc207('0x1')]},'table':{'type':Sequelize[_0xc207('0x1')]},'conditions':{'type':Sequelize[_0xc207('0x2')]},'joins':{'type':Sequelize[_0xc207('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 324591c..a9691e6 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 _0xe3e7=['value','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','UNIX_TIMESTAMP(%s)','operator','getFields','Sequelize','metric','DESC','web','fullPath','randomstring','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','run','COUNT(DISTINCT\x20%s)','IS\x20EMPTY','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','Content-Range','apply','reject','then','destroy','CustomReports','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','group','condition'];(function(_0x3fc287,_0x5c3f36){var _0x33af9f=function(_0x27cfc6){while(--_0x27cfc6){_0x3fc287['push'](_0x3fc287['shift']());}};_0x33af9f(++_0x5c3f36);}(_0xe3e7,0xe0));var _0x7e3e=function(_0x4a3f01,_0x20687d){_0x4a3f01=_0x4a3f01-0x0;var _0x14fd54=_0xe3e7[_0x4a3f01];return _0x14fd54;};'use strict';var emlformat=require(_0x7e3e('0x0'));var rimraf=require(_0x7e3e('0x1'));var zipdir=require(_0x7e3e('0x2'));var jsonpatch=require(_0x7e3e('0x3'));var rp=require(_0x7e3e('0x4'));var moment=require(_0x7e3e('0x5'));var BPromise=require(_0x7e3e('0x6'));var Mustache=require('mustache');var util=require(_0x7e3e('0x7'));var path=require(_0x7e3e('0x8'));var sox=require(_0x7e3e('0x9'));var csv=require(_0x7e3e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e3e('0xb'));var _=require(_0x7e3e('0xc'));var squel=require(_0x7e3e('0xd'));var crypto=require(_0x7e3e('0xe'));var jsforce=require(_0x7e3e('0xf'));var deskjs=require(_0x7e3e('0x10'));var toCsv=require(_0x7e3e('0xa'));var querystring=require(_0x7e3e('0x11'));var Papa=require(_0x7e3e('0x12'));var Redis=require(_0x7e3e('0x13'));var authService=require(_0x7e3e('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7e3e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e3e('0x16'))(_0x7e3e('0x17'));var utils=require(_0x7e3e('0x18'));var config=require(_0x7e3e('0x19'));var licenseUtil=require(_0x7e3e('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require(_0x7e3e('0x1b'))['dbH'];function respondWithStatusCode(_0x29d33e,_0x4e65a5){_0x4e65a5=_0x4e65a5||0xcc;return function(_0x3005e9){if(_0x3005e9){return _0x29d33e['sendStatus'](_0x4e65a5);}return _0x29d33e['status'](_0x4e65a5)['end']();};}function respondWithResult(_0xd7edff,_0x59d785){_0x59d785=_0x59d785||0xc8;return function(_0xc0f7ca){if(_0xc0f7ca){return _0xd7edff[_0x7e3e('0x1c')](_0x59d785)[_0x7e3e('0x1d')](_0xc0f7ca);}};}function respondWithFilteredResult(_0x3c7313,_0xa62ace){return function(_0x4757fe){if(_0x4757fe){var _0x5bf61e=typeof _0xa62ace[_0x7e3e('0x1e')]===_0x7e3e('0x1f')&&typeof _0xa62ace['limit']==='undefined';var _0x47c04c=_0x4757fe[_0x7e3e('0x20')];var _0x368288=_0x5bf61e?0x0:_0xa62ace[_0x7e3e('0x1e')];var _0x15fba6=_0x5bf61e?_0x4757fe[_0x7e3e('0x20')]:_0xa62ace[_0x7e3e('0x1e')]+_0xa62ace['limit'];var _0x272cff;if(_0x15fba6>=_0x47c04c){_0x15fba6=_0x47c04c;_0x272cff=0xc8;}else{_0x272cff=0xce;}_0x3c7313[_0x7e3e('0x1c')](_0x272cff);return _0x3c7313['set'](_0x7e3e('0x21'),_0x368288+'-'+_0x15fba6+'/'+_0x47c04c)[_0x7e3e('0x1d')](_0x4757fe);}return null;};}function patchUpdates(_0x172997){return function(_0x47b832){try{jsonpatch[_0x7e3e('0x22')](_0x47b832,_0x172997,!![]);}catch(_0x18d1a9){return BPromise[_0x7e3e('0x23')](_0x18d1a9);}return _0x47b832['save']();};}function saveUpdates(_0x2b94a7,_0x4a3a6f){return function(_0x506e5c){if(_0x506e5c){return _0x506e5c['update'](_0x2b94a7)[_0x7e3e('0x24')](function(_0x353f30){return _0x353f30;});}return null;};}function removeEntity(_0x1a1854,_0x3a723f){return function(_0x1e82ab){if(_0x1e82ab){return _0x1e82ab[_0x7e3e('0x25')]()[_0x7e3e('0x24')](function(){var _0x11deea=_0x1e82ab['get']({'plain':!![]});var _0x3fb5d3=_0x7e3e('0x26');return db[_0x7e3e('0x27')]['destroy']({'where':{'type':_0x3fb5d3,'resourceId':_0x11deea['id']}})[_0x7e3e('0x24')](function(){return _0x1e82ab;});})[_0x7e3e('0x24')](function(){_0x1a1854[_0x7e3e('0x1c')](0xcc)[_0x7e3e('0x28')]();});}};}function handleEntityNotFound(_0x567040,_0x16361d){return function(_0x1fefc0){if(!_0x1fefc0){_0x567040[_0x7e3e('0x29')](0x194);}return _0x1fefc0;};}function handleError(_0x5e38de,_0x4f44a0){_0x4f44a0=_0x4f44a0||0x1f4;return function(_0x1bd40e){logger[_0x7e3e('0x2a')](_0x1bd40e[_0x7e3e('0x2b')]);if(_0x1bd40e[_0x7e3e('0x2c')]){delete _0x1bd40e['name'];}_0x5e38de[_0x7e3e('0x1c')](_0x4f44a0)[_0x7e3e('0x2d')](_0x1bd40e);};}exports[_0x7e3e('0x2e')]=function(_0x4a4b7d,_0x4e2d89){var _0x3e75ab={},_0x72a15f={},_0x34b68f={'count':0x0,'rows':[]};var _0x1624a4=_[_0x7e3e('0x2f')](db[_0x7e3e('0x30')][_0x7e3e('0x31')],function(_0x417585){return{'name':_0x417585[_0x7e3e('0x32')],'type':_0x417585['type'][_0x7e3e('0x33')]};});_0x72a15f[_0x7e3e('0x34')]=_[_0x7e3e('0x2f')](_0x1624a4,_0x7e3e('0x2c'));_0x72a15f[_0x7e3e('0x35')]=_[_0x7e3e('0x36')](_0x4a4b7d[_0x7e3e('0x35')]);_0x72a15f[_0x7e3e('0x37')]=_[_0x7e3e('0x38')](_0x72a15f[_0x7e3e('0x34')],_0x72a15f['query']);_0x3e75ab['attributes']=_['intersection'](_0x72a15f[_0x7e3e('0x34')],qs[_0x7e3e('0x39')](_0x4a4b7d[_0x7e3e('0x35')]['fields']));_0x3e75ab['attributes']=_0x3e75ab['attributes']['length']?_0x3e75ab[_0x7e3e('0x3a')]:_0x72a15f[_0x7e3e('0x34')];if(!_0x4a4b7d[_0x7e3e('0x35')][_0x7e3e('0x3b')](_0x7e3e('0x3c'))){_0x3e75ab[_0x7e3e('0x3d')]=qs[_0x7e3e('0x3d')](_0x4a4b7d['query'][_0x7e3e('0x3d')]);_0x3e75ab[_0x7e3e('0x1e')]=qs[_0x7e3e('0x1e')](_0x4a4b7d[_0x7e3e('0x35')][_0x7e3e('0x1e')]);}_0x3e75ab[_0x7e3e('0x3e')]=qs[_0x7e3e('0x3f')](_0x4a4b7d[_0x7e3e('0x35')][_0x7e3e('0x3f')]);_0x3e75ab[_0x7e3e('0x40')]=qs[_0x7e3e('0x37')](_['pick'](_0x4a4b7d[_0x7e3e('0x35')],_0x72a15f[_0x7e3e('0x37')]),_0x1624a4);if(_0x4a4b7d[_0x7e3e('0x35')][_0x7e3e('0x41')]){_0x3e75ab[_0x7e3e('0x40')]=_[_0x7e3e('0x42')](_0x3e75ab[_0x7e3e('0x40')],{'$or':_[_0x7e3e('0x2f')](_0x1624a4,function(_0x5a16bc){if(_0x5a16bc[_0x7e3e('0x43')]!==_0x7e3e('0x44')){var _0x4e91c0={};_0x4e91c0[_0x5a16bc['name']]={'$like':'%'+_0x4a4b7d[_0x7e3e('0x35')]['filter']+'%'};return _0x4e91c0;}})});}_0x3e75ab=_['merge']({},_0x3e75ab,_0x4a4b7d[_0x7e3e('0x45')]);var _0x1dedc9={'where':_0x3e75ab[_0x7e3e('0x40')]};return db[_0x7e3e('0x30')][_0x7e3e('0x20')](_0x1dedc9)[_0x7e3e('0x24')](function(_0x871427){_0x34b68f['count']=_0x871427;if(_0x4a4b7d[_0x7e3e('0x35')]['includeAll']){_0x3e75ab[_0x7e3e('0x46')]=[{'all':!![]}];}return db[_0x7e3e('0x30')][_0x7e3e('0x47')](_0x3e75ab);})[_0x7e3e('0x24')](function(_0x2662a9){_0x34b68f[_0x7e3e('0x48')]=_0x2662a9;return _0x34b68f;})[_0x7e3e('0x24')](respondWithFilteredResult(_0x4e2d89,_0x3e75ab))[_0x7e3e('0x49')](handleError(_0x4e2d89,null));};exports['show']=function(_0x557f10,_0x5158a0){var _0x5f44bd={'raw':![],'where':{'id':_0x557f10[_0x7e3e('0x4a')]['id']}},_0x37729f={};_0x37729f[_0x7e3e('0x34')]=_['keys'](db['AnalyticCustomReport'][_0x7e3e('0x31')]);_0x37729f[_0x7e3e('0x35')]=_['keys'](_0x557f10[_0x7e3e('0x35')]);_0x37729f[_0x7e3e('0x37')]=_[_0x7e3e('0x38')](_0x37729f[_0x7e3e('0x34')],_0x37729f[_0x7e3e('0x35')]);_0x5f44bd[_0x7e3e('0x3a')]=_['intersection'](_0x37729f[_0x7e3e('0x34')],qs[_0x7e3e('0x39')](_0x557f10[_0x7e3e('0x35')][_0x7e3e('0x39')]));_0x5f44bd['attributes']=_0x5f44bd['attributes']['length']?_0x5f44bd['attributes']:_0x37729f[_0x7e3e('0x34')];if(_0x557f10['query'][_0x7e3e('0x4b')]){_0x5f44bd[_0x7e3e('0x46')]=[{'all':!![]}];}_0x5f44bd=_[_0x7e3e('0x42')]({},_0x5f44bd,_0x557f10['options']);return db[_0x7e3e('0x30')][_0x7e3e('0x4c')](_0x5f44bd)[_0x7e3e('0x24')](handleEntityNotFound(_0x5158a0,null))[_0x7e3e('0x24')](respondWithResult(_0x5158a0,null))['catch'](handleError(_0x5158a0,null));};exports['create']=function(_0x436743,_0x3144a6){return db[_0x7e3e('0x30')][_0x7e3e('0x4d')](_0x436743[_0x7e3e('0x4e')],{})[_0x7e3e('0x24')](function(_0x561501){var _0x42b7f7=_0x436743[_0x7e3e('0x4f')][_0x7e3e('0x50')]({'plain':!![]});if(!_0x42b7f7)throw new Error(_0x7e3e('0x51'));if(_0x42b7f7['role']===_0x7e3e('0x4f')){var _0x745c6d=_0x561501[_0x7e3e('0x50')]({'plain':!![]});var _0x199f0c=_0x7e3e('0x52');return db[_0x7e3e('0x53')][_0x7e3e('0x4c')]({'where':{'name':_0x199f0c,'userProfileId':_0x42b7f7['userProfileId']},'raw':!![]})[_0x7e3e('0x24')](function(_0x3f1caf){if(_0x3f1caf&&_0x3f1caf[_0x7e3e('0x54')]===0x0){return db[_0x7e3e('0x27')][_0x7e3e('0x4d')]({'name':_0x745c6d[_0x7e3e('0x2c')],'resourceId':_0x745c6d['id'],'type':_0x7e3e('0x26'),'sectionId':_0x3f1caf['id']},{})['then'](function(){return _0x561501;});}else{return _0x561501;}})[_0x7e3e('0x49')](function(_0x1ce5b2){logger[_0x7e3e('0x2a')](_0x7e3e('0x55'),_0x1ce5b2);throw _0x1ce5b2;});}return _0x561501;})['then'](respondWithResult(_0x3144a6,0xc9))[_0x7e3e('0x49')](handleError(_0x3144a6,null));};exports['update']=function(_0x48aaf8,_0x472679){if(_0x48aaf8['body']['id']){delete _0x48aaf8[_0x7e3e('0x4e')]['id'];}return db[_0x7e3e('0x30')][_0x7e3e('0x4c')]({'where':{'id':_0x48aaf8[_0x7e3e('0x4a')]['id']}})[_0x7e3e('0x24')](handleEntityNotFound(_0x472679,null))['then'](saveUpdates(_0x48aaf8[_0x7e3e('0x4e')],null))[_0x7e3e('0x24')](respondWithResult(_0x472679,null))[_0x7e3e('0x49')](handleError(_0x472679,null));};exports['destroy']=function(_0x371844,_0x5bc668){return db[_0x7e3e('0x30')][_0x7e3e('0x4c')]({'where':{'id':_0x371844['params']['id']}})[_0x7e3e('0x24')](handleEntityNotFound(_0x5bc668,null))['then'](removeEntity(_0x5bc668,null))['catch'](handleError(_0x5bc668,null));};exports['preview']=function(_0x3a650c,_0x277577){var _0x523360=0xa;var _0x18c115=[_0x7e3e('0x56'),'left_join',_0x7e3e('0x57'),_0x7e3e('0x58')];var _0x504896={'SUM':_0x7e3e('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7e3e('0x5a'),'MIN':_0x7e3e('0x5b'),'AVG':_0x7e3e('0x5c'),'GROUP_CONCAT':_0x7e3e('0x5d'),'GROUP_CONCAT ASC':_0x7e3e('0x5e'),'GROUP_CONCAT DESC':_0x7e3e('0x5f')};var _0x15273a={'SEC_TO_TIME':_0x7e3e('0x60'),'DATE':_0x7e3e('0x61'),'HOUR':_0x7e3e('0x62'),'ROUND':_0x7e3e('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x416cc7=function(_0x145889){return!_[_0x7e3e('0x64')]([_0x7e3e('0x65'),_0x7e3e('0x66'),'IS\x20EMPTY',_0x7e3e('0x67')],_0x145889);};var _0x263f72=function(_0x778929){if(!_0x778929||!_0x778929[_0x7e3e('0x68')][_0x7e3e('0x69')]){return'';}for(var _0x1a5ad6='(',_0x27d987=0x0;_0x27d987<_0x778929[_0x7e3e('0x68')][_0x7e3e('0x69')];_0x27d987+=0x1){_0x27d987>0x0&&(_0x1a5ad6+='\x20'+_0x778929['operator']+'\x20');_0x1a5ad6+=_0x778929[_0x7e3e('0x68')][_0x27d987][_0x7e3e('0x6a')]?_0x263f72(_0x778929[_0x7e3e('0x68')][_0x27d987][_0x7e3e('0x6a')]):_0x778929['rules'][_0x27d987]['field']+'\x20'+_0x778929[_0x7e3e('0x68')][_0x27d987][_0x7e3e('0x6b')]+(_0x416cc7(_0x778929[_0x7e3e('0x68')][_0x27d987][_0x7e3e('0x6b')])?'\x20'+_0x778929[_0x7e3e('0x68')][_0x27d987][_0x7e3e('0x6c')]:'');}return _0x1a5ad6+')';};var _0x4881d3={'where':{'id':_0x3a650c[_0x7e3e('0x4a')]['id']}},_0x243f98,_0xa2f3c0,_0x544cd3,_0x37efac,_0x31dcc3;_0x4881d3=_[_0x7e3e('0x42')]({},_0x4881d3,_0x3a650c[_0x7e3e('0x45')]);return db[_0x7e3e('0x30')]['find'](_0x4881d3)[_0x7e3e('0x24')](function(_0x57ceb9){if(_0x57ceb9){_0x243f98=_0x57ceb9;return _0x57ceb9['getFields']();}return null;})[_0x7e3e('0x24')](function(_0xa3c747){if(_0xa3c747){if(!_0xa3c747[_0x7e3e('0x69')]){throw new db['Sequelize'][(_0x7e3e('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xa2f3c0=_0xa3c747;return db[_0x7e3e('0x6e')][_0x7e3e('0x47')]({'raw':!![]});}return null;})[_0x7e3e('0x24')](function(_0x7074ee){if(_0x7074ee){_0x544cd3=_[_0x7e3e('0x6f')](_0x7074ee,'id');var _0x1ef028;var _0x2d6f44=squel[_0x7e3e('0x70')]();_0x2d6f44[_0x7e3e('0x71')](_0x243f98[_0x7e3e('0x72')]);for(var _0x31328f=0x0;_0x31328f<_0xa2f3c0[_0x7e3e('0x69')];_0x31328f+=0x1){_0x1ef028=_0xa2f3c0[_0x31328f][_0x7e3e('0x73')]?_0x544cd3[_0xa2f3c0[_0x31328f][_0x7e3e('0x73')]]['metric']:_0xa2f3c0[_0x31328f][_0x7e3e('0x74')];_0x1ef028=_0xa2f3c0[_0x31328f][_0x7e3e('0x75')]?_[_0x7e3e('0x76')](_0x504896[_0xa2f3c0[_0x31328f][_0x7e3e('0x75')]],'%s',_0x1ef028):_0x1ef028;_0x1ef028=_0xa2f3c0[_0x31328f]['format']?_['replace'](_0x15273a[_0xa2f3c0[_0x31328f][_0x7e3e('0x77')]],'%s',_0x1ef028):_0x1ef028;if(_0xa2f3c0[_0x31328f][_0x7e3e('0x78')]){_0x2d6f44[_0x7e3e('0x6a')](_0x1ef028);}_0xa2f3c0[_0x31328f][_0x7e3e('0x79')]&&_0x2d6f44[_0x7e3e('0x3e')](_0x1ef028,_0xa2f3c0[_0x31328f]['orderBy']==='DESC'?![]:!![]);_0x2d6f44['field'](_0x1ef028,_0xa2f3c0[_0x31328f][_0x7e3e('0x7a')]||_0x1ef028);}if(_0x243f98['joins']){_0x243f98[_0x7e3e('0x7b')]=JSON[_0x7e3e('0x7c')](_0x243f98['joins']);for(var _0x4b2296=0x0;_0x4b2296<_0x243f98[_0x7e3e('0x7b')][_0x7e3e('0x69')];_0x4b2296+=0x1){if(_0x243f98[_0x7e3e('0x7b')][_0x4b2296]['type']&&_[_0x7e3e('0x64')](_0x18c115,_0x243f98[_0x7e3e('0x7b')][_0x4b2296][_0x7e3e('0x43')])&&_0x243f98[_0x7e3e('0x7b')][_0x4b2296][_0x7e3e('0x7d')]&&_0x243f98[_0x7e3e('0x7b')][_0x4b2296][_0x7e3e('0x7e')]&&_0x243f98[_0x7e3e('0x7b')][_0x4b2296][_0x7e3e('0x7f')]){_0x2d6f44[_0x243f98['joins'][_0x4b2296]['type']](_0x243f98[_0x7e3e('0x7b')][_0x4b2296][_0x7e3e('0x7e')],null,util[_0x7e3e('0x77')](_0x7e3e('0x80'),_0x243f98[_0x7e3e('0x72')],_0x243f98['joins'][_0x4b2296][_0x7e3e('0x7d')],_0x243f98[_0x7e3e('0x7b')][_0x4b2296]['foreignTable'],_0x243f98[_0x7e3e('0x7b')][_0x4b2296][_0x7e3e('0x7f')]));}}}if(_0x243f98[_0x7e3e('0x81')]){_0x243f98[_0x7e3e('0x81')]=JSON['parse'](_0x243f98[_0x7e3e('0x81')]);_0x2d6f44[_0x7e3e('0x40')](_0x263f72(_0x243f98[_0x7e3e('0x81')][_0x7e3e('0x6a')]));}_0x31dcc3=_0x2d6f44[_0x7e3e('0x82')]();_0x2d6f44[_0x7e3e('0x3d')](_0x523360);_0x2d6f44[_0x7e3e('0x1e')](0x0);logger['debug']('Limited\x20Query:',_0x2d6f44[_0x7e3e('0x83')]());return dbH[_0x7e3e('0x84')][_0x7e3e('0x35')](_0x2d6f44['toString'](),{'type':dbH['sequelize'][_0x7e3e('0x85')][_0x7e3e('0x86')]});}})[_0x7e3e('0x24')](respondWithResult(_0x277577,null))[_0x7e3e('0x49')](handleError(_0x277577,null));};function runReport(_0x5ac425,_0x3bb96d,_0x3ec1c2){var _0x31ff60=_0x3bb96d['name'];var _0x3a6056=0xa;var _0x57939b=['join','left_join','right_join',_0x7e3e('0x58')];var _0x111cd0={'SUM':_0x7e3e('0x59'),'COUNT':_0x7e3e('0x87'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7e3e('0x5a'),'MIN':_0x7e3e('0x5b'),'AVG':_0x7e3e('0x5c'),'GROUP_CONCAT':_0x7e3e('0x5d'),'GROUP_CONCAT ASC':_0x7e3e('0x5e'),'GROUP_CONCAT DESC':_0x7e3e('0x5f')};var _0x443439={'SEC_TO_TIME':_0x7e3e('0x60'),'DATE':'DATE(%s)','HOUR':_0x7e3e('0x62'),'ROUND':_0x7e3e('0x63'),'UNIX_TIMESTAMP':_0x7e3e('0x88')};var _0x2f7659=function(_0x11529c){return!_[_0x7e3e('0x64')]([_0x7e3e('0x65'),_0x7e3e('0x66'),'IS\x20EMPTY',_0x7e3e('0x67')],_0x11529c);};var _0x3c6988=function(_0x57bb00){if(!_0x57bb00||!_0x57bb00[_0x7e3e('0x68')]['length']){return'';}for(var _0x5a767e='(',_0x283f4f=0x0;_0x283f4f<_0x57bb00[_0x7e3e('0x68')][_0x7e3e('0x69')];_0x283f4f+=0x1){_0x283f4f>0x0&&(_0x5a767e+='\x20'+_0x57bb00[_0x7e3e('0x89')]+'\x20');_0x5a767e+=_0x57bb00[_0x7e3e('0x68')][_0x283f4f]['group']?_0x3c6988(_0x57bb00[_0x7e3e('0x68')][_0x283f4f]['group']):_0x57bb00[_0x7e3e('0x68')][_0x283f4f][_0x7e3e('0x74')]+'\x20'+_0x57bb00[_0x7e3e('0x68')][_0x283f4f][_0x7e3e('0x6b')]+(_0x2f7659(_0x57bb00[_0x7e3e('0x68')][_0x283f4f][_0x7e3e('0x6b')])?'\x20'+_0x57bb00[_0x7e3e('0x68')][_0x283f4f]['value']:'');}return _0x5a767e+')';};var _0xa1e13e={'where':{'id':_0x5ac425['id']}},_0x36df4b,_0x251633,_0x3f0eec,_0x3bc987,_0x3fc085;_0xa1e13e=_[_0x7e3e('0x42')]({},_0xa1e13e,_0x3ec1c2);return db[_0x7e3e('0x30')]['find'](_0xa1e13e)[_0x7e3e('0x24')](function(_0x44a558){if(_0x44a558){_0x36df4b=_0x44a558;return _0x44a558[_0x7e3e('0x8a')]();}return null;})[_0x7e3e('0x24')](function(_0x39bf5e){if(_0x39bf5e){if(!_0x39bf5e[_0x7e3e('0x69')]){throw new db[(_0x7e3e('0x8b'))][(_0x7e3e('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x251633=_0x39bf5e;return db['AnalyticMetric'][_0x7e3e('0x47')]({'raw':!![]});}return null;})[_0x7e3e('0x24')](function(_0x5492e6){if(_0x5492e6){_0x3f0eec=_[_0x7e3e('0x6f')](_0x5492e6,'id');var _0x10b209;var _0x3a91d4=squel[_0x7e3e('0x70')]();_0x3a91d4['from'](_0x36df4b[_0x7e3e('0x72')]);for(var _0x369ae4=0x0;_0x369ae4<_0x251633[_0x7e3e('0x69')];_0x369ae4+=0x1){_0x10b209=_0x251633[_0x369ae4]['MetricId']?_0x3f0eec[_0x251633[_0x369ae4][_0x7e3e('0x73')]][_0x7e3e('0x8c')]:_0x251633[_0x369ae4]['field'];_0x10b209=_0x251633[_0x369ae4][_0x7e3e('0x75')]?_[_0x7e3e('0x76')](_0x111cd0[_0x251633[_0x369ae4][_0x7e3e('0x75')]],'%s',_0x10b209):_0x10b209;_0x10b209=_0x251633[_0x369ae4][_0x7e3e('0x77')]?_['replace'](_0x443439[_0x251633[_0x369ae4]['format']],'%s',_0x10b209):_0x10b209;if(_0x251633[_0x369ae4]['groupBy']){_0x3a91d4[_0x7e3e('0x6a')](_0x10b209);}_0x251633[_0x369ae4][_0x7e3e('0x79')]&&_0x3a91d4['order'](_0x10b209,_0x251633[_0x369ae4]['orderBy']===_0x7e3e('0x8d')?![]:!![]);_0x3a91d4[_0x7e3e('0x74')](_0x10b209,_0x251633[_0x369ae4][_0x7e3e('0x7a')]||_0x10b209);}if(_0x36df4b[_0x7e3e('0x7b')]){_0x36df4b[_0x7e3e('0x7b')]=JSON[_0x7e3e('0x7c')](_0x36df4b['joins']);for(var _0x4fabcc=0x0;_0x4fabcc<_0x36df4b[_0x7e3e('0x7b')]['length'];_0x4fabcc+=0x1){if(_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x43')]&&_[_0x7e3e('0x64')](_0x57939b,_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x43')])&&_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x7d')]&&_0x36df4b['joins'][_0x4fabcc][_0x7e3e('0x7e')]&&_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x7f')]){_0x3a91d4[_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x43')]](_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x7e')],null,util['format'](_0x7e3e('0x80'),_0x36df4b[_0x7e3e('0x72')],_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x7d')],_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x7e')],_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x7f')]));}}}if(_0x36df4b[_0x7e3e('0x81')]){_0x36df4b['conditions']=JSON[_0x7e3e('0x7c')](_0x36df4b[_0x7e3e('0x81')]);_0x3a91d4[_0x7e3e('0x40')](_0x3c6988(_0x36df4b[_0x7e3e('0x81')][_0x7e3e('0x6a')]));}_0x3fc085=_0x3a91d4[_0x7e3e('0x82')]();_0x3a91d4[_0x7e3e('0x3d')](_0x3a6056);_0x3a91d4[_0x7e3e('0x1e')](0x0);return;}})[_0x7e3e('0x24')](function(){if(_0x3bb96d['output']===_0x7e3e('0x8e')){return null;}var _0xb76605=_[_0x7e3e('0x42')](_0x3bb96d,{'name':_0x3bb96d[_0x7e3e('0x8f')]||_0x3bb96d[_0x7e3e('0x2c')]||_0x36df4b[_0x7e3e('0x2c')],'basename':_0x31ff60,'savename':util[_0x7e3e('0x77')]('%s-%s.%s',_0x3bb96d[_0x7e3e('0x2c')]||_0x36df4b['name'],require(_0x7e3e('0x90'))[_0x7e3e('0x91')](0x4),_0x3bb96d[_0x7e3e('0x92')]||_0x7e3e('0x93')),'reportId':_0x36df4b['id'],'reportType':_0x7e3e('0x94')});return db[_0x7e3e('0x95')][_0x7e3e('0x4d')](_0xb76605,{'raw':!![]});})[_0x7e3e('0x24')](function(_0x49d1ac){if(_0x36df4b[_0x7e3e('0x72')]===_0x7e3e('0x96')){_0x3fc085['where'](_0x36df4b['table']+_0x7e3e('0x97'),_0x3bb96d[_0x7e3e('0x98')],_0x3bb96d['endDate']);}else{_0x3fc085[_0x7e3e('0x40')](_0x36df4b[_0x7e3e('0x72')]+_0x7e3e('0x99'),_0x3bb96d[_0x7e3e('0x98')],_0x3bb96d[_0x7e3e('0x9a')]);}if(_0x49d1ac){logger[_0x7e3e('0x9b')](_0x7e3e('0x9c'),_0x3fc085[_0x7e3e('0x83')]());require(_0x7e3e('0x9d'))[_0x7e3e('0x9e')](path[_0x7e3e('0x56')](__dirname,'../../components/export/',_0x49d1ac[_0x7e3e('0x92')]),[_0x49d1ac['id'],_0x3fc085[_0x7e3e('0x83')](),path[_0x7e3e('0x56')](__dirname,_0x7e3e('0x9f'),_0x49d1ac[_0x7e3e('0xa0')]),_0x31ff60]);return _0x49d1ac;}else{var _0x53ce02=squel[_0x7e3e('0x70')]();_0x53ce02[_0x7e3e('0x71')]('('+_0x3fc085[_0x7e3e('0x83')]()+')',_0x7e3e('0xa1'));_0x53ce02['field'](_0x7e3e('0xa2'),_0x7e3e('0x20'));_0x3fc085['limit'](_0x3bb96d[_0x7e3e('0x3d')]||_0x3a6056);_0x3fc085[_0x7e3e('0x1e')](_0x3bb96d['offset']||0x0);return dbH[_0x7e3e('0x84')][_0x7e3e('0x35')](_0x53ce02[_0x7e3e('0x83')](),{'type':dbH[_0x7e3e('0x84')][_0x7e3e('0x85')][_0x7e3e('0x86')]})[_0x7e3e('0x24')](function(_0x302003){if(!_0x302003['length']){_0x3bc987=0x0;}else{_0x3bc987=_0x302003[0x0][_0x7e3e('0x20')]||0x0;}return dbH[_0x7e3e('0x84')][_0x7e3e('0x35')](_0x3fc085[_0x7e3e('0x83')](),{'type':dbH[_0x7e3e('0x84')]['QueryTypes'][_0x7e3e('0x86')]});})[_0x7e3e('0x24')](function(_0x422aa7){return{'rows':_0x422aa7||[],'count':_0x3bc987};});}});}exports[_0x7e3e('0xa3')]=function(_0x31b506,_0x1d73a6){return runReport(_0x31b506[_0x7e3e('0x4a')],_0x31b506[_0x7e3e('0x35')],_0x31b506[_0x7e3e('0x45')])[_0x7e3e('0x24')](respondWithResult(_0x1d73a6,null))[_0x7e3e('0x49')](handleError(_0x1d73a6,null));};exports['runReport']=runReport;exports[_0x7e3e('0x35')]=function(_0x498fab,_0x1d5200){var _0x572f3f=0xa;var _0x29fe13=[_0x7e3e('0x56'),'left_join',_0x7e3e('0x57'),_0x7e3e('0x58')];var _0x370e92={'SUM':_0x7e3e('0x59'),'COUNT':_0x7e3e('0x87'),'COUNT DISTINCT':_0x7e3e('0xa4'),'MAX':_0x7e3e('0x5a'),'MIN':_0x7e3e('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x7e3e('0x5d'),'GROUP_CONCAT ASC':_0x7e3e('0x5e'),'GROUP_CONCAT DESC':_0x7e3e('0x5f')};var _0xc221f={'SEC_TO_TIME':_0x7e3e('0x60'),'DATE':_0x7e3e('0x61'),'HOUR':_0x7e3e('0x62'),'ROUND':_0x7e3e('0x63'),'UNIX_TIMESTAMP':_0x7e3e('0x88')};var _0x221511=function(_0x1020c6){return!_[_0x7e3e('0x64')]([_0x7e3e('0x65'),_0x7e3e('0x66'),_0x7e3e('0xa5'),_0x7e3e('0x67')],_0x1020c6);};var _0x53afe7=function(_0x32d65c){if(!_0x32d65c||!_0x32d65c['rules'][_0x7e3e('0x69')]){return'';}for(var _0x90fcd2='(',_0x48ed9e=0x0;_0x48ed9e<_0x32d65c[_0x7e3e('0x68')]['length'];_0x48ed9e+=0x1){_0x48ed9e>0x0&&(_0x90fcd2+='\x20'+_0x32d65c[_0x7e3e('0x89')]+'\x20');_0x90fcd2+=_0x32d65c['rules'][_0x48ed9e]['group']?_0x53afe7(_0x32d65c[_0x7e3e('0x68')][_0x48ed9e][_0x7e3e('0x6a')]):_0x32d65c[_0x7e3e('0x68')][_0x48ed9e][_0x7e3e('0x74')]+'\x20'+_0x32d65c[_0x7e3e('0x68')][_0x48ed9e][_0x7e3e('0x6b')]+(_0x221511(_0x32d65c['rules'][_0x48ed9e][_0x7e3e('0x6b')])?'\x20'+_0x32d65c['rules'][_0x48ed9e]['value']:'');}return _0x90fcd2+')';};var _0x460b07={'where':{'id':_0x498fab[_0x7e3e('0x4a')]['id']}},_0x17f769,_0x27b1a8,_0x14b123,_0x238495,_0x1dd59e;_0x460b07=_[_0x7e3e('0x42')]({},_0x460b07,_0x498fab[_0x7e3e('0x45')]);return db[_0x7e3e('0x30')][_0x7e3e('0x4c')](_0x460b07)[_0x7e3e('0x24')](function(_0x2edc81){if(_0x2edc81){_0x17f769=_0x2edc81;return _0x2edc81[_0x7e3e('0x8a')]();}return null;})['then'](function(_0x280031){if(_0x280031){if(!_0x280031[_0x7e3e('0x69')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x27b1a8=_0x280031;return db[_0x7e3e('0x6e')]['findAll']({'raw':!![]});}return null;})[_0x7e3e('0x24')](function(_0x4dc56e){if(_0x4dc56e){_0x14b123=_['keyBy'](_0x4dc56e,'id');var _0x26133f;var _0x492aaa=squel[_0x7e3e('0x70')]();_0x492aaa['from'](_0x17f769[_0x7e3e('0x72')]);for(var _0xf21490=0x0;_0xf21490<_0x27b1a8[_0x7e3e('0x69')];_0xf21490+=0x1){_0x26133f=_0x27b1a8[_0xf21490][_0x7e3e('0x73')]?_0x14b123[_0x27b1a8[_0xf21490][_0x7e3e('0x73')]][_0x7e3e('0x8c')]:_0x27b1a8[_0xf21490][_0x7e3e('0x74')];_0x26133f=_0x27b1a8[_0xf21490]['function']?_[_0x7e3e('0x76')](_0x370e92[_0x27b1a8[_0xf21490][_0x7e3e('0x75')]],'%s',_0x26133f):_0x26133f;_0x26133f=_0x27b1a8[_0xf21490]['format']?_[_0x7e3e('0x76')](_0xc221f[_0x27b1a8[_0xf21490]['format']],'%s',_0x26133f):_0x26133f;if(_0x27b1a8[_0xf21490][_0x7e3e('0x78')]){_0x492aaa[_0x7e3e('0x6a')](_0x26133f);}_0x27b1a8[_0xf21490][_0x7e3e('0x79')]&&_0x492aaa['order'](_0x26133f,_0x27b1a8[_0xf21490][_0x7e3e('0x79')]===_0x7e3e('0x8d')?![]:!![]);_0x492aaa[_0x7e3e('0x74')](_0x26133f,_0x27b1a8[_0xf21490][_0x7e3e('0x7a')]||_0x26133f);}if(_0x17f769[_0x7e3e('0x7b')]){_0x17f769[_0x7e3e('0x7b')]=JSON[_0x7e3e('0x7c')](_0x17f769[_0x7e3e('0x7b')]);for(var _0x123e20=0x0;_0x123e20<_0x17f769['joins']['length'];_0x123e20+=0x1){if(_0x17f769['joins'][_0x123e20][_0x7e3e('0x43')]&&_['includes'](_0x29fe13,_0x17f769['joins'][_0x123e20][_0x7e3e('0x43')])&&_0x17f769[_0x7e3e('0x7b')][_0x123e20][_0x7e3e('0x7d')]&&_0x17f769[_0x7e3e('0x7b')][_0x123e20][_0x7e3e('0x7e')]&&_0x17f769['joins'][_0x123e20][_0x7e3e('0x7f')]){_0x492aaa[_0x17f769[_0x7e3e('0x7b')][_0x123e20][_0x7e3e('0x43')]](_0x17f769[_0x7e3e('0x7b')][_0x123e20]['foreignTable'],null,util[_0x7e3e('0x77')](_0x7e3e('0x80'),_0x17f769[_0x7e3e('0x72')],_0x17f769[_0x7e3e('0x7b')][_0x123e20][_0x7e3e('0x7d')],_0x17f769[_0x7e3e('0x7b')][_0x123e20]['foreignTable'],_0x17f769[_0x7e3e('0x7b')][_0x123e20][_0x7e3e('0x7f')]));}}}if(_0x17f769[_0x7e3e('0x81')]){_0x17f769[_0x7e3e('0x81')]=JSON['parse'](_0x17f769['conditions']);_0x492aaa[_0x7e3e('0x40')](_0x53afe7(_0x17f769[_0x7e3e('0x81')][_0x7e3e('0x6a')]));}_0x1dd59e=_0x492aaa[_0x7e3e('0x82')]();_0x492aaa[_0x7e3e('0x3d')](_0x572f3f);_0x492aaa['offset'](0x0);logger['debug']('Limited\x20Query:',_0x492aaa[_0x7e3e('0x83')]());return dbH[_0x7e3e('0x84')][_0x7e3e('0x35')](_0x492aaa[_0x7e3e('0x83')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})[_0x7e3e('0x24')](function(){return{'sql':_0x1dd59e[_0x7e3e('0x83')]()};})[_0x7e3e('0x24')](respondWithResult(_0x1d5200,null))[_0x7e3e('0x49')](handleError(_0x1d5200,null));};
\ No newline at end of file
+var _0xe45c=['order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','autoAssociation','CustomReports','error','body','preview','join','left_join','right_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','cross_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NULL','getFields','Please\x20insert\x20at\x20least\x20one\x20field','select','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','run','runReport','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','end','status','json','offset','limit','count','set','Content-Range','update','then','destroy','get','UserProfileResource','sendStatus','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty'];(function(_0x449b54,_0x3776f3){var _0x32d6b9=function(_0xbce7c4){while(--_0xbce7c4){_0x449b54['push'](_0x449b54['shift']());}};_0x32d6b9(++_0x3776f3);}(_0xe45c,0x6d));var _0xce45=function(_0x4c6a2e,_0xd6b681){_0x4c6a2e=_0x4c6a2e-0x0;var _0x1e5a1a=_0xe45c[_0x4c6a2e];return _0x1e5a1a;};'use strict';var emlformat=require(_0xce45('0x0'));var rimraf=require(_0xce45('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xce45('0x2'));var rp=require(_0xce45('0x3'));var moment=require(_0xce45('0x4'));var BPromise=require(_0xce45('0x5'));var Mustache=require(_0xce45('0x6'));var util=require(_0xce45('0x7'));var path=require(_0xce45('0x8'));var sox=require(_0xce45('0x9'));var csv=require(_0xce45('0xa'));var ejs=require(_0xce45('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce45('0xc'));var squel=require(_0xce45('0xd'));var crypto=require(_0xce45('0xe'));var jsforce=require(_0xce45('0xf'));var deskjs=require(_0xce45('0x10'));var toCsv=require(_0xce45('0xa'));var querystring=require(_0xce45('0x11'));var Papa=require(_0xce45('0x12'));var Redis=require(_0xce45('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xce45('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce45('0x15'));var logger=require('../../config/logger')(_0xce45('0x16'));var utils=require(_0xce45('0x17'));var config=require(_0xce45('0x18'));var licenseUtil=require(_0xce45('0x19'));var db=require('../../mysqldb')['db'];var dbH=require(_0xce45('0x1a'))[_0xce45('0x1b')];function respondWithStatusCode(_0x3846bf,_0x5f5917){_0x5f5917=_0x5f5917||0xcc;return function(_0x2798ed){if(_0x2798ed){return _0x3846bf['sendStatus'](_0x5f5917);}return _0x3846bf['status'](_0x5f5917)[_0xce45('0x1c')]();};}function respondWithResult(_0x3dac2a,_0x44dbca){_0x44dbca=_0x44dbca||0xc8;return function(_0xb90750){if(_0xb90750){return _0x3dac2a[_0xce45('0x1d')](_0x44dbca)[_0xce45('0x1e')](_0xb90750);}};}function respondWithFilteredResult(_0x4906f8,_0x34e196){return function(_0xdef3cc){if(_0xdef3cc){var _0x318037=typeof _0x34e196[_0xce45('0x1f')]==='undefined'&&typeof _0x34e196[_0xce45('0x20')]==='undefined';var _0x263393=_0xdef3cc[_0xce45('0x21')];var _0x358c7e=_0x318037?0x0:_0x34e196['offset'];var _0x2fad74=_0x318037?_0xdef3cc[_0xce45('0x21')]:_0x34e196[_0xce45('0x1f')]+_0x34e196[_0xce45('0x20')];var _0x4a24eb;if(_0x2fad74>=_0x263393){_0x2fad74=_0x263393;_0x4a24eb=0xc8;}else{_0x4a24eb=0xce;}_0x4906f8[_0xce45('0x1d')](_0x4a24eb);return _0x4906f8[_0xce45('0x22')](_0xce45('0x23'),_0x358c7e+'-'+_0x2fad74+'/'+_0x263393)['json'](_0xdef3cc);}return null;};}function patchUpdates(_0x3dbdc4){return function(_0x1700f9){try{jsonpatch['apply'](_0x1700f9,_0x3dbdc4,!![]);}catch(_0x523044){return BPromise['reject'](_0x523044);}return _0x1700f9['save']();};}function saveUpdates(_0x35a6bb,_0x1d73d9){return function(_0x24deb6){if(_0x24deb6){return _0x24deb6[_0xce45('0x24')](_0x35a6bb)[_0xce45('0x25')](function(_0x135dae){return _0x135dae;});}return null;};}function removeEntity(_0x60a333,_0x3af291){return function(_0x509795){if(_0x509795){return _0x509795[_0xce45('0x26')]()[_0xce45('0x25')](function(){var _0xc84907=_0x509795[_0xce45('0x27')]({'plain':!![]});var _0x311e8b='CustomReports';return db[_0xce45('0x28')][_0xce45('0x26')]({'where':{'type':_0x311e8b,'resourceId':_0xc84907['id']}})['then'](function(){return _0x509795;});})[_0xce45('0x25')](function(){_0x60a333[_0xce45('0x1d')](0xcc)[_0xce45('0x1c')]();});}};}function handleEntityNotFound(_0x3d0b4f,_0x46cb73){return function(_0x6b4121){if(!_0x6b4121){_0x3d0b4f[_0xce45('0x29')](0x194);}return _0x6b4121;};}function handleError(_0x190ee6,_0x2ccff1){_0x2ccff1=_0x2ccff1||0x1f4;return function(_0x4535ed){logger['error'](_0x4535ed['stack']);if(_0x4535ed[_0xce45('0x2a')]){delete _0x4535ed[_0xce45('0x2a')];}_0x190ee6['status'](_0x2ccff1)['send'](_0x4535ed);};}exports[_0xce45('0x2b')]=function(_0x3ca283,_0x97d1d4){var _0x4d43bf={},_0x3c0a77={},_0x54397c={'count':0x0,'rows':[]};var _0x19612d=_[_0xce45('0x2c')](db[_0xce45('0x2d')][_0xce45('0x2e')],function(_0x1db44d){return{'name':_0x1db44d[_0xce45('0x2f')],'type':_0x1db44d[_0xce45('0x30')][_0xce45('0x31')]};});_0x3c0a77['model']=_[_0xce45('0x2c')](_0x19612d,_0xce45('0x2a'));_0x3c0a77[_0xce45('0x32')]=_[_0xce45('0x33')](_0x3ca283['query']);_0x3c0a77['filters']=_[_0xce45('0x34')](_0x3c0a77[_0xce45('0x35')],_0x3c0a77[_0xce45('0x32')]);_0x4d43bf['attributes']=_[_0xce45('0x34')](_0x3c0a77[_0xce45('0x35')],qs['fields'](_0x3ca283['query'][_0xce45('0x36')]));_0x4d43bf[_0xce45('0x37')]=_0x4d43bf[_0xce45('0x37')][_0xce45('0x38')]?_0x4d43bf[_0xce45('0x37')]:_0x3c0a77['model'];if(!_0x3ca283[_0xce45('0x32')][_0xce45('0x39')]('nolimit')){_0x4d43bf[_0xce45('0x20')]=qs[_0xce45('0x20')](_0x3ca283[_0xce45('0x32')][_0xce45('0x20')]);_0x4d43bf[_0xce45('0x1f')]=qs[_0xce45('0x1f')](_0x3ca283[_0xce45('0x32')][_0xce45('0x1f')]);}_0x4d43bf[_0xce45('0x3a')]=qs[_0xce45('0x3b')](_0x3ca283[_0xce45('0x32')][_0xce45('0x3b')]);_0x4d43bf[_0xce45('0x3c')]=qs[_0xce45('0x3d')](_['pick'](_0x3ca283['query'],_0x3c0a77['filters']),_0x19612d);if(_0x3ca283[_0xce45('0x32')][_0xce45('0x3e')]){_0x4d43bf[_0xce45('0x3c')]=_['merge'](_0x4d43bf[_0xce45('0x3c')],{'$or':_[_0xce45('0x2c')](_0x19612d,function(_0x345267){if(_0x345267[_0xce45('0x30')]!==_0xce45('0x3f')){var _0x2d73dd={};_0x2d73dd[_0x345267[_0xce45('0x2a')]]={'$like':'%'+_0x3ca283[_0xce45('0x32')][_0xce45('0x3e')]+'%'};return _0x2d73dd;}})});}_0x4d43bf=_[_0xce45('0x40')]({},_0x4d43bf,_0x3ca283[_0xce45('0x41')]);var _0x1532c8={'where':_0x4d43bf[_0xce45('0x3c')]};return db['AnalyticCustomReport'][_0xce45('0x21')](_0x1532c8)[_0xce45('0x25')](function(_0x431112){_0x54397c[_0xce45('0x21')]=_0x431112;if(_0x3ca283[_0xce45('0x32')][_0xce45('0x42')]){_0x4d43bf[_0xce45('0x43')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xce45('0x44')](_0x4d43bf);})[_0xce45('0x25')](function(_0x5eb2b8){_0x54397c[_0xce45('0x45')]=_0x5eb2b8;return _0x54397c;})[_0xce45('0x25')](respondWithFilteredResult(_0x97d1d4,_0x4d43bf))['catch'](handleError(_0x97d1d4,null));};exports['show']=function(_0x5cd778,_0x484b8f){var _0x4326d2={'raw':![],'where':{'id':_0x5cd778[_0xce45('0x46')]['id']}},_0x246df6={};_0x246df6[_0xce45('0x35')]=_[_0xce45('0x33')](db[_0xce45('0x2d')][_0xce45('0x2e')]);_0x246df6[_0xce45('0x32')]=_[_0xce45('0x33')](_0x5cd778[_0xce45('0x32')]);_0x246df6[_0xce45('0x3d')]=_[_0xce45('0x34')](_0x246df6[_0xce45('0x35')],_0x246df6['query']);_0x4326d2['attributes']=_[_0xce45('0x34')](_0x246df6['model'],qs['fields'](_0x5cd778['query'][_0xce45('0x36')]));_0x4326d2[_0xce45('0x37')]=_0x4326d2['attributes'][_0xce45('0x38')]?_0x4326d2[_0xce45('0x37')]:_0x246df6[_0xce45('0x35')];if(_0x5cd778[_0xce45('0x32')][_0xce45('0x42')]){_0x4326d2['include']=[{'all':!![]}];}_0x4326d2=_['merge']({},_0x4326d2,_0x5cd778[_0xce45('0x41')]);return db[_0xce45('0x2d')]['find'](_0x4326d2)[_0xce45('0x25')](handleEntityNotFound(_0x484b8f,null))['then'](respondWithResult(_0x484b8f,null))[_0xce45('0x47')](handleError(_0x484b8f,null));};exports[_0xce45('0x48')]=function(_0x346f71,_0x5c6688){return db[_0xce45('0x2d')][_0xce45('0x48')](_0x346f71['body'],{})[_0xce45('0x25')](function(_0x221d89){var _0x573771=_0x346f71[_0xce45('0x49')][_0xce45('0x27')]({'plain':!![]});if(!_0x573771)throw new Error(_0xce45('0x4a'));if(_0x573771[_0xce45('0x4b')]==='user'){var _0x648320=_0x221d89[_0xce45('0x27')]({'plain':!![]});var _0x5c3663=_0xce45('0x4c');return db['UserProfileSection'][_0xce45('0x4d')]({'where':{'name':_0x5c3663,'userProfileId':_0x573771[_0xce45('0x4e')]},'raw':!![]})[_0xce45('0x25')](function(_0x72df){if(_0x72df&&_0x72df[_0xce45('0x4f')]===0x0){return db[_0xce45('0x28')][_0xce45('0x48')]({'name':_0x648320[_0xce45('0x2a')],'resourceId':_0x648320['id'],'type':_0xce45('0x50'),'sectionId':_0x72df['id']},{})[_0xce45('0x25')](function(){return _0x221d89;});}else{return _0x221d89;}})[_0xce45('0x47')](function(_0x35cc5a){logger[_0xce45('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35cc5a);throw _0x35cc5a;});}return _0x221d89;})[_0xce45('0x25')](respondWithResult(_0x5c6688,0xc9))[_0xce45('0x47')](handleError(_0x5c6688,null));};exports[_0xce45('0x24')]=function(_0x221c46,_0x432a84){if(_0x221c46['body']['id']){delete _0x221c46[_0xce45('0x52')]['id'];}return db[_0xce45('0x2d')][_0xce45('0x4d')]({'where':{'id':_0x221c46[_0xce45('0x46')]['id']}})[_0xce45('0x25')](handleEntityNotFound(_0x432a84,null))['then'](saveUpdates(_0x221c46[_0xce45('0x52')],null))[_0xce45('0x25')](respondWithResult(_0x432a84,null))[_0xce45('0x47')](handleError(_0x432a84,null));};exports['destroy']=function(_0x4e5a05,_0x599bdd){return db[_0xce45('0x2d')][_0xce45('0x4d')]({'where':{'id':_0x4e5a05[_0xce45('0x46')]['id']}})['then'](handleEntityNotFound(_0x599bdd,null))[_0xce45('0x25')](removeEntity(_0x599bdd,null))['catch'](handleError(_0x599bdd,null));};exports[_0xce45('0x53')]=function(_0x51f925,_0x2f6356){var _0x3e3ab6=0xa;var _0x49c032=[_0xce45('0x54'),_0xce45('0x55'),_0xce45('0x56'),'cross_join'];var _0x312ca7={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xce45('0x57'),'MAX':_0xce45('0x58'),'MIN':_0xce45('0x59'),'AVG':_0xce45('0x5a'),'GROUP_CONCAT':_0xce45('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4be7c2={'SEC_TO_TIME':_0xce45('0x5c'),'DATE':_0xce45('0x5d'),'HOUR':_0xce45('0x5e'),'ROUND':_0xce45('0x5f'),'UNIX_TIMESTAMP':_0xce45('0x60')};var _0x36bd68=function(_0x1ebcd1){return!_[_0xce45('0x61')](['IS\x20NULL',_0xce45('0x62'),_0xce45('0x63'),_0xce45('0x64')],_0x1ebcd1);};var _0x2f03d3=function(_0x537807){if(!_0x537807||!_0x537807['rules'][_0xce45('0x38')]){return'';}for(var _0x27a925='(',_0x2f885c=0x0;_0x2f885c<_0x537807['rules'][_0xce45('0x38')];_0x2f885c+=0x1){_0x2f885c>0x0&&(_0x27a925+='\x20'+_0x537807[_0xce45('0x65')]+'\x20');_0x27a925+=_0x537807['rules'][_0x2f885c]['group']?_0x2f03d3(_0x537807[_0xce45('0x66')][_0x2f885c][_0xce45('0x67')]):_0x537807['rules'][_0x2f885c][_0xce45('0x68')]+'\x20'+_0x537807[_0xce45('0x66')][_0x2f885c][_0xce45('0x69')]+(_0x36bd68(_0x537807[_0xce45('0x66')][_0x2f885c][_0xce45('0x69')])?'\x20'+_0x537807[_0xce45('0x66')][_0x2f885c][_0xce45('0x6a')]:'');}return _0x27a925+')';};var _0x4c4d63={'where':{'id':_0x51f925[_0xce45('0x46')]['id']}},_0x3e8f22,_0x460871,_0x411342,_0x1dbe16,_0x3ba720;_0x4c4d63=_[_0xce45('0x40')]({},_0x4c4d63,_0x51f925[_0xce45('0x41')]);return db[_0xce45('0x2d')][_0xce45('0x4d')](_0x4c4d63)[_0xce45('0x25')](function(_0x5c484a){if(_0x5c484a){_0x3e8f22=_0x5c484a;return _0x5c484a['getFields']();}return null;})[_0xce45('0x25')](function(_0x1e501e){if(_0x1e501e){if(!_0x1e501e[_0xce45('0x38')]){throw new db[(_0xce45('0x6b'))][(_0xce45('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x460871=_0x1e501e;return db[_0xce45('0x6d')][_0xce45('0x44')]({'raw':!![]});}return null;})['then'](function(_0x49c1d4){if(_0x49c1d4){_0x411342=_[_0xce45('0x6e')](_0x49c1d4,'id');var _0x2eb198;var _0x58eb10=squel['select']();_0x58eb10[_0xce45('0x6f')](_0x3e8f22[_0xce45('0x70')]);for(var _0x1dddd2=0x0;_0x1dddd2<_0x460871[_0xce45('0x38')];_0x1dddd2+=0x1){_0x2eb198=_0x460871[_0x1dddd2][_0xce45('0x71')]?_0x411342[_0x460871[_0x1dddd2][_0xce45('0x71')]][_0xce45('0x72')]:_0x460871[_0x1dddd2]['field'];_0x2eb198=_0x460871[_0x1dddd2][_0xce45('0x73')]?_['replace'](_0x312ca7[_0x460871[_0x1dddd2]['function']],'%s',_0x2eb198):_0x2eb198;_0x2eb198=_0x460871[_0x1dddd2][_0xce45('0x74')]?_[_0xce45('0x75')](_0x4be7c2[_0x460871[_0x1dddd2][_0xce45('0x74')]],'%s',_0x2eb198):_0x2eb198;if(_0x460871[_0x1dddd2][_0xce45('0x76')]){_0x58eb10[_0xce45('0x67')](_0x2eb198);}_0x460871[_0x1dddd2][_0xce45('0x77')]&&_0x58eb10[_0xce45('0x3a')](_0x2eb198,_0x460871[_0x1dddd2][_0xce45('0x77')]===_0xce45('0x78')?![]:!![]);_0x58eb10[_0xce45('0x68')](_0x2eb198,_0x460871[_0x1dddd2][_0xce45('0x79')]||_0x2eb198);}if(_0x3e8f22[_0xce45('0x7a')]){_0x3e8f22['joins']=JSON[_0xce45('0x7b')](_0x3e8f22[_0xce45('0x7a')]);for(var _0x22c67a=0x0;_0x22c67a<_0x3e8f22[_0xce45('0x7a')][_0xce45('0x38')];_0x22c67a+=0x1){if(_0x3e8f22['joins'][_0x22c67a]['type']&&_['includes'](_0x49c032,_0x3e8f22[_0xce45('0x7a')][_0x22c67a][_0xce45('0x30')])&&_0x3e8f22[_0xce45('0x7a')][_0x22c67a][_0xce45('0x7c')]&&_0x3e8f22['joins'][_0x22c67a][_0xce45('0x7d')]&&_0x3e8f22[_0xce45('0x7a')][_0x22c67a][_0xce45('0x7e')]){_0x58eb10[_0x3e8f22[_0xce45('0x7a')][_0x22c67a][_0xce45('0x30')]](_0x3e8f22[_0xce45('0x7a')][_0x22c67a][_0xce45('0x7d')],null,util[_0xce45('0x74')]('%s.%s\x20=\x20%s.%s',_0x3e8f22[_0xce45('0x70')],_0x3e8f22[_0xce45('0x7a')][_0x22c67a][_0xce45('0x7c')],_0x3e8f22[_0xce45('0x7a')][_0x22c67a][_0xce45('0x7d')],_0x3e8f22[_0xce45('0x7a')][_0x22c67a][_0xce45('0x7e')]));}}}if(_0x3e8f22['conditions']){_0x3e8f22[_0xce45('0x7f')]=JSON[_0xce45('0x7b')](_0x3e8f22[_0xce45('0x7f')]);_0x58eb10[_0xce45('0x3c')](_0x2f03d3(_0x3e8f22[_0xce45('0x7f')][_0xce45('0x67')]));}_0x3ba720=_0x58eb10[_0xce45('0x80')]();_0x58eb10[_0xce45('0x20')](_0x3e3ab6);_0x58eb10[_0xce45('0x1f')](0x0);logger[_0xce45('0x81')](_0xce45('0x82'),_0x58eb10[_0xce45('0x83')]());return dbH[_0xce45('0x84')][_0xce45('0x32')](_0x58eb10[_0xce45('0x83')](),{'type':dbH[_0xce45('0x84')]['QueryTypes'][_0xce45('0x85')]});}})['then'](respondWithResult(_0x2f6356,null))['catch'](handleError(_0x2f6356,null));};function runReport(_0x307a85,_0x1b868f,_0x381b90){var _0x1d4abb=_0x1b868f[_0xce45('0x2a')];var _0x5b02ed=0xa;var _0x4e8899=[_0xce45('0x54'),_0xce45('0x55'),_0xce45('0x56'),_0xce45('0x86')];var _0x3dc50e={'SUM':_0xce45('0x87'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xce45('0x58'),'MIN':_0xce45('0x59'),'AVG':_0xce45('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xce45('0x88'),'GROUP_CONCAT DESC':_0xce45('0x89')};var _0x3c88e8={'SEC_TO_TIME':_0xce45('0x5c'),'DATE':_0xce45('0x5d'),'HOUR':_0xce45('0x5e'),'ROUND':_0xce45('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x38e72a=function(_0x127ddf){return!_[_0xce45('0x61')]([_0xce45('0x8a'),_0xce45('0x62'),_0xce45('0x63'),'IS\x20NOT\x20EMPTY'],_0x127ddf);};var _0x40ed47=function(_0x2ac7d0){if(!_0x2ac7d0||!_0x2ac7d0['rules']['length']){return'';}for(var _0x478c5b='(',_0x1cb6c8=0x0;_0x1cb6c8<_0x2ac7d0['rules'][_0xce45('0x38')];_0x1cb6c8+=0x1){_0x1cb6c8>0x0&&(_0x478c5b+='\x20'+_0x2ac7d0[_0xce45('0x65')]+'\x20');_0x478c5b+=_0x2ac7d0[_0xce45('0x66')][_0x1cb6c8][_0xce45('0x67')]?_0x40ed47(_0x2ac7d0['rules'][_0x1cb6c8][_0xce45('0x67')]):_0x2ac7d0['rules'][_0x1cb6c8][_0xce45('0x68')]+'\x20'+_0x2ac7d0[_0xce45('0x66')][_0x1cb6c8][_0xce45('0x69')]+(_0x38e72a(_0x2ac7d0[_0xce45('0x66')][_0x1cb6c8][_0xce45('0x69')])?'\x20'+_0x2ac7d0['rules'][_0x1cb6c8]['value']:'');}return _0x478c5b+')';};var _0x3f41f7={'where':{'id':_0x307a85['id']}},_0x40e72a,_0x5c4b16,_0x4bbb2e,_0x4d9a76,_0x53718d;_0x3f41f7=_[_0xce45('0x40')]({},_0x3f41f7,_0x381b90);return db[_0xce45('0x2d')]['find'](_0x3f41f7)[_0xce45('0x25')](function(_0x5c7787){if(_0x5c7787){_0x40e72a=_0x5c7787;return _0x5c7787[_0xce45('0x8b')]();}return null;})[_0xce45('0x25')](function(_0x3abd3e){if(_0x3abd3e){if(!_0x3abd3e[_0xce45('0x38')]){throw new db[(_0xce45('0x6b'))][(_0xce45('0x6c'))](_0xce45('0x8c'),0x193);}_0x5c4b16=_0x3abd3e;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xce45('0x25')](function(_0x116389){if(_0x116389){_0x4bbb2e=_[_0xce45('0x6e')](_0x116389,'id');var _0x1f2020;var _0x1f48eb=squel[_0xce45('0x8d')]();_0x1f48eb[_0xce45('0x6f')](_0x40e72a[_0xce45('0x70')]);for(var _0x4bfcf8=0x0;_0x4bfcf8<_0x5c4b16[_0xce45('0x38')];_0x4bfcf8+=0x1){_0x1f2020=_0x5c4b16[_0x4bfcf8][_0xce45('0x71')]?_0x4bbb2e[_0x5c4b16[_0x4bfcf8][_0xce45('0x71')]]['metric']:_0x5c4b16[_0x4bfcf8][_0xce45('0x68')];_0x1f2020=_0x5c4b16[_0x4bfcf8]['function']?_['replace'](_0x3dc50e[_0x5c4b16[_0x4bfcf8][_0xce45('0x73')]],'%s',_0x1f2020):_0x1f2020;_0x1f2020=_0x5c4b16[_0x4bfcf8][_0xce45('0x74')]?_['replace'](_0x3c88e8[_0x5c4b16[_0x4bfcf8][_0xce45('0x74')]],'%s',_0x1f2020):_0x1f2020;if(_0x5c4b16[_0x4bfcf8][_0xce45('0x76')]){_0x1f48eb['group'](_0x1f2020);}_0x5c4b16[_0x4bfcf8][_0xce45('0x77')]&&_0x1f48eb[_0xce45('0x3a')](_0x1f2020,_0x5c4b16[_0x4bfcf8][_0xce45('0x77')]===_0xce45('0x78')?![]:!![]);_0x1f48eb[_0xce45('0x68')](_0x1f2020,_0x5c4b16[_0x4bfcf8]['alias']||_0x1f2020);}if(_0x40e72a[_0xce45('0x7a')]){_0x40e72a[_0xce45('0x7a')]=JSON[_0xce45('0x7b')](_0x40e72a[_0xce45('0x7a')]);for(var _0x4a06aa=0x0;_0x4a06aa<_0x40e72a[_0xce45('0x7a')][_0xce45('0x38')];_0x4a06aa+=0x1){if(_0x40e72a[_0xce45('0x7a')][_0x4a06aa][_0xce45('0x30')]&&_[_0xce45('0x61')](_0x4e8899,_0x40e72a[_0xce45('0x7a')][_0x4a06aa][_0xce45('0x30')])&&_0x40e72a[_0xce45('0x7a')][_0x4a06aa][_0xce45('0x7c')]&&_0x40e72a[_0xce45('0x7a')][_0x4a06aa]['foreignTable']&&_0x40e72a[_0xce45('0x7a')][_0x4a06aa][_0xce45('0x7e')]){_0x1f48eb[_0x40e72a['joins'][_0x4a06aa][_0xce45('0x30')]](_0x40e72a[_0xce45('0x7a')][_0x4a06aa][_0xce45('0x7d')],null,util[_0xce45('0x74')](_0xce45('0x8e'),_0x40e72a[_0xce45('0x70')],_0x40e72a[_0xce45('0x7a')][_0x4a06aa]['parentKey'],_0x40e72a['joins'][_0x4a06aa][_0xce45('0x7d')],_0x40e72a[_0xce45('0x7a')][_0x4a06aa]['foreignKey']));}}}if(_0x40e72a[_0xce45('0x7f')]){_0x40e72a['conditions']=JSON['parse'](_0x40e72a[_0xce45('0x7f')]);_0x1f48eb[_0xce45('0x3c')](_0x40ed47(_0x40e72a[_0xce45('0x7f')][_0xce45('0x67')]));}_0x53718d=_0x1f48eb[_0xce45('0x80')]();_0x1f48eb[_0xce45('0x20')](_0x5b02ed);_0x1f48eb[_0xce45('0x1f')](0x0);return;}})[_0xce45('0x25')](function(){if(_0x1b868f[_0xce45('0x8f')]===_0xce45('0x90')){return null;}var _0x543227=_[_0xce45('0x40')](_0x1b868f,{'name':_0x1b868f[_0xce45('0x91')]||_0x1b868f[_0xce45('0x2a')]||_0x40e72a[_0xce45('0x2a')],'basename':_0x1d4abb,'savename':util[_0xce45('0x74')](_0xce45('0x92'),_0x1b868f[_0xce45('0x2a')]||_0x40e72a[_0xce45('0x2a')],require('randomstring')[_0xce45('0x93')](0x4),_0x1b868f['output']||_0xce45('0x94')),'reportId':_0x40e72a['id'],'reportType':_0xce45('0x95')});return db[_0xce45('0x96')][_0xce45('0x48')](_0x543227,{'raw':!![]});})[_0xce45('0x25')](function(_0x30476e){if(_0x40e72a[_0xce45('0x70')]===_0xce45('0x97')){_0x53718d[_0xce45('0x3c')](_0x40e72a[_0xce45('0x70')]+_0xce45('0x98'),_0x1b868f[_0xce45('0x99')],_0x1b868f[_0xce45('0x9a')]);}else{_0x53718d[_0xce45('0x3c')](_0x40e72a[_0xce45('0x70')]+_0xce45('0x9b'),_0x1b868f[_0xce45('0x99')],_0x1b868f[_0xce45('0x9a')]);}if(_0x30476e){logger[_0xce45('0x9c')](_0xce45('0x9d'),_0x53718d['toString']());require(_0xce45('0x9e'))[_0xce45('0x9f')](path[_0xce45('0x54')](__dirname,_0xce45('0xa0'),_0x30476e[_0xce45('0x8f')]),[_0x30476e['id'],_0x53718d[_0xce45('0x83')](),path[_0xce45('0x54')](__dirname,_0xce45('0xa1'),_0x30476e['savename']),_0x1d4abb]);return _0x30476e;}else{var _0xa977cb=squel['select']();_0xa977cb[_0xce45('0x6f')]('('+_0x53718d[_0xce45('0x83')]()+')',_0xce45('0xa2'));_0xa977cb[_0xce45('0x68')](_0xce45('0xa3'),_0xce45('0x21'));_0x53718d['limit'](_0x1b868f[_0xce45('0x20')]||_0x5b02ed);_0x53718d[_0xce45('0x1f')](_0x1b868f[_0xce45('0x1f')]||0x0);return dbH['sequelize'][_0xce45('0x32')](_0xa977cb[_0xce45('0x83')](),{'type':dbH[_0xce45('0x84')][_0xce45('0xa4')][_0xce45('0x85')]})[_0xce45('0x25')](function(_0x5584b5){if(!_0x5584b5[_0xce45('0x38')]){_0x4d9a76=0x0;}else{_0x4d9a76=_0x5584b5[0x0][_0xce45('0x21')]||0x0;}return dbH[_0xce45('0x84')][_0xce45('0x32')](_0x53718d[_0xce45('0x83')](),{'type':dbH[_0xce45('0x84')][_0xce45('0xa4')][_0xce45('0x85')]});})[_0xce45('0x25')](function(_0x5afae9){return{'rows':_0x5afae9||[],'count':_0x4d9a76};});}});}exports[_0xce45('0xa5')]=function(_0x26719e,_0x4405c0){return runReport(_0x26719e[_0xce45('0x46')],_0x26719e[_0xce45('0x32')],_0x26719e['options'])['then'](respondWithResult(_0x4405c0,null))[_0xce45('0x47')](handleError(_0x4405c0,null));};exports[_0xce45('0xa6')]=runReport;exports[_0xce45('0x32')]=function(_0x2f8ee5,_0x2a31d2){var _0xeaff6c=0xa;var _0x5d3f41=['join',_0xce45('0x55'),_0xce45('0x56'),_0xce45('0x86')];var _0x319098={'SUM':_0xce45('0x87'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xce45('0x58'),'MIN':'MIN(%s)','AVG':_0xce45('0x5a'),'GROUP_CONCAT':_0xce45('0x5b'),'GROUP_CONCAT ASC':_0xce45('0x88'),'GROUP_CONCAT DESC':_0xce45('0x89')};var _0x13f789={'SEC_TO_TIME':_0xce45('0x5c'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xce45('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x26516e=function(_0x179126){return!_[_0xce45('0x61')]([_0xce45('0x8a'),'IS\x20NOT\x20NULL',_0xce45('0x63'),_0xce45('0x64')],_0x179126);};var _0x1e875b=function(_0x29846f){if(!_0x29846f||!_0x29846f['rules'][_0xce45('0x38')]){return'';}for(var _0x53a96c='(',_0x913fd2=0x0;_0x913fd2<_0x29846f['rules'][_0xce45('0x38')];_0x913fd2+=0x1){_0x913fd2>0x0&&(_0x53a96c+='\x20'+_0x29846f[_0xce45('0x65')]+'\x20');_0x53a96c+=_0x29846f[_0xce45('0x66')][_0x913fd2][_0xce45('0x67')]?_0x1e875b(_0x29846f[_0xce45('0x66')][_0x913fd2]['group']):_0x29846f[_0xce45('0x66')][_0x913fd2]['field']+'\x20'+_0x29846f[_0xce45('0x66')][_0x913fd2][_0xce45('0x69')]+(_0x26516e(_0x29846f[_0xce45('0x66')][_0x913fd2][_0xce45('0x69')])?'\x20'+_0x29846f['rules'][_0x913fd2]['value']:'');}return _0x53a96c+')';};var _0x33789b={'where':{'id':_0x2f8ee5['params']['id']}},_0x1a67fb,_0x15bfc5,_0x80a0dc,_0x20f0bf,_0x1bf228;_0x33789b=_[_0xce45('0x40')]({},_0x33789b,_0x2f8ee5['options']);return db[_0xce45('0x2d')][_0xce45('0x4d')](_0x33789b)[_0xce45('0x25')](function(_0x3eb583){if(_0x3eb583){_0x1a67fb=_0x3eb583;return _0x3eb583[_0xce45('0x8b')]();}return null;})[_0xce45('0x25')](function(_0x13201e){if(_0x13201e){if(!_0x13201e[_0xce45('0x38')]){throw new db[(_0xce45('0x6b'))][(_0xce45('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x15bfc5=_0x13201e;return db[_0xce45('0x6d')][_0xce45('0x44')]({'raw':!![]});}return null;})[_0xce45('0x25')](function(_0x2650dd){if(_0x2650dd){_0x80a0dc=_[_0xce45('0x6e')](_0x2650dd,'id');var _0x4194d5;var _0x2ee1af=squel[_0xce45('0x8d')]();_0x2ee1af['from'](_0x1a67fb['table']);for(var _0x31e867=0x0;_0x31e867<_0x15bfc5[_0xce45('0x38')];_0x31e867+=0x1){_0x4194d5=_0x15bfc5[_0x31e867]['MetricId']?_0x80a0dc[_0x15bfc5[_0x31e867]['MetricId']][_0xce45('0x72')]:_0x15bfc5[_0x31e867][_0xce45('0x68')];_0x4194d5=_0x15bfc5[_0x31e867][_0xce45('0x73')]?_[_0xce45('0x75')](_0x319098[_0x15bfc5[_0x31e867]['function']],'%s',_0x4194d5):_0x4194d5;_0x4194d5=_0x15bfc5[_0x31e867]['format']?_['replace'](_0x13f789[_0x15bfc5[_0x31e867]['format']],'%s',_0x4194d5):_0x4194d5;if(_0x15bfc5[_0x31e867][_0xce45('0x76')]){_0x2ee1af[_0xce45('0x67')](_0x4194d5);}_0x15bfc5[_0x31e867][_0xce45('0x77')]&&_0x2ee1af['order'](_0x4194d5,_0x15bfc5[_0x31e867][_0xce45('0x77')]===_0xce45('0x78')?![]:!![]);_0x2ee1af['field'](_0x4194d5,_0x15bfc5[_0x31e867][_0xce45('0x79')]||_0x4194d5);}if(_0x1a67fb[_0xce45('0x7a')]){_0x1a67fb['joins']=JSON[_0xce45('0x7b')](_0x1a67fb[_0xce45('0x7a')]);for(var _0x1ae026=0x0;_0x1ae026<_0x1a67fb[_0xce45('0x7a')][_0xce45('0x38')];_0x1ae026+=0x1){if(_0x1a67fb['joins'][_0x1ae026]['type']&&_['includes'](_0x5d3f41,_0x1a67fb[_0xce45('0x7a')][_0x1ae026][_0xce45('0x30')])&&_0x1a67fb[_0xce45('0x7a')][_0x1ae026][_0xce45('0x7c')]&&_0x1a67fb[_0xce45('0x7a')][_0x1ae026]['foreignTable']&&_0x1a67fb[_0xce45('0x7a')][_0x1ae026][_0xce45('0x7e')]){_0x2ee1af[_0x1a67fb[_0xce45('0x7a')][_0x1ae026]['type']](_0x1a67fb[_0xce45('0x7a')][_0x1ae026][_0xce45('0x7d')],null,util[_0xce45('0x74')]('%s.%s\x20=\x20%s.%s',_0x1a67fb[_0xce45('0x70')],_0x1a67fb[_0xce45('0x7a')][_0x1ae026][_0xce45('0x7c')],_0x1a67fb['joins'][_0x1ae026][_0xce45('0x7d')],_0x1a67fb[_0xce45('0x7a')][_0x1ae026]['foreignKey']));}}}if(_0x1a67fb[_0xce45('0x7f')]){_0x1a67fb[_0xce45('0x7f')]=JSON[_0xce45('0x7b')](_0x1a67fb['conditions']);_0x2ee1af['where'](_0x1e875b(_0x1a67fb[_0xce45('0x7f')][_0xce45('0x67')]));}_0x1bf228=_0x2ee1af[_0xce45('0x80')]();_0x2ee1af['limit'](_0xeaff6c);_0x2ee1af[_0xce45('0x1f')](0x0);logger[_0xce45('0x81')](_0xce45('0x82'),_0x2ee1af[_0xce45('0x83')]());return dbH[_0xce45('0x84')][_0xce45('0x32')](_0x2ee1af[_0xce45('0x83')](),{'type':dbH[_0xce45('0x84')][_0xce45('0xa4')]['SELECT']});}})[_0xce45('0x25')](function(){return{'sql':_0x1bf228[_0xce45('0x83')]()};})[_0xce45('0x25')](respondWithResult(_0x2a31d2,null))['catch'](handleError(_0x2a31d2,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 56d1def..aafc91a 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 _0xd502=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','../../config/logger','moment'];(function(_0x597e6c,_0x37ddaa){var _0x10bc1c=function(_0x1a5fda){while(--_0x1a5fda){_0x597e6c['push'](_0x597e6c['shift']());}};_0x10bc1c(++_0x37ddaa);}(_0xd502,0x135));var _0x2d50=function(_0x5c8628,_0x2fc5f5){_0x5c8628=_0x5c8628-0x0;var _0xcbd50e=_0xd502[_0x5c8628];return _0xcbd50e;};'use strict';var _=require(_0x2d50('0x0'));var util=require('util');var logger=require(_0x2d50('0x1'))('api');var moment=require(_0x2d50('0x2'));var BPromise=require(_0x2d50('0x3'));var rp=require(_0x2d50('0x4'));var fs=require('fs');var path=require(_0x2d50('0x5'));var rimraf=require(_0x2d50('0x6'));var config=require(_0x2d50('0x7'));var attributes=require(_0x2d50('0x8'));module[_0x2d50('0x9')]=function(_0x137dce,_0x1e6624){return _0x137dce[_0x2d50('0xa')](_0x2d50('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4bf3=['./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4bf3,0x19d));var _0x34bf=function(_0x2df698,_0x1ec0d2){_0x2df698=_0x2df698-0x0;var _0x178879=_0x4bf3[_0x2df698];return _0x178879;};'use strict';var _=require(_0x34bf('0x0'));var util=require('util');var logger=require(_0x34bf('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x34bf('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x34bf('0x3'));module[_0x34bf('0x4')]=function(_0x792727,_0x537791){return _0x792727[_0x34bf('0x5')](_0x34bf('0x6'),attributes,{'tableName':_0x34bf('0x7'),'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 b738d66..2cab7c2 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 _0xbf37=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf37,0xfd));var _0x7bf3=function(_0x105a77,_0x39b87b){_0x105a77=_0x105a77-0x0;var _0x3e8155=_0xbf37[_0x105a77];return _0x3e8155;};'use strict';var _=require(_0x7bf3('0x0'));var util=require(_0x7bf3('0x1'));var moment=require(_0x7bf3('0x2'));var BPromise=require(_0x7bf3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7bf3('0x4'));var db=require(_0x7bf3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7bf3('0x6'))(_0x7bf3('0x7'));var config=require('../../config/environment');var jayson=require(_0x7bf3('0x8'));var client=jayson[_0x7bf3('0x9')][_0x7bf3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x386b07,_0x2da045,_0x2ed1de){return new BPromise(function(_0x39a35f,_0x5a5063){return client['request'](_0x386b07,_0x2ed1de)[_0x7bf3('0xb')](function(_0x248bcf){logger[_0x7bf3('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2da045,'request\x20sent');logger['debug'](_0x7bf3('0xd'),_0x2da045,_0x7bf3('0xe'),JSON['stringify'](_0x248bcf));if(_0x248bcf[_0x7bf3('0xf')]){if(_0x248bcf[_0x7bf3('0xf')][_0x7bf3('0x10')]===0x1f4){logger[_0x7bf3('0xf')](_0x7bf3('0x11'),_0x2da045,_0x248bcf[_0x7bf3('0xf')][_0x7bf3('0x12')]);return _0x5a5063(_0x248bcf[_0x7bf3('0xf')][_0x7bf3('0x12')]);}logger[_0x7bf3('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2da045,_0x248bcf[_0x7bf3('0xf')][_0x7bf3('0x12')]);return _0x39a35f(_0x248bcf['error'][_0x7bf3('0x12')]);}else{logger[_0x7bf3('0xc')](_0x7bf3('0x11'),_0x2da045,_0x7bf3('0xe'));_0x39a35f(_0x248bcf[_0x7bf3('0x13')]['message']);}})[_0x7bf3('0x14')](function(_0x81a9eb){logger[_0x7bf3('0xf')](_0x7bf3('0x11'),_0x2da045,_0x81a9eb);_0x5a5063(_0x81a9eb);});});}
\ No newline at end of file
+var _0xfdd4=['http','request','info','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x55b481,_0x59cdc1){var _0x2d25a5=function(_0x1936c6){while(--_0x1936c6){_0x55b481['push'](_0x55b481['shift']());}};_0x2d25a5(++_0x59cdc1);}(_0xfdd4,0x1d4));var _0x4fdd=function(_0x3fcc5,_0x5771ad){_0x3fcc5=_0x3fcc5-0x0;var _0x3977fc=_0xfdd4[_0x3fcc5];return _0x3977fc;};'use strict';var _=require(_0x4fdd('0x0'));var util=require(_0x4fdd('0x1'));var moment=require(_0x4fdd('0x2'));var BPromise=require(_0x4fdd('0x3'));var rs=require(_0x4fdd('0x4'));var fs=require('fs');var Redis=require(_0x4fdd('0x5'));var db=require(_0x4fdd('0x6'))['db'];var utils=require(_0x4fdd('0x7'));var logger=require(_0x4fdd('0x8'))(_0x4fdd('0x9'));var config=require(_0x4fdd('0xa'));var jayson=require(_0x4fdd('0xb'));var client=jayson['client'][_0x4fdd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5d7059,_0x2156b1,_0x2a0884){return new BPromise(function(_0x1102a6,_0x41ce79){return client[_0x4fdd('0xd')](_0x5d7059,_0x2a0884)['then'](function(_0x49fbf7){logger[_0x4fdd('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2156b1,'request\x20sent');logger[_0x4fdd('0xf')](_0x4fdd('0x10'),_0x2156b1,'request\x20sent',JSON[_0x4fdd('0x11')](_0x49fbf7));if(_0x49fbf7[_0x4fdd('0x12')]){if(_0x49fbf7[_0x4fdd('0x12')][_0x4fdd('0x13')]===0x1f4){logger[_0x4fdd('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2156b1,_0x49fbf7[_0x4fdd('0x12')][_0x4fdd('0x14')]);return _0x41ce79(_0x49fbf7[_0x4fdd('0x12')][_0x4fdd('0x14')]);}logger[_0x4fdd('0x12')](_0x4fdd('0x15'),_0x2156b1,_0x49fbf7['error'][_0x4fdd('0x14')]);return _0x1102a6(_0x49fbf7[_0x4fdd('0x12')][_0x4fdd('0x14')]);}else{logger[_0x4fdd('0xe')](_0x4fdd('0x15'),_0x2156b1,_0x4fdd('0x16'));_0x1102a6(_0x49fbf7['result'][_0x4fdd('0x14')]);}})[_0x4fdd('0x17')](function(_0x283996){logger['error'](_0x4fdd('0x15'),_0x2156b1,_0x283996);_0x41ce79(_0x283996);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 4c80a16..be4a352 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 _0x4134=['get','show','preview','isAuthenticated','run','query','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller'];(function(_0x128450,_0x5869ba){var _0x4d80ed=function(_0x4a2da3){while(--_0x4a2da3){_0x128450['push'](_0x128450['shift']());}};_0x4d80ed(++_0x5869ba);}(_0x4134,0x139));var _0x4413=function(_0x13056b,_0x14fe2b){_0x13056b=_0x13056b-0x0;var _0x38b789=_0x4134[_0x13056b];return _0x38b789;};'use strict';var multer=require(_0x4413('0x0'));var util=require(_0x4413('0x1'));var path=require(_0x4413('0x2'));var timeout=require(_0x4413('0x3'));var express=require(_0x4413('0x4'));var router=express['Router']();var fs_extra=require(_0x4413('0x5'));var auth=require(_0x4413('0x6'));var interaction=require(_0x4413('0x7'));var config=require('../../config/environment');var controller=require(_0x4413('0x8'));router[_0x4413('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4413('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4413('0xa')]);router[_0x4413('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0x4413('0xb')]);router[_0x4413('0x9')]('/:id/run',auth[_0x4413('0xc')](),controller[_0x4413('0xd')]);router[_0x4413('0x9')]('/:id/query',auth[_0x4413('0xc')](),controller[_0x4413('0xe')]);router[_0x4413('0xf')]('/',auth[_0x4413('0xc')](),controller[_0x4413('0x10')]);router[_0x4413('0x11')](_0x4413('0x12'),auth[_0x4413('0xc')](),controller[_0x4413('0x13')]);router[_0x4413('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x4413('0x15')]);module[_0x4413('0x16')]=router;
\ No newline at end of file
+var _0x20b3=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','show','/:id/preview','isAuthenticated','preview','run','/:id/query','query','post','create','put','update','delete','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x20b3,0x159));var _0x320b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20b3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x320b('0x0'));var util=require(_0x320b('0x1'));var path=require('path');var timeout=require(_0x320b('0x2'));var express=require(_0x320b('0x3'));var router=express['Router']();var fs_extra=require(_0x320b('0x4'));var auth=require(_0x320b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x320b('0x6'));var controller=require('./analyticCustomReport.controller');router[_0x320b('0x7')]('/',auth['isAuthenticated'](),controller[_0x320b('0x8')]);router[_0x320b('0x7')](_0x320b('0x9'),auth['isAuthenticated'](),controller[_0x320b('0xa')]);router[_0x320b('0x7')](_0x320b('0xb'),auth[_0x320b('0xc')](),controller[_0x320b('0xd')]);router[_0x320b('0x7')]('/:id/run',auth['isAuthenticated'](),controller[_0x320b('0xe')]);router[_0x320b('0x7')](_0x320b('0xf'),auth[_0x320b('0xc')](),controller[_0x320b('0x10')]);router[_0x320b('0x11')]('/',auth[_0x320b('0xc')](),controller[_0x320b('0x12')]);router[_0x320b('0x13')](_0x320b('0x9'),auth[_0x320b('0xc')](),controller[_0x320b('0x14')]);router[_0x320b('0x15')](_0x320b('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x320b('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index ea522e1..aba0cef 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 _0x038b=['exports','STRING','TEXT'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x038b,0x114));var _0xb038=function(_0x31ffde,_0x212061){_0x31ffde=_0x31ffde-0x0;var _0x4ea5dc=_0x038b[_0x31ffde];return _0x4ea5dc;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'name':{'type':Sequelize[_0xb038('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb038('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb038('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb038('0x2')]}};
\ No newline at end of file
+var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x32874f,_0x2b45c6){var _0x5a89c6=function(_0xce908){while(--_0xce908){_0x32874f['push'](_0x32874f['shift']());}};_0x5a89c6(++_0x2b45c6);}(_0x5fab,0x177));var _0xb5fa=function(_0xcd9ece,_0x33ff67){_0xcd9ece=_0xcd9ece-0x0;var _0x36f54f=_0x5fab[_0xcd9ece];return _0x36f54f;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index e68b6cb..7ccdb9e 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 _0x187d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','limit','undefined','count','offset','set','json','save','update','then','get','destroy','error','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','order','sort','filter','where','merge','options','includeAll','rows','catch','include','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\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\x20NOT\x20EMPTY','rules','length','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','metric','replace','format','groupBy','orderBy','field','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','join','IS\x20EMPTY','operator','AnalyticMetric','function','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','select','countTable','QueryTypes','runReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x39f11f,_0xa18250){var _0x387198=function(_0x4d0b1f){while(--_0x4d0b1f){_0x39f11f['push'](_0x39f11f['shift']());}};_0x387198(++_0xa18250);}(_0x187d,0x93));var _0xd187=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x187d[_0x5b561d];return _0x431060;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];var dbH=require(_0xd187('0x1a'))[_0xd187('0x1b')];function respondWithStatusCode(_0x59ee4a,_0x33e3d5){_0x33e3d5=_0x33e3d5||0xcc;return function(_0x18ce42){if(_0x18ce42){return _0x59ee4a[_0xd187('0x1c')](_0x33e3d5);}return _0x59ee4a[_0xd187('0x1d')](_0x33e3d5)['end']();};}function respondWithResult(_0x39a927,_0x2050d5){_0x2050d5=_0x2050d5||0xc8;return function(_0x45ab10){if(_0x45ab10){return _0x39a927[_0xd187('0x1d')](_0x2050d5)['json'](_0x45ab10);}};}function respondWithFilteredResult(_0x245d3e,_0x52a208){return function(_0x5cf218){if(_0x5cf218){var _0x40ed84=typeof _0x52a208['offset']==='undefined'&&typeof _0x52a208[_0xd187('0x1e')]===_0xd187('0x1f');var _0x374fe0=_0x5cf218[_0xd187('0x20')];var _0x21df74=_0x40ed84?0x0:_0x52a208[_0xd187('0x21')];var _0x12b388=_0x40ed84?_0x5cf218[_0xd187('0x20')]:_0x52a208[_0xd187('0x21')]+_0x52a208[_0xd187('0x1e')];var _0x170d5c;if(_0x12b388>=_0x374fe0){_0x12b388=_0x374fe0;_0x170d5c=0xc8;}else{_0x170d5c=0xce;}_0x245d3e[_0xd187('0x1d')](_0x170d5c);return _0x245d3e[_0xd187('0x22')]('Content-Range',_0x21df74+'-'+_0x12b388+'/'+_0x374fe0)[_0xd187('0x23')](_0x5cf218);}return null;};}function patchUpdates(_0x81b988){return function(_0xc5bba5){try{jsonpatch['apply'](_0xc5bba5,_0x81b988,!![]);}catch(_0x5a0360){return BPromise['reject'](_0x5a0360);}return _0xc5bba5[_0xd187('0x24')]();};}function saveUpdates(_0x33741d,_0x249a82){return function(_0x4f62c8){if(_0x4f62c8){return _0x4f62c8[_0xd187('0x25')](_0x33741d)['then'](function(_0x145771){return _0x145771;});}return null;};}function removeEntity(_0x5a7a23,_0x1047f4){return function(_0x54f340){if(_0x54f340){return _0x54f340['destroy']()[_0xd187('0x26')](function(){var _0x4d992b=_0x54f340[_0xd187('0x27')]({'plain':!![]});var _0x598aa4='DefaultReports';return db['UserProfileResource'][_0xd187('0x28')]({'where':{'type':_0x598aa4,'resourceId':_0x4d992b['id']}})[_0xd187('0x26')](function(){return _0x54f340;});})[_0xd187('0x26')](function(){_0x5a7a23[_0xd187('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a20ed,_0x2875c8){return function(_0x5c8e52){if(!_0x5c8e52){_0x2a20ed[_0xd187('0x1c')](0x194);}return _0x5c8e52;};}function handleError(_0x1c87ee,_0x34febe){_0x34febe=_0x34febe||0x1f4;return function(_0x4c50a5){logger[_0xd187('0x29')](_0x4c50a5['stack']);if(_0x4c50a5[_0xd187('0x2a')]){delete _0x4c50a5[_0xd187('0x2a')];}_0x1c87ee[_0xd187('0x1d')](_0x34febe)[_0xd187('0x2b')](_0x4c50a5);};}exports['index']=function(_0x140e54,_0xb38778){var _0x5bba10={},_0x4cc587={},_0x1a1922={'count':0x0,'rows':[]};var _0x1836cf=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x2d8843){return{'name':_0x2d8843[_0xd187('0x2f')],'type':_0x2d8843[_0xd187('0x30')]['key']};});_0x4cc587[_0xd187('0x31')]=_[_0xd187('0x2c')](_0x1836cf,_0xd187('0x2a'));_0x4cc587['query']=_[_0xd187('0x32')](_0x140e54['query']);_0x4cc587[_0xd187('0x33')]=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],_0x4cc587['query']);_0x5bba10['attributes']=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],qs['fields'](_0x140e54[_0xd187('0x35')][_0xd187('0x36')]));_0x5bba10[_0xd187('0x37')]=_0x5bba10['attributes']['length']?_0x5bba10[_0xd187('0x37')]:_0x4cc587[_0xd187('0x31')];if(!_0x140e54['query']['hasOwnProperty']('nolimit')){_0x5bba10[_0xd187('0x1e')]=qs['limit'](_0x140e54[_0xd187('0x35')][_0xd187('0x1e')]);_0x5bba10['offset']=qs[_0xd187('0x21')](_0x140e54['query'][_0xd187('0x21')]);}_0x5bba10[_0xd187('0x38')]=qs['sort'](_0x140e54[_0xd187('0x35')][_0xd187('0x39')]);_0x5bba10['where']=qs[_0xd187('0x33')](_['pick'](_0x140e54['query'],_0x4cc587[_0xd187('0x33')]),_0x1836cf);if(_0x140e54[_0xd187('0x35')][_0xd187('0x3a')]){_0x5bba10[_0xd187('0x3b')]=_[_0xd187('0x3c')](_0x5bba10['where'],{'$or':_[_0xd187('0x2c')](_0x1836cf,function(_0xe090ad){if(_0xe090ad[_0xd187('0x30')]!=='VIRTUAL'){var _0x4b121c={};_0x4b121c[_0xe090ad['name']]={'$like':'%'+_0x140e54['query'][_0xd187('0x3a')]+'%'};return _0x4b121c;}})});}_0x5bba10=_[_0xd187('0x3c')]({},_0x5bba10,_0x140e54[_0xd187('0x3d')]);var _0x367303={'where':_0x5bba10[_0xd187('0x3b')]};return db[_0xd187('0x2d')][_0xd187('0x20')](_0x367303)[_0xd187('0x26')](function(_0x526060){_0x1a1922[_0xd187('0x20')]=_0x526060;if(_0x140e54[_0xd187('0x35')][_0xd187('0x3e')]){_0x5bba10['include']=[{'all':!![]}];}return db[_0xd187('0x2d')]['findAll'](_0x5bba10);})[_0xd187('0x26')](function(_0x406d29){_0x1a1922[_0xd187('0x3f')]=_0x406d29;return _0x1a1922;})[_0xd187('0x26')](respondWithFilteredResult(_0xb38778,_0x5bba10))[_0xd187('0x40')](handleError(_0xb38778,null));};exports['show']=function(_0x3f0484,_0x3d9e60){var _0x3215b1={'raw':!![],'where':{'id':_0x3f0484['params']['id']}},_0x3fa19c={};_0x3fa19c[_0xd187('0x31')]=_[_0xd187('0x32')](db['AnalyticDefaultReport'][_0xd187('0x2e')]);_0x3fa19c[_0xd187('0x35')]=_['keys'](_0x3f0484['query']);_0x3fa19c[_0xd187('0x33')]=_[_0xd187('0x34')](_0x3fa19c['model'],_0x3fa19c['query']);_0x3215b1['attributes']=_[_0xd187('0x34')](_0x3fa19c[_0xd187('0x31')],qs[_0xd187('0x36')](_0x3f0484[_0xd187('0x35')][_0xd187('0x36')]));_0x3215b1[_0xd187('0x37')]=_0x3215b1[_0xd187('0x37')]['length']?_0x3215b1[_0xd187('0x37')]:_0x3fa19c[_0xd187('0x31')];if(_0x3f0484[_0xd187('0x35')][_0xd187('0x3e')]){_0x3215b1[_0xd187('0x41')]=[{'all':!![]}];}_0x3215b1=_[_0xd187('0x3c')]({},_0x3215b1,_0x3f0484[_0xd187('0x3d')]);return db[_0xd187('0x2d')]['find'](_0x3215b1)[_0xd187('0x26')](handleEntityNotFound(_0x3d9e60,null))[_0xd187('0x26')](respondWithResult(_0x3d9e60,null))[_0xd187('0x40')](handleError(_0x3d9e60,null));};exports[_0xd187('0x42')]=function(_0x36b99d,_0x5ad646){return db[_0xd187('0x2d')][_0xd187('0x42')](_0x36b99d['body'],{})[_0xd187('0x26')](function(_0xd9635d){var _0x55fac6=_0x36b99d['user']['get']({'plain':!![]});if(!_0x55fac6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55fac6[_0xd187('0x43')]===_0xd187('0x44')){var _0x12d448=_0xd9635d[_0xd187('0x27')]({'plain':!![]});var _0x460202=_0xd187('0x45');return db[_0xd187('0x46')]['find']({'where':{'name':_0x460202,'userProfileId':_0x55fac6[_0xd187('0x47')]},'raw':!![]})[_0xd187('0x26')](function(_0x1b12c4){if(_0x1b12c4&&_0x1b12c4[_0xd187('0x48')]===0x0){return db['UserProfileResource'][_0xd187('0x42')]({'name':_0x12d448['name'],'resourceId':_0x12d448['id'],'type':'DefaultReports','sectionId':_0x1b12c4['id']},{})[_0xd187('0x26')](function(){return _0xd9635d;});}else{return _0xd9635d;}})['catch'](function(_0x1a1252){logger[_0xd187('0x29')](_0xd187('0x49'),_0x1a1252);throw _0x1a1252;});}return _0xd9635d;})[_0xd187('0x26')](respondWithResult(_0x5ad646,0xc9))[_0xd187('0x40')](handleError(_0x5ad646,null));};exports[_0xd187('0x25')]=function(_0x3c7ba6,_0x2b4f9d){if(_0x3c7ba6[_0xd187('0x4a')]['id']){delete _0x3c7ba6['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x4b')]({'where':{'id':_0x3c7ba6['params']['id']}})[_0xd187('0x26')](handleEntityNotFound(_0x2b4f9d,null))[_0xd187('0x26')](saveUpdates(_0x3c7ba6[_0xd187('0x4a')],null))['then'](respondWithResult(_0x2b4f9d,null))[_0xd187('0x40')](handleError(_0x2b4f9d,null));};exports[_0xd187('0x28')]=function(_0x50073d,_0x457da1){return db[_0xd187('0x2d')]['find']({'where':{'id':_0x50073d[_0xd187('0x4c')]['id']}})['then'](handleEntityNotFound(_0x457da1,null))[_0xd187('0x26')](removeEntity(_0x457da1,null))[_0xd187('0x40')](handleError(_0x457da1,null));};exports[_0xd187('0x4d')]=function(_0x508866,_0x100d64){var _0x2265fb=0xa;var _0x1675d9=['join',_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x56b36b={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':_0xd187('0x58'),'GROUP_CONCAT DESC':_0xd187('0x59')};var _0x2c7dd9={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':_0xd187('0x5b'),'HOUR':_0xd187('0x5c'),'ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0xaff1e6=function(_0x42fb32){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x42fb32);};var _0x48c82d=function(_0x13d118){if(!_0x13d118||!_0x13d118[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x4225e6='(',_0x51fbdb=0x0;_0x51fbdb<_0x13d118[_0xd187('0x63')][_0xd187('0x64')];_0x51fbdb+=0x1){_0x51fbdb>0x0&&(_0x4225e6+='\x20'+_0x13d118['operator']+'\x20');_0x4225e6+=_0x13d118['rules'][_0x51fbdb][_0xd187('0x65')]?_0x48c82d(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x65')]):_0x13d118[_0xd187('0x63')][_0x51fbdb]['field']+'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb]['condition']+(_0xaff1e6(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x66')])?'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x67')]:'');}return _0x4225e6+')';};var _0x57cad7={'where':{'id':_0x508866['params']['id']}},_0x2409a8,_0xaea7e0,_0xd12560,_0x9e82c,_0x151f3c;_0x57cad7=_['merge']({},_0x57cad7,_0x508866[_0xd187('0x3d')]);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x57cad7)[_0xd187('0x26')](function(_0x13e05a){if(_0x13e05a){_0x2409a8=_0x13e05a;return _0x13e05a[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1291cc){if(_0x1291cc){if(!_0x1291cc[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0xaea7e0=_0x1291cc;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x54e908){if(_0x54e908){_0xd12560=_[_0xd187('0x6d')](_0x54e908,'id');var _0x1a9979;var _0x4bec3e=squel['select']();_0x4bec3e[_0xd187('0x6e')](_0x2409a8[_0xd187('0x6f')]);for(var _0x2ac56f=0x0;_0x2ac56f<_0xaea7e0[_0xd187('0x64')];_0x2ac56f+=0x1){_0x1a9979=_0xaea7e0[_0x2ac56f]['MetricId']?_0xd12560[_0xaea7e0[_0x2ac56f][_0xd187('0x70')]][_0xd187('0x71')]:_0xaea7e0[_0x2ac56f]['field'];_0x1a9979=_0xaea7e0[_0x2ac56f]['function']?_[_0xd187('0x72')](_0x56b36b[_0xaea7e0[_0x2ac56f]['function']],'%s',_0x1a9979):_0x1a9979;_0x1a9979=_0xaea7e0[_0x2ac56f][_0xd187('0x73')]?_[_0xd187('0x72')](_0x2c7dd9[_0xaea7e0[_0x2ac56f]['format']],'%s',_0x1a9979):_0x1a9979;if(_0xaea7e0[_0x2ac56f][_0xd187('0x74')]){_0x4bec3e['group'](_0x1a9979);}_0xaea7e0[_0x2ac56f][_0xd187('0x75')]&&_0x4bec3e['order'](_0x1a9979,_0xaea7e0[_0x2ac56f]['orderBy']==='DESC'?![]:!![]);_0x4bec3e[_0xd187('0x76')](_0x1a9979,_0xaea7e0[_0x2ac56f][_0xd187('0x77')]||_0x1a9979);}if(_0x2409a8[_0xd187('0x78')]){_0x2409a8[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x78')]);for(var _0x11858e=0x0;_0x11858e<_0x2409a8[_0xd187('0x78')]['length'];_0x11858e+=0x1){if(_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x1675d9,_0x2409a8['joins'][_0x11858e][_0xd187('0x30')])&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7a')]&&_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable']&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7b')]){_0x4bec3e[_0x2409a8['joins'][_0x11858e][_0xd187('0x30')]](_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7c')],null,util[_0xd187('0x73')]('%s.%s\x20=\x20%s.%s',_0x2409a8[_0xd187('0x6f')],_0x2409a8[_0xd187('0x78')][_0x11858e]['parentKey'],_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable'],_0x2409a8['joins'][_0x11858e]['foreignKey']));}}}if(_0x2409a8[_0xd187('0x7d')]){_0x2409a8[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x7d')]);_0x4bec3e[_0xd187('0x3b')](_0x48c82d(_0x2409a8[_0xd187('0x7d')]['group']));}_0x151f3c=_0x4bec3e[_0xd187('0x7e')]();_0x4bec3e[_0xd187('0x1e')](_0x2265fb);_0x4bec3e['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x4bec3e[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x4bec3e[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes'][_0xd187('0x82')]});}})[_0xd187('0x26')](respondWithResult(_0x100d64,null))[_0xd187('0x40')](handleError(_0x100d64,null));};function runReport(_0xbc650f,_0x1da684,_0x2879ff){var _0x1982cd=_0x1da684[_0xd187('0x2a')];var _0x3d9b2f=0xa;var _0xf31fac=[_0xd187('0x83'),_0xd187('0x4e'),'right_join','cross_join'];var _0x3d7e97={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x520f86={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd187('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x1ccb17=function(_0x432995){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x84'),_0xd187('0x62')],_0x432995);};var _0x395e45=function(_0x1e8839){if(!_0x1e8839||!_0x1e8839[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x2101a3='(',_0x25fc08=0x0;_0x25fc08<_0x1e8839['rules'][_0xd187('0x64')];_0x25fc08+=0x1){_0x25fc08>0x0&&(_0x2101a3+='\x20'+_0x1e8839[_0xd187('0x85')]+'\x20');_0x2101a3+=_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x65')]?_0x395e45(_0x1e8839['rules'][_0x25fc08][_0xd187('0x65')]):_0x1e8839[_0xd187('0x63')][_0x25fc08]['field']+'\x20'+_0x1e8839['rules'][_0x25fc08][_0xd187('0x66')]+(_0x1ccb17(_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x66')])?'\x20'+_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x67')]:'');}return _0x2101a3+')';};var _0x475ea9={'where':{'id':_0xbc650f['id']}},_0x4dd0c7,_0x22900,_0x22424d,_0x5b7870,_0x3244dd;_0x475ea9=_[_0xd187('0x3c')]({},_0x475ea9,_0x2879ff);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x475ea9)['then'](function(_0x5be1c9){if(_0x5be1c9){_0x4dd0c7=_0x5be1c9;return _0x5be1c9[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1cd0d2){if(_0x1cd0d2){if(!_0x1cd0d2['length']){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x22900=_0x1cd0d2;return db[_0xd187('0x86')]['findAll']({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x4efb9f){if(_0x4efb9f){_0x22424d=_['keyBy'](_0x4efb9f,'id');var _0x4a9310;var _0x54bf98=squel['select']();_0x54bf98['from'](_0x4dd0c7['table']);for(var _0x323311=0x0;_0x323311<_0x22900[_0xd187('0x64')];_0x323311+=0x1){_0x4a9310=_0x22900[_0x323311]['MetricId']?_0x22424d[_0x22900[_0x323311][_0xd187('0x70')]][_0xd187('0x71')]:_0x22900[_0x323311][_0xd187('0x76')];_0x4a9310=_0x22900[_0x323311][_0xd187('0x87')]?_[_0xd187('0x72')](_0x3d7e97[_0x22900[_0x323311]['function']],'%s',_0x4a9310):_0x4a9310;_0x4a9310=_0x22900[_0x323311][_0xd187('0x73')]?_['replace'](_0x520f86[_0x22900[_0x323311][_0xd187('0x73')]],'%s',_0x4a9310):_0x4a9310;if(_0x22900[_0x323311][_0xd187('0x74')]){_0x54bf98[_0xd187('0x65')](_0x4a9310);}_0x22900[_0x323311][_0xd187('0x75')]&&_0x54bf98[_0xd187('0x38')](_0x4a9310,_0x22900[_0x323311][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x54bf98['field'](_0x4a9310,_0x22900[_0x323311][_0xd187('0x77')]||_0x4a9310);}if(_0x4dd0c7[_0xd187('0x78')]){_0x4dd0c7['joins']=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x78')]);for(var _0x5df926=0x0;_0x5df926<_0x4dd0c7[_0xd187('0x78')][_0xd187('0x64')];_0x5df926+=0x1){if(_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0xf31fac,_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')])&&_0x4dd0c7[_0xd187('0x78')][_0x5df926]['parentKey']&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')]&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]){_0x54bf98[_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]](_0x4dd0c7['joins'][_0x5df926]['foreignTable'],null,util[_0xd187('0x73')](_0xd187('0x89'),_0x4dd0c7['table'],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7a')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]));}}}if(_0x4dd0c7['conditions']){_0x4dd0c7[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x7d')]);_0x54bf98[_0xd187('0x3b')](_0x395e45(_0x4dd0c7[_0xd187('0x7d')][_0xd187('0x65')]));}_0x3244dd=_0x54bf98[_0xd187('0x7e')]();_0x54bf98[_0xd187('0x1e')](_0x3d9b2f);_0x54bf98[_0xd187('0x21')](0x0);return;}})['then'](function(){if(_0x1da684[_0xd187('0x8a')]===_0xd187('0x8b')){return null;}var _0x25a053=_['merge'](_0x1da684,{'name':_0x1da684[_0xd187('0x8c')]||_0x1da684[_0xd187('0x2a')]||_0x4dd0c7[_0xd187('0x2a')],'basename':_0x1982cd,'savename':util[_0xd187('0x73')](_0xd187('0x8d'),_0x1da684[_0xd187('0x2a')]||_0x4dd0c7['name'],require(_0xd187('0x8e'))[_0xd187('0x8f')](0x4),_0x1da684[_0xd187('0x8a')]||'csv'),'reportId':_0x4dd0c7['id'],'reportType':_0xd187('0x90')});return db[_0xd187('0x91')][_0xd187('0x42')](_0x25a053,{'raw':!![]});})[_0xd187('0x26')](function(_0x12599e){if(_0x4dd0c7[_0xd187('0x6f')]==='cdr'){_0x3244dd[_0xd187('0x3b')](_0x4dd0c7[_0xd187('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1da684[_0xd187('0x92')],_0x1da684[_0xd187('0x93')]);}else{_0x3244dd['where'](_0x4dd0c7[_0xd187('0x6f')]+_0xd187('0x94'),_0x1da684['startDate'],_0x1da684[_0xd187('0x93')]);}if(_0x12599e){logger[_0xd187('0x95')]('Run\x20Query:',_0x3244dd[_0xd187('0x80')]());require('child_process')[_0xd187('0x96')](path[_0xd187('0x83')](__dirname,_0xd187('0x97'),_0x12599e[_0xd187('0x8a')]),[_0x12599e['id'],_0x3244dd[_0xd187('0x80')](),path['join'](__dirname,'../../files/reports',_0x12599e[_0xd187('0x98')]),_0x1982cd]);return _0x12599e;}else{var _0x2a2c7f=squel[_0xd187('0x99')]();_0x2a2c7f[_0xd187('0x6e')]('('+_0x3244dd[_0xd187('0x80')]()+')',_0xd187('0x9a'));_0x2a2c7f[_0xd187('0x76')]('COUNT(*)',_0xd187('0x20'));_0x3244dd[_0xd187('0x1e')](_0x1da684[_0xd187('0x1e')]||_0x3d9b2f);_0x3244dd[_0xd187('0x21')](_0x1da684[_0xd187('0x21')]||0x0);return dbH[_0xd187('0x81')]['query'](_0x2a2c7f[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')][_0xd187('0x82')]})[_0xd187('0x26')](function(_0x38a7cd){if(!_0x38a7cd[_0xd187('0x64')]){_0x5b7870=0x0;}else{_0x5b7870=_0x38a7cd[0x0][_0xd187('0x20')]||0x0;}return dbH['sequelize'][_0xd187('0x35')](_0x3244dd['toString'](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')]['SELECT']});})[_0xd187('0x26')](function(_0x254e0a){return{'rows':_0x254e0a||[],'count':_0x5b7870};});}});}exports['run']=function(_0x1776c1,_0x497a94){return runReport(_0x1776c1[_0xd187('0x4c')],_0x1776c1['query'],_0x1776c1['options'])[_0xd187('0x26')](respondWithResult(_0x497a94,null))[_0xd187('0x40')](handleError(_0x497a94,null));};exports[_0xd187('0x9c')]=runReport;exports[_0xd187('0x35')]=function(_0x568f72,_0x357526){var _0x13ee40=0xa;var _0x20c269=[_0xd187('0x83'),_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x25ff89={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x28798f={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x56fcde=function(_0x37b1b0){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x37b1b0);};var _0x428e6c=function(_0x4524c3){if(!_0x4524c3||!_0x4524c3[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x3a2937='(',_0xf03f9a=0x0;_0xf03f9a<_0x4524c3['rules'][_0xd187('0x64')];_0xf03f9a+=0x1){_0xf03f9a>0x0&&(_0x3a2937+='\x20'+_0x4524c3['operator']+'\x20');_0x3a2937+=_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']?_0x428e6c(_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']):_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x76')]+'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a]['condition']+(_0x56fcde(_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x66')])?'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x67')]:'');}return _0x3a2937+')';};var _0x37405d={'where':{'id':_0x568f72[_0xd187('0x4c')]['id']}},_0xe84f78,_0x12b4a4,_0x3d09a6,_0x5acea7,_0x2a756f;_0x37405d=_[_0xd187('0x3c')]({},_0x37405d,_0x568f72['options']);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x37405d)[_0xd187('0x26')](function(_0x110af6){if(_0x110af6){_0xe84f78=_0x110af6;return _0x110af6[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x2e4db4){if(_0x2e4db4){if(!_0x2e4db4[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x12b4a4=_0x2e4db4;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x50d5b8){if(_0x50d5b8){_0x3d09a6=_[_0xd187('0x6d')](_0x50d5b8,'id');var _0x48ef98;var _0x2008e9=squel['select']();_0x2008e9[_0xd187('0x6e')](_0xe84f78[_0xd187('0x6f')]);for(var _0x9b8840=0x0;_0x9b8840<_0x12b4a4[_0xd187('0x64')];_0x9b8840+=0x1){_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x70')]?_0x3d09a6[_0x12b4a4[_0x9b8840]['MetricId']][_0xd187('0x71')]:_0x12b4a4[_0x9b8840][_0xd187('0x76')];_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x87')]?_[_0xd187('0x72')](_0x25ff89[_0x12b4a4[_0x9b8840][_0xd187('0x87')]],'%s',_0x48ef98):_0x48ef98;_0x48ef98=_0x12b4a4[_0x9b8840]['format']?_[_0xd187('0x72')](_0x28798f[_0x12b4a4[_0x9b8840][_0xd187('0x73')]],'%s',_0x48ef98):_0x48ef98;if(_0x12b4a4[_0x9b8840][_0xd187('0x74')]){_0x2008e9['group'](_0x48ef98);}_0x12b4a4[_0x9b8840]['orderBy']&&_0x2008e9[_0xd187('0x38')](_0x48ef98,_0x12b4a4[_0x9b8840][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x2008e9[_0xd187('0x76')](_0x48ef98,_0x12b4a4[_0x9b8840]['alias']||_0x48ef98);}if(_0xe84f78[_0xd187('0x78')]){_0xe84f78[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0xe84f78[_0xd187('0x78')]);for(var _0x4bff96=0x0;_0x4bff96<_0xe84f78[_0xd187('0x78')]['length'];_0x4bff96+=0x1){if(_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x20c269,_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')])&&_0xe84f78['joins'][_0x4bff96][_0xd187('0x7a')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96]['foreignKey']){_0x2008e9[_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]](_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],null,util[_0xd187('0x73')](_0xd187('0x89'),_0xe84f78[_0xd187('0x6f')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7a')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7b')]));}}}if(_0xe84f78['conditions']){_0xe84f78[_0xd187('0x7d')]=JSON['parse'](_0xe84f78[_0xd187('0x7d')]);_0x2008e9['where'](_0x428e6c(_0xe84f78[_0xd187('0x7d')][_0xd187('0x65')]));}_0x2a756f=_0x2008e9[_0xd187('0x7e')]();_0x2008e9[_0xd187('0x1e')](_0x13ee40);_0x2008e9['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x2008e9[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x2008e9[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes']['SELECT']});}})[_0xd187('0x26')](function(){return{'sql':_0x2a756f[_0xd187('0x80')]()};})[_0xd187('0x26')](respondWithResult(_0x357526,null))['catch'](handleError(_0x357526,null));};
\ No newline at end of file
+var _0x187d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','limit','undefined','count','offset','set','json','save','update','then','get','destroy','error','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','order','sort','filter','where','merge','options','includeAll','rows','catch','include','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\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\x20NOT\x20EMPTY','rules','length','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','metric','replace','format','groupBy','orderBy','field','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','join','IS\x20EMPTY','operator','AnalyticMetric','function','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','select','countTable','QueryTypes','runReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x5bd78b,_0x393076){var _0xecd930=function(_0x2a0b40){while(--_0x2a0b40){_0x5bd78b['push'](_0x5bd78b['shift']());}};_0xecd930(++_0x393076);}(_0x187d,0x93));var _0xd187=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x187d[_0x29b609];return _0x54c952;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];var dbH=require(_0xd187('0x1a'))[_0xd187('0x1b')];function respondWithStatusCode(_0x59ee4a,_0x33e3d5){_0x33e3d5=_0x33e3d5||0xcc;return function(_0x18ce42){if(_0x18ce42){return _0x59ee4a[_0xd187('0x1c')](_0x33e3d5);}return _0x59ee4a[_0xd187('0x1d')](_0x33e3d5)['end']();};}function respondWithResult(_0x39a927,_0x2050d5){_0x2050d5=_0x2050d5||0xc8;return function(_0x45ab10){if(_0x45ab10){return _0x39a927[_0xd187('0x1d')](_0x2050d5)['json'](_0x45ab10);}};}function respondWithFilteredResult(_0x245d3e,_0x52a208){return function(_0x5cf218){if(_0x5cf218){var _0x40ed84=typeof _0x52a208['offset']==='undefined'&&typeof _0x52a208[_0xd187('0x1e')]===_0xd187('0x1f');var _0x374fe0=_0x5cf218[_0xd187('0x20')];var _0x21df74=_0x40ed84?0x0:_0x52a208[_0xd187('0x21')];var _0x12b388=_0x40ed84?_0x5cf218[_0xd187('0x20')]:_0x52a208[_0xd187('0x21')]+_0x52a208[_0xd187('0x1e')];var _0x170d5c;if(_0x12b388>=_0x374fe0){_0x12b388=_0x374fe0;_0x170d5c=0xc8;}else{_0x170d5c=0xce;}_0x245d3e[_0xd187('0x1d')](_0x170d5c);return _0x245d3e[_0xd187('0x22')]('Content-Range',_0x21df74+'-'+_0x12b388+'/'+_0x374fe0)[_0xd187('0x23')](_0x5cf218);}return null;};}function patchUpdates(_0x81b988){return function(_0xc5bba5){try{jsonpatch['apply'](_0xc5bba5,_0x81b988,!![]);}catch(_0x5a0360){return BPromise['reject'](_0x5a0360);}return _0xc5bba5[_0xd187('0x24')]();};}function saveUpdates(_0x33741d,_0x249a82){return function(_0x4f62c8){if(_0x4f62c8){return _0x4f62c8[_0xd187('0x25')](_0x33741d)['then'](function(_0x145771){return _0x145771;});}return null;};}function removeEntity(_0x5a7a23,_0x1047f4){return function(_0x54f340){if(_0x54f340){return _0x54f340['destroy']()[_0xd187('0x26')](function(){var _0x4d992b=_0x54f340[_0xd187('0x27')]({'plain':!![]});var _0x598aa4='DefaultReports';return db['UserProfileResource'][_0xd187('0x28')]({'where':{'type':_0x598aa4,'resourceId':_0x4d992b['id']}})[_0xd187('0x26')](function(){return _0x54f340;});})[_0xd187('0x26')](function(){_0x5a7a23[_0xd187('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a20ed,_0x2875c8){return function(_0x5c8e52){if(!_0x5c8e52){_0x2a20ed[_0xd187('0x1c')](0x194);}return _0x5c8e52;};}function handleError(_0x1c87ee,_0x34febe){_0x34febe=_0x34febe||0x1f4;return function(_0x4c50a5){logger[_0xd187('0x29')](_0x4c50a5['stack']);if(_0x4c50a5[_0xd187('0x2a')]){delete _0x4c50a5[_0xd187('0x2a')];}_0x1c87ee[_0xd187('0x1d')](_0x34febe)[_0xd187('0x2b')](_0x4c50a5);};}exports['index']=function(_0x140e54,_0xb38778){var _0x5bba10={},_0x4cc587={},_0x1a1922={'count':0x0,'rows':[]};var _0x1836cf=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x2d8843){return{'name':_0x2d8843[_0xd187('0x2f')],'type':_0x2d8843[_0xd187('0x30')]['key']};});_0x4cc587[_0xd187('0x31')]=_[_0xd187('0x2c')](_0x1836cf,_0xd187('0x2a'));_0x4cc587['query']=_[_0xd187('0x32')](_0x140e54['query']);_0x4cc587[_0xd187('0x33')]=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],_0x4cc587['query']);_0x5bba10['attributes']=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],qs['fields'](_0x140e54[_0xd187('0x35')][_0xd187('0x36')]));_0x5bba10[_0xd187('0x37')]=_0x5bba10['attributes']['length']?_0x5bba10[_0xd187('0x37')]:_0x4cc587[_0xd187('0x31')];if(!_0x140e54['query']['hasOwnProperty']('nolimit')){_0x5bba10[_0xd187('0x1e')]=qs['limit'](_0x140e54[_0xd187('0x35')][_0xd187('0x1e')]);_0x5bba10['offset']=qs[_0xd187('0x21')](_0x140e54['query'][_0xd187('0x21')]);}_0x5bba10[_0xd187('0x38')]=qs['sort'](_0x140e54[_0xd187('0x35')][_0xd187('0x39')]);_0x5bba10['where']=qs[_0xd187('0x33')](_['pick'](_0x140e54['query'],_0x4cc587[_0xd187('0x33')]),_0x1836cf);if(_0x140e54[_0xd187('0x35')][_0xd187('0x3a')]){_0x5bba10[_0xd187('0x3b')]=_[_0xd187('0x3c')](_0x5bba10['where'],{'$or':_[_0xd187('0x2c')](_0x1836cf,function(_0xe090ad){if(_0xe090ad[_0xd187('0x30')]!=='VIRTUAL'){var _0x4b121c={};_0x4b121c[_0xe090ad['name']]={'$like':'%'+_0x140e54['query'][_0xd187('0x3a')]+'%'};return _0x4b121c;}})});}_0x5bba10=_[_0xd187('0x3c')]({},_0x5bba10,_0x140e54[_0xd187('0x3d')]);var _0x367303={'where':_0x5bba10[_0xd187('0x3b')]};return db[_0xd187('0x2d')][_0xd187('0x20')](_0x367303)[_0xd187('0x26')](function(_0x526060){_0x1a1922[_0xd187('0x20')]=_0x526060;if(_0x140e54[_0xd187('0x35')][_0xd187('0x3e')]){_0x5bba10['include']=[{'all':!![]}];}return db[_0xd187('0x2d')]['findAll'](_0x5bba10);})[_0xd187('0x26')](function(_0x406d29){_0x1a1922[_0xd187('0x3f')]=_0x406d29;return _0x1a1922;})[_0xd187('0x26')](respondWithFilteredResult(_0xb38778,_0x5bba10))[_0xd187('0x40')](handleError(_0xb38778,null));};exports['show']=function(_0x3f0484,_0x3d9e60){var _0x3215b1={'raw':!![],'where':{'id':_0x3f0484['params']['id']}},_0x3fa19c={};_0x3fa19c[_0xd187('0x31')]=_[_0xd187('0x32')](db['AnalyticDefaultReport'][_0xd187('0x2e')]);_0x3fa19c[_0xd187('0x35')]=_['keys'](_0x3f0484['query']);_0x3fa19c[_0xd187('0x33')]=_[_0xd187('0x34')](_0x3fa19c['model'],_0x3fa19c['query']);_0x3215b1['attributes']=_[_0xd187('0x34')](_0x3fa19c[_0xd187('0x31')],qs[_0xd187('0x36')](_0x3f0484[_0xd187('0x35')][_0xd187('0x36')]));_0x3215b1[_0xd187('0x37')]=_0x3215b1[_0xd187('0x37')]['length']?_0x3215b1[_0xd187('0x37')]:_0x3fa19c[_0xd187('0x31')];if(_0x3f0484[_0xd187('0x35')][_0xd187('0x3e')]){_0x3215b1[_0xd187('0x41')]=[{'all':!![]}];}_0x3215b1=_[_0xd187('0x3c')]({},_0x3215b1,_0x3f0484[_0xd187('0x3d')]);return db[_0xd187('0x2d')]['find'](_0x3215b1)[_0xd187('0x26')](handleEntityNotFound(_0x3d9e60,null))[_0xd187('0x26')](respondWithResult(_0x3d9e60,null))[_0xd187('0x40')](handleError(_0x3d9e60,null));};exports[_0xd187('0x42')]=function(_0x36b99d,_0x5ad646){return db[_0xd187('0x2d')][_0xd187('0x42')](_0x36b99d['body'],{})[_0xd187('0x26')](function(_0xd9635d){var _0x55fac6=_0x36b99d['user']['get']({'plain':!![]});if(!_0x55fac6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55fac6[_0xd187('0x43')]===_0xd187('0x44')){var _0x12d448=_0xd9635d[_0xd187('0x27')]({'plain':!![]});var _0x460202=_0xd187('0x45');return db[_0xd187('0x46')]['find']({'where':{'name':_0x460202,'userProfileId':_0x55fac6[_0xd187('0x47')]},'raw':!![]})[_0xd187('0x26')](function(_0x1b12c4){if(_0x1b12c4&&_0x1b12c4[_0xd187('0x48')]===0x0){return db['UserProfileResource'][_0xd187('0x42')]({'name':_0x12d448['name'],'resourceId':_0x12d448['id'],'type':'DefaultReports','sectionId':_0x1b12c4['id']},{})[_0xd187('0x26')](function(){return _0xd9635d;});}else{return _0xd9635d;}})['catch'](function(_0x1a1252){logger[_0xd187('0x29')](_0xd187('0x49'),_0x1a1252);throw _0x1a1252;});}return _0xd9635d;})[_0xd187('0x26')](respondWithResult(_0x5ad646,0xc9))[_0xd187('0x40')](handleError(_0x5ad646,null));};exports[_0xd187('0x25')]=function(_0x3c7ba6,_0x2b4f9d){if(_0x3c7ba6[_0xd187('0x4a')]['id']){delete _0x3c7ba6['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x4b')]({'where':{'id':_0x3c7ba6['params']['id']}})[_0xd187('0x26')](handleEntityNotFound(_0x2b4f9d,null))[_0xd187('0x26')](saveUpdates(_0x3c7ba6[_0xd187('0x4a')],null))['then'](respondWithResult(_0x2b4f9d,null))[_0xd187('0x40')](handleError(_0x2b4f9d,null));};exports[_0xd187('0x28')]=function(_0x50073d,_0x457da1){return db[_0xd187('0x2d')]['find']({'where':{'id':_0x50073d[_0xd187('0x4c')]['id']}})['then'](handleEntityNotFound(_0x457da1,null))[_0xd187('0x26')](removeEntity(_0x457da1,null))[_0xd187('0x40')](handleError(_0x457da1,null));};exports[_0xd187('0x4d')]=function(_0x508866,_0x100d64){var _0x2265fb=0xa;var _0x1675d9=['join',_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x56b36b={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':_0xd187('0x58'),'GROUP_CONCAT DESC':_0xd187('0x59')};var _0x2c7dd9={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':_0xd187('0x5b'),'HOUR':_0xd187('0x5c'),'ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0xaff1e6=function(_0x42fb32){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x42fb32);};var _0x48c82d=function(_0x13d118){if(!_0x13d118||!_0x13d118[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x4225e6='(',_0x51fbdb=0x0;_0x51fbdb<_0x13d118[_0xd187('0x63')][_0xd187('0x64')];_0x51fbdb+=0x1){_0x51fbdb>0x0&&(_0x4225e6+='\x20'+_0x13d118['operator']+'\x20');_0x4225e6+=_0x13d118['rules'][_0x51fbdb][_0xd187('0x65')]?_0x48c82d(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x65')]):_0x13d118[_0xd187('0x63')][_0x51fbdb]['field']+'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb]['condition']+(_0xaff1e6(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x66')])?'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x67')]:'');}return _0x4225e6+')';};var _0x57cad7={'where':{'id':_0x508866['params']['id']}},_0x2409a8,_0xaea7e0,_0xd12560,_0x9e82c,_0x151f3c;_0x57cad7=_['merge']({},_0x57cad7,_0x508866[_0xd187('0x3d')]);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x57cad7)[_0xd187('0x26')](function(_0x13e05a){if(_0x13e05a){_0x2409a8=_0x13e05a;return _0x13e05a[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1291cc){if(_0x1291cc){if(!_0x1291cc[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0xaea7e0=_0x1291cc;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x54e908){if(_0x54e908){_0xd12560=_[_0xd187('0x6d')](_0x54e908,'id');var _0x1a9979;var _0x4bec3e=squel['select']();_0x4bec3e[_0xd187('0x6e')](_0x2409a8[_0xd187('0x6f')]);for(var _0x2ac56f=0x0;_0x2ac56f<_0xaea7e0[_0xd187('0x64')];_0x2ac56f+=0x1){_0x1a9979=_0xaea7e0[_0x2ac56f]['MetricId']?_0xd12560[_0xaea7e0[_0x2ac56f][_0xd187('0x70')]][_0xd187('0x71')]:_0xaea7e0[_0x2ac56f]['field'];_0x1a9979=_0xaea7e0[_0x2ac56f]['function']?_[_0xd187('0x72')](_0x56b36b[_0xaea7e0[_0x2ac56f]['function']],'%s',_0x1a9979):_0x1a9979;_0x1a9979=_0xaea7e0[_0x2ac56f][_0xd187('0x73')]?_[_0xd187('0x72')](_0x2c7dd9[_0xaea7e0[_0x2ac56f]['format']],'%s',_0x1a9979):_0x1a9979;if(_0xaea7e0[_0x2ac56f][_0xd187('0x74')]){_0x4bec3e['group'](_0x1a9979);}_0xaea7e0[_0x2ac56f][_0xd187('0x75')]&&_0x4bec3e['order'](_0x1a9979,_0xaea7e0[_0x2ac56f]['orderBy']==='DESC'?![]:!![]);_0x4bec3e[_0xd187('0x76')](_0x1a9979,_0xaea7e0[_0x2ac56f][_0xd187('0x77')]||_0x1a9979);}if(_0x2409a8[_0xd187('0x78')]){_0x2409a8[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x78')]);for(var _0x11858e=0x0;_0x11858e<_0x2409a8[_0xd187('0x78')]['length'];_0x11858e+=0x1){if(_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x1675d9,_0x2409a8['joins'][_0x11858e][_0xd187('0x30')])&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7a')]&&_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable']&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7b')]){_0x4bec3e[_0x2409a8['joins'][_0x11858e][_0xd187('0x30')]](_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7c')],null,util[_0xd187('0x73')]('%s.%s\x20=\x20%s.%s',_0x2409a8[_0xd187('0x6f')],_0x2409a8[_0xd187('0x78')][_0x11858e]['parentKey'],_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable'],_0x2409a8['joins'][_0x11858e]['foreignKey']));}}}if(_0x2409a8[_0xd187('0x7d')]){_0x2409a8[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x7d')]);_0x4bec3e[_0xd187('0x3b')](_0x48c82d(_0x2409a8[_0xd187('0x7d')]['group']));}_0x151f3c=_0x4bec3e[_0xd187('0x7e')]();_0x4bec3e[_0xd187('0x1e')](_0x2265fb);_0x4bec3e['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x4bec3e[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x4bec3e[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes'][_0xd187('0x82')]});}})[_0xd187('0x26')](respondWithResult(_0x100d64,null))[_0xd187('0x40')](handleError(_0x100d64,null));};function runReport(_0xbc650f,_0x1da684,_0x2879ff){var _0x1982cd=_0x1da684[_0xd187('0x2a')];var _0x3d9b2f=0xa;var _0xf31fac=[_0xd187('0x83'),_0xd187('0x4e'),'right_join','cross_join'];var _0x3d7e97={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x520f86={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd187('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x1ccb17=function(_0x432995){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x84'),_0xd187('0x62')],_0x432995);};var _0x395e45=function(_0x1e8839){if(!_0x1e8839||!_0x1e8839[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x2101a3='(',_0x25fc08=0x0;_0x25fc08<_0x1e8839['rules'][_0xd187('0x64')];_0x25fc08+=0x1){_0x25fc08>0x0&&(_0x2101a3+='\x20'+_0x1e8839[_0xd187('0x85')]+'\x20');_0x2101a3+=_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x65')]?_0x395e45(_0x1e8839['rules'][_0x25fc08][_0xd187('0x65')]):_0x1e8839[_0xd187('0x63')][_0x25fc08]['field']+'\x20'+_0x1e8839['rules'][_0x25fc08][_0xd187('0x66')]+(_0x1ccb17(_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x66')])?'\x20'+_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x67')]:'');}return _0x2101a3+')';};var _0x475ea9={'where':{'id':_0xbc650f['id']}},_0x4dd0c7,_0x22900,_0x22424d,_0x5b7870,_0x3244dd;_0x475ea9=_[_0xd187('0x3c')]({},_0x475ea9,_0x2879ff);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x475ea9)['then'](function(_0x5be1c9){if(_0x5be1c9){_0x4dd0c7=_0x5be1c9;return _0x5be1c9[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1cd0d2){if(_0x1cd0d2){if(!_0x1cd0d2['length']){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x22900=_0x1cd0d2;return db[_0xd187('0x86')]['findAll']({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x4efb9f){if(_0x4efb9f){_0x22424d=_['keyBy'](_0x4efb9f,'id');var _0x4a9310;var _0x54bf98=squel['select']();_0x54bf98['from'](_0x4dd0c7['table']);for(var _0x323311=0x0;_0x323311<_0x22900[_0xd187('0x64')];_0x323311+=0x1){_0x4a9310=_0x22900[_0x323311]['MetricId']?_0x22424d[_0x22900[_0x323311][_0xd187('0x70')]][_0xd187('0x71')]:_0x22900[_0x323311][_0xd187('0x76')];_0x4a9310=_0x22900[_0x323311][_0xd187('0x87')]?_[_0xd187('0x72')](_0x3d7e97[_0x22900[_0x323311]['function']],'%s',_0x4a9310):_0x4a9310;_0x4a9310=_0x22900[_0x323311][_0xd187('0x73')]?_['replace'](_0x520f86[_0x22900[_0x323311][_0xd187('0x73')]],'%s',_0x4a9310):_0x4a9310;if(_0x22900[_0x323311][_0xd187('0x74')]){_0x54bf98[_0xd187('0x65')](_0x4a9310);}_0x22900[_0x323311][_0xd187('0x75')]&&_0x54bf98[_0xd187('0x38')](_0x4a9310,_0x22900[_0x323311][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x54bf98['field'](_0x4a9310,_0x22900[_0x323311][_0xd187('0x77')]||_0x4a9310);}if(_0x4dd0c7[_0xd187('0x78')]){_0x4dd0c7['joins']=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x78')]);for(var _0x5df926=0x0;_0x5df926<_0x4dd0c7[_0xd187('0x78')][_0xd187('0x64')];_0x5df926+=0x1){if(_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0xf31fac,_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')])&&_0x4dd0c7[_0xd187('0x78')][_0x5df926]['parentKey']&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')]&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]){_0x54bf98[_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]](_0x4dd0c7['joins'][_0x5df926]['foreignTable'],null,util[_0xd187('0x73')](_0xd187('0x89'),_0x4dd0c7['table'],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7a')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]));}}}if(_0x4dd0c7['conditions']){_0x4dd0c7[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x7d')]);_0x54bf98[_0xd187('0x3b')](_0x395e45(_0x4dd0c7[_0xd187('0x7d')][_0xd187('0x65')]));}_0x3244dd=_0x54bf98[_0xd187('0x7e')]();_0x54bf98[_0xd187('0x1e')](_0x3d9b2f);_0x54bf98[_0xd187('0x21')](0x0);return;}})['then'](function(){if(_0x1da684[_0xd187('0x8a')]===_0xd187('0x8b')){return null;}var _0x25a053=_['merge'](_0x1da684,{'name':_0x1da684[_0xd187('0x8c')]||_0x1da684[_0xd187('0x2a')]||_0x4dd0c7[_0xd187('0x2a')],'basename':_0x1982cd,'savename':util[_0xd187('0x73')](_0xd187('0x8d'),_0x1da684[_0xd187('0x2a')]||_0x4dd0c7['name'],require(_0xd187('0x8e'))[_0xd187('0x8f')](0x4),_0x1da684[_0xd187('0x8a')]||'csv'),'reportId':_0x4dd0c7['id'],'reportType':_0xd187('0x90')});return db[_0xd187('0x91')][_0xd187('0x42')](_0x25a053,{'raw':!![]});})[_0xd187('0x26')](function(_0x12599e){if(_0x4dd0c7[_0xd187('0x6f')]==='cdr'){_0x3244dd[_0xd187('0x3b')](_0x4dd0c7[_0xd187('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1da684[_0xd187('0x92')],_0x1da684[_0xd187('0x93')]);}else{_0x3244dd['where'](_0x4dd0c7[_0xd187('0x6f')]+_0xd187('0x94'),_0x1da684['startDate'],_0x1da684[_0xd187('0x93')]);}if(_0x12599e){logger[_0xd187('0x95')]('Run\x20Query:',_0x3244dd[_0xd187('0x80')]());require('child_process')[_0xd187('0x96')](path[_0xd187('0x83')](__dirname,_0xd187('0x97'),_0x12599e[_0xd187('0x8a')]),[_0x12599e['id'],_0x3244dd[_0xd187('0x80')](),path['join'](__dirname,'../../files/reports',_0x12599e[_0xd187('0x98')]),_0x1982cd]);return _0x12599e;}else{var _0x2a2c7f=squel[_0xd187('0x99')]();_0x2a2c7f[_0xd187('0x6e')]('('+_0x3244dd[_0xd187('0x80')]()+')',_0xd187('0x9a'));_0x2a2c7f[_0xd187('0x76')]('COUNT(*)',_0xd187('0x20'));_0x3244dd[_0xd187('0x1e')](_0x1da684[_0xd187('0x1e')]||_0x3d9b2f);_0x3244dd[_0xd187('0x21')](_0x1da684[_0xd187('0x21')]||0x0);return dbH[_0xd187('0x81')]['query'](_0x2a2c7f[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')][_0xd187('0x82')]})[_0xd187('0x26')](function(_0x38a7cd){if(!_0x38a7cd[_0xd187('0x64')]){_0x5b7870=0x0;}else{_0x5b7870=_0x38a7cd[0x0][_0xd187('0x20')]||0x0;}return dbH['sequelize'][_0xd187('0x35')](_0x3244dd['toString'](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')]['SELECT']});})[_0xd187('0x26')](function(_0x254e0a){return{'rows':_0x254e0a||[],'count':_0x5b7870};});}});}exports['run']=function(_0x1776c1,_0x497a94){return runReport(_0x1776c1[_0xd187('0x4c')],_0x1776c1['query'],_0x1776c1['options'])[_0xd187('0x26')](respondWithResult(_0x497a94,null))[_0xd187('0x40')](handleError(_0x497a94,null));};exports[_0xd187('0x9c')]=runReport;exports[_0xd187('0x35')]=function(_0x568f72,_0x357526){var _0x13ee40=0xa;var _0x20c269=[_0xd187('0x83'),_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x25ff89={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x28798f={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x56fcde=function(_0x37b1b0){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x37b1b0);};var _0x428e6c=function(_0x4524c3){if(!_0x4524c3||!_0x4524c3[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x3a2937='(',_0xf03f9a=0x0;_0xf03f9a<_0x4524c3['rules'][_0xd187('0x64')];_0xf03f9a+=0x1){_0xf03f9a>0x0&&(_0x3a2937+='\x20'+_0x4524c3['operator']+'\x20');_0x3a2937+=_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']?_0x428e6c(_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']):_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x76')]+'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a]['condition']+(_0x56fcde(_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x66')])?'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x67')]:'');}return _0x3a2937+')';};var _0x37405d={'where':{'id':_0x568f72[_0xd187('0x4c')]['id']}},_0xe84f78,_0x12b4a4,_0x3d09a6,_0x5acea7,_0x2a756f;_0x37405d=_[_0xd187('0x3c')]({},_0x37405d,_0x568f72['options']);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x37405d)[_0xd187('0x26')](function(_0x110af6){if(_0x110af6){_0xe84f78=_0x110af6;return _0x110af6[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x2e4db4){if(_0x2e4db4){if(!_0x2e4db4[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x12b4a4=_0x2e4db4;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x50d5b8){if(_0x50d5b8){_0x3d09a6=_[_0xd187('0x6d')](_0x50d5b8,'id');var _0x48ef98;var _0x2008e9=squel['select']();_0x2008e9[_0xd187('0x6e')](_0xe84f78[_0xd187('0x6f')]);for(var _0x9b8840=0x0;_0x9b8840<_0x12b4a4[_0xd187('0x64')];_0x9b8840+=0x1){_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x70')]?_0x3d09a6[_0x12b4a4[_0x9b8840]['MetricId']][_0xd187('0x71')]:_0x12b4a4[_0x9b8840][_0xd187('0x76')];_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x87')]?_[_0xd187('0x72')](_0x25ff89[_0x12b4a4[_0x9b8840][_0xd187('0x87')]],'%s',_0x48ef98):_0x48ef98;_0x48ef98=_0x12b4a4[_0x9b8840]['format']?_[_0xd187('0x72')](_0x28798f[_0x12b4a4[_0x9b8840][_0xd187('0x73')]],'%s',_0x48ef98):_0x48ef98;if(_0x12b4a4[_0x9b8840][_0xd187('0x74')]){_0x2008e9['group'](_0x48ef98);}_0x12b4a4[_0x9b8840]['orderBy']&&_0x2008e9[_0xd187('0x38')](_0x48ef98,_0x12b4a4[_0x9b8840][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x2008e9[_0xd187('0x76')](_0x48ef98,_0x12b4a4[_0x9b8840]['alias']||_0x48ef98);}if(_0xe84f78[_0xd187('0x78')]){_0xe84f78[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0xe84f78[_0xd187('0x78')]);for(var _0x4bff96=0x0;_0x4bff96<_0xe84f78[_0xd187('0x78')]['length'];_0x4bff96+=0x1){if(_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x20c269,_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')])&&_0xe84f78['joins'][_0x4bff96][_0xd187('0x7a')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96]['foreignKey']){_0x2008e9[_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]](_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],null,util[_0xd187('0x73')](_0xd187('0x89'),_0xe84f78[_0xd187('0x6f')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7a')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7b')]));}}}if(_0xe84f78['conditions']){_0xe84f78[_0xd187('0x7d')]=JSON['parse'](_0xe84f78[_0xd187('0x7d')]);_0x2008e9['where'](_0x428e6c(_0xe84f78[_0xd187('0x7d')][_0xd187('0x65')]));}_0x2a756f=_0x2008e9[_0xd187('0x7e')]();_0x2008e9[_0xd187('0x1e')](_0x13ee40);_0x2008e9['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x2008e9[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x2008e9[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes']['SELECT']});}})[_0xd187('0x26')](function(){return{'sql':_0x2a756f[_0xd187('0x80')]()};})[_0xd187('0x26')](respondWithResult(_0x357526,null))['catch'](handleError(_0x357526,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index aedc5a1..ab3437c 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 _0x6b10=['analytics_default_reports','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport'];(function(_0xd31621,_0x17b567){var _0x2e7ac0=function(_0x3c5a8d){while(--_0x3c5a8d){_0xd31621['push'](_0xd31621['shift']());}};_0x2e7ac0(++_0x17b567);}(_0x6b10,0x115));var _0x06b1=function(_0x1bac6b,_0x4891cd){_0x1bac6b=_0x1bac6b-0x0;var _0x6a71be=_0x6b10[_0x1bac6b];return _0x6a71be;};'use strict';var _=require(_0x06b1('0x0'));var util=require('util');var logger=require(_0x06b1('0x1'))('api');var moment=require(_0x06b1('0x2'));var BPromise=require(_0x06b1('0x3'));var rp=require(_0x06b1('0x4'));var fs=require('fs');var path=require(_0x06b1('0x5'));var rimraf=require(_0x06b1('0x6'));var config=require(_0x06b1('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x06b1('0x8')]=function(_0x53fbff,_0x1a0334){return _0x53fbff[_0x06b1('0x9')](_0x06b1('0xa'),attributes,{'tableName':_0x06b1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7973=['moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x447d73,_0x50f8c7){var _0x343b07=function(_0x467a77){while(--_0x467a77){_0x447d73['push'](_0x447d73['shift']());}};_0x343b07(++_0x50f8c7);}(_0x7973,0x152));var _0x3797=function(_0x554336,_0x5dc9bf){_0x554336=_0x554336-0x0;var _0x372341=_0x7973[_0x554336];return _0x372341;};'use strict';var _=require(_0x3797('0x0'));var util=require(_0x3797('0x1'));var logger=require(_0x3797('0x2'))('api');var moment=require(_0x3797('0x3'));var BPromise=require(_0x3797('0x4'));var rp=require(_0x3797('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3797('0x6'));var config=require(_0x3797('0x7'));var attributes=require(_0x3797('0x8'));module[_0x3797('0x9')]=function(_0x2999e5,_0x25857a){return _0x2999e5[_0x3797('0xa')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','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 a41a2a3..68cc152 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 _0x3c00=['jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','error','code','message','request\x20sent','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment'];(function(_0x3a78a0,_0x44985f){var _0x48e917=function(_0x1e428c){while(--_0x1e428c){_0x3a78a0['push'](_0x3a78a0['shift']());}};_0x48e917(++_0x44985f);}(_0x3c00,0x1d4));var _0x03c0=function(_0x86782f,_0x436231){_0x86782f=_0x86782f-0x0;var _0x2d50b5=_0x3c00[_0x86782f];return _0x2d50b5;};'use strict';var _=require('lodash');var util=require(_0x03c0('0x0'));var moment=require(_0x03c0('0x1'));var BPromise=require(_0x03c0('0x2'));var rs=require(_0x03c0('0x3'));var fs=require('fs');var Redis=require(_0x03c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x03c0('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x03c0('0x6'));var jayson=require(_0x03c0('0x7'));var client=jayson[_0x03c0('0x8')][_0x03c0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b4827,_0x2bbb03,_0x3dd539){return new BPromise(function(_0x2bdb2e,_0x22730b){return client[_0x03c0('0xa')](_0x1b4827,_0x3dd539)[_0x03c0('0xb')](function(_0x4e5048){logger[_0x03c0('0xc')](_0x03c0('0xd'),_0x2bbb03,'request\x20sent');logger[_0x03c0('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2bbb03,'request\x20sent',JSON['stringify'](_0x4e5048));if(_0x4e5048['error']){if(_0x4e5048[_0x03c0('0xf')][_0x03c0('0x10')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2bbb03,_0x4e5048['error']['message']);return _0x22730b(_0x4e5048[_0x03c0('0xf')][_0x03c0('0x11')]);}logger[_0x03c0('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2bbb03,_0x4e5048[_0x03c0('0xf')][_0x03c0('0x11')]);return _0x2bdb2e(_0x4e5048['error'][_0x03c0('0x11')]);}else{logger[_0x03c0('0xc')](_0x03c0('0xd'),_0x2bbb03,_0x03c0('0x12'));_0x2bdb2e(_0x4e5048['result']['message']);}})['catch'](function(_0x18d3ca){logger[_0x03c0('0xf')](_0x03c0('0xd'),_0x2bbb03,_0x18d3ca);_0x22730b(_0x18d3ca);});});}
\ No newline at end of file
+var _0x89f7=['catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x379e0f,_0x3eca39){var _0x5959b9=function(_0x1b65d4){while(--_0x1b65d4){_0x379e0f['push'](_0x379e0f['shift']());}};_0x5959b9(++_0x3eca39);}(_0x89f7,0xa9));var _0x789f=function(_0x269c42,_0xeed101){_0x269c42=_0x269c42-0x0;var _0x4dad76=_0x89f7[_0x269c42];return _0x4dad76;};'use strict';var _=require(_0x789f('0x0'));var util=require(_0x789f('0x1'));var moment=require('moment');var BPromise=require(_0x789f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x789f('0x3'));var db=require(_0x789f('0x4'))['db'];var utils=require(_0x789f('0x5'));var logger=require(_0x789f('0x6'))(_0x789f('0x7'));var config=require(_0x789f('0x8'));var jayson=require(_0x789f('0x9'));var client=jayson[_0x789f('0xa')][_0x789f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51838c,_0x4551d2,_0x14d537){return new BPromise(function(_0x316016,_0x47db73){return client[_0x789f('0xc')](_0x51838c,_0x14d537)[_0x789f('0xd')](function(_0x550675){logger[_0x789f('0xe')](_0x789f('0xf'),_0x4551d2,_0x789f('0x10'));logger[_0x789f('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4551d2,_0x789f('0x10'),JSON[_0x789f('0x12')](_0x550675));if(_0x550675[_0x789f('0x13')]){if(_0x550675['error'][_0x789f('0x14')]===0x1f4){logger[_0x789f('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4551d2,_0x550675[_0x789f('0x13')][_0x789f('0x15')]);return _0x47db73(_0x550675[_0x789f('0x13')]['message']);}logger['error'](_0x789f('0xf'),_0x4551d2,_0x550675[_0x789f('0x13')][_0x789f('0x15')]);return _0x316016(_0x550675[_0x789f('0x13')][_0x789f('0x15')]);}else{logger[_0x789f('0xe')](_0x789f('0xf'),_0x4551d2,_0x789f('0x10'));_0x316016(_0x550675[_0x789f('0x16')][_0x789f('0x15')]);}})[_0x789f('0x17')](function(_0x1c2989){logger['error'](_0x789f('0xf'),_0x4551d2,_0x1c2989);_0x47db73(_0x1c2989);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 516b22f..a64b237 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 _0xb344=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','/:id','show','get','run','query','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5b6983,_0x53d5f9){var _0x1e2978=function(_0x44f668){while(--_0x44f668){_0x5b6983['push'](_0x5b6983['shift']());}};_0x1e2978(++_0x53d5f9);}(_0xb344,0x152));var _0x4b34=function(_0x59aecc,_0x255014){_0x59aecc=_0x59aecc-0x0;var _0x46b112=_0xb344[_0x59aecc];return _0x46b112;};'use strict';var multer=require(_0x4b34('0x0'));var util=require(_0x4b34('0x1'));var path=require(_0x4b34('0x2'));var timeout=require(_0x4b34('0x3'));var express=require(_0x4b34('0x4'));var router=express[_0x4b34('0x5')]();var fs_extra=require(_0x4b34('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4b34('0x7'));var config=require(_0x4b34('0x8'));var controller=require(_0x4b34('0x9'));router['get']('/',auth[_0x4b34('0xa')](),controller[_0x4b34('0xb')]);router['get'](_0x4b34('0xc'),auth['isAuthenticated'](),controller[_0x4b34('0xd')]);router[_0x4b34('0xe')]('/:id/preview',auth[_0x4b34('0xa')](),controller['preview']);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0x4b34('0xf')]);router['get']('/:id/query',auth['isAuthenticated'](),controller[_0x4b34('0x10')]);router[_0x4b34('0x11')]('/',auth[_0x4b34('0xa')](),controller[_0x4b34('0x12')]);router[_0x4b34('0x13')](_0x4b34('0xc'),auth[_0x4b34('0xa')](),controller[_0x4b34('0x14')]);router[_0x4b34('0x15')](_0x4b34('0xc'),auth[_0x4b34('0xa')](),controller['destroy']);module[_0x4b34('0x16')]=router;
\ No newline at end of file
+var _0xfcb9=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','util'];(function(_0x5abe28,_0x34f1ae){var _0x40bb6b=function(_0x1c7b9e){while(--_0x1c7b9e){_0x5abe28['push'](_0x5abe28['shift']());}};_0x40bb6b(++_0x34f1ae);}(_0xfcb9,0x14e));var _0x9fcb=function(_0x19c05f,_0x3c729a){_0x19c05f=_0x19c05f-0x0;var _0x28f808=_0xfcb9[_0x19c05f];return _0x28f808;};'use strict';var multer=require(_0x9fcb('0x0'));var util=require(_0x9fcb('0x1'));var path=require(_0x9fcb('0x2'));var timeout=require(_0x9fcb('0x3'));var express=require(_0x9fcb('0x4'));var router=express[_0x9fcb('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9fcb('0x6'));var interaction=require(_0x9fcb('0x7'));var config=require(_0x9fcb('0x8'));var controller=require(_0x9fcb('0x9'));router[_0x9fcb('0xa')]('/',auth[_0x9fcb('0xb')](),controller[_0x9fcb('0xc')]);router['get'](_0x9fcb('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9fcb('0xa')](_0x9fcb('0xe'),auth[_0x9fcb('0xb')](),controller['preview']);router[_0x9fcb('0xa')]('/:id/run',auth[_0x9fcb('0xb')](),controller[_0x9fcb('0xf')]);router['get'](_0x9fcb('0x10'),auth[_0x9fcb('0xb')](),controller[_0x9fcb('0x11')]);router['post']('/',auth[_0x9fcb('0xb')](),controller[_0x9fcb('0x12')]);router[_0x9fcb('0x13')](_0x9fcb('0xd'),auth[_0x9fcb('0xb')](),controller[_0x9fcb('0x14')]);router[_0x9fcb('0x15')](_0x9fcb('0xd'),auth[_0x9fcb('0xb')](),controller[_0x9fcb('0x16')]);module[_0x9fcb('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index c55b90d..e021341 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 _0xbed8=['csv','pdf','xlsx','DATE','Loading','scheduled','manual','UNSIGNED','sequelize','moment','STRING','ENUM'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xbed8,0x80));var _0x8bed=function(_0x398d85,_0x2465d7){_0x398d85=_0x398d85-0x0;var _0x33c2bb=_0xbed8[_0x398d85];return _0x33c2bb;};'use strict';var Sequelize=require(_0x8bed('0x0'));var moment=require(_0x8bed('0x1'));module['exports']={'name':{'type':Sequelize[_0x8bed('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x8bed('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x8bed('0x3')](_0x8bed('0x4'),_0x8bed('0x5'),_0x8bed('0x6')),'allowNull':![],'defaultValue':_0x8bed('0x4')},'savename':{'type':Sequelize[_0x8bed('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8bed('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0x8bed('0x8')},'type':{'type':Sequelize[_0x8bed('0x3')]('manual',_0x8bed('0x9')),'allowNull':![],'defaultValue':_0x8bed('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x8bed('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x10be=['moment','STRING','ENUM','DATE','manual','scheduled','INTEGER'];(function(_0x387440,_0x5e5ff3){var _0x359d8e=function(_0x3dad05){while(--_0x3dad05){_0x387440['push'](_0x387440['shift']());}};_0x359d8e(++_0x5e5ff3);}(_0x10be,0x103));var _0xe10b=function(_0x4a356c,_0x2cbf99){_0x4a356c=_0x4a356c-0x0;var _0x59b298=_0x10be[_0x4a356c];return _0x59b298;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe10b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xe10b('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0xe10b('0x2')]('csv','pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xe10b('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe10b('0x3')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xe10b('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xe10b('0x2')](_0xe10b('0x4'),_0xe10b('0x5')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xe10b('0x6')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index c14ef58..ac0ea24 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 _0x57f4=['set','apply','reject','update','then','destroy','get','ExtractedReports','error','stack','name','send','index','AnalyticExtractedReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','download','params','basename','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','root','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit'];(function(_0x8f4ca2,_0xc4ac52){var _0x126663=function(_0x1eebee){while(--_0x1eebee){_0x8f4ca2['push'](_0x8f4ca2['shift']());}};_0x126663(++_0xc4ac52);}(_0x57f4,0x1b6));var _0x457f=function(_0x5b872c,_0x521dc6){_0x5b872c=_0x5b872c-0x0;var _0x4ffc94=_0x57f4[_0x5b872c];return _0x4ffc94;};'use strict';var emlformat=require(_0x457f('0x0'));var rimraf=require(_0x457f('0x1'));var zipdir=require(_0x457f('0x2'));var jsonpatch=require(_0x457f('0x3'));var rp=require(_0x457f('0x4'));var moment=require(_0x457f('0x5'));var BPromise=require(_0x457f('0x6'));var Mustache=require(_0x457f('0x7'));var util=require(_0x457f('0x8'));var path=require('path');var sox=require(_0x457f('0x9'));var csv=require('to-csv');var ejs=require(_0x457f('0xa'));var fs=require('fs');var fs_extra=require(_0x457f('0xb'));var _=require(_0x457f('0xc'));var squel=require('squel');var crypto=require(_0x457f('0xd'));var jsforce=require(_0x457f('0xe'));var deskjs=require(_0x457f('0xf'));var toCsv=require(_0x457f('0x10'));var querystring=require(_0x457f('0x11'));var Papa=require(_0x457f('0x12'));var Redis=require(_0x457f('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x457f('0x14'));var logger=require(_0x457f('0x15'))('api');var utils=require(_0x457f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x457f('0x17'))['db'];function respondWithStatusCode(_0x59d093,_0x561e52){_0x561e52=_0x561e52||0xcc;return function(_0x1ffc30){if(_0x1ffc30){return _0x59d093[_0x457f('0x18')](_0x561e52);}return _0x59d093[_0x457f('0x19')](_0x561e52)[_0x457f('0x1a')]();};}function respondWithResult(_0x1acb6a,_0x492708){_0x492708=_0x492708||0xc8;return function(_0x36d745){if(_0x36d745){return _0x1acb6a[_0x457f('0x19')](_0x492708)[_0x457f('0x1b')](_0x36d745);}};}function respondWithFilteredResult(_0x2499a9,_0x5d7d0f){return function(_0x476838){if(_0x476838){var _0x92b8e0=typeof _0x5d7d0f['offset']===_0x457f('0x1c')&&typeof _0x5d7d0f['limit']===_0x457f('0x1c');var _0x12c6bd=_0x476838[_0x457f('0x1d')];var _0x47b349=_0x92b8e0?0x0:_0x5d7d0f[_0x457f('0x1e')];var _0x2abd3f=_0x92b8e0?_0x476838[_0x457f('0x1d')]:_0x5d7d0f[_0x457f('0x1e')]+_0x5d7d0f[_0x457f('0x1f')];var _0xc6b218;if(_0x2abd3f>=_0x12c6bd){_0x2abd3f=_0x12c6bd;_0xc6b218=0xc8;}else{_0xc6b218=0xce;}_0x2499a9[_0x457f('0x19')](_0xc6b218);return _0x2499a9[_0x457f('0x20')]('Content-Range',_0x47b349+'-'+_0x2abd3f+'/'+_0x12c6bd)[_0x457f('0x1b')](_0x476838);}return null;};}function patchUpdates(_0xfc9273){return function(_0x202183){try{jsonpatch[_0x457f('0x21')](_0x202183,_0xfc9273,!![]);}catch(_0x1ac777){return BPromise[_0x457f('0x22')](_0x1ac777);}return _0x202183['save']();};}function saveUpdates(_0x436cdd,_0x2b555c){return function(_0x496cf1){if(_0x496cf1){return _0x496cf1[_0x457f('0x23')](_0x436cdd)[_0x457f('0x24')](function(_0x2319d7){return _0x2319d7;});}return null;};}function removeEntity(_0x471fac,_0xe44762){return function(_0x111aeb){if(_0x111aeb){return _0x111aeb[_0x457f('0x25')]()[_0x457f('0x24')](function(){var _0x18447a=_0x111aeb[_0x457f('0x26')]({'plain':!![]});var _0x1753af=_0x457f('0x27');return db['UserProfileResource'][_0x457f('0x25')]({'where':{'type':_0x1753af,'resourceId':_0x18447a['id']}})['then'](function(){return _0x111aeb;});})[_0x457f('0x24')](function(){_0x471fac[_0x457f('0x19')](0xcc)[_0x457f('0x1a')]();});}};}function handleEntityNotFound(_0x5c951b,_0x4a4364){return function(_0x1e6e81){if(!_0x1e6e81){_0x5c951b['sendStatus'](0x194);}return _0x1e6e81;};}function handleError(_0x2148a5,_0x16b947){_0x16b947=_0x16b947||0x1f4;return function(_0xd330e4){logger[_0x457f('0x28')](_0xd330e4[_0x457f('0x29')]);if(_0xd330e4[_0x457f('0x2a')]){delete _0xd330e4[_0x457f('0x2a')];}_0x2148a5['status'](_0x16b947)[_0x457f('0x2b')](_0xd330e4);};}exports[_0x457f('0x2c')]=function(_0x41bda9,_0x28f3d3){var _0x57f9de={},_0x3def51={},_0xe96095={'count':0x0,'rows':[]};var _0x21a148=_['map'](db[_0x457f('0x2d')]['rawAttributes'],function(_0x3354af){return{'name':_0x3354af['fieldName'],'type':_0x3354af[_0x457f('0x2e')][_0x457f('0x2f')]};});_0x3def51[_0x457f('0x30')]=_['map'](_0x21a148,_0x457f('0x2a'));_0x3def51[_0x457f('0x31')]=_[_0x457f('0x32')](_0x41bda9[_0x457f('0x31')]);_0x3def51[_0x457f('0x33')]=_[_0x457f('0x34')](_0x3def51[_0x457f('0x30')],_0x3def51['query']);_0x57f9de[_0x457f('0x35')]=_[_0x457f('0x34')](_0x3def51[_0x457f('0x30')],qs[_0x457f('0x36')](_0x41bda9[_0x457f('0x31')][_0x457f('0x36')]));_0x57f9de['attributes']=_0x57f9de[_0x457f('0x35')][_0x457f('0x37')]?_0x57f9de[_0x457f('0x35')]:_0x3def51['model'];if(!_0x41bda9[_0x457f('0x31')][_0x457f('0x38')](_0x457f('0x39'))){_0x57f9de['limit']=qs['limit'](_0x41bda9[_0x457f('0x31')][_0x457f('0x1f')]);_0x57f9de[_0x457f('0x1e')]=qs[_0x457f('0x1e')](_0x41bda9[_0x457f('0x31')][_0x457f('0x1e')]);}_0x57f9de[_0x457f('0x3a')]=qs[_0x457f('0x3b')](_0x41bda9[_0x457f('0x31')][_0x457f('0x3b')]);_0x57f9de[_0x457f('0x3c')]=qs[_0x457f('0x33')](_[_0x457f('0x3d')](_0x41bda9[_0x457f('0x31')],_0x3def51[_0x457f('0x33')]),_0x21a148);if(_0x41bda9['query'][_0x457f('0x3e')]){_0x57f9de[_0x457f('0x3c')]=_[_0x457f('0x3f')](_0x57f9de['where'],{'$or':_[_0x457f('0x40')](_0x21a148,function(_0x4c7126){if(_0x4c7126[_0x457f('0x2e')]!==_0x457f('0x41')){var _0x34e466={};_0x34e466[_0x4c7126['name']]={'$like':'%'+_0x41bda9[_0x457f('0x31')][_0x457f('0x3e')]+'%'};return _0x34e466;}})});}_0x57f9de=_[_0x457f('0x3f')]({},_0x57f9de,_0x41bda9[_0x457f('0x42')]);var _0x1fbf17={'where':_0x57f9de[_0x457f('0x3c')]};return db[_0x457f('0x2d')]['count'](_0x1fbf17)['then'](function(_0x27eadb){_0xe96095[_0x457f('0x1d')]=_0x27eadb;if(_0x41bda9['query'][_0x457f('0x43')]){_0x57f9de['include']=[{'all':!![]}];}return db[_0x457f('0x2d')][_0x457f('0x44')](_0x57f9de);})[_0x457f('0x24')](function(_0x320154){_0xe96095['rows']=_0x320154;return _0xe96095;})[_0x457f('0x24')](respondWithFilteredResult(_0x28f3d3,_0x57f9de))[_0x457f('0x45')](handleError(_0x28f3d3,null));};exports[_0x457f('0x46')]=function(_0x1d7d5d,_0x5483d2){var _0x27bb2f={'raw':!![],'where':{'id':_0x1d7d5d['params']['id']}},_0x2d448e={};_0x2d448e[_0x457f('0x30')]=_[_0x457f('0x32')](db['AnalyticExtractedReport']['rawAttributes']);_0x2d448e[_0x457f('0x31')]=_[_0x457f('0x32')](_0x1d7d5d[_0x457f('0x31')]);_0x2d448e['filters']=_[_0x457f('0x34')](_0x2d448e[_0x457f('0x30')],_0x2d448e['query']);_0x27bb2f['attributes']=_['intersection'](_0x2d448e[_0x457f('0x30')],qs[_0x457f('0x36')](_0x1d7d5d[_0x457f('0x31')][_0x457f('0x36')]));_0x27bb2f[_0x457f('0x35')]=_0x27bb2f[_0x457f('0x35')]['length']?_0x27bb2f[_0x457f('0x35')]:_0x2d448e[_0x457f('0x30')];if(_0x1d7d5d['query']['includeAll']){_0x27bb2f[_0x457f('0x47')]=[{'all':!![]}];}_0x27bb2f=_[_0x457f('0x3f')]({},_0x27bb2f,_0x1d7d5d[_0x457f('0x42')]);return db['AnalyticExtractedReport'][_0x457f('0x48')](_0x27bb2f)[_0x457f('0x24')](handleEntityNotFound(_0x5483d2,null))[_0x457f('0x24')](respondWithResult(_0x5483d2,null))[_0x457f('0x45')](handleError(_0x5483d2,null));};exports['create']=function(_0x5ae21c,_0x1174d6){return db[_0x457f('0x2d')][_0x457f('0x49')](_0x5ae21c[_0x457f('0x4a')],{})[_0x457f('0x24')](function(_0x132b40){var _0x3a4fa3=_0x5ae21c[_0x457f('0x4b')]['get']({'plain':!![]});if(!_0x3a4fa3)throw new Error(_0x457f('0x4c'));if(_0x3a4fa3['role']===_0x457f('0x4b')){var _0x4ec2d8=_0x132b40['get']({'plain':!![]});var _0x236464=_0x457f('0x27');return db[_0x457f('0x4d')][_0x457f('0x48')]({'where':{'name':_0x236464,'userProfileId':_0x3a4fa3[_0x457f('0x4e')]},'raw':!![]})[_0x457f('0x24')](function(_0x13ff08){if(_0x13ff08&&_0x13ff08[_0x457f('0x4f')]===0x0){return db[_0x457f('0x50')]['create']({'name':_0x4ec2d8[_0x457f('0x2a')],'resourceId':_0x4ec2d8['id'],'type':_0x13ff08[_0x457f('0x2a')],'sectionId':_0x13ff08['id']},{})['then'](function(){return _0x132b40;});}else{return _0x132b40;}})[_0x457f('0x45')](function(_0x1dea73){logger[_0x457f('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1dea73);throw _0x1dea73;});}return _0x132b40;})['then'](respondWithResult(_0x1174d6,0xc9))[_0x457f('0x45')](handleError(_0x1174d6,null));};exports[_0x457f('0x23')]=function(_0x4aa58b,_0x160dce){if(_0x4aa58b[_0x457f('0x4a')]['id']){delete _0x4aa58b[_0x457f('0x4a')]['id'];}return db[_0x457f('0x2d')][_0x457f('0x48')]({'where':{'id':_0x4aa58b['params']['id']}})['then'](handleEntityNotFound(_0x160dce,null))[_0x457f('0x24')](saveUpdates(_0x4aa58b[_0x457f('0x4a')],null))[_0x457f('0x24')](respondWithResult(_0x160dce,null))[_0x457f('0x45')](handleError(_0x160dce,null));};exports[_0x457f('0x25')]=function(_0x1044e9,_0x6e2881){return db['AnalyticExtractedReport'][_0x457f('0x48')]({'where':{'id':_0x1044e9['params']['id']}})[_0x457f('0x24')](handleEntityNotFound(_0x6e2881,null))[_0x457f('0x24')](removeEntity(_0x6e2881,null))[_0x457f('0x45')](handleError(_0x6e2881,null));};exports[_0x457f('0x51')]=function(_0x4b673b,_0x5680d5,_0x5173d2){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x4b673b[_0x457f('0x52')]['id']},'attributes':[_0x457f('0x2a'),_0x457f('0x53'),_0x457f('0x54'),_0x457f('0x55')],'raw':!![]})[_0x457f('0x24')](handleEntityNotFound(_0x5680d5,null))[_0x457f('0x24')](function(_0x2683f2){if(_0x2683f2){if(!fs[_0x457f('0x56')](path[_0x457f('0x57')](config['root'],_0x457f('0x58'),_0x2683f2['savename']))){throw new db[(_0x457f('0x59'))][(_0x457f('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x4b673b['query']['exists']){return _0x5680d5[_0x457f('0x18')](0xc8);}return _0x5680d5[_0x457f('0x51')](path[_0x457f('0x57')](config[_0x457f('0x5b')],_0x457f('0x58'),_0x2683f2[_0x457f('0x54')]),util[_0x457f('0x5c')](_0x457f('0x5d'),_0x2683f2['basename']||_0x2683f2[_0x457f('0x2a')],_0x2683f2[_0x457f('0x55')]['toLowerCase']()));}})['catch'](handleError(_0x5680d5,null));};
\ No newline at end of file
+var _0xd31d=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','fields','length','create','body','get','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','download','basename','savename','output','existsSync','join','root','Sequelize','ValidationError','exists','server/files/reports','format','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','destroy','then','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','model','query','keys','filters','intersection','attributes'];(function(_0x5a104c,_0x4c20bd){var _0x4c92cc=function(_0x13602a){while(--_0x13602a){_0x5a104c['push'](_0x5a104c['shift']());}};_0x4c92cc(++_0x4c20bd);}(_0xd31d,0x1b3));var _0xdd31=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0xd31d[_0x999b85];return _0x1d7124;};'use strict';var emlformat=require(_0xdd31('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd31('0x1'));var jsonpatch=require(_0xdd31('0x2'));var rp=require(_0xdd31('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdd31('0x4'));var util=require(_0xdd31('0x5'));var path=require(_0xdd31('0x6'));var sox=require(_0xdd31('0x7'));var csv=require(_0xdd31('0x8'));var ejs=require(_0xdd31('0x9'));var fs=require('fs');var fs_extra=require(_0xdd31('0xa'));var _=require(_0xdd31('0xb'));var squel=require(_0xdd31('0xc'));var crypto=require('crypto');var jsforce=require(_0xdd31('0xd'));var deskjs=require(_0xdd31('0xe'));var toCsv=require(_0xdd31('0x8'));var querystring=require(_0xdd31('0xf'));var Papa=require(_0xdd31('0x10'));var Redis=require(_0xdd31('0x11'));var authService=require(_0xdd31('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdd31('0x13'));var hardwareService=require(_0xdd31('0x14'));var logger=require(_0xdd31('0x15'))(_0xdd31('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdd31('0x17'));var db=require(_0xdd31('0x18'))['db'];function respondWithStatusCode(_0x4f737d,_0x4b5a95){_0x4b5a95=_0x4b5a95||0xcc;return function(_0x18262e){if(_0x18262e){return _0x4f737d['sendStatus'](_0x4b5a95);}return _0x4f737d['status'](_0x4b5a95)[_0xdd31('0x19')]();};}function respondWithResult(_0x228b43,_0x27dfb1){_0x27dfb1=_0x27dfb1||0xc8;return function(_0x5cf482){if(_0x5cf482){return _0x228b43[_0xdd31('0x1a')](_0x27dfb1)['json'](_0x5cf482);}};}function respondWithFilteredResult(_0x1e59de,_0x405bc6){return function(_0x2c1083){if(_0x2c1083){var _0x148ab5=typeof _0x405bc6[_0xdd31('0x1b')]===_0xdd31('0x1c')&&typeof _0x405bc6[_0xdd31('0x1d')]===_0xdd31('0x1c');var _0x23ddd8=_0x2c1083[_0xdd31('0x1e')];var _0x5a7370=_0x148ab5?0x0:_0x405bc6['offset'];var _0x521e55=_0x148ab5?_0x2c1083[_0xdd31('0x1e')]:_0x405bc6['offset']+_0x405bc6[_0xdd31('0x1d')];var _0x23df87;if(_0x521e55>=_0x23ddd8){_0x521e55=_0x23ddd8;_0x23df87=0xc8;}else{_0x23df87=0xce;}_0x1e59de[_0xdd31('0x1a')](_0x23df87);return _0x1e59de[_0xdd31('0x1f')](_0xdd31('0x20'),_0x5a7370+'-'+_0x521e55+'/'+_0x23ddd8)[_0xdd31('0x21')](_0x2c1083);}return null;};}function patchUpdates(_0x45145c){return function(_0x36db28){try{jsonpatch[_0xdd31('0x22')](_0x36db28,_0x45145c,!![]);}catch(_0x33713a){return BPromise['reject'](_0x33713a);}return _0x36db28[_0xdd31('0x23')]();};}function saveUpdates(_0x1c28bc,_0x4c5b31){return function(_0x24a03a){if(_0x24a03a){return _0x24a03a['update'](_0x1c28bc)['then'](function(_0x5baa38){return _0x5baa38;});}return null;};}function removeEntity(_0x475d8e,_0x551d43){return function(_0x2d4478){if(_0x2d4478){return _0x2d4478[_0xdd31('0x24')]()[_0xdd31('0x25')](function(){var _0x52aa2c=_0x2d4478['get']({'plain':!![]});var _0x1d5a71=_0xdd31('0x26');return db[_0xdd31('0x27')][_0xdd31('0x24')]({'where':{'type':_0x1d5a71,'resourceId':_0x52aa2c['id']}})['then'](function(){return _0x2d4478;});})[_0xdd31('0x25')](function(){_0x475d8e[_0xdd31('0x1a')](0xcc)[_0xdd31('0x19')]();});}};}function handleEntityNotFound(_0x26baf0,_0x2a1593){return function(_0x203ae0){if(!_0x203ae0){_0x26baf0[_0xdd31('0x28')](0x194);}return _0x203ae0;};}function handleError(_0xd9dce0,_0x290548){_0x290548=_0x290548||0x1f4;return function(_0x2de6bb){logger[_0xdd31('0x29')](_0x2de6bb[_0xdd31('0x2a')]);if(_0x2de6bb[_0xdd31('0x2b')]){delete _0x2de6bb[_0xdd31('0x2b')];}_0xd9dce0['status'](_0x290548)[_0xdd31('0x2c')](_0x2de6bb);};}exports[_0xdd31('0x2d')]=function(_0x1ad662,_0x2d13b5){var _0x296906={},_0x53232c={},_0x142652={'count':0x0,'rows':[]};var _0xf60b90=_[_0xdd31('0x2e')](db[_0xdd31('0x2f')]['rawAttributes'],function(_0x195e71){return{'name':_0x195e71[_0xdd31('0x30')],'type':_0x195e71['type']['key']};});_0x53232c[_0xdd31('0x31')]=_[_0xdd31('0x2e')](_0xf60b90,_0xdd31('0x2b'));_0x53232c[_0xdd31('0x32')]=_[_0xdd31('0x33')](_0x1ad662[_0xdd31('0x32')]);_0x53232c[_0xdd31('0x34')]=_[_0xdd31('0x35')](_0x53232c[_0xdd31('0x31')],_0x53232c[_0xdd31('0x32')]);_0x296906[_0xdd31('0x36')]=_[_0xdd31('0x35')](_0x53232c[_0xdd31('0x31')],qs['fields'](_0x1ad662[_0xdd31('0x32')]['fields']));_0x296906[_0xdd31('0x36')]=_0x296906[_0xdd31('0x36')]['length']?_0x296906['attributes']:_0x53232c['model'];if(!_0x1ad662['query'][_0xdd31('0x37')](_0xdd31('0x38'))){_0x296906[_0xdd31('0x1d')]=qs['limit'](_0x1ad662[_0xdd31('0x32')][_0xdd31('0x1d')]);_0x296906[_0xdd31('0x1b')]=qs[_0xdd31('0x1b')](_0x1ad662['query']['offset']);}_0x296906['order']=qs[_0xdd31('0x39')](_0x1ad662[_0xdd31('0x32')][_0xdd31('0x39')]);_0x296906[_0xdd31('0x3a')]=qs[_0xdd31('0x34')](_[_0xdd31('0x3b')](_0x1ad662[_0xdd31('0x32')],_0x53232c['filters']),_0xf60b90);if(_0x1ad662[_0xdd31('0x32')][_0xdd31('0x3c')]){_0x296906[_0xdd31('0x3a')]=_[_0xdd31('0x3d')](_0x296906[_0xdd31('0x3a')],{'$or':_['map'](_0xf60b90,function(_0x19e92d){if(_0x19e92d[_0xdd31('0x3e')]!==_0xdd31('0x3f')){var _0x5992ab={};_0x5992ab[_0x19e92d[_0xdd31('0x2b')]]={'$like':'%'+_0x1ad662[_0xdd31('0x32')]['filter']+'%'};return _0x5992ab;}})});}_0x296906=_['merge']({},_0x296906,_0x1ad662[_0xdd31('0x40')]);var _0x1c9d58={'where':_0x296906['where']};return db[_0xdd31('0x2f')][_0xdd31('0x1e')](_0x1c9d58)[_0xdd31('0x25')](function(_0x7492f3){_0x142652[_0xdd31('0x1e')]=_0x7492f3;if(_0x1ad662[_0xdd31('0x32')][_0xdd31('0x41')]){_0x296906[_0xdd31('0x42')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xdd31('0x43')](_0x296906);})['then'](function(_0x2d973b){_0x142652[_0xdd31('0x44')]=_0x2d973b;return _0x142652;})[_0xdd31('0x25')](respondWithFilteredResult(_0x2d13b5,_0x296906))[_0xdd31('0x45')](handleError(_0x2d13b5,null));};exports[_0xdd31('0x46')]=function(_0x13c986,_0x1ab8b7){var _0x2aa4eb={'raw':!![],'where':{'id':_0x13c986['params']['id']}},_0x4871cb={};_0x4871cb[_0xdd31('0x31')]=_[_0xdd31('0x33')](db['AnalyticExtractedReport'][_0xdd31('0x47')]);_0x4871cb[_0xdd31('0x32')]=_[_0xdd31('0x33')](_0x13c986[_0xdd31('0x32')]);_0x4871cb[_0xdd31('0x34')]=_[_0xdd31('0x35')](_0x4871cb['model'],_0x4871cb[_0xdd31('0x32')]);_0x2aa4eb['attributes']=_[_0xdd31('0x35')](_0x4871cb[_0xdd31('0x31')],qs[_0xdd31('0x48')](_0x13c986[_0xdd31('0x32')][_0xdd31('0x48')]));_0x2aa4eb[_0xdd31('0x36')]=_0x2aa4eb[_0xdd31('0x36')][_0xdd31('0x49')]?_0x2aa4eb[_0xdd31('0x36')]:_0x4871cb[_0xdd31('0x31')];if(_0x13c986[_0xdd31('0x32')][_0xdd31('0x41')]){_0x2aa4eb[_0xdd31('0x42')]=[{'all':!![]}];}_0x2aa4eb=_['merge']({},_0x2aa4eb,_0x13c986[_0xdd31('0x40')]);return db[_0xdd31('0x2f')]['find'](_0x2aa4eb)[_0xdd31('0x25')](handleEntityNotFound(_0x1ab8b7,null))['then'](respondWithResult(_0x1ab8b7,null))[_0xdd31('0x45')](handleError(_0x1ab8b7,null));};exports[_0xdd31('0x4a')]=function(_0x915cb7,_0x38b440){return db['AnalyticExtractedReport'][_0xdd31('0x4a')](_0x915cb7[_0xdd31('0x4b')],{})[_0xdd31('0x25')](function(_0xbf73ce){var _0xb3e7c=_0x915cb7['user'][_0xdd31('0x4c')]({'plain':!![]});if(!_0xb3e7c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb3e7c['role']==='user'){var _0x32c50e=_0xbf73ce[_0xdd31('0x4c')]({'plain':!![]});var _0x3306ad='ExtractedReports';return db[_0xdd31('0x4d')][_0xdd31('0x4e')]({'where':{'name':_0x3306ad,'userProfileId':_0xb3e7c[_0xdd31('0x4f')]},'raw':!![]})['then'](function(_0x8a936b){if(_0x8a936b&&_0x8a936b[_0xdd31('0x50')]===0x0){return db[_0xdd31('0x27')]['create']({'name':_0x32c50e['name'],'resourceId':_0x32c50e['id'],'type':_0x8a936b['name'],'sectionId':_0x8a936b['id']},{})[_0xdd31('0x25')](function(){return _0xbf73ce;});}else{return _0xbf73ce;}})[_0xdd31('0x45')](function(_0x2be25b){logger['error'](_0xdd31('0x51'),_0x2be25b);throw _0x2be25b;});}return _0xbf73ce;})['then'](respondWithResult(_0x38b440,0xc9))['catch'](handleError(_0x38b440,null));};exports[_0xdd31('0x52')]=function(_0x66277f,_0x5eca28){if(_0x66277f[_0xdd31('0x4b')]['id']){delete _0x66277f[_0xdd31('0x4b')]['id'];}return db[_0xdd31('0x2f')]['find']({'where':{'id':_0x66277f['params']['id']}})[_0xdd31('0x25')](handleEntityNotFound(_0x5eca28,null))[_0xdd31('0x25')](saveUpdates(_0x66277f['body'],null))[_0xdd31('0x25')](respondWithResult(_0x5eca28,null))[_0xdd31('0x45')](handleError(_0x5eca28,null));};exports[_0xdd31('0x24')]=function(_0x3085fd,_0x483cb5){return db[_0xdd31('0x2f')][_0xdd31('0x4e')]({'where':{'id':_0x3085fd[_0xdd31('0x53')]['id']}})['then'](handleEntityNotFound(_0x483cb5,null))[_0xdd31('0x25')](removeEntity(_0x483cb5,null))[_0xdd31('0x45')](handleError(_0x483cb5,null));};exports[_0xdd31('0x54')]=function(_0x883938,_0x132e2c,_0x2de559){return db[_0xdd31('0x2f')][_0xdd31('0x4e')]({'where':{'id':_0x883938[_0xdd31('0x53')]['id']},'attributes':['name',_0xdd31('0x55'),_0xdd31('0x56'),_0xdd31('0x57')],'raw':!![]})[_0xdd31('0x25')](handleEntityNotFound(_0x132e2c,null))[_0xdd31('0x25')](function(_0x3cf8b2){if(_0x3cf8b2){if(!fs[_0xdd31('0x58')](path[_0xdd31('0x59')](config[_0xdd31('0x5a')],'server/files/reports',_0x3cf8b2[_0xdd31('0x56')]))){throw new db[(_0xdd31('0x5b'))][(_0xdd31('0x5c'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x883938[_0xdd31('0x32')][_0xdd31('0x5d')]){return _0x132e2c[_0xdd31('0x28')](0xc8);}return _0x132e2c['download'](path['join'](config['root'],_0xdd31('0x5e'),_0x3cf8b2['savename']),util[_0xdd31('0x5f')](_0xdd31('0x60'),_0x3cf8b2[_0xdd31('0x55')]||_0x3cf8b2[_0xdd31('0x2b')],_0x3cf8b2[_0xdd31('0x57')][_0xdd31('0x61')]()));}})[_0xdd31('0x45')](handleError(_0x132e2c,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index e4dbdc4..64142fc 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 _0xab3a=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x39d711,_0xe11eb7){var _0xee1d0c=function(_0x457e08){while(--_0x457e08){_0x39d711['push'](_0x39d711['shift']());}};_0xee1d0c(++_0xe11eb7);}(_0xab3a,0xb9));var _0xaab3=function(_0x4452a1,_0x1d50fa){_0x4452a1=_0x4452a1-0x0;var _0x2e5604=_0xab3a[_0x4452a1];return _0x2e5604;};'use strict';var _=require(_0xaab3('0x0'));var util=require('util');var logger=require(_0xaab3('0x1'))(_0xaab3('0x2'));var moment=require(_0xaab3('0x3'));var BPromise=require('bluebird');var rp=require(_0xaab3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaab3('0x5'));var config=require(_0xaab3('0x6'));var attributes=require(_0xaab3('0x7'));module[_0xaab3('0x8')]=function(_0x30a442,_0x315675){return _0x30a442[_0xaab3('0x9')](_0xaab3('0xa'),attributes,{'tableName':_0xaab3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb23d=['../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0xb23d,0x84));var _0xdb23=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0xb23d[_0x5ecadc];return _0x565037;};'use strict';var _=require(_0xdb23('0x0'));var util=require(_0xdb23('0x1'));var logger=require(_0xdb23('0x2'))('api');var moment=require(_0xdb23('0x3'));var BPromise=require(_0xdb23('0x4'));var rp=require(_0xdb23('0x5'));var fs=require('fs');var path=require(_0xdb23('0x6'));var rimraf=require(_0xdb23('0x7'));var config=require(_0xdb23('0x8'));var attributes=require(_0xdb23('0x9'));module[_0xdb23('0xa')]=function(_0x29df6a,_0x312a42){return _0x29df6a[_0xdb23('0xb')](_0xdb23('0xc'),attributes,{'tableName':_0xdb23('0xd'),'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 6bf1bb6..f3157e9 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 _0x87ed=['message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/environment','jayson/promise','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x17bb5b,_0x36806f){var _0x3dddc8=function(_0x3084d4){while(--_0x3084d4){_0x17bb5b['push'](_0x17bb5b['shift']());}};_0x3dddc8(++_0x36806f);}(_0x87ed,0x88));var _0xd87e=function(_0x16946b,_0x5ea65a){_0x16946b=_0x16946b-0x0;var _0x322ea3=_0x87ed[_0x16946b];return _0x322ea3;};'use strict';var _=require(_0xd87e('0x0'));var util=require(_0xd87e('0x1'));var moment=require(_0xd87e('0x2'));var BPromise=require('bluebird');var rs=require(_0xd87e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd87e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd87e('0x5'));var jayson=require(_0xd87e('0x6'));var client=jayson['client'][_0xd87e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4c43f2,_0x22073e,_0x275705){return new BPromise(function(_0x52d938,_0x55bbf3){return client[_0xd87e('0x8')](_0x4c43f2,_0x275705)['then'](function(_0x436bb6){logger[_0xd87e('0x9')](_0xd87e('0xa'),_0x22073e,_0xd87e('0xb'));logger[_0xd87e('0xc')](_0xd87e('0xd'),_0x22073e,_0xd87e('0xb'),JSON['stringify'](_0x436bb6));if(_0x436bb6[_0xd87e('0xe')]){if(_0x436bb6['error'][_0xd87e('0xf')]===0x1f4){logger[_0xd87e('0xe')](_0xd87e('0xa'),_0x22073e,_0x436bb6['error'][_0xd87e('0x10')]);return _0x55bbf3(_0x436bb6['error'][_0xd87e('0x10')]);}logger['error'](_0xd87e('0xa'),_0x22073e,_0x436bb6[_0xd87e('0xe')][_0xd87e('0x10')]);return _0x52d938(_0x436bb6[_0xd87e('0xe')][_0xd87e('0x10')]);}else{logger['info'](_0xd87e('0xa'),_0x22073e,_0xd87e('0xb'));_0x52d938(_0x436bb6[_0xd87e('0x11')]['message']);}})[_0xd87e('0x12')](function(_0xed36a4){logger[_0xd87e('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x22073e,_0xed36a4);_0x55bbf3(_0xed36a4);});});}
\ No newline at end of file
+var _0xc5a8=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x496af1,_0x2d5f59){var _0x5700b3=function(_0x4e346a){while(--_0x4e346a){_0x496af1['push'](_0x496af1['shift']());}};_0x5700b3(++_0x2d5f59);}(_0xc5a8,0x144));var _0x8c5a=function(_0x170c9e,_0x303595){_0x170c9e=_0x170c9e-0x0;var _0x849fc0=_0xc5a8[_0x170c9e];return _0x849fc0;};'use strict';var _=require(_0x8c5a('0x0'));var util=require(_0x8c5a('0x1'));var moment=require('moment');var BPromise=require(_0x8c5a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c5a('0x3'));var db=require(_0x8c5a('0x4'))['db'];var utils=require(_0x8c5a('0x5'));var logger=require(_0x8c5a('0x6'))(_0x8c5a('0x7'));var config=require(_0x8c5a('0x8'));var jayson=require(_0x8c5a('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5447a9,_0x59c420,_0x402b90){return new BPromise(function(_0x26de35,_0x3a1648){return client[_0x8c5a('0xa')](_0x5447a9,_0x402b90)[_0x8c5a('0xb')](function(_0x4be2a4){logger[_0x8c5a('0xc')](_0x8c5a('0xd'),_0x59c420,'request\x20sent');logger[_0x8c5a('0xe')](_0x8c5a('0xf'),_0x59c420,'request\x20sent',JSON[_0x8c5a('0x10')](_0x4be2a4));if(_0x4be2a4['error']){if(_0x4be2a4[_0x8c5a('0x11')][_0x8c5a('0x12')]===0x1f4){logger[_0x8c5a('0x11')](_0x8c5a('0xd'),_0x59c420,_0x4be2a4[_0x8c5a('0x11')]['message']);return _0x3a1648(_0x4be2a4[_0x8c5a('0x11')][_0x8c5a('0x13')]);}logger[_0x8c5a('0x11')](_0x8c5a('0xd'),_0x59c420,_0x4be2a4[_0x8c5a('0x11')][_0x8c5a('0x13')]);return _0x26de35(_0x4be2a4[_0x8c5a('0x11')][_0x8c5a('0x13')]);}else{logger[_0x8c5a('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x59c420,_0x8c5a('0x14'));_0x26de35(_0x4be2a4[_0x8c5a('0x15')][_0x8c5a('0x13')]);}})['catch'](function(_0x49bd7d){logger[_0x8c5a('0x11')](_0x8c5a('0xd'),_0x59c420,_0x49bd7d);_0x3a1648(_0x49bd7d);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 067c981..5b10e31 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 _0xeca1=['get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller'];(function(_0x28449c,_0x40bdbd){var _0x96cc9e=function(_0x15667b){while(--_0x15667b){_0x28449c['push'](_0x28449c['shift']());}};_0x96cc9e(++_0x40bdbd);}(_0xeca1,0x85));var _0x1eca=function(_0x40724e,_0x23f01c){_0x40724e=_0x40724e-0x0;var _0x42b101=_0xeca1[_0x40724e];return _0x42b101;};'use strict';var multer=require(_0x1eca('0x0'));var util=require(_0x1eca('0x1'));var path=require(_0x1eca('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1eca('0x3'));var auth=require(_0x1eca('0x4'));var interaction=require(_0x1eca('0x5'));var config=require('../../config/environment');var controller=require(_0x1eca('0x6'));router[_0x1eca('0x7')]('/',auth[_0x1eca('0x8')](),controller[_0x1eca('0x9')]);router[_0x1eca('0x7')](_0x1eca('0xa'),auth[_0x1eca('0x8')](),controller[_0x1eca('0xb')]);router[_0x1eca('0x7')](_0x1eca('0xc'),auth['isAuthenticated'](),controller[_0x1eca('0xd')]);router[_0x1eca('0xe')]('/',auth[_0x1eca('0x8')](),controller[_0x1eca('0xf')]);router[_0x1eca('0x10')](_0x1eca('0xa'),auth['isAuthenticated'](),controller[_0x1eca('0x11')]);router['delete'](_0x1eca('0xa'),auth['isAuthenticated'](),controller[_0x1eca('0x12')]);module[_0x1eca('0x13')]=router;
\ No newline at end of file
+var _0x8561=['../../config/environment','./analyticExtractedReport.controller','get','/:id','isAuthenticated','download','post','put','update','destroy','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4c30c8,_0x1e34ff){var _0xc66228=function(_0x159165){while(--_0x159165){_0x4c30c8['push'](_0x4c30c8['shift']());}};_0xc66228(++_0x1e34ff);}(_0x8561,0xba));var _0x1856=function(_0x1334aa,_0x2a09c9){_0x1334aa=_0x1334aa-0x0;var _0x1062f9=_0x8561[_0x1334aa];return _0x1062f9;};'use strict';var multer=require(_0x1856('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1856('0x1'));var router=express[_0x1856('0x2')]();var fs_extra=require(_0x1856('0x3'));var auth=require(_0x1856('0x4'));var interaction=require(_0x1856('0x5'));var config=require(_0x1856('0x6'));var controller=require(_0x1856('0x7'));router[_0x1856('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1856('0x8')](_0x1856('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x1856('0x8')]('/:id/download',auth[_0x1856('0xa')](),controller[_0x1856('0xb')]);router[_0x1856('0xc')]('/',auth[_0x1856('0xa')](),controller['create']);router[_0x1856('0xd')](_0x1856('0x9'),auth[_0x1856('0xa')](),controller[_0x1856('0xe')]);router['delete'](_0x1856('0x9'),auth[_0x1856('0xa')](),controller[_0x1856('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index afaec42..130376e 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 _0xaf80=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x42004d,_0x127961){var _0xb47cd4=function(_0x5a3b8d){while(--_0x5a3b8d){_0x42004d['push'](_0x42004d['shift']());}};_0xb47cd4(++_0x127961);}(_0xaf80,0x92));var _0x0af8=function(_0x1f12a9,_0x3457fc){_0x1f12a9=_0x1f12a9-0x0;var _0x1e3b99=_0xaf80[_0x1f12a9];return _0x1e3b99;};'use strict';var Sequelize=require(_0x0af8('0x0'));module['exports']={'field':{'type':Sequelize[_0x0af8('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x0af8('0x2')]},'format':{'type':Sequelize[_0x0af8('0x2')]},'groupBy':{'type':Sequelize[_0x0af8('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0af8('0x2')]},'custom':{'type':Sequelize[_0x0af8('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7104=['BOOLEAN','sequelize','exports','STRING'];(function(_0x4ef68f,_0x2dca6d){var _0x24c902=function(_0x30f9d0){while(--_0x30f9d0){_0x4ef68f['push'](_0x4ef68f['shift']());}};_0x24c902(++_0x2dca6d);}(_0x7104,0xbd));var _0x4710=function(_0x366804,_0x14fae9){_0x366804=_0x366804-0x0;var _0x29e66a=_0x7104[_0x366804];return _0x29e66a;};'use strict';var Sequelize=require(_0x4710('0x0'));module[_0x4710('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x4710('0x2')]},'function':{'type':Sequelize[_0x4710('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x4710('0x2')]},'custom':{'type':Sequelize[_0x4710('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 f8f2293..1b65ece 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 _0xebd5=['fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','bulkCreate','body','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','save','then','destroy','error','name','send','index','map','AnalyticFieldReport'];(function(_0x1d4934,_0x273e2b){var _0x3603f7=function(_0x41f762){while(--_0x41f762){_0x1d4934['push'](_0x1d4934['shift']());}};_0x3603f7(++_0x273e2b);}(_0xebd5,0x71));var _0x5ebd=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xebd5[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0x5ebd('0x0'));var rimraf=require(_0x5ebd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5ebd('0x2'));var moment=require(_0x5ebd('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5ebd('0x4'));var path=require(_0x5ebd('0x5'));var sox=require(_0x5ebd('0x6'));var csv=require('to-csv');var ejs=require(_0x5ebd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ebd('0x8'));var squel=require('squel');var crypto=require(_0x5ebd('0x9'));var jsforce=require(_0x5ebd('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5ebd('0xb'));var Papa=require(_0x5ebd('0xc'));var Redis=require(_0x5ebd('0xd'));var authService=require(_0x5ebd('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x5ebd('0xf'));var hardwareService=require(_0x5ebd('0x10'));var logger=require('../../config/logger')(_0x5ebd('0x11'));var utils=require(_0x5ebd('0x12'));var config=require(_0x5ebd('0x13'));var licenseUtil=require(_0x5ebd('0x14'));var db=require(_0x5ebd('0x15'))['db'];function respondWithStatusCode(_0x315f39,_0x30c24f){_0x30c24f=_0x30c24f||0xcc;return function(_0x5c9925){if(_0x5c9925){return _0x315f39[_0x5ebd('0x16')](_0x30c24f);}return _0x315f39['status'](_0x30c24f)[_0x5ebd('0x17')]();};}function respondWithResult(_0x3d6b1a,_0x3481db){_0x3481db=_0x3481db||0xc8;return function(_0x4ce10a){if(_0x4ce10a){return _0x3d6b1a['status'](_0x3481db)[_0x5ebd('0x18')](_0x4ce10a);}};}function respondWithFilteredResult(_0x12c306,_0x3f9ab3){return function(_0x981d23){if(_0x981d23){var _0x47a85c=typeof _0x3f9ab3[_0x5ebd('0x19')]===_0x5ebd('0x1a')&&typeof _0x3f9ab3['limit']===_0x5ebd('0x1a');var _0x155e88=_0x981d23[_0x5ebd('0x1b')];var _0x18217f=_0x47a85c?0x0:_0x3f9ab3[_0x5ebd('0x19')];var _0x28308d=_0x47a85c?_0x981d23[_0x5ebd('0x1b')]:_0x3f9ab3[_0x5ebd('0x19')]+_0x3f9ab3[_0x5ebd('0x1c')];var _0x2a06e8;if(_0x28308d>=_0x155e88){_0x28308d=_0x155e88;_0x2a06e8=0xc8;}else{_0x2a06e8=0xce;}_0x12c306[_0x5ebd('0x1d')](_0x2a06e8);return _0x12c306[_0x5ebd('0x1e')](_0x5ebd('0x1f'),_0x18217f+'-'+_0x28308d+'/'+_0x155e88)[_0x5ebd('0x18')](_0x981d23);}return null;};}function patchUpdates(_0x30547b){return function(_0xdac639){try{jsonpatch['apply'](_0xdac639,_0x30547b,!![]);}catch(_0x55be72){return BPromise['reject'](_0x55be72);}return _0xdac639[_0x5ebd('0x20')]();};}function saveUpdates(_0x43e542,_0x39eff1){return function(_0x151ffa){if(_0x151ffa){return _0x151ffa['update'](_0x43e542)[_0x5ebd('0x21')](function(_0x338f97){return _0x338f97;});}return null;};}function removeEntity(_0x4ddcc2,_0x160509){return function(_0x6e869b){if(_0x6e869b){return _0x6e869b[_0x5ebd('0x22')]()[_0x5ebd('0x21')](function(){_0x4ddcc2[_0x5ebd('0x1d')](0xcc)[_0x5ebd('0x17')]();});}};}function handleEntityNotFound(_0x59cc2e,_0x547f35){return function(_0x35f1c4){if(!_0x35f1c4){_0x59cc2e[_0x5ebd('0x16')](0x194);}return _0x35f1c4;};}function handleError(_0x3ebc2c,_0x4614f1){_0x4614f1=_0x4614f1||0x1f4;return function(_0x25e6f9){logger[_0x5ebd('0x23')](_0x25e6f9['stack']);if(_0x25e6f9[_0x5ebd('0x24')]){delete _0x25e6f9[_0x5ebd('0x24')];}_0x3ebc2c['status'](_0x4614f1)[_0x5ebd('0x25')](_0x25e6f9);};}exports[_0x5ebd('0x26')]=function(_0x4fd9bd,_0x3e8e28){var _0x7128e9={},_0x2ed99b={},_0x11c38a={'count':0x0,'rows':[]};var _0x1128b5=_[_0x5ebd('0x27')](db[_0x5ebd('0x28')]['rawAttributes'],function(_0x5665a9){return{'name':_0x5665a9[_0x5ebd('0x29')],'type':_0x5665a9[_0x5ebd('0x2a')]['key']};});_0x2ed99b[_0x5ebd('0x2b')]=_['map'](_0x1128b5,_0x5ebd('0x24'));_0x2ed99b[_0x5ebd('0x2c')]=_[_0x5ebd('0x2d')](_0x4fd9bd['query']);_0x2ed99b[_0x5ebd('0x2e')]=_[_0x5ebd('0x2f')](_0x2ed99b['model'],_0x2ed99b[_0x5ebd('0x2c')]);_0x7128e9[_0x5ebd('0x30')]=_[_0x5ebd('0x2f')](_0x2ed99b[_0x5ebd('0x2b')],qs[_0x5ebd('0x31')](_0x4fd9bd[_0x5ebd('0x2c')][_0x5ebd('0x31')]));_0x7128e9[_0x5ebd('0x30')]=_0x7128e9[_0x5ebd('0x30')]['length']?_0x7128e9[_0x5ebd('0x30')]:_0x2ed99b[_0x5ebd('0x2b')];if(!_0x4fd9bd[_0x5ebd('0x2c')][_0x5ebd('0x32')](_0x5ebd('0x33'))){_0x7128e9['limit']=qs['limit'](_0x4fd9bd[_0x5ebd('0x2c')][_0x5ebd('0x1c')]);_0x7128e9['offset']=qs[_0x5ebd('0x19')](_0x4fd9bd[_0x5ebd('0x2c')][_0x5ebd('0x19')]);}_0x7128e9[_0x5ebd('0x34')]=qs['sort'](_0x4fd9bd[_0x5ebd('0x2c')][_0x5ebd('0x35')]);_0x7128e9[_0x5ebd('0x36')]=qs['filters'](_[_0x5ebd('0x37')](_0x4fd9bd['query'],_0x2ed99b[_0x5ebd('0x2e')]),_0x1128b5);if(_0x4fd9bd[_0x5ebd('0x2c')][_0x5ebd('0x38')]){_0x7128e9[_0x5ebd('0x36')]=_[_0x5ebd('0x39')](_0x7128e9['where'],{'$or':_[_0x5ebd('0x27')](_0x1128b5,function(_0x380310){if(_0x380310[_0x5ebd('0x2a')]!==_0x5ebd('0x3a')){var _0x247f04={};_0x247f04[_0x380310['name']]={'$like':'%'+_0x4fd9bd['query'][_0x5ebd('0x38')]+'%'};return _0x247f04;}})});}_0x7128e9=_[_0x5ebd('0x39')]({},_0x7128e9,_0x4fd9bd[_0x5ebd('0x3b')]);var _0x5970a0={'where':_0x7128e9[_0x5ebd('0x36')]};return db[_0x5ebd('0x28')][_0x5ebd('0x1b')](_0x5970a0)[_0x5ebd('0x21')](function(_0x45fe2f){_0x11c38a[_0x5ebd('0x1b')]=_0x45fe2f;if(_0x4fd9bd['query'][_0x5ebd('0x3c')]){_0x7128e9[_0x5ebd('0x3d')]=[{'all':!![]}];}return db[_0x5ebd('0x28')]['findAll'](_0x7128e9);})[_0x5ebd('0x21')](function(_0x108cf8){_0x11c38a[_0x5ebd('0x3e')]=_0x108cf8;return _0x11c38a;})[_0x5ebd('0x21')](respondWithFilteredResult(_0x3e8e28,_0x7128e9))[_0x5ebd('0x3f')](handleError(_0x3e8e28,null));};exports[_0x5ebd('0x40')]=function(_0x20be2d,_0x25d7c7){var _0x58f29b={'raw':![],'where':{'id':_0x20be2d[_0x5ebd('0x41')]['id']}},_0x130c42={};_0x130c42[_0x5ebd('0x2b')]=_[_0x5ebd('0x2d')](db['AnalyticFieldReport'][_0x5ebd('0x42')]);_0x130c42['query']=_['keys'](_0x20be2d[_0x5ebd('0x2c')]);_0x130c42[_0x5ebd('0x2e')]=_[_0x5ebd('0x2f')](_0x130c42[_0x5ebd('0x2b')],_0x130c42['query']);_0x58f29b[_0x5ebd('0x30')]=_[_0x5ebd('0x2f')](_0x130c42[_0x5ebd('0x2b')],qs[_0x5ebd('0x31')](_0x20be2d['query'][_0x5ebd('0x31')]));_0x58f29b['attributes']=_0x58f29b['attributes']['length']?_0x58f29b['attributes']:_0x130c42['model'];if(_0x20be2d['query'][_0x5ebd('0x3c')]){_0x58f29b[_0x5ebd('0x3d')]=[{'all':!![]}];}_0x58f29b=_[_0x5ebd('0x39')]({},_0x58f29b,_0x20be2d['options']);return db[_0x5ebd('0x28')][_0x5ebd('0x43')](_0x58f29b)['then'](handleEntityNotFound(_0x25d7c7,null))['then'](respondWithResult(_0x25d7c7,null))[_0x5ebd('0x3f')](handleError(_0x25d7c7,null));};exports[_0x5ebd('0x44')]=function(_0x1cd137,_0x33f94d){return db[_0x5ebd('0x28')][_0x5ebd('0x44')](_0x1cd137['body'],{})[_0x5ebd('0x21')](respondWithResult(_0x33f94d,0xc9))['catch'](handleError(_0x33f94d,null));};exports['bulkCreate']=function(_0x758bfa,_0x2bf8f5){return db[_0x5ebd('0x28')][_0x5ebd('0x45')](_0x758bfa[_0x5ebd('0x46')],{'raw':![],'individualHooks':!![]})[_0x5ebd('0x21')](respondWithResult(_0x2bf8f5,0xc9))[_0x5ebd('0x3f')](handleError(_0x2bf8f5,null));};exports['update']=function(_0xaad01,_0x288a92){if(_0xaad01[_0x5ebd('0x46')]['id']){delete _0xaad01[_0x5ebd('0x46')]['id'];}return db[_0x5ebd('0x28')][_0x5ebd('0x43')]({'where':{'id':_0xaad01['params']['id']}})[_0x5ebd('0x21')](handleEntityNotFound(_0x288a92,null))[_0x5ebd('0x21')](saveUpdates(_0xaad01[_0x5ebd('0x46')],null))['then'](respondWithResult(_0x288a92,null))['catch'](handleError(_0x288a92,null));};exports[_0x5ebd('0x22')]=function(_0x42c793,_0x1b96c0){return db['AnalyticFieldReport'][_0x5ebd('0x43')]({'where':{'id':_0x42c793[_0x5ebd('0x41')]['id']}})[_0x5ebd('0x21')](handleEntityNotFound(_0x1b96c0,null))[_0x5ebd('0x21')](removeEntity(_0x1b96c0,null))[_0x5ebd('0x3f')](handleError(_0x1b96c0,null));};exports['bulkDestroy']=function(_0x3812a3,_0x20b6b7){return db[_0x5ebd('0x28')][_0x5ebd('0x22')]({'where':{'id':_0x3812a3[_0x5ebd('0x2c')][_0x5ebd('0x47')]||[]},'raw':![],'individualHooks':!![]})[_0x5ebd('0x21')](respondWithResult(_0x20b6b7,0xcc))['catch'](handleError(_0x20b6b7,null));};exports[_0x5ebd('0x48')]=function(_0x3edf69,_0x52223a,_0xe92951){return db[_0x5ebd('0x49')]['findOne']({'where':{'id':_0x3edf69['params']['id']}})[_0x5ebd('0x21')](handleEntityNotFound(_0x52223a,null))['then'](function(_0x456a99){if(_0x456a99){return db[_0x5ebd('0x4a')][_0x5ebd('0x4b')](function(_0x2d3bac){return db[_0x5ebd('0x28')]['destroy']({'where':{'CustomReportId':_0x3edf69[_0x5ebd('0x41')]['id']},'transaction':_0x2d3bac})['then'](function(_0x43c1a3){var _0x2c3f2f=_[_0x5ebd('0x27')](_0x3edf69[_0x5ebd('0x46')],function(_0x125e32){delete _0x125e32['id'];_0x125e32[_0x5ebd('0x4c')]=_0x3edf69[_0x5ebd('0x41')]['id'];return _0x125e32;});return db[_0x5ebd('0x28')][_0x5ebd('0x45')](_0x2c3f2f,{'transaction':_0x2d3bac});});})['then'](function(){return db[_0x5ebd('0x28')]['findAll']({'where':{'CustomReportId':_0x3edf69['params']['id']}});});}})[_0x5ebd('0x21')](respondWithResult(_0x52223a,null))[_0x5ebd('0x3f')](handleError(_0x52223a,null));};
\ No newline at end of file
+var _0xf767=['filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','merge','find','create','body','bulkCreate','update','bulkDestroy','destroy','ids','AnalyticCustomReport','findOne','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','undefined','count','limit','status','set','json','apply','save','then','error','stack','name','map','AnalyticFieldReport','fieldName','type','key','query'];(function(_0x4cc113,_0x1efdf7){var _0x490b11=function(_0x15f024){while(--_0x15f024){_0x4cc113['push'](_0x4cc113['shift']());}};_0x490b11(++_0x1efdf7);}(_0xf767,0x76));var _0x7f76=function(_0x51ac09,_0x383098){_0x51ac09=_0x51ac09-0x0;var _0x3f827d=_0xf767[_0x51ac09];return _0x3f827d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f76('0x0'));var zipdir=require(_0x7f76('0x1'));var jsonpatch=require(_0x7f76('0x2'));var rp=require(_0x7f76('0x3'));var moment=require(_0x7f76('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7f76('0x5'));var util=require(_0x7f76('0x6'));var path=require(_0x7f76('0x7'));var sox=require(_0x7f76('0x8'));var csv=require('to-csv');var ejs=require(_0x7f76('0x9'));var fs=require('fs');var fs_extra=require(_0x7f76('0xa'));var _=require(_0x7f76('0xb'));var squel=require(_0x7f76('0xc'));var crypto=require(_0x7f76('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f76('0xe'));var toCsv=require(_0x7f76('0xf'));var querystring=require(_0x7f76('0x10'));var Papa=require(_0x7f76('0x11'));var Redis=require('ioredis');var authService=require(_0x7f76('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7f76('0x13'));var hardwareService=require(_0x7f76('0x14'));var logger=require(_0x7f76('0x15'))(_0x7f76('0x16'));var utils=require(_0x7f76('0x17'));var config=require(_0x7f76('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f76('0x19'))['db'];function respondWithStatusCode(_0x2cd1b3,_0x47403b){_0x47403b=_0x47403b||0xcc;return function(_0x32392b){if(_0x32392b){return _0x2cd1b3[_0x7f76('0x1a')](_0x47403b);}return _0x2cd1b3['status'](_0x47403b)[_0x7f76('0x1b')]();};}function respondWithResult(_0x4d8de0,_0x42a9d3){_0x42a9d3=_0x42a9d3||0xc8;return function(_0x256f79){if(_0x256f79){return _0x4d8de0['status'](_0x42a9d3)['json'](_0x256f79);}};}function respondWithFilteredResult(_0x58d2f3,_0xe81aa9){return function(_0x2df2db){if(_0x2df2db){var _0x286e96=typeof _0xe81aa9['offset']===_0x7f76('0x1c')&&typeof _0xe81aa9['limit']===_0x7f76('0x1c');var _0x3ceb6a=_0x2df2db[_0x7f76('0x1d')];var _0x4802ff=_0x286e96?0x0:_0xe81aa9['offset'];var _0x494537=_0x286e96?_0x2df2db['count']:_0xe81aa9['offset']+_0xe81aa9[_0x7f76('0x1e')];var _0xdb1407;if(_0x494537>=_0x3ceb6a){_0x494537=_0x3ceb6a;_0xdb1407=0xc8;}else{_0xdb1407=0xce;}_0x58d2f3[_0x7f76('0x1f')](_0xdb1407);return _0x58d2f3[_0x7f76('0x20')]('Content-Range',_0x4802ff+'-'+_0x494537+'/'+_0x3ceb6a)[_0x7f76('0x21')](_0x2df2db);}return null;};}function patchUpdates(_0x557c0f){return function(_0x38c4d6){try{jsonpatch[_0x7f76('0x22')](_0x38c4d6,_0x557c0f,!![]);}catch(_0x5a28b0){return BPromise['reject'](_0x5a28b0);}return _0x38c4d6[_0x7f76('0x23')]();};}function saveUpdates(_0xb647d8,_0x5efed5){return function(_0x3f2536){if(_0x3f2536){return _0x3f2536['update'](_0xb647d8)[_0x7f76('0x24')](function(_0x333056){return _0x333056;});}return null;};}function removeEntity(_0x31993d,_0x3deb00){return function(_0x3eea75){if(_0x3eea75){return _0x3eea75['destroy']()[_0x7f76('0x24')](function(){_0x31993d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x197519,_0x45f1c9){return function(_0x3492f4){if(!_0x3492f4){_0x197519['sendStatus'](0x194);}return _0x3492f4;};}function handleError(_0xbe6ac1,_0x1347bf){_0x1347bf=_0x1347bf||0x1f4;return function(_0x3e624d){logger[_0x7f76('0x25')](_0x3e624d[_0x7f76('0x26')]);if(_0x3e624d['name']){delete _0x3e624d[_0x7f76('0x27')];}_0xbe6ac1[_0x7f76('0x1f')](_0x1347bf)['send'](_0x3e624d);};}exports['index']=function(_0xe459de,_0x58829a){var _0x1dd664={},_0x3542e3={},_0xd5ba7={'count':0x0,'rows':[]};var _0x393bdd=_[_0x7f76('0x28')](db[_0x7f76('0x29')]['rawAttributes'],function(_0x3570ec){return{'name':_0x3570ec[_0x7f76('0x2a')],'type':_0x3570ec[_0x7f76('0x2b')][_0x7f76('0x2c')]};});_0x3542e3['model']=_[_0x7f76('0x28')](_0x393bdd,_0x7f76('0x27'));_0x3542e3[_0x7f76('0x2d')]=_['keys'](_0xe459de[_0x7f76('0x2d')]);_0x3542e3[_0x7f76('0x2e')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],_0x3542e3[_0x7f76('0x2d')]);_0x1dd664[_0x7f76('0x31')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0xe459de[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x1dd664[_0x7f76('0x31')]=_0x1dd664[_0x7f76('0x31')]['length']?_0x1dd664[_0x7f76('0x31')]:_0x3542e3[_0x7f76('0x30')];if(!_0xe459de[_0x7f76('0x2d')][_0x7f76('0x33')](_0x7f76('0x34'))){_0x1dd664[_0x7f76('0x1e')]=qs[_0x7f76('0x1e')](_0xe459de[_0x7f76('0x2d')]['limit']);_0x1dd664[_0x7f76('0x35')]=qs['offset'](_0xe459de['query'][_0x7f76('0x35')]);}_0x1dd664['order']=qs[_0x7f76('0x36')](_0xe459de[_0x7f76('0x2d')]['sort']);_0x1dd664[_0x7f76('0x37')]=qs['filters'](_['pick'](_0xe459de[_0x7f76('0x2d')],_0x3542e3[_0x7f76('0x2e')]),_0x393bdd);if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]){_0x1dd664[_0x7f76('0x37')]=_['merge'](_0x1dd664[_0x7f76('0x37')],{'$or':_[_0x7f76('0x28')](_0x393bdd,function(_0x4edf74){if(_0x4edf74['type']!==_0x7f76('0x39')){var _0x4ea167={};_0x4ea167[_0x4edf74[_0x7f76('0x27')]]={'$like':'%'+_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]+'%'};return _0x4ea167;}})});}_0x1dd664=_['merge']({},_0x1dd664,_0xe459de[_0x7f76('0x3a')]);var _0x26b537={'where':_0x1dd664[_0x7f76('0x37')]};return db[_0x7f76('0x29')][_0x7f76('0x1d')](_0x26b537)[_0x7f76('0x24')](function(_0x58649f){_0xd5ba7['count']=_0x58649f;if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x1dd664[_0x7f76('0x3c')]=[{'all':!![]}];}return db[_0x7f76('0x29')][_0x7f76('0x3d')](_0x1dd664);})[_0x7f76('0x24')](function(_0x401284){_0xd5ba7[_0x7f76('0x3e')]=_0x401284;return _0xd5ba7;})[_0x7f76('0x24')](respondWithFilteredResult(_0x58829a,_0x1dd664))[_0x7f76('0x3f')](handleError(_0x58829a,null));};exports[_0x7f76('0x40')]=function(_0x313d37,_0x3229b9){var _0x391d04={'raw':![],'where':{'id':_0x313d37[_0x7f76('0x41')]['id']}},_0x2a43f1={};_0x2a43f1[_0x7f76('0x30')]=_[_0x7f76('0x42')](db['AnalyticFieldReport'][_0x7f76('0x43')]);_0x2a43f1[_0x7f76('0x2d')]=_[_0x7f76('0x42')](_0x313d37['query']);_0x2a43f1['filters']=_[_0x7f76('0x2f')](_0x2a43f1['model'],_0x2a43f1[_0x7f76('0x2d')]);_0x391d04['attributes']=_['intersection'](_0x2a43f1[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0x313d37[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x391d04[_0x7f76('0x31')]=_0x391d04[_0x7f76('0x31')][_0x7f76('0x44')]?_0x391d04[_0x7f76('0x31')]:_0x2a43f1[_0x7f76('0x30')];if(_0x313d37[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x391d04[_0x7f76('0x3c')]=[{'all':!![]}];}_0x391d04=_[_0x7f76('0x45')]({},_0x391d04,_0x313d37[_0x7f76('0x3a')]);return db['AnalyticFieldReport'][_0x7f76('0x46')](_0x391d04)['then'](handleEntityNotFound(_0x3229b9,null))[_0x7f76('0x24')](respondWithResult(_0x3229b9,null))[_0x7f76('0x3f')](handleError(_0x3229b9,null));};exports[_0x7f76('0x47')]=function(_0x39bbef,_0x487b1f){return db[_0x7f76('0x29')][_0x7f76('0x47')](_0x39bbef[_0x7f76('0x48')],{})[_0x7f76('0x24')](respondWithResult(_0x487b1f,0xc9))['catch'](handleError(_0x487b1f,null));};exports[_0x7f76('0x49')]=function(_0xd87fe7,_0x53f77a){return db[_0x7f76('0x29')][_0x7f76('0x49')](_0xd87fe7[_0x7f76('0x48')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x53f77a,0xc9))[_0x7f76('0x3f')](handleError(_0x53f77a,null));};exports[_0x7f76('0x4a')]=function(_0x19d7dd,_0x12127d){if(_0x19d7dd[_0x7f76('0x48')]['id']){delete _0x19d7dd[_0x7f76('0x48')]['id'];}return db[_0x7f76('0x29')][_0x7f76('0x46')]({'where':{'id':_0x19d7dd[_0x7f76('0x41')]['id']}})[_0x7f76('0x24')](handleEntityNotFound(_0x12127d,null))[_0x7f76('0x24')](saveUpdates(_0x19d7dd[_0x7f76('0x48')],null))['then'](respondWithResult(_0x12127d,null))[_0x7f76('0x3f')](handleError(_0x12127d,null));};exports['destroy']=function(_0x3d23b4,_0x3bcd59){return db[_0x7f76('0x29')]['find']({'where':{'id':_0x3d23b4[_0x7f76('0x41')]['id']}})[_0x7f76('0x24')](handleEntityNotFound(_0x3bcd59,null))['then'](removeEntity(_0x3bcd59,null))[_0x7f76('0x3f')](handleError(_0x3bcd59,null));};exports[_0x7f76('0x4b')]=function(_0x470ca2,_0x2e7a61){return db[_0x7f76('0x29')][_0x7f76('0x4c')]({'where':{'id':_0x470ca2[_0x7f76('0x2d')][_0x7f76('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x7f76('0x24')](respondWithResult(_0x2e7a61,0xcc))['catch'](handleError(_0x2e7a61,null));};exports['addFields']=function(_0xcdca96,_0x273884,_0x119a56){return db[_0x7f76('0x4e')][_0x7f76('0x4f')]({'where':{'id':_0xcdca96[_0x7f76('0x41')]['id']}})[_0x7f76('0x24')](handleEntityNotFound(_0x273884,null))[_0x7f76('0x24')](function(_0xd49945){if(_0xd49945){return db['sequelize'][_0x7f76('0x50')](function(_0x2aca95){return db[_0x7f76('0x29')][_0x7f76('0x4c')]({'where':{'CustomReportId':_0xcdca96[_0x7f76('0x41')]['id']},'transaction':_0x2aca95})[_0x7f76('0x24')](function(_0x3bf79a){var _0x50651c=_[_0x7f76('0x28')](_0xcdca96['body'],function(_0x6913a1){delete _0x6913a1['id'];_0x6913a1[_0x7f76('0x51')]=_0xcdca96[_0x7f76('0x41')]['id'];return _0x6913a1;});return db[_0x7f76('0x29')][_0x7f76('0x49')](_0x50651c,{'transaction':_0x2aca95});});})[_0x7f76('0x24')](function(){return db[_0x7f76('0x29')][_0x7f76('0x3d')]({'where':{'CustomReportId':_0xcdca96['params']['id']}});});}})['then'](respondWithResult(_0x273884,null))[_0x7f76('0x3f')](handleError(_0x273884,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index ede983f..aef292d 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 _0x20c3=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4c179f,_0x4b6186){var _0x500640=function(_0x1e486b){while(--_0x1e486b){_0x4c179f['push'](_0x4c179f['shift']());}};_0x500640(++_0x4b6186);}(_0x20c3,0x70));var _0x320c=function(_0x220253,_0x408ef7){_0x220253=_0x220253-0x0;var _0x1ce4a0=_0x20c3[_0x220253];return _0x1ce4a0;};'use strict';var _=require(_0x320c('0x0'));var util=require(_0x320c('0x1'));var logger=require(_0x320c('0x2'))(_0x320c('0x3'));var moment=require(_0x320c('0x4'));var BPromise=require(_0x320c('0x5'));var rp=require(_0x320c('0x6'));var fs=require('fs');var path=require(_0x320c('0x7'));var rimraf=require(_0x320c('0x8'));var config=require(_0x320c('0x9'));var attributes=require(_0x320c('0xa'));module[_0x320c('0xb')]=function(_0x19832e,_0x525ebd){return _0x19832e[_0x320c('0xc')](_0x320c('0xd'),attributes,{'tableName':_0x320c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa022=['../../config/environment','define','AnalyticFieldReport','analytics_report_fields','lodash','api','request-promise','path','rimraf'];(function(_0x2e8c8a,_0x73d0f6){var _0x1455e6=function(_0x72356a){while(--_0x72356a){_0x2e8c8a['push'](_0x2e8c8a['shift']());}};_0x1455e6(++_0x73d0f6);}(_0xa022,0x94));var _0x2a02=function(_0x4474c6,_0x288938){_0x4474c6=_0x4474c6-0x0;var _0x345fab=_0xa022[_0x4474c6];return _0x345fab;};'use strict';var _=require(_0x2a02('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2a02('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2a02('0x2'));var fs=require('fs');var path=require(_0x2a02('0x3'));var rimraf=require(_0x2a02('0x4'));var config=require(_0x2a02('0x5'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x16a121,_0x38e6f4){return _0x16a121[_0x2a02('0x6')](_0x2a02('0x7'),attributes,{'tableName':_0x2a02('0x8'),'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 c7cc69a..73b41ea 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 _0xabcc=['request\x20sent','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x7e6cf7,_0x4c8e23){var _0x18d4ee=function(_0x14b2fc){while(--_0x14b2fc){_0x7e6cf7['push'](_0x7e6cf7['shift']());}};_0x18d4ee(++_0x4c8e23);}(_0xabcc,0x7b));var _0xcabc=function(_0x1f2941,_0x3544ce){_0x1f2941=_0x1f2941-0x0;var _0x31e313=_0xabcc[_0x1f2941];return _0x31e313;};'use strict';var _=require('lodash');var util=require(_0xcabc('0x0'));var moment=require(_0xcabc('0x1'));var BPromise=require(_0xcabc('0x2'));var rs=require(_0xcabc('0x3'));var fs=require('fs');var Redis=require(_0xcabc('0x4'));var db=require(_0xcabc('0x5'))['db'];var utils=require(_0xcabc('0x6'));var logger=require(_0xcabc('0x7'))(_0xcabc('0x8'));var config=require(_0xcabc('0x9'));var jayson=require(_0xcabc('0xa'));var client=jayson[_0xcabc('0xb')][_0xcabc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5df19b,_0x6f7393,_0x596ef9){return new BPromise(function(_0x234d01,_0x23fb36){return client[_0xcabc('0xd')](_0x5df19b,_0x596ef9)['then'](function(_0xe97cd2){logger['info'](_0xcabc('0xe'),_0x6f7393,'request\x20sent');logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x6f7393,_0xcabc('0xf'),JSON[_0xcabc('0x10')](_0xe97cd2));if(_0xe97cd2[_0xcabc('0x11')]){if(_0xe97cd2[_0xcabc('0x11')][_0xcabc('0x12')]===0x1f4){logger[_0xcabc('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x6f7393,_0xe97cd2[_0xcabc('0x11')]['message']);return _0x23fb36(_0xe97cd2[_0xcabc('0x11')][_0xcabc('0x13')]);}logger[_0xcabc('0x11')](_0xcabc('0xe'),_0x6f7393,_0xe97cd2[_0xcabc('0x11')]['message']);return _0x234d01(_0xe97cd2[_0xcabc('0x11')][_0xcabc('0x13')]);}else{logger[_0xcabc('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x6f7393,_0xcabc('0xf'));_0x234d01(_0xe97cd2[_0xcabc('0x15')]['message']);}})[_0xcabc('0x16')](function(_0x4d9738){logger[_0xcabc('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x6f7393,_0x4d9738);_0x23fb36(_0x4d9738);});});}
\ No newline at end of file
+var _0x3b31=['info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then'];(function(_0x375522,_0xba9a07){var _0x3de250=function(_0x13bb46){while(--_0x13bb46){_0x375522['push'](_0x375522['shift']());}};_0x3de250(++_0xba9a07);}(_0x3b31,0xfa));var _0x13b3=function(_0x2a2325,_0x3fc0b7){_0x2a2325=_0x2a2325-0x0;var _0x297285=_0x3b31[_0x2a2325];return _0x297285;};'use strict';var _=require(_0x13b3('0x0'));var util=require(_0x13b3('0x1'));var moment=require(_0x13b3('0x2'));var BPromise=require(_0x13b3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x13b3('0x4'))['db'];var utils=require(_0x13b3('0x5'));var logger=require('../../config/logger')(_0x13b3('0x6'));var config=require('../../config/environment');var jayson=require(_0x13b3('0x7'));var client=jayson[_0x13b3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53d0dd,_0x2f0a8d,_0x3f6106){return new BPromise(function(_0x201c82,_0xeaff1a){return client['request'](_0x53d0dd,_0x3f6106)[_0x13b3('0x9')](function(_0x3ab43b){logger[_0x13b3('0xa')](_0x13b3('0xb'),_0x2f0a8d,_0x13b3('0xc'));logger[_0x13b3('0xd')](_0x13b3('0xe'),_0x2f0a8d,_0x13b3('0xc'),JSON[_0x13b3('0xf')](_0x3ab43b));if(_0x3ab43b[_0x13b3('0x10')]){if(_0x3ab43b[_0x13b3('0x10')][_0x13b3('0x11')]===0x1f4){logger[_0x13b3('0x10')](_0x13b3('0xb'),_0x2f0a8d,_0x3ab43b[_0x13b3('0x10')][_0x13b3('0x12')]);return _0xeaff1a(_0x3ab43b['error'][_0x13b3('0x12')]);}logger[_0x13b3('0x10')](_0x13b3('0xb'),_0x2f0a8d,_0x3ab43b['error'][_0x13b3('0x12')]);return _0x201c82(_0x3ab43b[_0x13b3('0x10')][_0x13b3('0x12')]);}else{logger[_0x13b3('0xa')](_0x13b3('0xb'),_0x2f0a8d,_0x13b3('0xc'));_0x201c82(_0x3ab43b['result']['message']);}})[_0x13b3('0x13')](function(_0x4173ac){logger['error'](_0x13b3('0xb'),_0x2f0a8d,_0x4173ac);_0xeaff1a(_0x4173ac);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 367c0e2..068f23f 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(_0x13bbf5,_0x3c3cc2){var _0x2d9e20=function(_0x31ff82){while(--_0x31ff82){_0x13bbf5['push'](_0x13bbf5['shift']());}};_0x2d9e20(++_0x3c3cc2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x3bac74,_0x525272){var _0x385d69=function(_0x35e2c3){while(--_0x35e2c3){_0x3bac74['push'](_0x3bac74['shift']());}};_0x385d69(++_0x525272);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 cecb3d4..8b52cb8 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 _0xbee0=['STRING','name','TEXT','exports'];(function(_0x204774,_0x572ffc){var _0x9f6e47=function(_0x590321){while(--_0x590321){_0x204774['push'](_0x204774['shift']());}};_0x9f6e47(++_0x572ffc);}(_0xbee0,0x147));var _0x0bee=function(_0x3fa4ec,_0x3387d3){_0x3fa4ec=_0x3fa4ec-0x0;var _0x4df5f0=_0xbee0[_0x3fa4ec];return _0x4df5f0;};'use strict';var Sequelize=require('sequelize');module[_0x0bee('0x0')]={'name':{'type':Sequelize[_0x0bee('0x1')],'allowNull':![],'unique':_0x0bee('0x2')},'table':{'type':Sequelize[_0x0bee('0x1')]},'metric':{'type':Sequelize[_0x0bee('0x3')]},'description':{'type':Sequelize[_0x0bee('0x1')]}};
\ No newline at end of file
+var _0xaa1b=['sequelize','exports','STRING'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xbaa1('0x0'));module[_0xbaa1('0x1')]={'name':{'type':Sequelize[_0xbaa1('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xbaa1('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xbaa1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 7e9f8e0..7fe5a47 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 _0x8ef6=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xc187f4,_0x406145){var _0x1dc539=function(_0x48fc22){while(--_0x48fc22){_0xc187f4['push'](_0xc187f4['shift']());}};_0x1dc539(++_0x406145);}(_0x8ef6,0xf2));var _0x68ef=function(_0x57f20c,_0x33aa60){_0x57f20c=_0x57f20c-0x0;var _0x3e36e9=_0x8ef6[_0x57f20c];return _0x3e36e9;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){var _0x49374f=_0x438b4c[_0x68ef('0x29')]({'plain':!![]});var _0x13280b='Metrics';return db[_0x68ef('0x2a')]['destroy']({'where':{'type':_0x13280b,'resourceId':_0x49374f['id']}})['then'](function(){return _0x438b4c;});})['then'](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x123041,_0x29518e){return function(_0x52e67e){if(!_0x52e67e){_0x123041['sendStatus'](0x194);}return _0x52e67e;};}function handleError(_0x1cbe4f,_0x28907a){_0x28907a=_0x28907a||0x1f4;return function(_0x7bf96){logger[_0x68ef('0x2b')](_0x7bf96[_0x68ef('0x2c')]);if(_0x7bf96[_0x68ef('0x2d')]){delete _0x7bf96[_0x68ef('0x2d')];}_0x1cbe4f[_0x68ef('0x1d')](_0x28907a)['send'](_0x7bf96);};}exports[_0x68ef('0x2e')]=function(_0x4314bd,_0x132d9e){var _0x4c25aa={},_0x370a8f={},_0x523120={'count':0x0,'rows':[]};var _0x133788=_[_0x68ef('0x2f')](db['AnalyticMetric']['rawAttributes'],function(_0x159395){return{'name':_0x159395[_0x68ef('0x30')],'type':_0x159395['type'][_0x68ef('0x31')]};});_0x370a8f[_0x68ef('0x32')]=_[_0x68ef('0x2f')](_0x133788,_0x68ef('0x2d'));_0x370a8f['query']=_[_0x68ef('0x33')](_0x4314bd[_0x68ef('0x34')]);_0x370a8f['filters']=_[_0x68ef('0x35')](_0x370a8f['model'],_0x370a8f[_0x68ef('0x34')]);_0x4c25aa[_0x68ef('0x36')]=_['intersection'](_0x370a8f[_0x68ef('0x32')],qs['fields'](_0x4314bd[_0x68ef('0x34')]['fields']));_0x4c25aa[_0x68ef('0x36')]=_0x4c25aa[_0x68ef('0x36')][_0x68ef('0x37')]?_0x4c25aa['attributes']:_0x370a8f[_0x68ef('0x32')];if(!_0x4314bd['query'][_0x68ef('0x38')]('nolimit')){_0x4c25aa[_0x68ef('0x21')]=qs[_0x68ef('0x21')](_0x4314bd[_0x68ef('0x34')][_0x68ef('0x21')]);_0x4c25aa[_0x68ef('0x1f')]=qs[_0x68ef('0x1f')](_0x4314bd['query'][_0x68ef('0x1f')]);}_0x4c25aa[_0x68ef('0x39')]=qs[_0x68ef('0x3a')](_0x4314bd['query'][_0x68ef('0x3a')]);_0x4c25aa[_0x68ef('0x3b')]=qs[_0x68ef('0x3c')](_['pick'](_0x4314bd['query'],_0x370a8f[_0x68ef('0x3c')]),_0x133788);if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x3d')]){_0x4c25aa[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x4c25aa[_0x68ef('0x3b')],{'$or':_[_0x68ef('0x2f')](_0x133788,function(_0x5b1246){if(_0x5b1246[_0x68ef('0x3f')]!==_0x68ef('0x40')){var _0x2f6ee0={};_0x2f6ee0[_0x5b1246[_0x68ef('0x2d')]]={'$like':'%'+_0x4314bd['query'][_0x68ef('0x3d')]+'%'};return _0x2f6ee0;}})});}_0x4c25aa=_[_0x68ef('0x3e')]({},_0x4c25aa,_0x4314bd[_0x68ef('0x41')]);var _0x410c10={'where':_0x4c25aa[_0x68ef('0x3b')]};return db[_0x68ef('0x42')]['count'](_0x410c10)[_0x68ef('0x27')](function(_0x3f7699){_0x523120[_0x68ef('0x43')]=_0x3f7699;if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x44')]){_0x4c25aa[_0x68ef('0x45')]=[{'all':!![]}];}return db[_0x68ef('0x42')][_0x68ef('0x46')](_0x4c25aa);})[_0x68ef('0x27')](function(_0x531096){_0x523120[_0x68ef('0x47')]=_0x531096;return _0x523120;})[_0x68ef('0x27')](respondWithFilteredResult(_0x132d9e,_0x4c25aa))[_0x68ef('0x48')](handleError(_0x132d9e,null));};exports[_0x68ef('0x49')]=function(_0xdeacf2,_0x183377){var _0xcac58f={'raw':!![],'where':{'id':_0xdeacf2[_0x68ef('0x4a')]['id']}},_0x576767={};_0x576767['model']=_[_0x68ef('0x33')](db[_0x68ef('0x42')][_0x68ef('0x4b')]);_0x576767[_0x68ef('0x34')]=_['keys'](_0xdeacf2[_0x68ef('0x34')]);_0x576767['filters']=_[_0x68ef('0x35')](_0x576767['model'],_0x576767[_0x68ef('0x34')]);_0xcac58f[_0x68ef('0x36')]=_[_0x68ef('0x35')](_0x576767['model'],qs['fields'](_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x4c')]));_0xcac58f['attributes']=_0xcac58f['attributes']['length']?_0xcac58f[_0x68ef('0x36')]:_0x576767[_0x68ef('0x32')];if(_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x44')]){_0xcac58f[_0x68ef('0x45')]=[{'all':!![]}];}_0xcac58f=_['merge']({},_0xcac58f,_0xdeacf2['options']);return db[_0x68ef('0x42')][_0x68ef('0x4d')](_0xcac58f)[_0x68ef('0x27')](handleEntityNotFound(_0x183377,null))[_0x68ef('0x27')](respondWithResult(_0x183377,null))['catch'](handleError(_0x183377,null));};exports[_0x68ef('0x4e')]=function(_0x474e5a,_0x1c9b6f){return db[_0x68ef('0x42')]['create'](_0x474e5a['body'],{})[_0x68ef('0x27')](function(_0x3c3074){var _0x566e7c=_0x474e5a[_0x68ef('0x4f')][_0x68ef('0x29')]({'plain':!![]});if(!_0x566e7c)throw new Error(_0x68ef('0x50'));if(_0x566e7c[_0x68ef('0x51')]===_0x68ef('0x4f')){var _0x4f0f77=_0x3c3074[_0x68ef('0x29')]({'plain':!![]});var _0x3984ca=_0x68ef('0x52');return db['UserProfileSection'][_0x68ef('0x4d')]({'where':{'name':_0x3984ca,'userProfileId':_0x566e7c[_0x68ef('0x53')]},'raw':!![]})[_0x68ef('0x27')](function(_0x50ef1f){if(_0x50ef1f&&_0x50ef1f[_0x68ef('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4f0f77[_0x68ef('0x2d')],'resourceId':_0x4f0f77['id'],'type':_0x50ef1f['name'],'sectionId':_0x50ef1f['id']},{})[_0x68ef('0x27')](function(){return _0x3c3074;});}else{return _0x3c3074;}})[_0x68ef('0x48')](function(_0x53ebd){logger[_0x68ef('0x2b')](_0x68ef('0x55'),_0x53ebd);throw _0x53ebd;});}return _0x3c3074;})[_0x68ef('0x27')](respondWithResult(_0x1c9b6f,0xc9))[_0x68ef('0x48')](handleError(_0x1c9b6f,null));};exports[_0x68ef('0x56')]=function(_0x2b35f4,_0x247915){if(_0x2b35f4['body']['id']){delete _0x2b35f4['body']['id'];}return db[_0x68ef('0x42')][_0x68ef('0x4d')]({'where':{'id':_0x2b35f4[_0x68ef('0x4a')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x247915,null))[_0x68ef('0x27')](saveUpdates(_0x2b35f4[_0x68ef('0x57')],null))[_0x68ef('0x27')](respondWithResult(_0x247915,null))[_0x68ef('0x48')](handleError(_0x247915,null));};exports[_0x68ef('0x28')]=function(_0x4c2e9c,_0x5685bb){return db[_0x68ef('0x42')]['find']({'where':{'id':_0x4c2e9c[_0x68ef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5685bb,null))[_0x68ef('0x27')](removeEntity(_0x5685bb,null))[_0x68ef('0x48')](handleError(_0x5685bb,null));};
\ No newline at end of file
+var _0x46ed=['where','pick','filter','merge','map','type','options','count','includeAll','include','findAll','rows','params','keys','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x1a7fbe,_0x1d0032){var _0x4a4789=function(_0x11edd6){while(--_0x11edd6){_0x1a7fbe['push'](_0x1a7fbe['shift']());}};_0x4a4789(++_0x1d0032);}(_0x46ed,0x168));var _0xd46e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x46ed[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];function respondWithStatusCode(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xcc;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0x1a')](_0x48550b);}return _0x5bc1da['status'](_0x48550b)['end']();};}function respondWithResult(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0xc8;return function(_0x1e9aae){if(_0x1e9aae){return _0xacd799[_0xd46e('0x1b')](_0x4688ae)['json'](_0x1e9aae);}};}function respondWithFilteredResult(_0x3b6d25,_0x44a620){return function(_0x417402){if(_0x417402){var _0x3d72ce=typeof _0x44a620[_0xd46e('0x1c')]==='undefined'&&typeof _0x44a620[_0xd46e('0x1d')]===_0xd46e('0x1e');var _0x3583a5=_0x417402['count'];var _0x5ddd04=_0x3d72ce?0x0:_0x44a620[_0xd46e('0x1c')];var _0x1bd574=_0x3d72ce?_0x417402['count']:_0x44a620['offset']+_0x44a620[_0xd46e('0x1d')];var _0x2f2571;if(_0x1bd574>=_0x3583a5){_0x1bd574=_0x3583a5;_0x2f2571=0xc8;}else{_0x2f2571=0xce;}_0x3b6d25[_0xd46e('0x1b')](_0x2f2571);return _0x3b6d25[_0xd46e('0x1f')](_0xd46e('0x20'),_0x5ddd04+'-'+_0x1bd574+'/'+_0x3583a5)[_0xd46e('0x21')](_0x417402);}return null;};}function patchUpdates(_0x3b5fa4){return function(_0x327b7e){try{jsonpatch[_0xd46e('0x22')](_0x327b7e,_0x3b5fa4,!![]);}catch(_0x3c7e91){return BPromise[_0xd46e('0x23')](_0x3c7e91);}return _0x327b7e['save']();};}function saveUpdates(_0x259072,_0x1c83fa){return function(_0x79aa51){if(_0x79aa51){return _0x79aa51[_0xd46e('0x24')](_0x259072)[_0xd46e('0x25')](function(_0xc1af7f){return _0xc1af7f;});}return null;};}function removeEntity(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(_0x62dea5){return _0x62dea5['destroy']()[_0xd46e('0x25')](function(){var _0x5424e5=_0x62dea5['get']({'plain':!![]});var _0x371054=_0xd46e('0x26');return db[_0xd46e('0x27')][_0xd46e('0x28')]({'where':{'type':_0x371054,'resourceId':_0x5424e5['id']}})[_0xd46e('0x25')](function(){return _0x62dea5;});})[_0xd46e('0x25')](function(){_0x33c2e0[_0xd46e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45d789,_0x3c301a){return function(_0xddbce9){if(!_0xddbce9){_0x45d789[_0xd46e('0x1a')](0x194);}return _0xddbce9;};}function handleError(_0x96f15c,_0x16e941){_0x16e941=_0x16e941||0x1f4;return function(_0x58aeef){logger[_0xd46e('0x29')](_0x58aeef[_0xd46e('0x2a')]);if(_0x58aeef[_0xd46e('0x2b')]){delete _0x58aeef[_0xd46e('0x2b')];}_0x96f15c[_0xd46e('0x1b')](_0x16e941)[_0xd46e('0x2c')](_0x58aeef);};}exports[_0xd46e('0x2d')]=function(_0x2c5ec7,_0x18f060){var _0x45ea47={},_0x2ff785={},_0x504324={'count':0x0,'rows':[]};var _0x2f4a1b=_['map'](db[_0xd46e('0x2e')][_0xd46e('0x2f')],function(_0x4f5718){return{'name':_0x4f5718[_0xd46e('0x30')],'type':_0x4f5718['type'][_0xd46e('0x31')]};});_0x2ff785[_0xd46e('0x32')]=_['map'](_0x2f4a1b,_0xd46e('0x2b'));_0x2ff785[_0xd46e('0x33')]=_['keys'](_0x2c5ec7[_0xd46e('0x33')]);_0x2ff785[_0xd46e('0x34')]=_[_0xd46e('0x35')](_0x2ff785['model'],_0x2ff785['query']);_0x45ea47[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x2ff785[_0xd46e('0x32')],qs[_0xd46e('0x37')](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x37')]));_0x45ea47[_0xd46e('0x36')]=_0x45ea47[_0xd46e('0x36')]['length']?_0x45ea47[_0xd46e('0x36')]:_0x2ff785[_0xd46e('0x32')];if(!_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x38')](_0xd46e('0x39'))){_0x45ea47[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x2c5ec7['query'][_0xd46e('0x1d')]);_0x45ea47[_0xd46e('0x1c')]=qs['offset'](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x1c')]);}_0x45ea47[_0xd46e('0x3a')]=qs[_0xd46e('0x3b')](_0x2c5ec7['query'][_0xd46e('0x3b')]);_0x45ea47[_0xd46e('0x3c')]=qs[_0xd46e('0x34')](_[_0xd46e('0x3d')](_0x2c5ec7[_0xd46e('0x33')],_0x2ff785[_0xd46e('0x34')]),_0x2f4a1b);if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x3e')]){_0x45ea47['where']=_[_0xd46e('0x3f')](_0x45ea47[_0xd46e('0x3c')],{'$or':_[_0xd46e('0x40')](_0x2f4a1b,function(_0x25657a){if(_0x25657a[_0xd46e('0x41')]!=='VIRTUAL'){var _0x964c66={};_0x964c66[_0x25657a['name']]={'$like':'%'+_0x2c5ec7['query']['filter']+'%'};return _0x964c66;}})});}_0x45ea47=_['merge']({},_0x45ea47,_0x2c5ec7[_0xd46e('0x42')]);var _0x54949f={'where':_0x45ea47[_0xd46e('0x3c')]};return db[_0xd46e('0x2e')]['count'](_0x54949f)[_0xd46e('0x25')](function(_0x4114e6){_0x504324[_0xd46e('0x43')]=_0x4114e6;if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x44')]){_0x45ea47[_0xd46e('0x45')]=[{'all':!![]}];}return db[_0xd46e('0x2e')][_0xd46e('0x46')](_0x45ea47);})[_0xd46e('0x25')](function(_0xec367d){_0x504324[_0xd46e('0x47')]=_0xec367d;return _0x504324;})['then'](respondWithFilteredResult(_0x18f060,_0x45ea47))['catch'](handleError(_0x18f060,null));};exports['show']=function(_0x2b4a5a,_0x4e1d94){var _0x168d35={'raw':!![],'where':{'id':_0x2b4a5a[_0xd46e('0x48')]['id']}},_0x272f5f={};_0x272f5f[_0xd46e('0x32')]=_[_0xd46e('0x49')](db[_0xd46e('0x2e')][_0xd46e('0x2f')]);_0x272f5f[_0xd46e('0x33')]=_['keys'](_0x2b4a5a[_0xd46e('0x33')]);_0x272f5f['filters']=_[_0xd46e('0x35')](_0x272f5f[_0xd46e('0x32')],_0x272f5f[_0xd46e('0x33')]);_0x168d35[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x272f5f['model'],qs[_0xd46e('0x37')](_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x37')]));_0x168d35[_0xd46e('0x36')]=_0x168d35[_0xd46e('0x36')]['length']?_0x168d35[_0xd46e('0x36')]:_0x272f5f[_0xd46e('0x32')];if(_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x44')]){_0x168d35[_0xd46e('0x45')]=[{'all':!![]}];}_0x168d35=_['merge']({},_0x168d35,_0x2b4a5a[_0xd46e('0x42')]);return db[_0xd46e('0x2e')][_0xd46e('0x4a')](_0x168d35)[_0xd46e('0x25')](handleEntityNotFound(_0x4e1d94,null))[_0xd46e('0x25')](respondWithResult(_0x4e1d94,null))[_0xd46e('0x4b')](handleError(_0x4e1d94,null));};exports[_0xd46e('0x4c')]=function(_0x440dcc,_0x5188f6){return db[_0xd46e('0x2e')][_0xd46e('0x4c')](_0x440dcc[_0xd46e('0x4d')],{})[_0xd46e('0x25')](function(_0x1f1941){var _0x4e84c8=_0x440dcc['user'][_0xd46e('0x4e')]({'plain':!![]});if(!_0x4e84c8)throw new Error(_0xd46e('0x4f'));if(_0x4e84c8[_0xd46e('0x50')]==='user'){var _0x479711=_0x1f1941[_0xd46e('0x4e')]({'plain':!![]});var _0x9d8638='Metrics';return db[_0xd46e('0x51')][_0xd46e('0x4a')]({'where':{'name':_0x9d8638,'userProfileId':_0x4e84c8[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x25')](function(_0x1bd8a5){if(_0x1bd8a5&&_0x1bd8a5[_0xd46e('0x53')]===0x0){return db[_0xd46e('0x27')][_0xd46e('0x4c')]({'name':_0x479711['name'],'resourceId':_0x479711['id'],'type':_0x1bd8a5[_0xd46e('0x2b')],'sectionId':_0x1bd8a5['id']},{})[_0xd46e('0x25')](function(){return _0x1f1941;});}else{return _0x1f1941;}})[_0xd46e('0x4b')](function(_0x63ee74){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x63ee74);throw _0x63ee74;});}return _0x1f1941;})[_0xd46e('0x25')](respondWithResult(_0x5188f6,0xc9))['catch'](handleError(_0x5188f6,null));};exports[_0xd46e('0x24')]=function(_0x2af20b,_0x393cb9){if(_0x2af20b[_0xd46e('0x4d')]['id']){delete _0x2af20b[_0xd46e('0x4d')]['id'];}return db[_0xd46e('0x2e')]['find']({'where':{'id':_0x2af20b[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x393cb9,null))[_0xd46e('0x25')](saveUpdates(_0x2af20b['body'],null))[_0xd46e('0x25')](respondWithResult(_0x393cb9,null))[_0xd46e('0x4b')](handleError(_0x393cb9,null));};exports[_0xd46e('0x28')]=function(_0x2042d4,_0x1886e6){return db[_0xd46e('0x2e')][_0xd46e('0x4a')]({'where':{'id':_0x2042d4[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x1886e6,null))[_0xd46e('0x25')](removeEntity(_0x1886e6,null))[_0xd46e('0x4b')](handleError(_0x1886e6,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 2d2f477..91a9e69 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 _0xb091=['moment','request-promise','../../config/environment','./analyticMetric.attributes','define','analytics_metrics','util','../../config/logger','api'];(function(_0x2d0057,_0x24db80){var _0x2881ca=function(_0x42c8a4){while(--_0x42c8a4){_0x2d0057['push'](_0x2d0057['shift']());}};_0x2881ca(++_0x24db80);}(_0xb091,0x16e));var _0x1b09=function(_0x486876,_0x76fa8a){_0x486876=_0x486876-0x0;var _0x1dc1c2=_0xb091[_0x486876];return _0x1dc1c2;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var logger=require(_0x1b09('0x1'))(_0x1b09('0x2'));var moment=require(_0x1b09('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b09('0x5'));var attributes=require(_0x1b09('0x6'));module['exports']=function(_0xda8caa,_0x5fa348){return _0xda8caa[_0x1b09('0x7')]('AnalyticMetric',attributes,{'tableName':_0x1b09('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x49fe=['request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','moment','bluebird'];(function(_0x30d2a5,_0x13516b){var _0x12f6c6=function(_0x53d40d){while(--_0x53d40d){_0x30d2a5['push'](_0x30d2a5['shift']());}};_0x12f6c6(++_0x13516b);}(_0x49fe,0x75));var _0xe49f=function(_0x53b44c,_0x460abf){_0x53b44c=_0x53b44c-0x0;var _0x42c2b5=_0x49fe[_0x53b44c];return _0x42c2b5;};'use strict';var _=require(_0xe49f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe49f('0x1'));var BPromise=require(_0xe49f('0x2'));var rp=require(_0xe49f('0x3'));var fs=require('fs');var path=require(_0xe49f('0x4'));var rimraf=require(_0xe49f('0x5'));var config=require(_0xe49f('0x6'));var attributes=require(_0xe49f('0x7'));module[_0xe49f('0x8')]=function(_0x3e984c,_0x2f3f9f){return _0x3e984c[_0xe49f('0x9')](_0xe49f('0xa'),attributes,{'tableName':_0xe49f('0xb'),'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 4007d93..f2b7872 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 _0xa3f8=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','AnalyticMetric,\x20%s,\x20%s','message','lodash','bluebird','randomstring','ioredis'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xa3f8,0x1df));var _0x8a3f=function(_0x55fb83,_0x1d3856){_0x55fb83=_0x55fb83-0x0;var _0x59a87a=_0xa3f8[_0x55fb83];return _0x59a87a;};'use strict';var _=require(_0x8a3f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8a3f('0x1'));var rs=require(_0x8a3f('0x2'));var fs=require('fs');var Redis=require(_0x8a3f('0x3'));var db=require(_0x8a3f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a3f('0x5'))(_0x8a3f('0x6'));var config=require(_0x8a3f('0x7'));var jayson=require(_0x8a3f('0x8'));var client=jayson[_0x8a3f('0x9')][_0x8a3f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8c8a81,_0x3f5cc9,_0x1c457a){return new BPromise(function(_0x19b46f,_0x1a7a3a){return client[_0x8a3f('0xb')](_0x8c8a81,_0x1c457a)[_0x8a3f('0xc')](function(_0x315b7c){logger[_0x8a3f('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x3f5cc9,_0x8a3f('0xe'));logger[_0x8a3f('0xf')](_0x8a3f('0x10'),_0x3f5cc9,_0x8a3f('0xe'),JSON['stringify'](_0x315b7c));if(_0x315b7c[_0x8a3f('0x11')]){if(_0x315b7c[_0x8a3f('0x11')][_0x8a3f('0x12')]===0x1f4){logger[_0x8a3f('0x11')](_0x8a3f('0x13'),_0x3f5cc9,_0x315b7c[_0x8a3f('0x11')][_0x8a3f('0x14')]);return _0x1a7a3a(_0x315b7c[_0x8a3f('0x11')][_0x8a3f('0x14')]);}logger[_0x8a3f('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x3f5cc9,_0x315b7c['error']['message']);return _0x19b46f(_0x315b7c[_0x8a3f('0x11')][_0x8a3f('0x14')]);}else{logger[_0x8a3f('0xd')](_0x8a3f('0x13'),_0x3f5cc9,'request\x20sent');_0x19b46f(_0x315b7c['result'][_0x8a3f('0x14')]);}})['catch'](function(_0x33e575){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x3f5cc9,_0x33e575);_0x1a7a3a(_0x33e575);});});}
\ No newline at end of file
+var _0xa819=['../../mysqldb','../../config/utils','../../config/environment','client','request','then','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','AnalyticMetric,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x394dd0,_0x372e2f){var _0x25caf5=function(_0x4e7bf5){while(--_0x4e7bf5){_0x394dd0['push'](_0x394dd0['shift']());}};_0x25caf5(++_0x372e2f);}(_0xa819,0x1f3));var _0x9a81=function(_0x4212fa,_0x56d028){_0x4212fa=_0x4212fa-0x0;var _0x2f8bc8=_0xa819[_0x4212fa];return _0x2f8bc8;};'use strict';var _=require(_0x9a81('0x0'));var util=require(_0x9a81('0x1'));var moment=require(_0x9a81('0x2'));var BPromise=require('bluebird');var rs=require(_0x9a81('0x3'));var fs=require('fs');var Redis=require(_0x9a81('0x4'));var db=require(_0x9a81('0x5'))['db'];var utils=require(_0x9a81('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9a81('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9a81('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f1128,_0x3fbe40,_0x528a38){return new BPromise(function(_0x4f121d,_0x4dcf2e){return client[_0x9a81('0x9')](_0x5f1128,_0x528a38)[_0x9a81('0xa')](function(_0x3997e3){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x3fbe40,_0x9a81('0xb'));logger['debug'](_0x9a81('0xc'),_0x3fbe40,_0x9a81('0xb'),JSON[_0x9a81('0xd')](_0x3997e3));if(_0x3997e3['error']){if(_0x3997e3[_0x9a81('0xe')][_0x9a81('0xf')]===0x1f4){logger[_0x9a81('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x3fbe40,_0x3997e3['error']['message']);return _0x4dcf2e(_0x3997e3[_0x9a81('0xe')][_0x9a81('0x10')]);}logger[_0x9a81('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x3fbe40,_0x3997e3[_0x9a81('0xe')]['message']);return _0x4f121d(_0x3997e3[_0x9a81('0xe')][_0x9a81('0x10')]);}else{logger[_0x9a81('0x11')](_0x9a81('0x12'),_0x3fbe40,_0x9a81('0xb'));_0x4f121d(_0x3997e3[_0x9a81('0x13')][_0x9a81('0x10')]);}})[_0x9a81('0x14')](function(_0x3a62b6){logger[_0x9a81('0xe')](_0x9a81('0x12'),_0x3fbe40,_0x3a62b6);_0x4dcf2e(_0x3a62b6);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index b7d5b2e..f1da998 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 _0xdbf7=['fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xf9a547,_0x40ab32){var _0x573d08=function(_0x4b23ef){while(--_0x4b23ef){_0xf9a547['push'](_0xf9a547['shift']());}};_0x573d08(++_0x40ab32);}(_0xdbf7,0x8d));var _0x7dbf=function(_0x188ee2,_0xb845f6){_0x188ee2=_0x188ee2-0x0;var _0x336576=_0xdbf7[_0x188ee2];return _0x336576;};'use strict';var multer=require(_0x7dbf('0x0'));var util=require(_0x7dbf('0x1'));var path=require(_0x7dbf('0x2'));var timeout=require(_0x7dbf('0x3'));var express=require(_0x7dbf('0x4'));var router=express[_0x7dbf('0x5')]();var fs_extra=require(_0x7dbf('0x6'));var auth=require(_0x7dbf('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7dbf('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x7dbf('0x9')](),controller[_0x7dbf('0xa')]);router[_0x7dbf('0xb')](_0x7dbf('0xc'),auth[_0x7dbf('0x9')](),controller[_0x7dbf('0xd')]);router[_0x7dbf('0xe')]('/',auth[_0x7dbf('0x9')](),controller[_0x7dbf('0xf')]);router[_0x7dbf('0x10')](_0x7dbf('0xc'),auth[_0x7dbf('0x9')](),controller[_0x7dbf('0x11')]);router[_0x7dbf('0x12')](_0x7dbf('0xc'),auth['isAuthenticated'](),controller[_0x7dbf('0x13')]);module[_0x7dbf('0x14')]=router;
\ No newline at end of file
+var _0xeda8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','update','delete','/:id','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x58cb73,_0x1472a9){var _0x2f23e9=function(_0x489ff9){while(--_0x489ff9){_0x58cb73['push'](_0x58cb73['shift']());}};_0x2f23e9(++_0x1472a9);}(_0xeda8,0x104));var _0x8eda=function(_0x518f82,_0x533e12){_0x518f82=_0x518f82-0x0;var _0x5d2e09=_0xeda8[_0x518f82];return _0x5d2e09;};'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')]('/',auth[_0x8eda('0xb')](),controller[_0x8eda('0xc')]);router[_0x8eda('0xa')]('/:id',auth[_0x8eda('0xb')](),controller[_0x8eda('0xd')]);router[_0x8eda('0xe')]('/',auth[_0x8eda('0xb')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8eda('0xf')]);router[_0x8eda('0x10')](_0x8eda('0x11'),auth['isAuthenticated'](),controller[_0x8eda('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index beac5fb..c46485a 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 _0x9c08=['sequelize','exports','TEXT'];(function(_0x47d69f,_0x460801){var _0xd1a4b5=function(_0x51a661){while(--_0x51a661){_0x47d69f['push'](_0x47d69f['shift']());}};_0xd1a4b5(++_0x460801);}(_0x9c08,0x147));var _0x89c0=function(_0x5c425d,_0x12caad){_0x5c425d=_0x5c425d-0x0;var _0x21b646=_0x9c08[_0x5c425d];return _0x21b646;};'use strict';var Sequelize=require(_0x89c0('0x0'));module[_0x89c0('0x1')]={'tree':{'type':Sequelize[_0x89c0('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x2c2a=['TEXT','sequelize'];(function(_0x438a37,_0x30e65e){var _0x38b013=function(_0x4dc7ca){while(--_0x4dc7ca){_0x438a37['push'](_0x438a37['shift']());}};_0x38b013(++_0x30e65e);}(_0x2c2a,0x73));var _0xa2c2=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x2c2a[_0x18ab2a];return _0x16dcee;};'use strict';var Sequelize=require(_0xa2c2('0x0'));module['exports']={'tree':{'type':Sequelize[_0xa2c2('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 3296c61..d7fe0d9 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 _0xd64f=['body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','apply','update','destroy','then','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','type','options','includeAll','include','findAll','catch','show','params','keys','create'];(function(_0x33e5fe,_0x307a4b){var _0x195b9a=function(_0x48c555){while(--_0x48c555){_0x33e5fe['push'](_0x33e5fe['shift']());}};_0x195b9a(++_0x307a4b);}(_0xd64f,0x1ac));var _0xfd64=function(_0x1492f9,_0xfe7389){_0x1492f9=_0x1492f9-0x0;var _0x1dc8a8=_0xd64f[_0x1492f9];return _0x1dc8a8;};'use strict';var emlformat=require(_0xfd64('0x0'));var rimraf=require(_0xfd64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfd64('0x2'));var rp=require(_0xfd64('0x3'));var moment=require(_0xfd64('0x4'));var BPromise=require(_0xfd64('0x5'));var Mustache=require(_0xfd64('0x6'));var util=require(_0xfd64('0x7'));var path=require(_0xfd64('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfd64('0x9'));var squel=require('squel');var crypto=require(_0xfd64('0xa'));var jsforce=require(_0xfd64('0xb'));var deskjs=require(_0xfd64('0xc'));var toCsv=require(_0xfd64('0xd'));var querystring=require(_0xfd64('0xe'));var Papa=require(_0xfd64('0xf'));var Redis=require(_0xfd64('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfd64('0x11'));var as=require(_0xfd64('0x12'));var hardwareService=require(_0xfd64('0x13'));var logger=require(_0xfd64('0x14'))('api');var utils=require(_0xfd64('0x15'));var config=require(_0xfd64('0x16'));var licenseUtil=require(_0xfd64('0x17'));var db=require(_0xfd64('0x18'))['db'];function respondWithStatusCode(_0x5cf0d7,_0x47017f){_0x47017f=_0x47017f||0xcc;return function(_0x329a4a){if(_0x329a4a){return _0x5cf0d7[_0xfd64('0x19')](_0x47017f);}return _0x5cf0d7['status'](_0x47017f)[_0xfd64('0x1a')]();};}function respondWithResult(_0xcb3cb3,_0x198a75){_0x198a75=_0x198a75||0xc8;return function(_0x3d700d){if(_0x3d700d){return _0xcb3cb3[_0xfd64('0x1b')](_0x198a75)[_0xfd64('0x1c')](_0x3d700d);}};}function respondWithFilteredResult(_0x3ab6d8,_0x36d48a){return function(_0x3f7217){if(_0x3f7217){var _0xadf334=typeof _0x36d48a['offset']==='undefined'&&typeof _0x36d48a[_0xfd64('0x1d')]===_0xfd64('0x1e');var _0x366944=_0x3f7217[_0xfd64('0x1f')];var _0x136990=_0xadf334?0x0:_0x36d48a[_0xfd64('0x20')];var _0x4cc9c2=_0xadf334?_0x3f7217[_0xfd64('0x1f')]:_0x36d48a['offset']+_0x36d48a[_0xfd64('0x1d')];var _0x19cac7;if(_0x4cc9c2>=_0x366944){_0x4cc9c2=_0x366944;_0x19cac7=0xc8;}else{_0x19cac7=0xce;}_0x3ab6d8[_0xfd64('0x1b')](_0x19cac7);return _0x3ab6d8['set'](_0xfd64('0x21'),_0x136990+'-'+_0x4cc9c2+'/'+_0x366944)[_0xfd64('0x1c')](_0x3f7217);}return null;};}function patchUpdates(_0x5ab395){return function(_0x95d98f){try{jsonpatch[_0xfd64('0x22')](_0x95d98f,_0x5ab395,!![]);}catch(_0x447a04){return BPromise['reject'](_0x447a04);}return _0x95d98f['save']();};}function saveUpdates(_0x694a83,_0x1ec056){return function(_0x5c8fd){if(_0x5c8fd){return _0x5c8fd[_0xfd64('0x23')](_0x694a83)['then'](function(_0x853463){return _0x853463;});}return null;};}function removeEntity(_0x45dba0,_0x1a33f7){return function(_0x2d2273){if(_0x2d2273){return _0x2d2273[_0xfd64('0x24')]()[_0xfd64('0x25')](function(){_0x45dba0['status'](0xcc)[_0xfd64('0x1a')]();});}};}function handleEntityNotFound(_0x47e6fd,_0x1eb6f9){return function(_0x52218a){if(!_0x52218a){_0x47e6fd[_0xfd64('0x19')](0x194);}return _0x52218a;};}function handleError(_0x2cba05,_0x323f62){_0x323f62=_0x323f62||0x1f4;return function(_0x104e77){logger[_0xfd64('0x26')](_0x104e77[_0xfd64('0x27')]);if(_0x104e77['name']){delete _0x104e77[_0xfd64('0x28')];}_0x2cba05[_0xfd64('0x1b')](_0x323f62)['send'](_0x104e77);};}exports[_0xfd64('0x29')]=function(_0x237e6d,_0x41da45){var _0x211501={},_0x2ea267={},_0x49b43a={'count':0x0,'rows':[]};var _0x15dd5f=_[_0xfd64('0x2a')](db[_0xfd64('0x2b')][_0xfd64('0x2c')],function(_0x4ab988){return{'name':_0x4ab988['fieldName'],'type':_0x4ab988['type']['key']};});_0x2ea267['model']=_['map'](_0x15dd5f,_0xfd64('0x28'));_0x2ea267[_0xfd64('0x2d')]=_['keys'](_0x237e6d[_0xfd64('0x2d')]);_0x2ea267[_0xfd64('0x2e')]=_[_0xfd64('0x2f')](_0x2ea267[_0xfd64('0x30')],_0x2ea267[_0xfd64('0x2d')]);_0x211501[_0xfd64('0x31')]=_[_0xfd64('0x2f')](_0x2ea267['model'],qs[_0xfd64('0x32')](_0x237e6d['query']['fields']));_0x211501['attributes']=_0x211501[_0xfd64('0x31')][_0xfd64('0x33')]?_0x211501['attributes']:_0x2ea267['model'];if(!_0x237e6d['query'][_0xfd64('0x34')]('nolimit')){_0x211501['limit']=qs[_0xfd64('0x1d')](_0x237e6d[_0xfd64('0x2d')][_0xfd64('0x1d')]);_0x211501[_0xfd64('0x20')]=qs[_0xfd64('0x20')](_0x237e6d[_0xfd64('0x2d')]['offset']);}_0x211501[_0xfd64('0x35')]=qs[_0xfd64('0x36')](_0x237e6d['query'][_0xfd64('0x36')]);_0x211501['where']=qs['filters'](_[_0xfd64('0x37')](_0x237e6d[_0xfd64('0x2d')],_0x2ea267[_0xfd64('0x2e')]),_0x15dd5f);if(_0x237e6d[_0xfd64('0x2d')][_0xfd64('0x38')]){_0x211501['where']=_[_0xfd64('0x39')](_0x211501[_0xfd64('0x3a')],{'$or':_[_0xfd64('0x2a')](_0x15dd5f,function(_0x5ac6a5){if(_0x5ac6a5[_0xfd64('0x3b')]!=='VIRTUAL'){var _0x314080={};_0x314080[_0x5ac6a5[_0xfd64('0x28')]]={'$like':'%'+_0x237e6d[_0xfd64('0x2d')][_0xfd64('0x38')]+'%'};return _0x314080;}})});}_0x211501=_['merge']({},_0x211501,_0x237e6d[_0xfd64('0x3c')]);var _0x21abbc={'where':_0x211501[_0xfd64('0x3a')]};return db[_0xfd64('0x2b')][_0xfd64('0x1f')](_0x21abbc)['then'](function(_0x44340a){_0x49b43a[_0xfd64('0x1f')]=_0x44340a;if(_0x237e6d['query'][_0xfd64('0x3d')]){_0x211501[_0xfd64('0x3e')]=[{'all':!![]}];}return db[_0xfd64('0x2b')][_0xfd64('0x3f')](_0x211501);})[_0xfd64('0x25')](function(_0x5876e0){_0x49b43a['rows']=_0x5876e0;return _0x49b43a;})['then'](respondWithFilteredResult(_0x41da45,_0x211501))[_0xfd64('0x40')](handleError(_0x41da45,null));};exports[_0xfd64('0x41')]=function(_0xd49fc9,_0x14506a){var _0x24f2a2={'raw':!![],'where':{'id':_0xd49fc9[_0xfd64('0x42')]['id']}},_0xa6a7d0={};_0xa6a7d0['model']=_[_0xfd64('0x43')](db[_0xfd64('0x2b')]['rawAttributes']);_0xa6a7d0['query']=_[_0xfd64('0x43')](_0xd49fc9[_0xfd64('0x2d')]);_0xa6a7d0['filters']=_['intersection'](_0xa6a7d0[_0xfd64('0x30')],_0xa6a7d0['query']);_0x24f2a2['attributes']=_[_0xfd64('0x2f')](_0xa6a7d0[_0xfd64('0x30')],qs['fields'](_0xd49fc9['query'][_0xfd64('0x32')]));_0x24f2a2['attributes']=_0x24f2a2[_0xfd64('0x31')][_0xfd64('0x33')]?_0x24f2a2[_0xfd64('0x31')]:_0xa6a7d0[_0xfd64('0x30')];if(_0xd49fc9[_0xfd64('0x2d')][_0xfd64('0x3d')]){_0x24f2a2[_0xfd64('0x3e')]=[{'all':!![]}];}_0x24f2a2=_[_0xfd64('0x39')]({},_0x24f2a2,_0xd49fc9['options']);return db[_0xfd64('0x2b')]['find'](_0x24f2a2)[_0xfd64('0x25')](handleEntityNotFound(_0x14506a,null))['then'](respondWithResult(_0x14506a,null))[_0xfd64('0x40')](handleError(_0x14506a,null));};exports[_0xfd64('0x44')]=function(_0x3d0f97,_0xe2dd37){return db[_0xfd64('0x2b')]['create'](_0x3d0f97[_0xfd64('0x45')],{})[_0xfd64('0x25')](respondWithResult(_0xe2dd37,0xc9))[_0xfd64('0x40')](handleError(_0xe2dd37,null));};exports[_0xfd64('0x23')]=function(_0x54dcb9,_0xa69fba){if(_0x54dcb9['body']['id']){delete _0x54dcb9[_0xfd64('0x45')]['id'];}return db[_0xfd64('0x2b')][_0xfd64('0x46')]({'where':{'id':_0x54dcb9[_0xfd64('0x42')]['id']}})[_0xfd64('0x25')](handleEntityNotFound(_0xa69fba,null))[_0xfd64('0x25')](saveUpdates(_0x54dcb9[_0xfd64('0x45')],null))[_0xfd64('0x25')](respondWithResult(_0xa69fba,null))[_0xfd64('0x40')](handleError(_0xa69fba,null));};exports[_0xfd64('0x24')]=function(_0x4f97e2,_0x5d4ff1){return db['AnalyticTreeReport'][_0xfd64('0x46')]({'where':{'id':_0x4f97e2['params']['id']}})[_0xfd64('0x25')](handleEntityNotFound(_0x5d4ff1,null))[_0xfd64('0x25')](removeEntity(_0x5d4ff1,null))['catch'](handleError(_0x5d4ff1,null));};
\ No newline at end of file
+var _0xdd67=['offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','lodash','squel','crypto','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end'];(function(_0x10f2ad,_0x256d6){var _0x432110=function(_0x522bb4){while(--_0x522bb4){_0x10f2ad['push'](_0x10f2ad['shift']());}};_0x432110(++_0x256d6);}(_0xdd67,0x106));var _0x7dd6=function(_0x1f8a5d,_0x447149){_0x1f8a5d=_0x1f8a5d-0x0;var _0x2c1e27=_0xdd67[_0x1f8a5d];return _0x2c1e27;};'use strict';var emlformat=require(_0x7dd6('0x0'));var rimraf=require(_0x7dd6('0x1'));var zipdir=require(_0x7dd6('0x2'));var jsonpatch=require(_0x7dd6('0x3'));var rp=require(_0x7dd6('0x4'));var moment=require('moment');var BPromise=require(_0x7dd6('0x5'));var Mustache=require('mustache');var util=require(_0x7dd6('0x6'));var path=require(_0x7dd6('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dd6('0x8'));var squel=require(_0x7dd6('0x9'));var crypto=require(_0x7dd6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7dd6('0xb'));var toCsv=require(_0x7dd6('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7dd6('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x7dd6('0xe'));var hardwareService=require(_0x7dd6('0xf'));var logger=require('../../config/logger')(_0x7dd6('0x10'));var utils=require(_0x7dd6('0x11'));var config=require(_0x7dd6('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x7dd6('0x13'))['db'];function respondWithStatusCode(_0x3d3aef,_0x4b9366){_0x4b9366=_0x4b9366||0xcc;return function(_0x362cd2){if(_0x362cd2){return _0x3d3aef['sendStatus'](_0x4b9366);}return _0x3d3aef[_0x7dd6('0x14')](_0x4b9366)[_0x7dd6('0x15')]();};}function respondWithResult(_0x482a28,_0x424e1d){_0x424e1d=_0x424e1d||0xc8;return function(_0x3ba4aa){if(_0x3ba4aa){return _0x482a28[_0x7dd6('0x14')](_0x424e1d)['json'](_0x3ba4aa);}};}function respondWithFilteredResult(_0xbeabdf,_0x240391){return function(_0x29579b){if(_0x29579b){var _0x49c5d5=typeof _0x240391[_0x7dd6('0x16')]===_0x7dd6('0x17')&&typeof _0x240391[_0x7dd6('0x18')]===_0x7dd6('0x17');var _0x371432=_0x29579b[_0x7dd6('0x19')];var _0x1e42da=_0x49c5d5?0x0:_0x240391[_0x7dd6('0x16')];var _0x1edfa1=_0x49c5d5?_0x29579b[_0x7dd6('0x19')]:_0x240391[_0x7dd6('0x16')]+_0x240391[_0x7dd6('0x18')];var _0x54951e;if(_0x1edfa1>=_0x371432){_0x1edfa1=_0x371432;_0x54951e=0xc8;}else{_0x54951e=0xce;}_0xbeabdf[_0x7dd6('0x14')](_0x54951e);return _0xbeabdf[_0x7dd6('0x1a')](_0x7dd6('0x1b'),_0x1e42da+'-'+_0x1edfa1+'/'+_0x371432)[_0x7dd6('0x1c')](_0x29579b);}return null;};}function patchUpdates(_0x5d84f5){return function(_0xf303f7){try{jsonpatch[_0x7dd6('0x1d')](_0xf303f7,_0x5d84f5,!![]);}catch(_0x56ee64){return BPromise[_0x7dd6('0x1e')](_0x56ee64);}return _0xf303f7[_0x7dd6('0x1f')]();};}function saveUpdates(_0x2bfd34,_0x371545){return function(_0x2fe40e){if(_0x2fe40e){return _0x2fe40e[_0x7dd6('0x20')](_0x2bfd34)['then'](function(_0x11a28b){return _0x11a28b;});}return null;};}function removeEntity(_0x37ca73,_0x51d908){return function(_0x46fc27){if(_0x46fc27){return _0x46fc27['destroy']()[_0x7dd6('0x21')](function(){_0x37ca73[_0x7dd6('0x14')](0xcc)[_0x7dd6('0x15')]();});}};}function handleEntityNotFound(_0x1c9d8b,_0xcd3794){return function(_0x22e53c){if(!_0x22e53c){_0x1c9d8b[_0x7dd6('0x22')](0x194);}return _0x22e53c;};}function handleError(_0x4141f0,_0x348bf6){_0x348bf6=_0x348bf6||0x1f4;return function(_0x116d23){logger[_0x7dd6('0x23')](_0x116d23['stack']);if(_0x116d23[_0x7dd6('0x24')]){delete _0x116d23[_0x7dd6('0x24')];}_0x4141f0[_0x7dd6('0x14')](_0x348bf6)[_0x7dd6('0x25')](_0x116d23);};}exports[_0x7dd6('0x26')]=function(_0x7985e9,_0x4ec647){var _0x34be95={},_0x5ce095={},_0x5590c9={'count':0x0,'rows':[]};var _0x338153=_[_0x7dd6('0x27')](db[_0x7dd6('0x28')][_0x7dd6('0x29')],function(_0x27562e){return{'name':_0x27562e[_0x7dd6('0x2a')],'type':_0x27562e[_0x7dd6('0x2b')][_0x7dd6('0x2c')]};});_0x5ce095[_0x7dd6('0x2d')]=_[_0x7dd6('0x27')](_0x338153,'name');_0x5ce095[_0x7dd6('0x2e')]=_[_0x7dd6('0x2f')](_0x7985e9[_0x7dd6('0x2e')]);_0x5ce095['filters']=_[_0x7dd6('0x30')](_0x5ce095[_0x7dd6('0x2d')],_0x5ce095['query']);_0x34be95[_0x7dd6('0x31')]=_[_0x7dd6('0x30')](_0x5ce095['model'],qs[_0x7dd6('0x32')](_0x7985e9['query']['fields']));_0x34be95[_0x7dd6('0x31')]=_0x34be95[_0x7dd6('0x31')][_0x7dd6('0x33')]?_0x34be95[_0x7dd6('0x31')]:_0x5ce095['model'];if(!_0x7985e9[_0x7dd6('0x2e')]['hasOwnProperty'](_0x7dd6('0x34'))){_0x34be95[_0x7dd6('0x18')]=qs[_0x7dd6('0x18')](_0x7985e9[_0x7dd6('0x2e')][_0x7dd6('0x18')]);_0x34be95[_0x7dd6('0x16')]=qs[_0x7dd6('0x16')](_0x7985e9[_0x7dd6('0x2e')][_0x7dd6('0x16')]);}_0x34be95[_0x7dd6('0x35')]=qs[_0x7dd6('0x36')](_0x7985e9['query']['sort']);_0x34be95['where']=qs[_0x7dd6('0x37')](_[_0x7dd6('0x38')](_0x7985e9[_0x7dd6('0x2e')],_0x5ce095[_0x7dd6('0x37')]),_0x338153);if(_0x7985e9['query']['filter']){_0x34be95[_0x7dd6('0x39')]=_['merge'](_0x34be95[_0x7dd6('0x39')],{'$or':_[_0x7dd6('0x27')](_0x338153,function(_0x46494e){if(_0x46494e[_0x7dd6('0x2b')]!==_0x7dd6('0x3a')){var _0x3de296={};_0x3de296[_0x46494e['name']]={'$like':'%'+_0x7985e9[_0x7dd6('0x2e')]['filter']+'%'};return _0x3de296;}})});}_0x34be95=_[_0x7dd6('0x3b')]({},_0x34be95,_0x7985e9[_0x7dd6('0x3c')]);var _0x318c7e={'where':_0x34be95[_0x7dd6('0x39')]};return db[_0x7dd6('0x28')][_0x7dd6('0x19')](_0x318c7e)[_0x7dd6('0x21')](function(_0x40ea59){_0x5590c9[_0x7dd6('0x19')]=_0x40ea59;if(_0x7985e9['query'][_0x7dd6('0x3d')]){_0x34be95[_0x7dd6('0x3e')]=[{'all':!![]}];}return db[_0x7dd6('0x28')][_0x7dd6('0x3f')](_0x34be95);})[_0x7dd6('0x21')](function(_0x501983){_0x5590c9[_0x7dd6('0x40')]=_0x501983;return _0x5590c9;})['then'](respondWithFilteredResult(_0x4ec647,_0x34be95))[_0x7dd6('0x41')](handleError(_0x4ec647,null));};exports['show']=function(_0x2dc23f,_0x29badd){var _0x18ae43={'raw':!![],'where':{'id':_0x2dc23f[_0x7dd6('0x42')]['id']}},_0x416786={};_0x416786['model']=_[_0x7dd6('0x2f')](db[_0x7dd6('0x28')][_0x7dd6('0x29')]);_0x416786['query']=_[_0x7dd6('0x2f')](_0x2dc23f[_0x7dd6('0x2e')]);_0x416786[_0x7dd6('0x37')]=_[_0x7dd6('0x30')](_0x416786[_0x7dd6('0x2d')],_0x416786[_0x7dd6('0x2e')]);_0x18ae43[_0x7dd6('0x31')]=_[_0x7dd6('0x30')](_0x416786[_0x7dd6('0x2d')],qs[_0x7dd6('0x32')](_0x2dc23f[_0x7dd6('0x2e')]['fields']));_0x18ae43['attributes']=_0x18ae43[_0x7dd6('0x31')]['length']?_0x18ae43[_0x7dd6('0x31')]:_0x416786[_0x7dd6('0x2d')];if(_0x2dc23f[_0x7dd6('0x2e')][_0x7dd6('0x3d')]){_0x18ae43[_0x7dd6('0x3e')]=[{'all':!![]}];}_0x18ae43=_[_0x7dd6('0x3b')]({},_0x18ae43,_0x2dc23f[_0x7dd6('0x3c')]);return db[_0x7dd6('0x28')][_0x7dd6('0x43')](_0x18ae43)[_0x7dd6('0x21')](handleEntityNotFound(_0x29badd,null))['then'](respondWithResult(_0x29badd,null))[_0x7dd6('0x41')](handleError(_0x29badd,null));};exports[_0x7dd6('0x44')]=function(_0x4e8c99,_0x2c310a){return db['AnalyticTreeReport']['create'](_0x4e8c99[_0x7dd6('0x45')],{})[_0x7dd6('0x21')](respondWithResult(_0x2c310a,0xc9))[_0x7dd6('0x41')](handleError(_0x2c310a,null));};exports[_0x7dd6('0x20')]=function(_0x57dddf,_0x2c137c){if(_0x57dddf['body']['id']){delete _0x57dddf[_0x7dd6('0x45')]['id'];}return db[_0x7dd6('0x28')]['find']({'where':{'id':_0x57dddf['params']['id']}})[_0x7dd6('0x21')](handleEntityNotFound(_0x2c137c,null))[_0x7dd6('0x21')](saveUpdates(_0x57dddf[_0x7dd6('0x45')],null))[_0x7dd6('0x21')](respondWithResult(_0x2c137c,null))['catch'](handleError(_0x2c137c,null));};exports[_0x7dd6('0x46')]=function(_0xd87f2,_0x2d6878){return db[_0x7dd6('0x28')][_0x7dd6('0x43')]({'where':{'id':_0xd87f2['params']['id']}})['then'](handleEntityNotFound(_0x2d6878,null))[_0x7dd6('0x21')](removeEntity(_0x2d6878,null))['catch'](handleError(_0x2d6878,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 0995fc8..15b3ef0 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 _0x11f3=['../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3828e2,_0x2ef6d6){var _0x2fa385=function(_0x2b8040){while(--_0x2b8040){_0x3828e2['push'](_0x3828e2['shift']());}};_0x2fa385(++_0x2ef6d6);}(_0x11f3,0x118));var _0x311f=function(_0x3a7bdf,_0x58bdd8){_0x3a7bdf=_0x3a7bdf-0x0;var _0x35a9a8=_0x11f3[_0x3a7bdf];return _0x35a9a8;};'use strict';var _=require(_0x311f('0x0'));var util=require('util');var logger=require(_0x311f('0x1'))(_0x311f('0x2'));var moment=require(_0x311f('0x3'));var BPromise=require(_0x311f('0x4'));var rp=require(_0x311f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x311f('0x6'));var attributes=require(_0x311f('0x7'));module['exports']=function(_0x49d494,_0x1539be){return _0x49d494[_0x311f('0x8')](_0x311f('0x9'),attributes,{'tableName':_0x311f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x75e5=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./analyticTreeReport.attributes','exports','define','analytics_report_trees'];(function(_0x2046dd,_0x40a9ab){var _0x2eb055=function(_0x1c65e8){while(--_0x1c65e8){_0x2046dd['push'](_0x2046dd['shift']());}};_0x2eb055(++_0x40a9ab);}(_0x75e5,0x160));var _0x575e=function(_0x1e182d,_0x4f35c2){_0x1e182d=_0x1e182d-0x0;var _0x5627c6=_0x75e5[_0x1e182d];return _0x5627c6;};'use strict';var _=require(_0x575e('0x0'));var util=require(_0x575e('0x1'));var logger=require(_0x575e('0x2'))(_0x575e('0x3'));var moment=require(_0x575e('0x4'));var BPromise=require(_0x575e('0x5'));var rp=require(_0x575e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x575e('0x7'));module[_0x575e('0x8')]=function(_0x13223d,_0x493105){return _0x13223d[_0x575e('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0x575e('0xa'),'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 2711899..d2ed2f0 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 _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0xad82c8,_0x5bc74a){_0xad82c8=_0xad82c8-0x0;var _0x43b405=_0x7a54[_0xad82c8];return _0x43b405;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x1101d7,_0x409c83){_0x1101d7=_0x1101d7-0x0;var _0x5015cb=_0x7a54[_0x1101d7];return _0x5015cb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 424d726..4faba83 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 _0xe81f=['../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','put','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe81f,0x126));var _0xfe81=function(_0x3071b5,_0xa4b97d){_0x3071b5=_0x3071b5-0x0;var _0x43af37=_0xe81f[_0x3071b5];return _0x43af37;};'use strict';var multer=require(_0xfe81('0x0'));var util=require('util');var path=require(_0xfe81('0x1'));var timeout=require(_0xfe81('0x2'));var express=require('express');var router=express[_0xfe81('0x3')]();var fs_extra=require(_0xfe81('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfe81('0x5'));var config=require(_0xfe81('0x6'));var controller=require(_0xfe81('0x7'));router[_0xfe81('0x8')]('/',auth[_0xfe81('0x9')](),controller['index']);router[_0xfe81('0x8')](_0xfe81('0xa'),auth[_0xfe81('0x9')](),controller[_0xfe81('0xb')]);router['post']('/',auth[_0xfe81('0x9')](),controller['create']);router[_0xfe81('0xc')](_0xfe81('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xfe81('0xd')](_0xfe81('0xa'),auth['isAuthenticated'](),controller[_0xfe81('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xaeca=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','get','show','create','put','/:id','update','delete','exports'];(function(_0x52660e,_0x4bae6b){var _0x2fd1a3=function(_0x2caaaf){while(--_0x2caaaf){_0x52660e['push'](_0x52660e['shift']());}};_0x2fd1a3(++_0x4bae6b);}(_0xaeca,0x140));var _0xaaec=function(_0x9c0817,_0x50058d){_0x9c0817=_0x9c0817-0x0;var _0x396086=_0xaeca[_0x9c0817];return _0x396086;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaaec('0x0'));var timeout=require(_0xaaec('0x1'));var express=require(_0xaaec('0x2'));var router=express['Router']();var fs_extra=require(_0xaaec('0x3'));var auth=require(_0xaaec('0x4'));var interaction=require(_0xaaec('0x5'));var config=require('../../config/environment');var controller=require(_0xaaec('0x6'));router['get']('/',auth[_0xaaec('0x7')](),controller['index']);router[_0xaaec('0x8')]('/:id',auth[_0xaaec('0x7')](),controller[_0xaaec('0x9')]);router['post']('/',auth[_0xaaec('0x7')](),controller[_0xaaec('0xa')]);router[_0xaaec('0xb')](_0xaaec('0xc'),auth['isAuthenticated'](),controller[_0xaaec('0xd')]);router[_0xaaec('0xe')](_0xaaec('0xc'),auth[_0xaaec('0x7')](),controller['destroy']);module[_0xaaec('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index b408ea1..6523bbb 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 _0x8135=['STRING','exports'];(function(_0x1b22b3,_0x99ea09){var _0x1678f1=function(_0x4fc986){while(--_0x4fc986){_0x1b22b3['push'](_0x1b22b3['shift']());}};_0x1678f1(++_0x99ea09);}(_0x8135,0x99));var _0x5813=function(_0x3725fc,_0x98ba1e){_0x3725fc=_0x3725fc-0x0;var _0xe49d8d=_0x8135[_0x3725fc];return _0xe49d8d;};'use strict';var Sequelize=require('sequelize');module[_0x5813('0x0')]={'name':{'type':Sequelize[_0x5813('0x1')]},'basename':{'type':Sequelize[_0x5813('0x1')]},'type':{'type':Sequelize[_0x5813('0x1')]}};
\ No newline at end of file
+var _0x2b84=['STRING','sequelize'];(function(_0x22ae7c,_0x1d3152){var _0x286eb5=function(_0x5a641f){while(--_0x5a641f){_0x22ae7c['push'](_0x22ae7c['shift']());}};_0x286eb5(++_0x1d3152);}(_0x2b84,0x105));var _0x42b8=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x2b84[_0xf50820];return _0x2a9b10;};'use strict';var Sequelize=require(_0x42b8('0x0'));module['exports']={'name':{'type':Sequelize[_0x42b8('0x1')]},'basename':{'type':Sequelize[_0x42b8('0x1')]},'type':{'type':Sequelize[_0x42b8('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 0cb9d55..fcd6fd9 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 _0xefb5=['show','params','rawAttributes','find','omit','body','create','file','originalname','type','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','stack','name','send','index','Attachment','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch'];(function(_0x278111,_0x44e763){var _0x34edb0=function(_0x585faf){while(--_0x585faf){_0x278111['push'](_0x278111['shift']());}};_0x34edb0(++_0x44e763);}(_0xefb5,0x10b));var _0x5efb=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xefb5[_0x36ed48];return _0x51c63a;};'use strict';var emlformat=require(_0x5efb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5efb('0x1'));var jsonpatch=require(_0x5efb('0x2'));var rp=require(_0x5efb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5efb('0x4'));var util=require('util');var path=require(_0x5efb('0x5'));var sox=require(_0x5efb('0x6'));var csv=require(_0x5efb('0x7'));var ejs=require(_0x5efb('0x8'));var fs=require('fs');var fs_extra=require(_0x5efb('0x9'));var _=require('lodash');var squel=require(_0x5efb('0xa'));var crypto=require(_0x5efb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5efb('0xc'));var toCsv=require(_0x5efb('0x7'));var querystring=require(_0x5efb('0xd'));var Papa=require(_0x5efb('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5efb('0xf'));var as=require(_0x5efb('0x10'));var hardwareService=require(_0x5efb('0x11'));var logger=require(_0x5efb('0x12'))(_0x5efb('0x13'));var utils=require('../../config/utils');var config=require(_0x5efb('0x14'));var licenseUtil=require(_0x5efb('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16351f,_0x5cd8f8){_0x5cd8f8=_0x5cd8f8||0xcc;return function(_0x4e8c2a){if(_0x4e8c2a){return _0x16351f[_0x5efb('0x16')](_0x5cd8f8);}return _0x16351f[_0x5efb('0x17')](_0x5cd8f8)[_0x5efb('0x18')]();};}function respondWithResult(_0x2641ef,_0x5c1732){_0x5c1732=_0x5c1732||0xc8;return function(_0x4b0328){if(_0x4b0328){return _0x2641ef[_0x5efb('0x17')](_0x5c1732)[_0x5efb('0x19')](_0x4b0328);}};}function respondWithFilteredResult(_0x255365,_0xf415f0){return function(_0xc49129){if(_0xc49129){var _0x2b0ab9=typeof _0xf415f0[_0x5efb('0x1a')]===_0x5efb('0x1b')&&typeof _0xf415f0[_0x5efb('0x1c')]===_0x5efb('0x1b');var _0x324f4d=_0xc49129[_0x5efb('0x1d')];var _0x2a591a=_0x2b0ab9?0x0:_0xf415f0[_0x5efb('0x1a')];var _0x35ff7d=_0x2b0ab9?_0xc49129[_0x5efb('0x1d')]:_0xf415f0[_0x5efb('0x1a')]+_0xf415f0[_0x5efb('0x1c')];var _0x3c3e7a;if(_0x35ff7d>=_0x324f4d){_0x35ff7d=_0x324f4d;_0x3c3e7a=0xc8;}else{_0x3c3e7a=0xce;}_0x255365[_0x5efb('0x17')](_0x3c3e7a);return _0x255365[_0x5efb('0x1e')](_0x5efb('0x1f'),_0x2a591a+'-'+_0x35ff7d+'/'+_0x324f4d)[_0x5efb('0x19')](_0xc49129);}return null;};}function patchUpdates(_0x3da8d7){return function(_0xc9a640){try{jsonpatch[_0x5efb('0x20')](_0xc9a640,_0x3da8d7,!![]);}catch(_0xf8a70c){return BPromise[_0x5efb('0x21')](_0xf8a70c);}return _0xc9a640['save']();};}function saveUpdates(_0x4f3b80,_0x4badd8){return function(_0xee5caf){if(_0xee5caf){return _0xee5caf[_0x5efb('0x22')](_0x4f3b80)['then'](function(_0x58247a){return _0x58247a;});}return null;};}function removeEntity(_0x267932,_0xe5de8a){return function(_0x2e1f09){if(_0x2e1f09){return _0x2e1f09[_0x5efb('0x23')]()[_0x5efb('0x24')](function(){_0x267932[_0x5efb('0x17')](0xcc)[_0x5efb('0x18')]();});}};}function handleEntityNotFound(_0x5714fd,_0x1411b0){return function(_0x2f4a17){if(!_0x2f4a17){_0x5714fd['sendStatus'](0x194);}return _0x2f4a17;};}function handleError(_0x240189,_0x4ed1b7){_0x4ed1b7=_0x4ed1b7||0x1f4;return function(_0xc0d95f){logger['error'](_0xc0d95f[_0x5efb('0x25')]);if(_0xc0d95f[_0x5efb('0x26')]){delete _0xc0d95f[_0x5efb('0x26')];}_0x240189[_0x5efb('0x17')](_0x4ed1b7)[_0x5efb('0x27')](_0xc0d95f);};}exports[_0x5efb('0x28')]=function(_0x2886cd,_0x6cc841){var _0xc560b1={},_0x208bfe={},_0x6b0356={'count':0x0,'rows':[]};var _0x4dfc2c=_['map'](db[_0x5efb('0x29')]['rawAttributes'],function(_0x3c88ba){return{'name':_0x3c88ba['fieldName'],'type':_0x3c88ba['type'][_0x5efb('0x2a')]};});_0x208bfe[_0x5efb('0x2b')]=_[_0x5efb('0x2c')](_0x4dfc2c,'name');_0x208bfe[_0x5efb('0x2d')]=_[_0x5efb('0x2e')](_0x2886cd['query']);_0x208bfe[_0x5efb('0x2f')]=_['intersection'](_0x208bfe['model'],_0x208bfe[_0x5efb('0x2d')]);_0xc560b1[_0x5efb('0x30')]=_[_0x5efb('0x31')](_0x208bfe[_0x5efb('0x2b')],qs[_0x5efb('0x32')](_0x2886cd[_0x5efb('0x2d')][_0x5efb('0x32')]));_0xc560b1[_0x5efb('0x30')]=_0xc560b1['attributes'][_0x5efb('0x33')]?_0xc560b1['attributes']:_0x208bfe[_0x5efb('0x2b')];if(!_0x2886cd[_0x5efb('0x2d')]['hasOwnProperty'](_0x5efb('0x34'))){_0xc560b1[_0x5efb('0x1c')]=qs[_0x5efb('0x1c')](_0x2886cd[_0x5efb('0x2d')][_0x5efb('0x1c')]);_0xc560b1[_0x5efb('0x1a')]=qs[_0x5efb('0x1a')](_0x2886cd[_0x5efb('0x2d')][_0x5efb('0x1a')]);}_0xc560b1[_0x5efb('0x35')]=qs[_0x5efb('0x36')](_0x2886cd['query'][_0x5efb('0x36')]);_0xc560b1[_0x5efb('0x37')]=qs[_0x5efb('0x2f')](_[_0x5efb('0x38')](_0x2886cd[_0x5efb('0x2d')],_0x208bfe[_0x5efb('0x2f')]),_0x4dfc2c);if(_0x2886cd[_0x5efb('0x2d')][_0x5efb('0x39')]){_0xc560b1[_0x5efb('0x37')]=_[_0x5efb('0x3a')](_0xc560b1[_0x5efb('0x37')],{'$or':_[_0x5efb('0x2c')](_0x4dfc2c,function(_0x2a68f6){if(_0x2a68f6['type']!==_0x5efb('0x3b')){var _0x5718ff={};_0x5718ff[_0x2a68f6[_0x5efb('0x26')]]={'$like':'%'+_0x2886cd['query'][_0x5efb('0x39')]+'%'};return _0x5718ff;}})});}_0xc560b1=_[_0x5efb('0x3a')]({},_0xc560b1,_0x2886cd[_0x5efb('0x3c')]);var _0x127163={'where':_0xc560b1['where']};return db[_0x5efb('0x29')]['count'](_0x127163)['then'](function(_0x3b9602){_0x6b0356[_0x5efb('0x1d')]=_0x3b9602;if(_0x2886cd[_0x5efb('0x2d')][_0x5efb('0x3d')]){_0xc560b1[_0x5efb('0x3e')]=[{'all':!![]}];}return db[_0x5efb('0x29')][_0x5efb('0x3f')](_0xc560b1);})[_0x5efb('0x24')](function(_0xb4c804){_0x6b0356['rows']=_0xb4c804;return _0x6b0356;})[_0x5efb('0x24')](respondWithFilteredResult(_0x6cc841,_0xc560b1))[_0x5efb('0x40')](handleError(_0x6cc841,null));};exports[_0x5efb('0x41')]=function(_0x4c6fa0,_0x172f53){var _0x2e91c7={'raw':!![],'where':{'id':_0x4c6fa0[_0x5efb('0x42')]['id']}},_0x30d9f0={};_0x30d9f0['model']=_['keys'](db['Attachment'][_0x5efb('0x43')]);_0x30d9f0[_0x5efb('0x2d')]=_['keys'](_0x4c6fa0[_0x5efb('0x2d')]);_0x30d9f0[_0x5efb('0x2f')]=_[_0x5efb('0x31')](_0x30d9f0[_0x5efb('0x2b')],_0x30d9f0['query']);_0x2e91c7['attributes']=_['intersection'](_0x30d9f0[_0x5efb('0x2b')],qs[_0x5efb('0x32')](_0x4c6fa0[_0x5efb('0x2d')][_0x5efb('0x32')]));_0x2e91c7['attributes']=_0x2e91c7[_0x5efb('0x30')][_0x5efb('0x33')]?_0x2e91c7[_0x5efb('0x30')]:_0x30d9f0[_0x5efb('0x2b')];if(_0x4c6fa0[_0x5efb('0x2d')][_0x5efb('0x3d')]){_0x2e91c7[_0x5efb('0x3e')]=[{'all':!![]}];}_0x2e91c7=_[_0x5efb('0x3a')]({},_0x2e91c7,_0x4c6fa0[_0x5efb('0x3c')]);return db[_0x5efb('0x29')]['find'](_0x2e91c7)[_0x5efb('0x24')](handleEntityNotFound(_0x172f53,null))[_0x5efb('0x24')](respondWithResult(_0x172f53,null))[_0x5efb('0x40')](handleError(_0x172f53,null));};exports['clone']=function(_0x195bd2,_0x3058ae){var _0x1ab7aa={'where':{'id':_0x195bd2[_0x5efb('0x42')]['id']}},_0x5370b2={};_0x5370b2[_0x5efb('0x2b')]=_[_0x5efb('0x2e')](db[_0x5efb('0x29')][_0x5efb('0x43')]);_0x1ab7aa['attributes']=_[_0x5efb('0x31')](_0x5370b2['model'],qs['fields'](_0x195bd2['query'][_0x5efb('0x32')]));_0x1ab7aa[_0x5efb('0x30')]=_0x1ab7aa[_0x5efb('0x30')][_0x5efb('0x33')]?_0x1ab7aa['attributes']:_0x5370b2[_0x5efb('0x2b')];if(_0x195bd2[_0x5efb('0x2d')]['includeAll']){_0x1ab7aa['include']=[{'all':!![]}];}_0x1ab7aa=_[_0x5efb('0x3a')]({},_0x1ab7aa,_0x195bd2['options']);return db['Attachment'][_0x5efb('0x44')](_0x1ab7aa)[_0x5efb('0x24')](handleEntityNotFound(_0x3058ae,null))[_0x5efb('0x24')](function(_0x204433){if(_0x204433){var _0x25fc97=_0x204433['get']({'plain':!![]});_0x25fc97=qs[_0x5efb('0x45')](_0x25fc97,['id','createdAt','updatedAt']);_0x195bd2['body']=_[_0x5efb('0x45')](_0x195bd2[_0x5efb('0x46')],['id','createdAt','updatedAt']);return db[_0x5efb('0x29')][_0x5efb('0x47')](_[_0x5efb('0x3a')](_0x25fc97,_0x195bd2[_0x5efb('0x46')]),{'include':_0x195bd2['query'][_0x5efb('0x3d')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x3058ae,0xc9))[_0x5efb('0x40')](handleError(_0x3058ae,null));};exports[_0x5efb('0x22')]=function(_0x134a96,_0x479720){if(_0x134a96[_0x5efb('0x46')]['id']){delete _0x134a96['body']['id'];}return db[_0x5efb('0x29')][_0x5efb('0x44')]({'where':{'id':_0x134a96['params']['id']}})[_0x5efb('0x24')](handleEntityNotFound(_0x479720,null))[_0x5efb('0x24')](saveUpdates(_0x134a96[_0x5efb('0x46')],null))[_0x5efb('0x24')](respondWithResult(_0x479720,null))['catch'](handleError(_0x479720,null));};exports[_0x5efb('0x23')]=function(_0xc8ed46,_0x33639e){return db[_0x5efb('0x29')][_0x5efb('0x44')]({'where':{'id':_0xc8ed46[_0x5efb('0x42')]['id']}})[_0x5efb('0x24')](handleEntityNotFound(_0x33639e,null))[_0x5efb('0x24')](removeEntity(_0x33639e,null))[_0x5efb('0x40')](handleError(_0x33639e,null));};exports['create']=function(_0x3b8516,_0x12eac6,_0x3c1c24){_0x3b8516['body'][_0x5efb('0x26')]=_0x3b8516[_0x5efb('0x48')][_0x5efb('0x49')];_0x3b8516[_0x5efb('0x46')]['basename']=_0x3b8516['file']['filename'];_0x3b8516[_0x5efb('0x46')][_0x5efb('0x4a')]=_0x3b8516[_0x5efb('0x48')][_0x5efb('0x4b')];return db[_0x5efb('0x29')][_0x5efb('0x47')](_0x3b8516['body'])[_0x5efb('0x24')](respondWithResult(_0x12eac6,0xc9))['catch'](handleError(_0x12eac6,null));};exports[_0x5efb('0x4c')]=function(_0x549309,_0x5be08f,_0xf96c67){return db['Attachment'][_0x5efb('0x4d')]({'where':{'id':_0x549309[_0x5efb('0x42')]['id']},'raw':!![]})[_0x5efb('0x24')](handleEntityNotFound(_0x5be08f,null))['then'](function(_0x22a3da){if(_0x22a3da){var _0x2f587e=_0x22a3da[_0x5efb('0x4e')]!==null;var _0xfe62ec=path[_0x5efb('0x4f')](config['root'],_0x5efb('0x50'));if(_0x2f587e){_0xfe62ec=path[_0x5efb('0x4f')](_0xfe62ec,_0x5efb('0x51'));}var _0x250f19=path[_0x5efb('0x4f')](_0xfe62ec,_0x22a3da[_0x5efb('0x52')]);return _0x5be08f[_0x5efb('0x4c')](_0x250f19);}})[_0x5efb('0x40')](handleError(_0x5be08f,null));};
\ No newline at end of file
+var _0xbcb8=['include','findAll','rows','catch','show','params','includeAll','find','clone','length','omit','createdAt','body','create','destroy','file','originalname','basename','filename','type','mimetype','download','ChatOfflineMessageId','join','offline-chat/','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','Content-Range','apply','save','update','then','stack','name','map','Attachment','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options'];(function(_0x41064d,_0x4ead45){var _0x23ee30=function(_0x151d50){while(--_0x151d50){_0x41064d['push'](_0x41064d['shift']());}};_0x23ee30(++_0x4ead45);}(_0xbcb8,0x1b8));var _0x8bcb=function(_0x54a73b,_0x1993f2){_0x54a73b=_0x54a73b-0x0;var _0x4ebec2=_0xbcb8[_0x54a73b];return _0x4ebec2;};'use strict';var emlformat=require(_0x8bcb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8bcb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8bcb('0x2'));var moment=require('moment');var BPromise=require(_0x8bcb('0x3'));var Mustache=require(_0x8bcb('0x4'));var util=require(_0x8bcb('0x5'));var path=require('path');var sox=require(_0x8bcb('0x6'));var csv=require(_0x8bcb('0x7'));var ejs=require(_0x8bcb('0x8'));var fs=require('fs');var fs_extra=require(_0x8bcb('0x9'));var _=require('lodash');var squel=require(_0x8bcb('0xa'));var crypto=require(_0x8bcb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8bcb('0xc'));var toCsv=require(_0x8bcb('0x7'));var querystring=require(_0x8bcb('0xd'));var Papa=require('papaparse');var Redis=require(_0x8bcb('0xe'));var authService=require(_0x8bcb('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8bcb('0x10'));var hardwareService=require(_0x8bcb('0x11'));var logger=require(_0x8bcb('0x12'))(_0x8bcb('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8bcb('0x14'));var db=require(_0x8bcb('0x15'))['db'];function respondWithStatusCode(_0x49a5e0,_0x393ff9){_0x393ff9=_0x393ff9||0xcc;return function(_0x3bfdbd){if(_0x3bfdbd){return _0x49a5e0[_0x8bcb('0x16')](_0x393ff9);}return _0x49a5e0['status'](_0x393ff9)[_0x8bcb('0x17')]();};}function respondWithResult(_0x226b03,_0x26f2f1){_0x26f2f1=_0x26f2f1||0xc8;return function(_0x46b89a){if(_0x46b89a){return _0x226b03[_0x8bcb('0x18')](_0x26f2f1)[_0x8bcb('0x19')](_0x46b89a);}};}function respondWithFilteredResult(_0x544dd9,_0x4b8858){return function(_0x58801f){if(_0x58801f){var _0x152f56=typeof _0x4b8858[_0x8bcb('0x1a')]==='undefined'&&typeof _0x4b8858[_0x8bcb('0x1b')]==='undefined';var _0x3818eb=_0x58801f[_0x8bcb('0x1c')];var _0x4ed1e8=_0x152f56?0x0:_0x4b8858[_0x8bcb('0x1a')];var _0x221f4f=_0x152f56?_0x58801f[_0x8bcb('0x1c')]:_0x4b8858[_0x8bcb('0x1a')]+_0x4b8858['limit'];var _0x27fad0;if(_0x221f4f>=_0x3818eb){_0x221f4f=_0x3818eb;_0x27fad0=0xc8;}else{_0x27fad0=0xce;}_0x544dd9[_0x8bcb('0x18')](_0x27fad0);return _0x544dd9['set'](_0x8bcb('0x1d'),_0x4ed1e8+'-'+_0x221f4f+'/'+_0x3818eb)['json'](_0x58801f);}return null;};}function patchUpdates(_0x26a2e1){return function(_0x26297a){try{jsonpatch[_0x8bcb('0x1e')](_0x26297a,_0x26a2e1,!![]);}catch(_0xc02234){return BPromise['reject'](_0xc02234);}return _0x26297a[_0x8bcb('0x1f')]();};}function saveUpdates(_0x560cfa,_0x22b2e2){return function(_0x541266){if(_0x541266){return _0x541266[_0x8bcb('0x20')](_0x560cfa)[_0x8bcb('0x21')](function(_0x29ee6a){return _0x29ee6a;});}return null;};}function removeEntity(_0xf25c79,_0x400703){return function(_0x5f1d00){if(_0x5f1d00){return _0x5f1d00['destroy']()[_0x8bcb('0x21')](function(){_0xf25c79[_0x8bcb('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c128b,_0x315001){return function(_0x4c60c4){if(!_0x4c60c4){_0x1c128b[_0x8bcb('0x16')](0x194);}return _0x4c60c4;};}function handleError(_0x5b2b39,_0x556cb3){_0x556cb3=_0x556cb3||0x1f4;return function(_0x42374b){logger['error'](_0x42374b[_0x8bcb('0x22')]);if(_0x42374b[_0x8bcb('0x23')]){delete _0x42374b[_0x8bcb('0x23')];}_0x5b2b39[_0x8bcb('0x18')](_0x556cb3)['send'](_0x42374b);};}exports['index']=function(_0x18f9de,_0x2b484c){var _0xdab036={},_0x469436={},_0x2dfa22={'count':0x0,'rows':[]};var _0x183fc7=_[_0x8bcb('0x24')](db[_0x8bcb('0x25')][_0x8bcb('0x26')],function(_0x2813da){return{'name':_0x2813da[_0x8bcb('0x27')],'type':_0x2813da['type'][_0x8bcb('0x28')]};});_0x469436[_0x8bcb('0x29')]=_['map'](_0x183fc7,_0x8bcb('0x23'));_0x469436[_0x8bcb('0x2a')]=_[_0x8bcb('0x2b')](_0x18f9de[_0x8bcb('0x2a')]);_0x469436[_0x8bcb('0x2c')]=_[_0x8bcb('0x2d')](_0x469436[_0x8bcb('0x29')],_0x469436['query']);_0xdab036[_0x8bcb('0x2e')]=_['intersection'](_0x469436[_0x8bcb('0x29')],qs[_0x8bcb('0x2f')](_0x18f9de[_0x8bcb('0x2a')][_0x8bcb('0x2f')]));_0xdab036[_0x8bcb('0x2e')]=_0xdab036[_0x8bcb('0x2e')]['length']?_0xdab036[_0x8bcb('0x2e')]:_0x469436['model'];if(!_0x18f9de[_0x8bcb('0x2a')][_0x8bcb('0x30')](_0x8bcb('0x31'))){_0xdab036[_0x8bcb('0x1b')]=qs[_0x8bcb('0x1b')](_0x18f9de['query'][_0x8bcb('0x1b')]);_0xdab036[_0x8bcb('0x1a')]=qs[_0x8bcb('0x1a')](_0x18f9de[_0x8bcb('0x2a')][_0x8bcb('0x1a')]);}_0xdab036[_0x8bcb('0x32')]=qs[_0x8bcb('0x33')](_0x18f9de['query'][_0x8bcb('0x33')]);_0xdab036['where']=qs[_0x8bcb('0x2c')](_[_0x8bcb('0x34')](_0x18f9de[_0x8bcb('0x2a')],_0x469436[_0x8bcb('0x2c')]),_0x183fc7);if(_0x18f9de[_0x8bcb('0x2a')][_0x8bcb('0x35')]){_0xdab036[_0x8bcb('0x36')]=_[_0x8bcb('0x37')](_0xdab036[_0x8bcb('0x36')],{'$or':_[_0x8bcb('0x24')](_0x183fc7,function(_0x476fa8){if(_0x476fa8['type']!==_0x8bcb('0x38')){var _0x57dda7={};_0x57dda7[_0x476fa8[_0x8bcb('0x23')]]={'$like':'%'+_0x18f9de['query'][_0x8bcb('0x35')]+'%'};return _0x57dda7;}})});}_0xdab036=_[_0x8bcb('0x37')]({},_0xdab036,_0x18f9de[_0x8bcb('0x39')]);var _0x56c44c={'where':_0xdab036[_0x8bcb('0x36')]};return db[_0x8bcb('0x25')][_0x8bcb('0x1c')](_0x56c44c)['then'](function(_0x4a2314){_0x2dfa22['count']=_0x4a2314;if(_0x18f9de[_0x8bcb('0x2a')]['includeAll']){_0xdab036[_0x8bcb('0x3a')]=[{'all':!![]}];}return db[_0x8bcb('0x25')][_0x8bcb('0x3b')](_0xdab036);})[_0x8bcb('0x21')](function(_0x583154){_0x2dfa22[_0x8bcb('0x3c')]=_0x583154;return _0x2dfa22;})[_0x8bcb('0x21')](respondWithFilteredResult(_0x2b484c,_0xdab036))[_0x8bcb('0x3d')](handleError(_0x2b484c,null));};exports[_0x8bcb('0x3e')]=function(_0x20848d,_0x2f2805){var _0x16c444={'raw':!![],'where':{'id':_0x20848d[_0x8bcb('0x3f')]['id']}},_0x398b1b={};_0x398b1b[_0x8bcb('0x29')]=_[_0x8bcb('0x2b')](db[_0x8bcb('0x25')][_0x8bcb('0x26')]);_0x398b1b['query']=_[_0x8bcb('0x2b')](_0x20848d[_0x8bcb('0x2a')]);_0x398b1b[_0x8bcb('0x2c')]=_[_0x8bcb('0x2d')](_0x398b1b[_0x8bcb('0x29')],_0x398b1b[_0x8bcb('0x2a')]);_0x16c444[_0x8bcb('0x2e')]=_[_0x8bcb('0x2d')](_0x398b1b[_0x8bcb('0x29')],qs[_0x8bcb('0x2f')](_0x20848d[_0x8bcb('0x2a')][_0x8bcb('0x2f')]));_0x16c444['attributes']=_0x16c444[_0x8bcb('0x2e')]['length']?_0x16c444['attributes']:_0x398b1b[_0x8bcb('0x29')];if(_0x20848d[_0x8bcb('0x2a')][_0x8bcb('0x40')]){_0x16c444[_0x8bcb('0x3a')]=[{'all':!![]}];}_0x16c444=_[_0x8bcb('0x37')]({},_0x16c444,_0x20848d['options']);return db[_0x8bcb('0x25')][_0x8bcb('0x41')](_0x16c444)['then'](handleEntityNotFound(_0x2f2805,null))['then'](respondWithResult(_0x2f2805,null))[_0x8bcb('0x3d')](handleError(_0x2f2805,null));};exports[_0x8bcb('0x42')]=function(_0x5b6ee8,_0x29d03c){var _0x2b2762={'where':{'id':_0x5b6ee8[_0x8bcb('0x3f')]['id']}},_0x438406={};_0x438406['model']=_['keys'](db['Attachment'][_0x8bcb('0x26')]);_0x2b2762['attributes']=_[_0x8bcb('0x2d')](_0x438406[_0x8bcb('0x29')],qs[_0x8bcb('0x2f')](_0x5b6ee8[_0x8bcb('0x2a')][_0x8bcb('0x2f')]));_0x2b2762['attributes']=_0x2b2762[_0x8bcb('0x2e')][_0x8bcb('0x43')]?_0x2b2762[_0x8bcb('0x2e')]:_0x438406['model'];if(_0x5b6ee8[_0x8bcb('0x2a')][_0x8bcb('0x40')]){_0x2b2762[_0x8bcb('0x3a')]=[{'all':!![]}];}_0x2b2762=_[_0x8bcb('0x37')]({},_0x2b2762,_0x5b6ee8[_0x8bcb('0x39')]);return db[_0x8bcb('0x25')][_0x8bcb('0x41')](_0x2b2762)[_0x8bcb('0x21')](handleEntityNotFound(_0x29d03c,null))[_0x8bcb('0x21')](function(_0x46a774){if(_0x46a774){var _0x7d2777=_0x46a774['get']({'plain':!![]});_0x7d2777=qs[_0x8bcb('0x44')](_0x7d2777,['id',_0x8bcb('0x45'),'updatedAt']);_0x5b6ee8[_0x8bcb('0x46')]=_[_0x8bcb('0x44')](_0x5b6ee8[_0x8bcb('0x46')],['id',_0x8bcb('0x45'),'updatedAt']);return db['Attachment'][_0x8bcb('0x47')](_[_0x8bcb('0x37')](_0x7d2777,_0x5b6ee8[_0x8bcb('0x46')]),{'include':_0x5b6ee8[_0x8bcb('0x2a')][_0x8bcb('0x40')]?[{'all':!![]}]:undefined});}})[_0x8bcb('0x21')](respondWithResult(_0x29d03c,0xc9))[_0x8bcb('0x3d')](handleError(_0x29d03c,null));};exports[_0x8bcb('0x20')]=function(_0x5dd5c0,_0x403800){if(_0x5dd5c0[_0x8bcb('0x46')]['id']){delete _0x5dd5c0[_0x8bcb('0x46')]['id'];}return db[_0x8bcb('0x25')][_0x8bcb('0x41')]({'where':{'id':_0x5dd5c0['params']['id']}})[_0x8bcb('0x21')](handleEntityNotFound(_0x403800,null))[_0x8bcb('0x21')](saveUpdates(_0x5dd5c0[_0x8bcb('0x46')],null))[_0x8bcb('0x21')](respondWithResult(_0x403800,null))[_0x8bcb('0x3d')](handleError(_0x403800,null));};exports[_0x8bcb('0x48')]=function(_0x5146ab,_0x780eee){return db[_0x8bcb('0x25')][_0x8bcb('0x41')]({'where':{'id':_0x5146ab[_0x8bcb('0x3f')]['id']}})['then'](handleEntityNotFound(_0x780eee,null))[_0x8bcb('0x21')](removeEntity(_0x780eee,null))[_0x8bcb('0x3d')](handleError(_0x780eee,null));};exports[_0x8bcb('0x47')]=function(_0x4c9e77,_0x37ef0a,_0x237437){_0x4c9e77[_0x8bcb('0x46')]['name']=_0x4c9e77[_0x8bcb('0x49')][_0x8bcb('0x4a')];_0x4c9e77[_0x8bcb('0x46')][_0x8bcb('0x4b')]=_0x4c9e77[_0x8bcb('0x49')][_0x8bcb('0x4c')];_0x4c9e77[_0x8bcb('0x46')][_0x8bcb('0x4d')]=_0x4c9e77['file'][_0x8bcb('0x4e')];return db[_0x8bcb('0x25')][_0x8bcb('0x47')](_0x4c9e77[_0x8bcb('0x46')])[_0x8bcb('0x21')](respondWithResult(_0x37ef0a,0xc9))['catch'](handleError(_0x37ef0a,null));};exports[_0x8bcb('0x4f')]=function(_0x1c732c,_0x3d9d4f,_0x5654c1){return db[_0x8bcb('0x25')]['findOne']({'where':{'id':_0x1c732c[_0x8bcb('0x3f')]['id']},'raw':!![]})[_0x8bcb('0x21')](handleEntityNotFound(_0x3d9d4f,null))['then'](function(_0x57c6b5){if(_0x57c6b5){var _0x2f0a77=_0x57c6b5[_0x8bcb('0x50')]!==null;var _0x34766e=path[_0x8bcb('0x51')](config['root'],'server/files/attachments/');if(_0x2f0a77){_0x34766e=path[_0x8bcb('0x51')](_0x34766e,_0x8bcb('0x52'));}var _0x4fddad=path[_0x8bcb('0x51')](_0x34766e,_0x57c6b5[_0x8bcb('0x4b')]);return _0x3d9d4f[_0x8bcb('0x4f')](_0x4fddad);}})[_0x8bcb('0x3d')](handleError(_0x3d9d4f,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 8455976..18b4db2 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 _0x7e1a=['api','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','define','attachments','lodash','util','../../config/logger'];(function(_0x1f9c93,_0x533398){var _0x226ac2=function(_0x24412c){while(--_0x24412c){_0x1f9c93['push'](_0x1f9c93['shift']());}};_0x226ac2(++_0x533398);}(_0x7e1a,0x195));var _0xa7e1=function(_0x316da5,_0x34ddb6){_0x316da5=_0x316da5-0x0;var _0xbd1248=_0x7e1a[_0x316da5];return _0xbd1248;};'use strict';var _=require(_0xa7e1('0x0'));var util=require(_0xa7e1('0x1'));var logger=require(_0xa7e1('0x2'))(_0xa7e1('0x3'));var moment=require('moment');var BPromise=require(_0xa7e1('0x4'));var rp=require(_0xa7e1('0x5'));var fs=require('fs');var path=require(_0xa7e1('0x6'));var rimraf=require(_0xa7e1('0x7'));var config=require('../../config/environment');var attributes=require(_0xa7e1('0x8'));module[_0xa7e1('0x9')]=function(_0x334c92,_0x49e036){return _0x334c92[_0xa7e1('0xa')]('Attachment',attributes,{'tableName':_0xa7e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa31d=['../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','../../config/logger','api','moment','bluebird','path'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0xa31d,0x1d4));var _0xda31=function(_0x5d5bcb,_0x25e2ea){_0x5d5bcb=_0x5d5bcb-0x0;var _0x4ea5eb=_0xa31d[_0x5d5bcb];return _0x4ea5eb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xda31('0x0'))(_0xda31('0x1'));var moment=require(_0xda31('0x2'));var BPromise=require(_0xda31('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda31('0x4'));var rimraf=require('rimraf');var config=require(_0xda31('0x5'));var attributes=require(_0xda31('0x6'));module[_0xda31('0x7')]=function(_0xe94201,_0x5878e2){return _0xe94201[_0xda31('0x8')](_0xda31('0x9'),attributes,{'tableName':_0xda31('0xa'),'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 fc78d03..bc11a93 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 _0x4fef=['debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw'];(function(_0x569b7a,_0x377a61){var _0x39d00a=function(_0x1ee0bc){while(--_0x1ee0bc){_0x569b7a['push'](_0x569b7a['shift']());}};_0x39d00a(++_0x377a61);}(_0x4fef,0x10f));var _0xf4fe=function(_0x196b4b,_0x41613f){_0x196b4b=_0x196b4b-0x0;var _0xefe3b0=_0x4fef[_0x196b4b];return _0xefe3b0;};'use strict';var _=require(_0xf4fe('0x0'));var util=require(_0xf4fe('0x1'));var moment=require('moment');var BPromise=require(_0xf4fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4fe('0x3'));var db=require(_0xf4fe('0x4'))['db'];var utils=require(_0xf4fe('0x5'));var logger=require(_0xf4fe('0x6'))(_0xf4fe('0x7'));var config=require(_0xf4fe('0x8'));var jayson=require(_0xf4fe('0x9'));var client=jayson[_0xf4fe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x363096,_0x3e844d,_0x4805b0){return new BPromise(function(_0x23b761,_0x1e858f){return client[_0xf4fe('0xb')](_0x363096,_0x4805b0)[_0xf4fe('0xc')](function(_0xdec534){logger[_0xf4fe('0xd')](_0xf4fe('0xe'),_0x3e844d,_0xf4fe('0xf'));logger['debug'](_0xf4fe('0x10'),_0x3e844d,'request\x20sent',JSON[_0xf4fe('0x11')](_0xdec534));if(_0xdec534[_0xf4fe('0x12')]){if(_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x13')]===0x1f4){logger[_0xf4fe('0x12')]('Attachment,\x20%s,\x20%s',_0x3e844d,_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x14')]);return _0x1e858f(_0xdec534[_0xf4fe('0x12')]['message']);}logger[_0xf4fe('0x12')]('Attachment,\x20%s,\x20%s',_0x3e844d,_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x14')]);return _0x23b761(_0xdec534[_0xf4fe('0x12')]['message']);}else{logger[_0xf4fe('0xd')](_0xf4fe('0xe'),_0x3e844d,'request\x20sent');_0x23b761(_0xdec534[_0xf4fe('0x15')][_0xf4fe('0x14')]);}})[_0xf4fe('0x16')](function(_0x565dc6){logger['error'](_0xf4fe('0xe'),_0x3e844d,_0x565dc6);_0x1e858f(_0x565dc6);});});}exports[_0xf4fe('0x17')]=function(_0x5ad86c){var _0x519f1d=this;return new Promise(function(_0x24c818,_0x2b58dd){return db[_0xf4fe('0x18')][_0xf4fe('0x19')](_0x5ad86c[_0xf4fe('0x1a')],{'raw':_0x5ad86c[_0xf4fe('0x1b')]?_0x5ad86c[_0xf4fe('0x1b')][_0xf4fe('0x1c')]===undefined?!![]:![]:!![]})[_0xf4fe('0xc')](function(_0x223676){logger[_0xf4fe('0xd')](_0xf4fe('0x17'),_0x5ad86c);logger[_0xf4fe('0x1d')](_0xf4fe('0x17'),_0x5ad86c,JSON['stringify'](_0x223676));_0x24c818(_0x223676);})[_0xf4fe('0x16')](function(_0x5e8e18){logger['error']('CreateAttachment',_0x5e8e18[_0xf4fe('0x14')],_0x5ad86c);_0x2b58dd(_0x519f1d['error'](0x1f4,_0x5e8e18['message']));});});};
\ No newline at end of file
+var _0x12fd=['options','raw','debug','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','Attachment,\x20%s,\x20%s','result','catch','CreateAttachment','Attachment'];(function(_0x4ab11f,_0x22687d){var _0x5e4885=function(_0x50aa){while(--_0x50aa){_0x4ab11f['push'](_0x4ab11f['shift']());}};_0x5e4885(++_0x22687d);}(_0x12fd,0x199));var _0xd12f=function(_0x269979,_0x54a6c3){_0x269979=_0x269979-0x0;var _0x4c45ca=_0x12fd[_0x269979];return _0x4c45ca;};'use strict';var _=require(_0xd12f('0x0'));var util=require(_0xd12f('0x1'));var moment=require(_0xd12f('0x2'));var BPromise=require(_0xd12f('0x3'));var rs=require(_0xd12f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd12f('0x5'))['db'];var utils=require(_0xd12f('0x6'));var logger=require(_0xd12f('0x7'))(_0xd12f('0x8'));var config=require(_0xd12f('0x9'));var jayson=require(_0xd12f('0xa'));var client=jayson['client'][_0xd12f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ca6e6,_0x285abf,_0x193e89){return new BPromise(function(_0x62de68,_0x40aaf8){return client['request'](_0x5ca6e6,_0x193e89)[_0xd12f('0xc')](function(_0x539473){logger[_0xd12f('0xd')]('Attachment,\x20%s,\x20%s',_0x285abf,'request\x20sent');logger['debug'](_0xd12f('0xe'),_0x285abf,_0xd12f('0xf'),JSON['stringify'](_0x539473));if(_0x539473['error']){if(_0x539473['error']['code']===0x1f4){logger[_0xd12f('0x10')]('Attachment,\x20%s,\x20%s',_0x285abf,_0x539473[_0xd12f('0x10')][_0xd12f('0x11')]);return _0x40aaf8(_0x539473['error'][_0xd12f('0x11')]);}logger[_0xd12f('0x10')]('Attachment,\x20%s,\x20%s',_0x285abf,_0x539473['error']['message']);return _0x62de68(_0x539473[_0xd12f('0x10')][_0xd12f('0x11')]);}else{logger[_0xd12f('0xd')](_0xd12f('0x12'),_0x285abf,_0xd12f('0xf'));_0x62de68(_0x539473[_0xd12f('0x13')][_0xd12f('0x11')]);}})[_0xd12f('0x14')](function(_0x4769a2){logger['error']('Attachment,\x20%s,\x20%s',_0x285abf,_0x4769a2);_0x40aaf8(_0x4769a2);});});}exports[_0xd12f('0x15')]=function(_0x45ff4d){var _0x58a653=this;return new Promise(function(_0x14c619,_0x12c884){return db[_0xd12f('0x16')]['create'](_0x45ff4d['body'],{'raw':_0x45ff4d[_0xd12f('0x17')]?_0x45ff4d[_0xd12f('0x17')][_0xd12f('0x18')]===undefined?!![]:![]:!![]})[_0xd12f('0xc')](function(_0x410073){logger[_0xd12f('0xd')]('CreateAttachment',_0x45ff4d);logger[_0xd12f('0x19')](_0xd12f('0x15'),_0x45ff4d,JSON[_0xd12f('0x1a')](_0x410073));_0x14c619(_0x410073);})[_0xd12f('0x14')](function(_0x3a0c41){logger[_0xd12f('0x10')](_0xd12f('0x15'),_0x3a0c41[_0xd12f('0x11')],_0x45ff4d);_0x12c884(_0x58a653[_0xd12f('0x10')](0x1f4,_0x3a0c41[_0xd12f('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index ba61bc8..1b184cd 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(_0x28fd8c,_0x6826b2){var _0x26bd61=function(_0x3d717b){while(--_0x3d717b){_0x28fd8c['push'](_0x28fd8c['shift']());}};_0x26bd61(++_0x6826b2);}(_0xb10b,0x12a));var _0xbb10=function(_0x595151,_0x1f1f72){_0x595151=_0x595151-0x0;var _0x5776df=_0xb10b[_0x595151];return _0x5776df;};'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 _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x431c42,_0x336574){var _0x16f9df=function(_0x3956fd){while(--_0x3956fd){_0x431c42['push'](_0x431c42['shift']());}};_0x16f9df(++_0x336574);}(_0xadb5,0xad));var _0x5adb=function(_0x19c2de,_0x5318bd){_0x19c2de=_0x19c2de-0x0;var _0x226c87=_0xadb5[_0x19c2de];return _0x226c87;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index f2de981..5fbcdd9 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 _0x7355=['role','json','online','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','Error\x20authenticate\x20%s:\x20%s','inspect','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','findOne','name','password','salt','blocked','blockedAt','admin','user','agent','then','disabled','add','getLicense','catch','send','message','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.'];(function(_0x2000c8,_0x4550cc){var _0x39e30c=function(_0x2d79a4){while(--_0x2d79a4){_0x2000c8['push'](_0x2000c8['shift']());}};_0x39e30c(++_0x4550cc);}(_0x7355,0x91));var _0x5735=function(_0x1035c3,_0x1072dc){_0x1035c3=_0x1035c3-0x0;var _0x2aeba6=_0x7355[_0x1035c3];return _0x2aeba6;};'use strict';var passport=require(_0x5735('0x0'));var LocalStrategy=require(_0x5735('0x1'))[_0x5735('0x2')];var moment=require(_0x5735('0x3'));var ActiveDirectory=require(_0x5735('0x4'));var BPromise=require(_0x5735('0x5'));var util=require('util');var db=require(_0x5735('0x6'))['db'];var authService=require(_0x5735('0x7'));var utils=require(_0x5735('0x8'));var config=require(_0x5735('0x9'));var logger=require(_0x5735('0xa'))(_0x5735('0xb'));function isActiveDirectoryConfigured(_0x2c1aa3){var _0x186b2a=![];if(typeof _0x2c1aa3[_0x5735('0xc')]!==_0x5735('0xd')){_0x186b2a=_0x2c1aa3[_0x5735('0xc')][_0x5735('0xe')]&&_0x2c1aa3[_0x5735('0xc')]['url']&&_0x2c1aa3['activedirectory'][_0x5735('0xf')];}return _0x186b2a;}function adAuthenticate(_0x391f7d,_0x1cd8dd,_0x257a8e){return new BPromise(function(_0x52967e,_0x38b5f3){try{var _0x5c9bd9=new ActiveDirectory(_0x391f7d);_0x5c9bd9['authenticate'](_0x1cd8dd,_0x257a8e,function(_0x520186,_0x51172a){if(_0x520186){logger['error'](_0x5735('0x10'),_0x1cd8dd,util[_0x5735('0x11')](_0x520186,{'showHidden':![],'depth':null}));_0x38b5f3('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x51172a){logger[_0x5735('0x12')](_0x5735('0x13'),_0x1cd8dd);_0x38b5f3(_0x5735('0x14'));}else{_0x52967e(_0x51172a);}});}catch(_0x25f5d1){_0x38b5f3(_0x25f5d1);}});}function ActiveDirectoryAuthenticate(_0x377850,_0x1d4793,_0x2b5988,_0x12e200){var _0x295472,_0x184e0b;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x5735('0x15'),_0x1d4793);return _0x12e200(null,![],{'message':_0x5735('0x14')});}return db[_0x5735('0x16')]['findOne']({'where':{'id':0x1},'attributes':[_0x5735('0x17'),_0x5735('0x18')],'raw':!![]})['then'](function(_0x24314a){_0x295472=_0x24314a;if(!_0x295472[_0x5735('0x17')]){logger[_0x5735('0x12')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x1d4793);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x377850[_0x5735('0x19')]({'attributes':['id',_0x5735('0x1a'),_0x5735('0x1b'),_0x5735('0x1c'),'role','disabled',_0x5735('0x1d'),_0x5735('0x1e'),'online'],'where':{'name':_0x1d4793,'role':{'$or':[_0x5735('0x1f'),_0x5735('0x20'),_0x5735('0x21')]},'adSsoEnabled':!![]}});})[_0x5735('0x22')](function(_0x1838eb){if(!_0x1838eb||_0x1838eb&&_0x1838eb['name']!==_0x1d4793){throw new Error(_0x5735('0x14'));}_0x184e0b=_0x1838eb;var _0x4b1242=_0x184e0b['name']+'@'+config[_0x5735('0xc')][_0x5735('0xf')];return adAuthenticate(config[_0x5735('0xc')],_0x4b1242,_0x2b5988);})[_0x5735('0x22')](function(_0x5d855a){if(_0x184e0b[_0x5735('0x23')]){throw new Error(_0x5735('0x14'));}if(_0x295472[_0x5735('0x18')]>0x0){if(_0x184e0b[_0x5735('0x1d')]){if(moment(_0x184e0b['blockedAt'])[_0x5735('0x24')](_0x295472[_0x5735('0x18')],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x184e0b,0x0,![],null)['then'](function(){return utils[_0x5735('0x25')](_0x184e0b);})[_0x5735('0x22')](function(){return _0x12e200(null,_0x184e0b);});}else{return utils['getLicense'](_0x184e0b)[_0x5735('0x22')](function(){return _0x12e200(null,_0x184e0b);});}}else{return utils[_0x5735('0x25')](_0x184e0b)[_0x5735('0x22')](function(){return _0x12e200(null,_0x184e0b);});}})[_0x5735('0x26')](function(_0x315e1f){return _0x12e200(null,![],_0x315e1f);});}function handleError(_0x45f6b0,_0x37a04b,_0x384f53){return _0x45f6b0['status'](_0x37a04b||0x1f4)[_0x5735('0x27')]({'message':_0x384f53?_0x384f53[_0x5735('0x28')]||_0x384f53:''});}exports['login']=function(_0x185627,_0x11c6f6,_0x55c3e9){passport[_0x5735('0x29')]('ad-login',function(_0x1d70b2,_0x5dbf35,_0x552349){var _0x5bcf77=_0x1d70b2||_0x552349;if(_0x5bcf77){return handleError(_0x11c6f6,0x191,_0x5bcf77);}if(!_0x5dbf35){return handleError(_0x11c6f6,0x194,{'message':_0x5735('0x2a')});}else{var _0x5303af={'payload':{'id':_0x5dbf35['id'],'role':_0x5dbf35[_0x5735('0x2b')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5303af)[_0x5735('0x22')](function(_0x8e2547){_0x11c6f6[_0x5735('0x2c')]({'id':_0x5dbf35['id'],'token':_0x8e2547,'statusCall':'','isAlreadyLogged':_0x5dbf35[_0x5735('0x2d')]});});}})(_0x185627,_0x11c6f6,_0x55c3e9);};passport['use']('ad-login',new LocalStrategy({'usernameField':_0x5735('0x1a'),'passwordField':_0x5735('0x1b')},function(_0x18e17f,_0x35fb01,_0x5a383a){return ActiveDirectoryAuthenticate(db[_0x5735('0x2e')],_0x18e17f,_0x35fb01,_0x5a383a);}));
\ No newline at end of file
+var _0xbb6b=['url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','role','blockedAt','online','admin','user','agent','disabled','blocked','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','signToken','use','User','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory'];(function(_0x81dcac,_0x8ff7db){var _0xc7803b=function(_0x499b29){while(--_0x499b29){_0x81dcac['push'](_0x81dcac['shift']());}};_0xc7803b(++_0x8ff7db);}(_0xbb6b,0xea));var _0xbbb6=function(_0x5f5913,_0x2f50d1){_0x5f5913=_0x5f5913-0x0;var _0x377199=_0xbb6b[_0x5f5913];return _0x377199;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xbbb6('0x0'))[_0xbbb6('0x1')];var moment=require('moment');var ActiveDirectory=require(_0xbbb6('0x2'));var BPromise=require(_0xbbb6('0x3'));var util=require(_0xbbb6('0x4'));var db=require(_0xbbb6('0x5'))['db'];var authService=require(_0xbbb6('0x6'));var utils=require(_0xbbb6('0x7'));var config=require(_0xbbb6('0x8'));var logger=require('../../config/logger')(_0xbbb6('0x9'));function isActiveDirectoryConfigured(_0x1b7052){var _0x5e3c3c=![];if(typeof _0x1b7052[_0xbbb6('0xa')]!=='undefined'){_0x5e3c3c=_0x1b7052[_0xbbb6('0xa')]['baseDN']&&_0x1b7052[_0xbbb6('0xa')][_0xbbb6('0xb')]&&_0x1b7052[_0xbbb6('0xa')][_0xbbb6('0xc')];}return _0x5e3c3c;}function adAuthenticate(_0x5cd12d,_0x457fdd,_0x14c0c6){return new BPromise(function(_0x193cc6,_0x162f58){try{var _0x4a1ef3=new ActiveDirectory(_0x5cd12d);_0x4a1ef3[_0xbbb6('0xd')](_0x457fdd,_0x14c0c6,function(_0x15c180,_0x25f9ca){if(_0x15c180){logger['error'](_0xbbb6('0xe'),_0x457fdd,util[_0xbbb6('0xf')](_0x15c180,{'showHidden':![],'depth':null}));_0x162f58(_0xbbb6('0x10'));}else if(!_0x25f9ca){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x457fdd);_0x162f58('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x193cc6(_0x25f9ca);}});}catch(_0x4b83ca){_0x162f58(_0x4b83ca);}});}function ActiveDirectoryAuthenticate(_0x517bc9,_0x2b3dbc,_0x19a15c,_0x1c12b3){var _0x22a70c,_0x4a4a03;if(!isActiveDirectoryConfigured(config)){logger[_0xbbb6('0x11')](_0xbbb6('0x12'),_0x2b3dbc);return _0x1c12b3(null,![],{'message':_0xbbb6('0x10')});}return db[_0xbbb6('0x13')]['findOne']({'where':{'id':0x1},'attributes':[_0xbbb6('0x14'),_0xbbb6('0x15')],'raw':!![]})[_0xbbb6('0x16')](function(_0xa17a76){_0x22a70c=_0xa17a76;if(!_0x22a70c['adSsoEnabled']){logger[_0xbbb6('0x11')](_0xbbb6('0x17'),_0x2b3dbc);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x517bc9[_0xbbb6('0x18')]({'attributes':['id',_0xbbb6('0x19'),_0xbbb6('0x1a'),_0xbbb6('0x1b'),_0xbbb6('0x1c'),'disabled','blocked',_0xbbb6('0x1d'),_0xbbb6('0x1e')],'where':{'name':_0x2b3dbc,'role':{'$or':[_0xbbb6('0x1f'),_0xbbb6('0x20'),_0xbbb6('0x21')]},'adSsoEnabled':!![]}});})[_0xbbb6('0x16')](function(_0x33eaf4){if(!_0x33eaf4||_0x33eaf4&&_0x33eaf4[_0xbbb6('0x19')]!==_0x2b3dbc){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x4a4a03=_0x33eaf4;var _0x269900=_0x4a4a03[_0xbbb6('0x19')]+'@'+config[_0xbbb6('0xa')][_0xbbb6('0xc')];return adAuthenticate(config[_0xbbb6('0xa')],_0x269900,_0x19a15c);})[_0xbbb6('0x16')](function(_0x19dafa){if(_0x4a4a03[_0xbbb6('0x22')]){throw new Error(_0xbbb6('0x10'));}if(_0x22a70c[_0xbbb6('0x15')]>0x0){if(_0x4a4a03[_0xbbb6('0x23')]){if(moment(_0x4a4a03[_0xbbb6('0x1d')])[_0xbbb6('0x24')](_0x22a70c[_0xbbb6('0x15')],_0xbbb6('0x25'))>moment()){throw new Error(_0xbbb6('0x10'));}return utils[_0xbbb6('0x26')](_0x4a4a03,0x0,![],null)[_0xbbb6('0x16')](function(){return utils[_0xbbb6('0x27')](_0x4a4a03);})[_0xbbb6('0x16')](function(){return _0x1c12b3(null,_0x4a4a03);});}else{return utils[_0xbbb6('0x27')](_0x4a4a03)['then'](function(){return _0x1c12b3(null,_0x4a4a03);});}}else{return utils[_0xbbb6('0x27')](_0x4a4a03)['then'](function(){return _0x1c12b3(null,_0x4a4a03);});}})[_0xbbb6('0x28')](function(_0x290fba){return _0x1c12b3(null,![],_0x290fba);});}function handleError(_0x436d86,_0x426852,_0x447acd){return _0x436d86[_0xbbb6('0x29')](_0x426852||0x1f4)[_0xbbb6('0x2a')]({'message':_0x447acd?_0x447acd[_0xbbb6('0x2b')]||_0x447acd:''});}exports[_0xbbb6('0x2c')]=function(_0x3cdf21,_0x396178,_0x2ace40){passport['authenticate'](_0xbbb6('0x2d'),function(_0x4f4c89,_0x3171a0,_0xbf84fc){var _0x237458=_0x4f4c89||_0xbf84fc;if(_0x237458){return handleError(_0x396178,0x191,_0x237458);}if(!_0x3171a0){return handleError(_0x396178,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4637f8={'payload':{'id':_0x3171a0['id'],'role':_0x3171a0['role']},'options':{'expiresIn':0x15180}};return authService[_0xbbb6('0x2e')](_0x4637f8)[_0xbbb6('0x16')](function(_0x277c33){_0x396178['json']({'id':_0x3171a0['id'],'token':_0x277c33,'statusCall':'','isAlreadyLogged':_0x3171a0[_0xbbb6('0x1e')]});});}})(_0x3cdf21,_0x396178,_0x2ace40);};passport[_0xbbb6('0x2f')](_0xbbb6('0x2d'),new LocalStrategy({'usernameField':_0xbbb6('0x19'),'passwordField':'password'},function(_0x54986b,_0x2af4cb,_0x349613){return ActiveDirectoryAuthenticate(db[_0xbbb6('0x30')],_0x54986b,_0x2af4cb,_0x349613);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index d55faba..f2674aa 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 _0x81c3=['./authActiveDirectory.controller','post','exports','express'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x81c3,0x18b));var _0x381c=function(_0x5d9b60,_0x11579a){_0x5d9b60=_0x5d9b60-0x0;var _0x8b8632=_0x81c3[_0x5d9b60];return _0x8b8632;};'use strict';var express=require(_0x381c('0x0'));var router=express['Router']();var controller=require(_0x381c('0x1'));router[_0x381c('0x2')]('/',controller['login']);module[_0x381c('0x3')]=router;
\ No newline at end of file
+var _0x20b5=['./authActiveDirectory.controller','post','login','exports','express'];(function(_0x5ad771,_0x34186f){var _0x5b5dce=function(_0x5ad0fb){while(--_0x5ad0fb){_0x5ad771['push'](_0x5ad771['shift']());}};_0x5b5dce(++_0x34186f);}(_0x20b5,0x13a));var _0x520b=function(_0x21cb42,_0x4a9d87){_0x21cb42=_0x21cb42-0x0;var _0x4d847b=_0x20b5[_0x21cb42];return _0x4d847b;};'use strict';var express=require(_0x520b('0x0'));var router=express['Router']();var controller=require(_0x520b('0x1'));router[_0x520b('0x2')]('/',controller[_0x520b('0x3')]);module[_0x520b('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index c730952..579f05f 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x7a54,0x106));var _0x47a5=function(_0x26db4b,_0x314d28){_0x26db4b=_0x26db4b-0x0;var _0x1f64c9=_0x7a54[_0x26db4b];return _0x1f64c9;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x7a54,0x106));var _0x47a5=function(_0x389dc6,_0x1d2f0b){_0x389dc6=_0x389dc6-0x0;var _0x59a020=_0x7a54[_0x389dc6];return _0x59a020;};'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 842fc58..1bf1f3a 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 _0x9d5d=['login','isMiddleware','setTokenCookie','exports','express','passport','./authGoogle.controller','../../components/auth/service','get'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x9d5d,0x1bd));var _0xd9d5=function(_0x38ca9d,_0x3118ff){_0x38ca9d=_0x38ca9d-0x0;var _0x573132=_0x9d5d[_0x38ca9d];return _0x573132;};'use strict';var express=require(_0xd9d5('0x0'));var passport=require(_0xd9d5('0x1'));var router=express['Router']();var controller=require(_0xd9d5('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0xd9d5('0x3'));router[_0xd9d5('0x4')]('/',controller[_0xd9d5('0x5')]);router['get']('/callback',controller['callback'],authService[_0xd9d5('0x6')],userController[_0xd9d5('0x5')],authService[_0xd9d5('0x7')]);module[_0xd9d5('0x8')]=router;
\ No newline at end of file
+var _0x80ea=['express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie'];(function(_0x1ec25a,_0x4e81ca){var _0x55855f=function(_0x3b7aba){while(--_0x3b7aba){_0x1ec25a['push'](_0x1ec25a['shift']());}};_0x55855f(++_0x4e81ca);}(_0x80ea,0x15c));var _0xa80e=function(_0x59734a,_0x40a9b4){_0x59734a=_0x59734a-0x0;var _0xc5bdb4=_0x80ea[_0x59734a];return _0xc5bdb4;};'use strict';var express=require(_0xa80e('0x0'));var passport=require(_0xa80e('0x1'));var router=express[_0xa80e('0x2')]();var controller=require(_0xa80e('0x3'));var userController=require(_0xa80e('0x4'));var authService=require(_0xa80e('0x5'));router[_0xa80e('0x6')]('/',controller[_0xa80e('0x7')]);router[_0xa80e('0x6')](_0xa80e('0x8'),controller[_0xa80e('0x9')],authService[_0xa80e('0xa')],userController[_0xa80e('0x7')],authService[_0xa80e('0xb')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 787edd2..0a1f6a7 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 _0x94e1=['body','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','passwordHistoryLimit','securePassword','validatePasswordPattern','enforcePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','allowedLoginAttempts','blockDuration','findOne','name','password','role','disabled','blocked','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','then','add','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','status','send','local-login','signToken','forgot','generate'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x94e1,0x1e1));var _0x194e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x94e1[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x194e('0x0'));var passport=require(_0x194e('0x1'));var LocalStrategy=require(_0x194e('0x2'))[_0x194e('0x3')];var jayson=require(_0x194e('0x4'));var _=require(_0x194e('0x5'));var rs=require(_0x194e('0x6'));var moment=require(_0x194e('0x7'));var db=require(_0x194e('0x8'))['db'];var authService=require(_0x194e('0x9'));var utils=require('../../config/utils');var client=jayson[_0x194e('0xa')]['http']({'port':0x232b});function localAuthenticate(_0xebafa0,_0x118a27,_0x51c941,_0x3d99cd){var _0x56007b,_0x3c065a;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x194e('0xb'),_0x194e('0xc')],'raw':!![]})['then'](function(_0x1d647b){_0x56007b=_0x1d647b;return _0xebafa0[_0x194e('0xd')]({'attributes':['id',_0x194e('0xe'),_0x194e('0xf'),'salt',_0x194e('0x10'),_0x194e('0x11'),_0x194e('0x12'),_0x194e('0x13'),_0x194e('0x14')],'where':{'name':_0x118a27,'role':{'$or':[_0x194e('0x15'),_0x194e('0x16'),'agent']}}});})['then'](function(_0xcb40f4){if(!_0xcb40f4||_0xcb40f4&&_0xcb40f4[_0x194e('0xe')]!==_0x118a27){throw new Error(_0x194e('0x17'));}else{_0x3c065a=_0xcb40f4;return _0x3c065a;}})['then'](function(){_0x3c065a[_0x194e('0x18')](_0x51c941,function(_0x5adcf8,_0x2f26a1){var _0x131b15=_0x3c065a[_0x194e('0x14')]+0x1;if(_0x5adcf8){return _0x3d99cd(_0x5adcf8);}else if(!_0x2f26a1){if(_0x3c065a[_0x194e('0x11')]){return _0x3d99cd(null,![],{'message':_0x194e('0x17')});}else if(_0x56007b[_0x194e('0xb')]>0x0){if(_0x3c065a[_0x194e('0x12')]){if(_0x56007b[_0x194e('0xc')]>0x0){if(moment(_0x3c065a[_0x194e('0x13')])['add'](_0x56007b['blockDuration'],_0x194e('0x19'))>moment()){return _0x3d99cd(null,![],{'message':_0x194e('0x17')});}else{return utils[_0x194e('0x1a')](_0x3c065a,_0x131b15,![],null)['then'](function(){return _0x3d99cd(null,![],{'message':_0x194e('0x17')});});}}else{return _0x3d99cd(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x131b15>=_0x56007b[_0x194e('0xb')]){return utils[_0x194e('0x1a')](_0x3c065a,0x0,!![],moment())[_0x194e('0x1b')](function(){return _0x3d99cd(null,![],{'message':_0x194e('0x17')});});}else{return utils[_0x194e('0x1a')](_0x3c065a,_0x131b15,![],null)[_0x194e('0x1b')](function(){return _0x3d99cd(null,![],{'message':_0x194e('0x17')});});}}}else{return _0x3d99cd(null,![],{'message':_0x194e('0x17')});}}else{if(_0x3c065a[_0x194e('0x11')]){return _0x3d99cd(null,![],{'message':_0x194e('0x17')});}else if(_0x56007b[_0x194e('0xb')]>0x0){if(_0x3c065a[_0x194e('0x12')]){if(_0x56007b[_0x194e('0xc')]>0x0){if(moment(_0x3c065a[_0x194e('0x13')])[_0x194e('0x1c')](_0x56007b['blockDuration'],'minutes')>moment()){return _0x3d99cd(null,![],{'message':_0x194e('0x17')});}else{return utils[_0x194e('0x1a')](_0x3c065a,0x0,![],null)[_0x194e('0x1b')](function(){return utils[_0x194e('0x1d')](_0x3c065a);})['then'](function(){return _0x3d99cd(null,_0x3c065a);});}}else{return _0x3d99cd(null,![],{'message':_0x194e('0x17')});}}else{return utils['clearBlockUser'](_0x3c065a,0x0,![],null)[_0x194e('0x1b')](function(){return utils[_0x194e('0x1d')](_0x3c065a);})['then'](function(){return _0x3d99cd(null,_0x3c065a);})[_0x194e('0x1e')](function(_0x30fae9){return _0x3d99cd(null,![],_0x30fae9);});}}else{if(_0x3c065a[_0x194e('0x12')]){return _0x3d99cd(null,![],{'message':_0x194e('0x17')});}else{return utils[_0x194e('0x1d')](_0x3c065a)[_0x194e('0x1b')](function(){return _0x3d99cd(null,_0x3c065a);});}}}});})[_0x194e('0x1e')](function(_0x271c23){return _0x3d99cd(null,![],_0x271c23);});}function sendServiceMail(_0x250a37){return db['MailAccount'][_0x194e('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x194e('0xe'),_0x194e('0x20')],'include':[{'model':db[_0x194e('0x21')],'as':_0x194e('0x22'),'include':[{'model':db[_0x194e('0x23')],'as':'CloudProvider'}]}]})[_0x194e('0x1b')](function(_0x1871f5){if(!_0x1871f5){throw new Error(_0x194e('0x24'));}var _0x14c06c=_0x1871f5[_0x194e('0x25')]();var _0x572753={'account':_0x14c06c,'message':_['merge']({'from':util[_0x194e('0x26')](_0x194e('0x27'),_0x1871f5[_0x194e('0xe')],_0x1871f5[_0x194e('0x20')]||_0x1871f5[_0x194e('0x22')][_0x194e('0x16')])},_0x250a37)};return client[_0x194e('0x28')](_0x194e('0x29'),_0x572753);})[_0x194e('0x1b')](function(_0x1b4a09){if(_0x1b4a09['error']){throw new Error(util[_0x194e('0x26')](_0x194e('0x2a'),_0x1b4a09[_0x194e('0x2b')][_0x194e('0x2c')]||JSON['stringify'](_0x1b4a09['error'])));}return!![];});}function handleError(_0x2e10f5,_0x3a1c49,_0x3c4e79){return _0x2e10f5[_0x194e('0x2d')](_0x3a1c49||0x1f4)[_0x194e('0x2e')]({'message':_0x3c4e79?_0x3c4e79['message']||_0x3c4e79:''});}exports['login']=function(_0x4d50b3,_0x4cca9b,_0x25add5){passport[_0x194e('0x18')](_0x194e('0x2f'),function(_0x2e69d5,_0x590292,_0x25d138){var _0x1565de=_0x2e69d5||_0x25d138;if(_0x1565de){return handleError(_0x4cca9b,0x191,_0x1565de);}if(!_0x590292){return handleError(_0x4cca9b,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x117a1b={'payload':{'id':_0x590292['id'],'role':_0x590292[_0x194e('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x194e('0x30')](_0x117a1b)[_0x194e('0x1b')](function(_0xc3c53e){_0x4cca9b['json']({'id':_0x590292['id'],'token':_0xc3c53e,'statusCall':'','isAlreadyLogged':_0x590292['online']});});}})(_0x4d50b3,_0x4cca9b,_0x25add5);};exports[_0x194e('0x31')]=function(_0x30c2a9,_0x2c54b5){if(!_0x30c2a9['body'][_0x194e('0x20')]){return handleError(_0x2c54b5,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x1abdf9=rs[_0x194e('0x32')]();_0x30c2a9['body'][_0x194e('0x20')]=_0x30c2a9[_0x194e('0x33')][_0x194e('0x20')]['trim']()[_0x194e('0x34')]();var _0x3f2e26;return db[_0x194e('0x35')][_0x194e('0xd')]({'where':{'id':0x1},'attributes':[_0x194e('0xb'),_0x194e('0xc')],'raw':!![]})[_0x194e('0x1b')](function(_0x5ad9ba){_0x3f2e26=_0x5ad9ba;return db[_0x194e('0x36')][_0x194e('0x1f')]({'where':{'email':_0x30c2a9[_0x194e('0x33')][_0x194e('0x20')]}});})[_0x194e('0x1b')](function(_0x33b01b){if(!_0x33b01b){throw new Error(_0x194e('0x37'));}if(_0x33b01b[_0x194e('0x11')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x33b01b['blocked']){if(moment(_0x33b01b[_0x194e('0x13')])['add'](_0x3f2e26['blockDuration'],_0x194e('0x19'))>moment()){throw new Error(_0x194e('0x38'));}else{_0x33b01b[_0x194e('0x12')]=![];_0x33b01b['blockedAt']=null;}}_0x33b01b['resetPasswordToken']=_0x1abdf9;_0x33b01b[_0x194e('0x39')]=Date[_0x194e('0x3a')]()+0x36ee80;return _0x33b01b[_0x194e('0x3b')]();})[_0x194e('0x1b')](function(){return sendServiceMail({'to':_0x30c2a9[_0x194e('0x33')][_0x194e('0x20')],'subject':_0x194e('0x3c'),'text':_0x194e('0x3d')+_0x194e('0x3e')+_0x194e('0x3f')+_0x30c2a9['headers']['host']+_0x194e('0x40')+_0x1abdf9+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x194e('0x1b')](function(){_0x2c54b5['status'](0xc8)[_0x194e('0x2e')]({'message':_0x194e('0x41')});})['catch'](function(_0x474dd1){return handleError(_0x2c54b5,0x1f4,_0x474dd1);});};exports['reset']=function(_0x12e97b,_0x526790){return db[_0x194e('0x36')]['find']({'where':{'resetPasswordToken':_0x12e97b[_0x194e('0x42')][_0x194e('0x43')],'resetPasswordExpires':{'$gt':Date[_0x194e('0x3a')]()}}})[_0x194e('0x1b')](function(_0x1aad56){if(!_0x1aad56){throw new Error(_0x194e('0x44'));}return db[_0x194e('0x35')][_0x194e('0xd')]({'attributes':['id','securePassword','enforcePasswordHistory',_0x194e('0x45')]})[_0x194e('0x1b')](function(_0x190443){if(_0x190443[_0x194e('0x46')])authService[_0x194e('0x47')](_0x12e97b[_0x194e('0x33')][_0x194e('0xf')]);if(!_0x190443[_0x194e('0x48')]||!_0x1aad56[_0x194e('0x49')])return _0x1aad56;authService['validatePasswordHistory'](_0x12e97b[_0x194e('0x33')][_0x194e('0xf')],_0x1aad56[_0x194e('0x49')],_0x190443[_0x194e('0x45')]);return _0x1aad56;})['then'](function(){_0x1aad56[_0x194e('0xf')]=_0x12e97b[_0x194e('0x33')][_0x194e('0xf')];_0x1aad56['resetPasswordToken']=null;_0x1aad56['resetPasswordExpires']=null;return _0x1aad56[_0x194e('0x3b')]();});})['then'](function(){_0x526790[_0x194e('0x2d')](0xc8)[_0x194e('0x2e')]({'message':_0x194e('0x4a')});})[_0x194e('0x1e')](function(_0x369310){return handleError(_0x526790,0x1f4,_0x369310);});};passport[_0x194e('0x4b')](_0x194e('0x2f'),new LocalStrategy({'usernameField':_0x194e('0xe'),'passwordField':_0x194e('0xf')},function(_0x57b09c,_0x7c3dd0,_0x1ae8a0){return localAuthenticate(db['User'],_0x57b09c,_0x7c3dd0,_0x1ae8a0);}));
\ No newline at end of file
+var _0x9a44=['now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','password','save','status','Password\x20reset!','use','local-login','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','role','disabled','blocked','loginAttempts','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','add','minutes','clearBlockUser','getLicense','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','send','login','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires'];(function(_0x3e3780,_0x4b826e){var _0x338739=function(_0x80cd87){while(--_0x80cd87){_0x3e3780['push'](_0x3e3780['shift']());}};_0x338739(++_0x4b826e);}(_0x9a44,0x106));var _0x49a4=function(_0x32bbf1,_0x56976f){_0x32bbf1=_0x32bbf1-0x0;var _0x57c25b=_0x9a44[_0x32bbf1];return _0x57c25b;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x49a4('0x0'))[_0x49a4('0x1')];var jayson=require(_0x49a4('0x2'));var _=require('lodash');var rs=require(_0x49a4('0x3'));var moment=require(_0x49a4('0x4'));var db=require(_0x49a4('0x5'))['db'];var authService=require(_0x49a4('0x6'));var utils=require(_0x49a4('0x7'));var client=jayson[_0x49a4('0x8')][_0x49a4('0x9')]({'port':0x232b});function localAuthenticate(_0x11842c,_0x452566,_0x40e3c9,_0x3b5d8a){var _0x3c24d4,_0x3aeb3d;return db[_0x49a4('0xa')][_0x49a4('0xb')]({'where':{'id':0x1},'attributes':[_0x49a4('0xc'),_0x49a4('0xd')],'raw':!![]})['then'](function(_0xbb51a5){_0x3c24d4=_0xbb51a5;return _0x11842c[_0x49a4('0xb')]({'attributes':['id',_0x49a4('0xe'),'password',_0x49a4('0xf'),_0x49a4('0x10'),_0x49a4('0x11'),_0x49a4('0x12'),'blockedAt',_0x49a4('0x13')],'where':{'name':_0x452566,'role':{'$or':['admin',_0x49a4('0x14'),_0x49a4('0x15')]}}});})[_0x49a4('0x16')](function(_0x169785){if(!_0x169785||_0x169785&&_0x169785[_0x49a4('0xe')]!==_0x452566){throw new Error(_0x49a4('0x17'));}else{_0x3aeb3d=_0x169785;return _0x3aeb3d;}})['then'](function(){_0x3aeb3d[_0x49a4('0x18')](_0x40e3c9,function(_0x36787c,_0x2422df){var _0x54d47e=_0x3aeb3d[_0x49a4('0x13')]+0x1;if(_0x36787c){return _0x3b5d8a(_0x36787c);}else if(!_0x2422df){if(_0x3aeb3d[_0x49a4('0x11')]){return _0x3b5d8a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3c24d4[_0x49a4('0xc')]>0x0){if(_0x3aeb3d[_0x49a4('0x12')]){if(_0x3c24d4[_0x49a4('0xd')]>0x0){if(moment(_0x3aeb3d[_0x49a4('0x19')])[_0x49a4('0x1a')](_0x3c24d4[_0x49a4('0xd')],_0x49a4('0x1b'))>moment()){return _0x3b5d8a(null,![],{'message':_0x49a4('0x17')});}else{return utils[_0x49a4('0x1c')](_0x3aeb3d,_0x54d47e,![],null)[_0x49a4('0x16')](function(){return _0x3b5d8a(null,![],{'message':_0x49a4('0x17')});});}}else{return _0x3b5d8a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x54d47e>=_0x3c24d4[_0x49a4('0xc')]){return utils[_0x49a4('0x1c')](_0x3aeb3d,0x0,!![],moment())['then'](function(){return _0x3b5d8a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x49a4('0x1c')](_0x3aeb3d,_0x54d47e,![],null)['then'](function(){return _0x3b5d8a(null,![],{'message':_0x49a4('0x17')});});}}}else{return _0x3b5d8a(null,![],{'message':_0x49a4('0x17')});}}else{if(_0x3aeb3d['disabled']){return _0x3b5d8a(null,![],{'message':_0x49a4('0x17')});}else if(_0x3c24d4[_0x49a4('0xc')]>0x0){if(_0x3aeb3d[_0x49a4('0x12')]){if(_0x3c24d4['blockDuration']>0x0){if(moment(_0x3aeb3d[_0x49a4('0x19')])[_0x49a4('0x1a')](_0x3c24d4[_0x49a4('0xd')],_0x49a4('0x1b'))>moment()){return _0x3b5d8a(null,![],{'message':_0x49a4('0x17')});}else{return utils[_0x49a4('0x1c')](_0x3aeb3d,0x0,![],null)[_0x49a4('0x16')](function(){return utils[_0x49a4('0x1d')](_0x3aeb3d);})[_0x49a4('0x16')](function(){return _0x3b5d8a(null,_0x3aeb3d);});}}else{return _0x3b5d8a(null,![],{'message':_0x49a4('0x17')});}}else{return utils[_0x49a4('0x1c')](_0x3aeb3d,0x0,![],null)['then'](function(){return utils[_0x49a4('0x1d')](_0x3aeb3d);})[_0x49a4('0x16')](function(){return _0x3b5d8a(null,_0x3aeb3d);})['catch'](function(_0x3e7224){return _0x3b5d8a(null,![],_0x3e7224);});}}else{if(_0x3aeb3d[_0x49a4('0x12')]){return _0x3b5d8a(null,![],{'message':_0x49a4('0x17')});}else{return utils['getLicense'](_0x3aeb3d)[_0x49a4('0x16')](function(){return _0x3b5d8a(null,_0x3aeb3d);});}}}});})['catch'](function(_0xa61fbc){return _0x3b5d8a(null,![],_0xa61fbc);});}function sendServiceMail(_0x3116a4){return db[_0x49a4('0x1e')][_0x49a4('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x49a4('0xe'),_0x49a4('0x20')],'include':[{'model':db[_0x49a4('0x21')],'as':_0x49a4('0x22'),'include':[{'model':db[_0x49a4('0x23')],'as':_0x49a4('0x23')}]}]})[_0x49a4('0x16')](function(_0x4200b1){if(!_0x4200b1){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x1d51ef=_0x4200b1[_0x49a4('0x24')]();var _0x2bd4ff={'account':_0x1d51ef,'message':_['merge']({'from':util[_0x49a4('0x25')](_0x49a4('0x26'),_0x4200b1['name'],_0x4200b1[_0x49a4('0x20')]||_0x4200b1[_0x49a4('0x22')]['user'])},_0x3116a4)};return client[_0x49a4('0x27')](_0x49a4('0x28'),_0x2bd4ff);})[_0x49a4('0x16')](function(_0x6caf7e){if(_0x6caf7e['error']){throw new Error(util[_0x49a4('0x25')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x6caf7e[_0x49a4('0x29')][_0x49a4('0x2a')]||JSON[_0x49a4('0x2b')](_0x6caf7e[_0x49a4('0x29')])));}return!![];});}function handleError(_0x1d6366,_0x152fec,_0x12246b){return _0x1d6366['status'](_0x152fec||0x1f4)[_0x49a4('0x2c')]({'message':_0x12246b?_0x12246b['message']||_0x12246b:''});}exports[_0x49a4('0x2d')]=function(_0x2122ee,_0x2f8c5b,_0x5753b4){passport[_0x49a4('0x18')]('local-login',function(_0x19faaf,_0xc5f366,_0x305886){var _0x480a4=_0x19faaf||_0x305886;if(_0x480a4){return handleError(_0x2f8c5b,0x191,_0x480a4);}if(!_0xc5f366){return handleError(_0x2f8c5b,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3a219d={'payload':{'id':_0xc5f366['id'],'role':_0xc5f366[_0x49a4('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x49a4('0x2e')](_0x3a219d)['then'](function(_0x2b8a88){_0x2f8c5b['json']({'id':_0xc5f366['id'],'token':_0x2b8a88,'statusCall':'','isAlreadyLogged':_0xc5f366[_0x49a4('0x2f')]});});}})(_0x2122ee,_0x2f8c5b,_0x5753b4);};exports[_0x49a4('0x30')]=function(_0x82646b,_0x1ac5a1){if(!_0x82646b[_0x49a4('0x31')][_0x49a4('0x20')]){return handleError(_0x1ac5a1,0x1f4,{'message':_0x49a4('0x32')});}var _0x3c5c88=rs[_0x49a4('0x33')]();_0x82646b[_0x49a4('0x31')][_0x49a4('0x20')]=_0x82646b['body'][_0x49a4('0x20')][_0x49a4('0x34')]()[_0x49a4('0x35')]();var _0x2d4292;return db[_0x49a4('0xa')][_0x49a4('0xb')]({'where':{'id':0x1},'attributes':[_0x49a4('0xc'),_0x49a4('0xd')],'raw':!![]})['then'](function(_0x3cf8e4){_0x2d4292=_0x3cf8e4;return db[_0x49a4('0x36')][_0x49a4('0x1f')]({'where':{'email':_0x82646b[_0x49a4('0x31')][_0x49a4('0x20')]}});})[_0x49a4('0x16')](function(_0x4f2616){if(!_0x4f2616){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x4f2616[_0x49a4('0x11')]){throw new Error(_0x49a4('0x37'));}if(_0x4f2616[_0x49a4('0x12')]){if(moment(_0x4f2616['blockedAt'])[_0x49a4('0x1a')](_0x2d4292[_0x49a4('0xd')],_0x49a4('0x1b'))>moment()){throw new Error(_0x49a4('0x38'));}else{_0x4f2616[_0x49a4('0x12')]=![];_0x4f2616['blockedAt']=null;}}_0x4f2616['resetPasswordToken']=_0x3c5c88;_0x4f2616[_0x49a4('0x39')]=Date[_0x49a4('0x3a')]()+0x36ee80;return _0x4f2616['save']();})['then'](function(){return sendServiceMail({'to':_0x82646b[_0x49a4('0x31')][_0x49a4('0x20')],'subject':_0x49a4('0x3b'),'text':_0x49a4('0x3c')+_0x49a4('0x3d')+_0x49a4('0x3e')+_0x82646b['headers'][_0x49a4('0x3f')]+_0x49a4('0x40')+_0x3c5c88+'\x0a\x0a'+_0x49a4('0x41')});})[_0x49a4('0x16')](function(){_0x1ac5a1['status'](0xc8)[_0x49a4('0x2c')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x33e910){return handleError(_0x1ac5a1,0x1f4,_0x33e910);});};exports['reset']=function(_0x102c0b,_0x2bdb50){return db[_0x49a4('0x36')][_0x49a4('0x1f')]({'where':{'resetPasswordToken':_0x102c0b[_0x49a4('0x42')][_0x49a4('0x43')],'resetPasswordExpires':{'$gt':Date[_0x49a4('0x3a')]()}}})['then'](function(_0x50ae3a){if(!_0x50ae3a){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x49a4('0xa')][_0x49a4('0xb')]({'attributes':['id',_0x49a4('0x44'),_0x49a4('0x45'),_0x49a4('0x46')]})[_0x49a4('0x16')](function(_0x3344e0){if(_0x3344e0[_0x49a4('0x44')])authService[_0x49a4('0x47')](_0x102c0b[_0x49a4('0x31')]['password']);if(!_0x3344e0[_0x49a4('0x45')]||!_0x50ae3a[_0x49a4('0x48')])return _0x50ae3a;authService[_0x49a4('0x49')](_0x102c0b[_0x49a4('0x31')][_0x49a4('0x4a')],_0x50ae3a[_0x49a4('0x48')],_0x3344e0[_0x49a4('0x46')]);return _0x50ae3a;})[_0x49a4('0x16')](function(){_0x50ae3a[_0x49a4('0x4a')]=_0x102c0b[_0x49a4('0x31')][_0x49a4('0x4a')];_0x50ae3a['resetPasswordToken']=null;_0x50ae3a[_0x49a4('0x39')]=null;return _0x50ae3a[_0x49a4('0x4b')]();});})['then'](function(){_0x2bdb50[_0x49a4('0x4c')](0xc8)[_0x49a4('0x2c')]({'message':_0x49a4('0x4d')});})['catch'](function(_0x19b11f){return handleError(_0x2bdb50,0x1f4,_0x19b11f);});};passport[_0x49a4('0x4e')](_0x49a4('0x4f'),new LocalStrategy({'usernameField':'name','passwordField':_0x49a4('0x4a')},function(_0x5dac02,_0x29c6bd,_0x1d83cc){return localAuthenticate(db['User'],_0x5dac02,_0x29c6bd,_0x1d83cc);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 93efb4b..46dca26 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 _0xd335=['/reset/:token','exports','express','Router','login','post','/forgot','forgot'];(function(_0x5e3a45,_0x45f0c5){var _0x13419f=function(_0x5ac996){while(--_0x5ac996){_0x5e3a45['push'](_0x5e3a45['shift']());}};_0x13419f(++_0x45f0c5);}(_0xd335,0x19a));var _0x5d33=function(_0x229b9e,_0x4e863a){_0x229b9e=_0x229b9e-0x0;var _0x3ae42d=_0xd335[_0x229b9e];return _0x3ae42d;};'use strict';var express=require(_0x5d33('0x0'));var router=express[_0x5d33('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0x5d33('0x2')]);router[_0x5d33('0x3')](_0x5d33('0x4'),controller[_0x5d33('0x5')]);router[_0x5d33('0x3')](_0x5d33('0x6'),controller['reset']);module[_0x5d33('0x7')]=router;
\ No newline at end of file
+var _0x8ff5=['Router','./authLocal.controller','post','/forgot','/reset/:token','reset','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ff5,0xd1));var _0x58ff=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x8ff5[_0x5d6456];return _0x4d66c1;};'use strict';var express=require(_0x58ff('0x0'));var router=express[_0x58ff('0x1')]();var controller=require(_0x58ff('0x2'));router[_0x58ff('0x3')]('/',controller['login']);router[_0x58ff('0x3')](_0x58ff('0x4'),controller['forgot']);router['post'](_0x58ff('0x5'),controller[_0x58ff('0x6')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 34246f7..03dbb26 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 _0x062a=['INTEGER','STRING'];(function(_0x3fd7ab,_0x3dd0bc){var _0x56cb4b=function(_0x2cd862){while(--_0x2cd862){_0x3fd7ab['push'](_0x3fd7ab['shift']());}};_0x56cb4b(++_0x3dd0bc);}(_0x062a,0x16b));var _0xa062=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x062a[_0x1ed116];return _0x574066;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa062('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0xa062('0x0')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xa062('0x1')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x8b80=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x44a895,_0x4d65a2){var _0x591a86=function(_0x2468b8){while(--_0x2468b8){_0x44a895['push'](_0x44a895['shift']());}};_0x591a86(++_0x4d65a2);}(_0x8b80,0x73));var _0x08b8=function(_0x307bf6,_0x55bdd5){_0x307bf6=_0x307bf6-0x0;var _0x2878fc=_0x8b80[_0x307bf6];return _0x2878fc;};'use strict';var Sequelize=require(_0x08b8('0x0'));module[_0x08b8('0x1')]={'name':{'type':Sequelize[_0x08b8('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x08b8('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x08b8('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x08b8('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 cdcd911..211b836 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 _0xe545=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','keys','intersection','query','attributes','fields','model','nolimit','order','sort','where','pick','filters','merge','options','count','includeAll','include','findAll','catch','params','length','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','filter','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe545,0x17f));var _0x5e54=function(_0x3e3ba7,_0x531288){_0x3e3ba7=_0x3e3ba7-0x0;var _0x2f6d9d=_0xe545[_0x3e3ba7];return _0x2f6d9d;};'use strict';var emlformat=require(_0x5e54('0x0'));var rimraf=require(_0x5e54('0x1'));var zipdir=require(_0x5e54('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5e54('0x3'));var moment=require(_0x5e54('0x4'));var BPromise=require(_0x5e54('0x5'));var Mustache=require(_0x5e54('0x6'));var util=require(_0x5e54('0x7'));var path=require('path');var sox=require(_0x5e54('0x8'));var csv=require('to-csv');var ejs=require(_0x5e54('0x9'));var fs=require('fs');var fs_extra=require(_0x5e54('0xa'));var _=require('lodash');var squel=require(_0x5e54('0xb'));var crypto=require(_0x5e54('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5e54('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5e54('0xe'));var Papa=require(_0x5e54('0xf'));var Redis=require(_0x5e54('0x10'));var authService=require(_0x5e54('0x11'));var qs=require(_0x5e54('0x12'));var as=require(_0x5e54('0x13'));var hardwareService=require(_0x5e54('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5e54('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1dc37a,_0x1acb17){_0x1acb17=_0x1acb17||0xcc;return function(_0x3dee05){if(_0x3dee05){return _0x1dc37a[_0x5e54('0x16')](_0x1acb17);}return _0x1dc37a[_0x5e54('0x17')](_0x1acb17)[_0x5e54('0x18')]();};}function respondWithResult(_0x1053e1,_0x4cba04){_0x4cba04=_0x4cba04||0xc8;return function(_0x1bfaa5){if(_0x1bfaa5){return _0x1053e1[_0x5e54('0x17')](_0x4cba04)['json'](_0x1bfaa5);}};}function respondWithFilteredResult(_0x2c1a3b,_0x31dc8c){return function(_0x538336){if(_0x538336){var _0x29ee90=typeof _0x31dc8c[_0x5e54('0x19')]===_0x5e54('0x1a')&&typeof _0x31dc8c['limit']==='undefined';var _0x1af620=_0x538336['count'];var _0x35d1b5=_0x29ee90?0x0:_0x31dc8c[_0x5e54('0x19')];var _0x4b5625=_0x29ee90?_0x538336['count']:_0x31dc8c[_0x5e54('0x19')]+_0x31dc8c[_0x5e54('0x1b')];var _0x4fa4f3;if(_0x4b5625>=_0x1af620){_0x4b5625=_0x1af620;_0x4fa4f3=0xc8;}else{_0x4fa4f3=0xce;}_0x2c1a3b['status'](_0x4fa4f3);return _0x2c1a3b['set'](_0x5e54('0x1c'),_0x35d1b5+'-'+_0x4b5625+'/'+_0x1af620)[_0x5e54('0x1d')](_0x538336);}return null;};}function patchUpdates(_0x1b7d06){return function(_0x438fdf){try{jsonpatch[_0x5e54('0x1e')](_0x438fdf,_0x1b7d06,!![]);}catch(_0x5a6967){return BPromise[_0x5e54('0x1f')](_0x5a6967);}return _0x438fdf['save']();};}function saveUpdates(_0x506afe,_0x4f0b65){return function(_0x3b0772){if(_0x3b0772){return _0x3b0772[_0x5e54('0x20')](_0x506afe)[_0x5e54('0x21')](function(_0x3f9c62){return _0x3f9c62;});}return null;};}function removeEntity(_0x4e1ed7,_0x353570){return function(_0x444c9c){if(_0x444c9c){return _0x444c9c[_0x5e54('0x22')]()[_0x5e54('0x21')](function(){_0x4e1ed7[_0x5e54('0x17')](0xcc)[_0x5e54('0x18')]();});}};}function handleEntityNotFound(_0x441f25,_0x10a9f6){return function(_0x15c738){if(!_0x15c738){_0x441f25[_0x5e54('0x16')](0x194);}return _0x15c738;};}function handleError(_0x555716,_0x27b073){_0x27b073=_0x27b073||0x1f4;return function(_0x46a02f){logger[_0x5e54('0x23')](_0x46a02f[_0x5e54('0x24')]);if(_0x46a02f['name']){delete _0x46a02f[_0x5e54('0x25')];}_0x555716['status'](_0x27b073)[_0x5e54('0x26')](_0x46a02f);};}exports[_0x5e54('0x27')]=function(_0x284ed8,_0x4ee581){var _0x1ab497={},_0x2bb8e2={},_0x5b303d={'count':0x0,'rows':[]};var _0x2d28c0=_[_0x5e54('0x28')](db[_0x5e54('0x29')][_0x5e54('0x2a')],function(_0x17bb90){return{'name':_0x17bb90[_0x5e54('0x2b')],'type':_0x17bb90[_0x5e54('0x2c')]['key']};});_0x2bb8e2['model']=_['map'](_0x2d28c0,_0x5e54('0x25'));_0x2bb8e2['query']=_[_0x5e54('0x2d')](_0x284ed8['query']);_0x2bb8e2['filters']=_[_0x5e54('0x2e')](_0x2bb8e2['model'],_0x2bb8e2[_0x5e54('0x2f')]);_0x1ab497[_0x5e54('0x30')]=_['intersection'](_0x2bb8e2['model'],qs[_0x5e54('0x31')](_0x284ed8['query'][_0x5e54('0x31')]));_0x1ab497[_0x5e54('0x30')]=_0x1ab497[_0x5e54('0x30')]['length']?_0x1ab497[_0x5e54('0x30')]:_0x2bb8e2[_0x5e54('0x32')];if(!_0x284ed8[_0x5e54('0x2f')]['hasOwnProperty'](_0x5e54('0x33'))){_0x1ab497[_0x5e54('0x1b')]=qs[_0x5e54('0x1b')](_0x284ed8['query']['limit']);_0x1ab497[_0x5e54('0x19')]=qs[_0x5e54('0x19')](_0x284ed8[_0x5e54('0x2f')][_0x5e54('0x19')]);}_0x1ab497[_0x5e54('0x34')]=qs['sort'](_0x284ed8['query'][_0x5e54('0x35')]);_0x1ab497[_0x5e54('0x36')]=qs['filters'](_[_0x5e54('0x37')](_0x284ed8[_0x5e54('0x2f')],_0x2bb8e2[_0x5e54('0x38')]),_0x2d28c0);if(_0x284ed8['query']['filter']){_0x1ab497[_0x5e54('0x36')]=_[_0x5e54('0x39')](_0x1ab497[_0x5e54('0x36')],{'$or':_[_0x5e54('0x28')](_0x2d28c0,function(_0x5e49d8){if(_0x5e49d8['type']!=='VIRTUAL'){var _0x2e9752={};_0x2e9752[_0x5e49d8[_0x5e54('0x25')]]={'$like':'%'+_0x284ed8[_0x5e54('0x2f')]['filter']+'%'};return _0x2e9752;}})});}_0x1ab497=_['merge']({},_0x1ab497,_0x284ed8[_0x5e54('0x3a')]);var _0x1173cd={'where':_0x1ab497['where']};return db[_0x5e54('0x29')][_0x5e54('0x3b')](_0x1173cd)[_0x5e54('0x21')](function(_0x218c11){_0x5b303d[_0x5e54('0x3b')]=_0x218c11;if(_0x284ed8[_0x5e54('0x2f')][_0x5e54('0x3c')]){_0x1ab497[_0x5e54('0x3d')]=[{'all':!![]}];}return db[_0x5e54('0x29')][_0x5e54('0x3e')](_0x1ab497);})[_0x5e54('0x21')](function(_0x523487){_0x5b303d['rows']=_0x523487;return _0x5b303d;})[_0x5e54('0x21')](respondWithFilteredResult(_0x4ee581,_0x1ab497))[_0x5e54('0x3f')](handleError(_0x4ee581,null));};exports['show']=function(_0x55aa73,_0x3a89fc){var _0x22f4a5={'raw':![],'where':{'id':_0x55aa73[_0x5e54('0x40')]['id']}},_0x7a288b={};_0x7a288b[_0x5e54('0x32')]=_[_0x5e54('0x2d')](db[_0x5e54('0x29')][_0x5e54('0x2a')]);_0x7a288b[_0x5e54('0x2f')]=_[_0x5e54('0x2d')](_0x55aa73[_0x5e54('0x2f')]);_0x7a288b[_0x5e54('0x38')]=_[_0x5e54('0x2e')](_0x7a288b[_0x5e54('0x32')],_0x7a288b[_0x5e54('0x2f')]);_0x22f4a5[_0x5e54('0x30')]=_[_0x5e54('0x2e')](_0x7a288b[_0x5e54('0x32')],qs[_0x5e54('0x31')](_0x55aa73[_0x5e54('0x2f')]['fields']));_0x22f4a5[_0x5e54('0x30')]=_0x22f4a5[_0x5e54('0x30')][_0x5e54('0x41')]?_0x22f4a5['attributes']:_0x7a288b['model'];if(_0x55aa73[_0x5e54('0x2f')][_0x5e54('0x3c')]){_0x22f4a5[_0x5e54('0x3d')]=[{'all':!![]}];}_0x22f4a5=_[_0x5e54('0x39')]({},_0x22f4a5,_0x55aa73[_0x5e54('0x3a')]);return db[_0x5e54('0x29')][_0x5e54('0x42')](_0x22f4a5)['then'](handleEntityNotFound(_0x3a89fc,null))[_0x5e54('0x21')](respondWithResult(_0x3a89fc,null))['catch'](handleError(_0x3a89fc,null));};exports[_0x5e54('0x43')]=function(_0xa70f22,_0x40412c){return db[_0x5e54('0x29')][_0x5e54('0x43')](_0xa70f22[_0x5e54('0x44')],{})['then'](respondWithResult(_0x40412c,0xc9))[_0x5e54('0x3f')](handleError(_0x40412c,null));};exports[_0x5e54('0x20')]=function(_0x4312b2,_0x54cdd1){if(_0x4312b2[_0x5e54('0x44')]['id']){delete _0x4312b2[_0x5e54('0x44')]['id'];}return db['Automation']['find']({'where':{'id':_0x4312b2['params']['id']}})[_0x5e54('0x21')](handleEntityNotFound(_0x54cdd1,null))[_0x5e54('0x21')](saveUpdates(_0x4312b2[_0x5e54('0x44')],null))[_0x5e54('0x21')](respondWithResult(_0x54cdd1,null))['catch'](handleError(_0x54cdd1,null));};exports[_0x5e54('0x22')]=function(_0x41d468,_0x558891){return db[_0x5e54('0x29')]['find']({'where':{'id':_0x41d468[_0x5e54('0x40')]['id']}})[_0x5e54('0x21')](handleEntityNotFound(_0x558891,null))['then'](removeEntity(_0x558891,null))[_0x5e54('0x3f')](handleError(_0x558891,null));};exports[_0x5e54('0x45')]=function(_0x78cbc2,_0x5cb661,_0xebdee1){return db[_0x5e54('0x46')]['find']({'where':{'id':_0x78cbc2[_0x5e54('0x40')]['id']}})[_0x5e54('0x21')](handleEntityNotFound(_0x5cb661,null))[_0x5e54('0x21')](function(_0x4633bf){if(_0x4633bf){return _0x4633bf[_0x5e54('0x45')](_0x78cbc2[_0x5e54('0x44')][_0x5e54('0x47')],_[_0x5e54('0x48')](_0x78cbc2[_0x5e54('0x44')],[_0x5e54('0x47'),'id'])||{});}})[_0x5e54('0x21')](respondWithResult(_0x5cb661,null))['catch'](handleError(_0x5cb661,null));};exports[_0x5e54('0x49')]=function(_0x327216,_0x28c193,_0x108224){var _0x12ad30={};var _0x7547b2={};var _0x29d410;var _0x154537;return db[_0x5e54('0x29')][_0x5e54('0x4a')]({'where':{'id':_0x327216[_0x5e54('0x40')]['id']}})['then'](handleEntityNotFound(_0x28c193,null))['then'](function(_0x2e0fe7){if(_0x2e0fe7){_0x29d410=_0x2e0fe7;_0x7547b2[_0x5e54('0x32')]=_[_0x5e54('0x2d')](db[_0x5e54('0x46')][_0x5e54('0x2a')]);_0x7547b2[_0x5e54('0x2f')]=_['keys'](_0x327216[_0x5e54('0x2f')]);_0x7547b2['filters']=_[_0x5e54('0x2e')](_0x7547b2['model'],_0x7547b2['query']);_0x12ad30[_0x5e54('0x30')]=_['intersection'](_0x7547b2['model'],qs[_0x5e54('0x31')](_0x327216[_0x5e54('0x2f')][_0x5e54('0x31')]));_0x12ad30[_0x5e54('0x30')]=_0x12ad30[_0x5e54('0x30')]['length']?_0x12ad30[_0x5e54('0x30')]:_0x7547b2[_0x5e54('0x32')];_0x12ad30[_0x5e54('0x34')]=qs[_0x5e54('0x35')](_0x327216[_0x5e54('0x2f')][_0x5e54('0x35')]);_0x12ad30[_0x5e54('0x36')]=qs['filters'](_[_0x5e54('0x37')](_0x327216['query'],_0x7547b2['filters']));if(_0x327216[_0x5e54('0x2f')][_0x5e54('0x4b')]){_0x12ad30[_0x5e54('0x36')]=_['merge'](_0x12ad30[_0x5e54('0x36')],{'$or':_[_0x5e54('0x28')](_0x12ad30['attributes'],function(_0x1e5192){var _0x2cefb1={};_0x2cefb1[_0x1e5192]={'$like':'%'+_0x327216[_0x5e54('0x2f')]['filter']+'%'};return _0x2cefb1;})});}_0x12ad30=_[_0x5e54('0x39')]({},_0x12ad30,_0x327216[_0x5e54('0x3a')]);return _0x29d410[_0x5e54('0x49')](_0x12ad30);}})[_0x5e54('0x21')](function(_0x1e1eee){if(_0x1e1eee){_0x154537=_0x1e1eee[_0x5e54('0x41')];if(!_0x327216[_0x5e54('0x2f')][_0x5e54('0x4c')](_0x5e54('0x33'))){_0x12ad30[_0x5e54('0x1b')]=qs['limit'](_0x327216[_0x5e54('0x2f')]['limit']);_0x12ad30[_0x5e54('0x19')]=qs[_0x5e54('0x19')](_0x327216[_0x5e54('0x2f')]['offset']);}return _0x29d410[_0x5e54('0x49')](_0x12ad30);}})[_0x5e54('0x21')](function(_0x213898){if(_0x213898){return _0x213898?{'count':_0x154537,'rows':_0x213898}:null;}})['then'](respondWithResult(_0x28c193,null))[_0x5e54('0x3f')](handleError(_0x28c193,null));};exports[_0x5e54('0x4d')]=function(_0x62770f,_0x59796c,_0x80ca22){return db[_0x5e54('0x4e')][_0x5e54('0x42')]({'where':{'id':_0x62770f[_0x5e54('0x40')]['id']}})['then'](handleEntityNotFound(_0x59796c,null))[_0x5e54('0x21')](function(_0x563c05){if(_0x563c05){return _0x563c05[_0x5e54('0x4d')](_0x62770f[_0x5e54('0x44')][_0x5e54('0x47')],_[_0x5e54('0x48')](_0x62770f['body'],[_0x5e54('0x47'),'id'])||{});}})['then'](respondWithResult(_0x59796c,null))[_0x5e54('0x3f')](handleError(_0x59796c,null));};exports[_0x5e54('0x4f')]=function(_0x5c0794,_0x48f8fc,_0x11ef9f){var _0x5170e9={};var _0x18942d={};var _0x331eab;var _0x2b4536;return db[_0x5e54('0x29')][_0x5e54('0x4a')]({'where':{'id':_0x5c0794[_0x5e54('0x40')]['id']}})[_0x5e54('0x21')](handleEntityNotFound(_0x48f8fc,null))[_0x5e54('0x21')](function(_0x2ae7a1){if(_0x2ae7a1){_0x331eab=_0x2ae7a1;_0x18942d[_0x5e54('0x32')]=_[_0x5e54('0x2d')](db['Action'][_0x5e54('0x2a')]);_0x18942d[_0x5e54('0x2f')]=_['keys'](_0x5c0794[_0x5e54('0x2f')]);_0x18942d[_0x5e54('0x38')]=_[_0x5e54('0x2e')](_0x18942d[_0x5e54('0x32')],_0x18942d[_0x5e54('0x2f')]);_0x5170e9['attributes']=_['intersection'](_0x18942d['model'],qs['fields'](_0x5c0794['query']['fields']));_0x5170e9[_0x5e54('0x30')]=_0x5170e9[_0x5e54('0x30')][_0x5e54('0x41')]?_0x5170e9[_0x5e54('0x30')]:_0x18942d[_0x5e54('0x32')];_0x5170e9[_0x5e54('0x34')]=qs[_0x5e54('0x35')](_0x5c0794[_0x5e54('0x2f')][_0x5e54('0x35')]);_0x5170e9[_0x5e54('0x36')]=qs['filters'](_['pick'](_0x5c0794[_0x5e54('0x2f')],_0x18942d[_0x5e54('0x38')]));if(_0x5c0794[_0x5e54('0x2f')][_0x5e54('0x4b')]){_0x5170e9[_0x5e54('0x36')]=_[_0x5e54('0x39')](_0x5170e9[_0x5e54('0x36')],{'$or':_[_0x5e54('0x28')](_0x5170e9['attributes'],function(_0x467847){var _0x1df71f={};_0x1df71f[_0x467847]={'$like':'%'+_0x5c0794['query'][_0x5e54('0x4b')]+'%'};return _0x1df71f;})});}_0x5170e9=_['merge']({},_0x5170e9,_0x5c0794[_0x5e54('0x3a')]);return _0x331eab[_0x5e54('0x4f')](_0x5170e9);}})[_0x5e54('0x21')](function(_0x1d8118){if(_0x1d8118){_0x2b4536=_0x1d8118['length'];if(!_0x5c0794[_0x5e54('0x2f')][_0x5e54('0x4c')](_0x5e54('0x33'))){_0x5170e9[_0x5e54('0x1b')]=qs['limit'](_0x5c0794[_0x5e54('0x2f')]['limit']);_0x5170e9[_0x5e54('0x19')]=qs[_0x5e54('0x19')](_0x5c0794[_0x5e54('0x2f')][_0x5e54('0x19')]);}return _0x331eab[_0x5e54('0x4f')](_0x5170e9);}})['then'](function(_0x2226c4){if(_0x2226c4){return _0x2226c4?{'count':_0x2b4536,'rows':_0x2226c4}:null;}})['then'](respondWithResult(_0x48f8fc,null))[_0x5e54('0x3f')](handleError(_0x48f8fc,null));};
\ No newline at end of file
+var _0x5262=['../../config/logger','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','index','map','Automation','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','rawAttributes','keys','create','body','find','addConditions','omit','ids','getConditions','Condition','order','Action','addActions','getActions','findOne','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xadf939,_0x482184){var _0x232c43=function(_0x26c854){while(--_0x26c854){_0xadf939['push'](_0xadf939['shift']());}};_0x232c43(++_0x482184);}(_0x5262,0x90));var _0x2526=function(_0x66b6fc,_0x53d699){_0x66b6fc=_0x66b6fc-0x0;var _0xec117d=_0x5262[_0x66b6fc];return _0xec117d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2526('0x0'));var jsonpatch=require(_0x2526('0x1'));var rp=require(_0x2526('0x2'));var moment=require(_0x2526('0x3'));var BPromise=require(_0x2526('0x4'));var Mustache=require(_0x2526('0x5'));var util=require(_0x2526('0x6'));var path=require(_0x2526('0x7'));var sox=require(_0x2526('0x8'));var csv=require(_0x2526('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2526('0xa'));var _=require(_0x2526('0xb'));var squel=require('squel');var crypto=require(_0x2526('0xc'));var jsforce=require(_0x2526('0xd'));var deskjs=require(_0x2526('0xe'));var toCsv=require(_0x2526('0x9'));var querystring=require(_0x2526('0xf'));var Papa=require(_0x2526('0x10'));var Redis=require(_0x2526('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2526('0x12'));var hardwareService=require(_0x2526('0x13'));var logger=require(_0x2526('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2526('0x15'))['db'];function respondWithStatusCode(_0x3f3e8b,_0x29b96b){_0x29b96b=_0x29b96b||0xcc;return function(_0x1f596e){if(_0x1f596e){return _0x3f3e8b[_0x2526('0x16')](_0x29b96b);}return _0x3f3e8b['status'](_0x29b96b)[_0x2526('0x17')]();};}function respondWithResult(_0x5978ec,_0x313d73){_0x313d73=_0x313d73||0xc8;return function(_0x275c1d){if(_0x275c1d){return _0x5978ec[_0x2526('0x18')](_0x313d73)[_0x2526('0x19')](_0x275c1d);}};}function respondWithFilteredResult(_0x11eb92,_0x535816){return function(_0x38a2fe){if(_0x38a2fe){var _0x526693=typeof _0x535816[_0x2526('0x1a')]===_0x2526('0x1b')&&typeof _0x535816['limit']==='undefined';var _0x2ff929=_0x38a2fe['count'];var _0x57d312=_0x526693?0x0:_0x535816[_0x2526('0x1a')];var _0x15f2ad=_0x526693?_0x38a2fe['count']:_0x535816[_0x2526('0x1a')]+_0x535816[_0x2526('0x1c')];var _0x5091af;if(_0x15f2ad>=_0x2ff929){_0x15f2ad=_0x2ff929;_0x5091af=0xc8;}else{_0x5091af=0xce;}_0x11eb92[_0x2526('0x18')](_0x5091af);return _0x11eb92[_0x2526('0x1d')](_0x2526('0x1e'),_0x57d312+'-'+_0x15f2ad+'/'+_0x2ff929)[_0x2526('0x19')](_0x38a2fe);}return null;};}function patchUpdates(_0x4d8ac4){return function(_0x252867){try{jsonpatch[_0x2526('0x1f')](_0x252867,_0x4d8ac4,!![]);}catch(_0x372279){return BPromise[_0x2526('0x20')](_0x372279);}return _0x252867[_0x2526('0x21')]();};}function saveUpdates(_0x8aaa91,_0x281de1){return function(_0x2839d5){if(_0x2839d5){return _0x2839d5['update'](_0x8aaa91)['then'](function(_0x5bf480){return _0x5bf480;});}return null;};}function removeEntity(_0x5378b6,_0x2b570b){return function(_0x335012){if(_0x335012){return _0x335012[_0x2526('0x22')]()[_0x2526('0x23')](function(){_0x5378b6[_0x2526('0x18')](0xcc)[_0x2526('0x17')]();});}};}function handleEntityNotFound(_0x53831c,_0x355fda){return function(_0x36f7f0){if(!_0x36f7f0){_0x53831c['sendStatus'](0x194);}return _0x36f7f0;};}function handleError(_0x3c163f,_0x5afb85){_0x5afb85=_0x5afb85||0x1f4;return function(_0x527b4d){logger[_0x2526('0x24')](_0x527b4d[_0x2526('0x25')]);if(_0x527b4d[_0x2526('0x26')]){delete _0x527b4d[_0x2526('0x26')];}_0x3c163f['status'](_0x5afb85)['send'](_0x527b4d);};}exports[_0x2526('0x27')]=function(_0x2eb4d9,_0x5177cf){var _0x2af91d={},_0xd154dc={},_0x5aa9b2={'count':0x0,'rows':[]};var _0x37f29c=_[_0x2526('0x28')](db[_0x2526('0x29')]['rawAttributes'],function(_0x6c9e90){return{'name':_0x6c9e90['fieldName'],'type':_0x6c9e90[_0x2526('0x2a')][_0x2526('0x2b')]};});_0xd154dc['model']=_[_0x2526('0x28')](_0x37f29c,_0x2526('0x26'));_0xd154dc[_0x2526('0x2c')]=_['keys'](_0x2eb4d9[_0x2526('0x2c')]);_0xd154dc['filters']=_[_0x2526('0x2d')](_0xd154dc[_0x2526('0x2e')],_0xd154dc[_0x2526('0x2c')]);_0x2af91d[_0x2526('0x2f')]=_['intersection'](_0xd154dc['model'],qs[_0x2526('0x30')](_0x2eb4d9[_0x2526('0x2c')]['fields']));_0x2af91d[_0x2526('0x2f')]=_0x2af91d[_0x2526('0x2f')][_0x2526('0x31')]?_0x2af91d[_0x2526('0x2f')]:_0xd154dc['model'];if(!_0x2eb4d9[_0x2526('0x2c')][_0x2526('0x32')](_0x2526('0x33'))){_0x2af91d[_0x2526('0x1c')]=qs[_0x2526('0x1c')](_0x2eb4d9[_0x2526('0x2c')]['limit']);_0x2af91d[_0x2526('0x1a')]=qs[_0x2526('0x1a')](_0x2eb4d9[_0x2526('0x2c')][_0x2526('0x1a')]);}_0x2af91d['order']=qs[_0x2526('0x34')](_0x2eb4d9['query']['sort']);_0x2af91d[_0x2526('0x35')]=qs['filters'](_[_0x2526('0x36')](_0x2eb4d9['query'],_0xd154dc[_0x2526('0x37')]),_0x37f29c);if(_0x2eb4d9[_0x2526('0x2c')][_0x2526('0x38')]){_0x2af91d[_0x2526('0x35')]=_[_0x2526('0x39')](_0x2af91d[_0x2526('0x35')],{'$or':_[_0x2526('0x28')](_0x37f29c,function(_0x191ace){if(_0x191ace[_0x2526('0x2a')]!==_0x2526('0x3a')){var _0x984980={};_0x984980[_0x191ace['name']]={'$like':'%'+_0x2eb4d9[_0x2526('0x2c')][_0x2526('0x38')]+'%'};return _0x984980;}})});}_0x2af91d=_[_0x2526('0x39')]({},_0x2af91d,_0x2eb4d9[_0x2526('0x3b')]);var _0x27cf41={'where':_0x2af91d[_0x2526('0x35')]};return db['Automation'][_0x2526('0x3c')](_0x27cf41)[_0x2526('0x23')](function(_0x56ca2f){_0x5aa9b2[_0x2526('0x3c')]=_0x56ca2f;if(_0x2eb4d9['query']['includeAll']){_0x2af91d[_0x2526('0x3d')]=[{'all':!![]}];}return db[_0x2526('0x29')][_0x2526('0x3e')](_0x2af91d);})[_0x2526('0x23')](function(_0x253a92){_0x5aa9b2[_0x2526('0x3f')]=_0x253a92;return _0x5aa9b2;})['then'](respondWithFilteredResult(_0x5177cf,_0x2af91d))[_0x2526('0x40')](handleError(_0x5177cf,null));};exports[_0x2526('0x41')]=function(_0x56a927,_0x15651e){var _0x5f327a={'raw':![],'where':{'id':_0x56a927[_0x2526('0x42')]['id']}},_0x156e03={};_0x156e03[_0x2526('0x2e')]=_['keys'](db['Automation'][_0x2526('0x43')]);_0x156e03[_0x2526('0x2c')]=_[_0x2526('0x44')](_0x56a927[_0x2526('0x2c')]);_0x156e03[_0x2526('0x37')]=_['intersection'](_0x156e03[_0x2526('0x2e')],_0x156e03[_0x2526('0x2c')]);_0x5f327a[_0x2526('0x2f')]=_['intersection'](_0x156e03['model'],qs[_0x2526('0x30')](_0x56a927[_0x2526('0x2c')][_0x2526('0x30')]));_0x5f327a[_0x2526('0x2f')]=_0x5f327a[_0x2526('0x2f')][_0x2526('0x31')]?_0x5f327a[_0x2526('0x2f')]:_0x156e03[_0x2526('0x2e')];if(_0x56a927['query']['includeAll']){_0x5f327a['include']=[{'all':!![]}];}_0x5f327a=_['merge']({},_0x5f327a,_0x56a927[_0x2526('0x3b')]);return db[_0x2526('0x29')]['find'](_0x5f327a)[_0x2526('0x23')](handleEntityNotFound(_0x15651e,null))[_0x2526('0x23')](respondWithResult(_0x15651e,null))[_0x2526('0x40')](handleError(_0x15651e,null));};exports[_0x2526('0x45')]=function(_0x4c2e97,_0x36420e){return db[_0x2526('0x29')][_0x2526('0x45')](_0x4c2e97[_0x2526('0x46')],{})[_0x2526('0x23')](respondWithResult(_0x36420e,0xc9))[_0x2526('0x40')](handleError(_0x36420e,null));};exports['update']=function(_0x4170f6,_0x25e616){if(_0x4170f6['body']['id']){delete _0x4170f6['body']['id'];}return db[_0x2526('0x29')][_0x2526('0x47')]({'where':{'id':_0x4170f6[_0x2526('0x42')]['id']}})[_0x2526('0x23')](handleEntityNotFound(_0x25e616,null))['then'](saveUpdates(_0x4170f6[_0x2526('0x46')],null))[_0x2526('0x23')](respondWithResult(_0x25e616,null))['catch'](handleError(_0x25e616,null));};exports['destroy']=function(_0x123ec8,_0x2dd703){return db['Automation']['find']({'where':{'id':_0x123ec8[_0x2526('0x42')]['id']}})[_0x2526('0x23')](handleEntityNotFound(_0x2dd703,null))[_0x2526('0x23')](removeEntity(_0x2dd703,null))[_0x2526('0x40')](handleError(_0x2dd703,null));};exports[_0x2526('0x48')]=function(_0x3214d6,_0x207370,_0x3818f7){return db['Condition'][_0x2526('0x47')]({'where':{'id':_0x3214d6[_0x2526('0x42')]['id']}})[_0x2526('0x23')](handleEntityNotFound(_0x207370,null))[_0x2526('0x23')](function(_0xa2f0a3){if(_0xa2f0a3){return _0xa2f0a3[_0x2526('0x48')](_0x3214d6[_0x2526('0x46')]['ids'],_[_0x2526('0x49')](_0x3214d6[_0x2526('0x46')],[_0x2526('0x4a'),'id'])||{});}})[_0x2526('0x23')](respondWithResult(_0x207370,null))[_0x2526('0x40')](handleError(_0x207370,null));};exports[_0x2526('0x4b')]=function(_0x51b7fc,_0x55fd31,_0x2f9334){var _0x5e91a4={};var _0x22e193={};var _0x455512;var _0x2847ab;return db[_0x2526('0x29')]['findOne']({'where':{'id':_0x51b7fc['params']['id']}})['then'](handleEntityNotFound(_0x55fd31,null))['then'](function(_0x2e6f2b){if(_0x2e6f2b){_0x455512=_0x2e6f2b;_0x22e193[_0x2526('0x2e')]=_[_0x2526('0x44')](db[_0x2526('0x4c')][_0x2526('0x43')]);_0x22e193[_0x2526('0x2c')]=_[_0x2526('0x44')](_0x51b7fc[_0x2526('0x2c')]);_0x22e193[_0x2526('0x37')]=_[_0x2526('0x2d')](_0x22e193[_0x2526('0x2e')],_0x22e193[_0x2526('0x2c')]);_0x5e91a4[_0x2526('0x2f')]=_[_0x2526('0x2d')](_0x22e193[_0x2526('0x2e')],qs[_0x2526('0x30')](_0x51b7fc[_0x2526('0x2c')][_0x2526('0x30')]));_0x5e91a4[_0x2526('0x2f')]=_0x5e91a4[_0x2526('0x2f')][_0x2526('0x31')]?_0x5e91a4[_0x2526('0x2f')]:_0x22e193['model'];_0x5e91a4[_0x2526('0x4d')]=qs[_0x2526('0x34')](_0x51b7fc[_0x2526('0x2c')][_0x2526('0x34')]);_0x5e91a4['where']=qs[_0x2526('0x37')](_[_0x2526('0x36')](_0x51b7fc[_0x2526('0x2c')],_0x22e193['filters']));if(_0x51b7fc['query'][_0x2526('0x38')]){_0x5e91a4[_0x2526('0x35')]=_['merge'](_0x5e91a4[_0x2526('0x35')],{'$or':_[_0x2526('0x28')](_0x5e91a4['attributes'],function(_0x177869){var _0x58c9db={};_0x58c9db[_0x177869]={'$like':'%'+_0x51b7fc[_0x2526('0x2c')][_0x2526('0x38')]+'%'};return _0x58c9db;})});}_0x5e91a4=_[_0x2526('0x39')]({},_0x5e91a4,_0x51b7fc['options']);return _0x455512['getConditions'](_0x5e91a4);}})[_0x2526('0x23')](function(_0x4edc5d){if(_0x4edc5d){_0x2847ab=_0x4edc5d['length'];if(!_0x51b7fc['query'][_0x2526('0x32')](_0x2526('0x33'))){_0x5e91a4['limit']=qs['limit'](_0x51b7fc['query'][_0x2526('0x1c')]);_0x5e91a4['offset']=qs[_0x2526('0x1a')](_0x51b7fc[_0x2526('0x2c')]['offset']);}return _0x455512[_0x2526('0x4b')](_0x5e91a4);}})['then'](function(_0x169ab8){if(_0x169ab8){return _0x169ab8?{'count':_0x2847ab,'rows':_0x169ab8}:null;}})[_0x2526('0x23')](respondWithResult(_0x55fd31,null))[_0x2526('0x40')](handleError(_0x55fd31,null));};exports['addActions']=function(_0x14dbbb,_0x2afd48,_0x49e2c0){return db[_0x2526('0x4e')][_0x2526('0x47')]({'where':{'id':_0x14dbbb['params']['id']}})[_0x2526('0x23')](handleEntityNotFound(_0x2afd48,null))[_0x2526('0x23')](function(_0x1c3481){if(_0x1c3481){return _0x1c3481[_0x2526('0x4f')](_0x14dbbb[_0x2526('0x46')][_0x2526('0x4a')],_[_0x2526('0x49')](_0x14dbbb['body'],['ids','id'])||{});}})[_0x2526('0x23')](respondWithResult(_0x2afd48,null))['catch'](handleError(_0x2afd48,null));};exports[_0x2526('0x50')]=function(_0x569075,_0x332c61,_0x4e2b31){var _0x17cb16={};var _0x1b84f3={};var _0x76f6bf;var _0x1976bd;return db[_0x2526('0x29')][_0x2526('0x51')]({'where':{'id':_0x569075[_0x2526('0x42')]['id']}})[_0x2526('0x23')](handleEntityNotFound(_0x332c61,null))['then'](function(_0x3ac2dc){if(_0x3ac2dc){_0x76f6bf=_0x3ac2dc;_0x1b84f3['model']=_['keys'](db[_0x2526('0x4e')][_0x2526('0x43')]);_0x1b84f3[_0x2526('0x2c')]=_[_0x2526('0x44')](_0x569075[_0x2526('0x2c')]);_0x1b84f3[_0x2526('0x37')]=_[_0x2526('0x2d')](_0x1b84f3[_0x2526('0x2e')],_0x1b84f3[_0x2526('0x2c')]);_0x17cb16[_0x2526('0x2f')]=_[_0x2526('0x2d')](_0x1b84f3[_0x2526('0x2e')],qs[_0x2526('0x30')](_0x569075[_0x2526('0x2c')][_0x2526('0x30')]));_0x17cb16[_0x2526('0x2f')]=_0x17cb16[_0x2526('0x2f')][_0x2526('0x31')]?_0x17cb16[_0x2526('0x2f')]:_0x1b84f3[_0x2526('0x2e')];_0x17cb16['order']=qs['sort'](_0x569075['query'][_0x2526('0x34')]);_0x17cb16['where']=qs[_0x2526('0x37')](_['pick'](_0x569075[_0x2526('0x2c')],_0x1b84f3[_0x2526('0x37')]));if(_0x569075[_0x2526('0x2c')]['filter']){_0x17cb16['where']=_['merge'](_0x17cb16[_0x2526('0x35')],{'$or':_['map'](_0x17cb16[_0x2526('0x2f')],function(_0x3f52b5){var _0x3c79d5={};_0x3c79d5[_0x3f52b5]={'$like':'%'+_0x569075[_0x2526('0x2c')][_0x2526('0x38')]+'%'};return _0x3c79d5;})});}_0x17cb16=_[_0x2526('0x39')]({},_0x17cb16,_0x569075[_0x2526('0x3b')]);return _0x76f6bf[_0x2526('0x50')](_0x17cb16);}})[_0x2526('0x23')](function(_0x72e26f){if(_0x72e26f){_0x1976bd=_0x72e26f[_0x2526('0x31')];if(!_0x569075[_0x2526('0x2c')][_0x2526('0x32')](_0x2526('0x33'))){_0x17cb16[_0x2526('0x1c')]=qs[_0x2526('0x1c')](_0x569075[_0x2526('0x2c')][_0x2526('0x1c')]);_0x17cb16[_0x2526('0x1a')]=qs[_0x2526('0x1a')](_0x569075['query']['offset']);}return _0x76f6bf['getActions'](_0x17cb16);}})[_0x2526('0x23')](function(_0x3e72d2){if(_0x3e72d2){return _0x3e72d2?{'count':_0x1976bd,'rows':_0x3e72d2}:null;}})[_0x2526('0x23')](respondWithResult(_0x332c61,null))['catch'](handleError(_0x332c61,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 4ba50cd..68a370b 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 _0x9ea7=['lodash','../../config/logger','request-promise','path','../../config/environment','./automation.attributes','define'];(function(_0x288a14,_0x5300db){var _0x1e15f2=function(_0x30fb34){while(--_0x30fb34){_0x288a14['push'](_0x288a14['shift']());}};_0x1e15f2(++_0x5300db);}(_0x9ea7,0x165));var _0x79ea=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x9ea7[_0x2afbb0];return _0x411ff2;};'use strict';var _=require(_0x79ea('0x0'));var util=require('util');var logger=require(_0x79ea('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x79ea('0x2'));var fs=require('fs');var path=require(_0x79ea('0x3'));var rimraf=require('rimraf');var config=require(_0x79ea('0x4'));var attributes=require(_0x79ea('0x5'));module['exports']=function(_0x32938b,_0x5cd579){return _0x32938b[_0x79ea('0x6')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5b38=['rimraf','../../config/environment','./automation.attributes','define','Automation','util','../../config/logger','api','moment','bluebird'];(function(_0x4a8b2a,_0x5639ac){var _0x412976=function(_0x28dac1){while(--_0x28dac1){_0x4a8b2a['push'](_0x4a8b2a['shift']());}};_0x412976(++_0x5639ac);}(_0x5b38,0x73));var _0x85b3=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5b38[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0x85b3('0x0'));var logger=require(_0x85b3('0x1'))(_0x85b3('0x2'));var moment=require(_0x85b3('0x3'));var BPromise=require(_0x85b3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x85b3('0x5'));var config=require(_0x85b3('0x6'));var attributes=require(_0x85b3('0x7'));module['exports']=function(_0x5a581a,_0x44766d){return _0x5a581a[_0x85b3('0x8')](_0x85b3('0x9'),attributes,{'tableName':'tools_automations','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 1abe74d..f00c761 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 _0x1410=['jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1410,0x130));var _0x0141=function(_0x39153c,_0x293109){_0x39153c=_0x39153c-0x0;var _0x246bac=_0x1410[_0x39153c];return _0x246bac;};'use strict';var _=require(_0x0141('0x0'));var util=require(_0x0141('0x1'));var moment=require(_0x0141('0x2'));var BPromise=require(_0x0141('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0141('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0141('0x5'));var logger=require('../../config/logger')(_0x0141('0x6'));var config=require(_0x0141('0x7'));var jayson=require(_0x0141('0x8'));var client=jayson[_0x0141('0x9')][_0x0141('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24f701,_0x22b566,_0x25511f){return new BPromise(function(_0x2d8f15,_0x57cfbb){return client[_0x0141('0xb')](_0x24f701,_0x25511f)[_0x0141('0xc')](function(_0x2b4f13){logger[_0x0141('0xd')](_0x0141('0xe'),_0x22b566,_0x0141('0xf'));logger[_0x0141('0x10')](_0x0141('0x11'),_0x22b566,'request\x20sent',JSON[_0x0141('0x12')](_0x2b4f13));if(_0x2b4f13[_0x0141('0x13')]){if(_0x2b4f13[_0x0141('0x13')][_0x0141('0x14')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x22b566,_0x2b4f13[_0x0141('0x13')][_0x0141('0x15')]);return _0x57cfbb(_0x2b4f13['error'][_0x0141('0x15')]);}logger[_0x0141('0x13')](_0x0141('0xe'),_0x22b566,_0x2b4f13[_0x0141('0x13')][_0x0141('0x15')]);return _0x2d8f15(_0x2b4f13['error'][_0x0141('0x15')]);}else{logger['info'](_0x0141('0xe'),_0x22b566,_0x0141('0xf'));_0x2d8f15(_0x2b4f13[_0x0141('0x16')][_0x0141('0x15')]);}})[_0x0141('0x17')](function(_0x3c91e8){logger['error']('Automation,\x20%s,\x20%s',_0x22b566,_0x3c91e8);_0x57cfbb(_0x3c91e8);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x17edef,_0x3a08b1){var _0x8fb2e9=function(_0x1b7143){while(--_0x1b7143){_0x17edef['push'](_0x17edef['shift']());}};_0x8fb2e9(++_0x3a08b1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x50a200,_0x107e3b){_0x50a200=_0x50a200-0x0;var _0x209610=_0x5f2f[_0x50a200];return _0x209610;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 5ee12f0..b334699 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 _0xbbb8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addConditions','addActions','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x51d26e,_0x5bc3ae){var _0x10c10a=function(_0x21a675){while(--_0x21a675){_0x51d26e['push'](_0x51d26e['shift']());}};_0x10c10a(++_0x5bc3ae);}(_0xbbb8,0x7d));var _0x8bbb=function(_0x113dfd,_0x48eae8){_0x113dfd=_0x113dfd-0x0;var _0xb7a4ed=_0xbbb8[_0x113dfd];return _0xb7a4ed;};'use strict';var multer=require(_0x8bbb('0x0'));var util=require(_0x8bbb('0x1'));var path=require('path');var timeout=require(_0x8bbb('0x2'));var express=require(_0x8bbb('0x3'));var router=express['Router']();var fs_extra=require(_0x8bbb('0x4'));var auth=require(_0x8bbb('0x5'));var interaction=require(_0x8bbb('0x6'));var config=require(_0x8bbb('0x7'));var controller=require(_0x8bbb('0x8'));router[_0x8bbb('0x9')]('/',auth[_0x8bbb('0xa')](),controller[_0x8bbb('0xb')]);router[_0x8bbb('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8bbb('0x9')](_0x8bbb('0xc'),auth[_0x8bbb('0xa')](),controller[_0x8bbb('0xd')]);router[_0x8bbb('0x9')](_0x8bbb('0xe'),auth[_0x8bbb('0xa')](),controller[_0x8bbb('0xf')]);router['post']('/',auth[_0x8bbb('0xa')](),controller[_0x8bbb('0x10')]);router[_0x8bbb('0x11')]('/:id/conditions',auth[_0x8bbb('0xa')](),controller[_0x8bbb('0x12')]);router[_0x8bbb('0x11')]('/:id/actions',auth[_0x8bbb('0xa')](),controller[_0x8bbb('0x13')]);router[_0x8bbb('0x14')](_0x8bbb('0x15'),auth['isAuthenticated'](),controller[_0x8bbb('0x16')]);router[_0x8bbb('0x17')]('/:id',auth[_0x8bbb('0xa')](),controller[_0x8bbb('0x18')]);module[_0x8bbb('0x19')]=router;
\ No newline at end of file
+var _0x6b19=['show','/:id/conditions','getConditions','/:id/actions','getActions','post','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','get'];(function(_0x2ee8b2,_0x26a81a){var _0x5de665=function(_0x73b664){while(--_0x73b664){_0x2ee8b2['push'](_0x2ee8b2['shift']());}};_0x5de665(++_0x26a81a);}(_0x6b19,0xe8));var _0x96b1=function(_0x573a82,_0x4939d2){_0x573a82=_0x573a82-0x0;var _0x5bf900=_0x6b19[_0x573a82];return _0x5bf900;};'use strict';var multer=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var path=require('path');var timeout=require(_0x96b1('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x96b1('0x3'));var auth=require(_0x96b1('0x4'));var interaction=require(_0x96b1('0x5'));var config=require(_0x96b1('0x6'));var controller=require(_0x96b1('0x7'));router['get']('/',auth[_0x96b1('0x8')](),controller['index']);router[_0x96b1('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x96b1('0xa')]);router['get'](_0x96b1('0xb'),auth['isAuthenticated'](),controller[_0x96b1('0xc')]);router[_0x96b1('0x9')](_0x96b1('0xd'),auth[_0x96b1('0x8')](),controller[_0x96b1('0xe')]);router[_0x96b1('0xf')]('/',auth[_0x96b1('0x8')](),controller['create']);router['post'](_0x96b1('0xb'),auth['isAuthenticated'](),controller['addConditions']);router[_0x96b1('0xf')](_0x96b1('0xd'),auth[_0x96b1('0x8')](),controller['addActions']);router[_0x96b1('0x10')](_0x96b1('0x11'),auth[_0x96b1('0x8')](),controller[_0x96b1('0x12')]);router[_0x96b1('0x13')]('/:id',auth[_0x96b1('0x8')](),controller[_0x96b1('0x14')]);module[_0x96b1('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index e75626f..6450aee 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 _0x048e=['Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen'];(function(_0x2f1696,_0x429c06){var _0x2f08e4=function(_0x36bef6){while(--_0x36bef6){_0x2f1696['push'](_0x2f1696['shift']());}};_0x2f08e4(++_0x429c06);}(_0x048e,0x1aa));var _0xe048=function(_0x59dfe7,_0x925008){_0x59dfe7=_0x59dfe7-0x0;var _0x572f2e=_0x048e[_0x59dfe7];return _0x572f2e;};'use strict';var Sequelize=require(_0xe048('0x0'));module['exports']={'name':{'type':Sequelize[_0xe048('0x1')],'unique':_0xe048('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xe048('0x3')](_0xe048('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xe048('0x1')]},'active':{'type':Sequelize[_0xe048('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xe048('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xe048('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe048('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xe048('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe048('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe048('0x9')](0x3)[_0xe048('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe048('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe048('0x9')](0x5)[_0xe048('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe048('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xe048('0x9')](0x3)[_0xe048('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe048('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe048('0x9')](0x5)[_0xe048('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe048('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xe048('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe048('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe048('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe048('0xe')},'dialTimezone':{'type':Sequelize[_0xe048('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe048('0x1')],'defaultValue':_0xe048('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xe048('0x10'),'never',_0xe048('0x11')),'defaultValue':_0xe048('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe048('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xe048('0x9')](0x9)[_0xe048('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe048('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xe048('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe048('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe048('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe048('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe048('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe048('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xe048('0x9')](0x9)[_0xe048('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe048('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe048('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe048('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe048('0x9')](0x9)[_0xe048('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe048('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe048('0x9')](0x5)[_0xe048('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe048('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe048('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe048('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe048('0x3')](_0xe048('0x1c'),_0xe048('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xe048('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xe048('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xe048('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe048('0x9')](0x3)[_0xe048('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe048('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe048('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xe048('0x9')](0x3)[_0xe048('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe048('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xe048('0x9')](0x5)[_0xe048('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe048('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe048('0x9')](0x3)[_0xe048('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe048('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe048('0x9')](0x5)[_0xe048('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xe048('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xe048('0x9')](0x5)[_0xe048('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe048('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe048('0x9')](0x3)[_0xe048('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe048('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe048('0x9')](0x5)[_0xe048('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe048('0x24')}};
\ No newline at end of file
+var _0x784c=['#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','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\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,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)'];(function(_0x359186,_0x110e27){var _0xb83111=function(_0x1d80c3){while(--_0x1d80c3){_0x359186['push'](_0x359186['shift']());}};_0xb83111(++_0x110e27);}(_0x784c,0x78));var _0xc784=function(_0x3b5f06,_0x42190e){_0x3b5f06=_0x3b5f06-0x0;var _0x46afd5=_0x784c[_0x3b5f06];return _0x46afd5;};'use strict';var Sequelize=require(_0xc784('0x0'));module[_0xc784('0x1')]={'name':{'type':Sequelize[_0xc784('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc784('0x3')]('ivr'),'allowNull':![],'defaultValue':_0xc784('0x4')},'description':{'type':Sequelize[_0xc784('0x2')]},'active':{'type':Sequelize[_0xc784('0x5')],'defaultValue':0x0,'comment':_0xc784('0x6')},'limitCalls':{'type':Sequelize[_0xc784('0x7')](0x4)[_0xc784('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc784('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xc784('0x7')](0x3)[_0xc784('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc784('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc784('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc784('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc784('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc784('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xc784('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc784('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc784('0x7')](0x5)[_0xc784('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc784('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xc784('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc784('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc784('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc784('0x7')](0x3)[_0xc784('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc784('0x10')},'dialTimezone':{'type':Sequelize[_0xc784('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc784('0x2')],'defaultValue':_0xc784('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xc784('0x3')]('always',_0xc784('0x12'),_0xc784('0x13')),'defaultValue':_0xc784('0x14')},'dialAMDActive':{'type':Sequelize[_0xc784('0x5')],'defaultValue':0x0,'comment':_0xc784('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0xc784('0x7')](0x9)[_0xc784('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc784('0x16')},'dialAMDGreeting':{'type':Sequelize[_0xc784('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc784('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc784('0x7')](0x9)[_0xc784('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc784('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xc784('0x7')](0x9)[_0xc784('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc784('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc784('0x7')](0x9)[_0xc784('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc784('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc784('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc784('0x7')](0x5)[_0xc784('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc784('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc784('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc784('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc784('0x3')](_0xc784('0x1d'),_0xc784('0x1e')),'defaultValue':_0xc784('0x1d')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc784('0x7')](0x3)[_0xc784('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc784('0x1f')},'dialCutDigit':{'type':Sequelize[_0xc784('0x7')](0x3)[_0xc784('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc784('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc784('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc784('0x7')](0x5)[_0xc784('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xc784('0x7')](0x3)[_0xc784('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc784('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xc784('0x7')](0x5)[_0xc784('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc784('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc784('0x7')](0x3)[_0xc784('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc784('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc784('0x7')](0x5)[_0xc784('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xc784('0x7')](0x3)[_0xc784('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc784('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc784('0x7')](0x5)[_0xc784('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc784('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc784('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc784('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc784('0x26')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 4ef6578..b1017a4 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 _0x7543=['createdAt','updatedAt','role','userProfileId','getHoppers','findOne','CmHopper','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','include','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','into','cm_hopper','scheduledAt','ContactId','ListId','select','field','phone','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','insert','fromQuery','NOW()','ListId\x20=\x20?','cmHopperId','OrderBy','ci.OrderBY','cm_contact_has_items','join','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','UserProfileResource','status','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','Campaign','includeAll','rows','params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x7543,0xca));var _0x3754=function(_0x2052cc,_0x4f76dc){_0x2052cc=_0x2052cc-0x0;var _0x58609f=_0x7543[_0x2052cc];return _0x58609f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3754('0x0'));var zipdir=require(_0x3754('0x1'));var jsonpatch=require(_0x3754('0x2'));var rp=require(_0x3754('0x3'));var moment=require(_0x3754('0x4'));var BPromise=require(_0x3754('0x5'));var Mustache=require(_0x3754('0x6'));var util=require(_0x3754('0x7'));var path=require(_0x3754('0x8'));var sox=require(_0x3754('0x9'));var csv=require(_0x3754('0xa'));var ejs=require(_0x3754('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3754('0xc'));var squel=require(_0x3754('0xd'));var crypto=require(_0x3754('0xe'));var jsforce=require(_0x3754('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3754('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3754('0x10'));var authService=require(_0x3754('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3754('0x12'));var hardwareService=require(_0x3754('0x13'));var logger=require(_0x3754('0x14'))(_0x3754('0x15'));var utils=require(_0x3754('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3754('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x318523,_0x416fd8){_0x416fd8=_0x416fd8||0xcc;return function(_0x4879da){if(_0x4879da){return _0x318523['sendStatus'](_0x416fd8);}return _0x318523['status'](_0x416fd8)['end']();};}function respondWithResult(_0x367e4a,_0x5c5152){_0x5c5152=_0x5c5152||0xc8;return function(_0x46d0e3){if(_0x46d0e3){return _0x367e4a['status'](_0x5c5152)[_0x3754('0x18')](_0x46d0e3);}};}function respondWithFilteredResult(_0x24a2a5,_0x5cb2a5){return function(_0x89d91f){if(_0x89d91f){var _0x5ce0d0=typeof _0x5cb2a5[_0x3754('0x19')]===_0x3754('0x1a')&&typeof _0x5cb2a5[_0x3754('0x1b')]===_0x3754('0x1a');var _0x208200=_0x89d91f[_0x3754('0x1c')];var _0x571225=_0x5ce0d0?0x0:_0x5cb2a5[_0x3754('0x19')];var _0x4983cc=_0x5ce0d0?_0x89d91f[_0x3754('0x1c')]:_0x5cb2a5['offset']+_0x5cb2a5[_0x3754('0x1b')];var _0x36f2b1;if(_0x4983cc>=_0x208200){_0x4983cc=_0x208200;_0x36f2b1=0xc8;}else{_0x36f2b1=0xce;}_0x24a2a5['status'](_0x36f2b1);return _0x24a2a5[_0x3754('0x1d')](_0x3754('0x1e'),_0x571225+'-'+_0x4983cc+'/'+_0x208200)[_0x3754('0x18')](_0x89d91f);}return null;};}function patchUpdates(_0x5762cc){return function(_0x31999f){try{jsonpatch[_0x3754('0x1f')](_0x31999f,_0x5762cc,!![]);}catch(_0xbe0cfc){return BPromise[_0x3754('0x20')](_0xbe0cfc);}return _0x31999f['save']();};}function saveUpdates(_0x1d3f2f,_0x24bd78){return function(_0x20ed49){if(_0x20ed49){return _0x20ed49[_0x3754('0x21')](_0x1d3f2f)[_0x3754('0x22')](function(_0x41e49d){return _0x41e49d;});}return null;};}function removeEntity(_0x17ce16,_0x4ff03d){return function(_0x2751f1){if(_0x2751f1){return _0x2751f1[_0x3754('0x23')]()['then'](function(){var _0x43a878=_0x2751f1[_0x3754('0x24')]({'plain':!![]});var _0x1ca092=_0x3754('0x25');return db[_0x3754('0x26')][_0x3754('0x23')]({'where':{'type':_0x1ca092,'resourceId':_0x43a878['id']}})[_0x3754('0x22')](function(){return _0x2751f1;});})['then'](function(){_0x17ce16[_0x3754('0x27')](0xcc)[_0x3754('0x28')]();});}};}function handleEntityNotFound(_0x78f082,_0x16d172){return function(_0x510783){if(!_0x510783){_0x78f082[_0x3754('0x29')](0x194);}return _0x510783;};}function handleError(_0x29c3b9,_0x2a4d0c){_0x2a4d0c=_0x2a4d0c||0x1f4;return function(_0x27a327){logger[_0x3754('0x2a')](_0x27a327[_0x3754('0x2b')]);if(_0x27a327['name']){delete _0x27a327[_0x3754('0x2c')];}_0x29c3b9[_0x3754('0x27')](_0x2a4d0c)[_0x3754('0x2d')](_0x27a327);};}exports[_0x3754('0x2e')]=function(_0x335f4e,_0x181977){var _0x5311a6={},_0x578958={},_0x2fe498={'count':0x0,'rows':[]};var _0x1688eb=_[_0x3754('0x2f')](db['Campaign'][_0x3754('0x30')],function(_0x48426c){return{'name':_0x48426c[_0x3754('0x31')],'type':_0x48426c[_0x3754('0x32')][_0x3754('0x33')]};});_0x578958[_0x3754('0x34')]=_[_0x3754('0x2f')](_0x1688eb,_0x3754('0x2c'));_0x578958[_0x3754('0x35')]=_['keys'](_0x335f4e[_0x3754('0x35')]);_0x578958['filters']=_[_0x3754('0x36')](_0x578958['model'],_0x578958[_0x3754('0x35')]);_0x5311a6[_0x3754('0x37')]=_[_0x3754('0x36')](_0x578958[_0x3754('0x34')],qs[_0x3754('0x38')](_0x335f4e['query'][_0x3754('0x38')]));_0x5311a6[_0x3754('0x37')]=_0x5311a6[_0x3754('0x37')][_0x3754('0x39')]?_0x5311a6[_0x3754('0x37')]:_0x578958[_0x3754('0x34')];if(!_0x335f4e[_0x3754('0x35')][_0x3754('0x3a')](_0x3754('0x3b'))){_0x5311a6[_0x3754('0x1b')]=qs[_0x3754('0x1b')](_0x335f4e['query'][_0x3754('0x1b')]);_0x5311a6[_0x3754('0x19')]=qs[_0x3754('0x19')](_0x335f4e[_0x3754('0x35')][_0x3754('0x19')]);}_0x5311a6[_0x3754('0x3c')]=qs[_0x3754('0x3d')](_0x335f4e[_0x3754('0x35')][_0x3754('0x3d')]);_0x5311a6[_0x3754('0x3e')]=qs[_0x3754('0x3f')](_[_0x3754('0x40')](_0x335f4e[_0x3754('0x35')],_0x578958[_0x3754('0x3f')]),_0x1688eb);if(_0x335f4e[_0x3754('0x35')]['filter']){_0x5311a6[_0x3754('0x3e')]=_[_0x3754('0x41')](_0x5311a6[_0x3754('0x3e')],{'$or':_['map'](_0x1688eb,function(_0xa95b07){if(_0xa95b07['type']!=='VIRTUAL'){var _0x55c205={};_0x55c205[_0xa95b07['name']]={'$like':'%'+_0x335f4e[_0x3754('0x35')][_0x3754('0x42')]+'%'};return _0x55c205;}})});}_0x5311a6=_[_0x3754('0x41')]({},_0x5311a6,_0x335f4e[_0x3754('0x43')]);var _0x3a60c5={'where':_0x5311a6[_0x3754('0x3e')]};return db[_0x3754('0x44')][_0x3754('0x1c')](_0x3a60c5)['then'](function(_0x54bd3a){_0x2fe498[_0x3754('0x1c')]=_0x54bd3a;if(_0x335f4e[_0x3754('0x35')][_0x3754('0x45')]){_0x5311a6['include']=[{'all':!![]}];}return db[_0x3754('0x44')]['findAll'](_0x5311a6);})[_0x3754('0x22')](function(_0x5e41c4){_0x2fe498[_0x3754('0x46')]=_0x5e41c4;return _0x2fe498;})[_0x3754('0x22')](respondWithFilteredResult(_0x181977,_0x5311a6))['catch'](handleError(_0x181977,null));};exports['show']=function(_0x1b4f9c,_0x3e54b7){var _0x3b881e={'raw':![],'where':{'id':_0x1b4f9c[_0x3754('0x47')]['id']}},_0x2b06e1={};_0x2b06e1[_0x3754('0x34')]=_[_0x3754('0x48')](db[_0x3754('0x44')][_0x3754('0x30')]);_0x2b06e1['query']=_['keys'](_0x1b4f9c[_0x3754('0x35')]);_0x2b06e1[_0x3754('0x3f')]=_[_0x3754('0x36')](_0x2b06e1['model'],_0x2b06e1[_0x3754('0x35')]);_0x3b881e['attributes']=_[_0x3754('0x36')](_0x2b06e1[_0x3754('0x34')],qs[_0x3754('0x38')](_0x1b4f9c[_0x3754('0x35')][_0x3754('0x38')]));_0x3b881e[_0x3754('0x37')]=_0x3b881e[_0x3754('0x37')][_0x3754('0x39')]?_0x3b881e[_0x3754('0x37')]:_0x2b06e1[_0x3754('0x34')];if(_0x1b4f9c[_0x3754('0x35')][_0x3754('0x45')]){_0x3b881e['include']=[{'all':!![]}];}_0x3b881e=_['merge']({},_0x3b881e,_0x1b4f9c[_0x3754('0x43')]);return db['Campaign'][_0x3754('0x49')](_0x3b881e)[_0x3754('0x22')](handleEntityNotFound(_0x3e54b7,null))['then'](respondWithResult(_0x3e54b7,null))[_0x3754('0x4a')](handleError(_0x3e54b7,null));};exports[_0x3754('0x4b')]=function(_0xad7f3a,_0x4d9d89){return db[_0x3754('0x44')]['create'](_0xad7f3a[_0x3754('0x4c')],{})[_0x3754('0x22')](function(_0x4648d1){var _0x440893=_0xad7f3a[_0x3754('0x4d')][_0x3754('0x24')]({'plain':!![]});if(!_0x440893)throw new Error(_0x3754('0x4e'));if(_0x440893['role']==='user'){var _0x42ab00=_0x4648d1[_0x3754('0x24')]({'plain':!![]});var _0x218b7b='IvrCampaigns';return db[_0x3754('0x4f')][_0x3754('0x49')]({'where':{'name':_0x218b7b,'userProfileId':_0x440893['userProfileId']},'raw':!![]})[_0x3754('0x22')](function(_0x38a4f7){if(_0x38a4f7&&_0x38a4f7[_0x3754('0x50')]===0x0){return db[_0x3754('0x26')]['create']({'name':_0x42ab00[_0x3754('0x2c')],'resourceId':_0x42ab00['id'],'type':_0x38a4f7[_0x3754('0x2c')],'sectionId':_0x38a4f7['id']},{})[_0x3754('0x22')](function(){return _0x4648d1;});}else{return _0x4648d1;}})[_0x3754('0x4a')](function(_0x4a6f88){logger[_0x3754('0x2a')](_0x3754('0x51'),_0x4a6f88);throw _0x4a6f88;});}return _0x4648d1;})[_0x3754('0x22')](respondWithResult(_0x4d9d89,0xc9))[_0x3754('0x4a')](handleError(_0x4d9d89,null));};exports[_0x3754('0x52')]=function(_0x284e8e,_0x4e2cbd){var _0x5deb09={'where':{'id':_0x284e8e['params']['id']}},_0x38e1fc={};_0x38e1fc['model']=_[_0x3754('0x48')](db[_0x3754('0x44')][_0x3754('0x30')]);_0x5deb09[_0x3754('0x37')]=_[_0x3754('0x36')](_0x38e1fc[_0x3754('0x34')],qs['fields'](_0x284e8e[_0x3754('0x35')][_0x3754('0x38')]));_0x5deb09['attributes']=_0x5deb09[_0x3754('0x37')][_0x3754('0x39')]?_0x5deb09[_0x3754('0x37')]:_0x38e1fc['model'];if(_0x284e8e[_0x3754('0x35')]['includeAll']){_0x5deb09['include']=[{'all':!![]}];}_0x5deb09=_[_0x3754('0x41')]({},_0x5deb09,_0x284e8e['options']);return db[_0x3754('0x44')][_0x3754('0x49')](_0x5deb09)[_0x3754('0x22')](handleEntityNotFound(_0x4e2cbd,null))[_0x3754('0x22')](function(_0x1d683b){if(_0x1d683b){var _0x3f4540=_0x1d683b[_0x3754('0x24')]({'plain':!![]});_0x3f4540=qs[_0x3754('0x53')](_0x3f4540,['id',_0x3754('0x54'),_0x3754('0x55')]);_0x284e8e['body']=_[_0x3754('0x53')](_0x284e8e['body'],['id',_0x3754('0x54'),_0x3754('0x55')]);return db['Campaign']['create'](_[_0x3754('0x41')](_0x3f4540,_0x284e8e[_0x3754('0x4c')]),{'include':_0x284e8e[_0x3754('0x35')][_0x3754('0x45')]?[{'all':!![]}]:undefined})[_0x3754('0x22')](function(_0x12e47f){var _0x1cf88c=_0x284e8e['user']['get']({'plain':!![]});if(!_0x1cf88c)throw new Error(_0x3754('0x4e'));if(_0x1cf88c[_0x3754('0x56')]===_0x3754('0x4d')){var _0x36922e=_0x12e47f['get']({'plain':!![]});var _0x584d40=_0x3754('0x25');return db[_0x3754('0x4f')]['find']({'where':{'name':_0x584d40,'userProfileId':_0x1cf88c[_0x3754('0x57')]},'raw':!![]})[_0x3754('0x22')](function(_0x4915f9){if(_0x4915f9&&_0x4915f9[_0x3754('0x50')]===0x0){return db['UserProfileResource'][_0x3754('0x4b')]({'name':_0x36922e['name'],'resourceId':_0x36922e['id'],'type':_0x4915f9[_0x3754('0x2c')],'sectionId':_0x4915f9['id']},{})[_0x3754('0x22')](function(){return _0x12e47f;});}else{return _0x12e47f;}})[_0x3754('0x4a')](function(_0x56edc8){logger[_0x3754('0x2a')](_0x3754('0x51'),_0x56edc8);throw _0x56edc8;});}return _0x12e47f;});}})[_0x3754('0x22')](respondWithResult(_0x4e2cbd,0xc9))[_0x3754('0x4a')](handleError(_0x4e2cbd,null));};exports[_0x3754('0x21')]=function(_0x3ac683,_0x307ade){if(_0x3ac683[_0x3754('0x4c')]['id']){delete _0x3ac683['body']['id'];}return db[_0x3754('0x44')][_0x3754('0x49')]({'where':{'id':_0x3ac683[_0x3754('0x47')]['id']}})[_0x3754('0x22')](handleEntityNotFound(_0x307ade,null))['then'](saveUpdates(_0x3ac683[_0x3754('0x4c')],null))[_0x3754('0x22')](respondWithResult(_0x307ade,null))[_0x3754('0x4a')](handleError(_0x307ade,null));};exports['destroy']=function(_0x19670a,_0x298ef1){return db[_0x3754('0x44')][_0x3754('0x49')]({'where':{'id':_0x19670a[_0x3754('0x47')]['id']}})[_0x3754('0x22')](handleEntityNotFound(_0x298ef1,null))['then'](removeEntity(_0x298ef1,null))[_0x3754('0x4a')](handleError(_0x298ef1,null));};exports[_0x3754('0x58')]=function(_0x2f9418,_0x59ca00,_0xda5db3){var _0x46ec64={'raw':!![],'where':{}};var _0x4d6db2={};var _0x1832e9={'count':0x0,'rows':[]};return db[_0x3754('0x44')][_0x3754('0x59')]({'where':{'id':_0x2f9418[_0x3754('0x47')]['id']}})['then'](handleEntityNotFound(_0x59ca00,null))[_0x3754('0x22')](function(_0x395760){if(_0x395760){_0x4d6db2[_0x3754('0x34')]=_[_0x3754('0x48')](db[_0x3754('0x5a')][_0x3754('0x30')]);_0x4d6db2['query']=_[_0x3754('0x48')](_0x2f9418[_0x3754('0x35')]);_0x4d6db2[_0x3754('0x3f')]=_[_0x3754('0x36')](_0x4d6db2[_0x3754('0x34')],_0x4d6db2[_0x3754('0x35')]);_0x46ec64[_0x3754('0x37')]=_['intersection'](_0x4d6db2[_0x3754('0x34')],qs[_0x3754('0x38')](_0x2f9418['query'][_0x3754('0x38')]));_0x46ec64[_0x3754('0x37')]=_0x46ec64[_0x3754('0x37')][_0x3754('0x39')]?_0x46ec64['attributes']:_0x4d6db2[_0x3754('0x34')];if(!_0x2f9418[_0x3754('0x35')][_0x3754('0x3a')](_0x3754('0x3b'))){_0x46ec64['limit']=qs[_0x3754('0x1b')](_0x2f9418[_0x3754('0x35')][_0x3754('0x1b')]);_0x46ec64[_0x3754('0x19')]=qs[_0x3754('0x19')](_0x2f9418['query'][_0x3754('0x19')]);}_0x46ec64[_0x3754('0x3c')]=qs['sort'](_0x2f9418[_0x3754('0x35')]['sort']);_0x46ec64['where']=qs['filters'](_[_0x3754('0x40')](_0x2f9418[_0x3754('0x35')],_0x4d6db2['filters']));_0x46ec64[_0x3754('0x3e')][_0x3754('0x5b')]=_0x395760['id'];if(_0x2f9418[_0x3754('0x35')][_0x3754('0x42')]){_0x46ec64[_0x3754('0x3e')]=_[_0x3754('0x41')](_0x46ec64['where'],{'$or':_[_0x3754('0x2f')](_0x46ec64[_0x3754('0x37')],function(_0x546d3a){var _0x4edcc={};_0x4edcc[_0x546d3a]={'$like':'%'+_0x2f9418[_0x3754('0x35')][_0x3754('0x42')]+'%'};return _0x4edcc;})});}_0x46ec64=_[_0x3754('0x41')]({},_0x46ec64,_0x2f9418['options']);return db[_0x3754('0x5a')][_0x3754('0x1c')]({'where':_0x46ec64[_0x3754('0x3e')]})[_0x3754('0x22')](function(_0x33236c){_0x1832e9[_0x3754('0x1c')]=_0x33236c;if(_0x2f9418['query'][_0x3754('0x45')]){_0x46ec64['include']=[{'all':!![]}];}return db[_0x3754('0x5a')][_0x3754('0x5c')](_0x46ec64);})['then'](function(_0x57d507){_0x1832e9['rows']=_0x57d507;return _0x1832e9;});}})[_0x3754('0x22')](respondWithFilteredResult(_0x59ca00,_0x46ec64))['catch'](handleError(_0x59ca00,null));};exports[_0x3754('0x5d')]=function(_0x5dda69,_0x2c3733,_0x4668a3){var _0xeeffed={'raw':!![],'where':{}};var _0x3a4d3e={};var _0x2df519={'count':0x0,'rows':[]};return db['Campaign'][_0x3754('0x59')]({'where':{'id':_0x5dda69[_0x3754('0x47')]['id']}})[_0x3754('0x22')](handleEntityNotFound(_0x2c3733,null))[_0x3754('0x22')](function(_0x287028){if(_0x287028){_0x3a4d3e['model']=_[_0x3754('0x48')](db['CmHopperHistory']['rawAttributes']);_0x3a4d3e[_0x3754('0x35')]=_[_0x3754('0x48')](_0x5dda69['query']);_0x3a4d3e['filters']=_[_0x3754('0x36')](_0x3a4d3e['model'],_0x3a4d3e[_0x3754('0x35')]);_0xeeffed['attributes']=_[_0x3754('0x36')](_0x3a4d3e['model'],qs[_0x3754('0x38')](_0x5dda69[_0x3754('0x35')][_0x3754('0x38')]));_0xeeffed[_0x3754('0x37')]=_0xeeffed['attributes']['length']?_0xeeffed['attributes']:_0x3a4d3e[_0x3754('0x34')];if(!_0x5dda69['query']['hasOwnProperty']('nolimit')){_0xeeffed['limit']=qs[_0x3754('0x1b')](_0x5dda69[_0x3754('0x35')][_0x3754('0x1b')]);_0xeeffed[_0x3754('0x19')]=qs['offset'](_0x5dda69[_0x3754('0x35')][_0x3754('0x19')]);}_0xeeffed[_0x3754('0x3c')]=qs[_0x3754('0x3d')](_0x5dda69[_0x3754('0x35')][_0x3754('0x3d')]);_0xeeffed['where']=qs['filters'](_[_0x3754('0x40')](_0x5dda69[_0x3754('0x35')],_0x3a4d3e[_0x3754('0x3f')]));_0xeeffed[_0x3754('0x3e')]['CampaignId']=_0x287028['id'];if(_0x5dda69[_0x3754('0x35')][_0x3754('0x42')]){_0xeeffed[_0x3754('0x3e')]=_['merge'](_0xeeffed[_0x3754('0x3e')],{'$or':_['map'](_0xeeffed[_0x3754('0x37')],function(_0x30499e){var _0x4c4e86={};_0x4c4e86[_0x30499e]={'$like':'%'+_0x5dda69[_0x3754('0x35')][_0x3754('0x42')]+'%'};return _0x4c4e86;})});}_0xeeffed=_[_0x3754('0x41')]({},_0xeeffed,_0x5dda69[_0x3754('0x43')]);return db[_0x3754('0x5e')][_0x3754('0x1c')]({'where':_0xeeffed[_0x3754('0x3e')]})[_0x3754('0x22')](function(_0x491261){_0x2df519[_0x3754('0x1c')]=_0x491261;if(_0x5dda69[_0x3754('0x35')]['includeAll']){_0xeeffed['include']=[{'all':!![]}];}return db[_0x3754('0x5e')]['findAll'](_0xeeffed);})[_0x3754('0x22')](function(_0x2f65bd){_0x2df519['rows']=_0x2f65bd;return _0x2df519;});}})['then'](respondWithFilteredResult(_0x2c3733,_0xeeffed))[_0x3754('0x4a')](handleError(_0x2c3733,null));};exports[_0x3754('0x5f')]=function(_0x2ceb89,_0x5d96f2,_0x66703f){var _0x2c90d1={'raw':!![],'where':{}};var _0x136107={};var _0x11516e={'count':0x0,'rows':[]};return db[_0x3754('0x44')][_0x3754('0x59')]({'where':{'id':_0x2ceb89[_0x3754('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d96f2,null))[_0x3754('0x22')](function(_0x3409ed){if(_0x3409ed){_0x136107['model']=_['keys'](db[_0x3754('0x60')][_0x3754('0x30')]);_0x136107[_0x3754('0x35')]=_[_0x3754('0x48')](_0x2ceb89[_0x3754('0x35')]);_0x136107[_0x3754('0x3f')]=_[_0x3754('0x36')](_0x136107[_0x3754('0x34')],_0x136107[_0x3754('0x35')]);_0x2c90d1[_0x3754('0x37')]=_[_0x3754('0x36')](_0x136107[_0x3754('0x34')],qs[_0x3754('0x38')](_0x2ceb89[_0x3754('0x35')]['fields']));_0x2c90d1['attributes']=_0x2c90d1[_0x3754('0x37')][_0x3754('0x39')]?_0x2c90d1[_0x3754('0x37')]:_0x136107[_0x3754('0x34')];if(!_0x2ceb89[_0x3754('0x35')][_0x3754('0x3a')](_0x3754('0x3b'))){_0x2c90d1[_0x3754('0x1b')]=qs[_0x3754('0x1b')](_0x2ceb89[_0x3754('0x35')]['limit']);_0x2c90d1[_0x3754('0x19')]=qs[_0x3754('0x19')](_0x2ceb89[_0x3754('0x35')][_0x3754('0x19')]);}_0x2c90d1[_0x3754('0x3c')]=qs[_0x3754('0x3d')](_0x2ceb89[_0x3754('0x35')]['sort']);_0x2c90d1[_0x3754('0x3e')]=qs['filters'](_[_0x3754('0x40')](_0x2ceb89[_0x3754('0x35')],_0x136107[_0x3754('0x3f')]));_0x2c90d1[_0x3754('0x3e')][_0x3754('0x5b')]=_0x3409ed['id'];if(_0x2ceb89[_0x3754('0x35')][_0x3754('0x42')]){_0x2c90d1[_0x3754('0x3e')]=_['merge'](_0x2c90d1['where'],{'$or':_['map'](_0x2c90d1[_0x3754('0x37')],function(_0x2f6b4e){var _0x4afb7e={};_0x4afb7e[_0x2f6b4e]={'$like':'%'+_0x2ceb89[_0x3754('0x35')]['filter']+'%'};return _0x4afb7e;})});}_0x2c90d1=_[_0x3754('0x41')]({},_0x2c90d1,_0x2ceb89[_0x3754('0x43')]);return db[_0x3754('0x60')][_0x3754('0x1c')]({'where':_0x2c90d1[_0x3754('0x3e')]})['then'](function(_0x4025e0){_0x11516e['count']=_0x4025e0;if(_0x2ceb89[_0x3754('0x35')][_0x3754('0x45')]){_0x2c90d1[_0x3754('0x61')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x3754('0x5c')](_0x2c90d1);})[_0x3754('0x22')](function(_0x53d0b7){_0x11516e['rows']=_0x53d0b7;return _0x11516e;});}})[_0x3754('0x22')](respondWithFilteredResult(_0x5d96f2,_0x2c90d1))[_0x3754('0x4a')](handleError(_0x5d96f2,null));};exports['getHopperBlacks']=function(_0x5665d5,_0x2a48ce,_0x5f1a4d){var _0x23b949={'raw':!![],'where':{}};var _0x3b2249={};var _0x50b74a={'count':0x0,'rows':[]};return db['Campaign'][_0x3754('0x59')]({'where':{'id':_0x5665d5['params']['id']}})[_0x3754('0x22')](handleEntityNotFound(_0x2a48ce,null))[_0x3754('0x22')](function(_0x4b3810){if(_0x4b3810){_0x3b2249[_0x3754('0x34')]=_[_0x3754('0x48')](db['CmHopperBlack'][_0x3754('0x30')]);_0x3b2249[_0x3754('0x35')]=_[_0x3754('0x48')](_0x5665d5[_0x3754('0x35')]);_0x3b2249[_0x3754('0x3f')]=_[_0x3754('0x36')](_0x3b2249[_0x3754('0x34')],_0x3b2249['query']);_0x23b949[_0x3754('0x37')]=_[_0x3754('0x36')](_0x3b2249[_0x3754('0x34')],qs[_0x3754('0x38')](_0x5665d5[_0x3754('0x35')][_0x3754('0x38')]));_0x23b949['attributes']=_0x23b949[_0x3754('0x37')][_0x3754('0x39')]?_0x23b949[_0x3754('0x37')]:_0x3b2249[_0x3754('0x34')];if(!_0x5665d5['query'][_0x3754('0x3a')]('nolimit')){_0x23b949[_0x3754('0x1b')]=qs[_0x3754('0x1b')](_0x5665d5[_0x3754('0x35')][_0x3754('0x1b')]);_0x23b949[_0x3754('0x19')]=qs[_0x3754('0x19')](_0x5665d5['query'][_0x3754('0x19')]);}_0x23b949['order']=qs[_0x3754('0x3d')](_0x5665d5[_0x3754('0x35')][_0x3754('0x3d')]);_0x23b949[_0x3754('0x3e')]=qs['filters'](_['pick'](_0x5665d5['query'],_0x3b2249[_0x3754('0x3f')]));_0x23b949[_0x3754('0x3e')][_0x3754('0x5b')]=_0x4b3810['id'];if(_0x5665d5[_0x3754('0x35')]['filter']){_0x23b949[_0x3754('0x3e')]=_['merge'](_0x23b949['where'],{'$or':_[_0x3754('0x2f')](_0x23b949[_0x3754('0x37')],function(_0x1b43d9){var _0x51374c={};_0x51374c[_0x1b43d9]={'$like':'%'+_0x5665d5[_0x3754('0x35')][_0x3754('0x42')]+'%'};return _0x51374c;})});}_0x23b949=_[_0x3754('0x41')]({},_0x23b949,_0x5665d5[_0x3754('0x43')]);return db[_0x3754('0x62')][_0x3754('0x1c')]({'where':_0x23b949['where']})[_0x3754('0x22')](function(_0x239b57){_0x50b74a[_0x3754('0x1c')]=_0x239b57;if(_0x5665d5['query'][_0x3754('0x45')]){_0x23b949[_0x3754('0x61')]=[{'all':!![]}];}return db[_0x3754('0x62')][_0x3754('0x5c')](_0x23b949);})[_0x3754('0x22')](function(_0x40c5f9){_0x50b74a[_0x3754('0x46')]=_0x40c5f9;return _0x50b74a;});}})['then'](respondWithFilteredResult(_0x2a48ce,_0x23b949))[_0x3754('0x4a')](handleError(_0x2a48ce,null));};exports[_0x3754('0x63')]=function(_0x27a6a2,_0x5adb27,_0x4501fc){var _0x9aa437={};var _0x4f8ade={};var _0x239a2d;var _0x480e8b;return db[_0x3754('0x44')][_0x3754('0x59')]({'where':{'id':_0x27a6a2[_0x3754('0x47')]['id']}})[_0x3754('0x22')](handleEntityNotFound(_0x5adb27,null))['then'](function(_0xc1a9){if(_0xc1a9){_0x239a2d=_0xc1a9;_0x4f8ade[_0x3754('0x34')]=_['keys'](db[_0x3754('0x64')][_0x3754('0x30')]);_0x4f8ade[_0x3754('0x35')]=_[_0x3754('0x48')](_0x27a6a2[_0x3754('0x35')]);_0x4f8ade[_0x3754('0x3f')]=_['intersection'](_0x4f8ade[_0x3754('0x34')],_0x4f8ade['query']);_0x9aa437[_0x3754('0x37')]=_[_0x3754('0x36')](_0x4f8ade['model'],qs['fields'](_0x27a6a2[_0x3754('0x35')]['fields']));_0x9aa437['attributes']=_0x9aa437[_0x3754('0x37')][_0x3754('0x39')]?_0x9aa437[_0x3754('0x37')]:_0x4f8ade['model'];_0x9aa437[_0x3754('0x3c')]=qs[_0x3754('0x3d')](_0x27a6a2[_0x3754('0x35')][_0x3754('0x3d')]);_0x9aa437['where']=qs['filters'](_[_0x3754('0x40')](_0x27a6a2[_0x3754('0x35')],_0x4f8ade[_0x3754('0x3f')]));if(_0x27a6a2['query'][_0x3754('0x42')]){_0x9aa437['where']=_[_0x3754('0x41')](_0x9aa437[_0x3754('0x3e')],{'$or':_[_0x3754('0x2f')](_0x9aa437[_0x3754('0x37')],function(_0x24398c){var _0x33ee06={};_0x33ee06[_0x24398c]={'$like':'%'+_0x27a6a2[_0x3754('0x35')][_0x3754('0x42')]+'%'};return _0x33ee06;})});}_0x9aa437=_['merge']({},_0x9aa437,_0x27a6a2[_0x3754('0x43')]);return _0x239a2d[_0x3754('0x63')](_0x9aa437);}})[_0x3754('0x22')](function(_0x35c428){if(_0x35c428){_0x480e8b=_0x35c428[_0x3754('0x39')];if(!_0x27a6a2[_0x3754('0x35')][_0x3754('0x3a')]('nolimit')){_0x9aa437[_0x3754('0x1b')]=qs[_0x3754('0x1b')](_0x27a6a2[_0x3754('0x35')][_0x3754('0x1b')]);_0x9aa437[_0x3754('0x19')]=qs[_0x3754('0x19')](_0x27a6a2[_0x3754('0x35')]['offset']);}return _0x239a2d[_0x3754('0x63')](_0x9aa437);}})[_0x3754('0x22')](function(_0x454664){if(_0x454664){return _0x454664?{'count':_0x480e8b,'rows':_0x454664}:null;}})[_0x3754('0x22')](respondWithResult(_0x5adb27,null))[_0x3754('0x4a')](handleError(_0x5adb27,null));};exports[_0x3754('0x65')]=function(_0x459c3d,_0xb4a03b,_0x56947a){var _0x3f6b0c,_0xf4d907;var _0x1d906a=[];var _0x18f7fa=moment()[_0x3754('0x66')](_0x3754('0x67'));return db['Campaign']['find']({'where':{'id':_0x459c3d[_0x3754('0x47')]['id']}})[_0x3754('0x22')](handleEntityNotFound(_0xb4a03b,null))[_0x3754('0x22')](function(_0x13bed4){if(_0x13bed4){_0xf4d907=_0x13bed4;return _0x13bed4[_0x3754('0x65')](_0x459c3d[_0x3754('0x4c')]['ids'],_[_0x3754('0x53')](_0x459c3d[_0x3754('0x4c')],[_0x3754('0x68'),'id'])||{});}return null;})[_0x3754('0x69')](function(_0x5a4e12){var _0x24e85a;var _0x487f75;_0x3f6b0c=_0x5a4e12||[];var _0x101fa8=[];if(_0x5a4e12){for(var _0x4f4a9f=0x0;_0x4f4a9f<_0x5a4e12['length'];_0x4f4a9f+=0x1){var _0x472e03=_0x5a4e12[_0x4f4a9f]['get']({'plain':!![]});_0xf4d907['dialCheckDuplicateType']=_0x459c3d[_0x3754('0x4c')]['dialCheckDuplicateType']?_0x459c3d[_0x3754('0x4c')][_0x3754('0x6a')]:_0xf4d907[_0x3754('0x6a')];switch(_0xf4d907[_0x3754('0x6a')]){case'always':_0x24e85a=squel['insert']()[_0x3754('0x6b')](_0x3754('0x6c'))['fromQuery'](['phone',_0x3754('0x6d'),_0x3754('0x6e'),_0x3754('0x6f'),_0x3754('0x5b'),_0x3754('0x54'),_0x3754('0x55')],squel[_0x3754('0x70')]()[_0x3754('0x71')](_0x3754('0x72'),'phone')[_0x3754('0x71')]('NOW()','scheduledAt')[_0x3754('0x71')]('id',_0x3754('0x6e'))[_0x3754('0x71')](_0x472e03[_0x3754('0x73')][_0x3754('0x74')](),_0x3754('0x6f'))[_0x3754('0x71')](_0x459c3d[_0x3754('0x47')]['id'][_0x3754('0x74')](),_0x3754('0x5b'))[_0x3754('0x71')]('\x27'+_0x18f7fa+'\x27','createdAt')['field']('\x27'+_0x18f7fa+'\x27',_0x3754('0x55'))[_0x3754('0x75')](_0x3754('0x76'))[_0x3754('0x3e')](_0x3754('0x77'))[_0x3754('0x3e')]('ListId\x20=\x20?',_0x472e03[_0x3754('0x73')][_0x3754('0x74')]())[_0x3754('0x3e')](_0x3754('0x78'))['where'](_0x3754('0x79'),squel['select']()[_0x3754('0x71')](_0x3754('0x7a'))[_0x3754('0x75')](_0x3754('0x7b'))[_0x3754('0x3e')]('CampaignId\x20=\x20?',_0x459c3d['params']['id']['toString']()))[_0x3754('0x3e')](_0x3754('0x79'),squel['select']()[_0x3754('0x71')](_0x3754('0x7c'))[_0x3754('0x75')](_0x3754('0x6c'))[_0x3754('0x3e')]('CampaignId\x20=\x20?',_0x459c3d[_0x3754('0x47')]['id'][_0x3754('0x74')]())))[_0x3754('0x74')]();break;case'onlyIfOpen':_0x24e85a=squel[_0x3754('0x7d')]()[_0x3754('0x6b')]('cm_hopper')[_0x3754('0x7e')]([_0x3754('0x72'),_0x3754('0x6d'),_0x3754('0x6e'),_0x3754('0x6f'),_0x3754('0x5b'),_0x3754('0x54'),_0x3754('0x55')],squel[_0x3754('0x70')]()['field'](_0x3754('0x72'),_0x3754('0x72'))[_0x3754('0x71')](_0x3754('0x7f'),'scheduledAt')['field']('id',_0x3754('0x6e'))['field'](_0x472e03['CmListId'][_0x3754('0x74')](),_0x3754('0x6f'))[_0x3754('0x71')](_0x459c3d[_0x3754('0x47')]['id']['toString'](),'CampaignId')[_0x3754('0x71')]('\x27'+_0x18f7fa+'\x27',_0x3754('0x54'))['field']('\x27'+_0x18f7fa+'\x27',_0x3754('0x55'))[_0x3754('0x75')](_0x3754('0x76'))[_0x3754('0x3e')](_0x3754('0x77'))[_0x3754('0x3e')](_0x3754('0x80'),_0x472e03[_0x3754('0x73')]['toString']())[_0x3754('0x3e')](_0x3754('0x78'))[_0x3754('0x3e')](_0x3754('0x79'),squel[_0x3754('0x70')]()[_0x3754('0x71')](_0x3754('0x7c'))['from'](_0x3754('0x6c'))[_0x3754('0x3e')]('CampaignId\x20=\x20?',_0x459c3d['params']['id'][_0x3754('0x74')]())))[_0x3754('0x74')]();break;default:_0x24e85a=squel[_0x3754('0x7d')]()[_0x3754('0x6b')](_0x3754('0x6c'))['fromQuery']([_0x3754('0x72'),_0x3754('0x6d'),_0x3754('0x6e'),_0x3754('0x6f'),_0x3754('0x5b'),'createdAt',_0x3754('0x55')],squel['select']()[_0x3754('0x71')](_0x3754('0x72'),_0x3754('0x72'))['field'](_0x3754('0x7f'),_0x3754('0x6d'))[_0x3754('0x71')]('id','ContactId')['field'](_0x472e03[_0x3754('0x73')]['toString'](),_0x3754('0x6f'))['field'](_0x459c3d['params']['id'][_0x3754('0x74')](),_0x3754('0x5b'))[_0x3754('0x71')]('\x27'+_0x18f7fa+'\x27',_0x3754('0x54'))[_0x3754('0x71')]('\x27'+_0x18f7fa+'\x27',_0x3754('0x55'))[_0x3754('0x75')](_0x3754('0x76'))[_0x3754('0x3e')]('deletedAt\x20IS\x20NULL')[_0x3754('0x3e')](_0x3754('0x80'),_0x472e03['CmListId'][_0x3754('0x74')]())['where'](_0x3754('0x78')))[_0x3754('0x74')]();}_0x487f75=squel[_0x3754('0x7d')]()[_0x3754('0x6b')]('cm_hopper_additional_phones')['fromQuery']([_0x3754('0x81'),_0x3754('0x6d'),_0x3754('0x72'),_0x3754('0x82'),'createdAt','updatedAt'],squel[_0x3754('0x70')]()[_0x3754('0x71')]('h.id','id')[_0x3754('0x71')](_0x3754('0x7f'),'scheduledAt')['field']('ci.item',_0x3754('0x72'))[_0x3754('0x71')](_0x3754('0x83'),_0x3754('0x82'))[_0x3754('0x71')]('\x27'+_0x18f7fa+'\x27',_0x3754('0x54'))[_0x3754('0x71')]('\x27'+_0x18f7fa+'\x27',_0x3754('0x55'))[_0x3754('0x75')](_0x3754('0x84'),'ci')[_0x3754('0x85')]('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0x3754('0x3e')]('h.ListId\x20=\x20?',_0x472e03[_0x3754('0x73')][_0x3754('0x74')]())[_0x3754('0x3e')](_0x3754('0x86'),_0x459c3d[_0x3754('0x47')]['id']['toString']())[_0x3754('0x3e')](_0x3754('0x87'),_0x18f7fa))[_0x3754('0x74')]();_0x101fa8[_0x3754('0x88')](db[_0x3754('0x89')][_0x3754('0x35')](_0x24e85a));_0x1d906a[_0x3754('0x88')](db[_0x3754('0x89')][_0x3754('0x35')](_0x487f75));}return BPromise['all'](_0x101fa8);}})[_0x3754('0x22')](function(){return BPromise[_0x3754('0x8a')](_0x1d906a);})[_0x3754('0x22')](function(){return _0x3f6b0c;})['then'](respondWithResult(_0xb4a03b,null))[_0x3754('0x4a')](handleError(_0xb4a03b,null));};exports['removeLists']=function(_0xed1e23,_0x33f9ac,_0x104c22){return db[_0x3754('0x44')][_0x3754('0x49')]({'where':{'id':_0xed1e23['params']['id']}})['then'](handleEntityNotFound(_0x33f9ac,null))[_0x3754('0x22')](function(_0x4f2436){if(_0x4f2436){return _0x4f2436['removeLists'](_0xed1e23[_0x3754('0x35')][_0x3754('0x68')]);}})[_0x3754('0x22')](function(_0x5580a0){if(_0x5580a0){return db[_0x3754('0x5a')]['destroy']({'where':{'ListId':_0xed1e23[_0x3754('0x35')][_0x3754('0x68')],'CampaignId':_0xed1e23['params']['id']}})[_0x3754('0x22')](function(){return _0x5580a0;});}})[_0x3754('0x22')](respondWithStatusCode(_0x33f9ac,null))[_0x3754('0x4a')](handleError(_0x33f9ac,null));};exports['getBlackLists']=function(_0x32a77e,_0x332db5,_0x4c5979){var _0x49c99b={};var _0x337729={};var _0x54edb3;var _0x59c5f3;return db[_0x3754('0x44')][_0x3754('0x59')]({'where':{'id':_0x32a77e[_0x3754('0x47')]['id']}})[_0x3754('0x22')](handleEntityNotFound(_0x332db5,null))['then'](function(_0x3820ef){if(_0x3820ef){_0x54edb3=_0x3820ef;_0x337729[_0x3754('0x34')]=_[_0x3754('0x48')](db[_0x3754('0x64')][_0x3754('0x30')]);_0x337729[_0x3754('0x35')]=_[_0x3754('0x48')](_0x32a77e[_0x3754('0x35')]);_0x337729[_0x3754('0x3f')]=_['intersection'](_0x337729[_0x3754('0x34')],_0x337729[_0x3754('0x35')]);_0x49c99b[_0x3754('0x37')]=_['intersection'](_0x337729[_0x3754('0x34')],qs[_0x3754('0x38')](_0x32a77e[_0x3754('0x35')][_0x3754('0x38')]));_0x49c99b[_0x3754('0x37')]=_0x49c99b['attributes'][_0x3754('0x39')]?_0x49c99b['attributes']:_0x337729['model'];_0x49c99b[_0x3754('0x3c')]=qs[_0x3754('0x3d')](_0x32a77e[_0x3754('0x35')][_0x3754('0x3d')]);_0x49c99b[_0x3754('0x3e')]=qs['filters'](_[_0x3754('0x40')](_0x32a77e['query'],_0x337729['filters']));if(_0x32a77e['query'][_0x3754('0x42')]){_0x49c99b[_0x3754('0x3e')]=_[_0x3754('0x41')](_0x49c99b['where'],{'$or':_['map'](_0x49c99b[_0x3754('0x37')],function(_0x3f2448){var _0x275cc0={};_0x275cc0[_0x3f2448]={'$like':'%'+_0x32a77e['query'][_0x3754('0x42')]+'%'};return _0x275cc0;})});}_0x49c99b=_[_0x3754('0x41')]({},_0x49c99b,_0x32a77e[_0x3754('0x43')]);return _0x54edb3[_0x3754('0x8b')](_0x49c99b);}})[_0x3754('0x22')](function(_0x47f680){if(_0x47f680){_0x59c5f3=_0x47f680['length'];if(!_0x32a77e['query'][_0x3754('0x3a')](_0x3754('0x3b'))){_0x49c99b[_0x3754('0x1b')]=qs[_0x3754('0x1b')](_0x32a77e[_0x3754('0x35')][_0x3754('0x1b')]);_0x49c99b[_0x3754('0x19')]=qs[_0x3754('0x19')](_0x32a77e[_0x3754('0x35')][_0x3754('0x19')]);}return _0x54edb3[_0x3754('0x8b')](_0x49c99b);}})['then'](function(_0x349e62){if(_0x349e62){return _0x349e62?{'count':_0x59c5f3,'rows':_0x349e62}:null;}})[_0x3754('0x22')](respondWithResult(_0x332db5,null))[_0x3754('0x4a')](handleError(_0x332db5,null));};exports[_0x3754('0x8c')]=function(_0x15dbd4,_0x3ca8f2,_0x1d5560){var _0x1d4776,_0xdebc6c;var _0x5edf22=[];var _0x1a8d1d=moment()[_0x3754('0x66')](_0x3754('0x67'));return db[_0x3754('0x44')][_0x3754('0x49')]({'where':{'id':_0x15dbd4[_0x3754('0x47')]['id']}})[_0x3754('0x22')](handleEntityNotFound(_0x3ca8f2,null))[_0x3754('0x22')](function(_0x9357c2){if(_0x9357c2){_0xdebc6c=_0x9357c2;return _0x9357c2[_0x3754('0x8c')](_0x15dbd4[_0x3754('0x4c')][_0x3754('0x68')],_[_0x3754('0x53')](_0x15dbd4[_0x3754('0x4c')],['ids','id'])||{});}return null;})['spread'](function(_0x5215bc){var _0x2ccd63;var _0x39c621;_0x1d4776=_0x5215bc||[];var _0x5150fc=[];if(_0x5215bc){for(var _0xd77e01=0x0;_0xd77e01<_0x5215bc[_0x3754('0x39')];_0xd77e01+=0x1){var _0x31e5f4=_0x5215bc[_0xd77e01][_0x3754('0x24')]({'plain':!![]});_0x2ccd63=squel['insert']()[_0x3754('0x6b')](_0x3754('0x8d'))['fromQuery'](['phone','ContactId','ListId',_0x3754('0x5b'),'createdAt',_0x3754('0x55')],squel[_0x3754('0x70')]()['field'](_0x3754('0x72'),'phone')[_0x3754('0x71')]('id',_0x3754('0x6e'))[_0x3754('0x71')](_0x31e5f4['CmListId']['toString'](),_0x3754('0x6f'))[_0x3754('0x71')](_0x15dbd4[_0x3754('0x47')]['id'][_0x3754('0x74')](),'CampaignId')[_0x3754('0x71')](_0x3754('0x7f'),_0x3754('0x54'))[_0x3754('0x71')](_0x3754('0x7f'),'updatedAt')[_0x3754('0x75')](_0x3754('0x76'))['where'](_0x3754('0x77'))[_0x3754('0x3e')](_0x3754('0x80'),_0x31e5f4['CmListId']['toString']())['where'](_0x3754('0x78')))[_0x3754('0x74')]();_0x5150fc[_0x3754('0x88')](db[_0x3754('0x89')][_0x3754('0x35')](_0x2ccd63));}return BPromise['all'](_0x5150fc);}})[_0x3754('0x22')](function(){return _0x1d4776;})['then'](respondWithResult(_0x3ca8f2,null))[_0x3754('0x4a')](handleError(_0x3ca8f2,null));};exports[_0x3754('0x8e')]=function(_0x4fa2fa,_0x294b20,_0x526138){return db['Campaign']['find']({'where':{'id':_0x4fa2fa['params']['id']}})[_0x3754('0x22')](handleEntityNotFound(_0x294b20,null))[_0x3754('0x22')](function(_0x2aff7c){if(_0x2aff7c){return _0x2aff7c[_0x3754('0x8e')](_0x4fa2fa[_0x3754('0x35')][_0x3754('0x68')]);}})[_0x3754('0x22')](function(_0x5f04f0){if(_0x5f04f0){return db['CmHopperBlack'][_0x3754('0x23')]({'where':{'ListId':_0x4fa2fa[_0x3754('0x35')][_0x3754('0x68')],'CampaignId':_0x4fa2fa['params']['id']}})[_0x3754('0x22')](function(){return _0x5f04f0;});}})[_0x3754('0x22')](respondWithStatusCode(_0x294b20,null))['catch'](handleError(_0x294b20,null));};
\ No newline at end of file
+var _0x0431=['path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','sendStatus','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','params','options','find','create','body','user','role','IvrCampaigns','userProfileId','autoAssociation','UserProfileResource','clone','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','ids','omit','dialCheckDuplicateType','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x5d1b3c,_0x41945e){var _0x45176a=function(_0x3a3789){while(--_0x3a3789){_0x5d1b3c['push'](_0x5d1b3c['shift']());}};_0x45176a(++_0x41945e);}(_0x0431,0x11d));var _0x1043=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0x0431[_0x57486e];return _0x5f110b;};'use strict';var emlformat=require(_0x1043('0x0'));var rimraf=require(_0x1043('0x1'));var zipdir=require(_0x1043('0x2'));var jsonpatch=require(_0x1043('0x3'));var rp=require(_0x1043('0x4'));var moment=require('moment');var BPromise=require(_0x1043('0x5'));var Mustache=require(_0x1043('0x6'));var util=require('util');var path=require(_0x1043('0x7'));var sox=require(_0x1043('0x8'));var csv=require(_0x1043('0x9'));var ejs=require(_0x1043('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1043('0xb'));var squel=require('squel');var crypto=require(_0x1043('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1043('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1043('0xe'));var Papa=require(_0x1043('0xf'));var Redis=require(_0x1043('0x10'));var authService=require(_0x1043('0x11'));var qs=require(_0x1043('0x12'));var as=require(_0x1043('0x13'));var hardwareService=require(_0x1043('0x14'));var logger=require(_0x1043('0x15'))('api');var utils=require(_0x1043('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1043('0x17'))['db'];function respondWithStatusCode(_0x17676f,_0x1f5d6a){_0x1f5d6a=_0x1f5d6a||0xcc;return function(_0x42a054){if(_0x42a054){return _0x17676f['sendStatus'](_0x1f5d6a);}return _0x17676f[_0x1043('0x18')](_0x1f5d6a)[_0x1043('0x19')]();};}function respondWithResult(_0x58408b,_0x55f143){_0x55f143=_0x55f143||0xc8;return function(_0x5759fe){if(_0x5759fe){return _0x58408b[_0x1043('0x18')](_0x55f143)[_0x1043('0x1a')](_0x5759fe);}};}function respondWithFilteredResult(_0xbdf462,_0x4255a7){return function(_0x2bb5ca){if(_0x2bb5ca){var _0x12535a=typeof _0x4255a7[_0x1043('0x1b')]===_0x1043('0x1c')&&typeof _0x4255a7[_0x1043('0x1d')]==='undefined';var _0x4a1b59=_0x2bb5ca['count'];var _0x16510a=_0x12535a?0x0:_0x4255a7[_0x1043('0x1b')];var _0x1a58e0=_0x12535a?_0x2bb5ca['count']:_0x4255a7[_0x1043('0x1b')]+_0x4255a7['limit'];var _0x284725;if(_0x1a58e0>=_0x4a1b59){_0x1a58e0=_0x4a1b59;_0x284725=0xc8;}else{_0x284725=0xce;}_0xbdf462[_0x1043('0x18')](_0x284725);return _0xbdf462[_0x1043('0x1e')](_0x1043('0x1f'),_0x16510a+'-'+_0x1a58e0+'/'+_0x4a1b59)[_0x1043('0x1a')](_0x2bb5ca);}return null;};}function patchUpdates(_0x5dbf75){return function(_0x490fba){try{jsonpatch[_0x1043('0x20')](_0x490fba,_0x5dbf75,!![]);}catch(_0x1fc51c){return BPromise[_0x1043('0x21')](_0x1fc51c);}return _0x490fba[_0x1043('0x22')]();};}function saveUpdates(_0x57e612,_0x3f53b8){return function(_0x484180){if(_0x484180){return _0x484180[_0x1043('0x23')](_0x57e612)['then'](function(_0x128941){return _0x128941;});}return null;};}function removeEntity(_0xedc199,_0x2853d4){return function(_0xdfc1d6){if(_0xdfc1d6){return _0xdfc1d6[_0x1043('0x24')]()[_0x1043('0x25')](function(){var _0x568ae0=_0xdfc1d6[_0x1043('0x26')]({'plain':!![]});var _0x46edf4='IvrCampaigns';return db['UserProfileResource'][_0x1043('0x24')]({'where':{'type':_0x46edf4,'resourceId':_0x568ae0['id']}})['then'](function(){return _0xdfc1d6;});})[_0x1043('0x25')](function(){_0xedc199[_0x1043('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2453ed,_0x36590b){return function(_0xb9b548){if(!_0xb9b548){_0x2453ed[_0x1043('0x27')](0x194);}return _0xb9b548;};}function handleError(_0x15adf3,_0x286e5e){_0x286e5e=_0x286e5e||0x1f4;return function(_0x3d5426){logger[_0x1043('0x28')](_0x3d5426[_0x1043('0x29')]);if(_0x3d5426[_0x1043('0x2a')]){delete _0x3d5426[_0x1043('0x2a')];}_0x15adf3[_0x1043('0x18')](_0x286e5e)[_0x1043('0x2b')](_0x3d5426);};}exports[_0x1043('0x2c')]=function(_0x1fe638,_0x20fd56){var _0x5496ea={},_0x5de70c={},_0x1865e5={'count':0x0,'rows':[]};var _0x4624ae=_[_0x1043('0x2d')](db[_0x1043('0x2e')][_0x1043('0x2f')],function(_0xe51897){return{'name':_0xe51897[_0x1043('0x30')],'type':_0xe51897[_0x1043('0x31')][_0x1043('0x32')]};});_0x5de70c[_0x1043('0x33')]=_[_0x1043('0x2d')](_0x4624ae,_0x1043('0x2a'));_0x5de70c[_0x1043('0x34')]=_[_0x1043('0x35')](_0x1fe638[_0x1043('0x34')]);_0x5de70c[_0x1043('0x36')]=_[_0x1043('0x37')](_0x5de70c[_0x1043('0x33')],_0x5de70c[_0x1043('0x34')]);_0x5496ea[_0x1043('0x38')]=_['intersection'](_0x5de70c[_0x1043('0x33')],qs[_0x1043('0x39')](_0x1fe638[_0x1043('0x34')][_0x1043('0x39')]));_0x5496ea[_0x1043('0x38')]=_0x5496ea[_0x1043('0x38')][_0x1043('0x3a')]?_0x5496ea['attributes']:_0x5de70c['model'];if(!_0x1fe638['query'][_0x1043('0x3b')](_0x1043('0x3c'))){_0x5496ea[_0x1043('0x1d')]=qs['limit'](_0x1fe638[_0x1043('0x34')][_0x1043('0x1d')]);_0x5496ea[_0x1043('0x1b')]=qs[_0x1043('0x1b')](_0x1fe638[_0x1043('0x34')]['offset']);}_0x5496ea[_0x1043('0x3d')]=qs[_0x1043('0x3e')](_0x1fe638[_0x1043('0x34')]['sort']);_0x5496ea[_0x1043('0x3f')]=qs[_0x1043('0x36')](_[_0x1043('0x40')](_0x1fe638[_0x1043('0x34')],_0x5de70c[_0x1043('0x36')]),_0x4624ae);if(_0x1fe638[_0x1043('0x34')][_0x1043('0x41')]){_0x5496ea[_0x1043('0x3f')]=_[_0x1043('0x42')](_0x5496ea[_0x1043('0x3f')],{'$or':_[_0x1043('0x2d')](_0x4624ae,function(_0x28cfad){if(_0x28cfad[_0x1043('0x31')]!=='VIRTUAL'){var _0x2b502e={};_0x2b502e[_0x28cfad[_0x1043('0x2a')]]={'$like':'%'+_0x1fe638[_0x1043('0x34')][_0x1043('0x41')]+'%'};return _0x2b502e;}})});}_0x5496ea=_['merge']({},_0x5496ea,_0x1fe638['options']);var _0x44aaa9={'where':_0x5496ea['where']};return db[_0x1043('0x2e')]['count'](_0x44aaa9)[_0x1043('0x25')](function(_0x39d04a){_0x1865e5[_0x1043('0x43')]=_0x39d04a;if(_0x1fe638[_0x1043('0x34')][_0x1043('0x44')]){_0x5496ea[_0x1043('0x45')]=[{'all':!![]}];}return db['Campaign'][_0x1043('0x46')](_0x5496ea);})['then'](function(_0x4c5cfb){_0x1865e5[_0x1043('0x47')]=_0x4c5cfb;return _0x1865e5;})['then'](respondWithFilteredResult(_0x20fd56,_0x5496ea))[_0x1043('0x48')](handleError(_0x20fd56,null));};exports['show']=function(_0x354d30,_0x293fc2){var _0x497c18={'raw':![],'where':{'id':_0x354d30[_0x1043('0x49')]['id']}},_0x445d79={};_0x445d79[_0x1043('0x33')]=_[_0x1043('0x35')](db[_0x1043('0x2e')][_0x1043('0x2f')]);_0x445d79[_0x1043('0x34')]=_[_0x1043('0x35')](_0x354d30[_0x1043('0x34')]);_0x445d79['filters']=_[_0x1043('0x37')](_0x445d79['model'],_0x445d79['query']);_0x497c18['attributes']=_['intersection'](_0x445d79[_0x1043('0x33')],qs[_0x1043('0x39')](_0x354d30[_0x1043('0x34')]['fields']));_0x497c18[_0x1043('0x38')]=_0x497c18[_0x1043('0x38')]['length']?_0x497c18[_0x1043('0x38')]:_0x445d79[_0x1043('0x33')];if(_0x354d30[_0x1043('0x34')][_0x1043('0x44')]){_0x497c18[_0x1043('0x45')]=[{'all':!![]}];}_0x497c18=_[_0x1043('0x42')]({},_0x497c18,_0x354d30[_0x1043('0x4a')]);return db[_0x1043('0x2e')][_0x1043('0x4b')](_0x497c18)['then'](handleEntityNotFound(_0x293fc2,null))[_0x1043('0x25')](respondWithResult(_0x293fc2,null))[_0x1043('0x48')](handleError(_0x293fc2,null));};exports[_0x1043('0x4c')]=function(_0x3db714,_0x133ee7){return db['Campaign'][_0x1043('0x4c')](_0x3db714[_0x1043('0x4d')],{})[_0x1043('0x25')](function(_0x580fd1){var _0x2ec7dc=_0x3db714[_0x1043('0x4e')][_0x1043('0x26')]({'plain':!![]});if(!_0x2ec7dc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ec7dc[_0x1043('0x4f')]===_0x1043('0x4e')){var _0x19b65b=_0x580fd1[_0x1043('0x26')]({'plain':!![]});var _0x144820=_0x1043('0x50');return db['UserProfileSection'][_0x1043('0x4b')]({'where':{'name':_0x144820,'userProfileId':_0x2ec7dc[_0x1043('0x51')]},'raw':!![]})[_0x1043('0x25')](function(_0x216d71){if(_0x216d71&&_0x216d71[_0x1043('0x52')]===0x0){return db[_0x1043('0x53')][_0x1043('0x4c')]({'name':_0x19b65b[_0x1043('0x2a')],'resourceId':_0x19b65b['id'],'type':_0x216d71[_0x1043('0x2a')],'sectionId':_0x216d71['id']},{})[_0x1043('0x25')](function(){return _0x580fd1;});}else{return _0x580fd1;}})[_0x1043('0x48')](function(_0x50ec41){logger[_0x1043('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50ec41);throw _0x50ec41;});}return _0x580fd1;})[_0x1043('0x25')](respondWithResult(_0x133ee7,0xc9))[_0x1043('0x48')](handleError(_0x133ee7,null));};exports[_0x1043('0x54')]=function(_0x3909d3,_0x4aff90){var _0x4bcd21={'where':{'id':_0x3909d3[_0x1043('0x49')]['id']}},_0x1e5d49={};_0x1e5d49[_0x1043('0x33')]=_[_0x1043('0x35')](db[_0x1043('0x2e')][_0x1043('0x2f')]);_0x4bcd21['attributes']=_[_0x1043('0x37')](_0x1e5d49[_0x1043('0x33')],qs[_0x1043('0x39')](_0x3909d3[_0x1043('0x34')][_0x1043('0x39')]));_0x4bcd21[_0x1043('0x38')]=_0x4bcd21[_0x1043('0x38')][_0x1043('0x3a')]?_0x4bcd21['attributes']:_0x1e5d49['model'];if(_0x3909d3[_0x1043('0x34')][_0x1043('0x44')]){_0x4bcd21[_0x1043('0x45')]=[{'all':!![]}];}_0x4bcd21=_[_0x1043('0x42')]({},_0x4bcd21,_0x3909d3[_0x1043('0x4a')]);return db[_0x1043('0x2e')][_0x1043('0x4b')](_0x4bcd21)[_0x1043('0x25')](handleEntityNotFound(_0x4aff90,null))[_0x1043('0x25')](function(_0x5464b0){if(_0x5464b0){var _0x1bac61=_0x5464b0['get']({'plain':!![]});_0x1bac61=qs['omit'](_0x1bac61,['id',_0x1043('0x55'),_0x1043('0x56')]);_0x3909d3['body']=_['omit'](_0x3909d3[_0x1043('0x4d')],['id','createdAt',_0x1043('0x56')]);return db[_0x1043('0x2e')][_0x1043('0x4c')](_[_0x1043('0x42')](_0x1bac61,_0x3909d3[_0x1043('0x4d')]),{'include':_0x3909d3[_0x1043('0x34')][_0x1043('0x44')]?[{'all':!![]}]:undefined})[_0x1043('0x25')](function(_0x3b6f4e){var _0x1d1997=_0x3909d3[_0x1043('0x4e')][_0x1043('0x26')]({'plain':!![]});if(!_0x1d1997)throw new Error(_0x1043('0x57'));if(_0x1d1997[_0x1043('0x4f')]===_0x1043('0x4e')){var _0x352504=_0x3b6f4e[_0x1043('0x26')]({'plain':!![]});var _0x354ff0=_0x1043('0x50');return db[_0x1043('0x58')][_0x1043('0x4b')]({'where':{'name':_0x354ff0,'userProfileId':_0x1d1997['userProfileId']},'raw':!![]})['then'](function(_0x1ed4ba){if(_0x1ed4ba&&_0x1ed4ba['autoAssociation']===0x0){return db[_0x1043('0x53')][_0x1043('0x4c')]({'name':_0x352504[_0x1043('0x2a')],'resourceId':_0x352504['id'],'type':_0x1ed4ba[_0x1043('0x2a')],'sectionId':_0x1ed4ba['id']},{})[_0x1043('0x25')](function(){return _0x3b6f4e;});}else{return _0x3b6f4e;}})[_0x1043('0x48')](function(_0x3801d7){logger[_0x1043('0x28')](_0x1043('0x59'),_0x3801d7);throw _0x3801d7;});}return _0x3b6f4e;});}})[_0x1043('0x25')](respondWithResult(_0x4aff90,0xc9))[_0x1043('0x48')](handleError(_0x4aff90,null));};exports['update']=function(_0x34e449,_0x246eaf){if(_0x34e449[_0x1043('0x4d')]['id']){delete _0x34e449['body']['id'];}return db[_0x1043('0x2e')]['find']({'where':{'id':_0x34e449[_0x1043('0x49')]['id']}})['then'](handleEntityNotFound(_0x246eaf,null))[_0x1043('0x25')](saveUpdates(_0x34e449[_0x1043('0x4d')],null))[_0x1043('0x25')](respondWithResult(_0x246eaf,null))[_0x1043('0x48')](handleError(_0x246eaf,null));};exports[_0x1043('0x24')]=function(_0x533fe7,_0x2980fb){return db[_0x1043('0x2e')][_0x1043('0x4b')]({'where':{'id':_0x533fe7[_0x1043('0x49')]['id']}})[_0x1043('0x25')](handleEntityNotFound(_0x2980fb,null))[_0x1043('0x25')](removeEntity(_0x2980fb,null))[_0x1043('0x48')](handleError(_0x2980fb,null));};exports[_0x1043('0x5a')]=function(_0x437126,_0x5e959e,_0x36c5ae){var _0x5a14d5={'raw':!![],'where':{}};var _0x47028f={};var _0x2142c4={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x437126[_0x1043('0x49')]['id']}})['then'](handleEntityNotFound(_0x5e959e,null))[_0x1043('0x25')](function(_0x41719a){if(_0x41719a){_0x47028f[_0x1043('0x33')]=_['keys'](db[_0x1043('0x5b')][_0x1043('0x2f')]);_0x47028f[_0x1043('0x34')]=_['keys'](_0x437126[_0x1043('0x34')]);_0x47028f['filters']=_[_0x1043('0x37')](_0x47028f[_0x1043('0x33')],_0x47028f[_0x1043('0x34')]);_0x5a14d5[_0x1043('0x38')]=_[_0x1043('0x37')](_0x47028f['model'],qs[_0x1043('0x39')](_0x437126['query'][_0x1043('0x39')]));_0x5a14d5['attributes']=_0x5a14d5[_0x1043('0x38')][_0x1043('0x3a')]?_0x5a14d5[_0x1043('0x38')]:_0x47028f['model'];if(!_0x437126[_0x1043('0x34')]['hasOwnProperty'](_0x1043('0x3c'))){_0x5a14d5['limit']=qs['limit'](_0x437126[_0x1043('0x34')][_0x1043('0x1d')]);_0x5a14d5['offset']=qs[_0x1043('0x1b')](_0x437126[_0x1043('0x34')][_0x1043('0x1b')]);}_0x5a14d5[_0x1043('0x3d')]=qs[_0x1043('0x3e')](_0x437126[_0x1043('0x34')]['sort']);_0x5a14d5[_0x1043('0x3f')]=qs[_0x1043('0x36')](_['pick'](_0x437126[_0x1043('0x34')],_0x47028f[_0x1043('0x36')]));_0x5a14d5['where'][_0x1043('0x5c')]=_0x41719a['id'];if(_0x437126[_0x1043('0x34')][_0x1043('0x41')]){_0x5a14d5[_0x1043('0x3f')]=_[_0x1043('0x42')](_0x5a14d5[_0x1043('0x3f')],{'$or':_[_0x1043('0x2d')](_0x5a14d5['attributes'],function(_0xe110d){var _0xec60dc={};_0xec60dc[_0xe110d]={'$like':'%'+_0x437126[_0x1043('0x34')][_0x1043('0x41')]+'%'};return _0xec60dc;})});}_0x5a14d5=_[_0x1043('0x42')]({},_0x5a14d5,_0x437126[_0x1043('0x4a')]);return db[_0x1043('0x5b')][_0x1043('0x43')]({'where':_0x5a14d5['where']})[_0x1043('0x25')](function(_0x15aef0){_0x2142c4[_0x1043('0x43')]=_0x15aef0;if(_0x437126[_0x1043('0x34')][_0x1043('0x44')]){_0x5a14d5[_0x1043('0x45')]=[{'all':!![]}];}return db[_0x1043('0x5b')][_0x1043('0x46')](_0x5a14d5);})[_0x1043('0x25')](function(_0x5d4afb){_0x2142c4[_0x1043('0x47')]=_0x5d4afb;return _0x2142c4;});}})[_0x1043('0x25')](respondWithFilteredResult(_0x5e959e,_0x5a14d5))[_0x1043('0x48')](handleError(_0x5e959e,null));};exports[_0x1043('0x5d')]=function(_0x4f31d1,_0x5b33b0,_0x205fcc){var _0x1a276e={'raw':!![],'where':{}};var _0x9123bd={};var _0x78a6f2={'count':0x0,'rows':[]};return db[_0x1043('0x2e')][_0x1043('0x5e')]({'where':{'id':_0x4f31d1[_0x1043('0x49')]['id']}})[_0x1043('0x25')](handleEntityNotFound(_0x5b33b0,null))[_0x1043('0x25')](function(_0x31fec4){if(_0x31fec4){_0x9123bd[_0x1043('0x33')]=_[_0x1043('0x35')](db[_0x1043('0x5f')][_0x1043('0x2f')]);_0x9123bd[_0x1043('0x34')]=_[_0x1043('0x35')](_0x4f31d1[_0x1043('0x34')]);_0x9123bd['filters']=_[_0x1043('0x37')](_0x9123bd[_0x1043('0x33')],_0x9123bd[_0x1043('0x34')]);_0x1a276e['attributes']=_[_0x1043('0x37')](_0x9123bd['model'],qs[_0x1043('0x39')](_0x4f31d1[_0x1043('0x34')]['fields']));_0x1a276e[_0x1043('0x38')]=_0x1a276e[_0x1043('0x38')][_0x1043('0x3a')]?_0x1a276e[_0x1043('0x38')]:_0x9123bd[_0x1043('0x33')];if(!_0x4f31d1[_0x1043('0x34')][_0x1043('0x3b')](_0x1043('0x3c'))){_0x1a276e['limit']=qs['limit'](_0x4f31d1[_0x1043('0x34')][_0x1043('0x1d')]);_0x1a276e[_0x1043('0x1b')]=qs['offset'](_0x4f31d1[_0x1043('0x34')][_0x1043('0x1b')]);}_0x1a276e[_0x1043('0x3d')]=qs[_0x1043('0x3e')](_0x4f31d1[_0x1043('0x34')]['sort']);_0x1a276e['where']=qs[_0x1043('0x36')](_[_0x1043('0x40')](_0x4f31d1[_0x1043('0x34')],_0x9123bd[_0x1043('0x36')]));_0x1a276e['where'][_0x1043('0x5c')]=_0x31fec4['id'];if(_0x4f31d1[_0x1043('0x34')][_0x1043('0x41')]){_0x1a276e['where']=_['merge'](_0x1a276e[_0x1043('0x3f')],{'$or':_[_0x1043('0x2d')](_0x1a276e[_0x1043('0x38')],function(_0x21f9ac){var _0x5b2f49={};_0x5b2f49[_0x21f9ac]={'$like':'%'+_0x4f31d1[_0x1043('0x34')]['filter']+'%'};return _0x5b2f49;})});}_0x1a276e=_[_0x1043('0x42')]({},_0x1a276e,_0x4f31d1[_0x1043('0x4a')]);return db['CmHopperHistory'][_0x1043('0x43')]({'where':_0x1a276e['where']})[_0x1043('0x25')](function(_0x4151f6){_0x78a6f2[_0x1043('0x43')]=_0x4151f6;if(_0x4f31d1[_0x1043('0x34')][_0x1043('0x44')]){_0x1a276e['include']=[{'all':!![]}];}return db[_0x1043('0x5f')][_0x1043('0x46')](_0x1a276e);})['then'](function(_0x266d46){_0x78a6f2['rows']=_0x266d46;return _0x78a6f2;});}})[_0x1043('0x25')](respondWithFilteredResult(_0x5b33b0,_0x1a276e))[_0x1043('0x48')](handleError(_0x5b33b0,null));};exports[_0x1043('0x60')]=function(_0x27bfbe,_0x1b168f,_0x54c80c){var _0x171913={'raw':!![],'where':{}};var _0x488344={};var _0x1f5e07={'count':0x0,'rows':[]};return db['Campaign'][_0x1043('0x5e')]({'where':{'id':_0x27bfbe[_0x1043('0x49')]['id']}})[_0x1043('0x25')](handleEntityNotFound(_0x1b168f,null))[_0x1043('0x25')](function(_0x155792){if(_0x155792){_0x488344['model']=_[_0x1043('0x35')](db[_0x1043('0x61')][_0x1043('0x2f')]);_0x488344[_0x1043('0x34')]=_[_0x1043('0x35')](_0x27bfbe[_0x1043('0x34')]);_0x488344[_0x1043('0x36')]=_['intersection'](_0x488344[_0x1043('0x33')],_0x488344[_0x1043('0x34')]);_0x171913[_0x1043('0x38')]=_[_0x1043('0x37')](_0x488344[_0x1043('0x33')],qs[_0x1043('0x39')](_0x27bfbe['query'][_0x1043('0x39')]));_0x171913[_0x1043('0x38')]=_0x171913['attributes'][_0x1043('0x3a')]?_0x171913[_0x1043('0x38')]:_0x488344[_0x1043('0x33')];if(!_0x27bfbe[_0x1043('0x34')][_0x1043('0x3b')](_0x1043('0x3c'))){_0x171913['limit']=qs[_0x1043('0x1d')](_0x27bfbe[_0x1043('0x34')]['limit']);_0x171913[_0x1043('0x1b')]=qs[_0x1043('0x1b')](_0x27bfbe[_0x1043('0x34')]['offset']);}_0x171913[_0x1043('0x3d')]=qs[_0x1043('0x3e')](_0x27bfbe['query'][_0x1043('0x3e')]);_0x171913[_0x1043('0x3f')]=qs['filters'](_[_0x1043('0x40')](_0x27bfbe[_0x1043('0x34')],_0x488344[_0x1043('0x36')]));_0x171913['where']['CampaignId']=_0x155792['id'];if(_0x27bfbe[_0x1043('0x34')]['filter']){_0x171913[_0x1043('0x3f')]=_[_0x1043('0x42')](_0x171913['where'],{'$or':_[_0x1043('0x2d')](_0x171913[_0x1043('0x38')],function(_0x20eeba){var _0x40f3d0={};_0x40f3d0[_0x20eeba]={'$like':'%'+_0x27bfbe[_0x1043('0x34')][_0x1043('0x41')]+'%'};return _0x40f3d0;})});}_0x171913=_[_0x1043('0x42')]({},_0x171913,_0x27bfbe[_0x1043('0x4a')]);return db[_0x1043('0x61')][_0x1043('0x43')]({'where':_0x171913[_0x1043('0x3f')]})[_0x1043('0x25')](function(_0x1a3546){_0x1f5e07[_0x1043('0x43')]=_0x1a3546;if(_0x27bfbe['query'][_0x1043('0x44')]){_0x171913[_0x1043('0x45')]=[{'all':!![]}];}return db[_0x1043('0x61')][_0x1043('0x46')](_0x171913);})['then'](function(_0x41f51b){_0x1f5e07[_0x1043('0x47')]=_0x41f51b;return _0x1f5e07;});}})[_0x1043('0x25')](respondWithFilteredResult(_0x1b168f,_0x171913))['catch'](handleError(_0x1b168f,null));};exports[_0x1043('0x62')]=function(_0x2cb8c0,_0x4a886b,_0x364732){var _0x11524d={'raw':!![],'where':{}};var _0xb85a7e={};var _0x1e733f={'count':0x0,'rows':[]};return db[_0x1043('0x2e')]['findOne']({'where':{'id':_0x2cb8c0[_0x1043('0x49')]['id']}})[_0x1043('0x25')](handleEntityNotFound(_0x4a886b,null))[_0x1043('0x25')](function(_0x9ae26c){if(_0x9ae26c){_0xb85a7e[_0x1043('0x33')]=_['keys'](db[_0x1043('0x63')][_0x1043('0x2f')]);_0xb85a7e[_0x1043('0x34')]=_[_0x1043('0x35')](_0x2cb8c0['query']);_0xb85a7e[_0x1043('0x36')]=_[_0x1043('0x37')](_0xb85a7e[_0x1043('0x33')],_0xb85a7e[_0x1043('0x34')]);_0x11524d['attributes']=_[_0x1043('0x37')](_0xb85a7e[_0x1043('0x33')],qs[_0x1043('0x39')](_0x2cb8c0[_0x1043('0x34')][_0x1043('0x39')]));_0x11524d['attributes']=_0x11524d[_0x1043('0x38')][_0x1043('0x3a')]?_0x11524d[_0x1043('0x38')]:_0xb85a7e[_0x1043('0x33')];if(!_0x2cb8c0[_0x1043('0x34')][_0x1043('0x3b')](_0x1043('0x3c'))){_0x11524d['limit']=qs[_0x1043('0x1d')](_0x2cb8c0['query']['limit']);_0x11524d[_0x1043('0x1b')]=qs[_0x1043('0x1b')](_0x2cb8c0['query'][_0x1043('0x1b')]);}_0x11524d[_0x1043('0x3d')]=qs[_0x1043('0x3e')](_0x2cb8c0[_0x1043('0x34')][_0x1043('0x3e')]);_0x11524d[_0x1043('0x3f')]=qs[_0x1043('0x36')](_['pick'](_0x2cb8c0[_0x1043('0x34')],_0xb85a7e[_0x1043('0x36')]));_0x11524d['where'][_0x1043('0x5c')]=_0x9ae26c['id'];if(_0x2cb8c0[_0x1043('0x34')][_0x1043('0x41')]){_0x11524d[_0x1043('0x3f')]=_[_0x1043('0x42')](_0x11524d[_0x1043('0x3f')],{'$or':_[_0x1043('0x2d')](_0x11524d[_0x1043('0x38')],function(_0x36b51e){var _0xb1846d={};_0xb1846d[_0x36b51e]={'$like':'%'+_0x2cb8c0[_0x1043('0x34')][_0x1043('0x41')]+'%'};return _0xb1846d;})});}_0x11524d=_[_0x1043('0x42')]({},_0x11524d,_0x2cb8c0[_0x1043('0x4a')]);return db[_0x1043('0x63')][_0x1043('0x43')]({'where':_0x11524d[_0x1043('0x3f')]})[_0x1043('0x25')](function(_0x2d31bb){_0x1e733f[_0x1043('0x43')]=_0x2d31bb;if(_0x2cb8c0[_0x1043('0x34')][_0x1043('0x44')]){_0x11524d['include']=[{'all':!![]}];}return db[_0x1043('0x63')][_0x1043('0x46')](_0x11524d);})[_0x1043('0x25')](function(_0x59f790){_0x1e733f['rows']=_0x59f790;return _0x1e733f;});}})[_0x1043('0x25')](respondWithFilteredResult(_0x4a886b,_0x11524d))[_0x1043('0x48')](handleError(_0x4a886b,null));};exports[_0x1043('0x64')]=function(_0x5810a8,_0x5dd452,_0x3a14d0){var _0x34e251={};var _0x462b93={};var _0x27a43d;var _0x49095c;return db[_0x1043('0x2e')]['findOne']({'where':{'id':_0x5810a8[_0x1043('0x49')]['id']}})[_0x1043('0x25')](handleEntityNotFound(_0x5dd452,null))[_0x1043('0x25')](function(_0x324db7){if(_0x324db7){_0x27a43d=_0x324db7;_0x462b93[_0x1043('0x33')]=_['keys'](db[_0x1043('0x65')][_0x1043('0x2f')]);_0x462b93['query']=_[_0x1043('0x35')](_0x5810a8['query']);_0x462b93[_0x1043('0x36')]=_[_0x1043('0x37')](_0x462b93['model'],_0x462b93['query']);_0x34e251['attributes']=_['intersection'](_0x462b93[_0x1043('0x33')],qs[_0x1043('0x39')](_0x5810a8[_0x1043('0x34')][_0x1043('0x39')]));_0x34e251['attributes']=_0x34e251['attributes'][_0x1043('0x3a')]?_0x34e251[_0x1043('0x38')]:_0x462b93[_0x1043('0x33')];_0x34e251[_0x1043('0x3d')]=qs['sort'](_0x5810a8[_0x1043('0x34')][_0x1043('0x3e')]);_0x34e251[_0x1043('0x3f')]=qs['filters'](_[_0x1043('0x40')](_0x5810a8[_0x1043('0x34')],_0x462b93[_0x1043('0x36')]));if(_0x5810a8[_0x1043('0x34')][_0x1043('0x41')]){_0x34e251[_0x1043('0x3f')]=_['merge'](_0x34e251[_0x1043('0x3f')],{'$or':_[_0x1043('0x2d')](_0x34e251['attributes'],function(_0x2c5305){var _0x5de97a={};_0x5de97a[_0x2c5305]={'$like':'%'+_0x5810a8[_0x1043('0x34')][_0x1043('0x41')]+'%'};return _0x5de97a;})});}_0x34e251=_['merge']({},_0x34e251,_0x5810a8[_0x1043('0x4a')]);return _0x27a43d['getLists'](_0x34e251);}})[_0x1043('0x25')](function(_0x2d4b7a){if(_0x2d4b7a){_0x49095c=_0x2d4b7a[_0x1043('0x3a')];if(!_0x5810a8[_0x1043('0x34')][_0x1043('0x3b')](_0x1043('0x3c'))){_0x34e251[_0x1043('0x1d')]=qs[_0x1043('0x1d')](_0x5810a8[_0x1043('0x34')]['limit']);_0x34e251[_0x1043('0x1b')]=qs[_0x1043('0x1b')](_0x5810a8[_0x1043('0x34')][_0x1043('0x1b')]);}return _0x27a43d[_0x1043('0x64')](_0x34e251);}})[_0x1043('0x25')](function(_0x18a916){if(_0x18a916){return _0x18a916?{'count':_0x49095c,'rows':_0x18a916}:null;}})[_0x1043('0x25')](respondWithResult(_0x5dd452,null))['catch'](handleError(_0x5dd452,null));};exports['addLists']=function(_0x3d14df,_0x6b20ab,_0x2eb4d9){var _0x28c8f4,_0x3956c6;var _0xbba138=[];var _0x451194=moment()[_0x1043('0x66')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x1043('0x2e')][_0x1043('0x4b')]({'where':{'id':_0x3d14df['params']['id']}})[_0x1043('0x25')](handleEntityNotFound(_0x6b20ab,null))['then'](function(_0x10e01c){if(_0x10e01c){_0x3956c6=_0x10e01c;return _0x10e01c['addLists'](_0x3d14df['body'][_0x1043('0x67')],_[_0x1043('0x68')](_0x3d14df[_0x1043('0x4d')],[_0x1043('0x67'),'id'])||{});}return null;})['spread'](function(_0x27c71f){var _0x57dbb0;var _0x18e31b;_0x28c8f4=_0x27c71f||[];var _0x177289=[];if(_0x27c71f){for(var _0x4739fc=0x0;_0x4739fc<_0x27c71f[_0x1043('0x3a')];_0x4739fc+=0x1){var _0x6cfbf7=_0x27c71f[_0x4739fc][_0x1043('0x26')]({'plain':!![]});_0x3956c6[_0x1043('0x69')]=_0x3d14df[_0x1043('0x4d')][_0x1043('0x69')]?_0x3d14df[_0x1043('0x4d')]['dialCheckDuplicateType']:_0x3956c6[_0x1043('0x69')];switch(_0x3956c6['dialCheckDuplicateType']){case'always':_0x57dbb0=squel[_0x1043('0x6a')]()[_0x1043('0x6b')](_0x1043('0x6c'))['fromQuery']([_0x1043('0x6d'),_0x1043('0x6e'),_0x1043('0x6f'),_0x1043('0x70'),_0x1043('0x5c'),'createdAt','updatedAt'],squel[_0x1043('0x71')]()[_0x1043('0x72')]('phone',_0x1043('0x6d'))[_0x1043('0x72')](_0x1043('0x73'),_0x1043('0x6e'))['field']('id',_0x1043('0x6f'))[_0x1043('0x72')](_0x6cfbf7[_0x1043('0x74')]['toString'](),_0x1043('0x70'))[_0x1043('0x72')](_0x3d14df[_0x1043('0x49')]['id'][_0x1043('0x75')](),_0x1043('0x5c'))['field']('\x27'+_0x451194+'\x27',_0x1043('0x55'))['field']('\x27'+_0x451194+'\x27',_0x1043('0x56'))[_0x1043('0x76')](_0x1043('0x77'))[_0x1043('0x3f')](_0x1043('0x78'))['where'](_0x1043('0x79'),_0x6cfbf7[_0x1043('0x74')][_0x1043('0x75')]())['where'](_0x1043('0x7a'))[_0x1043('0x3f')](_0x1043('0x7b'),squel[_0x1043('0x71')]()[_0x1043('0x72')]('COALESCE(calleridnum,\x27\x27)')[_0x1043('0x76')]('cm_hopper_final')[_0x1043('0x3f')](_0x1043('0x7c'),_0x3d14df[_0x1043('0x49')]['id'][_0x1043('0x75')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x1043('0x71')]()[_0x1043('0x72')](_0x1043('0x7d'))['from'](_0x1043('0x6c'))[_0x1043('0x3f')](_0x1043('0x7c'),_0x3d14df[_0x1043('0x49')]['id']['toString']())))[_0x1043('0x75')]();break;case _0x1043('0x7e'):_0x57dbb0=squel[_0x1043('0x6a')]()[_0x1043('0x6b')](_0x1043('0x6c'))[_0x1043('0x7f')]([_0x1043('0x6d'),_0x1043('0x6e'),'ContactId','ListId',_0x1043('0x5c'),_0x1043('0x55'),_0x1043('0x56')],squel[_0x1043('0x71')]()[_0x1043('0x72')](_0x1043('0x6d'),_0x1043('0x6d'))['field'](_0x1043('0x73'),_0x1043('0x6e'))['field']('id',_0x1043('0x6f'))[_0x1043('0x72')](_0x6cfbf7['CmListId'][_0x1043('0x75')](),'ListId')[_0x1043('0x72')](_0x3d14df[_0x1043('0x49')]['id']['toString'](),_0x1043('0x5c'))['field']('\x27'+_0x451194+'\x27','createdAt')[_0x1043('0x72')]('\x27'+_0x451194+'\x27',_0x1043('0x56'))[_0x1043('0x76')]('cm_contacts')[_0x1043('0x3f')](_0x1043('0x78'))[_0x1043('0x3f')](_0x1043('0x79'),_0x6cfbf7[_0x1043('0x74')][_0x1043('0x75')]())['where'](_0x1043('0x7a'))[_0x1043('0x3f')](_0x1043('0x7b'),squel[_0x1043('0x71')]()[_0x1043('0x72')](_0x1043('0x7d'))[_0x1043('0x76')](_0x1043('0x6c'))[_0x1043('0x3f')](_0x1043('0x7c'),_0x3d14df[_0x1043('0x49')]['id'][_0x1043('0x75')]())))[_0x1043('0x75')]();break;default:_0x57dbb0=squel[_0x1043('0x6a')]()[_0x1043('0x6b')](_0x1043('0x6c'))[_0x1043('0x7f')]([_0x1043('0x6d'),_0x1043('0x6e'),_0x1043('0x6f'),_0x1043('0x70'),_0x1043('0x5c'),'createdAt',_0x1043('0x56')],squel[_0x1043('0x71')]()[_0x1043('0x72')](_0x1043('0x6d'),_0x1043('0x6d'))[_0x1043('0x72')](_0x1043('0x73'),'scheduledAt')[_0x1043('0x72')]('id',_0x1043('0x6f'))[_0x1043('0x72')](_0x6cfbf7[_0x1043('0x74')]['toString'](),_0x1043('0x70'))[_0x1043('0x72')](_0x3d14df[_0x1043('0x49')]['id'][_0x1043('0x75')](),_0x1043('0x5c'))['field']('\x27'+_0x451194+'\x27',_0x1043('0x55'))[_0x1043('0x72')]('\x27'+_0x451194+'\x27',_0x1043('0x56'))['from'](_0x1043('0x77'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x1043('0x79'),_0x6cfbf7[_0x1043('0x74')][_0x1043('0x75')]())[_0x1043('0x3f')](_0x1043('0x7a')))['toString']();}_0x18e31b=squel['insert']()[_0x1043('0x6b')]('cm_hopper_additional_phones')[_0x1043('0x7f')](['cmHopperId','scheduledAt',_0x1043('0x6d'),_0x1043('0x80'),_0x1043('0x55'),_0x1043('0x56')],squel[_0x1043('0x71')]()[_0x1043('0x72')](_0x1043('0x81'),'id')[_0x1043('0x72')](_0x1043('0x73'),_0x1043('0x6e'))[_0x1043('0x72')](_0x1043('0x82'),_0x1043('0x6d'))[_0x1043('0x72')](_0x1043('0x83'),_0x1043('0x80'))[_0x1043('0x72')]('\x27'+_0x451194+'\x27',_0x1043('0x55'))[_0x1043('0x72')]('\x27'+_0x451194+'\x27','updatedAt')['from'](_0x1043('0x84'),'ci')[_0x1043('0x85')](_0x1043('0x6c'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x1043('0x3f')]('h.ListId\x20=\x20?',_0x6cfbf7[_0x1043('0x74')]['toString']())['where'](_0x1043('0x86'),_0x3d14df['params']['id'][_0x1043('0x75')]())[_0x1043('0x3f')](_0x1043('0x87'),_0x451194))[_0x1043('0x75')]();_0x177289[_0x1043('0x88')](db[_0x1043('0x89')]['query'](_0x57dbb0));_0xbba138[_0x1043('0x88')](db['sequelize'][_0x1043('0x34')](_0x18e31b));}return BPromise[_0x1043('0x8a')](_0x177289);}})[_0x1043('0x25')](function(){return BPromise[_0x1043('0x8a')](_0xbba138);})['then'](function(){return _0x28c8f4;})[_0x1043('0x25')](respondWithResult(_0x6b20ab,null))[_0x1043('0x48')](handleError(_0x6b20ab,null));};exports[_0x1043('0x8b')]=function(_0x3cfd0e,_0x577fa0,_0x3636cd){return db[_0x1043('0x2e')][_0x1043('0x4b')]({'where':{'id':_0x3cfd0e[_0x1043('0x49')]['id']}})['then'](handleEntityNotFound(_0x577fa0,null))['then'](function(_0x43da65){if(_0x43da65){return _0x43da65[_0x1043('0x8b')](_0x3cfd0e['query']['ids']);}})[_0x1043('0x25')](function(_0x1cc171){if(_0x1cc171){return db[_0x1043('0x5b')]['destroy']({'where':{'ListId':_0x3cfd0e['query'][_0x1043('0x67')],'CampaignId':_0x3cfd0e[_0x1043('0x49')]['id']}})[_0x1043('0x25')](function(){return _0x1cc171;});}})['then'](respondWithStatusCode(_0x577fa0,null))[_0x1043('0x48')](handleError(_0x577fa0,null));};exports['getBlackLists']=function(_0x5a2f4a,_0x1ab0ab,_0x48a81a){var _0x3b608a={};var _0x3dc52e={};var _0x291b60;var _0x383afa;return db['Campaign'][_0x1043('0x5e')]({'where':{'id':_0x5a2f4a[_0x1043('0x49')]['id']}})['then'](handleEntityNotFound(_0x1ab0ab,null))[_0x1043('0x25')](function(_0x5d6336){if(_0x5d6336){_0x291b60=_0x5d6336;_0x3dc52e[_0x1043('0x33')]=_[_0x1043('0x35')](db[_0x1043('0x65')][_0x1043('0x2f')]);_0x3dc52e[_0x1043('0x34')]=_[_0x1043('0x35')](_0x5a2f4a[_0x1043('0x34')]);_0x3dc52e[_0x1043('0x36')]=_[_0x1043('0x37')](_0x3dc52e[_0x1043('0x33')],_0x3dc52e[_0x1043('0x34')]);_0x3b608a['attributes']=_['intersection'](_0x3dc52e['model'],qs['fields'](_0x5a2f4a['query'][_0x1043('0x39')]));_0x3b608a[_0x1043('0x38')]=_0x3b608a[_0x1043('0x38')][_0x1043('0x3a')]?_0x3b608a[_0x1043('0x38')]:_0x3dc52e['model'];_0x3b608a['order']=qs[_0x1043('0x3e')](_0x5a2f4a[_0x1043('0x34')]['sort']);_0x3b608a[_0x1043('0x3f')]=qs[_0x1043('0x36')](_['pick'](_0x5a2f4a[_0x1043('0x34')],_0x3dc52e[_0x1043('0x36')]));if(_0x5a2f4a[_0x1043('0x34')]['filter']){_0x3b608a[_0x1043('0x3f')]=_[_0x1043('0x42')](_0x3b608a[_0x1043('0x3f')],{'$or':_[_0x1043('0x2d')](_0x3b608a[_0x1043('0x38')],function(_0x14f895){var _0x493d29={};_0x493d29[_0x14f895]={'$like':'%'+_0x5a2f4a[_0x1043('0x34')]['filter']+'%'};return _0x493d29;})});}_0x3b608a=_['merge']({},_0x3b608a,_0x5a2f4a[_0x1043('0x4a')]);return _0x291b60['getBlackLists'](_0x3b608a);}})['then'](function(_0x9d61fe){if(_0x9d61fe){_0x383afa=_0x9d61fe[_0x1043('0x3a')];if(!_0x5a2f4a[_0x1043('0x34')][_0x1043('0x3b')](_0x1043('0x3c'))){_0x3b608a[_0x1043('0x1d')]=qs[_0x1043('0x1d')](_0x5a2f4a[_0x1043('0x34')][_0x1043('0x1d')]);_0x3b608a[_0x1043('0x1b')]=qs[_0x1043('0x1b')](_0x5a2f4a[_0x1043('0x34')][_0x1043('0x1b')]);}return _0x291b60[_0x1043('0x8c')](_0x3b608a);}})['then'](function(_0x4bbc07){if(_0x4bbc07){return _0x4bbc07?{'count':_0x383afa,'rows':_0x4bbc07}:null;}})[_0x1043('0x25')](respondWithResult(_0x1ab0ab,null))[_0x1043('0x48')](handleError(_0x1ab0ab,null));};exports[_0x1043('0x8d')]=function(_0x2f8a3e,_0x55a387,_0x488548){var _0x139132,_0x93844f;var _0x39c1cc=[];var _0x3b5e9=moment()[_0x1043('0x66')](_0x1043('0x8e'));return db[_0x1043('0x2e')][_0x1043('0x4b')]({'where':{'id':_0x2f8a3e[_0x1043('0x49')]['id']}})[_0x1043('0x25')](handleEntityNotFound(_0x55a387,null))[_0x1043('0x25')](function(_0x243f71){if(_0x243f71){_0x93844f=_0x243f71;return _0x243f71[_0x1043('0x8d')](_0x2f8a3e[_0x1043('0x4d')][_0x1043('0x67')],_[_0x1043('0x68')](_0x2f8a3e['body'],[_0x1043('0x67'),'id'])||{});}return null;})[_0x1043('0x8f')](function(_0x3480db){var _0x21b642;var _0x966ea4;_0x139132=_0x3480db||[];var _0x48528c=[];if(_0x3480db){for(var _0x59ca22=0x0;_0x59ca22<_0x3480db[_0x1043('0x3a')];_0x59ca22+=0x1){var _0x4375af=_0x3480db[_0x59ca22][_0x1043('0x26')]({'plain':!![]});_0x21b642=squel[_0x1043('0x6a')]()[_0x1043('0x6b')](_0x1043('0x90'))[_0x1043('0x7f')](['phone',_0x1043('0x6f'),_0x1043('0x70'),_0x1043('0x5c'),'createdAt',_0x1043('0x56')],squel[_0x1043('0x71')]()[_0x1043('0x72')](_0x1043('0x6d'),_0x1043('0x6d'))[_0x1043('0x72')]('id',_0x1043('0x6f'))['field'](_0x4375af[_0x1043('0x74')][_0x1043('0x75')](),'ListId')[_0x1043('0x72')](_0x2f8a3e[_0x1043('0x49')]['id'][_0x1043('0x75')](),_0x1043('0x5c'))[_0x1043('0x72')]('NOW()','createdAt')[_0x1043('0x72')]('NOW()','updatedAt')[_0x1043('0x76')]('cm_contacts')[_0x1043('0x3f')]('deletedAt\x20IS\x20NULL')[_0x1043('0x3f')]('ListId\x20=\x20?',_0x4375af[_0x1043('0x74')][_0x1043('0x75')]())[_0x1043('0x3f')](_0x1043('0x7a')))[_0x1043('0x75')]();_0x48528c['push'](db[_0x1043('0x89')][_0x1043('0x34')](_0x21b642));}return BPromise[_0x1043('0x8a')](_0x48528c);}})['then'](function(){return _0x139132;})[_0x1043('0x25')](respondWithResult(_0x55a387,null))[_0x1043('0x48')](handleError(_0x55a387,null));};exports[_0x1043('0x91')]=function(_0x36008d,_0x3dbaf3,_0x1fb8df){return db[_0x1043('0x2e')][_0x1043('0x4b')]({'where':{'id':_0x36008d[_0x1043('0x49')]['id']}})[_0x1043('0x25')](handleEntityNotFound(_0x3dbaf3,null))[_0x1043('0x25')](function(_0xe93e0c){if(_0xe93e0c){return _0xe93e0c['removeBlackLists'](_0x36008d[_0x1043('0x34')]['ids']);}})[_0x1043('0x25')](function(_0xff50d2){if(_0xff50d2){return db['CmHopperBlack'][_0x1043('0x24')]({'where':{'ListId':_0x36008d[_0x1043('0x34')]['ids'],'CampaignId':_0x36008d[_0x1043('0x49')]['id']}})[_0x1043('0x25')](function(){return _0xff50d2;});}})[_0x1043('0x25')](respondWithStatusCode(_0x3dbaf3,null))[_0x1043('0x48')](handleError(_0x3dbaf3,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 7b48770..cd23c8c 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xb509c2,_0xc778dd){var _0x1a63e1=function(_0x29b224){while(--_0x29b224){_0xb509c2['push'](_0xb509c2['shift']());}};_0x1a63e1(++_0xc778dd);}(_0x7a54,0x106));var _0x47a5=function(_0x192b30,_0x5c7525){_0x192b30=_0x192b30-0x0;var _0x1873fb=_0x7a54[_0x192b30];return _0x1873fb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x7a54,0x106));var _0x47a5=function(_0x471a69,_0x58574c){_0x471a69=_0x471a69-0x0;var _0x5dbe66=_0x7a54[_0x471a69];return _0x5dbe66;};'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 112f5f9..9b835e5 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 _0x4156=['request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','GetCampaign','Campaign','raw','options','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x580843,_0x1840bb){var _0x12a1e2=function(_0x5f02c5){while(--_0x5f02c5){_0x580843['push'](_0x580843['shift']());}};_0x12a1e2(++_0x1840bb);}(_0x4156,0xf1));var _0x6415=function(_0x359055,_0x20f62d){_0x359055=_0x359055-0x0;var _0xc50b4b=_0x4156[_0x359055];return _0xc50b4b;};'use strict';var _=require(_0x6415('0x0'));var util=require(_0x6415('0x1'));var moment=require(_0x6415('0x2'));var BPromise=require(_0x6415('0x3'));var rs=require(_0x6415('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6415('0x5'))['db'];var utils=require(_0x6415('0x6'));var logger=require(_0x6415('0x7'))(_0x6415('0x8'));var config=require(_0x6415('0x9'));var jayson=require(_0x6415('0xa'));var client=jayson[_0x6415('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24cb0,_0x47ec13,_0x4045ec){return new BPromise(function(_0x266237,_0x5bc51b){return client[_0x6415('0xc')](_0x24cb0,_0x4045ec)[_0x6415('0xd')](function(_0x3383d2){logger[_0x6415('0xe')]('Campaign,\x20%s,\x20%s',_0x47ec13,_0x6415('0xf'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x47ec13,_0x6415('0xf'),JSON[_0x6415('0x10')](_0x3383d2));if(_0x3383d2[_0x6415('0x11')]){if(_0x3383d2[_0x6415('0x11')][_0x6415('0x12')]===0x1f4){logger[_0x6415('0x11')](_0x6415('0x13'),_0x47ec13,_0x3383d2['error']['message']);return _0x5bc51b(_0x3383d2[_0x6415('0x11')][_0x6415('0x14')]);}logger[_0x6415('0x11')](_0x6415('0x13'),_0x47ec13,_0x3383d2[_0x6415('0x11')]['message']);return _0x266237(_0x3383d2['error'][_0x6415('0x14')]);}else{logger[_0x6415('0xe')]('Campaign,\x20%s,\x20%s',_0x47ec13,_0x6415('0xf'));_0x266237(_0x3383d2[_0x6415('0x15')]['message']);}})['catch'](function(_0x352a04){logger[_0x6415('0x11')](_0x6415('0x13'),_0x47ec13,_0x352a04);_0x5bc51b(_0x352a04);});});}exports[_0x6415('0x16')]=function(_0x2ef73b){var _0xa3d00a=this;return new Promise(function(_0x2c74c6,_0x468dc2){return db[_0x6415('0x17')]['findAll']({'raw':_0x2ef73b['options']?_0x2ef73b['options'][_0x6415('0x18')]===undefined?!![]:![]:!![],'where':_0x2ef73b[_0x6415('0x19')]?_0x2ef73b[_0x6415('0x19')][_0x6415('0x1a')]||null:null,'attributes':_0x2ef73b['options']?_0x2ef73b[_0x6415('0x19')][_0x6415('0x1b')]||null:null,'limit':_0x2ef73b[_0x6415('0x19')]?_0x2ef73b['options'][_0x6415('0x1c')]||null:null,'include':_0x2ef73b[_0x6415('0x19')]?_0x2ef73b[_0x6415('0x19')][_0x6415('0x1d')]?_[_0x6415('0x1e')](_0x2ef73b[_0x6415('0x19')][_0x6415('0x1d')],function(_0x41c266){return{'model':db[_0x41c266[_0x6415('0x1f')]],'as':_0x41c266['as'],'attributes':_0x41c266['attributes'],'include':_0x41c266[_0x6415('0x1d')]?_[_0x6415('0x1e')](_0x41c266['include'],function(_0x15be31){return{'model':db[_0x15be31[_0x6415('0x1f')]],'as':_0x15be31['as'],'attributes':_0x15be31[_0x6415('0x1b')],'include':_0x15be31[_0x6415('0x1d')]?_[_0x6415('0x1e')](_0x15be31['include'],function(_0x30d857){return{'model':db[_0x30d857['model']],'as':_0x30d857['as'],'attributes':_0x30d857[_0x6415('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6415('0xd')](function(_0x25d459){logger['info']('GetCampaign',_0x2ef73b);logger['debug'](_0x6415('0x16'),_0x2ef73b,JSON[_0x6415('0x10')](_0x25d459));_0x2c74c6(_0x25d459);})['catch'](function(_0x5bf08d){logger[_0x6415('0x11')](_0x6415('0x16'),_0x5bf08d[_0x6415('0x14')],_0x2ef73b);_0x468dc2(_0xa3d00a[_0x6415('0x11')](0x1f4,_0x5bf08d[_0x6415('0x14')]));});});};
\ No newline at end of file
+var _0xe58a=['message','info','result','catch','GetCampaign','findAll','options','raw','where','include','map','attributes','model','stringify','lodash','util','moment','randomstring','../../config/utils','../../config/environment','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error'];(function(_0x5b013e,_0x5065a3){var _0x55cda8=function(_0x463012){while(--_0x463012){_0x5b013e['push'](_0x5b013e['shift']());}};_0x55cda8(++_0x5065a3);}(_0xe58a,0x9f));var _0xae58=function(_0x462538,_0x4ae77f){_0x462538=_0x462538-0x0;var _0x19612e=_0xe58a[_0x462538];return _0x19612e;};'use strict';var _=require(_0xae58('0x0'));var util=require(_0xae58('0x1'));var moment=require(_0xae58('0x2'));var BPromise=require('bluebird');var rs=require(_0xae58('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xae58('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xae58('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xae58('0x6')][_0xae58('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2bd284,_0x2003b6,_0x703a03){return new BPromise(function(_0x7cb067,_0x20b26a){return client[_0xae58('0x8')](_0x2bd284,_0x703a03)[_0xae58('0x9')](function(_0x21d6f1){logger['info'](_0xae58('0xa'),_0x2003b6,_0xae58('0xb'));logger[_0xae58('0xc')](_0xae58('0xd'),_0x2003b6,_0xae58('0xb'),JSON['stringify'](_0x21d6f1));if(_0x21d6f1[_0xae58('0xe')]){if(_0x21d6f1[_0xae58('0xe')]['code']===0x1f4){logger[_0xae58('0xe')]('Campaign,\x20%s,\x20%s',_0x2003b6,_0x21d6f1[_0xae58('0xe')][_0xae58('0xf')]);return _0x20b26a(_0x21d6f1[_0xae58('0xe')][_0xae58('0xf')]);}logger['error'](_0xae58('0xa'),_0x2003b6,_0x21d6f1['error']['message']);return _0x7cb067(_0x21d6f1[_0xae58('0xe')][_0xae58('0xf')]);}else{logger[_0xae58('0x10')](_0xae58('0xa'),_0x2003b6,'request\x20sent');_0x7cb067(_0x21d6f1[_0xae58('0x11')][_0xae58('0xf')]);}})[_0xae58('0x12')](function(_0x2b3d7b){logger['error']('Campaign,\x20%s,\x20%s',_0x2003b6,_0x2b3d7b);_0x20b26a(_0x2b3d7b);});});}exports[_0xae58('0x13')]=function(_0x3d9b06){var _0x45a26b=this;return new Promise(function(_0x252488,_0x2e051c){return db['Campaign'][_0xae58('0x14')]({'raw':_0x3d9b06[_0xae58('0x15')]?_0x3d9b06[_0xae58('0x15')][_0xae58('0x16')]===undefined?!![]:![]:!![],'where':_0x3d9b06[_0xae58('0x15')]?_0x3d9b06[_0xae58('0x15')][_0xae58('0x17')]||null:null,'attributes':_0x3d9b06[_0xae58('0x15')]?_0x3d9b06[_0xae58('0x15')]['attributes']||null:null,'limit':_0x3d9b06['options']?_0x3d9b06[_0xae58('0x15')]['limit']||null:null,'include':_0x3d9b06[_0xae58('0x15')]?_0x3d9b06['options'][_0xae58('0x18')]?_[_0xae58('0x19')](_0x3d9b06[_0xae58('0x15')][_0xae58('0x18')],function(_0x41d2f2){return{'model':db[_0x41d2f2['model']],'as':_0x41d2f2['as'],'attributes':_0x41d2f2[_0xae58('0x1a')],'include':_0x41d2f2[_0xae58('0x18')]?_[_0xae58('0x19')](_0x41d2f2[_0xae58('0x18')],function(_0x557b6e){return{'model':db[_0x557b6e[_0xae58('0x1b')]],'as':_0x557b6e['as'],'attributes':_0x557b6e['attributes'],'include':_0x557b6e['include']?_[_0xae58('0x19')](_0x557b6e['include'],function(_0x2c3876){return{'model':db[_0x2c3876['model']],'as':_0x2c3876['as'],'attributes':_0x2c3876[_0xae58('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xae58('0x9')](function(_0x4474e8){logger['info']('GetCampaign',_0x3d9b06);logger['debug']('GetCampaign',_0x3d9b06,JSON[_0xae58('0x1c')](_0x4474e8));_0x252488(_0x4474e8);})['catch'](function(_0x551755){logger[_0xae58('0xe')](_0xae58('0x13'),_0x551755[_0xae58('0xf')],_0x3d9b06);_0x2e051c(_0x45a26b[_0xae58('0xe')](0x1f4,_0x551755[_0xae58('0xf')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 7f7e6ad..b1eacb5 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 _0xb722=['/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','/:id/clone','clone','addLists','/:id/blacklists','put','update','destroy','delete','removeLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals'];(function(_0x4ca602,_0x330765){var _0xefb7f7=function(_0x2ef10a){while(--_0x2ef10a){_0x4ca602['push'](_0x4ca602['shift']());}};_0xefb7f7(++_0x330765);}(_0xb722,0x191));var _0x2b72=function(_0xf5190e,_0xad681){_0xf5190e=_0xf5190e-0x0;var _0x3d6caa=_0xb722[_0xf5190e];return _0x3d6caa;};'use strict';var multer=require(_0x2b72('0x0'));var util=require('util');var path=require(_0x2b72('0x1'));var timeout=require(_0x2b72('0x2'));var express=require(_0x2b72('0x3'));var router=express[_0x2b72('0x4')]();var fs_extra=require(_0x2b72('0x5'));var auth=require(_0x2b72('0x6'));var interaction=require(_0x2b72('0x7'));var config=require('../../config/environment');var controller=require(_0x2b72('0x8'));router[_0x2b72('0x9')]('/',auth[_0x2b72('0xa')](),controller[_0x2b72('0xb')]);router[_0x2b72('0x9')](_0x2b72('0xc'),auth[_0x2b72('0xa')](),controller[_0x2b72('0xd')]);router['get'](_0x2b72('0xe'),auth[_0x2b72('0xa')](),controller[_0x2b72('0xf')]);router[_0x2b72('0x9')](_0x2b72('0x10'),auth[_0x2b72('0xa')](),controller[_0x2b72('0x11')]);router[_0x2b72('0x9')](_0x2b72('0x12'),auth[_0x2b72('0xa')](),controller['getHopperFinals']);router[_0x2b72('0x9')](_0x2b72('0x13'),auth[_0x2b72('0xa')](),controller[_0x2b72('0x14')]);router[_0x2b72('0x9')](_0x2b72('0x15'),auth[_0x2b72('0xa')](),controller[_0x2b72('0x16')]);router[_0x2b72('0x9')]('/:id/blacklists',auth[_0x2b72('0xa')](),controller[_0x2b72('0x17')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2b72('0x18')](_0x2b72('0x19'),auth[_0x2b72('0xa')](),controller[_0x2b72('0x1a')]);router[_0x2b72('0x18')]('/:id/lists',auth['isAuthenticated'](),controller[_0x2b72('0x1b')]);router['post'](_0x2b72('0x1c'),auth[_0x2b72('0xa')](),controller['addBlackLists']);router[_0x2b72('0x1d')](_0x2b72('0xc'),auth['isAuthenticated'](),controller[_0x2b72('0x1e')]);router['delete']('/:id',auth[_0x2b72('0xa')](),controller[_0x2b72('0x1f')]);router[_0x2b72('0x20')](_0x2b72('0x15'),auth[_0x2b72('0xa')](),controller[_0x2b72('0x21')]);router[_0x2b72('0x20')](_0x2b72('0x1c'),auth[_0x2b72('0xa')](),controller['removeBlackLists']);module[_0x2b72('0x22')]=router;
\ No newline at end of file
+var _0x42c8=['update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','index','/:id/hoppers','isAuthenticated','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addBlackLists','put','/:id'];(function(_0xba5e92,_0x38a184){var _0x43c82a=function(_0x4e628e){while(--_0x4e628e){_0xba5e92['push'](_0xba5e92['shift']());}};_0x43c82a(++_0x38a184);}(_0x42c8,0x116));var _0x842c=function(_0x3f78b0,_0x3e102f){_0x3f78b0=_0x3f78b0-0x0;var _0x226432=_0x42c8[_0x3f78b0];return _0x226432;};'use strict';var multer=require(_0x842c('0x0'));var util=require(_0x842c('0x1'));var path=require(_0x842c('0x2'));var timeout=require(_0x842c('0x3'));var express=require(_0x842c('0x4'));var router=express['Router']();var fs_extra=require(_0x842c('0x5'));var auth=require(_0x842c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x842c('0x7'));var controller=require(_0x842c('0x8'));router[_0x842c('0x9')]('/',auth['isAuthenticated'](),controller[_0x842c('0xa')]);router[_0x842c('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x842c('0xb'),auth[_0x842c('0xc')](),controller[_0x842c('0xd')]);router[_0x842c('0x9')]('/:id/hopper_histories',auth[_0x842c('0xc')](),controller[_0x842c('0xe')]);router[_0x842c('0x9')](_0x842c('0xf'),auth[_0x842c('0xc')](),controller[_0x842c('0x10')]);router[_0x842c('0x9')](_0x842c('0x11'),auth[_0x842c('0xc')](),controller['getHopperBlacks']);router[_0x842c('0x9')](_0x842c('0x12'),auth[_0x842c('0xc')](),controller[_0x842c('0x13')]);router['get'](_0x842c('0x14'),auth['isAuthenticated'](),controller[_0x842c('0x15')]);router[_0x842c('0x16')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x842c('0x17'),auth[_0x842c('0xc')](),controller[_0x842c('0x18')]);router[_0x842c('0x16')](_0x842c('0x12'),auth[_0x842c('0xc')](),controller['addLists']);router[_0x842c('0x16')](_0x842c('0x14'),auth[_0x842c('0xc')](),controller[_0x842c('0x19')]);router[_0x842c('0x1a')](_0x842c('0x1b'),auth[_0x842c('0xc')](),controller[_0x842c('0x1c')]);router[_0x842c('0x1d')]('/:id',auth[_0x842c('0xc')](),controller[_0x842c('0x1e')]);router[_0x842c('0x1d')](_0x842c('0x12'),auth[_0x842c('0xc')](),controller[_0x842c('0x1f')]);router[_0x842c('0x1d')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x842c('0x20')]);module[_0x842c('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 6ec1554..a7d0a38 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 _0x0448=['key','sequelize','exports','STRING','medium','VIRTUAL','getDataValue'];(function(_0x79b25c,_0x280b81){var _0x16d6c4=function(_0x23ae51){while(--_0x23ae51){_0x79b25c['push'](_0x79b25c['shift']());}};_0x16d6c4(++_0x280b81);}(_0x0448,0x16d));var _0x8044=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x0448[_0x1589dd];return _0x1bddd1;};'use strict';var Sequelize=require(_0x8044('0x0'));module[_0x8044('0x1')]={'key':{'type':Sequelize[_0x8044('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0x8044('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x8044('0x2')]},'name':{'type':Sequelize[_0x8044('0x4')],'get':function(){return this[_0x8044('0x5')](_0x8044('0x6'));}}};
\ No newline at end of file
+var _0x2206=['TEXT','medium','VIRTUAL','getDataValue','key','sequelize','STRING'];(function(_0x264d4d,_0x118fb5){var _0xc917e2=function(_0x21b9dc){while(--_0x21b9dc){_0x264d4d['push'](_0x264d4d['shift']());}};_0xc917e2(++_0x118fb5);}(_0x2206,0x194));var _0x6220=function(_0xad0beb,_0x5880da){_0xad0beb=_0xad0beb-0x0;var _0x27ec66=_0x2206[_0xad0beb];return _0x27ec66;};'use strict';var Sequelize=require(_0x6220('0x0'));module['exports']={'key':{'type':Sequelize[_0x6220('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x6220('0x2')],'length':_0x6220('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6220('0x1')]},'name':{'type':Sequelize[_0x6220('0x4')],'get':function(){return this[_0x6220('0x5')](_0x6220('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 9ae4a2f..c5cecb8 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 _0x519b=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CannedAnswers','name','send','index','map','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','options','CannedAnswer','include','findAll','rows','catch','show','params','includeAll','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','role','UserProfileSection','userProfileId','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined'];(function(_0x1635fe,_0x5f1d9f){var _0x3c512a=function(_0x26b53d){while(--_0x26b53d){_0x1635fe['push'](_0x1635fe['shift']());}};_0x3c512a(++_0x5f1d9f);}(_0x519b,0x19d));var _0xb519=function(_0x449b54,_0x3776f3){_0x449b54=_0x449b54-0x0;var _0x32d6b9=_0x519b[_0x449b54];return _0x32d6b9;};'use strict';var emlformat=require(_0xb519('0x0'));var rimraf=require(_0xb519('0x1'));var zipdir=require(_0xb519('0x2'));var jsonpatch=require(_0xb519('0x3'));var rp=require(_0xb519('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb519('0x5'));var util=require(_0xb519('0x6'));var path=require(_0xb519('0x7'));var sox=require(_0xb519('0x8'));var csv=require(_0xb519('0x9'));var ejs=require(_0xb519('0xa'));var fs=require('fs');var fs_extra=require(_0xb519('0xb'));var _=require(_0xb519('0xc'));var squel=require(_0xb519('0xd'));var crypto=require(_0xb519('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb519('0xf'));var toCsv=require(_0xb519('0x9'));var querystring=require(_0xb519('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb519('0x11'));var qs=require(_0xb519('0x12'));var as=require(_0xb519('0x13'));var hardwareService=require(_0xb519('0x14'));var logger=require(_0xb519('0x15'))(_0xb519('0x16'));var utils=require(_0xb519('0x17'));var config=require(_0xb519('0x18'));var licenseUtil=require(_0xb519('0x19'));var db=require(_0xb519('0x1a'))['db'];function respondWithStatusCode(_0x3f99a0,_0x17d365){_0x17d365=_0x17d365||0xcc;return function(_0x4dd12a){if(_0x4dd12a){return _0x3f99a0['sendStatus'](_0x17d365);}return _0x3f99a0[_0xb519('0x1b')](_0x17d365)[_0xb519('0x1c')]();};}function respondWithResult(_0x45f63c,_0x34a076){_0x34a076=_0x34a076||0xc8;return function(_0x8e82a3){if(_0x8e82a3){return _0x45f63c[_0xb519('0x1b')](_0x34a076)[_0xb519('0x1d')](_0x8e82a3);}};}function respondWithFilteredResult(_0x276c6f,_0x224200){return function(_0x124965){if(_0x124965){var _0x44a882=typeof _0x224200[_0xb519('0x1e')]===_0xb519('0x1f')&&typeof _0x224200[_0xb519('0x20')]===_0xb519('0x1f');var _0x1258f7=_0x124965[_0xb519('0x21')];var _0x11f96c=_0x44a882?0x0:_0x224200[_0xb519('0x1e')];var _0x35cb95=_0x44a882?_0x124965[_0xb519('0x21')]:_0x224200['offset']+_0x224200[_0xb519('0x20')];var _0x4bf1a9;if(_0x35cb95>=_0x1258f7){_0x35cb95=_0x1258f7;_0x4bf1a9=0xc8;}else{_0x4bf1a9=0xce;}_0x276c6f[_0xb519('0x1b')](_0x4bf1a9);return _0x276c6f[_0xb519('0x22')](_0xb519('0x23'),_0x11f96c+'-'+_0x35cb95+'/'+_0x1258f7)[_0xb519('0x1d')](_0x124965);}return null;};}function patchUpdates(_0x4b4398){return function(_0x4a7e54){try{jsonpatch[_0xb519('0x24')](_0x4a7e54,_0x4b4398,!![]);}catch(_0x970e97){return BPromise[_0xb519('0x25')](_0x970e97);}return _0x4a7e54[_0xb519('0x26')]();};}function saveUpdates(_0x54352a,_0x13a7d1){return function(_0x182842){if(_0x182842){return _0x182842[_0xb519('0x27')](_0x54352a)[_0xb519('0x28')](function(_0xd16956){return _0xd16956;});}return null;};}function removeEntity(_0x251ef5,_0x3d4d0e){return function(_0x2bb354){if(_0x2bb354){return _0x2bb354[_0xb519('0x29')]()[_0xb519('0x28')](function(){var _0x2db1ec=_0x2bb354['get']({'plain':!![]});var _0x2b90b1=_0xb519('0x2a');return db['UserProfileResource'][_0xb519('0x29')]({'where':{'type':_0x2b90b1,'resourceId':_0x2db1ec['id']}})[_0xb519('0x28')](function(){return _0x2bb354;});})['then'](function(){_0x251ef5[_0xb519('0x1b')](0xcc)[_0xb519('0x1c')]();});}};}function handleEntityNotFound(_0x1eceb4,_0x68acef){return function(_0x5da2fb){if(!_0x5da2fb){_0x1eceb4['sendStatus'](0x194);}return _0x5da2fb;};}function handleError(_0x4a1cc4,_0x4e1fd2){_0x4e1fd2=_0x4e1fd2||0x1f4;return function(_0x52e493){logger['error'](_0x52e493['stack']);if(_0x52e493[_0xb519('0x2b')]){delete _0x52e493[_0xb519('0x2b')];}_0x4a1cc4['status'](_0x4e1fd2)[_0xb519('0x2c')](_0x52e493);};}exports[_0xb519('0x2d')]=function(_0x8f29f3,_0x4ecebb){var _0x537143={},_0x29ed43={},_0x5c3892={'count':0x0,'rows':[]};var _0x52f992=_[_0xb519('0x2e')](db['CannedAnswer'][_0xb519('0x2f')],function(_0x54118b){return{'name':_0x54118b[_0xb519('0x30')],'type':_0x54118b['type'][_0xb519('0x31')]};});_0x29ed43[_0xb519('0x32')]=_[_0xb519('0x2e')](_0x52f992,_0xb519('0x2b'));_0x29ed43['query']=_[_0xb519('0x33')](_0x8f29f3['query']);_0x29ed43['filters']=_[_0xb519('0x34')](_0x29ed43[_0xb519('0x32')],_0x29ed43[_0xb519('0x35')]);_0x537143[_0xb519('0x36')]=_['intersection'](_0x29ed43['model'],qs[_0xb519('0x37')](_0x8f29f3[_0xb519('0x35')]['fields']));_0x537143[_0xb519('0x36')]=_0x537143[_0xb519('0x36')][_0xb519('0x38')]?_0x537143[_0xb519('0x36')]:_0x29ed43['model'];if(!_0x8f29f3['query']['hasOwnProperty'](_0xb519('0x39'))){_0x537143[_0xb519('0x20')]=qs[_0xb519('0x20')](_0x8f29f3[_0xb519('0x35')][_0xb519('0x20')]);_0x537143[_0xb519('0x1e')]=qs['offset'](_0x8f29f3[_0xb519('0x35')]['offset']);}_0x537143[_0xb519('0x3a')]=qs[_0xb519('0x3b')](_0x8f29f3['query'][_0xb519('0x3b')]);_0x537143[_0xb519('0x3c')]=qs['filters'](_['pick'](_0x8f29f3[_0xb519('0x35')],_0x29ed43[_0xb519('0x3d')]),_0x52f992);if(_0x8f29f3['query'][_0xb519('0x3e')]){_0x537143['where']=_[_0xb519('0x3f')](_0x537143[_0xb519('0x3c')],{'$or':[{'key':{'$like':'%'+_0x8f29f3[_0xb519('0x35')][_0xb519('0x3e')]+'%'}},{'value':{'$like':'%'+_0x8f29f3[_0xb519('0x35')][_0xb519('0x3e')]+'%'}}]});}_0x537143=_['merge']({},_0x537143,_0x8f29f3[_0xb519('0x40')]);var _0x5030fc={'where':_0x537143[_0xb519('0x3c')]};return db[_0xb519('0x41')]['count'](_0x5030fc)[_0xb519('0x28')](function(_0x255310){_0x5c3892[_0xb519('0x21')]=_0x255310;if(_0x8f29f3[_0xb519('0x35')]['includeAll']){_0x537143[_0xb519('0x42')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb519('0x43')](_0x537143);})[_0xb519('0x28')](function(_0x5f190a){_0x5c3892[_0xb519('0x44')]=_0x5f190a;return _0x5c3892;})[_0xb519('0x28')](respondWithFilteredResult(_0x4ecebb,_0x537143))[_0xb519('0x45')](handleError(_0x4ecebb,null));};exports[_0xb519('0x46')]=function(_0x4d94d9,_0xa5d370){var _0x1c083d={'raw':!![],'where':{'id':_0x4d94d9[_0xb519('0x47')]['id']}},_0x11a4d5={};_0x11a4d5[_0xb519('0x32')]=_['keys'](db['CannedAnswer'][_0xb519('0x2f')]);_0x11a4d5[_0xb519('0x35')]=_[_0xb519('0x33')](_0x4d94d9['query']);_0x11a4d5[_0xb519('0x3d')]=_[_0xb519('0x34')](_0x11a4d5[_0xb519('0x32')],_0x11a4d5[_0xb519('0x35')]);_0x1c083d[_0xb519('0x36')]=_[_0xb519('0x34')](_0x11a4d5[_0xb519('0x32')],qs[_0xb519('0x37')](_0x4d94d9[_0xb519('0x35')][_0xb519('0x37')]));_0x1c083d[_0xb519('0x36')]=_0x1c083d[_0xb519('0x36')][_0xb519('0x38')]?_0x1c083d[_0xb519('0x36')]:_0x11a4d5[_0xb519('0x32')];if(_0x4d94d9[_0xb519('0x35')][_0xb519('0x48')]){_0x1c083d[_0xb519('0x42')]=[{'all':!![]}];}_0x1c083d=_[_0xb519('0x3f')]({},_0x1c083d,_0x4d94d9['options']);return db[_0xb519('0x41')][_0xb519('0x49')](_0x1c083d)[_0xb519('0x28')](handleEntityNotFound(_0xa5d370,null))[_0xb519('0x28')](respondWithResult(_0xa5d370,null))['catch'](handleError(_0xa5d370,null));};exports[_0xb519('0x27')]=function(_0x213c77,_0x259b90){if(_0x213c77['body']['id']){delete _0x213c77[_0xb519('0x4a')]['id'];}return db[_0xb519('0x41')][_0xb519('0x49')]({'where':{'id':_0x213c77[_0xb519('0x47')]['id']}})['then'](handleEntityNotFound(_0x259b90,null))[_0xb519('0x28')](saveUpdates(_0x213c77[_0xb519('0x4a')],null))[_0xb519('0x28')](respondWithResult(_0x259b90,null))[_0xb519('0x45')](handleError(_0x259b90,null));};exports[_0xb519('0x29')]=function(_0x85f790,_0x4b04bc){return db[_0xb519('0x41')][_0xb519('0x49')]({'where':{'id':_0x85f790['params']['id']}})['then'](handleEntityNotFound(_0x4b04bc,null))['then'](removeEntity(_0x4b04bc,null))[_0xb519('0x45')](handleError(_0x4b04bc,null));};exports['create']=function(_0xb028b7,_0xa360c6){var _0x27680f={'key':_0xb028b7[_0xb519('0x4a')][_0xb519('0x31')]};if(_0xb028b7[_0xb519('0x4a')][_0xb519('0x4b')]){_0x27680f['MailAccountId']=_0xb028b7['body'][_0xb519('0x4b')];}else if(_0xb028b7[_0xb519('0x4a')][_0xb519('0x4c')]){_0x27680f[_0xb519('0x4c')]=_0xb028b7['body']['SmsAccountId'];}else if(_0xb028b7[_0xb519('0x4a')][_0xb519('0x4d')]){_0x27680f[_0xb519('0x4d')]=_0xb028b7['body']['OpenchannelAccountId'];}else if(_0xb028b7['body'][_0xb519('0x4e')]){_0x27680f['ChatWebsiteId']=_0xb028b7[_0xb519('0x4a')][_0xb519('0x4e')];}return db[_0xb519('0x41')]['find']({'where':_0x27680f})[_0xb519('0x28')](function(_0x3c0e96){if(_0x3c0e96){throw new db['Sequelize'][(_0xb519('0x4f'))](_0xb519('0x50'));}return db[_0xb519('0x41')]['create'](_0xb028b7[_0xb519('0x4a')]);})[_0xb519('0x28')](function(_0x1afa81){var _0x3221c6=_0xb028b7[_0xb519('0x51')][_0xb519('0x52')]({'plain':!![]});if(!_0x3221c6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3221c6[_0xb519('0x53')]===_0xb519('0x51')){var _0x368165=_0x1afa81[_0xb519('0x52')]({'plain':!![]});return db[_0xb519('0x54')][_0xb519('0x49')]({'where':{'name':_0xb519('0x2a'),'userProfileId':_0x3221c6[_0xb519('0x55')]},'raw':!![]})[_0xb519('0x28')](function(_0x54fd04){if(_0x54fd04&&_0x54fd04['autoAssociation']===0x0){return db['UserProfileResource'][_0xb519('0x56')]({'name':_0x368165[_0xb519('0x2b')],'resourceId':_0x368165['id'],'type':_0x54fd04[_0xb519('0x2b')],'sectionId':_0x54fd04['id']},{})[_0xb519('0x28')](function(){return _0x1afa81;});}else{return _0x1afa81;}})[_0xb519('0x45')](function(_0x166977){logger[_0xb519('0x57')](_0xb519('0x58'),_0x166977);throw _0x166977;});}return _0x1afa81;})[_0xb519('0x28')](respondWithResult(_0xa360c6,0xc9))[_0xb519('0x45')](handleError(_0xa360c6,null));};
\ No newline at end of file
+var _0x79c6=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','json','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','end','error','stack','name','index','map','CannedAnswer','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','pick','filter','merge','where','options','includeAll','include','findAll','rows','catch','show','find','body','params','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x208193,_0x530321){var _0x57cd36=function(_0x57d9f4){while(--_0x57d9f4){_0x208193['push'](_0x208193['shift']());}};_0x57cd36(++_0x530321);}(_0x79c6,0xb1));var _0x679c=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x79c6[_0x411017];return _0x2adeea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x679c('0x0'));var zipdir=require(_0x679c('0x1'));var jsonpatch=require(_0x679c('0x2'));var rp=require(_0x679c('0x3'));var moment=require('moment');var BPromise=require(_0x679c('0x4'));var Mustache=require(_0x679c('0x5'));var util=require(_0x679c('0x6'));var path=require('path');var sox=require(_0x679c('0x7'));var csv=require(_0x679c('0x8'));var ejs=require(_0x679c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x679c('0xa'));var squel=require(_0x679c('0xb'));var crypto=require(_0x679c('0xc'));var jsforce=require(_0x679c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x679c('0x8'));var querystring=require(_0x679c('0xe'));var Papa=require(_0x679c('0xf'));var Redis=require(_0x679c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x679c('0x11'));var as=require(_0x679c('0x12'));var hardwareService=require(_0x679c('0x13'));var logger=require(_0x679c('0x14'))(_0x679c('0x15'));var utils=require(_0x679c('0x16'));var config=require(_0x679c('0x17'));var licenseUtil=require(_0x679c('0x18'));var db=require(_0x679c('0x19'))['db'];function respondWithStatusCode(_0x1c2e04,_0x5da738){_0x5da738=_0x5da738||0xcc;return function(_0x47f311){if(_0x47f311){return _0x1c2e04[_0x679c('0x1a')](_0x5da738);}return _0x1c2e04[_0x679c('0x1b')](_0x5da738)['end']();};}function respondWithResult(_0x37e06e,_0x1430e0){_0x1430e0=_0x1430e0||0xc8;return function(_0x30df63){if(_0x30df63){return _0x37e06e[_0x679c('0x1b')](_0x1430e0)['json'](_0x30df63);}};}function respondWithFilteredResult(_0xf15701,_0x478bb4){return function(_0x582c60){if(_0x582c60){var _0x2bc10e=typeof _0x478bb4['offset']===_0x679c('0x1c')&&typeof _0x478bb4[_0x679c('0x1d')]===_0x679c('0x1c');var _0x24a65a=_0x582c60[_0x679c('0x1e')];var _0x24f946=_0x2bc10e?0x0:_0x478bb4[_0x679c('0x1f')];var _0x508bcf=_0x2bc10e?_0x582c60[_0x679c('0x1e')]:_0x478bb4[_0x679c('0x1f')]+_0x478bb4['limit'];var _0x3e9447;if(_0x508bcf>=_0x24a65a){_0x508bcf=_0x24a65a;_0x3e9447=0xc8;}else{_0x3e9447=0xce;}_0xf15701[_0x679c('0x1b')](_0x3e9447);return _0xf15701[_0x679c('0x20')]('Content-Range',_0x24f946+'-'+_0x508bcf+'/'+_0x24a65a)[_0x679c('0x21')](_0x582c60);}return null;};}function patchUpdates(_0x10b14c){return function(_0x2cc76c){try{jsonpatch['apply'](_0x2cc76c,_0x10b14c,!![]);}catch(_0x457b4d){return BPromise[_0x679c('0x22')](_0x457b4d);}return _0x2cc76c[_0x679c('0x23')]();};}function saveUpdates(_0x421f9c,_0x319c56){return function(_0x2ac9fa){if(_0x2ac9fa){return _0x2ac9fa[_0x679c('0x24')](_0x421f9c)[_0x679c('0x25')](function(_0x11771e){return _0x11771e;});}return null;};}function removeEntity(_0x5aec84,_0x38625c){return function(_0x4e3490){if(_0x4e3490){return _0x4e3490[_0x679c('0x26')]()[_0x679c('0x25')](function(){var _0x3240be=_0x4e3490['get']({'plain':!![]});var _0x299189=_0x679c('0x27');return db[_0x679c('0x28')][_0x679c('0x26')]({'where':{'type':_0x299189,'resourceId':_0x3240be['id']}})[_0x679c('0x25')](function(){return _0x4e3490;});})[_0x679c('0x25')](function(){_0x5aec84[_0x679c('0x1b')](0xcc)[_0x679c('0x29')]();});}};}function handleEntityNotFound(_0x53726e,_0x555a3c){return function(_0x4fe758){if(!_0x4fe758){_0x53726e['sendStatus'](0x194);}return _0x4fe758;};}function handleError(_0x356f69,_0x5f3866){_0x5f3866=_0x5f3866||0x1f4;return function(_0x59a3a8){logger[_0x679c('0x2a')](_0x59a3a8[_0x679c('0x2b')]);if(_0x59a3a8[_0x679c('0x2c')]){delete _0x59a3a8[_0x679c('0x2c')];}_0x356f69[_0x679c('0x1b')](_0x5f3866)['send'](_0x59a3a8);};}exports[_0x679c('0x2d')]=function(_0x18316c,_0x5229e9){var _0x1db4b7={},_0x3838d8={},_0x53a758={'count':0x0,'rows':[]};var _0x4d9734=_[_0x679c('0x2e')](db[_0x679c('0x2f')][_0x679c('0x30')],function(_0x15ff78){return{'name':_0x15ff78[_0x679c('0x31')],'type':_0x15ff78[_0x679c('0x32')]['key']};});_0x3838d8['model']=_['map'](_0x4d9734,_0x679c('0x2c'));_0x3838d8[_0x679c('0x33')]=_[_0x679c('0x34')](_0x18316c[_0x679c('0x33')]);_0x3838d8[_0x679c('0x35')]=_['intersection'](_0x3838d8[_0x679c('0x36')],_0x3838d8[_0x679c('0x33')]);_0x1db4b7[_0x679c('0x37')]=_[_0x679c('0x38')](_0x3838d8[_0x679c('0x36')],qs[_0x679c('0x39')](_0x18316c[_0x679c('0x33')][_0x679c('0x39')]));_0x1db4b7[_0x679c('0x37')]=_0x1db4b7[_0x679c('0x37')][_0x679c('0x3a')]?_0x1db4b7['attributes']:_0x3838d8[_0x679c('0x36')];if(!_0x18316c['query'][_0x679c('0x3b')]('nolimit')){_0x1db4b7[_0x679c('0x1d')]=qs[_0x679c('0x1d')](_0x18316c[_0x679c('0x33')]['limit']);_0x1db4b7[_0x679c('0x1f')]=qs[_0x679c('0x1f')](_0x18316c[_0x679c('0x33')]['offset']);}_0x1db4b7['order']=qs['sort'](_0x18316c[_0x679c('0x33')]['sort']);_0x1db4b7['where']=qs[_0x679c('0x35')](_[_0x679c('0x3c')](_0x18316c[_0x679c('0x33')],_0x3838d8['filters']),_0x4d9734);if(_0x18316c['query'][_0x679c('0x3d')]){_0x1db4b7['where']=_[_0x679c('0x3e')](_0x1db4b7[_0x679c('0x3f')],{'$or':[{'key':{'$like':'%'+_0x18316c[_0x679c('0x33')][_0x679c('0x3d')]+'%'}},{'value':{'$like':'%'+_0x18316c['query']['filter']+'%'}}]});}_0x1db4b7=_[_0x679c('0x3e')]({},_0x1db4b7,_0x18316c[_0x679c('0x40')]);var _0x1fb9d5={'where':_0x1db4b7['where']};return db['CannedAnswer'][_0x679c('0x1e')](_0x1fb9d5)[_0x679c('0x25')](function(_0x461adc){_0x53a758['count']=_0x461adc;if(_0x18316c[_0x679c('0x33')][_0x679c('0x41')]){_0x1db4b7[_0x679c('0x42')]=[{'all':!![]}];}return db[_0x679c('0x2f')][_0x679c('0x43')](_0x1db4b7);})[_0x679c('0x25')](function(_0x109425){_0x53a758[_0x679c('0x44')]=_0x109425;return _0x53a758;})[_0x679c('0x25')](respondWithFilteredResult(_0x5229e9,_0x1db4b7))[_0x679c('0x45')](handleError(_0x5229e9,null));};exports[_0x679c('0x46')]=function(_0x5c127f,_0x9a0277){var _0x5864a8={'raw':!![],'where':{'id':_0x5c127f['params']['id']}},_0x41676c={};_0x41676c[_0x679c('0x36')]=_['keys'](db[_0x679c('0x2f')][_0x679c('0x30')]);_0x41676c[_0x679c('0x33')]=_[_0x679c('0x34')](_0x5c127f[_0x679c('0x33')]);_0x41676c[_0x679c('0x35')]=_[_0x679c('0x38')](_0x41676c[_0x679c('0x36')],_0x41676c[_0x679c('0x33')]);_0x5864a8['attributes']=_['intersection'](_0x41676c[_0x679c('0x36')],qs[_0x679c('0x39')](_0x5c127f[_0x679c('0x33')][_0x679c('0x39')]));_0x5864a8[_0x679c('0x37')]=_0x5864a8[_0x679c('0x37')][_0x679c('0x3a')]?_0x5864a8[_0x679c('0x37')]:_0x41676c[_0x679c('0x36')];if(_0x5c127f[_0x679c('0x33')]['includeAll']){_0x5864a8[_0x679c('0x42')]=[{'all':!![]}];}_0x5864a8=_['merge']({},_0x5864a8,_0x5c127f[_0x679c('0x40')]);return db[_0x679c('0x2f')][_0x679c('0x47')](_0x5864a8)[_0x679c('0x25')](handleEntityNotFound(_0x9a0277,null))[_0x679c('0x25')](respondWithResult(_0x9a0277,null))[_0x679c('0x45')](handleError(_0x9a0277,null));};exports[_0x679c('0x24')]=function(_0x4ae4da,_0x441775){if(_0x4ae4da['body']['id']){delete _0x4ae4da[_0x679c('0x48')]['id'];}return db['CannedAnswer'][_0x679c('0x47')]({'where':{'id':_0x4ae4da[_0x679c('0x49')]['id']}})[_0x679c('0x25')](handleEntityNotFound(_0x441775,null))[_0x679c('0x25')](saveUpdates(_0x4ae4da[_0x679c('0x48')],null))[_0x679c('0x25')](respondWithResult(_0x441775,null))['catch'](handleError(_0x441775,null));};exports['destroy']=function(_0x394855,_0x34f60f){return db[_0x679c('0x2f')]['find']({'where':{'id':_0x394855[_0x679c('0x49')]['id']}})['then'](handleEntityNotFound(_0x34f60f,null))[_0x679c('0x25')](removeEntity(_0x34f60f,null))[_0x679c('0x45')](handleError(_0x34f60f,null));};exports[_0x679c('0x4a')]=function(_0x56324f,_0x1b8b12){var _0x353097={'key':_0x56324f[_0x679c('0x48')][_0x679c('0x4b')]};if(_0x56324f[_0x679c('0x48')][_0x679c('0x4c')]){_0x353097['MailAccountId']=_0x56324f[_0x679c('0x48')][_0x679c('0x4c')];}else if(_0x56324f[_0x679c('0x48')][_0x679c('0x4d')]){_0x353097[_0x679c('0x4d')]=_0x56324f[_0x679c('0x48')][_0x679c('0x4d')];}else if(_0x56324f[_0x679c('0x48')]['OpenchannelAccountId']){_0x353097[_0x679c('0x4e')]=_0x56324f[_0x679c('0x48')][_0x679c('0x4e')];}else if(_0x56324f[_0x679c('0x48')]['ChatWebsiteId']){_0x353097[_0x679c('0x4f')]=_0x56324f[_0x679c('0x48')][_0x679c('0x4f')];}return db['CannedAnswer']['find']({'where':_0x353097})[_0x679c('0x25')](function(_0x236501){if(_0x236501){throw new db[(_0x679c('0x50'))][(_0x679c('0x51'))](_0x679c('0x52'));}return db[_0x679c('0x2f')][_0x679c('0x4a')](_0x56324f[_0x679c('0x48')]);})[_0x679c('0x25')](function(_0x16e963){var _0x351b5b=_0x56324f[_0x679c('0x53')][_0x679c('0x54')]({'plain':!![]});if(!_0x351b5b)throw new Error(_0x679c('0x55'));if(_0x351b5b['role']===_0x679c('0x53')){var _0x4d3d4d=_0x16e963[_0x679c('0x54')]({'plain':!![]});return db[_0x679c('0x56')][_0x679c('0x47')]({'where':{'name':_0x679c('0x27'),'userProfileId':_0x351b5b['userProfileId']},'raw':!![]})['then'](function(_0x2501e4){if(_0x2501e4&&_0x2501e4['autoAssociation']===0x0){return db[_0x679c('0x28')][_0x679c('0x4a')]({'name':_0x4d3d4d[_0x679c('0x2c')],'resourceId':_0x4d3d4d['id'],'type':_0x2501e4[_0x679c('0x2c')],'sectionId':_0x2501e4['id']},{})[_0x679c('0x25')](function(){return _0x16e963;});}else{return _0x16e963;}})[_0x679c('0x45')](function(_0x4cd9c5){logger[_0x679c('0x2a')](_0x679c('0x57'),_0x4cd9c5);throw _0x4cd9c5;});}return _0x16e963;})[_0x679c('0x25')](respondWithResult(_0x1b8b12,0xc9))['catch'](handleError(_0x1b8b12,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 5eefd35..f744545 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 _0x39aa=['moment','bluebird','request-promise','path','rimraf','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x47cd82,_0x526cc0){var _0x32ad55=function(_0x18ca6f){while(--_0x18ca6f){_0x47cd82['push'](_0x47cd82['shift']());}};_0x32ad55(++_0x526cc0);}(_0x39aa,0x11b));var _0xa39a=function(_0x2e846d,_0x370cd6){_0x2e846d=_0x2e846d-0x0;var _0x10a6ab=_0x39aa[_0x2e846d];return _0x10a6ab;};'use strict';var _=require(_0xa39a('0x0'));var util=require(_0xa39a('0x1'));var logger=require('../../config/logger')(_0xa39a('0x2'));var moment=require(_0xa39a('0x3'));var BPromise=require(_0xa39a('0x4'));var rp=require(_0xa39a('0x5'));var fs=require('fs');var path=require(_0xa39a('0x6'));var rimraf=require(_0xa39a('0x7'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x3dba2c,_0x911d67){return _0x3dba2c[_0xa39a('0x8')](_0xa39a('0x9'),attributes,{'tableName':_0xa39a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa39a('0xb'),'collate':_0xa39a('0xc')});};
\ No newline at end of file
+var _0xbefe=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4'];(function(_0x3d8088,_0x59af8b){var _0x1705a6=function(_0x44ef7b){while(--_0x44ef7b){_0x3d8088['push'](_0x3d8088['shift']());}};_0x1705a6(++_0x59af8b);}(_0xbefe,0x168));var _0xebef=function(_0x166b97,_0x2833d5){_0x166b97=_0x166b97-0x0;var _0x4d3c9a=_0xbefe[_0x166b97];return _0x4d3c9a;};'use strict';var _=require('lodash');var util=require(_0xebef('0x0'));var logger=require('../../config/logger')(_0xebef('0x1'));var moment=require(_0xebef('0x2'));var BPromise=require(_0xebef('0x3'));var rp=require(_0xebef('0x4'));var fs=require('fs');var path=require(_0xebef('0x5'));var rimraf=require(_0xebef('0x6'));var config=require(_0xebef('0x7'));var attributes=require(_0xebef('0x8'));module['exports']=function(_0x3fe404,_0x39de80){return _0x3fe404[_0xebef('0x9')]('CannedAnswer',attributes,{'tableName':_0xebef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xebef('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index d8cdc5e..6950705 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(_0x3284fd,_0x547a9e){var _0x506e20=function(_0x26cc53){while(--_0x26cc53){_0x3284fd['push'](_0x3284fd['shift']());}};_0x506e20(++_0x547a9e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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(_0x3b1821,_0x5e44c9){var _0x655316=function(_0x367a6d){while(--_0x367a6d){_0x3b1821['push'](_0x3b1821['shift']());}};_0x655316(++_0x5e44c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 5370a54..09a5497 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 _0x6717=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','destroy','exports','multer'];(function(_0x631c23,_0x3e18bc){var _0x37f536=function(_0x2a0d53){while(--_0x2a0d53){_0x631c23['push'](_0x631c23['shift']());}};_0x37f536(++_0x3e18bc);}(_0x6717,0x1ef));var _0x7671=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6717[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7671('0x0'));var util=require('util');var path=require(_0x7671('0x1'));var timeout=require(_0x7671('0x2'));var express=require('express');var router=express[_0x7671('0x3')]();var fs_extra=require(_0x7671('0x4'));var auth=require(_0x7671('0x5'));var interaction=require(_0x7671('0x6'));var config=require('../../config/environment');var controller=require(_0x7671('0x7'));router[_0x7671('0x8')]('/',auth[_0x7671('0x9')](),controller[_0x7671('0xa')]);router['get'](_0x7671('0xb'),auth[_0x7671('0x9')](),controller[_0x7671('0xc')]);router['post']('/',auth[_0x7671('0x9')](),controller[_0x7671('0xd')]);router['put'](_0x7671('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7671('0xb'),auth[_0x7671('0x9')](),controller[_0x7671('0xe')]);module[_0x7671('0xf')]=router;
\ No newline at end of file
+var _0x9242=['/:id','show','post','create','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','index','get'];(function(_0x48f80a,_0x3bb5d4){var _0x1327fb=function(_0x46293e){while(--_0x46293e){_0x48f80a['push'](_0x48f80a['shift']());}};_0x1327fb(++_0x3bb5d4);}(_0x9242,0x1d0));var _0x2924=function(_0x4b7b69,_0x3ab075){_0x4b7b69=_0x4b7b69-0x0;var _0x173b4c=_0x9242[_0x4b7b69];return _0x173b4c;};'use strict';var multer=require(_0x2924('0x0'));var util=require(_0x2924('0x1'));var path=require(_0x2924('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2924('0x3')]();var fs_extra=require(_0x2924('0x4'));var auth=require(_0x2924('0x5'));var interaction=require(_0x2924('0x6'));var config=require('../../config/environment');var controller=require(_0x2924('0x7'));router['get']('/',auth[_0x2924('0x8')](),controller[_0x2924('0x9')]);router[_0x2924('0xa')](_0x2924('0xb'),auth[_0x2924('0x8')](),controller[_0x2924('0xc')]);router[_0x2924('0xd')]('/',auth[_0x2924('0x8')](),controller[_0x2924('0xe')]);router[_0x2924('0xf')](_0x2924('0xb'),auth['isAuthenticated'](),controller[_0x2924('0x10')]);router[_0x2924('0x11')](_0x2924('0xb'),auth[_0x2924('0x8')](),controller['destroy']);module[_0x2924('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 6a74431..29663d5 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 _0xda1c=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x4c8c4d,_0x170fc3){var _0x7c72d2=function(_0x249fd1){while(--_0x249fd1){_0x4c8c4d['push'](_0x4c8c4d['shift']());}};_0x7c72d2(++_0x170fc3);}(_0xda1c,0x68));var _0xcda1=function(_0x136a97,_0x140d35){_0x136a97=_0x136a97-0x0;var _0x42f478=_0xda1c[_0x136a97];return _0x42f478;};'use strict';var Sequelize=require(_0xcda1('0x0'));module[_0xcda1('0x1')]={'calldate':{'type':Sequelize[_0xcda1('0x2')],'allowNull':![],'defaultValue':_0xcda1('0x3')},'clid':{'type':Sequelize[_0xcda1('0x4')]},'src':{'type':Sequelize[_0xcda1('0x4')]},'dst':{'type':Sequelize[_0xcda1('0x4')]},'dcontext':{'type':Sequelize[_0xcda1('0x4')]},'channel':{'type':Sequelize[_0xcda1('0x4')]},'dstchannel':{'type':Sequelize[_0xcda1('0x4')]},'lastapp':{'type':Sequelize[_0xcda1('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xcda1('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xcda1('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xcda1('0x4')]},'amaflags':{'type':Sequelize[_0xcda1('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xcda1('0x4')]},'userfield':{'type':Sequelize[_0xcda1('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xcda1('0x4')]},'sequence':{'type':Sequelize[_0xcda1('0x4')]},'peeraccount':{'type':Sequelize[_0xcda1('0x4')]},'type':{'type':Sequelize[_0xcda1('0x4')]},'tag':{'type':Sequelize[_0xcda1('0x4')]}};
\ No newline at end of file
+var _0xec81=['INTEGER','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x5f42f1,_0x956be5){var _0x5534ee=function(_0x532333){while(--_0x532333){_0x5f42f1['push'](_0x5f42f1['shift']());}};_0x5534ee(++_0x956be5);}(_0xec81,0x71));var _0x1ec8=function(_0x36d45b,_0x417426){_0x36d45b=_0x36d45b-0x0;var _0x3dc01c=_0xec81[_0x36d45b];return _0x3dc01c;};'use strict';var Sequelize=require('sequelize');module[_0x1ec8('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x1ec8('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x1ec8('0x2')]},'dst':{'type':Sequelize[_0x1ec8('0x2')]},'dcontext':{'type':Sequelize[_0x1ec8('0x2')]},'channel':{'type':Sequelize[_0x1ec8('0x2')]},'dstchannel':{'type':Sequelize[_0x1ec8('0x2')]},'lastapp':{'type':Sequelize[_0x1ec8('0x2')]},'lastdata':{'type':Sequelize[_0x1ec8('0x2')]},'duration':{'type':Sequelize[_0x1ec8('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1ec8('0x2')]},'amaflags':{'type':Sequelize[_0x1ec8('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x1ec8('0x2')]},'uniqueid':{'type':Sequelize[_0x1ec8('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x1ec8('0x2')]},'peeraccount':{'type':Sequelize[_0x1ec8('0x2')]},'type':{'type':Sequelize[_0x1ec8('0x2')]},'tag':{'type':Sequelize[_0x1ec8('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 2860f77..9184faa 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 _0x0e85=['json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','map','Cdr','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end'];(function(_0x1dda71,_0x2bb545){var _0x5f2f56=function(_0x12b250){while(--_0x12b250){_0x1dda71['push'](_0x1dda71['shift']());}};_0x5f2f56(++_0x2bb545);}(_0x0e85,0x7c));var _0x50e8=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x0e85[_0x31a371];return _0x2a5bd6;};'use strict';var emlformat=require(_0x50e8('0x0'));var rimraf=require(_0x50e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50e8('0x2'));var rp=require(_0x50e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x50e8('0x4'));var path=require('path');var sox=require(_0x50e8('0x5'));var csv=require(_0x50e8('0x6'));var ejs=require(_0x50e8('0x7'));var fs=require('fs');var fs_extra=require(_0x50e8('0x8'));var _=require('lodash');var squel=require(_0x50e8('0x9'));var crypto=require(_0x50e8('0xa'));var jsforce=require(_0x50e8('0xb'));var deskjs=require(_0x50e8('0xc'));var toCsv=require(_0x50e8('0x6'));var querystring=require(_0x50e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x50e8('0xe'));var authService=require(_0x50e8('0xf'));var qs=require(_0x50e8('0x10'));var as=require(_0x50e8('0x11'));var hardwareService=require(_0x50e8('0x12'));var logger=require(_0x50e8('0x13'))(_0x50e8('0x14'));var utils=require(_0x50e8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x50e8('0x16'))['db'];function respondWithStatusCode(_0x24d381,_0x508377){_0x508377=_0x508377||0xcc;return function(_0x49e02f){if(_0x49e02f){return _0x24d381[_0x50e8('0x17')](_0x508377);}return _0x24d381[_0x50e8('0x18')](_0x508377)[_0x50e8('0x19')]();};}function respondWithResult(_0x473aa7,_0x54efd3){_0x54efd3=_0x54efd3||0xc8;return function(_0x18596f){if(_0x18596f){return _0x473aa7[_0x50e8('0x18')](_0x54efd3)[_0x50e8('0x1a')](_0x18596f);}};}function respondWithFilteredResult(_0x5c3baa,_0x5524a3){return function(_0x30a872){if(_0x30a872){var _0xf02b48=typeof _0x5524a3[_0x50e8('0x1b')]===_0x50e8('0x1c')&&typeof _0x5524a3[_0x50e8('0x1d')]===_0x50e8('0x1c');var _0x5642bf=_0x30a872['count'];var _0x441f25=_0xf02b48?0x0:_0x5524a3[_0x50e8('0x1b')];var _0x40d060=_0xf02b48?_0x30a872[_0x50e8('0x1e')]:_0x5524a3[_0x50e8('0x1b')]+_0x5524a3[_0x50e8('0x1d')];var _0x1a451d;if(_0x40d060>=_0x5642bf){_0x40d060=_0x5642bf;_0x1a451d=0xc8;}else{_0x1a451d=0xce;}_0x5c3baa['status'](_0x1a451d);return _0x5c3baa[_0x50e8('0x1f')]('Content-Range',_0x441f25+'-'+_0x40d060+'/'+_0x5642bf)[_0x50e8('0x1a')](_0x30a872);}return null;};}function patchUpdates(_0xe04a5c){return function(_0xd263d){try{jsonpatch[_0x50e8('0x20')](_0xd263d,_0xe04a5c,!![]);}catch(_0x46af8e){return BPromise['reject'](_0x46af8e);}return _0xd263d[_0x50e8('0x21')]();};}function saveUpdates(_0x1e4e0d,_0x58110d){return function(_0x31d23c){if(_0x31d23c){return _0x31d23c[_0x50e8('0x22')](_0x1e4e0d)['then'](function(_0x1ce7fc){return _0x1ce7fc;});}return null;};}function removeEntity(_0xe7e56c,_0x4f56b7){return function(_0x47a3d8){if(_0x47a3d8){return _0x47a3d8['destroy']()[_0x50e8('0x23')](function(){_0xe7e56c[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();});}};}function handleEntityNotFound(_0x371a1f,_0xc2f832){return function(_0x13b6e9){if(!_0x13b6e9){_0x371a1f['sendStatus'](0x194);}return _0x13b6e9;};}function handleError(_0x3a6442,_0x396611){_0x396611=_0x396611||0x1f4;return function(_0x4b3a09){logger[_0x50e8('0x24')](_0x4b3a09[_0x50e8('0x25')]);if(_0x4b3a09[_0x50e8('0x26')]){delete _0x4b3a09[_0x50e8('0x26')];}_0x3a6442['status'](_0x396611)[_0x50e8('0x27')](_0x4b3a09);};}exports['index']=function(_0x30fedf,_0x39c0c6){var _0x42bbef={},_0x4f0b88={},_0x1041b9={'count':0x0,'rows':[]};var _0x126c99=_[_0x50e8('0x28')](db[_0x50e8('0x29')][_0x50e8('0x2a')],function(_0x18aa31){return{'name':_0x18aa31[_0x50e8('0x2b')],'type':_0x18aa31['type'][_0x50e8('0x2c')]};});_0x4f0b88[_0x50e8('0x2d')]=_['map'](_0x126c99,'name');_0x4f0b88[_0x50e8('0x2e')]=_[_0x50e8('0x2f')](_0x30fedf[_0x50e8('0x2e')]);_0x4f0b88['filters']=_['intersection'](_0x4f0b88[_0x50e8('0x2d')],_0x4f0b88[_0x50e8('0x2e')]);_0x42bbef['attributes']=_[_0x50e8('0x30')](_0x4f0b88[_0x50e8('0x2d')],qs[_0x50e8('0x31')](_0x30fedf[_0x50e8('0x2e')]['fields']));_0x42bbef[_0x50e8('0x32')]=_0x42bbef['attributes'][_0x50e8('0x33')]?_0x42bbef[_0x50e8('0x32')]:_0x4f0b88[_0x50e8('0x2d')];if(!_0x30fedf['query'][_0x50e8('0x34')](_0x50e8('0x35'))){_0x42bbef['limit']=qs[_0x50e8('0x1d')](_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x1d')]);_0x42bbef[_0x50e8('0x1b')]=qs['offset'](_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x1b')]);}_0x42bbef[_0x50e8('0x36')]=qs[_0x50e8('0x37')](_0x30fedf['query'][_0x50e8('0x37')]);_0x42bbef[_0x50e8('0x38')]=qs[_0x50e8('0x39')](_['pick'](_0x30fedf['query'],_0x4f0b88['filters']),_0x126c99);if(_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x3a')]){_0x42bbef[_0x50e8('0x38')]=_[_0x50e8('0x3b')](_0x42bbef[_0x50e8('0x38')],{'$or':_[_0x50e8('0x28')](_0x126c99,function(_0xb566c2){if(_0xb566c2[_0x50e8('0x3c')]!==_0x50e8('0x3d')){var _0x3a1b4d={};_0x3a1b4d[_0xb566c2['name']]={'$like':'%'+_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x3a')]+'%'};return _0x3a1b4d;}})});}_0x42bbef=_[_0x50e8('0x3b')]({},_0x42bbef,_0x30fedf[_0x50e8('0x3e')]);var _0x5dbbe1={'where':_0x42bbef[_0x50e8('0x38')]};return db[_0x50e8('0x29')][_0x50e8('0x1e')](_0x5dbbe1)[_0x50e8('0x23')](function(_0x8e8a97){_0x1041b9['count']=_0x8e8a97;if(_0x30fedf['query'][_0x50e8('0x3f')]){_0x42bbef[_0x50e8('0x40')]=[{'all':!![]}];}return db['Cdr'][_0x50e8('0x41')](_0x42bbef);})[_0x50e8('0x23')](function(_0x3db1ab){_0x1041b9[_0x50e8('0x42')]=_0x3db1ab;return _0x1041b9;})[_0x50e8('0x23')](respondWithFilteredResult(_0x39c0c6,_0x42bbef))[_0x50e8('0x43')](handleError(_0x39c0c6,null));};exports[_0x50e8('0x44')]=function(_0x172049,_0x5e9da3){var _0x3d26bd={'raw':!![],'where':{'id':_0x172049[_0x50e8('0x45')]['id']}},_0x44e0ca={};_0x44e0ca[_0x50e8('0x2d')]=_['keys'](db[_0x50e8('0x29')][_0x50e8('0x2a')]);_0x44e0ca[_0x50e8('0x2e')]=_[_0x50e8('0x2f')](_0x172049['query']);_0x44e0ca[_0x50e8('0x39')]=_['intersection'](_0x44e0ca['model'],_0x44e0ca['query']);_0x3d26bd[_0x50e8('0x32')]=_[_0x50e8('0x30')](_0x44e0ca['model'],qs[_0x50e8('0x31')](_0x172049[_0x50e8('0x2e')][_0x50e8('0x31')]));_0x3d26bd[_0x50e8('0x32')]=_0x3d26bd[_0x50e8('0x32')][_0x50e8('0x33')]?_0x3d26bd['attributes']:_0x44e0ca[_0x50e8('0x2d')];if(_0x172049['query'][_0x50e8('0x3f')]){_0x3d26bd[_0x50e8('0x40')]=[{'all':!![]}];}_0x3d26bd=_['merge']({},_0x3d26bd,_0x172049[_0x50e8('0x3e')]);return db['Cdr'][_0x50e8('0x46')](_0x3d26bd)[_0x50e8('0x23')](handleEntityNotFound(_0x5e9da3,null))[_0x50e8('0x23')](respondWithResult(_0x5e9da3,null))[_0x50e8('0x43')](handleError(_0x5e9da3,null));};exports[_0x50e8('0x47')]=function(_0x3f72ea,_0x229d60){return db[_0x50e8('0x29')][_0x50e8('0x47')](_0x3f72ea[_0x50e8('0x48')],{})[_0x50e8('0x23')](respondWithResult(_0x229d60,0xc9))['catch'](handleError(_0x229d60,null));};exports[_0x50e8('0x22')]=function(_0x275a1b,_0x479431){if(_0x275a1b[_0x50e8('0x48')]['id']){delete _0x275a1b['body']['id'];}return db[_0x50e8('0x29')]['find']({'where':{'id':_0x275a1b[_0x50e8('0x45')]['id']}})[_0x50e8('0x23')](handleEntityNotFound(_0x479431,null))[_0x50e8('0x23')](saveUpdates(_0x275a1b[_0x50e8('0x48')],null))[_0x50e8('0x23')](respondWithResult(_0x479431,null))[_0x50e8('0x43')](handleError(_0x479431,null));};exports[_0x50e8('0x49')]=function(_0x5f256a,_0x3410f3){return db[_0x50e8('0x29')][_0x50e8('0x46')]({'where':{'id':_0x5f256a[_0x50e8('0x45')]['id']}})[_0x50e8('0x23')](handleEntityNotFound(_0x3410f3,null))[_0x50e8('0x23')](removeEntity(_0x3410f3,null))['catch'](handleError(_0x3410f3,null));};exports[_0x50e8('0x4a')]=function(_0x250b28,_0xff2e24){return db[_0x50e8('0x29')]['describe']()[_0x50e8('0x23')](respondWithResult(_0xff2e24,null))[_0x50e8('0x43')](handleError(_0xff2e24,null));};
\ No newline at end of file
+var _0x9206=['crypto','jsforce','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','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','Cdr','fieldName','key','model','map','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','findAll','catch','show','params','length','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','lodash','squel'];(function(_0x51684f,_0x4f2d0d){var _0x3480ff=function(_0x58dda5){while(--_0x58dda5){_0x51684f['push'](_0x51684f['shift']());}};_0x3480ff(++_0x4f2d0d);}(_0x9206,0x176));var _0x6920=function(_0x1b2bad,_0x390b93){_0x1b2bad=_0x1b2bad-0x0;var _0x1c83ed=_0x9206[_0x1b2bad];return _0x1c83ed;};'use strict';var emlformat=require(_0x6920('0x0'));var rimraf=require(_0x6920('0x1'));var zipdir=require(_0x6920('0x2'));var jsonpatch=require(_0x6920('0x3'));var rp=require(_0x6920('0x4'));var moment=require(_0x6920('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6920('0x6'));var path=require(_0x6920('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6920('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6920('0x9'));var squel=require(_0x6920('0xa'));var crypto=require(_0x6920('0xb'));var jsforce=require(_0x6920('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6920('0xd'));var Papa=require(_0x6920('0xe'));var Redis=require(_0x6920('0xf'));var authService=require(_0x6920('0x10'));var qs=require(_0x6920('0x11'));var as=require(_0x6920('0x12'));var hardwareService=require(_0x6920('0x13'));var logger=require(_0x6920('0x14'))(_0x6920('0x15'));var utils=require(_0x6920('0x16'));var config=require(_0x6920('0x17'));var licenseUtil=require(_0x6920('0x18'));var db=require(_0x6920('0x19'))['db'];function respondWithStatusCode(_0x5ad438,_0x4f8430){_0x4f8430=_0x4f8430||0xcc;return function(_0x31730c){if(_0x31730c){return _0x5ad438[_0x6920('0x1a')](_0x4f8430);}return _0x5ad438['status'](_0x4f8430)[_0x6920('0x1b')]();};}function respondWithResult(_0xfa2823,_0x18140a){_0x18140a=_0x18140a||0xc8;return function(_0x2c3a35){if(_0x2c3a35){return _0xfa2823[_0x6920('0x1c')](_0x18140a)['json'](_0x2c3a35);}};}function respondWithFilteredResult(_0x338e5f,_0x20cdfb){return function(_0x15d8af){if(_0x15d8af){var _0xa64034=typeof _0x20cdfb[_0x6920('0x1d')]===_0x6920('0x1e')&&typeof _0x20cdfb[_0x6920('0x1f')]===_0x6920('0x1e');var _0x11ce91=_0x15d8af[_0x6920('0x20')];var _0x462500=_0xa64034?0x0:_0x20cdfb[_0x6920('0x1d')];var _0xc6e86b=_0xa64034?_0x15d8af[_0x6920('0x20')]:_0x20cdfb[_0x6920('0x1d')]+_0x20cdfb['limit'];var _0x3a0c0c;if(_0xc6e86b>=_0x11ce91){_0xc6e86b=_0x11ce91;_0x3a0c0c=0xc8;}else{_0x3a0c0c=0xce;}_0x338e5f[_0x6920('0x1c')](_0x3a0c0c);return _0x338e5f[_0x6920('0x21')](_0x6920('0x22'),_0x462500+'-'+_0xc6e86b+'/'+_0x11ce91)[_0x6920('0x23')](_0x15d8af);}return null;};}function patchUpdates(_0x16cb96){return function(_0x2cce0b){try{jsonpatch[_0x6920('0x24')](_0x2cce0b,_0x16cb96,!![]);}catch(_0xaf93ba){return BPromise[_0x6920('0x25')](_0xaf93ba);}return _0x2cce0b[_0x6920('0x26')]();};}function saveUpdates(_0x39013e,_0x1df372){return function(_0x2dd788){if(_0x2dd788){return _0x2dd788[_0x6920('0x27')](_0x39013e)[_0x6920('0x28')](function(_0x1ae686){return _0x1ae686;});}return null;};}function removeEntity(_0x3a6e48,_0xa8f55){return function(_0x258986){if(_0x258986){return _0x258986['destroy']()[_0x6920('0x28')](function(){_0x3a6e48['status'](0xcc)[_0x6920('0x1b')]();});}};}function handleEntityNotFound(_0x4dd08b,_0x72316a){return function(_0x32a6ae){if(!_0x32a6ae){_0x4dd08b[_0x6920('0x1a')](0x194);}return _0x32a6ae;};}function handleError(_0xd069c,_0x5868e1){_0x5868e1=_0x5868e1||0x1f4;return function(_0x1cab00){logger[_0x6920('0x29')](_0x1cab00[_0x6920('0x2a')]);if(_0x1cab00[_0x6920('0x2b')]){delete _0x1cab00[_0x6920('0x2b')];}_0xd069c[_0x6920('0x1c')](_0x5868e1)[_0x6920('0x2c')](_0x1cab00);};}exports[_0x6920('0x2d')]=function(_0x400894,_0x2f5ce8){var _0x6860c7={},_0x2b2cd9={},_0x548fbc={'count':0x0,'rows':[]};var _0x182f1b=_['map'](db[_0x6920('0x2e')]['rawAttributes'],function(_0x31aa90){return{'name':_0x31aa90[_0x6920('0x2f')],'type':_0x31aa90['type'][_0x6920('0x30')]};});_0x2b2cd9[_0x6920('0x31')]=_[_0x6920('0x32')](_0x182f1b,'name');_0x2b2cd9['query']=_[_0x6920('0x33')](_0x400894['query']);_0x2b2cd9['filters']=_[_0x6920('0x34')](_0x2b2cd9[_0x6920('0x31')],_0x2b2cd9[_0x6920('0x35')]);_0x6860c7[_0x6920('0x36')]=_[_0x6920('0x34')](_0x2b2cd9[_0x6920('0x31')],qs[_0x6920('0x37')](_0x400894['query'][_0x6920('0x37')]));_0x6860c7['attributes']=_0x6860c7[_0x6920('0x36')]['length']?_0x6860c7['attributes']:_0x2b2cd9[_0x6920('0x31')];if(!_0x400894[_0x6920('0x35')][_0x6920('0x38')](_0x6920('0x39'))){_0x6860c7[_0x6920('0x1f')]=qs[_0x6920('0x1f')](_0x400894[_0x6920('0x35')][_0x6920('0x1f')]);_0x6860c7[_0x6920('0x1d')]=qs[_0x6920('0x1d')](_0x400894[_0x6920('0x35')][_0x6920('0x1d')]);}_0x6860c7['order']=qs[_0x6920('0x3a')](_0x400894['query'][_0x6920('0x3a')]);_0x6860c7[_0x6920('0x3b')]=qs[_0x6920('0x3c')](_['pick'](_0x400894[_0x6920('0x35')],_0x2b2cd9[_0x6920('0x3c')]),_0x182f1b);if(_0x400894[_0x6920('0x35')][_0x6920('0x3d')]){_0x6860c7['where']=_[_0x6920('0x3e')](_0x6860c7[_0x6920('0x3b')],{'$or':_['map'](_0x182f1b,function(_0x49be52){if(_0x49be52[_0x6920('0x3f')]!==_0x6920('0x40')){var _0x56ca8f={};_0x56ca8f[_0x49be52[_0x6920('0x2b')]]={'$like':'%'+_0x400894[_0x6920('0x35')]['filter']+'%'};return _0x56ca8f;}})});}_0x6860c7=_['merge']({},_0x6860c7,_0x400894[_0x6920('0x41')]);var _0x1f0c5f={'where':_0x6860c7[_0x6920('0x3b')]};return db[_0x6920('0x2e')][_0x6920('0x20')](_0x1f0c5f)['then'](function(_0x58f0e8){_0x548fbc['count']=_0x58f0e8;if(_0x400894[_0x6920('0x35')]['includeAll']){_0x6860c7['include']=[{'all':!![]}];}return db[_0x6920('0x2e')][_0x6920('0x42')](_0x6860c7);})['then'](function(_0x3aad11){_0x548fbc['rows']=_0x3aad11;return _0x548fbc;})[_0x6920('0x28')](respondWithFilteredResult(_0x2f5ce8,_0x6860c7))[_0x6920('0x43')](handleError(_0x2f5ce8,null));};exports[_0x6920('0x44')]=function(_0x1b3ebb,_0x3a994d){var _0x55d7b5={'raw':!![],'where':{'id':_0x1b3ebb[_0x6920('0x45')]['id']}},_0x4dfa0c={};_0x4dfa0c['model']=_['keys'](db['Cdr']['rawAttributes']);_0x4dfa0c[_0x6920('0x35')]=_[_0x6920('0x33')](_0x1b3ebb[_0x6920('0x35')]);_0x4dfa0c['filters']=_[_0x6920('0x34')](_0x4dfa0c[_0x6920('0x31')],_0x4dfa0c[_0x6920('0x35')]);_0x55d7b5[_0x6920('0x36')]=_[_0x6920('0x34')](_0x4dfa0c[_0x6920('0x31')],qs['fields'](_0x1b3ebb[_0x6920('0x35')][_0x6920('0x37')]));_0x55d7b5[_0x6920('0x36')]=_0x55d7b5[_0x6920('0x36')][_0x6920('0x46')]?_0x55d7b5[_0x6920('0x36')]:_0x4dfa0c[_0x6920('0x31')];if(_0x1b3ebb[_0x6920('0x35')][_0x6920('0x47')]){_0x55d7b5[_0x6920('0x48')]=[{'all':!![]}];}_0x55d7b5=_[_0x6920('0x3e')]({},_0x55d7b5,_0x1b3ebb[_0x6920('0x41')]);return db['Cdr'][_0x6920('0x49')](_0x55d7b5)[_0x6920('0x28')](handleEntityNotFound(_0x3a994d,null))['then'](respondWithResult(_0x3a994d,null))['catch'](handleError(_0x3a994d,null));};exports[_0x6920('0x4a')]=function(_0x3c231e,_0x20fab4){return db[_0x6920('0x2e')][_0x6920('0x4a')](_0x3c231e['body'],{})[_0x6920('0x28')](respondWithResult(_0x20fab4,0xc9))[_0x6920('0x43')](handleError(_0x20fab4,null));};exports[_0x6920('0x27')]=function(_0x51b12d,_0x4d1c79){if(_0x51b12d[_0x6920('0x4b')]['id']){delete _0x51b12d[_0x6920('0x4b')]['id'];}return db[_0x6920('0x2e')][_0x6920('0x49')]({'where':{'id':_0x51b12d['params']['id']}})[_0x6920('0x28')](handleEntityNotFound(_0x4d1c79,null))[_0x6920('0x28')](saveUpdates(_0x51b12d[_0x6920('0x4b')],null))[_0x6920('0x28')](respondWithResult(_0x4d1c79,null))[_0x6920('0x43')](handleError(_0x4d1c79,null));};exports['destroy']=function(_0x1c0dd9,_0x3fe81d){return db[_0x6920('0x2e')][_0x6920('0x49')]({'where':{'id':_0x1c0dd9[_0x6920('0x45')]['id']}})[_0x6920('0x28')](handleEntityNotFound(_0x3fe81d,null))[_0x6920('0x28')](removeEntity(_0x3fe81d,null))[_0x6920('0x43')](handleError(_0x3fe81d,null));};exports[_0x6920('0x4c')]=function(_0x1c6bba,_0x492a02){return db[_0x6920('0x2e')][_0x6920('0x4c')]()[_0x6920('0x28')](respondWithResult(_0x492a02,null))[_0x6920('0x43')](handleError(_0x492a02,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index ec10ab3..af9f16f 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3b49ee,_0x4c25f5){var _0x3e07b5=function(_0x38bed4){while(--_0x38bed4){_0x3b49ee['push'](_0x3b49ee['shift']());}};_0x3e07b5(++_0x4c25f5);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x5c1c40,_0x17c487){var _0x52f178=function(_0x8ec80e){while(--_0x8ec80e){_0x5c1c40['push'](_0x5c1c40['shift']());}};_0x52f178(++_0x17c487);}(_0x7a54,0x106));var _0x47a5=function(_0x414bd8,_0x18bdea){_0x414bd8=_0x414bd8-0x0;var _0x41a067=_0x7a54[_0x414bd8];return _0x41a067;};'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 eb3b12e..90fae90 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 _0xe852=['info','request\x20sent','debug','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xe852,0x15a));var _0x2e85=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xe852[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x2e85('0x0'));var util=require(_0x2e85('0x1'));var moment=require('moment');var BPromise=require(_0x2e85('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2e85('0x3'));var logger=require(_0x2e85('0x4'))(_0x2e85('0x5'));var config=require(_0x2e85('0x6'));var jayson=require(_0x2e85('0x7'));var client=jayson[_0x2e85('0x8')][_0x2e85('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8907ba,_0x3778ad,_0x388fd6){return new BPromise(function(_0x520552,_0x2efc7c){return client[_0x2e85('0xa')](_0x8907ba,_0x388fd6)['then'](function(_0x2f7237){logger[_0x2e85('0xb')]('Cdr,\x20%s,\x20%s',_0x3778ad,_0x2e85('0xc'));logger[_0x2e85('0xd')]('Cdr,\x20%s,\x20%s,\x20%s',_0x3778ad,'request\x20sent',JSON[_0x2e85('0xe')](_0x2f7237));if(_0x2f7237[_0x2e85('0xf')]){if(_0x2f7237[_0x2e85('0xf')][_0x2e85('0x10')]===0x1f4){logger['error'](_0x2e85('0x11'),_0x3778ad,_0x2f7237['error'][_0x2e85('0x12')]);return _0x2efc7c(_0x2f7237[_0x2e85('0xf')][_0x2e85('0x12')]);}logger[_0x2e85('0xf')](_0x2e85('0x11'),_0x3778ad,_0x2f7237[_0x2e85('0xf')][_0x2e85('0x12')]);return _0x520552(_0x2f7237[_0x2e85('0xf')][_0x2e85('0x12')]);}else{logger[_0x2e85('0xb')]('Cdr,\x20%s,\x20%s',_0x3778ad,_0x2e85('0xc'));_0x520552(_0x2f7237[_0x2e85('0x13')][_0x2e85('0x12')]);}})[_0x2e85('0x14')](function(_0x18004d){logger[_0x2e85('0xf')](_0x2e85('0x11'),_0x3778ad,_0x18004d);_0x2efc7c(_0x18004d);});});}
\ No newline at end of file
+var _0xaeb6=['http','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','Cdr,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x18ac87,_0x1b2c42){var _0x574f01=function(_0x391bd2){while(--_0x391bd2){_0x18ac87['push'](_0x18ac87['shift']());}};_0x574f01(++_0x1b2c42);}(_0xaeb6,0x8e));var _0x6aeb=function(_0xcadf94,_0x548852){_0xcadf94=_0xcadf94-0x0;var _0x53a2c3=_0xaeb6[_0xcadf94];return _0x53a2c3;};'use strict';var _=require(_0x6aeb('0x0'));var util=require(_0x6aeb('0x1'));var moment=require(_0x6aeb('0x2'));var BPromise=require(_0x6aeb('0x3'));var rs=require(_0x6aeb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6aeb('0x5'));var logger=require(_0x6aeb('0x6'))(_0x6aeb('0x7'));var config=require('../../config/environment');var jayson=require(_0x6aeb('0x8'));var client=jayson[_0x6aeb('0x9')][_0x6aeb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59ea3d,_0x5005b4,_0x475585){return new BPromise(function(_0x40f7fa,_0x1c6f88){return client['request'](_0x59ea3d,_0x475585)['then'](function(_0x57cf66){logger[_0x6aeb('0xb')]('Cdr,\x20%s,\x20%s',_0x5005b4,_0x6aeb('0xc'));logger[_0x6aeb('0xd')](_0x6aeb('0xe'),_0x5005b4,_0x6aeb('0xc'),JSON['stringify'](_0x57cf66));if(_0x57cf66['error']){if(_0x57cf66[_0x6aeb('0xf')][_0x6aeb('0x10')]===0x1f4){logger[_0x6aeb('0xf')](_0x6aeb('0x11'),_0x5005b4,_0x57cf66['error'][_0x6aeb('0x12')]);return _0x1c6f88(_0x57cf66[_0x6aeb('0xf')][_0x6aeb('0x12')]);}logger[_0x6aeb('0xf')](_0x6aeb('0x11'),_0x5005b4,_0x57cf66['error'][_0x6aeb('0x12')]);return _0x40f7fa(_0x57cf66['error'][_0x6aeb('0x12')]);}else{logger[_0x6aeb('0xb')](_0x6aeb('0x11'),_0x5005b4,_0x6aeb('0xc'));_0x40f7fa(_0x57cf66['result'][_0x6aeb('0x12')]);}})['catch'](function(_0x5a9111){logger['error'](_0x6aeb('0x11'),_0x5005b4,_0x5a9111);_0x1c6f88(_0x5a9111);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index c3ee563..6b9ad1c 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x437ea9,_0x55c4cd){var _0x5c04b4=function(_0x8d7a4a){while(--_0x8d7a4a){_0x437ea9['push'](_0x437ea9['shift']());}};_0x5c04b4(++_0x55c4cd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x36d45b,_0x417426){var _0x3dc01c=function(_0x37d04b){while(--_0x37d04b){_0x36d45b['push'](_0x36d45b['shift']());}};_0x3dc01c(++_0x417426);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index cabdbdd..f5b6516 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 _0x874b=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0x874b,0x147));var _0xb874=function(_0x9166ea,_0x1f21b0){_0x9166ea=_0x9166ea-0x0;var _0xdceec9=_0x874b[_0x9166ea];return _0xdceec9;};'use strict';var Sequelize=require(_0xb874('0x0'));module[_0xb874('0x1')]={'priority':{'type':Sequelize[_0xb874('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb874('0x3')]()},'description':{'type':Sequelize[_0xb874('0x4')]},'interval':{'type':Sequelize[_0xb874('0x4')],'defaultValue':_0xb874('0x5')}};
\ No newline at end of file
+var _0x403a=['*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x403a,0x1c8));var _0xa403=function(_0x3ccdf8,_0x584ceb){_0x3ccdf8=_0x3ccdf8-0x0;var _0x243dab=_0x403a[_0x3ccdf8];return _0x243dab;};'use strict';var Sequelize=require(_0xa403('0x0'));module[_0xa403('0x1')]={'priority':{'type':Sequelize[_0xa403('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xa403('0x3')],'defaultValue':_0xa403('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index f6590ca..0011a70 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 _0xdb76=['Content-Range','apply','reject','save','then','destroy','end','error','stack','send','show','params','model','ChatApplication','query','keys','filters','attributes','intersection','fields','length','includeAll','merge','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x2a033e,_0x150109){var _0xed1d3c=function(_0x5e8c88){while(--_0x5e8c88){_0x2a033e['push'](_0x2a033e['shift']());}};_0xed1d3c(++_0x150109);}(_0xdb76,0x1be));var _0x6db7=function(_0x3de5ab,_0x40a1d8){_0x3de5ab=_0x3de5ab-0x0;var _0x28be50=_0xdb76[_0x3de5ab];return _0x28be50;};'use strict';var emlformat=require(_0x6db7('0x0'));var rimraf=require(_0x6db7('0x1'));var zipdir=require(_0x6db7('0x2'));var jsonpatch=require(_0x6db7('0x3'));var rp=require(_0x6db7('0x4'));var moment=require('moment');var BPromise=require(_0x6db7('0x5'));var Mustache=require(_0x6db7('0x6'));var util=require(_0x6db7('0x7'));var path=require(_0x6db7('0x8'));var sox=require('sox');var csv=require(_0x6db7('0x9'));var ejs=require(_0x6db7('0xa'));var fs=require('fs');var fs_extra=require(_0x6db7('0xb'));var _=require(_0x6db7('0xc'));var squel=require(_0x6db7('0xd'));var crypto=require('crypto');var jsforce=require(_0x6db7('0xe'));var deskjs=require(_0x6db7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6db7('0x10'));var Papa=require(_0x6db7('0x11'));var Redis=require(_0x6db7('0x12'));var authService=require(_0x6db7('0x13'));var qs=require(_0x6db7('0x14'));var as=require(_0x6db7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6db7('0x16'));var utils=require(_0x6db7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6db7('0x18'));var db=require(_0x6db7('0x19'))['db'];function respondWithStatusCode(_0x421d28,_0x1658dd){_0x1658dd=_0x1658dd||0xcc;return function(_0x375f4a){if(_0x375f4a){return _0x421d28[_0x6db7('0x1a')](_0x1658dd);}return _0x421d28['status'](_0x1658dd)['end']();};}function respondWithResult(_0x426d31,_0x348ccf){_0x348ccf=_0x348ccf||0xc8;return function(_0x167384){if(_0x167384){return _0x426d31[_0x6db7('0x1b')](_0x348ccf)[_0x6db7('0x1c')](_0x167384);}};}function respondWithFilteredResult(_0x28dd67,_0x144684){return function(_0x43f66c){if(_0x43f66c){var _0x1432ac=typeof _0x144684[_0x6db7('0x1d')]===_0x6db7('0x1e')&&typeof _0x144684[_0x6db7('0x1f')]==='undefined';var _0x3c97b2=_0x43f66c[_0x6db7('0x20')];var _0x331e92=_0x1432ac?0x0:_0x144684[_0x6db7('0x1d')];var _0x37ffe3=_0x1432ac?_0x43f66c[_0x6db7('0x20')]:_0x144684[_0x6db7('0x1d')]+_0x144684[_0x6db7('0x1f')];var _0x3f8575;if(_0x37ffe3>=_0x3c97b2){_0x37ffe3=_0x3c97b2;_0x3f8575=0xc8;}else{_0x3f8575=0xce;}_0x28dd67[_0x6db7('0x1b')](_0x3f8575);return _0x28dd67[_0x6db7('0x21')](_0x6db7('0x22'),_0x331e92+'-'+_0x37ffe3+'/'+_0x3c97b2)['json'](_0x43f66c);}return null;};}function patchUpdates(_0x1cae66){return function(_0x206aa2){try{jsonpatch[_0x6db7('0x23')](_0x206aa2,_0x1cae66,!![]);}catch(_0x46a383){return BPromise[_0x6db7('0x24')](_0x46a383);}return _0x206aa2[_0x6db7('0x25')]();};}function saveUpdates(_0x4a78f7,_0x1b0f04){return function(_0x2795ab){if(_0x2795ab){return _0x2795ab['update'](_0x4a78f7)[_0x6db7('0x26')](function(_0x1ba956){return _0x1ba956;});}return null;};}function removeEntity(_0x7ca54f,_0x48e3af){return function(_0x24d818){if(_0x24d818){return _0x24d818[_0x6db7('0x27')]()['then'](function(){_0x7ca54f[_0x6db7('0x1b')](0xcc)[_0x6db7('0x28')]();});}};}function handleEntityNotFound(_0x2d6fca,_0x558d58){return function(_0x559e14){if(!_0x559e14){_0x2d6fca[_0x6db7('0x1a')](0x194);}return _0x559e14;};}function handleError(_0x105b81,_0xdbd9f1){_0xdbd9f1=_0xdbd9f1||0x1f4;return function(_0x4f28e9){logger[_0x6db7('0x29')](_0x4f28e9[_0x6db7('0x2a')]);if(_0x4f28e9['name']){delete _0x4f28e9['name'];}_0x105b81[_0x6db7('0x1b')](_0xdbd9f1)[_0x6db7('0x2b')](_0x4f28e9);};}exports[_0x6db7('0x2c')]=function(_0x3890f0,_0x11185d){var _0xc4f615={'raw':!![],'where':{'id':_0x3890f0[_0x6db7('0x2d')]['id']}},_0x4fb6dd={};_0x4fb6dd[_0x6db7('0x2e')]=_['keys'](db[_0x6db7('0x2f')]['rawAttributes']);_0x4fb6dd[_0x6db7('0x30')]=_[_0x6db7('0x31')](_0x3890f0[_0x6db7('0x30')]);_0x4fb6dd[_0x6db7('0x32')]=_['intersection'](_0x4fb6dd[_0x6db7('0x2e')],_0x4fb6dd[_0x6db7('0x30')]);_0xc4f615[_0x6db7('0x33')]=_[_0x6db7('0x34')](_0x4fb6dd[_0x6db7('0x2e')],qs['fields'](_0x3890f0[_0x6db7('0x30')][_0x6db7('0x35')]));_0xc4f615[_0x6db7('0x33')]=_0xc4f615['attributes'][_0x6db7('0x36')]?_0xc4f615[_0x6db7('0x33')]:_0x4fb6dd[_0x6db7('0x2e')];if(_0x3890f0['query'][_0x6db7('0x37')]){_0xc4f615['include']=[{'all':!![]}];}_0xc4f615=_[_0x6db7('0x38')]({},_0xc4f615,_0x3890f0['options']);return db['ChatApplication'][_0x6db7('0x39')](_0xc4f615)[_0x6db7('0x26')](handleEntityNotFound(_0x11185d,null))[_0x6db7('0x26')](respondWithResult(_0x11185d,null))[_0x6db7('0x3a')](handleError(_0x11185d,null));};exports['update']=function(_0x5cfca3,_0x3f7973){if(_0x5cfca3[_0x6db7('0x3b')]['id']){delete _0x5cfca3['body']['id'];}return db[_0x6db7('0x2f')]['find']({'where':{'id':_0x5cfca3[_0x6db7('0x2d')]['id']}})['then'](handleEntityNotFound(_0x3f7973,null))[_0x6db7('0x26')](saveUpdates(_0x5cfca3['body'],null))['then'](respondWithResult(_0x3f7973,null))[_0x6db7('0x3a')](handleError(_0x3f7973,null));};exports[_0x6db7('0x27')]=function(_0x384fbf,_0x20b875){return db[_0x6db7('0x2f')]['find']({'where':{'id':_0x384fbf[_0x6db7('0x2d')]['id']}})[_0x6db7('0x26')](handleEntityNotFound(_0x20b875,null))[_0x6db7('0x26')](removeEntity(_0x20b875,null))[_0x6db7('0x3a')](handleError(_0x20b875,null));};
\ No newline at end of file
+var _0xc79f=['find','catch','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','intersection','fields','attributes','length','include','merge','options'];(function(_0x301855,_0x139ee5){var _0x3bcda4=function(_0x3c96f9){while(--_0x3c96f9){_0x301855['push'](_0x301855['shift']());}};_0x3bcda4(++_0x139ee5);}(_0xc79f,0x82));var _0xfc79=function(_0x18b1a0,_0x17a7c2){_0x18b1a0=_0x18b1a0-0x0;var _0x463713=_0xc79f[_0x18b1a0];return _0x463713;};'use strict';var emlformat=require(_0xfc79('0x0'));var rimraf=require(_0xfc79('0x1'));var zipdir=require(_0xfc79('0x2'));var jsonpatch=require(_0xfc79('0x3'));var rp=require(_0xfc79('0x4'));var moment=require('moment');var BPromise=require(_0xfc79('0x5'));var Mustache=require(_0xfc79('0x6'));var util=require(_0xfc79('0x7'));var path=require(_0xfc79('0x8'));var sox=require(_0xfc79('0x9'));var csv=require(_0xfc79('0xa'));var ejs=require(_0xfc79('0xb'));var fs=require('fs');var fs_extra=require(_0xfc79('0xc'));var _=require(_0xfc79('0xd'));var squel=require('squel');var crypto=require(_0xfc79('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xfc79('0xf'));var toCsv=require(_0xfc79('0xa'));var querystring=require(_0xfc79('0x10'));var Papa=require('papaparse');var Redis=require(_0xfc79('0x11'));var authService=require(_0xfc79('0x12'));var qs=require(_0xfc79('0x13'));var as=require(_0xfc79('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc79('0x15'))(_0xfc79('0x16'));var utils=require(_0xfc79('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfc79('0x18'));var db=require(_0xfc79('0x19'))['db'];function respondWithStatusCode(_0x4b7f0e,_0xc2f79){_0xc2f79=_0xc2f79||0xcc;return function(_0x493a04){if(_0x493a04){return _0x4b7f0e[_0xfc79('0x1a')](_0xc2f79);}return _0x4b7f0e[_0xfc79('0x1b')](_0xc2f79)[_0xfc79('0x1c')]();};}function respondWithResult(_0x4996b6,_0x33bf71){_0x33bf71=_0x33bf71||0xc8;return function(_0x29c937){if(_0x29c937){return _0x4996b6[_0xfc79('0x1b')](_0x33bf71)[_0xfc79('0x1d')](_0x29c937);}};}function respondWithFilteredResult(_0x895b17,_0x7ef734){return function(_0x4cb052){if(_0x4cb052){var _0x228dab=typeof _0x7ef734[_0xfc79('0x1e')]===_0xfc79('0x1f')&&typeof _0x7ef734[_0xfc79('0x20')]==='undefined';var _0x39983a=_0x4cb052[_0xfc79('0x21')];var _0x216501=_0x228dab?0x0:_0x7ef734[_0xfc79('0x1e')];var _0x489e9a=_0x228dab?_0x4cb052['count']:_0x7ef734[_0xfc79('0x1e')]+_0x7ef734['limit'];var _0x816333;if(_0x489e9a>=_0x39983a){_0x489e9a=_0x39983a;_0x816333=0xc8;}else{_0x816333=0xce;}_0x895b17[_0xfc79('0x1b')](_0x816333);return _0x895b17[_0xfc79('0x22')](_0xfc79('0x23'),_0x216501+'-'+_0x489e9a+'/'+_0x39983a)['json'](_0x4cb052);}return null;};}function patchUpdates(_0x8187e2){return function(_0x418f64){try{jsonpatch[_0xfc79('0x24')](_0x418f64,_0x8187e2,!![]);}catch(_0x3c3c54){return BPromise[_0xfc79('0x25')](_0x3c3c54);}return _0x418f64[_0xfc79('0x26')]();};}function saveUpdates(_0x287549,_0x5009d5){return function(_0x1d6551){if(_0x1d6551){return _0x1d6551[_0xfc79('0x27')](_0x287549)[_0xfc79('0x28')](function(_0x2042ee){return _0x2042ee;});}return null;};}function removeEntity(_0x44ab6b,_0x5a1c6e){return function(_0x4d8636){if(_0x4d8636){return _0x4d8636['destroy']()[_0xfc79('0x28')](function(){_0x44ab6b[_0xfc79('0x1b')](0xcc)[_0xfc79('0x1c')]();});}};}function handleEntityNotFound(_0x324191,_0x5dcf36){return function(_0x1c152){if(!_0x1c152){_0x324191['sendStatus'](0x194);}return _0x1c152;};}function handleError(_0x3bf898,_0x560ca0){_0x560ca0=_0x560ca0||0x1f4;return function(_0x82011){logger[_0xfc79('0x29')](_0x82011[_0xfc79('0x2a')]);if(_0x82011['name']){delete _0x82011[_0xfc79('0x2b')];}_0x3bf898[_0xfc79('0x1b')](_0x560ca0)[_0xfc79('0x2c')](_0x82011);};}exports[_0xfc79('0x2d')]=function(_0x2ae979,_0x158b2f){var _0x3daf63={'raw':!![],'where':{'id':_0x2ae979[_0xfc79('0x2e')]['id']}},_0x4ef0f8={};_0x4ef0f8[_0xfc79('0x2f')]=_[_0xfc79('0x30')](db[_0xfc79('0x31')]['rawAttributes']);_0x4ef0f8[_0xfc79('0x32')]=_[_0xfc79('0x30')](_0x2ae979[_0xfc79('0x32')]);_0x4ef0f8[_0xfc79('0x33')]=_[_0xfc79('0x34')](_0x4ef0f8[_0xfc79('0x2f')],_0x4ef0f8['query']);_0x3daf63['attributes']=_[_0xfc79('0x34')](_0x4ef0f8['model'],qs[_0xfc79('0x35')](_0x2ae979[_0xfc79('0x32')][_0xfc79('0x35')]));_0x3daf63[_0xfc79('0x36')]=_0x3daf63[_0xfc79('0x36')][_0xfc79('0x37')]?_0x3daf63[_0xfc79('0x36')]:_0x4ef0f8[_0xfc79('0x2f')];if(_0x2ae979[_0xfc79('0x32')]['includeAll']){_0x3daf63[_0xfc79('0x38')]=[{'all':!![]}];}_0x3daf63=_[_0xfc79('0x39')]({},_0x3daf63,_0x2ae979[_0xfc79('0x3a')]);return db[_0xfc79('0x31')][_0xfc79('0x3b')](_0x3daf63)['then'](handleEntityNotFound(_0x158b2f,null))[_0xfc79('0x28')](respondWithResult(_0x158b2f,null))[_0xfc79('0x3c')](handleError(_0x158b2f,null));};exports['update']=function(_0x4f7df6,_0x525c96){if(_0x4f7df6[_0xfc79('0x3d')]['id']){delete _0x4f7df6[_0xfc79('0x3d')]['id'];}return db[_0xfc79('0x31')][_0xfc79('0x3b')]({'where':{'id':_0x4f7df6[_0xfc79('0x2e')]['id']}})['then'](handleEntityNotFound(_0x525c96,null))[_0xfc79('0x28')](saveUpdates(_0x4f7df6[_0xfc79('0x3d')],null))[_0xfc79('0x28')](respondWithResult(_0x525c96,null))['catch'](handleError(_0x525c96,null));};exports[_0xfc79('0x3e')]=function(_0x26632a,_0x5acace){return db['ChatApplication'][_0xfc79('0x3b')]({'where':{'id':_0x26632a[_0xfc79('0x2e')]['id']}})[_0xfc79('0x28')](handleEntityNotFound(_0x5acace,null))[_0xfc79('0x28')](removeEntity(_0x5acace,null))[_0xfc79('0x3c')](handleError(_0x5acace,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 4bc71df..5b4769d 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 _0x9ef8=['util','api','moment','bluebird','path','rimraf','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1cf825,_0x35f9ae){var _0x3f739f=function(_0x573ca3){while(--_0x573ca3){_0x1cf825['push'](_0x1cf825['shift']());}};_0x3f739f(++_0x35f9ae);}(_0x9ef8,0x17f));var _0x89ef=function(_0x16dbcd,_0x274516){_0x16dbcd=_0x16dbcd-0x0;var _0x34706e=_0x9ef8[_0x16dbcd];return _0x34706e;};'use strict';var _=require(_0x89ef('0x0'));var util=require(_0x89ef('0x1'));var logger=require('../../config/logger')(_0x89ef('0x2'));var moment=require(_0x89ef('0x3'));var BPromise=require(_0x89ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x89ef('0x5'));var rimraf=require(_0x89ef('0x6'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module['exports']=function(_0x383019,_0x2e117e){return _0x383019[_0x89ef('0x7')](_0x89ef('0x8'),attributes,{'tableName':_0x89ef('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x89ef('0xa'),'collate':_0x89ef('0xb')});};
\ No newline at end of file
+var _0x48d7=['bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','lodash','util','../../config/logger','moment'];(function(_0x5210e8,_0x20bb22){var _0x14fcad=function(_0x2a566e){while(--_0x2a566e){_0x5210e8['push'](_0x5210e8['shift']());}};_0x14fcad(++_0x20bb22);}(_0x48d7,0xfb));var _0x748d=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x48d7[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x748d('0x0'));var util=require(_0x748d('0x1'));var logger=require(_0x748d('0x2'))('api');var moment=require(_0x748d('0x3'));var BPromise=require(_0x748d('0x4'));var rp=require(_0x748d('0x5'));var fs=require('fs');var path=require(_0x748d('0x6'));var rimraf=require(_0x748d('0x7'));var config=require(_0x748d('0x8'));var attributes=require(_0x748d('0x9'));module[_0x748d('0xa')]=function(_0x591eb9,_0x23a5ed){return _0x591eb9[_0x748d('0xb')](_0x748d('0xc'),attributes,{'tableName':_0x748d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x748d('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 9c23ac2..d913334 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 _0x1b51=['stringify','error','code','message','info','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x4aae6b,_0x386b16){var _0x22bc72=function(_0x309479){while(--_0x309479){_0x4aae6b['push'](_0x4aae6b['shift']());}};_0x22bc72(++_0x386b16);}(_0x1b51,0xed));var _0x11b5=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1b51[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x11b5('0x0'));var util=require('util');var moment=require(_0x11b5('0x1'));var BPromise=require('bluebird');var rs=require(_0x11b5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x11b5('0x3'))['db'];var utils=require(_0x11b5('0x4'));var logger=require('../../config/logger')(_0x11b5('0x5'));var config=require(_0x11b5('0x6'));var jayson=require(_0x11b5('0x7'));var client=jayson[_0x11b5('0x8')][_0x11b5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2020e5,_0x1a498b,_0x8d461a){return new BPromise(function(_0x5e90d3,_0x121be4){return client['request'](_0x2020e5,_0x8d461a)[_0x11b5('0xa')](function(_0x1a6000){logger['info'](_0x11b5('0xb'),_0x1a498b,_0x11b5('0xc'));logger[_0x11b5('0xd')](_0x11b5('0xe'),_0x1a498b,_0x11b5('0xc'),JSON[_0x11b5('0xf')](_0x1a6000));if(_0x1a6000[_0x11b5('0x10')]){if(_0x1a6000[_0x11b5('0x10')][_0x11b5('0x11')]===0x1f4){logger[_0x11b5('0x10')]('ChatApplication,\x20%s,\x20%s',_0x1a498b,_0x1a6000['error'][_0x11b5('0x12')]);return _0x121be4(_0x1a6000[_0x11b5('0x10')][_0x11b5('0x12')]);}logger['error'](_0x11b5('0xb'),_0x1a498b,_0x1a6000[_0x11b5('0x10')][_0x11b5('0x12')]);return _0x5e90d3(_0x1a6000['error']['message']);}else{logger[_0x11b5('0x13')](_0x11b5('0xb'),_0x1a498b,_0x11b5('0xc'));_0x5e90d3(_0x1a6000['result'][_0x11b5('0x12')]);}})[_0x11b5('0x14')](function(_0x47ca8e){logger[_0x11b5('0x10')](_0x11b5('0xb'),_0x1a498b,_0x47ca8e);_0x121be4(_0x47ca8e);});});}
\ No newline at end of file
+var _0x9e18=['request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../config/environment','jayson/promise','client'];(function(_0x1f263f,_0x56b2db){var _0x2ecbcc=function(_0x4b22d5){while(--_0x4b22d5){_0x1f263f['push'](_0x1f263f['shift']());}};_0x2ecbcc(++_0x56b2db);}(_0x9e18,0x150));var _0x89e1=function(_0x2acd64,_0x4e8ce8){_0x2acd64=_0x2acd64-0x0;var _0x3d3fce=_0x9e18[_0x2acd64];return _0x3d3fce;};'use strict';var _=require(_0x89e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x89e1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89e1('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x89e1('0x3'));var jayson=require(_0x89e1('0x4'));var client=jayson[_0x89e1('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x426bbf,_0x1eb0ea,_0x5694aa){return new BPromise(function(_0x5f2c8e,_0x267416){return client[_0x89e1('0x6')](_0x426bbf,_0x5694aa)[_0x89e1('0x7')](function(_0x2c5341){logger[_0x89e1('0x8')](_0x89e1('0x9'),_0x1eb0ea,_0x89e1('0xa'));logger[_0x89e1('0xb')](_0x89e1('0xc'),_0x1eb0ea,_0x89e1('0xa'),JSON[_0x89e1('0xd')](_0x2c5341));if(_0x2c5341['error']){if(_0x2c5341[_0x89e1('0xe')][_0x89e1('0xf')]===0x1f4){logger[_0x89e1('0xe')](_0x89e1('0x9'),_0x1eb0ea,_0x2c5341[_0x89e1('0xe')][_0x89e1('0x10')]);return _0x267416(_0x2c5341[_0x89e1('0xe')][_0x89e1('0x10')]);}logger['error'](_0x89e1('0x9'),_0x1eb0ea,_0x2c5341[_0x89e1('0xe')][_0x89e1('0x10')]);return _0x5f2c8e(_0x2c5341[_0x89e1('0xe')]['message']);}else{logger[_0x89e1('0x8')](_0x89e1('0x9'),_0x1eb0ea,_0x89e1('0xa'));_0x5f2c8e(_0x2c5341[_0x89e1('0x11')]['message']);}})[_0x89e1('0x12')](function(_0x5ba7a1){logger[_0x89e1('0xe')]('ChatApplication,\x20%s,\x20%s',_0x1eb0ea,_0x5ba7a1);_0x267416(_0x5ba7a1);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 397a97e..322f770 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 _0xbd4e=['update','destroy','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbd4e,0x7b));var _0xebd4=function(_0x32365c,_0x453f9f){_0x32365c=_0x32365c-0x0;var _0x34ff18=_0xbd4e[_0x32365c];return _0x34ff18;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xebd4('0x0'));var router=express[_0xebd4('0x1')]();var fs_extra=require(_0xebd4('0x2'));var auth=require(_0xebd4('0x3'));var interaction=require(_0xebd4('0x4'));var config=require(_0xebd4('0x5'));var controller=require(_0xebd4('0x6'));router[_0xebd4('0x7')](_0xebd4('0x8'),auth[_0xebd4('0x9')](),controller[_0xebd4('0xa')]);router[_0xebd4('0xb')](_0xebd4('0x8'),auth[_0xebd4('0x9')](),controller[_0xebd4('0xc')]);router['delete'](_0xebd4('0x8'),auth[_0xebd4('0x9')](),controller[_0xebd4('0xd')]);module[_0xebd4('0xe')]=router;
\ No newline at end of file
+var _0x5631=['/:id','isAuthenticated','show','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get'];(function(_0x467622,_0x4ad91){var _0x35ca1a=function(_0x1cdb34){while(--_0x1cdb34){_0x467622['push'](_0x467622['shift']());}};_0x35ca1a(++_0x4ad91);}(_0x5631,0x85));var _0x1563=function(_0x5dc03e,_0x54e60c){_0x5dc03e=_0x5dc03e-0x0;var _0x466a07=_0x5631[_0x5dc03e];return _0x466a07;};'use strict';var multer=require(_0x1563('0x0'));var util=require(_0x1563('0x1'));var path=require(_0x1563('0x2'));var timeout=require(_0x1563('0x3'));var express=require('express');var router=express[_0x1563('0x4')]();var fs_extra=require(_0x1563('0x5'));var auth=require(_0x1563('0x6'));var interaction=require(_0x1563('0x7'));var config=require(_0x1563('0x8'));var controller=require(_0x1563('0x9'));router[_0x1563('0xa')](_0x1563('0xb'),auth[_0x1563('0xc')](),controller[_0x1563('0xd')]);router[_0x1563('0xe')]('/:id',auth[_0x1563('0xc')](),controller[_0x1563('0xf')]);router[_0x1563('0x10')](_0x1563('0xb'),auth[_0x1563('0xc')](),controller['destroy']);module[_0x1563('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index f916ad0..8acd65f 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 _0x2b0a=['sequelize','exports','STRING'];(function(_0x687c0a,_0x3aac82){var _0x8fdcb5=function(_0x318f0b){while(--_0x318f0b){_0x687c0a['push'](_0x687c0a['shift']());}};_0x8fdcb5(++_0x3aac82);}(_0x2b0a,0x84));var _0xa2b0=function(_0x1ac237,_0x515063){_0x1ac237=_0x1ac237-0x0;var _0x752098=_0x2b0a[_0x1ac237];return _0x752098;};'use strict';var Sequelize=require(_0xa2b0('0x0'));module[_0xa2b0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa2b0('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xbfce=['STRING','BOOLEAN','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbfce,0x161));var _0xebfc=function(_0x2cc6bf,_0x4849a3){_0x2cc6bf=_0x2cc6bf-0x0;var _0x320f3c=_0xbfce[_0x2cc6bf];return _0x320f3c;};'use strict';var Sequelize=require('sequelize');module[_0xebfc('0x0')]={'name':{'type':Sequelize[_0xebfc('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xebfc('0x1')]},'write':{'type':Sequelize[_0xebfc('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 3a790ee..e3fdc06 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 _0xa114=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','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/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatGroup','includeAll','include','findAll','catch','params','keys','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','$gte','format','getMessages','eml-format'];(function(_0x1c7a62,_0x374c5b){var _0x46b20=function(_0x50c9b9){while(--_0x50c9b9){_0x1c7a62['push'](_0x1c7a62['shift']());}};_0x46b20(++_0x374c5b);}(_0xa114,0x187));var _0x4a11=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0xa114[_0x525af9];return _0x129fbf;};'use strict';var emlformat=require(_0x4a11('0x0'));var rimraf=require(_0x4a11('0x1'));var zipdir=require(_0x4a11('0x2'));var jsonpatch=require(_0x4a11('0x3'));var rp=require(_0x4a11('0x4'));var moment=require(_0x4a11('0x5'));var BPromise=require(_0x4a11('0x6'));var Mustache=require(_0x4a11('0x7'));var util=require(_0x4a11('0x8'));var path=require(_0x4a11('0x9'));var sox=require(_0x4a11('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a11('0xb'));var _=require(_0x4a11('0xc'));var squel=require('squel');var crypto=require(_0x4a11('0xd'));var jsforce=require(_0x4a11('0xe'));var deskjs=require(_0x4a11('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4a11('0x10'));var Papa=require(_0x4a11('0x11'));var Redis=require(_0x4a11('0x12'));var authService=require(_0x4a11('0x13'));var qs=require(_0x4a11('0x14'));var as=require(_0x4a11('0x15'));var hardwareService=require(_0x4a11('0x16'));var logger=require(_0x4a11('0x17'))(_0x4a11('0x18'));var utils=require(_0x4a11('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x4a11('0x1a'));var db=require(_0x4a11('0x1b'))['db'];config['redis']=_['defaults'](config[_0x4a11('0x1c')],{'host':_0x4a11('0x1d'),'port':0x18eb});var socket=require(_0x4a11('0x1e'))(new Redis(config[_0x4a11('0x1c')]));require(_0x4a11('0x1f'))[_0x4a11('0x20')](socket);function respondWithStatusCode(_0x365d1c,_0x3ff435){_0x3ff435=_0x3ff435||0xcc;return function(_0x42dec9){if(_0x42dec9){return _0x365d1c[_0x4a11('0x21')](_0x3ff435);}return _0x365d1c['status'](_0x3ff435)[_0x4a11('0x22')]();};}function respondWithResult(_0x268d34,_0x3ecc29){_0x3ecc29=_0x3ecc29||0xc8;return function(_0xe336de){if(_0xe336de){return _0x268d34[_0x4a11('0x23')](_0x3ecc29)[_0x4a11('0x24')](_0xe336de);}};}function respondWithFilteredResult(_0x2bcb1d,_0x27703b){return function(_0x20a6eb){if(_0x20a6eb){var _0x43ec84=typeof _0x27703b[_0x4a11('0x25')]===_0x4a11('0x26')&&typeof _0x27703b['limit']===_0x4a11('0x26');var _0x58b9a1=_0x20a6eb['count'];var _0x25a10d=_0x43ec84?0x0:_0x27703b[_0x4a11('0x25')];var _0x4c4e65=_0x43ec84?_0x20a6eb[_0x4a11('0x27')]:_0x27703b[_0x4a11('0x25')]+_0x27703b[_0x4a11('0x28')];var _0x42f1a5;if(_0x4c4e65>=_0x58b9a1){_0x4c4e65=_0x58b9a1;_0x42f1a5=0xc8;}else{_0x42f1a5=0xce;}_0x2bcb1d[_0x4a11('0x23')](_0x42f1a5);return _0x2bcb1d[_0x4a11('0x29')](_0x4a11('0x2a'),_0x25a10d+'-'+_0x4c4e65+'/'+_0x58b9a1)[_0x4a11('0x24')](_0x20a6eb);}return null;};}function patchUpdates(_0x3015ec){return function(_0x18e393){try{jsonpatch['apply'](_0x18e393,_0x3015ec,!![]);}catch(_0x91817f){return BPromise[_0x4a11('0x2b')](_0x91817f);}return _0x18e393[_0x4a11('0x2c')]();};}function saveUpdates(_0x38dc7b,_0x56b6eb){return function(_0x429527){if(_0x429527){return _0x429527[_0x4a11('0x2d')](_0x38dc7b)[_0x4a11('0x2e')](function(_0xb3950){return _0xb3950;});}return null;};}function removeEntity(_0xd5b915,_0x3c64da){return function(_0x3614f9){if(_0x3614f9){return _0x3614f9[_0x4a11('0x2f')]()[_0x4a11('0x2e')](function(){_0xd5b915['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53367d,_0x1473bd){return function(_0x52b79d){if(!_0x52b79d){_0x53367d[_0x4a11('0x21')](0x194);}return _0x52b79d;};}function handleError(_0x3f8684,_0x2c13d4){_0x2c13d4=_0x2c13d4||0x1f4;return function(_0x2b25d9){logger[_0x4a11('0x30')](_0x2b25d9[_0x4a11('0x31')]);if(_0x2b25d9[_0x4a11('0x32')]){delete _0x2b25d9[_0x4a11('0x32')];}_0x3f8684['status'](_0x2c13d4)['send'](_0x2b25d9);};}exports[_0x4a11('0x33')]=function(_0x5e32,_0xd180ee){var _0x3a2246={},_0x2f46d2={},_0x1faed3={'count':0x0,'rows':[]};var _0x57d45f=_[_0x4a11('0x34')](db['ChatGroup'][_0x4a11('0x35')],function(_0x1f7c7a){return{'name':_0x1f7c7a['fieldName'],'type':_0x1f7c7a['type'][_0x4a11('0x36')]};});_0x2f46d2['model']=_[_0x4a11('0x34')](_0x57d45f,'name');_0x2f46d2[_0x4a11('0x37')]=_['keys'](_0x5e32['query']);_0x2f46d2[_0x4a11('0x38')]=_[_0x4a11('0x39')](_0x2f46d2[_0x4a11('0x3a')],_0x2f46d2[_0x4a11('0x37')]);_0x3a2246['attributes']=_[_0x4a11('0x39')](_0x2f46d2[_0x4a11('0x3a')],qs[_0x4a11('0x3b')](_0x5e32[_0x4a11('0x37')][_0x4a11('0x3b')]));_0x3a2246[_0x4a11('0x3c')]=_0x3a2246[_0x4a11('0x3c')][_0x4a11('0x3d')]?_0x3a2246['attributes']:_0x2f46d2['model'];if(!_0x5e32[_0x4a11('0x37')][_0x4a11('0x3e')](_0x4a11('0x3f'))){_0x3a2246[_0x4a11('0x28')]=qs[_0x4a11('0x28')](_0x5e32[_0x4a11('0x37')][_0x4a11('0x28')]);_0x3a2246[_0x4a11('0x25')]=qs[_0x4a11('0x25')](_0x5e32[_0x4a11('0x37')][_0x4a11('0x25')]);}_0x3a2246[_0x4a11('0x40')]=qs[_0x4a11('0x41')](_0x5e32[_0x4a11('0x37')]['sort']);_0x3a2246[_0x4a11('0x42')]=qs['filters'](_[_0x4a11('0x43')](_0x5e32['query'],_0x2f46d2[_0x4a11('0x38')]),_0x57d45f);if(_0x5e32['query'][_0x4a11('0x44')]){_0x3a2246[_0x4a11('0x42')]=_[_0x4a11('0x45')](_0x3a2246[_0x4a11('0x42')],{'$or':_[_0x4a11('0x34')](_0x57d45f,function(_0x58e7de){if(_0x58e7de[_0x4a11('0x46')]!==_0x4a11('0x47')){var _0x25e5ba={};_0x25e5ba[_0x58e7de[_0x4a11('0x32')]]={'$like':'%'+_0x5e32[_0x4a11('0x37')][_0x4a11('0x44')]+'%'};return _0x25e5ba;}})});}_0x3a2246=_[_0x4a11('0x45')]({},_0x3a2246,_0x5e32[_0x4a11('0x48')]);var _0x16d9f3={'where':_0x3a2246[_0x4a11('0x42')]};return db[_0x4a11('0x49')][_0x4a11('0x27')](_0x16d9f3)['then'](function(_0x5c869e){_0x1faed3['count']=_0x5c869e;if(_0x5e32['query'][_0x4a11('0x4a')]){_0x3a2246[_0x4a11('0x4b')]=[{'all':!![]}];}return db[_0x4a11('0x49')][_0x4a11('0x4c')](_0x3a2246);})[_0x4a11('0x2e')](function(_0x4291e9){_0x1faed3['rows']=_0x4291e9;return _0x1faed3;})[_0x4a11('0x2e')](respondWithFilteredResult(_0xd180ee,_0x3a2246))[_0x4a11('0x4d')](handleError(_0xd180ee,null));};exports['show']=function(_0x313041,_0x1e7603){var _0x316433={'raw':!![],'where':{'id':_0x313041[_0x4a11('0x4e')]['id']}},_0x9b7a25={};_0x9b7a25[_0x4a11('0x3a')]=_[_0x4a11('0x4f')](db[_0x4a11('0x49')]['rawAttributes']);_0x9b7a25[_0x4a11('0x37')]=_[_0x4a11('0x4f')](_0x313041[_0x4a11('0x37')]);_0x9b7a25[_0x4a11('0x38')]=_[_0x4a11('0x39')](_0x9b7a25['model'],_0x9b7a25[_0x4a11('0x37')]);_0x316433[_0x4a11('0x3c')]=_[_0x4a11('0x39')](_0x9b7a25[_0x4a11('0x3a')],qs[_0x4a11('0x3b')](_0x313041[_0x4a11('0x37')][_0x4a11('0x3b')]));_0x316433[_0x4a11('0x3c')]=_0x316433[_0x4a11('0x3c')][_0x4a11('0x3d')]?_0x316433[_0x4a11('0x3c')]:_0x9b7a25[_0x4a11('0x3a')];if(_0x313041['query'][_0x4a11('0x4a')]){_0x316433[_0x4a11('0x4b')]=[{'all':!![]}];}_0x316433=_[_0x4a11('0x45')]({},_0x316433,_0x313041['options']);return db[_0x4a11('0x49')][_0x4a11('0x50')](_0x316433)[_0x4a11('0x2e')](handleEntityNotFound(_0x1e7603,null))[_0x4a11('0x2e')](respondWithResult(_0x1e7603,null))['catch'](handleError(_0x1e7603,null));};exports[_0x4a11('0x51')]=function(_0x4fe772,_0x4db92a){return db[_0x4a11('0x49')]['create'](_0x4fe772[_0x4a11('0x52')],{})[_0x4a11('0x2e')](respondWithResult(_0x4db92a,0xc9))['catch'](handleError(_0x4db92a,null));};exports['update']=function(_0x475071,_0x5f3f67){if(_0x475071[_0x4a11('0x52')]['id']){delete _0x475071[_0x4a11('0x52')]['id'];}return db[_0x4a11('0x49')][_0x4a11('0x50')]({'where':{'id':_0x475071[_0x4a11('0x4e')]['id']}})[_0x4a11('0x2e')](handleEntityNotFound(_0x5f3f67,null))[_0x4a11('0x2e')](saveUpdates(_0x475071[_0x4a11('0x52')],null))[_0x4a11('0x2e')](respondWithResult(_0x5f3f67,null))[_0x4a11('0x4d')](handleError(_0x5f3f67,null));};exports['destroy']=function(_0x5bc350,_0x2eefc2){return db[_0x4a11('0x49')][_0x4a11('0x50')]({'where':{'id':_0x5bc350[_0x4a11('0x4e')]['id']}})[_0x4a11('0x2e')](handleEntityNotFound(_0x2eefc2,null))['then'](removeEntity(_0x2eefc2,null))[_0x4a11('0x4d')](handleError(_0x2eefc2,null));};exports[_0x4a11('0x53')]=function(_0x86508f,_0x83755e){return db[_0x4a11('0x49')][_0x4a11('0x53')]()[_0x4a11('0x2e')](respondWithResult(_0x83755e,null))[_0x4a11('0x4d')](handleError(_0x83755e,null));};exports[_0x4a11('0x54')]=function(_0x286818,_0x1e72c2,_0x43036f){return db[_0x4a11('0x55')][_0x4a11('0x27')]({'where':{'ChatGroupId':_0x286818[_0x4a11('0x4e')]['id'],'ToId':_0x286818[_0x4a11('0x56')]['id'],'read':![]}})[_0x4a11('0x2e')](function(_0x59e4e7){return{'id':_[_0x4a11('0x57')](_0x286818[_0x4a11('0x4e')]['id']),'count':_0x59e4e7};})['then'](respondWithResult(_0x1e72c2,null))[_0x4a11('0x4d')](handleError(_0x1e72c2,null));};exports[_0x4a11('0x58')]=function(_0x3098a9,_0x35222f,_0x291d0c){return db[_0x4a11('0x49')]['find']({'where':{'id':_0x3098a9[_0x4a11('0x4e')]['id']}})[_0x4a11('0x2e')](handleEntityNotFound(_0x35222f,null))['then'](function(_0x5bc607){if(_0x5bc607){return _0x5bc607[_0x4a11('0x58')](_0x3098a9[_0x4a11('0x52')][_0x4a11('0x59')],_[_0x4a11('0x5a')](_0x3098a9['body'],[_0x4a11('0x59'),'id'])||{});}})['then'](respondWithResult(_0x35222f,null))[_0x4a11('0x4d')](handleError(_0x35222f,null));};exports[_0x4a11('0x5b')]=function(_0x2c954f,_0x327776,_0x36f3bd){var _0xd23cb4={};var _0x268eb8={};var _0x22bc2c;var _0x3d7931;return db[_0x4a11('0x49')][_0x4a11('0x5c')]({'where':{'id':_0x2c954f['params']['id']}})[_0x4a11('0x2e')](handleEntityNotFound(_0x327776,null))[_0x4a11('0x2e')](function(_0x1acf1b){if(_0x1acf1b){_0x22bc2c=_0x1acf1b;_0x268eb8[_0x4a11('0x3a')]=_[_0x4a11('0x4f')](db[_0x4a11('0x5d')][_0x4a11('0x35')]);_0x268eb8[_0x4a11('0x37')]=_[_0x4a11('0x4f')](_0x2c954f[_0x4a11('0x37')]);_0x268eb8['filters']=_[_0x4a11('0x39')](_0x268eb8[_0x4a11('0x3a')],_0x268eb8[_0x4a11('0x37')]);_0xd23cb4[_0x4a11('0x3c')]=_[_0x4a11('0x39')](_0x268eb8[_0x4a11('0x3a')],qs['fields'](_0x2c954f[_0x4a11('0x37')]['fields']));_0xd23cb4[_0x4a11('0x3c')]=_0xd23cb4[_0x4a11('0x3c')][_0x4a11('0x3d')]?_0xd23cb4[_0x4a11('0x3c')]:_0x268eb8[_0x4a11('0x3a')];_0xd23cb4[_0x4a11('0x40')]=qs[_0x4a11('0x41')](_0x2c954f[_0x4a11('0x37')][_0x4a11('0x41')]);_0xd23cb4['where']=qs[_0x4a11('0x38')](_[_0x4a11('0x43')](_0x2c954f['query'],_0x268eb8[_0x4a11('0x38')]));if(_0x2c954f['query'][_0x4a11('0x44')]){_0xd23cb4[_0x4a11('0x42')]=_[_0x4a11('0x45')](_0xd23cb4[_0x4a11('0x42')],{'$or':_[_0x4a11('0x34')](_0xd23cb4['attributes'],function(_0x820267){var _0x44a502={};_0x44a502[_0x820267]={'$like':'%'+_0x2c954f['query'][_0x4a11('0x44')]+'%'};return _0x44a502;})});}_0xd23cb4=_['merge']({},_0xd23cb4,_0x2c954f[_0x4a11('0x48')]);return _0x22bc2c[_0x4a11('0x5b')](_0xd23cb4);}})[_0x4a11('0x2e')](function(_0x37ee2f){if(_0x37ee2f){_0x3d7931=_0x37ee2f['length'];if(!_0x2c954f[_0x4a11('0x37')][_0x4a11('0x3e')](_0x4a11('0x3f'))){_0xd23cb4['limit']=qs['limit'](_0x2c954f[_0x4a11('0x37')]['limit']);_0xd23cb4['offset']=qs[_0x4a11('0x25')](_0x2c954f[_0x4a11('0x37')][_0x4a11('0x25')]);}return _0x22bc2c[_0x4a11('0x5b')](_0xd23cb4);}})[_0x4a11('0x2e')](function(_0x2f6077){if(_0x2f6077){return _0x2f6077?{'count':_0x3d7931,'rows':_0x2f6077}:null;}})[_0x4a11('0x2e')](respondWithResult(_0x327776,null))[_0x4a11('0x4d')](handleError(_0x327776,null));};exports[_0x4a11('0x5e')]=function(_0x7a0364,_0x842393,_0x3a7fcd){return db['ChatGroup']['find']({'where':{'id':_0x7a0364[_0x4a11('0x4e')]['id']}})[_0x4a11('0x2e')](handleEntityNotFound(_0x842393,null))[_0x4a11('0x2e')](function(_0x3b16c9){if(_0x3b16c9){return _0x3b16c9['removeMembers'](_0x7a0364[_0x4a11('0x37')]['ids']);}})[_0x4a11('0x2e')](respondWithStatusCode(_0x842393,null))[_0x4a11('0x4d')](handleError(_0x842393,null));};exports['addMessage']=function(_0x1e7eeb,_0x24ccbc,_0x54be14){if(_0x1e7eeb['body']['id']){delete _0x1e7eeb[_0x4a11('0x52')]['id'];}return db['ChatGroup'][_0x4a11('0x50')]({'where':{'id':_0x1e7eeb['params']['id']}})[_0x4a11('0x2e')](handleEntityNotFound(_0x24ccbc,null))['then'](function(_0x3e07d9){if(_0x3e07d9){_0x1e7eeb[_0x4a11('0x52')]['ChatGroupId']=_0x3e07d9['id'];return db['ChatInternalMessage'][_0x4a11('0x51')](_0x1e7eeb['body']);}})['then'](respondWithResult(_0x24ccbc,null))[_0x4a11('0x4d')](handleError(_0x24ccbc,null));};exports['getMessages']=function(_0x508894,_0x231fd4,_0x298043){var _0x2efd9f={};var _0x355ef7={};var _0x3e45d5;var _0x28f43c;return db[_0x4a11('0x49')][_0x4a11('0x5c')]({'where':{'id':_0x508894['params']['id']}})[_0x4a11('0x2e')](handleEntityNotFound(_0x231fd4,null))[_0x4a11('0x2e')](function(_0x350030){if(_0x350030){_0x3e45d5=_0x350030;_0x355ef7[_0x4a11('0x3a')]=_['keys'](db['ChatInternalMessage'][_0x4a11('0x35')]);_0x355ef7['query']=_['keys'](_0x508894['query']);_0x355ef7[_0x4a11('0x38')]=_[_0x4a11('0x39')](_0x355ef7[_0x4a11('0x3a')],_0x355ef7[_0x4a11('0x37')]);_0x2efd9f[_0x4a11('0x3c')]=_['intersection'](_0x355ef7[_0x4a11('0x3a')],qs[_0x4a11('0x3b')](_0x508894[_0x4a11('0x37')][_0x4a11('0x3b')]));_0x2efd9f[_0x4a11('0x3c')]=_0x2efd9f[_0x4a11('0x3c')][_0x4a11('0x3d')]?_0x2efd9f[_0x4a11('0x3c')]:_0x355ef7[_0x4a11('0x3a')];_0x2efd9f[_0x4a11('0x40')]=qs['sort'](_0x508894[_0x4a11('0x37')][_0x4a11('0x41')]);_0x2efd9f[_0x4a11('0x42')]=qs[_0x4a11('0x38')](_[_0x4a11('0x43')](_0x508894['query'],_0x355ef7['filters']));if(_0x508894[_0x4a11('0x37')][_0x4a11('0x44')]){_0x2efd9f[_0x4a11('0x42')]=_[_0x4a11('0x45')](_0x2efd9f[_0x4a11('0x42')],{'$or':_[_0x4a11('0x34')](_0x2efd9f['attributes'],function(_0x55631b){var _0x4951b9={};_0x4951b9[_0x55631b]={'$like':'%'+_0x508894[_0x4a11('0x37')][_0x4a11('0x44')]+'%'};return _0x4951b9;})});}if(_0x508894['query']['$gte']){var _0x39578f=_0x508894[_0x4a11('0x37')][_0x4a11('0x5f')]['split'](',');var _0x23166c={};_0x23166c[_0x39578f[0x0]]={'$gte':moment(_0x39578f[0x1])[_0x4a11('0x60')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2efd9f[_0x4a11('0x42')]=_[_0x4a11('0x45')](_0x2efd9f[_0x4a11('0x42')],_0x23166c);}_0x2efd9f=_[_0x4a11('0x45')]({},_0x2efd9f,_0x508894['options']);return _0x3e45d5[_0x4a11('0x61')](_0x2efd9f);}})[_0x4a11('0x2e')](function(_0x335b72){if(_0x335b72){_0x28f43c=_0x335b72[_0x4a11('0x3d')];if(!_0x508894[_0x4a11('0x37')][_0x4a11('0x3e')]('nolimit')){_0x2efd9f[_0x4a11('0x28')]=qs['limit'](_0x508894['query'][_0x4a11('0x28')]);_0x2efd9f['offset']=qs[_0x4a11('0x25')](_0x508894[_0x4a11('0x37')][_0x4a11('0x25')]);}return _0x3e45d5[_0x4a11('0x61')](_0x2efd9f);}})[_0x4a11('0x2e')](function(_0x248475){if(_0x248475){return _0x248475?{'count':_0x28f43c,'rows':_0x248475}:null;}})[_0x4a11('0x2e')](respondWithResult(_0x231fd4,null))['catch'](handleError(_0x231fd4,null));};
\ No newline at end of file
+var _0x9f26=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','destroy','error','name','send','index','rawAttributes','fieldName','model','map','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','ChatGroup','findAll','show','includeAll','find','catch','create','body','params','getUnread','ChatInternalMessage','user','addMembers','ids','omit','findOne','pick','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x3f0362,_0x5c8421){var _0x342be3=function(_0x16e59b){while(--_0x16e59b){_0x3f0362['push'](_0x3f0362['shift']());}};_0x342be3(++_0x5c8421);}(_0x9f26,0x1c8));var _0x69f2=function(_0x54de43,_0xfb2a03){_0x54de43=_0x54de43-0x0;var _0x22cb02=_0x9f26[_0x54de43];return _0x22cb02;};'use strict';var emlformat=require(_0x69f2('0x0'));var rimraf=require(_0x69f2('0x1'));var zipdir=require(_0x69f2('0x2'));var jsonpatch=require(_0x69f2('0x3'));var rp=require(_0x69f2('0x4'));var moment=require('moment');var BPromise=require(_0x69f2('0x5'));var Mustache=require('mustache');var util=require(_0x69f2('0x6'));var path=require(_0x69f2('0x7'));var sox=require(_0x69f2('0x8'));var csv=require('to-csv');var ejs=require(_0x69f2('0x9'));var fs=require('fs');var fs_extra=require(_0x69f2('0xa'));var _=require(_0x69f2('0xb'));var squel=require('squel');var crypto=require(_0x69f2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x69f2('0xd'));var toCsv=require(_0x69f2('0xe'));var querystring=require(_0x69f2('0xf'));var Papa=require(_0x69f2('0x10'));var Redis=require('ioredis');var authService=require(_0x69f2('0x11'));var qs=require(_0x69f2('0x12'));var as=require(_0x69f2('0x13'));var hardwareService=require(_0x69f2('0x14'));var logger=require('../../config/logger')(_0x69f2('0x15'));var utils=require(_0x69f2('0x16'));var config=require(_0x69f2('0x17'));var licenseUtil=require(_0x69f2('0x18'));var db=require(_0x69f2('0x19'))['db'];config['redis']=_[_0x69f2('0x1a')](config[_0x69f2('0x1b')],{'host':_0x69f2('0x1c'),'port':0x18eb});var socket=require(_0x69f2('0x1d'))(new Redis(config[_0x69f2('0x1b')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x53a7ec,_0x3d4294){_0x3d4294=_0x3d4294||0xcc;return function(_0x54ec5f){if(_0x54ec5f){return _0x53a7ec[_0x69f2('0x1e')](_0x3d4294);}return _0x53a7ec[_0x69f2('0x1f')](_0x3d4294)[_0x69f2('0x20')]();};}function respondWithResult(_0x230bab,_0x53bfa0){_0x53bfa0=_0x53bfa0||0xc8;return function(_0x4b3c45){if(_0x4b3c45){return _0x230bab['status'](_0x53bfa0)['json'](_0x4b3c45);}};}function respondWithFilteredResult(_0x1b3f83,_0x14274c){return function(_0x540c88){if(_0x540c88){var _0x3515b1=typeof _0x14274c[_0x69f2('0x21')]===_0x69f2('0x22')&&typeof _0x14274c[_0x69f2('0x23')]===_0x69f2('0x22');var _0x3788f5=_0x540c88[_0x69f2('0x24')];var _0x54566f=_0x3515b1?0x0:_0x14274c[_0x69f2('0x21')];var _0x13f775=_0x3515b1?_0x540c88[_0x69f2('0x24')]:_0x14274c['offset']+_0x14274c[_0x69f2('0x23')];var _0x4d6c3d;if(_0x13f775>=_0x3788f5){_0x13f775=_0x3788f5;_0x4d6c3d=0xc8;}else{_0x4d6c3d=0xce;}_0x1b3f83[_0x69f2('0x1f')](_0x4d6c3d);return _0x1b3f83[_0x69f2('0x25')]('Content-Range',_0x54566f+'-'+_0x13f775+'/'+_0x3788f5)[_0x69f2('0x26')](_0x540c88);}return null;};}function patchUpdates(_0x42b4bf){return function(_0x199210){try{jsonpatch[_0x69f2('0x27')](_0x199210,_0x42b4bf,!![]);}catch(_0x1b7c12){return BPromise[_0x69f2('0x28')](_0x1b7c12);}return _0x199210['save']();};}function saveUpdates(_0x577579,_0xf24fd0){return function(_0x388599){if(_0x388599){return _0x388599[_0x69f2('0x29')](_0x577579)[_0x69f2('0x2a')](function(_0x235c1c){return _0x235c1c;});}return null;};}function removeEntity(_0x15a264,_0x104a52){return function(_0x4ac819){if(_0x4ac819){return _0x4ac819[_0x69f2('0x2b')]()[_0x69f2('0x2a')](function(){_0x15a264[_0x69f2('0x1f')](0xcc)[_0x69f2('0x20')]();});}};}function handleEntityNotFound(_0x391178,_0x579d05){return function(_0x516c08){if(!_0x516c08){_0x391178[_0x69f2('0x1e')](0x194);}return _0x516c08;};}function handleError(_0x128cb5,_0x254470){_0x254470=_0x254470||0x1f4;return function(_0x48d36c){logger[_0x69f2('0x2c')](_0x48d36c['stack']);if(_0x48d36c[_0x69f2('0x2d')]){delete _0x48d36c[_0x69f2('0x2d')];}_0x128cb5['status'](_0x254470)[_0x69f2('0x2e')](_0x48d36c);};}exports[_0x69f2('0x2f')]=function(_0xc975be,_0x5e95cf){var _0x3b661b={},_0x5df3c7={},_0xbcd257={'count':0x0,'rows':[]};var _0x180eb5=_['map'](db['ChatGroup'][_0x69f2('0x30')],function(_0x4323c6){return{'name':_0x4323c6[_0x69f2('0x31')],'type':_0x4323c6['type']['key']};});_0x5df3c7[_0x69f2('0x32')]=_[_0x69f2('0x33')](_0x180eb5,_0x69f2('0x2d'));_0x5df3c7[_0x69f2('0x34')]=_[_0x69f2('0x35')](_0xc975be[_0x69f2('0x34')]);_0x5df3c7[_0x69f2('0x36')]=_[_0x69f2('0x37')](_0x5df3c7[_0x69f2('0x32')],_0x5df3c7[_0x69f2('0x34')]);_0x3b661b['attributes']=_['intersection'](_0x5df3c7['model'],qs[_0x69f2('0x38')](_0xc975be[_0x69f2('0x34')][_0x69f2('0x38')]));_0x3b661b['attributes']=_0x3b661b['attributes'][_0x69f2('0x39')]?_0x3b661b[_0x69f2('0x3a')]:_0x5df3c7[_0x69f2('0x32')];if(!_0xc975be[_0x69f2('0x34')][_0x69f2('0x3b')](_0x69f2('0x3c'))){_0x3b661b[_0x69f2('0x23')]=qs[_0x69f2('0x23')](_0xc975be[_0x69f2('0x34')][_0x69f2('0x23')]);_0x3b661b[_0x69f2('0x21')]=qs[_0x69f2('0x21')](_0xc975be['query']['offset']);}_0x3b661b[_0x69f2('0x3d')]=qs[_0x69f2('0x3e')](_0xc975be[_0x69f2('0x34')]['sort']);_0x3b661b[_0x69f2('0x3f')]=qs[_0x69f2('0x36')](_['pick'](_0xc975be['query'],_0x5df3c7[_0x69f2('0x36')]),_0x180eb5);if(_0xc975be[_0x69f2('0x34')][_0x69f2('0x40')]){_0x3b661b[_0x69f2('0x3f')]=_[_0x69f2('0x41')](_0x3b661b[_0x69f2('0x3f')],{'$or':_['map'](_0x180eb5,function(_0x3fed5b){if(_0x3fed5b['type']!==_0x69f2('0x42')){var _0x501f70={};_0x501f70[_0x3fed5b['name']]={'$like':'%'+_0xc975be[_0x69f2('0x34')]['filter']+'%'};return _0x501f70;}})});}_0x3b661b=_['merge']({},_0x3b661b,_0xc975be[_0x69f2('0x43')]);var _0x1b9cc8={'where':_0x3b661b['where']};return db['ChatGroup']['count'](_0x1b9cc8)['then'](function(_0x218a2e){_0xbcd257[_0x69f2('0x24')]=_0x218a2e;if(_0xc975be[_0x69f2('0x34')]['includeAll']){_0x3b661b[_0x69f2('0x44')]=[{'all':!![]}];}return db[_0x69f2('0x45')][_0x69f2('0x46')](_0x3b661b);})['then'](function(_0x474817){_0xbcd257['rows']=_0x474817;return _0xbcd257;})[_0x69f2('0x2a')](respondWithFilteredResult(_0x5e95cf,_0x3b661b))['catch'](handleError(_0x5e95cf,null));};exports[_0x69f2('0x47')]=function(_0x1a50d7,_0x19edfd){var _0x3ac40e={'raw':!![],'where':{'id':_0x1a50d7['params']['id']}},_0x2eecf5={};_0x2eecf5[_0x69f2('0x32')]=_[_0x69f2('0x35')](db[_0x69f2('0x45')][_0x69f2('0x30')]);_0x2eecf5['query']=_[_0x69f2('0x35')](_0x1a50d7[_0x69f2('0x34')]);_0x2eecf5[_0x69f2('0x36')]=_[_0x69f2('0x37')](_0x2eecf5['model'],_0x2eecf5[_0x69f2('0x34')]);_0x3ac40e['attributes']=_[_0x69f2('0x37')](_0x2eecf5[_0x69f2('0x32')],qs[_0x69f2('0x38')](_0x1a50d7['query']['fields']));_0x3ac40e[_0x69f2('0x3a')]=_0x3ac40e[_0x69f2('0x3a')]['length']?_0x3ac40e[_0x69f2('0x3a')]:_0x2eecf5[_0x69f2('0x32')];if(_0x1a50d7['query'][_0x69f2('0x48')]){_0x3ac40e['include']=[{'all':!![]}];}_0x3ac40e=_[_0x69f2('0x41')]({},_0x3ac40e,_0x1a50d7[_0x69f2('0x43')]);return db[_0x69f2('0x45')][_0x69f2('0x49')](_0x3ac40e)[_0x69f2('0x2a')](handleEntityNotFound(_0x19edfd,null))['then'](respondWithResult(_0x19edfd,null))[_0x69f2('0x4a')](handleError(_0x19edfd,null));};exports[_0x69f2('0x4b')]=function(_0x4b3a3f,_0x10f78d){return db[_0x69f2('0x45')][_0x69f2('0x4b')](_0x4b3a3f[_0x69f2('0x4c')],{})[_0x69f2('0x2a')](respondWithResult(_0x10f78d,0xc9))[_0x69f2('0x4a')](handleError(_0x10f78d,null));};exports[_0x69f2('0x29')]=function(_0x3a9aeb,_0x352859){if(_0x3a9aeb['body']['id']){delete _0x3a9aeb['body']['id'];}return db[_0x69f2('0x45')][_0x69f2('0x49')]({'where':{'id':_0x3a9aeb[_0x69f2('0x4d')]['id']}})[_0x69f2('0x2a')](handleEntityNotFound(_0x352859,null))[_0x69f2('0x2a')](saveUpdates(_0x3a9aeb['body'],null))[_0x69f2('0x2a')](respondWithResult(_0x352859,null))[_0x69f2('0x4a')](handleError(_0x352859,null));};exports[_0x69f2('0x2b')]=function(_0x1954ae,_0x3e6e24){return db['ChatGroup']['find']({'where':{'id':_0x1954ae['params']['id']}})['then'](handleEntityNotFound(_0x3e6e24,null))[_0x69f2('0x2a')](removeEntity(_0x3e6e24,null))[_0x69f2('0x4a')](handleError(_0x3e6e24,null));};exports['describe']=function(_0x478081,_0x11cee9){return db['ChatGroup']['describe']()[_0x69f2('0x2a')](respondWithResult(_0x11cee9,null))[_0x69f2('0x4a')](handleError(_0x11cee9,null));};exports[_0x69f2('0x4e')]=function(_0x5f3781,_0x5cccf9,_0x181196){return db[_0x69f2('0x4f')][_0x69f2('0x24')]({'where':{'ChatGroupId':_0x5f3781[_0x69f2('0x4d')]['id'],'ToId':_0x5f3781[_0x69f2('0x50')]['id'],'read':![]}})[_0x69f2('0x2a')](function(_0x20a1b5){return{'id':_['toInteger'](_0x5f3781[_0x69f2('0x4d')]['id']),'count':_0x20a1b5};})[_0x69f2('0x2a')](respondWithResult(_0x5cccf9,null))['catch'](handleError(_0x5cccf9,null));};exports[_0x69f2('0x51')]=function(_0x17396f,_0xa3cf38,_0x53456e){return db['ChatGroup'][_0x69f2('0x49')]({'where':{'id':_0x17396f[_0x69f2('0x4d')]['id']}})[_0x69f2('0x2a')](handleEntityNotFound(_0xa3cf38,null))[_0x69f2('0x2a')](function(_0x565b1c){if(_0x565b1c){return _0x565b1c[_0x69f2('0x51')](_0x17396f[_0x69f2('0x4c')][_0x69f2('0x52')],_[_0x69f2('0x53')](_0x17396f[_0x69f2('0x4c')],[_0x69f2('0x52'),'id'])||{});}})[_0x69f2('0x2a')](respondWithResult(_0xa3cf38,null))[_0x69f2('0x4a')](handleError(_0xa3cf38,null));};exports['getMembers']=function(_0x5af4a0,_0x27e064,_0x2e5b2b){var _0x23ad22={};var _0x245914={};var _0x4aa498;var _0x3eb553;return db[_0x69f2('0x45')][_0x69f2('0x54')]({'where':{'id':_0x5af4a0[_0x69f2('0x4d')]['id']}})[_0x69f2('0x2a')](handleEntityNotFound(_0x27e064,null))['then'](function(_0xe8e18e){if(_0xe8e18e){_0x4aa498=_0xe8e18e;_0x245914[_0x69f2('0x32')]=_[_0x69f2('0x35')](db['User'][_0x69f2('0x30')]);_0x245914['query']=_[_0x69f2('0x35')](_0x5af4a0[_0x69f2('0x34')]);_0x245914[_0x69f2('0x36')]=_[_0x69f2('0x37')](_0x245914[_0x69f2('0x32')],_0x245914[_0x69f2('0x34')]);_0x23ad22['attributes']=_[_0x69f2('0x37')](_0x245914[_0x69f2('0x32')],qs['fields'](_0x5af4a0[_0x69f2('0x34')][_0x69f2('0x38')]));_0x23ad22[_0x69f2('0x3a')]=_0x23ad22[_0x69f2('0x3a')][_0x69f2('0x39')]?_0x23ad22[_0x69f2('0x3a')]:_0x245914['model'];_0x23ad22[_0x69f2('0x3d')]=qs[_0x69f2('0x3e')](_0x5af4a0[_0x69f2('0x34')][_0x69f2('0x3e')]);_0x23ad22[_0x69f2('0x3f')]=qs[_0x69f2('0x36')](_[_0x69f2('0x55')](_0x5af4a0[_0x69f2('0x34')],_0x245914[_0x69f2('0x36')]));if(_0x5af4a0[_0x69f2('0x34')][_0x69f2('0x40')]){_0x23ad22[_0x69f2('0x3f')]=_['merge'](_0x23ad22[_0x69f2('0x3f')],{'$or':_['map'](_0x23ad22['attributes'],function(_0x96ecc9){var _0x5dabde={};_0x5dabde[_0x96ecc9]={'$like':'%'+_0x5af4a0[_0x69f2('0x34')][_0x69f2('0x40')]+'%'};return _0x5dabde;})});}_0x23ad22=_[_0x69f2('0x41')]({},_0x23ad22,_0x5af4a0[_0x69f2('0x43')]);return _0x4aa498[_0x69f2('0x56')](_0x23ad22);}})[_0x69f2('0x2a')](function(_0x1bd8fb){if(_0x1bd8fb){_0x3eb553=_0x1bd8fb['length'];if(!_0x5af4a0[_0x69f2('0x34')][_0x69f2('0x3b')](_0x69f2('0x3c'))){_0x23ad22['limit']=qs[_0x69f2('0x23')](_0x5af4a0['query']['limit']);_0x23ad22['offset']=qs[_0x69f2('0x21')](_0x5af4a0[_0x69f2('0x34')][_0x69f2('0x21')]);}return _0x4aa498[_0x69f2('0x56')](_0x23ad22);}})[_0x69f2('0x2a')](function(_0x3ce000){if(_0x3ce000){return _0x3ce000?{'count':_0x3eb553,'rows':_0x3ce000}:null;}})[_0x69f2('0x2a')](respondWithResult(_0x27e064,null))['catch'](handleError(_0x27e064,null));};exports[_0x69f2('0x57')]=function(_0x1861c4,_0x3d7821,_0x2549fe){return db[_0x69f2('0x45')][_0x69f2('0x49')]({'where':{'id':_0x1861c4[_0x69f2('0x4d')]['id']}})[_0x69f2('0x2a')](handleEntityNotFound(_0x3d7821,null))[_0x69f2('0x2a')](function(_0x8aeaff){if(_0x8aeaff){return _0x8aeaff[_0x69f2('0x57')](_0x1861c4[_0x69f2('0x34')][_0x69f2('0x52')]);}})[_0x69f2('0x2a')](respondWithStatusCode(_0x3d7821,null))[_0x69f2('0x4a')](handleError(_0x3d7821,null));};exports[_0x69f2('0x58')]=function(_0x5058a2,_0x50fdd8,_0x41325e){if(_0x5058a2[_0x69f2('0x4c')]['id']){delete _0x5058a2[_0x69f2('0x4c')]['id'];}return db[_0x69f2('0x45')][_0x69f2('0x49')]({'where':{'id':_0x5058a2[_0x69f2('0x4d')]['id']}})[_0x69f2('0x2a')](handleEntityNotFound(_0x50fdd8,null))[_0x69f2('0x2a')](function(_0x1526b5){if(_0x1526b5){_0x5058a2['body'][_0x69f2('0x59')]=_0x1526b5['id'];return db[_0x69f2('0x4f')][_0x69f2('0x4b')](_0x5058a2[_0x69f2('0x4c')]);}})[_0x69f2('0x2a')](respondWithResult(_0x50fdd8,null))[_0x69f2('0x4a')](handleError(_0x50fdd8,null));};exports[_0x69f2('0x5a')]=function(_0x18d021,_0x577d3f,_0x17d308){var _0x9f1da3={};var _0x154f76={};var _0x21b472;var _0x7928fa;return db[_0x69f2('0x45')][_0x69f2('0x54')]({'where':{'id':_0x18d021[_0x69f2('0x4d')]['id']}})[_0x69f2('0x2a')](handleEntityNotFound(_0x577d3f,null))[_0x69f2('0x2a')](function(_0x2e9ba7){if(_0x2e9ba7){_0x21b472=_0x2e9ba7;_0x154f76[_0x69f2('0x32')]=_['keys'](db[_0x69f2('0x4f')][_0x69f2('0x30')]);_0x154f76[_0x69f2('0x34')]=_[_0x69f2('0x35')](_0x18d021[_0x69f2('0x34')]);_0x154f76[_0x69f2('0x36')]=_[_0x69f2('0x37')](_0x154f76[_0x69f2('0x32')],_0x154f76[_0x69f2('0x34')]);_0x9f1da3['attributes']=_[_0x69f2('0x37')](_0x154f76[_0x69f2('0x32')],qs[_0x69f2('0x38')](_0x18d021['query']['fields']));_0x9f1da3[_0x69f2('0x3a')]=_0x9f1da3[_0x69f2('0x3a')]['length']?_0x9f1da3[_0x69f2('0x3a')]:_0x154f76['model'];_0x9f1da3[_0x69f2('0x3d')]=qs[_0x69f2('0x3e')](_0x18d021['query']['sort']);_0x9f1da3[_0x69f2('0x3f')]=qs['filters'](_[_0x69f2('0x55')](_0x18d021[_0x69f2('0x34')],_0x154f76[_0x69f2('0x36')]));if(_0x18d021['query'][_0x69f2('0x40')]){_0x9f1da3[_0x69f2('0x3f')]=_['merge'](_0x9f1da3['where'],{'$or':_[_0x69f2('0x33')](_0x9f1da3[_0x69f2('0x3a')],function(_0x27dce2){var _0x4672de={};_0x4672de[_0x27dce2]={'$like':'%'+_0x18d021[_0x69f2('0x34')]['filter']+'%'};return _0x4672de;})});}if(_0x18d021[_0x69f2('0x34')][_0x69f2('0x5b')]){var _0x284fa8=_0x18d021[_0x69f2('0x34')][_0x69f2('0x5b')][_0x69f2('0x5c')](',');var _0x164da8={};_0x164da8[_0x284fa8[0x0]]={'$gte':moment(_0x284fa8[0x1])[_0x69f2('0x5d')](_0x69f2('0x5e'))};_0x9f1da3[_0x69f2('0x3f')]=_[_0x69f2('0x41')](_0x9f1da3[_0x69f2('0x3f')],_0x164da8);}_0x9f1da3=_[_0x69f2('0x41')]({},_0x9f1da3,_0x18d021[_0x69f2('0x43')]);return _0x21b472[_0x69f2('0x5a')](_0x9f1da3);}})[_0x69f2('0x2a')](function(_0x5aa13e){if(_0x5aa13e){_0x7928fa=_0x5aa13e[_0x69f2('0x39')];if(!_0x18d021[_0x69f2('0x34')][_0x69f2('0x3b')](_0x69f2('0x3c'))){_0x9f1da3[_0x69f2('0x23')]=qs[_0x69f2('0x23')](_0x18d021[_0x69f2('0x34')]['limit']);_0x9f1da3[_0x69f2('0x21')]=qs['offset'](_0x18d021['query'][_0x69f2('0x21')]);}return _0x21b472[_0x69f2('0x5a')](_0x9f1da3);}})['then'](function(_0x2f0bc4){if(_0x2f0bc4){return _0x2f0bc4?{'count':_0x7928fa,'rows':_0x2f0bc4}:null;}})[_0x69f2('0x2a')](respondWithResult(_0x577d3f,null))[_0x69f2('0x4a')](handleError(_0x577d3f,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 4052aba..e941341 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 _0x1033=['update','remove','emit','hasOwnProperty','hook','exports','ChatGroup','setMaxListeners','save'];(function(_0x2b5081,_0x45207e){var _0x5545e5=function(_0x271076){while(--_0x271076){_0x2b5081['push'](_0x2b5081['shift']());}};_0x5545e5(++_0x45207e);}(_0x1033,0x11d));var _0x3103=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x1033[_0x4792c8];return _0x35edb1;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x3103('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x3103('0x1')](0x0);var events={'afterCreate':_0x3103('0x2'),'afterUpdate':_0x3103('0x3'),'afterDestroy':_0x3103('0x4')};function emitEvent(_0x4b7881){return function(_0x592134,_0x431007,_0x5b10c1){ChatGroupEvents['emit'](_0x4b7881+':'+_0x592134['id'],_0x592134);ChatGroupEvents[_0x3103('0x5')](_0x4b7881,_0x592134);_0x5b10c1(null);};}for(var e in events){if(events[_0x3103('0x6')](e)){var event=events[e];ChatGroup[_0x3103('0x7')](e,emitEvent(event));}}module[_0x3103('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xf628=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','emit','hasOwnProperty'];(function(_0x48fa79,_0x5d6937){var _0x19cf49=function(_0x1f46ff){while(--_0x1f46ff){_0x48fa79['push'](_0x48fa79['shift']());}};_0x19cf49(++_0x5d6937);}(_0xf628,0x7f));var _0x8f62=function(_0x2a7503,_0x56ae52){_0x2a7503=_0x2a7503-0x0;var _0x348f22=_0xf628[_0x2a7503];return _0x348f22;};'use strict';var EventEmitter=require(_0x8f62('0x0'));var ChatGroup=require(_0x8f62('0x1'))['db'][_0x8f62('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8f62('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x393c04){return function(_0x18593f,_0x1706d2,_0x2377a5){ChatGroupEvents[_0x8f62('0x4')](_0x393c04+':'+_0x18593f['id'],_0x18593f);ChatGroupEvents['emit'](_0x393c04,_0x18593f);_0x2377a5(null);};}for(var e in events){if(events[_0x8f62('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8f62('0x6')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index aecd7fc..9e54f48 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 _0x5e8d=['api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0x4b8505,_0x52433b){var _0x592308=function(_0x311e09){while(--_0x311e09){_0x4b8505['push'](_0x4b8505['shift']());}};_0x592308(++_0x52433b);}(_0x5e8d,0x1a1));var _0xd5e8=function(_0x41b117,_0x239cfa){_0x41b117=_0x41b117-0x0;var _0x37e4ed=_0x5e8d[_0x41b117];return _0x37e4ed;};'use strict';var _=require(_0xd5e8('0x0'));var util=require(_0xd5e8('0x1'));var logger=require(_0xd5e8('0x2'))(_0xd5e8('0x3'));var moment=require(_0xd5e8('0x4'));var BPromise=require(_0xd5e8('0x5'));var rp=require(_0xd5e8('0x6'));var fs=require('fs');var path=require(_0xd5e8('0x7'));var rimraf=require(_0xd5e8('0x8'));var config=require('../../config/environment');var attributes=require(_0xd5e8('0x9'));module[_0xd5e8('0xa')]=function(_0x285f62,_0x226357){return _0x285f62[_0xd5e8('0xb')](_0xd5e8('0xc'),attributes,{'tableName':_0xd5e8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xff9b=['bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','lodash','util','../../config/logger','api','moment'];(function(_0x3342a1,_0x1db16d){var _0x3bb43b=function(_0x16b48c){while(--_0x16b48c){_0x3342a1['push'](_0x3342a1['shift']());}};_0x3bb43b(++_0x1db16d);}(_0xff9b,0x19b));var _0xbff9=function(_0x8f0755,_0x9b2637){_0x8f0755=_0x8f0755-0x0;var _0x2b2997=_0xff9b[_0x8f0755];return _0x2b2997;};'use strict';var _=require(_0xbff9('0x0'));var util=require(_0xbff9('0x1'));var logger=require(_0xbff9('0x2'))(_0xbff9('0x3'));var moment=require(_0xbff9('0x4'));var BPromise=require(_0xbff9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbff9('0x6'));var rimraf=require(_0xbff9('0x7'));var config=require(_0xbff9('0x8'));var attributes=require(_0xbff9('0x9'));module[_0xbff9('0xa')]=function(_0x54eb18,_0x1721e0){return _0x54eb18[_0xbff9('0xb')](_0xbff9('0xc'),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 bd0bd36..6e41ca1 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 _0xe14f=['then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe14f,0xea));var _0xfe14=function(_0x73e513,_0x30624a){_0x73e513=_0x73e513-0x0;var _0x4a4e7a=_0xe14f[_0x73e513];return _0x4a4e7a;};'use strict';var _=require(_0xfe14('0x0'));var util=require(_0xfe14('0x1'));var moment=require(_0xfe14('0x2'));var BPromise=require(_0xfe14('0x3'));var rs=require(_0xfe14('0x4'));var fs=require('fs');var Redis=require(_0xfe14('0x5'));var db=require(_0xfe14('0x6'))['db'];var utils=require(_0xfe14('0x7'));var logger=require(_0xfe14('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfe14('0x9'));var client=jayson['client'][_0xfe14('0xa')]({'port':0x232a});config[_0xfe14('0xb')]=_[_0xfe14('0xc')](config[_0xfe14('0xb')],{'host':_0xfe14('0xd'),'port':0x18eb});var socket=require(_0xfe14('0xe'))(new Redis(config[_0xfe14('0xb')]));require(_0xfe14('0xf'))[_0xfe14('0x10')](socket);function respondWithRpcPromise(_0x540586,_0x2a85b0,_0x3a8713){return new BPromise(function(_0x2bc525,_0x403478){return client[_0xfe14('0x11')](_0x540586,_0x3a8713)[_0xfe14('0x12')](function(_0x4ae9a6){logger[_0xfe14('0x13')]('ChatGroup,\x20%s,\x20%s',_0x2a85b0,_0xfe14('0x14'));logger[_0xfe14('0x15')](_0xfe14('0x16'),_0x2a85b0,_0xfe14('0x14'),JSON[_0xfe14('0x17')](_0x4ae9a6));if(_0x4ae9a6[_0xfe14('0x18')]){if(_0x4ae9a6['error']['code']===0x1f4){logger[_0xfe14('0x18')](_0xfe14('0x19'),_0x2a85b0,_0x4ae9a6[_0xfe14('0x18')]['message']);return _0x403478(_0x4ae9a6[_0xfe14('0x18')]['message']);}logger[_0xfe14('0x18')](_0xfe14('0x19'),_0x2a85b0,_0x4ae9a6[_0xfe14('0x18')][_0xfe14('0x1a')]);return _0x2bc525(_0x4ae9a6[_0xfe14('0x18')][_0xfe14('0x1a')]);}else{logger[_0xfe14('0x13')](_0xfe14('0x19'),_0x2a85b0,_0xfe14('0x14'));_0x2bc525(_0x4ae9a6['result']['message']);}})[_0xfe14('0x1b')](function(_0x44435d){logger[_0xfe14('0x18')](_0xfe14('0x19'),_0x2a85b0,_0x44435d);_0x403478(_0x44435d);});});}
\ No newline at end of file
+var _0x3821=['./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x58fa61,_0xc86740){var _0x1cc982=function(_0x2cb267){while(--_0x2cb267){_0x58fa61['push'](_0x58fa61['shift']());}};_0x1cc982(++_0xc86740);}(_0x3821,0xf7));var _0x1382=function(_0x2d3c35,_0x17c395){_0x2d3c35=_0x2d3c35-0x0;var _0x3ac24f=_0x3821[_0x2d3c35];return _0x3ac24f;};'use strict';var _=require(_0x1382('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1382('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1382('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1382('0x3'))(_0x1382('0x4'));var config=require(_0x1382('0x5'));var jayson=require(_0x1382('0x6'));var client=jayson[_0x1382('0x7')][_0x1382('0x8')]({'port':0x232a});config[_0x1382('0x9')]=_[_0x1382('0xa')](config[_0x1382('0x9')],{'host':_0x1382('0xb'),'port':0x18eb});var socket=require(_0x1382('0xc'))(new Redis(config['redis']));require(_0x1382('0xd'))[_0x1382('0xe')](socket);function respondWithRpcPromise(_0xe113ee,_0x525121,_0x3bf460){return new BPromise(function(_0x1fe6dc,_0x25272a){return client[_0x1382('0xf')](_0xe113ee,_0x3bf460)[_0x1382('0x10')](function(_0x30f40f){logger[_0x1382('0x11')](_0x1382('0x12'),_0x525121,_0x1382('0x13'));logger[_0x1382('0x14')](_0x1382('0x15'),_0x525121,'request\x20sent',JSON['stringify'](_0x30f40f));if(_0x30f40f[_0x1382('0x16')]){if(_0x30f40f[_0x1382('0x16')]['code']===0x1f4){logger[_0x1382('0x16')]('ChatGroup,\x20%s,\x20%s',_0x525121,_0x30f40f[_0x1382('0x16')]['message']);return _0x25272a(_0x30f40f[_0x1382('0x16')][_0x1382('0x17')]);}logger[_0x1382('0x16')](_0x1382('0x12'),_0x525121,_0x30f40f[_0x1382('0x16')][_0x1382('0x17')]);return _0x1fe6dc(_0x30f40f[_0x1382('0x16')][_0x1382('0x17')]);}else{logger[_0x1382('0x11')](_0x1382('0x12'),_0x525121,_0x1382('0x13'));_0x1fe6dc(_0x30f40f[_0x1382('0x18')]['message']);}})[_0x1382('0x19')](function(_0x37f030){logger[_0x1382('0x16')](_0x1382('0x12'),_0x525121,_0x37f030);_0x25272a(_0x37f030);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 5c328bc..111efe4 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 _0xc79f=['remove','removeListener','register','length','chatGroup:','save'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0xc79f,0x15b));var _0xfc79=function(_0x31ff63,_0x15ab56){_0x31ff63=_0x31ff63-0x0;var _0x445ba1=_0xc79f[_0x31ff63];return _0x445ba1;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xfc79('0x0'),_0xfc79('0x1'),'update'];function createListener(_0x21e7aa,_0x25f1c6){return function(_0x4e2237){_0x25f1c6['emit'](_0x21e7aa,_0x4e2237);};}function removeListener(_0x448b27,_0x48e2f5){return function(){ChatGroupEvents[_0xfc79('0x2')](_0x448b27,_0x48e2f5);};}exports[_0xfc79('0x3')]=function(_0xb435a1){for(var _0x25174c=0x0,_0x1c4272=events[_0xfc79('0x4')];_0x25174c<_0x1c4272;_0x25174c++){var _0x33f788=events[_0x25174c];var _0x191acd=createListener(_0xfc79('0x5')+_0x33f788,_0xb435a1);ChatGroupEvents['on'](_0x33f788,_0x191acd);}};
\ No newline at end of file
+var _0xe93e=['emit','length','./chatGroup.events','save','remove','update'];(function(_0x568af0,_0x5520fa){var _0x5979ae=function(_0x4ab544){while(--_0x4ab544){_0x568af0['push'](_0x568af0['shift']());}};_0x5979ae(++_0x5520fa);}(_0xe93e,0x8c));var _0xee93=function(_0x449166,_0x35d5c7){_0x449166=_0x449166-0x0;var _0x37916d=_0xe93e[_0x449166];return _0x37916d;};'use strict';var ChatGroupEvents=require(_0xee93('0x0'));var events=[_0xee93('0x1'),_0xee93('0x2'),_0xee93('0x3')];function createListener(_0x176c28,_0x1e5c96){return function(_0x91d4cb){_0x1e5c96[_0xee93('0x4')](_0x176c28,_0x91d4cb);};}function removeListener(_0x3fda59,_0x3a106c){return function(){ChatGroupEvents['removeListener'](_0x3fda59,_0x3a106c);};}exports['register']=function(_0xa5bf2e){for(var _0x359c47=0x0,_0x1b10ce=events[_0xee93('0x5')];_0x359c47<_0x1b10ce;_0x359c47++){var _0x126002=events[_0x359c47];var _0x6de3bb=createListener('chatGroup:'+_0x126002,_0xa5bf2e);ChatGroupEvents['on'](_0x126002,_0x6de3bb);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index e39320a..861d4ed 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 _0xe101=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','getUnread','/:id/members','getMembers','getMessages','post','create','addMembers','addMessage','destroy','removeMembers','exports','path'];(function(_0x14d896,_0x53578b){var _0x28679a=function(_0x14921f){while(--_0x14921f){_0x14d896['push'](_0x14d896['shift']());}};_0x28679a(++_0x53578b);}(_0xe101,0x112));var _0x1e10=function(_0x29f8dc,_0x356c82){_0x29f8dc=_0x29f8dc-0x0;var _0x5d48c4=_0xe101[_0x29f8dc];return _0x5d48c4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1e10('0x0'));var timeout=require(_0x1e10('0x1'));var express=require(_0x1e10('0x2'));var router=express[_0x1e10('0x3')]();var fs_extra=require(_0x1e10('0x4'));var auth=require(_0x1e10('0x5'));var interaction=require(_0x1e10('0x6'));var config=require(_0x1e10('0x7'));var controller=require('./chatGroup.controller');router[_0x1e10('0x8')]('/',auth[_0x1e10('0x9')](),controller[_0x1e10('0xa')]);router[_0x1e10('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x1e10('0xb')]);router['get'](_0x1e10('0xc'),auth[_0x1e10('0x9')](),controller[_0x1e10('0xd')]);router[_0x1e10('0x8')]('/:id/unread',auth[_0x1e10('0x9')](),controller[_0x1e10('0xe')]);router['get'](_0x1e10('0xf'),auth[_0x1e10('0x9')](),controller[_0x1e10('0x10')]);router[_0x1e10('0x8')]('/:id/messages',auth[_0x1e10('0x9')](),controller[_0x1e10('0x11')]);router[_0x1e10('0x12')]('/',auth['isAuthenticated'](),controller[_0x1e10('0x13')]);router[_0x1e10('0x12')](_0x1e10('0xf'),auth['isAuthenticated'](),controller[_0x1e10('0x14')]);router[_0x1e10('0x12')]('/:id/messages',auth[_0x1e10('0x9')](),controller[_0x1e10('0x15')]);router['put'](_0x1e10('0xc'),auth[_0x1e10('0x9')](),controller['update']);router['delete'](_0x1e10('0xc'),auth[_0x1e10('0x9')](),controller[_0x1e10('0x16')]);router['delete']('/:id/members',auth[_0x1e10('0x9')](),controller[_0x1e10('0x17')]);module[_0x1e10('0x18')]=router;
\ No newline at end of file
+var _0x8fbc=['fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getMembers','/:id/messages','getMessages','post','addMessage','put','update','delete','destroy','removeMembers','exports','multer','path','connect-timeout','express','Router'];(function(_0x47e70a,_0x1c3714){var _0x3a9900=function(_0x19ec6a){while(--_0x19ec6a){_0x47e70a['push'](_0x47e70a['shift']());}};_0x3a9900(++_0x1c3714);}(_0x8fbc,0x6b));var _0xc8fb=function(_0x3bff3c,_0x5e2ec6){_0x3bff3c=_0x3bff3c-0x0;var _0x82d3dd=_0x8fbc[_0x3bff3c];return _0x82d3dd;};'use strict';var multer=require(_0xc8fb('0x0'));var util=require('util');var path=require(_0xc8fb('0x1'));var timeout=require(_0xc8fb('0x2'));var express=require(_0xc8fb('0x3'));var router=express[_0xc8fb('0x4')]();var fs_extra=require(_0xc8fb('0x5'));var auth=require(_0xc8fb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc8fb('0x7'));var controller=require(_0xc8fb('0x8'));router[_0xc8fb('0x9')]('/',auth[_0xc8fb('0xa')](),controller[_0xc8fb('0xb')]);router[_0xc8fb('0x9')](_0xc8fb('0xc'),auth[_0xc8fb('0xa')](),controller[_0xc8fb('0xd')]);router[_0xc8fb('0x9')](_0xc8fb('0xe'),auth['isAuthenticated'](),controller[_0xc8fb('0xf')]);router[_0xc8fb('0x9')](_0xc8fb('0x10'),auth['isAuthenticated'](),controller['getUnread']);router[_0xc8fb('0x9')]('/:id/members',auth[_0xc8fb('0xa')](),controller[_0xc8fb('0x11')]);router[_0xc8fb('0x9')](_0xc8fb('0x12'),auth[_0xc8fb('0xa')](),controller[_0xc8fb('0x13')]);router['post']('/',auth[_0xc8fb('0xa')](),controller['create']);router[_0xc8fb('0x14')]('/:id/members',auth[_0xc8fb('0xa')](),controller['addMembers']);router[_0xc8fb('0x14')]('/:id/messages',auth[_0xc8fb('0xa')](),controller[_0xc8fb('0x15')]);router[_0xc8fb('0x16')](_0xc8fb('0xe'),auth[_0xc8fb('0xa')](),controller[_0xc8fb('0x17')]);router[_0xc8fb('0x18')](_0xc8fb('0xe'),auth[_0xc8fb('0xa')](),controller[_0xc8fb('0x19')]);router[_0xc8fb('0x18')]('/:id/members',auth[_0xc8fb('0xa')](),controller[_0xc8fb('0x1a')]);module[_0xc8fb('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index c894be9..e4f7558 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 _0x60a6=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','out','BOOLEAN'];(function(_0x396db1,_0x1a6cad){var _0x1b6beb=function(_0x56b3d2){while(--_0x56b3d2){_0x396db1['push'](_0x396db1['shift']());}};_0x1b6beb(++_0x1a6cad);}(_0x60a6,0xe9));var _0x660a=function(_0x54abb1,_0x2dac29){_0x54abb1=_0x54abb1-0x0;var _0x3f2ea1=_0x60a6[_0x54abb1];return _0x3f2ea1;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x660a('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x660a('0x1')]},'ratingType':{'type':Sequelize[_0x660a('0x2')](_0x660a('0x3'),_0x660a('0x4')),'defaultValue':_0x660a('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x660a('0x5')]},'mailTranscript':{'type':Sequelize[_0x660a('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x660a('0x7')]},'disposition':{'type':Sequelize[_0x660a('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x660a('0x6')]},'browserName':{'type':Sequelize[_0x660a('0x6')]},'browserVersion':{'type':Sequelize[_0x660a('0x6')]},'osName':{'type':Sequelize[_0x660a('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x660a('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x660a('0x6')]},'referer':{'type':Sequelize[_0x660a('0x5')]},'customerIp':{'type':Sequelize[_0x660a('0x6')]},'formData':{'type':Sequelize[_0x660a('0x5')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x660a('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x660a('0x2')]('in',_0x660a('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x660a('0x6')]},'customerPort':{'type':Sequelize[_0x660a('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x660a('0x0')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x660a('0x1')]}};
\ No newline at end of file
+var _0x959c=['thumb','TEXT','DATE','STRING','long','out','sequelize','BOOLEAN','INTEGER','ENUM','star'];(function(_0x367361,_0x311488){var _0x195d2d=function(_0x2b20a4){while(--_0x2b20a4){_0x367361['push'](_0x367361['shift']());}};_0x195d2d(++_0x311488);}(_0x959c,0x1be));var _0xc959=function(_0x29aa41,_0x512deb){_0x29aa41=_0x29aa41-0x0;var _0x3947d6=_0x959c[_0x29aa41];return _0x3947d6;};'use strict';var Sequelize=require(_0xc959('0x0'));module['exports']={'closed':{'type':Sequelize[_0xc959('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc959('0x2')]},'ratingType':{'type':Sequelize[_0xc959('0x3')](_0xc959('0x4'),_0xc959('0x5')),'defaultValue':_0xc959('0x4')},'ratingMessage':{'type':Sequelize[_0xc959('0x6')]},'pathTranscript':{'type':Sequelize[_0xc959('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc959('0x7')]},'disposition':{'type':Sequelize[_0xc959('0x8')]},'secondDisposition':{'type':Sequelize[_0xc959('0x8')]},'thirdDisposition':{'type':Sequelize[_0xc959('0x8')]},'note':{'type':Sequelize[_0xc959('0x8')]},'browserName':{'type':Sequelize[_0xc959('0x8')]},'browserVersion':{'type':Sequelize[_0xc959('0x8')]},'osName':{'type':Sequelize[_0xc959('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xc959('0x8')]},'deviceVendor':{'type':Sequelize[_0xc959('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xc959('0x6')]},'customerIp':{'type':Sequelize[_0xc959('0x8')]},'formData':{'type':Sequelize[_0xc959('0x6')](_0xc959('0x9'))},'read1stAt':{'type':Sequelize[_0xc959('0x7')]},'lastMsgAt':{'type':Sequelize[_0xc959('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xc959('0x3')]('in',_0xc959('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc959('0x8')]},'customerPort':{'type':Sequelize[_0xc959('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xc959('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xc959('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xc959('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 9fec3fc..867c93f 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 _0x3acb=['value','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','end','stack','name','body','index','map','ChatInteraction','rawAttributes','fieldName','key','getOptions','findAll','chat','show','model','query','keys','filters','intersection','attributes','fields','length','include','merge','options','create','params','find','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooApiKey','user','fullname','email','contact','account','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooNote','follow','isNull','parse','metadata','Sequelize','ValidationError','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','attachmentUpload','file','originalname','filename','mimetype','Attachment','ChatOfflineMessageId','join','root','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','Messages','User','ContactId','format','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','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','hasOwnProperty','nolimit','sort','pick','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','order','includeAgent','push','rows','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','Chat','N.A.','toString','closedAt','browserName','osName','referer','customerIp','customerPort','tail','createWriteStream','out','basename'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3acb,0x19a));var _0xb3ac=function(_0x4c12a8,_0x55d973){_0x4c12a8=_0x4c12a8-0x0;var _0x177947=_0x3acb[_0x4c12a8];return _0x177947;};'use strict';var rimraf=require(_0xb3ac('0x0'));var zipdir=require(_0xb3ac('0x1'));var rp=require(_0xb3ac('0x2'));var moment=require(_0xb3ac('0x3'));var BPromise=require(_0xb3ac('0x4'));var Mustache=require(_0xb3ac('0x5'));var util=require('util');var path=require(_0xb3ac('0x6'));var ejs=require(_0xb3ac('0x7'));var fs=require('fs');var _=require(_0xb3ac('0x8'));var Redis=require(_0xb3ac('0x9'));var interaction=require(_0xb3ac('0xa'));var qs=require(_0xb3ac('0xb'));var pdf=require('../../components/export/pdf');var logger=require(_0xb3ac('0xc'))(_0xb3ac('0xd'));var config=require(_0xb3ac('0xe'));var db=require(_0xb3ac('0xf'))['db'];config['redis']=_[_0xb3ac('0x10')](config[_0xb3ac('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0xb3ac('0x12'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xb3ac('0x13')](socket);var jayson=require(_0xb3ac('0x14'));var client=jayson[_0xb3ac('0x15')][_0xb3ac('0x16')]({'port':0x232b});var client9004=jayson[_0xb3ac('0x15')][_0xb3ac('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x20ab48,_0x585e2d,_0x357417,_0x3451ef){return new BPromise(function(_0x4499d1,_0x4fa2e7){var _0x4b41a5=_0x3451ef||client;return _0x4b41a5['request'](_0x20ab48,_0x357417)[_0xb3ac('0x17')](function(_0x333ec0){logger[_0xb3ac('0x18')](_0xb3ac('0x19'),_0x585e2d,_0xb3ac('0x1a'));logger[_0xb3ac('0x1b')](_0xb3ac('0x1c'),_0x585e2d,_0xb3ac('0x1a'),JSON['stringify'](_0x333ec0));if(_0x333ec0[_0xb3ac('0x1d')]){if(_0x333ec0[_0xb3ac('0x1d')]['code']===0x1f4){logger[_0xb3ac('0x1d')](_0xb3ac('0x19'),_0x585e2d,_0x333ec0[_0xb3ac('0x1d')][_0xb3ac('0x1e')]);return _0x4fa2e7(_0x333ec0[_0xb3ac('0x1d')][_0xb3ac('0x1e')]);}logger[_0xb3ac('0x1d')](_0xb3ac('0x19'),_0x585e2d,_0x333ec0['error'][_0xb3ac('0x1e')]);return _0x4499d1(_0x333ec0[_0xb3ac('0x1d')][_0xb3ac('0x1e')]);}else{logger['info'](_0xb3ac('0x19'),_0x585e2d,_0xb3ac('0x1a'));_0x4499d1(_0x333ec0[_0xb3ac('0x1f')]['message']);}})[_0xb3ac('0x20')](function(_0x54178d){logger[_0xb3ac('0x1d')](_0xb3ac('0x19'),_0x585e2d,_0x54178d);_0x4fa2e7(_0x54178d);});});}function respondWithStatusCode(_0x2dee1b,_0x5ef209){_0x5ef209=_0x5ef209||0xcc;return function(_0x5574f8){if(_0x5574f8){return _0x2dee1b[_0xb3ac('0x21')](_0x5ef209);}return _0x2dee1b[_0xb3ac('0x22')](_0x5ef209)['end']();};}function respondWithResult(_0x160453,_0x1f4479){_0x1f4479=_0x1f4479||0xc8;return function(_0x3353e6){if(_0x3353e6){return _0x160453[_0xb3ac('0x22')](_0x1f4479)[_0xb3ac('0x23')](_0x3353e6);}};}function respondWithFilteredResult(_0x2e336b,_0x50d730){return function(_0x226444){if(_0x226444){var _0x1a50d2=typeof _0x50d730[_0xb3ac('0x24')]===_0xb3ac('0x25')&&typeof _0x50d730[_0xb3ac('0x26')]===_0xb3ac('0x25');var _0x97292=_0x226444['count'];var _0x24cfd0=_0x1a50d2?0x0:_0x50d730[_0xb3ac('0x24')];var _0x24ca0c=_0x1a50d2?_0x226444[_0xb3ac('0x27')]:_0x50d730['offset']+_0x50d730[_0xb3ac('0x26')];var _0x3dec8e;if(_0x24ca0c>=_0x97292){_0x24ca0c=_0x97292;_0x3dec8e=0xc8;}else{_0x3dec8e=0xce;}_0x2e336b['status'](_0x3dec8e);return _0x2e336b[_0xb3ac('0x28')](_0xb3ac('0x29'),_0x24cfd0+'-'+_0x24ca0c+'/'+_0x97292)[_0xb3ac('0x23')](_0x226444);}return null;};}function saveUpdates(_0xa58835){return function(_0xb15e34){if(_0xb15e34){return _0xb15e34[_0xb3ac('0x2a')](_0xa58835)[_0xb3ac('0x17')](function(_0x9d2b80){return _0x9d2b80;});}return null;};}function removeEntity(_0x3138d3){return function(_0x38375c){if(_0x38375c){return _0x38375c['destroy']()[_0xb3ac('0x17')](function(){_0x3138d3[_0xb3ac('0x22')](0xcc)[_0xb3ac('0x2b')]();});}};}function handleEntityNotFound(_0x15e530){return function(_0x441c99){if(!_0x441c99){_0x15e530['sendStatus'](0x194);}return _0x441c99;};}function handleError(_0x2300e0,_0x4edf99){_0x4edf99=_0x4edf99||0x1f4;return function(_0x188a15){logger['error'](_0x188a15[_0xb3ac('0x2c')]);if(_0x188a15['name']){delete _0x188a15[_0xb3ac('0x2d')];}_0x2300e0['status'](_0x4edf99)['send'](_0x188a15);};}function getMustacheRender(_0xcd85bf,_0x4703a7){return Mustache['render'](_0xcd85bf,_['merge'](_0x4703a7[_0xb3ac('0x2e')],{'contact':_0x4703a7['contact'],'message':_0x4703a7[_0xb3ac('0x1e')],'agent':_0x4703a7['agent'],'interaction':_0x4703a7['interaction'],'account':_0x4703a7['account']}))||'';}exports[_0xb3ac('0x2f')]=function(_0x21d3c9,_0xb93fc6){var _0x28be53={};var _0x3347e0=_[_0xb3ac('0x30')](db[_0xb3ac('0x31')][_0xb3ac('0x32')],function(_0x5c28d9){return{'name':_0x5c28d9[_0xb3ac('0x33')],'type':_0x5c28d9['type'][_0xb3ac('0x34')]};});_0x28be53=qs[_0xb3ac('0x35')](_0x3347e0,_0x21d3c9);return interaction[_0xb3ac('0x36')](_0xb3ac('0x37'),_0x21d3c9['query'],_0x21d3c9['user'],_0x28be53,_0x3347e0)[_0xb3ac('0x17')](respondWithFilteredResult(_0xb93fc6,_0x28be53))[_0xb3ac('0x20')](handleError(_0xb93fc6,null));};exports[_0xb3ac('0x38')]=function(_0x21e678,_0x31bff6){var _0x229fbf={'raw':![],'where':{'id':_0x21e678['params']['id']}},_0x5972d3={};_0x5972d3[_0xb3ac('0x39')]=_['keys'](db[_0xb3ac('0x31')][_0xb3ac('0x32')]);_0x5972d3[_0xb3ac('0x3a')]=_[_0xb3ac('0x3b')](_0x21e678[_0xb3ac('0x3a')]);_0x5972d3[_0xb3ac('0x3c')]=_[_0xb3ac('0x3d')](_0x5972d3[_0xb3ac('0x39')],_0x5972d3['query']);_0x229fbf[_0xb3ac('0x3e')]=_['intersection'](_0x5972d3['model'],qs[_0xb3ac('0x3f')](_0x21e678[_0xb3ac('0x3a')][_0xb3ac('0x3f')]));_0x229fbf['attributes']=_0x229fbf[_0xb3ac('0x3e')][_0xb3ac('0x40')]?_0x229fbf[_0xb3ac('0x3e')]:_0x5972d3['model'];if(_0x21e678[_0xb3ac('0x3a')]['includeAll']){_0x229fbf[_0xb3ac('0x41')]=[{'all':!![]}];}_0x229fbf=_[_0xb3ac('0x42')]({},_0x229fbf,_0x21e678[_0xb3ac('0x43')]);return db[_0xb3ac('0x31')]['find'](_0x229fbf)[_0xb3ac('0x17')](handleEntityNotFound(_0x31bff6,null))[_0xb3ac('0x17')](respondWithResult(_0x31bff6,null))[_0xb3ac('0x20')](handleError(_0x31bff6,null));};exports[_0xb3ac('0x44')]=function(_0x10be85,_0x26f382){return db['ChatInteraction'][_0xb3ac('0x44')](_0x10be85[_0xb3ac('0x2e')],{})[_0xb3ac('0x17')](respondWithResult(_0x26f382,0xc9))[_0xb3ac('0x20')](handleError(_0x26f382,null));};exports[_0xb3ac('0x2a')]=function(_0x2ed300,_0x5bccf1){if(_0x2ed300[_0xb3ac('0x2e')]['id']){delete _0x2ed300[_0xb3ac('0x2e')]['id'];}return db[_0xb3ac('0x31')]['find']({'where':{'id':_0x2ed300[_0xb3ac('0x45')]['id']}})[_0xb3ac('0x17')](handleEntityNotFound(_0x5bccf1,null))['then'](saveUpdates(_0x2ed300[_0xb3ac('0x2e')],null))[_0xb3ac('0x17')](respondWithResult(_0x5bccf1,null))[_0xb3ac('0x20')](handleError(_0x5bccf1,null));};exports['destroy']=function(_0x516d6c,_0x4112af){return db[_0xb3ac('0x31')][_0xb3ac('0x46')]({'where':{'id':_0x516d6c[_0xb3ac('0x45')]['id']}})[_0xb3ac('0x17')](handleEntityNotFound(_0x4112af,null))[_0xb3ac('0x17')](removeEntity(_0x4112af,null))[_0xb3ac('0x20')](handleError(_0x4112af,null));};exports[_0xb3ac('0x47')]=function(_0x18594a,_0x4fe068){return db[_0xb3ac('0x31')]['describe']()[_0xb3ac('0x17')](respondWithResult(_0x4fe068,null))[_0xb3ac('0x20')](handleError(_0x4fe068,null));};exports['createVidaooSession']=function(_0x178e8a,_0x56d61b){var _0x6b2e32=_0x178e8a[_0xb3ac('0x45')]['id'];var _0x408551;var _0x42592c;var _0x26d748;return db[_0xb3ac('0x31')][_0xb3ac('0x48')]({'where':{'id':_0x6b2e32}})[_0xb3ac('0x17')](function(_0x58932e){_0x408551=_0x58932e;return db[_0xb3ac('0x49')][_0xb3ac('0x48')]({'where':{'id':_0x58932e[_0xb3ac('0x4a')]},'attributes':['id','vidaooApiKey',_0xb3ac('0x4b'),'vidaooTopic','vidaooNote','vidaooMetadata'],'raw':!![]});})[_0xb3ac('0x17')](function(_0x39518e){if(_0x39518e&&_0x39518e[_0xb3ac('0x4c')]&&_0x39518e[_0xb3ac('0x4b')]){_0x42592c=_0x39518e;var _0x454e13={'interaction':{'id':_0x6b2e32},'agent':{'id':_0x178e8a[_0xb3ac('0x4d')]['id'],'name':_0x178e8a['user']['name'],'fullname':_0x178e8a[_0xb3ac('0x4d')][_0xb3ac('0x4e')],'email':_0x178e8a[_0xb3ac('0x4d')][_0xb3ac('0x4f')]},'contact':_0x178e8a['body'][_0xb3ac('0x50')],'account':_0x178e8a[_0xb3ac('0x2e')][_0xb3ac('0x51')]};var _0x495f2b={'rejectUnauthorized':![],'method':'POST','url':_0xb3ac('0x52'),'headers':{'X-APIKEY':_0x39518e[_0xb3ac('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x178e8a[_0xb3ac('0x4d')][_0xb3ac('0x4f')]],'buttons':null,'topic':_0x42592c['vidaooTopic'],'note':_['isNull'](_0x42592c['vidaooNote'])?null:getMustacheRender(_0x42592c[_0xb3ac('0x53')],_0x454e13),'metadata':null},'redirect':_0xb3ac('0x54'),'json':!![]};try{if(!_[_0xb3ac('0x55')](_0x42592c['vidaooMetadata'])){var _0x11f437=getMustacheRender(_0x42592c['vidaooMetadata'],_0x454e13);var _0x12877d=JSON[_0xb3ac('0x56')](_0x11f437);_0x495f2b[_0xb3ac('0x2e')][_0xb3ac('0x57')]=_0x12877d;}}catch(_0x4c2b7c){throw new db[(_0xb3ac('0x58'))][(_0xb3ac('0x59'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x495f2b);}else{throw new db[(_0xb3ac('0x58'))][(_0xb3ac('0x59'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xb3ac('0x17')](function(_0x2ffc33){_0x26d748=_0x2ffc33;if(_0x26d748['id']){var _0x52dd94={'body':_0x26d748['join_url'],'ChatWebsiteId':_0x42592c['id'],'ChatInteractionId':_0x408551['id'],'direction':'out','UserId':_0x178e8a['user']['id']};return db[_0xb3ac('0x5a')][_0xb3ac('0x44')](_0x52dd94,{});}else{throw new db[(_0xb3ac('0x58'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xb3ac('0x17')](function(){return _0x408551[_0xb3ac('0x5b')]({'vidaooSessionId':_0x26d748['id']});})[_0xb3ac('0x17')](respondWithResult(_0x56d61b,null))[_0xb3ac('0x20')](handleError(_0x56d61b,null));};exports[_0xb3ac('0x5c')]=function(_0x55d0db,_0x4d679d){if(_0x55d0db['body']['id']){delete _0x55d0db[_0xb3ac('0x2e')]['id'];}return db[_0xb3ac('0x31')][_0xb3ac('0x46')]({'where':{'id':_0x55d0db[_0xb3ac('0x45')]['id']},'include':[{'model':db[_0xb3ac('0x5d')],'as':_0xb3ac('0x5e')}]})[_0xb3ac('0x17')](handleEntityNotFound(_0x4d679d,null))[_0xb3ac('0x17')](saveUpdates(_0x55d0db[_0xb3ac('0x2e')],null))[_0xb3ac('0x17')](respondWithResult(_0x4d679d,null))['catch'](handleError(_0x4d679d,null));};exports[_0xb3ac('0x5f')]=function(_0x3adcee,_0x43f19f){if(_0x3adcee[_0xb3ac('0x2e')]['id']){delete _0x3adcee[_0xb3ac('0x2e')]['id'];}return db[_0xb3ac('0x31')]['find']({'where':{'id':_0x3adcee[_0xb3ac('0x45')]['id']}})['then'](function(_0x3b8589){if(!_0x3b8589){logger[_0xb3ac('0x1d')](_0xb3ac('0x60'),'abandon',0x194,_0xb3ac('0x61'));_0x43f19f[_0xb3ac('0x21')](0x194);}else{if(_0x3b8589[_0xb3ac('0x62')]){throw new db[(_0xb3ac('0x58'))][(_0xb3ac('0x59'))](_0xb3ac('0x63'));}}return _0x3b8589;})[_0xb3ac('0x17')](function(_0x1967c2){if(_0x1967c2){return _0x1967c2[_0xb3ac('0x2a')]({'closed':_0x3adcee[_0xb3ac('0x2e')][_0xb3ac('0x64')],'disposition':_0x3adcee[_0xb3ac('0x2e')]['disposition']})[_0xb3ac('0x17')](function(_0x22a03a){return _0x22a03a;});}})[_0xb3ac('0x17')](function(){return respondWithRpcPromise('AbandonInteraction',_0xb3ac('0x5f'),_0x3adcee['body'],client9004);})[_0xb3ac('0x17')](respondWithResult(_0x43f19f,null))['catch'](handleError(_0x43f19f,null));};exports[_0xb3ac('0x65')]=function(_0x4ca5b3,_0xc6db11){_0x4ca5b3[_0xb3ac('0x2e')]['name']=_0x4ca5b3[_0xb3ac('0x66')][_0xb3ac('0x67')];_0x4ca5b3['body']['basename']=_0x4ca5b3[_0xb3ac('0x66')][_0xb3ac('0x68')];_0x4ca5b3['body']['type']=_0x4ca5b3[_0xb3ac('0x66')][_0xb3ac('0x69')];return db[_0xb3ac('0x6a')][_0xb3ac('0x44')](_0x4ca5b3['body'])['then'](respondWithResult(_0xc6db11,0xc9))[_0xb3ac('0x20')](handleError(_0xc6db11,null));};exports['attachmentDownload']=function(_0x42a3ac,_0x50006c){return db[_0xb3ac('0x31')][_0xb3ac('0x48')]({'where':{'id':_0x42a3ac['params']['id']},'raw':!![]})[_0xb3ac('0x17')](handleEntityNotFound(_0x50006c,null))['then'](function(_0x26a6be){if(_0x26a6be){if(_0x26a6be[_0xb3ac('0x64')]){return _0x50006c[_0xb3ac('0x22')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0xb3ac('0x6a')][_0xb3ac('0x48')]({'where':{'id':_0x42a3ac['query']['attachId']},'raw':!![]})[_0xb3ac('0x17')](handleEntityNotFound(_0x50006c,null));}})['then'](function(_0x3e9d2b){if(_0x3e9d2b){var _0x1e0056=_0x3e9d2b[_0xb3ac('0x6b')]!==null;var _0x2c3271=path[_0xb3ac('0x6c')](config[_0xb3ac('0x6d')],'server/files/attachments/');if(_0x1e0056){_0x2c3271=path[_0xb3ac('0x6c')](_0x2c3271,'offline-chat/');}var _0x3a4acc=path[_0xb3ac('0x6c')](_0x2c3271,_0x3e9d2b['basename']);return _0x50006c[_0xb3ac('0x6e')](_0x3a4acc);}})['catch'](handleError(_0x50006c,null));};exports[_0xb3ac('0x6f')]=function(_0x23973b,_0x2c3af3){var _0x1b23c9=null;var _0x52811=null;var _0x1337fb=null;if(_0x23973b['body']['id']){delete _0x23973b[_0xb3ac('0x2e')]['id'];}if(_0x23973b[_0xb3ac('0x2e')][_0xb3ac('0x70')]){_0x1337fb=path[_0xb3ac('0x6c')](config[_0xb3ac('0x6d')],_0xb3ac('0x71'),util['format'](_0xb3ac('0x72'),Date[_0xb3ac('0x73')]()));_0x23973b[_0xb3ac('0x2e')]['pathTranscript']=_0x1337fb;}return db['ChatInteraction'][_0xb3ac('0x46')]({'where':{'id':_0x23973b[_0xb3ac('0x45')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xb3ac('0x74'),'include':[{'model':db[_0xb3ac('0x75')],'as':_0xb3ac('0x75')}]}]})[_0xb3ac('0x17')](handleEntityNotFound(_0x2c3af3,null))[_0xb3ac('0x17')](saveUpdates(_0x23973b[_0xb3ac('0x2e')],null))['then'](function(_0x31991c){if(_0x31991c){_0x1b23c9=_0x31991c;return db[_0xb3ac('0x49')][_0xb3ac('0x46')]({'where':{'id':_0x1b23c9[_0xb3ac('0x4a')]}});}})['then'](function(_0x27f1c4){if(_0x27f1c4){_0x52811=_0x27f1c4;return db[_0xb3ac('0x5d')][_0xb3ac('0x46')]({'where':{'id':_0x1b23c9[_0xb3ac('0x76')]}});}})[_0xb3ac('0x17')](function(_0x2579df){if(_0x2579df){if(_0x1337fb){var _0x5e5a37=null;for(var _0x3729dc=0x1;_0x3729dc<_0x1b23c9['Messages'][_0xb3ac('0x40')];++_0x3729dc){_0x5e5a37=_0x1b23c9[_0xb3ac('0x74')][_0x3729dc];var _0x198853=_0x5e5a37[_0xb3ac('0x62')]?util[_0xb3ac('0x77')](_0xb3ac('0x78'),_0x52811[_0xb3ac('0x79')],_0x5e5a37[_0xb3ac('0x62')]):_0xb3ac('0x7a');var _0x44a6b3=_0x23973b[_0xb3ac('0x2e')]['customer']||util[_0xb3ac('0x77')]('%s%d',_0xb3ac('0x7b'),_0x5e5a37[_0xb3ac('0x76')]);switch(_0x52811[_0xb3ac('0x7c')]){case _0xb3ac('0x7d'):_0x198853=_0x5e5a37[_0xb3ac('0x62')]?util[_0xb3ac('0x77')](_0xb3ac('0x78'),_0x52811[_0xb3ac('0x79')],_0x5e5a37[_0xb3ac('0x62')]):_0xb3ac('0x7a');break;case _0xb3ac('0x7e'):_0x198853=_0x5e5a37['UserId']?_0x5e5a37[_0xb3ac('0x75')]['alias']||_0x5e5a37[_0xb3ac('0x75')]['fullname']:_0xb3ac('0x7a');break;case _0xb3ac('0x7f'):_0x198853=_0x5e5a37[_0xb3ac('0x62')]?_0x5e5a37[_0xb3ac('0x75')][_0xb3ac('0x4e')]:_0xb3ac('0x7a');break;default:_0x198853=_0x5e5a37[_0xb3ac('0x62')]?util['format'](_0xb3ac('0x78'),_0x52811[_0xb3ac('0x79')],_0x5e5a37['UserId']):_0xb3ac('0x7a');}var _0x37d8bf=util[_0xb3ac('0x77')](_0xb3ac('0x80'),moment(_0x5e5a37[_0xb3ac('0x81')])[_0xb3ac('0x77')](_0xb3ac('0x82')),_0x5e5a37[_0xb3ac('0x83')]==='in'?_0x44a6b3:_0x198853,_0x5e5a37['body']);if(!_0x5e5a37[_0xb3ac('0x84')]){fs[_0xb3ac('0x85')](_0x1337fb,_0x37d8bf);}}return db[_0xb3ac('0x86')][_0xb3ac('0x48')]({'where':{'service':!![]},'include':[{'model':db[_0xb3ac('0x87')],'as':_0xb3ac('0x88'),'raw':!![],'include':[{'model':db[_0xb3ac('0x89')],'as':_0xb3ac('0x89'),'raw':!![]}]}]});}}})['then'](function(_0x1774c8){if(!_0x1774c8||!_0x1774c8[_0xb3ac('0x88')]||!_0x23973b['body'])return _0x1b23c9;var _0x132788=_0x1774c8[_0xb3ac('0x8a')]();return respondWithRpcPromise(_0xb3ac('0x8b'),'sendMail',{'account':_0x132788,'message':{'from':util[_0xb3ac('0x77')](_0xb3ac('0x8c'),_0x1774c8[_0xb3ac('0x2d')],_0x1774c8['email']||_0x1774c8[_0xb3ac('0x88')][_0xb3ac('0x4d')]),'to':_0x23973b['body'][_0xb3ac('0x70')],'subject':_0xb3ac('0x8d'),'text':util[_0xb3ac('0x77')](_0xb3ac('0x8e'),_0x23973b[_0xb3ac('0x2e')]['mailTranscript']),'attachments':[{'path':_0x1337fb}]}})[_0xb3ac('0x17')](function(){return _0x1b23c9;})[_0xb3ac('0x20')](function(_0x344255){logger['error'](_0x344255);});})[_0xb3ac('0x17')](respondWithStatusCode(_0x2c3af3,0xc8))[_0xb3ac('0x20')](handleError(_0x2c3af3,null));};exports[_0xb3ac('0x8f')]=function(_0x1518fb,_0x4cd2b7){return db['ChatMessage']['find']({'where':{'id':_0x1518fb[_0xb3ac('0x45')]['id']}})['then'](handleEntityNotFound(_0x4cd2b7,null))[_0xb3ac('0x17')](function(_0x3976db){if(_0x3976db){return _0x3976db[_0xb3ac('0x8f')](_0x1518fb[_0xb3ac('0x2e')][_0xb3ac('0x90')],_[_0xb3ac('0x91')](_0x1518fb[_0xb3ac('0x2e')],[_0xb3ac('0x90'),'id'])||{});}})[_0xb3ac('0x17')](respondWithResult(_0x4cd2b7,null))[_0xb3ac('0x20')](handleError(_0x4cd2b7,null));};exports['getMessages']=function(_0x5d23b6,_0x2896f1){var _0xfc9245={'raw':![],'where':{}};var _0x125d90={};var _0x57ebc1={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb3ac('0x48')]({'where':{'id':_0x5d23b6[_0xb3ac('0x45')]['id']}})[_0xb3ac('0x17')](handleEntityNotFound(_0x2896f1,null))['then'](function(_0x372480){if(_0x372480){_0x125d90['model']=_[_0xb3ac('0x3b')](db[_0xb3ac('0x5a')][_0xb3ac('0x32')]);_0x125d90[_0xb3ac('0x3a')]=_[_0xb3ac('0x3b')](_0x5d23b6[_0xb3ac('0x3a')]);_0x125d90[_0xb3ac('0x3c')]=_[_0xb3ac('0x3d')](_0x125d90[_0xb3ac('0x39')],_0x125d90[_0xb3ac('0x3a')]);_0xfc9245[_0xb3ac('0x3e')]=_[_0xb3ac('0x3d')](_0x125d90[_0xb3ac('0x39')],qs[_0xb3ac('0x3f')](_0x5d23b6[_0xb3ac('0x3a')]['fields']));_0xfc9245[_0xb3ac('0x3e')]=_0xfc9245[_0xb3ac('0x3e')][_0xb3ac('0x40')]?_0xfc9245[_0xb3ac('0x3e')]:_0x125d90[_0xb3ac('0x39')];if(!_0x5d23b6[_0xb3ac('0x3a')][_0xb3ac('0x92')](_0xb3ac('0x93'))){_0xfc9245['limit']=qs[_0xb3ac('0x26')](_0x5d23b6[_0xb3ac('0x3a')][_0xb3ac('0x26')]);_0xfc9245[_0xb3ac('0x24')]=qs[_0xb3ac('0x24')](_0x5d23b6[_0xb3ac('0x3a')][_0xb3ac('0x24')]);}_0xfc9245['order']=qs[_0xb3ac('0x94')](_0x5d23b6[_0xb3ac('0x3a')][_0xb3ac('0x94')]);_0xfc9245['where']=qs['filters'](_[_0xb3ac('0x95')](_0x5d23b6[_0xb3ac('0x3a')],_0x125d90['filters']));_0xfc9245[_0xb3ac('0x96')][_0xb3ac('0x97')]=_0x372480['id'];if(_0x5d23b6[_0xb3ac('0x3a')]['filter']){_0xfc9245[_0xb3ac('0x96')]=_[_0xb3ac('0x42')](_0xfc9245[_0xb3ac('0x96')],{'$or':_[_0xb3ac('0x30')](_0xfc9245[_0xb3ac('0x3e')],function(_0x1c6c41){var _0x21a76b={};_0x21a76b[_0x1c6c41]={'$like':'%'+_0x5d23b6[_0xb3ac('0x3a')][_0xb3ac('0x98')]+'%'};return _0x21a76b;})});}if(_0x5d23b6[_0xb3ac('0x3a')][_0xb3ac('0x99')]){var _0x4d1113=_0x5d23b6[_0xb3ac('0x3a')]['$gte'][_0xb3ac('0x9a')](',');var _0x5f37bb={};_0x5f37bb[_0x4d1113[0x0]]={'$gte':moment(_0x4d1113[0x1])[_0xb3ac('0x77')](_0xb3ac('0x9b'))};_0xfc9245[_0xb3ac('0x96')]=_['merge'](_0xfc9245[_0xb3ac('0x96')],_0x5f37bb);}_0xfc9245=_[_0xb3ac('0x42')]({},_0xfc9245,_0x5d23b6[_0xb3ac('0x43')]);return db[_0xb3ac('0x5a')][_0xb3ac('0x27')]({'where':_0xfc9245[_0xb3ac('0x96')]})[_0xb3ac('0x17')](function(_0x5828f5){_0x57ebc1['count']=_0x5828f5;if(_0x5d23b6['query']['includeAll']){_0xfc9245['include']=[{'all':!![]}];}return db[_0xb3ac('0x5a')]['findAll'](_0xfc9245);})[_0xb3ac('0x17')](function(_0x1a5bb4){_0x57ebc1['rows']=_0x1a5bb4;return _0x57ebc1;});}})[_0xb3ac('0x17')](respondWithFilteredResult(_0x2896f1,_0xfc9245))[_0xb3ac('0x20')](handleError(_0x2896f1,null));};exports[_0xb3ac('0x9c')]=function(_0x20e8e6,_0x539907){var _0x1f5bb2={'where':{}},_0x538f83={},_0x2eb1d5={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb3ac('0x48')]({'where':{'id':_0x20e8e6[_0xb3ac('0x45')]['id']}})[_0xb3ac('0x17')](handleEntityNotFound(_0x539907,null))['then'](function(_0xb0e600){if(_0xb0e600){_0x538f83[_0xb3ac('0x39')]=_['keys'](db[_0xb3ac('0x5a')][_0xb3ac('0x32')]);_0x538f83[_0xb3ac('0x3a')]=_[_0xb3ac('0x3b')](_0x20e8e6[_0xb3ac('0x3a')]);_0x538f83[_0xb3ac('0x3c')]=_[_0xb3ac('0x3d')](_0x538f83[_0xb3ac('0x39')],_0x538f83[_0xb3ac('0x3a')]);_0x1f5bb2['attributes']=_[_0xb3ac('0x3d')](_0x538f83[_0xb3ac('0x39')],qs['fields'](_0x20e8e6[_0xb3ac('0x3a')][_0xb3ac('0x3f')]));_0x1f5bb2['attributes']=_0x1f5bb2[_0xb3ac('0x3e')][_0xb3ac('0x40')]?_0x1f5bb2['attributes']:_0x538f83['model'];if(!_0x20e8e6[_0xb3ac('0x3a')]['hasOwnProperty'](_0xb3ac('0x93'))){_0x1f5bb2[_0xb3ac('0x26')]=qs['limit'](_0x20e8e6['query']['limit']);_0x1f5bb2[_0xb3ac('0x24')]=qs[_0xb3ac('0x24')](_0x20e8e6['query'][_0xb3ac('0x24')]);}_0x1f5bb2[_0xb3ac('0x9d')]=qs[_0xb3ac('0x94')](_0x20e8e6['query']['sort']);_0x1f5bb2[_0xb3ac('0x96')]=qs['filters'](_[_0xb3ac('0x95')](_0x20e8e6['query'],_0x538f83[_0xb3ac('0x3c')]));_0x1f5bb2[_0xb3ac('0x96')][_0xb3ac('0x97')]=_0xb0e600['id'];if(_0x20e8e6[_0xb3ac('0x3a')][_0xb3ac('0x98')]){_0x1f5bb2['where']=_[_0xb3ac('0x42')](_0x1f5bb2[_0xb3ac('0x96')],{'$or':_[_0xb3ac('0x30')](_0x1f5bb2[_0xb3ac('0x3e')],function(_0x4a6db7){var _0x17a267={};_0x17a267[_0x4a6db7]={'$like':'%'+_0x20e8e6['query'][_0xb3ac('0x98')]+'%'};return _0x17a267;})});}_0x1f5bb2['where'][_0xb3ac('0x84')]=![];if(_0x20e8e6['query']['id']){_0x1f5bb2[_0xb3ac('0x96')]['id']={'$gt':_0x20e8e6[_0xb3ac('0x3a')]['id']};}_0x1f5bb2=_['merge']({},_0x1f5bb2,_0x20e8e6['options']);return db['ChatMessage'][_0xb3ac('0x27')]({'where':_0x1f5bb2[_0xb3ac('0x96')]})[_0xb3ac('0x17')](function(_0x1b8dbb){_0x2eb1d5[_0xb3ac('0x27')]=_0x1b8dbb;_0x1f5bb2[_0xb3ac('0x41')]=[];if(_0x20e8e6['query'][_0xb3ac('0x9e')]){_0x1f5bb2[_0xb3ac('0x41')][_0xb3ac('0x9f')]({'model':db[_0xb3ac('0x75')],'as':_0xb3ac('0x75'),'attributes':['id','fullname','alias']});}if(_0x20e8e6[_0xb3ac('0x3a')]['includeAll']){_0x1f5bb2['include']=[{'all':!![]}];}return db[_0xb3ac('0x5a')][_0xb3ac('0x36')](_0x1f5bb2);})[_0xb3ac('0x17')](function(_0x38dedd){_0x2eb1d5[_0xb3ac('0xa0')]=_0x38dedd;return _0x2eb1d5;});}})[_0xb3ac('0x17')](respondWithFilteredResult(_0x539907,_0x1f5bb2))['catch'](handleError(_0x539907,null));};exports[_0xb3ac('0xa1')]=function(_0x456e3c,_0x5975b2){return db[_0xb3ac('0x31')]['find']({'where':{'id':_0x456e3c['params']['id']}})[_0xb3ac('0x17')](handleEntityNotFound(_0x5975b2,null))['then'](function(_0x25d731){if(_0x25d731){return _0x25d731[_0xb3ac('0xa2')](_0x456e3c[_0xb3ac('0x2e')][_0xb3ac('0x90')],_[_0xb3ac('0x91')](_0x456e3c['body'],['ids','id'])||{})[_0xb3ac('0xa3')](function(){return db[_0xb3ac('0xa4')][_0xb3ac('0x36')]({'attributes':['id',_0xb3ac('0x2d'),_0xb3ac('0xa5')],'where':{'id':_0x456e3c[_0xb3ac('0x2e')][_0xb3ac('0x90')]}});})[_0xb3ac('0x17')](function(_0x40c627){socket[_0xb3ac('0xa6')](_0xb3ac('0xa7'),{'id':Number(_0x456e3c[_0xb3ac('0x45')]['id']),'tags':_0x40c627||[]});return{'id':Number(_0x456e3c[_0xb3ac('0x45')]['id']),'tags':_0x40c627||[]};});}})[_0xb3ac('0x17')](respondWithResult(_0x5975b2,null))[_0xb3ac('0x20')](handleError(_0x5975b2,null));};exports[_0xb3ac('0xa8')]=function(_0x278530,_0x4848cc){return db[_0xb3ac('0x31')][_0xb3ac('0x46')]({'where':{'id':_0x278530['params']['id']}})[_0xb3ac('0x17')](handleEntityNotFound(_0x4848cc,null))[_0xb3ac('0x17')](function(_0x562411){if(_0x562411){return _0x562411['removeTags'](_0x278530[_0xb3ac('0x3a')][_0xb3ac('0x90')]);}})[_0xb3ac('0x17')](respondWithStatusCode(_0x4848cc,null))[_0xb3ac('0x20')](handleError(_0x4848cc,null));};exports[_0xb3ac('0x6e')]=function(_0x4114bb,_0x1cc0f2){var _0xcb9495=moment()[_0xb3ac('0xa9')]()['toString']();var _0x48c21e=path[_0xb3ac('0x6c')](config[_0xb3ac('0x6d')],'server',_0xb3ac('0xaa'),_0xb3ac('0xab'));var _0x32dc8d=path[_0xb3ac('0x6c')](config[_0xb3ac('0x6d')],'server','files',_0xb3ac('0xac'));var _0x1f7118=path[_0xb3ac('0x6c')](_0x48c21e,_0xcb9495);var _0x30a678=util['format'](_0xb3ac('0xad'),_0x4114bb['params']['id'],_0xcb9495);var _0x3ad17f=path[_0xb3ac('0x6c')](_0x48c21e,_0x30a678);var _0x220b35=[];_0x220b35[_0xb3ac('0x9f')]({'model':db[_0xb3ac('0x75')],'as':_0xb3ac('0x75'),'attributes':['id','fullname'],'raw':!![]});_0x220b35[_0xb3ac('0x9f')]({'model':db[_0xb3ac('0x5d')],'as':_0xb3ac('0x5e'),'attributes':['id',_0xb3ac('0xae'),_0xb3ac('0xaf')],'raw':!![]});if(_0x4114bb[_0xb3ac('0x3a')][_0xb3ac('0xac')]){_0x220b35[_0xb3ac('0x9f')]({'model':db[_0xb3ac('0x6a')],'as':_0xb3ac('0x6a'),'raw':!![]});}var _0x2d3f7a=[{'model':db[_0xb3ac('0x5a')],'as':_0xb3ac('0x74'),'attributes':['id',_0xb3ac('0x2e'),_0xb3ac('0x81'),_0xb3ac('0x83'),_0xb3ac('0x84'),_0xb3ac('0xb0')],'include':_0x220b35}];_0x2d3f7a['push']({'model':db[_0xb3ac('0x49')],'as':_0xb3ac('0xb1'),'attributes':['id',_0xb3ac('0x2d')]});_0x2d3f7a[_0xb3ac('0x9f')]({'model':db[_0xb3ac('0x75')],'as':_0xb3ac('0xb2'),'attributes':['id',_0xb3ac('0x4e')]});return db[_0xb3ac('0x31')][_0xb3ac('0x46')]({'where':{'id':_0x4114bb[_0xb3ac('0x45')]['id']},'include':_0x2d3f7a})[_0xb3ac('0x17')](handleEntityNotFound(_0x1cc0f2,null))[_0xb3ac('0x17')](function(_0x442b98){if(_0x442b98){var _0x223ee9=_0x442b98[_0xb3ac('0xb3')]({'plain':!![]});fs['mkdirSync'](_0x1f7118);var _0x426b1d={'channel':_0xb3ac('0xb4'),'account':_0x223ee9['Account'][_0xb3ac('0x2d')],'agent':_0x223ee9[_0xb3ac('0xb2')]?_0x223ee9[_0xb3ac('0xb2')][_0xb3ac('0x4e')]:_0xb3ac('0xb5'),'createdAt':moment(_0x223ee9[_0xb3ac('0x81')])[_0xb3ac('0x77')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb3ac('0xb6')](),'closedAt':_0x223ee9[_0xb3ac('0x64')]?moment(_0x223ee9[_0xb3ac('0xb7')])['format'](_0xb3ac('0x9b'))[_0xb3ac('0xb6')]():'','disposition':_0x223ee9['disposition'],'chatInfo':{'browser':_0x223ee9[_0xb3ac('0xb8')],'os':_0x223ee9[_0xb3ac('0xb9')],'referer':_0x223ee9[_0xb3ac('0xba')],'customerIp':_0x223ee9[_0xb3ac('0xbb')],'customerPort':_0x223ee9[_0xb3ac('0xbc')]?_0x223ee9[_0xb3ac('0xbc')]:_0xb3ac('0xb5')},'messages':_(_0x223ee9['Messages'])[_0xb3ac('0xbd')]()[_0xb3ac('0x98')]({'secret':![]})[_0xb3ac('0x30')](function(_0x50cb12){if(_0x50cb12[_0xb3ac('0x6a')]){var _0x3c5c85=path[_0xb3ac('0x6c')](_0x32dc8d,_0x50cb12['Attachment']['basename']);if(fs['existsSync'](_0x3c5c85)){fs['createReadStream'](_0x3c5c85)['pipe'](fs[_0xb3ac('0xbe')](path[_0xb3ac('0x6c')](_0x1f7118,_0x50cb12[_0xb3ac('0x6a')]['basename'])));}}return{'date':moment(_0x50cb12[_0xb3ac('0x81')])['format'](_0xb3ac('0x9b'))[_0xb3ac('0xb6')](),'sender':_0x50cb12['direction']===_0xb3ac('0xbf')?_0x50cb12['User']?_0x50cb12[_0xb3ac('0x75')]['fullname']:'System':_0x50cb12[_0xb3ac('0x5e')][_0xb3ac('0xae')]+(_0x50cb12['Contact'][_0xb3ac('0xaf')]?'\x20'+_0x50cb12['Contact'][_0xb3ac('0xaf')]:''),'body':_0x50cb12[_0xb3ac('0x6a')]?_0x50cb12[_0xb3ac('0x6a')][_0xb3ac('0xc0')]:_0x50cb12['body'],'direction':_0x50cb12['direction']===_0xb3ac('0xbf')?'A':'C','secret':_0x50cb12[_0xb3ac('0x84')],'read':_0x50cb12[_0xb3ac('0xb0')],'attachment':_0x50cb12['Attachment']};})[_0xb3ac('0xc1')]()};return ejs['renderFile'](path[_0xb3ac('0x6c')](config[_0xb3ac('0x6d')],_0xb3ac('0xc2'),_0xb3ac('0xc3'),_0xb3ac('0xc4')),{'interaction':_0x426b1d})[_0xb3ac('0x17')](function(_0x268a55){var _0xc23090=path['join'](_0x1f7118,_0xb3ac('0xc5')+_0x223ee9['id']+'-'+_0xcb9495+_0xb3ac('0xc6'));var _0x54bf2c={'path':_0xc23090,'channel':_0xb3ac('0xb4'),'interactionId':_0x223ee9['id']};return pdf[_0xb3ac('0xc7')](_0x268a55,_0x54bf2c);})[_0xb3ac('0x17')](function(){return new Promise(function(_0x19c6f6,_0x1fa70b){zipdir(_0x1f7118,{'saveTo':_0x3ad17f},function(_0x52b735,_0x2599da){if(_0x52b735)return _0x1fa70b(_0x52b735);return _0x19c6f6(_0x2599da);});})['then'](function(){return new BPromise(function(_0x4dbe77,_0x545f41){rimraf(_0x1f7118,function(_0x2d7a6a){if(_0x2d7a6a)_0x545f41(_0x2d7a6a);return _0x4dbe77();});});})[_0xb3ac('0x17')](function(){return _0x1cc0f2[_0xb3ac('0x6e')](_0x3ad17f,_0x30a678,function(_0x2871a9){if(_0x2871a9){logger[_0xb3ac('0x1d')](_0xb3ac('0xc8'),_0x2871a9);}else{fs['unlinkSync'](_0x3ad17f);}});});});}else{return _0x1cc0f2[_0xb3ac('0x21')](0xc8);}})[_0xb3ac('0x20')](handleError(_0x1cc0f2,null));};
\ No newline at end of file
+var _0xe3ef=['api','../../config/environment','../../mysqldb','defaults','localhost','redis','./chatInteraction.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','update','then','destroy','stack','name','merge','body','account','index','map','ChatInteraction','fieldName','type','key','getOptions','findAll','chat','query','user','show','params','rawAttributes','keys','model','intersection','attributes','length','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','email','contact','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','format','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','secret','MailAccount','MailServerOut','Smtp','CloudProvider','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filters','fields','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','getMyMessages','hasOwnProperty','nolimit','order','sort','includeAgent','push','rows','addTags','Tag','color','emit','removeTags','files','server','transcript-%d-%s.zip','attachments','createdAt','read','Account','Owner','get','Chat','N.A.','closedAt','toString','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','direction','firstName','Contact','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','zip-dir','moment','bluebird','mustache','ejs','lodash','../../components/interaction/service','../../components/export/pdf','../../config/logger'];(function(_0x4e0022,_0x1253da){var _0x597a15=function(_0x1238b6){while(--_0x1238b6){_0x4e0022['push'](_0x4e0022['shift']());}};_0x597a15(++_0x1253da);}(_0xe3ef,0xc7));var _0xfe3e=function(_0x4c749f,_0x5ddc3c){_0x4c749f=_0x4c749f-0x0;var _0x388d3b=_0xe3ef[_0x4c749f];return _0x388d3b;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xfe3e('0x0'));var rp=require('request-promise');var moment=require(_0xfe3e('0x1'));var BPromise=require(_0xfe3e('0x2'));var Mustache=require(_0xfe3e('0x3'));var util=require('util');var path=require('path');var ejs=require(_0xfe3e('0x4'));var fs=require('fs');var _=require(_0xfe3e('0x5'));var Redis=require('ioredis');var interaction=require(_0xfe3e('0x6'));var qs=require('../../components/parsers/qs');var pdf=require(_0xfe3e('0x7'));var logger=require(_0xfe3e('0x8'))(_0xfe3e('0x9'));var config=require(_0xfe3e('0xa'));var db=require(_0xfe3e('0xb'))['db'];config['redis']=_[_0xfe3e('0xc')](config['redis'],{'host':_0xfe3e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe3e('0xe')]));require(_0xfe3e('0xf'))[_0xfe3e('0x10')](socket);var jayson=require(_0xfe3e('0x11'));var client=jayson[_0xfe3e('0x12')][_0xfe3e('0x13')]({'port':0x232b});var client9004=jayson[_0xfe3e('0x12')][_0xfe3e('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x5fe883,_0x557f63,_0x1a0d27,_0x5303cc){return new BPromise(function(_0x5aa0a4,_0x222d0d){var _0x5554a1=_0x5303cc||client;return _0x5554a1[_0xfe3e('0x14')](_0x5fe883,_0x1a0d27)['then'](function(_0x3bae61){logger[_0xfe3e('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x557f63,_0xfe3e('0x16'));logger[_0xfe3e('0x17')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x557f63,_0xfe3e('0x16'),JSON[_0xfe3e('0x18')](_0x3bae61));if(_0x3bae61[_0xfe3e('0x19')]){if(_0x3bae61[_0xfe3e('0x19')][_0xfe3e('0x1a')]===0x1f4){logger[_0xfe3e('0x19')](_0xfe3e('0x1b'),_0x557f63,_0x3bae61[_0xfe3e('0x19')][_0xfe3e('0x1c')]);return _0x222d0d(_0x3bae61[_0xfe3e('0x19')][_0xfe3e('0x1c')]);}logger[_0xfe3e('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x557f63,_0x3bae61[_0xfe3e('0x19')][_0xfe3e('0x1c')]);return _0x5aa0a4(_0x3bae61['error'][_0xfe3e('0x1c')]);}else{logger[_0xfe3e('0x15')](_0xfe3e('0x1b'),_0x557f63,_0xfe3e('0x16'));_0x5aa0a4(_0x3bae61['result'][_0xfe3e('0x1c')]);}})[_0xfe3e('0x1d')](function(_0x38e872){logger[_0xfe3e('0x19')](_0xfe3e('0x1b'),_0x557f63,_0x38e872);_0x222d0d(_0x38e872);});});}function respondWithStatusCode(_0x281621,_0x50c6eb){_0x50c6eb=_0x50c6eb||0xcc;return function(_0xee7cde){if(_0xee7cde){return _0x281621[_0xfe3e('0x1e')](_0x50c6eb);}return _0x281621[_0xfe3e('0x1f')](_0x50c6eb)[_0xfe3e('0x20')]();};}function respondWithResult(_0x2a6fac,_0x254a5a){_0x254a5a=_0x254a5a||0xc8;return function(_0x2272f8){if(_0x2272f8){return _0x2a6fac[_0xfe3e('0x1f')](_0x254a5a)['json'](_0x2272f8);}};}function respondWithFilteredResult(_0x51b6b1,_0x5be731){return function(_0x5de796){if(_0x5de796){var _0x308fec=typeof _0x5be731['offset']===_0xfe3e('0x21')&&typeof _0x5be731[_0xfe3e('0x22')]===_0xfe3e('0x21');var _0xef8938=_0x5de796[_0xfe3e('0x23')];var _0x443283=_0x308fec?0x0:_0x5be731[_0xfe3e('0x24')];var _0x38ef37=_0x308fec?_0x5de796[_0xfe3e('0x23')]:_0x5be731['offset']+_0x5be731['limit'];var _0x394fd5;if(_0x38ef37>=_0xef8938){_0x38ef37=_0xef8938;_0x394fd5=0xc8;}else{_0x394fd5=0xce;}_0x51b6b1[_0xfe3e('0x1f')](_0x394fd5);return _0x51b6b1[_0xfe3e('0x25')](_0xfe3e('0x26'),_0x443283+'-'+_0x38ef37+'/'+_0xef8938)[_0xfe3e('0x27')](_0x5de796);}return null;};}function saveUpdates(_0xce871){return function(_0x4b6528){if(_0x4b6528){return _0x4b6528[_0xfe3e('0x28')](_0xce871)[_0xfe3e('0x29')](function(_0x20d155){return _0x20d155;});}return null;};}function removeEntity(_0x5a8b24){return function(_0x2557ca){if(_0x2557ca){return _0x2557ca[_0xfe3e('0x2a')]()[_0xfe3e('0x29')](function(){_0x5a8b24['status'](0xcc)[_0xfe3e('0x20')]();});}};}function handleEntityNotFound(_0x5533b9){return function(_0x4f3713){if(!_0x4f3713){_0x5533b9['sendStatus'](0x194);}return _0x4f3713;};}function handleError(_0x313488,_0x262cd9){_0x262cd9=_0x262cd9||0x1f4;return function(_0x47e290){logger['error'](_0x47e290[_0xfe3e('0x2b')]);if(_0x47e290[_0xfe3e('0x2c')]){delete _0x47e290['name'];}_0x313488[_0xfe3e('0x1f')](_0x262cd9)['send'](_0x47e290);};}function getMustacheRender(_0x231bbb,_0x227ddf){return Mustache['render'](_0x231bbb,_[_0xfe3e('0x2d')](_0x227ddf[_0xfe3e('0x2e')],{'contact':_0x227ddf['contact'],'message':_0x227ddf[_0xfe3e('0x1c')],'agent':_0x227ddf['agent'],'interaction':_0x227ddf['interaction'],'account':_0x227ddf[_0xfe3e('0x2f')]}))||'';}exports[_0xfe3e('0x30')]=function(_0x474756,_0x4e8264){var _0x468a7b={};var _0x5c0352=_[_0xfe3e('0x31')](db[_0xfe3e('0x32')]['rawAttributes'],function(_0xcef69c){return{'name':_0xcef69c[_0xfe3e('0x33')],'type':_0xcef69c[_0xfe3e('0x34')][_0xfe3e('0x35')]};});_0x468a7b=qs[_0xfe3e('0x36')](_0x5c0352,_0x474756);return interaction[_0xfe3e('0x37')](_0xfe3e('0x38'),_0x474756[_0xfe3e('0x39')],_0x474756[_0xfe3e('0x3a')],_0x468a7b,_0x5c0352)[_0xfe3e('0x29')](respondWithFilteredResult(_0x4e8264,_0x468a7b))[_0xfe3e('0x1d')](handleError(_0x4e8264,null));};exports[_0xfe3e('0x3b')]=function(_0x1efc8b,_0x529921){var _0x2473e0={'raw':![],'where':{'id':_0x1efc8b[_0xfe3e('0x3c')]['id']}},_0x3e4a1d={};_0x3e4a1d['model']=_['keys'](db[_0xfe3e('0x32')][_0xfe3e('0x3d')]);_0x3e4a1d[_0xfe3e('0x39')]=_[_0xfe3e('0x3e')](_0x1efc8b[_0xfe3e('0x39')]);_0x3e4a1d['filters']=_['intersection'](_0x3e4a1d[_0xfe3e('0x3f')],_0x3e4a1d[_0xfe3e('0x39')]);_0x2473e0['attributes']=_[_0xfe3e('0x40')](_0x3e4a1d[_0xfe3e('0x3f')],qs['fields'](_0x1efc8b['query']['fields']));_0x2473e0['attributes']=_0x2473e0[_0xfe3e('0x41')][_0xfe3e('0x42')]?_0x2473e0['attributes']:_0x3e4a1d[_0xfe3e('0x3f')];if(_0x1efc8b['query']['includeAll']){_0x2473e0['include']=[{'all':!![]}];}_0x2473e0=_[_0xfe3e('0x2d')]({},_0x2473e0,_0x1efc8b[_0xfe3e('0x43')]);return db['ChatInteraction'][_0xfe3e('0x44')](_0x2473e0)[_0xfe3e('0x29')](handleEntityNotFound(_0x529921,null))[_0xfe3e('0x29')](respondWithResult(_0x529921,null))[_0xfe3e('0x1d')](handleError(_0x529921,null));};exports[_0xfe3e('0x45')]=function(_0x335178,_0x38d37e){return db[_0xfe3e('0x32')][_0xfe3e('0x45')](_0x335178[_0xfe3e('0x2e')],{})['then'](respondWithResult(_0x38d37e,0xc9))[_0xfe3e('0x1d')](handleError(_0x38d37e,null));};exports['update']=function(_0x408147,_0x587ca4){if(_0x408147['body']['id']){delete _0x408147['body']['id'];}return db['ChatInteraction'][_0xfe3e('0x44')]({'where':{'id':_0x408147[_0xfe3e('0x3c')]['id']}})[_0xfe3e('0x29')](handleEntityNotFound(_0x587ca4,null))['then'](saveUpdates(_0x408147['body'],null))['then'](respondWithResult(_0x587ca4,null))[_0xfe3e('0x1d')](handleError(_0x587ca4,null));};exports[_0xfe3e('0x2a')]=function(_0x28245a,_0x34a830){return db[_0xfe3e('0x32')][_0xfe3e('0x44')]({'where':{'id':_0x28245a['params']['id']}})[_0xfe3e('0x29')](handleEntityNotFound(_0x34a830,null))['then'](removeEntity(_0x34a830,null))[_0xfe3e('0x1d')](handleError(_0x34a830,null));};exports[_0xfe3e('0x46')]=function(_0x3a00c5,_0x684ca8){return db[_0xfe3e('0x32')]['describe']()[_0xfe3e('0x29')](respondWithResult(_0x684ca8,null))[_0xfe3e('0x1d')](handleError(_0x684ca8,null));};exports[_0xfe3e('0x47')]=function(_0x5c5cb0,_0x5ab735){var _0x2e5e78=_0x5c5cb0['params']['id'];var _0x39a8ab;var _0x244ffe;var _0x2e554b;return db['ChatInteraction'][_0xfe3e('0x48')]({'where':{'id':_0x2e5e78}})[_0xfe3e('0x29')](function(_0x57d076){_0x39a8ab=_0x57d076;return db[_0xfe3e('0x49')][_0xfe3e('0x48')]({'where':{'id':_0x57d076['ChatWebsiteId']},'attributes':['id',_0xfe3e('0x4a'),'vidaooEscalation',_0xfe3e('0x4b'),_0xfe3e('0x4c'),_0xfe3e('0x4d')],'raw':!![]});})['then'](function(_0x17aad0){if(_0x17aad0&&_0x17aad0['vidaooApiKey']&&_0x17aad0[_0xfe3e('0x4e')]){_0x244ffe=_0x17aad0;var _0x59d116={'interaction':{'id':_0x2e5e78},'agent':{'id':_0x5c5cb0[_0xfe3e('0x3a')]['id'],'name':_0x5c5cb0[_0xfe3e('0x3a')][_0xfe3e('0x2c')],'fullname':_0x5c5cb0[_0xfe3e('0x3a')][_0xfe3e('0x4f')],'email':_0x5c5cb0['user'][_0xfe3e('0x50')]},'contact':_0x5c5cb0[_0xfe3e('0x2e')][_0xfe3e('0x51')],'account':_0x5c5cb0['body'][_0xfe3e('0x2f')]};var _0x37793e={'rejectUnauthorized':![],'method':'POST','url':_0xfe3e('0x52'),'headers':{'X-APIKEY':_0x17aad0['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5c5cb0[_0xfe3e('0x3a')][_0xfe3e('0x50')]],'buttons':null,'topic':_0x244ffe[_0xfe3e('0x4b')],'note':_[_0xfe3e('0x53')](_0x244ffe[_0xfe3e('0x4c')])?null:getMustacheRender(_0x244ffe[_0xfe3e('0x4c')],_0x59d116),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xfe3e('0x53')](_0x244ffe['vidaooMetadata'])){var _0x485a8d=getMustacheRender(_0x244ffe[_0xfe3e('0x4d')],_0x59d116);var _0x518d57=JSON[_0xfe3e('0x54')](_0x485a8d);_0x37793e[_0xfe3e('0x2e')][_0xfe3e('0x55')]=_0x518d57;}}catch(_0x3dea80){throw new db[(_0xfe3e('0x56'))][(_0xfe3e('0x57'))](_0xfe3e('0x58'));}return rp(_0x37793e);}else{throw new db[(_0xfe3e('0x56'))][(_0xfe3e('0x57'))](_0xfe3e('0x59'));}})[_0xfe3e('0x29')](function(_0x7e57a8){_0x2e554b=_0x7e57a8;if(_0x2e554b['id']){var _0x5a9ed7={'body':_0x2e554b[_0xfe3e('0x5a')],'ChatWebsiteId':_0x244ffe['id'],'ChatInteractionId':_0x39a8ab['id'],'direction':_0xfe3e('0x5b'),'UserId':_0x5c5cb0['user']['id']};return db[_0xfe3e('0x5c')][_0xfe3e('0x45')](_0x5a9ed7,{});}else{throw new db[(_0xfe3e('0x56'))][(_0xfe3e('0x57'))](_0xfe3e('0x5d'));}})['then'](function(){return _0x39a8ab['updateAttributes']({'vidaooSessionId':_0x2e554b['id']});})[_0xfe3e('0x29')](respondWithResult(_0x5ab735,null))[_0xfe3e('0x1d')](handleError(_0x5ab735,null));};exports[_0xfe3e('0x5e')]=function(_0x23426a,_0x2d40dd){if(_0x23426a[_0xfe3e('0x2e')]['id']){delete _0x23426a[_0xfe3e('0x2e')]['id'];}return db[_0xfe3e('0x32')][_0xfe3e('0x44')]({'where':{'id':_0x23426a[_0xfe3e('0x3c')]['id']},'include':[{'model':db[_0xfe3e('0x5f')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x2d40dd,null))[_0xfe3e('0x29')](saveUpdates(_0x23426a['body'],null))[_0xfe3e('0x29')](respondWithResult(_0x2d40dd,null))[_0xfe3e('0x1d')](handleError(_0x2d40dd,null));};exports['abandon']=function(_0x4150f7,_0x4361cd){if(_0x4150f7['body']['id']){delete _0x4150f7[_0xfe3e('0x2e')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x4150f7['params']['id']}})[_0xfe3e('0x29')](function(_0x1b8c34){if(!_0x1b8c34){logger[_0xfe3e('0x19')](_0xfe3e('0x60'),_0xfe3e('0x61'),0x194,_0xfe3e('0x62'));_0x4361cd[_0xfe3e('0x1e')](0x194);}else{if(_0x1b8c34[_0xfe3e('0x63')]){throw new db[(_0xfe3e('0x56'))][(_0xfe3e('0x57'))](_0xfe3e('0x64'));}}return _0x1b8c34;})[_0xfe3e('0x29')](function(_0xad91e4){if(_0xad91e4){return _0xad91e4[_0xfe3e('0x28')]({'closed':_0x4150f7[_0xfe3e('0x2e')][_0xfe3e('0x65')],'disposition':_0x4150f7[_0xfe3e('0x2e')][_0xfe3e('0x66')]})[_0xfe3e('0x29')](function(_0x4540d0){return _0x4540d0;});}})['then'](function(){return respondWithRpcPromise(_0xfe3e('0x67'),'abandon',_0x4150f7[_0xfe3e('0x2e')],client9004);})[_0xfe3e('0x29')](respondWithResult(_0x4361cd,null))['catch'](handleError(_0x4361cd,null));};exports['attachmentUpload']=function(_0x5db298,_0x127a8e){_0x5db298[_0xfe3e('0x2e')][_0xfe3e('0x2c')]=_0x5db298[_0xfe3e('0x68')][_0xfe3e('0x69')];_0x5db298[_0xfe3e('0x2e')][_0xfe3e('0x6a')]=_0x5db298['file'][_0xfe3e('0x6b')];_0x5db298[_0xfe3e('0x2e')]['type']=_0x5db298[_0xfe3e('0x68')][_0xfe3e('0x6c')];return db[_0xfe3e('0x6d')][_0xfe3e('0x45')](_0x5db298[_0xfe3e('0x2e')])[_0xfe3e('0x29')](respondWithResult(_0x127a8e,0xc9))[_0xfe3e('0x1d')](handleError(_0x127a8e,null));};exports[_0xfe3e('0x6e')]=function(_0x1ec1c6,_0x55ec8b){return db[_0xfe3e('0x32')]['findOne']({'where':{'id':_0x1ec1c6[_0xfe3e('0x3c')]['id']},'raw':!![]})[_0xfe3e('0x29')](handleEntityNotFound(_0x55ec8b,null))['then'](function(_0x53aaf0){if(_0x53aaf0){if(_0x53aaf0[_0xfe3e('0x65')]){return _0x55ec8b[_0xfe3e('0x1f')](0x193)['json']({'status':0x193,'message':_0xfe3e('0x6f')});}return db[_0xfe3e('0x6d')][_0xfe3e('0x48')]({'where':{'id':_0x1ec1c6[_0xfe3e('0x39')]['attachId']},'raw':!![]})[_0xfe3e('0x29')](handleEntityNotFound(_0x55ec8b,null));}})['then'](function(_0x1523a0){if(_0x1523a0){var _0x41ecc8=_0x1523a0[_0xfe3e('0x70')]!==null;var _0x403520=path[_0xfe3e('0x71')](config[_0xfe3e('0x72')],_0xfe3e('0x73'));if(_0x41ecc8){_0x403520=path[_0xfe3e('0x71')](_0x403520,_0xfe3e('0x74'));}var _0xbfdf47=path[_0xfe3e('0x71')](_0x403520,_0x1523a0[_0xfe3e('0x6a')]);return _0x55ec8b[_0xfe3e('0x75')](_0xbfdf47);}})['catch'](handleError(_0x55ec8b,null));};exports[_0xfe3e('0x76')]=function(_0x40e83d,_0x18f2ae){var _0x154176=null;var _0x7bc754=null;var _0x5e3c50=null;if(_0x40e83d[_0xfe3e('0x2e')]['id']){delete _0x40e83d[_0xfe3e('0x2e')]['id'];}if(_0x40e83d['body'][_0xfe3e('0x77')]){_0x5e3c50=path['join'](config[_0xfe3e('0x72')],_0xfe3e('0x78'),util['format'](_0xfe3e('0x79'),Date[_0xfe3e('0x7a')]()));_0x40e83d[_0xfe3e('0x2e')][_0xfe3e('0x7b')]=_0x5e3c50;}return db[_0xfe3e('0x32')][_0xfe3e('0x44')]({'where':{'id':_0x40e83d['params']['id']},'include':[{'model':db[_0xfe3e('0x5c')],'as':_0xfe3e('0x7c'),'include':[{'model':db[_0xfe3e('0x7d')],'as':_0xfe3e('0x7d')}]}]})[_0xfe3e('0x29')](handleEntityNotFound(_0x18f2ae,null))[_0xfe3e('0x29')](saveUpdates(_0x40e83d[_0xfe3e('0x2e')],null))[_0xfe3e('0x29')](function(_0x5e4296){if(_0x5e4296){_0x154176=_0x5e4296;return db[_0xfe3e('0x49')][_0xfe3e('0x44')]({'where':{'id':_0x154176['ChatWebsiteId']}});}})['then'](function(_0x2fef79){if(_0x2fef79){_0x7bc754=_0x2fef79;return db[_0xfe3e('0x5f')][_0xfe3e('0x44')]({'where':{'id':_0x154176[_0xfe3e('0x7e')]}});}})[_0xfe3e('0x29')](function(_0xbb36df){if(_0xbb36df){if(_0x5e3c50){var _0x33d135=null;for(var _0xfd2edc=0x1;_0xfd2edc<_0x154176[_0xfe3e('0x7c')][_0xfe3e('0x42')];++_0xfd2edc){_0x33d135=_0x154176[_0xfe3e('0x7c')][_0xfd2edc];var _0x54a0c7=_0x33d135['UserId']?util[_0xfe3e('0x7f')](_0xfe3e('0x80'),_0x7bc754[_0xfe3e('0x81')],_0x33d135[_0xfe3e('0x63')]):_0xfe3e('0x82');var _0x4922c9=_0x40e83d[_0xfe3e('0x2e')][_0xfe3e('0x83')]||util[_0xfe3e('0x7f')]('%s%d',_0xfe3e('0x84'),_0x33d135[_0xfe3e('0x7e')]);switch(_0x7bc754[_0xfe3e('0x85')]){case _0xfe3e('0x86'):_0x54a0c7=_0x33d135[_0xfe3e('0x63')]?util['format'](_0xfe3e('0x80'),_0x7bc754[_0xfe3e('0x81')],_0x33d135['UserId']):_0xfe3e('0x82');break;case _0xfe3e('0x87'):_0x54a0c7=_0x33d135[_0xfe3e('0x63')]?_0x33d135['User'][_0xfe3e('0x88')]||_0x33d135[_0xfe3e('0x7d')][_0xfe3e('0x4f')]:'System';break;case _0xfe3e('0x89'):_0x54a0c7=_0x33d135[_0xfe3e('0x63')]?_0x33d135[_0xfe3e('0x7d')][_0xfe3e('0x4f')]:'System';break;default:_0x54a0c7=_0x33d135[_0xfe3e('0x63')]?util[_0xfe3e('0x7f')]('%s%d',_0x7bc754[_0xfe3e('0x81')],_0x33d135[_0xfe3e('0x63')]):_0xfe3e('0x82');}var _0x14a7a1=util[_0xfe3e('0x7f')]('[%s]\x20%s:\x20%s\x0a',moment(_0x33d135['createdAt'])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x33d135['direction']==='in'?_0x4922c9:_0x54a0c7,_0x33d135['body']);if(!_0x33d135[_0xfe3e('0x8a')]){fs['appendFileSync'](_0x5e3c50,_0x14a7a1);}}return db[_0xfe3e('0x8b')][_0xfe3e('0x48')]({'where':{'service':!![]},'include':[{'model':db[_0xfe3e('0x8c')],'as':_0xfe3e('0x8d'),'raw':!![],'include':[{'model':db[_0xfe3e('0x8e')],'as':_0xfe3e('0x8e'),'raw':!![]}]}]});}}})[_0xfe3e('0x29')](function(_0x11d67a){if(!_0x11d67a||!_0x11d67a[_0xfe3e('0x8d')]||!_0x40e83d['body'])return _0x154176;var _0x4db447=_0x11d67a['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xfe3e('0x8f'),{'account':_0x4db447,'message':{'from':util[_0xfe3e('0x7f')](_0xfe3e('0x90'),_0x11d67a[_0xfe3e('0x2c')],_0x11d67a['email']||_0x11d67a['Smtp']['user']),'to':_0x40e83d[_0xfe3e('0x2e')][_0xfe3e('0x77')],'subject':'Mail\x20Transcript','text':util[_0xfe3e('0x7f')](_0xfe3e('0x91'),_0x40e83d[_0xfe3e('0x2e')][_0xfe3e('0x77')]),'attachments':[{'path':_0x5e3c50}]}})['then'](function(){return _0x154176;})[_0xfe3e('0x1d')](function(_0x4054d5){logger[_0xfe3e('0x19')](_0x4054d5);});})[_0xfe3e('0x29')](respondWithStatusCode(_0x18f2ae,0xc8))[_0xfe3e('0x1d')](handleError(_0x18f2ae,null));};exports[_0xfe3e('0x92')]=function(_0x3acfc2,_0x222645){return db['ChatMessage'][_0xfe3e('0x44')]({'where':{'id':_0x3acfc2[_0xfe3e('0x3c')]['id']}})['then'](handleEntityNotFound(_0x222645,null))[_0xfe3e('0x29')](function(_0x238335){if(_0x238335){return _0x238335[_0xfe3e('0x92')](_0x3acfc2[_0xfe3e('0x2e')][_0xfe3e('0x93')],_[_0xfe3e('0x94')](_0x3acfc2['body'],[_0xfe3e('0x93'),'id'])||{});}})[_0xfe3e('0x29')](respondWithResult(_0x222645,null))[_0xfe3e('0x1d')](handleError(_0x222645,null));};exports[_0xfe3e('0x95')]=function(_0x5a5796,_0x43ba0f){var _0x163e0c={'raw':![],'where':{}};var _0x14678f={};var _0x28a2fc={'count':0x0,'rows':[]};return db[_0xfe3e('0x32')][_0xfe3e('0x48')]({'where':{'id':_0x5a5796[_0xfe3e('0x3c')]['id']}})[_0xfe3e('0x29')](handleEntityNotFound(_0x43ba0f,null))[_0xfe3e('0x29')](function(_0x215e0d){if(_0x215e0d){_0x14678f[_0xfe3e('0x3f')]=_[_0xfe3e('0x3e')](db[_0xfe3e('0x5c')][_0xfe3e('0x3d')]);_0x14678f[_0xfe3e('0x39')]=_[_0xfe3e('0x3e')](_0x5a5796['query']);_0x14678f[_0xfe3e('0x96')]=_[_0xfe3e('0x40')](_0x14678f['model'],_0x14678f[_0xfe3e('0x39')]);_0x163e0c[_0xfe3e('0x41')]=_['intersection'](_0x14678f[_0xfe3e('0x3f')],qs[_0xfe3e('0x97')](_0x5a5796['query'][_0xfe3e('0x97')]));_0x163e0c['attributes']=_0x163e0c[_0xfe3e('0x41')][_0xfe3e('0x42')]?_0x163e0c[_0xfe3e('0x41')]:_0x14678f['model'];if(!_0x5a5796[_0xfe3e('0x39')]['hasOwnProperty']('nolimit')){_0x163e0c[_0xfe3e('0x22')]=qs[_0xfe3e('0x22')](_0x5a5796[_0xfe3e('0x39')][_0xfe3e('0x22')]);_0x163e0c[_0xfe3e('0x24')]=qs[_0xfe3e('0x24')](_0x5a5796[_0xfe3e('0x39')][_0xfe3e('0x24')]);}_0x163e0c['order']=qs['sort'](_0x5a5796[_0xfe3e('0x39')]['sort']);_0x163e0c[_0xfe3e('0x98')]=qs[_0xfe3e('0x96')](_[_0xfe3e('0x99')](_0x5a5796[_0xfe3e('0x39')],_0x14678f['filters']));_0x163e0c[_0xfe3e('0x98')][_0xfe3e('0x9a')]=_0x215e0d['id'];if(_0x5a5796[_0xfe3e('0x39')][_0xfe3e('0x9b')]){_0x163e0c[_0xfe3e('0x98')]=_['merge'](_0x163e0c[_0xfe3e('0x98')],{'$or':_[_0xfe3e('0x31')](_0x163e0c[_0xfe3e('0x41')],function(_0x21c772){var _0x287b87={};_0x287b87[_0x21c772]={'$like':'%'+_0x5a5796[_0xfe3e('0x39')]['filter']+'%'};return _0x287b87;})});}if(_0x5a5796[_0xfe3e('0x39')][_0xfe3e('0x9c')]){var _0x501f31=_0x5a5796[_0xfe3e('0x39')]['$gte'][_0xfe3e('0x9d')](',');var _0x5eb9f3={};_0x5eb9f3[_0x501f31[0x0]]={'$gte':moment(_0x501f31[0x1])[_0xfe3e('0x7f')](_0xfe3e('0x9e'))};_0x163e0c[_0xfe3e('0x98')]=_[_0xfe3e('0x2d')](_0x163e0c[_0xfe3e('0x98')],_0x5eb9f3);}_0x163e0c=_[_0xfe3e('0x2d')]({},_0x163e0c,_0x5a5796[_0xfe3e('0x43')]);return db[_0xfe3e('0x5c')]['count']({'where':_0x163e0c[_0xfe3e('0x98')]})[_0xfe3e('0x29')](function(_0x1d90b4){_0x28a2fc['count']=_0x1d90b4;if(_0x5a5796[_0xfe3e('0x39')][_0xfe3e('0x9f')]){_0x163e0c[_0xfe3e('0xa0')]=[{'all':!![]}];}return db['ChatMessage'][_0xfe3e('0x37')](_0x163e0c);})[_0xfe3e('0x29')](function(_0x47c3c5){_0x28a2fc['rows']=_0x47c3c5;return _0x28a2fc;});}})['then'](respondWithFilteredResult(_0x43ba0f,_0x163e0c))['catch'](handleError(_0x43ba0f,null));};exports[_0xfe3e('0xa1')]=function(_0x11403a,_0x24782e){var _0x36fe44={'where':{}},_0x14d791={},_0x4ff548={'count':0x0,'rows':[]};return db[_0xfe3e('0x32')][_0xfe3e('0x48')]({'where':{'id':_0x11403a['params']['id']}})[_0xfe3e('0x29')](handleEntityNotFound(_0x24782e,null))[_0xfe3e('0x29')](function(_0xac14c){if(_0xac14c){_0x14d791['model']=_[_0xfe3e('0x3e')](db[_0xfe3e('0x5c')][_0xfe3e('0x3d')]);_0x14d791[_0xfe3e('0x39')]=_[_0xfe3e('0x3e')](_0x11403a[_0xfe3e('0x39')]);_0x14d791[_0xfe3e('0x96')]=_[_0xfe3e('0x40')](_0x14d791[_0xfe3e('0x3f')],_0x14d791['query']);_0x36fe44[_0xfe3e('0x41')]=_[_0xfe3e('0x40')](_0x14d791[_0xfe3e('0x3f')],qs[_0xfe3e('0x97')](_0x11403a[_0xfe3e('0x39')][_0xfe3e('0x97')]));_0x36fe44[_0xfe3e('0x41')]=_0x36fe44[_0xfe3e('0x41')][_0xfe3e('0x42')]?_0x36fe44[_0xfe3e('0x41')]:_0x14d791[_0xfe3e('0x3f')];if(!_0x11403a[_0xfe3e('0x39')][_0xfe3e('0xa2')](_0xfe3e('0xa3'))){_0x36fe44[_0xfe3e('0x22')]=qs[_0xfe3e('0x22')](_0x11403a['query'][_0xfe3e('0x22')]);_0x36fe44[_0xfe3e('0x24')]=qs[_0xfe3e('0x24')](_0x11403a[_0xfe3e('0x39')][_0xfe3e('0x24')]);}_0x36fe44[_0xfe3e('0xa4')]=qs['sort'](_0x11403a[_0xfe3e('0x39')][_0xfe3e('0xa5')]);_0x36fe44[_0xfe3e('0x98')]=qs[_0xfe3e('0x96')](_[_0xfe3e('0x99')](_0x11403a[_0xfe3e('0x39')],_0x14d791[_0xfe3e('0x96')]));_0x36fe44['where'][_0xfe3e('0x9a')]=_0xac14c['id'];if(_0x11403a[_0xfe3e('0x39')]['filter']){_0x36fe44['where']=_[_0xfe3e('0x2d')](_0x36fe44['where'],{'$or':_[_0xfe3e('0x31')](_0x36fe44['attributes'],function(_0x5a9d3a){var _0x60c60e={};_0x60c60e[_0x5a9d3a]={'$like':'%'+_0x11403a['query']['filter']+'%'};return _0x60c60e;})});}_0x36fe44[_0xfe3e('0x98')][_0xfe3e('0x8a')]=![];if(_0x11403a[_0xfe3e('0x39')]['id']){_0x36fe44[_0xfe3e('0x98')]['id']={'$gt':_0x11403a[_0xfe3e('0x39')]['id']};}_0x36fe44=_['merge']({},_0x36fe44,_0x11403a[_0xfe3e('0x43')]);return db[_0xfe3e('0x5c')][_0xfe3e('0x23')]({'where':_0x36fe44[_0xfe3e('0x98')]})[_0xfe3e('0x29')](function(_0x2155b1){_0x4ff548['count']=_0x2155b1;_0x36fe44[_0xfe3e('0xa0')]=[];if(_0x11403a[_0xfe3e('0x39')][_0xfe3e('0xa6')]){_0x36fe44[_0xfe3e('0xa0')][_0xfe3e('0xa7')]({'model':db['User'],'as':_0xfe3e('0x7d'),'attributes':['id',_0xfe3e('0x4f'),'alias']});}if(_0x11403a[_0xfe3e('0x39')][_0xfe3e('0x9f')]){_0x36fe44[_0xfe3e('0xa0')]=[{'all':!![]}];}return db[_0xfe3e('0x5c')]['findAll'](_0x36fe44);})['then'](function(_0x4b536a){_0x4ff548[_0xfe3e('0xa8')]=_0x4b536a;return _0x4ff548;});}})[_0xfe3e('0x29')](respondWithFilteredResult(_0x24782e,_0x36fe44))['catch'](handleError(_0x24782e,null));};exports[_0xfe3e('0xa9')]=function(_0x587fc6,_0x2157ac){return db['ChatInteraction'][_0xfe3e('0x44')]({'where':{'id':_0x587fc6[_0xfe3e('0x3c')]['id']}})[_0xfe3e('0x29')](handleEntityNotFound(_0x2157ac,null))['then'](function(_0xef12c8){if(_0xef12c8){return _0xef12c8['setTags'](_0x587fc6[_0xfe3e('0x2e')][_0xfe3e('0x93')],_[_0xfe3e('0x94')](_0x587fc6[_0xfe3e('0x2e')],[_0xfe3e('0x93'),'id'])||{})['spread'](function(){return db[_0xfe3e('0xaa')]['findAll']({'attributes':['id',_0xfe3e('0x2c'),_0xfe3e('0xab')],'where':{'id':_0x587fc6['body'][_0xfe3e('0x93')]}});})[_0xfe3e('0x29')](function(_0x1995f4){socket[_0xfe3e('0xac')]('chatInteractionTags:save',{'id':Number(_0x587fc6[_0xfe3e('0x3c')]['id']),'tags':_0x1995f4||[]});return{'id':Number(_0x587fc6['params']['id']),'tags':_0x1995f4||[]};});}})[_0xfe3e('0x29')](respondWithResult(_0x2157ac,null))[_0xfe3e('0x1d')](handleError(_0x2157ac,null));};exports['removeTags']=function(_0x4c2bef,_0x22763e){return db[_0xfe3e('0x32')][_0xfe3e('0x44')]({'where':{'id':_0x4c2bef['params']['id']}})[_0xfe3e('0x29')](handleEntityNotFound(_0x22763e,null))['then'](function(_0x6e9a59){if(_0x6e9a59){return _0x6e9a59[_0xfe3e('0xad')](_0x4c2bef[_0xfe3e('0x39')][_0xfe3e('0x93')]);}})[_0xfe3e('0x29')](respondWithStatusCode(_0x22763e,null))[_0xfe3e('0x1d')](handleError(_0x22763e,null));};exports['download']=function(_0x43135f,_0xa23212){var _0xaafedc=moment()['unix']()['toString']();var _0x59146c=path[_0xfe3e('0x71')](config[_0xfe3e('0x72')],'server',_0xfe3e('0xae'),'tmp');var _0x1134d2=path[_0xfe3e('0x71')](config[_0xfe3e('0x72')],_0xfe3e('0xaf'),_0xfe3e('0xae'),'attachments');var _0x3b7cde=path[_0xfe3e('0x71')](_0x59146c,_0xaafedc);var _0x196918=util[_0xfe3e('0x7f')](_0xfe3e('0xb0'),_0x43135f[_0xfe3e('0x3c')]['id'],_0xaafedc);var _0x213bee=path[_0xfe3e('0x71')](_0x59146c,_0x196918);var _0x4469a6=[];_0x4469a6[_0xfe3e('0xa7')]({'model':db[_0xfe3e('0x7d')],'as':_0xfe3e('0x7d'),'attributes':['id','fullname'],'raw':!![]});_0x4469a6['push']({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x43135f[_0xfe3e('0x39')][_0xfe3e('0xb1')]){_0x4469a6[_0xfe3e('0xa7')]({'model':db['Attachment'],'as':_0xfe3e('0x6d'),'raw':!![]});}var _0x22dbf9=[{'model':db['ChatMessage'],'as':_0xfe3e('0x7c'),'attributes':['id',_0xfe3e('0x2e'),_0xfe3e('0xb2'),'direction','secret',_0xfe3e('0xb3')],'include':_0x4469a6}];_0x22dbf9[_0xfe3e('0xa7')]({'model':db[_0xfe3e('0x49')],'as':_0xfe3e('0xb4'),'attributes':['id',_0xfe3e('0x2c')]});_0x22dbf9[_0xfe3e('0xa7')]({'model':db[_0xfe3e('0x7d')],'as':_0xfe3e('0xb5'),'attributes':['id',_0xfe3e('0x4f')]});return db[_0xfe3e('0x32')][_0xfe3e('0x44')]({'where':{'id':_0x43135f[_0xfe3e('0x3c')]['id']},'include':_0x22dbf9})[_0xfe3e('0x29')](handleEntityNotFound(_0xa23212,null))[_0xfe3e('0x29')](function(_0x2a4a26){if(_0x2a4a26){var _0x297fa8=_0x2a4a26[_0xfe3e('0xb6')]({'plain':!![]});fs['mkdirSync'](_0x3b7cde);var _0x17a6e7={'channel':_0xfe3e('0xb7'),'account':_0x297fa8[_0xfe3e('0xb4')][_0xfe3e('0x2c')],'agent':_0x297fa8[_0xfe3e('0xb5')]?_0x297fa8[_0xfe3e('0xb5')][_0xfe3e('0x4f')]:_0xfe3e('0xb8'),'createdAt':moment(_0x297fa8[_0xfe3e('0xb2')])[_0xfe3e('0x7f')](_0xfe3e('0x9e'))['toString'](),'closedAt':_0x297fa8[_0xfe3e('0x65')]?moment(_0x297fa8[_0xfe3e('0xb9')])[_0xfe3e('0x7f')](_0xfe3e('0x9e'))[_0xfe3e('0xba')]():'','disposition':_0x297fa8['disposition'],'chatInfo':{'browser':_0x297fa8[_0xfe3e('0xbb')],'os':_0x297fa8[_0xfe3e('0xbc')],'referer':_0x297fa8[_0xfe3e('0xbd')],'customerIp':_0x297fa8[_0xfe3e('0xbe')],'customerPort':_0x297fa8[_0xfe3e('0xbf')]?_0x297fa8[_0xfe3e('0xbf')]:_0xfe3e('0xb8')},'messages':_(_0x297fa8[_0xfe3e('0x7c')])[_0xfe3e('0xc0')]()[_0xfe3e('0x9b')]({'secret':![]})[_0xfe3e('0x31')](function(_0x3038c1){if(_0x3038c1['Attachment']){var _0x1c074d=path[_0xfe3e('0x71')](_0x1134d2,_0x3038c1[_0xfe3e('0x6d')][_0xfe3e('0x6a')]);if(fs[_0xfe3e('0xc1')](_0x1c074d)){fs[_0xfe3e('0xc2')](_0x1c074d)[_0xfe3e('0xc3')](fs[_0xfe3e('0xc4')](path[_0xfe3e('0x71')](_0x3b7cde,_0x3038c1[_0xfe3e('0x6d')][_0xfe3e('0x6a')])));}}return{'date':moment(_0x3038c1[_0xfe3e('0xb2')])[_0xfe3e('0x7f')](_0xfe3e('0x9e'))[_0xfe3e('0xba')](),'sender':_0x3038c1[_0xfe3e('0xc5')]===_0xfe3e('0x5b')?_0x3038c1[_0xfe3e('0x7d')]?_0x3038c1[_0xfe3e('0x7d')][_0xfe3e('0x4f')]:_0xfe3e('0x82'):_0x3038c1['Contact'][_0xfe3e('0xc6')]+(_0x3038c1[_0xfe3e('0xc7')]['lastName']?'\x20'+_0x3038c1[_0xfe3e('0xc7')]['lastName']:''),'body':_0x3038c1[_0xfe3e('0x6d')]?_0x3038c1[_0xfe3e('0x6d')][_0xfe3e('0x6a')]:_0x3038c1[_0xfe3e('0x2e')],'direction':_0x3038c1[_0xfe3e('0xc5')]===_0xfe3e('0x5b')?'A':'C','secret':_0x3038c1['secret'],'read':_0x3038c1[_0xfe3e('0xb3')],'attachment':_0x3038c1[_0xfe3e('0x6d')]};})[_0xfe3e('0xc8')]()};return ejs[_0xfe3e('0xc9')](path['join'](config[_0xfe3e('0x72')],'server',_0xfe3e('0xca'),_0xfe3e('0xcb')),{'interaction':_0x17a6e7})[_0xfe3e('0x29')](function(_0x24f604){var _0x584a61=path['join'](_0x3b7cde,_0xfe3e('0xcc')+_0x297fa8['id']+'-'+_0xaafedc+_0xfe3e('0xcd'));var _0x5e0c8c={'path':_0x584a61,'channel':_0xfe3e('0xb7'),'interactionId':_0x297fa8['id']};return pdf[_0xfe3e('0xce')](_0x24f604,_0x5e0c8c);})[_0xfe3e('0x29')](function(){return new Promise(function(_0x236fc7,_0x37bb37){zipdir(_0x3b7cde,{'saveTo':_0x213bee},function(_0x3587d5,_0x4ba6f1){if(_0x3587d5)return _0x37bb37(_0x3587d5);return _0x236fc7(_0x4ba6f1);});})[_0xfe3e('0x29')](function(){return new BPromise(function(_0x206760,_0x39bc8c){rimraf(_0x3b7cde,function(_0x36a3cd){if(_0x36a3cd)_0x39bc8c(_0x36a3cd);return _0x206760();});});})['then'](function(){return _0xa23212['download'](_0x213bee,_0x196918,function(_0x1a09ea){if(_0x1a09ea){logger[_0xfe3e('0x19')]('err',_0x1a09ea);}else{fs[_0xfe3e('0xcf')](_0x213bee);}});});});}else{return _0xa23212[_0xfe3e('0x1e')](0xc8);}})['catch'](handleError(_0xa23212,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 49ab354..89c3e61 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 _0xbabf=['map','findAll','then','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','getUsers','setDataValue'];(function(_0x40a726,_0x1664ff){var _0x3bcb60=function(_0x11aadd){while(--_0x11aadd){_0x40a726['push'](_0x40a726['shift']());}};_0x3bcb60(++_0x1664ff);}(_0xbabf,0xbd));var _0xfbab=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xbabf[_0xc4001c];return _0x49f7bc;};'use strict';var EventEmitter=require(_0xfbab('0x0'));var ChatInteraction=require(_0xfbab('0x1'))['db'][_0xfbab('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xfbab('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xfbab('0x4')](0x0);var events={'afterCreate':_0xfbab('0x5'),'afterUpdate':'update','afterDestroy':_0xfbab('0x6')};function emitEvent(_0x4138e7){return function(_0x5ccf8d,_0x257411,_0x4a39b4){_0x5ccf8d[_0xfbab('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x178932){_0x5ccf8d[_0xfbab('0x8')]('Users',_0x178932[_0xfbab('0x9')](function(_0x2182ce){return{'id':_0x2182ce['id']};}));return ChatMessage[_0xfbab('0xa')]({'where':{'ChatInteractionId':_0x5ccf8d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfbab('0xb')](function(_0x2226bb){_0x5ccf8d['setDataValue']('unreadMessages',_0x2226bb[_0xfbab('0xc')]);ChatInteractionEvents['emit'](_0x4138e7+':'+_0x5ccf8d['id'],_0x5ccf8d);ChatInteractionEvents[_0xfbab('0xd')](_0x4138e7,_0x5ccf8d);_0x4a39b4(null);})[_0xfbab('0xe')](_0x4a39b4(null));};}for(var e in events){if(events[_0xfbab('0xf')](e)){var event=events[e];ChatInteraction[_0xfbab('0x10')](e,emitEvent(event));}}module[_0xfbab('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xd879=['exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save','remove','getUsers','setDataValue','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xd879,0x122));var _0x9d87=function(_0x579bc4,_0x19f3a2){_0x579bc4=_0x579bc4-0x0;var _0x2505dc=_0xd879[_0x579bc4];return _0x2505dc;};'use strict';var EventEmitter=require(_0x9d87('0x0'));var ChatInteraction=require(_0x9d87('0x1'))['db'][_0x9d87('0x2')];var ChatMessage=require(_0x9d87('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x9d87('0x3')](0x0);var events={'afterCreate':_0x9d87('0x4'),'afterUpdate':'update','afterDestroy':_0x9d87('0x5')};function emitEvent(_0x57d916){return function(_0x551a75,_0x3d0b5c,_0x476a7d){_0x551a75[_0x9d87('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4c2bb8){_0x551a75[_0x9d87('0x7')]('Users',_0x4c2bb8[_0x9d87('0x8')](function(_0x3e7a1b){return{'id':_0x3e7a1b['id']};}));return ChatMessage[_0x9d87('0x9')]({'where':{'ChatInteractionId':_0x551a75['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9d87('0xa')](function(_0x3c209d){_0x551a75[_0x9d87('0x7')](_0x9d87('0xb'),_0x3c209d[_0x9d87('0xc')]);ChatInteractionEvents[_0x9d87('0xd')](_0x57d916+':'+_0x551a75['id'],_0x551a75);ChatInteractionEvents[_0x9d87('0xd')](_0x57d916,_0x551a75);_0x476a7d(null);})[_0x9d87('0xe')](_0x476a7d(null));};}for(var e in events){if(events[_0x9d87('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x9d87('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index a80d4eb..66ad7a7 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 _0x11b2=['rimraf','../../config/environment','exports','define','ChatInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x11b2,0x1a2));var _0x211b=function(_0x512363,_0x44048d){_0x512363=_0x512363-0x0;var _0x38d1fd=_0x11b2[_0x512363];return _0x38d1fd;};'use strict';var _=require(_0x211b('0x0'));var util=require(_0x211b('0x1'));var logger=require(_0x211b('0x2'))('api');var moment=require(_0x211b('0x3'));var BPromise=require(_0x211b('0x4'));var rp=require(_0x211b('0x5'));var fs=require('fs');var path=require(_0x211b('0x6'));var rimraf=require(_0x211b('0x7'));var config=require(_0x211b('0x8'));var attributes=require('./chatInteraction.attributes');module[_0x211b('0x9')]=function(_0x4ca473,_0x46795f){return _0x4ca473[_0x211b('0xa')](_0x211b('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x95ea11,_0x583e18,_0x33d673){if(_0x95ea11[_0x211b('0xc')](_0x211b('0xd'))){_0x95ea11[_0x211b('0xe')]=moment()['format'](_0x211b('0xf'));}_0x33d673(null,_0x95ea11);}},'charset':_0x211b('0x10'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x078a=['./chatInteraction.attributes','define','ChatInteraction','chat_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x26b5ff,_0x92009a){var _0x58603e=function(_0x4454ff){while(--_0x4454ff){_0x26b5ff['push'](_0x26b5ff['shift']());}};_0x58603e(++_0x92009a);}(_0x078a,0x1d8));var _0xa078=function(_0x1e50b6,_0x15b74d){_0x1e50b6=_0x1e50b6-0x0;var _0xc4dcb3=_0x078a[_0x1e50b6];return _0xc4dcb3;};'use strict';var _=require('lodash');var util=require(_0xa078('0x0'));var logger=require(_0xa078('0x1'))(_0xa078('0x2'));var moment=require(_0xa078('0x3'));var BPromise=require('bluebird');var rp=require(_0xa078('0x4'));var fs=require('fs');var path=require(_0xa078('0x5'));var rimraf=require(_0xa078('0x6'));var config=require(_0xa078('0x7'));var attributes=require(_0xa078('0x8'));module['exports']=function(_0x548053,_0x4dbcab){return _0x548053[_0xa078('0x9')](_0xa078('0xa'),attributes,{'tableName':_0xa078('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4eeb21,_0xa5d146,_0x33cd9d){if(_0x4eeb21['changed'](_0xa078('0xc'))){_0x4eeb21['closedAt']=moment()[_0xa078('0xd')](_0xa078('0xe'));}_0x33cd9d(null,_0x4eeb21);}},'charset':_0xa078('0xf'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index c1e1c87..550c596 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 _0xebce=['register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','attributes','limit','AddTagsToChatInteraction','find','where','body','omit','ids','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket'];(function(_0x49c481,_0x1f5ec5){var _0x58e5d3=function(_0x5f090d){while(--_0x5f090d){_0x49c481['push'](_0x49c481['shift']());}};_0x58e5d3(++_0x1f5ec5);}(_0xebce,0x118));var _0xeebc=function(_0x4a77e4,_0x556f71){_0x4a77e4=_0x4a77e4-0x0;var _0x1c68d8=_0xebce[_0x4a77e4];return _0x1c68d8;};'use strict';var _=require('lodash');var util=require(_0xeebc('0x0'));var moment=require(_0xeebc('0x1'));var BPromise=require(_0xeebc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeebc('0x3'));var db=require(_0xeebc('0x4'))['db'];var utils=require(_0xeebc('0x5'));var logger=require(_0xeebc('0x6'))('rpc');var config=require(_0xeebc('0x7'));var jayson=require(_0xeebc('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xeebc('0x9')]=_[_0xeebc('0xa')](config['redis'],{'host':_0xeebc('0xb'),'port':0x18eb});var socket=require(_0xeebc('0xc'))(new Redis(config[_0xeebc('0x9')]));require(_0xeebc('0xd'))[_0xeebc('0xe')](socket);function respondWithRpcPromise(_0x49286d,_0x3e8cfa,_0x4f22aa){return new BPromise(function(_0x52bd87,_0x56a0be){return client[_0xeebc('0xf')](_0x49286d,_0x4f22aa)[_0xeebc('0x10')](function(_0x20cf3c){logger[_0xeebc('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x3e8cfa,_0xeebc('0x12'));logger[_0xeebc('0x13')](_0xeebc('0x14'),_0x3e8cfa,_0xeebc('0x12'),JSON[_0xeebc('0x15')](_0x20cf3c));if(_0x20cf3c[_0xeebc('0x16')]){if(_0x20cf3c['error'][_0xeebc('0x17')]===0x1f4){logger[_0xeebc('0x16')](_0xeebc('0x18'),_0x3e8cfa,_0x20cf3c[_0xeebc('0x16')][_0xeebc('0x19')]);return _0x56a0be(_0x20cf3c[_0xeebc('0x16')]['message']);}logger['error'](_0xeebc('0x18'),_0x3e8cfa,_0x20cf3c[_0xeebc('0x16')][_0xeebc('0x19')]);return _0x52bd87(_0x20cf3c[_0xeebc('0x16')]['message']);}else{logger[_0xeebc('0x11')](_0xeebc('0x18'),_0x3e8cfa,_0xeebc('0x12'));_0x52bd87(_0x20cf3c[_0xeebc('0x1a')]['message']);}})[_0xeebc('0x1b')](function(_0x232845){logger[_0xeebc('0x16')](_0xeebc('0x18'),_0x3e8cfa,_0x232845);_0x56a0be(_0x232845);});});}exports[_0xeebc('0x1c')]=function(_0x428830){var _0x385395=this;return new Promise(function(_0x3c702f,_0x2c1acc){return db[_0xeebc('0x1d')][_0xeebc('0x1e')](_0x428830['body'],{'raw':_0x428830[_0xeebc('0x1f')]?_0x428830['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x428830[_0xeebc('0x1f')]?_0x428830['options']['where']||null:null,'attributes':_0x428830['options']?_0x428830['options'][_0xeebc('0x20')]||null:null,'limit':_0x428830[_0xeebc('0x1f')]?_0x428830[_0xeebc('0x1f')][_0xeebc('0x21')]||null:null})[_0xeebc('0x10')](function(_0x5ed569){logger[_0xeebc('0x11')](_0xeebc('0x1c'),_0x428830);logger['debug'](_0xeebc('0x1c'),_0x428830,JSON['stringify'](_0x5ed569));_0x3c702f(_0x5ed569);})[_0xeebc('0x1b')](function(_0x41c2b3){logger['error'](_0xeebc('0x1c'),_0x41c2b3[_0xeebc('0x19')],_0x428830);_0x2c1acc(_0x385395[_0xeebc('0x16')](0x1f4,_0x41c2b3[_0xeebc('0x19')]));});});};exports[_0xeebc('0x22')]=function(_0x37600c){return new Promise(function(_0x4f231c,_0x162244){return db[_0xeebc('0x1d')][_0xeebc('0x23')]({'where':_0x37600c[_0xeebc('0x1f')]?_0x37600c[_0xeebc('0x1f')][_0xeebc('0x24')]||null:null})[_0xeebc('0x10')](function(_0xa687fb){if(_0xa687fb){return _0xa687fb['addTags'](_0x37600c[_0xeebc('0x25')]['ids'],_[_0xeebc('0x26')](_0x37600c['body'],[_0xeebc('0x27'),'id'])||{});}})[_0xeebc('0x28')](function(_0xb1ad6b){logger[_0xeebc('0x11')]('AddTags',_0x37600c);logger['debug'](_0xeebc('0x29'),_0x37600c,JSON['stringify'](_0xb1ad6b));_0x4f231c(_0xb1ad6b);})[_0xeebc('0x1b')](function(_0x3850eb){logger['error'](_0xeebc('0x29'),_0x3850eb[_0xeebc('0x19')],_0x37600c);_0x162244(_this[_0xeebc('0x16')](0x1f4,_0x3850eb[_0xeebc('0x19')]));});});};
\ No newline at end of file
+var _0x55db=['options','where','attributes','limit','then','debug','ChatInteraction','find','addTags','body','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateChatInteraction','update','raw'];(function(_0x10356a,_0x526f4a){var _0x38d1e8=function(_0xcf1c17){while(--_0xcf1c17){_0x10356a['push'](_0x10356a['shift']());}};_0x38d1e8(++_0x526f4a);}(_0x55db,0x13a));var _0xb55d=function(_0xc2c13a,_0x1070d3){_0xc2c13a=_0xc2c13a-0x0;var _0x2b8e2f=_0x55db[_0xc2c13a];return _0x2b8e2f;};'use strict';var _=require('lodash');var util=require(_0xb55d('0x0'));var moment=require(_0xb55d('0x1'));var BPromise=require(_0xb55d('0x2'));var rs=require(_0xb55d('0x3'));var fs=require('fs');var Redis=require(_0xb55d('0x4'));var db=require(_0xb55d('0x5'))['db'];var utils=require(_0xb55d('0x6'));var logger=require(_0xb55d('0x7'))('rpc');var config=require(_0xb55d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb55d('0x9')][_0xb55d('0xa')]({'port':0x232a});config[_0xb55d('0xb')]=_[_0xb55d('0xc')](config['redis'],{'host':_0xb55d('0xd'),'port':0x18eb});var socket=require(_0xb55d('0xe'))(new Redis(config[_0xb55d('0xb')]));require(_0xb55d('0xf'))[_0xb55d('0x10')](socket);function respondWithRpcPromise(_0x174ef1,_0x3473c8,_0x28bf54){return new BPromise(function(_0x463d3,_0xd8f113){return client[_0xb55d('0x11')](_0x174ef1,_0x28bf54)['then'](function(_0x3d0f73){logger[_0xb55d('0x12')](_0xb55d('0x13'),_0x3473c8,_0xb55d('0x14'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3473c8,'request\x20sent',JSON[_0xb55d('0x15')](_0x3d0f73));if(_0x3d0f73[_0xb55d('0x16')]){if(_0x3d0f73[_0xb55d('0x16')][_0xb55d('0x17')]===0x1f4){logger[_0xb55d('0x16')](_0xb55d('0x13'),_0x3473c8,_0x3d0f73[_0xb55d('0x16')][_0xb55d('0x18')]);return _0xd8f113(_0x3d0f73[_0xb55d('0x16')][_0xb55d('0x18')]);}logger[_0xb55d('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x3473c8,_0x3d0f73[_0xb55d('0x16')][_0xb55d('0x18')]);return _0x463d3(_0x3d0f73[_0xb55d('0x16')][_0xb55d('0x18')]);}else{logger['info'](_0xb55d('0x13'),_0x3473c8,'request\x20sent');_0x463d3(_0x3d0f73[_0xb55d('0x19')]['message']);}})[_0xb55d('0x1a')](function(_0x331cd3){logger[_0xb55d('0x16')](_0xb55d('0x13'),_0x3473c8,_0x331cd3);_0xd8f113(_0x331cd3);});});}exports[_0xb55d('0x1b')]=function(_0x48477b){var _0x29d60f=this;return new Promise(function(_0xb5adbd,_0x297a9a){return db['ChatInteraction'][_0xb55d('0x1c')](_0x48477b['body'],{'raw':_0x48477b['options']?_0x48477b['options'][_0xb55d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48477b[_0xb55d('0x1e')]?_0x48477b[_0xb55d('0x1e')][_0xb55d('0x1f')]||null:null,'attributes':_0x48477b[_0xb55d('0x1e')]?_0x48477b[_0xb55d('0x1e')][_0xb55d('0x20')]||null:null,'limit':_0x48477b[_0xb55d('0x1e')]?_0x48477b['options'][_0xb55d('0x21')]||null:null})[_0xb55d('0x22')](function(_0x2b9d12){logger[_0xb55d('0x12')](_0xb55d('0x1b'),_0x48477b);logger[_0xb55d('0x23')](_0xb55d('0x1b'),_0x48477b,JSON[_0xb55d('0x15')](_0x2b9d12));_0xb5adbd(_0x2b9d12);})[_0xb55d('0x1a')](function(_0x25e963){logger['error'](_0xb55d('0x1b'),_0x25e963[_0xb55d('0x18')],_0x48477b);_0x297a9a(_0x29d60f[_0xb55d('0x16')](0x1f4,_0x25e963[_0xb55d('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x23ce21){return new Promise(function(_0x5a74fb,_0x2ae814){return db[_0xb55d('0x24')][_0xb55d('0x25')]({'where':_0x23ce21[_0xb55d('0x1e')]?_0x23ce21[_0xb55d('0x1e')][_0xb55d('0x1f')]||null:null})[_0xb55d('0x22')](function(_0x15a4e4){if(_0x15a4e4){return _0x15a4e4[_0xb55d('0x26')](_0x23ce21[_0xb55d('0x27')][_0xb55d('0x28')],_['omit'](_0x23ce21[_0xb55d('0x27')],[_0xb55d('0x28'),'id'])||{});}})[_0xb55d('0x29')](function(_0x1525ec){logger[_0xb55d('0x12')](_0xb55d('0x2a'),_0x23ce21);logger['debug'](_0xb55d('0x2a'),_0x23ce21,JSON[_0xb55d('0x15')](_0x1525ec));_0x5a74fb(_0x1525ec);})['catch'](function(_0x5a6115){logger[_0xb55d('0x16')](_0xb55d('0x2a'),_0x5a6115[_0xb55d('0x18')],_0x23ce21);_0x2ae814(_this['error'](0x1f4,_0x5a6115['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index d782db7..4e20283 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 _0x0f9b=['remove','update','emit','removeListener','register','length','chatInteraction:','save'];(function(_0x4183ea,_0xeb7bb3){var _0x3873e4=function(_0x40efd6){while(--_0x40efd6){_0x4183ea['push'](_0x4183ea['shift']());}};_0x3873e4(++_0xeb7bb3);}(_0x0f9b,0xd7));var _0xb0f9=function(_0x328b7a,_0x20d32c){_0x328b7a=_0x328b7a-0x0;var _0x22e45a=_0x0f9b[_0x328b7a];return _0x22e45a;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xb0f9('0x0'),_0xb0f9('0x1'),_0xb0f9('0x2')];function createListener(_0xd0ae53,_0x3ba07b){return function(_0x17d3f3){_0x3ba07b[_0xb0f9('0x3')](_0xd0ae53,_0x17d3f3);};}function removeListener(_0x5e5ebf,_0x16dd2){return function(){ChatInteractionEvents[_0xb0f9('0x4')](_0x5e5ebf,_0x16dd2);};}exports[_0xb0f9('0x5')]=function(_0x59efb3){for(var _0x1cdacb=0x0,_0x2dc803=events[_0xb0f9('0x6')];_0x1cdacb<_0x2dc803;_0x1cdacb++){var _0x58739e=events[_0x1cdacb];var _0x3ab299=createListener(_0xb0f9('0x7')+_0x58739e,_0x59efb3);ChatInteractionEvents['on'](_0x58739e,_0x3ab299);}};
\ No newline at end of file
+var _0xb27d=['update','emit','removeListener','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x41d1b5,_0x1bad55){var _0x2ee95c=function(_0x254b00){while(--_0x254b00){_0x41d1b5['push'](_0x41d1b5['shift']());}};_0x2ee95c(++_0x1bad55);}(_0xb27d,0xe5));var _0xdb27=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb27d[_0x17d9e3];return _0x14192d;};'use strict';var ChatInteractionEvents=require(_0xdb27('0x0'));var events=[_0xdb27('0x1'),_0xdb27('0x2'),_0xdb27('0x3')];function createListener(_0x5f0cf3,_0x19c801){return function(_0x99d137){_0x19c801[_0xdb27('0x4')](_0x5f0cf3,_0x99d137);};}function removeListener(_0x206206,_0x202669){return function(){ChatInteractionEvents[_0xdb27('0x5')](_0x206206,_0x202669);};}exports['register']=function(_0x4ce81b){for(var _0x98c60=0x0,_0x589465=events[_0xdb27('0x6')];_0x98c60<_0x589465;_0x98c60++){var _0x1b944c=events[_0x98c60];var _0x2772ad=createListener(_0xdb27('0x7')+_0x1b944c,_0x4ce81b);ChatInteractionEvents['on'](_0x1b944c,_0x2772ad);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 7de1e72..987a6bc 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 _0x942d=['file','attachmentUpload','addMessage','chat','chatinteraction:addtags','put','tracked','chatinteraction:update','update','/:id/custom_update','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMyMessages','download','post','create','/:id/vidaoo','diskStorage','join','root','format','now','originalname','replace','/:id/attachment_upload','single'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x942d,0xe2));var _0xd942=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x942d[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0xd942('0x0'));var util=require(_0xd942('0x1'));var path=require('path');var timeout=require(_0xd942('0x2'));var express=require(_0xd942('0x3'));var router=express[_0xd942('0x4')]();var fs_extra=require(_0xd942('0x5'));var auth=require(_0xd942('0x6'));var interaction=require(_0xd942('0x7'));var config=require(_0xd942('0x8'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0xd942('0x9')](),controller[_0xd942('0xa')]);router[_0xd942('0xb')](_0xd942('0xc'),auth[_0xd942('0x9')](),controller[_0xd942('0xd')]);router['get'](_0xd942('0xe'),auth[_0xd942('0xf')](),controller[_0xd942('0x10')]);router[_0xd942('0xb')](_0xd942('0x11'),auth[_0xd942('0xf')](),controller[_0xd942('0x12')]);router[_0xd942('0xb')](_0xd942('0x13'),auth[_0xd942('0x9')](),controller['getMessages']);router[_0xd942('0xb')]('/:id/my_messages',auth[_0xd942('0xf')](),controller[_0xd942('0x14')]);router[_0xd942('0xb')]('/:id/download',auth[_0xd942('0x9')](),controller[_0xd942('0x15')]);router[_0xd942('0x16')]('/',auth[_0xd942('0x9')](),controller[_0xd942('0x17')]);router['post'](_0xd942('0x18'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xd942('0x19')]({'destination':function(_0x17c6b4,_0x1f7d59,_0x3de292){_0x3de292(null,path[_0xd942('0x1a')](config[_0xd942('0x1b')],'server/files/attachments/'));},'filename':function(_0x22f6f1,_0x5a5612,_0xf423b9){_0xf423b9(null,util[_0xd942('0x1c')]('%s-%s',Date[_0xd942('0x1d')](),_0x5a5612[_0xd942('0x1e')][_0xd942('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd942('0x16')](_0xd942('0x20'),upload[_0xd942('0x21')](_0xd942('0x22')),controller[_0xd942('0x23')]);router[_0xd942('0x16')]('/:id/messages',auth[_0xd942('0xf')](),controller[_0xd942('0x24')]);router[_0xd942('0x16')]('/:id/tags',auth[_0xd942('0x9')](),interaction['tracked'](_0xd942('0x25'),_0xd942('0x26')),controller['addTags']);router[_0xd942('0x27')](_0xd942('0xe'),auth[_0xd942('0x9')](),interaction[_0xd942('0x28')](_0xd942('0x25'),_0xd942('0x29')),controller[_0xd942('0x2a')]);router[_0xd942('0x27')](_0xd942('0x2b'),controller['customUpdate']);router[_0xd942('0x27')]('/:id/abandon',auth[_0xd942('0xf')](),controller[_0xd942('0x2c')]);router[_0xd942('0x27')](_0xd942('0x2d'),controller[_0xd942('0x2e')]);router[_0xd942('0x2f')](_0xd942('0xe'),auth[_0xd942('0x9')](),interaction['tracked'](_0xd942('0x25'),_0xd942('0x30')),controller[_0xd942('0x31')]);router[_0xd942('0x2f')](_0xd942('0x32'),auth[_0xd942('0x9')](),controller['removeTags']);module[_0xd942('0x33')]=router;
\ No newline at end of file
+var _0x5e62=['isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/download','download','post','create','diskStorage','server/files/attachments/','%s-%s','now','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','chatinteraction:update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','removeTags','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id'];(function(_0xd6fcb5,_0x526523){var _0x278ac7=function(_0x3a9512){while(--_0x3a9512){_0xd6fcb5['push'](_0xd6fcb5['shift']());}};_0x278ac7(++_0x526523);}(_0x5e62,0x1d3));var _0x25e6=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x5e62[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require('multer');var util=require(_0x25e6('0x0'));var path=require(_0x25e6('0x1'));var timeout=require(_0x25e6('0x2'));var express=require(_0x25e6('0x3'));var router=express['Router']();var fs_extra=require(_0x25e6('0x4'));var auth=require(_0x25e6('0x5'));var interaction=require(_0x25e6('0x6'));var config=require(_0x25e6('0x7'));var controller=require('./chatInteraction.controller');router[_0x25e6('0x8')]('/',auth[_0x25e6('0x9')](),controller['index']);router[_0x25e6('0x8')](_0x25e6('0xa'),auth[_0x25e6('0x9')](),controller[_0x25e6('0xb')]);router[_0x25e6('0x8')](_0x25e6('0xc'),auth[_0x25e6('0xd')](),controller[_0x25e6('0xe')]);router[_0x25e6('0x8')](_0x25e6('0xf'),auth[_0x25e6('0xd')](),controller[_0x25e6('0x10')]);router[_0x25e6('0x8')](_0x25e6('0x11'),auth[_0x25e6('0x9')](),controller[_0x25e6('0x12')]);router[_0x25e6('0x8')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x25e6('0x8')](_0x25e6('0x13'),auth[_0x25e6('0x9')](),controller[_0x25e6('0x14')]);router[_0x25e6('0x15')]('/',auth[_0x25e6('0x9')](),controller[_0x25e6('0x16')]);router[_0x25e6('0x15')]('/:id/vidaoo',auth[_0x25e6('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x25e6('0x17')]({'destination':function(_0x153def,_0x22d19a,_0x263060){_0x263060(null,path['join'](config['root'],_0x25e6('0x18')));},'filename':function(_0x418134,_0x23260b,_0x4a3908){_0x4a3908(null,util['format'](_0x25e6('0x19'),Date[_0x25e6('0x1a')](),_0x23260b['originalname'][_0x25e6('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x25e6('0x1c'),upload['single'](_0x25e6('0x1d')),controller[_0x25e6('0x1e')]);router['post'](_0x25e6('0x11'),auth[_0x25e6('0xd')](),controller[_0x25e6('0x1f')]);router[_0x25e6('0x15')](_0x25e6('0x20'),auth['isAuthenticated'](),interaction[_0x25e6('0x21')](_0x25e6('0x22'),_0x25e6('0x23')),controller['addTags']);router['put'](_0x25e6('0xc'),auth[_0x25e6('0x9')](),interaction[_0x25e6('0x21')]('chat',_0x25e6('0x24')),controller['update']);router[_0x25e6('0x25')](_0x25e6('0x26'),controller[_0x25e6('0x27')]);router['put'](_0x25e6('0x28'),auth[_0x25e6('0xd')](),controller[_0x25e6('0x29')]);router[_0x25e6('0x25')](_0x25e6('0x2a'),controller[_0x25e6('0x2b')]);router[_0x25e6('0x2c')](_0x25e6('0xc'),auth[_0x25e6('0x9')](),interaction[_0x25e6('0x21')](_0x25e6('0x22'),'chatinteraction:destroy'),controller[_0x25e6('0x2d')]);router[_0x25e6('0x2c')](_0x25e6('0x20'),auth[_0x25e6('0x9')](),controller[_0x25e6('0x2e')]);module[_0x25e6('0x2f')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 7200730..d415e3f 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 _0x6121=['exports','TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x4a2183,_0x53e74d){var _0xc7c01d=function(_0x526d67){while(--_0x526d67){_0x4a2183['push'](_0x4a2183['shift']());}};_0xc7c01d(++_0x53e74d);}(_0x6121,0x1b5));var _0x1612=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6121[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x1612('0x0'));module[_0x1612('0x1')]={'body':{'type':Sequelize[_0x1612('0x2')](_0x1612('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1612('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1612('0x5')]}};
\ No newline at end of file
+var _0x1662=['medium','BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x1662,0x189));var _0x2166=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1662[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x2166('0x0'));module[_0x2166('0x1')]={'body':{'type':Sequelize[_0x2166('0x2')](_0x2166('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x2166('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x2166('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index a59c331..0d5ec5c 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 _0x9708=['format','getUsers','agent','admin','user','fullname','lastLoginAt','allowmessenger','showWebBar','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','isEmpty','push','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','update','then','error','name','send','index','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','sort','where','filters','pick','filter','merge','map','type','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','find','create','body','destroy','params','describe','messages','createdAt','lastMessageAt'];(function(_0x416bb4,_0x3e9428){var _0x27ddf6=function(_0x41eb9f){while(--_0x41eb9f){_0x416bb4['push'](_0x416bb4['shift']());}};_0x27ddf6(++_0x3e9428);}(_0x9708,0x14d));var _0x8970=function(_0x100682,_0x11afec){_0x100682=_0x100682-0x0;var _0xcb6e87=_0x9708[_0x100682];return _0xcb6e87;};'use strict';var emlformat=require(_0x8970('0x0'));var rimraf=require(_0x8970('0x1'));var zipdir=require(_0x8970('0x2'));var jsonpatch=require(_0x8970('0x3'));var rp=require(_0x8970('0x4'));var moment=require(_0x8970('0x5'));var BPromise=require(_0x8970('0x6'));var Mustache=require(_0x8970('0x7'));var util=require(_0x8970('0x8'));var path=require('path');var sox=require(_0x8970('0x9'));var csv=require(_0x8970('0xa'));var ejs=require(_0x8970('0xb'));var fs=require('fs');var fs_extra=require(_0x8970('0xc'));var _=require(_0x8970('0xd'));var squel=require(_0x8970('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8970('0xf'));var toCsv=require(_0x8970('0xa'));var querystring=require(_0x8970('0x10'));var Papa=require(_0x8970('0x11'));var Redis=require(_0x8970('0x12'));var authService=require(_0x8970('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8970('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8970('0x15'))(_0x8970('0x16'));var utils=require(_0x8970('0x17'));var config=require(_0x8970('0x18'));var licenseUtil=require(_0x8970('0x19'));var db=require(_0x8970('0x1a'))['db'];config[_0x8970('0x1b')]=_[_0x8970('0x1c')](config['redis'],{'host':_0x8970('0x1d'),'port':0x18eb});var socket=require(_0x8970('0x1e'))(new Redis(config[_0x8970('0x1b')]));require(_0x8970('0x1f'))[_0x8970('0x20')](socket);function respondWithStatusCode(_0x23e152,_0x513719){_0x513719=_0x513719||0xcc;return function(_0x540981){if(_0x540981){return _0x23e152[_0x8970('0x21')](_0x513719);}return _0x23e152[_0x8970('0x22')](_0x513719)[_0x8970('0x23')]();};}function respondWithResult(_0x149fdb,_0xe74c6b){_0xe74c6b=_0xe74c6b||0xc8;return function(_0x30418f){if(_0x30418f){return _0x149fdb[_0x8970('0x22')](_0xe74c6b)['json'](_0x30418f);}};}function respondWithFilteredResult(_0x32dc12,_0x485f42){return function(_0x1abd90){if(_0x1abd90){var _0x57fc41=typeof _0x485f42[_0x8970('0x24')]===_0x8970('0x25')&&typeof _0x485f42[_0x8970('0x26')]===_0x8970('0x25');var _0x536c25=_0x1abd90[_0x8970('0x27')];var _0x2155cd=_0x57fc41?0x0:_0x485f42[_0x8970('0x24')];var _0x32871e=_0x57fc41?_0x1abd90[_0x8970('0x27')]:_0x485f42[_0x8970('0x24')]+_0x485f42['limit'];var _0x1b46fa;if(_0x32871e>=_0x536c25){_0x32871e=_0x536c25;_0x1b46fa=0xc8;}else{_0x1b46fa=0xce;}_0x32dc12[_0x8970('0x22')](_0x1b46fa);return _0x32dc12['set'](_0x8970('0x28'),_0x2155cd+'-'+_0x32871e+'/'+_0x536c25)['json'](_0x1abd90);}return null;};}function patchUpdates(_0x350d51){return function(_0x5675ea){try{jsonpatch['apply'](_0x5675ea,_0x350d51,!![]);}catch(_0x5b4cb7){return BPromise[_0x8970('0x29')](_0x5b4cb7);}return _0x5675ea[_0x8970('0x2a')]();};}function saveUpdates(_0x1f39f4,_0x361d5e){return function(_0x593a25){if(_0x593a25){return _0x593a25[_0x8970('0x2b')](_0x1f39f4)['then'](function(_0x1eaa52){return _0x1eaa52;});}return null;};}function removeEntity(_0x572f0b,_0x67ebef){return function(_0x2fd3cf){if(_0x2fd3cf){return _0x2fd3cf['destroy']()[_0x8970('0x2c')](function(){_0x572f0b[_0x8970('0x22')](0xcc)[_0x8970('0x23')]();});}};}function handleEntityNotFound(_0x3e9d6c,_0x52dd03){return function(_0x344404){if(!_0x344404){_0x3e9d6c['sendStatus'](0x194);}return _0x344404;};}function handleError(_0x1f2c09,_0x317e33){_0x317e33=_0x317e33||0x1f4;return function(_0x1fb90b){logger[_0x8970('0x2d')](_0x1fb90b['stack']);if(_0x1fb90b[_0x8970('0x2e')]){delete _0x1fb90b['name'];}_0x1f2c09[_0x8970('0x22')](_0x317e33)[_0x8970('0x2f')](_0x1fb90b);};}exports[_0x8970('0x30')]=function(_0x32aab6,_0x4b7f5a){var _0x356e53={},_0x5b17a6={},_0x4cdc63={'count':0x0,'rows':[]};var _0x5e205d=_['map'](db['ChatInternalMessage'][_0x8970('0x31')],function(_0x498076){return{'name':_0x498076[_0x8970('0x32')],'type':_0x498076['type']['key']};});_0x5b17a6[_0x8970('0x33')]=_['map'](_0x5e205d,_0x8970('0x2e'));_0x5b17a6[_0x8970('0x34')]=_[_0x8970('0x35')](_0x32aab6['query']);_0x5b17a6['filters']=_[_0x8970('0x36')](_0x5b17a6[_0x8970('0x33')],_0x5b17a6[_0x8970('0x34')]);_0x356e53['attributes']=_[_0x8970('0x36')](_0x5b17a6['model'],qs[_0x8970('0x37')](_0x32aab6[_0x8970('0x34')]['fields']));_0x356e53[_0x8970('0x38')]=_0x356e53[_0x8970('0x38')][_0x8970('0x39')]?_0x356e53[_0x8970('0x38')]:_0x5b17a6[_0x8970('0x33')];if(!_0x32aab6['query']['hasOwnProperty']('nolimit')){_0x356e53['limit']=qs[_0x8970('0x26')](_0x32aab6['query'][_0x8970('0x26')]);_0x356e53[_0x8970('0x24')]=qs[_0x8970('0x24')](_0x32aab6[_0x8970('0x34')][_0x8970('0x24')]);}_0x356e53['order']=qs[_0x8970('0x3a')](_0x32aab6[_0x8970('0x34')][_0x8970('0x3a')]);_0x356e53[_0x8970('0x3b')]=qs[_0x8970('0x3c')](_[_0x8970('0x3d')](_0x32aab6[_0x8970('0x34')],_0x5b17a6[_0x8970('0x3c')]),_0x5e205d);if(_0x32aab6[_0x8970('0x34')][_0x8970('0x3e')]){_0x356e53[_0x8970('0x3b')]=_[_0x8970('0x3f')](_0x356e53[_0x8970('0x3b')],{'$or':_[_0x8970('0x40')](_0x5e205d,function(_0x4a9683){if(_0x4a9683[_0x8970('0x41')]!=='VIRTUAL'){var _0x32f810={};_0x32f810[_0x4a9683[_0x8970('0x2e')]]={'$like':'%'+_0x32aab6[_0x8970('0x34')][_0x8970('0x3e')]+'%'};return _0x32f810;}})});}_0x356e53=_['merge']({},_0x356e53,_0x32aab6[_0x8970('0x42')]);var _0xb9c3dc={'where':_0x356e53[_0x8970('0x3b')]};return db[_0x8970('0x43')]['count'](_0xb9c3dc)[_0x8970('0x2c')](function(_0x221aa6){_0x4cdc63[_0x8970('0x27')]=_0x221aa6;if(_0x32aab6[_0x8970('0x34')][_0x8970('0x44')]){_0x356e53[_0x8970('0x45')]=[{'all':!![]}];}return db[_0x8970('0x43')][_0x8970('0x46')](_0x356e53);})[_0x8970('0x2c')](function(_0x52e475){_0x4cdc63[_0x8970('0x47')]=_0x52e475;return _0x4cdc63;})[_0x8970('0x2c')](respondWithFilteredResult(_0x4b7f5a,_0x356e53))[_0x8970('0x48')](handleError(_0x4b7f5a,null));};exports[_0x8970('0x49')]=function(_0x4b322f,_0x1a7a8a){var _0x1eb453={'raw':!![],'where':{'id':_0x4b322f['params']['id']}},_0x32874c={};_0x32874c[_0x8970('0x33')]=_[_0x8970('0x35')](db[_0x8970('0x43')]['rawAttributes']);_0x32874c[_0x8970('0x34')]=_['keys'](_0x4b322f[_0x8970('0x34')]);_0x32874c[_0x8970('0x3c')]=_[_0x8970('0x36')](_0x32874c['model'],_0x32874c['query']);_0x1eb453[_0x8970('0x38')]=_[_0x8970('0x36')](_0x32874c['model'],qs['fields'](_0x4b322f[_0x8970('0x34')][_0x8970('0x37')]));_0x1eb453[_0x8970('0x38')]=_0x1eb453[_0x8970('0x38')]['length']?_0x1eb453[_0x8970('0x38')]:_0x32874c[_0x8970('0x33')];if(_0x4b322f['query'][_0x8970('0x44')]){_0x1eb453[_0x8970('0x45')]=[{'all':!![]}];}_0x1eb453=_[_0x8970('0x3f')]({},_0x1eb453,_0x4b322f[_0x8970('0x42')]);return db[_0x8970('0x43')][_0x8970('0x4a')](_0x1eb453)[_0x8970('0x2c')](handleEntityNotFound(_0x1a7a8a,null))[_0x8970('0x2c')](respondWithResult(_0x1a7a8a,null))[_0x8970('0x48')](handleError(_0x1a7a8a,null));};exports['create']=function(_0x3a155b,_0x4e028a){return db[_0x8970('0x43')][_0x8970('0x4b')](_0x3a155b[_0x8970('0x4c')],{})[_0x8970('0x2c')](respondWithResult(_0x4e028a,0xc9))[_0x8970('0x48')](handleError(_0x4e028a,null));};exports[_0x8970('0x2b')]=function(_0x370633,_0x35e5a0){if(_0x370633[_0x8970('0x4c')]['id']){delete _0x370633[_0x8970('0x4c')]['id'];}return db['ChatInternalMessage'][_0x8970('0x4a')]({'where':{'id':_0x370633['params']['id']}})[_0x8970('0x2c')](handleEntityNotFound(_0x35e5a0,null))[_0x8970('0x2c')](saveUpdates(_0x370633[_0x8970('0x4c')],null))['then'](respondWithResult(_0x35e5a0,null))['catch'](handleError(_0x35e5a0,null));};exports[_0x8970('0x4d')]=function(_0x2412f4,_0x26db24){return db[_0x8970('0x43')][_0x8970('0x4a')]({'where':{'id':_0x2412f4[_0x8970('0x4e')]['id']}})[_0x8970('0x2c')](handleEntityNotFound(_0x26db24,null))[_0x8970('0x2c')](removeEntity(_0x26db24,null))[_0x8970('0x48')](handleError(_0x26db24,null));};exports['describe']=function(_0x49f5be,_0xea9f72){return db[_0x8970('0x43')][_0x8970('0x4f')]()['then'](respondWithResult(_0xea9f72,null))[_0x8970('0x48')](handleError(_0xea9f72,null));};function wrapUser(_0x226110){return function(_0x194636){var _0x195a02=_0x226110['get']({'plain':!![]});_0x195a02[_0x8970('0x50')]=[];if(_0x194636){_0x195a02['lastMessageAt']=_0x194636[_0x8970('0x51')];_0x195a02['lastMessage']=_0x194636;}else{_0x195a02[_0x8970('0x52')]=moment(0x0)[_0x8970('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x195a02['lastMessage']={};}return _0x195a02;};}exports[_0x8970('0x54')]=function(_0x5f4e9e,_0x46e7a3,_0x77879f){var _0x338cec=[];return db['User'][_0x8970('0x46')]({'where':{'role':[_0x8970('0x55'),_0x8970('0x56'),_0x8970('0x57')]},'attributes':['id',_0x8970('0x58'),_0x8970('0x2e'),'role','userpic','internal','online',_0x8970('0x59'),_0x8970('0x5a'),_0x8970('0x5b')],'order':qs[_0x8970('0x3a')]('-online'),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id','name',_0x8970('0x41')],'through':{'attributes':[]}}]})[_0x8970('0x2c')](function(_0x45be82){if(_0x45be82){var _0x2adf9c=_0x5f4e9e[_0x8970('0x57')][_0x8970('0x5c')]({'plain':!![]});if(!_0x2adf9c)throw new Error(_0x8970('0x5d'));if(_0x2adf9c[_0x8970('0x5e')]===_0x8970('0x57')){return db[_0x8970('0x5f')][_0x8970('0x4a')]({'where':{'name':_0x8970('0x60'),'userProfileId':_0x2adf9c[_0x8970('0x61')]},'raw':!![]})[_0x8970('0x2c')](function(_0x2950f4){if(_0x2950f4){if(_0x2950f4['autoAssociation']===0x0){return db['UserProfileResource'][_0x8970('0x46')]({'where':{'sectionId':_0x2950f4['id']},'raw':!![]})[_0x8970('0x2c')](function(_0x8eb506){var _0x6ab893=[];if(_[_0x8970('0x62')](_0x8eb506)){_0x6ab893=_[_0x8970('0x3e')](_0x45be82,function(_0x451d97){if(_0x451d97[_0x8970('0x5e')]!=='agent'){return _0x451d97;}});return _0x6ab893;}else{for(var _0x12ef43=0x0;_0x12ef43<_0x45be82['length'];_0x12ef43++){var _0x18227a=_0x45be82[_0x12ef43];if(_0x18227a[_0x8970('0x5e')]==='agent'){var _0x2042bf=_[_0x8970('0x4a')](_0x8eb506,function(_0x1033f3){return _0x1033f3['resourceId']===_0x18227a['id'];});if(_0x2042bf)_0x6ab893[_0x8970('0x63')](_0x18227a);}else{_0x6ab893[_0x8970('0x63')](_0x18227a);}}return _0x6ab893;}});}else{return _0x45be82;}}else{var _0x58e892=_[_0x8970('0x3e')](_0x45be82,function(_0x509023){if(_0x509023[_0x8970('0x5e')]!==_0x8970('0x55')){return _0x509023;}});return _0x58e892;}});}else{return _0x45be82;}}})[_0x8970('0x2c')](function(_0x23c076){var _0x444a6e=[];if(_0x23c076){_0x338cec=_0x23c076;for(var _0x2ce70f=0x0;_0x2ce70f<_0x23c076[_0x8970('0x39')];_0x2ce70f+=0x1){_0x338cec[_0x2ce70f]['messages']=[];_0x444a6e[_0x8970('0x63')](db[_0x8970('0x43')][_0x8970('0x4a')]({'where':{'FromId':[_0x5f4e9e[_0x8970('0x57')]['id'],_0x23c076[_0x2ce70f]['id']],'ToId':[_0x5f4e9e['user']['id'],_0x23c076[_0x2ce70f]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x8970('0x64'),_0x8970('0x65'),_0x8970('0x4c')],'order':qs[_0x8970('0x3a')](_0x8970('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x23c076[_0x2ce70f])));}return BPromise[_0x8970('0x67')](_0x444a6e);}return[];})[_0x8970('0x2c')](function(_0x330a2e){return{'rows':_0x330a2e,'count':_0x330a2e[_0x8970('0x39')]};})[_0x8970('0x2c')](respondWithResult(_0x46e7a3,null))[_0x8970('0x48')](handleError(_0x46e7a3,null));};
\ No newline at end of file
+var _0x1d9f=['findAll','rows','catch','show','params','keys','options','find','create','body','describe','get','messages','lastMessageAt','lastMessage','format','getUsers','agent','admin','fullname','role','userpic','online','lastLoginAt','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Agents','autoAssociation','isEmpty','resourceId','push','createdAt','FromId','ToId','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','undefined','limit','count','offset','json','apply','save','update','then','destroy','name','send','index','map','ChatInternalMessage','fieldName','type','model','filters','intersection','attributes','query','fields','length','nolimit','order','sort','where','pick','filter','merge','include'];(function(_0x28f0b6,_0x290a14){var _0x44156e=function(_0x4e57de){while(--_0x4e57de){_0x28f0b6['push'](_0x28f0b6['shift']());}};_0x44156e(++_0x290a14);}(_0x1d9f,0x158));var _0xf1d9=function(_0x51b474,_0x152542){_0x51b474=_0x51b474-0x0;var _0x29e5ea=_0x1d9f[_0x51b474];return _0x29e5ea;};'use strict';var emlformat=require(_0xf1d9('0x0'));var rimraf=require(_0xf1d9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf1d9('0x2'));var rp=require('request-promise');var moment=require(_0xf1d9('0x3'));var BPromise=require(_0xf1d9('0x4'));var Mustache=require(_0xf1d9('0x5'));var util=require(_0xf1d9('0x6'));var path=require(_0xf1d9('0x7'));var sox=require(_0xf1d9('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf1d9('0x9'));var _=require(_0xf1d9('0xa'));var squel=require(_0xf1d9('0xb'));var crypto=require('crypto');var jsforce=require(_0xf1d9('0xc'));var deskjs=require(_0xf1d9('0xd'));var toCsv=require(_0xf1d9('0xe'));var querystring=require(_0xf1d9('0xf'));var Papa=require(_0xf1d9('0x10'));var Redis=require(_0xf1d9('0x11'));var authService=require(_0xf1d9('0x12'));var qs=require(_0xf1d9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf1d9('0x14'));var logger=require('../../config/logger')(_0xf1d9('0x15'));var utils=require(_0xf1d9('0x16'));var config=require(_0xf1d9('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xf1d9('0x18')](config[_0xf1d9('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf1d9('0x1a'))(new Redis(config['redis']));require(_0xf1d9('0x1b'))[_0xf1d9('0x1c')](socket);function respondWithStatusCode(_0x81621d,_0x43b8b4){_0x43b8b4=_0x43b8b4||0xcc;return function(_0x1a321d){if(_0x1a321d){return _0x81621d[_0xf1d9('0x1d')](_0x43b8b4);}return _0x81621d[_0xf1d9('0x1e')](_0x43b8b4)[_0xf1d9('0x1f')]();};}function respondWithResult(_0x1e32e9,_0x40a1dd){_0x40a1dd=_0x40a1dd||0xc8;return function(_0x23a7d5){if(_0x23a7d5){return _0x1e32e9[_0xf1d9('0x1e')](_0x40a1dd)['json'](_0x23a7d5);}};}function respondWithFilteredResult(_0x4e311f,_0x27ed00){return function(_0xfa6be1){if(_0xfa6be1){var _0x50530c=typeof _0x27ed00['offset']===_0xf1d9('0x20')&&typeof _0x27ed00[_0xf1d9('0x21')]===_0xf1d9('0x20');var _0x521558=_0xfa6be1[_0xf1d9('0x22')];var _0x1e1a78=_0x50530c?0x0:_0x27ed00[_0xf1d9('0x23')];var _0x52fc28=_0x50530c?_0xfa6be1['count']:_0x27ed00[_0xf1d9('0x23')]+_0x27ed00[_0xf1d9('0x21')];var _0x26776f;if(_0x52fc28>=_0x521558){_0x52fc28=_0x521558;_0x26776f=0xc8;}else{_0x26776f=0xce;}_0x4e311f['status'](_0x26776f);return _0x4e311f['set']('Content-Range',_0x1e1a78+'-'+_0x52fc28+'/'+_0x521558)[_0xf1d9('0x24')](_0xfa6be1);}return null;};}function patchUpdates(_0x95dec8){return function(_0x2c1d5e){try{jsonpatch[_0xf1d9('0x25')](_0x2c1d5e,_0x95dec8,!![]);}catch(_0x2a8fb2){return BPromise['reject'](_0x2a8fb2);}return _0x2c1d5e[_0xf1d9('0x26')]();};}function saveUpdates(_0x383a4b,_0x1a3b7a){return function(_0x20a3dc){if(_0x20a3dc){return _0x20a3dc[_0xf1d9('0x27')](_0x383a4b)[_0xf1d9('0x28')](function(_0x247bdc){return _0x247bdc;});}return null;};}function removeEntity(_0x1062c4,_0x109bbd){return function(_0x1c4d86){if(_0x1c4d86){return _0x1c4d86[_0xf1d9('0x29')]()[_0xf1d9('0x28')](function(){_0x1062c4[_0xf1d9('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe56a90,_0x5b4c77){return function(_0x26b643){if(!_0x26b643){_0xe56a90[_0xf1d9('0x1d')](0x194);}return _0x26b643;};}function handleError(_0x455500,_0x1eea39){_0x1eea39=_0x1eea39||0x1f4;return function(_0x144e68){logger['error'](_0x144e68['stack']);if(_0x144e68[_0xf1d9('0x2a')]){delete _0x144e68['name'];}_0x455500[_0xf1d9('0x1e')](_0x1eea39)[_0xf1d9('0x2b')](_0x144e68);};}exports[_0xf1d9('0x2c')]=function(_0x159f78,_0x14fbfd){var _0xb63ef2={},_0x52ecf7={},_0x476c4f={'count':0x0,'rows':[]};var _0xc0ccd2=_[_0xf1d9('0x2d')](db[_0xf1d9('0x2e')]['rawAttributes'],function(_0xfcc87b){return{'name':_0xfcc87b[_0xf1d9('0x2f')],'type':_0xfcc87b[_0xf1d9('0x30')]['key']};});_0x52ecf7[_0xf1d9('0x31')]=_[_0xf1d9('0x2d')](_0xc0ccd2,_0xf1d9('0x2a'));_0x52ecf7['query']=_['keys'](_0x159f78['query']);_0x52ecf7[_0xf1d9('0x32')]=_[_0xf1d9('0x33')](_0x52ecf7[_0xf1d9('0x31')],_0x52ecf7['query']);_0xb63ef2[_0xf1d9('0x34')]=_[_0xf1d9('0x33')](_0x52ecf7['model'],qs['fields'](_0x159f78[_0xf1d9('0x35')][_0xf1d9('0x36')]));_0xb63ef2['attributes']=_0xb63ef2[_0xf1d9('0x34')][_0xf1d9('0x37')]?_0xb63ef2[_0xf1d9('0x34')]:_0x52ecf7[_0xf1d9('0x31')];if(!_0x159f78[_0xf1d9('0x35')]['hasOwnProperty'](_0xf1d9('0x38'))){_0xb63ef2['limit']=qs[_0xf1d9('0x21')](_0x159f78[_0xf1d9('0x35')][_0xf1d9('0x21')]);_0xb63ef2[_0xf1d9('0x23')]=qs[_0xf1d9('0x23')](_0x159f78[_0xf1d9('0x35')][_0xf1d9('0x23')]);}_0xb63ef2[_0xf1d9('0x39')]=qs['sort'](_0x159f78['query'][_0xf1d9('0x3a')]);_0xb63ef2[_0xf1d9('0x3b')]=qs[_0xf1d9('0x32')](_[_0xf1d9('0x3c')](_0x159f78['query'],_0x52ecf7['filters']),_0xc0ccd2);if(_0x159f78['query'][_0xf1d9('0x3d')]){_0xb63ef2['where']=_[_0xf1d9('0x3e')](_0xb63ef2['where'],{'$or':_[_0xf1d9('0x2d')](_0xc0ccd2,function(_0x549efb){if(_0x549efb[_0xf1d9('0x30')]!=='VIRTUAL'){var _0x19f13b={};_0x19f13b[_0x549efb['name']]={'$like':'%'+_0x159f78['query'][_0xf1d9('0x3d')]+'%'};return _0x19f13b;}})});}_0xb63ef2=_[_0xf1d9('0x3e')]({},_0xb63ef2,_0x159f78['options']);var _0x4f1940={'where':_0xb63ef2[_0xf1d9('0x3b')]};return db['ChatInternalMessage']['count'](_0x4f1940)[_0xf1d9('0x28')](function(_0x53d4ae){_0x476c4f[_0xf1d9('0x22')]=_0x53d4ae;if(_0x159f78[_0xf1d9('0x35')]['includeAll']){_0xb63ef2[_0xf1d9('0x3f')]=[{'all':!![]}];}return db[_0xf1d9('0x2e')][_0xf1d9('0x40')](_0xb63ef2);})[_0xf1d9('0x28')](function(_0x48ae84){_0x476c4f[_0xf1d9('0x41')]=_0x48ae84;return _0x476c4f;})[_0xf1d9('0x28')](respondWithFilteredResult(_0x14fbfd,_0xb63ef2))[_0xf1d9('0x42')](handleError(_0x14fbfd,null));};exports[_0xf1d9('0x43')]=function(_0x49575d,_0xb010dc){var _0x30e6f8={'raw':!![],'where':{'id':_0x49575d[_0xf1d9('0x44')]['id']}},_0x44fca0={};_0x44fca0['model']=_[_0xf1d9('0x45')](db[_0xf1d9('0x2e')]['rawAttributes']);_0x44fca0[_0xf1d9('0x35')]=_['keys'](_0x49575d['query']);_0x44fca0[_0xf1d9('0x32')]=_[_0xf1d9('0x33')](_0x44fca0[_0xf1d9('0x31')],_0x44fca0[_0xf1d9('0x35')]);_0x30e6f8['attributes']=_['intersection'](_0x44fca0['model'],qs[_0xf1d9('0x36')](_0x49575d[_0xf1d9('0x35')]['fields']));_0x30e6f8['attributes']=_0x30e6f8[_0xf1d9('0x34')]['length']?_0x30e6f8[_0xf1d9('0x34')]:_0x44fca0[_0xf1d9('0x31')];if(_0x49575d[_0xf1d9('0x35')]['includeAll']){_0x30e6f8[_0xf1d9('0x3f')]=[{'all':!![]}];}_0x30e6f8=_['merge']({},_0x30e6f8,_0x49575d[_0xf1d9('0x46')]);return db[_0xf1d9('0x2e')][_0xf1d9('0x47')](_0x30e6f8)[_0xf1d9('0x28')](handleEntityNotFound(_0xb010dc,null))[_0xf1d9('0x28')](respondWithResult(_0xb010dc,null))['catch'](handleError(_0xb010dc,null));};exports[_0xf1d9('0x48')]=function(_0x5b88e9,_0x1fdfcd){return db['ChatInternalMessage'][_0xf1d9('0x48')](_0x5b88e9[_0xf1d9('0x49')],{})[_0xf1d9('0x28')](respondWithResult(_0x1fdfcd,0xc9))[_0xf1d9('0x42')](handleError(_0x1fdfcd,null));};exports[_0xf1d9('0x27')]=function(_0x5e9404,_0x26787a){if(_0x5e9404[_0xf1d9('0x49')]['id']){delete _0x5e9404['body']['id'];}return db['ChatInternalMessage'][_0xf1d9('0x47')]({'where':{'id':_0x5e9404[_0xf1d9('0x44')]['id']}})[_0xf1d9('0x28')](handleEntityNotFound(_0x26787a,null))['then'](saveUpdates(_0x5e9404['body'],null))[_0xf1d9('0x28')](respondWithResult(_0x26787a,null))[_0xf1d9('0x42')](handleError(_0x26787a,null));};exports['destroy']=function(_0x399acc,_0x4b16fc){return db['ChatInternalMessage'][_0xf1d9('0x47')]({'where':{'id':_0x399acc[_0xf1d9('0x44')]['id']}})[_0xf1d9('0x28')](handleEntityNotFound(_0x4b16fc,null))[_0xf1d9('0x28')](removeEntity(_0x4b16fc,null))[_0xf1d9('0x42')](handleError(_0x4b16fc,null));};exports[_0xf1d9('0x4a')]=function(_0x4659b9,_0x5e9d91){return db[_0xf1d9('0x2e')]['describe']()[_0xf1d9('0x28')](respondWithResult(_0x5e9d91,null))[_0xf1d9('0x42')](handleError(_0x5e9d91,null));};function wrapUser(_0x34b0cc){return function(_0x2b0c97){var _0x521281=_0x34b0cc[_0xf1d9('0x4b')]({'plain':!![]});_0x521281[_0xf1d9('0x4c')]=[];if(_0x2b0c97){_0x521281[_0xf1d9('0x4d')]=_0x2b0c97['createdAt'];_0x521281[_0xf1d9('0x4e')]=_0x2b0c97;}else{_0x521281['lastMessageAt']=moment(0x0)[_0xf1d9('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x521281[_0xf1d9('0x4e')]={};}return _0x521281;};}exports[_0xf1d9('0x50')]=function(_0x2e8fab,_0x215487,_0x3250cc){var _0x20b4c5=[];return db['User'][_0xf1d9('0x40')]({'where':{'role':[_0xf1d9('0x51'),_0xf1d9('0x52'),'user']},'attributes':['id',_0xf1d9('0x53'),'name',_0xf1d9('0x54'),_0xf1d9('0x55'),'internal',_0xf1d9('0x56'),_0xf1d9('0x57'),'allowmessenger',_0xf1d9('0x58')],'order':qs[_0xf1d9('0x3a')](_0xf1d9('0x59')),'include':[{'model':db[_0xf1d9('0x5a')],'as':'VoiceQueues','attributes':['id',_0xf1d9('0x2a'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x3e41fc){if(_0x3e41fc){var _0x381c96=_0x2e8fab['user'][_0xf1d9('0x4b')]({'plain':!![]});if(!_0x381c96)throw new Error(_0xf1d9('0x5b'));if(_0x381c96[_0xf1d9('0x54')]===_0xf1d9('0x5c')){return db[_0xf1d9('0x5d')]['find']({'where':{'name':_0xf1d9('0x5e'),'userProfileId':_0x381c96['userProfileId']},'raw':!![]})['then'](function(_0x17e5d7){if(_0x17e5d7){if(_0x17e5d7[_0xf1d9('0x5f')]===0x0){return db['UserProfileResource'][_0xf1d9('0x40')]({'where':{'sectionId':_0x17e5d7['id']},'raw':!![]})[_0xf1d9('0x28')](function(_0x1862a3){var _0x3f392e=[];if(_[_0xf1d9('0x60')](_0x1862a3)){_0x3f392e=_['filter'](_0x3e41fc,function(_0x4e8235){if(_0x4e8235[_0xf1d9('0x54')]!==_0xf1d9('0x51')){return _0x4e8235;}});return _0x3f392e;}else{for(var _0x31e0d7=0x0;_0x31e0d7<_0x3e41fc[_0xf1d9('0x37')];_0x31e0d7++){var _0xccf4a2=_0x3e41fc[_0x31e0d7];if(_0xccf4a2['role']===_0xf1d9('0x51')){var _0x3bf39b=_['find'](_0x1862a3,function(_0x1e6cbd){return _0x1e6cbd[_0xf1d9('0x61')]===_0xccf4a2['id'];});if(_0x3bf39b)_0x3f392e[_0xf1d9('0x62')](_0xccf4a2);}else{_0x3f392e[_0xf1d9('0x62')](_0xccf4a2);}}return _0x3f392e;}});}else{return _0x3e41fc;}}else{var _0x1d96ae=_['filter'](_0x3e41fc,function(_0x233261){if(_0x233261[_0xf1d9('0x54')]!==_0xf1d9('0x51')){return _0x233261;}});return _0x1d96ae;}});}else{return _0x3e41fc;}}})[_0xf1d9('0x28')](function(_0x46b61e){var _0x278622=[];if(_0x46b61e){_0x20b4c5=_0x46b61e;for(var _0x24d7df=0x0;_0x24d7df<_0x46b61e[_0xf1d9('0x37')];_0x24d7df+=0x1){_0x20b4c5[_0x24d7df][_0xf1d9('0x4c')]=[];_0x278622['push'](db[_0xf1d9('0x2e')]['find']({'where':{'FromId':[_0x2e8fab['user']['id'],_0x46b61e[_0x24d7df]['id']],'ToId':[_0x2e8fab['user']['id'],_0x46b61e[_0x24d7df]['id']],'ChatGroupId':null},'attributes':['id',_0xf1d9('0x63'),_0xf1d9('0x64'),_0xf1d9('0x65'),'read','body'],'order':qs[_0xf1d9('0x3a')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf1d9('0x28')](wrapUser(_0x46b61e[_0x24d7df])));}return BPromise['all'](_0x278622);}return[];})[_0xf1d9('0x28')](function(_0x111997){return{'rows':_0x111997,'count':_0x111997[_0xf1d9('0x37')]};})[_0xf1d9('0x28')](respondWithResult(_0x215487,null))[_0xf1d9('0x42')](handleError(_0x215487,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index f059aa8..8fb92c2 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 _0xf920=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hook','exports','events'];(function(_0x5aa04c,_0x453a5e){var _0xe2999c=function(_0x5662c2){while(--_0x5662c2){_0x5aa04c['push'](_0x5aa04c['shift']());}};_0xe2999c(++_0x453a5e);}(_0xf920,0x1e5));var _0x0f92=function(_0x59342a,_0x16827b){_0x59342a=_0x59342a-0x0;var _0x17abc9=_0xf920[_0x59342a];return _0x17abc9;};'use strict';var EventEmitter=require(_0x0f92('0x0'));var ChatInternalMessage=require(_0x0f92('0x1'))['db'][_0x0f92('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0f92('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0f92('0x4'),'afterDestroy':_0x0f92('0x5')};function emitEvent(_0x29bb21){return function(_0x768fd7,_0x28555a,_0x24caf3){ChatInternalMessageEvents['emit'](_0x29bb21+':'+_0x768fd7['id'],_0x768fd7);ChatInternalMessageEvents[_0x0f92('0x6')](_0x29bb21,_0x768fd7);_0x24caf3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x0f92('0x7')](e,emitEvent(event));}}module[_0x0f92('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x2a19=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove'];(function(_0x2b6600,_0x24c497){var _0x912ee2=function(_0x5d6484){while(--_0x5d6484){_0x2b6600['push'](_0x2b6600['shift']());}};_0x912ee2(++_0x24c497);}(_0x2a19,0x199));var _0x92a1=function(_0x3344ad,_0xac7b45){_0x3344ad=_0x3344ad-0x0;var _0x469f58=_0x2a19[_0x3344ad];return _0x469f58;};'use strict';var EventEmitter=require(_0x92a1('0x0'));var ChatInternalMessage=require(_0x92a1('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x92a1('0x2'),'afterUpdate':_0x92a1('0x3'),'afterDestroy':_0x92a1('0x4')};function emitEvent(_0x356e40){return function(_0x315f01,_0x38ba73,_0x53eda1){ChatInternalMessageEvents[_0x92a1('0x5')](_0x356e40+':'+_0x315f01['id'],_0x315f01);ChatInternalMessageEvents[_0x92a1('0x5')](_0x356e40,_0x315f01);_0x53eda1(null);};}for(var e in events){if(events[_0x92a1('0x6')](e)){var event=events[e];ChatInternalMessage[_0x92a1('0x7')](e,emitEvent(event));}}module[_0x92a1('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index b62b4b6..de1b44f 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 _0x0190=['path','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x0190,0x1e7));var _0x0019=function(_0xe1a284,_0x583d4d){_0xe1a284=_0xe1a284-0x0;var _0x25231c=_0x0190[_0xe1a284];return _0x25231c;};'use strict';var _=require(_0x0019('0x0'));var util=require('util');var logger=require(_0x0019('0x1'))(_0x0019('0x2'));var moment=require('moment');var BPromise=require(_0x0019('0x3'));var rp=require(_0x0019('0x4'));var fs=require('fs');var path=require(_0x0019('0x5'));var rimraf=require('rimraf');var config=require(_0x0019('0x6'));var attributes=require(_0x0019('0x7'));module[_0x0019('0x8')]=function(_0xa88eca,_0x1b0ad3){return _0xa88eca[_0x0019('0x9')]('ChatInternalMessage',attributes,{'tableName':_0x0019('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0019('0xb')});};
\ No newline at end of file
+var _0x9a2e=['lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','utf8mb4'];(function(_0x56fd4c,_0x5a753c){var _0x5a3d36=function(_0x3f4be8){while(--_0x3f4be8){_0x56fd4c['push'](_0x56fd4c['shift']());}};_0x5a3d36(++_0x5a753c);}(_0x9a2e,0x17c));var _0xe9a2=function(_0x1b2ea9,_0x3bd1e1){_0x1b2ea9=_0x1b2ea9-0x0;var _0x5df608=_0x9a2e[_0x1b2ea9];return _0x5df608;};'use strict';var _=require(_0xe9a2('0x0'));var util=require(_0xe9a2('0x1'));var logger=require(_0xe9a2('0x2'))(_0xe9a2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9a2('0x4'));var rimraf=require(_0xe9a2('0x5'));var config=require(_0xe9a2('0x6'));var attributes=require(_0xe9a2('0x7'));module['exports']=function(_0x2c366c,_0x4d8839){return _0x2c366c['define'](_0xe9a2('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe9a2('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index e5dec98..e0f8490 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 _0x5acd=['code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x172780,_0x2672e7){var _0x54df9e=function(_0x585f34){while(--_0x585f34){_0x172780['push'](_0x172780['shift']());}};_0x54df9e(++_0x2672e7);}(_0x5acd,0x1f1));var _0xd5ac=function(_0x45839f,_0x522c19){_0x45839f=_0x45839f-0x0;var _0x40de77=_0x5acd[_0x45839f];return _0x40de77;};'use strict';var _=require(_0xd5ac('0x0'));var util=require(_0xd5ac('0x1'));var moment=require(_0xd5ac('0x2'));var BPromise=require(_0xd5ac('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd5ac('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd5ac('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xd5ac('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd5ac('0x7')]['http']({'port':0x232a});config[_0xd5ac('0x8')]=_[_0xd5ac('0x9')](config[_0xd5ac('0x8')],{'host':_0xd5ac('0xa'),'port':0x18eb});var socket=require(_0xd5ac('0xb'))(new Redis(config[_0xd5ac('0x8')]));require(_0xd5ac('0xc'))[_0xd5ac('0xd')](socket);function respondWithRpcPromise(_0x7fe90b,_0x393f7b,_0x3a08c7){return new BPromise(function(_0x3250e1,_0x1b5c03){return client[_0xd5ac('0xe')](_0x7fe90b,_0x3a08c7)[_0xd5ac('0xf')](function(_0x3885c7){logger[_0xd5ac('0x10')](_0xd5ac('0x11'),_0x393f7b,_0xd5ac('0x12'));logger[_0xd5ac('0x13')](_0xd5ac('0x14'),_0x393f7b,_0xd5ac('0x12'),JSON[_0xd5ac('0x15')](_0x3885c7));if(_0x3885c7[_0xd5ac('0x16')]){if(_0x3885c7[_0xd5ac('0x16')][_0xd5ac('0x17')]===0x1f4){logger[_0xd5ac('0x16')](_0xd5ac('0x11'),_0x393f7b,_0x3885c7[_0xd5ac('0x16')][_0xd5ac('0x18')]);return _0x1b5c03(_0x3885c7[_0xd5ac('0x16')][_0xd5ac('0x18')]);}logger[_0xd5ac('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x393f7b,_0x3885c7['error'][_0xd5ac('0x18')]);return _0x3250e1(_0x3885c7['error']['message']);}else{logger[_0xd5ac('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x393f7b,_0xd5ac('0x12'));_0x3250e1(_0x3885c7[_0xd5ac('0x19')][_0xd5ac('0x18')]);}})['catch'](function(_0x3ca925){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x393f7b,_0x3ca925);_0x1b5c03(_0x3ca925);});});}
\ No newline at end of file
+var _0x0795=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3b23df,_0xe519ca){var _0x44ec02=function(_0x39a318){while(--_0x39a318){_0x3b23df['push'](_0x3b23df['shift']());}};_0x44ec02(++_0xe519ca);}(_0x0795,0x14e));var _0x5079=function(_0x4ddaba,_0x17ea5f){_0x4ddaba=_0x4ddaba-0x0;var _0x8512c5=_0x0795[_0x4ddaba];return _0x8512c5;};'use strict';var _=require(_0x5079('0x0'));var util=require(_0x5079('0x1'));var moment=require(_0x5079('0x2'));var BPromise=require(_0x5079('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5079('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5079('0x5'));var logger=require(_0x5079('0x6'))(_0x5079('0x7'));var config=require(_0x5079('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5079('0x9')][_0x5079('0xa')]({'port':0x232a});config[_0x5079('0xb')]=_[_0x5079('0xc')](config[_0x5079('0xb')],{'host':_0x5079('0xd'),'port':0x18eb});var socket=require(_0x5079('0xe'))(new Redis(config[_0x5079('0xb')]));require(_0x5079('0xf'))[_0x5079('0x10')](socket);function respondWithRpcPromise(_0x4f7e88,_0x1bf964,_0x347506){return new BPromise(function(_0x139e2d,_0x3ec287){return client[_0x5079('0x11')](_0x4f7e88,_0x347506)[_0x5079('0x12')](function(_0x2bae3a){logger[_0x5079('0x13')](_0x5079('0x14'),_0x1bf964,_0x5079('0x15'));logger[_0x5079('0x16')](_0x5079('0x17'),_0x1bf964,_0x5079('0x15'),JSON[_0x5079('0x18')](_0x2bae3a));if(_0x2bae3a[_0x5079('0x19')]){if(_0x2bae3a[_0x5079('0x19')][_0x5079('0x1a')]===0x1f4){logger[_0x5079('0x19')](_0x5079('0x14'),_0x1bf964,_0x2bae3a[_0x5079('0x19')][_0x5079('0x1b')]);return _0x3ec287(_0x2bae3a[_0x5079('0x19')]['message']);}logger[_0x5079('0x19')](_0x5079('0x14'),_0x1bf964,_0x2bae3a[_0x5079('0x19')][_0x5079('0x1b')]);return _0x139e2d(_0x2bae3a[_0x5079('0x19')][_0x5079('0x1b')]);}else{logger[_0x5079('0x13')](_0x5079('0x14'),_0x1bf964,'request\x20sent');_0x139e2d(_0x2bae3a[_0x5079('0x1c')]['message']);}})[_0x5079('0x1d')](function(_0x4c6fff){logger[_0x5079('0x19')](_0x5079('0x14'),_0x1bf964,_0x4c6fff);_0x3ec287(_0x4c6fff);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index e31dcd6..6b30e31 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 _0xe7d2=['removeListener','register','length','./chatInternalMessage.events'];(function(_0x56402c,_0x2a8c8b){var _0x1b33da=function(_0x4af5a7){while(--_0x4af5a7){_0x56402c['push'](_0x56402c['shift']());}};_0x1b33da(++_0x2a8c8b);}(_0xe7d2,0x16b));var _0x2e7d=function(_0x825d19,_0x4fe030){_0x825d19=_0x825d19-0x0;var _0x2e7502=_0xe7d2[_0x825d19];return _0x2e7502;};'use strict';var ChatInternalMessageEvents=require(_0x2e7d('0x0'));var events=['save','remove','update'];function createListener(_0x2f72b9,_0x4b5229){return function(_0x420e3f){_0x4b5229['emit'](_0x2f72b9,_0x420e3f);};}function removeListener(_0x3871b5,_0x4c1015){return function(){ChatInternalMessageEvents[_0x2e7d('0x1')](_0x3871b5,_0x4c1015);};}exports[_0x2e7d('0x2')]=function(_0x4ddb1f){for(var _0x2ad851=0x0,_0x23fdf8=events[_0x2e7d('0x3')];_0x2ad851<_0x23fdf8;_0x2ad851++){var _0x1589b0=events[_0x2ad851];var _0x1ff055=createListener('chatInternalMessage:'+_0x1589b0,_0x4ddb1f);ChatInternalMessageEvents['on'](_0x1589b0,_0x1ff055);}};
\ No newline at end of file
+var _0xb14e=['length','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit','removeListener','register'];(function(_0x48d6c2,_0x1ce5d2){var _0x39eeb1=function(_0xa992a7){while(--_0xa992a7){_0x48d6c2['push'](_0x48d6c2['shift']());}};_0x39eeb1(++_0x1ce5d2);}(_0xb14e,0x15a));var _0xeb14=function(_0x342bd9,_0x172771){_0x342bd9=_0x342bd9-0x0;var _0x43705a=_0xb14e[_0x342bd9];return _0x43705a;};'use strict';var ChatInternalMessageEvents=require(_0xeb14('0x0'));var events=['save',_0xeb14('0x1'),_0xeb14('0x2')];function createListener(_0x3a204b,_0x58bcb2){return function(_0x232c62){_0x58bcb2[_0xeb14('0x3')](_0x3a204b,_0x232c62);};}function removeListener(_0x3e19d8,_0x56a566){return function(){ChatInternalMessageEvents[_0xeb14('0x4')](_0x3e19d8,_0x56a566);};}exports[_0xeb14('0x5')]=function(_0x1fa7a1){for(var _0x35255c=0x0,_0xd8e2dc=events[_0xeb14('0x6')];_0x35255c<_0xd8e2dc;_0x35255c++){var _0x477b3c=events[_0x35255c];var _0x34ae4e=createListener(_0xeb14('0x7')+_0x477b3c,_0x1fa7a1);ChatInternalMessageEvents['on'](_0x477b3c,_0x34ae4e);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index da7f147..c3ac1e3 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 _0x361a=['isAuthenticated','getUsers','show','post','create','put','/:id','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','index','/describe','describe','/users'];(function(_0x2263cc,_0x2e1dc9){var _0x1ba214=function(_0x2c4fe3){while(--_0x2c4fe3){_0x2263cc['push'](_0x2263cc['shift']());}};_0x1ba214(++_0x2e1dc9);}(_0x361a,0x8e));var _0xa361=function(_0x38fc0f,_0x4658a5){_0x38fc0f=_0x38fc0f-0x0;var _0x23c7c4=_0x361a[_0x38fc0f];return _0x23c7c4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa361('0x0'));var express=require(_0xa361('0x1'));var router=express[_0xa361('0x2')]();var fs_extra=require(_0xa361('0x3'));var auth=require(_0xa361('0x4'));var interaction=require(_0xa361('0x5'));var config=require(_0xa361('0x6'));var controller=require(_0xa361('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa361('0x8')]);router['get'](_0xa361('0x9'),auth['isAuthenticated'](),controller[_0xa361('0xa')]);router['get'](_0xa361('0xb'),auth[_0xa361('0xc')](),controller[_0xa361('0xd')]);router['get']('/:id',auth[_0xa361('0xc')](),controller[_0xa361('0xe')]);router[_0xa361('0xf')]('/',auth['isAuthenticated'](),controller[_0xa361('0x10')]);router[_0xa361('0x11')](_0xa361('0x12'),controller['update']);router[_0xa361('0x13')](_0xa361('0x12'),auth[_0xa361('0xc')](),controller[_0xa361('0x14')]);module[_0xa361('0x15')]=router;
\ No newline at end of file
+var _0xc14d=['isAuthenticated','describe','getUsers','/:id','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get'];(function(_0x518f54,_0x44f1bc){var _0x18667b=function(_0x4add60){while(--_0x4add60){_0x518f54['push'](_0x518f54['shift']());}};_0x18667b(++_0x44f1bc);}(_0xc14d,0x1ea));var _0xdc14=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc14d[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdc14('0x0'));var timeout=require(_0xdc14('0x1'));var express=require(_0xdc14('0x2'));var router=express[_0xdc14('0x3')]();var fs_extra=require(_0xdc14('0x4'));var auth=require(_0xdc14('0x5'));var interaction=require(_0xdc14('0x6'));var config=require(_0xdc14('0x7'));var controller=require(_0xdc14('0x8'));router[_0xdc14('0x9')]('/',auth[_0xdc14('0xa')](),controller['index']);router[_0xdc14('0x9')]('/describe',auth[_0xdc14('0xa')](),controller[_0xdc14('0xb')]);router[_0xdc14('0x9')]('/users',auth[_0xdc14('0xa')](),controller[_0xdc14('0xc')]);router[_0xdc14('0x9')](_0xdc14('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xdc14('0xa')](),controller[_0xdc14('0xe')]);router[_0xdc14('0xf')]('/:id',controller[_0xdc14('0x10')]);router[_0xdc14('0x11')](_0xdc14('0xd'),auth['isAuthenticated'](),controller[_0xdc14('0x12')]);module[_0xdc14('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 426671f..9f6e92f 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 _0xed3c=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize','exports'];(function(_0xeba5c0,_0x54381f){var _0x35b566=function(_0x136f70){while(--_0x136f70){_0xeba5c0['push'](_0xeba5c0['shift']());}};_0x35b566(++_0x54381f);}(_0xed3c,0x1a6));var _0xced3=function(_0x297dcf,_0x448cf5){_0x297dcf=_0x297dcf-0x0;var _0xe1699b=_0xed3c[_0x297dcf];return _0xe1699b;};'use strict';var Sequelize=require(_0xced3('0x0'));module[_0xced3('0x1')]={'body':{'type':Sequelize[_0xced3('0x2')](_0xced3('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xced3('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xced3('0x5')]('in',_0xced3('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xced3('0x7')]},'providerResponse':{'type':Sequelize[_0xced3('0x2')]}};
\ No newline at end of file
+var _0x7916=['out','STRING','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x69c0c2,_0x2af0bf){var _0x3422f6=function(_0x283e41){while(--_0x283e41){_0x69c0c2['push'](_0x69c0c2['shift']());}};_0x3422f6(++_0x2af0bf);}(_0x7916,0x128));var _0x6791=function(_0x43c23b,_0x136f62){_0x43c23b=_0x43c23b-0x0;var _0x3c1613=_0x7916[_0x43c23b];return _0x3c1613;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'body':{'type':Sequelize[_0x6791('0x1')](_0x6791('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x6791('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6791('0x4')]('in',_0x6791('0x5')),'defaultValue':_0x6791('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x6791('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 32be132..4b44ab1 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 _0x219e=['../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','find','create','body','params','describe','../../config/logger','accept','chat','readAt','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','QueryTypes','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','chat-interactions','RejectMessage','sequelize','Sequelize','SELECT','formData','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','api'];(function(_0xcd3e25,_0x3778c5){var _0x7164ce=function(_0x360b82){while(--_0x360b82){_0xcd3e25['push'](_0xcd3e25['shift']());}};_0x7164ce(++_0x3778c5);}(_0x219e,0x172));var _0xe219=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x219e[_0x5f0089];return _0x193892;};'use strict';var emlformat=require(_0xe219('0x0'));var rimraf=require(_0xe219('0x1'));var zipdir=require(_0xe219('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe219('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe219('0x4'));var util=require(_0xe219('0x5'));var path=require(_0xe219('0x6'));var sox=require(_0xe219('0x7'));var csv=require('to-csv');var ejs=require(_0xe219('0x8'));var fs=require('fs');var fs_extra=require(_0xe219('0x9'));var _=require(_0xe219('0xa'));var squel=require(_0xe219('0xb'));var crypto=require('crypto');var jsforce=require(_0xe219('0xc'));var deskjs=require(_0xe219('0xd'));var toCsv=require(_0xe219('0xe'));var querystring=require(_0xe219('0xf'));var Papa=require(_0xe219('0x10'));var Redis=require(_0xe219('0x11'));var authService=require(_0xe219('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe219('0x13'));var utils=require(_0xe219('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe219('0x15'))['db'];config[_0xe219('0x16')]=_[_0xe219('0x17')](config[_0xe219('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xe219('0x18'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xe219('0x19')](socket);var jayson=require(_0xe219('0x1a'));var client=jayson[_0xe219('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xe219('0x1b')][_0xe219('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1cc791,_0x37fcc6,_0x121059,_0x1c6aea){return new BPromise(function(_0x28f9e4,_0x6ea9be){var _0x3c78ad=_0x1c6aea||client;return _0x3c78ad[_0xe219('0x1d')](_0x1cc791,_0x121059)['then'](function(_0x5adbe9){logger[_0xe219('0x1e')]('ChatMessage,\x20%s,\x20%s',_0x37fcc6,_0xe219('0x1f'));logger[_0xe219('0x20')](_0xe219('0x21'),_0x37fcc6,'request\x20sent',JSON[_0xe219('0x22')](_0x5adbe9));if(_0x5adbe9['error']){if(_0x5adbe9[_0xe219('0x23')][_0xe219('0x24')]===0x1f4){logger['error'](_0xe219('0x25'),_0x37fcc6,_0x5adbe9[_0xe219('0x23')][_0xe219('0x26')]);return _0x6ea9be(_0x5adbe9['error'][_0xe219('0x26')]);}logger[_0xe219('0x23')](_0xe219('0x25'),_0x37fcc6,_0x5adbe9['error'][_0xe219('0x26')]);return _0x28f9e4(_0x5adbe9['error'][_0xe219('0x26')]);}else{logger[_0xe219('0x1e')](_0xe219('0x25'),_0x37fcc6,_0xe219('0x1f'));_0x28f9e4(_0x5adbe9[_0xe219('0x27')][_0xe219('0x26')]);}})[_0xe219('0x28')](function(_0x1dab92){logger['error'](_0xe219('0x25'),_0x37fcc6,_0x1dab92);_0x6ea9be(_0x1dab92);});});}function respondWithStatusCode(_0x1483b6,_0x2adb15){_0x2adb15=_0x2adb15||0xcc;return function(_0x73611e){if(_0x73611e){return _0x1483b6[_0xe219('0x29')](_0x2adb15);}return _0x1483b6[_0xe219('0x2a')](_0x2adb15)[_0xe219('0x2b')]();};}function respondWithResult(_0x319763,_0x43d2b0){_0x43d2b0=_0x43d2b0||0xc8;return function(_0x145082){if(_0x145082){return _0x319763[_0xe219('0x2a')](_0x43d2b0)[_0xe219('0x2c')](_0x145082);}};}function respondWithFilteredResult(_0x1aee9e,_0x2b042a){return function(_0x8ea90){if(_0x8ea90){var _0x4ce0bc=typeof _0x2b042a['offset']===_0xe219('0x2d')&&typeof _0x2b042a[_0xe219('0x2e')]===_0xe219('0x2d');var _0x1367b3=_0x8ea90[_0xe219('0x2f')];var _0x173e3b=_0x4ce0bc?0x0:_0x2b042a[_0xe219('0x30')];var _0x58d368=_0x4ce0bc?_0x8ea90[_0xe219('0x2f')]:_0x2b042a[_0xe219('0x30')]+_0x2b042a[_0xe219('0x2e')];var _0x4cc639;if(_0x58d368>=_0x1367b3){_0x58d368=_0x1367b3;_0x4cc639=0xc8;}else{_0x4cc639=0xce;}_0x1aee9e[_0xe219('0x2a')](_0x4cc639);return _0x1aee9e[_0xe219('0x31')](_0xe219('0x32'),_0x173e3b+'-'+_0x58d368+'/'+_0x1367b3)[_0xe219('0x2c')](_0x8ea90);}return null;};}function patchUpdates(_0x2f5b25){return function(_0x38e4fe){try{jsonpatch[_0xe219('0x33')](_0x38e4fe,_0x2f5b25,!![]);}catch(_0xab7136){return BPromise[_0xe219('0x34')](_0xab7136);}return _0x38e4fe[_0xe219('0x35')]();};}function saveUpdates(_0x29bc4b,_0x3a43de){return function(_0xd7cc54){if(_0xd7cc54){return _0xd7cc54[_0xe219('0x36')](_0x29bc4b)['then'](function(_0x3e9115){return _0x3e9115;});}return null;};}function removeEntity(_0x4120ff,_0x57b40a){return function(_0x2294a4){if(_0x2294a4){return _0x2294a4['destroy']()[_0xe219('0x37')](function(){_0x4120ff[_0xe219('0x2a')](0xcc)[_0xe219('0x2b')]();});}};}function handleEntityNotFound(_0x4462d3,_0x1d7845){return function(_0x58a4cf){if(!_0x58a4cf){_0x4462d3[_0xe219('0x29')](0x194);}return _0x58a4cf;};}function handleError(_0x4225a7,_0xe66907){_0xe66907=_0xe66907||0x1f4;return function(_0x368798){logger[_0xe219('0x23')](_0x368798[_0xe219('0x38')]);if(_0x368798[_0xe219('0x39')]){delete _0x368798['name'];}_0x4225a7[_0xe219('0x2a')](_0xe66907)['send'](_0x368798);};}exports[_0xe219('0x3a')]=function(_0x3ea303,_0x1f5ef4){var _0x409003={},_0x46d55f={},_0x35c4a8={'count':0x0,'rows':[]};var _0x5ef2ea=_[_0xe219('0x3b')](db[_0xe219('0x3c')][_0xe219('0x3d')],function(_0x2eedaf){return{'name':_0x2eedaf[_0xe219('0x3e')],'type':_0x2eedaf[_0xe219('0x3f')][_0xe219('0x40')]};});_0x46d55f[_0xe219('0x41')]=_[_0xe219('0x3b')](_0x5ef2ea,_0xe219('0x39'));_0x46d55f[_0xe219('0x42')]=_[_0xe219('0x43')](_0x3ea303[_0xe219('0x42')]);_0x46d55f[_0xe219('0x44')]=_[_0xe219('0x45')](_0x46d55f[_0xe219('0x41')],_0x46d55f[_0xe219('0x42')]);_0x409003[_0xe219('0x46')]=_[_0xe219('0x45')](_0x46d55f[_0xe219('0x41')],qs[_0xe219('0x47')](_0x3ea303[_0xe219('0x42')][_0xe219('0x47')]));_0x409003[_0xe219('0x46')]=_0x409003['attributes'][_0xe219('0x48')]?_0x409003[_0xe219('0x46')]:_0x46d55f['model'];if(!_0x3ea303[_0xe219('0x42')]['hasOwnProperty'](_0xe219('0x49'))){_0x409003['limit']=qs[_0xe219('0x2e')](_0x3ea303[_0xe219('0x42')][_0xe219('0x2e')]);_0x409003[_0xe219('0x30')]=qs[_0xe219('0x30')](_0x3ea303[_0xe219('0x42')]['offset']);}_0x409003[_0xe219('0x4a')]=qs['sort'](_0x3ea303['query'][_0xe219('0x4b')]);_0x409003[_0xe219('0x4c')]=qs[_0xe219('0x44')](_[_0xe219('0x4d')](_0x3ea303[_0xe219('0x42')],_0x46d55f[_0xe219('0x44')]),_0x5ef2ea);if(_0x3ea303['query'][_0xe219('0x4e')]){_0x409003[_0xe219('0x4c')]=_[_0xe219('0x4f')](_0x409003[_0xe219('0x4c')],{'$or':_[_0xe219('0x3b')](_0x5ef2ea,function(_0x5767c5){if(_0x5767c5[_0xe219('0x3f')]!=='VIRTUAL'){var _0x44547a={};_0x44547a[_0x5767c5[_0xe219('0x39')]]={'$like':'%'+_0x3ea303[_0xe219('0x42')][_0xe219('0x4e')]+'%'};return _0x44547a;}})});}_0x409003=_[_0xe219('0x4f')]({},_0x409003,_0x3ea303[_0xe219('0x50')]);var _0x2be226={'where':_0x409003[_0xe219('0x4c')]};return db[_0xe219('0x3c')][_0xe219('0x2f')](_0x2be226)[_0xe219('0x37')](function(_0x2675b2){_0x35c4a8[_0xe219('0x2f')]=_0x2675b2;if(_0x3ea303[_0xe219('0x42')][_0xe219('0x51')]){_0x409003[_0xe219('0x52')]=[{'all':!![]}];}return db['ChatMessage'][_0xe219('0x53')](_0x409003);})['then'](function(_0x96ae8a){_0x35c4a8['rows']=_0x96ae8a;return _0x35c4a8;})['then'](respondWithFilteredResult(_0x1f5ef4,_0x409003))[_0xe219('0x28')](handleError(_0x1f5ef4,null));};exports[_0xe219('0x54')]=function(_0x241532,_0x5e6053){var _0x35f9e5={'raw':!![],'where':{'id':_0x241532['params']['id']}},_0x56c9b9={};_0x56c9b9[_0xe219('0x41')]=_[_0xe219('0x43')](db['ChatMessage'][_0xe219('0x3d')]);_0x56c9b9[_0xe219('0x42')]=_[_0xe219('0x43')](_0x241532[_0xe219('0x42')]);_0x56c9b9[_0xe219('0x44')]=_[_0xe219('0x45')](_0x56c9b9[_0xe219('0x41')],_0x56c9b9[_0xe219('0x42')]);_0x35f9e5['attributes']=_['intersection'](_0x56c9b9[_0xe219('0x41')],qs[_0xe219('0x47')](_0x241532[_0xe219('0x42')][_0xe219('0x47')]));_0x35f9e5[_0xe219('0x46')]=_0x35f9e5[_0xe219('0x46')][_0xe219('0x48')]?_0x35f9e5[_0xe219('0x46')]:_0x56c9b9[_0xe219('0x41')];if(_0x241532[_0xe219('0x42')][_0xe219('0x51')]){_0x35f9e5[_0xe219('0x52')]=[{'all':!![]}];}_0x35f9e5=_[_0xe219('0x4f')]({},_0x35f9e5,_0x241532['options']);return db[_0xe219('0x3c')][_0xe219('0x55')](_0x35f9e5)[_0xe219('0x37')](handleEntityNotFound(_0x5e6053,null))['then'](respondWithResult(_0x5e6053,null))[_0xe219('0x28')](handleError(_0x5e6053,null));};exports[_0xe219('0x56')]=function(_0x2108b5,_0x595b49){return db['ChatMessage'][_0xe219('0x56')](_0x2108b5['body'],{})[_0xe219('0x37')](respondWithResult(_0x595b49,0xc9))[_0xe219('0x28')](handleError(_0x595b49,null));};exports['update']=function(_0x14fd8b,_0x19a671){if(_0x14fd8b[_0xe219('0x57')]['id']){delete _0x14fd8b[_0xe219('0x57')]['id'];}return db['ChatMessage'][_0xe219('0x55')]({'where':{'id':_0x14fd8b['params']['id']}})[_0xe219('0x37')](handleEntityNotFound(_0x19a671,null))[_0xe219('0x37')](saveUpdates(_0x14fd8b['body'],null))[_0xe219('0x37')](respondWithResult(_0x19a671,null))[_0xe219('0x28')](handleError(_0x19a671,null));};exports['destroy']=function(_0x4ba463,_0x4f8949){return db[_0xe219('0x3c')][_0xe219('0x55')]({'where':{'id':_0x4ba463[_0xe219('0x58')]['id']}})[_0xe219('0x37')](handleEntityNotFound(_0x4f8949,null))['then'](removeEntity(_0x4f8949,null))['catch'](handleError(_0x4f8949,null));};exports[_0xe219('0x59')]=function(_0x374db7,_0x51ba18){return db[_0xe219('0x3c')]['describe']()[_0xe219('0x37')](respondWithResult(_0x51ba18,null))[_0xe219('0x28')](handleError(_0x51ba18,null));};var interaction_log=require(_0xe219('0x5a'))('chat-interactions');exports[_0xe219('0x5b')]=function(_0x1be055,_0x54ee10,_0xf8511e){var _0x6007ae={'agent':{},'channel':_0xe219('0x5c')};if(_0x1be055[_0xe219('0x57')]['id']){delete _0x1be055['body']['id'];}_0x1be055['body']['read']=!![];_0x1be055[_0xe219('0x57')][_0xe219('0x5d')]=moment()[_0xe219('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x1be055[_0xe219('0x57')][_0xe219('0x5f')]=_0x1be055[_0xe219('0x57')][_0xe219('0x5f')]||_0x1be055[_0xe219('0x60')]['id'];_0x6007ae[_0xe219('0x61')]['id']=_0x1be055[_0xe219('0x57')][_0xe219('0x5f')];return db['ChatMessage']['find']({'where':{'id':_0x1be055[_0xe219('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x54ee10,null))[_0xe219('0x37')](saveUpdates(_0x1be055[_0xe219('0x57')],null))['then'](function(_0x248d58){if(_0x248d58){_0x6007ae[_0xe219('0x26')]=_0x248d58[_0xe219('0x62')]({'plain':!![]});return db[_0xe219('0x63')][_0xe219('0x55')]({'where':{'id':_0x248d58[_0xe219('0x64')]}});}return null;})[_0xe219('0x37')](handleEntityNotFound(_0x54ee10,null))[_0xe219('0x37')](function(_0x23725e){if(_0x23725e){return _0x23725e['update']({'UserId':_0x1be055[_0xe219('0x57')][_0xe219('0x5f')],'read1stAt':_[_0xe219('0x65')](_0x23725e[_0xe219('0x66')])?moment()[_0xe219('0x5e')](_0xe219('0x67')):undefined});}return null;})['then'](function(_0x439b6a){if(_0x439b6a){_0x6007ae[_0xe219('0x68')]=_0x439b6a['get']({'plain':!![]});interaction_log[_0xe219('0x1e')](_0xe219('0x69'),_0x1be055['user']['id'],_0x1be055['user'][_0xe219('0x39')],_0x1be055[_0xe219('0x60')][_0xe219('0x6a')],_0x6007ae[_0xe219('0x68')]['id'],_0x1be055['body']?JSON[_0xe219('0x22')](_0x1be055[_0xe219('0x57')]):_0xe219('0x6b'));return respondWithRpcPromise(_0xe219('0x6c'),_0xe219('0x6d'),_0x6007ae);}return null;})[_0xe219('0x37')](function(_0x1d882b){var _0xb615ea='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1d882b[_0xe219('0x26')]['ContactId'];return db['sequelize'][_0xe219('0x42')](_0xb615ea,{'type':db['Sequelize'][_0xe219('0x6e')]['SELECT'],'raw':!![]})[_0xe219('0x37')](function(_0x24703f){return _0x24703f;});})['then'](function(_0x197878){if(_0x197878){_0x6007ae[_0xe219('0x26')][_0xe219('0x6f')]=_0x197878[0x0];if(!_0x1be055[_0xe219('0x57')][_0xe219('0x5f')])return;return db[_0xe219('0x70')][_0xe219('0x55')]({'where':{'id':_0x1be055[_0xe219('0x57')][_0xe219('0x5f')],'role':_0xe219('0x61')},'attributes':['id',_0xe219('0x39'),_0xe219('0x71'),_0xe219('0x72'),_0xe219('0x73')],'raw':!![]});}return null;})['then'](function(_0x27840a){if(!_0x27840a)return null;_0x6007ae[_0xe219('0x26')][_0xe219('0x61')]=_0x27840a;return _0x6007ae;})[_0xe219('0x37')](function(_0x20bee7){if(_0x20bee7){if(_0x1be055[_0xe219('0x57')]['manual']){_0x6007ae['message'][_0xe219('0x74')]=util[_0xe219('0x5e')](_0xe219('0x75'),_0x1be055[_0xe219('0x60')]['name']);_0x6007ae[_0xe219('0x26')][_0xe219('0x76')]=_0x6007ae['channel'];_0x6007ae['message'][_0xe219('0x77')]=_0x6007ae['channel'];_0x6007ae[_0xe219('0x26')][_0xe219('0x78')]='accept';return respondWithRpcPromise(_0xe219('0x79'),_0xe219('0x79'),{'event':_0xe219('0x7a'),'message':_[_0xe219('0x4f')](_0x6007ae['message'],JSON[_0xe219('0x7b')](_0x6007ae[_0xe219('0x68')]['formData']))},client9002)['then'](function(){return _0x6007ae;});}return _0x6007ae;}return null;})[_0xe219('0x37')](respondWithResult(_0x54ee10,null))['catch'](handleError(_0x54ee10,null));};var interaction_log=require(_0xe219('0x5a'))(_0xe219('0x7c'));exports[_0xe219('0x34')]=function(_0x5bdb8e,_0x3c9e92,_0x519d69){var _0x13a16c={'agent':{},'channel':_0xe219('0x5c')};if(_0x5bdb8e[_0xe219('0x57')]['id']){delete _0x5bdb8e[_0xe219('0x57')]['id'];}_0x5bdb8e['body'][_0xe219('0x5f')]=_0x5bdb8e['body'][_0xe219('0x5f')]||_0x5bdb8e['user']['id'];_0x13a16c[_0xe219('0x61')]['id']=_0x5bdb8e[_0xe219('0x57')]['UserId'];return db['ChatMessage']['find']({'where':{'id':_0x5bdb8e[_0xe219('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c9e92,null))[_0xe219('0x37')](function(_0x329050){if(_0x329050){_0x13a16c[_0xe219('0x26')]=_0x329050[_0xe219('0x62')]({'plain':!![]});return db[_0xe219('0x63')]['find']({'where':{'id':_0x329050['ChatInteractionId']}});}return null;})[_0xe219('0x37')](handleEntityNotFound(_0x3c9e92,null))[_0xe219('0x37')](function(_0x43a2e1){if(_0x43a2e1){_0x13a16c[_0xe219('0x68')]=_0x43a2e1[_0xe219('0x62')]({'plain':!![]});interaction_log[_0xe219('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5bdb8e[_0xe219('0x60')]['id'],_0x5bdb8e[_0xe219('0x60')][_0xe219('0x39')],_0x5bdb8e[_0xe219('0x60')][_0xe219('0x6a')],_0x13a16c[_0xe219('0x68')]['id'],_0x5bdb8e[_0xe219('0x57')]?JSON[_0xe219('0x22')](_0x5bdb8e[_0xe219('0x57')]):_0xe219('0x6b'));return respondWithRpcPromise(_0xe219('0x7d'),'rejectMessage',_0x13a16c);}return null;})['then'](function(_0x49d161){var _0x4075ac='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x49d161[_0xe219('0x26')]['ContactId'];return db[_0xe219('0x7e')][_0xe219('0x42')](_0x4075ac,{'type':db[_0xe219('0x7f')][_0xe219('0x6e')][_0xe219('0x80')],'raw':!![]})['then'](function(_0x7e46cb){return _0x7e46cb;});})[_0xe219('0x37')](function(_0x47a05e){if(_0x47a05e){_0x13a16c[_0xe219('0x26')][_0xe219('0x6f')]=_0x47a05e[0x0];if(!_0x5bdb8e[_0xe219('0x57')][_0xe219('0x5f')])return;return db[_0xe219('0x70')][_0xe219('0x55')]({'where':{'id':_0x5bdb8e[_0xe219('0x57')][_0xe219('0x5f')],'role':'agent'},'attributes':['id',_0xe219('0x39'),_0xe219('0x71'),_0xe219('0x72'),_0xe219('0x73')],'raw':!![]});}return null;})[_0xe219('0x37')](function(_0x25a36c){if(!_0x25a36c)return null;_0x13a16c[_0xe219('0x26')][_0xe219('0x61')]=_0x25a36c;return _0x13a16c;})[_0xe219('0x37')](function(_0xbd40a9){if(_0xbd40a9){_0xbd40a9['message']['interface']=util[_0xe219('0x5e')]('SIP/%s',_0x5bdb8e[_0xe219('0x60')][_0xe219('0x39')]);_0xbd40a9['message'][_0xe219('0x76')]=_0x13a16c[_0xe219('0x76')];_0xbd40a9['message'][_0xe219('0x77')]=_0x13a16c[_0xe219('0x76')];_0xbd40a9[_0xe219('0x26')][_0xe219('0x78')]=_0xe219('0x34');respondWithRpcPromise(_0xe219('0x79'),'EventManager',{'event':'rejectmessage','message':_[_0xe219('0x4f')](_0x13a16c[_0xe219('0x26')],JSON[_0xe219('0x7b')](_0x13a16c[_0xe219('0x68')][_0xe219('0x81')]))},client9002);return _0x13a16c;}return null;})[_0xe219('0x37')](respondWithResult(_0x3c9e92,null))[_0xe219('0x28')](handleError(_0x3c9e92,null));};
\ No newline at end of file
+var _0x06ec=['ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','ChatMessage','count','includeAll','include','findAll','rows','catch','params','create','body','find','destroy','describe','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','rejectmessage','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0x06ec,0xe4));var _0xc06e=function(_0x5d3bc5,_0xd57ce){_0x5d3bc5=_0x5d3bc5-0x0;var _0x2f1d26=_0x06ec[_0x5d3bc5];return _0x2f1d26;};'use strict';var emlformat=require(_0xc06e('0x0'));var rimraf=require(_0xc06e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc06e('0x2'));var rp=require('request-promise');var moment=require(_0xc06e('0x3'));var BPromise=require(_0xc06e('0x4'));var Mustache=require(_0xc06e('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc06e('0x6'));var ejs=require(_0xc06e('0x7'));var fs=require('fs');var fs_extra=require(_0xc06e('0x8'));var _=require('lodash');var squel=require(_0xc06e('0x9'));var crypto=require('crypto');var jsforce=require(_0xc06e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xc06e('0x6'));var querystring=require(_0xc06e('0xb'));var Papa=require('papaparse');var Redis=require(_0xc06e('0xc'));var authService=require(_0xc06e('0xd'));var qs=require(_0xc06e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc06e('0xf'));var logger=require(_0xc06e('0x10'))(_0xc06e('0x11'));var utils=require(_0xc06e('0x12'));var config=require(_0xc06e('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc06e('0x14'))['db'];config[_0xc06e('0x15')]=_[_0xc06e('0x16')](config[_0xc06e('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xc06e('0x17'))(new Redis(config[_0xc06e('0x15')]));require('./chatMessage.socket')[_0xc06e('0x18')](socket);var jayson=require(_0xc06e('0x19'));var client=jayson[_0xc06e('0x1a')]['http']({'port':0x232c});var client9002=jayson['client'][_0xc06e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2add23,_0x4fe60f,_0x36131a,_0x6645d8){return new BPromise(function(_0x3c0462,_0x501deb){var _0x1bb750=_0x6645d8||client;return _0x1bb750['request'](_0x2add23,_0x36131a)['then'](function(_0x26c31a){logger[_0xc06e('0x1c')](_0xc06e('0x1d'),_0x4fe60f,_0xc06e('0x1e'));logger[_0xc06e('0x1f')](_0xc06e('0x20'),_0x4fe60f,_0xc06e('0x1e'),JSON['stringify'](_0x26c31a));if(_0x26c31a[_0xc06e('0x21')]){if(_0x26c31a[_0xc06e('0x21')][_0xc06e('0x22')]===0x1f4){logger[_0xc06e('0x21')](_0xc06e('0x1d'),_0x4fe60f,_0x26c31a[_0xc06e('0x21')]['message']);return _0x501deb(_0x26c31a['error'][_0xc06e('0x23')]);}logger[_0xc06e('0x21')](_0xc06e('0x1d'),_0x4fe60f,_0x26c31a[_0xc06e('0x21')][_0xc06e('0x23')]);return _0x3c0462(_0x26c31a[_0xc06e('0x21')][_0xc06e('0x23')]);}else{logger[_0xc06e('0x1c')]('ChatMessage,\x20%s,\x20%s',_0x4fe60f,_0xc06e('0x1e'));_0x3c0462(_0x26c31a[_0xc06e('0x24')][_0xc06e('0x23')]);}})['catch'](function(_0x200ecc){logger[_0xc06e('0x21')](_0xc06e('0x1d'),_0x4fe60f,_0x200ecc);_0x501deb(_0x200ecc);});});}function respondWithStatusCode(_0x4aab55,_0x61f5dc){_0x61f5dc=_0x61f5dc||0xcc;return function(_0x5df05d){if(_0x5df05d){return _0x4aab55[_0xc06e('0x25')](_0x61f5dc);}return _0x4aab55['status'](_0x61f5dc)[_0xc06e('0x26')]();};}function respondWithResult(_0x5bf39d,_0x185e5c){_0x185e5c=_0x185e5c||0xc8;return function(_0x4a5c20){if(_0x4a5c20){return _0x5bf39d['status'](_0x185e5c)[_0xc06e('0x27')](_0x4a5c20);}};}function respondWithFilteredResult(_0x39040d,_0x4306ea){return function(_0x40176f){if(_0x40176f){var _0x4579e2=typeof _0x4306ea[_0xc06e('0x28')]===_0xc06e('0x29')&&typeof _0x4306ea[_0xc06e('0x2a')]===_0xc06e('0x29');var _0x8a0b58=_0x40176f['count'];var _0x446da7=_0x4579e2?0x0:_0x4306ea['offset'];var _0xd0e78d=_0x4579e2?_0x40176f['count']:_0x4306ea[_0xc06e('0x28')]+_0x4306ea[_0xc06e('0x2a')];var _0x2aaef6;if(_0xd0e78d>=_0x8a0b58){_0xd0e78d=_0x8a0b58;_0x2aaef6=0xc8;}else{_0x2aaef6=0xce;}_0x39040d[_0xc06e('0x2b')](_0x2aaef6);return _0x39040d[_0xc06e('0x2c')](_0xc06e('0x2d'),_0x446da7+'-'+_0xd0e78d+'/'+_0x8a0b58)[_0xc06e('0x27')](_0x40176f);}return null;};}function patchUpdates(_0x18814f){return function(_0x1d59ae){try{jsonpatch[_0xc06e('0x2e')](_0x1d59ae,_0x18814f,!![]);}catch(_0x19b355){return BPromise[_0xc06e('0x2f')](_0x19b355);}return _0x1d59ae['save']();};}function saveUpdates(_0x556ce9,_0xcd8028){return function(_0x53dabc){if(_0x53dabc){return _0x53dabc[_0xc06e('0x30')](_0x556ce9)[_0xc06e('0x31')](function(_0x68b0a5){return _0x68b0a5;});}return null;};}function removeEntity(_0x5c28c7,_0x24b451){return function(_0x282a03){if(_0x282a03){return _0x282a03['destroy']()[_0xc06e('0x31')](function(){_0x5c28c7[_0xc06e('0x2b')](0xcc)[_0xc06e('0x26')]();});}};}function handleEntityNotFound(_0x5d677d,_0x5a9702){return function(_0x3f04e4){if(!_0x3f04e4){_0x5d677d[_0xc06e('0x25')](0x194);}return _0x3f04e4;};}function handleError(_0x57b79d,_0x317080){_0x317080=_0x317080||0x1f4;return function(_0x53b855){logger[_0xc06e('0x21')](_0x53b855[_0xc06e('0x32')]);if(_0x53b855[_0xc06e('0x33')]){delete _0x53b855[_0xc06e('0x33')];}_0x57b79d[_0xc06e('0x2b')](_0x317080)[_0xc06e('0x34')](_0x53b855);};}exports[_0xc06e('0x35')]=function(_0x33182f,_0x17498d){var _0x5e0793={},_0x2e10ef={},_0x2a70a6={'count':0x0,'rows':[]};var _0x16b021=_[_0xc06e('0x36')](db['ChatMessage'][_0xc06e('0x37')],function(_0x45bcc3){return{'name':_0x45bcc3[_0xc06e('0x38')],'type':_0x45bcc3['type'][_0xc06e('0x39')]};});_0x2e10ef[_0xc06e('0x3a')]=_[_0xc06e('0x36')](_0x16b021,'name');_0x2e10ef[_0xc06e('0x3b')]=_[_0xc06e('0x3c')](_0x33182f[_0xc06e('0x3b')]);_0x2e10ef['filters']=_['intersection'](_0x2e10ef[_0xc06e('0x3a')],_0x2e10ef[_0xc06e('0x3b')]);_0x5e0793[_0xc06e('0x3d')]=_[_0xc06e('0x3e')](_0x2e10ef['model'],qs[_0xc06e('0x3f')](_0x33182f['query'][_0xc06e('0x3f')]));_0x5e0793['attributes']=_0x5e0793['attributes'][_0xc06e('0x40')]?_0x5e0793[_0xc06e('0x3d')]:_0x2e10ef['model'];if(!_0x33182f[_0xc06e('0x3b')]['hasOwnProperty'](_0xc06e('0x41'))){_0x5e0793['limit']=qs['limit'](_0x33182f[_0xc06e('0x3b')][_0xc06e('0x2a')]);_0x5e0793[_0xc06e('0x28')]=qs[_0xc06e('0x28')](_0x33182f[_0xc06e('0x3b')]['offset']);}_0x5e0793[_0xc06e('0x42')]=qs['sort'](_0x33182f[_0xc06e('0x3b')][_0xc06e('0x43')]);_0x5e0793['where']=qs[_0xc06e('0x44')](_[_0xc06e('0x45')](_0x33182f[_0xc06e('0x3b')],_0x2e10ef[_0xc06e('0x44')]),_0x16b021);if(_0x33182f[_0xc06e('0x3b')][_0xc06e('0x46')]){_0x5e0793[_0xc06e('0x47')]=_[_0xc06e('0x48')](_0x5e0793[_0xc06e('0x47')],{'$or':_['map'](_0x16b021,function(_0x2971a7){if(_0x2971a7['type']!==_0xc06e('0x49')){var _0x3f7146={};_0x3f7146[_0x2971a7['name']]={'$like':'%'+_0x33182f[_0xc06e('0x3b')][_0xc06e('0x46')]+'%'};return _0x3f7146;}})});}_0x5e0793=_[_0xc06e('0x48')]({},_0x5e0793,_0x33182f[_0xc06e('0x4a')]);var _0x4c26f9={'where':_0x5e0793['where']};return db[_0xc06e('0x4b')][_0xc06e('0x4c')](_0x4c26f9)[_0xc06e('0x31')](function(_0x1045bb){_0x2a70a6[_0xc06e('0x4c')]=_0x1045bb;if(_0x33182f['query'][_0xc06e('0x4d')]){_0x5e0793[_0xc06e('0x4e')]=[{'all':!![]}];}return db[_0xc06e('0x4b')][_0xc06e('0x4f')](_0x5e0793);})[_0xc06e('0x31')](function(_0x805c8b){_0x2a70a6[_0xc06e('0x50')]=_0x805c8b;return _0x2a70a6;})['then'](respondWithFilteredResult(_0x17498d,_0x5e0793))[_0xc06e('0x51')](handleError(_0x17498d,null));};exports['show']=function(_0x3bd50b,_0x45d284){var _0x5b0bbd={'raw':!![],'where':{'id':_0x3bd50b[_0xc06e('0x52')]['id']}},_0x11048f={};_0x11048f[_0xc06e('0x3a')]=_[_0xc06e('0x3c')](db[_0xc06e('0x4b')][_0xc06e('0x37')]);_0x11048f[_0xc06e('0x3b')]=_[_0xc06e('0x3c')](_0x3bd50b[_0xc06e('0x3b')]);_0x11048f['filters']=_[_0xc06e('0x3e')](_0x11048f['model'],_0x11048f[_0xc06e('0x3b')]);_0x5b0bbd['attributes']=_['intersection'](_0x11048f[_0xc06e('0x3a')],qs['fields'](_0x3bd50b['query'][_0xc06e('0x3f')]));_0x5b0bbd[_0xc06e('0x3d')]=_0x5b0bbd[_0xc06e('0x3d')]['length']?_0x5b0bbd[_0xc06e('0x3d')]:_0x11048f[_0xc06e('0x3a')];if(_0x3bd50b['query'][_0xc06e('0x4d')]){_0x5b0bbd[_0xc06e('0x4e')]=[{'all':!![]}];}_0x5b0bbd=_['merge']({},_0x5b0bbd,_0x3bd50b['options']);return db[_0xc06e('0x4b')]['find'](_0x5b0bbd)['then'](handleEntityNotFound(_0x45d284,null))['then'](respondWithResult(_0x45d284,null))[_0xc06e('0x51')](handleError(_0x45d284,null));};exports[_0xc06e('0x53')]=function(_0x5d607f,_0x4aebab){return db['ChatMessage'][_0xc06e('0x53')](_0x5d607f[_0xc06e('0x54')],{})[_0xc06e('0x31')](respondWithResult(_0x4aebab,0xc9))['catch'](handleError(_0x4aebab,null));};exports[_0xc06e('0x30')]=function(_0x323373,_0x60b164){if(_0x323373[_0xc06e('0x54')]['id']){delete _0x323373['body']['id'];}return db[_0xc06e('0x4b')][_0xc06e('0x55')]({'where':{'id':_0x323373[_0xc06e('0x52')]['id']}})[_0xc06e('0x31')](handleEntityNotFound(_0x60b164,null))[_0xc06e('0x31')](saveUpdates(_0x323373[_0xc06e('0x54')],null))[_0xc06e('0x31')](respondWithResult(_0x60b164,null))[_0xc06e('0x51')](handleError(_0x60b164,null));};exports[_0xc06e('0x56')]=function(_0x1e05a9,_0x431b83){return db[_0xc06e('0x4b')][_0xc06e('0x55')]({'where':{'id':_0x1e05a9[_0xc06e('0x52')]['id']}})['then'](handleEntityNotFound(_0x431b83,null))[_0xc06e('0x31')](removeEntity(_0x431b83,null))[_0xc06e('0x51')](handleError(_0x431b83,null));};exports[_0xc06e('0x57')]=function(_0x50d341,_0x2ae4c5){return db[_0xc06e('0x4b')][_0xc06e('0x57')]()[_0xc06e('0x31')](respondWithResult(_0x2ae4c5,null))[_0xc06e('0x51')](handleError(_0x2ae4c5,null));};var interaction_log=require(_0xc06e('0x10'))('chat-interactions');exports[_0xc06e('0x58')]=function(_0x2b9a47,_0x2b87f8,_0x288ee4){var _0x432154={'agent':{},'channel':_0xc06e('0x59')};if(_0x2b9a47['body']['id']){delete _0x2b9a47[_0xc06e('0x54')]['id'];}_0x2b9a47[_0xc06e('0x54')][_0xc06e('0x5a')]=!![];_0x2b9a47[_0xc06e('0x54')][_0xc06e('0x5b')]=moment()[_0xc06e('0x5c')](_0xc06e('0x5d'));_0x2b9a47['body'][_0xc06e('0x5e')]=_0x2b9a47[_0xc06e('0x54')][_0xc06e('0x5e')]||_0x2b9a47[_0xc06e('0x5f')]['id'];_0x432154[_0xc06e('0x60')]['id']=_0x2b9a47['body']['UserId'];return db[_0xc06e('0x4b')][_0xc06e('0x55')]({'where':{'id':_0x2b9a47[_0xc06e('0x52')]['id'],'UserId':null}})[_0xc06e('0x31')](handleEntityNotFound(_0x2b87f8,null))[_0xc06e('0x31')](saveUpdates(_0x2b9a47[_0xc06e('0x54')],null))['then'](function(_0x4c691e){if(_0x4c691e){_0x432154[_0xc06e('0x23')]=_0x4c691e[_0xc06e('0x61')]({'plain':!![]});return db[_0xc06e('0x62')]['find']({'where':{'id':_0x4c691e[_0xc06e('0x63')]}});}return null;})[_0xc06e('0x31')](handleEntityNotFound(_0x2b87f8,null))[_0xc06e('0x31')](function(_0x585434){if(_0x585434){return _0x585434[_0xc06e('0x30')]({'UserId':_0x2b9a47[_0xc06e('0x54')][_0xc06e('0x5e')],'read1stAt':_['isNil'](_0x585434['read1stAt'])?moment()[_0xc06e('0x5c')](_0xc06e('0x5d')):undefined});}return null;})[_0xc06e('0x31')](function(_0x29c6df){if(_0x29c6df){_0x432154[_0xc06e('0x64')]=_0x29c6df[_0xc06e('0x61')]({'plain':!![]});interaction_log[_0xc06e('0x1c')](_0xc06e('0x65'),_0x2b9a47[_0xc06e('0x5f')]['id'],_0x2b9a47[_0xc06e('0x5f')][_0xc06e('0x33')],_0x2b9a47['user'][_0xc06e('0x66')],_0x432154[_0xc06e('0x64')]['id'],_0x2b9a47[_0xc06e('0x54')]?JSON[_0xc06e('0x67')](_0x2b9a47[_0xc06e('0x54')]):_0xc06e('0x68'));return respondWithRpcPromise(_0xc06e('0x69'),_0xc06e('0x6a'),_0x432154);}return null;})[_0xc06e('0x31')](function(_0x3ecb17){var _0x34aa0e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3ecb17[_0xc06e('0x23')][_0xc06e('0x6b')];return db[_0xc06e('0x6c')][_0xc06e('0x3b')](_0x34aa0e,{'type':db[_0xc06e('0x6d')][_0xc06e('0x6e')][_0xc06e('0x6f')],'raw':!![]})['then'](function(_0xca8334){return _0xca8334;});})[_0xc06e('0x31')](function(_0x2cc4de){if(_0x2cc4de){_0x432154['message']['contact']=_0x2cc4de[0x0];if(!_0x2b9a47[_0xc06e('0x54')][_0xc06e('0x5e')])return;return db['User'][_0xc06e('0x55')]({'where':{'id':_0x2b9a47['body'][_0xc06e('0x5e')],'role':'agent'},'attributes':['id',_0xc06e('0x33'),_0xc06e('0x70'),_0xc06e('0x71'),_0xc06e('0x72')],'raw':!![]});}return null;})[_0xc06e('0x31')](function(_0x4e6613){if(!_0x4e6613)return null;_0x432154['message'][_0xc06e('0x60')]=_0x4e6613;return _0x432154;})[_0xc06e('0x31')](function(_0x5db2f5){if(_0x5db2f5){if(_0x2b9a47[_0xc06e('0x54')][_0xc06e('0x73')]){_0x432154['message'][_0xc06e('0x74')]=util['format'](_0xc06e('0x75'),_0x2b9a47['user']['name']);_0x432154['message'][_0xc06e('0x76')]=_0x432154[_0xc06e('0x76')];_0x432154[_0xc06e('0x23')][_0xc06e('0x77')]=_0x432154[_0xc06e('0x76')];_0x432154[_0xc06e('0x23')][_0xc06e('0x78')]=_0xc06e('0x58');return respondWithRpcPromise('EventManager',_0xc06e('0x79'),{'event':'acceptmessage','message':_[_0xc06e('0x48')](_0x432154[_0xc06e('0x23')],JSON[_0xc06e('0x7a')](_0x432154[_0xc06e('0x64')][_0xc06e('0x7b')]))},client9002)[_0xc06e('0x31')](function(){return _0x432154;});}return _0x432154;}return null;})[_0xc06e('0x31')](respondWithResult(_0x2b87f8,null))['catch'](handleError(_0x2b87f8,null));};var interaction_log=require(_0xc06e('0x10'))(_0xc06e('0x7c'));exports[_0xc06e('0x2f')]=function(_0xf66806,_0x3adc15,_0x1b9312){var _0x1927e1={'agent':{},'channel':_0xc06e('0x59')};if(_0xf66806['body']['id']){delete _0xf66806['body']['id'];}_0xf66806[_0xc06e('0x54')][_0xc06e('0x5e')]=_0xf66806[_0xc06e('0x54')][_0xc06e('0x5e')]||_0xf66806['user']['id'];_0x1927e1[_0xc06e('0x60')]['id']=_0xf66806[_0xc06e('0x54')]['UserId'];return db[_0xc06e('0x4b')][_0xc06e('0x55')]({'where':{'id':_0xf66806[_0xc06e('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3adc15,null))[_0xc06e('0x31')](function(_0x15ff44){if(_0x15ff44){_0x1927e1[_0xc06e('0x23')]=_0x15ff44[_0xc06e('0x61')]({'plain':!![]});return db[_0xc06e('0x62')]['find']({'where':{'id':_0x15ff44[_0xc06e('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x3adc15,null))[_0xc06e('0x31')](function(_0x5bcf0c){if(_0x5bcf0c){_0x1927e1[_0xc06e('0x64')]=_0x5bcf0c[_0xc06e('0x61')]({'plain':!![]});interaction_log['info'](_0xc06e('0x7d'),_0xf66806[_0xc06e('0x5f')]['id'],_0xf66806[_0xc06e('0x5f')][_0xc06e('0x33')],_0xf66806[_0xc06e('0x5f')]['role'],_0x1927e1[_0xc06e('0x64')]['id'],_0xf66806['body']?JSON[_0xc06e('0x67')](_0xf66806['body']):_0xc06e('0x68'));return respondWithRpcPromise(_0xc06e('0x7e'),_0xc06e('0x7f'),_0x1927e1);}return null;})[_0xc06e('0x31')](function(_0x5d981e){var _0x13125c=_0xc06e('0x80')+_0x5d981e[_0xc06e('0x23')][_0xc06e('0x6b')];return db['sequelize']['query'](_0x13125c,{'type':db[_0xc06e('0x6d')]['QueryTypes'][_0xc06e('0x6f')],'raw':!![]})[_0xc06e('0x31')](function(_0x4aa11e){return _0x4aa11e;});})[_0xc06e('0x31')](function(_0x91765f){if(_0x91765f){_0x1927e1[_0xc06e('0x23')]['contact']=_0x91765f[0x0];if(!_0xf66806[_0xc06e('0x54')]['UserId'])return;return db['User'][_0xc06e('0x55')]({'where':{'id':_0xf66806[_0xc06e('0x54')][_0xc06e('0x5e')],'role':_0xc06e('0x60')},'attributes':['id',_0xc06e('0x33'),_0xc06e('0x70'),'email',_0xc06e('0x72')],'raw':!![]});}return null;})['then'](function(_0x3f6540){if(!_0x3f6540)return null;_0x1927e1['message']['agent']=_0x3f6540;return _0x1927e1;})['then'](function(_0x1a9d8d){if(_0x1a9d8d){_0x1a9d8d[_0xc06e('0x23')][_0xc06e('0x74')]=util[_0xc06e('0x5c')](_0xc06e('0x75'),_0xf66806[_0xc06e('0x5f')][_0xc06e('0x33')]);_0x1a9d8d[_0xc06e('0x23')][_0xc06e('0x76')]=_0x1927e1['channel'];_0x1a9d8d[_0xc06e('0x23')][_0xc06e('0x77')]=_0x1927e1[_0xc06e('0x76')];_0x1a9d8d['message'][_0xc06e('0x78')]=_0xc06e('0x2f');respondWithRpcPromise(_0xc06e('0x79'),_0xc06e('0x79'),{'event':_0xc06e('0x81'),'message':_[_0xc06e('0x48')](_0x1927e1[_0xc06e('0x23')],JSON[_0xc06e('0x7a')](_0x1927e1[_0xc06e('0x64')][_0xc06e('0x7b')]))},client9002);return _0x1927e1;}return null;})[_0xc06e('0x31')](respondWithResult(_0x3adc15,null))['catch'](handleError(_0x3adc15,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 3fed642..c36cc67 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 _0xceeb=['remove','emit','hook','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x4b9488,_0x4544d2){var _0x5f59b8=function(_0x275d00){while(--_0x275d00){_0x4b9488['push'](_0x4b9488['shift']());}};_0x5f59b8(++_0x4544d2);}(_0xceeb,0xb3));var _0xbcee=function(_0x50e38a,_0x10ae4e){_0x50e38a=_0x50e38a-0x0;var _0x1c4785=_0xceeb[_0x50e38a];return _0x1c4785;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xbcee('0x0'))['db'][_0xbcee('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xbcee('0x2')](0x0);var events={'afterCreate':_0xbcee('0x3'),'afterUpdate':_0xbcee('0x4'),'afterDestroy':_0xbcee('0x5')};function emitEvent(_0x41def0){return function(_0x27ef66,_0x5295d2,_0x51ed81){ChatMessageEvents[_0xbcee('0x6')](_0x41def0+':'+_0x27ef66['id'],_0x27ef66);ChatMessageEvents[_0xbcee('0x6')](_0x41def0,_0x27ef66);_0x51ed81(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xbcee('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0xa816=['hasOwnProperty','hook','events','../../mysqldb','save','update','remove','emit'];(function(_0x32de42,_0xc16852){var _0x1eba0f=function(_0x246d99){while(--_0x246d99){_0x32de42['push'](_0x32de42['shift']());}};_0x1eba0f(++_0xc16852);}(_0xa816,0x17a));var _0x6a81=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xa816[_0x39e283];return _0x7de89f;};'use strict';var EventEmitter=require(_0x6a81('0x0'));var ChatMessage=require(_0x6a81('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6a81('0x2'),'afterUpdate':_0x6a81('0x3'),'afterDestroy':_0x6a81('0x4')};function emitEvent(_0x2cc762){return function(_0x5087d1,_0x2ce908,_0x25b962){ChatMessageEvents[_0x6a81('0x5')](_0x2cc762+':'+_0x5087d1['id'],_0x5087d1);ChatMessageEvents[_0x6a81('0x5')](_0x2cc762,_0x5087d1);_0x25b962(null);};}for(var e in events){if(events[_0x6a81('0x6')](e)){var event=events[e];ChatMessage[_0x6a81('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 2d409fd..2724080 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 _0xdade=['then','utf8mb4','lodash','api','moment','path','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId'];(function(_0x5d61e3,_0x5dd19a){var _0xc18c02=function(_0x1809c2){while(--_0x1809c2){_0x5d61e3['push'](_0x5d61e3['shift']());}};_0xc18c02(++_0x5dd19a);}(_0xdade,0x1e6));var _0xedad=function(_0x2467b8,_0x584199){_0x2467b8=_0x2467b8-0x0;var _0x5d3095=_0xdade[_0x2467b8];return _0x5d3095;};'use strict';var _=require(_0xedad('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xedad('0x1'));var moment=require(_0xedad('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xedad('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xedad('0x4'));module[_0xedad('0x5')]=function(_0x3ab906,_0x4df785){return _0x3ab906['define'](_0xedad('0x6'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xedad('0x7'),'fields':[_0xedad('0x8')],'type':_0xedad('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x35df2d,_0x1486a0,_0x3f913e){var _0x4f5a21=_0x3ab906[_0xedad('0xa')];var _0x46d5f5=_0x35df2d[_0xedad('0xb')]({'plain':!![]});if(_0x46d5f5[_0xedad('0xc')][_0xedad('0xd')]()==='in'||_0x46d5f5[_0xedad('0xc')][_0xedad('0xd')]()===_0xedad('0xe')&&!_0x46d5f5[_0xedad('0xf')]&&!_[_0xedad('0x10')](_0x46d5f5[_0xedad('0x11')])){_0x4f5a21['ChatInteraction'][_0xedad('0x12')]({'where':{'id':_0x46d5f5[_0xedad('0x13')]}})[_0xedad('0x14')](function(_0x46074c){if(_0x46074c){_0x46074c['update']({'lastMsgAt':_0x46d5f5['createdAt'],'lastMsgDirection':_0x46d5f5[_0xedad('0xc')]['toLowerCase']()});}})['catch'](function(_0x31b750){console['error'](_0x31b750);});}_0x3f913e();}},'charset':_0xedad('0x15'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6b38=['../../config/environment','./chatMessage.attributes','exports','fti_chat_messages','body','FULLTEXT','get','direction','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','update','createdAt','toLowerCase','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x3710eb,_0x4c8a29){var _0x4106e0=function(_0xa45fc9){while(--_0xa45fc9){_0x3710eb['push'](_0x3710eb['shift']());}};_0x4106e0(++_0x4c8a29);}(_0x6b38,0x65));var _0x86b3=function(_0xa6dc22,_0x1bdca9){_0xa6dc22=_0xa6dc22-0x0;var _0x31eca1=_0x6b38[_0xa6dc22];return _0x31eca1;};'use strict';var _=require(_0x86b3('0x0'));var util=require(_0x86b3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x86b3('0x2'));var BPromise=require(_0x86b3('0x3'));var rp=require(_0x86b3('0x4'));var fs=require('fs');var path=require(_0x86b3('0x5'));var rimraf=require(_0x86b3('0x6'));var config=require(_0x86b3('0x7'));var attributes=require(_0x86b3('0x8'));module[_0x86b3('0x9')]=function(_0x243be1,_0x337125){return _0x243be1['define']('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x86b3('0xa'),'fields':[_0x86b3('0xb')],'type':_0x86b3('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x32f261,_0x38342e,_0x911903){var _0x35afb5=_0x243be1['models'];var _0x4abfad=_0x32f261[_0x86b3('0xd')]({'plain':!![]});if(_0x4abfad[_0x86b3('0xe')]['toLowerCase']()==='in'||_0x4abfad[_0x86b3('0xe')]['toLowerCase']()===_0x86b3('0xf')&&!_0x4abfad[_0x86b3('0x10')]&&!_[_0x86b3('0x11')](_0x4abfad[_0x86b3('0x12')])){_0x35afb5[_0x86b3('0x13')]['findOne']({'where':{'id':_0x4abfad[_0x86b3('0x14')]}})['then'](function(_0x514e90){if(_0x514e90){_0x514e90[_0x86b3('0x15')]({'lastMsgAt':_0x4abfad[_0x86b3('0x16')],'lastMsgDirection':_0x4abfad[_0x86b3('0xe')][_0x86b3('0x17')]()});}})[_0x86b3('0x18')](function(_0x11b1da){console['error'](_0x11b1da);});}_0x911903();}},'charset':_0x86b3('0x19'),'collate':_0x86b3('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 2b5e621..2aae441 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 _0xf39e=['socket.io-emitter','./chatMessage.socket','register','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','then','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','defaults','redis','localhost'];(function(_0x437e08,_0x1cab6c){var _0xcf57f2=function(_0x2ef02e){while(--_0x2ef02e){_0x437e08['push'](_0x437e08['shift']());}};_0xcf57f2(++_0x1cab6c);}(_0xf39e,0x18b));var _0xef39=function(_0x258df0,_0x31ce33){_0x258df0=_0x258df0-0x0;var _0x2a96fe=_0xf39e[_0x258df0];return _0x2a96fe;};'use strict';var _=require(_0xef39('0x0'));var util=require(_0xef39('0x1'));var moment=require(_0xef39('0x2'));var BPromise=require('bluebird');var rs=require(_0xef39('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef39('0x4'))['db'];var utils=require(_0xef39('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xef39('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xef39('0x7')]['http']({'port':0x232a});config['redis']=_[_0xef39('0x8')](config[_0xef39('0x9')],{'host':_0xef39('0xa'),'port':0x18eb});var socket=require(_0xef39('0xb'))(new Redis(config[_0xef39('0x9')]));require(_0xef39('0xc'))[_0xef39('0xd')](socket);function respondWithRpcPromise(_0x475324,_0x4f5bf0,_0x22dcab){return new BPromise(function(_0x7db2cb,_0x6b306c){return client['request'](_0x475324,_0x22dcab)['then'](function(_0x236ef4){logger[_0xef39('0xe')](_0xef39('0xf'),_0x4f5bf0,'request\x20sent');logger['debug'](_0xef39('0x10'),_0x4f5bf0,_0xef39('0x11'),JSON['stringify'](_0x236ef4));if(_0x236ef4[_0xef39('0x12')]){if(_0x236ef4[_0xef39('0x12')]['code']===0x1f4){logger[_0xef39('0x12')](_0xef39('0xf'),_0x4f5bf0,_0x236ef4[_0xef39('0x12')][_0xef39('0x13')]);return _0x6b306c(_0x236ef4[_0xef39('0x12')][_0xef39('0x13')]);}logger[_0xef39('0x12')]('ChatMessage,\x20%s,\x20%s',_0x4f5bf0,_0x236ef4[_0xef39('0x12')][_0xef39('0x13')]);return _0x7db2cb(_0x236ef4['error'][_0xef39('0x13')]);}else{logger['info'](_0xef39('0xf'),_0x4f5bf0,_0xef39('0x11'));_0x7db2cb(_0x236ef4[_0xef39('0x14')][_0xef39('0x13')]);}})[_0xef39('0x15')](function(_0x56d97a){logger[_0xef39('0x12')]('ChatMessage,\x20%s,\x20%s',_0x4f5bf0,_0x56d97a);_0x6b306c(_0x56d97a);});});}exports[_0xef39('0x16')]=function(_0x79c8b2){var _0x1fec7f=this;return new Promise(function(_0x1bc3e8,_0x6ab6eb){return db[_0xef39('0x17')][_0xef39('0x18')](_0x79c8b2['body'],{'raw':_0x79c8b2[_0xef39('0x19')]?_0x79c8b2['options'][_0xef39('0x1a')]===undefined?!![]:![]:!![]})[_0xef39('0x1b')](function(_0x211abe){logger[_0xef39('0xe')](_0xef39('0x16'),_0x79c8b2);logger[_0xef39('0x1c')](_0xef39('0x16'),_0x79c8b2,JSON['stringify'](_0x211abe));_0x1bc3e8(_0x211abe);})[_0xef39('0x15')](function(_0x40a942){logger['error'](_0xef39('0x16'),_0x40a942[_0xef39('0x13')],_0x79c8b2);_0x6ab6eb(_0x1fec7f['error'](0x1f4,_0x40a942[_0xef39('0x13')]));});});};
\ No newline at end of file
+var _0x5d99=['error','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x3f553b,_0x49a9c2){var _0x183c4e=function(_0x873b22){while(--_0x873b22){_0x3f553b['push'](_0x3f553b['shift']());}};_0x183c4e(++_0x49a9c2);}(_0x5d99,0x1b7));var _0x95d9=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0x5d99[_0x256d6a];return _0x460058;};'use strict';var _=require(_0x95d9('0x0'));var util=require(_0x95d9('0x1'));var moment=require(_0x95d9('0x2'));var BPromise=require(_0x95d9('0x3'));var rs=require(_0x95d9('0x4'));var fs=require('fs');var Redis=require(_0x95d9('0x5'));var db=require(_0x95d9('0x6'))['db'];var utils=require(_0x95d9('0x7'));var logger=require(_0x95d9('0x8'))(_0x95d9('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x95d9('0xa')][_0x95d9('0xb')]({'port':0x232a});config[_0x95d9('0xc')]=_['defaults'](config['redis'],{'host':_0x95d9('0xd'),'port':0x18eb});var socket=require(_0x95d9('0xe'))(new Redis(config['redis']));require(_0x95d9('0xf'))[_0x95d9('0x10')](socket);function respondWithRpcPromise(_0x32ed58,_0x5d5ceb,_0x626bb7){return new BPromise(function(_0x19214c,_0x563ae1){return client['request'](_0x32ed58,_0x626bb7)[_0x95d9('0x11')](function(_0x36d167){logger[_0x95d9('0x12')](_0x95d9('0x13'),_0x5d5ceb,_0x95d9('0x14'));logger[_0x95d9('0x15')](_0x95d9('0x16'),_0x5d5ceb,_0x95d9('0x14'),JSON['stringify'](_0x36d167));if(_0x36d167[_0x95d9('0x17')]){if(_0x36d167[_0x95d9('0x17')]['code']===0x1f4){logger[_0x95d9('0x17')](_0x95d9('0x13'),_0x5d5ceb,_0x36d167[_0x95d9('0x17')][_0x95d9('0x18')]);return _0x563ae1(_0x36d167[_0x95d9('0x17')]['message']);}logger[_0x95d9('0x17')](_0x95d9('0x13'),_0x5d5ceb,_0x36d167[_0x95d9('0x17')]['message']);return _0x19214c(_0x36d167[_0x95d9('0x17')][_0x95d9('0x18')]);}else{logger[_0x95d9('0x12')](_0x95d9('0x13'),_0x5d5ceb,_0x95d9('0x14'));_0x19214c(_0x36d167[_0x95d9('0x19')][_0x95d9('0x18')]);}})[_0x95d9('0x1a')](function(_0x57c94e){logger[_0x95d9('0x17')]('ChatMessage,\x20%s,\x20%s',_0x5d5ceb,_0x57c94e);_0x563ae1(_0x57c94e);});});}exports[_0x95d9('0x1b')]=function(_0x14f4f0){var _0x5e9052=this;return new Promise(function(_0x35aa6c,_0x171791){return db[_0x95d9('0x1c')][_0x95d9('0x1d')](_0x14f4f0[_0x95d9('0x1e')],{'raw':_0x14f4f0['options']?_0x14f4f0[_0x95d9('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x95d9('0x11')](function(_0x20b81d){logger[_0x95d9('0x12')](_0x95d9('0x1b'),_0x14f4f0);logger[_0x95d9('0x15')]('CreateChatMessage',_0x14f4f0,JSON[_0x95d9('0x20')](_0x20b81d));_0x35aa6c(_0x20b81d);})[_0x95d9('0x1a')](function(_0x36b5bf){logger[_0x95d9('0x17')]('CreateChatMessage',_0x36b5bf[_0x95d9('0x18')],_0x14f4f0);_0x171791(_0x5e9052[_0x95d9('0x17')](0x1f4,_0x36b5bf['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 5ee359e..a8594e0 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 _0x448b=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x1f5738,_0x351b9d){var _0x4e0aa3=function(_0x21614f){while(--_0x21614f){_0x1f5738['push'](_0x1f5738['shift']());}};_0x4e0aa3(++_0x351b9d);}(_0x448b,0x125));var _0xb448=function(_0x4095ab,_0x5f0de7){_0x4095ab=_0x4095ab-0x0;var _0x54dcd0=_0x448b[_0x4095ab];return _0x54dcd0;};'use strict';var ChatMessageEvents=require(_0xb448('0x0'));var events=[_0xb448('0x1'),_0xb448('0x2'),_0xb448('0x3')];function createListener(_0x422fa2,_0x51583a){return function(_0x5bf7db){_0x51583a[_0xb448('0x4')](_0x422fa2,_0x5bf7db);};}function removeListener(_0x32bcae,_0x172a89){return function(){ChatMessageEvents[_0xb448('0x5')](_0x32bcae,_0x172a89);};}exports[_0xb448('0x6')]=function(_0x276466){for(var _0x3670cb=0x0,_0x5993ad=events[_0xb448('0x7')];_0x3670cb<_0x5993ad;_0x3670cb++){var _0x2f6f82=events[_0x3670cb];var _0x2c2bdd=createListener(_0xb448('0x8')+_0x2f6f82,_0x276466);ChatMessageEvents['on'](_0x2f6f82,_0x2c2bdd);}};
\ No newline at end of file
+var _0xeb0d=['removeListener','register','./chatMessage.events','emit'];(function(_0x41a93b,_0x2fc19d){var _0x220a7e=function(_0x5ecb05){while(--_0x5ecb05){_0x41a93b['push'](_0x41a93b['shift']());}};_0x220a7e(++_0x2fc19d);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x4d9ae7,_0x216573){_0x4d9ae7=_0x4d9ae7-0x0;var _0xc4e2bb=_0xeb0d[_0x4d9ae7];return _0xc4e2bb;};'use strict';var ChatMessageEvents=require(_0xdeb0('0x0'));var events=['save','remove','update'];function createListener(_0x256ce4,_0x430873){return function(_0x538fc2){_0x430873[_0xdeb0('0x1')](_0x256ce4,_0x538fc2);};}function removeListener(_0x36367c,_0xd8dd51){return function(){ChatMessageEvents[_0xdeb0('0x2')](_0x36367c,_0xd8dd51);};}exports[_0xdeb0('0x3')]=function(_0x13d486){for(var _0xc48108=0x0,_0x27ebaa=events['length'];_0xc48108<_0x27ebaa;_0xc48108++){var _0x28a1a4=events[_0xc48108];var _0x16b36b=createListener('chatMessage:'+_0x28a1a4,_0x13d486);ChatMessageEvents['on'](_0x28a1a4,_0x16b36b);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 5de8cb8..b9356f3 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 _0x464d=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','tracked','chatmessage:create','create','update','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x177b7b,_0x319e32){var _0x54e536=function(_0x1d2f05){while(--_0x1d2f05){_0x177b7b['push'](_0x177b7b['shift']());}};_0x54e536(++_0x319e32);}(_0x464d,0x15e));var _0xd464=function(_0x2a71d2,_0x35bcda){_0x2a71d2=_0x2a71d2-0x0;var _0x200112=_0x464d[_0x2a71d2];return _0x200112;};'use strict';var multer=require('multer');var util=require(_0xd464('0x0'));var path=require(_0xd464('0x1'));var timeout=require(_0xd464('0x2'));var express=require('express');var router=express[_0xd464('0x3')]();var fs_extra=require(_0xd464('0x4'));var auth=require(_0xd464('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd464('0x6'));var controller=require(_0xd464('0x7'));router['get']('/',auth[_0xd464('0x8')](),controller[_0xd464('0x9')]);router[_0xd464('0xa')](_0xd464('0xb'),auth[_0xd464('0x8')](),controller[_0xd464('0xc')]);router[_0xd464('0xa')](_0xd464('0xd'),auth['isAuthenticated'](),controller[_0xd464('0xe')]);router['post']('/',auth[_0xd464('0x8')](),interaction[_0xd464('0xf')]('chat',_0xd464('0x10')),controller[_0xd464('0x11')]);router['put'](_0xd464('0xd'),controller[_0xd464('0x12')]);router['put']('/:id/accept',auth[_0xd464('0x8')](),controller[_0xd464('0x13')]);router['put'](_0xd464('0x14'),auth['isAuthenticated'](),controller[_0xd464('0x15')]);router[_0xd464('0x16')](_0xd464('0xd'),auth[_0xd464('0x8')](),controller[_0xd464('0x17')]);module[_0xd464('0x18')]=router;
\ No newline at end of file
+var _0x3c71=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/:id','show','post','tracked','create','put','/:id/accept','accept','delete','destroy','util','path','fs-extra'];(function(_0x47bd60,_0x22f024){var _0x523729=function(_0x9b333a){while(--_0x9b333a){_0x47bd60['push'](_0x47bd60['shift']());}};_0x523729(++_0x22f024);}(_0x3c71,0x165));var _0x13c7=function(_0x399dc3,_0x1916c8){_0x399dc3=_0x399dc3-0x0;var _0x1b0ade=_0x3c71[_0x399dc3];return _0x1b0ade;};'use strict';var multer=require('multer');var util=require(_0x13c7('0x0'));var path=require(_0x13c7('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x13c7('0x2'));var auth=require(_0x13c7('0x3'));var interaction=require(_0x13c7('0x4'));var config=require(_0x13c7('0x5'));var controller=require(_0x13c7('0x6'));router[_0x13c7('0x7')]('/',auth[_0x13c7('0x8')](),controller[_0x13c7('0x9')]);router[_0x13c7('0x7')]('/describe',auth[_0x13c7('0x8')](),controller['describe']);router['get'](_0x13c7('0xa'),auth['isAuthenticated'](),controller[_0x13c7('0xb')]);router[_0x13c7('0xc')]('/',auth[_0x13c7('0x8')](),interaction[_0x13c7('0xd')]('chat','chatmessage:create'),controller[_0x13c7('0xe')]);router['put']('/:id',controller['update']);router[_0x13c7('0xf')](_0x13c7('0x10'),auth[_0x13c7('0x8')](),controller[_0x13c7('0x11')]);router[_0x13c7('0xf')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0x13c7('0x12')](_0x13c7('0xa'),auth[_0x13c7('0x8')](),controller[_0x13c7('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 4cbefb6..094e4a5 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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x1f8e45,_0x386c27){var _0x41d697=function(_0x4d213b){while(--_0x4d213b){_0x1f8e45['push'](_0x1f8e45['shift']());}};_0x41d697(++_0x386c27);}(_0xb10b,0x12a));var _0xbb10=function(_0x2f4d7f,_0x62f4b7){_0x2f4d7f=_0x2f4d7f-0x0;var _0x147ba1=_0xb10b[_0x2f4d7f];return _0x147ba1;};'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
+var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x0b0e,0x187));var _0xe0b0=function(_0x406fbb,_0x1093e5){_0x406fbb=_0x406fbb-0x0;var _0x8e921d=_0x0b0e[_0x406fbb];return _0x8e921d;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 222016f..2569b05 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(_0x47561b,_0x5d97db){var _0x218acd=function(_0xd0d9ac){while(--_0xd0d9ac){_0x47561b['push'](_0x47561b['shift']());}};_0x218acd(++_0x5d97db);}(_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(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x7a54,0x106));var _0x47a5=function(_0x24fe80,_0x2dfff4){_0x24fe80=_0x24fe80-0x0;var _0x1cfa9a=_0x7a54[_0x24fe80];return _0x1cfa9a;};'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 c63d6d3..96f5dca 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 _0xd035=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x376ed9,_0x10d4c0){var _0x1cb970=function(_0xb9f837){while(--_0xb9f837){_0x376ed9['push'](_0x376ed9['shift']());}};_0x1cb970(++_0x10d4c0);}(_0xd035,0xdc));var _0x5d03=function(_0xdd0313,_0x251c2b){_0xdd0313=_0xdd0313-0x0;var _0x2bd7e8=_0xd035[_0xdd0313];return _0x2bd7e8;};'use strict';var EventEmitter=require(_0x5d03('0x0'));var ChatOfflineMessage=require(_0x5d03('0x1'))['db'][_0x5d03('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x5d03('0x3')](0x0);var events={'afterCreate':_0x5d03('0x4'),'afterUpdate':_0x5d03('0x5'),'afterDestroy':_0x5d03('0x6')};function emitEvent(_0x433e55){return function(_0x112aa1,_0x3c0aba,_0x33ddd8){ChatOfflineMessageEvents[_0x5d03('0x7')](_0x433e55+':'+_0x112aa1['id'],_0x112aa1);ChatOfflineMessageEvents['emit'](_0x433e55,_0x112aa1);_0x33ddd8(null);};}for(var e in events){if(events[_0x5d03('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x5d03('0x9')](e,emitEvent(event));}}module[_0x5d03('0xa')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x7fd5=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x5595ab,_0x1ff695){var _0x5402e5=function(_0x242514){while(--_0x242514){_0x5595ab['push'](_0x5595ab['shift']());}};_0x5402e5(++_0x1ff695);}(_0x7fd5,0xa0));var _0x57fd=function(_0x455b35,_0x5d2b5e){_0x455b35=_0x455b35-0x0;var _0x1fc095=_0x7fd5[_0x455b35];return _0x1fc095;};'use strict';var EventEmitter=require(_0x57fd('0x0'));var ChatOfflineMessage=require(_0x57fd('0x1'))['db'][_0x57fd('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x57fd('0x3')](0x0);var events={'afterCreate':_0x57fd('0x4'),'afterUpdate':_0x57fd('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1c7ceb){return function(_0x312cb8,_0x6572cc,_0x3d08f7){ChatOfflineMessageEvents[_0x57fd('0x6')](_0x1c7ceb+':'+_0x312cb8['id'],_0x312cb8);ChatOfflineMessageEvents[_0x57fd('0x6')](_0x1c7ceb,_0x312cb8);_0x3d08f7(null);};}for(var e in events){if(events[_0x57fd('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x57fd('0x8')](e,emitEvent(event));}}module[_0x57fd('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 48b75d2..1623841 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 _0xf5c8=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf5c8,0xd1));var _0x8f5c=function(_0x211632,_0x378e2e){_0x211632=_0x211632-0x0;var _0x5a1da1=_0xf5c8[_0x211632];return _0x5a1da1;};'use strict';var attributes=require(_0x8f5c('0x0'));module['exports']=function(_0x52db7b){return _0x52db7b['define']('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8f5c('0x1'),'collate':_0x8f5c('0x2')});};
\ No newline at end of file
+var _0xc5da=['./chatOfflineMessage.attributes','exports','define','utf8mb4_unicode_ci'];(function(_0x5bf78a,_0x380699){var _0x457c8e=function(_0x2355e9){while(--_0x2355e9){_0x5bf78a['push'](_0x5bf78a['shift']());}};_0x457c8e(++_0x380699);}(_0xc5da,0x100));var _0xac5d=function(_0x5d9322,_0x11069c){_0x5d9322=_0x5d9322-0x0;var _0x3c616c=_0xc5da[_0x5d9322];return _0x3c616c;};'use strict';var attributes=require(_0xac5d('0x0'));module[_0xac5d('0x1')]=function(_0x3b7468){return _0x3b7468[_0xac5d('0x2')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xac5d('0x3')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 7c30969..88f8508 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 _0xa4c2=['http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1a9740,_0x3cfd32){var _0x383ff6=function(_0x1dd73c){while(--_0x1dd73c){_0x1a9740['push'](_0x1a9740['shift']());}};_0x383ff6(++_0x3cfd32);}(_0xa4c2,0xc1));var _0x2a4c=function(_0x246694,_0x50cae1){_0x246694=_0x246694-0x0;var _0x38f821=_0xa4c2[_0x246694];return _0x38f821;};'use strict';var _=require(_0x2a4c('0x0'));var util=require('util');var moment=require(_0x2a4c('0x1'));var BPromise=require('bluebird');var rs=require(_0x2a4c('0x2'));var fs=require('fs');var Redis=require(_0x2a4c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2a4c('0x4'))('rpc');var config=require(_0x2a4c('0x5'));var jayson=require(_0x2a4c('0x6'));var client=jayson['client'][_0x2a4c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3d2511,_0x9f8993,_0x41dfad){return new BPromise(function(_0x1f86e5,_0x25f1d3){return client['request'](_0x3d2511,_0x41dfad)[_0x2a4c('0x8')](function(_0x37f2c4){logger[_0x2a4c('0x9')](_0x2a4c('0xa'),_0x9f8993,_0x2a4c('0xb'));logger[_0x2a4c('0xc')](_0x2a4c('0xd'),_0x9f8993,'request\x20sent',JSON[_0x2a4c('0xe')](_0x37f2c4));if(_0x37f2c4['error']){if(_0x37f2c4['error'][_0x2a4c('0xf')]===0x1f4){logger[_0x2a4c('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x9f8993,_0x37f2c4[_0x2a4c('0x10')][_0x2a4c('0x11')]);return _0x25f1d3(_0x37f2c4['error'][_0x2a4c('0x11')]);}logger['error'](_0x2a4c('0xa'),_0x9f8993,_0x37f2c4['error'][_0x2a4c('0x11')]);return _0x1f86e5(_0x37f2c4[_0x2a4c('0x10')]['message']);}else{logger[_0x2a4c('0x9')](_0x2a4c('0xa'),_0x9f8993,'request\x20sent');_0x1f86e5(_0x37f2c4[_0x2a4c('0x12')][_0x2a4c('0x11')]);}})[_0x2a4c('0x13')](function(_0x47921d){logger[_0x2a4c('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x9f8993,_0x47921d);_0x25f1d3(_0x47921d);});});}
\ No newline at end of file
+var _0x3787=['request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x283864,_0x405a20){var _0x3f7482=function(_0x22cd1b){while(--_0x22cd1b){_0x283864['push'](_0x283864['shift']());}};_0x3f7482(++_0x405a20);}(_0x3787,0xd3));var _0x7378=function(_0x5761b6,_0x417a7b){_0x5761b6=_0x5761b6-0x0;var _0x2ce497=_0x3787[_0x5761b6];return _0x2ce497;};'use strict';var _=require('lodash');var util=require(_0x7378('0x0'));var moment=require('moment');var BPromise=require(_0x7378('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7378('0x2'));var logger=require(_0x7378('0x3'))(_0x7378('0x4'));var config=require(_0x7378('0x5'));var jayson=require(_0x7378('0x6'));var client=jayson[_0x7378('0x7')][_0x7378('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ff022,_0x295076,_0x4324c5){return new BPromise(function(_0x33e391,_0x397bf9){return client[_0x7378('0x9')](_0x3ff022,_0x4324c5)[_0x7378('0xa')](function(_0x258b54){logger[_0x7378('0xb')](_0x7378('0xc'),_0x295076,'request\x20sent');logger[_0x7378('0xd')](_0x7378('0xe'),_0x295076,'request\x20sent',JSON[_0x7378('0xf')](_0x258b54));if(_0x258b54[_0x7378('0x10')]){if(_0x258b54[_0x7378('0x10')][_0x7378('0x11')]===0x1f4){logger[_0x7378('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x295076,_0x258b54['error']['message']);return _0x397bf9(_0x258b54[_0x7378('0x10')][_0x7378('0x12')]);}logger['error'](_0x7378('0xc'),_0x295076,_0x258b54[_0x7378('0x10')]['message']);return _0x33e391(_0x258b54[_0x7378('0x10')]['message']);}else{logger[_0x7378('0xb')](_0x7378('0xc'),_0x295076,_0x7378('0x13'));_0x33e391(_0x258b54[_0x7378('0x14')][_0x7378('0x12')]);}})[_0x7378('0x15')](function(_0x582ca4){logger['error'](_0x7378('0xc'),_0x295076,_0x582ca4);_0x397bf9(_0x582ca4);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index cb2edb0..289e2e6 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 _0x824c=['create','put','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x342628,_0xf4352e){var _0x3affa7=function(_0x179e0c){while(--_0x179e0c){_0x342628['push'](_0x342628['shift']());}};_0x3affa7(++_0xf4352e);}(_0x824c,0x6d));var _0xc824=function(_0x2b6730,_0x1bab44){_0x2b6730=_0x2b6730-0x0;var _0x5b6403=_0x824c[_0x2b6730];return _0x5b6403;};'use strict';var multer=require(_0xc824('0x0'));var util=require(_0xc824('0x1'));var path=require(_0xc824('0x2'));var timeout=require(_0xc824('0x3'));var express=require(_0xc824('0x4'));var router=express['Router']();var fs_extra=require(_0xc824('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc824('0x6'));var config=require(_0xc824('0x7'));var controller=require(_0xc824('0x8'));router[_0xc824('0x9')]('/',auth[_0xc824('0xa')](),controller[_0xc824('0xb')]);router[_0xc824('0x9')](_0xc824('0xc'),auth[_0xc824('0xa')](),controller[_0xc824('0xd')]);router[_0xc824('0x9')](_0xc824('0xe'),auth[_0xc824('0xa')](),controller[_0xc824('0xf')]);router[_0xc824('0x10')]('/',auth[_0xc824('0xa')](),controller[_0xc824('0x11')]);router[_0xc824('0x12')](_0xc824('0xe'),auth[_0xc824('0xa')](),controller['update']);router[_0xc824('0x13')]('/:id',auth[_0xc824('0xa')](),controller[_0xc824('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x90e1=['/:id','post','put','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','describe'];(function(_0x2fd442,_0x2fe25e){var _0x2d7ae7=function(_0x3ce907){while(--_0x3ce907){_0x2fd442['push'](_0x2fd442['shift']());}};_0x2d7ae7(++_0x2fe25e);}(_0x90e1,0x8b));var _0x190e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x90e1[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x190e('0x0'));var util=require(_0x190e('0x1'));var path=require('path');var timeout=require(_0x190e('0x2'));var express=require('express');var router=express[_0x190e('0x3')]();var fs_extra=require(_0x190e('0x4'));var auth=require(_0x190e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x190e('0x6'));var controller=require(_0x190e('0x7'));router[_0x190e('0x8')]('/',auth[_0x190e('0x9')](),controller['index']);router[_0x190e('0x8')]('/describe',auth[_0x190e('0x9')](),controller[_0x190e('0xa')]);router[_0x190e('0x8')](_0x190e('0xb'),auth[_0x190e('0x9')](),controller['show']);router[_0x190e('0xc')]('/',auth[_0x190e('0x9')](),controller['create']);router[_0x190e('0xd')]('/:id',auth[_0x190e('0x9')](),controller['update']);router['delete']('/:id',auth[_0x190e('0x9')](),controller['destroy']);module[_0x190e('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index f463d89..7279fb7 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 _0x9c1f=['sequelize','exports','STRING','mouseOver','timeout','INTEGER'];(function(_0x3aa2f5,_0x286fa0){var _0x43cf17=function(_0x7695f5){while(--_0x7695f5){_0x3aa2f5['push'](_0x3aa2f5['shift']());}};_0x43cf17(++_0x286fa0);}(_0x9c1f,0xa2));var _0xf9c1=function(_0x1a6ef7,_0x6bb449){_0x1a6ef7=_0x1a6ef7-0x0;var _0x4f0d4b=_0x9c1f[_0x1a6ef7];return _0x4f0d4b;};'use strict';var Sequelize=require(_0xf9c1('0x0'));module[_0xf9c1('0x1')]={'name':{'type':Sequelize[_0xf9c1('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xf9c1('0x3'),_0xf9c1('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xf9c1('0x2')]},'timeout':{'type':Sequelize[_0xf9c1('0x5')]}};
\ No newline at end of file
+var _0x2a7e=['INTEGER','sequelize','exports','ENUM','mouseOver','STRING'];(function(_0x12e9af,_0x56a602){var _0x3fbb38=function(_0x41303d){while(--_0x41303d){_0x12e9af['push'](_0x12e9af['shift']());}};_0x3fbb38(++_0x56a602);}(_0x2a7e,0xf7));var _0xe2a7=function(_0x3c35fe,_0x3d6f11){_0x3c35fe=_0x3c35fe-0x0;var _0x546e20=_0x2a7e[_0x3c35fe];return _0x546e20;};'use strict';var Sequelize=require(_0xe2a7('0x0'));module[_0xe2a7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe2a7('0x2')](_0xe2a7('0x3'),'timeout'),'defaultValue':_0xe2a7('0x3')},'selector':{'type':Sequelize[_0xe2a7('0x4')]},'timeout':{'type':Sequelize[_0xe2a7('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index e6f63b3..3b1c922 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 _0xce1a=['name','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','catch','create','body','find','params','eml-format','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce1a,0xbf));var _0xace1=function(_0xdd5f90,_0x39278f){_0xdd5f90=_0xdd5f90-0x0;var _0x1df94d=_0xce1a[_0xdd5f90];return _0x1df94d;};'use strict';var emlformat=require(_0xace1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xace1('0x1'));var moment=require(_0xace1('0x2'));var BPromise=require(_0xace1('0x3'));var Mustache=require(_0xace1('0x4'));var util=require(_0xace1('0x5'));var path=require('path');var sox=require(_0xace1('0x6'));var csv=require('to-csv');var ejs=require(_0xace1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xace1('0x8'));var squel=require(_0xace1('0x9'));var crypto=require(_0xace1('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xace1('0xb'));var querystring=require('querystring');var Papa=require(_0xace1('0xc'));var Redis=require(_0xace1('0xd'));var authService=require(_0xace1('0xe'));var qs=require(_0xace1('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xace1('0x10'));var logger=require(_0xace1('0x11'))('api');var utils=require(_0xace1('0x12'));var config=require(_0xace1('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56d771,_0x2e1d19){_0x2e1d19=_0x2e1d19||0xcc;return function(_0x2f59f3){if(_0x2f59f3){return _0x56d771[_0xace1('0x14')](_0x2e1d19);}return _0x56d771['status'](_0x2e1d19)['end']();};}function respondWithResult(_0x4e8389,_0x319d1a){_0x319d1a=_0x319d1a||0xc8;return function(_0x18d9ce){if(_0x18d9ce){return _0x4e8389[_0xace1('0x15')](_0x319d1a)[_0xace1('0x16')](_0x18d9ce);}};}function respondWithFilteredResult(_0x248193,_0x303080){return function(_0x25114d){if(_0x25114d){var _0x6cc04e=typeof _0x303080['offset']==='undefined'&&typeof _0x303080[_0xace1('0x17')]===_0xace1('0x18');var _0x49cb73=_0x25114d[_0xace1('0x19')];var _0x162a79=_0x6cc04e?0x0:_0x303080[_0xace1('0x1a')];var _0x45541e=_0x6cc04e?_0x25114d[_0xace1('0x19')]:_0x303080['offset']+_0x303080['limit'];var _0x1781aa;if(_0x45541e>=_0x49cb73){_0x45541e=_0x49cb73;_0x1781aa=0xc8;}else{_0x1781aa=0xce;}_0x248193['status'](_0x1781aa);return _0x248193[_0xace1('0x1b')](_0xace1('0x1c'),_0x162a79+'-'+_0x45541e+'/'+_0x49cb73)[_0xace1('0x16')](_0x25114d);}return null;};}function patchUpdates(_0x4fe2ba){return function(_0x183941){try{jsonpatch[_0xace1('0x1d')](_0x183941,_0x4fe2ba,!![]);}catch(_0x4fce58){return BPromise[_0xace1('0x1e')](_0x4fce58);}return _0x183941[_0xace1('0x1f')]();};}function saveUpdates(_0xe0bda8,_0x41ab2b){return function(_0x484ac1){if(_0x484ac1){return _0x484ac1[_0xace1('0x20')](_0xe0bda8)[_0xace1('0x21')](function(_0x15f2fb){return _0x15f2fb;});}return null;};}function removeEntity(_0x324b52,_0x120c33){return function(_0x9ff8a0){if(_0x9ff8a0){return _0x9ff8a0[_0xace1('0x22')]()[_0xace1('0x21')](function(){_0x324b52[_0xace1('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e99f5,_0x49cacb){return function(_0x937188){if(!_0x937188){_0x5e99f5[_0xace1('0x14')](0x194);}return _0x937188;};}function handleError(_0x4985b2,_0xe8723c){_0xe8723c=_0xe8723c||0x1f4;return function(_0x51ab2c){logger[_0xace1('0x23')](_0x51ab2c[_0xace1('0x24')]);if(_0x51ab2c[_0xace1('0x25')]){delete _0x51ab2c[_0xace1('0x25')];}_0x4985b2['status'](_0xe8723c)['send'](_0x51ab2c);};}exports[_0xace1('0x26')]=function(_0x455286,_0x1dacd0){var _0x2677da={'raw':!![],'where':{'id':_0x455286['params']['id']}},_0x4f52a9={};_0x4f52a9[_0xace1('0x27')]=_[_0xace1('0x28')](db[_0xace1('0x29')][_0xace1('0x2a')]);_0x4f52a9[_0xace1('0x2b')]=_[_0xace1('0x28')](_0x455286[_0xace1('0x2b')]);_0x4f52a9[_0xace1('0x2c')]=_[_0xace1('0x2d')](_0x4f52a9[_0xace1('0x27')],_0x4f52a9[_0xace1('0x2b')]);_0x2677da[_0xace1('0x2e')]=_[_0xace1('0x2d')](_0x4f52a9[_0xace1('0x27')],qs['fields'](_0x455286['query'][_0xace1('0x2f')]));_0x2677da['attributes']=_0x2677da[_0xace1('0x2e')][_0xace1('0x30')]?_0x2677da[_0xace1('0x2e')]:_0x4f52a9[_0xace1('0x27')];if(_0x455286[_0xace1('0x2b')][_0xace1('0x31')]){_0x2677da['include']=[{'all':!![]}];}_0x2677da=_[_0xace1('0x32')]({},_0x2677da,_0x455286[_0xace1('0x33')]);return db[_0xace1('0x29')]['find'](_0x2677da)['then'](handleEntityNotFound(_0x1dacd0,null))[_0xace1('0x21')](respondWithResult(_0x1dacd0,null))[_0xace1('0x34')](handleError(_0x1dacd0,null));};exports[_0xace1('0x35')]=function(_0x626aea,_0x37757a){return db[_0xace1('0x29')][_0xace1('0x35')](_0x626aea[_0xace1('0x36')],{})[_0xace1('0x21')](respondWithResult(_0x37757a,0xc9))[_0xace1('0x34')](handleError(_0x37757a,null));};exports[_0xace1('0x20')]=function(_0x3b6557,_0x374a11){if(_0x3b6557['body']['id']){delete _0x3b6557['body']['id'];}return db['ChatProactiveAction'][_0xace1('0x37')]({'where':{'id':_0x3b6557[_0xace1('0x38')]['id']}})['then'](handleEntityNotFound(_0x374a11,null))[_0xace1('0x21')](saveUpdates(_0x3b6557[_0xace1('0x36')],null))[_0xace1('0x21')](respondWithResult(_0x374a11,null))[_0xace1('0x34')](handleError(_0x374a11,null));};exports[_0xace1('0x22')]=function(_0x5308da,_0x5112dc){return db['ChatProactiveAction'][_0xace1('0x37')]({'where':{'id':_0x5308da[_0xace1('0x38')]['id']}})[_0xace1('0x21')](handleEntityNotFound(_0x5112dc,null))[_0xace1('0x21')](removeEntity(_0x5112dc,null))['catch'](handleError(_0x5112dc,null));};
\ No newline at end of file
+var _0x0a9f=['papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','show','rawAttributes','query','keys','filters','model','intersection','fields','attributes','include','merge','options','ChatProactiveAction','find','catch','create','body','params','rimraf','zip-dir','moment','mustache','ejs','fs-extra','squel','jsforce','desk.js','querystring'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x0a9f,0x64));var _0xf0a9=function(_0xde9959,_0x415b88){_0xde9959=_0xde9959-0x0;var _0x24d9d5=_0x0a9f[_0xde9959];return _0x24d9d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf0a9('0x0'));var zipdir=require(_0xf0a9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf0a9('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf0a9('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf0a9('0x4'));var fs=require('fs');var fs_extra=require(_0xf0a9('0x5'));var _=require('lodash');var squel=require(_0xf0a9('0x6'));var crypto=require('crypto');var jsforce=require(_0xf0a9('0x7'));var deskjs=require(_0xf0a9('0x8'));var toCsv=require('to-csv');var querystring=require(_0xf0a9('0x9'));var Papa=require(_0xf0a9('0xa'));var Redis=require(_0xf0a9('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xf0a9('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0a9('0xd'));var logger=require(_0xf0a9('0xe'))(_0xf0a9('0xf'));var utils=require(_0xf0a9('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xf0a9('0x11'));var db=require(_0xf0a9('0x12'))['db'];function respondWithStatusCode(_0x6a469e,_0xde853){_0xde853=_0xde853||0xcc;return function(_0x4c8877){if(_0x4c8877){return _0x6a469e['sendStatus'](_0xde853);}return _0x6a469e[_0xf0a9('0x13')](_0xde853)[_0xf0a9('0x14')]();};}function respondWithResult(_0xe27d7e,_0x24c3c9){_0x24c3c9=_0x24c3c9||0xc8;return function(_0x437a3b){if(_0x437a3b){return _0xe27d7e[_0xf0a9('0x13')](_0x24c3c9)[_0xf0a9('0x15')](_0x437a3b);}};}function respondWithFilteredResult(_0x48cffd,_0x18e6ce){return function(_0x4bb2f2){if(_0x4bb2f2){var _0x373ba8=typeof _0x18e6ce['offset']===_0xf0a9('0x16')&&typeof _0x18e6ce['limit']===_0xf0a9('0x16');var _0x43b7f3=_0x4bb2f2[_0xf0a9('0x17')];var _0xf9f800=_0x373ba8?0x0:_0x18e6ce[_0xf0a9('0x18')];var _0x37ddab=_0x373ba8?_0x4bb2f2[_0xf0a9('0x17')]:_0x18e6ce[_0xf0a9('0x18')]+_0x18e6ce[_0xf0a9('0x19')];var _0x4ecb10;if(_0x37ddab>=_0x43b7f3){_0x37ddab=_0x43b7f3;_0x4ecb10=0xc8;}else{_0x4ecb10=0xce;}_0x48cffd[_0xf0a9('0x13')](_0x4ecb10);return _0x48cffd[_0xf0a9('0x1a')](_0xf0a9('0x1b'),_0xf9f800+'-'+_0x37ddab+'/'+_0x43b7f3)['json'](_0x4bb2f2);}return null;};}function patchUpdates(_0x42e7f3){return function(_0x5c26c1){try{jsonpatch[_0xf0a9('0x1c')](_0x5c26c1,_0x42e7f3,!![]);}catch(_0x2f57e7){return BPromise['reject'](_0x2f57e7);}return _0x5c26c1[_0xf0a9('0x1d')]();};}function saveUpdates(_0x1707c2,_0xad2291){return function(_0x52b3cf){if(_0x52b3cf){return _0x52b3cf[_0xf0a9('0x1e')](_0x1707c2)[_0xf0a9('0x1f')](function(_0x132203){return _0x132203;});}return null;};}function removeEntity(_0x453307,_0x3f1013){return function(_0x41c958){if(_0x41c958){return _0x41c958[_0xf0a9('0x20')]()['then'](function(){_0x453307['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f39a3,_0x23ed63){return function(_0x1064cf){if(!_0x1064cf){_0x3f39a3['sendStatus'](0x194);}return _0x1064cf;};}function handleError(_0x3b1377,_0x12133f){_0x12133f=_0x12133f||0x1f4;return function(_0x1d93d2){logger[_0xf0a9('0x21')](_0x1d93d2[_0xf0a9('0x22')]);if(_0x1d93d2[_0xf0a9('0x23')]){delete _0x1d93d2['name'];}_0x3b1377[_0xf0a9('0x13')](_0x12133f)[_0xf0a9('0x24')](_0x1d93d2);};}exports[_0xf0a9('0x25')]=function(_0x1f24a2,_0x153a4e){var _0x4834e0={'raw':!![],'where':{'id':_0x1f24a2['params']['id']}},_0x1c2fef={};_0x1c2fef['model']=_['keys'](db['ChatProactiveAction'][_0xf0a9('0x26')]);_0x1c2fef[_0xf0a9('0x27')]=_[_0xf0a9('0x28')](_0x1f24a2['query']);_0x1c2fef[_0xf0a9('0x29')]=_['intersection'](_0x1c2fef[_0xf0a9('0x2a')],_0x1c2fef[_0xf0a9('0x27')]);_0x4834e0['attributes']=_[_0xf0a9('0x2b')](_0x1c2fef[_0xf0a9('0x2a')],qs[_0xf0a9('0x2c')](_0x1f24a2[_0xf0a9('0x27')][_0xf0a9('0x2c')]));_0x4834e0[_0xf0a9('0x2d')]=_0x4834e0['attributes']['length']?_0x4834e0['attributes']:_0x1c2fef['model'];if(_0x1f24a2[_0xf0a9('0x27')]['includeAll']){_0x4834e0[_0xf0a9('0x2e')]=[{'all':!![]}];}_0x4834e0=_[_0xf0a9('0x2f')]({},_0x4834e0,_0x1f24a2[_0xf0a9('0x30')]);return db[_0xf0a9('0x31')][_0xf0a9('0x32')](_0x4834e0)['then'](handleEntityNotFound(_0x153a4e,null))[_0xf0a9('0x1f')](respondWithResult(_0x153a4e,null))[_0xf0a9('0x33')](handleError(_0x153a4e,null));};exports[_0xf0a9('0x34')]=function(_0x573d27,_0x19e297){return db['ChatProactiveAction'][_0xf0a9('0x34')](_0x573d27[_0xf0a9('0x35')],{})[_0xf0a9('0x1f')](respondWithResult(_0x19e297,0xc9))[_0xf0a9('0x33')](handleError(_0x19e297,null));};exports[_0xf0a9('0x1e')]=function(_0x12e4ba,_0x538ebe){if(_0x12e4ba[_0xf0a9('0x35')]['id']){delete _0x12e4ba['body']['id'];}return db[_0xf0a9('0x31')][_0xf0a9('0x32')]({'where':{'id':_0x12e4ba[_0xf0a9('0x36')]['id']}})[_0xf0a9('0x1f')](handleEntityNotFound(_0x538ebe,null))[_0xf0a9('0x1f')](saveUpdates(_0x12e4ba[_0xf0a9('0x35')],null))[_0xf0a9('0x1f')](respondWithResult(_0x538ebe,null))[_0xf0a9('0x33')](handleError(_0x538ebe,null));};exports['destroy']=function(_0x5826c2,_0x42c072){return db['ChatProactiveAction'][_0xf0a9('0x32')]({'where':{'id':_0x5826c2[_0xf0a9('0x36')]['id']}})[_0xf0a9('0x1f')](handleEntityNotFound(_0x42c072,null))['then'](removeEntity(_0x42c072,null))[_0xf0a9('0x33')](handleError(_0x42c072,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 6c45b58..e24bb74 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 _0x504b=['moment','request-promise','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x262baa,_0x283058){var _0x4f2257=function(_0x2cd1c6){while(--_0x2cd1c6){_0x262baa['push'](_0x262baa['shift']());}};_0x4f2257(++_0x283058);}(_0x504b,0x97));var _0xb504=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x504b[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xb504('0x0'));var util=require(_0xb504('0x1'));var logger=require(_0xb504('0x2'))('api');var moment=require(_0xb504('0x3'));var BPromise=require('bluebird');var rp=require(_0xb504('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb504('0x5'));var config=require(_0xb504('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0xb504('0x7')]=function(_0x6319e7,_0x2b6627){return _0x6319e7[_0xb504('0x8')](_0xb504('0x9'),attributes,{'tableName':_0xb504('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8eac=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x8eac,0x1cc));var _0xc8ea=function(_0x15f8ad,_0x5275c3){_0x15f8ad=_0x15f8ad-0x0;var _0xc0238a=_0x8eac[_0x15f8ad];return _0xc0238a;};'use strict';var _=require(_0xc8ea('0x0'));var util=require(_0xc8ea('0x1'));var logger=require(_0xc8ea('0x2'))(_0xc8ea('0x3'));var moment=require('moment');var BPromise=require(_0xc8ea('0x4'));var rp=require(_0xc8ea('0x5'));var fs=require('fs');var path=require(_0xc8ea('0x6'));var rimraf=require(_0xc8ea('0x7'));var config=require(_0xc8ea('0x8'));var attributes=require(_0xc8ea('0x9'));module[_0xc8ea('0xa')]=function(_0x48691f,_0x4e4fe0){return _0x48691f[_0xc8ea('0xb')](_0xc8ea('0xc'),attributes,{'tableName':_0xc8ea('0xd'),'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 2bc943e..785888e 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 _0x663d=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3c7ee5,_0x11bc4c){var _0x202a66=function(_0x1fe31d){while(--_0x1fe31d){_0x3c7ee5['push'](_0x3c7ee5['shift']());}};_0x202a66(++_0x11bc4c);}(_0x663d,0x1d2));var _0xd663=function(_0xdb94db,_0x281c43){_0xdb94db=_0xdb94db-0x0;var _0x567bdb=_0x663d[_0xdb94db];return _0x567bdb;};'use strict';var _=require(_0xd663('0x0'));var util=require(_0xd663('0x1'));var moment=require(_0xd663('0x2'));var BPromise=require(_0xd663('0x3'));var rs=require(_0xd663('0x4'));var fs=require('fs');var Redis=require(_0xd663('0x5'));var db=require(_0xd663('0x6'))['db'];var utils=require(_0xd663('0x7'));var logger=require(_0xd663('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd663('0x9')][_0xd663('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x66a9b8,_0x2a6b93,_0x231932){return new BPromise(function(_0x407088,_0x159cc1){return client['request'](_0x66a9b8,_0x231932)[_0xd663('0xb')](function(_0x2b0244){logger[_0xd663('0xc')](_0xd663('0xd'),_0x2a6b93,_0xd663('0xe'));logger[_0xd663('0xf')](_0xd663('0x10'),_0x2a6b93,_0xd663('0xe'),JSON[_0xd663('0x11')](_0x2b0244));if(_0x2b0244[_0xd663('0x12')]){if(_0x2b0244[_0xd663('0x12')][_0xd663('0x13')]===0x1f4){logger[_0xd663('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x2a6b93,_0x2b0244[_0xd663('0x12')][_0xd663('0x14')]);return _0x159cc1(_0x2b0244[_0xd663('0x12')][_0xd663('0x14')]);}logger[_0xd663('0x12')](_0xd663('0xd'),_0x2a6b93,_0x2b0244[_0xd663('0x12')]['message']);return _0x407088(_0x2b0244[_0xd663('0x12')][_0xd663('0x14')]);}else{logger[_0xd663('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x2a6b93,_0xd663('0xe'));_0x407088(_0x2b0244[_0xd663('0x15')]['message']);}})['catch'](function(_0x59ea3d){logger[_0xd663('0x12')](_0xd663('0xd'),_0x2a6b93,_0x59ea3d);_0x159cc1(_0x59ea3d);});});}
\ No newline at end of file
+var _0x1be9=['debug','code','error','message','ChatProactiveAction,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','request\x20sent'];(function(_0x1f5f63,_0x14ace2){var _0xab31fa=function(_0x4a067b){while(--_0x4a067b){_0x1f5f63['push'](_0x1f5f63['shift']());}};_0xab31fa(++_0x14ace2);}(_0x1be9,0xa1));var _0x91be=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x1be9[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x91be('0x0'));var util=require(_0x91be('0x1'));var moment=require(_0x91be('0x2'));var BPromise=require(_0x91be('0x3'));var rs=require(_0x91be('0x4'));var fs=require('fs');var Redis=require(_0x91be('0x5'));var db=require(_0x91be('0x6'))['db'];var utils=require(_0x91be('0x7'));var logger=require(_0x91be('0x8'))('rpc');var config=require(_0x91be('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x91be('0xa')][_0x91be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18d3ab,_0x120de1,_0x4ade76){return new BPromise(function(_0x3f67ca,_0x5308e8){return client['request'](_0x18d3ab,_0x4ade76)[_0x91be('0xc')](function(_0x464cc4){logger[_0x91be('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x120de1,_0x91be('0xe'));logger[_0x91be('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x120de1,'request\x20sent',JSON['stringify'](_0x464cc4));if(_0x464cc4['error']){if(_0x464cc4['error'][_0x91be('0x10')]===0x1f4){logger[_0x91be('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x120de1,_0x464cc4[_0x91be('0x11')][_0x91be('0x12')]);return _0x5308e8(_0x464cc4[_0x91be('0x11')][_0x91be('0x12')]);}logger[_0x91be('0x11')](_0x91be('0x13'),_0x120de1,_0x464cc4[_0x91be('0x11')]['message']);return _0x3f67ca(_0x464cc4['error'][_0x91be('0x12')]);}else{logger[_0x91be('0xd')](_0x91be('0x13'),_0x120de1,'request\x20sent');_0x3f67ca(_0x464cc4[_0x91be('0x14')][_0x91be('0x12')]);}})[_0x91be('0x15')](function(_0x1d2592){logger['error'](_0x91be('0x13'),_0x120de1,_0x1d2592);_0x5308e8(_0x1d2592);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 6d2dfce..df31e8f 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 _0x7dfd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x3d43c4,_0x3e421b){var _0x382f66=function(_0x432e65){while(--_0x432e65){_0x3d43c4['push'](_0x3d43c4['shift']());}};_0x382f66(++_0x3e421b);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var fs_extra=require(_0xd7df('0x6'));var auth=require(_0xd7df('0x7'));var interaction=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var controller=require(_0xd7df('0xa'));router[_0xd7df('0xb')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0xe')]);router[_0xd7df('0xf')]('/',auth[_0xd7df('0xd')](),controller['create']);router[_0xd7df('0x10')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0x11')]);router['delete'](_0xd7df('0xc'),auth['isAuthenticated'](),controller[_0xd7df('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x46ed=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports'];(function(_0x14d042,_0x19eaea){var _0x28f422=function(_0x351c7c){while(--_0x351c7c){_0x14d042['push'](_0x14d042['shift']());}};_0x28f422(++_0x19eaea);}(_0x46ed,0x168));var _0xd46e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x46ed[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd46e('0x5'));var interaction=require(_0xd46e('0x6'));var config=require('../../config/environment');var controller=require(_0xd46e('0x7'));router[_0xd46e('0x8')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller[_0xd46e('0xb')]);router[_0xd46e('0xc')]('/',auth[_0xd46e('0xa')](),controller[_0xd46e('0xd')]);router[_0xd46e('0xe')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller['update']);router[_0xd46e('0xf')](_0xd46e('0x9'),auth['isAuthenticated'](),controller[_0xd46e('0x10')]);module[_0xd46e('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 8c57c95..7966310 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 _0xf008=['beepall','roundrobin','sequelize','exports','name','STRING','ENUM'];(function(_0x2e8f7b,_0x4121a7){var _0x398c1b=function(_0x104e13){while(--_0x104e13){_0x2e8f7b['push'](_0x2e8f7b['shift']());}};_0x398c1b(++_0x4121a7);}(_0xf008,0xfe));var _0x8f00=function(_0x2a47b5,_0x4d472c){_0x2a47b5=_0x2a47b5-0x0;var _0x1b6764=_0xf008[_0x2a47b5];return _0x1b6764;};'use strict';var Sequelize=require(_0x8f00('0x0'));module[_0x8f00('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8f00('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8f00('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8f00('0x4')]('rrmemory',_0x8f00('0x5'),_0x8f00('0x6'))}};
\ No newline at end of file
+var _0x81e5=['name','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x4bdddd,_0x1a8526){var _0x35f76c=function(_0x389f2a){while(--_0x389f2a){_0x4bdddd['push'](_0x4bdddd['shift']());}};_0x35f76c(++_0x1a8526);}(_0x81e5,0x1f1));var _0x581e=function(_0x4cda62,_0x2e4792){_0x4cda62=_0x4cda62-0x0;var _0x26a668=_0x81e5[_0x4cda62];return _0x26a668;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x581e('0x0')],'unique':_0x581e('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x581e('0x2')](_0x581e('0x3'),_0x581e('0x4'),_0x581e('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 2477b0c..6664fa4 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 _0x01f1=['updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','interface','flatMap','sequelize','forEach','userChatQueue:save','ids','select','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','transaction','removeTeams','isEmpty','removeAgents','emit','addAgents','userChatQueue:remove','getAgents','order','bluebird','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','update','then','get','error','stack','name','send','map','ChatQueue','fieldName','type','getOptions','where','findAll','catch','show','model','rawAttributes','query','keys','filters','fields','length','attributes','includeAll','include','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','describe','getMembers','findOne','UserChatQueue','intersection','hasOwnProperty','nolimit','sort','pick','ChatQueueId','filter','User','UserId','agent','chatPause'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01f1,0x114));var _0x101f=function(_0x3ff2f9,_0x544ba1){_0x3ff2f9=_0x3ff2f9-0x0;var _0x3b0913=_0x01f1[_0x3ff2f9];return _0x3b0913;};'use strict';var BPromise=require(_0x101f('0x0'));var util=require('util');var _=require(_0x101f('0x1'));var squel=require(_0x101f('0x2'));var Redis=require(_0x101f('0x3'));var qs=require(_0x101f('0x4'));var logger=require('../../config/logger')(_0x101f('0x5'));var config=require(_0x101f('0x6'));var db=require('../../mysqldb')['db'];config[_0x101f('0x7')]=_[_0x101f('0x8')](config[_0x101f('0x7')],{'host':_0x101f('0x9'),'port':0x18eb});var socket=require(_0x101f('0xa'))(new Redis(config[_0x101f('0x7')]));require('./chatQueue.socket')[_0x101f('0xb')](socket);function respondWithStatusCode(_0x53b4fe,_0x17388f){_0x17388f=_0x17388f||0xcc;return function(_0x250b19){if(_0x250b19){return _0x53b4fe[_0x101f('0xc')](_0x17388f);}return _0x53b4fe[_0x101f('0xd')](_0x17388f)['end']();};}function respondWithResult(_0x513695,_0x1ecc5c){_0x1ecc5c=_0x1ecc5c||0xc8;return function(_0x56d6dc){if(_0x56d6dc){return _0x513695[_0x101f('0xd')](_0x1ecc5c)[_0x101f('0xe')](_0x56d6dc);}};}function respondWithFilteredResult(_0x243808,_0x43b920){return function(_0x5cab52){if(_0x5cab52){var _0xf4cb95=typeof _0x43b920[_0x101f('0xf')]===_0x101f('0x10')&&typeof _0x43b920[_0x101f('0x11')]==='undefined';var _0x14ceea=_0x5cab52[_0x101f('0x12')];var _0x5df555=_0xf4cb95?0x0:_0x43b920[_0x101f('0xf')];var _0x5dbba4=_0xf4cb95?_0x5cab52[_0x101f('0x12')]:_0x43b920['offset']+_0x43b920[_0x101f('0x11')];var _0x598e90;if(_0x5dbba4>=_0x14ceea){_0x5dbba4=_0x14ceea;_0x598e90=0xc8;}else{_0x598e90=0xce;}_0x243808['status'](_0x598e90);return _0x243808[_0x101f('0x13')]('Content-Range',_0x5df555+'-'+_0x5dbba4+'/'+_0x14ceea)[_0x101f('0xe')](_0x5cab52);}return null;};}function saveUpdates(_0x2efa9f){return function(_0x4d4643){if(_0x4d4643){return _0x4d4643[_0x101f('0x14')](_0x2efa9f)[_0x101f('0x15')](function(_0x52fc68){return _0x52fc68;});}return null;};}function removeEntity(_0x1e10ad){return function(_0x464429){if(_0x464429){return _0x464429['destroy']()[_0x101f('0x15')](function(){var _0x30254=_0x464429[_0x101f('0x16')]({'plain':!![]});var _0x412b59='ChatQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x412b59,'resourceId':_0x30254['id']}})['then'](function(){return _0x464429;});})[_0x101f('0x15')](function(){_0x1e10ad[_0x101f('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d9cee){return function(_0x14088d){if(!_0x14088d){_0x2d9cee[_0x101f('0xc')](0x194);}return _0x14088d;};}function handleError(_0x52061a,_0x29d638){_0x29d638=_0x29d638||0x1f4;return function(_0x1d7dd9){logger[_0x101f('0x17')](_0x1d7dd9[_0x101f('0x18')]);if(_0x1d7dd9['name']){delete _0x1d7dd9[_0x101f('0x19')];}_0x52061a[_0x101f('0xd')](_0x29d638)[_0x101f('0x1a')](_0x1d7dd9);};}exports['index']=function(_0x387b0c,_0x5460de){var _0x30fd4f={};var _0x5dea3d={'count':0x0,'rows':[]};var _0x441c4c=_[_0x101f('0x1b')](db[_0x101f('0x1c')]['rawAttributes'],function(_0x2930f){return{'name':_0x2930f[_0x101f('0x1d')],'type':_0x2930f[_0x101f('0x1e')]['key']};});_0x30fd4f=qs[_0x101f('0x1f')](_0x441c4c,_0x387b0c);var _0x1945b4={'where':_0x30fd4f[_0x101f('0x20')]};return db['ChatQueue']['count'](_0x1945b4)[_0x101f('0x15')](function(_0x5bf754){_0x5dea3d[_0x101f('0x12')]=_0x5bf754;_0x30fd4f['include']=qs['include'](_0x387b0c['query']);return db[_0x101f('0x1c')][_0x101f('0x21')](_0x30fd4f);})['then'](function(_0x1e4111){_0x5dea3d['rows']=_0x1e4111;return _0x5dea3d;})['then'](respondWithFilteredResult(_0x5460de,_0x30fd4f))[_0x101f('0x22')](handleError(_0x5460de,null));};exports[_0x101f('0x23')]=function(_0x2cfa66,_0x1bb2db){var _0x4bd791={'raw':!![],'where':{'id':_0x2cfa66['params']['id']}},_0x17127a={};_0x17127a[_0x101f('0x24')]=_['keys'](db[_0x101f('0x1c')][_0x101f('0x25')]);_0x17127a[_0x101f('0x26')]=_[_0x101f('0x27')](_0x2cfa66['query']);_0x17127a[_0x101f('0x28')]=_['intersection'](_0x17127a[_0x101f('0x24')],_0x17127a[_0x101f('0x26')]);_0x4bd791['attributes']=_['intersection'](_0x17127a[_0x101f('0x24')],qs[_0x101f('0x29')](_0x2cfa66[_0x101f('0x26')][_0x101f('0x29')]));_0x4bd791['attributes']=_0x4bd791['attributes'][_0x101f('0x2a')]?_0x4bd791[_0x101f('0x2b')]:_0x17127a[_0x101f('0x24')];if(_0x2cfa66[_0x101f('0x26')][_0x101f('0x2c')]){_0x4bd791[_0x101f('0x2d')]=[{'all':!![]}];}_0x4bd791=_[_0x101f('0x2e')]({},_0x4bd791,_0x2cfa66[_0x101f('0x2f')]);return db[_0x101f('0x1c')][_0x101f('0x30')](_0x4bd791)[_0x101f('0x15')](handleEntityNotFound(_0x1bb2db,null))[_0x101f('0x15')](respondWithResult(_0x1bb2db,null))['catch'](handleError(_0x1bb2db,null));};exports[_0x101f('0x31')]=function(_0x5385fd,_0x10beea){return db[_0x101f('0x1c')][_0x101f('0x31')](_0x5385fd[_0x101f('0x32')],{})[_0x101f('0x15')](function(_0x5a7d34){var _0xa4d4fb=_0x5385fd[_0x101f('0x33')][_0x101f('0x16')]({'plain':!![]});if(!_0xa4d4fb)throw new Error(_0x101f('0x34'));if(_0xa4d4fb['role']===_0x101f('0x33')){var _0x505433=_0x5a7d34[_0x101f('0x16')]({'plain':!![]});var _0x55290e=_0x101f('0x35');return db['UserProfileSection']['find']({'where':{'name':_0x55290e,'userProfileId':_0xa4d4fb[_0x101f('0x36')]},'raw':!![]})['then'](function(_0x2770b6){if(_0x2770b6&&_0x2770b6[_0x101f('0x37')]===0x0){return db[_0x101f('0x38')]['create']({'name':_0x505433[_0x101f('0x19')],'resourceId':_0x505433['id'],'type':_0x2770b6[_0x101f('0x19')],'sectionId':_0x2770b6['id']},{})[_0x101f('0x15')](function(){return _0x5a7d34;});}else{return _0x5a7d34;}})[_0x101f('0x22')](function(_0x5dcc14){logger[_0x101f('0x17')](_0x101f('0x39'),_0x5dcc14);throw _0x5dcc14;});}return _0x5a7d34;})[_0x101f('0x15')](respondWithResult(_0x10beea,0xc9))[_0x101f('0x22')](handleError(_0x10beea,null));};exports[_0x101f('0x14')]=function(_0x4f0bba,_0x26d86f){if(_0x4f0bba['body']['id']){delete _0x4f0bba[_0x101f('0x32')]['id'];}return db[_0x101f('0x1c')]['find']({'where':{'id':_0x4f0bba['params']['id']}})[_0x101f('0x15')](handleEntityNotFound(_0x26d86f,null))['then'](saveUpdates(_0x4f0bba[_0x101f('0x32')],null))['then'](respondWithResult(_0x26d86f,null))[_0x101f('0x22')](handleError(_0x26d86f,null));};exports[_0x101f('0x3a')]=function(_0x51ac53,_0x57a17a){return db[_0x101f('0x1c')][_0x101f('0x30')]({'where':{'id':_0x51ac53[_0x101f('0x3b')]['id']}})[_0x101f('0x15')](handleEntityNotFound(_0x57a17a,null))[_0x101f('0x15')](removeEntity(_0x57a17a,null))[_0x101f('0x22')](handleError(_0x57a17a,null));};exports[_0x101f('0x3c')]=function(_0x23c78e,_0x5af813){return db[_0x101f('0x1c')][_0x101f('0x3c')]()[_0x101f('0x15')](respondWithResult(_0x5af813,null))[_0x101f('0x22')](handleError(_0x5af813,null));};exports[_0x101f('0x3d')]=function(_0x67dfdb,_0x354ddc){var _0x71a761={'raw':!![],'where':{}},_0x30200b={},_0xbaeb1d;return db[_0x101f('0x1c')][_0x101f('0x3e')]({'where':{'id':_0x67dfdb[_0x101f('0x3b')]['id']}})[_0x101f('0x15')](handleEntityNotFound(_0x354ddc,null))[_0x101f('0x15')](function(_0x4c23b2){if(_0x4c23b2){_0xbaeb1d=_0x4c23b2[_0x101f('0x16')]({'plain':!![]});_0x30200b[_0x101f('0x24')]=_['keys'](db[_0x101f('0x3f')]['rawAttributes']);_0x30200b[_0x101f('0x26')]=_['keys'](_0x67dfdb[_0x101f('0x26')]);_0x30200b[_0x101f('0x28')]=_[_0x101f('0x40')](_0x30200b[_0x101f('0x24')],_0x30200b[_0x101f('0x26')]);_0x71a761[_0x101f('0x2b')]=_[_0x101f('0x40')](_0x30200b['model'],qs['fields'](_0x67dfdb['query'][_0x101f('0x29')]));_0x71a761[_0x101f('0x2b')]=_0x71a761['attributes']['length']?_0x71a761['attributes']:_0x30200b[_0x101f('0x24')];if(!_0x67dfdb[_0x101f('0x26')][_0x101f('0x41')](_0x101f('0x42'))){_0x71a761[_0x101f('0x11')]=qs['limit'](_0x67dfdb['query'][_0x101f('0x11')]);_0x71a761[_0x101f('0xf')]=qs['offset'](_0x67dfdb['query'][_0x101f('0xf')]);}_0x71a761['order']=qs[_0x101f('0x43')](_0x67dfdb[_0x101f('0x26')][_0x101f('0x43')]);_0x71a761[_0x101f('0x20')]=qs[_0x101f('0x28')](_[_0x101f('0x44')](_0x67dfdb['query'],_0x30200b[_0x101f('0x28')]));_0x71a761[_0x101f('0x20')][_0x101f('0x45')]=_0x4c23b2['id'];if(_0x67dfdb[_0x101f('0x26')][_0x101f('0x46')]){_0x71a761[_0x101f('0x20')]=_['merge'](_0x71a761[_0x101f('0x20')],{'$or':_[_0x101f('0x1b')](_0x71a761[_0x101f('0x2b')],function(_0x243741){var _0x5ad259={};_0x5ad259[_0x243741]={'$like':'%'+_0x67dfdb[_0x101f('0x26')][_0x101f('0x46')]+'%'};return _0x5ad259;})});}_0x71a761=_[_0x101f('0x2e')]({},_0x71a761,_0x67dfdb[_0x101f('0x2f')]);return db[_0x101f('0x3f')][_0x101f('0x21')](_0x71a761);}})[_0x101f('0x15')](function(_0x4c81da){if(_0x4c81da){return db[_0x101f('0x47')]['findAndCountAll']({'where':{'id':_['map'](_0x4c81da,_0x101f('0x48')),'role':_0x101f('0x49')},'attributes':['id',_0x101f('0x19'),_0x101f('0x4a'),_0x101f('0x4b'),_0x101f('0x4c')]});}})[_0x101f('0x15')](function(_0x2e5c82){if(_0x2e5c82){return{'count':_0x2e5c82[_0x101f('0x12')],'rows':_[_0x101f('0x1b')](_0x2e5c82['rows'],function(_0x444315){return{'membername':_0x444315['name'],'UserId':_0x444315['id'],'queue_name':_0xbaeb1d[_0x101f('0x19')],'ChatQueueId':_0xbaeb1d['id'],'interface':util[_0x101f('0x4d')](_0x101f('0x4e'),_0x101f('0x4f'),_0x444315[_0x101f('0x19')]),'penalty':0x0,'paused':_0x444315[_0x101f('0x4a')],'createdAt':_0x444315['createdAt'],'updatedAt':_0x444315[_0x101f('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x354ddc,_0x71a761))[_0x101f('0x22')](handleError(_0x354ddc,null));};exports[_0x101f('0x50')]=function(_0x40b82f,_0xb7db8d){var _0x3cc5a1={};var _0x7470e3={};var _0x4dad0e;var _0x432652;return db[_0x101f('0x1c')][_0x101f('0x3e')]({'where':{'id':_0x40b82f[_0x101f('0x3b')]['id']}})[_0x101f('0x15')](handleEntityNotFound(_0xb7db8d,null))[_0x101f('0x15')](function(_0x1d20e2){if(_0x1d20e2){_0x4dad0e=_0x1d20e2;_0x7470e3['model']=_['keys'](db[_0x101f('0x51')][_0x101f('0x25')]);_0x7470e3['query']=_[_0x101f('0x27')](_0x40b82f['query']);_0x7470e3['filters']=_[_0x101f('0x40')](_0x7470e3[_0x101f('0x24')],_0x7470e3[_0x101f('0x26')]);_0x3cc5a1[_0x101f('0x2b')]=_['intersection'](_0x7470e3[_0x101f('0x24')],qs[_0x101f('0x29')](_0x40b82f[_0x101f('0x26')][_0x101f('0x29')]));_0x3cc5a1[_0x101f('0x2b')]=_0x3cc5a1[_0x101f('0x2b')]['length']?_0x3cc5a1[_0x101f('0x2b')]:_0x7470e3[_0x101f('0x24')];_0x3cc5a1['order']=qs[_0x101f('0x43')](_0x40b82f[_0x101f('0x26')][_0x101f('0x43')]);_0x3cc5a1[_0x101f('0x20')]=qs['filters'](_[_0x101f('0x44')](_0x40b82f[_0x101f('0x26')],_0x7470e3[_0x101f('0x28')]));if(_0x40b82f[_0x101f('0x26')][_0x101f('0x46')]){_0x3cc5a1[_0x101f('0x20')]=_[_0x101f('0x2e')](_0x3cc5a1['where'],{'$or':_[_0x101f('0x1b')](_0x3cc5a1[_0x101f('0x2b')],function(_0x2d9fae){var _0x3b179e={};_0x3b179e[_0x2d9fae]={'$like':'%'+_0x40b82f[_0x101f('0x26')][_0x101f('0x46')]+'%'};return _0x3b179e;})});}_0x3cc5a1=_[_0x101f('0x2e')]({},_0x3cc5a1,_0x40b82f[_0x101f('0x2f')]);return _0x4dad0e['getTeams'](_0x3cc5a1);}})[_0x101f('0x15')](function(_0xb69fff){if(_0xb69fff){_0x432652=_0xb69fff[_0x101f('0x2a')];if(!_0x40b82f[_0x101f('0x26')][_0x101f('0x41')](_0x101f('0x42'))){_0x3cc5a1[_0x101f('0x11')]=qs[_0x101f('0x11')](_0x40b82f['query'][_0x101f('0x11')]);_0x3cc5a1['offset']=qs['offset'](_0x40b82f[_0x101f('0x26')][_0x101f('0xf')]);}return _0x4dad0e['getTeams'](_0x3cc5a1);}})[_0x101f('0x15')](function(_0x1f4cf2){if(_0x1f4cf2){return _0x1f4cf2?{'count':_0x432652,'rows':_0x1f4cf2}:null;}})[_0x101f('0x15')](respondWithResult(_0xb7db8d,null))[_0x101f('0x22')](handleError(_0xb7db8d,null));};exports[_0x101f('0x52')]=function(_0x1415e9,_0x2e7a88){var _0x382fc6=_0x1415e9['body']['ids'];return db[_0x101f('0x51')][_0x101f('0x21')]({'where':{'id':_0x382fc6},'attributes':['id'],'include':[{'model':db['User'],'as':_0x101f('0x53'),'attributes':['id',_0x101f('0x19'),_0x101f('0x54'),'voicePause',_0x101f('0x55')],'raw':!![]}]})['then'](function(_0x183a58){if(_0x183a58){var _0x47b292=_[_0x101f('0x56')](_0x183a58,function(_0xd3e3a8){var _0x431955=_0xd3e3a8[_0x101f('0x16')]({'plain':!![]});return _0x431955[_0x101f('0x53')];});return db['ChatQueue'][_0x101f('0x30')]({'where':{'id':_0x1415e9[_0x101f('0x3b')]['id']}})[_0x101f('0x15')](function(_0x360ba8){return db[_0x101f('0x57')]['transaction'](function(_0x2c44e8){return _0x360ba8[_0x101f('0x52')](_0x382fc6,{'transaction':_0x2c44e8})[_0x101f('0x15')](function(){return BPromise['each'](_0x47b292,function(_0x4b38fc){return db[_0x101f('0x3f')]['findOrCreate']({'where':{'UserId':_0x4b38fc['id'],'ChatQueueId':_0x1415e9[_0x101f('0x3b')]['id']},'transaction':_0x2c44e8});});})[_0x101f('0x15')](function(){_0x47b292[_0x101f('0x58')](function(_0x4f4ca0){socket['emit'](_0x101f('0x59'),{'UserId':_0x4f4ca0['id'],'ChatQueueId':_0x360ba8['id']});});});});});}})['then'](respondWithStatusCode(_0x2e7a88,null))['catch'](handleError(_0x2e7a88,null));};exports['removeTeams']=function(_0x37c5d0,_0x2b3cb9){return db[_0x101f('0x51')][_0x101f('0x21')]({'where':{'id':_0x37c5d0['query'][_0x101f('0x5a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x101f('0x53'),'attributes':['id'],'raw':!![]}]})[_0x101f('0x15')](handleEntityNotFound(_0x2b3cb9,null))['then'](function(_0x2f803f){var _0x129e43=_[_0x101f('0x1b')](_0x2f803f,'id');var _0x5b9995=[];var _0x3ef2cd=[];var _0x1365f1=squel[_0x101f('0x5b')]();_0x1365f1['field']('tq.TeamId')['from'](_0x101f('0x5c'),'tq')[_0x101f('0x5d')](_0x101f('0x5e'),'ut',_0x101f('0x5f'))[_0x101f('0x20')](_0x101f('0x60'),_0x37c5d0['params']['id']);for(var _0x3856c9=0x0;_0x3856c9<_0x2f803f[_0x101f('0x2a')];_0x3856c9+=0x1){let _0x255e49=_0x2f803f[_0x3856c9];for(var _0x3894dc=0x0;_0x3894dc<_0x255e49[_0x101f('0x53')][_0x101f('0x2a')];_0x3894dc+=0x1){let _0x4e4fd0=_0x255e49[_0x101f('0x53')][_0x3894dc];var _0x5133dd=_0x1365f1[_0x101f('0x61')]();_0x5133dd[_0x101f('0x20')](_0x101f('0x62'),_0x4e4fd0['id']);_0x3ef2cd[_0x101f('0x63')](db['sequelize']['query'](_0x5133dd[_0x101f('0x64')](),{'type':db[_0x101f('0x57')][_0x101f('0x65')][_0x101f('0x66')]})[_0x101f('0x15')](function(_0x2a8123){if(_0x2a8123[_0x101f('0x2a')]===0x1){return _0x4e4fd0['id'];}else{var _0xd5ee2=_[_0x101f('0x67')](_[_0x101f('0x1b')](_0x2a8123,_0x101f('0x68')),function(_0x203347){return _['includes'](_0x129e43,_0x203347);});if(_0xd5ee2){return _0x4e4fd0['id'];}}}));}}return BPromise[_0x101f('0x69')](_0x3ef2cd)[_0x101f('0x15')](function(_0x53e7ca){_0x5b9995=_(_0x5b9995)[_0x101f('0x6a')](_0x53e7ca)[_0x101f('0x6b')]()['value']();return db[_0x101f('0x1c')]['find']({'where':{'id':_0x37c5d0[_0x101f('0x3b')]['id']}})[_0x101f('0x15')](function(_0x1e3d08){return db[_0x101f('0x57')][_0x101f('0x6c')](function(_0x115cd9){return _0x1e3d08[_0x101f('0x6d')](_0x37c5d0['query']['ids'],{'transaction':_0x115cd9})[_0x101f('0x15')](function(){if(!_[_0x101f('0x6e')](_0x5b9995)){return _0x1e3d08[_0x101f('0x6f')](_0x5b9995,{'transaction':_0x115cd9});}})[_0x101f('0x15')](function(){_0x5b9995[_0x101f('0x58')](function(_0x44d8ee){socket[_0x101f('0x70')]('userChatQueue:remove',{'UserId':_0x44d8ee,'ChatQueueId':_0x1e3d08['id']});});});});});});})[_0x101f('0x15')](respondWithStatusCode(_0x2b3cb9,null))[_0x101f('0x22')](handleError(_0x2b3cb9,null));};exports[_0x101f('0x71')]=function(_0x26cb19,_0xbc177a){return db['ChatQueue'][_0x101f('0x30')]({'where':{'id':_0x26cb19[_0x101f('0x3b')]['id']}})[_0x101f('0x15')](handleEntityNotFound(_0xbc177a,null))['then'](function(_0x16d8b7){if(_0x16d8b7){return _0x16d8b7[_0x101f('0x71')](_0x26cb19[_0x101f('0x32')][_0x101f('0x5a')],_['omit'](_0x26cb19[_0x101f('0x32')],[_0x101f('0x5a'),'id'])||{})['spread'](function(_0x16f83c){for(var _0x546be6=0x0;_0x546be6<_0x26cb19[_0x101f('0x32')][_0x101f('0x5a')][_0x101f('0x2a')];_0x546be6+=0x1){socket[_0x101f('0x70')](_0x101f('0x59'),{'UserId':Number(_0x26cb19[_0x101f('0x32')][_0x101f('0x5a')][_0x546be6]),'ChatQueueId':Number(_0x26cb19[_0x101f('0x3b')]['id'])});}return _0x16f83c;});}})[_0x101f('0x15')](respondWithResult(_0xbc177a,null))[_0x101f('0x22')](handleError(_0xbc177a,null));};exports['removeAgents']=function(_0x4382d,_0x135150){return db[_0x101f('0x1c')][_0x101f('0x30')]({'where':{'id':_0x4382d[_0x101f('0x3b')]['id']}})['then'](handleEntityNotFound(_0x135150,null))[_0x101f('0x15')](function(_0x2d441a){if(_0x2d441a){return _0x2d441a[_0x101f('0x6f')](_0x4382d[_0x101f('0x26')][_0x101f('0x5a')])[_0x101f('0x15')](function(){if(_['isArray'](_0x4382d[_0x101f('0x26')][_0x101f('0x5a')])){for(var _0x184964=0x0;_0x184964<_0x4382d['query'][_0x101f('0x5a')][_0x101f('0x2a')];_0x184964+=0x1){socket[_0x101f('0x70')](_0x101f('0x72'),{'UserId':Number(_0x4382d[_0x101f('0x26')][_0x101f('0x5a')][_0x184964]),'ChatQueueId':Number(_0x4382d[_0x101f('0x3b')]['id'])});}}else{socket[_0x101f('0x70')](_0x101f('0x72'),{'UserId':Number(_0x4382d['query'][_0x101f('0x5a')]),'ChatQueueId':Number(_0x4382d['params']['id'])});}});}})[_0x101f('0x15')](respondWithStatusCode(_0x135150,null))['catch'](handleError(_0x135150,null));};exports[_0x101f('0x73')]=function(_0x12234f,_0x2b1131){var _0x1a90ac={};var _0x42c31e={};var _0x2596c3;var _0x48b2c0;return db[_0x101f('0x1c')][_0x101f('0x3e')]({'where':{'id':_0x12234f[_0x101f('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2b1131,null))[_0x101f('0x15')](function(_0x439378){if(_0x439378){_0x2596c3=_0x439378;_0x42c31e[_0x101f('0x24')]=_[_0x101f('0x27')](db[_0x101f('0x47')][_0x101f('0x25')]);_0x42c31e[_0x101f('0x26')]=_[_0x101f('0x27')](_0x12234f[_0x101f('0x26')]);_0x42c31e['filters']=_['intersection'](_0x42c31e[_0x101f('0x24')],_0x42c31e[_0x101f('0x26')]);_0x1a90ac[_0x101f('0x2b')]=_['intersection'](_0x42c31e['model'],qs[_0x101f('0x29')](_0x12234f[_0x101f('0x26')][_0x101f('0x29')]));_0x1a90ac[_0x101f('0x2b')]=_0x1a90ac[_0x101f('0x2b')]['length']?_0x1a90ac[_0x101f('0x2b')]:_0x42c31e[_0x101f('0x24')];_0x1a90ac[_0x101f('0x74')]=qs['sort'](_0x12234f[_0x101f('0x26')][_0x101f('0x43')]);_0x1a90ac[_0x101f('0x20')]=qs[_0x101f('0x28')](_[_0x101f('0x44')](_0x12234f[_0x101f('0x26')],_0x42c31e[_0x101f('0x28')]));if(_0x12234f[_0x101f('0x26')]['filter']){_0x1a90ac[_0x101f('0x20')]=_[_0x101f('0x2e')](_0x1a90ac['where'],{'$or':_[_0x101f('0x1b')](_0x1a90ac[_0x101f('0x2b')],function(_0x2492f7){var _0x42c465={};_0x42c465[_0x2492f7]={'$like':'%'+_0x12234f[_0x101f('0x26')][_0x101f('0x46')]+'%'};return _0x42c465;})});}_0x1a90ac=_[_0x101f('0x2e')]({},_0x1a90ac,_0x12234f[_0x101f('0x2f')]);return _0x2596c3['getAgents'](_0x1a90ac);}})[_0x101f('0x15')](function(_0x562951){if(_0x562951){_0x48b2c0=_0x562951[_0x101f('0x2a')];if(!_0x12234f[_0x101f('0x26')][_0x101f('0x41')](_0x101f('0x42'))){_0x1a90ac[_0x101f('0x11')]=qs['limit'](_0x12234f['query']['limit']);_0x1a90ac['offset']=qs[_0x101f('0xf')](_0x12234f[_0x101f('0x26')][_0x101f('0xf')]);}return _0x2596c3['getAgents'](_0x1a90ac);}})[_0x101f('0x15')](function(_0xba2d3f){if(_0xba2d3f){return _0xba2d3f?{'count':_0x48b2c0,'rows':_0xba2d3f}:null;}})['then'](respondWithResult(_0x2b1131,null))[_0x101f('0x22')](handleError(_0x2b1131,null));};
\ No newline at end of file
+var _0x046a=['every','TeamId','includes','all','compact','value','isEmpty','forEach','emit','userChatQueue:remove','addAgents','spread','removeAgents','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','status','limit','undefined','count','offset','set','Content-Range','json','update','then','destroy','get','ChatQueues','UserProfileResource','end','error','name','index','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','rows','catch','show','params','model','keys','filters','intersection','attributes','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserChatQueue','fields','hasOwnProperty','order','sort','pick','filter','map','User','findAndCountAll','UserId','agent','chatPause','updatedAt','%s/%s','createdAt','getTeams','findOne','Team','nolimit','addTeams','Agents','online','voicePause','interface','sequelize','transaction','userChatQueue:save','removeTeams','findAll','ids','select','field','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT'];(function(_0x2eb30f,_0x1b8d1d){var _0x27873c=function(_0x18a46d){while(--_0x18a46d){_0x2eb30f['push'](_0x2eb30f['shift']());}};_0x27873c(++_0x1b8d1d);}(_0x046a,0xfe));var _0xa046=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x046a[_0x484e36];return _0xafc85d;};'use strict';var BPromise=require(_0xa046('0x0'));var util=require(_0xa046('0x1'));var _=require(_0xa046('0x2'));var squel=require('squel');var Redis=require(_0xa046('0x3'));var qs=require(_0xa046('0x4'));var logger=require(_0xa046('0x5'))(_0xa046('0x6'));var config=require(_0xa046('0x7'));var db=require(_0xa046('0x8'))['db'];config[_0xa046('0x9')]=_[_0xa046('0xa')](config[_0xa046('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xa046('0xb'))(new Redis(config[_0xa046('0x9')]));require(_0xa046('0xc'))[_0xa046('0xd')](socket);function respondWithStatusCode(_0x38d05f,_0x5a10ff){_0x5a10ff=_0x5a10ff||0xcc;return function(_0x4f486f){if(_0x4f486f){return _0x38d05f['sendStatus'](_0x5a10ff);}return _0x38d05f[_0xa046('0xe')](_0x5a10ff)['end']();};}function respondWithResult(_0x352f5e,_0x3c9db0){_0x3c9db0=_0x3c9db0||0xc8;return function(_0x3fc0e9){if(_0x3fc0e9){return _0x352f5e[_0xa046('0xe')](_0x3c9db0)['json'](_0x3fc0e9);}};}function respondWithFilteredResult(_0x28037f,_0x18b441){return function(_0x4697bc){if(_0x4697bc){var _0x1600fc=typeof _0x18b441['offset']==='undefined'&&typeof _0x18b441[_0xa046('0xf')]===_0xa046('0x10');var _0x5c0d14=_0x4697bc['count'];var _0x2fc4a6=_0x1600fc?0x0:_0x18b441['offset'];var _0x154ed0=_0x1600fc?_0x4697bc[_0xa046('0x11')]:_0x18b441[_0xa046('0x12')]+_0x18b441[_0xa046('0xf')];var _0x1bb694;if(_0x154ed0>=_0x5c0d14){_0x154ed0=_0x5c0d14;_0x1bb694=0xc8;}else{_0x1bb694=0xce;}_0x28037f[_0xa046('0xe')](_0x1bb694);return _0x28037f[_0xa046('0x13')](_0xa046('0x14'),_0x2fc4a6+'-'+_0x154ed0+'/'+_0x5c0d14)[_0xa046('0x15')](_0x4697bc);}return null;};}function saveUpdates(_0x57e898){return function(_0x25241d){if(_0x25241d){return _0x25241d[_0xa046('0x16')](_0x57e898)[_0xa046('0x17')](function(_0x347a80){return _0x347a80;});}return null;};}function removeEntity(_0x20cd98){return function(_0x8983af){if(_0x8983af){return _0x8983af[_0xa046('0x18')]()[_0xa046('0x17')](function(){var _0x35c57b=_0x8983af[_0xa046('0x19')]({'plain':!![]});var _0x5d2831=_0xa046('0x1a');return db[_0xa046('0x1b')][_0xa046('0x18')]({'where':{'type':_0x5d2831,'resourceId':_0x35c57b['id']}})[_0xa046('0x17')](function(){return _0x8983af;});})[_0xa046('0x17')](function(){_0x20cd98[_0xa046('0xe')](0xcc)[_0xa046('0x1c')]();});}};}function handleEntityNotFound(_0x21e13c){return function(_0x62819f){if(!_0x62819f){_0x21e13c['sendStatus'](0x194);}return _0x62819f;};}function handleError(_0x516f27,_0x17d99d){_0x17d99d=_0x17d99d||0x1f4;return function(_0x189534){logger[_0xa046('0x1d')](_0x189534['stack']);if(_0x189534[_0xa046('0x1e')]){delete _0x189534[_0xa046('0x1e')];}_0x516f27[_0xa046('0xe')](_0x17d99d)['send'](_0x189534);};}exports[_0xa046('0x1f')]=function(_0x183ffa,_0x487b26){var _0x29c85c={};var _0x299bcd={'count':0x0,'rows':[]};var _0x1ec6ea=_['map'](db[_0xa046('0x20')][_0xa046('0x21')],function(_0x52eba3){return{'name':_0x52eba3[_0xa046('0x22')],'type':_0x52eba3[_0xa046('0x23')][_0xa046('0x24')]};});_0x29c85c=qs[_0xa046('0x25')](_0x1ec6ea,_0x183ffa);var _0xfdf29f={'where':_0x29c85c[_0xa046('0x26')]};return db[_0xa046('0x20')][_0xa046('0x11')](_0xfdf29f)['then'](function(_0xe01259){_0x299bcd[_0xa046('0x11')]=_0xe01259;_0x29c85c[_0xa046('0x27')]=qs[_0xa046('0x27')](_0x183ffa[_0xa046('0x28')]);return db[_0xa046('0x20')]['findAll'](_0x29c85c);})[_0xa046('0x17')](function(_0x3dcd76){_0x299bcd[_0xa046('0x29')]=_0x3dcd76;return _0x299bcd;})[_0xa046('0x17')](respondWithFilteredResult(_0x487b26,_0x29c85c))[_0xa046('0x2a')](handleError(_0x487b26,null));};exports[_0xa046('0x2b')]=function(_0x378670,_0x2014e4){var _0x4ac7b0={'raw':!![],'where':{'id':_0x378670[_0xa046('0x2c')]['id']}},_0x8f36e7={};_0x8f36e7[_0xa046('0x2d')]=_[_0xa046('0x2e')](db[_0xa046('0x20')][_0xa046('0x21')]);_0x8f36e7['query']=_[_0xa046('0x2e')](_0x378670[_0xa046('0x28')]);_0x8f36e7[_0xa046('0x2f')]=_[_0xa046('0x30')](_0x8f36e7[_0xa046('0x2d')],_0x8f36e7[_0xa046('0x28')]);_0x4ac7b0['attributes']=_[_0xa046('0x30')](_0x8f36e7[_0xa046('0x2d')],qs['fields'](_0x378670[_0xa046('0x28')]['fields']));_0x4ac7b0['attributes']=_0x4ac7b0[_0xa046('0x31')][_0xa046('0x32')]?_0x4ac7b0[_0xa046('0x31')]:_0x8f36e7[_0xa046('0x2d')];if(_0x378670[_0xa046('0x28')][_0xa046('0x33')]){_0x4ac7b0[_0xa046('0x27')]=[{'all':!![]}];}_0x4ac7b0=_[_0xa046('0x34')]({},_0x4ac7b0,_0x378670[_0xa046('0x35')]);return db[_0xa046('0x20')][_0xa046('0x36')](_0x4ac7b0)[_0xa046('0x17')](handleEntityNotFound(_0x2014e4,null))[_0xa046('0x17')](respondWithResult(_0x2014e4,null))['catch'](handleError(_0x2014e4,null));};exports[_0xa046('0x37')]=function(_0x26b3c2,_0x3a7d6f){return db['ChatQueue']['create'](_0x26b3c2['body'],{})[_0xa046('0x17')](function(_0x4ecb09){var _0x101e0=_0x26b3c2[_0xa046('0x38')][_0xa046('0x19')]({'plain':!![]});if(!_0x101e0)throw new Error(_0xa046('0x39'));if(_0x101e0[_0xa046('0x3a')]==='user'){var _0x5f5caa=_0x4ecb09['get']({'plain':!![]});var _0x6bf7a0=_0xa046('0x1a');return db[_0xa046('0x3b')][_0xa046('0x36')]({'where':{'name':_0x6bf7a0,'userProfileId':_0x101e0['userProfileId']},'raw':!![]})[_0xa046('0x17')](function(_0xa4a48){if(_0xa4a48&&_0xa4a48[_0xa046('0x3c')]===0x0){return db[_0xa046('0x1b')][_0xa046('0x37')]({'name':_0x5f5caa[_0xa046('0x1e')],'resourceId':_0x5f5caa['id'],'type':_0xa4a48['name'],'sectionId':_0xa4a48['id']},{})['then'](function(){return _0x4ecb09;});}else{return _0x4ecb09;}})[_0xa046('0x2a')](function(_0x4f52a1){logger[_0xa046('0x1d')](_0xa046('0x3d'),_0x4f52a1);throw _0x4f52a1;});}return _0x4ecb09;})['then'](respondWithResult(_0x3a7d6f,0xc9))[_0xa046('0x2a')](handleError(_0x3a7d6f,null));};exports[_0xa046('0x16')]=function(_0x13faab,_0x30ff03){if(_0x13faab['body']['id']){delete _0x13faab[_0xa046('0x3e')]['id'];}return db[_0xa046('0x20')][_0xa046('0x36')]({'where':{'id':_0x13faab[_0xa046('0x2c')]['id']}})[_0xa046('0x17')](handleEntityNotFound(_0x30ff03,null))[_0xa046('0x17')](saveUpdates(_0x13faab[_0xa046('0x3e')],null))[_0xa046('0x17')](respondWithResult(_0x30ff03,null))[_0xa046('0x2a')](handleError(_0x30ff03,null));};exports['destroy']=function(_0x5604cc,_0x2254e3){return db[_0xa046('0x20')][_0xa046('0x36')]({'where':{'id':_0x5604cc[_0xa046('0x2c')]['id']}})[_0xa046('0x17')](handleEntityNotFound(_0x2254e3,null))['then'](removeEntity(_0x2254e3,null))[_0xa046('0x2a')](handleError(_0x2254e3,null));};exports['describe']=function(_0x3715f9,_0x392de2){return db[_0xa046('0x20')][_0xa046('0x3f')]()[_0xa046('0x17')](respondWithResult(_0x392de2,null))['catch'](handleError(_0x392de2,null));};exports[_0xa046('0x40')]=function(_0x4562b5,_0x524f43){var _0x1dc2b9={'raw':!![],'where':{}},_0x43ed73={},_0x2fbaa3;return db[_0xa046('0x20')]['findOne']({'where':{'id':_0x4562b5[_0xa046('0x2c')]['id']}})[_0xa046('0x17')](handleEntityNotFound(_0x524f43,null))[_0xa046('0x17')](function(_0x2cda3b){if(_0x2cda3b){_0x2fbaa3=_0x2cda3b[_0xa046('0x19')]({'plain':!![]});_0x43ed73[_0xa046('0x2d')]=_[_0xa046('0x2e')](db[_0xa046('0x41')]['rawAttributes']);_0x43ed73[_0xa046('0x28')]=_[_0xa046('0x2e')](_0x4562b5['query']);_0x43ed73['filters']=_[_0xa046('0x30')](_0x43ed73[_0xa046('0x2d')],_0x43ed73['query']);_0x1dc2b9[_0xa046('0x31')]=_['intersection'](_0x43ed73[_0xa046('0x2d')],qs['fields'](_0x4562b5[_0xa046('0x28')][_0xa046('0x42')]));_0x1dc2b9[_0xa046('0x31')]=_0x1dc2b9[_0xa046('0x31')][_0xa046('0x32')]?_0x1dc2b9['attributes']:_0x43ed73['model'];if(!_0x4562b5[_0xa046('0x28')][_0xa046('0x43')]('nolimit')){_0x1dc2b9[_0xa046('0xf')]=qs[_0xa046('0xf')](_0x4562b5[_0xa046('0x28')][_0xa046('0xf')]);_0x1dc2b9[_0xa046('0x12')]=qs['offset'](_0x4562b5[_0xa046('0x28')]['offset']);}_0x1dc2b9[_0xa046('0x44')]=qs['sort'](_0x4562b5['query'][_0xa046('0x45')]);_0x1dc2b9[_0xa046('0x26')]=qs[_0xa046('0x2f')](_[_0xa046('0x46')](_0x4562b5[_0xa046('0x28')],_0x43ed73[_0xa046('0x2f')]));_0x1dc2b9['where']['ChatQueueId']=_0x2cda3b['id'];if(_0x4562b5[_0xa046('0x28')][_0xa046('0x47')]){_0x1dc2b9[_0xa046('0x26')]=_[_0xa046('0x34')](_0x1dc2b9[_0xa046('0x26')],{'$or':_[_0xa046('0x48')](_0x1dc2b9[_0xa046('0x31')],function(_0xdd64e3){var _0x6a8ffa={};_0x6a8ffa[_0xdd64e3]={'$like':'%'+_0x4562b5[_0xa046('0x28')][_0xa046('0x47')]+'%'};return _0x6a8ffa;})});}_0x1dc2b9=_[_0xa046('0x34')]({},_0x1dc2b9,_0x4562b5['options']);return db['UserChatQueue']['findAll'](_0x1dc2b9);}})[_0xa046('0x17')](function(_0x5c5d82){if(_0x5c5d82){return db[_0xa046('0x49')][_0xa046('0x4a')]({'where':{'id':_[_0xa046('0x48')](_0x5c5d82,_0xa046('0x4b')),'role':_0xa046('0x4c')},'attributes':['id','name',_0xa046('0x4d'),_0xa046('0x4e'),'createdAt']});}})[_0xa046('0x17')](function(_0x516380){if(_0x516380){return{'count':_0x516380[_0xa046('0x11')],'rows':_[_0xa046('0x48')](_0x516380[_0xa046('0x29')],function(_0x373717){return{'membername':_0x373717[_0xa046('0x1e')],'UserId':_0x373717['id'],'queue_name':_0x2fbaa3['name'],'ChatQueueId':_0x2fbaa3['id'],'interface':util['format'](_0xa046('0x4f'),'SIP',_0x373717['name']),'penalty':0x0,'paused':_0x373717[_0xa046('0x4d')],'createdAt':_0x373717[_0xa046('0x50')],'updatedAt':_0x373717[_0xa046('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa046('0x17')](respondWithFilteredResult(_0x524f43,_0x1dc2b9))[_0xa046('0x2a')](handleError(_0x524f43,null));};exports[_0xa046('0x51')]=function(_0x166e4f,_0x4be41b){var _0x37cedf={};var _0x2dc520={};var _0x898bdb;var _0x3f0c23;return db[_0xa046('0x20')][_0xa046('0x52')]({'where':{'id':_0x166e4f[_0xa046('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4be41b,null))[_0xa046('0x17')](function(_0xf2680f){if(_0xf2680f){_0x898bdb=_0xf2680f;_0x2dc520[_0xa046('0x2d')]=_[_0xa046('0x2e')](db[_0xa046('0x53')][_0xa046('0x21')]);_0x2dc520['query']=_[_0xa046('0x2e')](_0x166e4f[_0xa046('0x28')]);_0x2dc520[_0xa046('0x2f')]=_['intersection'](_0x2dc520['model'],_0x2dc520['query']);_0x37cedf[_0xa046('0x31')]=_[_0xa046('0x30')](_0x2dc520[_0xa046('0x2d')],qs['fields'](_0x166e4f[_0xa046('0x28')][_0xa046('0x42')]));_0x37cedf[_0xa046('0x31')]=_0x37cedf[_0xa046('0x31')][_0xa046('0x32')]?_0x37cedf['attributes']:_0x2dc520['model'];_0x37cedf[_0xa046('0x44')]=qs['sort'](_0x166e4f[_0xa046('0x28')][_0xa046('0x45')]);_0x37cedf[_0xa046('0x26')]=qs[_0xa046('0x2f')](_[_0xa046('0x46')](_0x166e4f['query'],_0x2dc520[_0xa046('0x2f')]));if(_0x166e4f['query'][_0xa046('0x47')]){_0x37cedf[_0xa046('0x26')]=_['merge'](_0x37cedf[_0xa046('0x26')],{'$or':_[_0xa046('0x48')](_0x37cedf[_0xa046('0x31')],function(_0x43252a){var _0x5aca92={};_0x5aca92[_0x43252a]={'$like':'%'+_0x166e4f[_0xa046('0x28')][_0xa046('0x47')]+'%'};return _0x5aca92;})});}_0x37cedf=_[_0xa046('0x34')]({},_0x37cedf,_0x166e4f[_0xa046('0x35')]);return _0x898bdb[_0xa046('0x51')](_0x37cedf);}})[_0xa046('0x17')](function(_0x3edcb7){if(_0x3edcb7){_0x3f0c23=_0x3edcb7[_0xa046('0x32')];if(!_0x166e4f[_0xa046('0x28')][_0xa046('0x43')](_0xa046('0x54'))){_0x37cedf[_0xa046('0xf')]=qs[_0xa046('0xf')](_0x166e4f[_0xa046('0x28')]['limit']);_0x37cedf[_0xa046('0x12')]=qs[_0xa046('0x12')](_0x166e4f[_0xa046('0x28')][_0xa046('0x12')]);}return _0x898bdb[_0xa046('0x51')](_0x37cedf);}})[_0xa046('0x17')](function(_0x3bda14){if(_0x3bda14){return _0x3bda14?{'count':_0x3f0c23,'rows':_0x3bda14}:null;}})[_0xa046('0x17')](respondWithResult(_0x4be41b,null))[_0xa046('0x2a')](handleError(_0x4be41b,null));};exports[_0xa046('0x55')]=function(_0x434543,_0x157b91){var _0x3674b9=_0x434543['body']['ids'];return db[_0xa046('0x53')]['findAll']({'where':{'id':_0x3674b9},'attributes':['id'],'include':[{'model':db[_0xa046('0x49')],'as':_0xa046('0x56'),'attributes':['id',_0xa046('0x1e'),_0xa046('0x57'),_0xa046('0x58'),_0xa046('0x59')],'raw':!![]}]})[_0xa046('0x17')](function(_0x38403d){if(_0x38403d){var _0x2f60a5=_['flatMap'](_0x38403d,function(_0x329120){var _0x4feedc=_0x329120['get']({'plain':!![]});return _0x4feedc[_0xa046('0x56')];});return db[_0xa046('0x20')][_0xa046('0x36')]({'where':{'id':_0x434543[_0xa046('0x2c')]['id']}})[_0xa046('0x17')](function(_0x20be1b){return db[_0xa046('0x5a')][_0xa046('0x5b')](function(_0x4b5115){return _0x20be1b[_0xa046('0x55')](_0x3674b9,{'transaction':_0x4b5115})[_0xa046('0x17')](function(){return BPromise['each'](_0x2f60a5,function(_0x1b2f66){return db[_0xa046('0x41')]['findOrCreate']({'where':{'UserId':_0x1b2f66['id'],'ChatQueueId':_0x434543['params']['id']},'transaction':_0x4b5115});});})[_0xa046('0x17')](function(){_0x2f60a5['forEach'](function(_0x58642f){socket['emit'](_0xa046('0x5c'),{'UserId':_0x58642f['id'],'ChatQueueId':_0x20be1b['id']});});});});});}})[_0xa046('0x17')](respondWithStatusCode(_0x157b91,null))[_0xa046('0x2a')](handleError(_0x157b91,null));};exports[_0xa046('0x5d')]=function(_0x1d68c9,_0x42deaa){return db['Team'][_0xa046('0x5e')]({'where':{'id':_0x1d68c9['query'][_0xa046('0x5f')]},'attributes':['id'],'include':[{'model':db[_0xa046('0x49')],'as':_0xa046('0x56'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x42deaa,null))[_0xa046('0x17')](function(_0x34ad9f){var _0x3c0b9b=_[_0xa046('0x48')](_0x34ad9f,'id');var _0x29276a=[];var _0x14a733=[];var _0x529e67=squel[_0xa046('0x60')]();_0x529e67[_0xa046('0x61')]('tq.TeamId')[_0xa046('0x62')](_0xa046('0x63'),'tq')['join']('user_has_teams','ut',_0xa046('0x64'))[_0xa046('0x26')]('ChatQueueId\x20=\x20?',_0x1d68c9['params']['id']);for(var _0xd3fd5f=0x0;_0xd3fd5f<_0x34ad9f['length'];_0xd3fd5f+=0x1){let _0x316ef8=_0x34ad9f[_0xd3fd5f];for(var _0x1d5534=0x0;_0x1d5534<_0x316ef8['Agents'][_0xa046('0x32')];_0x1d5534+=0x1){let _0x23d373=_0x316ef8['Agents'][_0x1d5534];var _0x2016b9=_0x529e67[_0xa046('0x65')]();_0x2016b9[_0xa046('0x26')](_0xa046('0x66'),_0x23d373['id']);_0x14a733[_0xa046('0x67')](db[_0xa046('0x5a')]['query'](_0x2016b9['toString'](),{'type':db[_0xa046('0x5a')][_0xa046('0x68')][_0xa046('0x69')]})[_0xa046('0x17')](function(_0x1f1ea9){if(_0x1f1ea9['length']===0x1){return _0x23d373['id'];}else{var _0x422561=_[_0xa046('0x6a')](_['map'](_0x1f1ea9,_0xa046('0x6b')),function(_0x83af2d){return _[_0xa046('0x6c')](_0x3c0b9b,_0x83af2d);});if(_0x422561){return _0x23d373['id'];}}}));}}return BPromise[_0xa046('0x6d')](_0x14a733)['then'](function(_0x148f88){_0x29276a=_(_0x29276a)['union'](_0x148f88)[_0xa046('0x6e')]()[_0xa046('0x6f')]();return db[_0xa046('0x20')][_0xa046('0x36')]({'where':{'id':_0x1d68c9[_0xa046('0x2c')]['id']}})[_0xa046('0x17')](function(_0x307843){return db[_0xa046('0x5a')][_0xa046('0x5b')](function(_0x5d113a){return _0x307843[_0xa046('0x5d')](_0x1d68c9[_0xa046('0x28')]['ids'],{'transaction':_0x5d113a})[_0xa046('0x17')](function(){if(!_[_0xa046('0x70')](_0x29276a)){return _0x307843['removeAgents'](_0x29276a,{'transaction':_0x5d113a});}})[_0xa046('0x17')](function(){_0x29276a[_0xa046('0x71')](function(_0x158d78){socket[_0xa046('0x72')](_0xa046('0x73'),{'UserId':_0x158d78,'ChatQueueId':_0x307843['id']});});});});});});})[_0xa046('0x17')](respondWithStatusCode(_0x42deaa,null))[_0xa046('0x2a')](handleError(_0x42deaa,null));};exports[_0xa046('0x74')]=function(_0x2e9422,_0x4908e0){return db[_0xa046('0x20')]['find']({'where':{'id':_0x2e9422['params']['id']}})[_0xa046('0x17')](handleEntityNotFound(_0x4908e0,null))[_0xa046('0x17')](function(_0x5f451d){if(_0x5f451d){return _0x5f451d['addAgents'](_0x2e9422[_0xa046('0x3e')][_0xa046('0x5f')],_['omit'](_0x2e9422[_0xa046('0x3e')],['ids','id'])||{})[_0xa046('0x75')](function(_0x3d77fa){for(var _0x237931=0x0;_0x237931<_0x2e9422[_0xa046('0x3e')][_0xa046('0x5f')][_0xa046('0x32')];_0x237931+=0x1){socket[_0xa046('0x72')](_0xa046('0x5c'),{'UserId':Number(_0x2e9422['body'][_0xa046('0x5f')][_0x237931]),'ChatQueueId':Number(_0x2e9422['params']['id'])});}return _0x3d77fa;});}})[_0xa046('0x17')](respondWithResult(_0x4908e0,null))[_0xa046('0x2a')](handleError(_0x4908e0,null));};exports[_0xa046('0x76')]=function(_0x8168aa,_0x3f8fdb){return db['ChatQueue'][_0xa046('0x36')]({'where':{'id':_0x8168aa[_0xa046('0x2c')]['id']}})[_0xa046('0x17')](handleEntityNotFound(_0x3f8fdb,null))[_0xa046('0x17')](function(_0x4f6677){if(_0x4f6677){return _0x4f6677['removeAgents'](_0x8168aa['query'][_0xa046('0x5f')])[_0xa046('0x17')](function(){if(_['isArray'](_0x8168aa[_0xa046('0x28')][_0xa046('0x5f')])){for(var _0x1c33bc=0x0;_0x1c33bc<_0x8168aa['query'][_0xa046('0x5f')][_0xa046('0x32')];_0x1c33bc+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x8168aa[_0xa046('0x28')][_0xa046('0x5f')][_0x1c33bc]),'ChatQueueId':Number(_0x8168aa[_0xa046('0x2c')]['id'])});}}else{socket[_0xa046('0x72')]('userChatQueue:remove',{'UserId':Number(_0x8168aa[_0xa046('0x28')][_0xa046('0x5f')]),'ChatQueueId':Number(_0x8168aa['params']['id'])});}});}})[_0xa046('0x17')](respondWithStatusCode(_0x3f8fdb,null))[_0xa046('0x2a')](handleError(_0x3f8fdb,null));};exports[_0xa046('0x77')]=function(_0x7e127f,_0x245686){var _0x518f0e={};var _0x4121ac={};var _0x29dc02;var _0x45f25d;return db[_0xa046('0x20')][_0xa046('0x52')]({'where':{'id':_0x7e127f[_0xa046('0x2c')]['id']}})[_0xa046('0x17')](handleEntityNotFound(_0x245686,null))[_0xa046('0x17')](function(_0x3cb517){if(_0x3cb517){_0x29dc02=_0x3cb517;_0x4121ac[_0xa046('0x2d')]=_[_0xa046('0x2e')](db[_0xa046('0x49')][_0xa046('0x21')]);_0x4121ac[_0xa046('0x28')]=_[_0xa046('0x2e')](_0x7e127f[_0xa046('0x28')]);_0x4121ac[_0xa046('0x2f')]=_[_0xa046('0x30')](_0x4121ac[_0xa046('0x2d')],_0x4121ac[_0xa046('0x28')]);_0x518f0e[_0xa046('0x31')]=_[_0xa046('0x30')](_0x4121ac['model'],qs[_0xa046('0x42')](_0x7e127f[_0xa046('0x28')][_0xa046('0x42')]));_0x518f0e['attributes']=_0x518f0e[_0xa046('0x31')][_0xa046('0x32')]?_0x518f0e[_0xa046('0x31')]:_0x4121ac[_0xa046('0x2d')];_0x518f0e[_0xa046('0x44')]=qs[_0xa046('0x45')](_0x7e127f[_0xa046('0x28')][_0xa046('0x45')]);_0x518f0e[_0xa046('0x26')]=qs['filters'](_['pick'](_0x7e127f['query'],_0x4121ac[_0xa046('0x2f')]));if(_0x7e127f[_0xa046('0x28')]['filter']){_0x518f0e['where']=_['merge'](_0x518f0e['where'],{'$or':_['map'](_0x518f0e['attributes'],function(_0xbd8525){var _0x2e694d={};_0x2e694d[_0xbd8525]={'$like':'%'+_0x7e127f[_0xa046('0x28')][_0xa046('0x47')]+'%'};return _0x2e694d;})});}_0x518f0e=_['merge']({},_0x518f0e,_0x7e127f[_0xa046('0x35')]);return _0x29dc02[_0xa046('0x77')](_0x518f0e);}})[_0xa046('0x17')](function(_0x12904b){if(_0x12904b){_0x45f25d=_0x12904b[_0xa046('0x32')];if(!_0x7e127f[_0xa046('0x28')][_0xa046('0x43')]('nolimit')){_0x518f0e[_0xa046('0xf')]=qs[_0xa046('0xf')](_0x7e127f['query']['limit']);_0x518f0e['offset']=qs[_0xa046('0x12')](_0x7e127f[_0xa046('0x28')][_0xa046('0x12')]);}return _0x29dc02['getAgents'](_0x518f0e);}})[_0xa046('0x17')](function(_0x52bca1){if(_0x52bca1){return _0x52bca1?{'count':_0x45f25d,'rows':_0x52bca1}:null;}})[_0xa046('0x17')](respondWithResult(_0x245686,null))[_0xa046('0x2a')](handleError(_0x245686,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index b2c6bec..2d2f05f 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 _0xb776=['exports','events','../../mysqldb','ChatQueue','save','update','remove','emit','hook'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0xb776,0x1cc));var _0x6b77=function(_0x59ab10,_0x538141){_0x59ab10=_0x59ab10-0x0;var _0x383f73=_0xb776[_0x59ab10];return _0x383f73;};'use strict';var EventEmitter=require(_0x6b77('0x0'));var ChatQueue=require(_0x6b77('0x1'))['db'][_0x6b77('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6b77('0x3'),'afterUpdate':_0x6b77('0x4'),'afterDestroy':_0x6b77('0x5')};function emitEvent(_0x35789c){return function(_0x3663c7,_0xb8ebde,_0x383a47){ChatQueueEvents[_0x6b77('0x6')](_0x35789c+':'+_0x3663c7['id'],_0x3663c7);ChatQueueEvents[_0x6b77('0x6')](_0x35789c,_0x3663c7);_0x383a47(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x6b77('0x7')](e,emitEvent(event));}}module[_0x6b77('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xfa54=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa54,0x98));var _0x4fa5=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xfa54[_0x2be8c2];return _0x97f531;};'use strict';var EventEmitter=require(_0x4fa5('0x0'));var ChatQueue=require(_0x4fa5('0x1'))['db'][_0x4fa5('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4fa5('0x3')](0x0);var events={'afterCreate':_0x4fa5('0x4'),'afterUpdate':_0x4fa5('0x5'),'afterDestroy':_0x4fa5('0x6')};function emitEvent(_0x384cfd){return function(_0x28eafe,_0x279534,_0x380e9f){ChatQueueEvents[_0x4fa5('0x7')](_0x384cfd+':'+_0x28eafe['id'],_0x28eafe);ChatQueueEvents[_0x4fa5('0x7')](_0x384cfd,_0x28eafe);_0x380e9f(null);};}for(var e in events){if(events[_0x4fa5('0x8')](e)){var event=events[e];ChatQueue[_0x4fa5('0x9')](e,emitEvent(event));}}module[_0x4fa5('0xa')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 9bd8aa5..a9c0be8 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 _0x7d2c=['../../config/logger','api','moment','bluebird','request-promise','path','./chatQueue.attributes','exports','lodash','util'];(function(_0x452558,_0x565159){var _0x3027f7=function(_0x198dc7){while(--_0x198dc7){_0x452558['push'](_0x452558['shift']());}};_0x3027f7(++_0x565159);}(_0x7d2c,0x184));var _0xc7d2=function(_0x3c42f0,_0x421a98){_0x3c42f0=_0x3c42f0-0x0;var _0x2e39da=_0x7d2c[_0x3c42f0];return _0x2e39da;};'use strict';var _=require(_0xc7d2('0x0'));var util=require(_0xc7d2('0x1'));var logger=require(_0xc7d2('0x2'))(_0xc7d2('0x3'));var moment=require(_0xc7d2('0x4'));var BPromise=require(_0xc7d2('0x5'));var rp=require(_0xc7d2('0x6'));var fs=require('fs');var path=require(_0xc7d2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc7d2('0x8'));module[_0xc7d2('0x9')]=function(_0x188d37,_0x49c3bc){return _0x188d37['define']('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8e0e=['bluebird','request-promise','path','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util','../../config/logger','moment'];(function(_0xa22e9f,_0x5cd275){var _0x1d9a64=function(_0x1be759){while(--_0x1be759){_0xa22e9f['push'](_0xa22e9f['shift']());}};_0x1d9a64(++_0x5cd275);}(_0x8e0e,0x17e));var _0xe8e0=function(_0x30c8c7,_0x455188){_0x30c8c7=_0x30c8c7-0x0;var _0x55f32d=_0x8e0e[_0x30c8c7];return _0x55f32d;};'use strict';var _=require('lodash');var util=require(_0xe8e0('0x0'));var logger=require(_0xe8e0('0x1'))('api');var moment=require(_0xe8e0('0x2'));var BPromise=require(_0xe8e0('0x3'));var rp=require(_0xe8e0('0x4'));var fs=require('fs');var path=require(_0xe8e0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe8e0('0x6'));module[_0xe8e0('0x7')]=function(_0x2b4d7e,_0x520017){return _0x2b4d7e[_0xe8e0('0x8')](_0xe8e0('0x9'),attributes,{'tableName':_0xe8e0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 7428814..785adcd 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 _0x236c=['error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','info','debug','find','ShowChatQueue','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./chatQueue.socket','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x1aaa19,_0x3e7c58){var _0x1dd09e=function(_0x60a6fe){while(--_0x60a6fe){_0x1aaa19['push'](_0x1aaa19['shift']());}};_0x1dd09e(++_0x3e7c58);}(_0x236c,0x155));var _0xc236=function(_0x1fc619,_0x29ad91){_0x1fc619=_0x1fc619-0x0;var _0x3a5129=_0x236c[_0x1fc619];return _0x3a5129;};'use strict';var _=require(_0xc236('0x0'));var util=require('util');var moment=require(_0xc236('0x1'));var BPromise=require(_0xc236('0x2'));var rs=require(_0xc236('0x3'));var fs=require('fs');var Redis=require(_0xc236('0x4'));var db=require(_0xc236('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc236('0x6'))(_0xc236('0x7'));var config=require(_0xc236('0x8'));var jayson=require(_0xc236('0x9'));var client=jayson[_0xc236('0xa')][_0xc236('0xb')]({'port':0x232a});config['redis']=_[_0xc236('0xc')](config[_0xc236('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc236('0xe'))['register'](socket);function respondWithRpcPromise(_0x30a28d,_0x381ed1,_0x18f33b){return new BPromise(function(_0x2f8b72,_0xaf651b){return client['request'](_0x30a28d,_0x18f33b)[_0xc236('0xf')](function(_0x3311f7){logger['info'](_0xc236('0x10'),_0x381ed1,_0xc236('0x11'));logger['debug'](_0xc236('0x12'),_0x381ed1,'request\x20sent',JSON['stringify'](_0x3311f7));if(_0x3311f7[_0xc236('0x13')]){if(_0x3311f7[_0xc236('0x13')][_0xc236('0x14')]===0x1f4){logger[_0xc236('0x13')]('ChatQueue,\x20%s,\x20%s',_0x381ed1,_0x3311f7[_0xc236('0x13')]['message']);return _0xaf651b(_0x3311f7['error'][_0xc236('0x15')]);}logger[_0xc236('0x13')](_0xc236('0x10'),_0x381ed1,_0x3311f7[_0xc236('0x13')][_0xc236('0x15')]);return _0x2f8b72(_0x3311f7['error']['message']);}else{logger['info'](_0xc236('0x10'),_0x381ed1,_0xc236('0x11'));_0x2f8b72(_0x3311f7[_0xc236('0x16')]['message']);}})[_0xc236('0x17')](function(_0x506974){logger['error'](_0xc236('0x10'),_0x381ed1,_0x506974);_0xaf651b(_0x506974);});});}exports[_0xc236('0x18')]=function(_0x3a6183){var _0x46bc69=this;return new Promise(function(_0x2b6d3f,_0x27c6ab){return db[_0xc236('0x19')][_0xc236('0x1a')]({'raw':_0x3a6183[_0xc236('0x1b')]?_0x3a6183[_0xc236('0x1b')][_0xc236('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a6183['options']?_0x3a6183[_0xc236('0x1b')][_0xc236('0x1d')]||null:null,'attributes':_0x3a6183[_0xc236('0x1b')]?_0x3a6183[_0xc236('0x1b')][_0xc236('0x1e')]||null:null,'limit':_0x3a6183[_0xc236('0x1b')]?_0x3a6183[_0xc236('0x1b')][_0xc236('0x1f')]||null:null,'include':_0x3a6183[_0xc236('0x1b')]?_0x3a6183[_0xc236('0x1b')][_0xc236('0x20')]?_['map'](_0x3a6183[_0xc236('0x1b')][_0xc236('0x20')],function(_0x356042){return{'model':db[_0x356042[_0xc236('0x21')]],'as':_0x356042['as'],'attributes':_0x356042['attributes'],'include':_0x356042[_0xc236('0x20')]?_['map'](_0x356042['include'],function(_0x15ead8){return{'model':db[_0x15ead8['model']],'as':_0x15ead8['as'],'attributes':_0x15ead8[_0xc236('0x1e')],'include':_0x15ead8['include']?_[_0xc236('0x22')](_0x15ead8['include'],function(_0x423842){return{'model':db[_0x423842[_0xc236('0x21')]],'as':_0x423842['as'],'attributes':_0x423842['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x265c8d){logger[_0xc236('0x23')](_0xc236('0x18'),_0x3a6183);logger[_0xc236('0x24')]('GetChatQueue',_0x3a6183,JSON['stringify'](_0x265c8d));_0x2b6d3f(_0x265c8d);})[_0xc236('0x17')](function(_0x53b767){logger[_0xc236('0x13')]('GetChatQueue',_0x53b767[_0xc236('0x15')],_0x3a6183);_0x27c6ab(_0x46bc69[_0xc236('0x13')](0x1f4,_0x53b767['message']));});});};exports['ShowChatQueue']=function(_0x2537f9){var _0x3053a3=this;return new Promise(function(_0xbda858,_0x2f64bd){return db[_0xc236('0x19')][_0xc236('0x25')]({'raw':_0x2537f9[_0xc236('0x1b')]?_0x2537f9[_0xc236('0x1b')][_0xc236('0x1c')]===undefined?!![]:![]:!![],'where':_0x2537f9['options']?_0x2537f9['options']['where']||null:null,'attributes':_0x2537f9[_0xc236('0x1b')]?_0x2537f9[_0xc236('0x1b')][_0xc236('0x1e')]||null:null,'include':_0x2537f9[_0xc236('0x1b')]?_0x2537f9[_0xc236('0x1b')][_0xc236('0x20')]?_[_0xc236('0x22')](_0x2537f9['options'][_0xc236('0x20')],function(_0x3f9b1d){return{'model':db[_0x3f9b1d[_0xc236('0x21')]],'as':_0x3f9b1d['as'],'attributes':_0x3f9b1d['attributes'],'include':_0x3f9b1d[_0xc236('0x20')]?_[_0xc236('0x22')](_0x3f9b1d[_0xc236('0x20')],function(_0x281137){return{'model':db[_0x281137['model']],'as':_0x281137['as'],'attributes':_0x281137[_0xc236('0x1e')],'include':_0x281137[_0xc236('0x20')]?_[_0xc236('0x22')](_0x281137[_0xc236('0x20')],function(_0x3f3785){return{'model':db[_0x3f3785[_0xc236('0x21')]],'as':_0x3f3785['as'],'attributes':_0x3f3785[_0xc236('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc236('0xf')](function(_0x131212){logger[_0xc236('0x23')](_0xc236('0x26'),_0x2537f9);logger[_0xc236('0x24')](_0xc236('0x26'),_0x2537f9,JSON[_0xc236('0x27')](_0x131212));_0xbda858(_0x131212);})[_0xc236('0x17')](function(_0x3973be){logger[_0xc236('0x13')]('ShowChatQueue',_0x3973be['message'],_0x2537f9);_0x2f64bd(_0x3053a3['error'](0x1f4,_0x3973be['message']));});});};
\ No newline at end of file
+var _0x74fd=['info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then'];(function(_0x52c6bf,_0x29c95b){var _0x37fea0=function(_0xb23096){while(--_0xb23096){_0x52c6bf['push'](_0x52c6bf['shift']());}};_0x37fea0(++_0x29c95b);}(_0x74fd,0x8f));var _0xd74f=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0x74fd[_0x31a576];return _0x30b1d3;};'use strict';var _=require(_0xd74f('0x0'));var util=require('util');var moment=require(_0xd74f('0x1'));var BPromise=require(_0xd74f('0x2'));var rs=require(_0xd74f('0x3'));var fs=require('fs');var Redis=require(_0xd74f('0x4'));var db=require(_0xd74f('0x5'))['db'];var utils=require(_0xd74f('0x6'));var logger=require(_0xd74f('0x7'))(_0xd74f('0x8'));var config=require(_0xd74f('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd74f('0xa')]({'port':0x232a});config[_0xd74f('0xb')]=_['defaults'](config[_0xd74f('0xb')],{'host':_0xd74f('0xc'),'port':0x18eb});var socket=require(_0xd74f('0xd'))(new Redis(config[_0xd74f('0xb')]));require(_0xd74f('0xe'))['register'](socket);function respondWithRpcPromise(_0x50f801,_0x33150f,_0x58836e){return new BPromise(function(_0x50790b,_0x39552d){return client[_0xd74f('0xf')](_0x50f801,_0x58836e)[_0xd74f('0x10')](function(_0x176773){logger[_0xd74f('0x11')](_0xd74f('0x12'),_0x33150f,_0xd74f('0x13'));logger[_0xd74f('0x14')](_0xd74f('0x15'),_0x33150f,'request\x20sent',JSON[_0xd74f('0x16')](_0x176773));if(_0x176773[_0xd74f('0x17')]){if(_0x176773[_0xd74f('0x17')][_0xd74f('0x18')]===0x1f4){logger[_0xd74f('0x17')]('ChatQueue,\x20%s,\x20%s',_0x33150f,_0x176773[_0xd74f('0x17')][_0xd74f('0x19')]);return _0x39552d(_0x176773[_0xd74f('0x17')]['message']);}logger[_0xd74f('0x17')](_0xd74f('0x12'),_0x33150f,_0x176773['error'][_0xd74f('0x19')]);return _0x50790b(_0x176773[_0xd74f('0x17')][_0xd74f('0x19')]);}else{logger[_0xd74f('0x11')](_0xd74f('0x12'),_0x33150f,_0xd74f('0x13'));_0x50790b(_0x176773[_0xd74f('0x1a')]['message']);}})[_0xd74f('0x1b')](function(_0x43ede4){logger['error'](_0xd74f('0x12'),_0x33150f,_0x43ede4);_0x39552d(_0x43ede4);});});}exports[_0xd74f('0x1c')]=function(_0x36377a){var _0x5b2746=this;return new Promise(function(_0x554b8f,_0x586a75){return db[_0xd74f('0x1d')]['findAll']({'raw':_0x36377a['options']?_0x36377a[_0xd74f('0x1e')][_0xd74f('0x1f')]===undefined?!![]:![]:!![],'where':_0x36377a['options']?_0x36377a[_0xd74f('0x1e')][_0xd74f('0x20')]||null:null,'attributes':_0x36377a['options']?_0x36377a['options'][_0xd74f('0x21')]||null:null,'limit':_0x36377a[_0xd74f('0x1e')]?_0x36377a[_0xd74f('0x1e')][_0xd74f('0x22')]||null:null,'include':_0x36377a[_0xd74f('0x1e')]?_0x36377a[_0xd74f('0x1e')][_0xd74f('0x23')]?_[_0xd74f('0x24')](_0x36377a[_0xd74f('0x1e')][_0xd74f('0x23')],function(_0x1abb89){return{'model':db[_0x1abb89[_0xd74f('0x25')]],'as':_0x1abb89['as'],'attributes':_0x1abb89[_0xd74f('0x21')],'include':_0x1abb89[_0xd74f('0x23')]?_[_0xd74f('0x24')](_0x1abb89['include'],function(_0x4ea720){return{'model':db[_0x4ea720['model']],'as':_0x4ea720['as'],'attributes':_0x4ea720[_0xd74f('0x21')],'include':_0x4ea720[_0xd74f('0x23')]?_[_0xd74f('0x24')](_0x4ea720[_0xd74f('0x23')],function(_0x175c36){return{'model':db[_0x175c36[_0xd74f('0x25')]],'as':_0x175c36['as'],'attributes':_0x175c36[_0xd74f('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd74f('0x10')](function(_0x33d02e){logger[_0xd74f('0x11')](_0xd74f('0x1c'),_0x36377a);logger['debug'](_0xd74f('0x1c'),_0x36377a,JSON[_0xd74f('0x16')](_0x33d02e));_0x554b8f(_0x33d02e);})[_0xd74f('0x1b')](function(_0x29af0c){logger[_0xd74f('0x17')]('GetChatQueue',_0x29af0c[_0xd74f('0x19')],_0x36377a);_0x586a75(_0x5b2746[_0xd74f('0x17')](0x1f4,_0x29af0c[_0xd74f('0x19')]));});});};exports[_0xd74f('0x26')]=function(_0x306c1f){var _0x34b074=this;return new Promise(function(_0x16ef8c,_0x572535){return db[_0xd74f('0x1d')][_0xd74f('0x27')]({'raw':_0x306c1f[_0xd74f('0x1e')]?_0x306c1f[_0xd74f('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x306c1f['options']?_0x306c1f[_0xd74f('0x1e')][_0xd74f('0x20')]||null:null,'attributes':_0x306c1f[_0xd74f('0x1e')]?_0x306c1f[_0xd74f('0x1e')][_0xd74f('0x21')]||null:null,'include':_0x306c1f['options']?_0x306c1f[_0xd74f('0x1e')]['include']?_[_0xd74f('0x24')](_0x306c1f['options']['include'],function(_0x2f8a33){return{'model':db[_0x2f8a33[_0xd74f('0x25')]],'as':_0x2f8a33['as'],'attributes':_0x2f8a33[_0xd74f('0x21')],'include':_0x2f8a33['include']?_[_0xd74f('0x24')](_0x2f8a33[_0xd74f('0x23')],function(_0x126ac9){return{'model':db[_0x126ac9[_0xd74f('0x25')]],'as':_0x126ac9['as'],'attributes':_0x126ac9[_0xd74f('0x21')],'include':_0x126ac9[_0xd74f('0x23')]?_[_0xd74f('0x24')](_0x126ac9[_0xd74f('0x23')],function(_0x23fa3f){return{'model':db[_0x23fa3f[_0xd74f('0x25')]],'as':_0x23fa3f['as'],'attributes':_0x23fa3f[_0xd74f('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd74f('0x10')](function(_0x218fe5){logger[_0xd74f('0x11')](_0xd74f('0x26'),_0x306c1f);logger[_0xd74f('0x14')]('ShowChatQueue',_0x306c1f,JSON[_0xd74f('0x16')](_0x218fe5));_0x16ef8c(_0x218fe5);})[_0xd74f('0x1b')](function(_0x25a801){logger[_0xd74f('0x17')](_0xd74f('0x26'),_0x25a801[_0xd74f('0x19')],_0x306c1f);_0x572535(_0x34b074[_0xd74f('0x17')](0x1f4,_0x25a801[_0xd74f('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index f9f2cc5..c91fa93 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 _0xb7c8=['chatQueue:','save','remove','update','emit','removeListener','register','length'];(function(_0x2a9831,_0x599826){var _0x4df16c=function(_0x27bea6){while(--_0x27bea6){_0x2a9831['push'](_0x2a9831['shift']());}};_0x4df16c(++_0x599826);}(_0xb7c8,0x119));var _0x8b7c=function(_0x5bd86b,_0x504b7b){_0x5bd86b=_0x5bd86b-0x0;var _0x74090a=_0xb7c8[_0x5bd86b];return _0x74090a;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8b7c('0x0'),_0x8b7c('0x1'),_0x8b7c('0x2')];function createListener(_0x3a84fc,_0x1dceff){return function(_0x31ad24){_0x1dceff[_0x8b7c('0x3')](_0x3a84fc,_0x31ad24);};}function removeListener(_0x50113e,_0x38672b){return function(){ChatQueueEvents[_0x8b7c('0x4')](_0x50113e,_0x38672b);};}exports[_0x8b7c('0x5')]=function(_0x440900){for(var _0x107428=0x0,_0x12665c=events[_0x8b7c('0x6')];_0x107428<_0x12665c;_0x107428++){var _0x3c8fd6=events[_0x107428];var _0x6afb55=createListener(_0x8b7c('0x7')+_0x3c8fd6,_0x440900);ChatQueueEvents['on'](_0x3c8fd6,_0x6afb55);}};
\ No newline at end of file
+var _0x84ab=['update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','remove'];(function(_0x5728ba,_0x4259e2){var _0x529a3a=function(_0x36a810){while(--_0x36a810){_0x5728ba['push'](_0x5728ba['shift']());}};_0x529a3a(++_0x4259e2);}(_0x84ab,0x12f));var _0xb84a=function(_0x2eb5bc,_0x4634c6){_0x2eb5bc=_0x2eb5bc-0x0;var _0x51c7b1=_0x84ab[_0x2eb5bc];return _0x51c7b1;};'use strict';var ChatQueueEvents=require(_0xb84a('0x0'));var events=[_0xb84a('0x1'),_0xb84a('0x2'),_0xb84a('0x3')];function createListener(_0x473c3,_0x512f13){return function(_0xc83587){_0x512f13[_0xb84a('0x4')](_0x473c3,_0xc83587);};}function removeListener(_0x47b8e3,_0x9d3a00){return function(){ChatQueueEvents[_0xb84a('0x5')](_0x47b8e3,_0x9d3a00);};}exports[_0xb84a('0x6')]=function(_0x5b9def){for(var _0x521a64=0x0,_0x4dc496=events[_0xb84a('0x7')];_0x521a64<_0x4dc496;_0x521a64++){var _0x4fac4d=events[_0x521a64];var _0x3e9086=createListener(_0xb84a('0x8')+_0x4fac4d,_0x5b9def);ChatQueueEvents['on'](_0x4fac4d,_0x3e9086);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index b89264f..3681bd4 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x5dd5d9,_0x1e4895){var _0xbbeaa7=function(_0x24f203){while(--_0x24f203){_0x5dd5d9['push'](_0x5dd5d9['shift']());}};_0xbbeaa7(++_0x1e4895);}(_0xe14b,0x93));var _0xbe14=function(_0x49d259,_0x297ed6){_0x49d259=_0x49d259-0x0;var _0x11c87e=_0xe14b[_0x49d259];return _0x11c87e;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x384b0a,_0x4aff7c){var _0x10a10b=function(_0x4ef092){while(--_0x4ef092){_0x384b0a['push'](_0x384b0a['shift']());}};_0x10a10b(++_0x4aff7c);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index d05947b..e4bb90e 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 _0x1ac3=['STRING','DATE','moment','sequelize','exports'];(function(_0x6cfb8a,_0x53be6f){var _0x29ba1d=function(_0x104303){while(--_0x104303){_0x6cfb8a['push'](_0x6cfb8a['shift']());}};_0x29ba1d(++_0x53be6f);}(_0x1ac3,0x129));var _0x31ac=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x1ac3[_0x5bd426];return _0x23a7eb;};'use strict';var moment=require(_0x31ac('0x0'));var Sequelize=require(_0x31ac('0x1'));module[_0x31ac('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x31ac('0x3')]},'joinAt':{'type':Sequelize[_0x31ac('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x31ac('0x4')]},'reason':{'type':Sequelize[_0x31ac('0x3')]}};
\ No newline at end of file
+var _0x3691=['moment','sequelize','STRING','DATE'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x3691,0xac));var _0x1369=function(_0x1789e7,_0x4b22c1){_0x1789e7=_0x1789e7-0x0;var _0x4daf76=_0x3691[_0x1789e7];return _0x4daf76;};'use strict';var moment=require(_0x1369('0x0'));var Sequelize=require(_0x1369('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x1369('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1369('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1369('0x3')]},'acceptAt':{'type':Sequelize[_0x1369('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1369('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 6fe45e3..de56218 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 _0xf562=['map','keys','query','filters','attributes','intersection','fields','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','ChatQueueReport','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','send','fieldName','type','key','model'];(function(_0x2ffd34,_0xc660c9){var _0x9d8e89=function(_0x5609fd){while(--_0x5609fd){_0x2ffd34['push'](_0x2ffd34['shift']());}};_0x9d8e89(++_0xc660c9);}(_0xf562,0x100));var _0x2f56=function(_0x3ba963,_0x26436b){_0x3ba963=_0x3ba963-0x0;var _0x5d0bc4=_0xf562[_0x3ba963];return _0x5d0bc4;};'use strict';var emlformat=require(_0x2f56('0x0'));var rimraf=require(_0x2f56('0x1'));var zipdir=require(_0x2f56('0x2'));var jsonpatch=require(_0x2f56('0x3'));var rp=require(_0x2f56('0x4'));var moment=require(_0x2f56('0x5'));var BPromise=require(_0x2f56('0x6'));var Mustache=require(_0x2f56('0x7'));var util=require(_0x2f56('0x8'));var path=require('path');var sox=require(_0x2f56('0x9'));var csv=require('to-csv');var ejs=require(_0x2f56('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f56('0xb'));var squel=require(_0x2f56('0xc'));var crypto=require(_0x2f56('0xd'));var jsforce=require(_0x2f56('0xe'));var deskjs=require(_0x2f56('0xf'));var toCsv=require(_0x2f56('0x10'));var querystring=require(_0x2f56('0x11'));var Papa=require(_0x2f56('0x12'));var Redis=require(_0x2f56('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2f56('0x14'));var as=require(_0x2f56('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f56('0x16'))(_0x2f56('0x17'));var utils=require('../../config/utils');var config=require(_0x2f56('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2f56('0x19'))['db'];function respondWithStatusCode(_0x519c81,_0xa190b0){_0xa190b0=_0xa190b0||0xcc;return function(_0x3bec3f){if(_0x3bec3f){return _0x519c81[_0x2f56('0x1a')](_0xa190b0);}return _0x519c81[_0x2f56('0x1b')](_0xa190b0)[_0x2f56('0x1c')]();};}function respondWithResult(_0x69fc74,_0x37e55f){_0x37e55f=_0x37e55f||0xc8;return function(_0x3d9cb3){if(_0x3d9cb3){return _0x69fc74['status'](_0x37e55f)[_0x2f56('0x1d')](_0x3d9cb3);}};}function respondWithFilteredResult(_0x42a056,_0x11dd1e){return function(_0x1d2463){if(_0x1d2463){var _0x341045=typeof _0x11dd1e['offset']===_0x2f56('0x1e')&&typeof _0x11dd1e[_0x2f56('0x1f')]===_0x2f56('0x1e');var _0x3e3165=_0x1d2463[_0x2f56('0x20')];var _0x59db1d=_0x341045?0x0:_0x11dd1e[_0x2f56('0x21')];var _0x33b43f=_0x341045?_0x1d2463[_0x2f56('0x20')]:_0x11dd1e[_0x2f56('0x21')]+_0x11dd1e[_0x2f56('0x1f')];var _0x562cea;if(_0x33b43f>=_0x3e3165){_0x33b43f=_0x3e3165;_0x562cea=0xc8;}else{_0x562cea=0xce;}_0x42a056[_0x2f56('0x1b')](_0x562cea);return _0x42a056[_0x2f56('0x22')](_0x2f56('0x23'),_0x59db1d+'-'+_0x33b43f+'/'+_0x3e3165)[_0x2f56('0x1d')](_0x1d2463);}return null;};}function patchUpdates(_0x33dc10){return function(_0x27613f){try{jsonpatch[_0x2f56('0x24')](_0x27613f,_0x33dc10,!![]);}catch(_0x349d55){return BPromise['reject'](_0x349d55);}return _0x27613f[_0x2f56('0x25')]();};}function saveUpdates(_0x497d3f,_0x5bac85){return function(_0x297827){if(_0x297827){return _0x297827[_0x2f56('0x26')](_0x497d3f)[_0x2f56('0x27')](function(_0x4ee4c9){return _0x4ee4c9;});}return null;};}function removeEntity(_0x21f4b0,_0x433f0b){return function(_0x2db586){if(_0x2db586){return _0x2db586['destroy']()['then'](function(){_0x21f4b0[_0x2f56('0x1b')](0xcc)[_0x2f56('0x1c')]();});}};}function handleEntityNotFound(_0x38b366,_0x3e047b){return function(_0x4406ff){if(!_0x4406ff){_0x38b366['sendStatus'](0x194);}return _0x4406ff;};}function handleError(_0x2641d9,_0xaec9e8){_0xaec9e8=_0xaec9e8||0x1f4;return function(_0x861e9c){logger[_0x2f56('0x28')](_0x861e9c[_0x2f56('0x29')]);if(_0x861e9c[_0x2f56('0x2a')]){delete _0x861e9c[_0x2f56('0x2a')];}_0x2641d9[_0x2f56('0x1b')](_0xaec9e8)[_0x2f56('0x2b')](_0x861e9c);};}exports['index']=function(_0x44ff58,_0x49b89c){var _0x4e6dbc={},_0x284252={},_0x60a325={'count':0x0,'rows':[]};var _0x288019=_['map'](db['ChatQueueReport']['rawAttributes'],function(_0x61a170){return{'name':_0x61a170[_0x2f56('0x2c')],'type':_0x61a170[_0x2f56('0x2d')][_0x2f56('0x2e')]};});_0x284252[_0x2f56('0x2f')]=_[_0x2f56('0x30')](_0x288019,_0x2f56('0x2a'));_0x284252['query']=_[_0x2f56('0x31')](_0x44ff58[_0x2f56('0x32')]);_0x284252[_0x2f56('0x33')]=_['intersection'](_0x284252[_0x2f56('0x2f')],_0x284252[_0x2f56('0x32')]);_0x4e6dbc[_0x2f56('0x34')]=_[_0x2f56('0x35')](_0x284252[_0x2f56('0x2f')],qs[_0x2f56('0x36')](_0x44ff58[_0x2f56('0x32')]['fields']));_0x4e6dbc[_0x2f56('0x34')]=_0x4e6dbc[_0x2f56('0x34')]['length']?_0x4e6dbc[_0x2f56('0x34')]:_0x284252[_0x2f56('0x2f')];if(!_0x44ff58['query'][_0x2f56('0x37')]('nolimit')){_0x4e6dbc['limit']=qs[_0x2f56('0x1f')](_0x44ff58[_0x2f56('0x32')][_0x2f56('0x1f')]);_0x4e6dbc['offset']=qs[_0x2f56('0x21')](_0x44ff58['query'][_0x2f56('0x21')]);}_0x4e6dbc['order']=qs[_0x2f56('0x38')](_0x44ff58[_0x2f56('0x32')][_0x2f56('0x38')]);_0x4e6dbc['where']=qs[_0x2f56('0x33')](_[_0x2f56('0x39')](_0x44ff58[_0x2f56('0x32')],_0x284252[_0x2f56('0x33')]),_0x288019);if(_0x44ff58[_0x2f56('0x32')][_0x2f56('0x3a')]){_0x4e6dbc['where']=_[_0x2f56('0x3b')](_0x4e6dbc[_0x2f56('0x3c')],{'$or':_[_0x2f56('0x30')](_0x288019,function(_0x27c4ce){if(_0x27c4ce[_0x2f56('0x2d')]!==_0x2f56('0x3d')){var _0x141c09={};_0x141c09[_0x27c4ce[_0x2f56('0x2a')]]={'$like':'%'+_0x44ff58[_0x2f56('0x32')]['filter']+'%'};return _0x141c09;}})});}_0x4e6dbc=_[_0x2f56('0x3b')]({},_0x4e6dbc,_0x44ff58['options']);var _0x12032c={'where':_0x4e6dbc[_0x2f56('0x3c')]};return db[_0x2f56('0x3e')][_0x2f56('0x20')](_0x12032c)[_0x2f56('0x27')](function(_0x197bcc){_0x60a325[_0x2f56('0x20')]=_0x197bcc;if(_0x44ff58['query']['includeAll']){_0x4e6dbc[_0x2f56('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x2f56('0x40')](_0x4e6dbc);})[_0x2f56('0x27')](function(_0x1d3efa){_0x60a325[_0x2f56('0x41')]=_0x1d3efa;return _0x60a325;})[_0x2f56('0x27')](respondWithFilteredResult(_0x49b89c,_0x4e6dbc))[_0x2f56('0x42')](handleError(_0x49b89c,null));};exports[_0x2f56('0x43')]=function(_0x18464b,_0x1de6a7){var _0x5cf160={'raw':!![],'where':{'id':_0x18464b[_0x2f56('0x44')]['id']}},_0x5779a6={};_0x5779a6['model']=_[_0x2f56('0x31')](db[_0x2f56('0x3e')][_0x2f56('0x45')]);_0x5779a6[_0x2f56('0x32')]=_[_0x2f56('0x31')](_0x18464b[_0x2f56('0x32')]);_0x5779a6['filters']=_['intersection'](_0x5779a6['model'],_0x5779a6[_0x2f56('0x32')]);_0x5cf160['attributes']=_[_0x2f56('0x35')](_0x5779a6[_0x2f56('0x2f')],qs['fields'](_0x18464b[_0x2f56('0x32')]['fields']));_0x5cf160[_0x2f56('0x34')]=_0x5cf160['attributes'][_0x2f56('0x46')]?_0x5cf160[_0x2f56('0x34')]:_0x5779a6[_0x2f56('0x2f')];if(_0x18464b[_0x2f56('0x32')]['includeAll']){_0x5cf160[_0x2f56('0x3f')]=[{'all':!![]}];}_0x5cf160=_[_0x2f56('0x3b')]({},_0x5cf160,_0x18464b[_0x2f56('0x47')]);return db[_0x2f56('0x3e')][_0x2f56('0x48')](_0x5cf160)['then'](handleEntityNotFound(_0x1de6a7,null))[_0x2f56('0x27')](respondWithResult(_0x1de6a7,null))[_0x2f56('0x42')](handleError(_0x1de6a7,null));};exports[_0x2f56('0x49')]=function(_0x519790,_0x3218eb){return db['ChatQueueReport'][_0x2f56('0x49')](_0x519790[_0x2f56('0x4a')],{})['then'](respondWithResult(_0x3218eb,0xc9))['catch'](handleError(_0x3218eb,null));};exports[_0x2f56('0x26')]=function(_0x338324,_0x215215){if(_0x338324[_0x2f56('0x4a')]['id']){delete _0x338324[_0x2f56('0x4a')]['id'];}return db['ChatQueueReport'][_0x2f56('0x48')]({'where':{'id':_0x338324[_0x2f56('0x44')]['id']}})[_0x2f56('0x27')](handleEntityNotFound(_0x215215,null))['then'](saveUpdates(_0x338324[_0x2f56('0x4a')],null))[_0x2f56('0x27')](respondWithResult(_0x215215,null))[_0x2f56('0x42')](handleError(_0x215215,null));};exports[_0x2f56('0x4b')]=function(_0x4ad9bf,_0x2e0311){return db[_0x2f56('0x3e')][_0x2f56('0x48')]({'where':{'id':_0x4ad9bf[_0x2f56('0x44')]['id']}})[_0x2f56('0x27')](handleEntityNotFound(_0x2e0311,null))[_0x2f56('0x27')](removeEntity(_0x2e0311,null))[_0x2f56('0x42')](handleError(_0x2e0311,null));};exports['describe']=function(_0x3a4cf4,_0x213d99){return db['ChatQueueReport']['describe']()[_0x2f56('0x27')](respondWithResult(_0x213d99,null))[_0x2f56('0x42')](handleError(_0x213d99,null));};
\ No newline at end of file
+var _0xb1ad=['rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','ChatQueueReport','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','order','sort','pick','filters','filter','where','merge','options','then','includeAll','include'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb1ad,0x184));var _0xdb1a=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xb1ad[_0x24259d];return _0x5a701;};'use strict';var emlformat=require(_0xdb1a('0x0'));var rimraf=require(_0xdb1a('0x1'));var zipdir=require(_0xdb1a('0x2'));var jsonpatch=require(_0xdb1a('0x3'));var rp=require(_0xdb1a('0x4'));var moment=require(_0xdb1a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdb1a('0x6'));var util=require(_0xdb1a('0x7'));var path=require(_0xdb1a('0x8'));var sox=require(_0xdb1a('0x9'));var csv=require(_0xdb1a('0xa'));var ejs=require(_0xdb1a('0xb'));var fs=require('fs');var fs_extra=require(_0xdb1a('0xc'));var _=require(_0xdb1a('0xd'));var squel=require(_0xdb1a('0xe'));var crypto=require(_0xdb1a('0xf'));var jsforce=require(_0xdb1a('0x10'));var deskjs=require(_0xdb1a('0x11'));var toCsv=require(_0xdb1a('0xa'));var querystring=require(_0xdb1a('0x12'));var Papa=require(_0xdb1a('0x13'));var Redis=require('ioredis');var authService=require(_0xdb1a('0x14'));var qs=require(_0xdb1a('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdb1a('0x16'));var utils=require(_0xdb1a('0x17'));var config=require(_0xdb1a('0x18'));var licenseUtil=require(_0xdb1a('0x19'));var db=require(_0xdb1a('0x1a'))['db'];function respondWithStatusCode(_0x31ccd3,_0x3ca28b){_0x3ca28b=_0x3ca28b||0xcc;return function(_0x1c40c8){if(_0x1c40c8){return _0x31ccd3[_0xdb1a('0x1b')](_0x3ca28b);}return _0x31ccd3[_0xdb1a('0x1c')](_0x3ca28b)[_0xdb1a('0x1d')]();};}function respondWithResult(_0x1d69dd,_0x857c00){_0x857c00=_0x857c00||0xc8;return function(_0x5aa761){if(_0x5aa761){return _0x1d69dd[_0xdb1a('0x1c')](_0x857c00)[_0xdb1a('0x1e')](_0x5aa761);}};}function respondWithFilteredResult(_0x112be1,_0x4bdec7){return function(_0x28dfe9){if(_0x28dfe9){var _0x504d92=typeof _0x4bdec7[_0xdb1a('0x1f')]===_0xdb1a('0x20')&&typeof _0x4bdec7[_0xdb1a('0x21')]==='undefined';var _0x9ffb77=_0x28dfe9[_0xdb1a('0x22')];var _0x268ce8=_0x504d92?0x0:_0x4bdec7['offset'];var _0xe3780b=_0x504d92?_0x28dfe9[_0xdb1a('0x22')]:_0x4bdec7[_0xdb1a('0x1f')]+_0x4bdec7[_0xdb1a('0x21')];var _0x37e10c;if(_0xe3780b>=_0x9ffb77){_0xe3780b=_0x9ffb77;_0x37e10c=0xc8;}else{_0x37e10c=0xce;}_0x112be1[_0xdb1a('0x1c')](_0x37e10c);return _0x112be1['set'](_0xdb1a('0x23'),_0x268ce8+'-'+_0xe3780b+'/'+_0x9ffb77)[_0xdb1a('0x1e')](_0x28dfe9);}return null;};}function patchUpdates(_0x386e32){return function(_0x37b776){try{jsonpatch[_0xdb1a('0x24')](_0x37b776,_0x386e32,!![]);}catch(_0x400397){return BPromise[_0xdb1a('0x25')](_0x400397);}return _0x37b776[_0xdb1a('0x26')]();};}function saveUpdates(_0x3a9b3a,_0xc92d26){return function(_0x4d1d09){if(_0x4d1d09){return _0x4d1d09[_0xdb1a('0x27')](_0x3a9b3a)['then'](function(_0x28ccfe){return _0x28ccfe;});}return null;};}function removeEntity(_0x2cc1aa,_0x3d07fc){return function(_0x5d3d24){if(_0x5d3d24){return _0x5d3d24[_0xdb1a('0x28')]()['then'](function(){_0x2cc1aa[_0xdb1a('0x1c')](0xcc)[_0xdb1a('0x1d')]();});}};}function handleEntityNotFound(_0x22c95e,_0x157c6a){return function(_0xaa6f2e){if(!_0xaa6f2e){_0x22c95e[_0xdb1a('0x1b')](0x194);}return _0xaa6f2e;};}function handleError(_0x22c260,_0x2e814e){_0x2e814e=_0x2e814e||0x1f4;return function(_0x5c963b){logger['error'](_0x5c963b[_0xdb1a('0x29')]);if(_0x5c963b[_0xdb1a('0x2a')]){delete _0x5c963b[_0xdb1a('0x2a')];}_0x22c260[_0xdb1a('0x1c')](_0x2e814e)[_0xdb1a('0x2b')](_0x5c963b);};}exports[_0xdb1a('0x2c')]=function(_0x5d1514,_0x3ec2f6){var _0x51f0ff={},_0x5a67c4={},_0xbfa09f={'count':0x0,'rows':[]};var _0x51a26d=_['map'](db[_0xdb1a('0x2d')][_0xdb1a('0x2e')],function(_0x46d019){return{'name':_0x46d019['fieldName'],'type':_0x46d019[_0xdb1a('0x2f')][_0xdb1a('0x30')]};});_0x5a67c4[_0xdb1a('0x31')]=_[_0xdb1a('0x32')](_0x51a26d,'name');_0x5a67c4[_0xdb1a('0x33')]=_[_0xdb1a('0x34')](_0x5d1514[_0xdb1a('0x33')]);_0x5a67c4['filters']=_[_0xdb1a('0x35')](_0x5a67c4[_0xdb1a('0x31')],_0x5a67c4[_0xdb1a('0x33')]);_0x51f0ff[_0xdb1a('0x36')]=_['intersection'](_0x5a67c4['model'],qs['fields'](_0x5d1514[_0xdb1a('0x33')][_0xdb1a('0x37')]));_0x51f0ff['attributes']=_0x51f0ff[_0xdb1a('0x36')][_0xdb1a('0x38')]?_0x51f0ff[_0xdb1a('0x36')]:_0x5a67c4[_0xdb1a('0x31')];if(!_0x5d1514[_0xdb1a('0x33')]['hasOwnProperty']('nolimit')){_0x51f0ff['limit']=qs[_0xdb1a('0x21')](_0x5d1514['query']['limit']);_0x51f0ff[_0xdb1a('0x1f')]=qs[_0xdb1a('0x1f')](_0x5d1514['query'][_0xdb1a('0x1f')]);}_0x51f0ff[_0xdb1a('0x39')]=qs[_0xdb1a('0x3a')](_0x5d1514[_0xdb1a('0x33')][_0xdb1a('0x3a')]);_0x51f0ff['where']=qs['filters'](_[_0xdb1a('0x3b')](_0x5d1514[_0xdb1a('0x33')],_0x5a67c4[_0xdb1a('0x3c')]),_0x51a26d);if(_0x5d1514[_0xdb1a('0x33')][_0xdb1a('0x3d')]){_0x51f0ff[_0xdb1a('0x3e')]=_[_0xdb1a('0x3f')](_0x51f0ff['where'],{'$or':_[_0xdb1a('0x32')](_0x51a26d,function(_0x5ba671){if(_0x5ba671['type']!=='VIRTUAL'){var _0x4a4366={};_0x4a4366[_0x5ba671[_0xdb1a('0x2a')]]={'$like':'%'+_0x5d1514[_0xdb1a('0x33')][_0xdb1a('0x3d')]+'%'};return _0x4a4366;}})});}_0x51f0ff=_[_0xdb1a('0x3f')]({},_0x51f0ff,_0x5d1514[_0xdb1a('0x40')]);var _0x5f535d={'where':_0x51f0ff[_0xdb1a('0x3e')]};return db[_0xdb1a('0x2d')][_0xdb1a('0x22')](_0x5f535d)[_0xdb1a('0x41')](function(_0xcffe52){_0xbfa09f[_0xdb1a('0x22')]=_0xcffe52;if(_0x5d1514[_0xdb1a('0x33')][_0xdb1a('0x42')]){_0x51f0ff[_0xdb1a('0x43')]=[{'all':!![]}];}return db[_0xdb1a('0x2d')]['findAll'](_0x51f0ff);})['then'](function(_0x43e27a){_0xbfa09f[_0xdb1a('0x44')]=_0x43e27a;return _0xbfa09f;})[_0xdb1a('0x41')](respondWithFilteredResult(_0x3ec2f6,_0x51f0ff))[_0xdb1a('0x45')](handleError(_0x3ec2f6,null));};exports[_0xdb1a('0x46')]=function(_0x4572d,_0x149fd6){var _0xad79f2={'raw':!![],'where':{'id':_0x4572d[_0xdb1a('0x47')]['id']}},_0xcb156c={};_0xcb156c[_0xdb1a('0x31')]=_[_0xdb1a('0x34')](db[_0xdb1a('0x2d')]['rawAttributes']);_0xcb156c[_0xdb1a('0x33')]=_[_0xdb1a('0x34')](_0x4572d[_0xdb1a('0x33')]);_0xcb156c[_0xdb1a('0x3c')]=_[_0xdb1a('0x35')](_0xcb156c[_0xdb1a('0x31')],_0xcb156c[_0xdb1a('0x33')]);_0xad79f2['attributes']=_['intersection'](_0xcb156c['model'],qs[_0xdb1a('0x37')](_0x4572d[_0xdb1a('0x33')]['fields']));_0xad79f2[_0xdb1a('0x36')]=_0xad79f2[_0xdb1a('0x36')]['length']?_0xad79f2['attributes']:_0xcb156c[_0xdb1a('0x31')];if(_0x4572d[_0xdb1a('0x33')]['includeAll']){_0xad79f2[_0xdb1a('0x43')]=[{'all':!![]}];}_0xad79f2=_[_0xdb1a('0x3f')]({},_0xad79f2,_0x4572d[_0xdb1a('0x40')]);return db['ChatQueueReport'][_0xdb1a('0x48')](_0xad79f2)[_0xdb1a('0x41')](handleEntityNotFound(_0x149fd6,null))[_0xdb1a('0x41')](respondWithResult(_0x149fd6,null))[_0xdb1a('0x45')](handleError(_0x149fd6,null));};exports['create']=function(_0x37aa5e,_0x452aa8){return db[_0xdb1a('0x2d')][_0xdb1a('0x49')](_0x37aa5e['body'],{})[_0xdb1a('0x41')](respondWithResult(_0x452aa8,0xc9))[_0xdb1a('0x45')](handleError(_0x452aa8,null));};exports[_0xdb1a('0x27')]=function(_0x367b1f,_0x40b193){if(_0x367b1f[_0xdb1a('0x4a')]['id']){delete _0x367b1f[_0xdb1a('0x4a')]['id'];}return db[_0xdb1a('0x2d')][_0xdb1a('0x48')]({'where':{'id':_0x367b1f[_0xdb1a('0x47')]['id']}})['then'](handleEntityNotFound(_0x40b193,null))['then'](saveUpdates(_0x367b1f['body'],null))[_0xdb1a('0x41')](respondWithResult(_0x40b193,null))[_0xdb1a('0x45')](handleError(_0x40b193,null));};exports[_0xdb1a('0x28')]=function(_0x3b018c,_0x32faa7){return db[_0xdb1a('0x2d')][_0xdb1a('0x48')]({'where':{'id':_0x3b018c['params']['id']}})['then'](handleEntityNotFound(_0x32faa7,null))['then'](removeEntity(_0x32faa7,null))['catch'](handleError(_0x32faa7,null));};exports[_0xdb1a('0x4b')]=function(_0x1f6115,_0x5663f1){return db['ChatQueueReport']['describe']()[_0xdb1a('0x41')](respondWithResult(_0x5663f1,null))[_0xdb1a('0x45')](handleError(_0x5663f1,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 3c140fa..0165b75 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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x2f3623,_0x34a5ed){var _0x51e1b3=function(_0x6d6200){while(--_0x6d6200){_0x2f3623['push'](_0x2f3623['shift']());}};_0x51e1b3(++_0x34a5ed);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0xcb91[_0x53bcc3];return _0x47c959;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x2dbcef,_0x1cfecb){var _0x5a90ea=function(_0x189054){while(--_0x189054){_0x2dbcef['push'](_0x2dbcef['shift']());}};_0x5a90ea(++_0x1cfecb);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 12d2e34..6d6f7eb 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 _0xa8f0=['CreateChatQueueReport','options','raw','stringify','UpdateChatQueueReport','body','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','code','error','message','catch'];(function(_0xb51261,_0x51a20c){var _0x217382=function(_0x5e0c81){while(--_0x5e0c81){_0xb51261['push'](_0xb51261['shift']());}};_0x217382(++_0x51a20c);}(_0xa8f0,0x173));var _0x0a8f=function(_0x4d093a,_0x15d59c){_0x4d093a=_0x4d093a-0x0;var _0x5d7227=_0xa8f0[_0x4d093a];return _0x5d7227;};'use strict';var _=require('lodash');var util=require(_0x0a8f('0x0'));var moment=require(_0x0a8f('0x1'));var BPromise=require(_0x0a8f('0x2'));var rs=require(_0x0a8f('0x3'));var fs=require('fs');var Redis=require(_0x0a8f('0x4'));var db=require(_0x0a8f('0x5'))['db'];var utils=require(_0x0a8f('0x6'));var logger=require(_0x0a8f('0x7'))('rpc');var config=require(_0x0a8f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a8f('0x9')][_0x0a8f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xca44d2,_0x65bd19,_0x54f2d6){return new BPromise(function(_0x430f12,_0x228e64){return client['request'](_0xca44d2,_0x54f2d6)[_0x0a8f('0xb')](function(_0x128683){logger[_0x0a8f('0xc')](_0x0a8f('0xd'),_0x65bd19,_0x0a8f('0xe'));logger[_0x0a8f('0xf')](_0x0a8f('0x10'),_0x65bd19,_0x0a8f('0xe'),JSON['stringify'](_0x128683));if(_0x128683['error']){if(_0x128683['error'][_0x0a8f('0x11')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x65bd19,_0x128683[_0x0a8f('0x12')][_0x0a8f('0x13')]);return _0x228e64(_0x128683[_0x0a8f('0x12')][_0x0a8f('0x13')]);}logger[_0x0a8f('0x12')](_0x0a8f('0xd'),_0x65bd19,_0x128683[_0x0a8f('0x12')]['message']);return _0x430f12(_0x128683[_0x0a8f('0x12')][_0x0a8f('0x13')]);}else{logger[_0x0a8f('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x65bd19,'request\x20sent');_0x430f12(_0x128683['result'][_0x0a8f('0x13')]);}})[_0x0a8f('0x14')](function(_0x251e6e){logger[_0x0a8f('0x12')](_0x0a8f('0xd'),_0x65bd19,_0x251e6e);_0x228e64(_0x251e6e);});});}exports[_0x0a8f('0x15')]=function(_0x56ec8e){var _0x40c859=this;return new Promise(function(_0x2c2e2d,_0x58d493){return db['ChatQueueReport']['create'](_0x56ec8e['body'],{'raw':_0x56ec8e[_0x0a8f('0x16')]?_0x56ec8e[_0x0a8f('0x16')][_0x0a8f('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x3bc61c){logger[_0x0a8f('0xc')](_0x0a8f('0x15'),_0x56ec8e);logger[_0x0a8f('0xf')](_0x0a8f('0x15'),_0x56ec8e,JSON[_0x0a8f('0x18')](_0x3bc61c));_0x2c2e2d(_0x3bc61c);})['catch'](function(_0x743a91){logger[_0x0a8f('0x12')]('CreateChatQueueReport',_0x743a91['message'],_0x56ec8e);_0x58d493(_0x40c859['error'](0x1f4,_0x743a91[_0x0a8f('0x13')]));});});};exports[_0x0a8f('0x19')]=function(_0x43c9c3){var _0x41ccf2=this;return new Promise(function(_0x263a2c,_0xbbd479){return db['ChatQueueReport']['update'](_0x43c9c3[_0x0a8f('0x1a')],{'raw':_0x43c9c3[_0x0a8f('0x16')]?_0x43c9c3[_0x0a8f('0x16')][_0x0a8f('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43c9c3[_0x0a8f('0x16')]?_0x43c9c3['options'][_0x0a8f('0x1b')]||null:null,'attributes':_0x43c9c3[_0x0a8f('0x16')]?_0x43c9c3[_0x0a8f('0x16')]['attributes']||null:null,'limit':_0x43c9c3[_0x0a8f('0x16')]?_0x43c9c3[_0x0a8f('0x16')]['limit']||null:null})[_0x0a8f('0xb')](function(_0x78e1b5){logger[_0x0a8f('0xc')](_0x0a8f('0x19'),_0x43c9c3);logger['debug']('UpdateChatQueueReport',_0x43c9c3,JSON[_0x0a8f('0x18')](_0x78e1b5));_0x263a2c(_0x78e1b5);})['catch'](function(_0x48e8d1){logger[_0x0a8f('0x12')]('UpdateChatQueueReport',_0x48e8d1[_0x0a8f('0x13')],_0x43c9c3);_0xbbd479(_0x41ccf2['error'](0x1f4,_0x48e8d1['message']));});});};
\ No newline at end of file
+var _0x895d=['ChatQueueReport','create','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','attributes','limit','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x4cf87e,_0x31894e){var _0x42e41e=function(_0x515278){while(--_0x515278){_0x4cf87e['push'](_0x4cf87e['shift']());}};_0x42e41e(++_0x31894e);}(_0x895d,0x181));var _0xd895=function(_0x1b8241,_0x3a359e){_0x1b8241=_0x1b8241-0x0;var _0x22ac33=_0x895d[_0x1b8241];return _0x22ac33;};'use strict';var _=require(_0xd895('0x0'));var util=require(_0xd895('0x1'));var moment=require(_0xd895('0x2'));var BPromise=require('bluebird');var rs=require(_0xd895('0x3'));var fs=require('fs');var Redis=require(_0xd895('0x4'));var db=require(_0xd895('0x5'))['db'];var utils=require(_0xd895('0x6'));var logger=require(_0xd895('0x7'))(_0xd895('0x8'));var config=require('../../config/environment');var jayson=require(_0xd895('0x9'));var client=jayson[_0xd895('0xa')][_0xd895('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6a3e2c,_0x13bffa,_0x9048bb){return new BPromise(function(_0x2199b2,_0x31769f){return client[_0xd895('0xc')](_0x6a3e2c,_0x9048bb)[_0xd895('0xd')](function(_0x557bfb){logger[_0xd895('0xe')](_0xd895('0xf'),_0x13bffa,_0xd895('0x10'));logger[_0xd895('0x11')](_0xd895('0x12'),_0x13bffa,_0xd895('0x10'),JSON['stringify'](_0x557bfb));if(_0x557bfb[_0xd895('0x13')]){if(_0x557bfb['error']['code']===0x1f4){logger[_0xd895('0x13')](_0xd895('0xf'),_0x13bffa,_0x557bfb[_0xd895('0x13')][_0xd895('0x14')]);return _0x31769f(_0x557bfb[_0xd895('0x13')][_0xd895('0x14')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x13bffa,_0x557bfb[_0xd895('0x13')]['message']);return _0x2199b2(_0x557bfb['error'][_0xd895('0x14')]);}else{logger[_0xd895('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x13bffa,_0xd895('0x10'));_0x2199b2(_0x557bfb[_0xd895('0x15')]['message']);}})[_0xd895('0x16')](function(_0x4d7147){logger[_0xd895('0x13')](_0xd895('0xf'),_0x13bffa,_0x4d7147);_0x31769f(_0x4d7147);});});}exports['CreateChatQueueReport']=function(_0x26258f){var _0x12a3e2=this;return new Promise(function(_0x1c07bb,_0x44462b){return db[_0xd895('0x17')][_0xd895('0x18')](_0x26258f[_0xd895('0x19')],{'raw':_0x26258f[_0xd895('0x1a')]?_0x26258f[_0xd895('0x1a')][_0xd895('0x1b')]===undefined?!![]:![]:!![]})[_0xd895('0xd')](function(_0xfe7c0){logger[_0xd895('0xe')]('CreateChatQueueReport',_0x26258f);logger[_0xd895('0x11')](_0xd895('0x1c'),_0x26258f,JSON['stringify'](_0xfe7c0));_0x1c07bb(_0xfe7c0);})[_0xd895('0x16')](function(_0x2078ff){logger[_0xd895('0x13')]('CreateChatQueueReport',_0x2078ff[_0xd895('0x14')],_0x26258f);_0x44462b(_0x12a3e2[_0xd895('0x13')](0x1f4,_0x2078ff[_0xd895('0x14')]));});});};exports[_0xd895('0x1d')]=function(_0x13eddb){var _0x3f7d17=this;return new Promise(function(_0x36b4ef,_0x29f01a){return db['ChatQueueReport'][_0xd895('0x1e')](_0x13eddb['body'],{'raw':_0x13eddb[_0xd895('0x1a')]?_0x13eddb[_0xd895('0x1a')][_0xd895('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13eddb[_0xd895('0x1a')]?_0x13eddb[_0xd895('0x1a')]['where']||null:null,'attributes':_0x13eddb[_0xd895('0x1a')]?_0x13eddb[_0xd895('0x1a')][_0xd895('0x1f')]||null:null,'limit':_0x13eddb['options']?_0x13eddb[_0xd895('0x1a')][_0xd895('0x20')]||null:null})[_0xd895('0xd')](function(_0x1286d7){logger[_0xd895('0xe')](_0xd895('0x1d'),_0x13eddb);logger['debug'](_0xd895('0x1d'),_0x13eddb,JSON[_0xd895('0x21')](_0x1286d7));_0x36b4ef(_0x1286d7);})[_0xd895('0x16')](function(_0x1b96bf){logger['error'](_0xd895('0x1d'),_0x1b96bf[_0xd895('0x14')],_0x13eddb);_0x29f01a(_0x3f7d17[_0xd895('0x13')](0x1f4,_0x1b96bf['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index c0c836e..1aecc18 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 _0x5dd3=['/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','index'];(function(_0x2dcb28,_0x26b688){var _0x314ba5=function(_0x2cf325){while(--_0x2cf325){_0x2dcb28['push'](_0x2dcb28['shift']());}};_0x314ba5(++_0x26b688);}(_0x5dd3,0x1af));var _0x35dd=function(_0x3526a5,_0x56825d){_0x3526a5=_0x3526a5-0x0;var _0x44f869=_0x5dd3[_0x3526a5];return _0x44f869;};'use strict';var multer=require('multer');var util=require(_0x35dd('0x0'));var path=require(_0x35dd('0x1'));var timeout=require(_0x35dd('0x2'));var express=require('express');var router=express[_0x35dd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x35dd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x35dd('0x5'));var controller=require(_0x35dd('0x6'));router[_0x35dd('0x7')]('/',auth['isAuthenticated'](),controller[_0x35dd('0x8')]);router[_0x35dd('0x7')](_0x35dd('0x9'),auth[_0x35dd('0xa')](),controller[_0x35dd('0xb')]);router[_0x35dd('0x7')](_0x35dd('0xc'),auth[_0x35dd('0xa')](),controller['show']);router[_0x35dd('0xd')]('/',auth[_0x35dd('0xa')](),controller[_0x35dd('0xe')]);router[_0x35dd('0xf')](_0x35dd('0xc'),auth['isAuthenticated'](),controller[_0x35dd('0x10')]);router[_0x35dd('0x11')](_0x35dd('0xc'),auth[_0x35dd('0xa')](),controller[_0x35dd('0x12')]);module[_0x35dd('0x13')]=router;
\ No newline at end of file
+var _0x889f=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete'];(function(_0x2cfb48,_0x24b83b){var _0xc4594f=function(_0x3bc089){while(--_0x3bc089){_0x2cfb48['push'](_0x2cfb48['shift']());}};_0xc4594f(++_0x24b83b);}(_0x889f,0x10a));var _0xf889=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0x889f[_0x1780f8];return _0x33a410;};'use strict';var multer=require(_0xf889('0x0'));var util=require('util');var path=require(_0xf889('0x1'));var timeout=require(_0xf889('0x2'));var express=require('express');var router=express[_0xf889('0x3')]();var fs_extra=require(_0xf889('0x4'));var auth=require(_0xf889('0x5'));var interaction=require(_0xf889('0x6'));var config=require('../../config/environment');var controller=require(_0xf889('0x7'));router[_0xf889('0x8')]('/',auth[_0xf889('0x9')](),controller[_0xf889('0xa')]);router['get'](_0xf889('0xb'),auth['isAuthenticated'](),controller[_0xf889('0xc')]);router[_0xf889('0x8')](_0xf889('0xd'),auth[_0xf889('0x9')](),controller['show']);router[_0xf889('0xe')]('/',auth[_0xf889('0x9')](),controller[_0xf889('0xf')]);router[_0xf889('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xf889('0x11')]);router[_0xf889('0x12')](_0xf889('0xd'),auth[_0xf889('0x9')](),controller['destroy']);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 0f15a12..34fbdc7 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x230a9b,_0x3bbee7){var _0x28dfd1=function(_0x18f00a){while(--_0x18f00a){_0x230a9b['push'](_0x230a9b['shift']());}};_0x28dfd1(++_0x3bbee7);}(_0x4b84,0x1cc));var _0x44b8=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x4b84[_0x56482c];return _0x5aae7a;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x45dd0e,_0x28e603){var _0x50e5ca=function(_0x46a412){while(--_0x46a412){_0x45dd0e['push'](_0x45dd0e['shift']());}};_0x50e5ca(++_0x28e603);}(_0x008c,0x188));var _0xc008=function(_0x31cdf3,_0x4f2183){_0x31cdf3=_0x31cdf3-0x0;var _0x5623f8=_0x008c[_0x31cdf3];return _0x5623f8;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 664b2e1..ea81b95 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 _0x2ea2=['undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','name','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','findAll','catch','show','params','include','merge','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x2199db,_0x64fe69){var _0x1823bc=function(_0x4f849b){while(--_0x4f849b){_0x2199db['push'](_0x2199db['shift']());}};_0x1823bc(++_0x64fe69);}(_0x2ea2,0x73));var _0x22ea=function(_0x23ca4a,_0x491470){_0x23ca4a=_0x23ca4a-0x0;var _0x392a33=_0x2ea2[_0x23ca4a];return _0x392a33;};'use strict';var emlformat=require(_0x22ea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x22ea('0x1'));var jsonpatch=require(_0x22ea('0x2'));var rp=require(_0x22ea('0x3'));var moment=require(_0x22ea('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x22ea('0x5'));var util=require('util');var path=require('path');var sox=require(_0x22ea('0x6'));var csv=require(_0x22ea('0x7'));var ejs=require(_0x22ea('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x22ea('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x22ea('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x22ea('0x7'));var querystring=require('querystring');var Papa=require(_0x22ea('0xb'));var Redis=require(_0x22ea('0xc'));var authService=require(_0x22ea('0xd'));var qs=require(_0x22ea('0xe'));var as=require(_0x22ea('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x22ea('0x10'))(_0x22ea('0x11'));var utils=require(_0x22ea('0x12'));var config=require(_0x22ea('0x13'));var licenseUtil=require(_0x22ea('0x14'));var db=require(_0x22ea('0x15'))['db'];function respondWithStatusCode(_0x1f6f1c,_0x18b0c0){_0x18b0c0=_0x18b0c0||0xcc;return function(_0x444d9f){if(_0x444d9f){return _0x1f6f1c[_0x22ea('0x16')](_0x18b0c0);}return _0x1f6f1c[_0x22ea('0x17')](_0x18b0c0)[_0x22ea('0x18')]();};}function respondWithResult(_0x4b203e,_0x2a245b){_0x2a245b=_0x2a245b||0xc8;return function(_0x3d8982){if(_0x3d8982){return _0x4b203e['status'](_0x2a245b)[_0x22ea('0x19')](_0x3d8982);}};}function respondWithFilteredResult(_0x36d354,_0x307593){return function(_0x2263f7){if(_0x2263f7){var _0xbed39a=typeof _0x307593[_0x22ea('0x1a')]===_0x22ea('0x1b')&&typeof _0x307593[_0x22ea('0x1c')]===_0x22ea('0x1b');var _0x45a6e2=_0x2263f7[_0x22ea('0x1d')];var _0x56b35f=_0xbed39a?0x0:_0x307593[_0x22ea('0x1a')];var _0x152b86=_0xbed39a?_0x2263f7[_0x22ea('0x1d')]:_0x307593['offset']+_0x307593[_0x22ea('0x1c')];var _0x57b0ad;if(_0x152b86>=_0x45a6e2){_0x152b86=_0x45a6e2;_0x57b0ad=0xc8;}else{_0x57b0ad=0xce;}_0x36d354[_0x22ea('0x17')](_0x57b0ad);return _0x36d354['set'](_0x22ea('0x1e'),_0x56b35f+'-'+_0x152b86+'/'+_0x45a6e2)['json'](_0x2263f7);}return null;};}function patchUpdates(_0x4786b4){return function(_0x27cea7){try{jsonpatch[_0x22ea('0x1f')](_0x27cea7,_0x4786b4,!![]);}catch(_0x1b0377){return BPromise[_0x22ea('0x20')](_0x1b0377);}return _0x27cea7[_0x22ea('0x21')]();};}function saveUpdates(_0x4e5e80,_0x12bdf2){return function(_0x486870){if(_0x486870){return _0x486870[_0x22ea('0x22')](_0x4e5e80)['then'](function(_0x4b03eb){return _0x4b03eb;});}return null;};}function removeEntity(_0x4d3f4b,_0x1aa13c){return function(_0x5f0dce){if(_0x5f0dce){return _0x5f0dce[_0x22ea('0x23')]()[_0x22ea('0x24')](function(){_0x4d3f4b[_0x22ea('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x217474,_0x12e51e){return function(_0x758b73){if(!_0x758b73){_0x217474[_0x22ea('0x16')](0x194);}return _0x758b73;};}function handleError(_0x124f7a,_0x255801){_0x255801=_0x255801||0x1f4;return function(_0x4f4d82){logger[_0x22ea('0x25')](_0x4f4d82['stack']);if(_0x4f4d82[_0x22ea('0x26')]){delete _0x4f4d82['name'];}_0x124f7a[_0x22ea('0x17')](_0x255801)['send'](_0x4f4d82);};}exports['index']=function(_0xf3aa34,_0x27ca1b){var _0x1af2b1={},_0x2cb7ce={},_0x31f537={'count':0x0,'rows':[]};var _0x2dfc60=_[_0x22ea('0x27')](db[_0x22ea('0x28')][_0x22ea('0x29')],function(_0x213d9a){return{'name':_0x213d9a[_0x22ea('0x2a')],'type':_0x213d9a[_0x22ea('0x2b')][_0x22ea('0x2c')]};});_0x2cb7ce[_0x22ea('0x2d')]=_[_0x22ea('0x27')](_0x2dfc60,'name');_0x2cb7ce['query']=_[_0x22ea('0x2e')](_0xf3aa34[_0x22ea('0x2f')]);_0x2cb7ce['filters']=_[_0x22ea('0x30')](_0x2cb7ce[_0x22ea('0x2d')],_0x2cb7ce[_0x22ea('0x2f')]);_0x1af2b1['attributes']=_[_0x22ea('0x30')](_0x2cb7ce[_0x22ea('0x2d')],qs['fields'](_0xf3aa34[_0x22ea('0x2f')][_0x22ea('0x31')]));_0x1af2b1[_0x22ea('0x32')]=_0x1af2b1['attributes'][_0x22ea('0x33')]?_0x1af2b1['attributes']:_0x2cb7ce['model'];if(!_0xf3aa34[_0x22ea('0x2f')][_0x22ea('0x34')]('nolimit')){_0x1af2b1['limit']=qs['limit'](_0xf3aa34[_0x22ea('0x2f')][_0x22ea('0x1c')]);_0x1af2b1[_0x22ea('0x1a')]=qs[_0x22ea('0x1a')](_0xf3aa34[_0x22ea('0x2f')][_0x22ea('0x1a')]);}_0x1af2b1['order']=qs['sort'](_0xf3aa34[_0x22ea('0x2f')][_0x22ea('0x35')]);_0x1af2b1[_0x22ea('0x36')]=qs[_0x22ea('0x37')](_[_0x22ea('0x38')](_0xf3aa34[_0x22ea('0x2f')],_0x2cb7ce[_0x22ea('0x37')]),_0x2dfc60);if(_0xf3aa34[_0x22ea('0x2f')][_0x22ea('0x39')]){_0x1af2b1[_0x22ea('0x36')]=_['merge'](_0x1af2b1[_0x22ea('0x36')],{'$or':_[_0x22ea('0x27')](_0x2dfc60,function(_0x5d2a8e){if(_0x5d2a8e['type']!==_0x22ea('0x3a')){var _0x2018fe={};_0x2018fe[_0x5d2a8e[_0x22ea('0x26')]]={'$like':'%'+_0xf3aa34['query']['filter']+'%'};return _0x2018fe;}})});}_0x1af2b1=_['merge']({},_0x1af2b1,_0xf3aa34[_0x22ea('0x3b')]);var _0x1e74ff={'where':_0x1af2b1[_0x22ea('0x36')]};return db[_0x22ea('0x28')]['count'](_0x1e74ff)[_0x22ea('0x24')](function(_0x24a82c){_0x31f537[_0x22ea('0x1d')]=_0x24a82c;if(_0xf3aa34[_0x22ea('0x2f')][_0x22ea('0x3c')]){_0x1af2b1['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x22ea('0x3d')](_0x1af2b1);})[_0x22ea('0x24')](function(_0x3d98cf){_0x31f537['rows']=_0x3d98cf;return _0x31f537;})[_0x22ea('0x24')](respondWithFilteredResult(_0x27ca1b,_0x1af2b1))[_0x22ea('0x3e')](handleError(_0x27ca1b,null));};exports[_0x22ea('0x3f')]=function(_0x350ed9,_0x49d5ab){var _0x28be64={'raw':!![],'where':{'id':_0x350ed9[_0x22ea('0x40')]['id']}},_0x582862={};_0x582862[_0x22ea('0x2d')]=_[_0x22ea('0x2e')](db[_0x22ea('0x28')][_0x22ea('0x29')]);_0x582862[_0x22ea('0x2f')]=_[_0x22ea('0x2e')](_0x350ed9[_0x22ea('0x2f')]);_0x582862[_0x22ea('0x37')]=_['intersection'](_0x582862[_0x22ea('0x2d')],_0x582862['query']);_0x28be64['attributes']=_[_0x22ea('0x30')](_0x582862[_0x22ea('0x2d')],qs['fields'](_0x350ed9['query'][_0x22ea('0x31')]));_0x28be64['attributes']=_0x28be64[_0x22ea('0x32')][_0x22ea('0x33')]?_0x28be64['attributes']:_0x582862[_0x22ea('0x2d')];if(_0x350ed9[_0x22ea('0x2f')]['includeAll']){_0x28be64[_0x22ea('0x41')]=[{'all':!![]}];}_0x28be64=_[_0x22ea('0x42')]({},_0x28be64,_0x350ed9[_0x22ea('0x3b')]);return db['ChatTransferReport'][_0x22ea('0x43')](_0x28be64)[_0x22ea('0x24')](handleEntityNotFound(_0x49d5ab,null))[_0x22ea('0x24')](respondWithResult(_0x49d5ab,null))['catch'](handleError(_0x49d5ab,null));};exports[_0x22ea('0x44')]=function(_0x7f625e,_0x3d3944){return db[_0x22ea('0x28')]['create'](_0x7f625e['body'],{})[_0x22ea('0x24')](respondWithResult(_0x3d3944,0xc9))['catch'](handleError(_0x3d3944,null));};exports[_0x22ea('0x22')]=function(_0x1c108b,_0x2cad54){if(_0x1c108b[_0x22ea('0x45')]['id']){delete _0x1c108b[_0x22ea('0x45')]['id'];}return db[_0x22ea('0x28')][_0x22ea('0x43')]({'where':{'id':_0x1c108b[_0x22ea('0x40')]['id']}})[_0x22ea('0x24')](handleEntityNotFound(_0x2cad54,null))[_0x22ea('0x24')](saveUpdates(_0x1c108b['body'],null))[_0x22ea('0x24')](respondWithResult(_0x2cad54,null))[_0x22ea('0x3e')](handleError(_0x2cad54,null));};exports[_0x22ea('0x23')]=function(_0x64993b,_0xa1eeca){return db[_0x22ea('0x28')][_0x22ea('0x43')]({'where':{'id':_0x64993b[_0x22ea('0x40')]['id']}})[_0x22ea('0x24')](handleEntityNotFound(_0xa1eeca,null))[_0x22ea('0x24')](removeEntity(_0xa1eeca,null))[_0x22ea('0x3e')](handleError(_0xa1eeca,null));};exports[_0x22ea('0x46')]=function(_0x15c8da,_0x381e31){return db[_0x22ea('0x28')]['describe']()[_0x22ea('0x24')](respondWithResult(_0x381e31,null))[_0x22ea('0x3e')](handleError(_0x381e31,null));};
\ No newline at end of file
+var _0x378c=['ChatTransferReport','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map'];(function(_0x478612,_0x2d5b1f){var _0x878115=function(_0x1b6f8a){while(--_0x1b6f8a){_0x478612['push'](_0x478612['shift']());}};_0x878115(++_0x2d5b1f);}(_0x378c,0x1c1));var _0xc378=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x378c[_0x24f31b];return _0x488401;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc378('0x0'));var rp=require(_0xc378('0x1'));var moment=require('moment');var BPromise=require(_0xc378('0x2'));var Mustache=require(_0xc378('0x3'));var util=require('util');var path=require(_0xc378('0x4'));var sox=require(_0xc378('0x5'));var csv=require(_0xc378('0x6'));var ejs=require(_0xc378('0x7'));var fs=require('fs');var fs_extra=require(_0xc378('0x8'));var _=require('lodash');var squel=require(_0xc378('0x9'));var crypto=require(_0xc378('0xa'));var jsforce=require(_0xc378('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc378('0x6'));var querystring=require(_0xc378('0xc'));var Papa=require('papaparse');var Redis=require(_0xc378('0xd'));var authService=require(_0xc378('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc378('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc378('0x10'))(_0xc378('0x11'));var utils=require('../../config/utils');var config=require(_0xc378('0x12'));var licenseUtil=require(_0xc378('0x13'));var db=require(_0xc378('0x14'))['db'];function respondWithStatusCode(_0x2053ce,_0x96861b){_0x96861b=_0x96861b||0xcc;return function(_0x3a51f8){if(_0x3a51f8){return _0x2053ce[_0xc378('0x15')](_0x96861b);}return _0x2053ce[_0xc378('0x16')](_0x96861b)[_0xc378('0x17')]();};}function respondWithResult(_0x4575f0,_0x2ec00d){_0x2ec00d=_0x2ec00d||0xc8;return function(_0x4cd841){if(_0x4cd841){return _0x4575f0[_0xc378('0x16')](_0x2ec00d)[_0xc378('0x18')](_0x4cd841);}};}function respondWithFilteredResult(_0x37e2bd,_0x35c1a6){return function(_0x463384){if(_0x463384){var _0x120f64=typeof _0x35c1a6[_0xc378('0x19')]===_0xc378('0x1a')&&typeof _0x35c1a6[_0xc378('0x1b')]===_0xc378('0x1a');var _0x21a6c6=_0x463384[_0xc378('0x1c')];var _0x18f6ed=_0x120f64?0x0:_0x35c1a6['offset'];var _0xa2ee27=_0x120f64?_0x463384[_0xc378('0x1c')]:_0x35c1a6['offset']+_0x35c1a6[_0xc378('0x1b')];var _0x4f1c8b;if(_0xa2ee27>=_0x21a6c6){_0xa2ee27=_0x21a6c6;_0x4f1c8b=0xc8;}else{_0x4f1c8b=0xce;}_0x37e2bd[_0xc378('0x16')](_0x4f1c8b);return _0x37e2bd[_0xc378('0x1d')](_0xc378('0x1e'),_0x18f6ed+'-'+_0xa2ee27+'/'+_0x21a6c6)['json'](_0x463384);}return null;};}function patchUpdates(_0x44a2c6){return function(_0x48d624){try{jsonpatch[_0xc378('0x1f')](_0x48d624,_0x44a2c6,!![]);}catch(_0x14a6ae){return BPromise['reject'](_0x14a6ae);}return _0x48d624['save']();};}function saveUpdates(_0x1a78e2,_0x23236c){return function(_0x4d3a05){if(_0x4d3a05){return _0x4d3a05[_0xc378('0x20')](_0x1a78e2)[_0xc378('0x21')](function(_0x54c32c){return _0x54c32c;});}return null;};}function removeEntity(_0x45092a,_0x264b99){return function(_0x355c59){if(_0x355c59){return _0x355c59[_0xc378('0x22')]()[_0xc378('0x21')](function(){_0x45092a['status'](0xcc)[_0xc378('0x17')]();});}};}function handleEntityNotFound(_0x3944cf,_0x4bf6de){return function(_0x4095f4){if(!_0x4095f4){_0x3944cf[_0xc378('0x15')](0x194);}return _0x4095f4;};}function handleError(_0x322688,_0x44130d){_0x44130d=_0x44130d||0x1f4;return function(_0x2b18e3){logger[_0xc378('0x23')](_0x2b18e3[_0xc378('0x24')]);if(_0x2b18e3['name']){delete _0x2b18e3[_0xc378('0x25')];}_0x322688['status'](_0x44130d)[_0xc378('0x26')](_0x2b18e3);};}exports[_0xc378('0x27')]=function(_0x49b9d4,_0x1a01e4){var _0xf3ecdf={},_0x3455b4={},_0x2be6ea={'count':0x0,'rows':[]};var _0x1b9a5=_[_0xc378('0x28')](db[_0xc378('0x29')][_0xc378('0x2a')],function(_0x1bd4c6){return{'name':_0x1bd4c6['fieldName'],'type':_0x1bd4c6[_0xc378('0x2b')][_0xc378('0x2c')]};});_0x3455b4[_0xc378('0x2d')]=_['map'](_0x1b9a5,'name');_0x3455b4[_0xc378('0x2e')]=_['keys'](_0x49b9d4[_0xc378('0x2e')]);_0x3455b4[_0xc378('0x2f')]=_[_0xc378('0x30')](_0x3455b4['model'],_0x3455b4[_0xc378('0x2e')]);_0xf3ecdf['attributes']=_['intersection'](_0x3455b4[_0xc378('0x2d')],qs['fields'](_0x49b9d4['query'][_0xc378('0x31')]));_0xf3ecdf[_0xc378('0x32')]=_0xf3ecdf[_0xc378('0x32')]['length']?_0xf3ecdf[_0xc378('0x32')]:_0x3455b4[_0xc378('0x2d')];if(!_0x49b9d4['query']['hasOwnProperty'](_0xc378('0x33'))){_0xf3ecdf[_0xc378('0x1b')]=qs[_0xc378('0x1b')](_0x49b9d4['query'][_0xc378('0x1b')]);_0xf3ecdf[_0xc378('0x19')]=qs[_0xc378('0x19')](_0x49b9d4['query'][_0xc378('0x19')]);}_0xf3ecdf['order']=qs['sort'](_0x49b9d4['query'][_0xc378('0x34')]);_0xf3ecdf['where']=qs[_0xc378('0x2f')](_[_0xc378('0x35')](_0x49b9d4[_0xc378('0x2e')],_0x3455b4['filters']),_0x1b9a5);if(_0x49b9d4[_0xc378('0x2e')][_0xc378('0x36')]){_0xf3ecdf[_0xc378('0x37')]=_[_0xc378('0x38')](_0xf3ecdf[_0xc378('0x37')],{'$or':_[_0xc378('0x28')](_0x1b9a5,function(_0x43dc6){if(_0x43dc6[_0xc378('0x2b')]!=='VIRTUAL'){var _0x15987f={};_0x15987f[_0x43dc6[_0xc378('0x25')]]={'$like':'%'+_0x49b9d4[_0xc378('0x2e')]['filter']+'%'};return _0x15987f;}})});}_0xf3ecdf=_[_0xc378('0x38')]({},_0xf3ecdf,_0x49b9d4[_0xc378('0x39')]);var _0x1027d2={'where':_0xf3ecdf[_0xc378('0x37')]};return db[_0xc378('0x29')]['count'](_0x1027d2)[_0xc378('0x21')](function(_0x16b1aa){_0x2be6ea[_0xc378('0x1c')]=_0x16b1aa;if(_0x49b9d4[_0xc378('0x2e')][_0xc378('0x3a')]){_0xf3ecdf[_0xc378('0x3b')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xc378('0x3c')](_0xf3ecdf);})[_0xc378('0x21')](function(_0x21e6f8){_0x2be6ea[_0xc378('0x3d')]=_0x21e6f8;return _0x2be6ea;})[_0xc378('0x21')](respondWithFilteredResult(_0x1a01e4,_0xf3ecdf))[_0xc378('0x3e')](handleError(_0x1a01e4,null));};exports[_0xc378('0x3f')]=function(_0x1956a0,_0x2849b7){var _0x50acd6={'raw':!![],'where':{'id':_0x1956a0[_0xc378('0x40')]['id']}},_0x47436c={};_0x47436c['model']=_['keys'](db[_0xc378('0x29')][_0xc378('0x2a')]);_0x47436c[_0xc378('0x2e')]=_[_0xc378('0x41')](_0x1956a0['query']);_0x47436c[_0xc378('0x2f')]=_['intersection'](_0x47436c[_0xc378('0x2d')],_0x47436c['query']);_0x50acd6[_0xc378('0x32')]=_[_0xc378('0x30')](_0x47436c[_0xc378('0x2d')],qs[_0xc378('0x31')](_0x1956a0[_0xc378('0x2e')][_0xc378('0x31')]));_0x50acd6['attributes']=_0x50acd6[_0xc378('0x32')]['length']?_0x50acd6[_0xc378('0x32')]:_0x47436c[_0xc378('0x2d')];if(_0x1956a0[_0xc378('0x2e')][_0xc378('0x3a')]){_0x50acd6[_0xc378('0x3b')]=[{'all':!![]}];}_0x50acd6=_['merge']({},_0x50acd6,_0x1956a0[_0xc378('0x39')]);return db[_0xc378('0x29')][_0xc378('0x42')](_0x50acd6)[_0xc378('0x21')](handleEntityNotFound(_0x2849b7,null))[_0xc378('0x21')](respondWithResult(_0x2849b7,null))['catch'](handleError(_0x2849b7,null));};exports[_0xc378('0x43')]=function(_0x3f1020,_0x5d8a2e){return db['ChatTransferReport'][_0xc378('0x43')](_0x3f1020[_0xc378('0x44')],{})[_0xc378('0x21')](respondWithResult(_0x5d8a2e,0xc9))['catch'](handleError(_0x5d8a2e,null));};exports['update']=function(_0x49aea3,_0x58f45f){if(_0x49aea3[_0xc378('0x44')]['id']){delete _0x49aea3[_0xc378('0x44')]['id'];}return db['ChatTransferReport'][_0xc378('0x42')]({'where':{'id':_0x49aea3[_0xc378('0x40')]['id']}})['then'](handleEntityNotFound(_0x58f45f,null))[_0xc378('0x21')](saveUpdates(_0x49aea3[_0xc378('0x44')],null))[_0xc378('0x21')](respondWithResult(_0x58f45f,null))[_0xc378('0x3e')](handleError(_0x58f45f,null));};exports[_0xc378('0x22')]=function(_0x46a7d9,_0x5b4ae9){return db[_0xc378('0x29')]['find']({'where':{'id':_0x46a7d9[_0xc378('0x40')]['id']}})['then'](handleEntityNotFound(_0x5b4ae9,null))['then'](removeEntity(_0x5b4ae9,null))[_0xc378('0x3e')](handleError(_0x5b4ae9,null));};exports[_0xc378('0x45')]=function(_0x546682,_0x577fd8){return db['ChatTransferReport'][_0xc378('0x45')]()[_0xc378('0x21')](respondWithResult(_0x577fd8,null))['catch'](handleError(_0x577fd8,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index ae9b666..ea09b73 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 _0x9160=['rimraf','../../config/environment','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x41c19c,_0x43f4ef){var _0x14e900=function(_0xff3679){while(--_0xff3679){_0x41c19c['push'](_0x41c19c['shift']());}};_0x14e900(++_0x43f4ef);}(_0x9160,0x1c2));var _0x0916=function(_0x5df47d,_0x56b70d){_0x5df47d=_0x5df47d-0x0;var _0x503d79=_0x9160[_0x5df47d];return _0x503d79;};'use strict';var _=require(_0x0916('0x0'));var util=require(_0x0916('0x1'));var logger=require(_0x0916('0x2'))(_0x0916('0x3'));var moment=require(_0x0916('0x4'));var BPromise=require('bluebird');var rp=require(_0x0916('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0916('0x6'));var config=require(_0x0916('0x7'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x3214ae,_0x5dacc){return _0x3214ae[_0x0916('0x8')](_0x0916('0x9'),attributes,{'tableName':_0x0916('0xa'),'paranoid':![],'indexes':[{'name':_0x0916('0xb'),'fields':[_0x0916('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x132f=['exports','ChatTransferReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x71dc07,_0x20d016){var _0x3eaf59=function(_0x44971a){while(--_0x44971a){_0x71dc07['push'](_0x71dc07['shift']());}};_0x3eaf59(++_0x20d016);}(_0x132f,0x9f));var _0xf132=function(_0x2feb53,_0x264ef7){_0x2feb53=_0x2feb53-0x0;var _0x5700ee=_0x132f[_0x2feb53];return _0x5700ee;};'use strict';var _=require(_0xf132('0x0'));var util=require(_0xf132('0x1'));var logger=require(_0xf132('0x2'))('api');var moment=require(_0xf132('0x3'));var BPromise=require(_0xf132('0x4'));var rp=require(_0xf132('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf132('0x6'));var config=require(_0xf132('0x7'));var attributes=require(_0xf132('0x8'));module[_0xf132('0x9')]=function(_0x4409e6,_0x276b08){return _0x4409e6['define'](_0xf132('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xf132('0xb'),'fields':[_0xf132('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 9e33598..d15c84e 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 _0x9487=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x43fdf8,_0x8426b3){var _0x1160c6=function(_0x281fb6){while(--_0x281fb6){_0x43fdf8['push'](_0x43fdf8['shift']());}};_0x1160c6(++_0x8426b3);}(_0x9487,0x6c));var _0x7948=function(_0x21f7ee,_0x5c38f0){_0x21f7ee=_0x21f7ee-0x0;var _0x12079a=_0x9487[_0x21f7ee];return _0x12079a;};'use strict';var _=require(_0x7948('0x0'));var util=require('util');var moment=require(_0x7948('0x1'));var BPromise=require(_0x7948('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7948('0x3'))['db'];var utils=require(_0x7948('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7948('0x5'));var client=jayson[_0x7948('0x6')][_0x7948('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4c7366,_0x5b399d,_0x1e2368){return new BPromise(function(_0x5ad6f1,_0x2f1e1d){return client[_0x7948('0x8')](_0x4c7366,_0x1e2368)[_0x7948('0x9')](function(_0x9ae07a){logger['info'](_0x7948('0xa'),_0x5b399d,_0x7948('0xb'));logger[_0x7948('0xc')](_0x7948('0xd'),_0x5b399d,_0x7948('0xb'),JSON[_0x7948('0xe')](_0x9ae07a));if(_0x9ae07a[_0x7948('0xf')]){if(_0x9ae07a[_0x7948('0xf')][_0x7948('0x10')]===0x1f4){logger[_0x7948('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x5b399d,_0x9ae07a[_0x7948('0xf')][_0x7948('0x11')]);return _0x2f1e1d(_0x9ae07a[_0x7948('0xf')][_0x7948('0x11')]);}logger[_0x7948('0xf')](_0x7948('0xa'),_0x5b399d,_0x9ae07a[_0x7948('0xf')][_0x7948('0x11')]);return _0x5ad6f1(_0x9ae07a[_0x7948('0xf')][_0x7948('0x11')]);}else{logger[_0x7948('0x12')](_0x7948('0xa'),_0x5b399d,_0x7948('0xb'));_0x5ad6f1(_0x9ae07a['result']['message']);}})[_0x7948('0x13')](function(_0x277395){logger[_0x7948('0xf')](_0x7948('0xa'),_0x5b399d,_0x277395);_0x2f1e1d(_0x277395);});});}
\ No newline at end of file
+var _0x57a2=['http','request','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x26e727,_0x3e65be){var _0x563800=function(_0xbcf999){while(--_0xbcf999){_0x26e727['push'](_0x26e727['shift']());}};_0x563800(++_0x3e65be);}(_0x57a2,0x197));var _0x257a=function(_0x1a41a9,_0x5023b3){_0x1a41a9=_0x1a41a9-0x0;var _0xad981f=_0x57a2[_0x1a41a9];return _0xad981f;};'use strict';var _=require(_0x257a('0x0'));var util=require(_0x257a('0x1'));var moment=require('moment');var BPromise=require(_0x257a('0x2'));var rs=require(_0x257a('0x3'));var fs=require('fs');var Redis=require(_0x257a('0x4'));var db=require(_0x257a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x257a('0x6'))(_0x257a('0x7'));var config=require(_0x257a('0x8'));var jayson=require(_0x257a('0x9'));var client=jayson[_0x257a('0xa')][_0x257a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x369c43,_0x37b823,_0x2db3a5){return new BPromise(function(_0x1421b2,_0x4a86db){return client[_0x257a('0xc')](_0x369c43,_0x2db3a5)['then'](function(_0x17bc86){logger[_0x257a('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x37b823,_0x257a('0xe'));logger[_0x257a('0xf')](_0x257a('0x10'),_0x37b823,'request\x20sent',JSON['stringify'](_0x17bc86));if(_0x17bc86[_0x257a('0x11')]){if(_0x17bc86[_0x257a('0x11')]['code']===0x1f4){logger[_0x257a('0x11')](_0x257a('0x12'),_0x37b823,_0x17bc86[_0x257a('0x11')][_0x257a('0x13')]);return _0x4a86db(_0x17bc86['error'][_0x257a('0x13')]);}logger[_0x257a('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x37b823,_0x17bc86['error'][_0x257a('0x13')]);return _0x1421b2(_0x17bc86[_0x257a('0x11')][_0x257a('0x13')]);}else{logger[_0x257a('0xd')](_0x257a('0x12'),_0x37b823,_0x257a('0xe'));_0x1421b2(_0x17bc86[_0x257a('0x14')][_0x257a('0x13')]);}})[_0x257a('0x15')](function(_0x272354){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x37b823,_0x272354);_0x4a86db(_0x272354);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 4a50d47..cfe25c5 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 _0x0f1f=['index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x41fad2,_0xe2dc0e){var _0x67dac0=function(_0x3271a2){while(--_0x3271a2){_0x41fad2['push'](_0x41fad2['shift']());}};_0x67dac0(++_0xe2dc0e);}(_0x0f1f,0x69));var _0xf0f1=function(_0x464507,_0x28b145){_0x464507=_0x464507-0x0;var _0x3f6072=_0x0f1f[_0x464507];return _0x3f6072;};'use strict';var multer=require('multer');var util=require(_0xf0f1('0x0'));var path=require(_0xf0f1('0x1'));var timeout=require(_0xf0f1('0x2'));var express=require('express');var router=express[_0xf0f1('0x3')]();var fs_extra=require(_0xf0f1('0x4'));var auth=require(_0xf0f1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf0f1('0x6'));var controller=require('./chatTransferReport.controller');router[_0xf0f1('0x7')]('/',auth[_0xf0f1('0x8')](),controller[_0xf0f1('0x9')]);router[_0xf0f1('0x7')]('/describe',auth[_0xf0f1('0x8')](),controller['describe']);router[_0xf0f1('0x7')](_0xf0f1('0xa'),auth[_0xf0f1('0x8')](),controller[_0xf0f1('0xb')]);router[_0xf0f1('0xc')]('/',auth['isAuthenticated'](),controller[_0xf0f1('0xd')]);router[_0xf0f1('0xe')](_0xf0f1('0xa'),auth[_0xf0f1('0x8')](),controller[_0xf0f1('0xf')]);router[_0xf0f1('0x10')](_0xf0f1('0xa'),auth[_0xf0f1('0x8')](),controller[_0xf0f1('0x11')]);module[_0xf0f1('0x12')]=router;
\ No newline at end of file
+var _0xb989=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','create','delete','/:id','multer','util','path','connect-timeout','express'];(function(_0x3078f2,_0x2a9c32){var _0x797e2=function(_0x23012b){while(--_0x23012b){_0x3078f2['push'](_0x3078f2['shift']());}};_0x797e2(++_0x2a9c32);}(_0xb989,0x11b));var _0x9b98=function(_0x868b7c,_0xfa438b){_0x868b7c=_0x868b7c-0x0;var _0x21683c=_0xb989[_0x868b7c];return _0x21683c;};'use strict';var multer=require(_0x9b98('0x0'));var util=require(_0x9b98('0x1'));var path=require(_0x9b98('0x2'));var timeout=require(_0x9b98('0x3'));var express=require(_0x9b98('0x4'));var router=express[_0x9b98('0x5')]();var fs_extra=require(_0x9b98('0x6'));var auth=require(_0x9b98('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9b98('0x8'));var controller=require(_0x9b98('0x9'));router[_0x9b98('0xa')]('/',auth['isAuthenticated'](),controller[_0x9b98('0xb')]);router['get'](_0x9b98('0xc'),auth[_0x9b98('0xd')](),controller[_0x9b98('0xe')]);router['get']('/:id',auth[_0x9b98('0xd')](),controller['show']);router['post']('/',auth[_0x9b98('0xd')](),controller[_0x9b98('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9b98('0x10')](_0x9b98('0x11'),auth[_0x9b98('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 6d61783..2164854 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 _0x0aa5=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','onlineForm','getDataValue','setDataValue','textarea','Comments','offlineForm','generate','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','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId'];(function(_0x2971e6,_0x4a962e){var _0x5e6392=function(_0x16e6cf){while(--_0x16e6cf){_0x2971e6['push'](_0x2971e6['shift']());}};_0x5e6392(++_0x4a962e);}(_0x0aa5,0x11b));var _0x50aa=function(_0x54ac7c,_0x219d13){_0x54ac7c=_0x54ac7c-0x0;var _0xa4b01c=_0x0aa5[_0x54ac7c];return _0xa4b01c;};'use strict';var Sequelize=require(_0x50aa('0x0'));var rs=require(_0x50aa('0x1'));module['exports']={'name':{'type':Sequelize[_0x50aa('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x50aa('0x2')],'allowNull':![],'unique':_0x50aa('0x3')},'description':{'type':Sequelize[_0x50aa('0x2')]},'mapKey':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x4')},'mapKeyOffline':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x4')},'key':{'type':Sequelize[_0x50aa('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x5')},'customerAlias':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x50aa('0x2')],'allowNull':![],'defaultValue':_0x50aa('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x50aa('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x50aa('0x2')],'allowNull':![],'defaultValue':_0x50aa('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x50aa('0x2')],'allowNull':![],'defaultValue':_0x50aa('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x50aa('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x50aa('0xa'),_0x50aa('0xb')),'defaultValue':_0x50aa('0xa')},'header_online':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0xc')},'start_chat_button':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0xd')},'offline_chat_button':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0xe')},'header_offline':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0xf')},'download_transcript':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x50aa('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x50aa('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x12')},'placeholderMessage':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x13')},'closingMessage':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x14')},'closingMessageButton':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0xe')},'skipMessageButton':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x15')},'conditionAgreement':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0x50aa('0x17'),_0x50aa('0x18')),'defaultValue':_0x50aa('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x50aa('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x50aa('0x10')],'defaultValue':function(){return JSON[_0x50aa('0x19')]({'items':[{'type':_0x50aa('0x1a'),'variable':null,'config':{'placeholder':_0x50aa('0x1b'),'type':'text','required':!![]},'props':{'title':_0x50aa('0x1b'),'helpText':''}},{'type':_0x50aa('0x1a'),'props':{'title':_0x50aa('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x50aa('0x4'),'type':_0x50aa('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x50aa('0x1c'))?JSON['parse'](this[_0x50aa('0x1d')]('onlineForm')):{};},'set':function(_0x4ab514){return this[_0x50aa('0x1e')](_0x50aa('0x1c'),JSON[_0x50aa('0x19')](_0x4ab514));}},'offlineForm':{'type':Sequelize[_0x50aa('0x10')],'defaultValue':function(){return JSON[_0x50aa('0x19')]({'items':[{'type':_0x50aa('0x1a'),'props':{'title':_0x50aa('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x50aa('0x4'),'type':'email'},'variable':null},{'type':_0x50aa('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':_0x50aa('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x50aa('0x1d')](_0x50aa('0x21'))?JSON['parse'](this[_0x50aa('0x1d')]('offlineForm')):{};},'set':function(_0x29f9ec){return this[_0x50aa('0x1e')](_0x50aa('0x21'),JSON[_0x50aa('0x19')](_0x29f9ec));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x50aa('0x22')]();}},'autoclose':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x50aa('0x2')]},'forwardOffline':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x24')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x50aa('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x26')},'skipUnmanaged':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x15')},'sendUnmanaged':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x50aa('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x50aa('0x2')]},'notificationTemplate':{'type':Sequelize[_0x50aa('0x10')],'defaultValue':function(){return _0x50aa('0x27');}},'notificationSound':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x50aa('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x50aa('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x50aa('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x50aa('0x29')},'messagesAlignment':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x2a')},'defaultTitle':{'type':Sequelize[_0x50aa('0x2')]},'customerAvatar':{'type':Sequelize[_0x50aa('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x50aa('0x2')],'allowNull':![],'defaultValue':_0x50aa('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x50aa('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x50aa('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x50aa('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x50aa('0x8')],'comment':_0x50aa('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4ccaab){if(!_0x4ccaab)this[_0x50aa('0x1e')](_0x50aa('0x2d'),null);this['setDataValue']('mandatoryDisposition',_0x4ccaab);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x50aa('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':function(){return _0x50aa('0x2e');}},'vidaooMetadata':{'type':Sequelize[_0x50aa('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x50aa('0x10')]}};
\ No newline at end of file
+var _0x42b4=['TEXT','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','INTEGER','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us'];(function(_0x3e138d,_0x2ca788){var _0x434945=function(_0x340d21){while(--_0x340d21){_0x3e138d['push'](_0x3e138d['shift']());}};_0x434945(++_0x2ca788);}(_0x42b4,0xf1));var _0x442b=function(_0x3c7335,_0x86f232){_0x3c7335=_0x3c7335-0x0;var _0x4c15a7=_0x42b4[_0x3c7335];return _0x4c15a7;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x442b('0x0')]={'name':{'type':Sequelize[_0x442b('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x442b('0x1')],'allowNull':![],'unique':_0x442b('0x2')},'description':{'type':Sequelize[_0x442b('0x1')]},'mapKey':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0x3')},'mapKeyOffline':{'type':Sequelize[_0x442b('0x1')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0x4')},'customerAlias':{'type':Sequelize[_0x442b('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x442b('0x1')],'allowNull':![],'defaultValue':_0x442b('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x442b('0x1')],'allowNull':![],'defaultValue':_0x442b('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x442b('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x442b('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x442b('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x442b('0x8'),_0x442b('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0xa')},'start_chat_button':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0xb')},'offline_chat_button':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0xc')},'header_offline':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0xd')},'download_transcript':{'type':Sequelize[_0x442b('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x442b('0x1')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x442b('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x442b('0xe')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x442b('0x1')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0x10')},'placeholderMessage':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0x11')},'closingMessage':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0x12')},'closingMessageButton':{'type':Sequelize[_0x442b('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0x13')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x442b('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x442b('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0x14')},'ratingType':{'type':Sequelize[_0x442b('0x15')](_0x442b('0x16'),_0x442b('0x17')),'defaultValue':_0x442b('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x442b('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x442b('0x18'),'variable':null,'config':{'placeholder':_0x442b('0x19'),'type':_0x442b('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x442b('0x18'),'props':{'title':_0x442b('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x442b('0x3'),'type':_0x442b('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x442b('0x1b')](_0x442b('0x1c'))?JSON[_0x442b('0x1d')](this['getDataValue']('onlineForm')):{};},'set':function(_0x14f0c7){return this[_0x442b('0x1e')](_0x442b('0x1c'),JSON[_0x442b('0x1f')](_0x14f0c7));}},'offlineForm':{'type':Sequelize[_0x442b('0xe')],'defaultValue':function(){return JSON[_0x442b('0x1f')]({'items':[{'type':'input','props':{'title':_0x442b('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x442b('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0x442b('0x20')},'props':{'title':_0x442b('0x20'),'helpText':_0x442b('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x442b('0x1b')](_0x442b('0x22'))?JSON[_0x442b('0x1d')](this[_0x442b('0x1b')](_0x442b('0x22'))):{};},'set':function(_0x4eed8e){return this[_0x442b('0x1e')]('offlineForm',JSON[_0x442b('0x1f')](_0x4eed8e));}},'token':{'type':Sequelize[_0x442b('0x1')],'defaultValue':function(){return rs[_0x442b('0x23')]();}},'autoclose':{'type':Sequelize[_0x442b('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x442b('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x442b('0x1')]},'forwardOffline':{'type':Sequelize[_0x442b('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x442b('0x1')]},'waitingTitle':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x442b('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x442b('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x442b('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0x26')},'skipUnmanaged':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0x13')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x442b('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x442b('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x442b('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x442b('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x442b('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x442b('0x1')]},'notificationTemplate':{'type':Sequelize[_0x442b('0xe')],'defaultValue':function(){return _0x442b('0x27');}},'notificationSound':{'type':Sequelize[_0x442b('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x442b('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x442b('0x29')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x442b('0x29')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0x2a')},'verticalAlignment':{'type':Sequelize[_0x442b('0x29')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x442b('0x1')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0x2b')},'defaultTitle':{'type':Sequelize[_0x442b('0x1')]},'customerAvatar':{'type':Sequelize[_0x442b('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x442b('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x442b('0x29')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x442b('0x1')],'allowNull':![],'defaultValue':_0x442b('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x442b('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x442b('0x29')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x442b('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x442b('0x29')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x442b('0x1')],'defaultValue':_0x442b('0x2d')},'systemAvatar':{'type':Sequelize[_0x442b('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x442b('0x29')],'comment':_0x442b('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x442b('0x7')],'defaultValue':![],'comment':_0x442b('0x2f'),'set':function(_0x551dc1){if(!_0x551dc1)this['setDataValue'](_0x442b('0x30'),null);this[_0x442b('0x1e')]('mandatoryDisposition',_0x551dc1);}},'vidaooEscalation':{'type':Sequelize[_0x442b('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x442b('0x1')]},'vidaooTopic':{'type':Sequelize[_0x442b('0x1')],'allowNull':![],'defaultValue':_0x442b('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x442b('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x442b('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x442b('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x442b('0xe')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index cb33853..bf612a9 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 _0x1224=['getDispositions','findOne','Disposition','nolimit','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','getLicense','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','isNil','getSystemAvatar','server/files/images/avatars/system_avatar.png','existsSync','notify','chat','from','mapKey','isEmpty','Body\x20is\x20mandatory','No\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','includes','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmContact','DESC','ChatApplication','Applications','Interval','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','timezone','ifTime','List','account','list','orderBy','priority','asc','Contacts','contact','threadId','closed','Writing\x20on\x20closed\x20interaction','externalUrl','ChatInteraction','interaction','messageId','created','autoclose','push','applications','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','Sequelize','difference','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','openNewInteraction','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','addInteraction','omit','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','getProactiveActions','../../config/license/util','virtual','custom','License','increment','server/files/chat/iframe.ejs','utf8','origin','remote','headers','connection','remoteAddress','alignment','verticalAlignment','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','offlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','querystring','html-to-text','ioredis','../../components/parsers/qs','api','../../config/environment','APIBadRequestError','APINotFoundError','../../errors/api','APIOutOfIntervalError','handleError','APIConflictError','redis','defaults','socket.io-emitter','register','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','offset','limit','count','set','Content-Range','json','destroy','get','ChatWebsites','sendStatus','stack','name','user-agent-parser','setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','device','vendor','model','type','index','Pause','mandatoryDispositionPause','ChatWebsite','fieldName','key','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','show','params','rawAttributes','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','body','ChatWebsiteId'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x1224,0xc6));var _0x4122=function(_0x4f02a5,_0x154972){_0x4f02a5=_0x4f02a5-0x0;var _0x23ca4f=_0x1224[_0x4f02a5];return _0x23ca4f;};'use strict';var Mustache=require(_0x4122('0x0'));var util=require(_0x4122('0x1'));var path=require(_0x4122('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x4122('0x3'));var htmlToText=require(_0x4122('0x4'));var Redis=require(_0x4122('0x5'));var jayson=require('jayson/promise');var url=require('url');var qs=require(_0x4122('0x6'));var logger=require('../../config/logger')(_0x4122('0x7'));var config=require(_0x4122('0x8'));var APIBadRequestError=require('../../errors/api')[_0x4122('0x9')];var APINotFoundError=require('../../errors/api')[_0x4122('0xa')];var APIOutOfIntervalError=require(_0x4122('0xb'))[_0x4122('0xc')];var APIHandleError=require(_0x4122('0xb'))[_0x4122('0xd')];var APIConflictError=require(_0x4122('0xb'))[_0x4122('0xe')];var db=require('../../mysqldb')['db'];config[_0x4122('0xf')]=_[_0x4122('0x10')](config[_0x4122('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x4122('0x11'))(new Redis(config[_0x4122('0xf')]));require('./chatWebsite.socket')[_0x4122('0x12')](socket);var client=jayson[_0x4122('0x13')][_0x4122('0x14')]({'port':0x232c});var client9002=jayson[_0x4122('0x13')]['http']({'port':0x232a});var client9003=jayson[_0x4122('0x13')][_0x4122('0x14')]({'port':0x232b});var client9001=jayson['client'][_0x4122('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x384641,_0x254e35,_0x5d17a6,_0x3b55d9){return new Promise(function(_0x412a1e,_0x457d11){var _0x587c3c=_0x3b55d9||client;return _0x587c3c['request'](_0x384641,_0x5d17a6)[_0x4122('0x15')](function(_0x4c7236){logger[_0x4122('0x16')](_0x4122('0x17'),_0x254e35,_0x4122('0x18'));logger[_0x4122('0x19')](_0x4122('0x1a'),_0x254e35,_0x4122('0x18'),JSON[_0x4122('0x1b')](_0x4c7236));if(_0x4c7236[_0x4122('0x1c')]){if(_0x4c7236[_0x4122('0x1c')][_0x4122('0x1d')]===0x1f4){logger[_0x4122('0x1c')](_0x4122('0x17'),_0x254e35,_0x4c7236[_0x4122('0x1c')][_0x4122('0x1e')]);return _0x457d11(_0x4c7236[_0x4122('0x1c')][_0x4122('0x1e')]);}logger['error'](_0x4122('0x17'),_0x254e35,_0x4c7236[_0x4122('0x1c')][_0x4122('0x1e')]);return _0x412a1e(_0x4c7236['error'][_0x4122('0x1e')]);}else{logger[_0x4122('0x16')](_0x4122('0x17'),_0x254e35,_0x4122('0x18'));_0x412a1e(_0x4c7236[_0x4122('0x1f')][_0x4122('0x1e')]);}})[_0x4122('0x20')](function(_0x2da1d1){logger[_0x4122('0x1c')](_0x4122('0x17'),_0x254e35,_0x2da1d1);_0x457d11(_0x2da1d1);});});}function respondWithStatusCode(_0x52f531,_0x34f5ea){_0x34f5ea=_0x34f5ea||0xcc;return function(_0x5446ce){if(_0x5446ce){return _0x52f531['sendStatus'](_0x34f5ea);}return _0x52f531['status'](_0x34f5ea)[_0x4122('0x21')]();};}function respondWithResult(_0x4e8c7d,_0x2e32f7){_0x2e32f7=_0x2e32f7||0xc8;return function(_0x1c5b14){if(_0x1c5b14){return _0x4e8c7d[_0x4122('0x22')](_0x2e32f7)['json'](_0x1c5b14);}};}function respondWithFilteredResult(_0xbb939f,_0x3691ed){return function(_0x1a11c){if(_0x1a11c){var _0xbf64db=typeof _0x3691ed[_0x4122('0x23')]==='undefined'&&typeof _0x3691ed[_0x4122('0x24')]==='undefined';var _0x518aaa=_0x1a11c[_0x4122('0x25')];var _0x3cbe98=_0xbf64db?0x0:_0x3691ed['offset'];var _0x156fe6=_0xbf64db?_0x1a11c['count']:_0x3691ed[_0x4122('0x23')]+_0x3691ed['limit'];var _0x148a7d;if(_0x156fe6>=_0x518aaa){_0x156fe6=_0x518aaa;_0x148a7d=0xc8;}else{_0x148a7d=0xce;}_0xbb939f[_0x4122('0x22')](_0x148a7d);return _0xbb939f[_0x4122('0x26')](_0x4122('0x27'),_0x3cbe98+'-'+_0x156fe6+'/'+_0x518aaa)[_0x4122('0x28')](_0x1a11c);}return null;};}function saveUpdates(_0x168af5){return function(_0x2881a4){if(_0x2881a4){return _0x2881a4['update'](_0x168af5)[_0x4122('0x15')](function(_0x2e7fce){return _0x2e7fce;});}return null;};}function removeEntity(_0xa8ce1e){return function(_0x58df9c){if(_0x58df9c){return _0x58df9c[_0x4122('0x29')]()[_0x4122('0x15')](function(){var _0x29c0d6=_0x58df9c[_0x4122('0x2a')]({'plain':!![]});var _0x57f13f=_0x4122('0x2b');return db['UserProfileResource'][_0x4122('0x29')]({'where':{'type':_0x57f13f,'resourceId':_0x29c0d6['id']}})['then'](function(){return _0x58df9c;});})[_0x4122('0x15')](function(){_0xa8ce1e[_0x4122('0x22')](0xcc)[_0x4122('0x21')]();});}};}function handleEntityNotFound(_0xa373c6){return function(_0x10379b){if(!_0x10379b){_0xa373c6[_0x4122('0x2c')](0x194);}return _0x10379b;};}function handleError(_0x21257d,_0x1dc688){_0x1dc688=_0x1dc688||0x1f4;return function(_0x594e9c){logger['error'](_0x594e9c[_0x4122('0x2d')]);if(_0x594e9c[_0x4122('0x2e')]){delete _0x594e9c['name'];}_0x21257d['status'](_0x1dc688)['send'](_0x594e9c);};}function createInteractionObject(_0x55707a,_0x2fd4ff,_0x16bd08,_0x219424){var _0x4e9fc5=require(_0x4122('0x2f'));var _0x1cfb27=new _0x4e9fc5();var _0x54030b=_0x1cfb27[_0x4122('0x30')](_0x16bd08[_0x4122('0x31')])[_0x4122('0x32')]();var _0x31168d=_0x2fd4ff[_0x4122('0x33')];if(_0x16bd08['cf-connecting-ip']){_0x31168d=_0x16bd08[_0x4122('0x34')];}else if(_0x16bd08[_0x4122('0x35')]){_0x31168d=_[_0x4122('0x36')](_0x16bd08['x-forwarded-for'][_0x4122('0x37')](','));}return{'ContactId':_0x219424['id'],'ChatWebsiteId':_0x55707a,'from':(_0x219424[_0x4122('0x38')]||'')+'\x20'+(_0x219424[_0x4122('0x39')]||''),'customerIp':_0x31168d,'customerPort':_0x16bd08[_0x4122('0x3a')]?_0x16bd08[_0x4122('0x3a')]:null,'referer':_0x2fd4ff[_0x4122('0x3b')],'browserName':_0x54030b[_0x4122('0x3c')][_0x4122('0x2e')]&&_0x54030b[_0x4122('0x3c')][_0x4122('0x3d')]?util[_0x4122('0x3e')]('%s\x20%s',_0x54030b[_0x4122('0x3c')][_0x4122('0x2e')],_0x54030b[_0x4122('0x3c')]['version']):'unknown','browserVersion':_0x54030b[_0x4122('0x3c')][_0x4122('0x3d')]||_0x4122('0x3f'),'osName':util['format']('%s\x20%s',_0x54030b['os'][_0x4122('0x2e')],_0x54030b['os'][_0x4122('0x3d')]),'osVersion':_0x54030b['os']['version'],'deviceModel':_0x54030b[_0x4122('0x40')]['model']&&_0x54030b['device'][_0x4122('0x41')]?util[_0x4122('0x3e')]('%s\x20%s\x20%s',_0x54030b[_0x4122('0x40')][_0x4122('0x42')],_0x54030b[_0x4122('0x40')][_0x4122('0x41')],_0x54030b[_0x4122('0x40')][_0x4122('0x43')]):null,'deviceVendor':_0x54030b[_0x4122('0x40')]['vendor'],'deviceType':_0x54030b[_0x4122('0x40')][_0x4122('0x43')],'formData':JSON[_0x4122('0x1b')](_0x2fd4ff)};}exports[_0x4122('0x44')]=function(_0x12e99f,_0x2d6ccd){var _0x4bb6ca={'include':[{'model':db[_0x4122('0x45')],'as':_0x4122('0x46')}]},_0x47334e={},_0x19539e={'count':0x0,'rows':[]};var _0x2d86bf=_['map'](db[_0x4122('0x47')]['rawAttributes'],function(_0x242993){return{'name':_0x242993[_0x4122('0x48')],'type':_0x242993['type'][_0x4122('0x49')]};});_0x47334e['model']=_[_0x4122('0x4a')](_0x2d86bf,_0x4122('0x2e'));_0x47334e[_0x4122('0x4b')]=_[_0x4122('0x4c')](_0x12e99f[_0x4122('0x4b')]);_0x47334e[_0x4122('0x4d')]=_[_0x4122('0x4e')](_0x47334e[_0x4122('0x42')],_0x47334e[_0x4122('0x4b')]);_0x4bb6ca[_0x4122('0x4f')]=_['intersection'](_0x47334e[_0x4122('0x42')],qs[_0x4122('0x50')](_0x12e99f['query']['fields']));_0x4bb6ca[_0x4122('0x4f')]=_0x4bb6ca[_0x4122('0x4f')][_0x4122('0x51')]?_0x4bb6ca[_0x4122('0x4f')]:_0x47334e['model'];if(!_0x12e99f[_0x4122('0x4b')][_0x4122('0x52')]('nolimit')){_0x4bb6ca[_0x4122('0x24')]=qs[_0x4122('0x24')](_0x12e99f[_0x4122('0x4b')]['limit']);_0x4bb6ca[_0x4122('0x23')]=qs[_0x4122('0x23')](_0x12e99f['query'][_0x4122('0x23')]);}_0x4bb6ca[_0x4122('0x53')]=qs[_0x4122('0x54')](_0x12e99f[_0x4122('0x4b')][_0x4122('0x54')]);_0x4bb6ca['where']=qs[_0x4122('0x4d')](_[_0x4122('0x55')](_0x12e99f[_0x4122('0x4b')],_0x47334e[_0x4122('0x4d')]),_0x2d86bf);if(_0x12e99f[_0x4122('0x4b')][_0x4122('0x56')]){_0x4bb6ca[_0x4122('0x57')]=_[_0x4122('0x58')](_0x4bb6ca[_0x4122('0x57')],{'$or':_[_0x4122('0x4a')](_0x2d86bf,function(_0x436f7c){if(_0x436f7c[_0x4122('0x43')]!==_0x4122('0x59')){var _0x54d733={};_0x54d733[_0x436f7c['name']]={'$like':'%'+_0x12e99f['query'][_0x4122('0x56')]+'%'};return _0x54d733;}})});}_0x4bb6ca=_[_0x4122('0x58')]({},_0x4bb6ca,_0x12e99f[_0x4122('0x5a')]);var _0x372d5a={'where':_0x4bb6ca[_0x4122('0x57')]};return db['ChatWebsite'][_0x4122('0x25')](_0x372d5a)['then'](function(_0x12be15){_0x19539e[_0x4122('0x25')]=_0x12be15;if(_0x12e99f['query']['includeAll']){_0x4bb6ca[_0x4122('0x5b')]=[{'all':!![]}];}return db['ChatWebsite'][_0x4122('0x5c')](_0x4bb6ca);})[_0x4122('0x15')](function(_0x4b7491){_0x19539e['rows']=_0x4b7491;return _0x19539e;})['then'](respondWithFilteredResult(_0x2d6ccd,_0x4bb6ca))[_0x4122('0x20')](handleError(_0x2d6ccd,null));};exports[_0x4122('0x5d')]=function(_0x4625aa,_0x3e256){var _0x51633a={'raw':![],'where':{'id':_0x4625aa[_0x4122('0x5e')]['id']},'include':[{'model':db[_0x4122('0x45')],'as':_0x4122('0x46')}]},_0x5cdbc9={};_0x5cdbc9[_0x4122('0x42')]=_['keys'](db[_0x4122('0x47')][_0x4122('0x5f')]);_0x5cdbc9[_0x4122('0x4b')]=_[_0x4122('0x4c')](_0x4625aa[_0x4122('0x4b')]);_0x5cdbc9['filters']=_[_0x4122('0x4e')](_0x5cdbc9[_0x4122('0x42')],_0x5cdbc9['query']);_0x51633a['attributes']=_[_0x4122('0x4e')](_0x5cdbc9[_0x4122('0x42')],qs[_0x4122('0x50')](_0x4625aa[_0x4122('0x4b')]['fields']));_0x51633a[_0x4122('0x4f')]=_0x51633a[_0x4122('0x4f')][_0x4122('0x51')]?_0x51633a[_0x4122('0x4f')]:_0x5cdbc9[_0x4122('0x42')];if(_0x4625aa[_0x4122('0x4b')]['includeAll']){_0x51633a[_0x4122('0x5b')]=[{'all':!![]}];}_0x51633a=_[_0x4122('0x58')]({},_0x51633a,_0x4625aa[_0x4122('0x5a')]);return db['ChatWebsite']['find'](_0x51633a)[_0x4122('0x15')](handleEntityNotFound(_0x3e256,null))['then'](respondWithResult(_0x3e256,null))[_0x4122('0x20')](handleError(_0x3e256,null));};exports[_0x4122('0x60')]=function(_0xed30b6,_0x4f8ee1){return db[_0x4122('0x47')][_0x4122('0x60')](_0xed30b6['body'],{})[_0x4122('0x15')](function(_0x3157fa){var _0x58566c=_0xed30b6['user']['get']({'plain':!![]});if(!_0x58566c)throw new Error(_0x4122('0x61'));if(_0x58566c[_0x4122('0x62')]===_0x4122('0x63')){var _0x44fcee=_0x3157fa['get']({'plain':!![]});var _0xf41526=_0x4122('0x2b');return db[_0x4122('0x64')][_0x4122('0x65')]({'where':{'name':_0xf41526,'userProfileId':_0x58566c[_0x4122('0x66')]},'raw':!![]})['then'](function(_0x2fa300){if(_0x2fa300&&_0x2fa300[_0x4122('0x67')]===0x0){return db[_0x4122('0x68')][_0x4122('0x60')]({'name':_0x44fcee[_0x4122('0x2e')],'resourceId':_0x44fcee['id'],'type':_0x2fa300['name'],'sectionId':_0x2fa300['id']},{})[_0x4122('0x15')](function(){return _0x3157fa;});}else{return _0x3157fa;}})[_0x4122('0x20')](function(_0x4e4364){logger[_0x4122('0x1c')](_0x4122('0x69'),_0x4e4364);throw _0x4e4364;});}return _0x3157fa;})[_0x4122('0x15')](respondWithResult(_0x4f8ee1,0xc9))[_0x4122('0x20')](handleError(_0x4f8ee1,null));};exports[_0x4122('0x6a')]=function(_0x3ae015,_0x49d273){if(_0x3ae015['body']['id']){delete _0x3ae015['body']['id'];}return db[_0x4122('0x47')][_0x4122('0x65')]({'where':{'id':_0x3ae015[_0x4122('0x5e')]['id']},'include':[{'model':db[_0x4122('0x45')],'as':_0x4122('0x46')}]})[_0x4122('0x15')](handleEntityNotFound(_0x49d273,null))[_0x4122('0x15')](saveUpdates(_0x3ae015['body'],null))[_0x4122('0x15')](respondWithResult(_0x49d273,null))['catch'](handleError(_0x49d273,null));};exports[_0x4122('0x29')]=function(_0x3376ca,_0x2cc75a){return db[_0x4122('0x47')][_0x4122('0x65')]({'where':{'id':_0x3376ca[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x2cc75a,null))['then'](removeEntity(_0x2cc75a,null))['catch'](handleError(_0x2cc75a,null));};exports[_0x4122('0x6b')]=function(_0x5bbfaf,_0x5cc276){return db[_0x4122('0x47')][_0x4122('0x6b')]()['then'](respondWithResult(_0x5cc276,null))['catch'](handleError(_0x5cc276,null));};exports[_0x4122('0x6c')]=function(_0x300254,_0x44b90c){if(_0x300254[_0x4122('0x6d')]['id']){delete _0x300254[_0x4122('0x6d')]['id'];}return db['ChatWebsite'][_0x4122('0x65')]({'where':{'id':_0x300254[_0x4122('0x5e')]['id']}})['then'](handleEntityNotFound(_0x44b90c,null))[_0x4122('0x15')](function(_0x1c051d){if(_0x1c051d){_0x300254[_0x4122('0x6d')][_0x4122('0x6e')]=_0x1c051d['id'];return db['Disposition'][_0x4122('0x60')](_0x300254['body']);}})[_0x4122('0x15')](respondWithResult(_0x44b90c,null))[_0x4122('0x20')](handleError(_0x44b90c,null));};exports[_0x4122('0x6f')]=function(_0x3270d9,_0x3747e8){var _0x376ddf={'raw':![],'where':{}};var _0x122a84={};var _0x57409e={'count':0x0,'rows':[]};return db[_0x4122('0x47')][_0x4122('0x70')]({'where':{'id':_0x3270d9[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x3747e8,null))[_0x4122('0x15')](function(_0x452094){if(_0x452094){_0x122a84[_0x4122('0x42')]=_['keys'](db[_0x4122('0x71')][_0x4122('0x5f')]);_0x122a84[_0x4122('0x4b')]=_['keys'](_0x3270d9[_0x4122('0x4b')]);_0x122a84[_0x4122('0x4d')]=_[_0x4122('0x4e')](_0x122a84[_0x4122('0x42')],_0x122a84[_0x4122('0x4b')]);_0x376ddf[_0x4122('0x4f')]=_[_0x4122('0x4e')](_0x122a84[_0x4122('0x42')],qs[_0x4122('0x50')](_0x3270d9['query']['fields']));_0x376ddf['attributes']=_0x376ddf[_0x4122('0x4f')]['length']?_0x376ddf[_0x4122('0x4f')]:_0x122a84[_0x4122('0x42')];if(!_0x3270d9[_0x4122('0x4b')]['hasOwnProperty'](_0x4122('0x72'))){_0x376ddf[_0x4122('0x24')]=qs[_0x4122('0x24')](_0x3270d9['query'][_0x4122('0x24')]);_0x376ddf[_0x4122('0x23')]=qs['offset'](_0x3270d9[_0x4122('0x4b')]['offset']);}_0x376ddf['order']=qs['sort'](_0x3270d9[_0x4122('0x4b')]['sort']);_0x376ddf[_0x4122('0x57')]=qs[_0x4122('0x4d')](_[_0x4122('0x55')](_0x3270d9[_0x4122('0x4b')],_0x122a84[_0x4122('0x4d')]));_0x376ddf[_0x4122('0x57')]['ChatWebsiteId']=_0x452094['id'];if(_0x3270d9[_0x4122('0x4b')][_0x4122('0x56')]){_0x376ddf['where']=_['merge'](_0x376ddf['where'],{'$or':_[_0x4122('0x4a')](_0x376ddf['attributes'],function(_0x909ac0){var _0x5de7fa={};_0x5de7fa[_0x909ac0]={'$like':'%'+_0x3270d9[_0x4122('0x4b')][_0x4122('0x56')]+'%'};return _0x5de7fa;})});}_0x376ddf=_[_0x4122('0x58')]({},_0x376ddf,_0x3270d9[_0x4122('0x5a')]);return db[_0x4122('0x71')]['count']({'where':_0x376ddf[_0x4122('0x57')]})[_0x4122('0x15')](function(_0x3357a8){_0x57409e[_0x4122('0x25')]=_0x3357a8;if(_0x3270d9[_0x4122('0x4b')][_0x4122('0x73')]){_0x376ddf[_0x4122('0x5b')]=[{'all':!![]}];}return db[_0x4122('0x71')][_0x4122('0x5c')](_0x376ddf);})[_0x4122('0x15')](function(_0x15dede){_0x57409e['rows']=_0x15dede;return _0x57409e;});}})['then'](respondWithFilteredResult(_0x3747e8,_0x376ddf))['catch'](handleError(_0x3747e8,null));};exports[_0x4122('0x74')]=function(_0x2d3a6a,_0x5f5c67){return db['ChatWebsite'][_0x4122('0x65')]({'where':{'id':_0x2d3a6a[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x5f5c67,null))['then'](function(_0x1e186e){if(_0x1e186e){return _0x1e186e[_0x4122('0x74')](_0x2d3a6a[_0x4122('0x4b')][_0x4122('0x75')]);}})[_0x4122('0x15')](respondWithStatusCode(_0x5f5c67,null))[_0x4122('0x20')](handleError(_0x5f5c67,null));};exports[_0x4122('0x76')]=function(_0x2e497a,_0x4308e8){if(_0x2e497a[_0x4122('0x6d')]['id']){delete _0x2e497a['body']['id'];}return db['ChatWebsite'][_0x4122('0x65')]({'where':{'id':_0x2e497a[_0x4122('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4308e8,null))['then'](function(_0x29a62a){if(_0x29a62a){_0x2e497a[_0x4122('0x6d')][_0x4122('0x6e')]=_0x29a62a['id'];return db[_0x4122('0x77')][_0x4122('0x60')](_0x2e497a[_0x4122('0x6d')]);}})['then'](respondWithResult(_0x4308e8,null))['catch'](handleError(_0x4308e8,null));};exports[_0x4122('0x78')]=function(_0x2c6b16,_0x284fda){var _0x1d29b4={'raw':![],'where':{}};var _0xaa0c38={};var _0x2324c6={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4122('0x70')]({'where':{'id':_0x2c6b16[_0x4122('0x5e')]['id']}})['then'](handleEntityNotFound(_0x284fda,null))[_0x4122('0x15')](function(_0x157c6a){if(_0x157c6a){_0xaa0c38[_0x4122('0x42')]=_[_0x4122('0x4c')](db[_0x4122('0x77')][_0x4122('0x5f')]);_0xaa0c38['query']=_[_0x4122('0x4c')](_0x2c6b16[_0x4122('0x4b')]);_0xaa0c38[_0x4122('0x4d')]=_[_0x4122('0x4e')](_0xaa0c38['model'],_0xaa0c38[_0x4122('0x4b')]);_0x1d29b4[_0x4122('0x4f')]=_[_0x4122('0x4e')](_0xaa0c38['model'],qs['fields'](_0x2c6b16[_0x4122('0x4b')]['fields']));_0x1d29b4[_0x4122('0x4f')]=_0x1d29b4[_0x4122('0x4f')][_0x4122('0x51')]?_0x1d29b4[_0x4122('0x4f')]:_0xaa0c38[_0x4122('0x42')];if(!_0x2c6b16['query'][_0x4122('0x52')](_0x4122('0x72'))){_0x1d29b4[_0x4122('0x24')]=qs[_0x4122('0x24')](_0x2c6b16[_0x4122('0x4b')][_0x4122('0x24')]);_0x1d29b4[_0x4122('0x23')]=qs[_0x4122('0x23')](_0x2c6b16[_0x4122('0x4b')][_0x4122('0x23')]);}_0x1d29b4[_0x4122('0x53')]=qs[_0x4122('0x54')](_0x2c6b16[_0x4122('0x4b')][_0x4122('0x54')]);_0x1d29b4[_0x4122('0x57')]=qs['filters'](_[_0x4122('0x55')](_0x2c6b16['query'],_0xaa0c38[_0x4122('0x4d')]));_0x1d29b4[_0x4122('0x57')][_0x4122('0x6e')]=_0x157c6a['id'];if(_0x2c6b16['query'][_0x4122('0x56')]){_0x1d29b4['where']=_[_0x4122('0x58')](_0x1d29b4[_0x4122('0x57')],{'$or':_['map'](_0x1d29b4['attributes'],function(_0x5ba438){var _0x205457={};_0x205457[_0x5ba438]={'$like':'%'+_0x2c6b16[_0x4122('0x4b')]['filter']+'%'};return _0x205457;})});}_0x1d29b4=_[_0x4122('0x58')]({},_0x1d29b4,_0x2c6b16[_0x4122('0x5a')]);return db[_0x4122('0x77')][_0x4122('0x25')]({'where':_0x1d29b4[_0x4122('0x57')]})[_0x4122('0x15')](function(_0x49d235){_0x2324c6[_0x4122('0x25')]=_0x49d235;if(_0x2c6b16[_0x4122('0x4b')][_0x4122('0x73')]){_0x1d29b4[_0x4122('0x5b')]=[{'all':!![]}];}return db[_0x4122('0x77')][_0x4122('0x5c')](_0x1d29b4);})[_0x4122('0x15')](function(_0x2b841f){_0x2324c6[_0x4122('0x79')]=_0x2b841f;return _0x2324c6;});}})['then'](respondWithFilteredResult(_0x284fda,_0x1d29b4))[_0x4122('0x20')](handleError(_0x284fda,null));};exports['removeAnswers']=function(_0x4eb3da,_0x4d91a6){return db['ChatWebsite'][_0x4122('0x65')]({'where':{'id':_0x4eb3da[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x4d91a6,null))[_0x4122('0x15')](function(_0x51fb2d){if(_0x51fb2d){return _0x51fb2d['removeAnswers'](_0x4eb3da['query'][_0x4122('0x75')]);}})[_0x4122('0x15')](respondWithStatusCode(_0x4d91a6,null))[_0x4122('0x20')](handleError(_0x4d91a6,null));};exports[_0x4122('0x7a')]=function(_0x102854,_0x5e3c0f){_0x102854[_0x4122('0x6d')][_0x4122('0x7b')]=_0x102854[_0x4122('0x7c')][_0x4122('0x7d')];return db[_0x4122('0x47')][_0x4122('0x65')]({'where':{'id':_0x102854[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x5e3c0f,null))['then'](saveUpdates(_0x102854[_0x4122('0x6d')],null))[_0x4122('0x15')](respondWithResult(_0x5e3c0f,null))[_0x4122('0x20')](handleError(_0x5e3c0f,null));};exports[_0x4122('0x7e')]=function(_0x24b499,_0x2060eb){_0x24b499[_0x4122('0x6d')][_0x4122('0x7f')]=_0x24b499['file'][_0x4122('0x7d')];return db[_0x4122('0x47')]['find']({'where':{'id':_0x24b499['params']['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x2060eb,null))[_0x4122('0x15')](saveUpdates(_0x24b499[_0x4122('0x6d')],null))[_0x4122('0x15')](respondWithResult(_0x2060eb,null))[_0x4122('0x20')](handleError(_0x2060eb,null));};exports[_0x4122('0x80')]=function(_0x1489f7,_0x152426){_0x1489f7[_0x4122('0x6d')][_0x4122('0x81')]=_0x1489f7['file'][_0x4122('0x7d')];return db[_0x4122('0x47')][_0x4122('0x65')]({'where':{'id':_0x1489f7[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x152426,null))['then'](saveUpdates(_0x1489f7[_0x4122('0x6d')],null))[_0x4122('0x15')](respondWithResult(_0x152426,null))[_0x4122('0x20')](handleError(_0x152426,null));};exports[_0x4122('0x82')]=function(_0x1fc2e6,_0x29e7a2){_0x1fc2e6[_0x4122('0x6d')][_0x4122('0x83')]=_0x1fc2e6['file'][_0x4122('0x7d')];return db[_0x4122('0x47')]['find']({'where':{'id':_0x1fc2e6[_0x4122('0x5e')]['id']}})['then'](handleEntityNotFound(_0x29e7a2,null))[_0x4122('0x15')](saveUpdates(_0x1fc2e6[_0x4122('0x6d')],null))[_0x4122('0x15')](respondWithResult(_0x29e7a2,null))[_0x4122('0x20')](handleError(_0x29e7a2,null));};exports[_0x4122('0x84')]=function(_0x5b3b35,_0x5e812e){var _0x338382=path[_0x4122('0x85')](config[_0x4122('0x86')],'server/files/images/logos/default_logo.svg');var _0x4eb5c1={'where':{'id':_0x5b3b35[_0x4122('0x5e')]['id']},'attributes':['id',_0x4122('0x7b')],'raw':!![]};var _0x1005a8=![];return require('../../config/license/util')[_0x4122('0x87')]()['then'](function(_0x790b9c){if(_0x790b9c){_0x1005a8=_0x790b9c['custom'];}})[_0x4122('0x15')](function(){return db[_0x4122('0x47')]['find'](_0x4eb5c1);})[_0x4122('0x15')](handleEntityNotFound(_0x5e812e,null))[_0x4122('0x15')](function(_0xea2df4){if(_0xea2df4){if(!_['isNil'](_0xea2df4['sitepic'])){if(fs['existsSync'](path[_0x4122('0x85')](config[_0x4122('0x86')],_0x4122('0x88'),_0xea2df4[_0x4122('0x7b')]))&&_0x1005a8){_0x338382=path[_0x4122('0x85')](config[_0x4122('0x86')],_0x4122('0x88'),_0xea2df4[_0x4122('0x7b')]);}}return _0x5e812e[_0x4122('0x89')](_0x338382);}})[_0x4122('0x20')](handleError(_0x5e812e,null));};exports[_0x4122('0x8a')]=function(_0xbffd65,_0x39ed0a){var _0xabc7a=path['join'](config[_0x4122('0x86')],'server/files/images/avatars/default_avatar.png');var _0x294f6c={'where':{'id':_0xbffd65[_0x4122('0x5e')]['id']},'attributes':['id',_0x4122('0x7f')],'raw':!![]};return db[_0x4122('0x47')][_0x4122('0x65')](_0x294f6c)[_0x4122('0x15')](handleEntityNotFound(_0x39ed0a,null))[_0x4122('0x15')](function(_0x4b8af0){if(_0x4b8af0){if(!_['isNil'](_0x4b8af0['agentAvatar'])){if(fs['existsSync'](path[_0x4122('0x85')](config[_0x4122('0x86')],_0x4122('0x8b'),_0x4b8af0['agentAvatar']))){_0xabc7a=path['join'](config[_0x4122('0x86')],_0x4122('0x8b'),_0x4b8af0[_0x4122('0x7f')]);}}return _0x39ed0a[_0x4122('0x89')](_0xabc7a);}})[_0x4122('0x20')](handleError(_0x39ed0a,null));};exports[_0x4122('0x8c')]=function(_0x3ddf4c,_0x2c3f0d){var _0x105186=path[_0x4122('0x85')](config[_0x4122('0x86')],_0x4122('0x8d'));var _0x38eff7={'where':{'id':_0x3ddf4c[_0x4122('0x5e')]['id']},'attributes':['id',_0x4122('0x81'),_0x4122('0x8e')],'raw':!![]};return db['ChatWebsite'][_0x4122('0x65')](_0x38eff7)['then'](handleEntityNotFound(_0x2c3f0d,null))[_0x4122('0x15')](function(_0x26033d){if(_0x26033d){if(!_[_0x4122('0x8f')](_0x26033d[_0x4122('0x81')])){if(fs['existsSync'](path[_0x4122('0x85')](config[_0x4122('0x86')],'server/files/images/avatars/',_0x26033d[_0x4122('0x81')]))&&_0x26033d[_0x4122('0x8e')]){_0x105186=path[_0x4122('0x85')](config[_0x4122('0x86')],_0x4122('0x8b'),_0x26033d[_0x4122('0x81')]);}}return _0x2c3f0d[_0x4122('0x89')](_0x105186);}})[_0x4122('0x20')](handleError(_0x2c3f0d,null));};exports[_0x4122('0x90')]=function(_0x539163,_0x5c78c0){var _0xdb77eb=path['join'](config['root'],_0x4122('0x91'));var _0x1cc890={'where':{'id':_0x539163[_0x4122('0x5e')]['id']},'attributes':['id',_0x4122('0x83')],'raw':!![]};return db[_0x4122('0x47')][_0x4122('0x65')](_0x1cc890)[_0x4122('0x15')](handleEntityNotFound(_0x5c78c0,null))[_0x4122('0x15')](function(_0x10e93d){if(_0x10e93d){if(!_['isNil'](_0x10e93d[_0x4122('0x83')])){if(fs[_0x4122('0x92')](path['join'](config[_0x4122('0x86')],_0x4122('0x8b'),_0x10e93d[_0x4122('0x83')]))){_0xdb77eb=path['join'](config[_0x4122('0x86')],_0x4122('0x8b'),_0x10e93d['systemAvatar']);}}return _0x5c78c0['download'](_0xdb77eb);}})[_0x4122('0x20')](handleError(_0x5c78c0,null));};exports[_0x4122('0x93')]=function(_0xb9b23b,_0x3a5d97){var _0x1f2b80={'body':_0xb9b23b[_0x4122('0x6d')],'channel':_0x4122('0x94')};var _0x3d905f=[];var _0x1609fd=[];var _0x1c81f4={};var _0x1cdd7a=![];if(_0xb9b23b['body']['id']){delete _0xb9b23b[_0x4122('0x6d')]['id'];}if(_[_0x4122('0x8f')](_0xb9b23b[_0x4122('0x6d')][_0x4122('0x95')])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0x4122('0x8f')](_0xb9b23b[_0x4122('0x6d')][_0x4122('0x96')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0x4122('0x97')](_0xb9b23b[_0x4122('0x6d')]['body'])){throw new APIBadRequestError(_0x4122('0x98'));}return db['CmContact'][_0x4122('0x6b')]()[_0x4122('0x15')](function(_0x171926){if(!_0x171926){throw new Error(_0x4122('0x99'));}_0x3d905f=Object[_0x4122('0x4c')](_0x171926)[_0x4122('0x56')](function(_0x4ae150){return![_0x4122('0x9a'),'updatedAt']['includes'](_0x4ae150);});_0x1609fd=Object[_0x4122('0x4c')](_0x171926)['filter'](function(_0x3aac12){return!['createdAt',_0x4122('0x9b'),_0x4122('0x9c'),_0x4122('0x9d')][_0x4122('0x9e')](_0x3aac12);});if(!_['includes'](_0x1609fd,_0xb9b23b[_0x4122('0x6d')][_0x4122('0x96')])){throw new APIBadRequestError(_0x4122('0x9f')+_0x1609fd[_0x4122('0x85')](',\x20'));}_0x1c81f4[_0xb9b23b['body']['mapKey']]=_0xb9b23b[_0x4122('0x6d')][_0x4122('0x95')];})[_0x4122('0x15')](function(){return db[_0x4122('0x47')][_0x4122('0x65')]({'where':{'id':_0xb9b23b['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x4122('0xa0')],'as':'Contacts','where':_0x1c81f4,'limit':0x1,'order':[[_0x4122('0x9b'),_0x4122('0xa1')]]}]},{'model':db[_0x4122('0xa2')],'as':_0x4122('0xa3')},{'model':db[_0x4122('0xa4')],'as':_0x4122('0xa4'),'include':[{'model':db[_0x4122('0xa4')],'as':_0x4122('0xa5'),'attributes':['id',_0x4122('0xa6')],'raw':!![]}]}]});})[_0x4122('0x15')](function(_0xac7866){if(!_0xac7866){throw new APINotFoundError(util[_0x4122('0x3e')](_0x4122('0xa7'),_0xb9b23b[_0x4122('0x5e')]['id']));}var _0x530878=_0xac7866[_0x4122('0xa4')];if(_0x530878){var _0x3a9445=_0xac7866[_0x4122('0xa8')]||undefined;return _0x530878[_0x4122('0xa9')](_0x3a9445)['then'](function(_0x355157){if(!_0x355157){throw new APIOutOfIntervalError();}return _0xac7866;});}else{return _0xac7866;}})[_0x4122('0x15')](function(_0x67d048){if(!_0x67d048[_0x4122('0xaa')]){return;}_0x1f2b80[_0x4122('0xab')]=_0x67d048;_0x1f2b80[_0x4122('0xac')]=_0x67d048['List'];_0x1f2b80['applications']=_[_0x4122('0xad')](_0x67d048[_0x4122('0xa3')],[_0x4122('0xae')],[_0x4122('0xaf')]);if(_0x1f2b80[_0x4122('0xab')]['Applications']){delete _0x1f2b80['account'][_0x4122('0xa3')];}if(_0x1f2b80[_0x4122('0xab')][_0x4122('0xaa')]&&_0x1f2b80[_0x4122('0xab')][_0x4122('0xaa')][_0x4122('0xb0')]['length']){return _0x1f2b80[_0x4122('0xab')][_0x4122('0xaa')][_0x4122('0xb0')][0x0];}var _0x4ebef5=_[_0x4122('0x10')](_0xb9b23b[_0x4122('0x6d')],{'firstName':_0xb9b23b[_0x4122('0x6d')][_0x4122('0x95')],'ListId':_0x67d048[_0x4122('0x9d')]});_0x4ebef5[_0xb9b23b['body'][_0x4122('0x96')]]=_0xb9b23b[_0x4122('0x6d')][_0x4122('0x95')];return db[_0x4122('0xa0')]['create'](_0x4ebef5,{'fields':_0x3d905f,'raw':!![]});})['then'](function(_0x4d8630){_0x1f2b80[_0x4122('0xb1')]=_0x4d8630;var _0x5a7f9a=createInteractionObject(_0xb9b23b[_0x4122('0x5e')]['id'],_0xb9b23b['body'],_0xb9b23b['headers'],_0x4d8630);var _0x164c12={'ChatWebsiteId':_0xb9b23b[_0x4122('0x5e')]['id']};if(_0xb9b23b[_0x4122('0x6d')][_0x4122('0xb2')]){_0x164c12[_0x4122('0xb2')]=_0xb9b23b[_0x4122('0x6d')]['threadId'];_0x164c12[_0x4122('0xb3')]=![];return db['ChatInteraction']['find']({'where':_0x164c12})['then'](function(_0x2e77f4){var _0xb215b8=_0xb9b23b[_0x4122('0x6d')][_0x4122('0x33')]&&_0xb9b23b[_0x4122('0x6d')]['referer'];if(_0x2e77f4){_0x1cdd7a=!![];return _0x2e77f4;}else if(!_0xb215b8&&_0x2e77f4&&_0x2e77f4[_0x4122('0xb3')]){throw new APIConflictError(_0x4122('0xb4'));}_0x5a7f9a[_0x4122('0xb2')]=_0xb9b23b[_0x4122('0x6d')]['threadId'];_0x5a7f9a[_0x4122('0xb5')]=_0xb9b23b[_0x4122('0x6d')][_0x4122('0xb5')];return db[_0x4122('0xb6')][_0x4122('0x60')](_0x5a7f9a);});}_0x164c12['ContactId']=_0x4d8630['id'];if(_0xb9b23b[_0x4122('0x6d')][_0x4122('0xb7')]&&_0xb9b23b['body'][_0x4122('0xb7')]['id']){_0x164c12['id']=_0xb9b23b['body'][_0x4122('0xb7')]['id'];return db[_0x4122('0xb6')]['find']({'where':_0x164c12})[_0x4122('0x15')](function(_0x5aec89){var _0xddf209=_0xb9b23b[_0x4122('0x6d')][_0x4122('0x33')]&&_0xb9b23b[_0x4122('0x6d')][_0x4122('0x3b')];if(!_0xddf209&&_0x5aec89&&_0x5aec89[_0x4122('0xb3')]){throw new APIConflictError(_0x4122('0xb4'));}else if(_0x5aec89){_0x1cdd7a=!![];return _0x5aec89;}else{return db[_0x4122('0xb6')][_0x4122('0x60')](_0x5a7f9a);}});}return db[_0x4122('0xb6')][_0x4122('0x60')](_0x5a7f9a);})[_0x4122('0x15')](function(_0x14b404){if(!_0x1cdd7a){return _0x14b404;}var _0x28a0fb={'from':(_0x1f2b80['contact'][_0x4122('0x38')]||'')+'\x20'+(_0x1f2b80[_0x4122('0xb1')][_0x4122('0x39')]||'')};if(_0xb9b23b['body'][_0x4122('0xb2')]&&_0xb9b23b[_0x4122('0x6d')][_0x4122('0xb8')]&&_0xb9b23b[_0x4122('0x6d')][_0x4122('0xb2')]!=_0xb9b23b[_0x4122('0x6d')][_0x4122('0xb8')]){_0x28a0fb[_0x4122('0xb2')]=_0xb9b23b[_0x4122('0x6d')]['messageId'];}return _0x14b404['update'](_0x28a0fb);})[_0x4122('0x15')](function(_0x1e88b5){_0x1f2b80[_0x4122('0xb7')]=_0x1e88b5[_0x4122('0x2a')]({'plain':!![]});_0x1f2b80[_0x4122('0xb7')][_0x4122('0xb9')]=!_0x1cdd7a;if(_0x1f2b80[_0x4122('0xb7')][_0x4122('0xb9')]){if(_0x1f2b80[_0x4122('0xab')][_0x4122('0xba')]){_0x1f2b80['applications'][_0x4122('0xbb')]({'id':0x0,'priority':_0x1f2b80[_0x4122('0xbc')]['length']+0x1,'app':_0x4122('0xbd'),'appdata':_0x4122('0xbe'),'interval':_0x4122('0xbf')});}}return db[_0x4122('0xc0')][_0x4122('0x60')]({'body':_0xb9b23b['body'][_0x4122('0x6d')],'ChatWebsiteId':_0xb9b23b[_0x4122('0x5e')]['id'],'ChatInteractionId':_0x1e88b5['id'],'direction':'in','ContactId':_0x1f2b80[_0x4122('0xb1')]['id'],'AttachmentId':_0xb9b23b[_0x4122('0x6d')][_0x4122('0xc1')]});})['then'](function(_0x230f2b){_0x1f2b80['message']=_0x230f2b;if(!_0x1f2b80[_0x4122('0xb7')][_0x4122('0xc2')]){return;}return db[_0x4122('0xc3')][_0x4122('0x65')]({'attributes':['id',_0x4122('0x2e')],'where':{'id':_0x1f2b80[_0x4122('0xb7')][_0x4122('0xc2')]}});})[_0x4122('0x15')](function(_0x1f9496){if(_0x1f9496){_0x1f2b80[_0x4122('0xbc')][_0x4122('0xc4')]({'id':0x0,'priority':0x0,'app':_0x4122('0xc5'),'appdata':_0x1f9496[_0x4122('0x2e')]+','+(_0x1f2b80['account'][_0x4122('0xc6')]||0xa),'interval':_0x4122('0xbf')});_0x1f2b80[_0x4122('0xc7')]=!![];}if(!_0x1f2b80[_0x4122('0xb7')][_0x4122('0xc8')]){return;}return db[_0x4122('0xc9')][_0x4122('0x65')]({'attributes':['id',_0x4122('0x2e')],'where':{'id':_0x1f2b80[_0x4122('0xb7')]['queueId']}});})['then'](function(_0x517373){if(_0x517373){_0x1f2b80[_0x4122('0xbc')]['unshift']({'id':0x0,'priority':0x1,'app':_0x4122('0xca'),'appdata':_0x517373['name']+','+(_0x1f2b80[_0x4122('0xab')][_0x4122('0xcb')]||0x12c),'interval':_0x4122('0xbf')});}return respondWithRpcPromise(_0x4122('0xcc'),_0x4122('0xcd'),_0x1f2b80);})['then'](function(_0x287dcc){respondWithRpcPromise(_0x4122('0xce'),_0x4122('0xce'),{'event':_0x4122('0x93'),'message':_0x287dcc},client9002);return _0x287dcc;})[_0x4122('0x15')](respondWithResult(_0x3a5d97,null))['catch'](APIHandleError(_0x3a5d97));};exports[_0x4122('0xcf')]=function(_0x49570d,_0x4bbde1){var _0x4f5f47,_0x4caa8c,_0x4a12a6;var _0x34bfa1=[];var _0x8d2161={};var _0x5911c6=_0x49570d[_0x4122('0xd0')]||[];var _0x203510=[];var _0x4cafd4;return db['CmContact'][_0x4122('0x6b')]()[_0x4122('0x15')](function(_0x3fb236){if(!_0x3fb236){throw new db[(_0x4122('0xd1'))]['ValidationError']('no\x20available\x20attributes');}_0x34bfa1=_[_0x4122('0xd2')](_['keys'](_0x3fb236),[_0x4122('0x9a'),_0x4122('0x9b'),'CompanyId',_0x4122('0x9d')]);if(_0x49570d[_0x4122('0x6d')]['id']){delete _0x49570d['body']['id'];}if(_['isNil'](_0x49570d[_0x4122('0x6d')][_0x4122('0x95')])){throw _0x4bbde1[_0x4122('0x22')](0x1f4)['send'](new db[(_0x4122('0xd1'))][(_0x4122('0xd3'))](_0x4122('0xd4')));}if(_[_0x4122('0x8f')](_0x49570d['body'][_0x4122('0x6d')])||_0x49570d[_0x4122('0x6d')][_0x4122('0x6d')]===''){throw _0x4bbde1[_0x4122('0x22')](0x1f4)['send'](new db[(_0x4122('0xd1'))][(_0x4122('0xd3'))](_0x4122('0xd5')));}if(_[_0x4122('0x8f')](_0x49570d[_0x4122('0x6d')][_0x4122('0xd6')])){throw _0x4bbde1[_0x4122('0x22')](0x1f4)[_0x4122('0xd7')](new db[(_0x4122('0xd1'))][(_0x4122('0xd3'))](_0x4122('0xd8')+_0x34bfa1));}if(!_[_0x4122('0x9e')](_0x34bfa1,_0x49570d[_0x4122('0x6d')][_0x4122('0xd6')])){throw _0x4bbde1[_0x4122('0x22')](0x1f4)[_0x4122('0xd7')](new db[(_0x4122('0xd1'))][(_0x4122('0xd3'))](_0x4122('0xd9')+_0x34bfa1));}_0x8d2161[_0x49570d[_0x4122('0x6d')][_0x4122('0xd6')]]=_0x49570d[_0x4122('0x6d')][_0x4122('0x95')];})['then'](function(){return db[_0x4122('0x47')][_0x4122('0x65')]({'where':{'id':_0x49570d['params']['id']},'include':[{'model':db[_0x4122('0xda')],'as':'List'},{'model':db[_0x4122('0xdb')],'as':'MailAccount'}]});})[_0x4122('0x15')](handleEntityNotFound(_0x4bbde1,null))[_0x4122('0x15')](function(_0x521816){if(_0x521816&&_0x521816[_0x4122('0xaa')]){_0x4caa8c=_0x521816;var _0x35e9a3=_[_0x4122('0x10')](_0x49570d[_0x4122('0x6d')],{'firstName':_0x49570d['body'][_0x4122('0x95')],'phone':_0x49570d[_0x4122('0x6d')]['from'],'ListId':_0x521816[_0x4122('0x9d')]});_0x35e9a3[_0x49570d[_0x4122('0x6d')][_0x4122('0xd6')]]=_0x49570d[_0x4122('0x6d')][_0x4122('0x95')];return db[_0x4122('0xa0')][_0x4122('0xdc')]({'where':_0x8d2161,'defaults':_0x35e9a3});}})[_0x4122('0xdd')](function(_0x1a98a1){if(_0x1a98a1){_0x4a12a6=_0x1a98a1;var _0x15ac3f=fs[_0x4122('0xde')](path['join'](config['root'],_0x4122('0xdf')),'utf8');var _0x51d120=ejs[_0x4122('0xe0')](_0x15ac3f,{'body':_[_0x4122('0xe1')](_0x49570d[_0x4122('0x6d')][_0x4122('0x6d')]),'bodyTitle':_0x4caa8c[_0x4122('0xe2')]});return db[_0x4122('0xe3')][_0x4122('0x60')]({'body':_0x51d120,'plainBody':htmlToText[_0x4122('0xe4')](_0x51d120),'ContactId':_0x1a98a1['id'],'ChatWebsiteId':_0x4caa8c['id']});}})[_0x4122('0x15')](function(_0x6ddac0){_0x4cafd4=_0x6ddac0;if(_0x5911c6[_0x4122('0x51')]){var _0x1747ac=_0x5911c6[_0x4122('0x4a')](function(_0x144fa0){return{'name':_0x144fa0[_0x4122('0xe5')],'basename':_0x144fa0[_0x4122('0x7d')],'type':_0x144fa0[_0x4122('0xe6')],'ChatOfflineMessageId':_0x6ddac0['id']};});_0x203510=_0x1747ac[_0x4122('0x4a')](_0xfbe78d=>{var _0x4390da={'filename':_0xfbe78d[_0x4122('0x2e')],'path':path[_0x4122('0x85')](config[_0x4122('0x86')],_0x4122('0xe7'),_0x4122('0xd0'),_0x4122('0xe8'),_0x4122('0xe9'),_0xfbe78d[_0x4122('0xea')])};return _0x4390da;});if(!_0x4caa8c['openNewInteraction']){return db[_0x4122('0xeb')][_0x4122('0xec')](function(_0x59108b){return db[_0x4122('0xed')][_0x4122('0xee')](_0x1747ac,{'transaction':_0x59108b});});}}})[_0x4122('0x15')](function(){if(_0x4cafd4){_0x4f5f47=_0x4cafd4;return db[_0x4122('0xdb')][_0x4122('0x70')]({'where':{'service':!![]},'include':[{'model':db[_0x4122('0xef')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4122('0xf0')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x4122('0x15')](function(_0x496112){if(_0x496112&&_0x496112[_0x4122('0xf1')]&&_0x4caa8c[_0x4122('0xf2')]&&_0x4caa8c['forwardOfflineAddress']){var _0x5b617c=_0x496112[_0x4122('0xf3')]();return respondWithRpcPromise(_0x4122('0xf4'),_0x4122('0xf5'),{'account':_0x5b617c,'message':{'from':util['format'](_0x4122('0xf6'),_0x496112[_0x4122('0x2e')],_0x496112[_0x4122('0xf7')]||_0x496112[_0x4122('0xf1')][_0x4122('0x63')]),'to':_0x4caa8c[_0x4122('0xf8')],'subject':_0x4caa8c[_0x4122('0xf9')],'html':_0x4f5f47[_0x4122('0x6d')],'attachments':_0x203510}},client9003)['then'](function(){return _0x4f5f47;})[_0x4122('0x20')](function(_0x952fe1){logger[_0x4122('0x1c')](_0x952fe1);});}})[_0x4122('0x15')](function(){if(_0x4caa8c&&_0x4caa8c[_0x4122('0xfa')]&&_0x4caa8c[_0x4122('0xfb')]){var _0x1037b0=[];if(_0x5911c6['length']){_0x1037b0=_0x5911c6[_0x4122('0x4a')](function(_0x43c964){return{'name':_0x43c964['originalname'],'basename':_0x43c964[_0x4122('0x7d')],'type':_0x43c964[_0x4122('0xe6')],'ChatOfflineMessageId':_0x4cafd4['id']};});}var _0x32b5ae;if(!_[_0x4122('0x8f')](_0x4caa8c[_0x4122('0xfc')])){var _0x4f0c78=_[_0x4122('0x4a')](_0x49570d['body'],function(_0x873052){return _0x873052;});var _0x4a2338=_[_0x4122('0xfd')](_0x4f0c78)[0x0];var _0x3638b8=_[_0x4122('0xfe')](_0x4a2338,function(_0x5315c8){return _0x5315c8;});_0x32b5ae=_0x3638b8[0x1][_0x4caa8c[_0x4122('0xfc')]];}var _0x287946={'from':_0x4a12a6['email'],'firstName':_0x4a12a6[_0x4122('0x38')],'lastName':_0x4a12a6[_0x4122('0x39')],'mapKey':_0x4122('0xf7'),'message':{'from':_0x4a12a6[_0x4122('0xf7')],'to':_0x4caa8c[_0x4122('0xdb')][_0x4122('0xf7')],'cc':'','subject':_[_0x4122('0x8f')](_0x32b5ae)?_0x4caa8c[_0x4122('0xf9')]:_0x32b5ae,'messageId':'','sentAt':new Date(),'attach':_0x1037b0['length'],'attachments':_0x1037b0,'originChannel':_0x4122('0xff'),'ChatWebsiteId':_0x4caa8c['id'],'ChatOfflineMessageId':_0x4f5f47['id'],'originTo':_0x4caa8c[_0x4122('0xdb')][_0x4122('0xf7')]},'body':_0x4f5f47[_0x4122('0x6d')]};var _0x3d2f91={'account':{'id':_0x4caa8c[_0x4122('0xfb')]},'body':_0x287946,'log':_0x4122('0x100')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x3d2f91,client9001)[_0x4122('0x15')](function(){return _0x4f5f47;})['catch'](function(_0x468460){logger['error'](_0x468460);});}return;})[_0x4122('0x15')](function(){if(_0x4f5f47){return _0x4f5f47;}})[_0x4122('0x15')](respondWithResult(_0x4bbde1,null))[_0x4122('0x20')](function(){for(var _0xc9a468 of _0x5911c6){var _0x4b94f4=path[_0x4122('0x85')](config['root'],_0x4122('0xe7'),_0x4122('0xd0'),_0x4122('0xe8'),'offline-chat',_0xc9a468[_0x4122('0x7d')]);fs_extra['remove'](_0x4b94f4)[_0x4122('0x20')](function(_0x16e1fd){logger[_0x4122('0x1c')]('Could\x20not\x20remove\x20attachment\x20file',_0x4b94f4,_0x16e1fd);});}});};exports[_0x4122('0x101')]=function(_0x370266,_0x589870){return db[_0x4122('0xb6')][_0x4122('0x65')]({'where':{'id':_0x370266['params']['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x589870,null))['then'](function(_0x5d5155){if(_0x5d5155){return _0x5d5155['addInteraction'](_0x370266[_0x4122('0x6d')][_0x4122('0x75')],_[_0x4122('0x102')](_0x370266[_0x4122('0x6d')],[_0x4122('0x75'),'id'])||{});}})[_0x4122('0x15')](respondWithResult(_0x589870,null))['catch'](handleError(_0x589870,null));};exports[_0x4122('0x103')]=function(_0x55ce4a,_0x39d1bc){var _0x224a86={'raw':![],'where':{}};var _0x409bad={};var _0x1bde17={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x55ce4a[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x39d1bc,null))['then'](function(_0x3c4d9a){if(_0x3c4d9a){_0x409bad[_0x4122('0x42')]=_[_0x4122('0x4c')](db['ChatInteraction'][_0x4122('0x5f')]);_0x409bad[_0x4122('0x4b')]=_['keys'](_0x55ce4a['query']);_0x409bad['filters']=_[_0x4122('0x4e')](_0x409bad[_0x4122('0x42')],_0x409bad[_0x4122('0x4b')]);_0x224a86[_0x4122('0x4f')]=_[_0x4122('0x4e')](_0x409bad[_0x4122('0x42')],qs[_0x4122('0x50')](_0x55ce4a['query'][_0x4122('0x50')]));_0x224a86[_0x4122('0x4f')]=_0x224a86[_0x4122('0x4f')][_0x4122('0x51')]?_0x224a86[_0x4122('0x4f')]:_0x409bad[_0x4122('0x42')];if(!_0x55ce4a[_0x4122('0x4b')]['hasOwnProperty']('nolimit')){_0x224a86['limit']=qs['limit'](_0x55ce4a[_0x4122('0x4b')][_0x4122('0x24')]);_0x224a86[_0x4122('0x23')]=qs[_0x4122('0x23')](_0x55ce4a[_0x4122('0x4b')][_0x4122('0x23')]);}_0x224a86['order']=qs['sort'](_0x55ce4a['query'][_0x4122('0x54')]);_0x224a86[_0x4122('0x57')]=qs[_0x4122('0x4d')](_[_0x4122('0x55')](_0x55ce4a['query'],_0x409bad['filters']));_0x224a86['where'][_0x4122('0x6e')]=_0x3c4d9a['id'];if(_0x55ce4a['query']['filter']){_0x224a86['where']=_[_0x4122('0x58')](_0x224a86[_0x4122('0x57')],{'$or':_['map'](_0x224a86[_0x4122('0x4f')],function(_0x989f7){var _0x2e9c92={};_0x2e9c92[_0x989f7]={'$like':'%'+_0x55ce4a[_0x4122('0x4b')][_0x4122('0x56')]+'%'};return _0x2e9c92;})});}_0x224a86=_[_0x4122('0x58')]({},_0x224a86,_0x55ce4a[_0x4122('0x5a')]);return db[_0x4122('0xb6')][_0x4122('0x25')]({'where':_0x224a86[_0x4122('0x57')]})['then'](function(_0x24102e){_0x1bde17['count']=_0x24102e;if(_0x55ce4a[_0x4122('0x4b')][_0x4122('0x73')]){_0x224a86['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x4122('0xc3')],'as':_0x4122('0x104'),'attributes':['name',_0x4122('0x105'),_0x4122('0x106')],'required':![]},{'model':db[_0x4122('0x107')],'as':_0x4122('0x108'),'attributes':['id','name',_0x4122('0x109')],'where':_0x55ce4a['query'][_0x4122('0x10a')]?{'id':_0x55ce4a[_0x4122('0x4b')]['tag']}:undefined,'required':_0x55ce4a[_0x4122('0x4b')][_0x4122('0x10a')]?!![]:![]}];}return db[_0x4122('0xb6')]['findAll'](_0x224a86);})['then'](function(_0x297958){_0x1bde17['rows']=_0x297958;return _0x1bde17;});}})[_0x4122('0x15')](respondWithFilteredResult(_0x39d1bc,_0x224a86))['catch'](handleError(_0x39d1bc,null));};exports['getSnippet']=function(_0x15031a,_0x1579ad){var _0x430c5f=0x0;var _0xa3b6bb=0x0;var _0x4f108f=![];var _0x423f9c;var _0x1505f1;return db['ChatWebsite']['find']({'where':{'id':_0x15031a['params']['id']},'include':[{'model':db[_0x4122('0xa4')],'as':_0x4122('0xa4'),'include':[{'model':db[_0x4122('0xa4')],'as':'Intervals','attributes':['id',_0x4122('0xa6')]}]}]})[_0x4122('0x15')](handleEntityNotFound(_0x1579ad,null))[_0x4122('0x15')](function(_0x19837f){if(_0x19837f){_0x423f9c=_0x19837f;return _0x19837f[_0x4122('0x10b')]({'raw':!![]});}})[_0x4122('0x15')](function(_0x30eb51){if(_0x423f9c){if(_0x30eb51){_0x1505f1=_0x30eb51;}}return require(_0x4122('0x10c'))[_0x4122('0x87')]();})['then'](function(_0x3b0aee){if(_0x3b0aee){_0xa3b6bb=_0x3b0aee[_0x4122('0x10d')];_0x4f108f=_0x3b0aee[_0x4122('0x10e')];}})[_0x4122('0x15')](function(){return db[_0x4122('0xb6')][_0x4122('0x25')]({'where':{'closed':![]}});})[_0x4122('0x15')](function(_0x1dbb7a){_0x430c5f=_0x1dbb7a;if(_0xa3b6bb&&_0x1dbb7a>_0xa3b6bb){return db[_0x4122('0x10f')][_0x4122('0x70')]({'where':{'id':0x1}})[_0x4122('0x15')](function(_0x408182){if(_0x408182){_0x408182[_0x4122('0x110')]('chatLicenseExceeded');}});}})['then'](function(){var _0x9d9d73=_0x423f9c[_0x4122('0xa4')];var _0x3fe22e=_0x423f9c[_0x4122('0xa8')]||undefined;return _0x9d9d73?_0x9d9d73[_0x4122('0xa9')](_0x3fe22e):!![];})[_0x4122('0x15')](function(_0xb39b79){var _0x10fbbb=fs[_0x4122('0xde')](path[_0x4122('0x85')](config[_0x4122('0x86')],_0x4122('0x111')),_0x4122('0x112'));var _0x3da13c=new url['URL'](_0x423f9c['address'])[_0x4122('0x113')];var _0x315a59='3.8.1';var _0x31a4cc=![];var _0x2fe24f={'chatVersion':_0x315a59,'chatWebsiteAddressOrigin':_0x3da13c,'remote':_0x423f9c[_0x4122('0x114')],'query':querystring['stringify'](_[_0x4122('0x58')](_0x423f9c[_0x4122('0x2a')]({'plain':!![]}),{'customerIp':_0x15031a['headers'][_0x4122('0x35')]||_0x15031a[_0x4122('0x115')]['x-real-ip']||_0x15031a[_0x4122('0x116')][_0x4122('0x117')]||_0x15031a['ip'],'referer':_0x15031a['headers'][_0x4122('0x3b')],'openedInteractions':_0x430c5f,'maxInteractions':_0xa3b6bb,'virtual':_0x4f108f['virtual'],'online':_0xb39b79,'custom':_0x4f108f}))['replace'](/'/g,'\x5c\x27')};_0x1579ad[_0x4122('0xd7')](ejs[_0x4122('0xe0')](Mustache[_0x4122('0xe0')](_0x10fbbb,_0x2fe24f),{'proactiveActions':_0x1505f1,'alignment':_0x423f9c[_0x4122('0x118')],'verticalAlignment':_0x423f9c[_0x4122('0x119')],'div_color':_0x423f9c[_0x4122('0x109')],'labelText':_0x423f9c[_0x4122('0x11a')],'text_color':_0x423f9c[_0x4122('0x11b')],'text_button_color':_0x423f9c[_0x4122('0x11c')],'button_color':_0x423f9c['color_button'],'background_color':_0x423f9c[_0x4122('0x11d')],'hideWhenOffline':_0x423f9c[_0x4122('0x11e')],'intervalId':_0x423f9c[_0x4122('0x11f')],'isDevelopment':_0x31a4cc,'chatVersion':_0x315a59}));})['catch'](handleError(_0x1579ad,null));};exports[_0x4122('0x120')]=function(_0x18e1c6,_0x540a1d){var _0x1f2086=_0x18e1c6[_0x4122('0x5e')]['id'];var _0x2af064=_0x18e1c6[_0x4122('0x6d')];var _0x202c62=0xc8;var _0x57d164=null;return db[_0x4122('0xeb')][_0x4122('0xec')]({'isolationLevel':db[_0x4122('0xeb')][_0x4122('0x121')]['ISOLATION_LEVELS'][_0x4122('0x122')]},function(_0x4d6344){return db[_0x4122('0x47')][_0x4122('0x70')]({'where':{'id':_0x1f2086},'transaction':_0x4d6344})[_0x4122('0x15')](function(_0x1c99e4){if(_0x1c99e4){return db[_0x4122('0xa2')][_0x4122('0x29')]({'where':{'ChatWebsiteId':_0x1f2086},'transaction':_0x4d6344})['then'](function(){var _0x4fe8b8=_[_0x4122('0x4a')](_0x2af064,function(_0x34760f){_0x34760f[_0x4122('0x6e')]=_0x1f2086;return _0x34760f;});return db[_0x4122('0xa2')]['bulkCreate'](_0x4fe8b8,{'transaction':_0x4d6344});});}else{_0x202c62=0x194;_0x57d164=[];}});})[_0x4122('0x15')](function(){if(_0x202c62!==0x194){return db[_0x4122('0xa2')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x1f2086},'order':'priority'})[_0x4122('0x15')](function(_0xd6ba5c){_0x57d164=_0xd6ba5c;});}})[_0x4122('0x20')](function(_0x41d402){_0x202c62=0x1f4;logger['error'](_0x41d402['stack']);if(_0x41d402['name']){delete _0x41d402['name'];}_0x57d164=_0x41d402;})[_0x4122('0x123')](function(){if(_0x57d164===null){_0x540a1d[_0x4122('0x2c')](_0x202c62);}else{if(_0x202c62===0x1f4){_0x540a1d['status'](_0x202c62)['send'](_0x57d164);}else{_0x540a1d[_0x4122('0x22')](_0x202c62)['json'](_0x57d164);}}});};exports[_0x4122('0x124')]=function(_0x5481d7,_0x2badbc){var _0x508af0={};var _0x8c8072={};var _0x534ed3;var _0x405fff;return db['ChatWebsite']['findOne']({'where':{'id':_0x5481d7[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x2badbc,null))[_0x4122('0x15')](function(_0x7a24e3){if(_0x7a24e3){_0x534ed3=_0x7a24e3;_0x8c8072[_0x4122('0x42')]=_[_0x4122('0x4c')](db[_0x4122('0xa2')]['rawAttributes']);_0x8c8072[_0x4122('0x4b')]=_[_0x4122('0x4c')](_0x5481d7['query']);_0x8c8072[_0x4122('0x4d')]=_[_0x4122('0x4e')](_0x8c8072['model'],_0x8c8072[_0x4122('0x4b')]);_0x508af0[_0x4122('0x4f')]=_[_0x4122('0x4e')](_0x8c8072['model'],qs[_0x4122('0x50')](_0x5481d7['query'][_0x4122('0x50')]));_0x508af0[_0x4122('0x4f')]=_0x508af0['attributes'][_0x4122('0x51')]?_0x508af0[_0x4122('0x4f')]:_0x8c8072[_0x4122('0x42')];_0x508af0[_0x4122('0x53')]=qs[_0x4122('0x54')](_0x5481d7['query'][_0x4122('0x54')]);_0x508af0['where']=qs['filters'](_['pick'](_0x5481d7[_0x4122('0x4b')],_0x8c8072['filters']));if(_0x5481d7[_0x4122('0x4b')]['filter']){_0x508af0[_0x4122('0x57')]=_[_0x4122('0x58')](_0x508af0[_0x4122('0x57')],{'$or':_[_0x4122('0x4a')](_0x508af0[_0x4122('0x4f')],function(_0x2bfd89){var _0x26f7b1={};_0x26f7b1[_0x2bfd89]={'$like':'%'+_0x5481d7['query'][_0x4122('0x56')]+'%'};return _0x26f7b1;})});}_0x508af0=_['merge']({},_0x508af0,_0x5481d7['options']);return _0x534ed3[_0x4122('0x124')](_0x508af0);}})[_0x4122('0x15')](function(_0x4d428c){if(_0x4d428c){_0x405fff=_0x4d428c[_0x4122('0x51')];if(!_0x5481d7[_0x4122('0x4b')][_0x4122('0x52')](_0x4122('0x72'))){_0x508af0[_0x4122('0x24')]=qs['limit'](_0x5481d7[_0x4122('0x4b')][_0x4122('0x24')]);_0x508af0[_0x4122('0x23')]=qs['offset'](_0x5481d7[_0x4122('0x4b')][_0x4122('0x23')]);}return _0x534ed3[_0x4122('0x124')](_0x508af0);}})['then'](function(_0x2684bd){if(_0x2684bd){return _0x2684bd?{'count':_0x405fff,'rows':_0x2684bd}:null;}})[_0x4122('0x15')](respondWithResult(_0x2badbc,null))['catch'](handleError(_0x2badbc,null));};exports['addProactiveActions']=function(_0x1a03c2,_0x260b3b){return db[_0x4122('0x125')][_0x4122('0x65')]({'where':{'id':_0x1a03c2[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x260b3b,null))[_0x4122('0x15')](function(_0x2d2f31){if(_0x2d2f31){return _0x2d2f31[_0x4122('0x126')](_0x1a03c2['body'][_0x4122('0x75')],_['omit'](_0x1a03c2[_0x4122('0x6d')],[_0x4122('0x75'),'id'])||{});}})[_0x4122('0x15')](respondWithResult(_0x260b3b,null))[_0x4122('0x20')](handleError(_0x260b3b,null));};exports[_0x4122('0x10b')]=function(_0x3c1256,_0x1b8840){var _0x52adcc={};var _0x49875f={};var _0x59cf79;var _0x15826a;return db[_0x4122('0x47')][_0x4122('0x70')]({'where':{'id':_0x3c1256[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x1b8840,null))['then'](function(_0x1df890){if(_0x1df890){_0x59cf79=_0x1df890;_0x49875f[_0x4122('0x42')]=_['keys'](db[_0x4122('0x127')][_0x4122('0x5f')]);_0x49875f[_0x4122('0x4b')]=_[_0x4122('0x4c')](_0x3c1256[_0x4122('0x4b')]);_0x49875f[_0x4122('0x4d')]=_['intersection'](_0x49875f[_0x4122('0x42')],_0x49875f[_0x4122('0x4b')]);_0x52adcc[_0x4122('0x4f')]=_[_0x4122('0x4e')](_0x49875f[_0x4122('0x42')],qs['fields'](_0x3c1256[_0x4122('0x4b')][_0x4122('0x50')]));_0x52adcc['attributes']=_0x52adcc[_0x4122('0x4f')][_0x4122('0x51')]?_0x52adcc['attributes']:_0x49875f[_0x4122('0x42')];_0x52adcc[_0x4122('0x53')]=qs[_0x4122('0x54')](_0x3c1256['query'][_0x4122('0x54')]);_0x52adcc[_0x4122('0x57')]=qs[_0x4122('0x4d')](_['pick'](_0x3c1256[_0x4122('0x4b')],_0x49875f[_0x4122('0x4d')]));if(_0x3c1256[_0x4122('0x4b')][_0x4122('0x56')]){_0x52adcc['where']=_[_0x4122('0x58')](_0x52adcc[_0x4122('0x57')],{'$or':_['map'](_0x52adcc[_0x4122('0x4f')],function(_0x564a9b){var _0x2c2522={};_0x2c2522[_0x564a9b]={'$like':'%'+_0x3c1256[_0x4122('0x4b')][_0x4122('0x56')]+'%'};return _0x2c2522;})});}_0x52adcc=_[_0x4122('0x58')]({},_0x52adcc,_0x3c1256[_0x4122('0x5a')]);return _0x59cf79[_0x4122('0x10b')](_0x52adcc);}})[_0x4122('0x15')](function(_0x26fed7){if(_0x26fed7){_0x15826a=_0x26fed7['length'];if(!_0x3c1256[_0x4122('0x4b')][_0x4122('0x52')](_0x4122('0x72'))){_0x52adcc[_0x4122('0x24')]=qs[_0x4122('0x24')](_0x3c1256[_0x4122('0x4b')][_0x4122('0x24')]);_0x52adcc[_0x4122('0x23')]=qs['offset'](_0x3c1256[_0x4122('0x4b')][_0x4122('0x23')]);}return _0x59cf79[_0x4122('0x10b')](_0x52adcc);}})[_0x4122('0x15')](function(_0x1a9d51){if(_0x1a9d51){return _0x1a9d51?{'count':_0x15826a,'rows':_0x1a9d51}:null;}})[_0x4122('0x15')](respondWithResult(_0x1b8840,null))[_0x4122('0x20')](handleError(_0x1b8840,null));};exports[_0x4122('0x128')]=function(_0xbd985d,_0x311464){var _0x1d4714=_0xbd985d['query']['online']==='false'?_0x4122('0x129'):'onlineForm';return db['ChatWebsite'][_0x4122('0x65')]({'attributes':['id',_0x1d4714],'where':{'id':_0xbd985d[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x311464,null))[_0x4122('0x15')](function(_0x1f01a3){if(_0x1f01a3){var _0x4ecbf5=_0x1f01a3[_0x1d4714];var _0x19f6c2=_0x4ecbf5&&_0x4ecbf5[_0x4122('0x12a')]?_0x4ecbf5['items']:[];_0x311464[_0x4122('0xd7')]({'fromKey':_[_0x4122('0x8f')](_0x4ecbf5['fromKey'])?undefined:_0x4ecbf5[_0x4122('0x12b')],'count':_0x19f6c2[_0x4122('0x51')],'rows':_0x19f6c2});}})[_0x4122('0x20')](handleError(_0x311464,null));};exports[_0x4122('0x12c')]=function(_0x19214c,_0x46f8a2){var _0x3fc21c={'raw':![],'where':{}};var _0x4f2c96={};var _0x32b626={'count':0x0,'rows':[]};return db[_0x4122('0x47')][_0x4122('0x70')]({'where':{'id':_0x19214c[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x46f8a2,null))['then'](function(_0x4c6cca){if(_0x4c6cca){_0x4f2c96[_0x4122('0x42')]=_[_0x4122('0x4c')](db[_0x4122('0xe3')][_0x4122('0x5f')]);_0x4f2c96[_0x4122('0x4b')]=_[_0x4122('0x4c')](_0x19214c[_0x4122('0x4b')]);_0x4f2c96[_0x4122('0x4d')]=_[_0x4122('0x4e')](_0x4f2c96[_0x4122('0x42')],_0x4f2c96['query']);_0x3fc21c['attributes']=_[_0x4122('0x4e')](_0x4f2c96[_0x4122('0x42')],qs[_0x4122('0x50')](_0x19214c['query']['fields']));_0x3fc21c[_0x4122('0x4f')]=_0x3fc21c[_0x4122('0x4f')][_0x4122('0x51')]?_0x3fc21c[_0x4122('0x4f')]:_0x4f2c96['model'];if(!_0x19214c[_0x4122('0x4b')][_0x4122('0x52')](_0x4122('0x72'))){_0x3fc21c[_0x4122('0x24')]=qs[_0x4122('0x24')](_0x19214c[_0x4122('0x4b')]['limit']);_0x3fc21c['offset']=qs[_0x4122('0x23')](_0x19214c[_0x4122('0x4b')][_0x4122('0x23')]);}_0x3fc21c[_0x4122('0x53')]=qs[_0x4122('0x54')](_0x19214c[_0x4122('0x4b')][_0x4122('0x54')]);_0x3fc21c['where']=qs[_0x4122('0x4d')](_[_0x4122('0x55')](_0x19214c[_0x4122('0x4b')],_0x4f2c96['filters']));_0x3fc21c[_0x4122('0x57')][_0x4122('0x6e')]=_0x4c6cca['id'];if(_0x19214c[_0x4122('0x4b')]['filter']){_0x3fc21c[_0x4122('0x57')]=_[_0x4122('0x58')](_0x3fc21c[_0x4122('0x57')],{'$or':_[_0x4122('0x4a')](_0x3fc21c[_0x4122('0x4f')],function(_0x27441d){var _0x2d8d35={};_0x2d8d35[_0x27441d]={'$like':'%'+_0x19214c[_0x4122('0x4b')]['filter']+'%'};return _0x2d8d35;})});}_0x3fc21c=_[_0x4122('0x58')]({},_0x3fc21c,_0x19214c[_0x4122('0x5a')]);return db['ChatOfflineMessage'][_0x4122('0x25')]({'where':_0x3fc21c[_0x4122('0x57')]})[_0x4122('0x15')](function(_0xd7fdde){_0x32b626[_0x4122('0x25')]=_0xd7fdde;if(_0x19214c[_0x4122('0x4b')]['includeAll']){_0x3fc21c[_0x4122('0x5b')]=[{'all':!![]}];}else{_0x3fc21c[_0x4122('0x5b')]=[{'model':db[_0x4122('0xa0')],'as':_0x4122('0x12d'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0x4122('0xe3')]['findAll'](_0x3fc21c);})[_0x4122('0x15')](function(_0x1c23e8){_0x32b626[_0x4122('0x79')]=_0x1c23e8;return _0x32b626;});}})[_0x4122('0x15')](respondWithFilteredResult(_0x46f8a2,_0x3fc21c))[_0x4122('0x20')](handleError(_0x46f8a2,null));};exports[_0x4122('0x12e')]=function(_0x281bd1,_0x5e55e2){return db[_0x4122('0x47')][_0x4122('0x65')]({'where':{'id':_0x281bd1[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x5e55e2,null))[_0x4122('0x15')](function(_0xa2300c){if(_0xa2300c){return _0xa2300c[_0x4122('0x12e')](_0x281bd1['body'][_0x4122('0x75')],_[_0x4122('0x102')](_0x281bd1[_0x4122('0x6d')],['ids','id'])||{})[_0x4122('0xdd')](function(_0x49b039){for(var _0x107443=0x0;_0x107443<_0x281bd1['body'][_0x4122('0x75')][_0x4122('0x51')];_0x107443+=0x1){socket[_0x4122('0x12f')](_0x4122('0x130'),{'UserId':Number(_0x281bd1[_0x4122('0x6d')]['ids'][_0x107443]),'ChatWebsiteId':Number(_0x281bd1[_0x4122('0x5e')]['id'])});}return _0x49b039;});}})[_0x4122('0x15')](respondWithResult(_0x5e55e2,null))[_0x4122('0x20')](handleError(_0x5e55e2,null));};exports[_0x4122('0x131')]=function(_0x4485b4,_0x219331){return db['ChatWebsite']['find']({'where':{'id':_0x4485b4[_0x4122('0x5e')]['id']}})['then'](handleEntityNotFound(_0x219331,null))[_0x4122('0x15')](function(_0x437970){if(_0x437970){return _0x437970[_0x4122('0x131')](_0x4485b4[_0x4122('0x4b')][_0x4122('0x75')])[_0x4122('0x15')](function(){if(_[_0x4122('0x132')](_0x4485b4[_0x4122('0x4b')][_0x4122('0x75')])){for(var _0x326c20=0x0;_0x326c20<_0x4485b4[_0x4122('0x4b')][_0x4122('0x75')]['length'];_0x326c20+=0x1){socket[_0x4122('0x12f')](_0x4122('0x133'),{'UserId':Number(_0x4485b4[_0x4122('0x4b')][_0x4122('0x75')][_0x326c20]),'ChatWebsiteId':Number(_0x4485b4[_0x4122('0x5e')]['id'])});}}else{socket['emit'](_0x4122('0x133'),{'UserId':Number(_0x4485b4[_0x4122('0x4b')][_0x4122('0x75')]),'ChatWebsiteId':Number(_0x4485b4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x219331,null))[_0x4122('0x20')](handleError(_0x219331,null));};exports[_0x4122('0x134')]=function(_0x13fad9,_0x1d666e){var _0x58fe14={};var _0x1eed2e={};var _0x29b38e;var _0x33225f;return db[_0x4122('0x47')][_0x4122('0x70')]({'where':{'id':_0x13fad9[_0x4122('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1d666e,null))[_0x4122('0x15')](function(_0x3c3bc6){if(_0x3c3bc6){_0x29b38e=_0x3c3bc6;_0x1eed2e[_0x4122('0x42')]=_[_0x4122('0x4c')](db[_0x4122('0xc3')][_0x4122('0x5f')]);_0x1eed2e[_0x4122('0x4b')]=_['keys'](_0x13fad9[_0x4122('0x4b')]);_0x1eed2e[_0x4122('0x4d')]=_[_0x4122('0x4e')](_0x1eed2e[_0x4122('0x42')],_0x1eed2e[_0x4122('0x4b')]);_0x58fe14[_0x4122('0x4f')]=_['intersection'](_0x1eed2e[_0x4122('0x42')],qs[_0x4122('0x50')](_0x13fad9[_0x4122('0x4b')][_0x4122('0x50')]));_0x58fe14[_0x4122('0x4f')]=_0x58fe14[_0x4122('0x4f')][_0x4122('0x51')]?_0x58fe14['attributes']:_0x1eed2e[_0x4122('0x42')];_0x58fe14[_0x4122('0x53')]=qs[_0x4122('0x54')](_0x13fad9['query'][_0x4122('0x54')]);_0x58fe14['where']=qs[_0x4122('0x4d')](_[_0x4122('0x55')](_0x13fad9[_0x4122('0x4b')],_0x1eed2e[_0x4122('0x4d')]));if(_0x13fad9[_0x4122('0x4b')][_0x4122('0x56')]){_0x58fe14[_0x4122('0x57')]=_['merge'](_0x58fe14[_0x4122('0x57')],{'$or':_[_0x4122('0x4a')](_0x58fe14['attributes'],function(_0x1688eb){var _0x2d6c25={};_0x2d6c25[_0x1688eb]={'$like':'%'+_0x13fad9[_0x4122('0x4b')][_0x4122('0x56')]+'%'};return _0x2d6c25;})});}_0x58fe14=_[_0x4122('0x58')]({},_0x58fe14,_0x13fad9['options']);return _0x29b38e[_0x4122('0x134')](_0x58fe14);}})[_0x4122('0x15')](function(_0x2f8e72){if(_0x2f8e72){_0x33225f=_0x2f8e72[_0x4122('0x51')];if(!_0x13fad9[_0x4122('0x4b')][_0x4122('0x52')](_0x4122('0x72'))){_0x58fe14['limit']=qs[_0x4122('0x24')](_0x13fad9[_0x4122('0x4b')][_0x4122('0x24')]);_0x58fe14[_0x4122('0x23')]=qs[_0x4122('0x23')](_0x13fad9[_0x4122('0x4b')][_0x4122('0x23')]);}return _0x29b38e[_0x4122('0x134')](_0x58fe14);}})['then'](function(_0x30e0b0){if(_0x30e0b0){return _0x30e0b0?{'count':_0x33225f,'rows':_0x30e0b0}:null;}})[_0x4122('0x15')](respondWithResult(_0x1d666e,null))['catch'](handleError(_0x1d666e,null));};
\ No newline at end of file
+var _0xe010=['bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','SendMail','sendMail','\x22%s\x22\x20<%s>','forwardOfflineAddress','MailAccountId','subjectOffline','toPairsIn','email','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','fullname','internal','Tags','color','tag','getSnippet','virtual','License','chatLicenseExceeded','ifTime','server/files/chat/iframe.ejs','URL','address','origin','3.8.1','remote','x-real-ip','replace','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','transaction','sequelize','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','getFields','onlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','url','../../config/logger','api','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','info','ChatWebsite,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','update','then','destroy','ChatWebsites','stack','name','send','user-agent-parser','setUA','getResult','customerIp','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','unknown','format','%s\x20%s','device','model','vendor','%s\x20%s\x20%s','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','show','params','Pause','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','CmContact','No\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','includes','List','Contacts','DESC','ChatApplication','Applications','Interval','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','timezone','list','priority','asc','account','contact','headers','threadId','ChatInteraction','closed','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','autoclose','applications','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','files','Sequelize','no\x20available\x20attributes','difference','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','Attachment'];(function(_0x4e4984,_0x10d93e){var _0x1a807e=function(_0x4381cc){while(--_0x4381cc){_0x4e4984['push'](_0x4e4984['shift']());}};_0x1a807e(++_0x10d93e);}(_0xe010,0x17e));var _0x0e01=function(_0x3bd928,_0x441fec){_0x3bd928=_0x3bd928-0x0;var _0x4cc090=_0xe010[_0x3bd928];return _0x4cc090;};'use strict';var Mustache=require(_0x0e01('0x0'));var util=require('util');var path=require(_0x0e01('0x1'));var ejs=require(_0x0e01('0x2'));var fs=require('fs');var fs_extra=require(_0x0e01('0x3'));var _=require(_0x0e01('0x4'));var querystring=require(_0x0e01('0x5'));var htmlToText=require(_0x0e01('0x6'));var Redis=require(_0x0e01('0x7'));var jayson=require(_0x0e01('0x8'));var url=require(_0x0e01('0x9'));var qs=require('../../components/parsers/qs');var logger=require(_0x0e01('0xa'))(_0x0e01('0xb'));var config=require('../../config/environment');var APIBadRequestError=require(_0x0e01('0xc'))[_0x0e01('0xd')];var APINotFoundError=require('../../errors/api')[_0x0e01('0xe')];var APIOutOfIntervalError=require(_0x0e01('0xc'))[_0x0e01('0xf')];var APIHandleError=require('../../errors/api')[_0x0e01('0x10')];var APIConflictError=require(_0x0e01('0xc'))['APIConflictError'];var db=require(_0x0e01('0x11'))['db'];config[_0x0e01('0x12')]=_['defaults'](config['redis'],{'host':_0x0e01('0x13'),'port':0x18eb});var socket=require(_0x0e01('0x14'))(new Redis(config[_0x0e01('0x12')]));require(_0x0e01('0x15'))[_0x0e01('0x16')](socket);var client=jayson[_0x0e01('0x17')][_0x0e01('0x18')]({'port':0x232c});var client9002=jayson[_0x0e01('0x17')][_0x0e01('0x18')]({'port':0x232a});var client9003=jayson[_0x0e01('0x17')][_0x0e01('0x18')]({'port':0x232b});var client9001=jayson[_0x0e01('0x17')][_0x0e01('0x18')]({'port':0x2329});function respondWithRpcPromise(_0x230fbe,_0x147262,_0x440452,_0x286870){return new Promise(function(_0x51d333,_0xc9b6ad){var _0x553df6=_0x286870||client;return _0x553df6[_0x0e01('0x19')](_0x230fbe,_0x440452)['then'](function(_0x50fa55){logger[_0x0e01('0x1a')](_0x0e01('0x1b'),_0x147262,'request\x20sent');logger[_0x0e01('0x1c')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x147262,'request\x20sent',JSON[_0x0e01('0x1d')](_0x50fa55));if(_0x50fa55[_0x0e01('0x1e')]){if(_0x50fa55[_0x0e01('0x1e')]['code']===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x147262,_0x50fa55[_0x0e01('0x1e')]['message']);return _0xc9b6ad(_0x50fa55['error'][_0x0e01('0x1f')]);}logger[_0x0e01('0x1e')](_0x0e01('0x1b'),_0x147262,_0x50fa55[_0x0e01('0x1e')]['message']);return _0x51d333(_0x50fa55[_0x0e01('0x1e')][_0x0e01('0x1f')]);}else{logger[_0x0e01('0x1a')](_0x0e01('0x1b'),_0x147262,_0x0e01('0x20'));_0x51d333(_0x50fa55[_0x0e01('0x21')][_0x0e01('0x1f')]);}})[_0x0e01('0x22')](function(_0x3e7d79){logger[_0x0e01('0x1e')](_0x0e01('0x1b'),_0x147262,_0x3e7d79);_0xc9b6ad(_0x3e7d79);});});}function respondWithStatusCode(_0x36e44e,_0x202dae){_0x202dae=_0x202dae||0xcc;return function(_0x17520a){if(_0x17520a){return _0x36e44e[_0x0e01('0x23')](_0x202dae);}return _0x36e44e['status'](_0x202dae)[_0x0e01('0x24')]();};}function respondWithResult(_0x10a318,_0x34a9b1){_0x34a9b1=_0x34a9b1||0xc8;return function(_0x58edb4){if(_0x58edb4){return _0x10a318['status'](_0x34a9b1)[_0x0e01('0x25')](_0x58edb4);}};}function respondWithFilteredResult(_0x850d92,_0x3f9a2a){return function(_0x4c2c83){if(_0x4c2c83){var _0x58ba68=typeof _0x3f9a2a['offset']===_0x0e01('0x26')&&typeof _0x3f9a2a[_0x0e01('0x27')]===_0x0e01('0x26');var _0xae2ef1=_0x4c2c83[_0x0e01('0x28')];var _0x42a7c7=_0x58ba68?0x0:_0x3f9a2a['offset'];var _0x4c8779=_0x58ba68?_0x4c2c83[_0x0e01('0x28')]:_0x3f9a2a[_0x0e01('0x29')]+_0x3f9a2a['limit'];var _0x312991;if(_0x4c8779>=_0xae2ef1){_0x4c8779=_0xae2ef1;_0x312991=0xc8;}else{_0x312991=0xce;}_0x850d92[_0x0e01('0x2a')](_0x312991);return _0x850d92[_0x0e01('0x2b')](_0x0e01('0x2c'),_0x42a7c7+'-'+_0x4c8779+'/'+_0xae2ef1)[_0x0e01('0x25')](_0x4c2c83);}return null;};}function saveUpdates(_0x12e501){return function(_0x14e144){if(_0x14e144){return _0x14e144[_0x0e01('0x2d')](_0x12e501)[_0x0e01('0x2e')](function(_0x4bb437){return _0x4bb437;});}return null;};}function removeEntity(_0x4e5378){return function(_0x19e563){if(_0x19e563){return _0x19e563[_0x0e01('0x2f')]()['then'](function(){var _0x38b4b3=_0x19e563['get']({'plain':!![]});var _0x5ab4ae=_0x0e01('0x30');return db['UserProfileResource'][_0x0e01('0x2f')]({'where':{'type':_0x5ab4ae,'resourceId':_0x38b4b3['id']}})[_0x0e01('0x2e')](function(){return _0x19e563;});})['then'](function(){_0x4e5378['status'](0xcc)[_0x0e01('0x24')]();});}};}function handleEntityNotFound(_0x57999e){return function(_0x40187c){if(!_0x40187c){_0x57999e[_0x0e01('0x23')](0x194);}return _0x40187c;};}function handleError(_0x9940d6,_0x50fc43){_0x50fc43=_0x50fc43||0x1f4;return function(_0x373f3a){logger[_0x0e01('0x1e')](_0x373f3a[_0x0e01('0x31')]);if(_0x373f3a[_0x0e01('0x32')]){delete _0x373f3a[_0x0e01('0x32')];}_0x9940d6['status'](_0x50fc43)[_0x0e01('0x33')](_0x373f3a);};}function createInteractionObject(_0x51a8a6,_0x57e59e,_0x345e0a,_0x4dbe21){var _0x486d7c=require(_0x0e01('0x34'));var _0x3b8ffc=new _0x486d7c();var _0x26cced=_0x3b8ffc[_0x0e01('0x35')](_0x345e0a['user-agent'])[_0x0e01('0x36')]();var _0x318ccf=_0x57e59e[_0x0e01('0x37')];if(_0x345e0a['cf-connecting-ip']){_0x318ccf=_0x345e0a['cf-connecting-ip'];}else if(_0x345e0a[_0x0e01('0x38')]){_0x318ccf=_['first'](_0x345e0a[_0x0e01('0x38')][_0x0e01('0x39')](','));}return{'ContactId':_0x4dbe21['id'],'ChatWebsiteId':_0x51a8a6,'from':(_0x4dbe21[_0x0e01('0x3a')]||'')+'\x20'+(_0x4dbe21[_0x0e01('0x3b')]||''),'customerIp':_0x318ccf,'customerPort':_0x345e0a[_0x0e01('0x3c')]?_0x345e0a['x-real-port']:null,'referer':_0x57e59e[_0x0e01('0x3d')],'browserName':_0x26cced[_0x0e01('0x3e')][_0x0e01('0x32')]&&_0x26cced[_0x0e01('0x3e')]['version']?util['format']('%s\x20%s',_0x26cced[_0x0e01('0x3e')][_0x0e01('0x32')],_0x26cced['browser'][_0x0e01('0x3f')]):_0x0e01('0x40'),'browserVersion':_0x26cced[_0x0e01('0x3e')][_0x0e01('0x3f')]||_0x0e01('0x40'),'osName':util[_0x0e01('0x41')](_0x0e01('0x42'),_0x26cced['os'][_0x0e01('0x32')],_0x26cced['os'][_0x0e01('0x3f')]),'osVersion':_0x26cced['os'][_0x0e01('0x3f')],'deviceModel':_0x26cced[_0x0e01('0x43')][_0x0e01('0x44')]&&_0x26cced[_0x0e01('0x43')][_0x0e01('0x45')]?util[_0x0e01('0x41')](_0x0e01('0x46'),_0x26cced[_0x0e01('0x43')][_0x0e01('0x44')],_0x26cced['device']['vendor'],_0x26cced[_0x0e01('0x43')]['type']):null,'deviceVendor':_0x26cced[_0x0e01('0x43')][_0x0e01('0x45')],'deviceType':_0x26cced['device']['type'],'formData':JSON[_0x0e01('0x1d')](_0x57e59e)};}exports[_0x0e01('0x47')]=function(_0x21691b,_0xe85206){var _0x3ab9c2={'include':[{'model':db['Pause'],'as':_0x0e01('0x48')}]},_0x2d47ee={},_0x4c81b3={'count':0x0,'rows':[]};var _0x3626ea=_[_0x0e01('0x49')](db[_0x0e01('0x4a')][_0x0e01('0x4b')],function(_0x479f5b){return{'name':_0x479f5b[_0x0e01('0x4c')],'type':_0x479f5b[_0x0e01('0x4d')][_0x0e01('0x4e')]};});_0x2d47ee[_0x0e01('0x44')]=_[_0x0e01('0x49')](_0x3626ea,_0x0e01('0x32'));_0x2d47ee[_0x0e01('0x4f')]=_[_0x0e01('0x50')](_0x21691b['query']);_0x2d47ee[_0x0e01('0x51')]=_[_0x0e01('0x52')](_0x2d47ee[_0x0e01('0x44')],_0x2d47ee[_0x0e01('0x4f')]);_0x3ab9c2[_0x0e01('0x53')]=_[_0x0e01('0x52')](_0x2d47ee['model'],qs[_0x0e01('0x54')](_0x21691b['query'][_0x0e01('0x54')]));_0x3ab9c2[_0x0e01('0x53')]=_0x3ab9c2['attributes'][_0x0e01('0x55')]?_0x3ab9c2[_0x0e01('0x53')]:_0x2d47ee['model'];if(!_0x21691b[_0x0e01('0x4f')][_0x0e01('0x56')](_0x0e01('0x57'))){_0x3ab9c2['limit']=qs[_0x0e01('0x27')](_0x21691b[_0x0e01('0x4f')][_0x0e01('0x27')]);_0x3ab9c2[_0x0e01('0x29')]=qs[_0x0e01('0x29')](_0x21691b[_0x0e01('0x4f')][_0x0e01('0x29')]);}_0x3ab9c2[_0x0e01('0x58')]=qs[_0x0e01('0x59')](_0x21691b[_0x0e01('0x4f')][_0x0e01('0x59')]);_0x3ab9c2[_0x0e01('0x5a')]=qs['filters'](_[_0x0e01('0x5b')](_0x21691b[_0x0e01('0x4f')],_0x2d47ee['filters']),_0x3626ea);if(_0x21691b['query']['filter']){_0x3ab9c2[_0x0e01('0x5a')]=_[_0x0e01('0x5c')](_0x3ab9c2[_0x0e01('0x5a')],{'$or':_[_0x0e01('0x49')](_0x3626ea,function(_0x5bf1ec){if(_0x5bf1ec['type']!==_0x0e01('0x5d')){var _0x2cb385={};_0x2cb385[_0x5bf1ec[_0x0e01('0x32')]]={'$like':'%'+_0x21691b[_0x0e01('0x4f')][_0x0e01('0x5e')]+'%'};return _0x2cb385;}})});}_0x3ab9c2=_[_0x0e01('0x5c')]({},_0x3ab9c2,_0x21691b['options']);var _0x273927={'where':_0x3ab9c2[_0x0e01('0x5a')]};return db[_0x0e01('0x4a')]['count'](_0x273927)[_0x0e01('0x2e')](function(_0x559377){_0x4c81b3[_0x0e01('0x28')]=_0x559377;if(_0x21691b['query'][_0x0e01('0x5f')]){_0x3ab9c2['include']=[{'all':!![]}];}return db[_0x0e01('0x4a')][_0x0e01('0x60')](_0x3ab9c2);})[_0x0e01('0x2e')](function(_0x36ef94){_0x4c81b3[_0x0e01('0x61')]=_0x36ef94;return _0x4c81b3;})['then'](respondWithFilteredResult(_0xe85206,_0x3ab9c2))['catch'](handleError(_0xe85206,null));};exports[_0x0e01('0x62')]=function(_0x5338b1,_0x94d3d1){var _0x4672ec={'raw':![],'where':{'id':_0x5338b1[_0x0e01('0x63')]['id']},'include':[{'model':db[_0x0e01('0x64')],'as':_0x0e01('0x48')}]},_0x19bda3={};_0x19bda3['model']=_[_0x0e01('0x50')](db['ChatWebsite'][_0x0e01('0x4b')]);_0x19bda3[_0x0e01('0x4f')]=_[_0x0e01('0x50')](_0x5338b1[_0x0e01('0x4f')]);_0x19bda3[_0x0e01('0x51')]=_['intersection'](_0x19bda3[_0x0e01('0x44')],_0x19bda3[_0x0e01('0x4f')]);_0x4672ec[_0x0e01('0x53')]=_['intersection'](_0x19bda3[_0x0e01('0x44')],qs[_0x0e01('0x54')](_0x5338b1[_0x0e01('0x4f')][_0x0e01('0x54')]));_0x4672ec[_0x0e01('0x53')]=_0x4672ec[_0x0e01('0x53')][_0x0e01('0x55')]?_0x4672ec[_0x0e01('0x53')]:_0x19bda3[_0x0e01('0x44')];if(_0x5338b1[_0x0e01('0x4f')][_0x0e01('0x5f')]){_0x4672ec[_0x0e01('0x65')]=[{'all':!![]}];}_0x4672ec=_['merge']({},_0x4672ec,_0x5338b1[_0x0e01('0x66')]);return db[_0x0e01('0x4a')][_0x0e01('0x67')](_0x4672ec)[_0x0e01('0x2e')](handleEntityNotFound(_0x94d3d1,null))[_0x0e01('0x2e')](respondWithResult(_0x94d3d1,null))[_0x0e01('0x22')](handleError(_0x94d3d1,null));};exports[_0x0e01('0x68')]=function(_0x56e062,_0x58c63c){return db[_0x0e01('0x4a')][_0x0e01('0x68')](_0x56e062[_0x0e01('0x69')],{})['then'](function(_0x3fe595){var _0x4a7f15=_0x56e062[_0x0e01('0x6a')][_0x0e01('0x6b')]({'plain':!![]});if(!_0x4a7f15)throw new Error(_0x0e01('0x6c'));if(_0x4a7f15[_0x0e01('0x6d')]===_0x0e01('0x6a')){var _0x2d7419=_0x3fe595[_0x0e01('0x6b')]({'plain':!![]});var _0x1201ab=_0x0e01('0x30');return db[_0x0e01('0x6e')][_0x0e01('0x67')]({'where':{'name':_0x1201ab,'userProfileId':_0x4a7f15[_0x0e01('0x6f')]},'raw':!![]})[_0x0e01('0x2e')](function(_0x5df421){if(_0x5df421&&_0x5df421[_0x0e01('0x70')]===0x0){return db['UserProfileResource'][_0x0e01('0x68')]({'name':_0x2d7419['name'],'resourceId':_0x2d7419['id'],'type':_0x5df421[_0x0e01('0x32')],'sectionId':_0x5df421['id']},{})['then'](function(){return _0x3fe595;});}else{return _0x3fe595;}})[_0x0e01('0x22')](function(_0x34ac10){logger[_0x0e01('0x1e')](_0x0e01('0x71'),_0x34ac10);throw _0x34ac10;});}return _0x3fe595;})[_0x0e01('0x2e')](respondWithResult(_0x58c63c,0xc9))['catch'](handleError(_0x58c63c,null));};exports[_0x0e01('0x2d')]=function(_0x25c567,_0xe5f731){if(_0x25c567[_0x0e01('0x69')]['id']){delete _0x25c567[_0x0e01('0x69')]['id'];}return db[_0x0e01('0x4a')][_0x0e01('0x67')]({'where':{'id':_0x25c567[_0x0e01('0x63')]['id']},'include':[{'model':db[_0x0e01('0x64')],'as':_0x0e01('0x48')}]})['then'](handleEntityNotFound(_0xe5f731,null))['then'](saveUpdates(_0x25c567['body'],null))[_0x0e01('0x2e')](respondWithResult(_0xe5f731,null))['catch'](handleError(_0xe5f731,null));};exports['destroy']=function(_0x438b41,_0x5cbd2f){return db['ChatWebsite'][_0x0e01('0x67')]({'where':{'id':_0x438b41['params']['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0x5cbd2f,null))['then'](removeEntity(_0x5cbd2f,null))[_0x0e01('0x22')](handleError(_0x5cbd2f,null));};exports[_0x0e01('0x72')]=function(_0x385b6e,_0x1e6d14){return db[_0x0e01('0x4a')][_0x0e01('0x72')]()[_0x0e01('0x2e')](respondWithResult(_0x1e6d14,null))['catch'](handleError(_0x1e6d14,null));};exports[_0x0e01('0x73')]=function(_0x231a85,_0x1cae16){if(_0x231a85[_0x0e01('0x69')]['id']){delete _0x231a85[_0x0e01('0x69')]['id'];}return db[_0x0e01('0x4a')][_0x0e01('0x67')]({'where':{'id':_0x231a85[_0x0e01('0x63')]['id']}})['then'](handleEntityNotFound(_0x1cae16,null))['then'](function(_0x46b488){if(_0x46b488){_0x231a85['body'][_0x0e01('0x74')]=_0x46b488['id'];return db[_0x0e01('0x75')][_0x0e01('0x68')](_0x231a85['body']);}})['then'](respondWithResult(_0x1cae16,null))[_0x0e01('0x22')](handleError(_0x1cae16,null));};exports[_0x0e01('0x76')]=function(_0xf0ebe7,_0x292237){var _0x1d5c5c={'raw':![],'where':{}};var _0x533d8e={};var _0x59d331={'count':0x0,'rows':[]};return db[_0x0e01('0x4a')][_0x0e01('0x77')]({'where':{'id':_0xf0ebe7[_0x0e01('0x63')]['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0x292237,null))['then'](function(_0x5b28c3){if(_0x5b28c3){_0x533d8e[_0x0e01('0x44')]=_['keys'](db['Disposition'][_0x0e01('0x4b')]);_0x533d8e[_0x0e01('0x4f')]=_[_0x0e01('0x50')](_0xf0ebe7[_0x0e01('0x4f')]);_0x533d8e[_0x0e01('0x51')]=_[_0x0e01('0x52')](_0x533d8e[_0x0e01('0x44')],_0x533d8e[_0x0e01('0x4f')]);_0x1d5c5c['attributes']=_[_0x0e01('0x52')](_0x533d8e[_0x0e01('0x44')],qs[_0x0e01('0x54')](_0xf0ebe7[_0x0e01('0x4f')][_0x0e01('0x54')]));_0x1d5c5c[_0x0e01('0x53')]=_0x1d5c5c[_0x0e01('0x53')][_0x0e01('0x55')]?_0x1d5c5c[_0x0e01('0x53')]:_0x533d8e[_0x0e01('0x44')];if(!_0xf0ebe7[_0x0e01('0x4f')][_0x0e01('0x56')]('nolimit')){_0x1d5c5c[_0x0e01('0x27')]=qs[_0x0e01('0x27')](_0xf0ebe7['query'][_0x0e01('0x27')]);_0x1d5c5c[_0x0e01('0x29')]=qs['offset'](_0xf0ebe7[_0x0e01('0x4f')][_0x0e01('0x29')]);}_0x1d5c5c[_0x0e01('0x58')]=qs['sort'](_0xf0ebe7[_0x0e01('0x4f')][_0x0e01('0x59')]);_0x1d5c5c[_0x0e01('0x5a')]=qs[_0x0e01('0x51')](_['pick'](_0xf0ebe7['query'],_0x533d8e[_0x0e01('0x51')]));_0x1d5c5c['where']['ChatWebsiteId']=_0x5b28c3['id'];if(_0xf0ebe7[_0x0e01('0x4f')]['filter']){_0x1d5c5c[_0x0e01('0x5a')]=_[_0x0e01('0x5c')](_0x1d5c5c[_0x0e01('0x5a')],{'$or':_['map'](_0x1d5c5c['attributes'],function(_0x2718a0){var _0xb587d9={};_0xb587d9[_0x2718a0]={'$like':'%'+_0xf0ebe7[_0x0e01('0x4f')]['filter']+'%'};return _0xb587d9;})});}_0x1d5c5c=_[_0x0e01('0x5c')]({},_0x1d5c5c,_0xf0ebe7['options']);return db['Disposition'][_0x0e01('0x28')]({'where':_0x1d5c5c[_0x0e01('0x5a')]})[_0x0e01('0x2e')](function(_0x3e3fda){_0x59d331[_0x0e01('0x28')]=_0x3e3fda;if(_0xf0ebe7['query'][_0x0e01('0x5f')]){_0x1d5c5c[_0x0e01('0x65')]=[{'all':!![]}];}return db[_0x0e01('0x75')][_0x0e01('0x60')](_0x1d5c5c);})[_0x0e01('0x2e')](function(_0x533e0a){_0x59d331[_0x0e01('0x61')]=_0x533e0a;return _0x59d331;});}})[_0x0e01('0x2e')](respondWithFilteredResult(_0x292237,_0x1d5c5c))[_0x0e01('0x22')](handleError(_0x292237,null));};exports[_0x0e01('0x78')]=function(_0x3f2709,_0x5dfd31){return db['ChatWebsite'][_0x0e01('0x67')]({'where':{'id':_0x3f2709[_0x0e01('0x63')]['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0x5dfd31,null))[_0x0e01('0x2e')](function(_0x22797a){if(_0x22797a){return _0x22797a[_0x0e01('0x78')](_0x3f2709['query']['ids']);}})['then'](respondWithStatusCode(_0x5dfd31,null))[_0x0e01('0x22')](handleError(_0x5dfd31,null));};exports[_0x0e01('0x79')]=function(_0x4a3008,_0x3a3755){if(_0x4a3008[_0x0e01('0x69')]['id']){delete _0x4a3008[_0x0e01('0x69')]['id'];}return db[_0x0e01('0x4a')][_0x0e01('0x67')]({'where':{'id':_0x4a3008[_0x0e01('0x63')]['id']}})['then'](handleEntityNotFound(_0x3a3755,null))[_0x0e01('0x2e')](function(_0x283f9a){if(_0x283f9a){_0x4a3008[_0x0e01('0x69')]['ChatWebsiteId']=_0x283f9a['id'];return db[_0x0e01('0x7a')][_0x0e01('0x68')](_0x4a3008[_0x0e01('0x69')]);}})[_0x0e01('0x2e')](respondWithResult(_0x3a3755,null))['catch'](handleError(_0x3a3755,null));};exports[_0x0e01('0x7b')]=function(_0x500e51,_0x5b52cc){var _0x3e3ee9={'raw':![],'where':{}};var _0x2ef18f={};var _0x57df16={'count':0x0,'rows':[]};return db[_0x0e01('0x4a')][_0x0e01('0x77')]({'where':{'id':_0x500e51[_0x0e01('0x63')]['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0x5b52cc,null))['then'](function(_0x23bddc){if(_0x23bddc){_0x2ef18f['model']=_[_0x0e01('0x50')](db['CannedAnswer'][_0x0e01('0x4b')]);_0x2ef18f['query']=_['keys'](_0x500e51[_0x0e01('0x4f')]);_0x2ef18f[_0x0e01('0x51')]=_['intersection'](_0x2ef18f[_0x0e01('0x44')],_0x2ef18f[_0x0e01('0x4f')]);_0x3e3ee9[_0x0e01('0x53')]=_['intersection'](_0x2ef18f[_0x0e01('0x44')],qs['fields'](_0x500e51[_0x0e01('0x4f')][_0x0e01('0x54')]));_0x3e3ee9[_0x0e01('0x53')]=_0x3e3ee9[_0x0e01('0x53')][_0x0e01('0x55')]?_0x3e3ee9[_0x0e01('0x53')]:_0x2ef18f[_0x0e01('0x44')];if(!_0x500e51[_0x0e01('0x4f')][_0x0e01('0x56')](_0x0e01('0x57'))){_0x3e3ee9[_0x0e01('0x27')]=qs[_0x0e01('0x27')](_0x500e51[_0x0e01('0x4f')][_0x0e01('0x27')]);_0x3e3ee9[_0x0e01('0x29')]=qs[_0x0e01('0x29')](_0x500e51['query'][_0x0e01('0x29')]);}_0x3e3ee9[_0x0e01('0x58')]=qs[_0x0e01('0x59')](_0x500e51[_0x0e01('0x4f')][_0x0e01('0x59')]);_0x3e3ee9[_0x0e01('0x5a')]=qs[_0x0e01('0x51')](_['pick'](_0x500e51[_0x0e01('0x4f')],_0x2ef18f['filters']));_0x3e3ee9[_0x0e01('0x5a')][_0x0e01('0x74')]=_0x23bddc['id'];if(_0x500e51[_0x0e01('0x4f')]['filter']){_0x3e3ee9['where']=_[_0x0e01('0x5c')](_0x3e3ee9[_0x0e01('0x5a')],{'$or':_[_0x0e01('0x49')](_0x3e3ee9[_0x0e01('0x53')],function(_0x33c11a){var _0x35a5c2={};_0x35a5c2[_0x33c11a]={'$like':'%'+_0x500e51[_0x0e01('0x4f')]['filter']+'%'};return _0x35a5c2;})});}_0x3e3ee9=_[_0x0e01('0x5c')]({},_0x3e3ee9,_0x500e51[_0x0e01('0x66')]);return db[_0x0e01('0x7a')][_0x0e01('0x28')]({'where':_0x3e3ee9[_0x0e01('0x5a')]})['then'](function(_0x595206){_0x57df16['count']=_0x595206;if(_0x500e51[_0x0e01('0x4f')][_0x0e01('0x5f')]){_0x3e3ee9[_0x0e01('0x65')]=[{'all':!![]}];}return db[_0x0e01('0x7a')][_0x0e01('0x60')](_0x3e3ee9);})[_0x0e01('0x2e')](function(_0x371d71){_0x57df16[_0x0e01('0x61')]=_0x371d71;return _0x57df16;});}})[_0x0e01('0x2e')](respondWithFilteredResult(_0x5b52cc,_0x3e3ee9))[_0x0e01('0x22')](handleError(_0x5b52cc,null));};exports['removeAnswers']=function(_0x4d2626,_0x355f0c){return db[_0x0e01('0x4a')]['find']({'where':{'id':_0x4d2626[_0x0e01('0x63')]['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0x355f0c,null))['then'](function(_0x5da911){if(_0x5da911){return _0x5da911[_0x0e01('0x7c')](_0x4d2626[_0x0e01('0x4f')][_0x0e01('0x7d')]);}})[_0x0e01('0x2e')](respondWithStatusCode(_0x355f0c,null))[_0x0e01('0x22')](handleError(_0x355f0c,null));};exports[_0x0e01('0x7e')]=function(_0x5ab31c,_0x22c43e){_0x5ab31c['body'][_0x0e01('0x7f')]=_0x5ab31c[_0x0e01('0x80')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x5ab31c[_0x0e01('0x63')]['id']}})['then'](handleEntityNotFound(_0x22c43e,null))['then'](saveUpdates(_0x5ab31c[_0x0e01('0x69')],null))['then'](respondWithResult(_0x22c43e,null))[_0x0e01('0x22')](handleError(_0x22c43e,null));};exports[_0x0e01('0x81')]=function(_0x4702a0,_0x1db996){_0x4702a0['body'][_0x0e01('0x82')]=_0x4702a0[_0x0e01('0x80')][_0x0e01('0x83')];return db['ChatWebsite'][_0x0e01('0x67')]({'where':{'id':_0x4702a0[_0x0e01('0x63')]['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0x1db996,null))[_0x0e01('0x2e')](saveUpdates(_0x4702a0[_0x0e01('0x69')],null))[_0x0e01('0x2e')](respondWithResult(_0x1db996,null))[_0x0e01('0x22')](handleError(_0x1db996,null));};exports[_0x0e01('0x84')]=function(_0x159329,_0x3a1493){_0x159329[_0x0e01('0x69')][_0x0e01('0x85')]=_0x159329[_0x0e01('0x80')][_0x0e01('0x83')];return db[_0x0e01('0x4a')][_0x0e01('0x67')]({'where':{'id':_0x159329['params']['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0x3a1493,null))[_0x0e01('0x2e')](saveUpdates(_0x159329[_0x0e01('0x69')],null))[_0x0e01('0x2e')](respondWithResult(_0x3a1493,null))[_0x0e01('0x22')](handleError(_0x3a1493,null));};exports[_0x0e01('0x86')]=function(_0x30911d,_0x1d64bf){_0x30911d[_0x0e01('0x69')][_0x0e01('0x87')]=_0x30911d['file'][_0x0e01('0x83')];return db[_0x0e01('0x4a')][_0x0e01('0x67')]({'where':{'id':_0x30911d[_0x0e01('0x63')]['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0x1d64bf,null))['then'](saveUpdates(_0x30911d['body'],null))[_0x0e01('0x2e')](respondWithResult(_0x1d64bf,null))[_0x0e01('0x22')](handleError(_0x1d64bf,null));};exports[_0x0e01('0x88')]=function(_0x2872fa,_0x511769){var _0x1513b9=path['join'](config[_0x0e01('0x89')],_0x0e01('0x8a'));var _0x300a22={'where':{'id':_0x2872fa[_0x0e01('0x63')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x300717=![];return require(_0x0e01('0x8b'))[_0x0e01('0x8c')]()[_0x0e01('0x2e')](function(_0x231da0){if(_0x231da0){_0x300717=_0x231da0[_0x0e01('0x8d')];}})['then'](function(){return db[_0x0e01('0x4a')]['find'](_0x300a22);})[_0x0e01('0x2e')](handleEntityNotFound(_0x511769,null))[_0x0e01('0x2e')](function(_0x11ec22){if(_0x11ec22){if(!_[_0x0e01('0x8e')](_0x11ec22['sitepic'])){if(fs[_0x0e01('0x8f')](path[_0x0e01('0x90')](config['root'],_0x0e01('0x91'),_0x11ec22[_0x0e01('0x7f')]))&&_0x300717){_0x1513b9=path[_0x0e01('0x90')](config[_0x0e01('0x89')],_0x0e01('0x91'),_0x11ec22[_0x0e01('0x7f')]);}}return _0x511769[_0x0e01('0x92')](_0x1513b9);}})[_0x0e01('0x22')](handleError(_0x511769,null));};exports[_0x0e01('0x93')]=function(_0x517c53,_0x3b5fef){var _0x4ca1bd=path[_0x0e01('0x90')](config[_0x0e01('0x89')],_0x0e01('0x94'));var _0x59c53d={'where':{'id':_0x517c53[_0x0e01('0x63')]['id']},'attributes':['id',_0x0e01('0x82')],'raw':!![]};return db[_0x0e01('0x4a')][_0x0e01('0x67')](_0x59c53d)[_0x0e01('0x2e')](handleEntityNotFound(_0x3b5fef,null))[_0x0e01('0x2e')](function(_0x15b433){if(_0x15b433){if(!_[_0x0e01('0x8e')](_0x15b433[_0x0e01('0x82')])){if(fs[_0x0e01('0x8f')](path[_0x0e01('0x90')](config[_0x0e01('0x89')],_0x0e01('0x95'),_0x15b433[_0x0e01('0x82')]))){_0x4ca1bd=path[_0x0e01('0x90')](config[_0x0e01('0x89')],_0x0e01('0x95'),_0x15b433['agentAvatar']);}}return _0x3b5fef[_0x0e01('0x92')](_0x4ca1bd);}})[_0x0e01('0x22')](handleError(_0x3b5fef,null));};exports[_0x0e01('0x96')]=function(_0x388c90,_0x53ac47){var _0x4b55ea=path['join'](config[_0x0e01('0x89')],_0x0e01('0x97'));var _0x532cef={'where':{'id':_0x388c90[_0x0e01('0x63')]['id']},'attributes':['id',_0x0e01('0x85'),_0x0e01('0x98')],'raw':!![]};return db['ChatWebsite'][_0x0e01('0x67')](_0x532cef)[_0x0e01('0x2e')](handleEntityNotFound(_0x53ac47,null))[_0x0e01('0x2e')](function(_0x63d11){if(_0x63d11){if(!_[_0x0e01('0x8e')](_0x63d11['customerAvatar'])){if(fs[_0x0e01('0x8f')](path[_0x0e01('0x90')](config[_0x0e01('0x89')],_0x0e01('0x95'),_0x63d11[_0x0e01('0x85')]))&&_0x63d11[_0x0e01('0x98')]){_0x4b55ea=path[_0x0e01('0x90')](config[_0x0e01('0x89')],'server/files/images/avatars/',_0x63d11['customerAvatar']);}}return _0x53ac47[_0x0e01('0x92')](_0x4b55ea);}})[_0x0e01('0x22')](handleError(_0x53ac47,null));};exports['getSystemAvatar']=function(_0xce57ae,_0x3e728c){var _0x8c0725=path['join'](config[_0x0e01('0x89')],_0x0e01('0x99'));var _0x5befc7={'where':{'id':_0xce57ae['params']['id']},'attributes':['id',_0x0e01('0x87')],'raw':!![]};return db['ChatWebsite']['find'](_0x5befc7)['then'](handleEntityNotFound(_0x3e728c,null))[_0x0e01('0x2e')](function(_0xf5c0db){if(_0xf5c0db){if(!_['isNil'](_0xf5c0db['systemAvatar'])){if(fs[_0x0e01('0x8f')](path[_0x0e01('0x90')](config['root'],'server/files/images/avatars/',_0xf5c0db[_0x0e01('0x87')]))){_0x8c0725=path[_0x0e01('0x90')](config[_0x0e01('0x89')],'server/files/images/avatars/',_0xf5c0db['systemAvatar']);}}return _0x3e728c[_0x0e01('0x92')](_0x8c0725);}})[_0x0e01('0x22')](handleError(_0x3e728c,null));};exports[_0x0e01('0x9a')]=function(_0x1542ec,_0x2f1f68){var _0x1c8b75={'body':_0x1542ec[_0x0e01('0x69')],'channel':'chat'};var _0x2f159c=[];var _0x2b78a8=[];var _0x3a0e58={};var _0x3bce1c=![];if(_0x1542ec[_0x0e01('0x69')]['id']){delete _0x1542ec[_0x0e01('0x69')]['id'];}if(_[_0x0e01('0x8e')](_0x1542ec['body'][_0x0e01('0x9b')])){throw new APIBadRequestError(_0x0e01('0x9c'));}if(_['isNil'](_0x1542ec[_0x0e01('0x69')][_0x0e01('0x9d')])){throw new APIBadRequestError(_0x0e01('0x9e'));}if(_[_0x0e01('0x9f')](_0x1542ec['body'][_0x0e01('0x69')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}return db[_0x0e01('0xa0')][_0x0e01('0x72')]()['then'](function(_0x537f8e){if(!_0x537f8e){throw new Error(_0x0e01('0xa1'));}_0x2f159c=Object[_0x0e01('0x50')](_0x537f8e)[_0x0e01('0x5e')](function(_0x157755){return![_0x0e01('0xa2'),'updatedAt']['includes'](_0x157755);});_0x2b78a8=Object['keys'](_0x537f8e)[_0x0e01('0x5e')](function(_0x540747){return![_0x0e01('0xa2'),_0x0e01('0xa3'),_0x0e01('0xa4'),_0x0e01('0xa5')][_0x0e01('0xa6')](_0x540747);});if(!_[_0x0e01('0xa6')](_0x2b78a8,_0x1542ec[_0x0e01('0x69')][_0x0e01('0x9d')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x2b78a8[_0x0e01('0x90')](',\x20'));}_0x3a0e58[_0x1542ec[_0x0e01('0x69')][_0x0e01('0x9d')]]=_0x1542ec['body'][_0x0e01('0x9b')];})[_0x0e01('0x2e')](function(){return db['ChatWebsite'][_0x0e01('0x67')]({'where':{'id':_0x1542ec[_0x0e01('0x63')]['id']},'include':[{'model':db['CmList'],'as':_0x0e01('0xa7'),'include':[{'model':db[_0x0e01('0xa0')],'as':_0x0e01('0xa8'),'where':_0x3a0e58,'limit':0x1,'order':[['updatedAt',_0x0e01('0xa9')]]}]},{'model':db[_0x0e01('0xaa')],'as':_0x0e01('0xab')},{'model':db[_0x0e01('0xac')],'as':_0x0e01('0xac'),'include':[{'model':db['Interval'],'as':_0x0e01('0xad'),'attributes':['id',_0x0e01('0xae')],'raw':!![]}]}]});})['then'](function(_0x1a39b2){if(!_0x1a39b2){throw new APINotFoundError(util[_0x0e01('0x41')](_0x0e01('0xaf'),_0x1542ec[_0x0e01('0x63')]['id']));}var _0x36b271=_0x1a39b2[_0x0e01('0xac')];if(_0x36b271){var _0x3835ed=_0x1a39b2[_0x0e01('0xb0')]||undefined;return _0x36b271['ifTime'](_0x3835ed)['then'](function(_0x49de0c){if(!_0x49de0c){throw new APIOutOfIntervalError();}return _0x1a39b2;});}else{return _0x1a39b2;}})[_0x0e01('0x2e')](function(_0x4474ac){if(!_0x4474ac[_0x0e01('0xa7')]){return;}_0x1c8b75['account']=_0x4474ac;_0x1c8b75[_0x0e01('0xb1')]=_0x4474ac[_0x0e01('0xa7')];_0x1c8b75['applications']=_['orderBy'](_0x4474ac[_0x0e01('0xab')],[_0x0e01('0xb2')],[_0x0e01('0xb3')]);if(_0x1c8b75['account'][_0x0e01('0xab')]){delete _0x1c8b75['account'][_0x0e01('0xab')];}if(_0x1c8b75[_0x0e01('0xb4')][_0x0e01('0xa7')]&&_0x1c8b75[_0x0e01('0xb4')][_0x0e01('0xa7')][_0x0e01('0xa8')][_0x0e01('0x55')]){return _0x1c8b75[_0x0e01('0xb4')]['List']['Contacts'][0x0];}var _0x4dfcd7=_['defaults'](_0x1542ec[_0x0e01('0x69')],{'firstName':_0x1542ec['body']['from'],'ListId':_0x4474ac[_0x0e01('0xa5')]});_0x4dfcd7[_0x1542ec['body'][_0x0e01('0x9d')]]=_0x1542ec[_0x0e01('0x69')]['from'];return db[_0x0e01('0xa0')][_0x0e01('0x68')](_0x4dfcd7,{'fields':_0x2f159c,'raw':!![]});})[_0x0e01('0x2e')](function(_0x61da63){_0x1c8b75[_0x0e01('0xb5')]=_0x61da63;var _0x42f238=createInteractionObject(_0x1542ec[_0x0e01('0x63')]['id'],_0x1542ec['body'],_0x1542ec[_0x0e01('0xb6')],_0x61da63);var _0x4d8410={'ChatWebsiteId':_0x1542ec[_0x0e01('0x63')]['id']};if(_0x1542ec[_0x0e01('0x69')][_0x0e01('0xb7')]){_0x4d8410[_0x0e01('0xb7')]=_0x1542ec[_0x0e01('0x69')]['threadId'];_0x4d8410['closed']=![];return db[_0x0e01('0xb8')][_0x0e01('0x67')]({'where':_0x4d8410})[_0x0e01('0x2e')](function(_0x531d43){var _0x4c6c10=_0x1542ec[_0x0e01('0x69')][_0x0e01('0x37')]&&_0x1542ec[_0x0e01('0x69')][_0x0e01('0x3d')];if(_0x531d43){_0x3bce1c=!![];return _0x531d43;}else if(!_0x4c6c10&&_0x531d43&&_0x531d43[_0x0e01('0xb9')]){throw new APIConflictError(_0x0e01('0xba'));}_0x42f238['threadId']=_0x1542ec['body']['threadId'];_0x42f238['externalUrl']=_0x1542ec[_0x0e01('0x69')][_0x0e01('0xbb')];return db[_0x0e01('0xb8')][_0x0e01('0x68')](_0x42f238);});}_0x4d8410[_0x0e01('0xbc')]=_0x61da63['id'];if(_0x1542ec['body'][_0x0e01('0xbd')]&&_0x1542ec[_0x0e01('0x69')][_0x0e01('0xbd')]['id']){_0x4d8410['id']=_0x1542ec[_0x0e01('0x69')][_0x0e01('0xbd')]['id'];return db[_0x0e01('0xb8')][_0x0e01('0x67')]({'where':_0x4d8410})[_0x0e01('0x2e')](function(_0x3e17c4){var _0x370c88=_0x1542ec[_0x0e01('0x69')][_0x0e01('0x37')]&&_0x1542ec[_0x0e01('0x69')][_0x0e01('0x3d')];if(!_0x370c88&&_0x3e17c4&&_0x3e17c4['closed']){throw new APIConflictError(_0x0e01('0xba'));}else if(_0x3e17c4){_0x3bce1c=!![];return _0x3e17c4;}else{return db[_0x0e01('0xb8')]['create'](_0x42f238);}});}return db['ChatInteraction'][_0x0e01('0x68')](_0x42f238);})[_0x0e01('0x2e')](function(_0x39a775){if(!_0x3bce1c){return _0x39a775;}var _0x303df3={'from':(_0x1c8b75[_0x0e01('0xb5')][_0x0e01('0x3a')]||'')+'\x20'+(_0x1c8b75[_0x0e01('0xb5')][_0x0e01('0x3b')]||'')};if(_0x1542ec[_0x0e01('0x69')]['threadId']&&_0x1542ec[_0x0e01('0x69')][_0x0e01('0xbe')]&&_0x1542ec[_0x0e01('0x69')]['threadId']!=_0x1542ec[_0x0e01('0x69')][_0x0e01('0xbe')]){_0x303df3['threadId']=_0x1542ec[_0x0e01('0x69')]['messageId'];}return _0x39a775[_0x0e01('0x2d')](_0x303df3);})[_0x0e01('0x2e')](function(_0x5867ce){_0x1c8b75[_0x0e01('0xbd')]=_0x5867ce[_0x0e01('0x6b')]({'plain':!![]});_0x1c8b75[_0x0e01('0xbd')][_0x0e01('0xbf')]=!_0x3bce1c;if(_0x1c8b75[_0x0e01('0xbd')][_0x0e01('0xbf')]){if(_0x1c8b75[_0x0e01('0xb4')][_0x0e01('0xc0')]){_0x1c8b75[_0x0e01('0xc1')][_0x0e01('0xc2')]({'id':0x0,'priority':_0x1c8b75[_0x0e01('0xc1')][_0x0e01('0x55')]+0x1,'app':_0x0e01('0xc3'),'appdata':_0x0e01('0xc4'),'interval':_0x0e01('0xc5')});}}return db[_0x0e01('0xc6')][_0x0e01('0x68')]({'body':_0x1542ec[_0x0e01('0x69')][_0x0e01('0x69')],'ChatWebsiteId':_0x1542ec[_0x0e01('0x63')]['id'],'ChatInteractionId':_0x5867ce['id'],'direction':'in','ContactId':_0x1c8b75['contact']['id'],'AttachmentId':_0x1542ec[_0x0e01('0x69')][_0x0e01('0xc7')]});})[_0x0e01('0x2e')](function(_0x515ef0){_0x1c8b75['message']=_0x515ef0;if(!_0x1c8b75[_0x0e01('0xbd')][_0x0e01('0xc8')]){return;}return db[_0x0e01('0xc9')][_0x0e01('0x67')]({'attributes':['id',_0x0e01('0x32')],'where':{'id':_0x1c8b75[_0x0e01('0xbd')][_0x0e01('0xc8')]}});})[_0x0e01('0x2e')](function(_0x29a864){if(_0x29a864){_0x1c8b75[_0x0e01('0xc1')][_0x0e01('0xca')]({'id':0x0,'priority':0x0,'app':_0x0e01('0xcb'),'appdata':_0x29a864[_0x0e01('0x32')]+','+(_0x1c8b75[_0x0e01('0xb4')][_0x0e01('0xcc')]||0xa),'interval':_0x0e01('0xc5')});_0x1c8b75[_0x0e01('0xcd')]=!![];}if(!_0x1c8b75[_0x0e01('0xbd')][_0x0e01('0xce')]){return;}return db['ChatQueue'][_0x0e01('0x67')]({'attributes':['id','name'],'where':{'id':_0x1c8b75[_0x0e01('0xbd')][_0x0e01('0xce')]}});})[_0x0e01('0x2e')](function(_0x4d047c){if(_0x4d047c){_0x1c8b75[_0x0e01('0xc1')]['unshift']({'id':0x0,'priority':0x1,'app':_0x0e01('0xcf'),'appdata':_0x4d047c[_0x0e01('0x32')]+','+(_0x1c8b75[_0x0e01('0xb4')][_0x0e01('0xd0')]||0x12c),'interval':_0x0e01('0xc5')});}return respondWithRpcPromise(_0x0e01('0xd1'),_0x0e01('0xd2'),_0x1c8b75);})[_0x0e01('0x2e')](function(_0x3cb79e){respondWithRpcPromise(_0x0e01('0xd3'),_0x0e01('0xd3'),{'event':_0x0e01('0x9a'),'message':_0x3cb79e},client9002);return _0x3cb79e;})[_0x0e01('0x2e')](respondWithResult(_0x2f1f68,null))[_0x0e01('0x22')](APIHandleError(_0x2f1f68));};exports['offline']=function(_0x2259e8,_0x3b38fe){var _0x5c38df,_0x28a346,_0x3ab3c8;var _0x342822=[];var _0x120039={};var _0x424eb2=_0x2259e8[_0x0e01('0xd4')]||[];var _0xb35ed=[];var _0x3a1aee;return db[_0x0e01('0xa0')]['describe']()['then'](function(_0x47318e){if(!_0x47318e){throw new db[(_0x0e01('0xd5'))]['ValidationError'](_0x0e01('0xd6'));}_0x342822=_[_0x0e01('0xd7')](_[_0x0e01('0x50')](_0x47318e),[_0x0e01('0xa2'),_0x0e01('0xa3'),_0x0e01('0xa4'),_0x0e01('0xa5')]);if(_0x2259e8['body']['id']){delete _0x2259e8['body']['id'];}if(_[_0x0e01('0x8e')](_0x2259e8['body'][_0x0e01('0x9b')])){throw _0x3b38fe[_0x0e01('0x2a')](0x1f4)[_0x0e01('0x33')](new db[(_0x0e01('0xd5'))][(_0x0e01('0xd8'))](_0x0e01('0xd9')));}if(_[_0x0e01('0x8e')](_0x2259e8[_0x0e01('0x69')]['body'])||_0x2259e8[_0x0e01('0x69')][_0x0e01('0x69')]===''){throw _0x3b38fe[_0x0e01('0x2a')](0x1f4)[_0x0e01('0x33')](new db['Sequelize'][(_0x0e01('0xd8'))](_0x0e01('0xda')));}if(_[_0x0e01('0x8e')](_0x2259e8[_0x0e01('0x69')][_0x0e01('0xdb')])){throw _0x3b38fe[_0x0e01('0x2a')](0x1f4)['send'](new db['Sequelize'][(_0x0e01('0xd8'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x342822));}if(!_[_0x0e01('0xa6')](_0x342822,_0x2259e8['body'][_0x0e01('0xdb')])){throw _0x3b38fe[_0x0e01('0x2a')](0x1f4)[_0x0e01('0x33')](new db[(_0x0e01('0xd5'))][(_0x0e01('0xd8'))](_0x0e01('0xdc')+_0x342822));}_0x120039[_0x2259e8[_0x0e01('0x69')][_0x0e01('0xdb')]]=_0x2259e8[_0x0e01('0x69')]['from'];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x2259e8['params']['id']},'include':[{'model':db[_0x0e01('0xdd')],'as':_0x0e01('0xa7')},{'model':db[_0x0e01('0xde')],'as':_0x0e01('0xde')}]});})[_0x0e01('0x2e')](handleEntityNotFound(_0x3b38fe,null))[_0x0e01('0x2e')](function(_0x51ad27){if(_0x51ad27&&_0x51ad27[_0x0e01('0xa7')]){_0x28a346=_0x51ad27;var _0xbfcd02=_['defaults'](_0x2259e8[_0x0e01('0x69')],{'firstName':_0x2259e8[_0x0e01('0x69')][_0x0e01('0x9b')],'phone':_0x2259e8[_0x0e01('0x69')][_0x0e01('0x9b')],'ListId':_0x51ad27[_0x0e01('0xa5')]});_0xbfcd02[_0x2259e8[_0x0e01('0x69')]['mapKeyOffline']]=_0x2259e8['body'][_0x0e01('0x9b')];return db[_0x0e01('0xa0')][_0x0e01('0xdf')]({'where':_0x120039,'defaults':_0xbfcd02});}})[_0x0e01('0xe0')](function(_0x8f9f19){if(_0x8f9f19){_0x3ab3c8=_0x8f9f19;var _0x4e0de3=fs[_0x0e01('0xe1')](path[_0x0e01('0x90')](config['root'],_0x0e01('0xe2')),_0x0e01('0xe3'));var _0x553a1a=ejs['render'](_0x4e0de3,{'body':_[_0x0e01('0xe4')](_0x2259e8[_0x0e01('0x69')]['body']),'bodyTitle':_0x28a346[_0x0e01('0xe5')]});return db['ChatOfflineMessage'][_0x0e01('0x68')]({'body':_0x553a1a,'plainBody':htmlToText[_0x0e01('0xe6')](_0x553a1a),'ContactId':_0x8f9f19['id'],'ChatWebsiteId':_0x28a346['id']});}})[_0x0e01('0x2e')](function(_0x3b5914){_0x3a1aee=_0x3b5914;if(_0x424eb2[_0x0e01('0x55')]){var _0x12c56f=_0x424eb2['map'](function(_0x1d64c4){return{'name':_0x1d64c4[_0x0e01('0xe7')],'basename':_0x1d64c4[_0x0e01('0x83')],'type':_0x1d64c4[_0x0e01('0xe8')],'ChatOfflineMessageId':_0x3b5914['id']};});_0xb35ed=_0x12c56f[_0x0e01('0x49')](_0x2c3656=>{var _0x255aee={'filename':_0x2c3656['name'],'path':path[_0x0e01('0x90')](config[_0x0e01('0x89')],_0x0e01('0xe9'),'files',_0x0e01('0xea'),_0x0e01('0xeb'),_0x2c3656['basename'])};return _0x255aee;});if(!_0x28a346[_0x0e01('0xec')]){return db['sequelize']['transaction'](function(_0x40f0b5){return db[_0x0e01('0xed')][_0x0e01('0xee')](_0x12c56f,{'transaction':_0x40f0b5});});}}})[_0x0e01('0x2e')](function(){if(_0x3a1aee){_0x5c38df=_0x3a1aee;return db['MailAccount'][_0x0e01('0x77')]({'where':{'service':!![]},'include':[{'model':db[_0x0e01('0xef')],'as':_0x0e01('0xf0'),'raw':!![],'include':[{'model':db[_0x0e01('0xf1')],'as':_0x0e01('0xf1'),'raw':!![]}]}]});}})[_0x0e01('0x2e')](function(_0x29bac2){if(_0x29bac2&&_0x29bac2[_0x0e01('0xf0')]&&_0x28a346[_0x0e01('0xf2')]&&_0x28a346['forwardOfflineAddress']){var _0x194cf7=_0x29bac2['getSmtpOptions']();return respondWithRpcPromise(_0x0e01('0xf3'),_0x0e01('0xf4'),{'account':_0x194cf7,'message':{'from':util[_0x0e01('0x41')](_0x0e01('0xf5'),_0x29bac2[_0x0e01('0x32')],_0x29bac2['email']||_0x29bac2['Smtp'][_0x0e01('0x6a')]),'to':_0x28a346[_0x0e01('0xf6')],'subject':_0x28a346['offlineMessageSubject'],'html':_0x5c38df['body'],'attachments':_0xb35ed}},client9003)[_0x0e01('0x2e')](function(){return _0x5c38df;})[_0x0e01('0x22')](function(_0x720b50){logger[_0x0e01('0x1e')](_0x720b50);});}})[_0x0e01('0x2e')](function(){if(_0x28a346&&_0x28a346['openNewInteraction']&&_0x28a346[_0x0e01('0xf7')]){var _0x49a007=[];if(_0x424eb2[_0x0e01('0x55')]){_0x49a007=_0x424eb2[_0x0e01('0x49')](function(_0x17e0bc){return{'name':_0x17e0bc[_0x0e01('0xe7')],'basename':_0x17e0bc[_0x0e01('0x83')],'type':_0x17e0bc[_0x0e01('0xe8')],'ChatOfflineMessageId':_0x3a1aee['id']};});}var _0x50fd4a;if(!_['isNil'](_0x28a346[_0x0e01('0xf8')])){var _0x426ebc=_[_0x0e01('0x49')](_0x2259e8[_0x0e01('0x69')],function(_0x3f70ef){return _0x3f70ef;});var _0x4453c6=_[_0x0e01('0xf9')](_0x426ebc)[0x0];var _0x50a327=_['mapValues'](_0x4453c6,function(_0x546d41){return _0x546d41;});_0x50fd4a=_0x50a327[0x1][_0x28a346['subjectOffline']];}var _0x3ffb9e={'from':_0x3ab3c8[_0x0e01('0xfa')],'firstName':_0x3ab3c8['firstName'],'lastName':_0x3ab3c8[_0x0e01('0x3b')],'mapKey':'email','message':{'from':_0x3ab3c8[_0x0e01('0xfa')],'to':_0x28a346[_0x0e01('0xde')][_0x0e01('0xfa')],'cc':'','subject':_[_0x0e01('0x8e')](_0x50fd4a)?_0x28a346['offlineMessageSubject']:_0x50fd4a,'messageId':'','sentAt':new Date(),'attach':_0x49a007[_0x0e01('0x55')],'attachments':_0x49a007,'originChannel':_0x0e01('0xfb'),'ChatWebsiteId':_0x28a346['id'],'ChatOfflineMessageId':_0x5c38df['id'],'originTo':_0x28a346[_0x0e01('0xde')][_0x0e01('0xfa')]},'body':_0x5c38df[_0x0e01('0x69')]};var _0x10aeb9={'account':{'id':_0x28a346['MailAccountId']},'body':_0x3ffb9e,'log':_0x0e01('0xfc')};return respondWithRpcPromise(_0x0e01('0xfc'),_0x0e01('0xfd'),_0x10aeb9,client9001)[_0x0e01('0x2e')](function(){return _0x5c38df;})['catch'](function(_0x4ab220){logger['error'](_0x4ab220);});}return;})[_0x0e01('0x2e')](function(){if(_0x5c38df){return _0x5c38df;}})['then'](respondWithResult(_0x3b38fe,null))[_0x0e01('0x22')](function(){for(var _0x209f0f of _0x424eb2){var _0xd5a53a=path[_0x0e01('0x90')](config[_0x0e01('0x89')],_0x0e01('0xe9'),_0x0e01('0xd4'),_0x0e01('0xea'),'offline-chat',_0x209f0f[_0x0e01('0x83')]);fs_extra['remove'](_0xd5a53a)['catch'](function(_0x5dbbb3){logger[_0x0e01('0x1e')](_0x0e01('0xfe'),_0xd5a53a,_0x5dbbb3);});}});};exports[_0x0e01('0xff')]=function(_0x4f854d,_0x1e5447){return db['ChatInteraction'][_0x0e01('0x67')]({'where':{'id':_0x4f854d[_0x0e01('0x63')]['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0x1e5447,null))['then'](function(_0x4a21bf){if(_0x4a21bf){return _0x4a21bf['addInteraction'](_0x4f854d[_0x0e01('0x69')][_0x0e01('0x7d')],_[_0x0e01('0x100')](_0x4f854d[_0x0e01('0x69')],['ids','id'])||{});}})[_0x0e01('0x2e')](respondWithResult(_0x1e5447,null))['catch'](handleError(_0x1e5447,null));};exports[_0x0e01('0x101')]=function(_0x21dbaf,_0xcd491f){var _0x10c383={'raw':![],'where':{}};var _0x2f915f={};var _0x228458={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0e01('0x77')]({'where':{'id':_0x21dbaf[_0x0e01('0x63')]['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0xcd491f,null))[_0x0e01('0x2e')](function(_0x4c7e4c){if(_0x4c7e4c){_0x2f915f[_0x0e01('0x44')]=_['keys'](db['ChatInteraction'][_0x0e01('0x4b')]);_0x2f915f[_0x0e01('0x4f')]=_['keys'](_0x21dbaf['query']);_0x2f915f['filters']=_[_0x0e01('0x52')](_0x2f915f[_0x0e01('0x44')],_0x2f915f[_0x0e01('0x4f')]);_0x10c383['attributes']=_['intersection'](_0x2f915f[_0x0e01('0x44')],qs[_0x0e01('0x54')](_0x21dbaf[_0x0e01('0x4f')][_0x0e01('0x54')]));_0x10c383[_0x0e01('0x53')]=_0x10c383[_0x0e01('0x53')]['length']?_0x10c383['attributes']:_0x2f915f['model'];if(!_0x21dbaf[_0x0e01('0x4f')]['hasOwnProperty'](_0x0e01('0x57'))){_0x10c383[_0x0e01('0x27')]=qs[_0x0e01('0x27')](_0x21dbaf[_0x0e01('0x4f')]['limit']);_0x10c383['offset']=qs[_0x0e01('0x29')](_0x21dbaf['query'][_0x0e01('0x29')]);}_0x10c383[_0x0e01('0x58')]=qs['sort'](_0x21dbaf[_0x0e01('0x4f')][_0x0e01('0x59')]);_0x10c383['where']=qs['filters'](_['pick'](_0x21dbaf[_0x0e01('0x4f')],_0x2f915f[_0x0e01('0x51')]));_0x10c383[_0x0e01('0x5a')][_0x0e01('0x74')]=_0x4c7e4c['id'];if(_0x21dbaf[_0x0e01('0x4f')][_0x0e01('0x5e')]){_0x10c383[_0x0e01('0x5a')]=_['merge'](_0x10c383[_0x0e01('0x5a')],{'$or':_[_0x0e01('0x49')](_0x10c383[_0x0e01('0x53')],function(_0x1544f4){var _0x5cc5ae={};_0x5cc5ae[_0x1544f4]={'$like':'%'+_0x21dbaf[_0x0e01('0x4f')][_0x0e01('0x5e')]+'%'};return _0x5cc5ae;})});}_0x10c383=_[_0x0e01('0x5c')]({},_0x10c383,_0x21dbaf['options']);return db['ChatInteraction'][_0x0e01('0x28')]({'where':_0x10c383[_0x0e01('0x5a')]})[_0x0e01('0x2e')](function(_0x363774){_0x228458[_0x0e01('0x28')]=_0x363774;if(_0x21dbaf['query']['includeAll']){_0x10c383[_0x0e01('0x65')]=[{'model':db[_0x0e01('0xa0')],'as':_0x0e01('0x102'),'required':![]},{'model':db[_0x0e01('0xc9')],'as':'Owner','attributes':[_0x0e01('0x32'),_0x0e01('0x103'),_0x0e01('0x104')],'required':![]},{'model':db['Tag'],'as':_0x0e01('0x105'),'attributes':['id','name',_0x0e01('0x106')],'where':_0x21dbaf[_0x0e01('0x4f')][_0x0e01('0x107')]?{'id':_0x21dbaf[_0x0e01('0x4f')][_0x0e01('0x107')]}:undefined,'required':_0x21dbaf[_0x0e01('0x4f')][_0x0e01('0x107')]?!![]:![]}];}return db['ChatInteraction'][_0x0e01('0x60')](_0x10c383);})[_0x0e01('0x2e')](function(_0xec1b8f){_0x228458[_0x0e01('0x61')]=_0xec1b8f;return _0x228458;});}})['then'](respondWithFilteredResult(_0xcd491f,_0x10c383))[_0x0e01('0x22')](handleError(_0xcd491f,null));};exports[_0x0e01('0x108')]=function(_0x4a0a61,_0x5689a6){var _0x1acee1=0x0;var _0x27debb=0x0;var _0x21259c=![];var _0x51a7b7;var _0x43422e;return db[_0x0e01('0x4a')]['find']({'where':{'id':_0x4a0a61['params']['id']},'include':[{'model':db[_0x0e01('0xac')],'as':_0x0e01('0xac'),'include':[{'model':db[_0x0e01('0xac')],'as':'Intervals','attributes':['id',_0x0e01('0xae')]}]}]})[_0x0e01('0x2e')](handleEntityNotFound(_0x5689a6,null))['then'](function(_0xd94483){if(_0xd94483){_0x51a7b7=_0xd94483;return _0xd94483['getProactiveActions']({'raw':!![]});}})[_0x0e01('0x2e')](function(_0x25abbb){if(_0x51a7b7){if(_0x25abbb){_0x43422e=_0x25abbb;}}return require(_0x0e01('0x8b'))[_0x0e01('0x8c')]();})[_0x0e01('0x2e')](function(_0x584da2){if(_0x584da2){_0x27debb=_0x584da2[_0x0e01('0x109')];_0x21259c=_0x584da2[_0x0e01('0x8d')];}})[_0x0e01('0x2e')](function(){return db[_0x0e01('0xb8')][_0x0e01('0x28')]({'where':{'closed':![]}});})[_0x0e01('0x2e')](function(_0x3176c8){_0x1acee1=_0x3176c8;if(_0x27debb&&_0x3176c8>_0x27debb){return db[_0x0e01('0x10a')]['findOne']({'where':{'id':0x1}})['then'](function(_0xef932d){if(_0xef932d){_0xef932d['increment'](_0x0e01('0x10b'));}});}})['then'](function(){var _0x461f87=_0x51a7b7[_0x0e01('0xac')];var _0x3ceac1=_0x51a7b7['timezone']||undefined;return _0x461f87?_0x461f87[_0x0e01('0x10c')](_0x3ceac1):!![];})['then'](function(_0x318d7b){var _0x1891d4=fs[_0x0e01('0xe1')](path['join'](config['root'],_0x0e01('0x10d')),'utf8');var _0x224454=new url[(_0x0e01('0x10e'))](_0x51a7b7[_0x0e01('0x10f')])[_0x0e01('0x110')];var _0x5eacb3=_0x0e01('0x111');var _0x4a2055=![];var _0xbf9c1a={'chatVersion':_0x5eacb3,'chatWebsiteAddressOrigin':_0x224454,'remote':_0x51a7b7[_0x0e01('0x112')],'query':querystring[_0x0e01('0x1d')](_[_0x0e01('0x5c')](_0x51a7b7['get']({'plain':!![]}),{'customerIp':_0x4a0a61[_0x0e01('0xb6')][_0x0e01('0x38')]||_0x4a0a61[_0x0e01('0xb6')][_0x0e01('0x113')]||_0x4a0a61['connection']['remoteAddress']||_0x4a0a61['ip'],'referer':_0x4a0a61[_0x0e01('0xb6')][_0x0e01('0x3d')],'openedInteractions':_0x1acee1,'maxInteractions':_0x27debb,'virtual':_0x21259c[_0x0e01('0x109')],'online':_0x318d7b,'custom':_0x21259c}))[_0x0e01('0x114')](/'/g,'\x5c\x27')};_0x5689a6[_0x0e01('0x33')](ejs[_0x0e01('0x115')](Mustache[_0x0e01('0x115')](_0x1891d4,_0xbf9c1a),{'proactiveActions':_0x43422e,'alignment':_0x51a7b7[_0x0e01('0x116')],'verticalAlignment':_0x51a7b7[_0x0e01('0x117')],'div_color':_0x51a7b7[_0x0e01('0x106')],'labelText':_0x51a7b7[_0x0e01('0x118')],'text_color':_0x51a7b7[_0x0e01('0x119')],'text_button_color':_0x51a7b7[_0x0e01('0x11a')],'button_color':_0x51a7b7[_0x0e01('0x11b')],'background_color':_0x51a7b7[_0x0e01('0x11c')],'hideWhenOffline':_0x51a7b7[_0x0e01('0x11d')],'intervalId':_0x51a7b7[_0x0e01('0x11e')],'isDevelopment':_0x4a2055,'chatVersion':_0x5eacb3}));})[_0x0e01('0x22')](handleError(_0x5689a6,null));};exports[_0x0e01('0x11f')]=function(_0xd56f79,_0x184a97){var _0x10d262=_0xd56f79['params']['id'];var _0x33b152=_0xd56f79[_0x0e01('0x69')];var _0x4be811=0xc8;var _0x40308f=null;return db['sequelize'][_0x0e01('0x120')]({'isolationLevel':db[_0x0e01('0x121')]['Transaction']['ISOLATION_LEVELS'][_0x0e01('0x122')]},function(_0x5e9f3f){return db[_0x0e01('0x4a')][_0x0e01('0x77')]({'where':{'id':_0x10d262},'transaction':_0x5e9f3f})['then'](function(_0x55a74e){if(_0x55a74e){return db[_0x0e01('0xaa')][_0x0e01('0x2f')]({'where':{'ChatWebsiteId':_0x10d262},'transaction':_0x5e9f3f})['then'](function(){var _0x5d1d60=_[_0x0e01('0x49')](_0x33b152,function(_0x563d3b){_0x563d3b[_0x0e01('0x74')]=_0x10d262;return _0x563d3b;});return db['ChatApplication'][_0x0e01('0xee')](_0x5d1d60,{'transaction':_0x5e9f3f});});}else{_0x4be811=0x194;_0x40308f=[];}});})[_0x0e01('0x2e')](function(){if(_0x4be811!==0x194){return db[_0x0e01('0xaa')][_0x0e01('0x123')]({'where':{'ChatWebsiteId':_0x10d262},'order':_0x0e01('0xb2')})[_0x0e01('0x2e')](function(_0x207219){_0x40308f=_0x207219;});}})[_0x0e01('0x22')](function(_0xd4e859){_0x4be811=0x1f4;logger[_0x0e01('0x1e')](_0xd4e859[_0x0e01('0x31')]);if(_0xd4e859[_0x0e01('0x32')]){delete _0xd4e859['name'];}_0x40308f=_0xd4e859;})[_0x0e01('0x124')](function(){if(_0x40308f===null){_0x184a97[_0x0e01('0x23')](_0x4be811);}else{if(_0x4be811===0x1f4){_0x184a97[_0x0e01('0x2a')](_0x4be811)['send'](_0x40308f);}else{_0x184a97[_0x0e01('0x2a')](_0x4be811)[_0x0e01('0x25')](_0x40308f);}}});};exports[_0x0e01('0x125')]=function(_0x2f7a1b,_0xc00ff3){var _0x12ea8d={};var _0x3de799={};var _0x9e4d48;var _0x2add87;return db[_0x0e01('0x4a')][_0x0e01('0x77')]({'where':{'id':_0x2f7a1b[_0x0e01('0x63')]['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0xc00ff3,null))[_0x0e01('0x2e')](function(_0x5807c3){if(_0x5807c3){_0x9e4d48=_0x5807c3;_0x3de799[_0x0e01('0x44')]=_[_0x0e01('0x50')](db[_0x0e01('0xaa')][_0x0e01('0x4b')]);_0x3de799['query']=_[_0x0e01('0x50')](_0x2f7a1b[_0x0e01('0x4f')]);_0x3de799[_0x0e01('0x51')]=_[_0x0e01('0x52')](_0x3de799[_0x0e01('0x44')],_0x3de799[_0x0e01('0x4f')]);_0x12ea8d[_0x0e01('0x53')]=_[_0x0e01('0x52')](_0x3de799[_0x0e01('0x44')],qs[_0x0e01('0x54')](_0x2f7a1b[_0x0e01('0x4f')][_0x0e01('0x54')]));_0x12ea8d['attributes']=_0x12ea8d[_0x0e01('0x53')][_0x0e01('0x55')]?_0x12ea8d[_0x0e01('0x53')]:_0x3de799[_0x0e01('0x44')];_0x12ea8d[_0x0e01('0x58')]=qs['sort'](_0x2f7a1b[_0x0e01('0x4f')][_0x0e01('0x59')]);_0x12ea8d[_0x0e01('0x5a')]=qs[_0x0e01('0x51')](_[_0x0e01('0x5b')](_0x2f7a1b[_0x0e01('0x4f')],_0x3de799[_0x0e01('0x51')]));if(_0x2f7a1b[_0x0e01('0x4f')][_0x0e01('0x5e')]){_0x12ea8d[_0x0e01('0x5a')]=_[_0x0e01('0x5c')](_0x12ea8d['where'],{'$or':_['map'](_0x12ea8d[_0x0e01('0x53')],function(_0x484684){var _0x3428d2={};_0x3428d2[_0x484684]={'$like':'%'+_0x2f7a1b[_0x0e01('0x4f')][_0x0e01('0x5e')]+'%'};return _0x3428d2;})});}_0x12ea8d=_[_0x0e01('0x5c')]({},_0x12ea8d,_0x2f7a1b[_0x0e01('0x66')]);return _0x9e4d48['getApplications'](_0x12ea8d);}})[_0x0e01('0x2e')](function(_0x1d83ed){if(_0x1d83ed){_0x2add87=_0x1d83ed[_0x0e01('0x55')];if(!_0x2f7a1b[_0x0e01('0x4f')][_0x0e01('0x56')](_0x0e01('0x57'))){_0x12ea8d['limit']=qs['limit'](_0x2f7a1b['query'][_0x0e01('0x27')]);_0x12ea8d[_0x0e01('0x29')]=qs[_0x0e01('0x29')](_0x2f7a1b[_0x0e01('0x4f')][_0x0e01('0x29')]);}return _0x9e4d48['getApplications'](_0x12ea8d);}})[_0x0e01('0x2e')](function(_0x5f46e4){if(_0x5f46e4){return _0x5f46e4?{'count':_0x2add87,'rows':_0x5f46e4}:null;}})['then'](respondWithResult(_0xc00ff3,null))[_0x0e01('0x22')](handleError(_0xc00ff3,null));};exports[_0x0e01('0x126')]=function(_0x9fc065,_0x190231){return db[_0x0e01('0x127')]['find']({'where':{'id':_0x9fc065[_0x0e01('0x63')]['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0x190231,null))[_0x0e01('0x2e')](function(_0x1db44d){if(_0x1db44d){return _0x1db44d[_0x0e01('0x126')](_0x9fc065[_0x0e01('0x69')][_0x0e01('0x7d')],_[_0x0e01('0x100')](_0x9fc065[_0x0e01('0x69')],[_0x0e01('0x7d'),'id'])||{});}})[_0x0e01('0x2e')](respondWithResult(_0x190231,null))[_0x0e01('0x22')](handleError(_0x190231,null));};exports[_0x0e01('0x128')]=function(_0x59458b,_0x77166a){var _0x28d08c={};var _0x2bb16b={};var _0x5d9818;var _0x2b676e;return db[_0x0e01('0x4a')][_0x0e01('0x77')]({'where':{'id':_0x59458b[_0x0e01('0x63')]['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0x77166a,null))[_0x0e01('0x2e')](function(_0xe37e4b){if(_0xe37e4b){_0x5d9818=_0xe37e4b;_0x2bb16b['model']=_[_0x0e01('0x50')](db['ChatProactiveAction'][_0x0e01('0x4b')]);_0x2bb16b['query']=_[_0x0e01('0x50')](_0x59458b[_0x0e01('0x4f')]);_0x2bb16b[_0x0e01('0x51')]=_[_0x0e01('0x52')](_0x2bb16b['model'],_0x2bb16b[_0x0e01('0x4f')]);_0x28d08c[_0x0e01('0x53')]=_[_0x0e01('0x52')](_0x2bb16b[_0x0e01('0x44')],qs[_0x0e01('0x54')](_0x59458b[_0x0e01('0x4f')][_0x0e01('0x54')]));_0x28d08c[_0x0e01('0x53')]=_0x28d08c[_0x0e01('0x53')]['length']?_0x28d08c['attributes']:_0x2bb16b[_0x0e01('0x44')];_0x28d08c[_0x0e01('0x58')]=qs[_0x0e01('0x59')](_0x59458b[_0x0e01('0x4f')][_0x0e01('0x59')]);_0x28d08c['where']=qs[_0x0e01('0x51')](_[_0x0e01('0x5b')](_0x59458b[_0x0e01('0x4f')],_0x2bb16b[_0x0e01('0x51')]));if(_0x59458b['query'][_0x0e01('0x5e')]){_0x28d08c[_0x0e01('0x5a')]=_[_0x0e01('0x5c')](_0x28d08c['where'],{'$or':_[_0x0e01('0x49')](_0x28d08c[_0x0e01('0x53')],function(_0x36278b){var _0x136b8f={};_0x136b8f[_0x36278b]={'$like':'%'+_0x59458b[_0x0e01('0x4f')][_0x0e01('0x5e')]+'%'};return _0x136b8f;})});}_0x28d08c=_[_0x0e01('0x5c')]({},_0x28d08c,_0x59458b[_0x0e01('0x66')]);return _0x5d9818[_0x0e01('0x128')](_0x28d08c);}})[_0x0e01('0x2e')](function(_0x5f20da){if(_0x5f20da){_0x2b676e=_0x5f20da['length'];if(!_0x59458b[_0x0e01('0x4f')][_0x0e01('0x56')](_0x0e01('0x57'))){_0x28d08c['limit']=qs[_0x0e01('0x27')](_0x59458b[_0x0e01('0x4f')][_0x0e01('0x27')]);_0x28d08c[_0x0e01('0x29')]=qs[_0x0e01('0x29')](_0x59458b[_0x0e01('0x4f')][_0x0e01('0x29')]);}return _0x5d9818['getProactiveActions'](_0x28d08c);}})[_0x0e01('0x2e')](function(_0x4fde59){if(_0x4fde59){return _0x4fde59?{'count':_0x2b676e,'rows':_0x4fde59}:null;}})[_0x0e01('0x2e')](respondWithResult(_0x77166a,null))[_0x0e01('0x22')](handleError(_0x77166a,null));};exports[_0x0e01('0x129')]=function(_0x3e21e4,_0x147498){var _0x15794b=_0x3e21e4[_0x0e01('0x4f')]['online']==='false'?'offlineForm':_0x0e01('0x12a');return db[_0x0e01('0x4a')][_0x0e01('0x67')]({'attributes':['id',_0x15794b],'where':{'id':_0x3e21e4[_0x0e01('0x63')]['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0x147498,null))[_0x0e01('0x2e')](function(_0x39eeb2){if(_0x39eeb2){var _0x10e0e4=_0x39eeb2[_0x15794b];var _0x26dfc0=_0x10e0e4&&_0x10e0e4[_0x0e01('0x12b')]?_0x10e0e4[_0x0e01('0x12b')]:[];_0x147498[_0x0e01('0x33')]({'fromKey':_['isNil'](_0x10e0e4['fromKey'])?undefined:_0x10e0e4[_0x0e01('0x12c')],'count':_0x26dfc0[_0x0e01('0x55')],'rows':_0x26dfc0});}})[_0x0e01('0x22')](handleError(_0x147498,null));};exports['getOfflineMessages']=function(_0x1df46f,_0x2188a6){var _0x426ba7={'raw':![],'where':{}};var _0x55c83a={};var _0xec52de={'count':0x0,'rows':[]};return db[_0x0e01('0x4a')]['findOne']({'where':{'id':_0x1df46f[_0x0e01('0x63')]['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0x2188a6,null))[_0x0e01('0x2e')](function(_0x1b1ab3){if(_0x1b1ab3){_0x55c83a[_0x0e01('0x44')]=_[_0x0e01('0x50')](db[_0x0e01('0x12d')][_0x0e01('0x4b')]);_0x55c83a['query']=_['keys'](_0x1df46f['query']);_0x55c83a['filters']=_[_0x0e01('0x52')](_0x55c83a['model'],_0x55c83a['query']);_0x426ba7[_0x0e01('0x53')]=_[_0x0e01('0x52')](_0x55c83a[_0x0e01('0x44')],qs[_0x0e01('0x54')](_0x1df46f[_0x0e01('0x4f')][_0x0e01('0x54')]));_0x426ba7[_0x0e01('0x53')]=_0x426ba7[_0x0e01('0x53')][_0x0e01('0x55')]?_0x426ba7[_0x0e01('0x53')]:_0x55c83a[_0x0e01('0x44')];if(!_0x1df46f[_0x0e01('0x4f')][_0x0e01('0x56')](_0x0e01('0x57'))){_0x426ba7[_0x0e01('0x27')]=qs['limit'](_0x1df46f[_0x0e01('0x4f')]['limit']);_0x426ba7['offset']=qs[_0x0e01('0x29')](_0x1df46f[_0x0e01('0x4f')]['offset']);}_0x426ba7[_0x0e01('0x58')]=qs[_0x0e01('0x59')](_0x1df46f[_0x0e01('0x4f')]['sort']);_0x426ba7[_0x0e01('0x5a')]=qs['filters'](_['pick'](_0x1df46f[_0x0e01('0x4f')],_0x55c83a['filters']));_0x426ba7[_0x0e01('0x5a')][_0x0e01('0x74')]=_0x1b1ab3['id'];if(_0x1df46f['query']['filter']){_0x426ba7['where']=_[_0x0e01('0x5c')](_0x426ba7[_0x0e01('0x5a')],{'$or':_[_0x0e01('0x49')](_0x426ba7[_0x0e01('0x53')],function(_0x48d45e){var _0x2eddbd={};_0x2eddbd[_0x48d45e]={'$like':'%'+_0x1df46f[_0x0e01('0x4f')][_0x0e01('0x5e')]+'%'};return _0x2eddbd;})});}_0x426ba7=_[_0x0e01('0x5c')]({},_0x426ba7,_0x1df46f[_0x0e01('0x66')]);return db[_0x0e01('0x12d')][_0x0e01('0x28')]({'where':_0x426ba7[_0x0e01('0x5a')]})[_0x0e01('0x2e')](function(_0x1dd2c5){_0xec52de[_0x0e01('0x28')]=_0x1dd2c5;if(_0x1df46f[_0x0e01('0x4f')][_0x0e01('0x5f')]){_0x426ba7['include']=[{'all':!![]}];}else{_0x426ba7[_0x0e01('0x65')]=[{'model':db[_0x0e01('0xa0')],'as':_0x0e01('0x102'),'required':![]},{'model':db[_0x0e01('0xed')],'as':_0x0e01('0x12e'),'required':![]}];}return db[_0x0e01('0x12d')]['findAll'](_0x426ba7);})[_0x0e01('0x2e')](function(_0x47111b){_0xec52de[_0x0e01('0x61')]=_0x47111b;return _0xec52de;});}})[_0x0e01('0x2e')](respondWithFilteredResult(_0x2188a6,_0x426ba7))[_0x0e01('0x22')](handleError(_0x2188a6,null));};exports['addAgents']=function(_0x293a01,_0xcc5410){return db[_0x0e01('0x4a')]['find']({'where':{'id':_0x293a01[_0x0e01('0x63')]['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0xcc5410,null))[_0x0e01('0x2e')](function(_0x490f21){if(_0x490f21){return _0x490f21[_0x0e01('0x12f')](_0x293a01[_0x0e01('0x69')][_0x0e01('0x7d')],_[_0x0e01('0x100')](_0x293a01[_0x0e01('0x69')],[_0x0e01('0x7d'),'id'])||{})[_0x0e01('0xe0')](function(_0x5341e5){for(var _0x509188=0x0;_0x509188<_0x293a01[_0x0e01('0x69')][_0x0e01('0x7d')][_0x0e01('0x55')];_0x509188+=0x1){socket[_0x0e01('0x130')](_0x0e01('0x131'),{'UserId':Number(_0x293a01[_0x0e01('0x69')][_0x0e01('0x7d')][_0x509188]),'ChatWebsiteId':Number(_0x293a01[_0x0e01('0x63')]['id'])});}return _0x5341e5;});}})['then'](respondWithResult(_0xcc5410,null))[_0x0e01('0x22')](handleError(_0xcc5410,null));};exports[_0x0e01('0x132')]=function(_0x3369fb,_0x45b77b){return db[_0x0e01('0x4a')][_0x0e01('0x67')]({'where':{'id':_0x3369fb[_0x0e01('0x63')]['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0x45b77b,null))['then'](function(_0x38e681){if(_0x38e681){return _0x38e681[_0x0e01('0x132')](_0x3369fb[_0x0e01('0x4f')][_0x0e01('0x7d')])[_0x0e01('0x2e')](function(){if(_[_0x0e01('0x133')](_0x3369fb[_0x0e01('0x4f')][_0x0e01('0x7d')])){for(var _0x440029=0x0;_0x440029<_0x3369fb['query']['ids']['length'];_0x440029+=0x1){socket[_0x0e01('0x130')](_0x0e01('0x134'),{'UserId':Number(_0x3369fb[_0x0e01('0x4f')][_0x0e01('0x7d')][_0x440029]),'ChatWebsiteId':Number(_0x3369fb['params']['id'])});}}else{socket[_0x0e01('0x130')]('userChatWebsite:remove',{'UserId':Number(_0x3369fb[_0x0e01('0x4f')][_0x0e01('0x7d')]),'ChatWebsiteId':Number(_0x3369fb[_0x0e01('0x63')]['id'])});}});}})[_0x0e01('0x2e')](respondWithStatusCode(_0x45b77b,null))[_0x0e01('0x22')](handleError(_0x45b77b,null));};exports[_0x0e01('0x135')]=function(_0x3648c1,_0x3e4a50){var _0x3cddfe={};var _0x507085={};var _0x5736d3;var _0x1f7818;return db[_0x0e01('0x4a')][_0x0e01('0x77')]({'where':{'id':_0x3648c1[_0x0e01('0x63')]['id']}})[_0x0e01('0x2e')](handleEntityNotFound(_0x3e4a50,null))['then'](function(_0x782c6a){if(_0x782c6a){_0x5736d3=_0x782c6a;_0x507085[_0x0e01('0x44')]=_['keys'](db[_0x0e01('0xc9')][_0x0e01('0x4b')]);_0x507085[_0x0e01('0x4f')]=_[_0x0e01('0x50')](_0x3648c1[_0x0e01('0x4f')]);_0x507085[_0x0e01('0x51')]=_[_0x0e01('0x52')](_0x507085[_0x0e01('0x44')],_0x507085[_0x0e01('0x4f')]);_0x3cddfe[_0x0e01('0x53')]=_['intersection'](_0x507085['model'],qs['fields'](_0x3648c1['query'][_0x0e01('0x54')]));_0x3cddfe[_0x0e01('0x53')]=_0x3cddfe[_0x0e01('0x53')][_0x0e01('0x55')]?_0x3cddfe[_0x0e01('0x53')]:_0x507085[_0x0e01('0x44')];_0x3cddfe[_0x0e01('0x58')]=qs[_0x0e01('0x59')](_0x3648c1[_0x0e01('0x4f')][_0x0e01('0x59')]);_0x3cddfe[_0x0e01('0x5a')]=qs[_0x0e01('0x51')](_[_0x0e01('0x5b')](_0x3648c1[_0x0e01('0x4f')],_0x507085[_0x0e01('0x51')]));if(_0x3648c1[_0x0e01('0x4f')][_0x0e01('0x5e')]){_0x3cddfe[_0x0e01('0x5a')]=_[_0x0e01('0x5c')](_0x3cddfe[_0x0e01('0x5a')],{'$or':_['map'](_0x3cddfe['attributes'],function(_0x513f9b){var _0x5c7ca2={};_0x5c7ca2[_0x513f9b]={'$like':'%'+_0x3648c1[_0x0e01('0x4f')]['filter']+'%'};return _0x5c7ca2;})});}_0x3cddfe=_[_0x0e01('0x5c')]({},_0x3cddfe,_0x3648c1['options']);return _0x5736d3[_0x0e01('0x135')](_0x3cddfe);}})[_0x0e01('0x2e')](function(_0x2b8f70){if(_0x2b8f70){_0x1f7818=_0x2b8f70['length'];if(!_0x3648c1[_0x0e01('0x4f')][_0x0e01('0x56')](_0x0e01('0x57'))){_0x3cddfe[_0x0e01('0x27')]=qs['limit'](_0x3648c1['query'][_0x0e01('0x27')]);_0x3cddfe[_0x0e01('0x29')]=qs[_0x0e01('0x29')](_0x3648c1[_0x0e01('0x4f')]['offset']);}return _0x5736d3[_0x0e01('0x135')](_0x3cddfe);}})[_0x0e01('0x2e')](function(_0x5abf73){if(_0x5abf73){return _0x5abf73?{'count':_0x1f7818,'rows':_0x5abf73}:null;}})[_0x0e01('0x2e')](respondWithResult(_0x3e4a50,null))['catch'](handleError(_0x3e4a50,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 5404aa0..68c9b26 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 _0x6c96=['exports','events','ChatWebsite','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c96,0x1c1));var _0x66c9=function(_0x5ab2e6,_0x150c3a){_0x5ab2e6=_0x5ab2e6-0x0;var _0x329b44=_0x6c96[_0x5ab2e6];return _0x329b44;};'use strict';var EventEmitter=require(_0x66c9('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x66c9('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x66c9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x66c9('0x3'),'afterDestroy':_0x66c9('0x4')};function emitEvent(_0x3c2e67){return function(_0x37e814,_0x35b830,_0x15aaa6){ChatWebsiteEvents[_0x66c9('0x5')](_0x3c2e67+':'+_0x37e814['id'],_0x37e814);ChatWebsiteEvents['emit'](_0x3c2e67,_0x37e814);_0x15aaa6(null);};}for(var e in events){if(events[_0x66c9('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x66c9('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xbed7=['ChatWebsite','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0xc50658,_0x49657a){var _0x5cb377=function(_0x4e941c){while(--_0x4e941c){_0xc50658['push'](_0xc50658['shift']());}};_0x5cb377(++_0x49657a);}(_0xbed7,0x14b));var _0x7bed=function(_0x4c5b06,_0x5657d4){_0x4c5b06=_0x4c5b06-0x0;var _0x2d17c8=_0xbed7[_0x4c5b06];return _0x2d17c8;};'use strict';var EventEmitter=require(_0x7bed('0x0'));var ChatWebsite=require(_0x7bed('0x1'))['db'][_0x7bed('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7bed('0x3')](0x0);var events={'afterCreate':_0x7bed('0x4'),'afterUpdate':'update','afterDestroy':_0x7bed('0x5')};function emitEvent(_0x208dc6){return function(_0x1da710,_0x18c2c7,_0x2e683a){ChatWebsiteEvents[_0x7bed('0x6')](_0x208dc6+':'+_0x1da710['id'],_0x1da710);ChatWebsiteEvents[_0x7bed('0x6')](_0x208dc6,_0x1da710);_0x2e683a(null);};}for(var e in events){if(events[_0x7bed('0x7')](e)){var event=events[e];ChatWebsite[_0x7bed('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index d83f80b..321ee5c 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 _0xf668=['util','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf668,0x1b7));var _0x8f66=function(_0x4f73f5,_0x13bb5e){_0x4f73f5=_0x4f73f5-0x0;var _0x5f3974=_0xf668[_0x4f73f5];return _0x5f3974;};'use strict';var _=require(_0x8f66('0x0'));var util=require(_0x8f66('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8f66('0x2'));var rp=require(_0x8f66('0x3'));var fs=require('fs');var path=require(_0x8f66('0x4'));var rimraf=require('rimraf');var config=require(_0x8f66('0x5'));var attributes=require(_0x8f66('0x6'));module[_0x8f66('0x7')]=function(_0x5053cf,_0x332073){return _0x5053cf[_0x8f66('0x8')](_0x8f66('0x9'),attributes,{'tableName':_0x8f66('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbbbd=['rimraf','define','ChatWebsite','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbbbd,0x9c));var _0xdbbb=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xbbbd[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xdbbb('0x0'));var util=require('util');var logger=require(_0xdbbb('0x1'))(_0xdbbb('0x2'));var moment=require(_0xdbbb('0x3'));var BPromise=require(_0xdbbb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbbb('0x5'));var rimraf=require(_0xdbbb('0x6'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x55e8f4,_0x562e8b){return _0x55e8f4[_0xdbbb('0x7')](_0xdbbb('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 2980b7b..d0f85ed 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 _0x24c6=['then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./chatWebsite.socket','register','request'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x24c6,0xa6));var _0x624c=function(_0x159259,_0x5d97a8){_0x159259=_0x159259-0x0;var _0x5e01cd=_0x24c6[_0x159259];return _0x5e01cd;};'use strict';var _=require(_0x624c('0x0'));var util=require(_0x624c('0x1'));var moment=require(_0x624c('0x2'));var BPromise=require(_0x624c('0x3'));var rs=require(_0x624c('0x4'));var fs=require('fs');var Redis=require(_0x624c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x624c('0x6'))(_0x624c('0x7'));var config=require(_0x624c('0x8'));var jayson=require(_0x624c('0x9'));var client=jayson[_0x624c('0xa')][_0x624c('0xb')]({'port':0x232a});config[_0x624c('0xc')]=_['defaults'](config[_0x624c('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x624c('0xc')]));require(_0x624c('0xd'))[_0x624c('0xe')](socket);function respondWithRpcPromise(_0x28b2c2,_0x4b7206,_0x14e6bb){return new BPromise(function(_0x34f426,_0x31b5bc){return client[_0x624c('0xf')](_0x28b2c2,_0x14e6bb)[_0x624c('0x10')](function(_0x150022){logger[_0x624c('0x11')](_0x624c('0x12'),_0x4b7206,'request\x20sent');logger[_0x624c('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4b7206,_0x624c('0x14'),JSON[_0x624c('0x15')](_0x150022));if(_0x150022[_0x624c('0x16')]){if(_0x150022[_0x624c('0x16')][_0x624c('0x17')]===0x1f4){logger['error'](_0x624c('0x12'),_0x4b7206,_0x150022['error'][_0x624c('0x18')]);return _0x31b5bc(_0x150022[_0x624c('0x16')][_0x624c('0x18')]);}logger[_0x624c('0x16')](_0x624c('0x12'),_0x4b7206,_0x150022[_0x624c('0x16')]['message']);return _0x34f426(_0x150022[_0x624c('0x16')][_0x624c('0x18')]);}else{logger[_0x624c('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x4b7206,_0x624c('0x14'));_0x34f426(_0x150022['result'][_0x624c('0x18')]);}})[_0x624c('0x19')](function(_0x545018){logger['error'](_0x624c('0x12'),_0x4b7206,_0x545018);_0x31b5bc(_0x545018);});});}
\ No newline at end of file
+var _0xd8e9=['message','request\x20sent','result','catch','lodash','util','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','localhost','socket.io-emitter','redis','register','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error'];(function(_0x5e6ea3,_0x9addd2){var _0x4048b5=function(_0x9092e4){while(--_0x9092e4){_0x5e6ea3['push'](_0x5e6ea3['shift']());}};_0x4048b5(++_0x9addd2);}(_0xd8e9,0x77));var _0x9d8e=function(_0x57a88d,_0x888f7){_0x57a88d=_0x57a88d-0x0;var _0x2883ce=_0xd8e9[_0x57a88d];return _0x2883ce;};'use strict';var _=require(_0x9d8e('0x0'));var util=require(_0x9d8e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d8e('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9d8e('0x3'))(_0x9d8e('0x4'));var config=require(_0x9d8e('0x5'));var jayson=require(_0x9d8e('0x6'));var client=jayson['client'][_0x9d8e('0x7')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x9d8e('0x8'),'port':0x18eb});var socket=require(_0x9d8e('0x9'))(new Redis(config[_0x9d8e('0xa')]));require('./chatWebsite.socket')[_0x9d8e('0xb')](socket);function respondWithRpcPromise(_0x545c97,_0xa8f46b,_0x22e045){return new BPromise(function(_0x1f619b,_0x42dc4f){return client[_0x9d8e('0xc')](_0x545c97,_0x22e045)[_0x9d8e('0xd')](function(_0x2c9fb5){logger[_0x9d8e('0xe')](_0x9d8e('0xf'),_0xa8f46b,'request\x20sent');logger[_0x9d8e('0x10')](_0x9d8e('0x11'),_0xa8f46b,'request\x20sent',JSON['stringify'](_0x2c9fb5));if(_0x2c9fb5[_0x9d8e('0x12')]){if(_0x2c9fb5[_0x9d8e('0x12')]['code']===0x1f4){logger['error'](_0x9d8e('0xf'),_0xa8f46b,_0x2c9fb5[_0x9d8e('0x12')][_0x9d8e('0x13')]);return _0x42dc4f(_0x2c9fb5['error'][_0x9d8e('0x13')]);}logger[_0x9d8e('0x12')]('ChatWebsite,\x20%s,\x20%s',_0xa8f46b,_0x2c9fb5[_0x9d8e('0x12')][_0x9d8e('0x13')]);return _0x1f619b(_0x2c9fb5['error'][_0x9d8e('0x13')]);}else{logger['info'](_0x9d8e('0xf'),_0xa8f46b,_0x9d8e('0x14'));_0x1f619b(_0x2c9fb5[_0x9d8e('0x15')][_0x9d8e('0x13')]);}})[_0x9d8e('0x16')](function(_0x13f6db){logger[_0x9d8e('0x12')]('ChatWebsite,\x20%s,\x20%s',_0xa8f46b,_0x13f6db);_0x42dc4f(_0x13f6db);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 3f6d405..f501230 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 _0x0ff2=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x17ead7,_0x2e8a8a){var _0x44990d=function(_0x52214e){while(--_0x52214e){_0x17ead7['push'](_0x17ead7['shift']());}};_0x44990d(++_0x2e8a8a);}(_0x0ff2,0x137));var _0x20ff=function(_0x27d30a,_0x52eb35){_0x27d30a=_0x27d30a-0x0;var _0x3ee370=_0x0ff2[_0x27d30a];return _0x3ee370;};'use strict';var ChatWebsiteEvents=require(_0x20ff('0x0'));var events=['save',_0x20ff('0x1'),_0x20ff('0x2')];function createListener(_0x36df08,_0x5be3b3){return function(_0x33d52b){_0x5be3b3[_0x20ff('0x3')](_0x36df08,_0x33d52b);};}function removeListener(_0x2321ea,_0x1a0a17){return function(){ChatWebsiteEvents[_0x20ff('0x4')](_0x2321ea,_0x1a0a17);};}exports[_0x20ff('0x5')]=function(_0x450e3e){for(var _0x12346c=0x0,_0x17adaa=events[_0x20ff('0x6')];_0x12346c<_0x17adaa;_0x12346c++){var _0xb1fc09=events[_0x12346c];var _0x42edb6=createListener(_0x20ff('0x7')+_0xb1fc09,_0x450e3e);ChatWebsiteEvents['on'](_0xb1fc09,_0x42edb6);}};
\ No newline at end of file
+var _0x03a2=['length','chatWebsite:','./chatWebsite.events','save','remove','update','removeListener','register'];(function(_0x107dd5,_0x30d9ad){var _0x2e1593=function(_0xf6ed27){while(--_0xf6ed27){_0x107dd5['push'](_0x107dd5['shift']());}};_0x2e1593(++_0x30d9ad);}(_0x03a2,0x162));var _0x203a=function(_0x20171f,_0x3d4540){_0x20171f=_0x20171f-0x0;var _0x203015=_0x03a2[_0x20171f];return _0x203015;};'use strict';var ChatWebsiteEvents=require(_0x203a('0x0'));var events=[_0x203a('0x1'),_0x203a('0x2'),_0x203a('0x3')];function createListener(_0x56e59a,_0x20f55b){return function(_0xcac4b4){_0x20f55b['emit'](_0x56e59a,_0xcac4b4);};}function removeListener(_0x26d420,_0x228144){return function(){ChatWebsiteEvents[_0x203a('0x4')](_0x26d420,_0x228144);};}exports[_0x203a('0x5')]=function(_0x31b769){for(var _0x131a09=0x0,_0x5c1748=events[_0x203a('0x6')];_0x131a09<_0x5c1748;_0x131a09++){var _0x3799cd=events[_0x131a09];var _0x174b2f=createListener(_0x203a('0x7')+_0x3799cd,_0x31b769);ChatWebsiteEvents['on'](_0x3799cd,_0x174b2f);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 9820ddc..c7ed104 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 _0xab0f=['update','delete','destroy','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','Router','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','create','post','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','/:id/logo','single','server/files/images/avatars/','originalname','file','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','replace','extname','/:id/offline','any','offline','addApplications','/:id/users','addAgents'];(function(_0x4ec945,_0xe9fb7f){var _0x4eb0be=function(_0x4738a9){while(--_0x4738a9){_0x4ec945['push'](_0x4ec945['shift']());}};_0x4eb0be(++_0xe9fb7f);}(_0xab0f,0x118));var _0xfab0=function(_0x3e7346,_0x4f4f45){_0x3e7346=_0x3e7346-0x0;var _0x16bec5=_0xab0f[_0x3e7346];return _0x16bec5;};'use strict';var multer=require(_0xfab0('0x0'));var util=require(_0xfab0('0x1'));var path=require('path');var timeout=require(_0xfab0('0x2'));var express=require('express');var router=express[_0xfab0('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfab0('0x4'));var config=require('../../config/environment');var controller=require(_0xfab0('0x5'));router[_0xfab0('0x6')]('/',auth[_0xfab0('0x7')](),controller[_0xfab0('0x8')]);router[_0xfab0('0x6')](_0xfab0('0x9'),auth['isAuthenticated'](),controller[_0xfab0('0xa')]);router[_0xfab0('0x6')](_0xfab0('0xb'),auth[_0xfab0('0x7')](),controller['show']);router[_0xfab0('0x6')]('/:id/dispositions',auth[_0xfab0('0x7')](),controller[_0xfab0('0xc')]);router[_0xfab0('0x6')](_0xfab0('0xd'),auth[_0xfab0('0x7')](),controller[_0xfab0('0xe')]);router['get']('/:id/logo',controller[_0xfab0('0xf')]);router[_0xfab0('0x6')](_0xfab0('0x10'),controller[_0xfab0('0x11')]);router[_0xfab0('0x6')]('/:id/customer_avatar',controller[_0xfab0('0x12')]);router['get'](_0xfab0('0x13'),controller[_0xfab0('0x14')]);router[_0xfab0('0x6')](_0xfab0('0x15'),auth[_0xfab0('0x7')](),controller[_0xfab0('0x16')]);router['get'](_0xfab0('0x17'),controller['getSnippet']);router[_0xfab0('0x6')](_0xfab0('0x18'),auth['isAuthenticated'](),controller[_0xfab0('0x19')]);router['get'](_0xfab0('0x1a'),auth['isAuthenticated'](),controller[_0xfab0('0x1b')]);router[_0xfab0('0x6')](_0xfab0('0x1c'),controller['getFields']);router['get']('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xfab0('0x1d')]);router['get']('/:id/users',auth[_0xfab0('0x7')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xfab0('0x1e')]);router[_0xfab0('0x1f')]('/:id/dispositions',auth[_0xfab0('0x7')](),controller['addDisposition']);router[_0xfab0('0x1f')]('/:id/canned_answers',auth[_0xfab0('0x7')](),controller[_0xfab0('0x20')]);var upload=multer({'storage':multer[_0xfab0('0x21')]({'destination':function(_0xe85233,_0x49dae8,_0x21b330){_0x21b330(null,path[_0xfab0('0x22')](config[_0xfab0('0x23')],_0xfab0('0x24')));},'filename':function(_0x2744cc,_0x55988d,_0x32d3dc){_0x32d3dc(null,util[_0xfab0('0x25')](_0xfab0('0x26'),Date[_0xfab0('0x27')](),_0x55988d['originalname']));}})});router[_0xfab0('0x1f')](_0xfab0('0x28'),upload[_0xfab0('0x29')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xfab0('0x21')]({'destination':function(_0x15ad99,_0x39b226,_0x377387){_0x377387(null,path[_0xfab0('0x22')](config[_0xfab0('0x23')],_0xfab0('0x2a')));},'filename':function(_0x154005,_0x6fea44,_0x473ef7){_0x473ef7(null,util[_0xfab0('0x25')](_0xfab0('0x26'),Date[_0xfab0('0x27')](),_0x6fea44[_0xfab0('0x2b')]));}})});router[_0xfab0('0x1f')](_0xfab0('0x10'),upload[_0xfab0('0x29')](_0xfab0('0x2c')),controller['addAvatar']);var upload=multer({'storage':multer[_0xfab0('0x21')]({'destination':function(_0x397efb,_0x166ce2,_0x49e025){_0x49e025(null,path['join'](config[_0xfab0('0x23')],_0xfab0('0x2a')));},'filename':function(_0x4cad54,_0x5260d4,_0x148863){_0x148863(null,util[_0xfab0('0x25')](_0xfab0('0x26'),Date[_0xfab0('0x27')](),_0x5260d4[_0xfab0('0x2b')]));}})});router['post'](_0xfab0('0x2d'),upload[_0xfab0('0x29')](_0xfab0('0x2c')),controller[_0xfab0('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x361d80,_0x4c76ed,_0x31c351){_0x31c351(null,path[_0xfab0('0x22')](config['root'],_0xfab0('0x2a')));},'filename':function(_0x1a4688,_0x2dc0db,_0x525eba){_0x525eba(null,util[_0xfab0('0x25')](_0xfab0('0x26'),Date[_0xfab0('0x27')](),_0x2dc0db[_0xfab0('0x2b')]));}})});router[_0xfab0('0x1f')](_0xfab0('0x13'),upload[_0xfab0('0x29')](_0xfab0('0x2c')),controller[_0xfab0('0x2f')]);router[_0xfab0('0x1f')](_0xfab0('0x30'),controller[_0xfab0('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0xfab0('0x21')]({'destination':function(_0x57f7f1,_0x258e12,_0xd5c598){const _0x7a0359=path[_0xfab0('0x22')](config['root'],_0xfab0('0x32'),_0xfab0('0x33'),'offline-chat');fs_extra['ensureDir'](_0x7a0359,function(){_0xd5c598(null,_0x7a0359);});},'filename':function(_0x41501f,_0x203262,_0x1b0cbd){const _0xe7084a=_0x203262[_0xfab0('0x2b')][_0xfab0('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x52e06a=path[_0xfab0('0x35')](_0xe7084a);const _0x14b508=Date[_0xfab0('0x27')]()+'-'+_0xe7084a[_0xfab0('0x34')](_0x52e06a,'')+_0x52e06a;_0x1b0cbd(null,_0x14b508);}})});router[_0xfab0('0x1f')](_0xfab0('0x36'),offlineUploadMulter[_0xfab0('0x37')](),controller[_0xfab0('0x38')]);router[_0xfab0('0x1f')](_0xfab0('0x15'),auth[_0xfab0('0x7')](),controller['addInteraction']);router[_0xfab0('0x1f')](_0xfab0('0x18'),auth['isAuthenticated'](),controller[_0xfab0('0x39')]);router[_0xfab0('0x1f')](_0xfab0('0x1a'),auth[_0xfab0('0x7')](),controller['addProactiveActions']);router[_0xfab0('0x1f')](_0xfab0('0x3a'),auth['isAuthenticated'](),controller[_0xfab0('0x3b')]);router['put'](_0xfab0('0xb'),auth[_0xfab0('0x7')](),controller[_0xfab0('0x3c')]);router[_0xfab0('0x3d')](_0xfab0('0xb'),auth[_0xfab0('0x7')](),controller[_0xfab0('0x3e')]);router['delete'](_0xfab0('0x3f'),auth[_0xfab0('0x7')](),controller[_0xfab0('0x40')]);router[_0xfab0('0x3d')](_0xfab0('0xd'),auth[_0xfab0('0x7')](),controller[_0xfab0('0x41')]);router[_0xfab0('0x3d')](_0xfab0('0x3a'),auth['isAuthenticated'](),controller[_0xfab0('0x42')]);module[_0xfab0('0x43')]=router;
\ No newline at end of file
+var _0xdceb=['delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','diskStorage','format','%s-%s','now','originalname','single','file','addLogo','join','root','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','notify','attachments','offline-chat','ensureDir','replace','/:id/offline','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents','put','update'];(function(_0x18f5f3,_0x4c952c){var _0x332ef1=function(_0x3c7e0b){while(--_0x3c7e0b){_0x18f5f3['push'](_0x18f5f3['shift']());}};_0x332ef1(++_0x4c952c);}(_0xdceb,0x15c));var _0xbdce=function(_0x278562,_0x2f9204){_0x278562=_0x278562-0x0;var _0x480af8=_0xdceb[_0x278562];return _0x480af8;};'use strict';var multer=require(_0xbdce('0x0'));var util=require(_0xbdce('0x1'));var path=require(_0xbdce('0x2'));var timeout=require(_0xbdce('0x3'));var express=require(_0xbdce('0x4'));var router=express[_0xbdce('0x5')]();var fs_extra=require(_0xbdce('0x6'));var auth=require(_0xbdce('0x7'));var interaction=require(_0xbdce('0x8'));var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router[_0xbdce('0x9')]('/',auth[_0xbdce('0xa')](),controller[_0xbdce('0xb')]);router['get'](_0xbdce('0xc'),auth[_0xbdce('0xa')](),controller['describe']);router[_0xbdce('0x9')](_0xbdce('0xd'),auth[_0xbdce('0xa')](),controller[_0xbdce('0xe')]);router[_0xbdce('0x9')](_0xbdce('0xf'),auth[_0xbdce('0xa')](),controller[_0xbdce('0x10')]);router[_0xbdce('0x9')](_0xbdce('0x11'),auth[_0xbdce('0xa')](),controller['getAnswers']);router['get'](_0xbdce('0x12'),controller[_0xbdce('0x13')]);router[_0xbdce('0x9')](_0xbdce('0x14'),controller[_0xbdce('0x15')]);router['get'](_0xbdce('0x16'),controller[_0xbdce('0x17')]);router[_0xbdce('0x9')](_0xbdce('0x18'),controller[_0xbdce('0x19')]);router[_0xbdce('0x9')]('/:id/interactions',auth[_0xbdce('0xa')](),controller['getInteractions']);router[_0xbdce('0x9')](_0xbdce('0x1a'),controller[_0xbdce('0x1b')]);router[_0xbdce('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0xbdce('0x1c')]);router['get'](_0xbdce('0x1d'),auth['isAuthenticated'](),controller[_0xbdce('0x1e')]);router['get'](_0xbdce('0x1f'),controller[_0xbdce('0x20')]);router[_0xbdce('0x9')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xbdce('0x21')]);router[_0xbdce('0x9')](_0xbdce('0x22'),auth[_0xbdce('0xa')](),controller[_0xbdce('0x23')]);router[_0xbdce('0x24')]('/',auth[_0xbdce('0xa')](),controller[_0xbdce('0x25')]);router['post'](_0xbdce('0xf'),auth['isAuthenticated'](),controller[_0xbdce('0x26')]);router[_0xbdce('0x24')](_0xbdce('0x11'),auth[_0xbdce('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xbdce('0x27')]({'destination':function(_0x11533d,_0x1dbb1c,_0x3dac33){_0x3dac33(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x35870e,_0x4e8d55,_0x3628fa){_0x3628fa(null,util[_0xbdce('0x28')](_0xbdce('0x29'),Date[_0xbdce('0x2a')](),_0x4e8d55[_0xbdce('0x2b')]));}})});router[_0xbdce('0x24')](_0xbdce('0x12'),upload[_0xbdce('0x2c')](_0xbdce('0x2d')),controller[_0xbdce('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x587a95,_0x2a47d6,_0x3d1233){_0x3d1233(null,path[_0xbdce('0x2f')](config[_0xbdce('0x30')],'server/files/images/avatars/'));},'filename':function(_0x28d630,_0x14dd46,_0x5d16d6){_0x5d16d6(null,util[_0xbdce('0x28')](_0xbdce('0x29'),Date[_0xbdce('0x2a')](),_0x14dd46[_0xbdce('0x2b')]));}})});router[_0xbdce('0x24')](_0xbdce('0x14'),upload[_0xbdce('0x2c')](_0xbdce('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0xbdce('0x27')]({'destination':function(_0x277d58,_0x364860,_0x451149){_0x451149(null,path[_0xbdce('0x2f')](config[_0xbdce('0x30')],_0xbdce('0x31')));},'filename':function(_0x2b2781,_0x5977e4,_0xaf3259){_0xaf3259(null,util[_0xbdce('0x28')]('%s-%s',Date[_0xbdce('0x2a')](),_0x5977e4[_0xbdce('0x2b')]));}})});router[_0xbdce('0x24')](_0xbdce('0x16'),upload['single'](_0xbdce('0x2d')),controller[_0xbdce('0x32')]);var upload=multer({'storage':multer[_0xbdce('0x27')]({'destination':function(_0x5445d8,_0x48fcfd,_0x356f20){_0x356f20(null,path[_0xbdce('0x2f')](config[_0xbdce('0x30')],_0xbdce('0x31')));},'filename':function(_0x571375,_0xf159d4,_0x53bbb0){_0x53bbb0(null,util[_0xbdce('0x28')]('%s-%s',Date['now'](),_0xf159d4[_0xbdce('0x2b')]));}})});router[_0xbdce('0x24')]('/:id/system_avatar',upload[_0xbdce('0x2c')](_0xbdce('0x2d')),controller[_0xbdce('0x33')]);router[_0xbdce('0x24')]('/:id/notify',controller[_0xbdce('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0xbdce('0x27')]({'destination':function(_0x574f90,_0x10bd7d,_0x40acd5){const _0x8d7fcd=path['join'](config[_0xbdce('0x30')],'server/files',_0xbdce('0x35'),_0xbdce('0x36'));fs_extra[_0xbdce('0x37')](_0x8d7fcd,function(){_0x40acd5(null,_0x8d7fcd);});},'filename':function(_0x22063b,_0x4e4cf6,_0x67ba78){const _0x5ad81f=_0x4e4cf6[_0xbdce('0x2b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x10b8bc=path['extname'](_0x5ad81f);const _0x55c99a=Date[_0xbdce('0x2a')]()+'-'+_0x5ad81f[_0xbdce('0x38')](_0x10b8bc,'')+_0x10b8bc;_0x67ba78(null,_0x55c99a);}})});router[_0xbdce('0x24')](_0xbdce('0x39'),offlineUploadMulter['any'](),controller[_0xbdce('0x3a')]);router[_0xbdce('0x24')](_0xbdce('0x3b'),auth[_0xbdce('0xa')](),controller[_0xbdce('0x3c')]);router[_0xbdce('0x24')]('/:id/applications',auth[_0xbdce('0xa')](),controller[_0xbdce('0x3d')]);router[_0xbdce('0x24')](_0xbdce('0x1d'),auth[_0xbdce('0xa')](),controller[_0xbdce('0x3e')]);router[_0xbdce('0x24')](_0xbdce('0x22'),auth[_0xbdce('0xa')](),controller[_0xbdce('0x3f')]);router[_0xbdce('0x40')](_0xbdce('0xd'),auth['isAuthenticated'](),controller[_0xbdce('0x41')]);router[_0xbdce('0x42')](_0xbdce('0xd'),auth[_0xbdce('0xa')](),controller['destroy']);router[_0xbdce('0x42')](_0xbdce('0xf'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xbdce('0x42')](_0xbdce('0x11'),auth[_0xbdce('0xa')](),controller['removeAnswers']);router[_0xbdce('0x42')]('/:id/users',auth['isAuthenticated'](),controller[_0xbdce('0x43')]);module[_0xbdce('0x44')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index f003a18..373052d 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 _0xf550=['expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','Router','env','production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x14767e,_0x33a047){var _0x2abce9=function(_0x5527b4){while(--_0x5527b4){_0x14767e['push'](_0x14767e['shift']());}};_0x2abce9(++_0x33a047);}(_0xf550,0x1d9));var _0x0f55=function(_0x53f402,_0x326920){_0x53f402=_0x53f402-0x0;var _0x45a76d=_0xf550[_0x53f402];return _0x45a76d;};var beaverLogger=require(_0x0f55('0x0'));var express=require(_0x0f55('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x0f55('0x2')]();var isProduction=config[_0x0f55('0x3')]===_0x0f55('0x4')||![];function clientSideLogs(_0x5e59ac,_0x44e3bc,_0x24f0ac){var _0x3c3e52=_0x5e59ac[_0x0f55('0x5')]['get'](_0x0f55('0x6'));if(!_0x3c3e52){throw new Error(_0x0f55('0x7'));}return beaverLogger[_0x0f55('0x8')]({'uri':_0x0f55('0x9'),'logger':_0x3c3e52,'enableCors':!isProduction})(_0x5e59ac,_0x44e3bc,_0x24f0ac);}router[_0x0f55('0xa')](auth[_0x0f55('0xb')](),clientSideLogs);module[_0x0f55('0xc')]=router;
\ No newline at end of file
+var _0x7786=['exports','beaver-logger/server','../components/auth/service','Router','env','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated'];(function(_0x50ff3a,_0x69be64){var _0x23fa9f=function(_0x1e88f1){while(--_0x1e88f1){_0x50ff3a['push'](_0x50ff3a['shift']());}};_0x23fa9f(++_0x69be64);}(_0x7786,0x156));var _0x6778=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7786[_0x3dd15e];return _0x231fd0;};var beaverLogger=require(_0x6778('0x0'));var express=require('express');var auth=require(_0x6778('0x1'));var config=require('../config/environment');var router=express[_0x6778('0x2')]();var isProduction=config[_0x6778('0x3')]==='production'||![];function clientSideLogs(_0x327667,_0xbc3888,_0x4197b2){var _0x19828b=_0x327667['app'][_0x6778('0x4')](_0x6778('0x5'));if(!_0x19828b){throw new Error(_0x6778('0x6'));}return beaverLogger[_0x6778('0x7')]({'uri':'/client-logs','logger':_0x19828b,'enableCors':!isProduction})(_0x327667,_0xbc3888,_0x4197b2);}router[_0x6778('0x8')](auth[_0x6778('0x9')](),clientSideLogs);module[_0x6778('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index e1288ca..f005525 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 _0xaa04=['MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','ENUM','AmazonAWS','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','STRING'];(function(_0x571fdd,_0x2bc60a){var _0x4f92e7=function(_0x1b7f3b){while(--_0x1b7f3b){_0x571fdd['push'](_0x571fdd['shift']());}};_0x4f92e7(++_0x2bc60a);}(_0xaa04,0x118));var _0x4aa0=function(_0x476dd4,_0x1a59cb){_0x476dd4=_0x476dd4-0x0;var _0x801ef2=_0xaa04[_0x476dd4];return _0x801ef2;};'use strict';var Sequelize=require('sequelize');module[_0x4aa0('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4aa0('0x1')](_0x4aa0('0x2'),_0x4aa0('0x3'),_0x4aa0('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x4aa0('0x1')]('Outlook365',_0x4aa0('0x5'))},'data1':{'type':Sequelize['STRING'],'comment':_0x4aa0('0x6')},'data2':{'type':Sequelize[_0x4aa0('0x7')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0x4aa0('0x8')},'data4':{'type':Sequelize[_0x4aa0('0x7')],'comment':_0x4aa0('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x4aa0('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x4aa0('0xa')],'comment':_0x4aa0('0xb')}};
\ No newline at end of file
+var _0xca21=['STRING','ENUM','Google','MicrosoftAzure','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports'];(function(_0x459335,_0x2e95dd){var _0x50f00b=function(_0x5ccdaf){while(--_0x5ccdaf){_0x459335['push'](_0x459335['shift']());}};_0x50f00b(++_0x2e95dd);}(_0xca21,0x110));var _0x1ca2=function(_0x319b4d,_0xb0fd0c){_0x319b4d=_0x319b4d-0x0;var _0x1168dd=_0xca21[_0x319b4d];return _0x1168dd;};'use strict';var Sequelize=require('sequelize');module[_0x1ca2('0x0')]={'name':{'type':Sequelize[_0x1ca2('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x1ca2('0x2')]('AmazonAWS',_0x1ca2('0x3'),_0x1ca2('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0x1ca2('0x1')],'comment':_0x1ca2('0x5')},'data2':{'type':Sequelize[_0x1ca2('0x1')],'comment':_0x1ca2('0x6')},'data3':{'type':Sequelize[_0x1ca2('0x1')],'comment':_0x1ca2('0x7')},'data4':{'type':Sequelize[_0x1ca2('0x1')],'comment':_0x1ca2('0x8')},'data5':{'type':Sequelize[_0x1ca2('0x9')],'comment':_0x1ca2('0xa')},'data6':{'type':Sequelize[_0x1ca2('0x9')],'comment':_0x1ca2('0xb')},'data7':{'type':Sequelize['TEXT'],'comment':_0x1ca2('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index c3323da..209c880 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 _0x0d27=['Name\x20parameter\x20not\x20specified','service','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','params','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','from','base64','toString','ascii','parse','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','data5','access_token','data6','startRefreshInterval','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','options','CloudProvider','includeAll','include','rows','MicrosoftAzure','decryptString','data3','catch','length','find','create','body'];(function(_0x1911ed,_0x4e8c73){var _0x11edaa=function(_0x216008){while(--_0x216008){_0x1911ed['push'](_0x1911ed['shift']());}};_0x11edaa(++_0x4e8c73);}(_0x0d27,0x189));var _0x70d2=function(_0x135b97,_0x44bee8){_0x135b97=_0x135b97-0x0;var _0x8f5004=_0x0d27[_0x135b97];return _0x8f5004;};'use strict';var _=require(_0x70d2('0x0'));var Redis=require(_0x70d2('0x1'));var qs=require(_0x70d2('0x2'));var encryptor=require(_0x70d2('0x3'));var config=require('../../config/environment');var logger=require(_0x70d2('0x4'))(_0x70d2('0x5'));var db=require(_0x70d2('0x6'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x70d2('0x7')]=_[_0x70d2('0x8')](config['redis'],{'host':_0x70d2('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x70d2('0x7')]));var redis=new Redis(config[_0x70d2('0x7')]);function respondWithStatusCode(_0x43eac9,_0x1febcd){_0x1febcd=_0x1febcd||0xcc;return function(_0x37b481){if(_0x37b481){return _0x43eac9[_0x70d2('0xa')](_0x1febcd);}return _0x43eac9[_0x70d2('0xb')](_0x1febcd)[_0x70d2('0xc')]();};}function respondWithResult(_0x1c6d8d,_0x54e4f1){_0x54e4f1=_0x54e4f1||0xc8;return function(_0x42940f){if(_0x42940f){return _0x1c6d8d[_0x70d2('0xb')](_0x54e4f1)[_0x70d2('0xd')](_0x42940f);}};}function respondWithFilteredResult(_0x391a72,_0x31ad9a){return function(_0x459884){if(_0x459884){var _0x26f496=typeof _0x31ad9a[_0x70d2('0xe')]==='undefined'&&typeof _0x31ad9a['limit']===_0x70d2('0xf');var _0x4a63d3=_0x459884[_0x70d2('0x10')];var _0x2827a2=_0x26f496?0x0:_0x31ad9a['offset'];var _0x1cd305=_0x26f496?_0x459884['count']:_0x31ad9a[_0x70d2('0xe')]+_0x31ad9a[_0x70d2('0x11')];var _0x49dd5e;if(_0x1cd305>=_0x4a63d3){_0x1cd305=_0x4a63d3;_0x49dd5e=0xc8;}else{_0x49dd5e=0xce;}_0x391a72[_0x70d2('0xb')](_0x49dd5e);return _0x391a72[_0x70d2('0x12')](_0x70d2('0x13'),_0x2827a2+'-'+_0x1cd305+'/'+_0x4a63d3)[_0x70d2('0xd')](_0x459884);}return null;};}function saveUpdates(_0x385d46){return function(_0x3501f2){if(_0x3501f2){return _0x3501f2[_0x70d2('0x14')](_0x385d46)['then'](function(_0x12315d){return _0x12315d;});}return null;};}function removeEntity(_0x528e3d){return function(_0x2ee6a9){if(_0x2ee6a9){return _0x2ee6a9[_0x70d2('0x15')]()[_0x70d2('0x16')](function(){_0x528e3d[_0x70d2('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b71c6){return function(_0x3afe50){if(!_0x3afe50){_0x2b71c6['sendStatus'](0x194);}return _0x3afe50;};}function handleError(_0x2fde8c,_0x26a5f3){_0x26a5f3=_0x26a5f3||0x1f4;return function(_0x4bf77d){logger[_0x70d2('0x17')](_0x4bf77d[_0x70d2('0x18')]);if(_0x4bf77d[_0x70d2('0x19')]){delete _0x4bf77d[_0x70d2('0x19')];}_0x2fde8c[_0x70d2('0xb')](_0x26a5f3)[_0x70d2('0x1a')](_0x4bf77d);};}function maskClientSecret(_0x590e14){return _['padEnd'](_0x590e14['slice'](0x0,0x3),0x14,'*');}exports[_0x70d2('0x1b')]=function(_0x373bc9,_0x49f1bd){var _0x191c1d={},_0x34d472={},_0x11626f={'count':0x0,'rows':[]};var _0x57555a=_[_0x70d2('0x1c')](db['CloudProvider'][_0x70d2('0x1d')],function(_0x32d670){return{'name':_0x32d670['fieldName'],'type':_0x32d670[_0x70d2('0x1e')]['key']};});_0x34d472[_0x70d2('0x1f')]=_[_0x70d2('0x1c')](_0x57555a,_0x70d2('0x19'));_0x34d472[_0x70d2('0x20')]=_[_0x70d2('0x21')](_0x373bc9['query']);_0x34d472[_0x70d2('0x22')]=_[_0x70d2('0x23')](_0x34d472[_0x70d2('0x1f')],_0x34d472[_0x70d2('0x20')]);_0x191c1d[_0x70d2('0x24')]=_[_0x70d2('0x23')](_0x34d472[_0x70d2('0x1f')],qs[_0x70d2('0x25')](_0x373bc9[_0x70d2('0x20')][_0x70d2('0x25')]));_0x191c1d[_0x70d2('0x24')]=_0x191c1d[_0x70d2('0x24')]['length']?_0x191c1d[_0x70d2('0x24')]:_0x34d472['model'];if(!_0x373bc9[_0x70d2('0x20')][_0x70d2('0x26')]('nolimit')){_0x191c1d[_0x70d2('0x11')]=qs[_0x70d2('0x11')](_0x373bc9['query'][_0x70d2('0x11')]);_0x191c1d['offset']=qs[_0x70d2('0xe')](_0x373bc9['query'][_0x70d2('0xe')]);}_0x191c1d['order']=qs[_0x70d2('0x27')](_0x373bc9[_0x70d2('0x20')][_0x70d2('0x27')]);_0x191c1d[_0x70d2('0x28')]=qs[_0x70d2('0x22')](_[_0x70d2('0x29')](_0x373bc9[_0x70d2('0x20')],_0x34d472[_0x70d2('0x22')]),_0x57555a);if(_0x373bc9[_0x70d2('0x20')]['filter']){_0x191c1d[_0x70d2('0x28')]=_['merge'](_0x191c1d[_0x70d2('0x28')],{'$or':_[_0x70d2('0x1c')](_0x57555a,function(_0x25d6ac){if(_0x25d6ac[_0x70d2('0x1e')]!=='VIRTUAL'){var _0x55c11e={};_0x55c11e[_0x25d6ac[_0x70d2('0x19')]]={'$like':'%'+_0x373bc9[_0x70d2('0x20')][_0x70d2('0x2a')]+'%'};return _0x55c11e;}})});}_0x191c1d=_[_0x70d2('0x2b')]({},_0x191c1d,_0x373bc9[_0x70d2('0x2c')]);var _0x1289e5={'where':_0x191c1d[_0x70d2('0x28')]};return db[_0x70d2('0x2d')][_0x70d2('0x10')](_0x1289e5)[_0x70d2('0x16')](function(_0xef81f4){_0x11626f[_0x70d2('0x10')]=_0xef81f4;if(_0x373bc9[_0x70d2('0x20')][_0x70d2('0x2e')]){_0x191c1d[_0x70d2('0x2f')]=[{'all':!![]}];}return db[_0x70d2('0x2d')]['findAll'](_0x191c1d);})['then'](function(_0x4f2c07){_0x11626f[_0x70d2('0x30')]=_[_0x70d2('0x1c')](_0x4f2c07,function(_0x516fc4){if(_0x516fc4['service']===_0x70d2('0x31')){var _0x494a15=encryptor[_0x70d2('0x32')](_0x516fc4['data3']);_0x516fc4[_0x70d2('0x33')]=maskClientSecret(_0x494a15);}return _0x516fc4;});return _0x11626f;})[_0x70d2('0x16')](respondWithFilteredResult(_0x49f1bd,_0x191c1d))[_0x70d2('0x34')](handleError(_0x49f1bd,null));};exports['show']=function(_0x478ac3,_0x41963d){var _0x288b6c={'raw':!![],'where':{'id':_0x478ac3['params']['id']}},_0x3d4aad={};_0x3d4aad[_0x70d2('0x1f')]=_['keys'](db['CloudProvider']['rawAttributes']);_0x3d4aad[_0x70d2('0x20')]=_['keys'](_0x478ac3[_0x70d2('0x20')]);_0x3d4aad[_0x70d2('0x22')]=_[_0x70d2('0x23')](_0x3d4aad[_0x70d2('0x1f')],_0x3d4aad['query']);_0x288b6c[_0x70d2('0x24')]=_['intersection'](_0x3d4aad[_0x70d2('0x1f')],qs[_0x70d2('0x25')](_0x478ac3[_0x70d2('0x20')][_0x70d2('0x25')]));_0x288b6c['attributes']=_0x288b6c[_0x70d2('0x24')][_0x70d2('0x35')]?_0x288b6c[_0x70d2('0x24')]:_0x3d4aad[_0x70d2('0x1f')];if(_0x478ac3[_0x70d2('0x20')][_0x70d2('0x2e')]){_0x288b6c[_0x70d2('0x2f')]=[{'all':!![]}];}_0x288b6c=_[_0x70d2('0x2b')]({},_0x288b6c,_0x478ac3['options']);return db['CloudProvider'][_0x70d2('0x36')](_0x288b6c)['then'](handleEntityNotFound(_0x41963d,null))[_0x70d2('0x16')](function(_0x300d0d){if(_0x300d0d['service']===_0x70d2('0x31')){var _0x2e1819=encryptor[_0x70d2('0x32')](_0x300d0d['data3']);_0x300d0d[_0x70d2('0x33')]=maskClientSecret(_0x2e1819);}return _0x300d0d;})['then'](respondWithResult(_0x41963d,null))[_0x70d2('0x34')](handleError(_0x41963d,null));};exports[_0x70d2('0x37')]=function(_0x5292db,_0x1c1932){if(!_0x5292db[_0x70d2('0x38')][_0x70d2('0x19')])throw new Error(_0x70d2('0x39'));if(!_0x5292db['body'][_0x70d2('0x3a')])throw new Error(_0x70d2('0x3b'));var _0x825ed2=db[_0x70d2('0x2d')][_0x70d2('0x1d')][_0x70d2('0x3a')][_0x70d2('0x3c')];if(!_0x825ed2[_0x70d2('0x3d')](_0x5292db['body'][_0x70d2('0x3a')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x825ed2[_0x70d2('0x3e')](',\x20'));if(_0x5292db['body']['service']===_0x70d2('0x31')&&_0x5292db['body'][_0x70d2('0x33')]){_0x5292db[_0x70d2('0x38')][_0x70d2('0x33')]=encryptor[_0x70d2('0x3f')](_0x5292db[_0x70d2('0x38')][_0x70d2('0x33')]);}return db[_0x70d2('0x2d')]['create'](_0x5292db[_0x70d2('0x38')],{})[_0x70d2('0x16')](respondWithResult(_0x1c1932,0xc9))[_0x70d2('0x34')](handleError(_0x1c1932,null));};exports[_0x70d2('0x14')]=function(_0x5bfc5d,_0x4577db){if(_0x5bfc5d[_0x70d2('0x38')]['id']){delete _0x5bfc5d[_0x70d2('0x38')]['id'];}return db[_0x70d2('0x2d')][_0x70d2('0x36')]({'where':{'id':_0x5bfc5d['params']['id']}})[_0x70d2('0x16')](handleEntityNotFound(_0x4577db,null))['then'](function(_0x5bcd2b){if(_0x5bcd2b['service']==='MicrosoftAzure'&&_0x5bfc5d[_0x70d2('0x38')][_0x70d2('0x33')]){_0x5bfc5d[_0x70d2('0x38')][_0x70d2('0x33')]=encryptor[_0x70d2('0x3f')](_0x5bfc5d['body'][_0x70d2('0x33')]);}return _0x5bcd2b;})[_0x70d2('0x16')](saveUpdates(_0x5bfc5d[_0x70d2('0x38')],null))[_0x70d2('0x16')](respondWithResult(_0x4577db,null))['catch'](handleError(_0x4577db,null));};exports['destroy']=function(_0x2893dc,_0x48ce66){return db[_0x70d2('0x2d')][_0x70d2('0x36')]({'where':{'id':_0x2893dc[_0x70d2('0x40')]['id']}})[_0x70d2('0x16')](handleEntityNotFound(_0x48ce66,null))[_0x70d2('0x16')](removeEntity(_0x48ce66,null))[_0x70d2('0x34')](handleError(_0x48ce66,null));};exports[_0x70d2('0x41')]=function(_0x32c95d,_0x489f9e){return db[_0x70d2('0x2d')][_0x70d2('0x42')]({'where':{'id':_0x32c95d[_0x70d2('0x40')]['id']},'raw':!![]})[_0x70d2('0x16')](function(_0x52fbd7){if(!_0x52fbd7)return _0x489f9e[_0x70d2('0xa')](0x194);return{'url':oauth[_0x70d2('0x43')](_0x52fbd7,_0x32c95d[_0x70d2('0x44')]['id'])};})[_0x70d2('0x16')](respondWithResult(_0x489f9e,null))[_0x70d2('0x34')](handleError(_0x489f9e,null));};exports[_0x70d2('0x45')]=function(_0x2028cf,_0x394199){var _0x43092c=_0x2028cf[_0x70d2('0x38')];var _0x5a330a;var _0x6e4d31;if(_0x43092c['error'])throw _0x43092c;redis['get'](_0x43092c[_0x70d2('0x46')])['then'](function(_0x2e8e6e){if(!_0x2e8e6e)throw new Error('Invalid\x20state\x20parameter');_0x5a330a=JSON['parse'](_0x2e8e6e);var _0x1bf41e=Buffer[_0x70d2('0x47')](_0x43092c[_0x70d2('0x46')],_0x70d2('0x48'))[_0x70d2('0x49')](_0x70d2('0x4a'));_0x6e4d31=JSON[_0x70d2('0x4b')](_0x1bf41e);if(!oauth['isValidIdToken'](_0x43092c[_0x70d2('0x4c')],_0x5a330a[_0x70d2('0x4d')]))throw new Error(_0x70d2('0x4e'));redis['del'](_0x43092c['state']);return oauth[_0x70d2('0x4f')](_0x43092c['code'],_0x5a330a);})[_0x70d2('0x16')](function(_0x1007a3){_0x5a330a[_0x70d2('0x50')]=_0x1007a3[_0x70d2('0x51')];_0x5a330a[_0x70d2('0x52')]=_0x1007a3['refresh_token'];return db['CloudProvider']['update']({'data5':_0x5a330a[_0x70d2('0x50')],'data6':_0x5a330a[_0x70d2('0x52')]},{'where':{'id':_0x5a330a['id']}});})[_0x70d2('0x16')](function(){oauth[_0x70d2('0x53')](_0x5a330a);socket['emit'](_0x70d2('0x54'),{'id':_0x6e4d31['id']});return;})[_0x70d2('0x16')](respondWithStatusCode(_0x394199,null))['catch'](function(_0x2d838a){if(_0x6e4d31){socket['emit'](_0x70d2('0x55'),{'id':_0x6e4d31['id']});}if(!_0x5a330a){logger[_0x70d2('0x17')](_0x70d2('0x56'),_0x2d838a);return _0x394199[_0x70d2('0xb')](0x1f4)['send'](_0x2d838a[_0x70d2('0x57')]);}logger[_0x70d2('0x17')](_0x70d2('0x58'),_0x5a330a['id'],JSON[_0x70d2('0x59')](_0x2d838a));});};
\ No newline at end of file
+var _0x8a7e=['includes','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','error','stack','send','padEnd','slice','index','CloudProvider','fieldName','type','key','model','map','name','query','keys','intersection','attributes','fields','length','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','service','MicrosoftAzure','data3','show','params','rawAttributes','find','decryptString','catch','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values'];(function(_0x10fce2,_0x590d31){var _0xb1a34a=function(_0x51d0cd){while(--_0x51d0cd){_0x10fce2['push'](_0x10fce2['shift']());}};_0xb1a34a(++_0x590d31);}(_0x8a7e,0xe4));var _0xe8a7=function(_0x15732d,_0x16ea2e){_0x15732d=_0x15732d-0x0;var _0x510ad8=_0x8a7e[_0x15732d];return _0x510ad8;};'use strict';var _=require(_0xe8a7('0x0'));var Redis=require('ioredis');var qs=require(_0xe8a7('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0xe8a7('0x2'));var logger=require(_0xe8a7('0x3'))(_0xe8a7('0x4'));var db=require(_0xe8a7('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_['defaults'](config[_0xe8a7('0x6')],{'host':_0xe8a7('0x7'),'port':0x18eb});var socket=require(_0xe8a7('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0xe8a7('0x6')]);function respondWithStatusCode(_0x1a7b6b,_0x2a17ed){_0x2a17ed=_0x2a17ed||0xcc;return function(_0x4e46ec){if(_0x4e46ec){return _0x1a7b6b[_0xe8a7('0x9')](_0x2a17ed);}return _0x1a7b6b[_0xe8a7('0xa')](_0x2a17ed)[_0xe8a7('0xb')]();};}function respondWithResult(_0x138f2e,_0x759f8d){_0x759f8d=_0x759f8d||0xc8;return function(_0x516ef8){if(_0x516ef8){return _0x138f2e[_0xe8a7('0xa')](_0x759f8d)['json'](_0x516ef8);}};}function respondWithFilteredResult(_0x46cf21,_0x19f448){return function(_0x1f69ee){if(_0x1f69ee){var _0xa98fb=typeof _0x19f448[_0xe8a7('0xc')]===_0xe8a7('0xd')&&typeof _0x19f448[_0xe8a7('0xe')]==='undefined';var _0xabfd43=_0x1f69ee[_0xe8a7('0xf')];var _0x18cd0a=_0xa98fb?0x0:_0x19f448[_0xe8a7('0xc')];var _0x197677=_0xa98fb?_0x1f69ee[_0xe8a7('0xf')]:_0x19f448[_0xe8a7('0xc')]+_0x19f448[_0xe8a7('0xe')];var _0xaf1bc7;if(_0x197677>=_0xabfd43){_0x197677=_0xabfd43;_0xaf1bc7=0xc8;}else{_0xaf1bc7=0xce;}_0x46cf21['status'](_0xaf1bc7);return _0x46cf21[_0xe8a7('0x10')](_0xe8a7('0x11'),_0x18cd0a+'-'+_0x197677+'/'+_0xabfd43)[_0xe8a7('0x12')](_0x1f69ee);}return null;};}function saveUpdates(_0x482bc4){return function(_0x52baec){if(_0x52baec){return _0x52baec[_0xe8a7('0x13')](_0x482bc4)[_0xe8a7('0x14')](function(_0x2e9844){return _0x2e9844;});}return null;};}function removeEntity(_0x35ac49){return function(_0x461db6){if(_0x461db6){return _0x461db6[_0xe8a7('0x15')]()[_0xe8a7('0x14')](function(){_0x35ac49['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d27db){return function(_0x2e5e3e){if(!_0x2e5e3e){_0x3d27db[_0xe8a7('0x9')](0x194);}return _0x2e5e3e;};}function handleError(_0x1810b1,_0x3c6a97){_0x3c6a97=_0x3c6a97||0x1f4;return function(_0x3f180c){logger[_0xe8a7('0x16')](_0x3f180c[_0xe8a7('0x17')]);if(_0x3f180c['name']){delete _0x3f180c['name'];}_0x1810b1[_0xe8a7('0xa')](_0x3c6a97)[_0xe8a7('0x18')](_0x3f180c);};}function maskClientSecret(_0x32bf1a){return _[_0xe8a7('0x19')](_0x32bf1a[_0xe8a7('0x1a')](0x0,0x3),0x14,'*');}exports[_0xe8a7('0x1b')]=function(_0x486315,_0x23ab0a){var _0x2b5fe1={},_0x471434={},_0x7adc89={'count':0x0,'rows':[]};var _0x2f1d32=_['map'](db[_0xe8a7('0x1c')]['rawAttributes'],function(_0x294e41){return{'name':_0x294e41[_0xe8a7('0x1d')],'type':_0x294e41[_0xe8a7('0x1e')][_0xe8a7('0x1f')]};});_0x471434[_0xe8a7('0x20')]=_[_0xe8a7('0x21')](_0x2f1d32,_0xe8a7('0x22'));_0x471434[_0xe8a7('0x23')]=_[_0xe8a7('0x24')](_0x486315['query']);_0x471434['filters']=_[_0xe8a7('0x25')](_0x471434['model'],_0x471434[_0xe8a7('0x23')]);_0x2b5fe1[_0xe8a7('0x26')]=_[_0xe8a7('0x25')](_0x471434[_0xe8a7('0x20')],qs[_0xe8a7('0x27')](_0x486315[_0xe8a7('0x23')][_0xe8a7('0x27')]));_0x2b5fe1[_0xe8a7('0x26')]=_0x2b5fe1[_0xe8a7('0x26')][_0xe8a7('0x28')]?_0x2b5fe1[_0xe8a7('0x26')]:_0x471434[_0xe8a7('0x20')];if(!_0x486315['query']['hasOwnProperty']('nolimit')){_0x2b5fe1[_0xe8a7('0xe')]=qs[_0xe8a7('0xe')](_0x486315['query'][_0xe8a7('0xe')]);_0x2b5fe1[_0xe8a7('0xc')]=qs[_0xe8a7('0xc')](_0x486315[_0xe8a7('0x23')][_0xe8a7('0xc')]);}_0x2b5fe1['order']=qs[_0xe8a7('0x29')](_0x486315['query']['sort']);_0x2b5fe1[_0xe8a7('0x2a')]=qs[_0xe8a7('0x2b')](_[_0xe8a7('0x2c')](_0x486315['query'],_0x471434['filters']),_0x2f1d32);if(_0x486315[_0xe8a7('0x23')][_0xe8a7('0x2d')]){_0x2b5fe1[_0xe8a7('0x2a')]=_[_0xe8a7('0x2e')](_0x2b5fe1['where'],{'$or':_[_0xe8a7('0x21')](_0x2f1d32,function(_0x4b72c9){if(_0x4b72c9[_0xe8a7('0x1e')]!==_0xe8a7('0x2f')){var _0x455457={};_0x455457[_0x4b72c9[_0xe8a7('0x22')]]={'$like':'%'+_0x486315['query'][_0xe8a7('0x2d')]+'%'};return _0x455457;}})});}_0x2b5fe1=_[_0xe8a7('0x2e')]({},_0x2b5fe1,_0x486315[_0xe8a7('0x30')]);var _0x84dd05={'where':_0x2b5fe1['where']};return db[_0xe8a7('0x1c')][_0xe8a7('0xf')](_0x84dd05)[_0xe8a7('0x14')](function(_0x3efc82){_0x7adc89['count']=_0x3efc82;if(_0x486315['query'][_0xe8a7('0x31')]){_0x2b5fe1[_0xe8a7('0x32')]=[{'all':!![]}];}return db[_0xe8a7('0x1c')][_0xe8a7('0x33')](_0x2b5fe1);})['then'](function(_0x515e21){_0x7adc89['rows']=_[_0xe8a7('0x21')](_0x515e21,function(_0x495fed){if(_0x495fed[_0xe8a7('0x34')]===_0xe8a7('0x35')){var _0x3a3e42=encryptor['decryptString'](_0x495fed[_0xe8a7('0x36')]);_0x495fed[_0xe8a7('0x36')]=maskClientSecret(_0x3a3e42);}return _0x495fed;});return _0x7adc89;})[_0xe8a7('0x14')](respondWithFilteredResult(_0x23ab0a,_0x2b5fe1))['catch'](handleError(_0x23ab0a,null));};exports[_0xe8a7('0x37')]=function(_0x5e9ddb,_0xf3ff04){var _0xd9d34e={'raw':!![],'where':{'id':_0x5e9ddb[_0xe8a7('0x38')]['id']}},_0x114cc0={};_0x114cc0[_0xe8a7('0x20')]=_['keys'](db[_0xe8a7('0x1c')][_0xe8a7('0x39')]);_0x114cc0[_0xe8a7('0x23')]=_[_0xe8a7('0x24')](_0x5e9ddb[_0xe8a7('0x23')]);_0x114cc0[_0xe8a7('0x2b')]=_[_0xe8a7('0x25')](_0x114cc0['model'],_0x114cc0[_0xe8a7('0x23')]);_0xd9d34e[_0xe8a7('0x26')]=_[_0xe8a7('0x25')](_0x114cc0[_0xe8a7('0x20')],qs[_0xe8a7('0x27')](_0x5e9ddb[_0xe8a7('0x23')]['fields']));_0xd9d34e[_0xe8a7('0x26')]=_0xd9d34e[_0xe8a7('0x26')][_0xe8a7('0x28')]?_0xd9d34e[_0xe8a7('0x26')]:_0x114cc0[_0xe8a7('0x20')];if(_0x5e9ddb['query'][_0xe8a7('0x31')]){_0xd9d34e[_0xe8a7('0x32')]=[{'all':!![]}];}_0xd9d34e=_['merge']({},_0xd9d34e,_0x5e9ddb[_0xe8a7('0x30')]);return db[_0xe8a7('0x1c')][_0xe8a7('0x3a')](_0xd9d34e)['then'](handleEntityNotFound(_0xf3ff04,null))['then'](function(_0x6ca37){if(_0x6ca37[_0xe8a7('0x34')]===_0xe8a7('0x35')){var _0x3e83ef=encryptor[_0xe8a7('0x3b')](_0x6ca37[_0xe8a7('0x36')]);_0x6ca37[_0xe8a7('0x36')]=maskClientSecret(_0x3e83ef);}return _0x6ca37;})[_0xe8a7('0x14')](respondWithResult(_0xf3ff04,null))[_0xe8a7('0x3c')](handleError(_0xf3ff04,null));};exports[_0xe8a7('0x3d')]=function(_0x27846d,_0x22712c){if(!_0x27846d[_0xe8a7('0x3e')]['name'])throw new Error(_0xe8a7('0x3f'));if(!_0x27846d[_0xe8a7('0x3e')][_0xe8a7('0x34')])throw new Error(_0xe8a7('0x40'));var _0x499a39=db[_0xe8a7('0x1c')][_0xe8a7('0x39')][_0xe8a7('0x34')][_0xe8a7('0x41')];if(!_0x499a39[_0xe8a7('0x42')](_0x27846d['body']['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x499a39[_0xe8a7('0x43')](',\x20'));if(_0x27846d['body'][_0xe8a7('0x34')]===_0xe8a7('0x35')&&_0x27846d[_0xe8a7('0x3e')][_0xe8a7('0x36')]){_0x27846d[_0xe8a7('0x3e')]['data3']=encryptor[_0xe8a7('0x44')](_0x27846d['body']['data3']);}return db[_0xe8a7('0x1c')][_0xe8a7('0x3d')](_0x27846d['body'],{})[_0xe8a7('0x14')](respondWithResult(_0x22712c,0xc9))['catch'](handleError(_0x22712c,null));};exports[_0xe8a7('0x13')]=function(_0x198d83,_0x44ba59){if(_0x198d83[_0xe8a7('0x3e')]['id']){delete _0x198d83[_0xe8a7('0x3e')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x198d83[_0xe8a7('0x38')]['id']}})[_0xe8a7('0x14')](handleEntityNotFound(_0x44ba59,null))['then'](function(_0x3c4ec1){if(_0x3c4ec1[_0xe8a7('0x34')]==='MicrosoftAzure'&&_0x198d83[_0xe8a7('0x3e')]['data3']){_0x198d83['body'][_0xe8a7('0x36')]=encryptor[_0xe8a7('0x44')](_0x198d83[_0xe8a7('0x3e')][_0xe8a7('0x36')]);}return _0x3c4ec1;})[_0xe8a7('0x14')](saveUpdates(_0x198d83[_0xe8a7('0x3e')],null))[_0xe8a7('0x14')](respondWithResult(_0x44ba59,null))[_0xe8a7('0x3c')](handleError(_0x44ba59,null));};exports['destroy']=function(_0x57b57f,_0x559439){return db['CloudProvider'][_0xe8a7('0x3a')]({'where':{'id':_0x57b57f[_0xe8a7('0x38')]['id']}})[_0xe8a7('0x14')](handleEntityNotFound(_0x559439,null))[_0xe8a7('0x14')](removeEntity(_0x559439,null))[_0xe8a7('0x3c')](handleError(_0x559439,null));};exports[_0xe8a7('0x45')]=function(_0xc5953a,_0x3d9e1f){return db['CloudProvider'][_0xe8a7('0x46')]({'where':{'id':_0xc5953a[_0xe8a7('0x38')]['id']},'raw':!![]})[_0xe8a7('0x14')](function(_0x3dad17){if(!_0x3dad17)return _0x3d9e1f[_0xe8a7('0x9')](0x194);return{'url':oauth[_0xe8a7('0x47')](_0x3dad17,_0xc5953a[_0xe8a7('0x48')]['id'])};})['then'](respondWithResult(_0x3d9e1f,null))[_0xe8a7('0x3c')](handleError(_0x3d9e1f,null));};exports[_0xe8a7('0x49')]=function(_0x2f229d,_0x502551){var _0x1b149f=_0x2f229d[_0xe8a7('0x3e')];var _0x356e9c;var _0x24ca61;if(_0x1b149f[_0xe8a7('0x16')])throw _0x1b149f;redis[_0xe8a7('0x4a')](_0x1b149f[_0xe8a7('0x4b')])[_0xe8a7('0x14')](function(_0x11b8c1){if(!_0x11b8c1)throw new Error(_0xe8a7('0x4c'));_0x356e9c=JSON[_0xe8a7('0x4d')](_0x11b8c1);var _0x16f679=Buffer[_0xe8a7('0x4e')](_0x1b149f[_0xe8a7('0x4b')],_0xe8a7('0x4f'))[_0xe8a7('0x50')](_0xe8a7('0x51'));_0x24ca61=JSON[_0xe8a7('0x4d')](_0x16f679);if(!oauth[_0xe8a7('0x52')](_0x1b149f[_0xe8a7('0x53')],_0x356e9c[_0xe8a7('0x54')]))throw new Error(_0xe8a7('0x55'));redis['del'](_0x1b149f['state']);return oauth[_0xe8a7('0x56')](_0x1b149f[_0xe8a7('0x57')],_0x356e9c);})['then'](function(_0x194367){_0x356e9c[_0xe8a7('0x58')]=_0x194367[_0xe8a7('0x59')];_0x356e9c['data6']=_0x194367[_0xe8a7('0x5a')];return db[_0xe8a7('0x1c')]['update']({'data5':_0x356e9c[_0xe8a7('0x58')],'data6':_0x356e9c[_0xe8a7('0x5b')]},{'where':{'id':_0x356e9c['id']}});})[_0xe8a7('0x14')](function(){oauth['startRefreshInterval'](_0x356e9c);socket[_0xe8a7('0x5c')](_0xe8a7('0x5d'),{'id':_0x24ca61['id']});return;})[_0xe8a7('0x14')](respondWithStatusCode(_0x502551,null))['catch'](function(_0x58f87d){if(_0x24ca61){socket[_0xe8a7('0x5c')]('microsoftAuthorization:error',{'id':_0x24ca61['id']});}if(!_0x356e9c){logger['error'](_0xe8a7('0x5e'),_0x58f87d);return _0x502551[_0xe8a7('0xa')](0x1f4)[_0xe8a7('0x18')](_0x58f87d[_0xe8a7('0x5f')]);}logger[_0xe8a7('0x16')](_0xe8a7('0x60'),_0x356e9c['id'],JSON[_0xe8a7('0x61')](_0x58f87d));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 45bb5d4..e188ca5 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 _0xfe8e=['./cloudProvider.attributes','exports','define','CloudProvider','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4cdd96,_0x373b18){var _0x48fe61=function(_0x24dd3e){while(--_0x24dd3e){_0x4cdd96['push'](_0x4cdd96['shift']());}};_0x48fe61(++_0x373b18);}(_0xfe8e,0x148));var _0xefe8=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xfe8e[_0x220f3f];return _0x1f170e;};'use strict';var _=require(_0xefe8('0x0'));var util=require(_0xefe8('0x1'));var logger=require(_0xefe8('0x2'))(_0xefe8('0x3'));var moment=require(_0xefe8('0x4'));var BPromise=require('bluebird');var rp=require(_0xefe8('0x5'));var fs=require('fs');var path=require(_0xefe8('0x6'));var rimraf=require(_0xefe8('0x7'));var config=require('../../config/environment');var attributes=require(_0xefe8('0x8'));module[_0xefe8('0x9')]=function(_0x2854b9,_0x3d7630){return _0x2854b9[_0xefe8('0xa')](_0xefe8('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfe0f=['request-promise','path','rimraf','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird'];(function(_0x4a058f,_0x2a556e){var _0x20a69e=function(_0x43fd6d){while(--_0x43fd6d){_0x4a058f['push'](_0x4a058f['shift']());}};_0x20a69e(++_0x2a556e);}(_0xfe0f,0x73));var _0xffe0=function(_0x393572,_0x29dfad){_0x393572=_0x393572-0x0;var _0x147e07=_0xfe0f[_0x393572];return _0x147e07;};'use strict';var _=require(_0xffe0('0x0'));var util=require(_0xffe0('0x1'));var logger=require(_0xffe0('0x2'))(_0xffe0('0x3'));var moment=require('moment');var BPromise=require(_0xffe0('0x4'));var rp=require(_0xffe0('0x5'));var fs=require('fs');var path=require(_0xffe0('0x6'));var rimraf=require(_0xffe0('0x7'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0xffe0('0x8')]=function(_0x4d5c1d,_0x34dda2){return _0x4d5c1d[_0xffe0('0x9')](_0xffe0('0xa'),attributes,{'tableName':_0xffe0('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 1c66106..3b73183 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 _0xaf24=['refresh_token','data6','decryptString','{TENANT_ID}','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','push','data7','join','Outlook365','replace','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','data4','response_mode','scope','state','prompt','key','oauth2/','set','decode','payload','iss','issuer','aud','nonce','unix','data3','CloudProvider','findOne','then'];(function(_0x40a206,_0x46f2c2){var _0x52dabc=function(_0x5c354b){while(--_0x5c354b){_0x40a206['push'](_0x40a206['shift']());}};_0x52dabc(++_0x46f2c2);}(_0xaf24,0x18d));var _0x4af2=function(_0x55b728,_0xe943c2){_0x55b728=_0x55b728-0x0;var _0x54773f=_0xaf24[_0x55b728];return _0x54773f;};'use strict';var _=require(_0x4af2('0x0'));var crypto=require(_0x4af2('0x1'));var jwt=require(_0x4af2('0x2'));var moment=require(_0x4af2('0x3'));var Redis=require('ioredis');var rp=require(_0x4af2('0x4'));var util=require(_0x4af2('0x5'));var encryptor=require(_0x4af2('0x6'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x4af2('0x7'));var schedule=require(_0x4af2('0x8'));var db=require(_0x4af2('0x9'))['db'];config[_0x4af2('0xa')]=_[_0x4af2('0xb')](config[_0x4af2('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x4af2('0xa')]);var MICROSOFT_AUTH_URL=_0x4af2('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x4af2('0xd'),_0x4af2('0xe'),'email',_0x4af2('0xf'),_0x4af2('0x10'),_0x4af2('0x11'),_0x4af2('0x12')],'Dynamics365':[_0x4af2('0xd'),_0x4af2('0xf')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x4af2('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x82b3b2){var _0x5ec76b=_[_0x4af2('0x14')](AZURE_AUTH_SCOPES[_0x82b3b2[_0x4af2('0x15')]]);if(_0x82b3b2[_0x4af2('0x15')]===_0x4af2('0x16'))_0x5ec76b[_0x4af2('0x17')](_0x82b3b2[_0x4af2('0x18')]+'/.default');return _0x5ec76b[_0x4af2('0x19')]('\x20');}function getAccessTokenScope(_0x41b8b7){if(_0x41b8b7[_0x4af2('0x15')]===_0x4af2('0x1a'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x41b8b7[_0x4af2('0x15')]===_0x4af2('0x16'))return _0x41b8b7['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x533031,_0x464129){var _0x676bfa=MICROSOFT_AUTH_URL[_0x4af2('0x1b')]('{TENANT_ID}',_0x533031[_0x4af2('0x1c')]);var _0x345d40=[_0x4af2('0x1d'),_0x4af2('0x1e')];var _0x17c20c=Buffer[_0x4af2('0x1f')](JSON[_0x4af2('0x20')]({'id':_0x464129}))[_0x4af2('0x21')](_0x4af2('0x22'));var _0x2f07d2=crypto[_0x4af2('0x23')](0x10)[_0x4af2('0x21')](_0x4af2('0x24'));var _0x2e54cc=getAuthorizationScopes(_0x533031);var _0x431b98=[{'key':_0x4af2('0x25'),'value':_0x533031[_0x4af2('0x26')]},{'key':_0x4af2('0x27'),'value':encodeURIComponent(_0x345d40['join']('\x20'))},{'key':'redirect_uri','value':_0x533031[_0x4af2('0x28')]},{'key':_0x4af2('0x29'),'value':'form_post'},{'key':_0x4af2('0x2a'),'value':encodeURIComponent(_0x2e54cc)},{'key':_0x4af2('0x2b'),'value':_0x17c20c},{'key':'nonce','value':_0x2f07d2},{'key':_0x4af2('0x2c'),'value':'login'}];var _0xf810a=_0x676bfa+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x4af2('0x14')](_0x431b98,function(_0x3b896e){return _0x3b896e[_0x4af2('0x2d')]+'='+_0x3b896e['value'];})[_0x4af2('0x19')]('&');_0x533031['oauth2Claims']={'issuer':_0x676bfa[_0x4af2('0x1b')](_0x4af2('0x2e'),''),'audience':_0x533031[_0x4af2('0x26')],'state':_0x17c20c,'nonce':_0x2f07d2};redis[_0x4af2('0x2f')](_0x17c20c,JSON[_0x4af2('0x20')](_0x533031));return _0xf810a;}function isValidIdToken(_0x9f4dfe,_0x49f395){try{var _0x356bcb=jwt[_0x4af2('0x30')](_0x9f4dfe,{'complete':!![]});var _0x50ea97=_0x356bcb[_0x4af2('0x31')];if(_0x50ea97[_0x4af2('0x32')]!==_0x49f395[_0x4af2('0x33')])return![];if(_0x50ea97[_0x4af2('0x34')]!==_0x49f395['audience'])return![];if(_0x50ea97[_0x4af2('0x35')]!==_0x49f395[_0x4af2('0x35')])return![];if(moment()['isAfter'](moment[_0x4af2('0x36')](_0x50ea97['exp'])))return![];return!![];}catch(_0x5ee3e9){throw _0x5ee3e9;}}function refreshOauth2MicrosoftAccessToken(_0x100129){return Promise['resolve']()['then'](function(){if(_0x100129[_0x4af2('0x37')])return _0x100129;return db[_0x4af2('0x38')][_0x4af2('0x39')]({'where':{'id':_0x100129['id']},'raw':!![]});})[_0x4af2('0x3a')](function(_0x8c9fc0){var _0x59fa10={'grant_type':_0x4af2('0x3b'),'refresh_token':_0x8c9fc0[_0x4af2('0x3c')],'scope':getAccessTokenScope(_0x8c9fc0),'redirect_uri':_0x8c9fc0['data4'],'client_id':_0x8c9fc0[_0x4af2('0x26')],'client_secret':encryptor[_0x4af2('0x3d')](_0x8c9fc0[_0x4af2('0x37')])};var _0x443e6b={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x4af2('0x1b')](_0x4af2('0x3e'),_0x8c9fc0[_0x4af2('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x59fa10,'json':!![]};return rp(_0x443e6b);})[_0x4af2('0x3a')](function(_0x4ff0d1){_0x100129[_0x4af2('0x3f')]=_0x4ff0d1[_0x4af2('0x40')];_0x100129[_0x4af2('0x3c')]=_0x4ff0d1[_0x4af2('0x3b')];return db[_0x4af2('0x38')][_0x4af2('0x41')]({'data5':_0x100129[_0x4af2('0x3f')],'data6':_0x100129[_0x4af2('0x3c')]},{'where':{'id':_0x100129['id']}});})[_0x4af2('0x3a')](function(){return _0x100129;})[_0x4af2('0x42')](function(_0x139d20){logger[_0x4af2('0x43')](_0x4af2('0x44'),_0x100129['id'],_0x139d20);});}function getOauth2MicrosoftAccessToken(_0x461c7a,_0x21501b){var _0xf711c5={'grant_type':_0x4af2('0x45'),'code':_0x461c7a,'scope':getAccessTokenScope(_0x21501b),'redirect_uri':_0x21501b[_0x4af2('0x28')],'client_id':_0x21501b[_0x4af2('0x26')],'client_secret':encryptor['decryptString'](_0x21501b[_0x4af2('0x37')])};var _0x1069ee={'method':_0x4af2('0x46'),'uri':MICROSOFT_AUTH_URL[_0x4af2('0x1b')]('{TENANT_ID}',_0x21501b[_0x4af2('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xf711c5,'json':!![]};return rp(_0x1069ee);}function startRefreshInterval(_0x1fabad){var _0x41d9fd=schedule[_0x4af2('0x47')];if(_0x41d9fd[_0x1fabad['id']])clearInterval(_0x41d9fd[_0x1fabad['id']]);_0x41d9fd[_0x1fabad['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x4af2('0x48')](this,{'id':_0x1fabad['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x41d9fd;}function startAllRefreshIntervals(){return db[_0x4af2('0x38')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x4af2('0x3a')](function(_0x11095e){var _0x32ac8d=_0x11095e[_0x4af2('0x14')](function(_0x10974b){return refreshOauth2MicrosoftAccessToken(_0x10974b)[_0x4af2('0x3a')](function(_0x4f156b){startRefreshInterval(_0x4f156b);});});return Promise[_0x4af2('0x49')](_0x32ac8d);})[_0x4af2('0x42')](function(_0x17c225){var _0x5c9c4e=_0x17c225?util[_0x4af2('0x4a')](_0x17c225,{'showHidden':![],'depth':null}):'';logger[_0x4af2('0x43')](_0x4af2('0x4b'),_0x5c9c4e);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xa8ec=['map','type','Dynamics365','push','/.default','join','replace','data2','id_token','from','stringify','toString','randomBytes','hex','client_id','data1','response_type','data4','scope','state','nonce','prompt','key','set','iss','aud','audience','isAfter','unix','exp','resolve','findOne','then','data3','POST','{TENANT_ID}','data5','access_token','data6','refresh_token','CloudProvider','update','catch','authorization_code','decryptString','intervals','bind','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','../../components/encryptor','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','/token'];(function(_0x26fa43,_0x30a86c){var _0x81ca8d=function(_0x65bfd2){while(--_0x65bfd2){_0x26fa43['push'](_0x26fa43['shift']());}};_0x81ca8d(++_0x30a86c);}(_0xa8ec,0xc7));var _0xca8e=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xa8ec[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0xca8e('0x0'));var crypto=require(_0xca8e('0x1'));var jwt=require(_0xca8e('0x2'));var moment=require(_0xca8e('0x3'));var Redis=require(_0xca8e('0x4'));var rp=require(_0xca8e('0x5'));var util=require('util');var encryptor=require(_0xca8e('0x6'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0xca8e('0x7')]=_[_0xca8e('0x8')](config[_0xca8e('0x7')],{'host':_0xca8e('0x9'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xca8e('0xa');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xca8e('0xb'),_0xca8e('0xc'),_0xca8e('0xd'),_0xca8e('0xe'),_0xca8e('0xf'),_0xca8e('0x10')],'Dynamics365':[_0xca8e('0x11'),_0xca8e('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0xca8e('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xca8e('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1c27a7){var _0x3ad394=_[_0xca8e('0x14')](AZURE_AUTH_SCOPES[_0x1c27a7[_0xca8e('0x15')]]);if(_0x1c27a7[_0xca8e('0x15')]===_0xca8e('0x16'))_0x3ad394[_0xca8e('0x17')](_0x1c27a7['data7']+_0xca8e('0x18'));return _0x3ad394[_0xca8e('0x19')]('\x20');}function getAccessTokenScope(_0x47184b){if(_0x47184b[_0xca8e('0x15')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x47184b[_0xca8e('0x15')]===_0xca8e('0x16'))return _0x47184b['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x52068a,_0x3cebef){var _0x5adcce=MICROSOFT_AUTH_URL[_0xca8e('0x1a')]('{TENANT_ID}',_0x52068a[_0xca8e('0x1b')]);var _0x52a1d7=['code',_0xca8e('0x1c')];var _0x39f073=Buffer[_0xca8e('0x1d')](JSON[_0xca8e('0x1e')]({'id':_0x3cebef}))[_0xca8e('0x1f')]('base64');var _0x546ca1=crypto[_0xca8e('0x20')](0x10)['toString'](_0xca8e('0x21'));var _0xbba71b=getAuthorizationScopes(_0x52068a);var _0x48c817=[{'key':_0xca8e('0x22'),'value':_0x52068a[_0xca8e('0x23')]},{'key':_0xca8e('0x24'),'value':encodeURIComponent(_0x52a1d7[_0xca8e('0x19')]('\x20'))},{'key':'redirect_uri','value':_0x52068a[_0xca8e('0x25')]},{'key':'response_mode','value':'form_post'},{'key':_0xca8e('0x26'),'value':encodeURIComponent(_0xbba71b)},{'key':_0xca8e('0x27'),'value':_0x39f073},{'key':_0xca8e('0x28'),'value':_0x546ca1},{'key':_0xca8e('0x29'),'value':'login'}];var _0x597bf8=_0x5adcce+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xca8e('0x14')](_0x48c817,function(_0x53fa94){return _0x53fa94[_0xca8e('0x2a')]+'='+_0x53fa94['value'];})[_0xca8e('0x19')]('&');_0x52068a['oauth2Claims']={'issuer':_0x5adcce[_0xca8e('0x1a')]('oauth2/',''),'audience':_0x52068a[_0xca8e('0x23')],'state':_0x39f073,'nonce':_0x546ca1};redis[_0xca8e('0x2b')](_0x39f073,JSON['stringify'](_0x52068a));return _0x597bf8;}function isValidIdToken(_0x274752,_0x2d3ad9){try{var _0x978b1=jwt['decode'](_0x274752,{'complete':!![]});var _0x2df582=_0x978b1['payload'];if(_0x2df582[_0xca8e('0x2c')]!==_0x2d3ad9['issuer'])return![];if(_0x2df582[_0xca8e('0x2d')]!==_0x2d3ad9[_0xca8e('0x2e')])return![];if(_0x2df582[_0xca8e('0x28')]!==_0x2d3ad9[_0xca8e('0x28')])return![];if(moment()[_0xca8e('0x2f')](moment[_0xca8e('0x30')](_0x2df582[_0xca8e('0x31')])))return![];return!![];}catch(_0x49c103){throw _0x49c103;}}function refreshOauth2MicrosoftAccessToken(_0x2344ce){return Promise[_0xca8e('0x32')]()['then'](function(){if(_0x2344ce['data3'])return _0x2344ce;return db['CloudProvider'][_0xca8e('0x33')]({'where':{'id':_0x2344ce['id']},'raw':!![]});})[_0xca8e('0x34')](function(_0x183cba){var _0x227538={'grant_type':'refresh_token','refresh_token':_0x183cba['data6'],'scope':getAccessTokenScope(_0x183cba),'redirect_uri':_0x183cba[_0xca8e('0x25')],'client_id':_0x183cba[_0xca8e('0x23')],'client_secret':encryptor['decryptString'](_0x183cba[_0xca8e('0x35')])};var _0x4d8c1b={'method':_0xca8e('0x36'),'uri':MICROSOFT_AUTH_URL[_0xca8e('0x1a')](_0xca8e('0x37'),_0x183cba[_0xca8e('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x227538,'json':!![]};return rp(_0x4d8c1b);})[_0xca8e('0x34')](function(_0x5b883d){_0x2344ce[_0xca8e('0x38')]=_0x5b883d[_0xca8e('0x39')];_0x2344ce[_0xca8e('0x3a')]=_0x5b883d[_0xca8e('0x3b')];return db[_0xca8e('0x3c')][_0xca8e('0x3d')]({'data5':_0x2344ce[_0xca8e('0x38')],'data6':_0x2344ce[_0xca8e('0x3a')]},{'where':{'id':_0x2344ce['id']}});})[_0xca8e('0x34')](function(){return _0x2344ce;})[_0xca8e('0x3e')](function(_0x553468){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x2344ce['id'],_0x553468);});}function getOauth2MicrosoftAccessToken(_0x1c69ed,_0x36a22f){var _0x3851ad={'grant_type':_0xca8e('0x3f'),'code':_0x1c69ed,'scope':getAccessTokenScope(_0x36a22f),'redirect_uri':_0x36a22f[_0xca8e('0x25')],'client_id':_0x36a22f[_0xca8e('0x23')],'client_secret':encryptor[_0xca8e('0x40')](_0x36a22f[_0xca8e('0x35')])};var _0x4515e9={'method':'POST','uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x36a22f[_0xca8e('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3851ad,'json':!![]};return rp(_0x4515e9);}function startRefreshInterval(_0x171560){var _0x253044=schedule[_0xca8e('0x41')];if(_0x253044[_0x171560['id']])clearInterval(_0x253044[_0x171560['id']]);_0x253044[_0x171560['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xca8e('0x42')](this,{'id':_0x171560['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xca8e('0x41')]=_0x253044;}function startAllRefreshIntervals(){return db[_0xca8e('0x3c')][_0xca8e('0x43')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xca8e('0x34')](function(_0x2f07c0){var _0x3a0928=_0x2f07c0[_0xca8e('0x14')](function(_0x1d835a){return refreshOauth2MicrosoftAccessToken(_0x1d835a)[_0xca8e('0x34')](function(_0x8d49d0){startRefreshInterval(_0x8d49d0);});});return Promise[_0xca8e('0x44')](_0x3a0928);})['catch'](function(_0x8a77df){var _0x1f24d7=_0x8a77df?util[_0xca8e('0x45')](_0x8a77df,{'showHidden':![],'depth':null}):'';logger[_0xca8e('0x46')](_0xca8e('0x47'),_0x1f24d7);});}module[_0xca8e('0x48')]={'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 1aee72e..687322e 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 _0x3c91=['client','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0x3c91,0x1af));var _0x13c9=function(_0x4c45d4,_0x388987){_0x4c45d4=_0x4c45d4-0x0;var _0x1ee8be=_0x3c91[_0x4c45d4];return _0x1ee8be;};'use strict';var _=require(_0x13c9('0x0'));var util=require(_0x13c9('0x1'));var moment=require(_0x13c9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c9('0x3'));var db=require(_0x13c9('0x4'))['db'];var utils=require(_0x13c9('0x5'));var logger=require('../../config/logger')(_0x13c9('0x6'));var config=require(_0x13c9('0x7'));var jayson=require(_0x13c9('0x8'));var client=jayson[_0x13c9('0x9')][_0x13c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c4332,_0x58b610,_0x44243f){return new BPromise(function(_0x196c2a,_0x5fd23){return client[_0x13c9('0xb')](_0x4c4332,_0x44243f)[_0x13c9('0xc')](function(_0x5370dd){logger['info'](_0x13c9('0xd'),_0x58b610,_0x13c9('0xe'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x58b610,_0x13c9('0xe'),JSON[_0x13c9('0xf')](_0x5370dd));if(_0x5370dd[_0x13c9('0x10')]){if(_0x5370dd[_0x13c9('0x10')][_0x13c9('0x11')]===0x1f4){logger[_0x13c9('0x10')](_0x13c9('0xd'),_0x58b610,_0x5370dd['error'][_0x13c9('0x12')]);return _0x5fd23(_0x5370dd['error']['message']);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x58b610,_0x5370dd['error'][_0x13c9('0x12')]);return _0x196c2a(_0x5370dd[_0x13c9('0x10')]['message']);}else{logger[_0x13c9('0x13')](_0x13c9('0xd'),_0x58b610,_0x13c9('0xe'));_0x196c2a(_0x5370dd[_0x13c9('0x14')][_0x13c9('0x12')]);}})[_0x13c9('0x15')](function(_0x238952){logger['error']('CloudProvider,\x20%s,\x20%s',_0x58b610,_0x238952);_0x5fd23(_0x238952);});});}
\ No newline at end of file
+var _0xcac3=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4c525c,_0x4668a1){var _0x14a634=function(_0x467b4b){while(--_0x467b4b){_0x4c525c['push'](_0x4c525c['shift']());}};_0x14a634(++_0x4668a1);}(_0xcac3,0x193));var _0x3cac=function(_0x12156e,_0x550b21){_0x12156e=_0x12156e-0x0;var _0x55ada7=_0xcac3[_0x12156e];return _0x55ada7;};'use strict';var _=require('lodash');var util=require(_0x3cac('0x0'));var moment=require(_0x3cac('0x1'));var BPromise=require(_0x3cac('0x2'));var rs=require(_0x3cac('0x3'));var fs=require('fs');var Redis=require(_0x3cac('0x4'));var db=require(_0x3cac('0x5'))['db'];var utils=require(_0x3cac('0x6'));var logger=require(_0x3cac('0x7'))(_0x3cac('0x8'));var config=require(_0x3cac('0x9'));var jayson=require(_0x3cac('0xa'));var client=jayson[_0x3cac('0xb')][_0x3cac('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e2560,_0x14562c,_0x21365c){return new BPromise(function(_0x13c1b9,_0x55670d){return client[_0x3cac('0xd')](_0x1e2560,_0x21365c)[_0x3cac('0xe')](function(_0x3bcbed){logger[_0x3cac('0xf')](_0x3cac('0x10'),_0x14562c,'request\x20sent');logger[_0x3cac('0x11')](_0x3cac('0x12'),_0x14562c,_0x3cac('0x13'),JSON[_0x3cac('0x14')](_0x3bcbed));if(_0x3bcbed[_0x3cac('0x15')]){if(_0x3bcbed['error']['code']===0x1f4){logger[_0x3cac('0x15')](_0x3cac('0x10'),_0x14562c,_0x3bcbed[_0x3cac('0x15')][_0x3cac('0x16')]);return _0x55670d(_0x3bcbed[_0x3cac('0x15')][_0x3cac('0x16')]);}logger[_0x3cac('0x15')]('CloudProvider,\x20%s,\x20%s',_0x14562c,_0x3bcbed[_0x3cac('0x15')][_0x3cac('0x16')]);return _0x13c1b9(_0x3bcbed[_0x3cac('0x15')][_0x3cac('0x16')]);}else{logger[_0x3cac('0xf')](_0x3cac('0x10'),_0x14562c,_0x3cac('0x13'));_0x13c1b9(_0x3bcbed[_0x3cac('0x17')][_0x3cac('0x16')]);}})[_0x3cac('0x18')](function(_0x4173ca){logger[_0x3cac('0x15')](_0x3cac('0x10'),_0x14562c,_0x4173ca);_0x55670d(_0x4173ca);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 5b05a45..78e452f 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(_0x11fc7b,_0x1434e6){var _0x4080e6=function(_0x54ccb0){while(--_0x54ccb0){_0x11fc7b['push'](_0x11fc7b['shift']());}};_0x4080e6(++_0x1434e6);}(_0xdb28,0x106));var _0x8db2=function(_0x4b1edb,_0x39f6d6){_0x4b1edb=_0x4b1edb-0x0;var _0x1c7bb9=_0xdb28[_0x4b1edb];return _0x1c7bb9;};'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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x7a54,0x106));var _0x47a5=function(_0x85abec,_0x4c1b3b){_0x85abec=_0x85abec-0x0;var _0x17cdf9=_0x7a54[_0x85abec];return _0x17cdf9;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index b965a78..f74bda9 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 _0xd6b4=['sequelize','exports','STRING'];(function(_0xd8fc2d,_0x1c3f81){var _0x281c9e=function(_0x4df715){while(--_0x4df715){_0xd8fc2d['push'](_0xd8fc2d['shift']());}};_0x281c9e(++_0x1c3f81);}(_0xd6b4,0xb4));var _0x4d6b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd6b4[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x4d6b('0x0'));module[_0x4d6b('0x1')]={'name':{'type':Sequelize[_0x4d6b('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4d6b('0x2')]},'companyId':{'type':Sequelize[_0x4d6b('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x4d6b('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4d6b('0x2')]},'street':{'type':Sequelize[_0x4d6b('0x2')]},'postalCode':{'type':Sequelize[_0x4d6b('0x2')]},'city':{'type':Sequelize[_0x4d6b('0x2')]},'country':{'type':Sequelize[_0x4d6b('0x2')]},'email':{'type':Sequelize[_0x4d6b('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4d6b('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x4d6b('0x2')]},'sCountry':{'type':Sequelize[_0x4d6b('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8225=['sequelize','exports','STRING'];(function(_0x595852,_0x27d446){var _0x245346=function(_0xce6edd){while(--_0xce6edd){_0x595852['push'](_0x595852['shift']());}};_0x245346(++_0x27d446);}(_0x8225,0x87));var _0x5822=function(_0x19f8b6,_0x2b4e8c){_0x19f8b6=_0x19f8b6-0x0;var _0x213ebc=_0x8225[_0x19f8b6];return _0x213ebc;};'use strict';var Sequelize=require(_0x5822('0x0'));module[_0x5822('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x5822('0x2')]},'website':{'type':Sequelize[_0x5822('0x2')]},'phone':{'type':Sequelize[_0x5822('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5822('0x2')]},'street':{'type':Sequelize[_0x5822('0x2')]},'postalCode':{'type':Sequelize[_0x5822('0x2')]},'city':{'type':Sequelize[_0x5822('0x2')]},'country':{'type':Sequelize[_0x5822('0x2')]},'email':{'type':Sequelize[_0x5822('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x5822('0x2')]},'sStreet':{'type':Sequelize[_0x5822('0x2')]},'sPostalCode':{'type':Sequelize[_0x5822('0x2')]},'sCity':{'type':Sequelize[_0x5822('0x2')]},'sCountry':{'type':Sequelize[_0x5822('0x2')]},'description':{'type':Sequelize[_0x5822('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index b959d78..d3ff73c 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 _0x99ee=['role','userProfileId','autoAssociation','UserProfileResource','params','addContacts','CmContact','ids','getContacts','findOne','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','destroy','get','Companies','then','error','stack','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x522a0c,_0x32ba4e){var _0x194106=function(_0x5691ac){while(--_0x5691ac){_0x522a0c['push'](_0x522a0c['shift']());}};_0x194106(++_0x32ba4e);}(_0x99ee,0x157));var _0xe99e=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0x99ee[_0xaa6a4];return _0xdc31a4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe99e('0x0'));var zipdir=require(_0xe99e('0x1'));var jsonpatch=require(_0xe99e('0x2'));var rp=require(_0xe99e('0x3'));var moment=require('moment');var BPromise=require(_0xe99e('0x4'));var Mustache=require('mustache');var util=require(_0xe99e('0x5'));var path=require('path');var sox=require(_0xe99e('0x6'));var csv=require(_0xe99e('0x7'));var ejs=require(_0xe99e('0x8'));var fs=require('fs');var fs_extra=require(_0xe99e('0x9'));var _=require(_0xe99e('0xa'));var squel=require('squel');var crypto=require(_0xe99e('0xb'));var jsforce=require(_0xe99e('0xc'));var deskjs=require(_0xe99e('0xd'));var toCsv=require(_0xe99e('0x7'));var querystring=require('querystring');var Papa=require(_0xe99e('0xe'));var Redis=require(_0xe99e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe99e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe99e('0x11'))(_0xe99e('0x12'));var utils=require(_0xe99e('0x13'));var config=require(_0xe99e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe99e('0x15'))['db'];function respondWithStatusCode(_0x2aa1d9,_0x33ea2a){_0x33ea2a=_0x33ea2a||0xcc;return function(_0x27a3d4){if(_0x27a3d4){return _0x2aa1d9[_0xe99e('0x16')](_0x33ea2a);}return _0x2aa1d9[_0xe99e('0x17')](_0x33ea2a)[_0xe99e('0x18')]();};}function respondWithResult(_0x2c8f53,_0x53da2e){_0x53da2e=_0x53da2e||0xc8;return function(_0x2c3299){if(_0x2c3299){return _0x2c8f53['status'](_0x53da2e)['json'](_0x2c3299);}};}function respondWithFilteredResult(_0x1fb223,_0x17e057){return function(_0x528a05){if(_0x528a05){var _0x4b0ad6=typeof _0x17e057[_0xe99e('0x19')]===_0xe99e('0x1a')&&typeof _0x17e057[_0xe99e('0x1b')]===_0xe99e('0x1a');var _0x3156d3=_0x528a05['count'];var _0x54688f=_0x4b0ad6?0x0:_0x17e057[_0xe99e('0x19')];var _0x5e252c=_0x4b0ad6?_0x528a05[_0xe99e('0x1c')]:_0x17e057[_0xe99e('0x19')]+_0x17e057['limit'];var _0x540733;if(_0x5e252c>=_0x3156d3){_0x5e252c=_0x3156d3;_0x540733=0xc8;}else{_0x540733=0xce;}_0x1fb223['status'](_0x540733);return _0x1fb223['set'](_0xe99e('0x1d'),_0x54688f+'-'+_0x5e252c+'/'+_0x3156d3)['json'](_0x528a05);}return null;};}function patchUpdates(_0x29d840){return function(_0x33785f){try{jsonpatch['apply'](_0x33785f,_0x29d840,!![]);}catch(_0x28cff8){return BPromise[_0xe99e('0x1e')](_0x28cff8);}return _0x33785f[_0xe99e('0x1f')]();};}function saveUpdates(_0x10a9ec,_0x5cfd97){return function(_0xf32ac){if(_0xf32ac){return _0xf32ac['update'](_0x10a9ec)['then'](function(_0x271f28){return _0x271f28;});}return null;};}function removeEntity(_0xabe043,_0x432ce1){return function(_0x43360b){if(_0x43360b){return _0x43360b[_0xe99e('0x20')]()['then'](function(){var _0x442365=_0x43360b[_0xe99e('0x21')]({'plain':!![]});var _0x3b3a9a=_0xe99e('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x3b3a9a,'resourceId':_0x442365['id']}})[_0xe99e('0x23')](function(){return _0x43360b;});})[_0xe99e('0x23')](function(){_0xabe043['status'](0xcc)[_0xe99e('0x18')]();});}};}function handleEntityNotFound(_0x209ea7,_0x54a5ba){return function(_0x12bf5c){if(!_0x12bf5c){_0x209ea7[_0xe99e('0x16')](0x194);}return _0x12bf5c;};}function handleError(_0x21711b,_0x79edd9){_0x79edd9=_0x79edd9||0x1f4;return function(_0x139ab3){logger[_0xe99e('0x24')](_0x139ab3[_0xe99e('0x25')]);if(_0x139ab3[_0xe99e('0x26')]){delete _0x139ab3['name'];}_0x21711b[_0xe99e('0x17')](_0x79edd9)[_0xe99e('0x27')](_0x139ab3);};}exports[_0xe99e('0x28')]=function(_0x566e39,_0x38082e){var _0x9da73d={},_0x2c8c62={},_0x37a374={'count':0x0,'rows':[]};return db[_0xe99e('0x29')][_0xe99e('0x2a')]()[_0xe99e('0x23')](function(_0x2e0c54){_0x2c8c62[_0xe99e('0x2b')]=_['keys'](_0x2e0c54);_0x2c8c62[_0xe99e('0x2c')]=_[_0xe99e('0x2d')](_0x566e39[_0xe99e('0x2c')]);_0x2c8c62[_0xe99e('0x2e')]=_[_0xe99e('0x2f')](_0x2c8c62[_0xe99e('0x2b')],_0x2c8c62[_0xe99e('0x2c')]);_0x9da73d['attributes']=_[_0xe99e('0x2f')](_0x2c8c62[_0xe99e('0x2b')],qs[_0xe99e('0x30')](_0x566e39['query'][_0xe99e('0x30')]));_0x9da73d[_0xe99e('0x31')]=_0x9da73d['attributes'][_0xe99e('0x32')]?_0x9da73d[_0xe99e('0x31')]:_0x2c8c62[_0xe99e('0x2b')];if(!_0x566e39[_0xe99e('0x2c')][_0xe99e('0x33')]('nolimit')){_0x9da73d[_0xe99e('0x1b')]=qs[_0xe99e('0x1b')](_0x566e39['query'][_0xe99e('0x1b')]);_0x9da73d[_0xe99e('0x19')]=qs[_0xe99e('0x19')](_0x566e39[_0xe99e('0x2c')][_0xe99e('0x19')]);}_0x9da73d[_0xe99e('0x34')]=qs[_0xe99e('0x35')](_0x566e39['query'][_0xe99e('0x35')]);_0x9da73d[_0xe99e('0x36')]=qs[_0xe99e('0x2e')](_[_0xe99e('0x37')](_0x566e39['query'],_0x2c8c62[_0xe99e('0x2e')]),_0x2e0c54);if(_0x566e39[_0xe99e('0x2c')][_0xe99e('0x38')]){_0x9da73d[_0xe99e('0x36')]=_[_0xe99e('0x39')](_0x9da73d[_0xe99e('0x36')],{'$or':_[_0xe99e('0x3a')](_0x9da73d[_0xe99e('0x31')],function(_0x21fa60){var _0x49c70a={};_0x49c70a[_0x21fa60]={'$like':'%'+_0x566e39['query']['filter']+'%'};return _0x49c70a;})});}_0x9da73d=_['merge']({},_0x9da73d,_0x566e39[_0xe99e('0x3b')]);var _0x411e5a={'where':_0x9da73d['where']};return db[_0xe99e('0x29')][_0xe99e('0x1c')](_0x411e5a)[_0xe99e('0x23')](function(_0x4b788b){_0x37a374['count']=_0x4b788b;if(_0x566e39[_0xe99e('0x2c')][_0xe99e('0x3c')]){_0x9da73d[_0xe99e('0x3d')]=[{'all':!![]}];}return db[_0xe99e('0x29')][_0xe99e('0x3e')](_0x9da73d);})[_0xe99e('0x23')](function(_0x1f5af4){_0x37a374[_0xe99e('0x3f')]=_0x1f5af4;return _0x37a374;})[_0xe99e('0x23')](respondWithFilteredResult(_0x38082e,_0x9da73d))[_0xe99e('0x40')](handleError(_0x38082e,null));})['catch'](handleError(_0x38082e,null));};exports[_0xe99e('0x41')]=function(_0xdc4438,_0x4408fe){var _0x3cced4={'raw':![],'where':{'id':_0xdc4438['params']['id']}},_0x5c124d={};_0x5c124d[_0xe99e('0x2b')]=_[_0xe99e('0x2d')](db['CmCompany'][_0xe99e('0x42')]);_0x5c124d[_0xe99e('0x2c')]=_[_0xe99e('0x2d')](_0xdc4438['query']);_0x5c124d['filters']=_[_0xe99e('0x2f')](_0x5c124d[_0xe99e('0x2b')],_0x5c124d[_0xe99e('0x2c')]);_0x3cced4['attributes']=_[_0xe99e('0x2f')](_0x5c124d[_0xe99e('0x2b')],qs[_0xe99e('0x30')](_0xdc4438[_0xe99e('0x2c')][_0xe99e('0x30')]));_0x3cced4[_0xe99e('0x31')]=_0x3cced4[_0xe99e('0x31')]['length']?_0x3cced4[_0xe99e('0x31')]:_0x5c124d[_0xe99e('0x2b')];if(_0xdc4438[_0xe99e('0x2c')]['includeAll']){_0x3cced4[_0xe99e('0x3d')]=[{'all':!![]}];}_0x3cced4=_[_0xe99e('0x39')]({},_0x3cced4,_0xdc4438[_0xe99e('0x3b')]);return db[_0xe99e('0x29')][_0xe99e('0x43')](_0x3cced4)['then'](handleEntityNotFound(_0x4408fe,null))[_0xe99e('0x23')](respondWithResult(_0x4408fe,null))['catch'](handleError(_0x4408fe,null));};exports[_0xe99e('0x44')]=function(_0x52a010,_0x55ffc8){return db[_0xe99e('0x29')]['create'](_0x52a010[_0xe99e('0x45')],{})[_0xe99e('0x23')](function(_0x12554f){var _0xd558c4=_0x52a010[_0xe99e('0x46')][_0xe99e('0x21')]({'plain':!![]});if(!_0xd558c4)throw new Error(_0xe99e('0x47'));if(_0xd558c4[_0xe99e('0x48')]==='user'){var _0x71aa43=_0x12554f['get']({'plain':!![]});var _0x35f231=_0xe99e('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x35f231,'userProfileId':_0xd558c4[_0xe99e('0x49')]},'raw':!![]})[_0xe99e('0x23')](function(_0x9058d9){if(_0x9058d9&&_0x9058d9[_0xe99e('0x4a')]===0x0){return db[_0xe99e('0x4b')][_0xe99e('0x44')]({'name':_0x71aa43[_0xe99e('0x26')],'resourceId':_0x71aa43['id'],'type':_0x9058d9[_0xe99e('0x26')],'sectionId':_0x9058d9['id']},{})[_0xe99e('0x23')](function(){return _0x12554f;});}else{return _0x12554f;}})[_0xe99e('0x40')](function(_0x342fc0){logger[_0xe99e('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x342fc0);throw _0x342fc0;});}return _0x12554f;})[_0xe99e('0x23')](respondWithResult(_0x55ffc8,0xc9))[_0xe99e('0x40')](handleError(_0x55ffc8,null));};exports['update']=function(_0x5928f3,_0x121492){if(_0x5928f3[_0xe99e('0x45')]['id']){delete _0x5928f3[_0xe99e('0x45')]['id'];}return db[_0xe99e('0x29')][_0xe99e('0x43')]({'where':{'id':_0x5928f3['params']['id']}})[_0xe99e('0x23')](handleEntityNotFound(_0x121492,null))[_0xe99e('0x23')](saveUpdates(_0x5928f3[_0xe99e('0x45')],null))[_0xe99e('0x23')](respondWithResult(_0x121492,null))['catch'](handleError(_0x121492,null));};exports[_0xe99e('0x20')]=function(_0xffa9e6,_0x36ad97){return db[_0xe99e('0x29')]['find']({'where':{'id':_0xffa9e6[_0xe99e('0x4c')]['id']}})[_0xe99e('0x23')](handleEntityNotFound(_0x36ad97,null))[_0xe99e('0x23')](removeEntity(_0x36ad97,null))['catch'](handleError(_0x36ad97,null));};exports['describe']=function(_0xd77be9,_0x230f02){return db[_0xe99e('0x29')]['describe']()[_0xe99e('0x23')](respondWithResult(_0x230f02,null))[_0xe99e('0x40')](handleError(_0x230f02,null));};exports[_0xe99e('0x4d')]=function(_0x27593e,_0x37cc70,_0x488457){return db[_0xe99e('0x4e')][_0xe99e('0x43')]({'where':{'id':_0x27593e[_0xe99e('0x4c')]['id']}})[_0xe99e('0x23')](handleEntityNotFound(_0x37cc70,null))[_0xe99e('0x23')](function(_0x155656){if(_0x155656){return _0x155656[_0xe99e('0x4d')](_0x27593e[_0xe99e('0x45')]['ids'],_['omit'](_0x27593e[_0xe99e('0x45')],[_0xe99e('0x4f'),'id'])||{});}})[_0xe99e('0x23')](respondWithResult(_0x37cc70,null))[_0xe99e('0x40')](handleError(_0x37cc70,null));};exports[_0xe99e('0x50')]=function(_0x199566,_0x28c495,_0x34b871){var _0x24ee36={};var _0x440343={};var _0x430678;var _0x23bc14;return db[_0xe99e('0x29')][_0xe99e('0x51')]({'where':{'id':_0x199566[_0xe99e('0x4c')]['id']}})[_0xe99e('0x23')](handleEntityNotFound(_0x28c495,null))[_0xe99e('0x23')](function(_0x32a3e7){if(_0x32a3e7){_0x430678=_0x32a3e7;_0x440343[_0xe99e('0x2b')]=_['keys'](db[_0xe99e('0x4e')][_0xe99e('0x42')]);_0x440343[_0xe99e('0x2c')]=_[_0xe99e('0x2d')](_0x199566[_0xe99e('0x2c')]);_0x440343[_0xe99e('0x2e')]=_[_0xe99e('0x2f')](_0x440343[_0xe99e('0x2b')],_0x440343[_0xe99e('0x2c')]);_0x24ee36[_0xe99e('0x31')]=_[_0xe99e('0x2f')](_0x440343[_0xe99e('0x2b')],qs[_0xe99e('0x30')](_0x199566[_0xe99e('0x2c')][_0xe99e('0x30')]));_0x24ee36['attributes']=_0x24ee36['attributes']['length']?_0x24ee36[_0xe99e('0x31')]:_0x440343['model'];_0x24ee36[_0xe99e('0x34')]=qs['sort'](_0x199566[_0xe99e('0x2c')][_0xe99e('0x35')]);_0x24ee36[_0xe99e('0x36')]=qs[_0xe99e('0x2e')](_['pick'](_0x199566['query'],_0x440343['filters']));if(_0x199566['query']['filter']){_0x24ee36[_0xe99e('0x36')]=_[_0xe99e('0x39')](_0x24ee36[_0xe99e('0x36')],{'$or':_['map'](_0x24ee36[_0xe99e('0x31')],function(_0x378753){var _0x42c9d1={};_0x42c9d1[_0x378753]={'$like':'%'+_0x199566[_0xe99e('0x2c')][_0xe99e('0x38')]+'%'};return _0x42c9d1;})});}_0x24ee36=_['merge']({},_0x24ee36,_0x199566[_0xe99e('0x3b')]);return _0x430678['getContacts'](_0x24ee36);}})[_0xe99e('0x23')](function(_0x5a7ea5){if(_0x5a7ea5){_0x23bc14=_0x5a7ea5[_0xe99e('0x32')];if(!_0x199566[_0xe99e('0x2c')][_0xe99e('0x33')](_0xe99e('0x52'))){_0x24ee36[_0xe99e('0x1b')]=qs['limit'](_0x199566[_0xe99e('0x2c')][_0xe99e('0x1b')]);_0x24ee36[_0xe99e('0x19')]=qs[_0xe99e('0x19')](_0x199566[_0xe99e('0x2c')][_0xe99e('0x19')]);}return _0x430678[_0xe99e('0x50')](_0x24ee36);}})[_0xe99e('0x23')](function(_0x308d20){if(_0x308d20){return _0x308d20?{'count':_0x23bc14,'rows':_0x308d20}:null;}})[_0xe99e('0x23')](respondWithResult(_0x28c495,null))[_0xe99e('0x40')](handleError(_0x28c495,null));};
\ No newline at end of file
+var _0x167b=['apply','save','update','then','destroy','get','UserProfileResource','name','send','index','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','options','CmCompany','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','addContacts','ids','getContacts','findOne','rawAttributes','order','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x5c110c,_0x58d08b){var _0x485822=function(_0xb98557){while(--_0xb98557){_0x5c110c['push'](_0x5c110c['shift']());}};_0x485822(++_0x58d08b);}(_0x167b,0x196));var _0xb167=function(_0x597f41,_0x1922f6){_0x597f41=_0x597f41-0x0;var _0x3cdbc1=_0x167b[_0x597f41];return _0x3cdbc1;};'use strict';var emlformat=require(_0xb167('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb167('0x1'));var rp=require(_0xb167('0x2'));var moment=require(_0xb167('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb167('0x4'));var util=require(_0xb167('0x5'));var path=require(_0xb167('0x6'));var sox=require(_0xb167('0x7'));var csv=require(_0xb167('0x8'));var ejs=require(_0xb167('0x9'));var fs=require('fs');var fs_extra=require(_0xb167('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb167('0xb'));var jsforce=require(_0xb167('0xc'));var deskjs=require(_0xb167('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb167('0xe'));var Papa=require(_0xb167('0xf'));var Redis=require(_0xb167('0x10'));var authService=require(_0xb167('0x11'));var qs=require(_0xb167('0x12'));var as=require(_0xb167('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb167('0x14'))(_0xb167('0x15'));var utils=require('../../config/utils');var config=require(_0xb167('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb167('0x17'))['db'];function respondWithStatusCode(_0x1ab865,_0x4c904c){_0x4c904c=_0x4c904c||0xcc;return function(_0x2ea3c2){if(_0x2ea3c2){return _0x1ab865[_0xb167('0x18')](_0x4c904c);}return _0x1ab865[_0xb167('0x19')](_0x4c904c)[_0xb167('0x1a')]();};}function respondWithResult(_0x4a4284,_0x402263){_0x402263=_0x402263||0xc8;return function(_0x35246d){if(_0x35246d){return _0x4a4284['status'](_0x402263)[_0xb167('0x1b')](_0x35246d);}};}function respondWithFilteredResult(_0x51c7ae,_0x229f3d){return function(_0x156854){if(_0x156854){var _0x566b00=typeof _0x229f3d['offset']===_0xb167('0x1c')&&typeof _0x229f3d[_0xb167('0x1d')]===_0xb167('0x1c');var _0x1f10fa=_0x156854[_0xb167('0x1e')];var _0x151146=_0x566b00?0x0:_0x229f3d[_0xb167('0x1f')];var _0x550c90=_0x566b00?_0x156854[_0xb167('0x1e')]:_0x229f3d[_0xb167('0x1f')]+_0x229f3d['limit'];var _0x9ab4e1;if(_0x550c90>=_0x1f10fa){_0x550c90=_0x1f10fa;_0x9ab4e1=0xc8;}else{_0x9ab4e1=0xce;}_0x51c7ae[_0xb167('0x19')](_0x9ab4e1);return _0x51c7ae[_0xb167('0x20')](_0xb167('0x21'),_0x151146+'-'+_0x550c90+'/'+_0x1f10fa)[_0xb167('0x1b')](_0x156854);}return null;};}function patchUpdates(_0x3bff61){return function(_0x24d65a){try{jsonpatch[_0xb167('0x22')](_0x24d65a,_0x3bff61,!![]);}catch(_0x197972){return BPromise['reject'](_0x197972);}return _0x24d65a[_0xb167('0x23')]();};}function saveUpdates(_0x4489a4,_0x4d2cf2){return function(_0x528cae){if(_0x528cae){return _0x528cae[_0xb167('0x24')](_0x4489a4)[_0xb167('0x25')](function(_0x59d1a6){return _0x59d1a6;});}return null;};}function removeEntity(_0x595a75,_0x57f310){return function(_0x14c3f2){if(_0x14c3f2){return _0x14c3f2[_0xb167('0x26')]()[_0xb167('0x25')](function(){var _0x3d3777=_0x14c3f2[_0xb167('0x27')]({'plain':!![]});var _0x1cabaa='Companies';return db[_0xb167('0x28')][_0xb167('0x26')]({'where':{'type':_0x1cabaa,'resourceId':_0x3d3777['id']}})['then'](function(){return _0x14c3f2;});})[_0xb167('0x25')](function(){_0x595a75[_0xb167('0x19')](0xcc)[_0xb167('0x1a')]();});}};}function handleEntityNotFound(_0x529733,_0xb19774){return function(_0x241b82){if(!_0x241b82){_0x529733[_0xb167('0x18')](0x194);}return _0x241b82;};}function handleError(_0x3a977a,_0x504c06){_0x504c06=_0x504c06||0x1f4;return function(_0x52b590){logger['error'](_0x52b590['stack']);if(_0x52b590[_0xb167('0x29')]){delete _0x52b590[_0xb167('0x29')];}_0x3a977a['status'](_0x504c06)[_0xb167('0x2a')](_0x52b590);};}exports[_0xb167('0x2b')]=function(_0x2b6889,_0x79f71e){var _0x5e44b3={},_0xfa25d1={},_0x491dd4={'count':0x0,'rows':[]};return db['CmCompany'][_0xb167('0x2c')]()[_0xb167('0x25')](function(_0x44c384){_0xfa25d1[_0xb167('0x2d')]=_[_0xb167('0x2e')](_0x44c384);_0xfa25d1[_0xb167('0x2f')]=_[_0xb167('0x2e')](_0x2b6889[_0xb167('0x2f')]);_0xfa25d1[_0xb167('0x30')]=_[_0xb167('0x31')](_0xfa25d1[_0xb167('0x2d')],_0xfa25d1[_0xb167('0x2f')]);_0x5e44b3['attributes']=_[_0xb167('0x31')](_0xfa25d1[_0xb167('0x2d')],qs[_0xb167('0x32')](_0x2b6889['query'][_0xb167('0x32')]));_0x5e44b3[_0xb167('0x33')]=_0x5e44b3[_0xb167('0x33')][_0xb167('0x34')]?_0x5e44b3[_0xb167('0x33')]:_0xfa25d1[_0xb167('0x2d')];if(!_0x2b6889['query'][_0xb167('0x35')](_0xb167('0x36'))){_0x5e44b3[_0xb167('0x1d')]=qs[_0xb167('0x1d')](_0x2b6889[_0xb167('0x2f')]['limit']);_0x5e44b3[_0xb167('0x1f')]=qs[_0xb167('0x1f')](_0x2b6889[_0xb167('0x2f')][_0xb167('0x1f')]);}_0x5e44b3['order']=qs[_0xb167('0x37')](_0x2b6889['query'][_0xb167('0x37')]);_0x5e44b3[_0xb167('0x38')]=qs['filters'](_[_0xb167('0x39')](_0x2b6889[_0xb167('0x2f')],_0xfa25d1[_0xb167('0x30')]),_0x44c384);if(_0x2b6889['query'][_0xb167('0x3a')]){_0x5e44b3[_0xb167('0x38')]=_[_0xb167('0x3b')](_0x5e44b3[_0xb167('0x38')],{'$or':_[_0xb167('0x3c')](_0x5e44b3[_0xb167('0x33')],function(_0x1e7091){var _0x134ef0={};_0x134ef0[_0x1e7091]={'$like':'%'+_0x2b6889['query'][_0xb167('0x3a')]+'%'};return _0x134ef0;})});}_0x5e44b3=_[_0xb167('0x3b')]({},_0x5e44b3,_0x2b6889[_0xb167('0x3d')]);var _0xbdc696={'where':_0x5e44b3[_0xb167('0x38')]};return db[_0xb167('0x3e')][_0xb167('0x1e')](_0xbdc696)['then'](function(_0x578d9d){_0x491dd4[_0xb167('0x1e')]=_0x578d9d;if(_0x2b6889[_0xb167('0x2f')][_0xb167('0x3f')]){_0x5e44b3[_0xb167('0x40')]=[{'all':!![]}];}return db[_0xb167('0x3e')][_0xb167('0x41')](_0x5e44b3);})['then'](function(_0x50d266){_0x491dd4[_0xb167('0x42')]=_0x50d266;return _0x491dd4;})[_0xb167('0x25')](respondWithFilteredResult(_0x79f71e,_0x5e44b3))[_0xb167('0x43')](handleError(_0x79f71e,null));})['catch'](handleError(_0x79f71e,null));};exports[_0xb167('0x44')]=function(_0x303356,_0xd5bc5d){var _0x6090f={'raw':![],'where':{'id':_0x303356[_0xb167('0x45')]['id']}},_0x593c04={};_0x593c04['model']=_[_0xb167('0x2e')](db[_0xb167('0x3e')]['rawAttributes']);_0x593c04[_0xb167('0x2f')]=_[_0xb167('0x2e')](_0x303356[_0xb167('0x2f')]);_0x593c04[_0xb167('0x30')]=_[_0xb167('0x31')](_0x593c04[_0xb167('0x2d')],_0x593c04[_0xb167('0x2f')]);_0x6090f[_0xb167('0x33')]=_[_0xb167('0x31')](_0x593c04[_0xb167('0x2d')],qs[_0xb167('0x32')](_0x303356['query']['fields']));_0x6090f[_0xb167('0x33')]=_0x6090f[_0xb167('0x33')][_0xb167('0x34')]?_0x6090f[_0xb167('0x33')]:_0x593c04[_0xb167('0x2d')];if(_0x303356[_0xb167('0x2f')][_0xb167('0x3f')]){_0x6090f[_0xb167('0x40')]=[{'all':!![]}];}_0x6090f=_[_0xb167('0x3b')]({},_0x6090f,_0x303356['options']);return db[_0xb167('0x3e')]['find'](_0x6090f)[_0xb167('0x25')](handleEntityNotFound(_0xd5bc5d,null))[_0xb167('0x25')](respondWithResult(_0xd5bc5d,null))[_0xb167('0x43')](handleError(_0xd5bc5d,null));};exports[_0xb167('0x46')]=function(_0x44140b,_0x5bb196){return db[_0xb167('0x3e')]['create'](_0x44140b[_0xb167('0x47')],{})['then'](function(_0x410987){var _0x2ec6e9=_0x44140b[_0xb167('0x48')][_0xb167('0x27')]({'plain':!![]});if(!_0x2ec6e9)throw new Error(_0xb167('0x49'));if(_0x2ec6e9[_0xb167('0x4a')]===_0xb167('0x48')){var _0x23f17c=_0x410987[_0xb167('0x27')]({'plain':!![]});var _0x111ca8=_0xb167('0x4b');return db[_0xb167('0x4c')][_0xb167('0x4d')]({'where':{'name':_0x111ca8,'userProfileId':_0x2ec6e9[_0xb167('0x4e')]},'raw':!![]})['then'](function(_0x410db1){if(_0x410db1&&_0x410db1['autoAssociation']===0x0){return db['UserProfileResource'][_0xb167('0x46')]({'name':_0x23f17c['name'],'resourceId':_0x23f17c['id'],'type':_0x410db1[_0xb167('0x29')],'sectionId':_0x410db1['id']},{})[_0xb167('0x25')](function(){return _0x410987;});}else{return _0x410987;}})[_0xb167('0x43')](function(_0x369e49){logger[_0xb167('0x4f')](_0xb167('0x50'),_0x369e49);throw _0x369e49;});}return _0x410987;})['then'](respondWithResult(_0x5bb196,0xc9))['catch'](handleError(_0x5bb196,null));};exports[_0xb167('0x24')]=function(_0x12fa18,_0x44ba2f){if(_0x12fa18[_0xb167('0x47')]['id']){delete _0x12fa18[_0xb167('0x47')]['id'];}return db[_0xb167('0x3e')][_0xb167('0x4d')]({'where':{'id':_0x12fa18['params']['id']}})[_0xb167('0x25')](handleEntityNotFound(_0x44ba2f,null))[_0xb167('0x25')](saveUpdates(_0x12fa18[_0xb167('0x47')],null))['then'](respondWithResult(_0x44ba2f,null))[_0xb167('0x43')](handleError(_0x44ba2f,null));};exports[_0xb167('0x26')]=function(_0x4f6faa,_0x4873fa){return db[_0xb167('0x3e')][_0xb167('0x4d')]({'where':{'id':_0x4f6faa['params']['id']}})[_0xb167('0x25')](handleEntityNotFound(_0x4873fa,null))[_0xb167('0x25')](removeEntity(_0x4873fa,null))[_0xb167('0x43')](handleError(_0x4873fa,null));};exports['describe']=function(_0x5f4579,_0x345dc9){return db['CmCompany']['describe']()[_0xb167('0x25')](respondWithResult(_0x345dc9,null))['catch'](handleError(_0x345dc9,null));};exports['addContacts']=function(_0x417bc2,_0x2af850,_0x181a04){return db[_0xb167('0x51')]['find']({'where':{'id':_0x417bc2[_0xb167('0x45')]['id']}})[_0xb167('0x25')](handleEntityNotFound(_0x2af850,null))[_0xb167('0x25')](function(_0x2a9e52){if(_0x2a9e52){return _0x2a9e52[_0xb167('0x52')](_0x417bc2[_0xb167('0x47')][_0xb167('0x53')],_['omit'](_0x417bc2[_0xb167('0x47')],[_0xb167('0x53'),'id'])||{});}})[_0xb167('0x25')](respondWithResult(_0x2af850,null))[_0xb167('0x43')](handleError(_0x2af850,null));};exports[_0xb167('0x54')]=function(_0x5b936f,_0x1106b3,_0x2d65c9){var _0x21cd99={};var _0x4ec1d5={};var _0x215b4e;var _0x573184;return db[_0xb167('0x3e')][_0xb167('0x55')]({'where':{'id':_0x5b936f[_0xb167('0x45')]['id']}})['then'](handleEntityNotFound(_0x1106b3,null))[_0xb167('0x25')](function(_0x1c6c27){if(_0x1c6c27){_0x215b4e=_0x1c6c27;_0x4ec1d5[_0xb167('0x2d')]=_[_0xb167('0x2e')](db[_0xb167('0x51')][_0xb167('0x56')]);_0x4ec1d5[_0xb167('0x2f')]=_['keys'](_0x5b936f[_0xb167('0x2f')]);_0x4ec1d5['filters']=_['intersection'](_0x4ec1d5['model'],_0x4ec1d5[_0xb167('0x2f')]);_0x21cd99[_0xb167('0x33')]=_[_0xb167('0x31')](_0x4ec1d5['model'],qs[_0xb167('0x32')](_0x5b936f[_0xb167('0x2f')][_0xb167('0x32')]));_0x21cd99[_0xb167('0x33')]=_0x21cd99['attributes'][_0xb167('0x34')]?_0x21cd99['attributes']:_0x4ec1d5['model'];_0x21cd99[_0xb167('0x57')]=qs[_0xb167('0x37')](_0x5b936f[_0xb167('0x2f')][_0xb167('0x37')]);_0x21cd99[_0xb167('0x38')]=qs[_0xb167('0x30')](_['pick'](_0x5b936f[_0xb167('0x2f')],_0x4ec1d5[_0xb167('0x30')]));if(_0x5b936f[_0xb167('0x2f')]['filter']){_0x21cd99[_0xb167('0x38')]=_[_0xb167('0x3b')](_0x21cd99['where'],{'$or':_['map'](_0x21cd99['attributes'],function(_0x4a5569){var _0x12325f={};_0x12325f[_0x4a5569]={'$like':'%'+_0x5b936f[_0xb167('0x2f')][_0xb167('0x3a')]+'%'};return _0x12325f;})});}_0x21cd99=_[_0xb167('0x3b')]({},_0x21cd99,_0x5b936f[_0xb167('0x3d')]);return _0x215b4e[_0xb167('0x54')](_0x21cd99);}})[_0xb167('0x25')](function(_0x430f57){if(_0x430f57){_0x573184=_0x430f57[_0xb167('0x34')];if(!_0x5b936f[_0xb167('0x2f')][_0xb167('0x35')](_0xb167('0x36'))){_0x21cd99[_0xb167('0x1d')]=qs[_0xb167('0x1d')](_0x5b936f[_0xb167('0x2f')][_0xb167('0x1d')]);_0x21cd99[_0xb167('0x1f')]=qs['offset'](_0x5b936f[_0xb167('0x2f')][_0xb167('0x1f')]);}return _0x215b4e[_0xb167('0x54')](_0x21cd99);}})[_0xb167('0x25')](function(_0x34008a){if(_0x34008a){return _0x34008a?{'count':_0x573184,'rows':_0x34008a}:null;}})['then'](respondWithResult(_0x1106b3,null))[_0xb167('0x43')](handleError(_0x1106b3,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 753c040..226ddf5 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 _0x49e9=['util','../../config/logger','request-promise','path','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash'];(function(_0x482ea4,_0x38e290){var _0x3e7cef=function(_0x41a909){while(--_0x41a909){_0x482ea4['push'](_0x482ea4['shift']());}};_0x3e7cef(++_0x38e290);}(_0x49e9,0x117));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var logger=require(_0x949e('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x949e('0x3'));var fs=require('fs');var path=require(_0x949e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x949e('0x5'));module[_0x949e('0x6')]=function(_0x3e97da,_0x1958a2){return _0x3e97da[_0x949e('0x7')](_0x949e('0x8'),attributes,{'tableName':_0x949e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x766c=['cm_companies','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0x766c,0xfd));var _0xc766=function(_0x363b9c,_0x175500){_0x363b9c=_0x363b9c-0x0;var _0x2a8edd=_0x766c[_0x363b9c];return _0x2a8edd;};'use strict';var _=require(_0xc766('0x0'));var util=require(_0xc766('0x1'));var logger=require('../../config/logger')(_0xc766('0x2'));var moment=require('moment');var BPromise=require(_0xc766('0x3'));var rp=require(_0xc766('0x4'));var fs=require('fs');var path=require(_0xc766('0x5'));var rimraf=require(_0xc766('0x6'));var config=require(_0xc766('0x7'));var attributes=require(_0xc766('0x8'));module[_0xc766('0x9')]=function(_0x5aea45,_0x5f23a0){return _0x5aea45['define'](_0xc766('0xa'),attributes,{'tableName':_0xc766('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 57f0240..c5a12e8 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 _0x7b4b=['http','then','info','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x49e5bc,_0x22576f){var _0x27c672=function(_0x185798){while(--_0x185798){_0x49e5bc['push'](_0x49e5bc['shift']());}};_0x27c672(++_0x22576f);}(_0x7b4b,0x1ad));var _0xb7b4=function(_0x557fd2,_0x2c0a7a){_0x557fd2=_0x557fd2-0x0;var _0x1b54a2=_0x7b4b[_0x557fd2];return _0x1b54a2;};'use strict';var _=require(_0xb7b4('0x0'));var util=require(_0xb7b4('0x1'));var moment=require(_0xb7b4('0x2'));var BPromise=require(_0xb7b4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7b4('0x4'))['db'];var utils=require(_0xb7b4('0x5'));var logger=require(_0xb7b4('0x6'))(_0xb7b4('0x7'));var config=require(_0xb7b4('0x8'));var jayson=require(_0xb7b4('0x9'));var client=jayson[_0xb7b4('0xa')][_0xb7b4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x203f2f,_0x5a4ee5,_0x69de6f){return new BPromise(function(_0x864ce9,_0x448747){return client['request'](_0x203f2f,_0x69de6f)[_0xb7b4('0xc')](function(_0x670b20){logger[_0xb7b4('0xd')]('CmCompany,\x20%s,\x20%s',_0x5a4ee5,'request\x20sent');logger['debug'](_0xb7b4('0xe'),_0x5a4ee5,_0xb7b4('0xf'),JSON['stringify'](_0x670b20));if(_0x670b20[_0xb7b4('0x10')]){if(_0x670b20[_0xb7b4('0x10')][_0xb7b4('0x11')]===0x1f4){logger[_0xb7b4('0x10')](_0xb7b4('0x12'),_0x5a4ee5,_0x670b20[_0xb7b4('0x10')][_0xb7b4('0x13')]);return _0x448747(_0x670b20[_0xb7b4('0x10')][_0xb7b4('0x13')]);}logger[_0xb7b4('0x10')](_0xb7b4('0x12'),_0x5a4ee5,_0x670b20[_0xb7b4('0x10')][_0xb7b4('0x13')]);return _0x864ce9(_0x670b20[_0xb7b4('0x10')][_0xb7b4('0x13')]);}else{logger['info'](_0xb7b4('0x12'),_0x5a4ee5,_0xb7b4('0xf'));_0x864ce9(_0x670b20[_0xb7b4('0x14')][_0xb7b4('0x13')]);}})[_0xb7b4('0x15')](function(_0x2d70a5){logger[_0xb7b4('0x10')](_0xb7b4('0x12'),_0x5a4ee5,_0x2d70a5);_0x448747(_0x2d70a5);});});}
\ No newline at end of file
+var _0x525d=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x525d,0x1c3));var _0xd525=function(_0x28ea42,_0x19a083){_0x28ea42=_0x28ea42-0x0;var _0x17318d=_0x525d[_0x28ea42];return _0x17318d;};'use strict';var _=require(_0xd525('0x0'));var util=require('util');var moment=require(_0xd525('0x1'));var BPromise=require('bluebird');var rs=require(_0xd525('0x2'));var fs=require('fs');var Redis=require(_0xd525('0x3'));var db=require(_0xd525('0x4'))['db'];var utils=require(_0xd525('0x5'));var logger=require(_0xd525('0x6'))(_0xd525('0x7'));var config=require(_0xd525('0x8'));var jayson=require(_0xd525('0x9'));var client=jayson[_0xd525('0xa')][_0xd525('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x284b3f,_0x4297c2,_0x4c94b0){return new BPromise(function(_0x4dc26b,_0x4277c9){return client[_0xd525('0xc')](_0x284b3f,_0x4c94b0)[_0xd525('0xd')](function(_0x48962f){logger[_0xd525('0xe')](_0xd525('0xf'),_0x4297c2,_0xd525('0x10'));logger[_0xd525('0x11')](_0xd525('0x12'),_0x4297c2,_0xd525('0x10'),JSON[_0xd525('0x13')](_0x48962f));if(_0x48962f[_0xd525('0x14')]){if(_0x48962f[_0xd525('0x14')][_0xd525('0x15')]===0x1f4){logger[_0xd525('0x14')](_0xd525('0xf'),_0x4297c2,_0x48962f['error'][_0xd525('0x16')]);return _0x4277c9(_0x48962f[_0xd525('0x14')][_0xd525('0x16')]);}logger[_0xd525('0x14')](_0xd525('0xf'),_0x4297c2,_0x48962f['error'][_0xd525('0x16')]);return _0x4dc26b(_0x48962f[_0xd525('0x14')][_0xd525('0x16')]);}else{logger['info'](_0xd525('0xf'),_0x4297c2,'request\x20sent');_0x4dc26b(_0x48962f[_0xd525('0x17')][_0xd525('0x16')]);}})[_0xd525('0x18')](function(_0x1dc629){logger[_0xd525('0x14')](_0xd525('0xf'),_0x4297c2,_0x1dc629);_0x4277c9(_0x1dc629);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 1b6b960..e01ac7c 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 _0x7cf6=['create','addContacts','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','/:id/contacts','getContacts','post'];(function(_0xe9c732,_0x125b29){var _0x2e6559=function(_0x1463d5){while(--_0x1463d5){_0xe9c732['push'](_0xe9c732['shift']());}};_0x2e6559(++_0x125b29);}(_0x7cf6,0x125));var _0x67cf=function(_0x2a5297,_0x577f67){_0x2a5297=_0x2a5297-0x0;var _0x261070=_0x7cf6[_0x2a5297];return _0x261070;};'use strict';var multer=require(_0x67cf('0x0'));var util=require('util');var path=require(_0x67cf('0x1'));var timeout=require(_0x67cf('0x2'));var express=require(_0x67cf('0x3'));var router=express['Router']();var fs_extra=require(_0x67cf('0x4'));var auth=require(_0x67cf('0x5'));var interaction=require(_0x67cf('0x6'));var config=require(_0x67cf('0x7'));var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x67cf('0x8')]);router[_0x67cf('0x9')]('/describe',auth[_0x67cf('0xa')](),controller[_0x67cf('0xb')]);router[_0x67cf('0x9')]('/:id',auth[_0x67cf('0xa')](),controller['show']);router[_0x67cf('0x9')](_0x67cf('0xc'),auth[_0x67cf('0xa')](),controller[_0x67cf('0xd')]);router[_0x67cf('0xe')]('/',auth[_0x67cf('0xa')](),controller[_0x67cf('0xf')]);router[_0x67cf('0xe')](_0x67cf('0xc'),auth[_0x67cf('0xa')](),controller[_0x67cf('0x10')]);router['put'](_0x67cf('0x11'),auth[_0x67cf('0xa')](),controller[_0x67cf('0x12')]);router[_0x67cf('0x13')](_0x67cf('0x11'),auth[_0x67cf('0xa')](),controller[_0x67cf('0x14')]);module[_0x67cf('0x15')]=router;
\ No newline at end of file
+var _0x0e4f=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','delete'];(function(_0x585d81,_0xf6d74f){var _0x1aca0d=function(_0x3782d3){while(--_0x3782d3){_0x585d81['push'](_0x585d81['shift']());}};_0x1aca0d(++_0xf6d74f);}(_0x0e4f,0xca));var _0xf0e4=function(_0x5f0cd9,_0x2a7359){_0x5f0cd9=_0x5f0cd9-0x0;var _0x4f9c59=_0x0e4f[_0x5f0cd9];return _0x4f9c59;};'use strict';var multer=require(_0xf0e4('0x0'));var util=require('util');var path=require(_0xf0e4('0x1'));var timeout=require(_0xf0e4('0x2'));var express=require('express');var router=express[_0xf0e4('0x3')]();var fs_extra=require(_0xf0e4('0x4'));var auth=require(_0xf0e4('0x5'));var interaction=require(_0xf0e4('0x6'));var config=require(_0xf0e4('0x7'));var controller=require(_0xf0e4('0x8'));router[_0xf0e4('0x9')]('/',auth[_0xf0e4('0xa')](),controller[_0xf0e4('0xb')]);router[_0xf0e4('0x9')](_0xf0e4('0xc'),auth[_0xf0e4('0xa')](),controller[_0xf0e4('0xd')]);router[_0xf0e4('0x9')](_0xf0e4('0xe'),auth[_0xf0e4('0xa')](),controller[_0xf0e4('0xf')]);router[_0xf0e4('0x9')](_0xf0e4('0x10'),auth['isAuthenticated'](),controller[_0xf0e4('0x11')]);router[_0xf0e4('0x12')]('/',auth[_0xf0e4('0xa')](),controller['create']);router[_0xf0e4('0x12')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xf0e4('0x13')]);router[_0xf0e4('0x14')](_0xf0e4('0xe'),auth[_0xf0e4('0xa')](),controller[_0xf0e4('0x15')]);router[_0xf0e4('0x16')](_0xf0e4('0xe'),auth[_0xf0e4('0xa')](),controller[_0xf0e4('0x17')]);module[_0xf0e4('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 632fd09..75e702f 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 _0xa4d1=['UNSIGNED','DATE','NOW','STRING','TEXT','INTEGER'];(function(_0x468e6c,_0x5e150b){var _0x54c64b=function(_0x44559f){while(--_0x44559f){_0x468e6c['push'](_0x468e6c['shift']());}};_0x54c64b(++_0x5e150b);}(_0xa4d1,0x17d));var _0x1a4d=function(_0x26764f,_0x43f4e7){_0x26764f=_0x26764f-0x0;var _0x53c715=_0xa4d1[_0x26764f];return _0x53c715;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0x1a4d('0x0')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1a4d('0x0')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x1a4d('0x0')]},'city':{'type':Sequelize[_0x1a4d('0x0')]},'country':{'type':Sequelize[_0x1a4d('0x0')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1a4d('0x1')]},'phone':{'type':Sequelize[_0x1a4d('0x0')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1a4d('0x0')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x1a4d('0x0')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x1a4d('0x0')]},'viber':{'type':Sequelize[_0x1a4d('0x0')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x1a4d('0x0')]},'telegram':{'type':Sequelize[_0x1a4d('0x0')]},'UserId':{'type':Sequelize[_0x1a4d('0x2')]},'AdditionalPhones':{'type':Sequelize[_0x1a4d('0x0')]},'priority':{'type':Sequelize[_0x1a4d('0x2')](0x2)[_0x1a4d('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1a4d('0x4')],'defaultValue':Sequelize[_0x1a4d('0x5')]},'dialTimezone':{'type':Sequelize[_0x1a4d('0x0')]},'utcOffset':{'type':Sequelize[_0x1a4d('0x2')]}};
\ No newline at end of file
+var _0x241b=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports'];(function(_0x5b7b6a,_0x4928a0){var _0x40aa78=function(_0x142851){while(--_0x142851){_0x5b7b6a['push'](_0x5b7b6a['shift']());}};_0x40aa78(++_0x4928a0);}(_0x241b,0x165));var _0xb241=function(_0x2c6665,_0x506b4b){_0x2c6665=_0x2c6665-0x0;var _0x3cf7a4=_0x241b[_0x2c6665];return _0x3cf7a4;};'use strict';var _=require(_0xb241('0x0'));var Sequelize=require(_0xb241('0x1'));module[_0xb241('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xb241('0x3')]},'street':{'type':Sequelize[_0xb241('0x3')]},'postalCode':{'type':Sequelize[_0xb241('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xb241('0x3')]},'dateOfBirth':{'type':Sequelize[_0xb241('0x3')]},'description':{'type':Sequelize[_0xb241('0x4')]},'phone':{'type':Sequelize[_0xb241('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xb241('0x3')]},'email':{'type':Sequelize[_0xb241('0x3')]},'url':{'type':Sequelize[_0xb241('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xb241('0x3')]},'skype':{'type':Sequelize[_0xb241('0x3')]},'teams':{'type':Sequelize[_0xb241('0x3')]},'viber':{'type':Sequelize[_0xb241('0x3')]},'line':{'type':Sequelize[_0xb241('0x3')]},'wechat':{'type':Sequelize[_0xb241('0x3')]},'telegram':{'type':Sequelize[_0xb241('0x3')]},'UserId':{'type':Sequelize[_0xb241('0x5')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb241('0x5')](0x2)[_0xb241('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xb241('0x7')],'defaultValue':Sequelize[_0xb241('0x8')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xb241('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 9ef9a4d..f25a82c 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 _0x544f=['custom','type','values','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','tags','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','create','join','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','$or','push','where','ListId','findOrCreate','contact','all','Tag','Tags','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','omit','map','format','cf_%d','pickBy','setFields','id\x20=\x20?','toParam','sequelize','text','phone','getTags','findOne','model','rawAttributes','attributes','intersection','fields','order','sort','filters','pick','filter','options','setTags','ids','CmContactHasItem','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','PHONE','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','nolimit','ContactId','includeAll','include','rows','getHopperHistories','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','root','server/files/tmp','file','chmodSync','0777','child_process','fork','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','parse','meta','import','User','agent','binding','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','firstName','socket_timestamp','../../components/import/cm/csvUpdates','message','getJourney','mail','chat','sms','openchannel','fax','voice','-createdAt','resolve','channel','includes','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','destination','starttime','endtime','duration','note','createdAt','userDisposition','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer','subject','substatus','externalUrl','Interaction','flatten','reverse','value','moment','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','defaults','socket.io-emitter','register','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','index','describe','getOptions','findAll','query','CmContact','find','params','catch','keys','length','startsWith','cf_','columnName','displayName','analytics','CmCustomField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x544f,0x1cd));var _0xf544=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x544f[_0x46698a];return _0x356db0;};'use strict';var moment=require(_0xf544('0x0'));var BPromise=require('bluebird');var util=require(_0xf544('0x1'));var path=require(_0xf544('0x2'));var fs=require('fs');var _=require(_0xf544('0x3'));var squel=require(_0xf544('0x4'));var Papa=require(_0xf544('0x5'));var Redis=require(_0xf544('0x6'));var contacts=require(_0xf544('0x7'));var qs=require(_0xf544('0x8'));var logger=require(_0xf544('0x9'))(_0xf544('0xa'));var config=require(_0xf544('0xb'));var shared=require(_0xf544('0xc'));var db=require('../../mysqldb')['db'];config[_0xf544('0xd')]=_[_0xf544('0xe')](config[_0xf544('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xf544('0xf'))(new Redis(config[_0xf544('0xd')]));require('./cmContact.socket')[_0xf544('0x10')](socket);function respondWithResult(_0x3c2f00,_0x38df05){_0x38df05=_0x38df05||0xc8;return function(_0x11cbf7){if(_0x11cbf7){return _0x3c2f00[_0xf544('0x11')](_0x38df05)[_0xf544('0x12')](_0x11cbf7);}};}function respondWithFilteredResult(_0x265a80,_0xb96a0f){return function(_0x138ad6){if(_0x138ad6){var _0x241ca8=typeof _0xb96a0f['offset']===_0xf544('0x13')&&typeof _0xb96a0f[_0xf544('0x14')]==='undefined';var _0x4fb7cd=_0x138ad6[_0xf544('0x15')];var _0x3c7e94=_0x241ca8?0x0:_0xb96a0f[_0xf544('0x16')];var _0x55b37a=_0x241ca8?_0x138ad6[_0xf544('0x15')]:_0xb96a0f[_0xf544('0x16')]+_0xb96a0f[_0xf544('0x14')];var _0x4266c7;if(_0x55b37a>=_0x4fb7cd){_0x55b37a=_0x4fb7cd;_0x4266c7=0xc8;}else{_0x4266c7=0xce;}_0x265a80[_0xf544('0x11')](_0x4266c7);return _0x265a80[_0xf544('0x17')](_0xf544('0x18'),_0x3c7e94+'-'+_0x55b37a+'/'+_0x4fb7cd)[_0xf544('0x12')](_0x138ad6);}return null;};}function saveUpdates(_0x43a93a){return function(_0x2c6ac6){if(_0x2c6ac6){return _0x2c6ac6[_0xf544('0x19')](_0x43a93a)[_0xf544('0x1a')](function(_0x48d441){return _0x48d441;});}return null;};}function removeEntity(_0x350243){return function(_0x5c909f){if(_0x5c909f){return _0x5c909f[_0xf544('0x1b')]()[_0xf544('0x1a')](function(){_0x350243['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a8914){return function(_0xeda7b2){if(!_0xeda7b2){_0x3a8914[_0xf544('0x1c')](0x194);}return _0xeda7b2;};}function handleError(_0x235325,_0xf5e5a1){_0xf5e5a1=_0xf5e5a1||0x1f4;return function(_0x9a908){logger[_0xf544('0x1d')](_0x9a908[_0xf544('0x1e')]);if(_0x9a908[_0xf544('0x1f')]){delete _0x9a908[_0xf544('0x1f')];}_0x235325[_0xf544('0x11')](_0xf5e5a1)['send'](_0x9a908);};}exports[_0xf544('0x20')]=function(_0x3598cf,_0x453a9d){var _0x2278b4={};return contacts[_0xf544('0x21')]()['then'](function(_0x20afcd){_0x2278b4=qs[_0xf544('0x22')](_0x20afcd,_0x3598cf);return contacts[_0xf544('0x23')](_0x3598cf[_0xf544('0x24')],_0x3598cf['user'],_0x2278b4,_0x20afcd);})[_0xf544('0x1a')](respondWithFilteredResult(_0x453a9d,_0x2278b4))['catch'](handleError(_0x453a9d,null));};exports['destroy']=function(_0x2c4e96,_0x5d5e2c){return db[_0xf544('0x25')][_0xf544('0x26')]({'where':{'id':_0x2c4e96[_0xf544('0x27')]['id']}})[_0xf544('0x1a')](handleEntityNotFound(_0x5d5e2c,null))['then'](removeEntity(_0x5d5e2c,null))[_0xf544('0x28')](handleError(_0x5d5e2c,null));};exports[_0xf544('0x21')]=function(_0x3e748c,_0x42bdc4){return db[_0xf544('0x25')][_0xf544('0x21')]()[_0xf544('0x1a')](function(_0x5b81a4){delete _0x5b81a4['tags'];for(var _0x3c0599=0x0;_0x3c0599
','Attachments','Data','generateXOAuth2Token'];(function(_0xad39f6,_0x129028){var _0x2eb864=function(_0xfc11bb){while(--_0xfc11bb){_0xad39f6['push'](_0xad39f6['shift']());}};_0x2eb864(++_0x129028);}(_0x5922,0x132));var _0x2592=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x5922[_0x2dea24];return _0x309d58;};'use strict';var _=require('lodash');var moment=require(_0x2592('0x0'));var random=require(_0x2592('0x1'));var fs=require('fs');var path=require('path');var util=require('util');var tnef=require(_0x2592('0x2'));var logger=require(_0x2592('0x3'))(_0x2592('0x4'));var config=require(_0x2592('0x5'));function getAddress(_0x3d8501){var _0x29eee8=_[_0x2592('0x6')](_0x3d8501[_0x2592('0x7')]);return _0x29eee8&&_0x29eee8[_0x2592('0x8')]?_0x29eee8[_0x2592('0x8')]:_0x2592('0x9')+random[_0x2592('0xa')](0x6)+_0x2592('0xb');}function getFirstName(_0x1b75bb){var _0x1f217d=_[_0x2592('0x6')](_0x1b75bb[_0x2592('0x7')]);if(_0x1f217d&&_0x1f217d[_0x2592('0xc')]){if(_0x1f217d['name']==_0x1f217d[_0x2592('0x8')]){return _0x1f217d[_0x2592('0xc')][_0x2592('0xd')](0x0,_0x1f217d[_0x2592('0xc')][_0x2592('0xe')]('@'));}var _0x51ec41=_0x1f217d[_0x2592('0xc')][_0x2592('0xf')](/\s+/);return _0x51ec41[_0x2592('0x10')]>0x1?_0x51ec41[_0x2592('0x11')](0x0,-0x1)[_0x2592('0x12')]('\x20'):_0x1f217d[_0x2592('0xc')];}return'Anonymous';}function getLastName(_0x38a446){var _0x224418=_['head'](_0x38a446[_0x2592('0x7')]);if(_0x224418&&_0x224418[_0x2592('0xc')]){var _0x2d33e2=_0x224418[_0x2592('0xc')]['split'](/\s+/);return _0x2d33e2['length']>0x1?_0x2d33e2[_0x2592('0x13')]():'';}return'';}function getMails(_0x3452bb,_0x297eb0){var _0x6ef5dc='';for(var _0x34f5c4=0x0;_0x34f5c4<_0x297eb0[_0x2592('0x7')][_0x2592('0x10')];_0x34f5c4+=0x1){if(_0x297eb0[_0x2592('0x7')][_0x34f5c4]['address']!==_0x3452bb){if(!_[_0x2592('0x14')](_0x6ef5dc)){_0x6ef5dc+=',';}_0x6ef5dc+=_0x297eb0[_0x2592('0x7')][_0x34f5c4][_0x2592('0xc')]||_0x297eb0['value'][_0x34f5c4]['address']||'';_0x6ef5dc+='\x20<';_0x6ef5dc+=_0x297eb0[_0x2592('0x7')][_0x34f5c4]['address']?_0x297eb0[_0x2592('0x7')][_0x34f5c4][_0x2592('0x8')]:'anonymous'+random[_0x2592('0xa')](0x6)+_0x2592('0xb');_0x6ef5dc+='>';}}return _0x6ef5dc;}function parseEmail(_0x1a97ca,_0x2f93fd,_0x337996){if(_0x2f93fd['html']){var _0x37dbbd=/