From: Andrea Bianco
Date: Mon, 4 Apr 2022 21:55:22 +0000 (+0200)
Subject: Built motion from commit da617fac.|2.6.6
X-Git-Tag: 2.6.6
X-Git-Url: http://repos.xcallymotion.com/base/%22./banner.jpg//%22avatar.png/%22?a=commitdiff_plain;h=fe8c827137dd3c5e6b46ed251e0129d077b10dab;p=motion2.git
Built motion from commit da617fac.|2.6.6
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 6535a09..c12d009 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-04-04T21:35:56.346Z",
+ "time": "2022-04-04T21:47:09.903Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index f2523e8..d30b1d0 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-04-04T21:35:56.346Z",
+ "time": "2022-04-04T21:47:09.903Z",
"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 a6e2f1f..a071611 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 _0xea1f=['TEXT','exports','getDataValue','action','STRING','integration','motionbar','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x3c180c,_0x52406){var _0xc5f9fe=function(_0xc27d5c){while(--_0xc27d5c){_0x3c180c['push'](_0x3c180c['shift']());}};_0xc5f9fe(++_0x52406);}(_0xea1f,0x6a));var _0xfea1=function(_0x5714dc,_0x3df6e4){_0x5714dc=_0x5714dc-0x0;var _0x58a901=_0xea1f[_0x5714dc];return _0x58a901;};'use strict';var Sequelize=require('sequelize');module[_0xfea1('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x421457){return this[_0xfea1('0x1')](_0xfea1('0x2'));}},'action':{'type':Sequelize[_0xfea1('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xfea1('0x4'),_0xfea1('0x5'),'jscripty',_0xfea1('0x6'),'browser',_0xfea1('0x7'),_0xfea1('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xfea1('0x9')},'data1':{'type':Sequelize[_0xfea1('0x3')](0x1000),'comment':_0xfea1('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xfea1('0xb')},'data3':{'type':Sequelize[_0xfea1('0x3')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xfea1('0x3')](0x1000),'comments':_0xfea1('0xc')},'data5':{'type':Sequelize[_0xfea1('0x3')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xfea1('0x3')],'comments':_0xfea1('0xd')},'data7':{'type':Sequelize[_0xfea1('0xe')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xd535=['urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','getDataValue','action','integration','motionbar','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'];(function(_0x45e135,_0x4e7c9b){var _0x31853e=function(_0x329f10){while(--_0x329f10){_0x45e135['push'](_0x45e135['shift']());}};_0x31853e(++_0x4e7c9b);}(_0xd535,0x167));var _0x5d53=function(_0x2eb40c,_0x3f90cf){_0x2eb40c=_0x2eb40c-0x0;var _0x250b6d=_0xd535[_0x2eb40c];return _0x250b6d;};'use strict';var Sequelize=require(_0x5d53('0x0'));module[_0x5d53('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x17dd80){return this[_0x5d53('0x2')](_0x5d53('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x5d53('0x4'),_0x5d53('0x5'),_0x5d53('0x6'),'urlForward',_0x5d53('0x7'),'bot',_0x5d53('0x8')]],'msg':_0x5d53('0x9')}},'comment':_0x5d53('0x9')},'data1':{'type':Sequelize[_0x5d53('0xa')](0x1000),'comment':_0x5d53('0xb')},'data2':{'type':Sequelize[_0x5d53('0xa')](0x1000),'comment':_0x5d53('0xc')},'data3':{'type':Sequelize[_0x5d53('0xa')](0x1000),'comment':_0x5d53('0xd')},'data4':{'type':Sequelize[_0x5d53('0xa')](0x1000),'comments':_0x5d53('0xe')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x5d53('0xa')],'comments':_0x5d53('0xf')},'data7':{'type':Sequelize[_0x5d53('0x10')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index a2f5383..a648ca0 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 _0x43db=['status','end','json','undefined','count','offset','limit','set','apply','reject','update','destroy','then','error','stack','name','send','body','find','params','catch','Action','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x259264,_0xfe2f1f){var _0x333ff4=function(_0x366e5c){while(--_0x366e5c){_0x259264['push'](_0x259264['shift']());}};_0x333ff4(++_0xfe2f1f);}(_0x43db,0x7a));var _0xb43d=function(_0x2d4421,_0x15a84f){_0x2d4421=_0x2d4421-0x0;var _0x2d3b01=_0x43db[_0x2d4421];return _0x2d3b01;};'use strict';var emlformat=require(_0xb43d('0x0'));var rimraf=require(_0xb43d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb43d('0x2'));var rp=require(_0xb43d('0x3'));var moment=require(_0xb43d('0x4'));var BPromise=require(_0xb43d('0x5'));var Mustache=require(_0xb43d('0x6'));var util=require(_0xb43d('0x7'));var path=require(_0xb43d('0x8'));var sox=require(_0xb43d('0x9'));var csv=require('to-csv');var ejs=require(_0xb43d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb43d('0xb'));var squel=require(_0xb43d('0xc'));var crypto=require(_0xb43d('0xd'));var jsforce=require(_0xb43d('0xe'));var deskjs=require(_0xb43d('0xf'));var toCsv=require(_0xb43d('0x10'));var querystring=require(_0xb43d('0x11'));var Papa=require(_0xb43d('0x12'));var Redis=require(_0xb43d('0x13'));var authService=require(_0xb43d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb43d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb43d('0x16'))(_0xb43d('0x17'));var utils=require(_0xb43d('0x18'));var config=require(_0xb43d('0x19'));var licenseUtil=require(_0xb43d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x371f08,_0x2a3960){_0x2a3960=_0x2a3960||0xcc;return function(_0x219d27){if(_0x219d27){return _0x371f08[_0xb43d('0x1b')](_0x2a3960);}return _0x371f08[_0xb43d('0x1c')](_0x2a3960)[_0xb43d('0x1d')]();};}function respondWithResult(_0x31d79e,_0x2d3f8e){_0x2d3f8e=_0x2d3f8e||0xc8;return function(_0x1dfc82){if(_0x1dfc82){return _0x31d79e[_0xb43d('0x1c')](_0x2d3f8e)[_0xb43d('0x1e')](_0x1dfc82);}};}function respondWithFilteredResult(_0x15c00b,_0x180a47){return function(_0x2be3f6){if(_0x2be3f6){var _0x20db51=typeof _0x180a47['offset']===_0xb43d('0x1f')&&typeof _0x180a47['limit']===_0xb43d('0x1f');var _0x54abc4=_0x2be3f6[_0xb43d('0x20')];var _0x39ff64=_0x20db51?0x0:_0x180a47[_0xb43d('0x21')];var _0x136e79=_0x20db51?_0x2be3f6['count']:_0x180a47['offset']+_0x180a47[_0xb43d('0x22')];var _0x45f8a4;if(_0x136e79>=_0x54abc4){_0x136e79=_0x54abc4;_0x45f8a4=0xc8;}else{_0x45f8a4=0xce;}_0x15c00b[_0xb43d('0x1c')](_0x45f8a4);return _0x15c00b[_0xb43d('0x23')]('Content-Range',_0x39ff64+'-'+_0x136e79+'/'+_0x54abc4)[_0xb43d('0x1e')](_0x2be3f6);}return null;};}function patchUpdates(_0x5eb094){return function(_0x522da3){try{jsonpatch[_0xb43d('0x24')](_0x522da3,_0x5eb094,!![]);}catch(_0xe0536f){return BPromise[_0xb43d('0x25')](_0xe0536f);}return _0x522da3['save']();};}function saveUpdates(_0x412722,_0x18a52b){return function(_0x303fc2){if(_0x303fc2){return _0x303fc2[_0xb43d('0x26')](_0x412722)['then'](function(_0x39eab8){return _0x39eab8;});}return null;};}function removeEntity(_0x7f0a2e,_0x31b537){return function(_0x5fc649){if(_0x5fc649){return _0x5fc649[_0xb43d('0x27')]()[_0xb43d('0x28')](function(){_0x7f0a2e[_0xb43d('0x1c')](0xcc)[_0xb43d('0x1d')]();});}};}function handleEntityNotFound(_0x5896b1,_0x46b0b2){return function(_0x565589){if(!_0x565589){_0x5896b1[_0xb43d('0x1b')](0x194);}return _0x565589;};}function handleError(_0x477fe4,_0x38f9b2){_0x38f9b2=_0x38f9b2||0x1f4;return function(_0x14fb5f){logger[_0xb43d('0x29')](_0x14fb5f[_0xb43d('0x2a')]);if(_0x14fb5f[_0xb43d('0x2b')]){delete _0x14fb5f['name'];}_0x477fe4[_0xb43d('0x1c')](_0x38f9b2)[_0xb43d('0x2c')](_0x14fb5f);};}exports[_0xb43d('0x26')]=function(_0xab1497,_0x83cb18){if(_0xab1497[_0xb43d('0x2d')]['id']){delete _0xab1497[_0xb43d('0x2d')]['id'];}return db['Action'][_0xb43d('0x2e')]({'where':{'id':_0xab1497[_0xb43d('0x2f')]['id']}})[_0xb43d('0x28')](handleEntityNotFound(_0x83cb18,null))['then'](saveUpdates(_0xab1497[_0xb43d('0x2d')],null))[_0xb43d('0x28')](respondWithResult(_0x83cb18,null))[_0xb43d('0x30')](handleError(_0x83cb18,null));};exports['destroy']=function(_0x5088ea,_0x49510){return db[_0xb43d('0x31')]['find']({'where':{'id':_0x5088ea['params']['id']}})[_0xb43d('0x28')](handleEntityNotFound(_0x49510,null))[_0xb43d('0x28')](removeEntity(_0x49510,null))[_0xb43d('0x30')](handleError(_0x49510,null));};
\ No newline at end of file
+var _0xf8ef=['fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','Content-Range','reject','save','update','then','destroy','sendStatus','name','send','body','Action','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs'];(function(_0x2b4d01,_0x4c6044){var _0x4195d7=function(_0x59935){while(--_0x59935){_0x2b4d01['push'](_0x2b4d01['shift']());}};_0x4195d7(++_0x4c6044);}(_0xf8ef,0x13e));var _0xff8e=function(_0x390db1,_0x468c8b){_0x390db1=_0x390db1-0x0;var _0x4910c7=_0xf8ef[_0x390db1];return _0x4910c7;};'use strict';var emlformat=require(_0xff8e('0x0'));var rimraf=require(_0xff8e('0x1'));var zipdir=require(_0xff8e('0x2'));var jsonpatch=require(_0xff8e('0x3'));var rp=require(_0xff8e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xff8e('0x5'));var path=require(_0xff8e('0x6'));var sox=require(_0xff8e('0x7'));var csv=require(_0xff8e('0x8'));var ejs=require(_0xff8e('0x9'));var fs=require('fs');var fs_extra=require(_0xff8e('0xa'));var _=require(_0xff8e('0xb'));var squel=require(_0xff8e('0xc'));var crypto=require(_0xff8e('0xd'));var jsforce=require(_0xff8e('0xe'));var deskjs=require(_0xff8e('0xf'));var toCsv=require(_0xff8e('0x8'));var querystring=require('querystring');var Papa=require(_0xff8e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xff8e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff8e('0x12'));var logger=require('../../config/logger')(_0xff8e('0x13'));var utils=require('../../config/utils');var config=require(_0xff8e('0x14'));var licenseUtil=require(_0xff8e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2243dc,_0x4da014){_0x4da014=_0x4da014||0xcc;return function(_0xd8177b){if(_0xd8177b){return _0x2243dc['sendStatus'](_0x4da014);}return _0x2243dc[_0xff8e('0x16')](_0x4da014)[_0xff8e('0x17')]();};}function respondWithResult(_0x3585ff,_0x580989){_0x580989=_0x580989||0xc8;return function(_0x3e4f97){if(_0x3e4f97){return _0x3585ff[_0xff8e('0x16')](_0x580989)[_0xff8e('0x18')](_0x3e4f97);}};}function respondWithFilteredResult(_0x4a6860,_0x1c9d72){return function(_0x5617c7){if(_0x5617c7){var _0x150bc2=typeof _0x1c9d72[_0xff8e('0x19')]===_0xff8e('0x1a')&&typeof _0x1c9d72[_0xff8e('0x1b')]===_0xff8e('0x1a');var _0x37ba77=_0x5617c7['count'];var _0x29d48d=_0x150bc2?0x0:_0x1c9d72[_0xff8e('0x19')];var _0x103b66=_0x150bc2?_0x5617c7['count']:_0x1c9d72[_0xff8e('0x19')]+_0x1c9d72[_0xff8e('0x1b')];var _0x549666;if(_0x103b66>=_0x37ba77){_0x103b66=_0x37ba77;_0x549666=0xc8;}else{_0x549666=0xce;}_0x4a6860[_0xff8e('0x16')](_0x549666);return _0x4a6860['set'](_0xff8e('0x1c'),_0x29d48d+'-'+_0x103b66+'/'+_0x37ba77)[_0xff8e('0x18')](_0x5617c7);}return null;};}function patchUpdates(_0x84e6be){return function(_0x5c2bb4){try{jsonpatch['apply'](_0x5c2bb4,_0x84e6be,!![]);}catch(_0x54a804){return BPromise[_0xff8e('0x1d')](_0x54a804);}return _0x5c2bb4[_0xff8e('0x1e')]();};}function saveUpdates(_0x61c559,_0x469944){return function(_0x4e8aec){if(_0x4e8aec){return _0x4e8aec[_0xff8e('0x1f')](_0x61c559)[_0xff8e('0x20')](function(_0x321f75){return _0x321f75;});}return null;};}function removeEntity(_0x47bbd0,_0x5a45f9){return function(_0x20a89b){if(_0x20a89b){return _0x20a89b[_0xff8e('0x21')]()[_0xff8e('0x20')](function(){_0x47bbd0[_0xff8e('0x16')](0xcc)[_0xff8e('0x17')]();});}};}function handleEntityNotFound(_0x42efce,_0x5ed118){return function(_0x9d3df){if(!_0x9d3df){_0x42efce[_0xff8e('0x22')](0x194);}return _0x9d3df;};}function handleError(_0x31552c,_0x42428a){_0x42428a=_0x42428a||0x1f4;return function(_0x38e460){logger['error'](_0x38e460['stack']);if(_0x38e460[_0xff8e('0x23')]){delete _0x38e460['name'];}_0x31552c[_0xff8e('0x16')](_0x42428a)[_0xff8e('0x24')](_0x38e460);};}exports['update']=function(_0x2acf9e,_0xc88fbc){if(_0x2acf9e[_0xff8e('0x25')]['id']){delete _0x2acf9e['body']['id'];}return db[_0xff8e('0x26')][_0xff8e('0x27')]({'where':{'id':_0x2acf9e[_0xff8e('0x28')]['id']}})[_0xff8e('0x20')](handleEntityNotFound(_0xc88fbc,null))[_0xff8e('0x20')](saveUpdates(_0x2acf9e[_0xff8e('0x25')],null))[_0xff8e('0x20')](respondWithResult(_0xc88fbc,null))['catch'](handleError(_0xc88fbc,null));};exports[_0xff8e('0x21')]=function(_0x1ff97d,_0x162dc9){return db[_0xff8e('0x26')]['find']({'where':{'id':_0x1ff97d[_0xff8e('0x28')]['id']}})[_0xff8e('0x20')](handleEntityNotFound(_0x162dc9,null))[_0xff8e('0x20')](removeEntity(_0x162dc9,null))['catch'](handleError(_0x162dc9,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 0490692..d435cb6 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 _0xd933=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','exports'];(function(_0x177fdb,_0x702728){var _0x537fe5=function(_0x580ffe){while(--_0x580ffe){_0x177fdb['push'](_0x177fdb['shift']());}};_0x537fe5(++_0x702728);}(_0xd933,0x1c8));var _0x3d93=function(_0x3fc386,_0x413579){_0x3fc386=_0x3fc386-0x0;var _0x42c521=_0xd933[_0x3fc386];return _0x42c521;};'use strict';var _=require(_0x3d93('0x0'));var util=require(_0x3d93('0x1'));var logger=require(_0x3d93('0x2'))('api');var moment=require(_0x3d93('0x3'));var BPromise=require(_0x3d93('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d93('0x5'));var rimraf=require('rimraf');var config=require(_0x3d93('0x6'));var attributes=require('./action.attributes');module[_0x3d93('0x7')]=function(_0x56581d,_0x34b7d1){return _0x56581d['define']('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8e18=['tools_actions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','Action'];(function(_0x39e1e5,_0x1410c9){var _0x146024=function(_0x3aabbb){while(--_0x3aabbb){_0x39e1e5['push'](_0x39e1e5['shift']());}};_0x146024(++_0x1410c9);}(_0x8e18,0x1ae));var _0x88e1=function(_0x4938b5,_0x2e6769){_0x4938b5=_0x4938b5-0x0;var _0x4a9486=_0x8e18[_0x4938b5];return _0x4a9486;};'use strict';var _=require(_0x88e1('0x0'));var util=require(_0x88e1('0x1'));var logger=require(_0x88e1('0x2'))(_0x88e1('0x3'));var moment=require(_0x88e1('0x4'));var BPromise=require('bluebird');var rp=require(_0x88e1('0x5'));var fs=require('fs');var path=require(_0x88e1('0x6'));var rimraf=require(_0x88e1('0x7'));var config=require(_0x88e1('0x8'));var attributes=require(_0x88e1('0x9'));module[_0x88e1('0xa')]=function(_0x528360,_0x20d067){return _0x528360['define'](_0x88e1('0xb'),attributes,{'tableName':_0x88e1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 85b6d57..58028db 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 _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(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x7217,0x19e));var _0x7721=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7217[_0x40ac5e];return _0x2839d6;};'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
+var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x4975,0x86));var _0x5497=function(_0xd7677c,_0x3d8096){_0xd7677c=_0xd7677c-0x0;var _0x467b2b=_0x4975[_0xd7677c];return _0x467b2b;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index ce739ad..688180e 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 _0x1eb3=['delete','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./action.controller','/:id','update'];(function(_0x103f5f,_0x2d0dd1){var _0x388142=function(_0x44e6c2){while(--_0x44e6c2){_0x103f5f['push'](_0x103f5f['shift']());}};_0x388142(++_0x2d0dd1);}(_0x1eb3,0x9d));var _0x31eb=function(_0x1979f4,_0x3366aa){_0x1979f4=_0x1979f4-0x0;var _0x32a04e=_0x1eb3[_0x1979f4];return _0x32a04e;};'use strict';var multer=require(_0x31eb('0x0'));var util=require(_0x31eb('0x1'));var path=require(_0x31eb('0x2'));var timeout=require(_0x31eb('0x3'));var express=require(_0x31eb('0x4'));var router=express[_0x31eb('0x5')]();var fs_extra=require(_0x31eb('0x6'));var auth=require(_0x31eb('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x31eb('0x8'));router['put'](_0x31eb('0x9'),auth['isAuthenticated'](),controller[_0x31eb('0xa')]);router[_0x31eb('0xb')](_0x31eb('0x9'),auth[_0x31eb('0xc')](),controller['destroy']);module[_0x31eb('0xd')]=router;
\ No newline at end of file
+var _0x1686=['fs-extra','../../components/auth/service','../../config/environment','put','isAuthenticated','update','delete','/:id','multer','util','path','connect-timeout'];(function(_0x4ac8d1,_0x4384ae){var _0x2ef84e=function(_0xc0c2b0){while(--_0xc0c2b0){_0x4ac8d1['push'](_0x4ac8d1['shift']());}};_0x2ef84e(++_0x4384ae);}(_0x1686,0x104));var _0x6168=function(_0xf4972d,_0xf1c2ee){_0xf4972d=_0xf4972d-0x0;var _0x125f00=_0x1686[_0xf4972d];return _0x125f00;};'use strict';var multer=require(_0x6168('0x0'));var util=require(_0x6168('0x1'));var path=require(_0x6168('0x2'));var timeout=require(_0x6168('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6168('0x4'));var auth=require(_0x6168('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6168('0x6'));var controller=require('./action.controller');router[_0x6168('0x7')]('/:id',auth[_0x6168('0x8')](),controller[_0x6168('0x9')]);router[_0x6168('0xa')](_0x6168('0xb'),auth[_0x6168('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 15b7ae3..df072e1 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 _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0xcae7af,_0x12ea35){var _0x476c98=function(_0x5e6a77){while(--_0x5e6a77){_0xcae7af['push'](_0xcae7af['shift']());}};_0x476c98(++_0x12ea35);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
+var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x3604fd,_0x36d36c){var _0x449dff=function(_0x20ad1e){while(--_0x20ad1e){_0x3604fd['push'](_0x3604fd['shift']());}};_0x449dff(++_0x36d36c);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x25cf87,_0x1bbc50){_0x25cf87=_0x25cf87-0x0;var _0x353cca=_0x3eea[_0x25cf87];return _0x353cca;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 502adac..922eab5 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 _0xf0b0=['groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','IS\x20NOT\x20NULL','keyBy','replace','alias','output','web','%s-%s.%s','randomstring','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','savename','countTable','COUNT(*)','SELECT','run','runReport','GROUP_CONCAT(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','keys','find','catch','create','body','role','user','Reports','UserProfileSection','UserProfileResource','preview','join','left_join','right_join','cross_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','select','from','MetricId','metric','function','format'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xf0b0,0xd1));var _0x0f0b=function(_0x26a99d,_0x1a746e){_0x26a99d=_0x26a99d-0x0;var _0x231c06=_0xf0b0[_0x26a99d];return _0x231c06;};'use strict';var emlformat=require(_0x0f0b('0x0'));var rimraf=require(_0x0f0b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f0b('0x2'));var rp=require(_0x0f0b('0x3'));var moment=require(_0x0f0b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0f0b('0x5'));var util=require(_0x0f0b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0f0b('0x7'));var ejs=require(_0x0f0b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f0b('0x9'));var squel=require(_0x0f0b('0xa'));var crypto=require(_0x0f0b('0xb'));var jsforce=require(_0x0f0b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0f0b('0x7'));var querystring=require('querystring');var Papa=require(_0x0f0b('0xd'));var Redis=require('ioredis');var authService=require(_0x0f0b('0xe'));var qs=require(_0x0f0b('0xf'));var as=require(_0x0f0b('0x10'));var hardwareService=require(_0x0f0b('0x11'));var logger=require('../../config/logger')(_0x0f0b('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0f0b('0x13'));var db=require(_0x0f0b('0x14'))['db'];var dbH=require(_0x0f0b('0x14'))[_0x0f0b('0x15')];function respondWithStatusCode(_0x500eea,_0x47a443){_0x47a443=_0x47a443||0xcc;return function(_0x568a05){if(_0x568a05){return _0x500eea[_0x0f0b('0x16')](_0x47a443);}return _0x500eea[_0x0f0b('0x17')](_0x47a443)[_0x0f0b('0x18')]();};}function respondWithResult(_0x4f4bbf,_0x3fa206){_0x3fa206=_0x3fa206||0xc8;return function(_0x53dedc){if(_0x53dedc){return _0x4f4bbf[_0x0f0b('0x17')](_0x3fa206)[_0x0f0b('0x19')](_0x53dedc);}};}function respondWithFilteredResult(_0x1334e6,_0x5491ab){return function(_0x3a64dc){if(_0x3a64dc){var _0x3d6293=typeof _0x5491ab[_0x0f0b('0x1a')]===_0x0f0b('0x1b')&&typeof _0x5491ab['limit']===_0x0f0b('0x1b');var _0xd0f672=_0x3a64dc[_0x0f0b('0x1c')];var _0x1da8e0=_0x3d6293?0x0:_0x5491ab[_0x0f0b('0x1a')];var _0x148284=_0x3d6293?_0x3a64dc[_0x0f0b('0x1c')]:_0x5491ab['offset']+_0x5491ab[_0x0f0b('0x1d')];var _0x2cd771;if(_0x148284>=_0xd0f672){_0x148284=_0xd0f672;_0x2cd771=0xc8;}else{_0x2cd771=0xce;}_0x1334e6['status'](_0x2cd771);return _0x1334e6[_0x0f0b('0x1e')](_0x0f0b('0x1f'),_0x1da8e0+'-'+_0x148284+'/'+_0xd0f672)[_0x0f0b('0x19')](_0x3a64dc);}return null;};}function patchUpdates(_0x35fe61){return function(_0x5d8060){try{jsonpatch[_0x0f0b('0x20')](_0x5d8060,_0x35fe61,!![]);}catch(_0x5a1a44){return BPromise[_0x0f0b('0x21')](_0x5a1a44);}return _0x5d8060[_0x0f0b('0x22')]();};}function saveUpdates(_0x26b05f,_0x2bf01f){return function(_0x219d06){if(_0x219d06){return _0x219d06[_0x0f0b('0x23')](_0x26b05f)[_0x0f0b('0x24')](function(_0x4930d7){return _0x4930d7;});}return null;};}function removeEntity(_0x5bac1a,_0x3201f4){return function(_0x2f3aa4){if(_0x2f3aa4){return _0x2f3aa4[_0x0f0b('0x25')]()[_0x0f0b('0x24')](function(){var _0x43093c=_0x2f3aa4[_0x0f0b('0x26')]({'plain':!![]});var _0x4d47aa=_0x0f0b('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x4d47aa,'resourceId':_0x43093c['id']}})['then'](function(){return _0x2f3aa4;});})[_0x0f0b('0x24')](function(){_0x5bac1a[_0x0f0b('0x17')](0xcc)[_0x0f0b('0x18')]();});}};}function handleEntityNotFound(_0x3fb4f7,_0x16de11){return function(_0x2aaa8d){if(!_0x2aaa8d){_0x3fb4f7[_0x0f0b('0x16')](0x194);}return _0x2aaa8d;};}function handleError(_0x7b4193,_0x155902){_0x155902=_0x155902||0x1f4;return function(_0x3ce895){logger[_0x0f0b('0x28')](_0x3ce895[_0x0f0b('0x29')]);if(_0x3ce895[_0x0f0b('0x2a')]){delete _0x3ce895[_0x0f0b('0x2a')];}_0x7b4193[_0x0f0b('0x17')](_0x155902)[_0x0f0b('0x2b')](_0x3ce895);};}exports[_0x0f0b('0x2c')]=function(_0x2f5788,_0x561fa4){var _0x35a6ea={},_0xabb8dc={},_0x4dd243={'count':0x0,'rows':[]};var _0x376b24=_[_0x0f0b('0x2d')](db[_0x0f0b('0x2e')][_0x0f0b('0x2f')],function(_0x2acd9f){return{'name':_0x2acd9f[_0x0f0b('0x30')],'type':_0x2acd9f[_0x0f0b('0x31')][_0x0f0b('0x32')]};});_0xabb8dc['model']=_['map'](_0x376b24,_0x0f0b('0x2a'));_0xabb8dc['query']=_['keys'](_0x2f5788['query']);_0xabb8dc['filters']=_[_0x0f0b('0x33')](_0xabb8dc[_0x0f0b('0x34')],_0xabb8dc[_0x0f0b('0x35')]);_0x35a6ea['attributes']=_['intersection'](_0xabb8dc['model'],qs[_0x0f0b('0x36')](_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x36')]));_0x35a6ea[_0x0f0b('0x37')]=_0x35a6ea['attributes'][_0x0f0b('0x38')]?_0x35a6ea[_0x0f0b('0x37')]:_0xabb8dc[_0x0f0b('0x34')];if(!_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x39')](_0x0f0b('0x3a'))){_0x35a6ea[_0x0f0b('0x1d')]=qs[_0x0f0b('0x1d')](_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x1d')]);_0x35a6ea[_0x0f0b('0x1a')]=qs['offset'](_0x2f5788[_0x0f0b('0x35')]['offset']);}_0x35a6ea[_0x0f0b('0x3b')]=qs[_0x0f0b('0x3c')](_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x3c')]);_0x35a6ea[_0x0f0b('0x3d')]=qs[_0x0f0b('0x3e')](_[_0x0f0b('0x3f')](_0x2f5788[_0x0f0b('0x35')],_0xabb8dc[_0x0f0b('0x3e')]),_0x376b24);if(_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x40')]){_0x35a6ea[_0x0f0b('0x3d')]=_[_0x0f0b('0x41')](_0x35a6ea[_0x0f0b('0x3d')],{'$or':_[_0x0f0b('0x2d')](_0x376b24,function(_0x4f9553){if(_0x4f9553['type']!==_0x0f0b('0x42')){var _0x222efd={};_0x222efd[_0x4f9553[_0x0f0b('0x2a')]]={'$like':'%'+_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x40')]+'%'};return _0x222efd;}})});}_0x35a6ea=_[_0x0f0b('0x41')]({},_0x35a6ea,_0x2f5788[_0x0f0b('0x43')]);var _0x462fae={'where':_0x35a6ea[_0x0f0b('0x3d')]};return db[_0x0f0b('0x2e')][_0x0f0b('0x1c')](_0x462fae)[_0x0f0b('0x24')](function(_0x593476){_0x4dd243[_0x0f0b('0x1c')]=_0x593476;if(_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x44')]){_0x35a6ea[_0x0f0b('0x45')]=[{'all':!![]}];}return db[_0x0f0b('0x2e')][_0x0f0b('0x46')](_0x35a6ea);})[_0x0f0b('0x24')](function(_0x19590a){_0x4dd243['rows']=_0x19590a;return _0x4dd243;})[_0x0f0b('0x24')](respondWithFilteredResult(_0x561fa4,_0x35a6ea))['catch'](handleError(_0x561fa4,null));};exports['show']=function(_0xfa16be,_0xfa3fe6){var _0x568125={'raw':![],'where':{'id':_0xfa16be[_0x0f0b('0x47')]['id']}},_0x11228d={};_0x11228d[_0x0f0b('0x34')]=_[_0x0f0b('0x48')](db[_0x0f0b('0x2e')][_0x0f0b('0x2f')]);_0x11228d[_0x0f0b('0x35')]=_[_0x0f0b('0x48')](_0xfa16be[_0x0f0b('0x35')]);_0x11228d[_0x0f0b('0x3e')]=_[_0x0f0b('0x33')](_0x11228d['model'],_0x11228d[_0x0f0b('0x35')]);_0x568125[_0x0f0b('0x37')]=_['intersection'](_0x11228d[_0x0f0b('0x34')],qs[_0x0f0b('0x36')](_0xfa16be[_0x0f0b('0x35')][_0x0f0b('0x36')]));_0x568125['attributes']=_0x568125[_0x0f0b('0x37')][_0x0f0b('0x38')]?_0x568125[_0x0f0b('0x37')]:_0x11228d[_0x0f0b('0x34')];if(_0xfa16be[_0x0f0b('0x35')][_0x0f0b('0x44')]){_0x568125[_0x0f0b('0x45')]=[{'all':!![]}];}_0x568125=_[_0x0f0b('0x41')]({},_0x568125,_0xfa16be[_0x0f0b('0x43')]);return db[_0x0f0b('0x2e')][_0x0f0b('0x49')](_0x568125)[_0x0f0b('0x24')](handleEntityNotFound(_0xfa3fe6,null))['then'](respondWithResult(_0xfa3fe6,null))[_0x0f0b('0x4a')](handleError(_0xfa3fe6,null));};exports[_0x0f0b('0x4b')]=function(_0x381118,_0x132526){return db[_0x0f0b('0x2e')]['create'](_0x381118[_0x0f0b('0x4c')],{})['then'](function(_0x20c01c){var _0x238323=_0x381118['user']['get']({'plain':!![]});if(!_0x238323)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x238323[_0x0f0b('0x4d')]===_0x0f0b('0x4e')){var _0x4eacd2=_0x20c01c[_0x0f0b('0x26')]({'plain':!![]});var _0x1e9397=_0x0f0b('0x4f');return db[_0x0f0b('0x50')][_0x0f0b('0x49')]({'where':{'name':_0x1e9397,'userProfileId':_0x238323['userProfileId']},'raw':!![]})[_0x0f0b('0x24')](function(_0x3b1ae9){if(_0x3b1ae9&&_0x3b1ae9['autoAssociation']===0x0){return db[_0x0f0b('0x51')]['create']({'name':_0x4eacd2['name'],'resourceId':_0x4eacd2['id'],'type':_0x0f0b('0x27'),'sectionId':_0x3b1ae9['id']},{})['then'](function(){return _0x20c01c;});}else{return _0x20c01c;}})['catch'](function(_0x44afec){logger[_0x0f0b('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44afec);throw _0x44afec;});}return _0x20c01c;})[_0x0f0b('0x24')](respondWithResult(_0x132526,0xc9))[_0x0f0b('0x4a')](handleError(_0x132526,null));};exports[_0x0f0b('0x23')]=function(_0x717119,_0x16f4cd){if(_0x717119[_0x0f0b('0x4c')]['id']){delete _0x717119[_0x0f0b('0x4c')]['id'];}return db[_0x0f0b('0x2e')][_0x0f0b('0x49')]({'where':{'id':_0x717119['params']['id']}})[_0x0f0b('0x24')](handleEntityNotFound(_0x16f4cd,null))[_0x0f0b('0x24')](saveUpdates(_0x717119[_0x0f0b('0x4c')],null))[_0x0f0b('0x24')](respondWithResult(_0x16f4cd,null))['catch'](handleError(_0x16f4cd,null));};exports[_0x0f0b('0x25')]=function(_0x38eefb,_0x2b88f8){return db[_0x0f0b('0x2e')][_0x0f0b('0x49')]({'where':{'id':_0x38eefb['params']['id']}})[_0x0f0b('0x24')](handleEntityNotFound(_0x2b88f8,null))[_0x0f0b('0x24')](removeEntity(_0x2b88f8,null))[_0x0f0b('0x4a')](handleError(_0x2b88f8,null));};exports[_0x0f0b('0x52')]=function(_0x375f0f,_0x2feab2){var _0xd25624=0xa;var _0x4b6520=[_0x0f0b('0x53'),_0x0f0b('0x54'),_0x0f0b('0x55'),_0x0f0b('0x56')];var _0x5c4649={'SUM':'SUM(%s)','COUNT':_0x0f0b('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x0f0b('0x58'),'MIN':_0x0f0b('0x59'),'AVG':_0x0f0b('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0f0b('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xb61db={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x0f0b('0x5c'),'ROUND':_0x0f0b('0x5d'),'UNIX_TIMESTAMP':_0x0f0b('0x5e')};var _0x27c9b6=function(_0x282005){return!_[_0x0f0b('0x5f')]([_0x0f0b('0x60'),'IS\x20NOT\x20NULL',_0x0f0b('0x61'),_0x0f0b('0x62')],_0x282005);};var _0x100a5e=function(_0x9e852e){if(!_0x9e852e||!_0x9e852e[_0x0f0b('0x63')]['length']){return'';}for(var _0x200963='(',_0x1760c5=0x0;_0x1760c5<_0x9e852e['rules']['length'];_0x1760c5+=0x1){_0x1760c5>0x0&&(_0x200963+='\x20'+_0x9e852e[_0x0f0b('0x64')]+'\x20');_0x200963+=_0x9e852e[_0x0f0b('0x63')][_0x1760c5]['group']?_0x100a5e(_0x9e852e[_0x0f0b('0x63')][_0x1760c5][_0x0f0b('0x65')]):_0x9e852e[_0x0f0b('0x63')][_0x1760c5][_0x0f0b('0x66')]+'\x20'+_0x9e852e[_0x0f0b('0x63')][_0x1760c5][_0x0f0b('0x67')]+(_0x27c9b6(_0x9e852e[_0x0f0b('0x63')][_0x1760c5][_0x0f0b('0x67')])?'\x20'+_0x9e852e[_0x0f0b('0x63')][_0x1760c5][_0x0f0b('0x68')]:'');}return _0x200963+')';};var _0x837d00={'where':{'id':_0x375f0f[_0x0f0b('0x47')]['id']}},_0x1f69a4,_0x352073,_0x23e42e,_0x2c7867,_0x247e35;_0x837d00=_[_0x0f0b('0x41')]({},_0x837d00,_0x375f0f[_0x0f0b('0x43')]);return db[_0x0f0b('0x2e')][_0x0f0b('0x49')](_0x837d00)[_0x0f0b('0x24')](function(_0x4513ad){if(_0x4513ad){_0x1f69a4=_0x4513ad;return _0x4513ad[_0x0f0b('0x69')]();}return null;})[_0x0f0b('0x24')](function(_0xf68000){if(_0xf68000){if(!_0xf68000[_0x0f0b('0x38')]){throw new db[(_0x0f0b('0x6a'))][(_0x0f0b('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x352073=_0xf68000;return db[_0x0f0b('0x6c')][_0x0f0b('0x46')]({'raw':!![]});}return null;})[_0x0f0b('0x24')](function(_0x4dda88){if(_0x4dda88){_0x23e42e=_['keyBy'](_0x4dda88,'id');var _0x593af5;var _0x387281=squel[_0x0f0b('0x6d')]();_0x387281[_0x0f0b('0x6e')](_0x1f69a4['table']);for(var _0x2fc598=0x0;_0x2fc598<_0x352073[_0x0f0b('0x38')];_0x2fc598+=0x1){_0x593af5=_0x352073[_0x2fc598]['MetricId']?_0x23e42e[_0x352073[_0x2fc598][_0x0f0b('0x6f')]][_0x0f0b('0x70')]:_0x352073[_0x2fc598][_0x0f0b('0x66')];_0x593af5=_0x352073[_0x2fc598][_0x0f0b('0x71')]?_['replace'](_0x5c4649[_0x352073[_0x2fc598][_0x0f0b('0x71')]],'%s',_0x593af5):_0x593af5;_0x593af5=_0x352073[_0x2fc598][_0x0f0b('0x72')]?_['replace'](_0xb61db[_0x352073[_0x2fc598][_0x0f0b('0x72')]],'%s',_0x593af5):_0x593af5;if(_0x352073[_0x2fc598][_0x0f0b('0x73')]){_0x387281[_0x0f0b('0x65')](_0x593af5);}_0x352073[_0x2fc598][_0x0f0b('0x74')]&&_0x387281['order'](_0x593af5,_0x352073[_0x2fc598]['orderBy']===_0x0f0b('0x75')?![]:!![]);_0x387281[_0x0f0b('0x66')](_0x593af5,_0x352073[_0x2fc598]['alias']||_0x593af5);}if(_0x1f69a4[_0x0f0b('0x76')]){_0x1f69a4[_0x0f0b('0x76')]=JSON[_0x0f0b('0x77')](_0x1f69a4[_0x0f0b('0x76')]);for(var _0x6343d2=0x0;_0x6343d2<_0x1f69a4[_0x0f0b('0x76')][_0x0f0b('0x38')];_0x6343d2+=0x1){if(_0x1f69a4['joins'][_0x6343d2][_0x0f0b('0x31')]&&_[_0x0f0b('0x5f')](_0x4b6520,_0x1f69a4[_0x0f0b('0x76')][_0x6343d2][_0x0f0b('0x31')])&&_0x1f69a4[_0x0f0b('0x76')][_0x6343d2][_0x0f0b('0x78')]&&_0x1f69a4[_0x0f0b('0x76')][_0x6343d2][_0x0f0b('0x79')]&&_0x1f69a4['joins'][_0x6343d2][_0x0f0b('0x7a')]){_0x387281[_0x1f69a4[_0x0f0b('0x76')][_0x6343d2][_0x0f0b('0x31')]](_0x1f69a4['joins'][_0x6343d2]['foreignTable'],null,util['format'](_0x0f0b('0x7b'),_0x1f69a4[_0x0f0b('0x7c')],_0x1f69a4[_0x0f0b('0x76')][_0x6343d2][_0x0f0b('0x78')],_0x1f69a4[_0x0f0b('0x76')][_0x6343d2]['foreignTable'],_0x1f69a4[_0x0f0b('0x76')][_0x6343d2]['foreignKey']));}}}if(_0x1f69a4['conditions']){_0x1f69a4[_0x0f0b('0x7d')]=JSON[_0x0f0b('0x77')](_0x1f69a4[_0x0f0b('0x7d')]);_0x387281[_0x0f0b('0x3d')](_0x100a5e(_0x1f69a4[_0x0f0b('0x7d')][_0x0f0b('0x65')]));}_0x247e35=_0x387281[_0x0f0b('0x7e')]();_0x387281[_0x0f0b('0x1d')](_0xd25624);_0x387281[_0x0f0b('0x1a')](0x0);logger[_0x0f0b('0x7f')](_0x0f0b('0x80'),_0x387281[_0x0f0b('0x81')]());return dbH[_0x0f0b('0x82')]['query'](_0x387281[_0x0f0b('0x81')](),{'type':dbH[_0x0f0b('0x82')][_0x0f0b('0x83')]['SELECT']});}})[_0x0f0b('0x24')](respondWithResult(_0x2feab2,null))['catch'](handleError(_0x2feab2,null));};function runReport(_0x241b12,_0x545300,_0x3f9c7f){var _0x3b6b97=_0x545300['name'];var _0x4b44db=0xa;var _0x2b7045=[_0x0f0b('0x53'),'left_join',_0x0f0b('0x55'),_0x0f0b('0x56')];var _0x27a014={'SUM':_0x0f0b('0x84'),'COUNT':_0x0f0b('0x57'),'COUNT DISTINCT':_0x0f0b('0x85'),'MAX':_0x0f0b('0x58'),'MIN':_0x0f0b('0x59'),'AVG':_0x0f0b('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0f0b('0x86')};var _0x4c79a5={'SEC_TO_TIME':_0x0f0b('0x87'),'DATE':_0x0f0b('0x88'),'HOUR':'HOUR(%s)','ROUND':_0x0f0b('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xee87dd=function(_0x2e169a){return!_[_0x0f0b('0x5f')](['IS\x20NULL',_0x0f0b('0x89'),_0x0f0b('0x61'),_0x0f0b('0x62')],_0x2e169a);};var _0x5e5052=function(_0x5b3fbc){if(!_0x5b3fbc||!_0x5b3fbc[_0x0f0b('0x63')][_0x0f0b('0x38')]){return'';}for(var _0x4d4f01='(',_0x570576=0x0;_0x570576<_0x5b3fbc[_0x0f0b('0x63')]['length'];_0x570576+=0x1){_0x570576>0x0&&(_0x4d4f01+='\x20'+_0x5b3fbc['operator']+'\x20');_0x4d4f01+=_0x5b3fbc[_0x0f0b('0x63')][_0x570576][_0x0f0b('0x65')]?_0x5e5052(_0x5b3fbc[_0x0f0b('0x63')][_0x570576][_0x0f0b('0x65')]):_0x5b3fbc[_0x0f0b('0x63')][_0x570576][_0x0f0b('0x66')]+'\x20'+_0x5b3fbc['rules'][_0x570576][_0x0f0b('0x67')]+(_0xee87dd(_0x5b3fbc[_0x0f0b('0x63')][_0x570576][_0x0f0b('0x67')])?'\x20'+_0x5b3fbc[_0x0f0b('0x63')][_0x570576]['value']:'');}return _0x4d4f01+')';};var _0x1bbe2e={'where':{'id':_0x241b12['id']}},_0x225111,_0x3b14e5,_0x385f5e,_0x152efe,_0x353587;_0x1bbe2e=_[_0x0f0b('0x41')]({},_0x1bbe2e,_0x3f9c7f);return db[_0x0f0b('0x2e')]['find'](_0x1bbe2e)['then'](function(_0x5c7e34){if(_0x5c7e34){_0x225111=_0x5c7e34;return _0x5c7e34[_0x0f0b('0x69')]();}return null;})[_0x0f0b('0x24')](function(_0x40bc66){if(_0x40bc66){if(!_0x40bc66['length']){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3b14e5=_0x40bc66;return db['AnalyticMetric'][_0x0f0b('0x46')]({'raw':!![]});}return null;})[_0x0f0b('0x24')](function(_0x39fa07){if(_0x39fa07){_0x385f5e=_[_0x0f0b('0x8a')](_0x39fa07,'id');var _0xca7b98;var _0x10b4ec=squel[_0x0f0b('0x6d')]();_0x10b4ec[_0x0f0b('0x6e')](_0x225111['table']);for(var _0x3e2eb6=0x0;_0x3e2eb6<_0x3b14e5[_0x0f0b('0x38')];_0x3e2eb6+=0x1){_0xca7b98=_0x3b14e5[_0x3e2eb6][_0x0f0b('0x6f')]?_0x385f5e[_0x3b14e5[_0x3e2eb6][_0x0f0b('0x6f')]]['metric']:_0x3b14e5[_0x3e2eb6]['field'];_0xca7b98=_0x3b14e5[_0x3e2eb6][_0x0f0b('0x71')]?_[_0x0f0b('0x8b')](_0x27a014[_0x3b14e5[_0x3e2eb6][_0x0f0b('0x71')]],'%s',_0xca7b98):_0xca7b98;_0xca7b98=_0x3b14e5[_0x3e2eb6][_0x0f0b('0x72')]?_[_0x0f0b('0x8b')](_0x4c79a5[_0x3b14e5[_0x3e2eb6]['format']],'%s',_0xca7b98):_0xca7b98;if(_0x3b14e5[_0x3e2eb6]['groupBy']){_0x10b4ec[_0x0f0b('0x65')](_0xca7b98);}_0x3b14e5[_0x3e2eb6]['orderBy']&&_0x10b4ec[_0x0f0b('0x3b')](_0xca7b98,_0x3b14e5[_0x3e2eb6]['orderBy']==='DESC'?![]:!![]);_0x10b4ec[_0x0f0b('0x66')](_0xca7b98,_0x3b14e5[_0x3e2eb6][_0x0f0b('0x8c')]||_0xca7b98);}if(_0x225111['joins']){_0x225111[_0x0f0b('0x76')]=JSON[_0x0f0b('0x77')](_0x225111[_0x0f0b('0x76')]);for(var _0x2ba180=0x0;_0x2ba180<_0x225111['joins']['length'];_0x2ba180+=0x1){if(_0x225111['joins'][_0x2ba180][_0x0f0b('0x31')]&&_[_0x0f0b('0x5f')](_0x2b7045,_0x225111['joins'][_0x2ba180]['type'])&&_0x225111[_0x0f0b('0x76')][_0x2ba180][_0x0f0b('0x78')]&&_0x225111[_0x0f0b('0x76')][_0x2ba180][_0x0f0b('0x79')]&&_0x225111[_0x0f0b('0x76')][_0x2ba180][_0x0f0b('0x7a')]){_0x10b4ec[_0x225111['joins'][_0x2ba180][_0x0f0b('0x31')]](_0x225111[_0x0f0b('0x76')][_0x2ba180][_0x0f0b('0x79')],null,util[_0x0f0b('0x72')](_0x0f0b('0x7b'),_0x225111[_0x0f0b('0x7c')],_0x225111[_0x0f0b('0x76')][_0x2ba180][_0x0f0b('0x78')],_0x225111[_0x0f0b('0x76')][_0x2ba180]['foreignTable'],_0x225111['joins'][_0x2ba180][_0x0f0b('0x7a')]));}}}if(_0x225111['conditions']){_0x225111['conditions']=JSON[_0x0f0b('0x77')](_0x225111[_0x0f0b('0x7d')]);_0x10b4ec['where'](_0x5e5052(_0x225111[_0x0f0b('0x7d')][_0x0f0b('0x65')]));}_0x353587=_0x10b4ec[_0x0f0b('0x7e')]();_0x10b4ec['limit'](_0x4b44db);_0x10b4ec[_0x0f0b('0x1a')](0x0);return;}})[_0x0f0b('0x24')](function(){if(_0x545300[_0x0f0b('0x8d')]===_0x0f0b('0x8e')){return null;}var _0xa122dc=_['merge'](_0x545300,{'name':_0x545300['fullPath']||_0x545300[_0x0f0b('0x2a')]||_0x225111[_0x0f0b('0x2a')],'basename':_0x3b6b97,'savename':util[_0x0f0b('0x72')](_0x0f0b('0x8f'),_0x545300[_0x0f0b('0x2a')]||_0x225111['name'],require(_0x0f0b('0x90'))['generate'](0x4),_0x545300[_0x0f0b('0x8d')]||'csv'),'reportId':_0x225111['id'],'reportType':_0x0f0b('0x91')});return db['AnalyticExtractedReport'][_0x0f0b('0x4b')](_0xa122dc,{'raw':!![]});})['then'](function(_0x47d422){if(_0x225111['table']===_0x0f0b('0x92')){_0x353587[_0x0f0b('0x3d')](_0x225111[_0x0f0b('0x7c')]+_0x0f0b('0x93'),_0x545300['startDate'],_0x545300[_0x0f0b('0x94')]);}else{_0x353587[_0x0f0b('0x3d')](_0x225111['table']+_0x0f0b('0x95'),_0x545300[_0x0f0b('0x96')],_0x545300['endDate']);}if(_0x47d422){logger[_0x0f0b('0x97')](_0x0f0b('0x98'),_0x353587[_0x0f0b('0x81')]());require(_0x0f0b('0x99'))['fork'](path[_0x0f0b('0x53')](__dirname,'../../components/export/',_0x47d422[_0x0f0b('0x8d')]),[_0x47d422['id'],_0x353587[_0x0f0b('0x81')](),path[_0x0f0b('0x53')](__dirname,'../../files/reports',_0x47d422[_0x0f0b('0x9a')]),_0x3b6b97]);return _0x47d422;}else{var _0x4ec957=squel[_0x0f0b('0x6d')]();_0x4ec957[_0x0f0b('0x6e')]('('+_0x353587[_0x0f0b('0x81')]()+')',_0x0f0b('0x9b'));_0x4ec957[_0x0f0b('0x66')](_0x0f0b('0x9c'),'count');_0x353587[_0x0f0b('0x1d')](_0x545300[_0x0f0b('0x1d')]||_0x4b44db);_0x353587[_0x0f0b('0x1a')](_0x545300[_0x0f0b('0x1a')]||0x0);return dbH[_0x0f0b('0x82')][_0x0f0b('0x35')](_0x4ec957[_0x0f0b('0x81')](),{'type':dbH['sequelize'][_0x0f0b('0x83')][_0x0f0b('0x9d')]})[_0x0f0b('0x24')](function(_0x4da2a9){if(!_0x4da2a9['length']){_0x152efe=0x0;}else{_0x152efe=_0x4da2a9[0x0][_0x0f0b('0x1c')]||0x0;}return dbH[_0x0f0b('0x82')]['query'](_0x353587['toString'](),{'type':dbH[_0x0f0b('0x82')][_0x0f0b('0x83')]['SELECT']});})[_0x0f0b('0x24')](function(_0x1ee745){return{'rows':_0x1ee745||[],'count':_0x152efe};});}});}exports[_0x0f0b('0x9e')]=function(_0x16e285,_0x28bb1a){return runReport(_0x16e285[_0x0f0b('0x47')],_0x16e285[_0x0f0b('0x35')],_0x16e285[_0x0f0b('0x43')])[_0x0f0b('0x24')](respondWithResult(_0x28bb1a,null))[_0x0f0b('0x4a')](handleError(_0x28bb1a,null));};exports[_0x0f0b('0x9f')]=runReport;exports[_0x0f0b('0x35')]=function(_0x210ea4,_0x57d3b2){var _0x1b8ea3=0xa;var _0x23a01b=[_0x0f0b('0x53'),_0x0f0b('0x54'),'right_join',_0x0f0b('0x56')];var _0x5c9b7f={'SUM':_0x0f0b('0x84'),'COUNT':_0x0f0b('0x57'),'COUNT DISTINCT':_0x0f0b('0x85'),'MAX':_0x0f0b('0x58'),'MIN':'MIN(%s)','AVG':_0x0f0b('0x5a'),'GROUP_CONCAT':_0x0f0b('0xa0'),'GROUP_CONCAT ASC':_0x0f0b('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x51c664={'SEC_TO_TIME':_0x0f0b('0x87'),'DATE':_0x0f0b('0x88'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0f0b('0x5e')};var _0x140551=function(_0x119e12){return!_['includes']([_0x0f0b('0x60'),_0x0f0b('0x89'),_0x0f0b('0x61'),'IS\x20NOT\x20EMPTY'],_0x119e12);};var _0x1f0338=function(_0x271554){if(!_0x271554||!_0x271554[_0x0f0b('0x63')][_0x0f0b('0x38')]){return'';}for(var _0x53c66b='(',_0x2d8029=0x0;_0x2d8029<_0x271554[_0x0f0b('0x63')][_0x0f0b('0x38')];_0x2d8029+=0x1){_0x2d8029>0x0&&(_0x53c66b+='\x20'+_0x271554[_0x0f0b('0x64')]+'\x20');_0x53c66b+=_0x271554[_0x0f0b('0x63')][_0x2d8029][_0x0f0b('0x65')]?_0x1f0338(_0x271554['rules'][_0x2d8029][_0x0f0b('0x65')]):_0x271554[_0x0f0b('0x63')][_0x2d8029][_0x0f0b('0x66')]+'\x20'+_0x271554[_0x0f0b('0x63')][_0x2d8029][_0x0f0b('0x67')]+(_0x140551(_0x271554[_0x0f0b('0x63')][_0x2d8029][_0x0f0b('0x67')])?'\x20'+_0x271554[_0x0f0b('0x63')][_0x2d8029]['value']:'');}return _0x53c66b+')';};var _0xa16e36={'where':{'id':_0x210ea4['params']['id']}},_0x1a3a6b,_0x2ca80c,_0x1c9718,_0x39c043,_0x28087d;_0xa16e36=_['merge']({},_0xa16e36,_0x210ea4[_0x0f0b('0x43')]);return db[_0x0f0b('0x2e')][_0x0f0b('0x49')](_0xa16e36)[_0x0f0b('0x24')](function(_0x36d195){if(_0x36d195){_0x1a3a6b=_0x36d195;return _0x36d195[_0x0f0b('0x69')]();}return null;})[_0x0f0b('0x24')](function(_0x2eddcc){if(_0x2eddcc){if(!_0x2eddcc['length']){throw new db[(_0x0f0b('0x6a'))][(_0x0f0b('0x6b'))](_0x0f0b('0xa1'),0x193);}_0x2ca80c=_0x2eddcc;return db[_0x0f0b('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x0f0b('0x24')](function(_0x59d053){if(_0x59d053){_0x1c9718=_[_0x0f0b('0x8a')](_0x59d053,'id');var _0x21e782;var _0x34eb5b=squel[_0x0f0b('0x6d')]();_0x34eb5b[_0x0f0b('0x6e')](_0x1a3a6b[_0x0f0b('0x7c')]);for(var _0x37d017=0x0;_0x37d017<_0x2ca80c['length'];_0x37d017+=0x1){_0x21e782=_0x2ca80c[_0x37d017][_0x0f0b('0x6f')]?_0x1c9718[_0x2ca80c[_0x37d017]['MetricId']][_0x0f0b('0x70')]:_0x2ca80c[_0x37d017][_0x0f0b('0x66')];_0x21e782=_0x2ca80c[_0x37d017][_0x0f0b('0x71')]?_[_0x0f0b('0x8b')](_0x5c9b7f[_0x2ca80c[_0x37d017][_0x0f0b('0x71')]],'%s',_0x21e782):_0x21e782;_0x21e782=_0x2ca80c[_0x37d017][_0x0f0b('0x72')]?_[_0x0f0b('0x8b')](_0x51c664[_0x2ca80c[_0x37d017][_0x0f0b('0x72')]],'%s',_0x21e782):_0x21e782;if(_0x2ca80c[_0x37d017][_0x0f0b('0x73')]){_0x34eb5b[_0x0f0b('0x65')](_0x21e782);}_0x2ca80c[_0x37d017][_0x0f0b('0x74')]&&_0x34eb5b[_0x0f0b('0x3b')](_0x21e782,_0x2ca80c[_0x37d017][_0x0f0b('0x74')]===_0x0f0b('0x75')?![]:!![]);_0x34eb5b[_0x0f0b('0x66')](_0x21e782,_0x2ca80c[_0x37d017][_0x0f0b('0x8c')]||_0x21e782);}if(_0x1a3a6b[_0x0f0b('0x76')]){_0x1a3a6b[_0x0f0b('0x76')]=JSON[_0x0f0b('0x77')](_0x1a3a6b[_0x0f0b('0x76')]);for(var _0x5c1b8c=0x0;_0x5c1b8c<_0x1a3a6b['joins'][_0x0f0b('0x38')];_0x5c1b8c+=0x1){if(_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x31')]&&_['includes'](_0x23a01b,_0x1a3a6b['joins'][_0x5c1b8c]['type'])&&_0x1a3a6b['joins'][_0x5c1b8c][_0x0f0b('0x78')]&&_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x79')]&&_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c]['foreignKey']){_0x34eb5b[_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x31')]](_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x79')],null,util[_0x0f0b('0x72')](_0x0f0b('0x7b'),_0x1a3a6b['table'],_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x78')],_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x79')],_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x7a')]));}}}if(_0x1a3a6b[_0x0f0b('0x7d')]){_0x1a3a6b[_0x0f0b('0x7d')]=JSON[_0x0f0b('0x77')](_0x1a3a6b[_0x0f0b('0x7d')]);_0x34eb5b[_0x0f0b('0x3d')](_0x1f0338(_0x1a3a6b['conditions'][_0x0f0b('0x65')]));}_0x28087d=_0x34eb5b[_0x0f0b('0x7e')]();_0x34eb5b[_0x0f0b('0x1d')](_0x1b8ea3);_0x34eb5b[_0x0f0b('0x1a')](0x0);logger['debug'](_0x0f0b('0x80'),_0x34eb5b[_0x0f0b('0x81')]());return dbH[_0x0f0b('0x82')][_0x0f0b('0x35')](_0x34eb5b['toString'](),{'type':dbH[_0x0f0b('0x82')][_0x0f0b('0x83')]['SELECT']});}})[_0x0f0b('0x24')](function(){return{'sql':_0x28087d[_0x0f0b('0x81')]()};})['then'](respondWithResult(_0x57d3b2,null))[_0x0f0b('0x4a')](handleError(_0x57d3b2,null));};
\ No newline at end of file
+var _0xc2bd=['QueryTypes','SELECT','SUM(%s)','AVG(%s)','IS\x20NOT\x20EMPTY','AnalyticMetric','from','order','output','fullPath','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','runReport','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','get','CustomReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize'];(function(_0x4ced13,_0x365022){var _0x2fdce1=function(_0x590571){while(--_0x590571){_0x4ced13['push'](_0x4ced13['shift']());}};_0x2fdce1(++_0x365022);}(_0xc2bd,0x16c));var _0xdc2b=function(_0x3824c8,_0x4698cb){_0x3824c8=_0x3824c8-0x0;var _0x319c42=_0xc2bd[_0x3824c8];return _0x319c42;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdc2b('0x0'));var zipdir=require(_0xdc2b('0x1'));var jsonpatch=require(_0xdc2b('0x2'));var rp=require(_0xdc2b('0x3'));var moment=require(_0xdc2b('0x4'));var BPromise=require(_0xdc2b('0x5'));var Mustache=require(_0xdc2b('0x6'));var util=require(_0xdc2b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xdc2b('0x8'));var ejs=require(_0xdc2b('0x9'));var fs=require('fs');var fs_extra=require(_0xdc2b('0xa'));var _=require(_0xdc2b('0xb'));var squel=require(_0xdc2b('0xc'));var crypto=require(_0xdc2b('0xd'));var jsforce=require(_0xdc2b('0xe'));var deskjs=require(_0xdc2b('0xf'));var toCsv=require(_0xdc2b('0x8'));var querystring=require('querystring');var Papa=require(_0xdc2b('0x10'));var Redis=require(_0xdc2b('0x11'));var authService=require(_0xdc2b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdc2b('0x13'));var hardwareService=require(_0xdc2b('0x14'));var logger=require('../../config/logger')(_0xdc2b('0x15'));var utils=require(_0xdc2b('0x16'));var config=require(_0xdc2b('0x17'));var licenseUtil=require(_0xdc2b('0x18'));var db=require(_0xdc2b('0x19'))['db'];var dbH=require(_0xdc2b('0x19'))[_0xdc2b('0x1a')];function respondWithStatusCode(_0x47641d,_0x5adc9c){_0x5adc9c=_0x5adc9c||0xcc;return function(_0x5bcd2f){if(_0x5bcd2f){return _0x47641d[_0xdc2b('0x1b')](_0x5adc9c);}return _0x47641d[_0xdc2b('0x1c')](_0x5adc9c)[_0xdc2b('0x1d')]();};}function respondWithResult(_0x13fe28,_0x149dc7){_0x149dc7=_0x149dc7||0xc8;return function(_0x549dfb){if(_0x549dfb){return _0x13fe28['status'](_0x149dc7)[_0xdc2b('0x1e')](_0x549dfb);}};}function respondWithFilteredResult(_0x3de711,_0x3716bf){return function(_0x763ce1){if(_0x763ce1){var _0x528afe=typeof _0x3716bf['offset']===_0xdc2b('0x1f')&&typeof _0x3716bf[_0xdc2b('0x20')]===_0xdc2b('0x1f');var _0x1dbad7=_0x763ce1[_0xdc2b('0x21')];var _0x5037a5=_0x528afe?0x0:_0x3716bf[_0xdc2b('0x22')];var _0x1b2d20=_0x528afe?_0x763ce1[_0xdc2b('0x21')]:_0x3716bf[_0xdc2b('0x22')]+_0x3716bf[_0xdc2b('0x20')];var _0x45e9b2;if(_0x1b2d20>=_0x1dbad7){_0x1b2d20=_0x1dbad7;_0x45e9b2=0xc8;}else{_0x45e9b2=0xce;}_0x3de711[_0xdc2b('0x1c')](_0x45e9b2);return _0x3de711[_0xdc2b('0x23')](_0xdc2b('0x24'),_0x5037a5+'-'+_0x1b2d20+'/'+_0x1dbad7)[_0xdc2b('0x1e')](_0x763ce1);}return null;};}function patchUpdates(_0x2f2fd8){return function(_0x6590d0){try{jsonpatch[_0xdc2b('0x25')](_0x6590d0,_0x2f2fd8,!![]);}catch(_0x2656ae){return BPromise[_0xdc2b('0x26')](_0x2656ae);}return _0x6590d0['save']();};}function saveUpdates(_0x269696,_0x19648d){return function(_0x529f4a){if(_0x529f4a){return _0x529f4a[_0xdc2b('0x27')](_0x269696)[_0xdc2b('0x28')](function(_0x2ecb30){return _0x2ecb30;});}return null;};}function removeEntity(_0x1c19d7,_0x350875){return function(_0x2b91b7){if(_0x2b91b7){return _0x2b91b7['destroy']()[_0xdc2b('0x28')](function(){var _0x28e613=_0x2b91b7[_0xdc2b('0x29')]({'plain':!![]});var _0x5a92c1=_0xdc2b('0x2a');return db[_0xdc2b('0x2b')][_0xdc2b('0x2c')]({'where':{'type':_0x5a92c1,'resourceId':_0x28e613['id']}})[_0xdc2b('0x28')](function(){return _0x2b91b7;});})[_0xdc2b('0x28')](function(){_0x1c19d7[_0xdc2b('0x1c')](0xcc)[_0xdc2b('0x1d')]();});}};}function handleEntityNotFound(_0x3e7ac0,_0x9f89cf){return function(_0x2b8e69){if(!_0x2b8e69){_0x3e7ac0[_0xdc2b('0x1b')](0x194);}return _0x2b8e69;};}function handleError(_0x553312,_0x2577b1){_0x2577b1=_0x2577b1||0x1f4;return function(_0x402f58){logger[_0xdc2b('0x2d')](_0x402f58[_0xdc2b('0x2e')]);if(_0x402f58[_0xdc2b('0x2f')]){delete _0x402f58[_0xdc2b('0x2f')];}_0x553312[_0xdc2b('0x1c')](_0x2577b1)[_0xdc2b('0x30')](_0x402f58);};}exports[_0xdc2b('0x31')]=function(_0x1efbed,_0x2287f4){var _0x4dec6f={},_0xe69375={},_0x1aa441={'count':0x0,'rows':[]};var _0x24617f=_[_0xdc2b('0x32')](db[_0xdc2b('0x33')][_0xdc2b('0x34')],function(_0x4a9a9b){return{'name':_0x4a9a9b[_0xdc2b('0x35')],'type':_0x4a9a9b[_0xdc2b('0x36')]['key']};});_0xe69375['model']=_[_0xdc2b('0x32')](_0x24617f,_0xdc2b('0x2f'));_0xe69375[_0xdc2b('0x37')]=_[_0xdc2b('0x38')](_0x1efbed['query']);_0xe69375[_0xdc2b('0x39')]=_[_0xdc2b('0x3a')](_0xe69375['model'],_0xe69375[_0xdc2b('0x37')]);_0x4dec6f['attributes']=_[_0xdc2b('0x3a')](_0xe69375[_0xdc2b('0x3b')],qs[_0xdc2b('0x3c')](_0x1efbed[_0xdc2b('0x37')][_0xdc2b('0x3c')]));_0x4dec6f[_0xdc2b('0x3d')]=_0x4dec6f[_0xdc2b('0x3d')][_0xdc2b('0x3e')]?_0x4dec6f[_0xdc2b('0x3d')]:_0xe69375[_0xdc2b('0x3b')];if(!_0x1efbed[_0xdc2b('0x37')][_0xdc2b('0x3f')]('nolimit')){_0x4dec6f['limit']=qs[_0xdc2b('0x20')](_0x1efbed[_0xdc2b('0x37')][_0xdc2b('0x20')]);_0x4dec6f['offset']=qs[_0xdc2b('0x22')](_0x1efbed[_0xdc2b('0x37')]['offset']);}_0x4dec6f['order']=qs[_0xdc2b('0x40')](_0x1efbed['query'][_0xdc2b('0x40')]);_0x4dec6f[_0xdc2b('0x41')]=qs['filters'](_[_0xdc2b('0x42')](_0x1efbed[_0xdc2b('0x37')],_0xe69375['filters']),_0x24617f);if(_0x1efbed[_0xdc2b('0x37')][_0xdc2b('0x43')]){_0x4dec6f[_0xdc2b('0x41')]=_[_0xdc2b('0x44')](_0x4dec6f[_0xdc2b('0x41')],{'$or':_['map'](_0x24617f,function(_0x511a1f){if(_0x511a1f[_0xdc2b('0x36')]!==_0xdc2b('0x45')){var _0x917a0d={};_0x917a0d[_0x511a1f[_0xdc2b('0x2f')]]={'$like':'%'+_0x1efbed[_0xdc2b('0x37')][_0xdc2b('0x43')]+'%'};return _0x917a0d;}})});}_0x4dec6f=_['merge']({},_0x4dec6f,_0x1efbed[_0xdc2b('0x46')]);var _0x4df7b2={'where':_0x4dec6f[_0xdc2b('0x41')]};return db[_0xdc2b('0x33')]['count'](_0x4df7b2)[_0xdc2b('0x28')](function(_0x159657){_0x1aa441[_0xdc2b('0x21')]=_0x159657;if(_0x1efbed[_0xdc2b('0x37')][_0xdc2b('0x47')]){_0x4dec6f[_0xdc2b('0x48')]=[{'all':!![]}];}return db[_0xdc2b('0x33')][_0xdc2b('0x49')](_0x4dec6f);})[_0xdc2b('0x28')](function(_0x3405a6){_0x1aa441[_0xdc2b('0x4a')]=_0x3405a6;return _0x1aa441;})[_0xdc2b('0x28')](respondWithFilteredResult(_0x2287f4,_0x4dec6f))[_0xdc2b('0x4b')](handleError(_0x2287f4,null));};exports[_0xdc2b('0x4c')]=function(_0x2ea012,_0x43f9f4){var _0x3ae89f={'raw':![],'where':{'id':_0x2ea012[_0xdc2b('0x4d')]['id']}},_0x38b9e2={};_0x38b9e2[_0xdc2b('0x3b')]=_[_0xdc2b('0x38')](db[_0xdc2b('0x33')][_0xdc2b('0x34')]);_0x38b9e2[_0xdc2b('0x37')]=_[_0xdc2b('0x38')](_0x2ea012[_0xdc2b('0x37')]);_0x38b9e2['filters']=_[_0xdc2b('0x3a')](_0x38b9e2[_0xdc2b('0x3b')],_0x38b9e2['query']);_0x3ae89f[_0xdc2b('0x3d')]=_['intersection'](_0x38b9e2[_0xdc2b('0x3b')],qs[_0xdc2b('0x3c')](_0x2ea012[_0xdc2b('0x37')][_0xdc2b('0x3c')]));_0x3ae89f[_0xdc2b('0x3d')]=_0x3ae89f[_0xdc2b('0x3d')][_0xdc2b('0x3e')]?_0x3ae89f[_0xdc2b('0x3d')]:_0x38b9e2[_0xdc2b('0x3b')];if(_0x2ea012[_0xdc2b('0x37')][_0xdc2b('0x47')]){_0x3ae89f[_0xdc2b('0x48')]=[{'all':!![]}];}_0x3ae89f=_['merge']({},_0x3ae89f,_0x2ea012[_0xdc2b('0x46')]);return db[_0xdc2b('0x33')][_0xdc2b('0x4e')](_0x3ae89f)[_0xdc2b('0x28')](handleEntityNotFound(_0x43f9f4,null))[_0xdc2b('0x28')](respondWithResult(_0x43f9f4,null))[_0xdc2b('0x4b')](handleError(_0x43f9f4,null));};exports[_0xdc2b('0x4f')]=function(_0x43ac98,_0x40e841){return db['AnalyticCustomReport'][_0xdc2b('0x4f')](_0x43ac98['body'],{})[_0xdc2b('0x28')](function(_0x1ee570){var _0x2d3bef=_0x43ac98[_0xdc2b('0x50')][_0xdc2b('0x29')]({'plain':!![]});if(!_0x2d3bef)throw new Error(_0xdc2b('0x51'));if(_0x2d3bef['role']===_0xdc2b('0x50')){var _0x521fdf=_0x1ee570['get']({'plain':!![]});var _0x55c54c=_0xdc2b('0x52');return db[_0xdc2b('0x53')][_0xdc2b('0x4e')]({'where':{'name':_0x55c54c,'userProfileId':_0x2d3bef[_0xdc2b('0x54')]},'raw':!![]})[_0xdc2b('0x28')](function(_0x5c0454){if(_0x5c0454&&_0x5c0454[_0xdc2b('0x55')]===0x0){return db[_0xdc2b('0x2b')][_0xdc2b('0x4f')]({'name':_0x521fdf[_0xdc2b('0x2f')],'resourceId':_0x521fdf['id'],'type':_0xdc2b('0x2a'),'sectionId':_0x5c0454['id']},{})[_0xdc2b('0x28')](function(){return _0x1ee570;});}else{return _0x1ee570;}})[_0xdc2b('0x4b')](function(_0x20bf4d){logger[_0xdc2b('0x2d')](_0xdc2b('0x56'),_0x20bf4d);throw _0x20bf4d;});}return _0x1ee570;})['then'](respondWithResult(_0x40e841,0xc9))['catch'](handleError(_0x40e841,null));};exports['update']=function(_0xacf28c,_0x3193bf){if(_0xacf28c[_0xdc2b('0x57')]['id']){delete _0xacf28c[_0xdc2b('0x57')]['id'];}return db[_0xdc2b('0x33')][_0xdc2b('0x4e')]({'where':{'id':_0xacf28c[_0xdc2b('0x4d')]['id']}})[_0xdc2b('0x28')](handleEntityNotFound(_0x3193bf,null))[_0xdc2b('0x28')](saveUpdates(_0xacf28c[_0xdc2b('0x57')],null))['then'](respondWithResult(_0x3193bf,null))['catch'](handleError(_0x3193bf,null));};exports[_0xdc2b('0x2c')]=function(_0x4ed318,_0x58d73c){return db[_0xdc2b('0x33')][_0xdc2b('0x4e')]({'where':{'id':_0x4ed318[_0xdc2b('0x4d')]['id']}})[_0xdc2b('0x28')](handleEntityNotFound(_0x58d73c,null))[_0xdc2b('0x28')](removeEntity(_0x58d73c,null))[_0xdc2b('0x4b')](handleError(_0x58d73c,null));};exports['preview']=function(_0x2b4fcc,_0x2a0f08){var _0x4362fd=0xa;var _0x521835=[_0xdc2b('0x58'),_0xdc2b('0x59'),_0xdc2b('0x5a'),_0xdc2b('0x5b')];var _0x366112={'SUM':'SUM(%s)','COUNT':_0xdc2b('0x5c'),'COUNT DISTINCT':_0xdc2b('0x5d'),'MAX':_0xdc2b('0x5e'),'MIN':_0xdc2b('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xdc2b('0x60'),'GROUP_CONCAT ASC':_0xdc2b('0x61'),'GROUP_CONCAT DESC':_0xdc2b('0x62')};var _0x344d56={'SEC_TO_TIME':_0xdc2b('0x63'),'DATE':_0xdc2b('0x64'),'HOUR':_0xdc2b('0x65'),'ROUND':_0xdc2b('0x66'),'UNIX_TIMESTAMP':_0xdc2b('0x67')};var _0x3046eb=function(_0x5813f4){return!_[_0xdc2b('0x68')]([_0xdc2b('0x69'),_0xdc2b('0x6a'),_0xdc2b('0x6b'),'IS\x20NOT\x20EMPTY'],_0x5813f4);};var _0x2065db=function(_0x141ddd){if(!_0x141ddd||!_0x141ddd[_0xdc2b('0x6c')][_0xdc2b('0x3e')]){return'';}for(var _0x192597='(',_0x3c7246=0x0;_0x3c7246<_0x141ddd[_0xdc2b('0x6c')][_0xdc2b('0x3e')];_0x3c7246+=0x1){_0x3c7246>0x0&&(_0x192597+='\x20'+_0x141ddd[_0xdc2b('0x6d')]+'\x20');_0x192597+=_0x141ddd[_0xdc2b('0x6c')][_0x3c7246][_0xdc2b('0x6e')]?_0x2065db(_0x141ddd['rules'][_0x3c7246][_0xdc2b('0x6e')]):_0x141ddd[_0xdc2b('0x6c')][_0x3c7246][_0xdc2b('0x6f')]+'\x20'+_0x141ddd[_0xdc2b('0x6c')][_0x3c7246]['condition']+(_0x3046eb(_0x141ddd[_0xdc2b('0x6c')][_0x3c7246][_0xdc2b('0x70')])?'\x20'+_0x141ddd['rules'][_0x3c7246][_0xdc2b('0x71')]:'');}return _0x192597+')';};var _0x2697d4={'where':{'id':_0x2b4fcc[_0xdc2b('0x4d')]['id']}},_0x2f414,_0x1ca5a8,_0x4bc3c4,_0x2d7639,_0x2e70d8;_0x2697d4=_[_0xdc2b('0x44')]({},_0x2697d4,_0x2b4fcc[_0xdc2b('0x46')]);return db['AnalyticCustomReport'][_0xdc2b('0x4e')](_0x2697d4)[_0xdc2b('0x28')](function(_0x391ed5){if(_0x391ed5){_0x2f414=_0x391ed5;return _0x391ed5[_0xdc2b('0x72')]();}return null;})[_0xdc2b('0x28')](function(_0x4d6c90){if(_0x4d6c90){if(!_0x4d6c90[_0xdc2b('0x3e')]){throw new db[(_0xdc2b('0x73'))][(_0xdc2b('0x74'))](_0xdc2b('0x75'),0x193);}_0x1ca5a8=_0x4d6c90;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xdc2b('0x28')](function(_0x880388){if(_0x880388){_0x4bc3c4=_[_0xdc2b('0x76')](_0x880388,'id');var _0x35d3cf;var _0x12c082=squel[_0xdc2b('0x77')]();_0x12c082['from'](_0x2f414[_0xdc2b('0x78')]);for(var _0xb72d1=0x0;_0xb72d1<_0x1ca5a8[_0xdc2b('0x3e')];_0xb72d1+=0x1){_0x35d3cf=_0x1ca5a8[_0xb72d1][_0xdc2b('0x79')]?_0x4bc3c4[_0x1ca5a8[_0xb72d1]['MetricId']][_0xdc2b('0x7a')]:_0x1ca5a8[_0xb72d1][_0xdc2b('0x6f')];_0x35d3cf=_0x1ca5a8[_0xb72d1][_0xdc2b('0x7b')]?_[_0xdc2b('0x7c')](_0x366112[_0x1ca5a8[_0xb72d1]['function']],'%s',_0x35d3cf):_0x35d3cf;_0x35d3cf=_0x1ca5a8[_0xb72d1][_0xdc2b('0x7d')]?_[_0xdc2b('0x7c')](_0x344d56[_0x1ca5a8[_0xb72d1][_0xdc2b('0x7d')]],'%s',_0x35d3cf):_0x35d3cf;if(_0x1ca5a8[_0xb72d1][_0xdc2b('0x7e')]){_0x12c082[_0xdc2b('0x6e')](_0x35d3cf);}_0x1ca5a8[_0xb72d1]['orderBy']&&_0x12c082['order'](_0x35d3cf,_0x1ca5a8[_0xb72d1][_0xdc2b('0x7f')]===_0xdc2b('0x80')?![]:!![]);_0x12c082[_0xdc2b('0x6f')](_0x35d3cf,_0x1ca5a8[_0xb72d1][_0xdc2b('0x81')]||_0x35d3cf);}if(_0x2f414[_0xdc2b('0x82')]){_0x2f414[_0xdc2b('0x82')]=JSON['parse'](_0x2f414[_0xdc2b('0x82')]);for(var _0x166047=0x0;_0x166047<_0x2f414[_0xdc2b('0x82')][_0xdc2b('0x3e')];_0x166047+=0x1){if(_0x2f414['joins'][_0x166047][_0xdc2b('0x36')]&&_[_0xdc2b('0x68')](_0x521835,_0x2f414[_0xdc2b('0x82')][_0x166047][_0xdc2b('0x36')])&&_0x2f414[_0xdc2b('0x82')][_0x166047][_0xdc2b('0x83')]&&_0x2f414[_0xdc2b('0x82')][_0x166047][_0xdc2b('0x84')]&&_0x2f414['joins'][_0x166047][_0xdc2b('0x85')]){_0x12c082[_0x2f414[_0xdc2b('0x82')][_0x166047][_0xdc2b('0x36')]](_0x2f414[_0xdc2b('0x82')][_0x166047][_0xdc2b('0x84')],null,util['format'](_0xdc2b('0x86'),_0x2f414[_0xdc2b('0x78')],_0x2f414[_0xdc2b('0x82')][_0x166047]['parentKey'],_0x2f414[_0xdc2b('0x82')][_0x166047][_0xdc2b('0x84')],_0x2f414['joins'][_0x166047]['foreignKey']));}}}if(_0x2f414[_0xdc2b('0x87')]){_0x2f414['conditions']=JSON[_0xdc2b('0x88')](_0x2f414[_0xdc2b('0x87')]);_0x12c082['where'](_0x2065db(_0x2f414[_0xdc2b('0x87')][_0xdc2b('0x6e')]));}_0x2e70d8=_0x12c082[_0xdc2b('0x89')]();_0x12c082[_0xdc2b('0x20')](_0x4362fd);_0x12c082['offset'](0x0);logger['debug']('Limited\x20Query:',_0x12c082[_0xdc2b('0x8a')]());return dbH['sequelize'][_0xdc2b('0x37')](_0x12c082[_0xdc2b('0x8a')](),{'type':dbH[_0xdc2b('0x8b')][_0xdc2b('0x8c')][_0xdc2b('0x8d')]});}})[_0xdc2b('0x28')](respondWithResult(_0x2a0f08,null))[_0xdc2b('0x4b')](handleError(_0x2a0f08,null));};function runReport(_0x31969f,_0x5c495f,_0x41d2d7){var _0x20de25=_0x5c495f['name'];var _0x40592e=0xa;var _0x152f5b=['join','left_join',_0xdc2b('0x5a'),_0xdc2b('0x5b')];var _0x57aeee={'SUM':_0xdc2b('0x8e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xdc2b('0x5e'),'MIN':_0xdc2b('0x5f'),'AVG':_0xdc2b('0x8f'),'GROUP_CONCAT':_0xdc2b('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x45402d={'SEC_TO_TIME':_0xdc2b('0x63'),'DATE':_0xdc2b('0x64'),'HOUR':_0xdc2b('0x65'),'ROUND':_0xdc2b('0x66'),'UNIX_TIMESTAMP':_0xdc2b('0x67')};var _0x4bf264=function(_0x2ef7c1){return!_[_0xdc2b('0x68')]([_0xdc2b('0x69'),_0xdc2b('0x6a'),_0xdc2b('0x6b'),_0xdc2b('0x90')],_0x2ef7c1);};var _0xd600f8=function(_0x2dffba){if(!_0x2dffba||!_0x2dffba['rules'][_0xdc2b('0x3e')]){return'';}for(var _0xd55db7='(',_0x4d6b90=0x0;_0x4d6b90<_0x2dffba[_0xdc2b('0x6c')]['length'];_0x4d6b90+=0x1){_0x4d6b90>0x0&&(_0xd55db7+='\x20'+_0x2dffba[_0xdc2b('0x6d')]+'\x20');_0xd55db7+=_0x2dffba[_0xdc2b('0x6c')][_0x4d6b90][_0xdc2b('0x6e')]?_0xd600f8(_0x2dffba[_0xdc2b('0x6c')][_0x4d6b90][_0xdc2b('0x6e')]):_0x2dffba[_0xdc2b('0x6c')][_0x4d6b90]['field']+'\x20'+_0x2dffba[_0xdc2b('0x6c')][_0x4d6b90][_0xdc2b('0x70')]+(_0x4bf264(_0x2dffba[_0xdc2b('0x6c')][_0x4d6b90]['condition'])?'\x20'+_0x2dffba['rules'][_0x4d6b90][_0xdc2b('0x71')]:'');}return _0xd55db7+')';};var _0x4bf51b={'where':{'id':_0x31969f['id']}},_0x212159,_0x2fc427,_0x47fefa,_0x298c66,_0xbb22e9;_0x4bf51b=_[_0xdc2b('0x44')]({},_0x4bf51b,_0x41d2d7);return db[_0xdc2b('0x33')][_0xdc2b('0x4e')](_0x4bf51b)[_0xdc2b('0x28')](function(_0x54e798){if(_0x54e798){_0x212159=_0x54e798;return _0x54e798[_0xdc2b('0x72')]();}return null;})[_0xdc2b('0x28')](function(_0x579150){if(_0x579150){if(!_0x579150[_0xdc2b('0x3e')]){throw new db[(_0xdc2b('0x73'))][(_0xdc2b('0x74'))](_0xdc2b('0x75'),0x193);}_0x2fc427=_0x579150;return db[_0xdc2b('0x91')][_0xdc2b('0x49')]({'raw':!![]});}return null;})['then'](function(_0x440843){if(_0x440843){_0x47fefa=_['keyBy'](_0x440843,'id');var _0x8d5b29;var _0x3f63c1=squel[_0xdc2b('0x77')]();_0x3f63c1[_0xdc2b('0x92')](_0x212159[_0xdc2b('0x78')]);for(var _0x1173ad=0x0;_0x1173ad<_0x2fc427[_0xdc2b('0x3e')];_0x1173ad+=0x1){_0x8d5b29=_0x2fc427[_0x1173ad][_0xdc2b('0x79')]?_0x47fefa[_0x2fc427[_0x1173ad][_0xdc2b('0x79')]][_0xdc2b('0x7a')]:_0x2fc427[_0x1173ad]['field'];_0x8d5b29=_0x2fc427[_0x1173ad][_0xdc2b('0x7b')]?_['replace'](_0x57aeee[_0x2fc427[_0x1173ad][_0xdc2b('0x7b')]],'%s',_0x8d5b29):_0x8d5b29;_0x8d5b29=_0x2fc427[_0x1173ad][_0xdc2b('0x7d')]?_[_0xdc2b('0x7c')](_0x45402d[_0x2fc427[_0x1173ad]['format']],'%s',_0x8d5b29):_0x8d5b29;if(_0x2fc427[_0x1173ad]['groupBy']){_0x3f63c1[_0xdc2b('0x6e')](_0x8d5b29);}_0x2fc427[_0x1173ad][_0xdc2b('0x7f')]&&_0x3f63c1[_0xdc2b('0x93')](_0x8d5b29,_0x2fc427[_0x1173ad][_0xdc2b('0x7f')]==='DESC'?![]:!![]);_0x3f63c1[_0xdc2b('0x6f')](_0x8d5b29,_0x2fc427[_0x1173ad][_0xdc2b('0x81')]||_0x8d5b29);}if(_0x212159['joins']){_0x212159[_0xdc2b('0x82')]=JSON[_0xdc2b('0x88')](_0x212159[_0xdc2b('0x82')]);for(var _0x248a66=0x0;_0x248a66<_0x212159[_0xdc2b('0x82')][_0xdc2b('0x3e')];_0x248a66+=0x1){if(_0x212159[_0xdc2b('0x82')][_0x248a66][_0xdc2b('0x36')]&&_[_0xdc2b('0x68')](_0x152f5b,_0x212159[_0xdc2b('0x82')][_0x248a66]['type'])&&_0x212159[_0xdc2b('0x82')][_0x248a66][_0xdc2b('0x83')]&&_0x212159[_0xdc2b('0x82')][_0x248a66][_0xdc2b('0x84')]&&_0x212159[_0xdc2b('0x82')][_0x248a66][_0xdc2b('0x85')]){_0x3f63c1[_0x212159[_0xdc2b('0x82')][_0x248a66][_0xdc2b('0x36')]](_0x212159['joins'][_0x248a66][_0xdc2b('0x84')],null,util[_0xdc2b('0x7d')](_0xdc2b('0x86'),_0x212159[_0xdc2b('0x78')],_0x212159[_0xdc2b('0x82')][_0x248a66]['parentKey'],_0x212159['joins'][_0x248a66]['foreignTable'],_0x212159['joins'][_0x248a66][_0xdc2b('0x85')]));}}}if(_0x212159[_0xdc2b('0x87')]){_0x212159[_0xdc2b('0x87')]=JSON['parse'](_0x212159[_0xdc2b('0x87')]);_0x3f63c1[_0xdc2b('0x41')](_0xd600f8(_0x212159['conditions']['group']));}_0xbb22e9=_0x3f63c1[_0xdc2b('0x89')]();_0x3f63c1['limit'](_0x40592e);_0x3f63c1['offset'](0x0);return;}})[_0xdc2b('0x28')](function(){if(_0x5c495f[_0xdc2b('0x94')]==='web'){return null;}var _0x52a227=_[_0xdc2b('0x44')](_0x5c495f,{'name':_0x5c495f[_0xdc2b('0x95')]||_0x5c495f[_0xdc2b('0x2f')]||_0x212159[_0xdc2b('0x2f')],'basename':_0x20de25,'savename':util[_0xdc2b('0x7d')]('%s-%s.%s',_0x5c495f[_0xdc2b('0x2f')]||_0x212159['name'],require('randomstring')['generate'](0x4),_0x5c495f[_0xdc2b('0x94')]||_0xdc2b('0x96')),'reportId':_0x212159['id'],'reportType':_0xdc2b('0x97')});return db[_0xdc2b('0x98')][_0xdc2b('0x4f')](_0x52a227,{'raw':!![]});})[_0xdc2b('0x28')](function(_0x454540){if(_0x212159['table']===_0xdc2b('0x99')){_0xbb22e9[_0xdc2b('0x41')](_0x212159['table']+_0xdc2b('0x9a'),_0x5c495f[_0xdc2b('0x9b')],_0x5c495f[_0xdc2b('0x9c')]);}else{_0xbb22e9[_0xdc2b('0x41')](_0x212159[_0xdc2b('0x78')]+_0xdc2b('0x9d'),_0x5c495f[_0xdc2b('0x9b')],_0x5c495f[_0xdc2b('0x9c')]);}if(_0x454540){logger[_0xdc2b('0x9e')](_0xdc2b('0x9f'),_0xbb22e9['toString']());require(_0xdc2b('0xa0'))[_0xdc2b('0xa1')](path[_0xdc2b('0x58')](__dirname,'../../components/export/',_0x454540['output']),[_0x454540['id'],_0xbb22e9['toString'](),path[_0xdc2b('0x58')](__dirname,_0xdc2b('0xa2'),_0x454540[_0xdc2b('0xa3')]),_0x20de25]);return _0x454540;}else{var _0x1e1c19=squel[_0xdc2b('0x77')]();_0x1e1c19['from']('('+_0xbb22e9[_0xdc2b('0x8a')]()+')',_0xdc2b('0xa4'));_0x1e1c19[_0xdc2b('0x6f')]('COUNT(*)',_0xdc2b('0x21'));_0xbb22e9[_0xdc2b('0x20')](_0x5c495f[_0xdc2b('0x20')]||_0x40592e);_0xbb22e9[_0xdc2b('0x22')](_0x5c495f[_0xdc2b('0x22')]||0x0);return dbH[_0xdc2b('0x8b')][_0xdc2b('0x37')](_0x1e1c19[_0xdc2b('0x8a')](),{'type':dbH['sequelize'][_0xdc2b('0x8c')][_0xdc2b('0x8d')]})[_0xdc2b('0x28')](function(_0x4bc87d){if(!_0x4bc87d[_0xdc2b('0x3e')]){_0x298c66=0x0;}else{_0x298c66=_0x4bc87d[0x0][_0xdc2b('0x21')]||0x0;}return dbH[_0xdc2b('0x8b')][_0xdc2b('0x37')](_0xbb22e9[_0xdc2b('0x8a')](),{'type':dbH['sequelize'][_0xdc2b('0x8c')]['SELECT']});})[_0xdc2b('0x28')](function(_0xddd1ee){return{'rows':_0xddd1ee||[],'count':_0x298c66};});}});}exports['run']=function(_0x2df528,_0x2acf3d){return runReport(_0x2df528[_0xdc2b('0x4d')],_0x2df528[_0xdc2b('0x37')],_0x2df528[_0xdc2b('0x46')])[_0xdc2b('0x28')](respondWithResult(_0x2acf3d,null))['catch'](handleError(_0x2acf3d,null));};exports[_0xdc2b('0xa5')]=runReport;exports[_0xdc2b('0x37')]=function(_0x2d8c07,_0x5d645f){var _0x3e606d=0xa;var _0x2c81c6=[_0xdc2b('0x58'),'left_join',_0xdc2b('0x5a'),_0xdc2b('0x5b')];var _0x301b5a={'SUM':_0xdc2b('0x8e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xdc2b('0x5e'),'MIN':_0xdc2b('0x5f'),'AVG':_0xdc2b('0x8f'),'GROUP_CONCAT':_0xdc2b('0x60'),'GROUP_CONCAT ASC':_0xdc2b('0x61'),'GROUP_CONCAT DESC':_0xdc2b('0x62')};var _0x2f84e2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xdc2b('0x64'),'HOUR':_0xdc2b('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xdc2b('0x67')};var _0x213e1f=function(_0x559b17){return!_[_0xdc2b('0x68')](['IS\x20NULL',_0xdc2b('0x6a'),_0xdc2b('0x6b'),_0xdc2b('0x90')],_0x559b17);};var _0x19b5f1=function(_0x5045ac){if(!_0x5045ac||!_0x5045ac['rules']['length']){return'';}for(var _0xe87c0c='(',_0x14d3ae=0x0;_0x14d3ae<_0x5045ac[_0xdc2b('0x6c')][_0xdc2b('0x3e')];_0x14d3ae+=0x1){_0x14d3ae>0x0&&(_0xe87c0c+='\x20'+_0x5045ac[_0xdc2b('0x6d')]+'\x20');_0xe87c0c+=_0x5045ac['rules'][_0x14d3ae][_0xdc2b('0x6e')]?_0x19b5f1(_0x5045ac['rules'][_0x14d3ae]['group']):_0x5045ac[_0xdc2b('0x6c')][_0x14d3ae][_0xdc2b('0x6f')]+'\x20'+_0x5045ac['rules'][_0x14d3ae][_0xdc2b('0x70')]+(_0x213e1f(_0x5045ac[_0xdc2b('0x6c')][_0x14d3ae][_0xdc2b('0x70')])?'\x20'+_0x5045ac['rules'][_0x14d3ae][_0xdc2b('0x71')]:'');}return _0xe87c0c+')';};var _0x4ef4ad={'where':{'id':_0x2d8c07[_0xdc2b('0x4d')]['id']}},_0x811668,_0x2cbfdd,_0x6178d2,_0x5b78ee,_0xe524f5;_0x4ef4ad=_['merge']({},_0x4ef4ad,_0x2d8c07[_0xdc2b('0x46')]);return db[_0xdc2b('0x33')][_0xdc2b('0x4e')](_0x4ef4ad)[_0xdc2b('0x28')](function(_0x4dc3aa){if(_0x4dc3aa){_0x811668=_0x4dc3aa;return _0x4dc3aa[_0xdc2b('0x72')]();}return null;})[_0xdc2b('0x28')](function(_0x450b2a){if(_0x450b2a){if(!_0x450b2a[_0xdc2b('0x3e')]){throw new db['Sequelize'][(_0xdc2b('0x74'))](_0xdc2b('0x75'),0x193);}_0x2cbfdd=_0x450b2a;return db['AnalyticMetric'][_0xdc2b('0x49')]({'raw':!![]});}return null;})['then'](function(_0x40b156){if(_0x40b156){_0x6178d2=_[_0xdc2b('0x76')](_0x40b156,'id');var _0x11ccb9;var _0x1a52d1=squel['select']();_0x1a52d1['from'](_0x811668[_0xdc2b('0x78')]);for(var _0x1ee4e8=0x0;_0x1ee4e8<_0x2cbfdd[_0xdc2b('0x3e')];_0x1ee4e8+=0x1){_0x11ccb9=_0x2cbfdd[_0x1ee4e8][_0xdc2b('0x79')]?_0x6178d2[_0x2cbfdd[_0x1ee4e8][_0xdc2b('0x79')]][_0xdc2b('0x7a')]:_0x2cbfdd[_0x1ee4e8][_0xdc2b('0x6f')];_0x11ccb9=_0x2cbfdd[_0x1ee4e8]['function']?_[_0xdc2b('0x7c')](_0x301b5a[_0x2cbfdd[_0x1ee4e8][_0xdc2b('0x7b')]],'%s',_0x11ccb9):_0x11ccb9;_0x11ccb9=_0x2cbfdd[_0x1ee4e8][_0xdc2b('0x7d')]?_[_0xdc2b('0x7c')](_0x2f84e2[_0x2cbfdd[_0x1ee4e8]['format']],'%s',_0x11ccb9):_0x11ccb9;if(_0x2cbfdd[_0x1ee4e8][_0xdc2b('0x7e')]){_0x1a52d1[_0xdc2b('0x6e')](_0x11ccb9);}_0x2cbfdd[_0x1ee4e8][_0xdc2b('0x7f')]&&_0x1a52d1[_0xdc2b('0x93')](_0x11ccb9,_0x2cbfdd[_0x1ee4e8]['orderBy']==='DESC'?![]:!![]);_0x1a52d1[_0xdc2b('0x6f')](_0x11ccb9,_0x2cbfdd[_0x1ee4e8][_0xdc2b('0x81')]||_0x11ccb9);}if(_0x811668[_0xdc2b('0x82')]){_0x811668['joins']=JSON[_0xdc2b('0x88')](_0x811668['joins']);for(var _0x46e159=0x0;_0x46e159<_0x811668[_0xdc2b('0x82')][_0xdc2b('0x3e')];_0x46e159+=0x1){if(_0x811668[_0xdc2b('0x82')][_0x46e159][_0xdc2b('0x36')]&&_[_0xdc2b('0x68')](_0x2c81c6,_0x811668[_0xdc2b('0x82')][_0x46e159][_0xdc2b('0x36')])&&_0x811668[_0xdc2b('0x82')][_0x46e159][_0xdc2b('0x83')]&&_0x811668[_0xdc2b('0x82')][_0x46e159]['foreignTable']&&_0x811668['joins'][_0x46e159][_0xdc2b('0x85')]){_0x1a52d1[_0x811668[_0xdc2b('0x82')][_0x46e159][_0xdc2b('0x36')]](_0x811668[_0xdc2b('0x82')][_0x46e159][_0xdc2b('0x84')],null,util[_0xdc2b('0x7d')](_0xdc2b('0x86'),_0x811668[_0xdc2b('0x78')],_0x811668['joins'][_0x46e159]['parentKey'],_0x811668[_0xdc2b('0x82')][_0x46e159][_0xdc2b('0x84')],_0x811668[_0xdc2b('0x82')][_0x46e159][_0xdc2b('0x85')]));}}}if(_0x811668['conditions']){_0x811668[_0xdc2b('0x87')]=JSON[_0xdc2b('0x88')](_0x811668[_0xdc2b('0x87')]);_0x1a52d1[_0xdc2b('0x41')](_0x19b5f1(_0x811668[_0xdc2b('0x87')][_0xdc2b('0x6e')]));}_0xe524f5=_0x1a52d1[_0xdc2b('0x89')]();_0x1a52d1[_0xdc2b('0x20')](_0x3e606d);_0x1a52d1['offset'](0x0);logger[_0xdc2b('0xa6')](_0xdc2b('0xa7'),_0x1a52d1[_0xdc2b('0x8a')]());return dbH[_0xdc2b('0x8b')]['query'](_0x1a52d1[_0xdc2b('0x8a')](),{'type':dbH['sequelize'][_0xdc2b('0x8c')][_0xdc2b('0x8d')]});}})[_0xdc2b('0x28')](function(){return{'sql':_0xe524f5[_0xdc2b('0x8a')]()};})['then'](respondWithResult(_0x5d645f,null))[_0xdc2b('0x4b')](handleError(_0x5d645f,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 01442a7..1821347 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 _0x5742=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports'];(function(_0x2d7766,_0x17b192){var _0x597efb=function(_0x224d6d){while(--_0x224d6d){_0x2d7766['push'](_0x2d7766['shift']());}};_0x597efb(++_0x17b192);}(_0x5742,0x160));var _0x2574=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x5742[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x2574('0x0'));var util=require(_0x2574('0x1'));var logger=require(_0x2574('0x2'))('api');var moment=require(_0x2574('0x3'));var BPromise=require(_0x2574('0x4'));var rp=require(_0x2574('0x5'));var fs=require('fs');var path=require(_0x2574('0x6'));var rimraf=require('rimraf');var config=require(_0x2574('0x7'));var attributes=require(_0x2574('0x8'));module['exports']=function(_0x1a95d2,_0xbed560){return _0x1a95d2['define'](_0x2574('0x9'),attributes,{'tableName':_0x2574('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc6a1=['bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment'];(function(_0x3ef90f,_0x46f414){var _0x278fab=function(_0x3ef740){while(--_0x3ef740){_0x3ef90f['push'](_0x3ef90f['shift']());}};_0x278fab(++_0x46f414);}(_0xc6a1,0xaf));var _0x1c6a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc6a1[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x1c6a('0x0'));var util=require(_0x1c6a('0x1'));var logger=require(_0x1c6a('0x2'))(_0x1c6a('0x3'));var moment=require(_0x1c6a('0x4'));var BPromise=require(_0x1c6a('0x5'));var rp=require(_0x1c6a('0x6'));var fs=require('fs');var path=require(_0x1c6a('0x7'));var rimraf=require('rimraf');var config=require(_0x1c6a('0x8'));var attributes=require(_0x1c6a('0x9'));module['exports']=function(_0x2efda3,_0x19c50f){return _0x2efda3['define'](_0x1c6a('0xa'),attributes,{'tableName':_0x1c6a('0xb'),'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 e23ae88..73d9b0d 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 _0x6d76=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x4c4b99,_0x3a290f){var _0x150415=function(_0x4b9e37){while(--_0x4b9e37){_0x4c4b99['push'](_0x4c4b99['shift']());}};_0x150415(++_0x3a290f);}(_0x6d76,0x109));var _0x66d7=function(_0x191b08,_0x23f80a){_0x191b08=_0x191b08-0x0;var _0x5d7e91=_0x6d76[_0x191b08];return _0x5d7e91;};'use strict';var _=require(_0x66d7('0x0'));var util=require('util');var moment=require(_0x66d7('0x1'));var BPromise=require(_0x66d7('0x2'));var rs=require(_0x66d7('0x3'));var fs=require('fs');var Redis=require(_0x66d7('0x4'));var db=require(_0x66d7('0x5'))['db'];var utils=require(_0x66d7('0x6'));var logger=require(_0x66d7('0x7'))(_0x66d7('0x8'));var config=require(_0x66d7('0x9'));var jayson=require(_0x66d7('0xa'));var client=jayson[_0x66d7('0xb')][_0x66d7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x104ccd,_0x5b9bef,_0x86668c){return new BPromise(function(_0x2fe861,_0x509fff){return client[_0x66d7('0xd')](_0x104ccd,_0x86668c)[_0x66d7('0xe')](function(_0x24f8e7){logger[_0x66d7('0xf')](_0x66d7('0x10'),_0x5b9bef,'request\x20sent');logger['debug'](_0x66d7('0x11'),_0x5b9bef,'request\x20sent',JSON[_0x66d7('0x12')](_0x24f8e7));if(_0x24f8e7[_0x66d7('0x13')]){if(_0x24f8e7[_0x66d7('0x13')][_0x66d7('0x14')]===0x1f4){logger[_0x66d7('0x13')](_0x66d7('0x10'),_0x5b9bef,_0x24f8e7['error']['message']);return _0x509fff(_0x24f8e7['error']['message']);}logger[_0x66d7('0x13')](_0x66d7('0x10'),_0x5b9bef,_0x24f8e7[_0x66d7('0x13')]['message']);return _0x2fe861(_0x24f8e7[_0x66d7('0x13')][_0x66d7('0x15')]);}else{logger[_0x66d7('0xf')](_0x66d7('0x10'),_0x5b9bef,_0x66d7('0x16'));_0x2fe861(_0x24f8e7['result'][_0x66d7('0x15')]);}})[_0x66d7('0x17')](function(_0x5bd07f){logger[_0x66d7('0x13')](_0x66d7('0x10'),_0x5b9bef,_0x5bd07f);_0x509fff(_0x5bd07f);});});}
\ No newline at end of file
+var _0x1bdb=['moment','bluebird','randomstring','ioredis','jayson/promise','client','http','request','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util'];(function(_0x33485c,_0x92f25){var _0x4a0a6d=function(_0x52fe3b){while(--_0x52fe3b){_0x33485c['push'](_0x33485c['shift']());}};_0x4a0a6d(++_0x92f25);}(_0x1bdb,0x18b));var _0xb1bd=function(_0x3ab53f,_0x508ae7){_0x3ab53f=_0x3ab53f-0x0;var _0x42c654=_0x1bdb[_0x3ab53f];return _0x42c654;};'use strict';var _=require('lodash');var util=require(_0xb1bd('0x0'));var moment=require(_0xb1bd('0x1'));var BPromise=require(_0xb1bd('0x2'));var rs=require(_0xb1bd('0x3'));var fs=require('fs');var Redis=require(_0xb1bd('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb1bd('0x5'));var client=jayson[_0xb1bd('0x6')][_0xb1bd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x28a080,_0x204a85,_0x28161d){return new BPromise(function(_0x3f934f,_0xaf7b47){return client[_0xb1bd('0x8')](_0x28a080,_0x28161d)['then'](function(_0x232129){logger['info'](_0xb1bd('0x9'),_0x204a85,_0xb1bd('0xa'));logger['debug'](_0xb1bd('0xb'),_0x204a85,_0xb1bd('0xa'),JSON[_0xb1bd('0xc')](_0x232129));if(_0x232129['error']){if(_0x232129['error']['code']===0x1f4){logger[_0xb1bd('0xd')](_0xb1bd('0x9'),_0x204a85,_0x232129[_0xb1bd('0xd')][_0xb1bd('0xe')]);return _0xaf7b47(_0x232129[_0xb1bd('0xd')][_0xb1bd('0xe')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x204a85,_0x232129[_0xb1bd('0xd')][_0xb1bd('0xe')]);return _0x3f934f(_0x232129[_0xb1bd('0xd')][_0xb1bd('0xe')]);}else{logger[_0xb1bd('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x204a85,'request\x20sent');_0x3f934f(_0x232129[_0xb1bd('0x10')]['message']);}})[_0xb1bd('0x11')](function(_0x207406){logger[_0xb1bd('0xd')](_0xb1bd('0x9'),_0x204a85,_0x207406);_0xaf7b47(_0x207406);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 140e192..9c2c17b 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 _0xe072=['put','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','create'];(function(_0x53263b,_0x299c08){var _0x3fd94b=function(_0x489939){while(--_0x489939){_0x53263b['push'](_0x53263b['shift']());}};_0x3fd94b(++_0x299c08);}(_0xe072,0x17d));var _0x2e07=function(_0x36221a,_0x37c5b5){_0x36221a=_0x36221a-0x0;var _0x233141=_0xe072[_0x36221a];return _0x233141;};'use strict';var multer=require(_0x2e07('0x0'));var util=require('util');var path=require(_0x2e07('0x1'));var timeout=require(_0x2e07('0x2'));var express=require('express');var router=express[_0x2e07('0x3')]();var fs_extra=require(_0x2e07('0x4'));var auth=require(_0x2e07('0x5'));var interaction=require(_0x2e07('0x6'));var config=require('../../config/environment');var controller=require(_0x2e07('0x7'));router[_0x2e07('0x8')]('/',auth[_0x2e07('0x9')](),controller['index']);router[_0x2e07('0x8')](_0x2e07('0xa'),auth[_0x2e07('0x9')](),controller[_0x2e07('0xb')]);router[_0x2e07('0x8')](_0x2e07('0xc'),auth[_0x2e07('0x9')](),controller[_0x2e07('0xd')]);router[_0x2e07('0x8')](_0x2e07('0xe'),auth[_0x2e07('0x9')](),controller[_0x2e07('0xf')]);router[_0x2e07('0x8')](_0x2e07('0x10'),auth[_0x2e07('0x9')](),controller['query']);router['post']('/',auth[_0x2e07('0x9')](),controller[_0x2e07('0x11')]);router[_0x2e07('0x12')](_0x2e07('0xa'),auth[_0x2e07('0x9')](),controller['update']);router[_0x2e07('0x13')](_0x2e07('0xa'),auth[_0x2e07('0x9')](),controller[_0x2e07('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xee5f=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','/:id','update','delete','exports','path'];(function(_0x3c99f5,_0x3c4b1a){var _0x3b958e=function(_0x18d09d){while(--_0x18d09d){_0x3c99f5['push'](_0x3c99f5['shift']());}};_0x3b958e(++_0x3c4b1a);}(_0xee5f,0x1c7));var _0xfee5=function(_0x238f7e,_0x4ecfc0){_0x238f7e=_0x238f7e-0x0;var _0x2244f6=_0xee5f[_0x238f7e];return _0x2244f6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfee5('0x0'));var timeout=require(_0xfee5('0x1'));var express=require('express');var router=express[_0xfee5('0x2')]();var fs_extra=require(_0xfee5('0x3'));var auth=require(_0xfee5('0x4'));var interaction=require(_0xfee5('0x5'));var config=require(_0xfee5('0x6'));var controller=require(_0xfee5('0x7'));router[_0xfee5('0x8')]('/',auth[_0xfee5('0x9')](),controller[_0xfee5('0xa')]);router[_0xfee5('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xfee5('0x8')](_0xfee5('0xb'),auth[_0xfee5('0x9')](),controller[_0xfee5('0xc')]);router[_0xfee5('0x8')](_0xfee5('0xd'),auth[_0xfee5('0x9')](),controller[_0xfee5('0xe')]);router[_0xfee5('0x8')](_0xfee5('0xf'),auth['isAuthenticated'](),controller[_0xfee5('0x10')]);router[_0xfee5('0x11')]('/',auth[_0xfee5('0x9')](),controller[_0xfee5('0x12')]);router[_0xfee5('0x13')](_0xfee5('0x14'),auth[_0xfee5('0x9')](),controller[_0xfee5('0x15')]);router[_0xfee5('0x16')](_0xfee5('0x14'),auth[_0xfee5('0x9')](),controller['destroy']);module[_0xfee5('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 5c55fd9..aeb732c 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 _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x55e62b,_0x4f34ac){var _0xa7162f=function(_0x178227){while(--_0x178227){_0x55e62b['push'](_0x55e62b['shift']());}};_0xa7162f(++_0x4f34ac);}(_0x814b,0x1a2));var _0xb814=function(_0x5c6022,_0x5cd10b){_0x5c6022=_0x5c6022-0x0;var _0x4ab5af=_0x814b[_0x5c6022];return _0x4ab5af;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}};
\ No newline at end of file
+var _0x5fd1=['STRING','TEXT','sequelize'];(function(_0x90a39a,_0x32020d){var _0x2b62f7=function(_0x6841cc){while(--_0x6841cc){_0x90a39a['push'](_0x90a39a['shift']());}};_0x2b62f7(++_0x32020d);}(_0x5fd1,0x155));var _0x15fd=function(_0x1937bf,_0x50299c){_0x1937bf=_0x1937bf-0x0;var _0x5b4ec7=_0x5fd1[_0x1937bf];return _0x5b4ec7;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'name':{'type':Sequelize[_0x15fd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x15fd('0x1')]},'parent':{'type':Sequelize[_0x15fd('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x15fd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 50fd6a8..eb042a0 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x31c0e3,_0x3c5cd6){var _0xf34e31=function(_0x312d15){while(--_0x312d15){_0x31c0e3['push'](_0x31c0e3['shift']());}};_0xf34e31(++_0x3c5cd6);}(_0xba34,0x119));var _0x4ba3=function(_0x2106c4,_0x5a3042){_0x2106c4=_0x2106c4-0x0;var _0x287771=_0xba34[_0x2106c4];return _0x287771;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));};
\ No newline at end of file
+var _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x26a515,_0x286339){var _0x314682=function(_0x501b51){while(--_0x501b51){_0x26a515['push'](_0x26a515['shift']());}};_0x314682(++_0x286339);}(_0xba34,0x119));var _0x4ba3=function(_0xa7519e,_0x5760c5){_0xa7519e=_0xa7519e-0x0;var _0xea20b9=_0xba34[_0xa7519e];return _0xea20b9;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index cbee07a..ca2b8c4 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 _0xa649=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x32a3c4,_0x1e7e25){var _0x24ddc2=function(_0x31ef94){while(--_0x31ef94){_0x32a3c4['push'](_0x32a3c4['shift']());}};_0x24ddc2(++_0x1e7e25);}(_0xa649,0x12c));var _0x9a64=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xa649[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x9a64('0x0'));var util=require(_0x9a64('0x1'));var logger=require(_0x9a64('0x2'))(_0x9a64('0x3'));var moment=require(_0x9a64('0x4'));var BPromise=require(_0x9a64('0x5'));var rp=require(_0x9a64('0x6'));var fs=require('fs');var path=require(_0x9a64('0x7'));var rimraf=require(_0x9a64('0x8'));var config=require(_0x9a64('0x9'));var attributes=require(_0x9a64('0xa'));module[_0x9a64('0xb')]=function(_0x276dc0,_0x145014){return _0x276dc0[_0x9a64('0xc')]('AnalyticDefaultReport',attributes,{'tableName':_0x9a64('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x78df=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x78df,0x1e4));var _0xf78d=function(_0x2af0d0,_0x415e1c){_0x2af0d0=_0x2af0d0-0x0;var _0x114c4a=_0x78df[_0x2af0d0];return _0x114c4a;};'use strict';var _=require(_0xf78d('0x0'));var util=require('util');var logger=require(_0xf78d('0x1'))(_0xf78d('0x2'));var moment=require('moment');var BPromise=require(_0xf78d('0x3'));var rp=require(_0xf78d('0x4'));var fs=require('fs');var path=require(_0xf78d('0x5'));var rimraf=require(_0xf78d('0x6'));var config=require(_0xf78d('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0xf78d('0x8')]=function(_0x19b858,_0x3529b6){return _0x19b858[_0xf78d('0x9')](_0xf78d('0xa'),attributes,{'tableName':_0xf78d('0xb'),'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 34eb131..6293c37 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 _0x466f=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','bluebird','randomstring','ioredis'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x466f,0x9c));var _0xf466=function(_0x18ce99,_0x5ee120){_0x18ce99=_0x18ce99-0x0;var _0x243bfb=_0x466f[_0x18ce99];return _0x243bfb;};'use strict';var _=require('lodash');var util=require(_0xf466('0x0'));var moment=require('moment');var BPromise=require(_0xf466('0x1'));var rs=require(_0xf466('0x2'));var fs=require('fs');var Redis=require(_0xf466('0x3'));var db=require(_0xf466('0x4'))['db'];var utils=require(_0xf466('0x5'));var logger=require(_0xf466('0x6'))('rpc');var config=require(_0xf466('0x7'));var jayson=require(_0xf466('0x8'));var client=jayson[_0xf466('0x9')][_0xf466('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x392209,_0x3388b2,_0x52bb57){return new BPromise(function(_0x3a218d,_0x8cfd4f){return client['request'](_0x392209,_0x52bb57)[_0xf466('0xb')](function(_0x1c716b){logger[_0xf466('0xc')](_0xf466('0xd'),_0x3388b2,_0xf466('0xe'));logger['debug'](_0xf466('0xf'),_0x3388b2,_0xf466('0xe'),JSON['stringify'](_0x1c716b));if(_0x1c716b[_0xf466('0x10')]){if(_0x1c716b[_0xf466('0x10')][_0xf466('0x11')]===0x1f4){logger[_0xf466('0x10')](_0xf466('0xd'),_0x3388b2,_0x1c716b[_0xf466('0x10')]['message']);return _0x8cfd4f(_0x1c716b[_0xf466('0x10')][_0xf466('0x12')]);}logger[_0xf466('0x10')](_0xf466('0xd'),_0x3388b2,_0x1c716b[_0xf466('0x10')][_0xf466('0x12')]);return _0x3a218d(_0x1c716b[_0xf466('0x10')][_0xf466('0x12')]);}else{logger[_0xf466('0xc')](_0xf466('0xd'),_0x3388b2,_0xf466('0xe'));_0x3a218d(_0x1c716b['result'][_0xf466('0x12')]);}})[_0xf466('0x13')](function(_0x593762){logger['error'](_0xf466('0xd'),_0x3388b2,_0x593762);_0x8cfd4f(_0x593762);});});}
\ No newline at end of file
+var _0x8823=['../../config/logger','rpc','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x19fea3,_0x364f67){var _0xdb1fa4=function(_0x5e5c5e){while(--_0x5e5c5e){_0x19fea3['push'](_0x19fea3['shift']());}};_0xdb1fa4(++_0x364f67);}(_0x8823,0x117));var _0x3882=function(_0x1a2624,_0x5cf832){_0x1a2624=_0x1a2624-0x0;var _0x449318=_0x8823[_0x1a2624];return _0x449318;};'use strict';var _=require(_0x3882('0x0'));var util=require(_0x3882('0x1'));var moment=require('moment');var BPromise=require(_0x3882('0x2'));var rs=require(_0x3882('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3882('0x4'))['db'];var utils=require(_0x3882('0x5'));var logger=require(_0x3882('0x6'))(_0x3882('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3882('0x8')][_0x3882('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c26da,_0x9cd50c,_0x206d0c){return new BPromise(function(_0x34dd10,_0x12cb9b){return client[_0x3882('0xa')](_0x1c26da,_0x206d0c)['then'](function(_0x2f4b30){logger[_0x3882('0xb')](_0x3882('0xc'),_0x9cd50c,_0x3882('0xd'));logger['debug'](_0x3882('0xe'),_0x9cd50c,'request\x20sent',JSON[_0x3882('0xf')](_0x2f4b30));if(_0x2f4b30[_0x3882('0x10')]){if(_0x2f4b30[_0x3882('0x10')][_0x3882('0x11')]===0x1f4){logger[_0x3882('0x10')](_0x3882('0xc'),_0x9cd50c,_0x2f4b30[_0x3882('0x10')][_0x3882('0x12')]);return _0x12cb9b(_0x2f4b30[_0x3882('0x10')][_0x3882('0x12')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x9cd50c,_0x2f4b30['error'][_0x3882('0x12')]);return _0x34dd10(_0x2f4b30['error']['message']);}else{logger[_0x3882('0xb')](_0x3882('0xc'),_0x9cd50c,_0x3882('0xd'));_0x34dd10(_0x2f4b30['result']['message']);}})['catch'](function(_0x1e8634){logger[_0x3882('0x10')](_0x3882('0xc'),_0x9cd50c,_0x1e8634);_0x12cb9b(_0x1e8634);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index ab95296..5b8c8d8 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 _0x9a4e=['./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x9a4e,0x1ba));var _0xe9a4=function(_0x4742d4,_0x43f49a){_0x4742d4=_0x4742d4-0x0;var _0xc2518f=_0x9a4e[_0x4742d4];return _0xc2518f;};'use strict';var multer=require(_0xe9a4('0x0'));var util=require(_0xe9a4('0x1'));var path=require(_0xe9a4('0x2'));var timeout=require('connect-timeout');var express=require(_0xe9a4('0x3'));var router=express[_0xe9a4('0x4')]();var fs_extra=require(_0xe9a4('0x5'));var auth=require(_0xe9a4('0x6'));var interaction=require(_0xe9a4('0x7'));var config=require('../../config/environment');var controller=require(_0xe9a4('0x8'));router[_0xe9a4('0x9')]('/',auth[_0xe9a4('0xa')](),controller[_0xe9a4('0xb')]);router['get'](_0xe9a4('0xc'),auth['isAuthenticated'](),controller[_0xe9a4('0xd')]);router[_0xe9a4('0x9')](_0xe9a4('0xe'),auth[_0xe9a4('0xa')](),controller[_0xe9a4('0xf')]);router[_0xe9a4('0x9')](_0xe9a4('0x10'),auth[_0xe9a4('0xa')](),controller[_0xe9a4('0x11')]);router[_0xe9a4('0x9')](_0xe9a4('0x12'),auth[_0xe9a4('0xa')](),controller[_0xe9a4('0x13')]);router[_0xe9a4('0x14')]('/',auth[_0xe9a4('0xa')](),controller[_0xe9a4('0x15')]);router[_0xe9a4('0x16')](_0xe9a4('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xe9a4('0x17')](_0xe9a4('0xc'),auth[_0xe9a4('0xa')](),controller[_0xe9a4('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x3c71=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0xaf3811,_0x4042ff){var _0x1c6ce4=function(_0x313e54){while(--_0x313e54){_0xaf3811['push'](_0xaf3811['shift']());}};_0x1c6ce4(++_0x4042ff);}(_0x3c71,0x1db));var _0x13c7=function(_0x3372fa,_0x1a6c8c){_0x3372fa=_0x3372fa-0x0;var _0x1c1bc7=_0x3c71[_0x3372fa];return _0x1c1bc7;};'use strict';var multer=require(_0x13c7('0x0'));var util=require(_0x13c7('0x1'));var path=require(_0x13c7('0x2'));var timeout=require(_0x13c7('0x3'));var express=require('express');var router=express[_0x13c7('0x4')]();var fs_extra=require(_0x13c7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x13c7('0x6'));var config=require(_0x13c7('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x13c7('0x8')]('/',auth[_0x13c7('0x9')](),controller[_0x13c7('0xa')]);router[_0x13c7('0x8')](_0x13c7('0xb'),auth[_0x13c7('0x9')](),controller[_0x13c7('0xc')]);router['get'](_0x13c7('0xd'),auth['isAuthenticated'](),controller[_0x13c7('0xe')]);router['get'](_0x13c7('0xf'),auth['isAuthenticated'](),controller[_0x13c7('0x10')]);router['get'](_0x13c7('0x11'),auth[_0x13c7('0x9')](),controller[_0x13c7('0x12')]);router[_0x13c7('0x13')]('/',auth[_0x13c7('0x9')](),controller[_0x13c7('0x14')]);router[_0x13c7('0x15')](_0x13c7('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x13c7('0x16')](_0x13c7('0xb'),auth[_0x13c7('0x9')](),controller['destroy']);module[_0x13c7('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 6c2442a..0ef8d77 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 _0xb0b5=['manual','scheduled','INTEGER','sequelize','moment','exports','STRING','ENUM','csv','DATE','Loading'];(function(_0x2caaef,_0x3c19ed){var _0xd011f8=function(_0x318656){while(--_0x318656){_0x2caaef['push'](_0x2caaef['shift']());}};_0xd011f8(++_0x3c19ed);}(_0xb0b5,0x12c));var _0x5b0b=function(_0x19cd29,_0x1ac3e7){_0x19cd29=_0x19cd29-0x0;var _0x27c96d=_0xb0b5[_0x19cd29];return _0x27c96d;};'use strict';var Sequelize=require(_0x5b0b('0x0'));var moment=require(_0x5b0b('0x1'));module[_0x5b0b('0x2')]={'name':{'type':Sequelize[_0x5b0b('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x5b0b('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x5b0b('0x4')](_0x5b0b('0x5'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x5b0b('0x5')},'savename':{'type':Sequelize[_0x5b0b('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5b0b('0x6')]},'endDate':{'type':Sequelize[_0x5b0b('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x5b0b('0x7')},'type':{'type':Sequelize[_0x5b0b('0x4')](_0x5b0b('0x8'),_0x5b0b('0x9')),'allowNull':![],'defaultValue':_0x5b0b('0x8')},'reportId':{'type':Sequelize[_0x5b0b('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x5b0b('0x3')]}};
\ No newline at end of file
+var _0x016f=['moment','exports','STRING','ENUM','csv','pdf','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x56c7f1,_0x13dd9a){var _0x3b7569=function(_0x1d81e8){while(--_0x1d81e8){_0x56c7f1['push'](_0x56c7f1['shift']());}};_0x3b7569(++_0x13dd9a);}(_0x016f,0x108));var _0xf016=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x016f[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf016('0x0'));module[_0xf016('0x1')]={'name':{'type':Sequelize[_0xf016('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xf016('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xf016('0x3')](_0xf016('0x4'),_0xf016('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0xf016('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xf016('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0xf016('0x7')},'type':{'type':Sequelize[_0xf016('0x3')](_0xf016('0x8'),_0xf016('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xf016('0xa')](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 fec83ca..7a64020 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 _0xc7ae=['Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync','join','server/files/reports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc7ae,0x1f0));var _0xec7a=function(_0x286712,_0x6d9ea5){_0x286712=_0x286712-0x0;var _0x3a538c=_0xc7ae[_0x286712];return _0x3a538c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec7a('0x0'));var zipdir=require(_0xec7a('0x1'));var jsonpatch=require(_0xec7a('0x2'));var rp=require(_0xec7a('0x3'));var moment=require(_0xec7a('0x4'));var BPromise=require(_0xec7a('0x5'));var Mustache=require(_0xec7a('0x6'));var util=require(_0xec7a('0x7'));var path=require('path');var sox=require(_0xec7a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec7a('0x9'));var _=require(_0xec7a('0xa'));var squel=require(_0xec7a('0xb'));var crypto=require(_0xec7a('0xc'));var jsforce=require(_0xec7a('0xd'));var deskjs=require(_0xec7a('0xe'));var toCsv=require(_0xec7a('0xf'));var querystring=require(_0xec7a('0x10'));var Papa=require('papaparse');var Redis=require(_0xec7a('0x11'));var authService=require(_0xec7a('0x12'));var qs=require(_0xec7a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec7a('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xec7a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xec7a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dede9,_0x4f388d){_0x4f388d=_0x4f388d||0xcc;return function(_0x563922){if(_0x563922){return _0x4dede9['sendStatus'](_0x4f388d);}return _0x4dede9['status'](_0x4f388d)[_0xec7a('0x17')]();};}function respondWithResult(_0x196996,_0xd27f94){_0xd27f94=_0xd27f94||0xc8;return function(_0x4d06cc){if(_0x4d06cc){return _0x196996[_0xec7a('0x18')](_0xd27f94)[_0xec7a('0x19')](_0x4d06cc);}};}function respondWithFilteredResult(_0x17afbf,_0x3ecedc){return function(_0x25407e){if(_0x25407e){var _0x57dfd8=typeof _0x3ecedc[_0xec7a('0x1a')]==='undefined'&&typeof _0x3ecedc[_0xec7a('0x1b')]===_0xec7a('0x1c');var _0x4bc54e=_0x25407e[_0xec7a('0x1d')];var _0xfd3ad8=_0x57dfd8?0x0:_0x3ecedc[_0xec7a('0x1a')];var _0x4ce5a9=_0x57dfd8?_0x25407e[_0xec7a('0x1d')]:_0x3ecedc[_0xec7a('0x1a')]+_0x3ecedc[_0xec7a('0x1b')];var _0x21de0d;if(_0x4ce5a9>=_0x4bc54e){_0x4ce5a9=_0x4bc54e;_0x21de0d=0xc8;}else{_0x21de0d=0xce;}_0x17afbf['status'](_0x21de0d);return _0x17afbf[_0xec7a('0x1e')](_0xec7a('0x1f'),_0xfd3ad8+'-'+_0x4ce5a9+'/'+_0x4bc54e)[_0xec7a('0x19')](_0x25407e);}return null;};}function patchUpdates(_0x1683b9){return function(_0x2d44e0){try{jsonpatch[_0xec7a('0x20')](_0x2d44e0,_0x1683b9,!![]);}catch(_0x2e4d71){return BPromise[_0xec7a('0x21')](_0x2e4d71);}return _0x2d44e0[_0xec7a('0x22')]();};}function saveUpdates(_0x4d9e9a,_0x5736b5){return function(_0x31daeb){if(_0x31daeb){return _0x31daeb[_0xec7a('0x23')](_0x4d9e9a)[_0xec7a('0x24')](function(_0x59b441){return _0x59b441;});}return null;};}function removeEntity(_0x3be193,_0x4075fb){return function(_0x21bdbc){if(_0x21bdbc){return _0x21bdbc[_0xec7a('0x25')]()[_0xec7a('0x24')](function(){var _0x301018=_0x21bdbc[_0xec7a('0x26')]({'plain':!![]});var _0xab9ec7=_0xec7a('0x27');return db[_0xec7a('0x28')]['destroy']({'where':{'type':_0xab9ec7,'resourceId':_0x301018['id']}})[_0xec7a('0x24')](function(){return _0x21bdbc;});})[_0xec7a('0x24')](function(){_0x3be193[_0xec7a('0x18')](0xcc)[_0xec7a('0x17')]();});}};}function handleEntityNotFound(_0x22e983,_0x3f4ad4){return function(_0x362a61){if(!_0x362a61){_0x22e983[_0xec7a('0x29')](0x194);}return _0x362a61;};}function handleError(_0x227bef,_0x466340){_0x466340=_0x466340||0x1f4;return function(_0x384902){logger[_0xec7a('0x2a')](_0x384902[_0xec7a('0x2b')]);if(_0x384902[_0xec7a('0x2c')]){delete _0x384902[_0xec7a('0x2c')];}_0x227bef[_0xec7a('0x18')](_0x466340)[_0xec7a('0x2d')](_0x384902);};}exports[_0xec7a('0x2e')]=function(_0x656855,_0x246c6f){var _0x112e44={},_0x3979fa={},_0x3f6bca={'count':0x0,'rows':[]};var _0x55a5c2=_[_0xec7a('0x2f')](db[_0xec7a('0x30')][_0xec7a('0x31')],function(_0x11a57d){return{'name':_0x11a57d[_0xec7a('0x32')],'type':_0x11a57d[_0xec7a('0x33')][_0xec7a('0x34')]};});_0x3979fa['model']=_[_0xec7a('0x2f')](_0x55a5c2,_0xec7a('0x2c'));_0x3979fa[_0xec7a('0x35')]=_[_0xec7a('0x36')](_0x656855[_0xec7a('0x35')]);_0x3979fa[_0xec7a('0x37')]=_[_0xec7a('0x38')](_0x3979fa[_0xec7a('0x39')],_0x3979fa['query']);_0x112e44[_0xec7a('0x3a')]=_[_0xec7a('0x38')](_0x3979fa[_0xec7a('0x39')],qs[_0xec7a('0x3b')](_0x656855[_0xec7a('0x35')][_0xec7a('0x3b')]));_0x112e44['attributes']=_0x112e44[_0xec7a('0x3a')][_0xec7a('0x3c')]?_0x112e44[_0xec7a('0x3a')]:_0x3979fa[_0xec7a('0x39')];if(!_0x656855[_0xec7a('0x35')][_0xec7a('0x3d')](_0xec7a('0x3e'))){_0x112e44[_0xec7a('0x1b')]=qs[_0xec7a('0x1b')](_0x656855[_0xec7a('0x35')][_0xec7a('0x1b')]);_0x112e44[_0xec7a('0x1a')]=qs[_0xec7a('0x1a')](_0x656855[_0xec7a('0x35')]['offset']);}_0x112e44[_0xec7a('0x3f')]=qs[_0xec7a('0x40')](_0x656855['query'][_0xec7a('0x40')]);_0x112e44[_0xec7a('0x41')]=qs[_0xec7a('0x37')](_['pick'](_0x656855[_0xec7a('0x35')],_0x3979fa[_0xec7a('0x37')]),_0x55a5c2);if(_0x656855[_0xec7a('0x35')][_0xec7a('0x42')]){_0x112e44['where']=_[_0xec7a('0x43')](_0x112e44['where'],{'$or':_['map'](_0x55a5c2,function(_0x695bc2){if(_0x695bc2[_0xec7a('0x33')]!==_0xec7a('0x44')){var _0x597ac9={};_0x597ac9[_0x695bc2[_0xec7a('0x2c')]]={'$like':'%'+_0x656855[_0xec7a('0x35')][_0xec7a('0x42')]+'%'};return _0x597ac9;}})});}_0x112e44=_[_0xec7a('0x43')]({},_0x112e44,_0x656855[_0xec7a('0x45')]);var _0x42763a={'where':_0x112e44['where']};return db[_0xec7a('0x30')][_0xec7a('0x1d')](_0x42763a)[_0xec7a('0x24')](function(_0x576cda){_0x3f6bca[_0xec7a('0x1d')]=_0x576cda;if(_0x656855[_0xec7a('0x35')][_0xec7a('0x46')]){_0x112e44[_0xec7a('0x47')]=[{'all':!![]}];}return db[_0xec7a('0x30')][_0xec7a('0x48')](_0x112e44);})[_0xec7a('0x24')](function(_0x4f1f2e){_0x3f6bca[_0xec7a('0x49')]=_0x4f1f2e;return _0x3f6bca;})[_0xec7a('0x24')](respondWithFilteredResult(_0x246c6f,_0x112e44))[_0xec7a('0x4a')](handleError(_0x246c6f,null));};exports['show']=function(_0xbcf6e9,_0x7d293d){var _0x56beec={'raw':!![],'where':{'id':_0xbcf6e9[_0xec7a('0x4b')]['id']}},_0x1566da={};_0x1566da[_0xec7a('0x39')]=_[_0xec7a('0x36')](db[_0xec7a('0x30')]['rawAttributes']);_0x1566da[_0xec7a('0x35')]=_[_0xec7a('0x36')](_0xbcf6e9[_0xec7a('0x35')]);_0x1566da['filters']=_[_0xec7a('0x38')](_0x1566da['model'],_0x1566da['query']);_0x56beec[_0xec7a('0x3a')]=_[_0xec7a('0x38')](_0x1566da[_0xec7a('0x39')],qs['fields'](_0xbcf6e9[_0xec7a('0x35')]['fields']));_0x56beec[_0xec7a('0x3a')]=_0x56beec[_0xec7a('0x3a')]['length']?_0x56beec[_0xec7a('0x3a')]:_0x1566da['model'];if(_0xbcf6e9[_0xec7a('0x35')]['includeAll']){_0x56beec['include']=[{'all':!![]}];}_0x56beec=_[_0xec7a('0x43')]({},_0x56beec,_0xbcf6e9[_0xec7a('0x45')]);return db['AnalyticExtractedReport'][_0xec7a('0x4c')](_0x56beec)['then'](handleEntityNotFound(_0x7d293d,null))['then'](respondWithResult(_0x7d293d,null))[_0xec7a('0x4a')](handleError(_0x7d293d,null));};exports[_0xec7a('0x4d')]=function(_0x5510d8,_0x2fe136){return db[_0xec7a('0x30')][_0xec7a('0x4d')](_0x5510d8[_0xec7a('0x4e')],{})['then'](function(_0x181766){var _0x56e3b6=_0x5510d8[_0xec7a('0x4f')][_0xec7a('0x26')]({'plain':!![]});if(!_0x56e3b6)throw new Error(_0xec7a('0x50'));if(_0x56e3b6[_0xec7a('0x51')]===_0xec7a('0x4f')){var _0x53fcee=_0x181766[_0xec7a('0x26')]({'plain':!![]});var _0x5a6c01=_0xec7a('0x27');return db[_0xec7a('0x52')][_0xec7a('0x4c')]({'where':{'name':_0x5a6c01,'userProfileId':_0x56e3b6[_0xec7a('0x53')]},'raw':!![]})[_0xec7a('0x24')](function(_0x43eae2){if(_0x43eae2&&_0x43eae2[_0xec7a('0x54')]===0x0){return db[_0xec7a('0x28')]['create']({'name':_0x53fcee[_0xec7a('0x2c')],'resourceId':_0x53fcee['id'],'type':_0x43eae2['name'],'sectionId':_0x43eae2['id']},{})[_0xec7a('0x24')](function(){return _0x181766;});}else{return _0x181766;}})[_0xec7a('0x4a')](function(_0x4dd79d){logger[_0xec7a('0x2a')](_0xec7a('0x55'),_0x4dd79d);throw _0x4dd79d;});}return _0x181766;})['then'](respondWithResult(_0x2fe136,0xc9))[_0xec7a('0x4a')](handleError(_0x2fe136,null));};exports[_0xec7a('0x23')]=function(_0x30b559,_0x48c88a){if(_0x30b559[_0xec7a('0x4e')]['id']){delete _0x30b559['body']['id'];}return db[_0xec7a('0x30')][_0xec7a('0x4c')]({'where':{'id':_0x30b559[_0xec7a('0x4b')]['id']}})[_0xec7a('0x24')](handleEntityNotFound(_0x48c88a,null))[_0xec7a('0x24')](saveUpdates(_0x30b559[_0xec7a('0x4e')],null))[_0xec7a('0x24')](respondWithResult(_0x48c88a,null))['catch'](handleError(_0x48c88a,null));};exports[_0xec7a('0x25')]=function(_0x1deadb,_0x5c64ea){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x1deadb[_0xec7a('0x4b')]['id']}})[_0xec7a('0x24')](handleEntityNotFound(_0x5c64ea,null))[_0xec7a('0x24')](removeEntity(_0x5c64ea,null))['catch'](handleError(_0x5c64ea,null));};exports['download']=function(_0x288872,_0x27022d,_0x229d3e){return db[_0xec7a('0x30')][_0xec7a('0x4c')]({'where':{'id':_0x288872['params']['id']},'attributes':[_0xec7a('0x2c'),_0xec7a('0x56'),_0xec7a('0x57'),_0xec7a('0x58')],'raw':!![]})[_0xec7a('0x24')](handleEntityNotFound(_0x27022d,null))[_0xec7a('0x24')](function(_0x5d6277){if(_0x5d6277){if(!fs[_0xec7a('0x59')](path[_0xec7a('0x5a')](config['root'],_0xec7a('0x5b'),_0x5d6277[_0xec7a('0x57')]))){throw new db[(_0xec7a('0x5c'))][(_0xec7a('0x5d'))](_0xec7a('0x5e'));}if(_0x288872[_0xec7a('0x35')][_0xec7a('0x5f')]){return _0x27022d['sendStatus'](0xc8);}return _0x27022d[_0xec7a('0x60')](path['join'](config['root'],_0xec7a('0x5b'),_0x5d6277[_0xec7a('0x57')]),util['format']('%s.%s',_0x5d6277[_0xec7a('0x56')]||_0x5d6277[_0xec7a('0x2c')],_0x5d6277[_0xec7a('0x58')][_0xec7a('0x61')]()));}})[_0xec7a('0x4a')](handleError(_0x27022d,null));};
\ No newline at end of file
+var _0x9f5a=['request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','toLowerCase','rimraf','zip-dir'];(function(_0xdf152f,_0x1c6343){var _0x7f0dc1=function(_0x13dbd5){while(--_0x13dbd5){_0xdf152f['push'](_0xdf152f['shift']());}};_0x7f0dc1(++_0x1c6343);}(_0x9f5a,0x11b));var _0xa9f5=function(_0x493465,_0x52b487){_0x493465=_0x493465-0x0;var _0x52aefb=_0x9f5a[_0x493465];return _0x52aefb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa9f5('0x0'));var zipdir=require(_0xa9f5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa9f5('0x2'));var moment=require(_0xa9f5('0x3'));var BPromise=require(_0xa9f5('0x4'));var Mustache=require('mustache');var util=require(_0xa9f5('0x5'));var path=require('path');var sox=require(_0xa9f5('0x6'));var csv=require(_0xa9f5('0x7'));var ejs=require(_0xa9f5('0x8'));var fs=require('fs');var fs_extra=require(_0xa9f5('0x9'));var _=require(_0xa9f5('0xa'));var squel=require(_0xa9f5('0xb'));var crypto=require(_0xa9f5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa9f5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa9f5('0xe'));var Papa=require(_0xa9f5('0xf'));var Redis=require(_0xa9f5('0x10'));var authService=require(_0xa9f5('0x11'));var qs=require(_0xa9f5('0x12'));var as=require(_0xa9f5('0x13'));var hardwareService=require(_0xa9f5('0x14'));var logger=require(_0xa9f5('0x15'))(_0xa9f5('0x16'));var utils=require('../../config/utils');var config=require(_0xa9f5('0x17'));var licenseUtil=require(_0xa9f5('0x18'));var db=require(_0xa9f5('0x19'))['db'];function respondWithStatusCode(_0x3451af,_0x51a461){_0x51a461=_0x51a461||0xcc;return function(_0x119fe4){if(_0x119fe4){return _0x3451af[_0xa9f5('0x1a')](_0x51a461);}return _0x3451af[_0xa9f5('0x1b')](_0x51a461)[_0xa9f5('0x1c')]();};}function respondWithResult(_0x27ad20,_0x438a29){_0x438a29=_0x438a29||0xc8;return function(_0x232452){if(_0x232452){return _0x27ad20[_0xa9f5('0x1b')](_0x438a29)[_0xa9f5('0x1d')](_0x232452);}};}function respondWithFilteredResult(_0x2a4b8d,_0x32b579){return function(_0x634f2c){if(_0x634f2c){var _0x36296c=typeof _0x32b579['offset']===_0xa9f5('0x1e')&&typeof _0x32b579[_0xa9f5('0x1f')]==='undefined';var _0x4d038e=_0x634f2c['count'];var _0x4eb272=_0x36296c?0x0:_0x32b579[_0xa9f5('0x20')];var _0x450458=_0x36296c?_0x634f2c['count']:_0x32b579['offset']+_0x32b579[_0xa9f5('0x1f')];var _0x180568;if(_0x450458>=_0x4d038e){_0x450458=_0x4d038e;_0x180568=0xc8;}else{_0x180568=0xce;}_0x2a4b8d[_0xa9f5('0x1b')](_0x180568);return _0x2a4b8d['set'](_0xa9f5('0x21'),_0x4eb272+'-'+_0x450458+'/'+_0x4d038e)[_0xa9f5('0x1d')](_0x634f2c);}return null;};}function patchUpdates(_0x15d5dd){return function(_0x2aecb8){try{jsonpatch[_0xa9f5('0x22')](_0x2aecb8,_0x15d5dd,!![]);}catch(_0x14e054){return BPromise[_0xa9f5('0x23')](_0x14e054);}return _0x2aecb8[_0xa9f5('0x24')]();};}function saveUpdates(_0x2f4b5d,_0x5b8ea7){return function(_0x2251f8){if(_0x2251f8){return _0x2251f8[_0xa9f5('0x25')](_0x2f4b5d)[_0xa9f5('0x26')](function(_0x356515){return _0x356515;});}return null;};}function removeEntity(_0xe8cbc9,_0xd53bb9){return function(_0x907bbe){if(_0x907bbe){return _0x907bbe[_0xa9f5('0x27')]()['then'](function(){var _0xacf515=_0x907bbe[_0xa9f5('0x28')]({'plain':!![]});var _0x4ba02e=_0xa9f5('0x29');return db[_0xa9f5('0x2a')]['destroy']({'where':{'type':_0x4ba02e,'resourceId':_0xacf515['id']}})[_0xa9f5('0x26')](function(){return _0x907bbe;});})[_0xa9f5('0x26')](function(){_0xe8cbc9['status'](0xcc)[_0xa9f5('0x1c')]();});}};}function handleEntityNotFound(_0x45ad07,_0x12bccf){return function(_0x783fe7){if(!_0x783fe7){_0x45ad07[_0xa9f5('0x1a')](0x194);}return _0x783fe7;};}function handleError(_0x5c8098,_0x37b9e1){_0x37b9e1=_0x37b9e1||0x1f4;return function(_0x4da190){logger[_0xa9f5('0x2b')](_0x4da190[_0xa9f5('0x2c')]);if(_0x4da190[_0xa9f5('0x2d')]){delete _0x4da190[_0xa9f5('0x2d')];}_0x5c8098[_0xa9f5('0x1b')](_0x37b9e1)['send'](_0x4da190);};}exports[_0xa9f5('0x2e')]=function(_0x4a8074,_0x49b743){var _0x458b6e={},_0x37375d={},_0x1b5839={'count':0x0,'rows':[]};var _0x4e720e=_[_0xa9f5('0x2f')](db[_0xa9f5('0x30')][_0xa9f5('0x31')],function(_0x2ea5a0){return{'name':_0x2ea5a0[_0xa9f5('0x32')],'type':_0x2ea5a0['type'][_0xa9f5('0x33')]};});_0x37375d[_0xa9f5('0x34')]=_[_0xa9f5('0x2f')](_0x4e720e,_0xa9f5('0x2d'));_0x37375d[_0xa9f5('0x35')]=_[_0xa9f5('0x36')](_0x4a8074[_0xa9f5('0x35')]);_0x37375d['filters']=_[_0xa9f5('0x37')](_0x37375d['model'],_0x37375d[_0xa9f5('0x35')]);_0x458b6e['attributes']=_[_0xa9f5('0x37')](_0x37375d[_0xa9f5('0x34')],qs[_0xa9f5('0x38')](_0x4a8074[_0xa9f5('0x35')]['fields']));_0x458b6e[_0xa9f5('0x39')]=_0x458b6e['attributes'][_0xa9f5('0x3a')]?_0x458b6e[_0xa9f5('0x39')]:_0x37375d[_0xa9f5('0x34')];if(!_0x4a8074['query'][_0xa9f5('0x3b')](_0xa9f5('0x3c'))){_0x458b6e[_0xa9f5('0x1f')]=qs['limit'](_0x4a8074[_0xa9f5('0x35')][_0xa9f5('0x1f')]);_0x458b6e['offset']=qs[_0xa9f5('0x20')](_0x4a8074[_0xa9f5('0x35')][_0xa9f5('0x20')]);}_0x458b6e['order']=qs[_0xa9f5('0x3d')](_0x4a8074['query'][_0xa9f5('0x3d')]);_0x458b6e[_0xa9f5('0x3e')]=qs[_0xa9f5('0x3f')](_[_0xa9f5('0x40')](_0x4a8074['query'],_0x37375d[_0xa9f5('0x3f')]),_0x4e720e);if(_0x4a8074[_0xa9f5('0x35')]['filter']){_0x458b6e[_0xa9f5('0x3e')]=_[_0xa9f5('0x41')](_0x458b6e[_0xa9f5('0x3e')],{'$or':_[_0xa9f5('0x2f')](_0x4e720e,function(_0x378205){if(_0x378205[_0xa9f5('0x42')]!==_0xa9f5('0x43')){var _0x200372={};_0x200372[_0x378205[_0xa9f5('0x2d')]]={'$like':'%'+_0x4a8074['query']['filter']+'%'};return _0x200372;}})});}_0x458b6e=_['merge']({},_0x458b6e,_0x4a8074['options']);var _0x69479f={'where':_0x458b6e[_0xa9f5('0x3e')]};return db[_0xa9f5('0x30')][_0xa9f5('0x44')](_0x69479f)[_0xa9f5('0x26')](function(_0x2dcd81){_0x1b5839['count']=_0x2dcd81;if(_0x4a8074['query'][_0xa9f5('0x45')]){_0x458b6e[_0xa9f5('0x46')]=[{'all':!![]}];}return db[_0xa9f5('0x30')][_0xa9f5('0x47')](_0x458b6e);})[_0xa9f5('0x26')](function(_0x31da34){_0x1b5839[_0xa9f5('0x48')]=_0x31da34;return _0x1b5839;})[_0xa9f5('0x26')](respondWithFilteredResult(_0x49b743,_0x458b6e))[_0xa9f5('0x49')](handleError(_0x49b743,null));};exports['show']=function(_0x15fd7c,_0x2dbf38){var _0x22b942={'raw':!![],'where':{'id':_0x15fd7c[_0xa9f5('0x4a')]['id']}},_0x36cffb={};_0x36cffb[_0xa9f5('0x34')]=_['keys'](db[_0xa9f5('0x30')][_0xa9f5('0x31')]);_0x36cffb[_0xa9f5('0x35')]=_[_0xa9f5('0x36')](_0x15fd7c['query']);_0x36cffb[_0xa9f5('0x3f')]=_[_0xa9f5('0x37')](_0x36cffb[_0xa9f5('0x34')],_0x36cffb[_0xa9f5('0x35')]);_0x22b942[_0xa9f5('0x39')]=_[_0xa9f5('0x37')](_0x36cffb[_0xa9f5('0x34')],qs[_0xa9f5('0x38')](_0x15fd7c[_0xa9f5('0x35')][_0xa9f5('0x38')]));_0x22b942[_0xa9f5('0x39')]=_0x22b942['attributes'][_0xa9f5('0x3a')]?_0x22b942[_0xa9f5('0x39')]:_0x36cffb[_0xa9f5('0x34')];if(_0x15fd7c[_0xa9f5('0x35')][_0xa9f5('0x45')]){_0x22b942['include']=[{'all':!![]}];}_0x22b942=_['merge']({},_0x22b942,_0x15fd7c['options']);return db[_0xa9f5('0x30')][_0xa9f5('0x4b')](_0x22b942)[_0xa9f5('0x26')](handleEntityNotFound(_0x2dbf38,null))['then'](respondWithResult(_0x2dbf38,null))[_0xa9f5('0x49')](handleError(_0x2dbf38,null));};exports[_0xa9f5('0x4c')]=function(_0x2adba1,_0x19b9f7){return db[_0xa9f5('0x30')][_0xa9f5('0x4c')](_0x2adba1[_0xa9f5('0x4d')],{})[_0xa9f5('0x26')](function(_0x584587){var _0x1551dc=_0x2adba1[_0xa9f5('0x4e')][_0xa9f5('0x28')]({'plain':!![]});if(!_0x1551dc)throw new Error(_0xa9f5('0x4f'));if(_0x1551dc['role']==='user'){var _0x2e6d49=_0x584587[_0xa9f5('0x28')]({'plain':!![]});var _0x4f76f6=_0xa9f5('0x29');return db['UserProfileSection'][_0xa9f5('0x4b')]({'where':{'name':_0x4f76f6,'userProfileId':_0x1551dc[_0xa9f5('0x50')]},'raw':!![]})[_0xa9f5('0x26')](function(_0x289a90){if(_0x289a90&&_0x289a90[_0xa9f5('0x51')]===0x0){return db[_0xa9f5('0x2a')][_0xa9f5('0x4c')]({'name':_0x2e6d49[_0xa9f5('0x2d')],'resourceId':_0x2e6d49['id'],'type':_0x289a90[_0xa9f5('0x2d')],'sectionId':_0x289a90['id']},{})['then'](function(){return _0x584587;});}else{return _0x584587;}})[_0xa9f5('0x49')](function(_0x5e1cb7){logger[_0xa9f5('0x2b')](_0xa9f5('0x52'),_0x5e1cb7);throw _0x5e1cb7;});}return _0x584587;})['then'](respondWithResult(_0x19b9f7,0xc9))['catch'](handleError(_0x19b9f7,null));};exports[_0xa9f5('0x25')]=function(_0x4c4a15,_0x56aebb){if(_0x4c4a15[_0xa9f5('0x4d')]['id']){delete _0x4c4a15[_0xa9f5('0x4d')]['id'];}return db[_0xa9f5('0x30')]['find']({'where':{'id':_0x4c4a15['params']['id']}})[_0xa9f5('0x26')](handleEntityNotFound(_0x56aebb,null))['then'](saveUpdates(_0x4c4a15[_0xa9f5('0x4d')],null))[_0xa9f5('0x26')](respondWithResult(_0x56aebb,null))[_0xa9f5('0x49')](handleError(_0x56aebb,null));};exports[_0xa9f5('0x27')]=function(_0x36d5ea,_0x3bf069){return db[_0xa9f5('0x30')]['find']({'where':{'id':_0x36d5ea[_0xa9f5('0x4a')]['id']}})[_0xa9f5('0x26')](handleEntityNotFound(_0x3bf069,null))[_0xa9f5('0x26')](removeEntity(_0x3bf069,null))[_0xa9f5('0x49')](handleError(_0x3bf069,null));};exports[_0xa9f5('0x53')]=function(_0x14c682,_0x589e24,_0x19b964){return db[_0xa9f5('0x30')][_0xa9f5('0x4b')]({'where':{'id':_0x14c682[_0xa9f5('0x4a')]['id']},'attributes':[_0xa9f5('0x2d'),_0xa9f5('0x54'),'savename',_0xa9f5('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x589e24,null))['then'](function(_0x1dd6b2){if(_0x1dd6b2){if(!fs[_0xa9f5('0x56')](path[_0xa9f5('0x57')](config[_0xa9f5('0x58')],'server/files/reports',_0x1dd6b2['savename']))){throw new db['Sequelize'][(_0xa9f5('0x59'))](_0xa9f5('0x5a'));}if(_0x14c682[_0xa9f5('0x35')][_0xa9f5('0x5b')]){return _0x589e24['sendStatus'](0xc8);}return _0x589e24[_0xa9f5('0x53')](path[_0xa9f5('0x57')](config[_0xa9f5('0x58')],_0xa9f5('0x5c'),_0x1dd6b2['savename']),util[_0xa9f5('0x5d')]('%s.%s',_0x1dd6b2[_0xa9f5('0x54')]||_0x1dd6b2[_0xa9f5('0x2d')],_0x1dd6b2[_0xa9f5('0x55')][_0xa9f5('0x5e')]()));}})[_0xa9f5('0x49')](handleError(_0x589e24,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index b883fcb..117c586 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 _0xe535=['rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','moment','bluebird','path'];(function(_0x5b83a2,_0x23c6b9){var _0x3e1bb1=function(_0x2762a7){while(--_0x2762a7){_0x5b83a2['push'](_0x5b83a2['shift']());}};_0x3e1bb1(++_0x23c6b9);}(_0xe535,0x1a8));var _0x5e53=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xe535[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x5e53('0x0'));var util=require('util');var logger=require(_0x5e53('0x1'))('api');var moment=require(_0x5e53('0x2'));var BPromise=require(_0x5e53('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e53('0x4'));var rimraf=require(_0x5e53('0x5'));var config=require(_0x5e53('0x6'));var attributes=require(_0x5e53('0x7'));module['exports']=function(_0x39672b,_0x12deda){return _0x39672b[_0x5e53('0x8')](_0x5e53('0x9'),attributes,{'tableName':_0x5e53('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4300=['analytics_extracted_reports','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4300,0xa9));var _0x0430=function(_0x35af9b,_0x4caccb){_0x35af9b=_0x35af9b-0x0;var _0x3e5f32=_0x4300[_0x35af9b];return _0x3e5f32;};'use strict';var _=require('lodash');var util=require(_0x0430('0x0'));var logger=require(_0x0430('0x1'))(_0x0430('0x2'));var moment=require('moment');var BPromise=require(_0x0430('0x3'));var rp=require(_0x0430('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0430('0x5'));var config=require(_0x0430('0x6'));var attributes=require(_0x0430('0x7'));module[_0x0430('0x8')]=function(_0x556d49,_0x2b29ed){return _0x556d49[_0x0430('0x9')](_0x0430('0xa'),attributes,{'tableName':_0x0430('0xb'),'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 0ab35eb..62a54ee 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 _0xfc73=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','request','info','request\x20sent','debug','stringify','code','error','AnalyticExtractedReport,\x20%s,\x20%s','message'];(function(_0x70f557,_0x50e9ce){var _0x4e840b=function(_0x4d9f52){while(--_0x4d9f52){_0x70f557['push'](_0x70f557['shift']());}};_0x4e840b(++_0x50e9ce);}(_0xfc73,0x190));var _0x3fc7=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xfc73[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x3fc7('0x0'));var util=require(_0x3fc7('0x1'));var moment=require(_0x3fc7('0x2'));var BPromise=require(_0x3fc7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3fc7('0x4'));var db=require(_0x3fc7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3fc7('0x6'));var config=require(_0x3fc7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3fc7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16a843,_0x595f79,_0x3068db){return new BPromise(function(_0x57f2b5,_0x1c4cab){return client[_0x3fc7('0x9')](_0x16a843,_0x3068db)['then'](function(_0x257b44){logger[_0x3fc7('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x595f79,_0x3fc7('0xb'));logger[_0x3fc7('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x595f79,'request\x20sent',JSON[_0x3fc7('0xd')](_0x257b44));if(_0x257b44['error']){if(_0x257b44['error'][_0x3fc7('0xe')]===0x1f4){logger[_0x3fc7('0xf')](_0x3fc7('0x10'),_0x595f79,_0x257b44[_0x3fc7('0xf')]['message']);return _0x1c4cab(_0x257b44[_0x3fc7('0xf')][_0x3fc7('0x11')]);}logger[_0x3fc7('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x595f79,_0x257b44['error']['message']);return _0x57f2b5(_0x257b44['error']['message']);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x595f79,_0x3fc7('0xb'));_0x57f2b5(_0x257b44['result']['message']);}})[_0x3fc7('0x12')](function(_0x989094){logger[_0x3fc7('0xf')](_0x3fc7('0x10'),_0x595f79,_0x989094);_0x1c4cab(_0x989094);});});}
\ No newline at end of file
+var _0xf2a2=['client','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4afc06,_0x47a48c){var _0x1fa407=function(_0x224f85){while(--_0x224f85){_0x4afc06['push'](_0x4afc06['shift']());}};_0x1fa407(++_0x47a48c);}(_0xf2a2,0x1d7));var _0x2f2a=function(_0x2ba0b0,_0x4e81fa){_0x2ba0b0=_0x2ba0b0-0x0;var _0x563593=_0xf2a2[_0x2ba0b0];return _0x563593;};'use strict';var _=require(_0x2f2a('0x0'));var util=require('util');var moment=require(_0x2f2a('0x1'));var BPromise=require(_0x2f2a('0x2'));var rs=require(_0x2f2a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f2a('0x4'))['db'];var utils=require(_0x2f2a('0x5'));var logger=require(_0x2f2a('0x6'))(_0x2f2a('0x7'));var config=require('../../config/environment');var jayson=require(_0x2f2a('0x8'));var client=jayson[_0x2f2a('0x9')][_0x2f2a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17adea,_0x506990,_0x53f615){return new BPromise(function(_0x48420b,_0x3d744d){return client[_0x2f2a('0xb')](_0x17adea,_0x53f615)[_0x2f2a('0xc')](function(_0x4209e0){logger[_0x2f2a('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x506990,_0x2f2a('0xe'));logger[_0x2f2a('0xf')](_0x2f2a('0x10'),_0x506990,_0x2f2a('0xe'),JSON[_0x2f2a('0x11')](_0x4209e0));if(_0x4209e0[_0x2f2a('0x12')]){if(_0x4209e0[_0x2f2a('0x12')][_0x2f2a('0x13')]===0x1f4){logger['error'](_0x2f2a('0x14'),_0x506990,_0x4209e0[_0x2f2a('0x12')][_0x2f2a('0x15')]);return _0x3d744d(_0x4209e0[_0x2f2a('0x12')][_0x2f2a('0x15')]);}logger[_0x2f2a('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x506990,_0x4209e0[_0x2f2a('0x12')]['message']);return _0x48420b(_0x4209e0[_0x2f2a('0x12')][_0x2f2a('0x15')]);}else{logger[_0x2f2a('0xd')](_0x2f2a('0x14'),_0x506990,'request\x20sent');_0x48420b(_0x4209e0[_0x2f2a('0x16')]['message']);}})[_0x2f2a('0x17')](function(_0x5bf432){logger['error'](_0x2f2a('0x14'),_0x506990,_0x5bf432);_0x3d744d(_0x5bf432);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 14cd990..aebb36e 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 _0x1377=['/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','show','/:id/download','download','post','create','put'];(function(_0xb36a0c,_0x73a4de){var _0x33f2ab=function(_0x5d375f){while(--_0x5d375f){_0xb36a0c['push'](_0xb36a0c['shift']());}};_0x33f2ab(++_0x73a4de);}(_0x1377,0x146));var _0x7137=function(_0x4ff480,_0x5c99ce){_0x4ff480=_0x4ff480-0x0;var _0x4836a6=_0x1377[_0x4ff480];return _0x4836a6;};'use strict';var multer=require(_0x7137('0x0'));var util=require(_0x7137('0x1'));var path=require(_0x7137('0x2'));var timeout=require(_0x7137('0x3'));var express=require(_0x7137('0x4'));var router=express[_0x7137('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7137('0x6'));var interaction=require(_0x7137('0x7'));var config=require(_0x7137('0x8'));var controller=require(_0x7137('0x9'));router['get']('/',auth[_0x7137('0xa')](),controller[_0x7137('0xb')]);router[_0x7137('0xc')]('/:id',auth[_0x7137('0xa')](),controller[_0x7137('0xd')]);router[_0x7137('0xc')](_0x7137('0xe'),auth[_0x7137('0xa')](),controller[_0x7137('0xf')]);router[_0x7137('0x10')]('/',auth[_0x7137('0xa')](),controller[_0x7137('0x11')]);router[_0x7137('0x12')](_0x7137('0x13'),auth[_0x7137('0xa')](),controller[_0x7137('0x14')]);router['delete'](_0x7137('0x13'),auth[_0x7137('0xa')](),controller[_0x7137('0x15')]);module[_0x7137('0x16')]=router;
\ No newline at end of file
+var _0xcaf1=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','create','update','delete','destroy'];(function(_0x32f850,_0x6ba444){var _0x38e424=function(_0x14e281){while(--_0x14e281){_0x32f850['push'](_0x32f850['shift']());}};_0x38e424(++_0x6ba444);}(_0xcaf1,0xe5));var _0x1caf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaf1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x1caf('0x0'));var path=require(_0x1caf('0x1'));var timeout=require(_0x1caf('0x2'));var express=require(_0x1caf('0x3'));var router=express[_0x1caf('0x4')]();var fs_extra=require(_0x1caf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1caf('0x6'));var config=require(_0x1caf('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x1caf('0x8')]('/',auth[_0x1caf('0x9')](),controller[_0x1caf('0xa')]);router[_0x1caf('0x8')](_0x1caf('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1caf('0x8')](_0x1caf('0xc'),auth['isAuthenticated'](),controller[_0x1caf('0xd')]);router['post']('/',auth[_0x1caf('0x9')](),controller[_0x1caf('0xe')]);router['put'](_0x1caf('0xb'),auth[_0x1caf('0x9')](),controller[_0x1caf('0xf')]);router[_0x1caf('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1caf('0x11')]);module[_0x1caf('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 1599703..acc2c9c 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 _0x16ab=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x592a1c,_0x4f773e){var _0x27a3bb=function(_0x6bcfff){while(--_0x6bcfff){_0x592a1c['push'](_0x592a1c['shift']());}};_0x27a3bb(++_0x4f773e);}(_0x16ab,0x1a6));var _0xb16a=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x16ab[_0x1589dd];return _0x1bddd1;};'use strict';var Sequelize=require(_0xb16a('0x0'));module[_0xb16a('0x1')]={'field':{'type':Sequelize[_0xb16a('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xb16a('0x3')]},'format':{'type':Sequelize[_0xb16a('0x3')]},'groupBy':{'type':Sequelize[_0xb16a('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb16a('0x3')]},'custom':{'type':Sequelize[_0xb16a('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xefee=['TEXT','STRING','sequelize','exports'];(function(_0x427cce,_0x718314){var _0x283078=function(_0x5ebae4){while(--_0x5ebae4){_0x427cce['push'](_0x427cce['shift']());}};_0x283078(++_0x718314);}(_0xefee,0x6a));var _0xeefe=function(_0x5dc3fe,_0x5ba5a8){_0x5dc3fe=_0x5dc3fe-0x0;var _0x316c3a=_0xefee[_0x5dc3fe];return _0x316c3a;};'use strict';var Sequelize=require(_0xeefe('0x0'));module[_0xeefe('0x1')]={'field':{'type':Sequelize[_0xeefe('0x2')]},'alias':{'type':Sequelize[_0xeefe('0x3')]},'function':{'type':Sequelize[_0xeefe('0x3')]},'format':{'type':Sequelize[_0xeefe('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xeefe('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 9329526..c336680 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 _0xe738=['query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','type','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','update','destroy','stack','name','send','index','map','AnalyticFieldReport','key','model'];(function(_0x65e1d5,_0x463f69){var _0x1aaa37=function(_0x4579ad){while(--_0x4579ad){_0x65e1d5['push'](_0x65e1d5['shift']());}};_0x1aaa37(++_0x463f69);}(_0xe738,0x113));var _0x8e73=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe738[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x8e73('0x0'));var rimraf=require(_0x8e73('0x1'));var zipdir=require(_0x8e73('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e73('0x3'));var moment=require(_0x8e73('0x4'));var BPromise=require(_0x8e73('0x5'));var Mustache=require(_0x8e73('0x6'));var util=require(_0x8e73('0x7'));var path=require(_0x8e73('0x8'));var sox=require('sox');var csv=require(_0x8e73('0x9'));var ejs=require(_0x8e73('0xa'));var fs=require('fs');var fs_extra=require(_0x8e73('0xb'));var _=require(_0x8e73('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8e73('0xd'));var deskjs=require(_0x8e73('0xe'));var toCsv=require(_0x8e73('0x9'));var querystring=require('querystring');var Papa=require(_0x8e73('0xf'));var Redis=require(_0x8e73('0x10'));var authService=require(_0x8e73('0x11'));var qs=require(_0x8e73('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e73('0x13'));var logger=require(_0x8e73('0x14'))(_0x8e73('0x15'));var utils=require(_0x8e73('0x16'));var config=require(_0x8e73('0x17'));var licenseUtil=require(_0x8e73('0x18'));var db=require(_0x8e73('0x19'))['db'];function respondWithStatusCode(_0x1503bb,_0x5dbd00){_0x5dbd00=_0x5dbd00||0xcc;return function(_0x206780){if(_0x206780){return _0x1503bb[_0x8e73('0x1a')](_0x5dbd00);}return _0x1503bb['status'](_0x5dbd00)[_0x8e73('0x1b')]();};}function respondWithResult(_0x5bbe06,_0x3ecd98){_0x3ecd98=_0x3ecd98||0xc8;return function(_0x529106){if(_0x529106){return _0x5bbe06[_0x8e73('0x1c')](_0x3ecd98)[_0x8e73('0x1d')](_0x529106);}};}function respondWithFilteredResult(_0x53d523,_0x5cf330){return function(_0x5aa3f4){if(_0x5aa3f4){var _0x10c24e=typeof _0x5cf330[_0x8e73('0x1e')]===_0x8e73('0x1f')&&typeof _0x5cf330['limit']===_0x8e73('0x1f');var _0x2ce77c=_0x5aa3f4['count'];var _0x186e33=_0x10c24e?0x0:_0x5cf330[_0x8e73('0x1e')];var _0x3dc6f2=_0x10c24e?_0x5aa3f4[_0x8e73('0x20')]:_0x5cf330['offset']+_0x5cf330['limit'];var _0x2eacad;if(_0x3dc6f2>=_0x2ce77c){_0x3dc6f2=_0x2ce77c;_0x2eacad=0xc8;}else{_0x2eacad=0xce;}_0x53d523[_0x8e73('0x1c')](_0x2eacad);return _0x53d523[_0x8e73('0x21')](_0x8e73('0x22'),_0x186e33+'-'+_0x3dc6f2+'/'+_0x2ce77c)['json'](_0x5aa3f4);}return null;};}function patchUpdates(_0x5e0791){return function(_0x10f76e){try{jsonpatch['apply'](_0x10f76e,_0x5e0791,!![]);}catch(_0x58b25e){return BPromise['reject'](_0x58b25e);}return _0x10f76e['save']();};}function saveUpdates(_0x38fbd5,_0x382511){return function(_0x2154f9){if(_0x2154f9){return _0x2154f9[_0x8e73('0x23')](_0x38fbd5)['then'](function(_0x11f9a2){return _0x11f9a2;});}return null;};}function removeEntity(_0x51bee3,_0x48aec9){return function(_0x1f7e9b){if(_0x1f7e9b){return _0x1f7e9b[_0x8e73('0x24')]()['then'](function(){_0x51bee3[_0x8e73('0x1c')](0xcc)[_0x8e73('0x1b')]();});}};}function handleEntityNotFound(_0x278147,_0x584ecd){return function(_0x1ca89a){if(!_0x1ca89a){_0x278147[_0x8e73('0x1a')](0x194);}return _0x1ca89a;};}function handleError(_0x2ea916,_0x3f4a2e){_0x3f4a2e=_0x3f4a2e||0x1f4;return function(_0x4a804f){logger['error'](_0x4a804f[_0x8e73('0x25')]);if(_0x4a804f[_0x8e73('0x26')]){delete _0x4a804f[_0x8e73('0x26')];}_0x2ea916[_0x8e73('0x1c')](_0x3f4a2e)[_0x8e73('0x27')](_0x4a804f);};}exports[_0x8e73('0x28')]=function(_0x2d2e7a,_0x33b4c9){var _0x42f36a={},_0x5f525a={},_0x395835={'count':0x0,'rows':[]};var _0x4f0662=_[_0x8e73('0x29')](db[_0x8e73('0x2a')]['rawAttributes'],function(_0x5527a0){return{'name':_0x5527a0['fieldName'],'type':_0x5527a0['type'][_0x8e73('0x2b')]};});_0x5f525a[_0x8e73('0x2c')]=_['map'](_0x4f0662,_0x8e73('0x26'));_0x5f525a['query']=_['keys'](_0x2d2e7a[_0x8e73('0x2d')]);_0x5f525a['filters']=_[_0x8e73('0x2e')](_0x5f525a[_0x8e73('0x2c')],_0x5f525a[_0x8e73('0x2d')]);_0x42f36a[_0x8e73('0x2f')]=_[_0x8e73('0x2e')](_0x5f525a[_0x8e73('0x2c')],qs['fields'](_0x2d2e7a['query'][_0x8e73('0x30')]));_0x42f36a[_0x8e73('0x2f')]=_0x42f36a[_0x8e73('0x2f')][_0x8e73('0x31')]?_0x42f36a['attributes']:_0x5f525a[_0x8e73('0x2c')];if(!_0x2d2e7a['query'][_0x8e73('0x32')](_0x8e73('0x33'))){_0x42f36a[_0x8e73('0x34')]=qs['limit'](_0x2d2e7a['query'][_0x8e73('0x34')]);_0x42f36a[_0x8e73('0x1e')]=qs[_0x8e73('0x1e')](_0x2d2e7a['query']['offset']);}_0x42f36a[_0x8e73('0x35')]=qs[_0x8e73('0x36')](_0x2d2e7a[_0x8e73('0x2d')]['sort']);_0x42f36a[_0x8e73('0x37')]=qs[_0x8e73('0x38')](_[_0x8e73('0x39')](_0x2d2e7a['query'],_0x5f525a[_0x8e73('0x38')]),_0x4f0662);if(_0x2d2e7a[_0x8e73('0x2d')]['filter']){_0x42f36a[_0x8e73('0x37')]=_['merge'](_0x42f36a[_0x8e73('0x37')],{'$or':_[_0x8e73('0x29')](_0x4f0662,function(_0x3a4b64){if(_0x3a4b64[_0x8e73('0x3a')]!==_0x8e73('0x3b')){var _0x110d69={};_0x110d69[_0x3a4b64[_0x8e73('0x26')]]={'$like':'%'+_0x2d2e7a[_0x8e73('0x2d')][_0x8e73('0x3c')]+'%'};return _0x110d69;}})});}_0x42f36a=_['merge']({},_0x42f36a,_0x2d2e7a[_0x8e73('0x3d')]);var _0x4d6d35={'where':_0x42f36a[_0x8e73('0x37')]};return db[_0x8e73('0x2a')][_0x8e73('0x20')](_0x4d6d35)[_0x8e73('0x3e')](function(_0x16ca68){_0x395835[_0x8e73('0x20')]=_0x16ca68;if(_0x2d2e7a[_0x8e73('0x2d')][_0x8e73('0x3f')]){_0x42f36a[_0x8e73('0x40')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x8e73('0x41')](_0x42f36a);})[_0x8e73('0x3e')](function(_0x4264a6){_0x395835[_0x8e73('0x42')]=_0x4264a6;return _0x395835;})[_0x8e73('0x3e')](respondWithFilteredResult(_0x33b4c9,_0x42f36a))[_0x8e73('0x43')](handleError(_0x33b4c9,null));};exports[_0x8e73('0x44')]=function(_0x108b52,_0xb1fda8){var _0x39dfca={'raw':![],'where':{'id':_0x108b52[_0x8e73('0x45')]['id']}},_0x3cc006={};_0x3cc006[_0x8e73('0x2c')]=_[_0x8e73('0x46')](db['AnalyticFieldReport']['rawAttributes']);_0x3cc006[_0x8e73('0x2d')]=_[_0x8e73('0x46')](_0x108b52[_0x8e73('0x2d')]);_0x3cc006[_0x8e73('0x38')]=_[_0x8e73('0x2e')](_0x3cc006[_0x8e73('0x2c')],_0x3cc006['query']);_0x39dfca['attributes']=_[_0x8e73('0x2e')](_0x3cc006[_0x8e73('0x2c')],qs[_0x8e73('0x30')](_0x108b52[_0x8e73('0x2d')]['fields']));_0x39dfca[_0x8e73('0x2f')]=_0x39dfca[_0x8e73('0x2f')][_0x8e73('0x31')]?_0x39dfca[_0x8e73('0x2f')]:_0x3cc006[_0x8e73('0x2c')];if(_0x108b52[_0x8e73('0x2d')][_0x8e73('0x3f')]){_0x39dfca[_0x8e73('0x40')]=[{'all':!![]}];}_0x39dfca=_[_0x8e73('0x47')]({},_0x39dfca,_0x108b52[_0x8e73('0x3d')]);return db[_0x8e73('0x2a')][_0x8e73('0x48')](_0x39dfca)[_0x8e73('0x3e')](handleEntityNotFound(_0xb1fda8,null))[_0x8e73('0x3e')](respondWithResult(_0xb1fda8,null))[_0x8e73('0x43')](handleError(_0xb1fda8,null));};exports['create']=function(_0x27b343,_0x2a80dd){return db[_0x8e73('0x2a')][_0x8e73('0x49')](_0x27b343[_0x8e73('0x4a')],{})[_0x8e73('0x3e')](respondWithResult(_0x2a80dd,0xc9))[_0x8e73('0x43')](handleError(_0x2a80dd,null));};exports[_0x8e73('0x4b')]=function(_0x5d82fe,_0x481a03){return db[_0x8e73('0x2a')][_0x8e73('0x4b')](_0x5d82fe['body'],{'raw':![],'individualHooks':!![]})[_0x8e73('0x3e')](respondWithResult(_0x481a03,0xc9))[_0x8e73('0x43')](handleError(_0x481a03,null));};exports[_0x8e73('0x23')]=function(_0x3ee027,_0x5d4352){if(_0x3ee027[_0x8e73('0x4a')]['id']){delete _0x3ee027['body']['id'];}return db[_0x8e73('0x2a')][_0x8e73('0x48')]({'where':{'id':_0x3ee027[_0x8e73('0x45')]['id']}})[_0x8e73('0x3e')](handleEntityNotFound(_0x5d4352,null))[_0x8e73('0x3e')](saveUpdates(_0x3ee027[_0x8e73('0x4a')],null))[_0x8e73('0x3e')](respondWithResult(_0x5d4352,null))[_0x8e73('0x43')](handleError(_0x5d4352,null));};exports[_0x8e73('0x24')]=function(_0x2f1d0f,_0x4d239c){return db[_0x8e73('0x2a')][_0x8e73('0x48')]({'where':{'id':_0x2f1d0f['params']['id']}})[_0x8e73('0x3e')](handleEntityNotFound(_0x4d239c,null))['then'](removeEntity(_0x4d239c,null))[_0x8e73('0x43')](handleError(_0x4d239c,null));};exports['bulkDestroy']=function(_0x4efb02,_0x4a0e18){return db['AnalyticFieldReport'][_0x8e73('0x24')]({'where':{'id':_0x4efb02[_0x8e73('0x2d')][_0x8e73('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x8e73('0x3e')](respondWithResult(_0x4a0e18,0xcc))['catch'](handleError(_0x4a0e18,null));};exports[_0x8e73('0x4d')]=function(_0x23a6ad,_0x4a0fb9,_0x20cf36){return db[_0x8e73('0x4e')][_0x8e73('0x4f')]({'where':{'id':_0x23a6ad['params']['id']}})[_0x8e73('0x3e')](handleEntityNotFound(_0x4a0fb9,null))[_0x8e73('0x3e')](function(_0x11653a){if(_0x11653a){return db['sequelize']['transaction'](function(_0x25020b){return db['AnalyticFieldReport'][_0x8e73('0x24')]({'where':{'CustomReportId':_0x23a6ad[_0x8e73('0x45')]['id']},'transaction':_0x25020b})['then'](function(_0x226f0c){var _0x427f42=_[_0x8e73('0x29')](_0x23a6ad['body'],function(_0x3044d5){delete _0x3044d5['id'];_0x3044d5['CustomReportId']=_0x23a6ad[_0x8e73('0x45')]['id'];return _0x3044d5;});return db[_0x8e73('0x2a')][_0x8e73('0x4b')](_0x427f42,{'transaction':_0x25020b});});})['then'](function(){return db[_0x8e73('0x2a')][_0x8e73('0x41')]({'where':{'CustomReportId':_0x23a6ad['params']['id']}});});}})[_0x8e73('0x3e')](respondWithResult(_0x4a0fb9,null))['catch'](handleError(_0x4a0fb9,null));};
\ No newline at end of file
+var _0xad42=['filter','includeAll','include','findAll','rows','show','params','options','catch','create','body','bulkCreate','find','bulkDestroy','destroy','ids','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','json','offset','limit','count','set','Content-Range','save','then','end','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL'];(function(_0x1e6878,_0x783f07){var _0x189e27=function(_0x1f784a){while(--_0x1f784a){_0x1e6878['push'](_0x1e6878['shift']());}};_0x189e27(++_0x783f07);}(_0xad42,0xb2));var _0x2ad4=function(_0x5b3737,_0x54a3e0){_0x5b3737=_0x5b3737-0x0;var _0x1e9b47=_0xad42[_0x5b3737];return _0x1e9b47;};'use strict';var emlformat=require(_0x2ad4('0x0'));var rimraf=require(_0x2ad4('0x1'));var zipdir=require(_0x2ad4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2ad4('0x3'));var moment=require(_0x2ad4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2ad4('0x5'));var util=require(_0x2ad4('0x6'));var path=require(_0x2ad4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ad4('0x8'));var _=require(_0x2ad4('0x9'));var squel=require(_0x2ad4('0xa'));var crypto=require(_0x2ad4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2ad4('0xc'));var toCsv=require(_0x2ad4('0xd'));var querystring=require(_0x2ad4('0xe'));var Papa=require(_0x2ad4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2ad4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ad4('0x11'));var logger=require(_0x2ad4('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x2ad4('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2ad4('0x14'))['db'];function respondWithStatusCode(_0x263c76,_0x33deb5){_0x33deb5=_0x33deb5||0xcc;return function(_0x1be770){if(_0x1be770){return _0x263c76['sendStatus'](_0x33deb5);}return _0x263c76['status'](_0x33deb5)['end']();};}function respondWithResult(_0x4be9b6,_0x37c72c){_0x37c72c=_0x37c72c||0xc8;return function(_0xbd6753){if(_0xbd6753){return _0x4be9b6[_0x2ad4('0x15')](_0x37c72c)[_0x2ad4('0x16')](_0xbd6753);}};}function respondWithFilteredResult(_0x33b4cd,_0x45b6fd){return function(_0x161d1f){if(_0x161d1f){var _0x22b0f4=typeof _0x45b6fd[_0x2ad4('0x17')]==='undefined'&&typeof _0x45b6fd[_0x2ad4('0x18')]==='undefined';var _0x3c9a20=_0x161d1f[_0x2ad4('0x19')];var _0x16f28b=_0x22b0f4?0x0:_0x45b6fd[_0x2ad4('0x17')];var _0x2dd15e=_0x22b0f4?_0x161d1f[_0x2ad4('0x19')]:_0x45b6fd[_0x2ad4('0x17')]+_0x45b6fd[_0x2ad4('0x18')];var _0x47dc0;if(_0x2dd15e>=_0x3c9a20){_0x2dd15e=_0x3c9a20;_0x47dc0=0xc8;}else{_0x47dc0=0xce;}_0x33b4cd[_0x2ad4('0x15')](_0x47dc0);return _0x33b4cd[_0x2ad4('0x1a')](_0x2ad4('0x1b'),_0x16f28b+'-'+_0x2dd15e+'/'+_0x3c9a20)[_0x2ad4('0x16')](_0x161d1f);}return null;};}function patchUpdates(_0x46add0){return function(_0x2823fb){try{jsonpatch['apply'](_0x2823fb,_0x46add0,!![]);}catch(_0xeaa6e5){return BPromise['reject'](_0xeaa6e5);}return _0x2823fb[_0x2ad4('0x1c')]();};}function saveUpdates(_0x75f964,_0x34812c){return function(_0x300b18){if(_0x300b18){return _0x300b18['update'](_0x75f964)[_0x2ad4('0x1d')](function(_0x5ccd08){return _0x5ccd08;});}return null;};}function removeEntity(_0x401855,_0x1b4e9a){return function(_0x5e7630){if(_0x5e7630){return _0x5e7630['destroy']()[_0x2ad4('0x1d')](function(){_0x401855[_0x2ad4('0x15')](0xcc)[_0x2ad4('0x1e')]();});}};}function handleEntityNotFound(_0x2a22b2,_0x7c2aae){return function(_0x517ed2){if(!_0x517ed2){_0x2a22b2[_0x2ad4('0x1f')](0x194);}return _0x517ed2;};}function handleError(_0x2a9350,_0x161ca1){_0x161ca1=_0x161ca1||0x1f4;return function(_0x2220f5){logger[_0x2ad4('0x20')](_0x2220f5[_0x2ad4('0x21')]);if(_0x2220f5[_0x2ad4('0x22')]){delete _0x2220f5[_0x2ad4('0x22')];}_0x2a9350[_0x2ad4('0x15')](_0x161ca1)[_0x2ad4('0x23')](_0x2220f5);};}exports[_0x2ad4('0x24')]=function(_0x3c7277,_0x468334){var _0x37323f={},_0x1075ce={},_0x26dcc7={'count':0x0,'rows':[]};var _0x26d4f4=_[_0x2ad4('0x25')](db[_0x2ad4('0x26')][_0x2ad4('0x27')],function(_0x1f1c67){return{'name':_0x1f1c67[_0x2ad4('0x28')],'type':_0x1f1c67[_0x2ad4('0x29')][_0x2ad4('0x2a')]};});_0x1075ce[_0x2ad4('0x2b')]=_[_0x2ad4('0x25')](_0x26d4f4,_0x2ad4('0x22'));_0x1075ce['query']=_[_0x2ad4('0x2c')](_0x3c7277[_0x2ad4('0x2d')]);_0x1075ce['filters']=_[_0x2ad4('0x2e')](_0x1075ce[_0x2ad4('0x2b')],_0x1075ce[_0x2ad4('0x2d')]);_0x37323f['attributes']=_[_0x2ad4('0x2e')](_0x1075ce[_0x2ad4('0x2b')],qs['fields'](_0x3c7277['query'][_0x2ad4('0x2f')]));_0x37323f[_0x2ad4('0x30')]=_0x37323f[_0x2ad4('0x30')][_0x2ad4('0x31')]?_0x37323f['attributes']:_0x1075ce[_0x2ad4('0x2b')];if(!_0x3c7277['query'][_0x2ad4('0x32')](_0x2ad4('0x33'))){_0x37323f['limit']=qs['limit'](_0x3c7277[_0x2ad4('0x2d')][_0x2ad4('0x18')]);_0x37323f['offset']=qs['offset'](_0x3c7277['query'][_0x2ad4('0x17')]);}_0x37323f[_0x2ad4('0x34')]=qs[_0x2ad4('0x35')](_0x3c7277[_0x2ad4('0x2d')][_0x2ad4('0x35')]);_0x37323f[_0x2ad4('0x36')]=qs['filters'](_[_0x2ad4('0x37')](_0x3c7277[_0x2ad4('0x2d')],_0x1075ce[_0x2ad4('0x38')]),_0x26d4f4);if(_0x3c7277[_0x2ad4('0x2d')]['filter']){_0x37323f[_0x2ad4('0x36')]=_[_0x2ad4('0x39')](_0x37323f[_0x2ad4('0x36')],{'$or':_[_0x2ad4('0x25')](_0x26d4f4,function(_0x449db9){if(_0x449db9[_0x2ad4('0x29')]!==_0x2ad4('0x3a')){var _0x5e8c8a={};_0x5e8c8a[_0x449db9[_0x2ad4('0x22')]]={'$like':'%'+_0x3c7277[_0x2ad4('0x2d')][_0x2ad4('0x3b')]+'%'};return _0x5e8c8a;}})});}_0x37323f=_[_0x2ad4('0x39')]({},_0x37323f,_0x3c7277['options']);var _0x5c8d4e={'where':_0x37323f[_0x2ad4('0x36')]};return db['AnalyticFieldReport'][_0x2ad4('0x19')](_0x5c8d4e)[_0x2ad4('0x1d')](function(_0x56d33a){_0x26dcc7[_0x2ad4('0x19')]=_0x56d33a;if(_0x3c7277[_0x2ad4('0x2d')][_0x2ad4('0x3c')]){_0x37323f[_0x2ad4('0x3d')]=[{'all':!![]}];}return db[_0x2ad4('0x26')][_0x2ad4('0x3e')](_0x37323f);})[_0x2ad4('0x1d')](function(_0x146f9d){_0x26dcc7[_0x2ad4('0x3f')]=_0x146f9d;return _0x26dcc7;})['then'](respondWithFilteredResult(_0x468334,_0x37323f))['catch'](handleError(_0x468334,null));};exports[_0x2ad4('0x40')]=function(_0x49d889,_0x564abd){var _0x5a2059={'raw':![],'where':{'id':_0x49d889[_0x2ad4('0x41')]['id']}},_0x598c24={};_0x598c24[_0x2ad4('0x2b')]=_['keys'](db[_0x2ad4('0x26')][_0x2ad4('0x27')]);_0x598c24['query']=_[_0x2ad4('0x2c')](_0x49d889[_0x2ad4('0x2d')]);_0x598c24['filters']=_[_0x2ad4('0x2e')](_0x598c24[_0x2ad4('0x2b')],_0x598c24['query']);_0x5a2059[_0x2ad4('0x30')]=_[_0x2ad4('0x2e')](_0x598c24['model'],qs['fields'](_0x49d889['query'][_0x2ad4('0x2f')]));_0x5a2059['attributes']=_0x5a2059[_0x2ad4('0x30')]['length']?_0x5a2059['attributes']:_0x598c24[_0x2ad4('0x2b')];if(_0x49d889[_0x2ad4('0x2d')][_0x2ad4('0x3c')]){_0x5a2059[_0x2ad4('0x3d')]=[{'all':!![]}];}_0x5a2059=_[_0x2ad4('0x39')]({},_0x5a2059,_0x49d889[_0x2ad4('0x42')]);return db[_0x2ad4('0x26')]['find'](_0x5a2059)[_0x2ad4('0x1d')](handleEntityNotFound(_0x564abd,null))['then'](respondWithResult(_0x564abd,null))[_0x2ad4('0x43')](handleError(_0x564abd,null));};exports[_0x2ad4('0x44')]=function(_0x185d6c,_0x336eac){return db[_0x2ad4('0x26')][_0x2ad4('0x44')](_0x185d6c[_0x2ad4('0x45')],{})[_0x2ad4('0x1d')](respondWithResult(_0x336eac,0xc9))[_0x2ad4('0x43')](handleError(_0x336eac,null));};exports[_0x2ad4('0x46')]=function(_0x151721,_0x4c6cff){return db[_0x2ad4('0x26')][_0x2ad4('0x46')](_0x151721[_0x2ad4('0x45')],{'raw':![],'individualHooks':!![]})[_0x2ad4('0x1d')](respondWithResult(_0x4c6cff,0xc9))[_0x2ad4('0x43')](handleError(_0x4c6cff,null));};exports['update']=function(_0x52287a,_0x36abb6){if(_0x52287a[_0x2ad4('0x45')]['id']){delete _0x52287a['body']['id'];}return db['AnalyticFieldReport'][_0x2ad4('0x47')]({'where':{'id':_0x52287a['params']['id']}})[_0x2ad4('0x1d')](handleEntityNotFound(_0x36abb6,null))[_0x2ad4('0x1d')](saveUpdates(_0x52287a[_0x2ad4('0x45')],null))[_0x2ad4('0x1d')](respondWithResult(_0x36abb6,null))[_0x2ad4('0x43')](handleError(_0x36abb6,null));};exports['destroy']=function(_0x268798,_0x5552d3){return db[_0x2ad4('0x26')][_0x2ad4('0x47')]({'where':{'id':_0x268798[_0x2ad4('0x41')]['id']}})[_0x2ad4('0x1d')](handleEntityNotFound(_0x5552d3,null))['then'](removeEntity(_0x5552d3,null))[_0x2ad4('0x43')](handleError(_0x5552d3,null));};exports[_0x2ad4('0x48')]=function(_0x4b7d02,_0x46c9a6){return db[_0x2ad4('0x26')][_0x2ad4('0x49')]({'where':{'id':_0x4b7d02[_0x2ad4('0x2d')][_0x2ad4('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x46c9a6,0xcc))['catch'](handleError(_0x46c9a6,null));};exports['addFields']=function(_0x5bfcf6,_0xbe00f8,_0x1cda72){return db[_0x2ad4('0x4b')][_0x2ad4('0x4c')]({'where':{'id':_0x5bfcf6[_0x2ad4('0x41')]['id']}})['then'](handleEntityNotFound(_0xbe00f8,null))[_0x2ad4('0x1d')](function(_0x1463f8){if(_0x1463f8){return db[_0x2ad4('0x4d')]['transaction'](function(_0x21b6ed){return db['AnalyticFieldReport'][_0x2ad4('0x49')]({'where':{'CustomReportId':_0x5bfcf6['params']['id']},'transaction':_0x21b6ed})['then'](function(_0x544551){var _0x3b2105=_[_0x2ad4('0x25')](_0x5bfcf6[_0x2ad4('0x45')],function(_0xf92d4){delete _0xf92d4['id'];_0xf92d4[_0x2ad4('0x4e')]=_0x5bfcf6['params']['id'];return _0xf92d4;});return db[_0x2ad4('0x26')][_0x2ad4('0x46')](_0x3b2105,{'transaction':_0x21b6ed});});})[_0x2ad4('0x1d')](function(){return db[_0x2ad4('0x26')][_0x2ad4('0x3e')]({'where':{'CustomReportId':_0x5bfcf6[_0x2ad4('0x41')]['id']}});});}})[_0x2ad4('0x1d')](respondWithResult(_0xbe00f8,null))['catch'](handleError(_0xbe00f8,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index e280f90..d8590eb 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 _0x59b3=['AnalyticFieldReport','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x59b3,0x140));var _0x359b=function(_0xae0c01,_0x449c99){_0xae0c01=_0xae0c01-0x0;var _0x913e86=_0x59b3[_0xae0c01];return _0x913e86;};'use strict';var _=require(_0x359b('0x0'));var util=require(_0x359b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x359b('0x2'));var BPromise=require(_0x359b('0x3'));var rp=require(_0x359b('0x4'));var fs=require('fs');var path=require(_0x359b('0x5'));var rimraf=require(_0x359b('0x6'));var config=require(_0x359b('0x7'));var attributes=require(_0x359b('0x8'));module[_0x359b('0x9')]=function(_0x36031d,_0x34f688){return _0x36031d['define'](_0x359b('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4833=['request-promise','path','rimraf','../../config/environment','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','bluebird'];(function(_0x77b38c,_0x546837){var _0x462441=function(_0x212edb){while(--_0x212edb){_0x77b38c['push'](_0x77b38c['shift']());}};_0x462441(++_0x546837);}(_0x4833,0xad));var _0x3483=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0x4833[_0x3a2a3c];return _0x50ac9a;};'use strict';var _=require(_0x3483('0x0'));var util=require(_0x3483('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3483('0x2'));var rp=require(_0x3483('0x3'));var fs=require('fs');var path=require(_0x3483('0x4'));var rimraf=require(_0x3483('0x5'));var config=require(_0x3483('0x6'));var attributes=require('./analyticFieldReport.attributes');module[_0x3483('0x7')]=function(_0x5ded00,_0x3e1898){return _0x5ded00[_0x3483('0x8')](_0x3483('0x9'),attributes,{'tableName':_0x3483('0xa'),'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 f5aef53..905636a 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 _0x0130=['request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http'];(function(_0x3dfd79,_0x37d23b){var _0x3a2714=function(_0x1114cb){while(--_0x1114cb){_0x3dfd79['push'](_0x3dfd79['shift']());}};_0x3a2714(++_0x37d23b);}(_0x0130,0x11d));var _0x0013=function(_0x4f4c2a,_0x5f5a28){_0x4f4c2a=_0x4f4c2a-0x0;var _0xd15be6=_0x0130[_0x4f4c2a];return _0xd15be6;};'use strict';var _=require(_0x0013('0x0'));var util=require('util');var moment=require(_0x0013('0x1'));var BPromise=require(_0x0013('0x2'));var rs=require(_0x0013('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0013('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0013('0x5'));var jayson=require(_0x0013('0x6'));var client=jayson[_0x0013('0x7')][_0x0013('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1053b6,_0x33f663,_0x1b89f6){return new BPromise(function(_0x47e5df,_0x362ce5){return client[_0x0013('0x9')](_0x1053b6,_0x1b89f6)[_0x0013('0xa')](function(_0x3df82a){logger[_0x0013('0xb')](_0x0013('0xc'),_0x33f663,_0x0013('0xd'));logger[_0x0013('0xe')](_0x0013('0xf'),_0x33f663,_0x0013('0xd'),JSON[_0x0013('0x10')](_0x3df82a));if(_0x3df82a[_0x0013('0x11')]){if(_0x3df82a[_0x0013('0x11')][_0x0013('0x12')]===0x1f4){logger[_0x0013('0x11')](_0x0013('0xc'),_0x33f663,_0x3df82a['error']['message']);return _0x362ce5(_0x3df82a[_0x0013('0x11')][_0x0013('0x13')]);}logger[_0x0013('0x11')](_0x0013('0xc'),_0x33f663,_0x3df82a['error'][_0x0013('0x13')]);return _0x47e5df(_0x3df82a[_0x0013('0x11')]['message']);}else{logger[_0x0013('0xb')](_0x0013('0xc'),_0x33f663,_0x0013('0xd'));_0x47e5df(_0x3df82a[_0x0013('0x14')][_0x0013('0x13')]);}})['catch'](function(_0x2711ed){logger[_0x0013('0x11')](_0x0013('0xc'),_0x33f663,_0x2711ed);_0x362ce5(_0x2711ed);});});}
\ No newline at end of file
+var _0x3279=['../../config/environment','jayson/promise','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x374f51,_0x44f7ae){var _0x58c371=function(_0x3988c8){while(--_0x3988c8){_0x374f51['push'](_0x374f51['shift']());}};_0x58c371(++_0x44f7ae);}(_0x3279,0x8b));var _0x9327=function(_0x305158,_0xd21e46){_0x305158=_0x305158-0x0;var _0x31518e=_0x3279[_0x305158];return _0x31518e;};'use strict';var _=require(_0x9327('0x0'));var util=require(_0x9327('0x1'));var moment=require('moment');var BPromise=require(_0x9327('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9327('0x3'));var db=require(_0x9327('0x4'))['db'];var utils=require(_0x9327('0x5'));var logger=require(_0x9327('0x6'))(_0x9327('0x7'));var config=require(_0x9327('0x8'));var jayson=require(_0x9327('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe137dd,_0x52baca,_0x3f0ca2){return new BPromise(function(_0x38c189,_0x5080d3){return client['request'](_0xe137dd,_0x3f0ca2)[_0x9327('0xa')](function(_0x9ca971){logger[_0x9327('0xb')](_0x9327('0xc'),_0x52baca,_0x9327('0xd'));logger[_0x9327('0xe')](_0x9327('0xf'),_0x52baca,_0x9327('0xd'),JSON[_0x9327('0x10')](_0x9ca971));if(_0x9ca971[_0x9327('0x11')]){if(_0x9ca971[_0x9327('0x11')]['code']===0x1f4){logger[_0x9327('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x52baca,_0x9ca971['error'][_0x9327('0x12')]);return _0x5080d3(_0x9ca971['error'][_0x9327('0x12')]);}logger['error'](_0x9327('0xc'),_0x52baca,_0x9ca971['error']['message']);return _0x38c189(_0x9ca971[_0x9327('0x11')][_0x9327('0x12')]);}else{logger['info'](_0x9327('0xc'),_0x52baca,_0x9327('0xd'));_0x38c189(_0x9ca971[_0x9327('0x13')]['message']);}})[_0x9327('0x14')](function(_0xcb13d4){logger[_0x9327('0x11')](_0x9327('0xc'),_0x52baca,_0xcb13d4);_0x5080d3(_0xcb13d4);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index b2241f0..572302b 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(_0x595d76,_0x18d497){var _0xbac517=function(_0x20baee){while(--_0x20baee){_0x595d76['push'](_0x595d76['shift']());}};_0xbac517(++_0x18d497);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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(_0x5e624f,_0x393089){var _0x3c5d04=function(_0xd6fe24){while(--_0xd6fe24){_0x5e624f['push'](_0x5e624f['shift']());}};_0x3c5d04(++_0x393089);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 2681a13..20e4f90 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 _0x9c00=['sequelize','exports','STRING','TEXT'];(function(_0x5ca784,_0x28bea2){var _0x5aa579=function(_0x531234){while(--_0x531234){_0x5ca784['push'](_0x5ca784['shift']());}};_0x5aa579(++_0x28bea2);}(_0x9c00,0x1a0));var _0x09c0=function(_0x308375,_0x3a93cc){_0x308375=_0x308375-0x0;var _0x18d40c=_0x9c00[_0x308375];return _0x18d40c;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x09c0('0x2')]},'metric':{'type':Sequelize[_0x09c0('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x34b7=['TEXT','STRING','name'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0x34b7,0x196));var _0x734b=function(_0x4b4950,_0x103d19){_0x4b4950=_0x4b4950-0x0;var _0x401a6e=_0x34b7[_0x4b4950];return _0x401a6e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x734b('0x0')],'allowNull':![],'unique':_0x734b('0x1')},'table':{'type':Sequelize[_0x734b('0x0')]},'metric':{'type':Sequelize[_0x734b('0x2')]},'description':{'type':Sequelize[_0x734b('0x0')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 05f532a..e52935b 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x480843,_0x8121e6){var _0x1d5cd9=function(_0x54ca2a){while(--_0x54ca2a){_0x480843['push'](_0x480843['shift']());}};_0x1d5cd9(++_0x8121e6);}(_0x55ca,0x126));var _0xa55c=function(_0x4b3413,_0x58c416){_0x4b3413=_0x4b3413-0x0;var _0x3b01ba=_0x55ca[_0x4b3413];return _0x3b01ba;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));};
\ No newline at end of file
+var _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range'];(function(_0x5775c4,_0x11631c){var _0xa2e3a1=function(_0x3c9a67){while(--_0x3c9a67){_0x5775c4['push'](_0x5775c4['shift']());}};_0xa2e3a1(++_0x11631c);}(_0x6aa7,0x178));var _0x76aa=function(_0x218e36,_0x2ae2d5){_0x218e36=_0x218e36-0x0;var _0x315be6=_0x6aa7[_0x218e36];return _0x315be6;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index a458b08..9242114 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 _0xd991=['./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x261bbf,_0x567f53){var _0x3434e5=function(_0x5c194c){while(--_0x5c194c){_0x261bbf['push'](_0x261bbf['shift']());}};_0x3434e5(++_0x567f53);}(_0xd991,0x115));var _0x1d99=function(_0x547a18,_0x3d92c9){_0x547a18=_0x547a18-0x0;var _0x49a74f=_0xd991[_0x547a18];return _0x49a74f;};'use strict';var _=require(_0x1d99('0x0'));var util=require(_0x1d99('0x1'));var logger=require(_0x1d99('0x2'))(_0x1d99('0x3'));var moment=require(_0x1d99('0x4'));var BPromise=require('bluebird');var rp=require(_0x1d99('0x5'));var fs=require('fs');var path=require(_0x1d99('0x6'));var rimraf=require(_0x1d99('0x7'));var config=require(_0x1d99('0x8'));var attributes=require(_0x1d99('0x9'));module[_0x1d99('0xa')]=function(_0x5f3a37,_0x1adbca){return _0x5f3a37[_0x1d99('0xb')]('AnalyticMetric',attributes,{'tableName':_0x1d99('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbacd=['api','moment','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util'];(function(_0x35efd7,_0x5a97e6){var _0x3d9b5d=function(_0x45fa98){while(--_0x45fa98){_0x35efd7['push'](_0x35efd7['shift']());}};_0x3d9b5d(++_0x5a97e6);}(_0xbacd,0x1c5));var _0xdbac=function(_0x44bf2d,_0x47c4b){_0x44bf2d=_0x44bf2d-0x0;var _0x5c793a=_0xbacd[_0x44bf2d];return _0x5c793a;};'use strict';var _=require(_0xdbac('0x0'));var util=require(_0xdbac('0x1'));var logger=require('../../config/logger')(_0xdbac('0x2'));var moment=require(_0xdbac('0x3'));var BPromise=require(_0xdbac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbac('0x5'));var rimraf=require(_0xdbac('0x6'));var config=require(_0xdbac('0x7'));var attributes=require(_0xdbac('0x8'));module[_0xdbac('0x9')]=function(_0x376641,_0x19134a){return _0x376641[_0xdbac('0xa')](_0xdbac('0xb'),attributes,{'tableName':_0xdbac('0xc'),'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 de53e47..e219b44 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 _0xc83a=['jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1b03a5,_0x812ea1){var _0x12d60d=function(_0x336667){while(--_0x336667){_0x1b03a5['push'](_0x1b03a5['shift']());}};_0x12d60d(++_0x812ea1);}(_0xc83a,0x10a));var _0xac83=function(_0x44757b,_0x1133d4){_0x44757b=_0x44757b-0x0;var _0x2e53d6=_0xc83a[_0x44757b];return _0x2e53d6;};'use strict';var _=require(_0xac83('0x0'));var util=require('util');var moment=require(_0xac83('0x1'));var BPromise=require(_0xac83('0x2'));var rs=require(_0xac83('0x3'));var fs=require('fs');var Redis=require(_0xac83('0x4'));var db=require(_0xac83('0x5'))['db'];var utils=require(_0xac83('0x6'));var logger=require(_0xac83('0x7'))(_0xac83('0x8'));var config=require(_0xac83('0x9'));var jayson=require(_0xac83('0xa'));var client=jayson['client'][_0xac83('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1351a2,_0x43a764,_0x442ffb){return new BPromise(function(_0x5c7679,_0x27ec9a){return client[_0xac83('0xc')](_0x1351a2,_0x442ffb)[_0xac83('0xd')](function(_0xc1e695){logger[_0xac83('0xe')](_0xac83('0xf'),_0x43a764,_0xac83('0x10'));logger[_0xac83('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x43a764,_0xac83('0x10'),JSON['stringify'](_0xc1e695));if(_0xc1e695['error']){if(_0xc1e695[_0xac83('0x12')][_0xac83('0x13')]===0x1f4){logger[_0xac83('0x12')](_0xac83('0xf'),_0x43a764,_0xc1e695[_0xac83('0x12')]['message']);return _0x27ec9a(_0xc1e695[_0xac83('0x12')][_0xac83('0x14')]);}logger['error'](_0xac83('0xf'),_0x43a764,_0xc1e695[_0xac83('0x12')][_0xac83('0x14')]);return _0x5c7679(_0xc1e695[_0xac83('0x12')][_0xac83('0x14')]);}else{logger[_0xac83('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x43a764,_0xac83('0x10'));_0x5c7679(_0xc1e695[_0xac83('0x15')][_0xac83('0x14')]);}})[_0xac83('0x16')](function(_0x14ebeb){logger[_0xac83('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x43a764,_0x14ebeb);_0x27ec9a(_0x14ebeb);});});}
\ No newline at end of file
+var _0x738b=['debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x2defb5,_0x1cda14){var _0x229c53=function(_0x5dd408){while(--_0x5dd408){_0x2defb5['push'](_0x2defb5['shift']());}};_0x229c53(++_0x1cda14);}(_0x738b,0x79));var _0xb738=function(_0x3318be,_0x1c7bcd){_0x3318be=_0x3318be-0x0;var _0x1229e4=_0x738b[_0x3318be];return _0x1229e4;};'use strict';var _=require(_0xb738('0x0'));var util=require(_0xb738('0x1'));var moment=require(_0xb738('0x2'));var BPromise=require(_0xb738('0x3'));var rs=require(_0xb738('0x4'));var fs=require('fs');var Redis=require(_0xb738('0x5'));var db=require(_0xb738('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb738('0x7'))(_0xb738('0x8'));var config=require(_0xb738('0x9'));var jayson=require(_0xb738('0xa'));var client=jayson[_0xb738('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bace8,_0x4bd31d,_0x22abd0){return new BPromise(function(_0x4a4e68,_0x480266){return client[_0xb738('0xc')](_0x1bace8,_0x22abd0)[_0xb738('0xd')](function(_0x5b8d47){logger[_0xb738('0xe')](_0xb738('0xf'),_0x4bd31d,_0xb738('0x10'));logger[_0xb738('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x4bd31d,'request\x20sent',JSON[_0xb738('0x12')](_0x5b8d47));if(_0x5b8d47[_0xb738('0x13')]){if(_0x5b8d47['error'][_0xb738('0x14')]===0x1f4){logger[_0xb738('0x13')](_0xb738('0xf'),_0x4bd31d,_0x5b8d47[_0xb738('0x13')][_0xb738('0x15')]);return _0x480266(_0x5b8d47[_0xb738('0x13')][_0xb738('0x15')]);}logger[_0xb738('0x13')](_0xb738('0xf'),_0x4bd31d,_0x5b8d47[_0xb738('0x13')][_0xb738('0x15')]);return _0x4a4e68(_0x5b8d47['error'][_0xb738('0x15')]);}else{logger[_0xb738('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x4bd31d,_0xb738('0x10'));_0x4a4e68(_0x5b8d47[_0xb738('0x16')]['message']);}})['catch'](function(_0x425033){logger[_0xb738('0x13')](_0xb738('0xf'),_0x4bd31d,_0x425033);_0x480266(_0x425033);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 400ace3..4acd3e2 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 _0x37cc=['index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated'];(function(_0x4752d4,_0x350e24){var _0x567af7=function(_0xf245f2){while(--_0xf245f2){_0x4752d4['push'](_0x4752d4['shift']());}};_0x567af7(++_0x350e24);}(_0x37cc,0x185));var _0xc37c=function(_0x474ef8,_0x543bc0){_0x474ef8=_0x474ef8-0x0;var _0x403ed1=_0x37cc[_0x474ef8];return _0x403ed1;};'use strict';var multer=require(_0xc37c('0x0'));var util=require(_0xc37c('0x1'));var path=require(_0xc37c('0x2'));var timeout=require(_0xc37c('0x3'));var express=require(_0xc37c('0x4'));var router=express[_0xc37c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc37c('0x6'));var config=require(_0xc37c('0x7'));var controller=require(_0xc37c('0x8'));router[_0xc37c('0x9')]('/',auth[_0xc37c('0xa')](),controller[_0xc37c('0xb')]);router[_0xc37c('0x9')](_0xc37c('0xc'),auth[_0xc37c('0xa')](),controller['show']);router[_0xc37c('0xd')]('/',auth[_0xc37c('0xa')](),controller[_0xc37c('0xe')]);router[_0xc37c('0xf')](_0xc37c('0xc'),auth['isAuthenticated'](),controller[_0xc37c('0x10')]);router[_0xc37c('0x11')](_0xc37c('0xc'),auth[_0xc37c('0xa')](),controller[_0xc37c('0x12')]);module[_0xc37c('0x13')]=router;
\ No newline at end of file
+var _0x06bf=['Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x5efd08,_0xf901dd){var _0x43f697=function(_0x1de0f1){while(--_0x1de0f1){_0x5efd08['push'](_0x5efd08['shift']());}};_0x43f697(++_0xf901dd);}(_0x06bf,0x105));var _0xf06b=function(_0x571675,_0x1e2bc1){_0x571675=_0x571675-0x0;var _0x48743f=_0x06bf[_0x571675];return _0x48743f;};'use strict';var multer=require(_0xf06b('0x0'));var util=require(_0xf06b('0x1'));var path=require(_0xf06b('0x2'));var timeout=require(_0xf06b('0x3'));var express=require(_0xf06b('0x4'));var router=express[_0xf06b('0x5')]();var fs_extra=require(_0xf06b('0x6'));var auth=require(_0xf06b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf06b('0x8'));var controller=require(_0xf06b('0x9'));router[_0xf06b('0xa')]('/',auth['isAuthenticated'](),controller[_0xf06b('0xb')]);router[_0xf06b('0xa')](_0xf06b('0xc'),auth[_0xf06b('0xd')](),controller['show']);router[_0xf06b('0xe')]('/',auth[_0xf06b('0xd')](),controller['create']);router['put'](_0xf06b('0xc'),auth[_0xf06b('0xd')](),controller[_0xf06b('0xf')]);router[_0xf06b('0x10')](_0xf06b('0xc'),auth[_0xf06b('0xd')](),controller[_0xf06b('0x11')]);module[_0xf06b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index d02867c..55bef11 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 _0xc663=['TEXT'];(function(_0x46cd90,_0x25b41a){var _0x3320b8=function(_0x2ea9f6){while(--_0x2ea9f6){_0x46cd90['push'](_0x46cd90['shift']());}};_0x3320b8(++_0x25b41a);}(_0xc663,0x1ea));var _0x3c66=function(_0x59400c,_0x364897){_0x59400c=_0x59400c-0x0;var _0x51508d=_0xc663[_0x59400c];return _0x51508d;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x3c66('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0x2367=['sequelize','exports','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2367,0x9f));var _0x7236=function(_0x5cabb7,_0xf7fc24){_0x5cabb7=_0x5cabb7-0x0;var _0x4c63b8=_0x2367[_0x5cabb7];return _0x4c63b8;};'use strict';var Sequelize=require(_0x7236('0x0'));module[_0x7236('0x1')]={'tree':{'type':Sequelize[_0x7236('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 2fc5f30..9738b30 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 _0xa9e7=['query','length','nolimit','order','where','filters','pick','filter','includeAll','include','findAll','rows','catch','params','keys','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','intersection','attributes','fields'];(function(_0x53aa46,_0x597524){var _0x5f37f5=function(_0x59b095){while(--_0x59b095){_0x53aa46['push'](_0x53aa46['shift']());}};_0x5f37f5(++_0x597524);}(_0xa9e7,0x185));var _0x7a9e=function(_0x3ff95a,_0x2aeb82){_0x3ff95a=_0x3ff95a-0x0;var _0x172fd5=_0xa9e7[_0x3ff95a];return _0x172fd5;};'use strict';var emlformat=require(_0x7a9e('0x0'));var rimraf=require(_0x7a9e('0x1'));var zipdir=require(_0x7a9e('0x2'));var jsonpatch=require(_0x7a9e('0x3'));var rp=require('request-promise');var moment=require(_0x7a9e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7a9e('0x5'));var util=require(_0x7a9e('0x6'));var path=require(_0x7a9e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7a9e('0x8'));var _=require(_0x7a9e('0x9'));var squel=require(_0x7a9e('0xa'));var crypto=require(_0x7a9e('0xb'));var jsforce=require(_0x7a9e('0xc'));var deskjs=require(_0x7a9e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7a9e('0xe'));var Papa=require(_0x7a9e('0xf'));var Redis=require('ioredis');var authService=require(_0x7a9e('0x10'));var qs=require(_0x7a9e('0x11'));var as=require(_0x7a9e('0x12'));var hardwareService=require(_0x7a9e('0x13'));var logger=require(_0x7a9e('0x14'))(_0x7a9e('0x15'));var utils=require('../../config/utils');var config=require(_0x7a9e('0x16'));var licenseUtil=require(_0x7a9e('0x17'));var db=require(_0x7a9e('0x18'))['db'];function respondWithStatusCode(_0xd88a5a,_0x35a1fb){_0x35a1fb=_0x35a1fb||0xcc;return function(_0x575248){if(_0x575248){return _0xd88a5a[_0x7a9e('0x19')](_0x35a1fb);}return _0xd88a5a['status'](_0x35a1fb)[_0x7a9e('0x1a')]();};}function respondWithResult(_0x19d33e,_0x5039e2){_0x5039e2=_0x5039e2||0xc8;return function(_0x5b7f91){if(_0x5b7f91){return _0x19d33e[_0x7a9e('0x1b')](_0x5039e2)[_0x7a9e('0x1c')](_0x5b7f91);}};}function respondWithFilteredResult(_0xcfc2c3,_0x122ba8){return function(_0x496078){if(_0x496078){var _0x35ca55=typeof _0x122ba8[_0x7a9e('0x1d')]===_0x7a9e('0x1e')&&typeof _0x122ba8[_0x7a9e('0x1f')]===_0x7a9e('0x1e');var _0x262b8f=_0x496078[_0x7a9e('0x20')];var _0xba9b1=_0x35ca55?0x0:_0x122ba8['offset'];var _0x483be8=_0x35ca55?_0x496078[_0x7a9e('0x20')]:_0x122ba8[_0x7a9e('0x1d')]+_0x122ba8[_0x7a9e('0x1f')];var _0x285383;if(_0x483be8>=_0x262b8f){_0x483be8=_0x262b8f;_0x285383=0xc8;}else{_0x285383=0xce;}_0xcfc2c3[_0x7a9e('0x1b')](_0x285383);return _0xcfc2c3[_0x7a9e('0x21')](_0x7a9e('0x22'),_0xba9b1+'-'+_0x483be8+'/'+_0x262b8f)['json'](_0x496078);}return null;};}function patchUpdates(_0x51aa59){return function(_0x2dad2f){try{jsonpatch[_0x7a9e('0x23')](_0x2dad2f,_0x51aa59,!![]);}catch(_0x252450){return BPromise[_0x7a9e('0x24')](_0x252450);}return _0x2dad2f[_0x7a9e('0x25')]();};}function saveUpdates(_0x58ebf7,_0x422506){return function(_0x5cd019){if(_0x5cd019){return _0x5cd019['update'](_0x58ebf7)[_0x7a9e('0x26')](function(_0x1c289c){return _0x1c289c;});}return null;};}function removeEntity(_0x34a89a,_0x2bbc51){return function(_0x23d40a){if(_0x23d40a){return _0x23d40a[_0x7a9e('0x27')]()[_0x7a9e('0x26')](function(){_0x34a89a['status'](0xcc)[_0x7a9e('0x1a')]();});}};}function handleEntityNotFound(_0x2aca80,_0x1744b3){return function(_0x274a04){if(!_0x274a04){_0x2aca80[_0x7a9e('0x19')](0x194);}return _0x274a04;};}function handleError(_0x102e66,_0x3bf0bd){_0x3bf0bd=_0x3bf0bd||0x1f4;return function(_0x53e2a6){logger[_0x7a9e('0x28')](_0x53e2a6[_0x7a9e('0x29')]);if(_0x53e2a6[_0x7a9e('0x2a')]){delete _0x53e2a6[_0x7a9e('0x2a')];}_0x102e66[_0x7a9e('0x1b')](_0x3bf0bd)[_0x7a9e('0x2b')](_0x53e2a6);};}exports[_0x7a9e('0x2c')]=function(_0x472094,_0x530d4d){var _0x281068={},_0x415d4c={},_0x258270={'count':0x0,'rows':[]};var _0x16a1ca=_['map'](db[_0x7a9e('0x2d')][_0x7a9e('0x2e')],function(_0x17ef91){return{'name':_0x17ef91[_0x7a9e('0x2f')],'type':_0x17ef91[_0x7a9e('0x30')][_0x7a9e('0x31')]};});_0x415d4c[_0x7a9e('0x32')]=_[_0x7a9e('0x33')](_0x16a1ca,_0x7a9e('0x2a'));_0x415d4c['query']=_['keys'](_0x472094['query']);_0x415d4c['filters']=_[_0x7a9e('0x34')](_0x415d4c[_0x7a9e('0x32')],_0x415d4c['query']);_0x281068[_0x7a9e('0x35')]=_[_0x7a9e('0x34')](_0x415d4c[_0x7a9e('0x32')],qs[_0x7a9e('0x36')](_0x472094[_0x7a9e('0x37')]['fields']));_0x281068['attributes']=_0x281068[_0x7a9e('0x35')][_0x7a9e('0x38')]?_0x281068[_0x7a9e('0x35')]:_0x415d4c['model'];if(!_0x472094[_0x7a9e('0x37')]['hasOwnProperty'](_0x7a9e('0x39'))){_0x281068['limit']=qs[_0x7a9e('0x1f')](_0x472094[_0x7a9e('0x37')][_0x7a9e('0x1f')]);_0x281068['offset']=qs[_0x7a9e('0x1d')](_0x472094['query'][_0x7a9e('0x1d')]);}_0x281068[_0x7a9e('0x3a')]=qs['sort'](_0x472094['query']['sort']);_0x281068[_0x7a9e('0x3b')]=qs[_0x7a9e('0x3c')](_[_0x7a9e('0x3d')](_0x472094[_0x7a9e('0x37')],_0x415d4c[_0x7a9e('0x3c')]),_0x16a1ca);if(_0x472094['query']['filter']){_0x281068[_0x7a9e('0x3b')]=_['merge'](_0x281068['where'],{'$or':_[_0x7a9e('0x33')](_0x16a1ca,function(_0x23df03){if(_0x23df03['type']!=='VIRTUAL'){var _0x17b49a={};_0x17b49a[_0x23df03[_0x7a9e('0x2a')]]={'$like':'%'+_0x472094['query'][_0x7a9e('0x3e')]+'%'};return _0x17b49a;}})});}_0x281068=_['merge']({},_0x281068,_0x472094['options']);var _0x564ab8={'where':_0x281068[_0x7a9e('0x3b')]};return db['AnalyticTreeReport']['count'](_0x564ab8)['then'](function(_0x179e0b){_0x258270[_0x7a9e('0x20')]=_0x179e0b;if(_0x472094[_0x7a9e('0x37')][_0x7a9e('0x3f')]){_0x281068[_0x7a9e('0x40')]=[{'all':!![]}];}return db[_0x7a9e('0x2d')][_0x7a9e('0x41')](_0x281068);})[_0x7a9e('0x26')](function(_0x488561){_0x258270[_0x7a9e('0x42')]=_0x488561;return _0x258270;})[_0x7a9e('0x26')](respondWithFilteredResult(_0x530d4d,_0x281068))[_0x7a9e('0x43')](handleError(_0x530d4d,null));};exports['show']=function(_0x12f378,_0x27cccd){var _0x529e35={'raw':!![],'where':{'id':_0x12f378[_0x7a9e('0x44')]['id']}},_0x34b3e8={};_0x34b3e8[_0x7a9e('0x32')]=_[_0x7a9e('0x45')](db['AnalyticTreeReport'][_0x7a9e('0x2e')]);_0x34b3e8[_0x7a9e('0x37')]=_[_0x7a9e('0x45')](_0x12f378[_0x7a9e('0x37')]);_0x34b3e8[_0x7a9e('0x3c')]=_[_0x7a9e('0x34')](_0x34b3e8[_0x7a9e('0x32')],_0x34b3e8[_0x7a9e('0x37')]);_0x529e35[_0x7a9e('0x35')]=_[_0x7a9e('0x34')](_0x34b3e8[_0x7a9e('0x32')],qs[_0x7a9e('0x36')](_0x12f378[_0x7a9e('0x37')]['fields']));_0x529e35[_0x7a9e('0x35')]=_0x529e35[_0x7a9e('0x35')][_0x7a9e('0x38')]?_0x529e35[_0x7a9e('0x35')]:_0x34b3e8['model'];if(_0x12f378[_0x7a9e('0x37')][_0x7a9e('0x3f')]){_0x529e35[_0x7a9e('0x40')]=[{'all':!![]}];}_0x529e35=_['merge']({},_0x529e35,_0x12f378['options']);return db['AnalyticTreeReport'][_0x7a9e('0x46')](_0x529e35)[_0x7a9e('0x26')](handleEntityNotFound(_0x27cccd,null))[_0x7a9e('0x26')](respondWithResult(_0x27cccd,null))[_0x7a9e('0x43')](handleError(_0x27cccd,null));};exports[_0x7a9e('0x47')]=function(_0x235e3,_0x2b5c32){return db['AnalyticTreeReport'][_0x7a9e('0x47')](_0x235e3[_0x7a9e('0x48')],{})[_0x7a9e('0x26')](respondWithResult(_0x2b5c32,0xc9))['catch'](handleError(_0x2b5c32,null));};exports[_0x7a9e('0x49')]=function(_0x2966a2,_0x3498e1){if(_0x2966a2[_0x7a9e('0x48')]['id']){delete _0x2966a2['body']['id'];}return db[_0x7a9e('0x2d')][_0x7a9e('0x46')]({'where':{'id':_0x2966a2[_0x7a9e('0x44')]['id']}})[_0x7a9e('0x26')](handleEntityNotFound(_0x3498e1,null))['then'](saveUpdates(_0x2966a2['body'],null))['then'](respondWithResult(_0x3498e1,null))['catch'](handleError(_0x3498e1,null));};exports[_0x7a9e('0x27')]=function(_0x1d6c20,_0x2ea9e0){return db[_0x7a9e('0x2d')]['find']({'where':{'id':_0x1d6c20[_0x7a9e('0x44')]['id']}})[_0x7a9e('0x26')](handleEntityNotFound(_0x2ea9e0,null))[_0x7a9e('0x26')](removeEntity(_0x2ea9e0,null))[_0x7a9e('0x43')](handleError(_0x2ea9e0,null));};
\ No newline at end of file
+var _0x17f7=['rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','map','AnalyticTreeReport'];(function(_0x4b6cc8,_0x355e5b){var _0x5c4743=function(_0x68d0f6){while(--_0x68d0f6){_0x4b6cc8['push'](_0x4b6cc8['shift']());}};_0x5c4743(++_0x355e5b);}(_0x17f7,0xb3));var _0x717f=function(_0x10ffa7,_0x16f24a){_0x10ffa7=_0x10ffa7-0x0;var _0x2bd7a1=_0x17f7[_0x10ffa7];return _0x2bd7a1;};'use strict';var emlformat=require(_0x717f('0x0'));var rimraf=require(_0x717f('0x1'));var zipdir=require(_0x717f('0x2'));var jsonpatch=require(_0x717f('0x3'));var rp=require('request-promise');var moment=require(_0x717f('0x4'));var BPromise=require(_0x717f('0x5'));var Mustache=require('mustache');var util=require(_0x717f('0x6'));var path=require(_0x717f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x717f('0x8'));var fs=require('fs');var fs_extra=require(_0x717f('0x9'));var _=require('lodash');var squel=require(_0x717f('0xa'));var crypto=require('crypto');var jsforce=require(_0x717f('0xb'));var deskjs=require(_0x717f('0xc'));var toCsv=require(_0x717f('0xd'));var querystring=require(_0x717f('0xe'));var Papa=require(_0x717f('0xf'));var Redis=require(_0x717f('0x10'));var authService=require(_0x717f('0x11'));var qs=require(_0x717f('0x12'));var as=require(_0x717f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x717f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x717f('0x15'));var db=require(_0x717f('0x16'))['db'];function respondWithStatusCode(_0x24a034,_0x1bd659){_0x1bd659=_0x1bd659||0xcc;return function(_0x395225){if(_0x395225){return _0x24a034[_0x717f('0x17')](_0x1bd659);}return _0x24a034[_0x717f('0x18')](_0x1bd659)[_0x717f('0x19')]();};}function respondWithResult(_0x3963ea,_0x1fd2d1){_0x1fd2d1=_0x1fd2d1||0xc8;return function(_0x244c8a){if(_0x244c8a){return _0x3963ea[_0x717f('0x18')](_0x1fd2d1)['json'](_0x244c8a);}};}function respondWithFilteredResult(_0x2925b8,_0xa9f875){return function(_0x4f79e1){if(_0x4f79e1){var _0x2509b4=typeof _0xa9f875['offset']==='undefined'&&typeof _0xa9f875[_0x717f('0x1a')]===_0x717f('0x1b');var _0x65dab1=_0x4f79e1[_0x717f('0x1c')];var _0x2dbdc5=_0x2509b4?0x0:_0xa9f875[_0x717f('0x1d')];var _0x3f0731=_0x2509b4?_0x4f79e1['count']:_0xa9f875[_0x717f('0x1d')]+_0xa9f875['limit'];var _0x4971dc;if(_0x3f0731>=_0x65dab1){_0x3f0731=_0x65dab1;_0x4971dc=0xc8;}else{_0x4971dc=0xce;}_0x2925b8[_0x717f('0x18')](_0x4971dc);return _0x2925b8['set'](_0x717f('0x1e'),_0x2dbdc5+'-'+_0x3f0731+'/'+_0x65dab1)[_0x717f('0x1f')](_0x4f79e1);}return null;};}function patchUpdates(_0x51e3ba){return function(_0x4f89f1){try{jsonpatch[_0x717f('0x20')](_0x4f89f1,_0x51e3ba,!![]);}catch(_0x2980ff){return BPromise[_0x717f('0x21')](_0x2980ff);}return _0x4f89f1['save']();};}function saveUpdates(_0x54dadd,_0x2c5e93){return function(_0x319fe1){if(_0x319fe1){return _0x319fe1[_0x717f('0x22')](_0x54dadd)[_0x717f('0x23')](function(_0xbecce){return _0xbecce;});}return null;};}function removeEntity(_0x492f55,_0x4727d5){return function(_0x36157f){if(_0x36157f){return _0x36157f[_0x717f('0x24')]()[_0x717f('0x23')](function(){_0x492f55[_0x717f('0x18')](0xcc)[_0x717f('0x19')]();});}};}function handleEntityNotFound(_0x504efc,_0x44676d){return function(_0x30a7f3){if(!_0x30a7f3){_0x504efc[_0x717f('0x17')](0x194);}return _0x30a7f3;};}function handleError(_0x305598,_0xe99596){_0xe99596=_0xe99596||0x1f4;return function(_0xba09d1){logger[_0x717f('0x25')](_0xba09d1[_0x717f('0x26')]);if(_0xba09d1[_0x717f('0x27')]){delete _0xba09d1[_0x717f('0x27')];}_0x305598[_0x717f('0x18')](_0xe99596)[_0x717f('0x28')](_0xba09d1);};}exports['index']=function(_0x56b91e,_0xbbc317){var _0x3ee693={},_0x96da61={},_0xfb12b5={'count':0x0,'rows':[]};var _0x2f455c=_[_0x717f('0x29')](db[_0x717f('0x2a')][_0x717f('0x2b')],function(_0x474e10){return{'name':_0x474e10[_0x717f('0x2c')],'type':_0x474e10[_0x717f('0x2d')][_0x717f('0x2e')]};});_0x96da61['model']=_[_0x717f('0x29')](_0x2f455c,_0x717f('0x27'));_0x96da61[_0x717f('0x2f')]=_[_0x717f('0x30')](_0x56b91e[_0x717f('0x2f')]);_0x96da61['filters']=_[_0x717f('0x31')](_0x96da61['model'],_0x96da61[_0x717f('0x2f')]);_0x3ee693[_0x717f('0x32')]=_['intersection'](_0x96da61[_0x717f('0x33')],qs['fields'](_0x56b91e[_0x717f('0x2f')][_0x717f('0x34')]));_0x3ee693[_0x717f('0x32')]=_0x3ee693[_0x717f('0x32')][_0x717f('0x35')]?_0x3ee693['attributes']:_0x96da61['model'];if(!_0x56b91e[_0x717f('0x2f')][_0x717f('0x36')](_0x717f('0x37'))){_0x3ee693[_0x717f('0x1a')]=qs[_0x717f('0x1a')](_0x56b91e['query']['limit']);_0x3ee693[_0x717f('0x1d')]=qs[_0x717f('0x1d')](_0x56b91e[_0x717f('0x2f')][_0x717f('0x1d')]);}_0x3ee693[_0x717f('0x38')]=qs['sort'](_0x56b91e['query'][_0x717f('0x39')]);_0x3ee693[_0x717f('0x3a')]=qs[_0x717f('0x3b')](_[_0x717f('0x3c')](_0x56b91e[_0x717f('0x2f')],_0x96da61[_0x717f('0x3b')]),_0x2f455c);if(_0x56b91e[_0x717f('0x2f')][_0x717f('0x3d')]){_0x3ee693[_0x717f('0x3a')]=_['merge'](_0x3ee693[_0x717f('0x3a')],{'$or':_[_0x717f('0x29')](_0x2f455c,function(_0x410533){if(_0x410533[_0x717f('0x2d')]!==_0x717f('0x3e')){var _0x11dab3={};_0x11dab3[_0x410533[_0x717f('0x27')]]={'$like':'%'+_0x56b91e[_0x717f('0x2f')][_0x717f('0x3d')]+'%'};return _0x11dab3;}})});}_0x3ee693=_[_0x717f('0x3f')]({},_0x3ee693,_0x56b91e[_0x717f('0x40')]);var _0x26e2f9={'where':_0x3ee693['where']};return db[_0x717f('0x2a')]['count'](_0x26e2f9)[_0x717f('0x23')](function(_0x4e79e8){_0xfb12b5[_0x717f('0x1c')]=_0x4e79e8;if(_0x56b91e['query']['includeAll']){_0x3ee693[_0x717f('0x41')]=[{'all':!![]}];}return db[_0x717f('0x2a')][_0x717f('0x42')](_0x3ee693);})['then'](function(_0x4743c4){_0xfb12b5[_0x717f('0x43')]=_0x4743c4;return _0xfb12b5;})[_0x717f('0x23')](respondWithFilteredResult(_0xbbc317,_0x3ee693))['catch'](handleError(_0xbbc317,null));};exports[_0x717f('0x44')]=function(_0x44bd0,_0x598628){var _0x1c7860={'raw':!![],'where':{'id':_0x44bd0[_0x717f('0x45')]['id']}},_0x1a0601={};_0x1a0601[_0x717f('0x33')]=_[_0x717f('0x30')](db['AnalyticTreeReport'][_0x717f('0x2b')]);_0x1a0601[_0x717f('0x2f')]=_[_0x717f('0x30')](_0x44bd0[_0x717f('0x2f')]);_0x1a0601[_0x717f('0x3b')]=_['intersection'](_0x1a0601['model'],_0x1a0601[_0x717f('0x2f')]);_0x1c7860['attributes']=_['intersection'](_0x1a0601[_0x717f('0x33')],qs['fields'](_0x44bd0[_0x717f('0x2f')][_0x717f('0x34')]));_0x1c7860[_0x717f('0x32')]=_0x1c7860[_0x717f('0x32')][_0x717f('0x35')]?_0x1c7860['attributes']:_0x1a0601['model'];if(_0x44bd0['query']['includeAll']){_0x1c7860[_0x717f('0x41')]=[{'all':!![]}];}_0x1c7860=_[_0x717f('0x3f')]({},_0x1c7860,_0x44bd0[_0x717f('0x40')]);return db[_0x717f('0x2a')][_0x717f('0x46')](_0x1c7860)[_0x717f('0x23')](handleEntityNotFound(_0x598628,null))[_0x717f('0x23')](respondWithResult(_0x598628,null))['catch'](handleError(_0x598628,null));};exports[_0x717f('0x47')]=function(_0x52ddc7,_0x389595){return db[_0x717f('0x2a')]['create'](_0x52ddc7[_0x717f('0x48')],{})[_0x717f('0x23')](respondWithResult(_0x389595,0xc9))[_0x717f('0x49')](handleError(_0x389595,null));};exports[_0x717f('0x22')]=function(_0x21e565,_0x4dbc3a){if(_0x21e565[_0x717f('0x48')]['id']){delete _0x21e565[_0x717f('0x48')]['id'];}return db[_0x717f('0x2a')][_0x717f('0x46')]({'where':{'id':_0x21e565[_0x717f('0x45')]['id']}})[_0x717f('0x23')](handleEntityNotFound(_0x4dbc3a,null))['then'](saveUpdates(_0x21e565[_0x717f('0x48')],null))[_0x717f('0x23')](respondWithResult(_0x4dbc3a,null))[_0x717f('0x49')](handleError(_0x4dbc3a,null));};exports[_0x717f('0x24')]=function(_0x3652fa,_0x38eb1f){return db[_0x717f('0x2a')]['find']({'where':{'id':_0x3652fa[_0x717f('0x45')]['id']}})[_0x717f('0x23')](handleEntityNotFound(_0x38eb1f,null))[_0x717f('0x23')](removeEntity(_0x38eb1f,null))[_0x717f('0x49')](handleError(_0x38eb1f,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index ed99622..f4fe575 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 _0xfb78=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x21cb9b,_0x5a2407){var _0x13a6fd=function(_0x1ff1da){while(--_0x1ff1da){_0x21cb9b['push'](_0x21cb9b['shift']());}};_0x13a6fd(++_0x5a2407);}(_0xfb78,0x8d));var _0x8fb7=function(_0x44044a,_0x3a0097){_0x44044a=_0x44044a-0x0;var _0x43bb6e=_0xfb78[_0x44044a];return _0x43bb6e;};'use strict';var _=require(_0x8fb7('0x0'));var util=require(_0x8fb7('0x1'));var logger=require(_0x8fb7('0x2'))(_0x8fb7('0x3'));var moment=require(_0x8fb7('0x4'));var BPromise=require(_0x8fb7('0x5'));var rp=require(_0x8fb7('0x6'));var fs=require('fs');var path=require(_0x8fb7('0x7'));var rimraf=require(_0x8fb7('0x8'));var config=require(_0x8fb7('0x9'));var attributes=require(_0x8fb7('0xa'));module[_0x8fb7('0xb')]=function(_0x38ce80,_0x5b8834){return _0x38ce80[_0x8fb7('0xc')](_0x8fb7('0xd'),attributes,{'tableName':_0x8fb7('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcbd7=['path','../../config/environment','exports','define','AnalyticTreeReport','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3cfb0d,_0x4df584){var _0x3486b4=function(_0x1b0939){while(--_0x1b0939){_0x3cfb0d['push'](_0x3cfb0d['shift']());}};_0x3486b4(++_0x4df584);}(_0xcbd7,0x1c8));var _0x7cbd=function(_0x54810f,_0x6da227){_0x54810f=_0x54810f-0x0;var _0x3e04fa=_0xcbd7[_0x54810f];return _0x3e04fa;};'use strict';var _=require(_0x7cbd('0x0'));var util=require('util');var logger=require(_0x7cbd('0x1'))(_0x7cbd('0x2'));var moment=require(_0x7cbd('0x3'));var BPromise=require(_0x7cbd('0x4'));var rp=require(_0x7cbd('0x5'));var fs=require('fs');var path=require(_0x7cbd('0x6'));var rimraf=require('rimraf');var config=require(_0x7cbd('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0x7cbd('0x8')]=function(_0x19f53d,_0x5760d4){return _0x19f53d[_0x7cbd('0x9')](_0x7cbd('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index ddb4757..1ad0e75 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x493049,_0x15e22d){var _0x10c1c7=function(_0x15d34e){while(--_0x15d34e){_0x493049['push'](_0x493049['shift']());}};_0x10c1c7(++_0x15e22d);}(_0x1261,0x144));var _0x1126=function(_0x57dc85,_0x3a6d51){_0x57dc85=_0x57dc85-0x0;var _0x563a2e=_0x1261[_0x57dc85];return _0x563a2e;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x38b9eb,_0x298f2f){var _0x1426da=function(_0xbad634){while(--_0xbad634){_0x38b9eb['push'](_0x38b9eb['shift']());}};_0x1426da(++_0x298f2f);}(_0x2ef3,0xba));var _0x32ef=function(_0x3fcc36,_0x10fb08){_0x3fcc36=_0x3fcc36-0x0;var _0x2adc58=_0x2ef3[_0x3fcc36];return _0x2adc58;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 71711e8..ab1d915 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 _0xe040=['post','create','put','update','delete','destroy','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xe040,0x1af));var _0x0e04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe040[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0e04('0x0'));var timeout=require('connect-timeout');var express=require(_0x0e04('0x1'));var router=express[_0x0e04('0x2')]();var fs_extra=require(_0x0e04('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0e04('0x4'));var config=require(_0x0e04('0x5'));var controller=require(_0x0e04('0x6'));router[_0x0e04('0x7')]('/',auth[_0x0e04('0x8')](),controller['index']);router[_0x0e04('0x7')](_0x0e04('0x9'),auth[_0x0e04('0x8')](),controller[_0x0e04('0xa')]);router[_0x0e04('0xb')]('/',auth[_0x0e04('0x8')](),controller[_0x0e04('0xc')]);router[_0x0e04('0xd')](_0x0e04('0x9'),auth['isAuthenticated'](),controller[_0x0e04('0xe')]);router[_0x0e04('0xf')](_0x0e04('0x9'),auth[_0x0e04('0x8')](),controller[_0x0e04('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x120d=['create','delete','destroy','exports','express','../../config/environment','get','isAuthenticated','index','/:id','post'];(function(_0x49052b,_0x3ba709){var _0x48c045=function(_0x41ac38){while(--_0x41ac38){_0x49052b['push'](_0x49052b['shift']());}};_0x48c045(++_0x3ba709);}(_0x120d,0x1a6));var _0xd120=function(_0x28b4cd,_0x573ff1){_0x28b4cd=_0x28b4cd-0x0;var _0x4229cc=_0x120d[_0x28b4cd];return _0x4229cc;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd120('0x0'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd120('0x1'));var controller=require('./analyticTreeReport.controller');router[_0xd120('0x2')]('/',auth[_0xd120('0x3')](),controller[_0xd120('0x4')]);router[_0xd120('0x2')](_0xd120('0x5'),auth[_0xd120('0x3')](),controller['show']);router[_0xd120('0x6')]('/',auth[_0xd120('0x3')](),controller[_0xd120('0x7')]);router['put'](_0xd120('0x5'),auth[_0xd120('0x3')](),controller['update']);router[_0xd120('0x8')](_0xd120('0x5'),auth['isAuthenticated'](),controller[_0xd120('0x9')]);module[_0xd120('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index fb61029..a47a289 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 _0xeb79=['STRING'];(function(_0x14b004,_0x297060){var _0x3d501f=function(_0x4a38ac){while(--_0x4a38ac){_0x14b004['push'](_0x14b004['shift']());}};_0x3d501f(++_0x297060);}(_0xeb79,0x87));var _0x9eb7=function(_0x11d10f,_0x275d65){_0x11d10f=_0x11d10f-0x0;var _0x4f3a86=_0xeb79[_0x11d10f];return _0x4f3a86;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9eb7('0x0')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9eb7('0x0')]}};
\ No newline at end of file
+var _0xa3e6=['sequelize','STRING'];(function(_0x47a41f,_0x48d92b){var _0x2411f5=function(_0x3f5b72){while(--_0x3f5b72){_0x47a41f['push'](_0x47a41f['shift']());}};_0x2411f5(++_0x48d92b);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x5130dc,_0x1901d5){_0x5130dc=_0x5130dc-0x0;var _0x145729=_0xa3e6[_0x5130dc];return _0x145729;};'use strict';var Sequelize=require(_0x6a3e('0x0'));module['exports']={'name':{'type':Sequelize[_0x6a3e('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6a3e('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 291e96d..a5f93f4 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 _0x2f31=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','then','end','error','stack','name','send','index','Attachment','rawAttributes','fieldName','key','model','map','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','options','get','updatedAt','omit','body','createdAt','update','find','params','create','file','originalname','basename','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x2f31,0x100));var _0x12f3=function(_0x58404e,_0x179d39){_0x58404e=_0x58404e-0x0;var _0x436571=_0x2f31[_0x58404e];return _0x436571;};'use strict';var emlformat=require(_0x12f3('0x0'));var rimraf=require(_0x12f3('0x1'));var zipdir=require(_0x12f3('0x2'));var jsonpatch=require(_0x12f3('0x3'));var rp=require(_0x12f3('0x4'));var moment=require(_0x12f3('0x5'));var BPromise=require(_0x12f3('0x6'));var Mustache=require(_0x12f3('0x7'));var util=require('util');var path=require(_0x12f3('0x8'));var sox=require(_0x12f3('0x9'));var csv=require(_0x12f3('0xa'));var ejs=require(_0x12f3('0xb'));var fs=require('fs');var fs_extra=require(_0x12f3('0xc'));var _=require(_0x12f3('0xd'));var squel=require('squel');var crypto=require(_0x12f3('0xe'));var jsforce=require(_0x12f3('0xf'));var deskjs=require(_0x12f3('0x10'));var toCsv=require(_0x12f3('0xa'));var querystring=require(_0x12f3('0x11'));var Papa=require(_0x12f3('0x12'));var Redis=require(_0x12f3('0x13'));var authService=require(_0x12f3('0x14'));var qs=require(_0x12f3('0x15'));var as=require(_0x12f3('0x16'));var hardwareService=require(_0x12f3('0x17'));var logger=require(_0x12f3('0x18'))(_0x12f3('0x19'));var utils=require(_0x12f3('0x1a'));var config=require(_0x12f3('0x1b'));var licenseUtil=require(_0x12f3('0x1c'));var db=require(_0x12f3('0x1d'))['db'];function respondWithStatusCode(_0x486961,_0x193461){_0x193461=_0x193461||0xcc;return function(_0x1e5f63){if(_0x1e5f63){return _0x486961[_0x12f3('0x1e')](_0x193461);}return _0x486961[_0x12f3('0x1f')](_0x193461)['end']();};}function respondWithResult(_0x2685d6,_0x2d5722){_0x2d5722=_0x2d5722||0xc8;return function(_0x582b8e){if(_0x582b8e){return _0x2685d6[_0x12f3('0x1f')](_0x2d5722)['json'](_0x582b8e);}};}function respondWithFilteredResult(_0x1e6788,_0x2fd376){return function(_0x431806){if(_0x431806){var _0x5aba51=typeof _0x2fd376[_0x12f3('0x20')]==='undefined'&&typeof _0x2fd376['limit']===_0x12f3('0x21');var _0x2a6aef=_0x431806[_0x12f3('0x22')];var _0x1a7ab0=_0x5aba51?0x0:_0x2fd376[_0x12f3('0x20')];var _0x253ab8=_0x5aba51?_0x431806[_0x12f3('0x22')]:_0x2fd376[_0x12f3('0x20')]+_0x2fd376[_0x12f3('0x23')];var _0x1dfd79;if(_0x253ab8>=_0x2a6aef){_0x253ab8=_0x2a6aef;_0x1dfd79=0xc8;}else{_0x1dfd79=0xce;}_0x1e6788[_0x12f3('0x1f')](_0x1dfd79);return _0x1e6788[_0x12f3('0x24')](_0x12f3('0x25'),_0x1a7ab0+'-'+_0x253ab8+'/'+_0x2a6aef)['json'](_0x431806);}return null;};}function patchUpdates(_0x56f3ae){return function(_0x4b7df3){try{jsonpatch[_0x12f3('0x26')](_0x4b7df3,_0x56f3ae,!![]);}catch(_0x20b50b){return BPromise[_0x12f3('0x27')](_0x20b50b);}return _0x4b7df3['save']();};}function saveUpdates(_0x14d297,_0x17fadc){return function(_0x3b378a){if(_0x3b378a){return _0x3b378a['update'](_0x14d297)['then'](function(_0x5ed878){return _0x5ed878;});}return null;};}function removeEntity(_0x5ca832,_0x28a13b){return function(_0x3ef402){if(_0x3ef402){return _0x3ef402['destroy']()[_0x12f3('0x28')](function(){_0x5ca832['status'](0xcc)[_0x12f3('0x29')]();});}};}function handleEntityNotFound(_0x465e9d,_0x1ade23){return function(_0x18807b){if(!_0x18807b){_0x465e9d['sendStatus'](0x194);}return _0x18807b;};}function handleError(_0x4c11fb,_0x21bc2e){_0x21bc2e=_0x21bc2e||0x1f4;return function(_0x1c73b8){logger[_0x12f3('0x2a')](_0x1c73b8[_0x12f3('0x2b')]);if(_0x1c73b8[_0x12f3('0x2c')]){delete _0x1c73b8[_0x12f3('0x2c')];}_0x4c11fb[_0x12f3('0x1f')](_0x21bc2e)[_0x12f3('0x2d')](_0x1c73b8);};}exports[_0x12f3('0x2e')]=function(_0x115e98,_0x3cbee1){var _0xcf00f5={},_0x231e33={},_0x352f77={'count':0x0,'rows':[]};var _0x156fb4=_['map'](db[_0x12f3('0x2f')][_0x12f3('0x30')],function(_0x3a8d68){return{'name':_0x3a8d68[_0x12f3('0x31')],'type':_0x3a8d68['type'][_0x12f3('0x32')]};});_0x231e33[_0x12f3('0x33')]=_[_0x12f3('0x34')](_0x156fb4,_0x12f3('0x2c'));_0x231e33['query']=_[_0x12f3('0x35')](_0x115e98['query']);_0x231e33[_0x12f3('0x36')]=_[_0x12f3('0x37')](_0x231e33['model'],_0x231e33[_0x12f3('0x38')]);_0xcf00f5['attributes']=_[_0x12f3('0x37')](_0x231e33[_0x12f3('0x33')],qs[_0x12f3('0x39')](_0x115e98[_0x12f3('0x38')][_0x12f3('0x39')]));_0xcf00f5[_0x12f3('0x3a')]=_0xcf00f5['attributes'][_0x12f3('0x3b')]?_0xcf00f5[_0x12f3('0x3a')]:_0x231e33[_0x12f3('0x33')];if(!_0x115e98[_0x12f3('0x38')][_0x12f3('0x3c')]('nolimit')){_0xcf00f5[_0x12f3('0x23')]=qs[_0x12f3('0x23')](_0x115e98[_0x12f3('0x38')][_0x12f3('0x23')]);_0xcf00f5['offset']=qs[_0x12f3('0x20')](_0x115e98[_0x12f3('0x38')][_0x12f3('0x20')]);}_0xcf00f5[_0x12f3('0x3d')]=qs[_0x12f3('0x3e')](_0x115e98[_0x12f3('0x38')][_0x12f3('0x3e')]);_0xcf00f5[_0x12f3('0x3f')]=qs['filters'](_['pick'](_0x115e98[_0x12f3('0x38')],_0x231e33[_0x12f3('0x36')]),_0x156fb4);if(_0x115e98[_0x12f3('0x38')]['filter']){_0xcf00f5[_0x12f3('0x3f')]=_[_0x12f3('0x40')](_0xcf00f5[_0x12f3('0x3f')],{'$or':_[_0x12f3('0x34')](_0x156fb4,function(_0x41cc9d){if(_0x41cc9d[_0x12f3('0x41')]!==_0x12f3('0x42')){var _0xefa749={};_0xefa749[_0x41cc9d['name']]={'$like':'%'+_0x115e98[_0x12f3('0x38')][_0x12f3('0x43')]+'%'};return _0xefa749;}})});}_0xcf00f5=_['merge']({},_0xcf00f5,_0x115e98['options']);var _0x28e32a={'where':_0xcf00f5[_0x12f3('0x3f')]};return db[_0x12f3('0x2f')][_0x12f3('0x22')](_0x28e32a)[_0x12f3('0x28')](function(_0x388fad){_0x352f77[_0x12f3('0x22')]=_0x388fad;if(_0x115e98[_0x12f3('0x38')][_0x12f3('0x44')]){_0xcf00f5[_0x12f3('0x45')]=[{'all':!![]}];}return db[_0x12f3('0x2f')]['findAll'](_0xcf00f5);})[_0x12f3('0x28')](function(_0x5d0867){_0x352f77[_0x12f3('0x46')]=_0x5d0867;return _0x352f77;})[_0x12f3('0x28')](respondWithFilteredResult(_0x3cbee1,_0xcf00f5))[_0x12f3('0x47')](handleError(_0x3cbee1,null));};exports[_0x12f3('0x48')]=function(_0xd5dea7,_0x400fcb){var _0x498ac2={'raw':!![],'where':{'id':_0xd5dea7['params']['id']}},_0x57cfcb={};_0x57cfcb['model']=_[_0x12f3('0x35')](db['Attachment'][_0x12f3('0x30')]);_0x57cfcb['query']=_[_0x12f3('0x35')](_0xd5dea7[_0x12f3('0x38')]);_0x57cfcb[_0x12f3('0x36')]=_[_0x12f3('0x37')](_0x57cfcb[_0x12f3('0x33')],_0x57cfcb[_0x12f3('0x38')]);_0x498ac2[_0x12f3('0x3a')]=_[_0x12f3('0x37')](_0x57cfcb['model'],qs['fields'](_0xd5dea7[_0x12f3('0x38')][_0x12f3('0x39')]));_0x498ac2['attributes']=_0x498ac2[_0x12f3('0x3a')]['length']?_0x498ac2[_0x12f3('0x3a')]:_0x57cfcb['model'];if(_0xd5dea7[_0x12f3('0x38')][_0x12f3('0x44')]){_0x498ac2[_0x12f3('0x45')]=[{'all':!![]}];}_0x498ac2=_[_0x12f3('0x40')]({},_0x498ac2,_0xd5dea7['options']);return db['Attachment']['find'](_0x498ac2)[_0x12f3('0x28')](handleEntityNotFound(_0x400fcb,null))[_0x12f3('0x28')](respondWithResult(_0x400fcb,null))[_0x12f3('0x47')](handleError(_0x400fcb,null));};exports['clone']=function(_0x278cc8,_0x590753){var _0x1ad71b={'where':{'id':_0x278cc8['params']['id']}},_0x16d31b={};_0x16d31b[_0x12f3('0x33')]=_[_0x12f3('0x35')](db['Attachment']['rawAttributes']);_0x1ad71b[_0x12f3('0x3a')]=_[_0x12f3('0x37')](_0x16d31b['model'],qs[_0x12f3('0x39')](_0x278cc8['query'][_0x12f3('0x39')]));_0x1ad71b[_0x12f3('0x3a')]=_0x1ad71b[_0x12f3('0x3a')][_0x12f3('0x3b')]?_0x1ad71b['attributes']:_0x16d31b[_0x12f3('0x33')];if(_0x278cc8[_0x12f3('0x38')][_0x12f3('0x44')]){_0x1ad71b[_0x12f3('0x45')]=[{'all':!![]}];}_0x1ad71b=_['merge']({},_0x1ad71b,_0x278cc8[_0x12f3('0x49')]);return db[_0x12f3('0x2f')]['find'](_0x1ad71b)[_0x12f3('0x28')](handleEntityNotFound(_0x590753,null))['then'](function(_0xc44fd1){if(_0xc44fd1){var _0x307f4c=_0xc44fd1[_0x12f3('0x4a')]({'plain':!![]});_0x307f4c=qs['omit'](_0x307f4c,['id','createdAt',_0x12f3('0x4b')]);_0x278cc8['body']=_[_0x12f3('0x4c')](_0x278cc8[_0x12f3('0x4d')],['id',_0x12f3('0x4e'),_0x12f3('0x4b')]);return db[_0x12f3('0x2f')]['create'](_[_0x12f3('0x40')](_0x307f4c,_0x278cc8[_0x12f3('0x4d')]),{'include':_0x278cc8[_0x12f3('0x38')][_0x12f3('0x44')]?[{'all':!![]}]:undefined});}})[_0x12f3('0x28')](respondWithResult(_0x590753,0xc9))[_0x12f3('0x47')](handleError(_0x590753,null));};exports[_0x12f3('0x4f')]=function(_0x21b1ab,_0x17c04b){if(_0x21b1ab['body']['id']){delete _0x21b1ab[_0x12f3('0x4d')]['id'];}return db[_0x12f3('0x2f')][_0x12f3('0x50')]({'where':{'id':_0x21b1ab[_0x12f3('0x51')]['id']}})['then'](handleEntityNotFound(_0x17c04b,null))[_0x12f3('0x28')](saveUpdates(_0x21b1ab['body'],null))['then'](respondWithResult(_0x17c04b,null))[_0x12f3('0x47')](handleError(_0x17c04b,null));};exports['destroy']=function(_0x2162b3,_0x521a75){return db['Attachment']['find']({'where':{'id':_0x2162b3[_0x12f3('0x51')]['id']}})[_0x12f3('0x28')](handleEntityNotFound(_0x521a75,null))[_0x12f3('0x28')](removeEntity(_0x521a75,null))[_0x12f3('0x47')](handleError(_0x521a75,null));};exports[_0x12f3('0x52')]=function(_0x5c24c3,_0x301e35,_0x520990){_0x5c24c3[_0x12f3('0x4d')][_0x12f3('0x2c')]=_0x5c24c3[_0x12f3('0x53')][_0x12f3('0x54')];_0x5c24c3[_0x12f3('0x4d')][_0x12f3('0x55')]=_0x5c24c3[_0x12f3('0x53')]['filename'];_0x5c24c3[_0x12f3('0x4d')][_0x12f3('0x41')]=_0x5c24c3['file']['mimetype'];return db[_0x12f3('0x2f')][_0x12f3('0x52')](_0x5c24c3[_0x12f3('0x4d')])[_0x12f3('0x28')](respondWithResult(_0x301e35,0xc9))[_0x12f3('0x47')](handleError(_0x301e35,null));};exports['download']=function(_0x58ca65,_0x5ecda0,_0x261fb8){return db[_0x12f3('0x2f')][_0x12f3('0x56')]({'where':{'id':_0x58ca65[_0x12f3('0x51')]['id']},'raw':!![]})[_0x12f3('0x28')](handleEntityNotFound(_0x5ecda0,null))['then'](function(_0xf1e178){if(_0xf1e178){var _0x20f6e4=_0xf1e178[_0x12f3('0x57')]!==null;var _0x5cdf26=path[_0x12f3('0x58')](config[_0x12f3('0x59')],_0x12f3('0x5a'));if(_0x20f6e4){_0x5cdf26=path['join'](_0x5cdf26,_0x12f3('0x5b'));}var _0x192603=path[_0x12f3('0x58')](_0x5cdf26,_0xf1e178['basename']);return _0x5ecda0[_0x12f3('0x5c')](_0x192603);}})[_0x12f3('0x47')](handleError(_0x5ecda0,null));};
\ No newline at end of file
+var _0xe342=['fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','Attachment','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','clone','params','find','omit','createdAt','updatedAt','body','create','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','ejs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe342,0x14f));var _0x2e34=function(_0x2df523,_0x11b09e){_0x2df523=_0x2df523-0x0;var _0x43f919=_0xe342[_0x2df523];return _0x43f919;};'use strict';var emlformat=require(_0x2e34('0x0'));var rimraf=require(_0x2e34('0x1'));var zipdir=require(_0x2e34('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2e34('0x3'));var Mustache=require(_0x2e34('0x4'));var util=require(_0x2e34('0x5'));var path=require(_0x2e34('0x6'));var sox=require(_0x2e34('0x7'));var csv=require('to-csv');var ejs=require(_0x2e34('0x8'));var fs=require('fs');var fs_extra=require(_0x2e34('0x9'));var _=require('lodash');var squel=require(_0x2e34('0xa'));var crypto=require(_0x2e34('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2e34('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2e34('0xd'));var Redis=require(_0x2e34('0xe'));var authService=require(_0x2e34('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2e34('0x10'));var hardwareService=require(_0x2e34('0x11'));var logger=require('../../config/logger')(_0x2e34('0x12'));var utils=require('../../config/utils');var config=require(_0x2e34('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2e34('0x14'))['db'];function respondWithStatusCode(_0x26a41a,_0x2cd9ee){_0x2cd9ee=_0x2cd9ee||0xcc;return function(_0x4f943f){if(_0x4f943f){return _0x26a41a['sendStatus'](_0x2cd9ee);}return _0x26a41a[_0x2e34('0x15')](_0x2cd9ee)['end']();};}function respondWithResult(_0x2c9625,_0x11b283){_0x11b283=_0x11b283||0xc8;return function(_0x23e3d3){if(_0x23e3d3){return _0x2c9625['status'](_0x11b283)[_0x2e34('0x16')](_0x23e3d3);}};}function respondWithFilteredResult(_0x3470b5,_0x1eaf41){return function(_0x12f975){if(_0x12f975){var _0x28dbe0=typeof _0x1eaf41[_0x2e34('0x17')]===_0x2e34('0x18')&&typeof _0x1eaf41['limit']===_0x2e34('0x18');var _0x510265=_0x12f975[_0x2e34('0x19')];var _0x178fbc=_0x28dbe0?0x0:_0x1eaf41[_0x2e34('0x17')];var _0x252be4=_0x28dbe0?_0x12f975['count']:_0x1eaf41[_0x2e34('0x17')]+_0x1eaf41[_0x2e34('0x1a')];var _0x10edd5;if(_0x252be4>=_0x510265){_0x252be4=_0x510265;_0x10edd5=0xc8;}else{_0x10edd5=0xce;}_0x3470b5[_0x2e34('0x15')](_0x10edd5);return _0x3470b5['set'](_0x2e34('0x1b'),_0x178fbc+'-'+_0x252be4+'/'+_0x510265)[_0x2e34('0x16')](_0x12f975);}return null;};}function patchUpdates(_0x1575c9){return function(_0x50b9b8){try{jsonpatch[_0x2e34('0x1c')](_0x50b9b8,_0x1575c9,!![]);}catch(_0x4df389){return BPromise[_0x2e34('0x1d')](_0x4df389);}return _0x50b9b8[_0x2e34('0x1e')]();};}function saveUpdates(_0x5712ff,_0x527478){return function(_0xf635d2){if(_0xf635d2){return _0xf635d2[_0x2e34('0x1f')](_0x5712ff)[_0x2e34('0x20')](function(_0x48477b){return _0x48477b;});}return null;};}function removeEntity(_0x146290,_0x51e2fb){return function(_0xede190){if(_0xede190){return _0xede190[_0x2e34('0x21')]()[_0x2e34('0x20')](function(){_0x146290['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53dc55,_0x28e4fa){return function(_0x36f3df){if(!_0x36f3df){_0x53dc55[_0x2e34('0x22')](0x194);}return _0x36f3df;};}function handleError(_0x2eeb8c,_0x3776bd){_0x3776bd=_0x3776bd||0x1f4;return function(_0x35909d){logger['error'](_0x35909d[_0x2e34('0x23')]);if(_0x35909d[_0x2e34('0x24')]){delete _0x35909d['name'];}_0x2eeb8c['status'](_0x3776bd)[_0x2e34('0x25')](_0x35909d);};}exports['index']=function(_0xee938c,_0x27422b){var _0xf9611d={},_0x1efb1d={},_0x5743fe={'count':0x0,'rows':[]};var _0x5edae3=_[_0x2e34('0x26')](db[_0x2e34('0x27')][_0x2e34('0x28')],function(_0x372e7b){return{'name':_0x372e7b[_0x2e34('0x29')],'type':_0x372e7b['type']['key']};});_0x1efb1d[_0x2e34('0x2a')]=_[_0x2e34('0x26')](_0x5edae3,_0x2e34('0x24'));_0x1efb1d['query']=_[_0x2e34('0x2b')](_0xee938c[_0x2e34('0x2c')]);_0x1efb1d[_0x2e34('0x2d')]=_[_0x2e34('0x2e')](_0x1efb1d[_0x2e34('0x2a')],_0x1efb1d[_0x2e34('0x2c')]);_0xf9611d[_0x2e34('0x2f')]=_[_0x2e34('0x2e')](_0x1efb1d[_0x2e34('0x2a')],qs[_0x2e34('0x30')](_0xee938c[_0x2e34('0x2c')]['fields']));_0xf9611d['attributes']=_0xf9611d[_0x2e34('0x2f')][_0x2e34('0x31')]?_0xf9611d[_0x2e34('0x2f')]:_0x1efb1d[_0x2e34('0x2a')];if(!_0xee938c[_0x2e34('0x2c')][_0x2e34('0x32')](_0x2e34('0x33'))){_0xf9611d[_0x2e34('0x1a')]=qs[_0x2e34('0x1a')](_0xee938c[_0x2e34('0x2c')][_0x2e34('0x1a')]);_0xf9611d[_0x2e34('0x17')]=qs[_0x2e34('0x17')](_0xee938c['query']['offset']);}_0xf9611d[_0x2e34('0x34')]=qs[_0x2e34('0x35')](_0xee938c[_0x2e34('0x2c')][_0x2e34('0x35')]);_0xf9611d[_0x2e34('0x36')]=qs[_0x2e34('0x2d')](_[_0x2e34('0x37')](_0xee938c[_0x2e34('0x2c')],_0x1efb1d[_0x2e34('0x2d')]),_0x5edae3);if(_0xee938c[_0x2e34('0x2c')][_0x2e34('0x38')]){_0xf9611d[_0x2e34('0x36')]=_[_0x2e34('0x39')](_0xf9611d[_0x2e34('0x36')],{'$or':_[_0x2e34('0x26')](_0x5edae3,function(_0xcbf3f8){if(_0xcbf3f8[_0x2e34('0x3a')]!==_0x2e34('0x3b')){var _0x5dde2c={};_0x5dde2c[_0xcbf3f8[_0x2e34('0x24')]]={'$like':'%'+_0xee938c['query'][_0x2e34('0x38')]+'%'};return _0x5dde2c;}})});}_0xf9611d=_['merge']({},_0xf9611d,_0xee938c[_0x2e34('0x3c')]);var _0x3ae9b4={'where':_0xf9611d['where']};return db[_0x2e34('0x27')][_0x2e34('0x19')](_0x3ae9b4)[_0x2e34('0x20')](function(_0xfd0c1e){_0x5743fe['count']=_0xfd0c1e;if(_0xee938c[_0x2e34('0x2c')][_0x2e34('0x3d')]){_0xf9611d[_0x2e34('0x3e')]=[{'all':!![]}];}return db[_0x2e34('0x27')]['findAll'](_0xf9611d);})[_0x2e34('0x20')](function(_0x2e9c9c){_0x5743fe[_0x2e34('0x3f')]=_0x2e9c9c;return _0x5743fe;})['then'](respondWithFilteredResult(_0x27422b,_0xf9611d))[_0x2e34('0x40')](handleError(_0x27422b,null));};exports[_0x2e34('0x41')]=function(_0x45665c,_0x4d9685){var _0x51b306={'raw':!![],'where':{'id':_0x45665c['params']['id']}},_0x5ad312={};_0x5ad312['model']=_[_0x2e34('0x2b')](db['Attachment'][_0x2e34('0x28')]);_0x5ad312[_0x2e34('0x2c')]=_[_0x2e34('0x2b')](_0x45665c[_0x2e34('0x2c')]);_0x5ad312[_0x2e34('0x2d')]=_[_0x2e34('0x2e')](_0x5ad312[_0x2e34('0x2a')],_0x5ad312[_0x2e34('0x2c')]);_0x51b306[_0x2e34('0x2f')]=_['intersection'](_0x5ad312['model'],qs[_0x2e34('0x30')](_0x45665c[_0x2e34('0x2c')][_0x2e34('0x30')]));_0x51b306[_0x2e34('0x2f')]=_0x51b306[_0x2e34('0x2f')][_0x2e34('0x31')]?_0x51b306[_0x2e34('0x2f')]:_0x5ad312[_0x2e34('0x2a')];if(_0x45665c[_0x2e34('0x2c')][_0x2e34('0x3d')]){_0x51b306[_0x2e34('0x3e')]=[{'all':!![]}];}_0x51b306=_['merge']({},_0x51b306,_0x45665c[_0x2e34('0x3c')]);return db[_0x2e34('0x27')]['find'](_0x51b306)[_0x2e34('0x20')](handleEntityNotFound(_0x4d9685,null))[_0x2e34('0x20')](respondWithResult(_0x4d9685,null))[_0x2e34('0x40')](handleError(_0x4d9685,null));};exports[_0x2e34('0x42')]=function(_0x4deccf,_0xefe9d0){var _0x1d9b8d={'where':{'id':_0x4deccf[_0x2e34('0x43')]['id']}},_0x821c13={};_0x821c13[_0x2e34('0x2a')]=_[_0x2e34('0x2b')](db[_0x2e34('0x27')][_0x2e34('0x28')]);_0x1d9b8d[_0x2e34('0x2f')]=_[_0x2e34('0x2e')](_0x821c13['model'],qs[_0x2e34('0x30')](_0x4deccf[_0x2e34('0x2c')][_0x2e34('0x30')]));_0x1d9b8d[_0x2e34('0x2f')]=_0x1d9b8d[_0x2e34('0x2f')][_0x2e34('0x31')]?_0x1d9b8d[_0x2e34('0x2f')]:_0x821c13[_0x2e34('0x2a')];if(_0x4deccf['query'][_0x2e34('0x3d')]){_0x1d9b8d['include']=[{'all':!![]}];}_0x1d9b8d=_[_0x2e34('0x39')]({},_0x1d9b8d,_0x4deccf[_0x2e34('0x3c')]);return db[_0x2e34('0x27')][_0x2e34('0x44')](_0x1d9b8d)[_0x2e34('0x20')](handleEntityNotFound(_0xefe9d0,null))[_0x2e34('0x20')](function(_0x1eb4e2){if(_0x1eb4e2){var _0x564b33=_0x1eb4e2['get']({'plain':!![]});_0x564b33=qs[_0x2e34('0x45')](_0x564b33,['id',_0x2e34('0x46'),_0x2e34('0x47')]);_0x4deccf[_0x2e34('0x48')]=_['omit'](_0x4deccf[_0x2e34('0x48')],['id','createdAt',_0x2e34('0x47')]);return db[_0x2e34('0x27')][_0x2e34('0x49')](_['merge'](_0x564b33,_0x4deccf[_0x2e34('0x48')]),{'include':_0x4deccf['query'][_0x2e34('0x3d')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0xefe9d0,0xc9))[_0x2e34('0x40')](handleError(_0xefe9d0,null));};exports[_0x2e34('0x1f')]=function(_0x2faee6,_0x48e91b){if(_0x2faee6['body']['id']){delete _0x2faee6['body']['id'];}return db['Attachment'][_0x2e34('0x44')]({'where':{'id':_0x2faee6[_0x2e34('0x43')]['id']}})[_0x2e34('0x20')](handleEntityNotFound(_0x48e91b,null))['then'](saveUpdates(_0x2faee6['body'],null))['then'](respondWithResult(_0x48e91b,null))[_0x2e34('0x40')](handleError(_0x48e91b,null));};exports[_0x2e34('0x21')]=function(_0x5b364a,_0x341bb8){return db['Attachment']['find']({'where':{'id':_0x5b364a[_0x2e34('0x43')]['id']}})['then'](handleEntityNotFound(_0x341bb8,null))[_0x2e34('0x20')](removeEntity(_0x341bb8,null))['catch'](handleError(_0x341bb8,null));};exports[_0x2e34('0x49')]=function(_0x2b4845,_0x4690e5,_0x588af1){_0x2b4845['body'][_0x2e34('0x24')]=_0x2b4845['file'][_0x2e34('0x4a')];_0x2b4845[_0x2e34('0x48')][_0x2e34('0x4b')]=_0x2b4845[_0x2e34('0x4c')][_0x2e34('0x4d')];_0x2b4845[_0x2e34('0x48')][_0x2e34('0x3a')]=_0x2b4845[_0x2e34('0x4c')][_0x2e34('0x4e')];return db[_0x2e34('0x27')][_0x2e34('0x49')](_0x2b4845[_0x2e34('0x48')])['then'](respondWithResult(_0x4690e5,0xc9))[_0x2e34('0x40')](handleError(_0x4690e5,null));};exports[_0x2e34('0x4f')]=function(_0x2ef8aa,_0x108a8d,_0x1a5fab){return db['Attachment'][_0x2e34('0x50')]({'where':{'id':_0x2ef8aa[_0x2e34('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x108a8d,null))[_0x2e34('0x20')](function(_0x22ce4d){if(_0x22ce4d){var _0x58e3cb=_0x22ce4d[_0x2e34('0x51')]!==null;var _0x1fd2a1=path[_0x2e34('0x52')](config[_0x2e34('0x53')],_0x2e34('0x54'));if(_0x58e3cb){_0x1fd2a1=path[_0x2e34('0x52')](_0x1fd2a1,_0x2e34('0x55'));}var _0x177d78=path[_0x2e34('0x52')](_0x1fd2a1,_0x22ce4d[_0x2e34('0x4b')]);return _0x108a8d[_0x2e34('0x4f')](_0x177d78);}})[_0x2e34('0x40')](handleError(_0x108a8d,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 2079804..81016fb 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 _0xc9be=['bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','util','../../config/logger','api','moment'];(function(_0x1c12b9,_0x2e14ed){var _0x2784ec=function(_0x4efebc){while(--_0x4efebc){_0x1c12b9['push'](_0x1c12b9['shift']());}};_0x2784ec(++_0x2e14ed);}(_0xc9be,0xf8));var _0xec9b=function(_0x3a1f2b,_0x1c6ea2){_0x3a1f2b=_0x3a1f2b-0x0;var _0x2c569b=_0xc9be[_0x3a1f2b];return _0x2c569b;};'use strict';var _=require('lodash');var util=require(_0xec9b('0x0'));var logger=require(_0xec9b('0x1'))(_0xec9b('0x2'));var moment=require(_0xec9b('0x3'));var BPromise=require(_0xec9b('0x4'));var rp=require(_0xec9b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec9b('0x6'));var config=require(_0xec9b('0x7'));var attributes=require(_0xec9b('0x8'));module[_0xec9b('0x9')]=function(_0x9d0472,_0x348c81){return _0x9d0472[_0xec9b('0xa')]('Attachment',attributes,{'tableName':_0xec9b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7e57=['request-promise','path','../../config/environment','./attachment.attributes','exports','Attachment','attachments','lodash','util','api'];(function(_0x22b70c,_0x297ae6){var _0x3fb6c7=function(_0x1162e2){while(--_0x1162e2){_0x22b70c['push'](_0x22b70c['shift']());}};_0x3fb6c7(++_0x297ae6);}(_0x7e57,0x1e7));var _0x77e5=function(_0x5b1c58,_0x29581b){_0x5b1c58=_0x5b1c58-0x0;var _0x2e25d3=_0x7e57[_0x5b1c58];return _0x2e25d3;};'use strict';var _=require(_0x77e5('0x0'));var util=require(_0x77e5('0x1'));var logger=require('../../config/logger')(_0x77e5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x77e5('0x3'));var fs=require('fs');var path=require(_0x77e5('0x4'));var rimraf=require('rimraf');var config=require(_0x77e5('0x5'));var attributes=require(_0x77e5('0x6'));module[_0x77e5('0x7')]=function(_0xd282bf,_0x1bcead){return _0xd282bf['define'](_0x77e5('0x8'),attributes,{'tableName':_0x77e5('0x9'),'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 5d0b6e0..4d466c4 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 _0x66fa=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','message','result','catch','Attachment','body','options','raw','CreateAttachment','lodash','util','moment','ioredis'];(function(_0x46ed8e,_0x16dfc8){var _0xc3bb00=function(_0x1633e6){while(--_0x1633e6){_0x46ed8e['push'](_0x46ed8e['shift']());}};_0xc3bb00(++_0x16dfc8);}(_0x66fa,0x168));var _0xa66f=function(_0x245300,_0x17d477){_0x245300=_0x245300-0x0;var _0x206824=_0x66fa[_0x245300];return _0x206824;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require(_0xa66f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa66f('0x3'));var db=require(_0xa66f('0x4'))['db'];var utils=require(_0xa66f('0x5'));var logger=require(_0xa66f('0x6'))(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var jayson=require(_0xa66f('0x9'));var client=jayson[_0xa66f('0xa')][_0xa66f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33bd0d,_0x150f73,_0x5b7cf7){return new BPromise(function(_0x1cf624,_0x5ec156){return client[_0xa66f('0xc')](_0x33bd0d,_0x5b7cf7)[_0xa66f('0xd')](function(_0x5ad336){logger[_0xa66f('0xe')](_0xa66f('0xf'),_0x150f73,_0xa66f('0x10'));logger[_0xa66f('0x11')](_0xa66f('0x12'),_0x150f73,_0xa66f('0x10'),JSON['stringify'](_0x5ad336));if(_0x5ad336['error']){if(_0x5ad336[_0xa66f('0x13')]['code']===0x1f4){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x150f73,_0x5ad336[_0xa66f('0x13')]['message']);return _0x5ec156(_0x5ad336[_0xa66f('0x13')][_0xa66f('0x14')]);}logger['error'](_0xa66f('0xf'),_0x150f73,_0x5ad336[_0xa66f('0x13')][_0xa66f('0x14')]);return _0x1cf624(_0x5ad336[_0xa66f('0x13')]['message']);}else{logger[_0xa66f('0xe')](_0xa66f('0xf'),_0x150f73,'request\x20sent');_0x1cf624(_0x5ad336[_0xa66f('0x15')][_0xa66f('0x14')]);}})[_0xa66f('0x16')](function(_0x76af81){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x150f73,_0x76af81);_0x5ec156(_0x76af81);});});}exports['CreateAttachment']=function(_0x4d5e31){var _0x162a28=this;return new Promise(function(_0x16648b,_0x1b4ab0){return db[_0xa66f('0x17')]['create'](_0x4d5e31[_0xa66f('0x18')],{'raw':_0x4d5e31[_0xa66f('0x19')]?_0x4d5e31['options'][_0xa66f('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3f4977){logger[_0xa66f('0xe')]('CreateAttachment',_0x4d5e31);logger['debug'](_0xa66f('0x1b'),_0x4d5e31,JSON['stringify'](_0x3f4977));_0x16648b(_0x3f4977);})['catch'](function(_0x59f7aa){logger['error'](_0xa66f('0x1b'),_0x59f7aa[_0xa66f('0x14')],_0x4d5e31);_0x1b4ab0(_0x162a28[_0xa66f('0x13')](0x1f4,_0x59f7aa['message']));});});};
\ No newline at end of file
+var _0x4517=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','CreateAttachment','create','body','options','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4517,0x112));var _0x7451=function(_0x5c79b2,_0x404254){_0x5c79b2=_0x5c79b2-0x0;var _0x61f405=_0x4517[_0x5c79b2];return _0x61f405;};'use strict';var _=require('lodash');var util=require(_0x7451('0x0'));var moment=require(_0x7451('0x1'));var BPromise=require('bluebird');var rs=require(_0x7451('0x2'));var fs=require('fs');var Redis=require(_0x7451('0x3'));var db=require(_0x7451('0x4'))['db'];var utils=require(_0x7451('0x5'));var logger=require(_0x7451('0x6'))(_0x7451('0x7'));var config=require(_0x7451('0x8'));var jayson=require(_0x7451('0x9'));var client=jayson[_0x7451('0xa')][_0x7451('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ac271,_0x1bfc08,_0x26306e){return new BPromise(function(_0x443b80,_0x2c2ace){return client[_0x7451('0xc')](_0x3ac271,_0x26306e)[_0x7451('0xd')](function(_0x4b7888){logger[_0x7451('0xe')](_0x7451('0xf'),_0x1bfc08,_0x7451('0x10'));logger[_0x7451('0x11')](_0x7451('0x12'),_0x1bfc08,_0x7451('0x10'),JSON[_0x7451('0x13')](_0x4b7888));if(_0x4b7888['error']){if(_0x4b7888['error'][_0x7451('0x14')]===0x1f4){logger['error'](_0x7451('0xf'),_0x1bfc08,_0x4b7888[_0x7451('0x15')]['message']);return _0x2c2ace(_0x4b7888[_0x7451('0x15')][_0x7451('0x16')]);}logger['error'](_0x7451('0xf'),_0x1bfc08,_0x4b7888[_0x7451('0x15')][_0x7451('0x16')]);return _0x443b80(_0x4b7888[_0x7451('0x15')]['message']);}else{logger[_0x7451('0xe')](_0x7451('0xf'),_0x1bfc08,_0x7451('0x10'));_0x443b80(_0x4b7888['result']['message']);}})[_0x7451('0x17')](function(_0x1db688){logger[_0x7451('0x15')](_0x7451('0xf'),_0x1bfc08,_0x1db688);_0x2c2ace(_0x1db688);});});}exports[_0x7451('0x18')]=function(_0xd47ee4){var _0x31a4b2=this;return new Promise(function(_0x1120b1,_0x125ab1){return db['Attachment'][_0x7451('0x19')](_0xd47ee4[_0x7451('0x1a')],{'raw':_0xd47ee4[_0x7451('0x1b')]?_0xd47ee4['options'][_0x7451('0x1c')]===undefined?!![]:![]:!![]})[_0x7451('0xd')](function(_0x3ffb08){logger[_0x7451('0xe')](_0x7451('0x18'),_0xd47ee4);logger[_0x7451('0x11')](_0x7451('0x18'),_0xd47ee4,JSON['stringify'](_0x3ffb08));_0x1120b1(_0x3ffb08);})[_0x7451('0x17')](function(_0x309be0){logger['error'](_0x7451('0x18'),_0x309be0[_0x7451('0x16')],_0xd47ee4);_0x125ab1(_0x31a4b2[_0x7451('0x15')](0x1f4,_0x309be0['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index a0a428c..78dbb24 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 _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(_0x38562a,_0x53ba1f){var _0x63d8aa=function(_0x33aabe){while(--_0x33aabe){_0x38562a['push'](_0x38562a['shift']());}};_0x63d8aa(++_0x53ba1f);}(_0xadb5,0xad));var _0x5adb=function(_0x1dd4ea,_0x508eb9){_0x1dd4ea=_0x1dd4ea-0x0;var _0x34eabd=_0xadb5[_0x1dd4ea];return _0x34eabd;};'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
+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(_0x3f2893,_0x31da6e){var _0x3a0136=function(_0x1e1fb8){while(--_0x1e1fb8){_0x3f2893['push'](_0x3f2893['shift']());}};_0x3a0136(++_0x31da6e);}(_0xadb5,0xad));var _0x5adb=function(_0x5d2ae0,_0x1cc0bf){_0x5d2ae0=_0x5d2ae0-0x0;var _0x3b3760=_0xadb5[_0x5d2ae0];return _0x3b3760;};'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 70c5887..6f8d505 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 _0x8477=['undefined','baseDN','url','domain','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','role','disabled','blocked','blockedAt','admin','agent','then','name','add','minutes','getLicense','catch','send','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','User','passport','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8477,0xea));var _0x7847=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x8477[_0x4dc7b9];return _0x3ab114;};'use strict';var passport=require(_0x7847('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0x7847('0x1'));var ActiveDirectory=require(_0x7847('0x2'));var BPromise=require(_0x7847('0x3'));var util=require(_0x7847('0x4'));var db=require(_0x7847('0x5'))['db'];var authService=require(_0x7847('0x6'));var utils=require('../../config/utils');var config=require(_0x7847('0x7'));var logger=require(_0x7847('0x8'))(_0x7847('0x9'));function isActiveDirectoryConfigured(_0x189b7d){var _0x5944d8=![];if(typeof _0x189b7d[_0x7847('0xa')]!==_0x7847('0xb')){_0x5944d8=_0x189b7d[_0x7847('0xa')][_0x7847('0xc')]&&_0x189b7d[_0x7847('0xa')][_0x7847('0xd')]&&_0x189b7d[_0x7847('0xa')][_0x7847('0xe')];}return _0x5944d8;}function adAuthenticate(_0x59c223,_0x2cc6c5,_0x5ca9ba){return new BPromise(function(_0x5c7f02,_0x283f92){try{var _0x4b9763=new ActiveDirectory(_0x59c223);_0x4b9763['authenticate'](_0x2cc6c5,_0x5ca9ba,function(_0x42d0bb,_0x2b14f6){if(_0x42d0bb){logger[_0x7847('0xf')](_0x7847('0x10'),_0x2cc6c5,util['inspect'](_0x42d0bb,{'showHidden':![],'depth':null}));_0x283f92(_0x7847('0x11'));}else if(!_0x2b14f6){logger[_0x7847('0xf')](_0x7847('0x12'),_0x2cc6c5);_0x283f92(_0x7847('0x11'));}else{_0x5c7f02(_0x2b14f6);}});}catch(_0x18a120){_0x283f92(_0x18a120);}});}function ActiveDirectoryAuthenticate(_0x1abe4e,_0x688007,_0x1d5edf,_0x41d22f){var _0xdf74d1,_0x2737cc;if(!isActiveDirectoryConfigured(config)){logger[_0x7847('0xf')](_0x7847('0x13'),_0x688007);return _0x41d22f(null,![],{'message':_0x7847('0x11')});}return db[_0x7847('0x14')][_0x7847('0x15')]({'where':{'id':0x1},'attributes':[_0x7847('0x16'),_0x7847('0x17')],'raw':!![]})['then'](function(_0x180c68){_0xdf74d1=_0x180c68;if(!_0xdf74d1[_0x7847('0x16')]){logger[_0x7847('0xf')](_0x7847('0x18'),_0x688007);throw new Error(_0x7847('0x11'));}return _0x1abe4e[_0x7847('0x15')]({'attributes':['id','name',_0x7847('0x19'),'salt',_0x7847('0x1a'),_0x7847('0x1b'),_0x7847('0x1c'),_0x7847('0x1d'),'online'],'where':{'name':_0x688007,'role':{'$or':[_0x7847('0x1e'),'user',_0x7847('0x1f')]},'adSsoEnabled':!![]}});})[_0x7847('0x20')](function(_0x1b2347){if(!_0x1b2347||_0x1b2347&&_0x1b2347[_0x7847('0x21')]!==_0x688007){throw new Error(_0x7847('0x11'));}_0x2737cc=_0x1b2347;var _0x420a5c=_0x2737cc[_0x7847('0x21')]+'@'+config[_0x7847('0xa')]['domain'];return adAuthenticate(config[_0x7847('0xa')],_0x420a5c,_0x1d5edf);})['then'](function(_0x19cf92){if(_0x2737cc[_0x7847('0x1b')]){throw new Error(_0x7847('0x11'));}if(_0xdf74d1['blockDuration']>0x0){if(_0x2737cc[_0x7847('0x1c')]){if(moment(_0x2737cc[_0x7847('0x1d')])[_0x7847('0x22')](_0xdf74d1[_0x7847('0x17')],_0x7847('0x23'))>moment()){throw new Error(_0x7847('0x11'));}return utils['clearBlockUser'](_0x2737cc,0x0,![],null)['then'](function(){return utils[_0x7847('0x24')](_0x2737cc);})[_0x7847('0x20')](function(){return _0x41d22f(null,_0x2737cc);});}else{return utils[_0x7847('0x24')](_0x2737cc)[_0x7847('0x20')](function(){return _0x41d22f(null,_0x2737cc);});}}else{return utils[_0x7847('0x24')](_0x2737cc)[_0x7847('0x20')](function(){return _0x41d22f(null,_0x2737cc);});}})[_0x7847('0x25')](function(_0xc8c7b2){return _0x41d22f(null,![],_0xc8c7b2);});}function handleError(_0x3e476b,_0x48c02f,_0x42f37b){return _0x3e476b['status'](_0x48c02f||0x1f4)[_0x7847('0x26')]({'message':_0x42f37b?_0x42f37b[_0x7847('0x27')]||_0x42f37b:''});}exports[_0x7847('0x28')]=function(_0x397df7,_0x27ac27,_0x122a18){passport[_0x7847('0x29')](_0x7847('0x2a'),function(_0x13fc8c,_0x44c365,_0x4ac4fd){var _0x3f20b1=_0x13fc8c||_0x4ac4fd;if(_0x3f20b1){return handleError(_0x27ac27,0x191,_0x3f20b1);}if(!_0x44c365){return handleError(_0x27ac27,0x194,{'message':_0x7847('0x2b')});}else{var _0x2facd6={'payload':{'id':_0x44c365['id'],'role':_0x44c365[_0x7847('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x7847('0x2c')](_0x2facd6)[_0x7847('0x20')](function(_0x4900e5){_0x27ac27[_0x7847('0x2d')]({'id':_0x44c365['id'],'token':_0x4900e5,'statusCall':'','isAlreadyLogged':_0x44c365[_0x7847('0x2e')]});});}})(_0x397df7,_0x27ac27,_0x122a18);};passport[_0x7847('0x2f')](_0x7847('0x2a'),new LocalStrategy({'usernameField':_0x7847('0x21'),'passwordField':_0x7847('0x19')},function(_0x4cc548,_0x3a3fcf,_0x2bd48c){return ActiveDirectoryAuthenticate(db[_0x7847('0x30')],_0x4cc548,_0x3a3fcf,_0x2bd48c);}));
\ No newline at end of file
+var _0x029a=['signToken','json','use','ad-login','User','passport-local','Strategy','activedirectory2','util','../../mysqldb','../../config/utils','../../config/logger','activedirectory','undefined','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','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','then','findOne','name','salt','role','disabled','blocked','online','admin','agent','blockedAt','add','minutes','clearBlockUser','getLicense','catch','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.'];(function(_0xa59345,_0x86f01c){var _0x22fc32=function(_0x1c5423){while(--_0x1c5423){_0xa59345['push'](_0xa59345['shift']());}};_0x22fc32(++_0x86f01c);}(_0x029a,0xb5));var _0xa029=function(_0x5a404a,_0x31e13f){_0x5a404a=_0x5a404a-0x0;var _0x25e98e=_0x029a[_0x5a404a];return _0x25e98e;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xa029('0x0'))[_0xa029('0x1')];var moment=require('moment');var ActiveDirectory=require(_0xa029('0x2'));var BPromise=require('bluebird');var util=require(_0xa029('0x3'));var db=require(_0xa029('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xa029('0x5'));var config=require('../../config/environment');var logger=require(_0xa029('0x6'))('api');function isActiveDirectoryConfigured(_0x22ac41){var _0x19c403=![];if(typeof _0x22ac41[_0xa029('0x7')]!==_0xa029('0x8')){_0x19c403=_0x22ac41[_0xa029('0x7')]['baseDN']&&_0x22ac41[_0xa029('0x7')]['url']&&_0x22ac41[_0xa029('0x7')][_0xa029('0x9')];}return _0x19c403;}function adAuthenticate(_0x2ec357,_0x49edf9,_0x128c70){return new BPromise(function(_0x2d95de,_0x22e9f7){try{var _0x4ea3b8=new ActiveDirectory(_0x2ec357);_0x4ea3b8[_0xa029('0xa')](_0x49edf9,_0x128c70,function(_0x4e8c53,_0x5bfbda){if(_0x4e8c53){logger['error'](_0xa029('0xb'),_0x49edf9,util['inspect'](_0x4e8c53,{'showHidden':![],'depth':null}));_0x22e9f7('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x5bfbda){logger[_0xa029('0xc')](_0xa029('0xd'),_0x49edf9);_0x22e9f7(_0xa029('0xe'));}else{_0x2d95de(_0x5bfbda);}});}catch(_0x53d7b3){_0x22e9f7(_0x53d7b3);}});}function ActiveDirectoryAuthenticate(_0x4d2d29,_0x2a9e09,_0x32593f,_0x33c07e){var _0x52cdf4,_0x555198;if(!isActiveDirectoryConfigured(config)){logger[_0xa029('0xc')](_0xa029('0xf'),_0x2a9e09);return _0x33c07e(null,![],{'message':_0xa029('0xe')});}return db[_0xa029('0x10')]['findOne']({'where':{'id':0x1},'attributes':[_0xa029('0x11'),_0xa029('0x12')],'raw':!![]})[_0xa029('0x13')](function(_0x10a6a4){_0x52cdf4=_0x10a6a4;if(!_0x52cdf4['adSsoEnabled']){logger[_0xa029('0xc')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x2a9e09);throw new Error(_0xa029('0xe'));}return _0x4d2d29[_0xa029('0x14')]({'attributes':['id',_0xa029('0x15'),'password',_0xa029('0x16'),_0xa029('0x17'),_0xa029('0x18'),_0xa029('0x19'),'blockedAt',_0xa029('0x1a')],'where':{'name':_0x2a9e09,'role':{'$or':[_0xa029('0x1b'),'user',_0xa029('0x1c')]},'adSsoEnabled':!![]}});})[_0xa029('0x13')](function(_0x536ec2){if(!_0x536ec2||_0x536ec2&&_0x536ec2['name']!==_0x2a9e09){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x555198=_0x536ec2;var _0x3972d2=_0x555198[_0xa029('0x15')]+'@'+config[_0xa029('0x7')][_0xa029('0x9')];return adAuthenticate(config['activedirectory'],_0x3972d2,_0x32593f);})[_0xa029('0x13')](function(_0x3d7d2a){if(_0x555198['disabled']){throw new Error(_0xa029('0xe'));}if(_0x52cdf4[_0xa029('0x12')]>0x0){if(_0x555198[_0xa029('0x19')]){if(moment(_0x555198[_0xa029('0x1d')])[_0xa029('0x1e')](_0x52cdf4[_0xa029('0x12')],_0xa029('0x1f'))>moment()){throw new Error(_0xa029('0xe'));}return utils[_0xa029('0x20')](_0x555198,0x0,![],null)['then'](function(){return utils['getLicense'](_0x555198);})[_0xa029('0x13')](function(){return _0x33c07e(null,_0x555198);});}else{return utils[_0xa029('0x21')](_0x555198)[_0xa029('0x13')](function(){return _0x33c07e(null,_0x555198);});}}else{return utils['getLicense'](_0x555198)[_0xa029('0x13')](function(){return _0x33c07e(null,_0x555198);});}})[_0xa029('0x22')](function(_0x79efb6){return _0x33c07e(null,![],_0x79efb6);});}function handleError(_0x2c72fa,_0x4376ae,_0x41e1ce){return _0x2c72fa['status'](_0x4376ae||0x1f4)[_0xa029('0x23')]({'message':_0x41e1ce?_0x41e1ce[_0xa029('0x24')]||_0x41e1ce:''});}exports[_0xa029('0x25')]=function(_0x50af21,_0x4deaf7,_0x398672){passport[_0xa029('0xa')]('ad-login',function(_0x3432ce,_0x3d45d9,_0x550154){var _0x1cbc06=_0x3432ce||_0x550154;if(_0x1cbc06){return handleError(_0x4deaf7,0x191,_0x1cbc06);}if(!_0x3d45d9){return handleError(_0x4deaf7,0x194,{'message':_0xa029('0x26')});}else{var _0x4d25df={'payload':{'id':_0x3d45d9['id'],'role':_0x3d45d9[_0xa029('0x17')]},'options':{'expiresIn':0x15180}};return authService[_0xa029('0x27')](_0x4d25df)[_0xa029('0x13')](function(_0x4de2d5){_0x4deaf7[_0xa029('0x28')]({'id':_0x3d45d9['id'],'token':_0x4de2d5,'statusCall':'','isAlreadyLogged':_0x3d45d9[_0xa029('0x1a')]});});}})(_0x50af21,_0x4deaf7,_0x398672);};passport[_0xa029('0x29')](_0xa029('0x2a'),new LocalStrategy({'usernameField':_0xa029('0x15'),'passwordField':'password'},function(_0x318336,_0x422209,_0x20498e){return ActiveDirectoryAuthenticate(db[_0xa029('0x2b')],_0x318336,_0x422209,_0x20498e);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index f485563..60e5ea7 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 _0x8771=['exports','express','Router','login'];(function(_0x534971,_0x1a8061){var _0x575c2f=function(_0x222f11){while(--_0x222f11){_0x534971['push'](_0x534971['shift']());}};_0x575c2f(++_0x1a8061);}(_0x8771,0x75));var _0x1877=function(_0x3f1718,_0x5360ad){_0x3f1718=_0x3f1718-0x0;var _0x29627e=_0x8771[_0x3f1718];return _0x29627e;};'use strict';var express=require(_0x1877('0x0'));var router=express[_0x1877('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0x1877('0x2')]);module[_0x1877('0x3')]=router;
\ No newline at end of file
+var _0x4ee4=['./authActiveDirectory.controller','post','login','exports','express','Router'];(function(_0x23e00d,_0x4e6f3d){var _0x2ebc05=function(_0x20fd35){while(--_0x20fd35){_0x23e00d['push'](_0x23e00d['shift']());}};_0x2ebc05(++_0x4e6f3d);}(_0x4ee4,0x160));var _0x44ee=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0x4ee4[_0x3a9661];return _0x5bb119;};'use strict';var express=require(_0x44ee('0x0'));var router=express[_0x44ee('0x1')]();var controller=require(_0x44ee('0x2'));router[_0x44ee('0x3')]('/',controller[_0x44ee('0x4')]);module[_0x44ee('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index a4aeb5e..e5ac1fa 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(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x7a54,0x106));var _0x47a5=function(_0x1ed583,_0x512eb2){_0x1ed583=_0x1ed583-0x0;var _0x42a452=_0x7a54[_0x1ed583];return _0x42a452;};'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(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x7a54,0x106));var _0x47a5=function(_0x39cc5e,_0xca88a3){_0x39cc5e=_0x39cc5e-0x0;var _0x168686=_0x7a54[_0x39cc5e];return _0x168686;};'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 8f42b43..f23ea83 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 _0x6412=['get','login','/callback','callback','isMiddleware','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x4e3780,_0x5c62fb){var _0x1d8532=function(_0x1010ab){while(--_0x1010ab){_0x4e3780['push'](_0x4e3780['shift']());}};_0x1d8532(++_0x5c62fb);}(_0x6412,0x1c8));var _0x2641=function(_0x40ae87,_0x29c4c6){_0x40ae87=_0x40ae87-0x0;var _0x49a0bb=_0x6412[_0x40ae87];return _0x49a0bb;};'use strict';var express=require(_0x2641('0x0'));var passport=require(_0x2641('0x1'));var router=express[_0x2641('0x2')]();var controller=require(_0x2641('0x3'));var userController=require(_0x2641('0x4'));var authService=require(_0x2641('0x5'));router[_0x2641('0x6')]('/',controller[_0x2641('0x7')]);router['get'](_0x2641('0x8'),controller[_0x2641('0x9')],authService[_0x2641('0xa')],userController[_0x2641('0x7')],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
+var _0x1057=['isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','login','/callback','callback'];(function(_0x2f7f62,_0x48fa3a){var _0x477878=function(_0x4b6229){while(--_0x4b6229){_0x2f7f62['push'](_0x2f7f62['shift']());}};_0x477878(++_0x48fa3a);}(_0x1057,0xc3));var _0x7105=function(_0x15d1d9,_0x41960f){_0x15d1d9=_0x15d1d9-0x0;var _0x5acc6f=_0x1057[_0x15d1d9];return _0x5acc6f;};'use strict';var express=require(_0x7105('0x0'));var passport=require(_0x7105('0x1'));var router=express[_0x7105('0x2')]();var controller=require(_0x7105('0x3'));var userController=require(_0x7105('0x4'));var authService=require('../../components/auth/service');router[_0x7105('0x5')]('/',controller[_0x7105('0x6')]);router[_0x7105('0x5')](_0x7105('0x7'),controller[_0x7105('0x8')],authService[_0x7105('0x9')],userController[_0x7105('0x6')],authService[_0x7105('0xa')]);module[_0x7105('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index e8e6044..fcd0f4b 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 _0xf8a8=['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\x20Email\x20sent!','params','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','use','util','passport','passport-local','jayson/promise','lodash','moment','../../components/auth/service','../../config/utils','client','http','allowedLoginAttempts','blockDuration','then','password','salt','disabled','blocked','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','blockedAt','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save'];(function(_0x495869,_0x43e996){var _0x1a5786=function(_0x45192c){while(--_0x45192c){_0x495869['push'](_0x495869['shift']());}};_0x1a5786(++_0x43e996);}(_0xf8a8,0xff));var _0x8f8a=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xf8a8[_0x4e9628];return _0x27bc8c;};'use strict';var util=require(_0x8f8a('0x0'));var passport=require(_0x8f8a('0x1'));var LocalStrategy=require(_0x8f8a('0x2'))['Strategy'];var jayson=require(_0x8f8a('0x3'));var _=require(_0x8f8a('0x4'));var rs=require('randomstring');var moment=require(_0x8f8a('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x8f8a('0x6'));var utils=require(_0x8f8a('0x7'));var client=jayson[_0x8f8a('0x8')][_0x8f8a('0x9')]({'port':0x232b});function localAuthenticate(_0x5ef965,_0x1160d0,_0x57ed11,_0x495896){var _0x4c5a10,_0x501ea0;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x8f8a('0xa'),_0x8f8a('0xb')],'raw':!![]})[_0x8f8a('0xc')](function(_0x420ddb){_0x4c5a10=_0x420ddb;return _0x5ef965['findOne']({'attributes':['id','name',_0x8f8a('0xd'),_0x8f8a('0xe'),'role',_0x8f8a('0xf'),_0x8f8a('0x10'),'blockedAt','loginAttempts'],'where':{'name':_0x1160d0,'role':{'$or':[_0x8f8a('0x11'),_0x8f8a('0x12'),_0x8f8a('0x13')]}}});})['then'](function(_0x1e0646){if(!_0x1e0646||_0x1e0646&&_0x1e0646[_0x8f8a('0x14')]!==_0x1160d0){throw new Error(_0x8f8a('0x15'));}else{_0x501ea0=_0x1e0646;return _0x501ea0;}})[_0x8f8a('0xc')](function(){_0x501ea0[_0x8f8a('0x16')](_0x57ed11,function(_0x57b3c7,_0x33f502){var _0xa8d8a0=_0x501ea0[_0x8f8a('0x17')]+0x1;if(_0x57b3c7){return _0x495896(_0x57b3c7);}else if(!_0x33f502){if(_0x501ea0[_0x8f8a('0xf')]){return _0x495896(null,![],{'message':_0x8f8a('0x15')});}else if(_0x4c5a10[_0x8f8a('0xa')]>0x0){if(_0x501ea0[_0x8f8a('0x10')]){if(_0x4c5a10[_0x8f8a('0xb')]>0x0){if(moment(_0x501ea0['blockedAt'])[_0x8f8a('0x18')](_0x4c5a10[_0x8f8a('0xb')],_0x8f8a('0x19'))>moment()){return _0x495896(null,![],{'message':_0x8f8a('0x15')});}else{return utils[_0x8f8a('0x1a')](_0x501ea0,_0xa8d8a0,![],null)['then'](function(){return _0x495896(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x495896(null,![],{'message':_0x8f8a('0x15')});}}else{if(_0xa8d8a0>=_0x4c5a10[_0x8f8a('0xa')]){return utils[_0x8f8a('0x1a')](_0x501ea0,0x0,!![],moment())[_0x8f8a('0xc')](function(){return _0x495896(null,![],{'message':_0x8f8a('0x15')});});}else{return utils[_0x8f8a('0x1a')](_0x501ea0,_0xa8d8a0,![],null)[_0x8f8a('0xc')](function(){return _0x495896(null,![],{'message':_0x8f8a('0x15')});});}}}else{return _0x495896(null,![],{'message':_0x8f8a('0x15')});}}else{if(_0x501ea0[_0x8f8a('0xf')]){return _0x495896(null,![],{'message':_0x8f8a('0x15')});}else if(_0x4c5a10[_0x8f8a('0xa')]>0x0){if(_0x501ea0[_0x8f8a('0x10')]){if(_0x4c5a10[_0x8f8a('0xb')]>0x0){if(moment(_0x501ea0[_0x8f8a('0x1b')])[_0x8f8a('0x18')](_0x4c5a10[_0x8f8a('0xb')],_0x8f8a('0x19'))>moment()){return _0x495896(null,![],{'message':_0x8f8a('0x15')});}else{return utils['clearBlockUser'](_0x501ea0,0x0,![],null)[_0x8f8a('0xc')](function(){return utils[_0x8f8a('0x1c')](_0x501ea0);})[_0x8f8a('0xc')](function(){return _0x495896(null,_0x501ea0);});}}else{return _0x495896(null,![],{'message':_0x8f8a('0x15')});}}else{return utils[_0x8f8a('0x1a')](_0x501ea0,0x0,![],null)[_0x8f8a('0xc')](function(){return utils['getLicense'](_0x501ea0);})[_0x8f8a('0xc')](function(){return _0x495896(null,_0x501ea0);})[_0x8f8a('0x1d')](function(_0xefafe3){return _0x495896(null,![],_0xefafe3);});}}else{if(_0x501ea0[_0x8f8a('0x10')]){return _0x495896(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x8f8a('0x1c')](_0x501ea0)[_0x8f8a('0xc')](function(){return _0x495896(null,_0x501ea0);});}}}});})[_0x8f8a('0x1d')](function(_0x53f446){return _0x495896(null,![],_0x53f446);});}function sendServiceMail(_0x2e9bbd){return db[_0x8f8a('0x1e')][_0x8f8a('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0x8f8a('0x20')],'include':[{'model':db[_0x8f8a('0x21')],'as':_0x8f8a('0x22'),'include':[{'model':db[_0x8f8a('0x23')],'as':_0x8f8a('0x23')}]}]})[_0x8f8a('0xc')](function(_0x1687e9){if(!_0x1687e9){throw new Error(_0x8f8a('0x24'));}var _0x5e10ad=_0x1687e9[_0x8f8a('0x25')]();var _0x5a1c6e={'account':_0x5e10ad,'message':_[_0x8f8a('0x26')]({'from':util[_0x8f8a('0x27')](_0x8f8a('0x28'),_0x1687e9[_0x8f8a('0x14')],_0x1687e9[_0x8f8a('0x20')]||_0x1687e9[_0x8f8a('0x22')][_0x8f8a('0x12')])},_0x2e9bbd)};return client['request']('SendMail',_0x5a1c6e);})[_0x8f8a('0xc')](function(_0x5cdeda){if(_0x5cdeda[_0x8f8a('0x29')]){throw new Error(util[_0x8f8a('0x27')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x5cdeda[_0x8f8a('0x29')][_0x8f8a('0x2a')]||JSON[_0x8f8a('0x2b')](_0x5cdeda[_0x8f8a('0x29')])));}return!![];});}function handleError(_0x5206d0,_0x58075b,_0x1552c1){return _0x5206d0[_0x8f8a('0x2c')](_0x58075b||0x1f4)[_0x8f8a('0x2d')]({'message':_0x1552c1?_0x1552c1['message']||_0x1552c1:''});}exports[_0x8f8a('0x2e')]=function(_0x49af2e,_0x4c5cbb,_0x3f1220){passport[_0x8f8a('0x16')](_0x8f8a('0x2f'),function(_0x5b3dec,_0x3ebb02,_0x5120cc){var _0x31e687=_0x5b3dec||_0x5120cc;if(_0x31e687){return handleError(_0x4c5cbb,0x191,_0x31e687);}if(!_0x3ebb02){return handleError(_0x4c5cbb,0x194,{'message':_0x8f8a('0x30')});}else{var _0x18ee8c={'payload':{'id':_0x3ebb02['id'],'role':_0x3ebb02[_0x8f8a('0x31')]},'options':{'expiresIn':0x15180}};return authService[_0x8f8a('0x32')](_0x18ee8c)[_0x8f8a('0xc')](function(_0x212309){_0x4c5cbb['json']({'id':_0x3ebb02['id'],'token':_0x212309,'statusCall':'','isAlreadyLogged':_0x3ebb02[_0x8f8a('0x33')]});});}})(_0x49af2e,_0x4c5cbb,_0x3f1220);};exports[_0x8f8a('0x34')]=function(_0x3a9f93,_0x408617){if(!_0x3a9f93[_0x8f8a('0x35')][_0x8f8a('0x20')]){return handleError(_0x408617,0x1f4,{'message':_0x8f8a('0x36')});}var _0x27def4=rs['generate']();_0x3a9f93[_0x8f8a('0x35')]['email']=_0x3a9f93[_0x8f8a('0x35')]['email'][_0x8f8a('0x37')]()['toLowerCase']();var _0x1c3123;return db[_0x8f8a('0x38')]['findOne']({'where':{'id':0x1},'attributes':[_0x8f8a('0xa'),_0x8f8a('0xb')],'raw':!![]})[_0x8f8a('0xc')](function(_0x2381e5){_0x1c3123=_0x2381e5;return db[_0x8f8a('0x39')][_0x8f8a('0x1f')]({'where':{'email':_0x3a9f93[_0x8f8a('0x35')][_0x8f8a('0x20')]}});})['then'](function(_0x54665c){if(!_0x54665c){throw new Error(_0x8f8a('0x3a'));}if(_0x54665c[_0x8f8a('0xf')]){throw new Error(_0x8f8a('0x3b'));}if(_0x54665c['blocked']){if(moment(_0x54665c[_0x8f8a('0x1b')])[_0x8f8a('0x18')](_0x1c3123[_0x8f8a('0xb')],_0x8f8a('0x19'))>moment()){throw new Error(_0x8f8a('0x3c'));}else{_0x54665c[_0x8f8a('0x10')]=![];_0x54665c['blockedAt']=null;}}_0x54665c[_0x8f8a('0x3d')]=_0x27def4;_0x54665c[_0x8f8a('0x3e')]=Date[_0x8f8a('0x3f')]()+0x36ee80;return _0x54665c[_0x8f8a('0x40')]();})[_0x8f8a('0xc')](function(){return sendServiceMail({'to':_0x3a9f93['body'][_0x8f8a('0x20')],'subject':_0x8f8a('0x41'),'text':_0x8f8a('0x42')+_0x8f8a('0x43')+_0x8f8a('0x44')+_0x3a9f93['headers'][_0x8f8a('0x45')]+'/reset/'+_0x27def4+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x8f8a('0xc')](function(){_0x408617[_0x8f8a('0x2c')](0xc8)[_0x8f8a('0x2d')]({'message':_0x8f8a('0x46')});})['catch'](function(_0x52bd85){return handleError(_0x408617,0x1f4,_0x52bd85);});};exports['reset']=function(_0x119d21,_0x25bfbd){return db['User']['find']({'where':{'resetPasswordToken':_0x119d21[_0x8f8a('0x47')]['token'],'resetPasswordExpires':{'$gt':Date[_0x8f8a('0x3f')]()}}})[_0x8f8a('0xc')](function(_0x3504a3){if(!_0x3504a3){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x8f8a('0x48')]({'attributes':['id',_0x8f8a('0x49'),_0x8f8a('0x4a'),_0x8f8a('0x4b')]})[_0x8f8a('0xc')](function(_0x120fec){if(_0x120fec['securePassword'])authService[_0x8f8a('0x4c')](_0x119d21[_0x8f8a('0x35')][_0x8f8a('0xd')]);if(!_0x120fec[_0x8f8a('0x4a')]||!_0x3504a3[_0x8f8a('0x4d')])return _0x3504a3;authService[_0x8f8a('0x4e')](_0x119d21[_0x8f8a('0x35')]['password'],_0x3504a3[_0x8f8a('0x4d')],_0x120fec[_0x8f8a('0x4b')]);return _0x3504a3;})[_0x8f8a('0xc')](function(){_0x3504a3['password']=_0x119d21[_0x8f8a('0x35')][_0x8f8a('0xd')];_0x3504a3[_0x8f8a('0x3d')]=null;_0x3504a3['resetPasswordExpires']=null;return _0x3504a3[_0x8f8a('0x40')]();});})[_0x8f8a('0xc')](function(){_0x25bfbd[_0x8f8a('0x2c')](0xc8)[_0x8f8a('0x2d')]({'message':'Password\x20reset!'});})[_0x8f8a('0x1d')](function(_0x529aa2){return handleError(_0x25bfbd,0x1f4,_0x529aa2);});};passport[_0x8f8a('0x4f')](_0x8f8a('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':_0x8f8a('0xd')},function(_0x205886,_0x12f9fe,_0x4746ab){return localAuthenticate(db[_0x8f8a('0x39')],_0x205886,_0x12f9fe,_0x4746ab);}));
\ No newline at end of file
+var _0x6b4a=['agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','Smtp','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','message','stringify','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','save','use','util','passport','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blockedAt','admin','user'];(function(_0x3adf40,_0x165ffb){var _0x2b15a6=function(_0x281cf2){while(--_0x281cf2){_0x3adf40['push'](_0x3adf40['shift']());}};_0x2b15a6(++_0x165ffb);}(_0x6b4a,0x86));var _0xa6b4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6b4a[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xa6b4('0x0'));var passport=require(_0xa6b4('0x1'));var LocalStrategy=require('passport-local')[_0xa6b4('0x2')];var jayson=require(_0xa6b4('0x3'));var _=require('lodash');var rs=require(_0xa6b4('0x4'));var moment=require(_0xa6b4('0x5'));var db=require(_0xa6b4('0x6'))['db'];var authService=require(_0xa6b4('0x7'));var utils=require('../../config/utils');var client=jayson['client'][_0xa6b4('0x8')]({'port':0x232b});function localAuthenticate(_0x41a3fb,_0x29073d,_0x553cdf,_0x1532ad){var _0x31b40a,_0x20758b;return db[_0xa6b4('0x9')][_0xa6b4('0xa')]({'where':{'id':0x1},'attributes':[_0xa6b4('0xb'),_0xa6b4('0xc')],'raw':!![]})[_0xa6b4('0xd')](function(_0x1fc163){_0x31b40a=_0x1fc163;return _0x41a3fb['findOne']({'attributes':['id',_0xa6b4('0xe'),_0xa6b4('0xf'),_0xa6b4('0x10'),_0xa6b4('0x11'),_0xa6b4('0x12'),'blocked',_0xa6b4('0x13'),'loginAttempts'],'where':{'name':_0x29073d,'role':{'$or':[_0xa6b4('0x14'),_0xa6b4('0x15'),_0xa6b4('0x16')]}}});})[_0xa6b4('0xd')](function(_0x58fd28){if(!_0x58fd28||_0x58fd28&&_0x58fd28[_0xa6b4('0xe')]!==_0x29073d){throw new Error(_0xa6b4('0x17'));}else{_0x20758b=_0x58fd28;return _0x20758b;}})[_0xa6b4('0xd')](function(){_0x20758b['authenticate'](_0x553cdf,function(_0x2be6b8,_0x3a1b84){var _0x1a30c9=_0x20758b['loginAttempts']+0x1;if(_0x2be6b8){return _0x1532ad(_0x2be6b8);}else if(!_0x3a1b84){if(_0x20758b['disabled']){return _0x1532ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x31b40a[_0xa6b4('0xb')]>0x0){if(_0x20758b[_0xa6b4('0x18')]){if(_0x31b40a[_0xa6b4('0xc')]>0x0){if(moment(_0x20758b[_0xa6b4('0x13')])[_0xa6b4('0x19')](_0x31b40a['blockDuration'],_0xa6b4('0x1a'))>moment()){return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});}else{return utils['clearBlockUser'](_0x20758b,_0x1a30c9,![],null)['then'](function(){return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});});}}else{return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});}}else{if(_0x1a30c9>=_0x31b40a[_0xa6b4('0xb')]){return utils[_0xa6b4('0x1b')](_0x20758b,0x0,!![],moment())['then'](function(){return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});});}else{return utils[_0xa6b4('0x1b')](_0x20758b,_0x1a30c9,![],null)[_0xa6b4('0xd')](function(){return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});});}}}else{return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});}}else{if(_0x20758b[_0xa6b4('0x12')]){return _0x1532ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x31b40a[_0xa6b4('0xb')]>0x0){if(_0x20758b[_0xa6b4('0x18')]){if(_0x31b40a[_0xa6b4('0xc')]>0x0){if(moment(_0x20758b[_0xa6b4('0x13')])['add'](_0x31b40a[_0xa6b4('0xc')],_0xa6b4('0x1a'))>moment()){return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});}else{return utils[_0xa6b4('0x1b')](_0x20758b,0x0,![],null)['then'](function(){return utils[_0xa6b4('0x1c')](_0x20758b);})[_0xa6b4('0xd')](function(){return _0x1532ad(null,_0x20758b);});}}else{return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});}}else{return utils['clearBlockUser'](_0x20758b,0x0,![],null)['then'](function(){return utils['getLicense'](_0x20758b);})[_0xa6b4('0xd')](function(){return _0x1532ad(null,_0x20758b);})['catch'](function(_0x3e4170){return _0x1532ad(null,![],_0x3e4170);});}}else{if(_0x20758b[_0xa6b4('0x18')]){return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});}else{return utils[_0xa6b4('0x1c')](_0x20758b)[_0xa6b4('0xd')](function(){return _0x1532ad(null,_0x20758b);});}}}});})[_0xa6b4('0x1d')](function(_0x249a2d){return _0x1532ad(null,![],_0x249a2d);});}function sendServiceMail(_0x328c38){return db[_0xa6b4('0x1e')][_0xa6b4('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xa6b4('0xe'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xa6b4('0x20'),'include':[{'model':db[_0xa6b4('0x21')],'as':_0xa6b4('0x21')}]}]})[_0xa6b4('0xd')](function(_0x34c17d){if(!_0x34c17d){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x59bcca=_0x34c17d[_0xa6b4('0x22')]();var _0xa9ce78={'account':_0x59bcca,'message':_[_0xa6b4('0x23')]({'from':util[_0xa6b4('0x24')](_0xa6b4('0x25'),_0x34c17d[_0xa6b4('0xe')],_0x34c17d[_0xa6b4('0x26')]||_0x34c17d[_0xa6b4('0x20')][_0xa6b4('0x15')])},_0x328c38)};return client[_0xa6b4('0x27')](_0xa6b4('0x28'),_0xa9ce78);})['then'](function(_0xaed830){if(_0xaed830['error']){throw new Error(util[_0xa6b4('0x24')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0xaed830[_0xa6b4('0x29')][_0xa6b4('0x2a')]||JSON[_0xa6b4('0x2b')](_0xaed830[_0xa6b4('0x29')])));}return!![];});}function handleError(_0x297bc4,_0x3457d4,_0x217696){return _0x297bc4['status'](_0x3457d4||0x1f4)[_0xa6b4('0x2c')]({'message':_0x217696?_0x217696[_0xa6b4('0x2a')]||_0x217696:''});}exports[_0xa6b4('0x2d')]=function(_0x25a43a,_0xb341ca,_0x4b42b9){passport[_0xa6b4('0x2e')](_0xa6b4('0x2f'),function(_0x428e5f,_0x162391,_0x5ced6b){var _0x15d5bf=_0x428e5f||_0x5ced6b;if(_0x15d5bf){return handleError(_0xb341ca,0x191,_0x15d5bf);}if(!_0x162391){return handleError(_0xb341ca,0x194,{'message':_0xa6b4('0x30')});}else{var _0x39f4d8={'payload':{'id':_0x162391['id'],'role':_0x162391['role']},'options':{'expiresIn':0x15180}};return authService[_0xa6b4('0x31')](_0x39f4d8)[_0xa6b4('0xd')](function(_0x4bfec0){_0xb341ca[_0xa6b4('0x32')]({'id':_0x162391['id'],'token':_0x4bfec0,'statusCall':'','isAlreadyLogged':_0x162391['online']});});}})(_0x25a43a,_0xb341ca,_0x4b42b9);};exports[_0xa6b4('0x33')]=function(_0x50f65,_0x33b0b8){if(!_0x50f65[_0xa6b4('0x34')][_0xa6b4('0x26')]){return handleError(_0x33b0b8,0x1f4,{'message':_0xa6b4('0x35')});}var _0x4dbe8b=rs[_0xa6b4('0x36')]();_0x50f65[_0xa6b4('0x34')]['email']=_0x50f65[_0xa6b4('0x34')][_0xa6b4('0x26')]['trim']()['toLowerCase']();var _0x326a8b;return db[_0xa6b4('0x9')][_0xa6b4('0xa')]({'where':{'id':0x1},'attributes':[_0xa6b4('0xb'),_0xa6b4('0xc')],'raw':!![]})[_0xa6b4('0xd')](function(_0x109ba4){_0x326a8b=_0x109ba4;return db[_0xa6b4('0x37')][_0xa6b4('0x1f')]({'where':{'email':_0x50f65['body'][_0xa6b4('0x26')]}});})[_0xa6b4('0xd')](function(_0x544db8){if(!_0x544db8){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x544db8[_0xa6b4('0x12')]){throw new Error(_0xa6b4('0x38'));}if(_0x544db8[_0xa6b4('0x18')]){if(moment(_0x544db8[_0xa6b4('0x13')])[_0xa6b4('0x19')](_0x326a8b[_0xa6b4('0xc')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x544db8[_0xa6b4('0x18')]=![];_0x544db8[_0xa6b4('0x13')]=null;}}_0x544db8[_0xa6b4('0x39')]=_0x4dbe8b;_0x544db8['resetPasswordExpires']=Date[_0xa6b4('0x3a')]()+0x36ee80;return _0x544db8['save']();})[_0xa6b4('0xd')](function(){return sendServiceMail({'to':_0x50f65[_0xa6b4('0x34')][_0xa6b4('0x26')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xa6b4('0x3b')+_0xa6b4('0x3c')+_0xa6b4('0x3d')+_0x50f65[_0xa6b4('0x3e')]['host']+'/reset/'+_0x4dbe8b+'\x0a\x0a'+_0xa6b4('0x3f')});})[_0xa6b4('0xd')](function(){_0x33b0b8[_0xa6b4('0x40')](0xc8)[_0xa6b4('0x2c')]({'message':_0xa6b4('0x41')});})[_0xa6b4('0x1d')](function(_0xef3eee){return handleError(_0x33b0b8,0x1f4,_0xef3eee);});};exports[_0xa6b4('0x42')]=function(_0xf284f9,_0xde7531){return db[_0xa6b4('0x37')][_0xa6b4('0x1f')]({'where':{'resetPasswordToken':_0xf284f9['params'][_0xa6b4('0x43')],'resetPasswordExpires':{'$gt':Date[_0xa6b4('0x3a')]()}}})['then'](function(_0x10cabb){if(!_0x10cabb){throw new Error(_0xa6b4('0x44'));}return db[_0xa6b4('0x9')]['findOne']({'attributes':['id','securePassword',_0xa6b4('0x45'),_0xa6b4('0x46')]})[_0xa6b4('0xd')](function(_0x196083){if(_0x196083[_0xa6b4('0x47')])authService[_0xa6b4('0x48')](_0xf284f9[_0xa6b4('0x34')][_0xa6b4('0xf')]);if(!_0x196083[_0xa6b4('0x45')]||!_0x10cabb[_0xa6b4('0x49')])return _0x10cabb;authService[_0xa6b4('0x4a')](_0xf284f9[_0xa6b4('0x34')][_0xa6b4('0xf')],_0x10cabb[_0xa6b4('0x49')],_0x196083[_0xa6b4('0x46')]);return _0x10cabb;})[_0xa6b4('0xd')](function(){_0x10cabb[_0xa6b4('0xf')]=_0xf284f9[_0xa6b4('0x34')][_0xa6b4('0xf')];_0x10cabb[_0xa6b4('0x39')]=null;_0x10cabb[_0xa6b4('0x4b')]=null;return _0x10cabb[_0xa6b4('0x4c')]();});})['then'](function(){_0xde7531[_0xa6b4('0x40')](0xc8)['send']({'message':'Password\x20reset!'});})['catch'](function(_0x5149a4){return handleError(_0xde7531,0x1f4,_0x5149a4);});};passport[_0xa6b4('0x4d')]('local-login',new LocalStrategy({'usernameField':_0xa6b4('0xe'),'passwordField':_0xa6b4('0xf')},function(_0x15cca9,_0x4f923e,_0x383ea9){return localAuthenticate(db['User'],_0x15cca9,_0x4f923e,_0x383ea9);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 60ae898..823deb4 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 _0x6007=['/reset/:token','reset','express','Router','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x202aa2,_0x584b66){var _0x4e8000=function(_0x400b30){while(--_0x400b30){_0x202aa2['push'](_0x202aa2['shift']());}};_0x4e8000(++_0x584b66);}(_0x6007,0x1b2));var _0x7600=function(_0x3e21f4,_0x43d310){_0x3e21f4=_0x3e21f4-0x0;var _0x40fc49=_0x6007[_0x3e21f4];return _0x40fc49;};'use strict';var express=require(_0x7600('0x0'));var router=express[_0x7600('0x1')]();var controller=require(_0x7600('0x2'));router[_0x7600('0x3')]('/',controller[_0x7600('0x4')]);router[_0x7600('0x3')](_0x7600('0x5'),controller[_0x7600('0x6')]);router[_0x7600('0x3')](_0x7600('0x7'),controller[_0x7600('0x8')]);module['exports']=router;
\ No newline at end of file
+var _0x9ac6=['exports','express','Router','./authLocal.controller','post','forgot','/reset/:token','reset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ac6,0x119));var _0x69ac=function(_0x563b77,_0x5f04b5){_0x563b77=_0x563b77-0x0;var _0x458a6b=_0x9ac6[_0x563b77];return _0x458a6b;};'use strict';var express=require(_0x69ac('0x0'));var router=express[_0x69ac('0x1')]();var controller=require(_0x69ac('0x2'));router[_0x69ac('0x3')]('/',controller['login']);router['post']('/forgot',controller[_0x69ac('0x4')]);router[_0x69ac('0x3')](_0x69ac('0x5'),controller[_0x69ac('0x6')]);module[_0x69ac('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 7de711c..58d297a 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 _0x2f4a=['exports','STRING','BOOLEAN','sequelize'];(function(_0x5a7d41,_0x4447e2){var _0x98d8fa=function(_0x2ce1cf){while(--_0x2ce1cf){_0x5a7d41['push'](_0x5a7d41['shift']());}};_0x98d8fa(++_0x4447e2);}(_0x2f4a,0x187));var _0xa2f4=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x2f4a[_0x37bd26];return _0xe83dc4;};'use strict';var Sequelize=require(_0xa2f4('0x0'));module[_0xa2f4('0x1')]={'name':{'type':Sequelize[_0xa2f4('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xa2f4('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xa2f4('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x703d=['sequelize','exports','STRING','BOOLEAN'];(function(_0x25d9a5,_0x31708a){var _0x166b18=function(_0x12cfee){while(--_0x12cfee){_0x25d9a5['push'](_0x25d9a5['shift']());}};_0x166b18(++_0x31708a);}(_0x703d,0x190));var _0xd703=function(_0xfc7051,_0x21e5a6){_0xfc7051=_0xfc7051-0x0;var _0x584180=_0x703d[_0xfc7051];return _0x584180;};'use strict';var Sequelize=require(_0xd703('0x0'));module[_0xd703('0x1')]={'name':{'type':Sequelize[_0xd703('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xd703('0x2')]},'description':{'type':Sequelize[_0xd703('0x2')]},'status':{'type':Sequelize[_0xd703('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 201d585..b3b6a64 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 _0x8fad=['create','body','Condition','addConditions','ids','omit','getConditions','Action','getActions','pick','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','length','query','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','fields','include','Automation','find'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x8fad,0x1a4));var _0xd8fa=function(_0x19e540,_0x597c37){_0x19e540=_0x19e540-0x0;var _0x2fefb6=_0x8fad[_0x19e540];return _0x2fefb6;};'use strict';var emlformat=require(_0xd8fa('0x0'));var rimraf=require(_0xd8fa('0x1'));var zipdir=require(_0xd8fa('0x2'));var jsonpatch=require(_0xd8fa('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd8fa('0x4'));var Mustache=require(_0xd8fa('0x5'));var util=require('util');var path=require(_0xd8fa('0x6'));var sox=require(_0xd8fa('0x7'));var csv=require(_0xd8fa('0x8'));var ejs=require(_0xd8fa('0x9'));var fs=require('fs');var fs_extra=require(_0xd8fa('0xa'));var _=require(_0xd8fa('0xb'));var squel=require(_0xd8fa('0xc'));var crypto=require(_0xd8fa('0xd'));var jsforce=require(_0xd8fa('0xe'));var deskjs=require(_0xd8fa('0xf'));var toCsv=require(_0xd8fa('0x8'));var querystring=require(_0xd8fa('0x10'));var Papa=require(_0xd8fa('0x11'));var Redis=require('ioredis');var authService=require(_0xd8fa('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd8fa('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd8fa('0x14'))('api');var utils=require(_0xd8fa('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd8fa('0x16'));var db=require(_0xd8fa('0x17'))['db'];function respondWithStatusCode(_0x51c64b,_0x272548){_0x272548=_0x272548||0xcc;return function(_0x35d263){if(_0x35d263){return _0x51c64b[_0xd8fa('0x18')](_0x272548);}return _0x51c64b[_0xd8fa('0x19')](_0x272548)[_0xd8fa('0x1a')]();};}function respondWithResult(_0x246819,_0xfaec91){_0xfaec91=_0xfaec91||0xc8;return function(_0x550da5){if(_0x550da5){return _0x246819[_0xd8fa('0x19')](_0xfaec91)[_0xd8fa('0x1b')](_0x550da5);}};}function respondWithFilteredResult(_0x42dc5e,_0x3afa46){return function(_0x3e65e3){if(_0x3e65e3){var _0x1d1afb=typeof _0x3afa46[_0xd8fa('0x1c')]===_0xd8fa('0x1d')&&typeof _0x3afa46[_0xd8fa('0x1e')]===_0xd8fa('0x1d');var _0x468056=_0x3e65e3[_0xd8fa('0x1f')];var _0x48a019=_0x1d1afb?0x0:_0x3afa46['offset'];var _0x54f28d=_0x1d1afb?_0x3e65e3[_0xd8fa('0x1f')]:_0x3afa46[_0xd8fa('0x1c')]+_0x3afa46[_0xd8fa('0x1e')];var _0x313d93;if(_0x54f28d>=_0x468056){_0x54f28d=_0x468056;_0x313d93=0xc8;}else{_0x313d93=0xce;}_0x42dc5e['status'](_0x313d93);return _0x42dc5e[_0xd8fa('0x20')](_0xd8fa('0x21'),_0x48a019+'-'+_0x54f28d+'/'+_0x468056)[_0xd8fa('0x1b')](_0x3e65e3);}return null;};}function patchUpdates(_0x33f94a){return function(_0x3d28c1){try{jsonpatch[_0xd8fa('0x22')](_0x3d28c1,_0x33f94a,!![]);}catch(_0x105286){return BPromise['reject'](_0x105286);}return _0x3d28c1[_0xd8fa('0x23')]();};}function saveUpdates(_0x117f93,_0x37b27b){return function(_0x54e737){if(_0x54e737){return _0x54e737[_0xd8fa('0x24')](_0x117f93)[_0xd8fa('0x25')](function(_0x16e7dc){return _0x16e7dc;});}return null;};}function removeEntity(_0x222c34,_0x55dd27){return function(_0x4e7106){if(_0x4e7106){return _0x4e7106[_0xd8fa('0x26')]()['then'](function(){_0x222c34[_0xd8fa('0x19')](0xcc)[_0xd8fa('0x1a')]();});}};}function handleEntityNotFound(_0x3d679e,_0x2f4b30){return function(_0x5c535f){if(!_0x5c535f){_0x3d679e['sendStatus'](0x194);}return _0x5c535f;};}function handleError(_0x55967c,_0x365982){_0x365982=_0x365982||0x1f4;return function(_0x12ba4f){logger[_0xd8fa('0x27')](_0x12ba4f['stack']);if(_0x12ba4f[_0xd8fa('0x28')]){delete _0x12ba4f[_0xd8fa('0x28')];}_0x55967c[_0xd8fa('0x19')](_0x365982)['send'](_0x12ba4f);};}exports['index']=function(_0x5b37a3,_0x53f446){var _0x23711d={},_0x50e99f={},_0x3d061e={'count':0x0,'rows':[]};var _0xfd6ac=_[_0xd8fa('0x29')](db['Automation'][_0xd8fa('0x2a')],function(_0x5209d7){return{'name':_0x5209d7[_0xd8fa('0x2b')],'type':_0x5209d7[_0xd8fa('0x2c')][_0xd8fa('0x2d')]};});_0x50e99f[_0xd8fa('0x2e')]=_[_0xd8fa('0x29')](_0xfd6ac,_0xd8fa('0x28'));_0x50e99f['query']=_[_0xd8fa('0x2f')](_0x5b37a3['query']);_0x50e99f[_0xd8fa('0x30')]=_[_0xd8fa('0x31')](_0x50e99f['model'],_0x50e99f['query']);_0x23711d['attributes']=_[_0xd8fa('0x31')](_0x50e99f[_0xd8fa('0x2e')],qs['fields'](_0x5b37a3['query']['fields']));_0x23711d['attributes']=_0x23711d[_0xd8fa('0x32')][_0xd8fa('0x33')]?_0x23711d[_0xd8fa('0x32')]:_0x50e99f['model'];if(!_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x35')](_0xd8fa('0x36'))){_0x23711d['limit']=qs[_0xd8fa('0x1e')](_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x1e')]);_0x23711d[_0xd8fa('0x1c')]=qs[_0xd8fa('0x1c')](_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x1c')]);}_0x23711d[_0xd8fa('0x37')]=qs[_0xd8fa('0x38')](_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x38')]);_0x23711d[_0xd8fa('0x39')]=qs[_0xd8fa('0x30')](_['pick'](_0x5b37a3[_0xd8fa('0x34')],_0x50e99f[_0xd8fa('0x30')]),_0xfd6ac);if(_0x5b37a3['query'][_0xd8fa('0x3a')]){_0x23711d[_0xd8fa('0x39')]=_[_0xd8fa('0x3b')](_0x23711d[_0xd8fa('0x39')],{'$or':_['map'](_0xfd6ac,function(_0x2ac500){if(_0x2ac500[_0xd8fa('0x2c')]!==_0xd8fa('0x3c')){var _0x5726cc={};_0x5726cc[_0x2ac500['name']]={'$like':'%'+_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x3a')]+'%'};return _0x5726cc;}})});}_0x23711d=_[_0xd8fa('0x3b')]({},_0x23711d,_0x5b37a3[_0xd8fa('0x3d')]);var _0x650ea7={'where':_0x23711d[_0xd8fa('0x39')]};return db['Automation'][_0xd8fa('0x1f')](_0x650ea7)[_0xd8fa('0x25')](function(_0x18476a){_0x3d061e['count']=_0x18476a;if(_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x3e')]){_0x23711d['include']=[{'all':!![]}];}return db['Automation'][_0xd8fa('0x3f')](_0x23711d);})[_0xd8fa('0x25')](function(_0x209e71){_0x3d061e[_0xd8fa('0x40')]=_0x209e71;return _0x3d061e;})[_0xd8fa('0x25')](respondWithFilteredResult(_0x53f446,_0x23711d))[_0xd8fa('0x41')](handleError(_0x53f446,null));};exports[_0xd8fa('0x42')]=function(_0x83eb25,_0x4702a2){var _0x5269fd={'raw':![],'where':{'id':_0x83eb25[_0xd8fa('0x43')]['id']}},_0x3c2dc5={};_0x3c2dc5[_0xd8fa('0x2e')]=_[_0xd8fa('0x2f')](db['Automation'][_0xd8fa('0x2a')]);_0x3c2dc5[_0xd8fa('0x34')]=_['keys'](_0x83eb25[_0xd8fa('0x34')]);_0x3c2dc5['filters']=_[_0xd8fa('0x31')](_0x3c2dc5['model'],_0x3c2dc5[_0xd8fa('0x34')]);_0x5269fd[_0xd8fa('0x32')]=_[_0xd8fa('0x31')](_0x3c2dc5[_0xd8fa('0x2e')],qs[_0xd8fa('0x44')](_0x83eb25[_0xd8fa('0x34')][_0xd8fa('0x44')]));_0x5269fd[_0xd8fa('0x32')]=_0x5269fd[_0xd8fa('0x32')][_0xd8fa('0x33')]?_0x5269fd['attributes']:_0x3c2dc5[_0xd8fa('0x2e')];if(_0x83eb25[_0xd8fa('0x34')]['includeAll']){_0x5269fd[_0xd8fa('0x45')]=[{'all':!![]}];}_0x5269fd=_[_0xd8fa('0x3b')]({},_0x5269fd,_0x83eb25[_0xd8fa('0x3d')]);return db[_0xd8fa('0x46')][_0xd8fa('0x47')](_0x5269fd)[_0xd8fa('0x25')](handleEntityNotFound(_0x4702a2,null))[_0xd8fa('0x25')](respondWithResult(_0x4702a2,null))[_0xd8fa('0x41')](handleError(_0x4702a2,null));};exports['create']=function(_0x18840e,_0x48887b){return db[_0xd8fa('0x46')][_0xd8fa('0x48')](_0x18840e[_0xd8fa('0x49')],{})['then'](respondWithResult(_0x48887b,0xc9))[_0xd8fa('0x41')](handleError(_0x48887b,null));};exports[_0xd8fa('0x24')]=function(_0x3725fb,_0x568930){if(_0x3725fb['body']['id']){delete _0x3725fb['body']['id'];}return db[_0xd8fa('0x46')]['find']({'where':{'id':_0x3725fb[_0xd8fa('0x43')]['id']}})['then'](handleEntityNotFound(_0x568930,null))['then'](saveUpdates(_0x3725fb[_0xd8fa('0x49')],null))[_0xd8fa('0x25')](respondWithResult(_0x568930,null))[_0xd8fa('0x41')](handleError(_0x568930,null));};exports['destroy']=function(_0x3428a1,_0x870a57){return db[_0xd8fa('0x46')][_0xd8fa('0x47')]({'where':{'id':_0x3428a1[_0xd8fa('0x43')]['id']}})[_0xd8fa('0x25')](handleEntityNotFound(_0x870a57,null))[_0xd8fa('0x25')](removeEntity(_0x870a57,null))[_0xd8fa('0x41')](handleError(_0x870a57,null));};exports['addConditions']=function(_0x1294f5,_0x3b487a,_0xf5b97e){return db[_0xd8fa('0x4a')]['find']({'where':{'id':_0x1294f5[_0xd8fa('0x43')]['id']}})[_0xd8fa('0x25')](handleEntityNotFound(_0x3b487a,null))[_0xd8fa('0x25')](function(_0x4d0d5a){if(_0x4d0d5a){return _0x4d0d5a[_0xd8fa('0x4b')](_0x1294f5[_0xd8fa('0x49')][_0xd8fa('0x4c')],_[_0xd8fa('0x4d')](_0x1294f5[_0xd8fa('0x49')],[_0xd8fa('0x4c'),'id'])||{});}})[_0xd8fa('0x25')](respondWithResult(_0x3b487a,null))[_0xd8fa('0x41')](handleError(_0x3b487a,null));};exports['getConditions']=function(_0x306871,_0x304580,_0x1ef13f){var _0x403c7f={};var _0x2608be={};var _0x5462b8;var _0xfa3e8a;return db[_0xd8fa('0x46')]['findOne']({'where':{'id':_0x306871[_0xd8fa('0x43')]['id']}})[_0xd8fa('0x25')](handleEntityNotFound(_0x304580,null))[_0xd8fa('0x25')](function(_0x56f4dc){if(_0x56f4dc){_0x5462b8=_0x56f4dc;_0x2608be[_0xd8fa('0x2e')]=_['keys'](db['Condition'][_0xd8fa('0x2a')]);_0x2608be[_0xd8fa('0x34')]=_['keys'](_0x306871[_0xd8fa('0x34')]);_0x2608be[_0xd8fa('0x30')]=_[_0xd8fa('0x31')](_0x2608be[_0xd8fa('0x2e')],_0x2608be['query']);_0x403c7f['attributes']=_['intersection'](_0x2608be[_0xd8fa('0x2e')],qs['fields'](_0x306871[_0xd8fa('0x34')][_0xd8fa('0x44')]));_0x403c7f[_0xd8fa('0x32')]=_0x403c7f[_0xd8fa('0x32')][_0xd8fa('0x33')]?_0x403c7f[_0xd8fa('0x32')]:_0x2608be[_0xd8fa('0x2e')];_0x403c7f[_0xd8fa('0x37')]=qs['sort'](_0x306871[_0xd8fa('0x34')]['sort']);_0x403c7f[_0xd8fa('0x39')]=qs[_0xd8fa('0x30')](_['pick'](_0x306871['query'],_0x2608be[_0xd8fa('0x30')]));if(_0x306871[_0xd8fa('0x34')]['filter']){_0x403c7f[_0xd8fa('0x39')]=_[_0xd8fa('0x3b')](_0x403c7f['where'],{'$or':_['map'](_0x403c7f[_0xd8fa('0x32')],function(_0x445b25){var _0x18c74f={};_0x18c74f[_0x445b25]={'$like':'%'+_0x306871[_0xd8fa('0x34')][_0xd8fa('0x3a')]+'%'};return _0x18c74f;})});}_0x403c7f=_[_0xd8fa('0x3b')]({},_0x403c7f,_0x306871[_0xd8fa('0x3d')]);return _0x5462b8[_0xd8fa('0x4e')](_0x403c7f);}})[_0xd8fa('0x25')](function(_0x25d758){if(_0x25d758){_0xfa3e8a=_0x25d758['length'];if(!_0x306871['query'][_0xd8fa('0x35')](_0xd8fa('0x36'))){_0x403c7f['limit']=qs['limit'](_0x306871[_0xd8fa('0x34')][_0xd8fa('0x1e')]);_0x403c7f['offset']=qs[_0xd8fa('0x1c')](_0x306871['query'][_0xd8fa('0x1c')]);}return _0x5462b8[_0xd8fa('0x4e')](_0x403c7f);}})[_0xd8fa('0x25')](function(_0x2e2d32){if(_0x2e2d32){return _0x2e2d32?{'count':_0xfa3e8a,'rows':_0x2e2d32}:null;}})[_0xd8fa('0x25')](respondWithResult(_0x304580,null))[_0xd8fa('0x41')](handleError(_0x304580,null));};exports['addActions']=function(_0x5676a7,_0x22f268,_0xb14774){return db[_0xd8fa('0x4f')][_0xd8fa('0x47')]({'where':{'id':_0x5676a7['params']['id']}})[_0xd8fa('0x25')](handleEntityNotFound(_0x22f268,null))[_0xd8fa('0x25')](function(_0x54c9c9){if(_0x54c9c9){return _0x54c9c9['addActions'](_0x5676a7[_0xd8fa('0x49')]['ids'],_[_0xd8fa('0x4d')](_0x5676a7[_0xd8fa('0x49')],[_0xd8fa('0x4c'),'id'])||{});}})[_0xd8fa('0x25')](respondWithResult(_0x22f268,null))[_0xd8fa('0x41')](handleError(_0x22f268,null));};exports[_0xd8fa('0x50')]=function(_0x2f38d9,_0x639d0,_0x3d3040){var _0x533caf={};var _0x248982={};var _0x309b9a;var _0x46661a;return db[_0xd8fa('0x46')]['findOne']({'where':{'id':_0x2f38d9[_0xd8fa('0x43')]['id']}})['then'](handleEntityNotFound(_0x639d0,null))['then'](function(_0x45421a){if(_0x45421a){_0x309b9a=_0x45421a;_0x248982[_0xd8fa('0x2e')]=_[_0xd8fa('0x2f')](db[_0xd8fa('0x4f')][_0xd8fa('0x2a')]);_0x248982[_0xd8fa('0x34')]=_['keys'](_0x2f38d9[_0xd8fa('0x34')]);_0x248982[_0xd8fa('0x30')]=_[_0xd8fa('0x31')](_0x248982['model'],_0x248982['query']);_0x533caf[_0xd8fa('0x32')]=_[_0xd8fa('0x31')](_0x248982['model'],qs[_0xd8fa('0x44')](_0x2f38d9[_0xd8fa('0x34')][_0xd8fa('0x44')]));_0x533caf[_0xd8fa('0x32')]=_0x533caf['attributes'][_0xd8fa('0x33')]?_0x533caf[_0xd8fa('0x32')]:_0x248982[_0xd8fa('0x2e')];_0x533caf[_0xd8fa('0x37')]=qs[_0xd8fa('0x38')](_0x2f38d9['query'][_0xd8fa('0x38')]);_0x533caf['where']=qs[_0xd8fa('0x30')](_[_0xd8fa('0x51')](_0x2f38d9[_0xd8fa('0x34')],_0x248982[_0xd8fa('0x30')]));if(_0x2f38d9['query'][_0xd8fa('0x3a')]){_0x533caf[_0xd8fa('0x39')]=_[_0xd8fa('0x3b')](_0x533caf['where'],{'$or':_[_0xd8fa('0x29')](_0x533caf[_0xd8fa('0x32')],function(_0x428d50){var _0x370eff={};_0x370eff[_0x428d50]={'$like':'%'+_0x2f38d9[_0xd8fa('0x34')][_0xd8fa('0x3a')]+'%'};return _0x370eff;})});}_0x533caf=_['merge']({},_0x533caf,_0x2f38d9['options']);return _0x309b9a['getActions'](_0x533caf);}})[_0xd8fa('0x25')](function(_0xc8e648){if(_0xc8e648){_0x46661a=_0xc8e648[_0xd8fa('0x33')];if(!_0x2f38d9[_0xd8fa('0x34')]['hasOwnProperty'](_0xd8fa('0x36'))){_0x533caf[_0xd8fa('0x1e')]=qs[_0xd8fa('0x1e')](_0x2f38d9['query'][_0xd8fa('0x1e')]);_0x533caf[_0xd8fa('0x1c')]=qs[_0xd8fa('0x1c')](_0x2f38d9[_0xd8fa('0x34')]['offset']);}return _0x309b9a[_0xd8fa('0x50')](_0x533caf);}})[_0xd8fa('0x25')](function(_0x118ffc){if(_0x118ffc){return _0x118ffc?{'count':_0x46661a,'rows':_0x118ffc}:null;}})[_0xd8fa('0x25')](respondWithResult(_0x639d0,null))['catch'](handleError(_0x639d0,null));};
\ No newline at end of file
+var _0xa524=['reject','save','update','then','destroy','end','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','include','create','body','params','find','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','count','offset','apply'];(function(_0x5919a0,_0x3d3c9a){var _0x1ccfaa=function(_0x3de102){while(--_0x3de102){_0x5919a0['push'](_0x5919a0['shift']());}};_0x1ccfaa(++_0x3d3c9a);}(_0xa524,0x83));var _0x4a52=function(_0x33925b,_0x95cfc6){_0x33925b=_0x33925b-0x0;var _0x375e21=_0xa524[_0x33925b];return _0x375e21;};'use strict';var emlformat=require(_0x4a52('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a52('0x1'));var jsonpatch=require(_0x4a52('0x2'));var rp=require(_0x4a52('0x3'));var moment=require('moment');var BPromise=require(_0x4a52('0x4'));var Mustache=require(_0x4a52('0x5'));var util=require(_0x4a52('0x6'));var path=require('path');var sox=require(_0x4a52('0x7'));var csv=require(_0x4a52('0x8'));var ejs=require(_0x4a52('0x9'));var fs=require('fs');var fs_extra=require(_0x4a52('0xa'));var _=require(_0x4a52('0xb'));var squel=require(_0x4a52('0xc'));var crypto=require(_0x4a52('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4a52('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4a52('0xf'));var Redis=require('ioredis');var authService=require(_0x4a52('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a52('0x11'))(_0x4a52('0x12'));var utils=require(_0x4a52('0x13'));var config=require(_0x4a52('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4a52('0x15'))['db'];function respondWithStatusCode(_0x299cfa,_0x5c940d){_0x5c940d=_0x5c940d||0xcc;return function(_0x1a2dc7){if(_0x1a2dc7){return _0x299cfa[_0x4a52('0x16')](_0x5c940d);}return _0x299cfa[_0x4a52('0x17')](_0x5c940d)['end']();};}function respondWithResult(_0x540d20,_0x33f74b){_0x33f74b=_0x33f74b||0xc8;return function(_0x5138b6){if(_0x5138b6){return _0x540d20[_0x4a52('0x17')](_0x33f74b)[_0x4a52('0x18')](_0x5138b6);}};}function respondWithFilteredResult(_0x247602,_0x1e589d){return function(_0x6806d5){if(_0x6806d5){var _0x4a53e3=typeof _0x1e589d['offset']==='undefined'&&typeof _0x1e589d[_0x4a52('0x19')]==='undefined';var _0x454c53=_0x6806d5[_0x4a52('0x1a')];var _0x440de4=_0x4a53e3?0x0:_0x1e589d[_0x4a52('0x1b')];var _0x5a772e=_0x4a53e3?_0x6806d5[_0x4a52('0x1a')]:_0x1e589d['offset']+_0x1e589d[_0x4a52('0x19')];var _0x30617b;if(_0x5a772e>=_0x454c53){_0x5a772e=_0x454c53;_0x30617b=0xc8;}else{_0x30617b=0xce;}_0x247602[_0x4a52('0x17')](_0x30617b);return _0x247602['set']('Content-Range',_0x440de4+'-'+_0x5a772e+'/'+_0x454c53)[_0x4a52('0x18')](_0x6806d5);}return null;};}function patchUpdates(_0x489627){return function(_0x46d07){try{jsonpatch[_0x4a52('0x1c')](_0x46d07,_0x489627,!![]);}catch(_0x3d6802){return BPromise[_0x4a52('0x1d')](_0x3d6802);}return _0x46d07[_0x4a52('0x1e')]();};}function saveUpdates(_0x25cb60,_0x3aeccd){return function(_0x51b755){if(_0x51b755){return _0x51b755[_0x4a52('0x1f')](_0x25cb60)[_0x4a52('0x20')](function(_0x2c280e){return _0x2c280e;});}return null;};}function removeEntity(_0x40cce4,_0x2910af){return function(_0x5774f2){if(_0x5774f2){return _0x5774f2[_0x4a52('0x21')]()['then'](function(){_0x40cce4['status'](0xcc)[_0x4a52('0x22')]();});}};}function handleEntityNotFound(_0x54c1e6,_0x3b4557){return function(_0x43ff7a){if(!_0x43ff7a){_0x54c1e6[_0x4a52('0x16')](0x194);}return _0x43ff7a;};}function handleError(_0x5a8180,_0x342d66){_0x342d66=_0x342d66||0x1f4;return function(_0x3b8abe){logger['error'](_0x3b8abe[_0x4a52('0x23')]);if(_0x3b8abe[_0x4a52('0x24')]){delete _0x3b8abe['name'];}_0x5a8180[_0x4a52('0x17')](_0x342d66)['send'](_0x3b8abe);};}exports[_0x4a52('0x25')]=function(_0x5e329d,_0x14f37d){var _0x5e8aba={},_0x228737={},_0x4c2a51={'count':0x0,'rows':[]};var _0x282bb6=_[_0x4a52('0x26')](db[_0x4a52('0x27')][_0x4a52('0x28')],function(_0x4ce016){return{'name':_0x4ce016[_0x4a52('0x29')],'type':_0x4ce016[_0x4a52('0x2a')][_0x4a52('0x2b')]};});_0x228737[_0x4a52('0x2c')]=_['map'](_0x282bb6,'name');_0x228737[_0x4a52('0x2d')]=_[_0x4a52('0x2e')](_0x5e329d['query']);_0x228737[_0x4a52('0x2f')]=_[_0x4a52('0x30')](_0x228737[_0x4a52('0x2c')],_0x228737['query']);_0x5e8aba['attributes']=_['intersection'](_0x228737[_0x4a52('0x2c')],qs[_0x4a52('0x31')](_0x5e329d['query'][_0x4a52('0x31')]));_0x5e8aba['attributes']=_0x5e8aba[_0x4a52('0x32')][_0x4a52('0x33')]?_0x5e8aba[_0x4a52('0x32')]:_0x228737[_0x4a52('0x2c')];if(!_0x5e329d[_0x4a52('0x2d')][_0x4a52('0x34')](_0x4a52('0x35'))){_0x5e8aba['limit']=qs[_0x4a52('0x19')](_0x5e329d[_0x4a52('0x2d')]['limit']);_0x5e8aba[_0x4a52('0x1b')]=qs[_0x4a52('0x1b')](_0x5e329d['query'][_0x4a52('0x1b')]);}_0x5e8aba[_0x4a52('0x36')]=qs[_0x4a52('0x37')](_0x5e329d[_0x4a52('0x2d')]['sort']);_0x5e8aba[_0x4a52('0x38')]=qs[_0x4a52('0x2f')](_[_0x4a52('0x39')](_0x5e329d['query'],_0x228737[_0x4a52('0x2f')]),_0x282bb6);if(_0x5e329d[_0x4a52('0x2d')][_0x4a52('0x3a')]){_0x5e8aba[_0x4a52('0x38')]=_[_0x4a52('0x3b')](_0x5e8aba[_0x4a52('0x38')],{'$or':_['map'](_0x282bb6,function(_0x51b940){if(_0x51b940[_0x4a52('0x2a')]!==_0x4a52('0x3c')){var _0xa9aab3={};_0xa9aab3[_0x51b940['name']]={'$like':'%'+_0x5e329d[_0x4a52('0x2d')]['filter']+'%'};return _0xa9aab3;}})});}_0x5e8aba=_[_0x4a52('0x3b')]({},_0x5e8aba,_0x5e329d[_0x4a52('0x3d')]);var _0x433fb5={'where':_0x5e8aba['where']};return db[_0x4a52('0x27')][_0x4a52('0x1a')](_0x433fb5)[_0x4a52('0x20')](function(_0x479f2b){_0x4c2a51[_0x4a52('0x1a')]=_0x479f2b;if(_0x5e329d[_0x4a52('0x2d')][_0x4a52('0x3e')]){_0x5e8aba['include']=[{'all':!![]}];}return db[_0x4a52('0x27')][_0x4a52('0x3f')](_0x5e8aba);})['then'](function(_0x1a0571){_0x4c2a51[_0x4a52('0x40')]=_0x1a0571;return _0x4c2a51;})[_0x4a52('0x20')](respondWithFilteredResult(_0x14f37d,_0x5e8aba))[_0x4a52('0x41')](handleError(_0x14f37d,null));};exports['show']=function(_0x2eb9c4,_0x22d151){var _0x26cbcf={'raw':![],'where':{'id':_0x2eb9c4['params']['id']}},_0x5db31f={};_0x5db31f[_0x4a52('0x2c')]=_['keys'](db['Automation'][_0x4a52('0x28')]);_0x5db31f[_0x4a52('0x2d')]=_[_0x4a52('0x2e')](_0x2eb9c4[_0x4a52('0x2d')]);_0x5db31f['filters']=_[_0x4a52('0x30')](_0x5db31f['model'],_0x5db31f['query']);_0x26cbcf['attributes']=_['intersection'](_0x5db31f['model'],qs[_0x4a52('0x31')](_0x2eb9c4[_0x4a52('0x2d')][_0x4a52('0x31')]));_0x26cbcf[_0x4a52('0x32')]=_0x26cbcf['attributes']['length']?_0x26cbcf[_0x4a52('0x32')]:_0x5db31f[_0x4a52('0x2c')];if(_0x2eb9c4[_0x4a52('0x2d')][_0x4a52('0x3e')]){_0x26cbcf[_0x4a52('0x42')]=[{'all':!![]}];}_0x26cbcf=_['merge']({},_0x26cbcf,_0x2eb9c4['options']);return db[_0x4a52('0x27')]['find'](_0x26cbcf)[_0x4a52('0x20')](handleEntityNotFound(_0x22d151,null))[_0x4a52('0x20')](respondWithResult(_0x22d151,null))['catch'](handleError(_0x22d151,null));};exports[_0x4a52('0x43')]=function(_0x16ff75,_0x383508){return db[_0x4a52('0x27')][_0x4a52('0x43')](_0x16ff75[_0x4a52('0x44')],{})['then'](respondWithResult(_0x383508,0xc9))[_0x4a52('0x41')](handleError(_0x383508,null));};exports[_0x4a52('0x1f')]=function(_0xaea45b,_0x20b0d8){if(_0xaea45b[_0x4a52('0x44')]['id']){delete _0xaea45b[_0x4a52('0x44')]['id'];}return db[_0x4a52('0x27')]['find']({'where':{'id':_0xaea45b[_0x4a52('0x45')]['id']}})[_0x4a52('0x20')](handleEntityNotFound(_0x20b0d8,null))[_0x4a52('0x20')](saveUpdates(_0xaea45b[_0x4a52('0x44')],null))['then'](respondWithResult(_0x20b0d8,null))[_0x4a52('0x41')](handleError(_0x20b0d8,null));};exports[_0x4a52('0x21')]=function(_0x4a7f27,_0x44483c){return db['Automation'][_0x4a52('0x46')]({'where':{'id':_0x4a7f27['params']['id']}})[_0x4a52('0x20')](handleEntityNotFound(_0x44483c,null))['then'](removeEntity(_0x44483c,null))[_0x4a52('0x41')](handleError(_0x44483c,null));};exports[_0x4a52('0x47')]=function(_0xea63e,_0x466e72,_0x3781a6){return db[_0x4a52('0x48')][_0x4a52('0x46')]({'where':{'id':_0xea63e[_0x4a52('0x45')]['id']}})['then'](handleEntityNotFound(_0x466e72,null))[_0x4a52('0x20')](function(_0x440797){if(_0x440797){return _0x440797[_0x4a52('0x47')](_0xea63e[_0x4a52('0x44')][_0x4a52('0x49')],_[_0x4a52('0x4a')](_0xea63e['body'],[_0x4a52('0x49'),'id'])||{});}})[_0x4a52('0x20')](respondWithResult(_0x466e72,null))[_0x4a52('0x41')](handleError(_0x466e72,null));};exports[_0x4a52('0x4b')]=function(_0x19c988,_0x7616f,_0x4c2699){var _0x318d3a={};var _0x3cfde1={};var _0x2feb47;var _0x2703ef;return db[_0x4a52('0x27')][_0x4a52('0x4c')]({'where':{'id':_0x19c988[_0x4a52('0x45')]['id']}})[_0x4a52('0x20')](handleEntityNotFound(_0x7616f,null))['then'](function(_0x2fdc8c){if(_0x2fdc8c){_0x2feb47=_0x2fdc8c;_0x3cfde1[_0x4a52('0x2c')]=_[_0x4a52('0x2e')](db['Condition']['rawAttributes']);_0x3cfde1[_0x4a52('0x2d')]=_['keys'](_0x19c988[_0x4a52('0x2d')]);_0x3cfde1['filters']=_[_0x4a52('0x30')](_0x3cfde1[_0x4a52('0x2c')],_0x3cfde1['query']);_0x318d3a['attributes']=_['intersection'](_0x3cfde1['model'],qs['fields'](_0x19c988[_0x4a52('0x2d')][_0x4a52('0x31')]));_0x318d3a['attributes']=_0x318d3a['attributes'][_0x4a52('0x33')]?_0x318d3a[_0x4a52('0x32')]:_0x3cfde1['model'];_0x318d3a[_0x4a52('0x36')]=qs[_0x4a52('0x37')](_0x19c988[_0x4a52('0x2d')][_0x4a52('0x37')]);_0x318d3a[_0x4a52('0x38')]=qs[_0x4a52('0x2f')](_[_0x4a52('0x39')](_0x19c988['query'],_0x3cfde1[_0x4a52('0x2f')]));if(_0x19c988[_0x4a52('0x2d')][_0x4a52('0x3a')]){_0x318d3a[_0x4a52('0x38')]=_[_0x4a52('0x3b')](_0x318d3a[_0x4a52('0x38')],{'$or':_['map'](_0x318d3a[_0x4a52('0x32')],function(_0x4a4993){var _0x4b8a77={};_0x4b8a77[_0x4a4993]={'$like':'%'+_0x19c988[_0x4a52('0x2d')][_0x4a52('0x3a')]+'%'};return _0x4b8a77;})});}_0x318d3a=_[_0x4a52('0x3b')]({},_0x318d3a,_0x19c988['options']);return _0x2feb47[_0x4a52('0x4b')](_0x318d3a);}})[_0x4a52('0x20')](function(_0x3a670f){if(_0x3a670f){_0x2703ef=_0x3a670f[_0x4a52('0x33')];if(!_0x19c988[_0x4a52('0x2d')][_0x4a52('0x34')](_0x4a52('0x35'))){_0x318d3a[_0x4a52('0x19')]=qs[_0x4a52('0x19')](_0x19c988['query'][_0x4a52('0x19')]);_0x318d3a['offset']=qs[_0x4a52('0x1b')](_0x19c988['query'][_0x4a52('0x1b')]);}return _0x2feb47[_0x4a52('0x4b')](_0x318d3a);}})[_0x4a52('0x20')](function(_0x50aec0){if(_0x50aec0){return _0x50aec0?{'count':_0x2703ef,'rows':_0x50aec0}:null;}})[_0x4a52('0x20')](respondWithResult(_0x7616f,null))['catch'](handleError(_0x7616f,null));};exports[_0x4a52('0x4d')]=function(_0x86079a,_0x128527,_0x453fed){return db[_0x4a52('0x4e')][_0x4a52('0x46')]({'where':{'id':_0x86079a[_0x4a52('0x45')]['id']}})[_0x4a52('0x20')](handleEntityNotFound(_0x128527,null))[_0x4a52('0x20')](function(_0x504e89){if(_0x504e89){return _0x504e89[_0x4a52('0x4d')](_0x86079a['body'][_0x4a52('0x49')],_[_0x4a52('0x4a')](_0x86079a[_0x4a52('0x44')],[_0x4a52('0x49'),'id'])||{});}})['then'](respondWithResult(_0x128527,null))[_0x4a52('0x41')](handleError(_0x128527,null));};exports[_0x4a52('0x4f')]=function(_0x5791ec,_0x3fe2f2,_0x4315db){var _0x13792c={};var _0x3f1438={};var _0x252d83;var _0x4628f6;return db['Automation'][_0x4a52('0x4c')]({'where':{'id':_0x5791ec['params']['id']}})[_0x4a52('0x20')](handleEntityNotFound(_0x3fe2f2,null))['then'](function(_0x5ca71f){if(_0x5ca71f){_0x252d83=_0x5ca71f;_0x3f1438[_0x4a52('0x2c')]=_[_0x4a52('0x2e')](db['Action'][_0x4a52('0x28')]);_0x3f1438[_0x4a52('0x2d')]=_['keys'](_0x5791ec['query']);_0x3f1438[_0x4a52('0x2f')]=_['intersection'](_0x3f1438[_0x4a52('0x2c')],_0x3f1438['query']);_0x13792c[_0x4a52('0x32')]=_[_0x4a52('0x30')](_0x3f1438['model'],qs['fields'](_0x5791ec[_0x4a52('0x2d')][_0x4a52('0x31')]));_0x13792c[_0x4a52('0x32')]=_0x13792c[_0x4a52('0x32')][_0x4a52('0x33')]?_0x13792c[_0x4a52('0x32')]:_0x3f1438[_0x4a52('0x2c')];_0x13792c[_0x4a52('0x36')]=qs[_0x4a52('0x37')](_0x5791ec[_0x4a52('0x2d')][_0x4a52('0x37')]);_0x13792c[_0x4a52('0x38')]=qs[_0x4a52('0x2f')](_[_0x4a52('0x39')](_0x5791ec[_0x4a52('0x2d')],_0x3f1438[_0x4a52('0x2f')]));if(_0x5791ec[_0x4a52('0x2d')][_0x4a52('0x3a')]){_0x13792c['where']=_[_0x4a52('0x3b')](_0x13792c[_0x4a52('0x38')],{'$or':_[_0x4a52('0x26')](_0x13792c['attributes'],function(_0x43c5c8){var _0x429d0e={};_0x429d0e[_0x43c5c8]={'$like':'%'+_0x5791ec[_0x4a52('0x2d')]['filter']+'%'};return _0x429d0e;})});}_0x13792c=_[_0x4a52('0x3b')]({},_0x13792c,_0x5791ec[_0x4a52('0x3d')]);return _0x252d83[_0x4a52('0x4f')](_0x13792c);}})['then'](function(_0x495799){if(_0x495799){_0x4628f6=_0x495799['length'];if(!_0x5791ec['query'][_0x4a52('0x34')](_0x4a52('0x35'))){_0x13792c['limit']=qs[_0x4a52('0x19')](_0x5791ec[_0x4a52('0x2d')]['limit']);_0x13792c[_0x4a52('0x1b')]=qs[_0x4a52('0x1b')](_0x5791ec[_0x4a52('0x2d')]['offset']);}return _0x252d83[_0x4a52('0x4f')](_0x13792c);}})[_0x4a52('0x20')](function(_0x27886b){if(_0x27886b){return _0x27886b?{'count':_0x4628f6,'rows':_0x27886b}:null;}})[_0x4a52('0x20')](respondWithResult(_0x3fe2f2,null))[_0x4a52('0x41')](handleError(_0x3fe2f2,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 3ccba71..360b6bc 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 _0xd558=['util','../../config/logger','api','moment','request-promise','path','rimraf','./automation.attributes','exports','define','tools_automations','lodash'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xd558,0xb3));var _0x8d55=function(_0x26bf59,_0x3fd050){_0x26bf59=_0x26bf59-0x0;var _0x14a039=_0xd558[_0x26bf59];return _0x14a039;};'use strict';var _=require(_0x8d55('0x0'));var util=require(_0x8d55('0x1'));var logger=require(_0x8d55('0x2'))(_0x8d55('0x3'));var moment=require(_0x8d55('0x4'));var BPromise=require('bluebird');var rp=require(_0x8d55('0x5'));var fs=require('fs');var path=require(_0x8d55('0x6'));var rimraf=require(_0x8d55('0x7'));var config=require('../../config/environment');var attributes=require(_0x8d55('0x8'));module[_0x8d55('0x9')]=function(_0x33e204,_0x4a4317){return _0x33e204[_0x8d55('0xa')]('Automation',attributes,{'tableName':_0x8d55('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x02e1=['moment','bluebird','request-promise','path','../../config/environment','exports','define','Automation','tools_automations','lodash','api'];(function(_0x411254,_0x3a4f1e){var _0x32c1e6=function(_0x166371){while(--_0x166371){_0x411254['push'](_0x411254['shift']());}};_0x32c1e6(++_0x3a4f1e);}(_0x02e1,0x132));var _0x102e=function(_0x419a47,_0x17697b){_0x419a47=_0x419a47-0x0;var _0x46ea5e=_0x02e1[_0x419a47];return _0x46ea5e;};'use strict';var _=require(_0x102e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x102e('0x1'));var moment=require(_0x102e('0x2'));var BPromise=require(_0x102e('0x3'));var rp=require(_0x102e('0x4'));var fs=require('fs');var path=require(_0x102e('0x5'));var rimraf=require('rimraf');var config=require(_0x102e('0x6'));var attributes=require('./automation.attributes');module[_0x102e('0x7')]=function(_0x1bfbcf,_0x37384a){return _0x1bfbcf[_0x102e('0x8')](_0x102e('0x9'),attributes,{'tableName':_0x102e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 990ee7b..aeb64c1 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 _0xf603=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xf603,0xeb));var _0x3f60=function(_0x34890c,_0x3ca746){_0x34890c=_0x34890c-0x0;var _0x129ef6=_0xf603[_0x34890c];return _0x129ef6;};'use strict';var _=require(_0x3f60('0x0'));var util=require(_0x3f60('0x1'));var moment=require(_0x3f60('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f60('0x3'));var fs=require('fs');var Redis=require(_0x3f60('0x4'));var db=require(_0x3f60('0x5'))['db'];var utils=require(_0x3f60('0x6'));var logger=require(_0x3f60('0x7'))('rpc');var config=require(_0x3f60('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3f60('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ec43c,_0x375f1e,_0x17659b){return new BPromise(function(_0x434249,_0x9282dd){return client['request'](_0x1ec43c,_0x17659b)[_0x3f60('0xa')](function(_0x33dcc8){logger[_0x3f60('0xb')](_0x3f60('0xc'),_0x375f1e,'request\x20sent');logger['debug'](_0x3f60('0xd'),_0x375f1e,_0x3f60('0xe'),JSON[_0x3f60('0xf')](_0x33dcc8));if(_0x33dcc8['error']){if(_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x11')]===0x1f4){logger[_0x3f60('0x10')]('Automation,\x20%s,\x20%s',_0x375f1e,_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x12')]);return _0x9282dd(_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x12')]);}logger[_0x3f60('0x10')](_0x3f60('0xc'),_0x375f1e,_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x12')]);return _0x434249(_0x33dcc8['error']['message']);}else{logger['info'](_0x3f60('0xc'),_0x375f1e,_0x3f60('0xe'));_0x434249(_0x33dcc8[_0x3f60('0x13')][_0x3f60('0x12')]);}})[_0x3f60('0x14')](function(_0x224982){logger[_0x3f60('0x10')](_0x3f60('0xc'),_0x375f1e,_0x224982);_0x9282dd(_0x224982);});});}
\ No newline at end of file
+var _0xb6fa=['then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2820f0,_0x3ff9bc){var _0x50a3f3=function(_0x20cf86){while(--_0x20cf86){_0x2820f0['push'](_0x2820f0['shift']());}};_0x50a3f3(++_0x3ff9bc);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x237f8b,_0xc5eddb){_0x237f8b=_0x237f8b-0x0;var _0x423f94=_0xb6fa[_0x237f8b];return _0x423f94;};'use strict';var _=require(_0xab6f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xab6f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab6f('0x2'))['db'];var utils=require(_0xab6f('0x3'));var logger=require('../../config/logger')(_0xab6f('0x4'));var config=require(_0xab6f('0x5'));var jayson=require(_0xab6f('0x6'));var client=jayson[_0xab6f('0x7')][_0xab6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x895acc,_0x16b84e,_0x1b4da9){return new BPromise(function(_0x46b0f6,_0x85cb19){return client[_0xab6f('0x9')](_0x895acc,_0x1b4da9)[_0xab6f('0xa')](function(_0x199f2d){logger[_0xab6f('0xb')](_0xab6f('0xc'),_0x16b84e,_0xab6f('0xd'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x16b84e,_0xab6f('0xd'),JSON[_0xab6f('0xe')](_0x199f2d));if(_0x199f2d['error']){if(_0x199f2d[_0xab6f('0xf')][_0xab6f('0x10')]===0x1f4){logger[_0xab6f('0xf')](_0xab6f('0xc'),_0x16b84e,_0x199f2d[_0xab6f('0xf')][_0xab6f('0x11')]);return _0x85cb19(_0x199f2d[_0xab6f('0xf')]['message']);}logger[_0xab6f('0xf')](_0xab6f('0xc'),_0x16b84e,_0x199f2d[_0xab6f('0xf')]['message']);return _0x46b0f6(_0x199f2d[_0xab6f('0xf')]['message']);}else{logger['info'](_0xab6f('0xc'),_0x16b84e,'request\x20sent');_0x46b0f6(_0x199f2d[_0xab6f('0x12')][_0xab6f('0x11')]);}})[_0xab6f('0x13')](function(_0x59b934){logger[_0xab6f('0xf')]('Automation,\x20%s,\x20%s',_0x16b84e,_0x59b934);_0x85cb19(_0x59b934);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 7aeb653..1cc4601 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 _0xc5b1=['getActions','post','create','addConditions','addActions','put','update','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions'];(function(_0x5d0b34,_0x20557b){var _0x472a0f=function(_0x3e7ff9){while(--_0x3e7ff9){_0x5d0b34['push'](_0x5d0b34['shift']());}};_0x472a0f(++_0x20557b);}(_0xc5b1,0x106));var _0x1c5b=function(_0x55889e,_0x466fbf){_0x55889e=_0x55889e-0x0;var _0x48a697=_0xc5b1[_0x55889e];return _0x48a697;};'use strict';var multer=require(_0x1c5b('0x0'));var util=require(_0x1c5b('0x1'));var path=require(_0x1c5b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1c5b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1c5b('0x4'));var config=require(_0x1c5b('0x5'));var controller=require('./automation.controller');router[_0x1c5b('0x6')]('/',auth['isAuthenticated'](),controller[_0x1c5b('0x7')]);router[_0x1c5b('0x6')](_0x1c5b('0x8'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0xa')]);router['get'](_0x1c5b('0xb'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0xc')]);router[_0x1c5b('0x6')](_0x1c5b('0xd'),auth['isAuthenticated'](),controller[_0x1c5b('0xe')]);router[_0x1c5b('0xf')]('/',auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x10')]);router[_0x1c5b('0xf')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x1c5b('0x11')]);router['post']('/:id/actions',auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x12')]);router[_0x1c5b('0x13')](_0x1c5b('0x8'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x14')]);router['delete'](_0x1c5b('0x8'),auth['isAuthenticated'](),controller[_0x1c5b('0x15')]);module[_0x1c5b('0x16')]=router;
\ No newline at end of file
+var _0x12dc=['./automation.controller','get','index','/:id','isAuthenticated','show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x10f060,_0x312a7b){var _0x512722=function(_0x2b0ce0){while(--_0x2b0ce0){_0x10f060['push'](_0x10f060['shift']());}};_0x512722(++_0x312a7b);}(_0x12dc,0xb4));var _0xc12d=function(_0x2a909c,_0x41eaf8){_0x2a909c=_0x2a909c-0x0;var _0x490155=_0x12dc[_0x2a909c];return _0x490155;};'use strict';var multer=require(_0xc12d('0x0'));var util=require(_0xc12d('0x1'));var path=require('path');var timeout=require(_0xc12d('0x2'));var express=require(_0xc12d('0x3'));var router=express[_0xc12d('0x4')]();var fs_extra=require(_0xc12d('0x5'));var auth=require(_0xc12d('0x6'));var interaction=require(_0xc12d('0x7'));var config=require(_0xc12d('0x8'));var controller=require(_0xc12d('0x9'));router[_0xc12d('0xa')]('/',auth['isAuthenticated'](),controller[_0xc12d('0xb')]);router[_0xc12d('0xa')](_0xc12d('0xc'),auth[_0xc12d('0xd')](),controller[_0xc12d('0xe')]);router[_0xc12d('0xa')]('/:id/conditions',auth[_0xc12d('0xd')](),controller[_0xc12d('0xf')]);router['get'](_0xc12d('0x10'),auth[_0xc12d('0xd')](),controller[_0xc12d('0x11')]);router[_0xc12d('0x12')]('/',auth[_0xc12d('0xd')](),controller[_0xc12d('0x13')]);router[_0xc12d('0x12')](_0xc12d('0x14'),auth[_0xc12d('0xd')](),controller[_0xc12d('0x15')]);router[_0xc12d('0x12')](_0xc12d('0x10'),auth[_0xc12d('0xd')](),controller[_0xc12d('0x16')]);router[_0xc12d('0x17')]('/:id',auth[_0xc12d('0xd')](),controller[_0xc12d('0x18')]);router['delete'](_0xc12d('0xc'),auth[_0xc12d('0xd')](),controller[_0xc12d('0x19')]);module[_0xc12d('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 682bf40..d369c06 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 _0xeb1c=['#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ENUM','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD'];(function(_0x193de9,_0x27d9d0){var _0x3c8210=function(_0x20d2e7){while(--_0x20d2e7){_0x193de9['push'](_0x193de9['shift']());}};_0x3c8210(++_0x27d9d0);}(_0xeb1c,0xa0));var _0xceb1=function(_0x19796e,_0x4802dc){_0x19796e=_0x19796e-0x0;var _0x45172a=_0xeb1c[_0x19796e];return _0x45172a;};'use strict';var Sequelize=require(_0xceb1('0x0'));module[_0xceb1('0x1')]={'name':{'type':Sequelize[_0xceb1('0x2')],'unique':_0xceb1('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xceb1('0x4')),'allowNull':![],'defaultValue':_0xceb1('0x4')},'description':{'type':Sequelize[_0xceb1('0x2')]},'active':{'type':Sequelize[_0xceb1('0x5')],'defaultValue':0x0,'comment':_0xceb1('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xceb1('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xceb1('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xceb1('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xceb1('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'comment':_0xceb1('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xceb1('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xceb1('0x2')],'defaultValue':_0xceb1('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xceb1('0x11'),'never',_0xceb1('0x12')),'defaultValue':_0xceb1('0x11')},'dialAMDActive':{'type':Sequelize[_0xceb1('0x5')],'defaultValue':0x0,'comment':_0xceb1('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xceb1('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xceb1('0x9')](0x9)[_0xceb1('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xceb1('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xceb1('0x9')](0x9)[_0xceb1('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xceb1('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xceb1('0x9')](0x9)[_0xceb1('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xceb1('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xceb1('0x9')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xceb1('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xceb1('0x9')](0x9)[_0xceb1('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xceb1('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xceb1('0x9')](0x9)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xceb1('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xceb1('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xceb1('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xceb1('0x1b')]('DESC',_0xceb1('0x1c')),'defaultValue':_0xceb1('0x1d')},'dialPrefix':{'type':Sequelize[_0xceb1('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xceb1('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xceb1('0x1e')},'dialCutDigit':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0x23')}};
\ No newline at end of file
+var _0xe03a=['Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC'];(function(_0x522a82,_0x40ebe6){var _0x173340=function(_0x173c77){while(--_0x173c77){_0x522a82['push'](_0x522a82['shift']());}};_0x173340(++_0x40ebe6);}(_0xe03a,0x130));var _0xae03=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe03a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xae03('0x0'));module['exports']={'name':{'type':Sequelize[_0xae03('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xae03('0x2')]('ivr'),'allowNull':![],'defaultValue':_0xae03('0x3')},'description':{'type':Sequelize[_0xae03('0x1')]},'active':{'type':Sequelize[_0xae03('0x4')],'defaultValue':0x0,'comment':_0xae03('0x5')},'limitCalls':{'type':Sequelize[_0xae03('0x6')](0x4)[_0xae03('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xae03('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xae03('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xae03('0x6')](0x3)[_0xae03('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae03('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae03('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xae03('0x6')](0x5)[_0xae03('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae03('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)[_0xae03('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae03('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xae03('0x6')](0x5)[_0xae03('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)[_0xae03('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xae03('0x6')](0x5)[_0xae03('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae03('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xae03('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xae03('0x1')],'defaultValue':_0xae03('0xe')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xae03('0xf'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xae03('0x4')],'defaultValue':0x0,'comment':_0xae03('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0xae03('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xae03('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xae03('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xae03('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xae03('0x6')](0x9)[_0xae03('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xae03('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xae03('0x6')](0x9)[_0xae03('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xae03('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xae03('0x6')](0x9)[_0xae03('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xae03('0x6')](0x9)[_0xae03('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xae03('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xae03('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xae03('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xae03('0x6')](0x9)[_0xae03('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xae03('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0xae03('0x2')](_0xae03('0x18'),_0xae03('0x19')),'defaultValue':_0xae03('0x18')},'dialPrefix':{'type':Sequelize[_0xae03('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xae03('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xae03('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xae03('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xae03('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)[_0xae03('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae03('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xae03('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)[_0xae03('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae03('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)[_0xae03('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xae03('0x6')](0x5)[_0xae03('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)[_0xae03('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xae03('0x6')](0x5)[_0xae03('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae03('0x1e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)[_0xae03('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae03('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xae03('0x6')](0x5)[_0xae03('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae03('0x20')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 9f54128..c4b9862 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 _0x4f8b=['COALESCE(phone,\x27\x27)','ListId\x20=\x20?','cm_hopper_additional_phones','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','removeBlackLists','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','sendStatus','stack','name','send','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Campaign','includeAll','include','findAll','catch','rawAttributes','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','create','error','clone','params','omit','createdAt','updatedAt','body','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','format','ids','spread','dialCheckDuplicateType','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','cm_hopper','onlyIfOpen','insert','into','fromQuery'];(function(_0x18036c,_0x25ac78){var _0x53b19f=function(_0x56f6d0){while(--_0x56f6d0){_0x18036c['push'](_0x18036c['shift']());}};_0x53b19f(++_0x25ac78);}(_0x4f8b,0x12e));var _0xb4f8=function(_0x45a666,_0x1ad7d3){_0x45a666=_0x45a666-0x0;var _0x813b90=_0x4f8b[_0x45a666];return _0x813b90;};'use strict';var emlformat=require(_0xb4f8('0x0'));var rimraf=require(_0xb4f8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb4f8('0x2'));var moment=require(_0xb4f8('0x3'));var BPromise=require(_0xb4f8('0x4'));var Mustache=require(_0xb4f8('0x5'));var util=require(_0xb4f8('0x6'));var path=require('path');var sox=require(_0xb4f8('0x7'));var csv=require(_0xb4f8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb4f8('0x9'));var _=require(_0xb4f8('0xa'));var squel=require('squel');var crypto=require(_0xb4f8('0xb'));var jsforce=require(_0xb4f8('0xc'));var deskjs=require(_0xb4f8('0xd'));var toCsv=require(_0xb4f8('0x8'));var querystring=require(_0xb4f8('0xe'));var Papa=require(_0xb4f8('0xf'));var Redis=require(_0xb4f8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb4f8('0x11'));var as=require(_0xb4f8('0x12'));var hardwareService=require(_0xb4f8('0x13'));var logger=require(_0xb4f8('0x14'))(_0xb4f8('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb4f8('0x16'))['db'];function respondWithStatusCode(_0x55f60b,_0x26c8fb){_0x26c8fb=_0x26c8fb||0xcc;return function(_0x1d0a37){if(_0x1d0a37){return _0x55f60b['sendStatus'](_0x26c8fb);}return _0x55f60b[_0xb4f8('0x17')](_0x26c8fb)[_0xb4f8('0x18')]();};}function respondWithResult(_0xacdbad,_0x309b62){_0x309b62=_0x309b62||0xc8;return function(_0x4d3017){if(_0x4d3017){return _0xacdbad[_0xb4f8('0x17')](_0x309b62)[_0xb4f8('0x19')](_0x4d3017);}};}function respondWithFilteredResult(_0x39ed9e,_0x4f00a0){return function(_0x2061e2){if(_0x2061e2){var _0x47ebe5=typeof _0x4f00a0[_0xb4f8('0x1a')]===_0xb4f8('0x1b')&&typeof _0x4f00a0[_0xb4f8('0x1c')]===_0xb4f8('0x1b');var _0x578e4c=_0x2061e2[_0xb4f8('0x1d')];var _0x4c3e35=_0x47ebe5?0x0:_0x4f00a0[_0xb4f8('0x1a')];var _0x1a50bd=_0x47ebe5?_0x2061e2[_0xb4f8('0x1d')]:_0x4f00a0['offset']+_0x4f00a0[_0xb4f8('0x1c')];var _0x4eff64;if(_0x1a50bd>=_0x578e4c){_0x1a50bd=_0x578e4c;_0x4eff64=0xc8;}else{_0x4eff64=0xce;}_0x39ed9e[_0xb4f8('0x17')](_0x4eff64);return _0x39ed9e['set'](_0xb4f8('0x1e'),_0x4c3e35+'-'+_0x1a50bd+'/'+_0x578e4c)[_0xb4f8('0x19')](_0x2061e2);}return null;};}function patchUpdates(_0x1c1a84){return function(_0x380649){try{jsonpatch[_0xb4f8('0x1f')](_0x380649,_0x1c1a84,!![]);}catch(_0x3ef98c){return BPromise[_0xb4f8('0x20')](_0x3ef98c);}return _0x380649['save']();};}function saveUpdates(_0x53ce83,_0x4415e7){return function(_0x35311c){if(_0x35311c){return _0x35311c[_0xb4f8('0x21')](_0x53ce83)[_0xb4f8('0x22')](function(_0x2bfdf2){return _0x2bfdf2;});}return null;};}function removeEntity(_0x56eb04,_0x3eb502){return function(_0x3a37e9){if(_0x3a37e9){return _0x3a37e9['destroy']()[_0xb4f8('0x22')](function(){var _0x18efcb=_0x3a37e9[_0xb4f8('0x23')]({'plain':!![]});var _0x54e6fc=_0xb4f8('0x24');return db[_0xb4f8('0x25')][_0xb4f8('0x26')]({'where':{'type':_0x54e6fc,'resourceId':_0x18efcb['id']}})['then'](function(){return _0x3a37e9;});})[_0xb4f8('0x22')](function(){_0x56eb04[_0xb4f8('0x17')](0xcc)[_0xb4f8('0x18')]();});}};}function handleEntityNotFound(_0x5ab6ac,_0x46d85e){return function(_0x1847c6){if(!_0x1847c6){_0x5ab6ac[_0xb4f8('0x27')](0x194);}return _0x1847c6;};}function handleError(_0x2801d9,_0x2183e1){_0x2183e1=_0x2183e1||0x1f4;return function(_0x44ed1f){logger['error'](_0x44ed1f[_0xb4f8('0x28')]);if(_0x44ed1f[_0xb4f8('0x29')]){delete _0x44ed1f[_0xb4f8('0x29')];}_0x2801d9[_0xb4f8('0x17')](_0x2183e1)[_0xb4f8('0x2a')](_0x44ed1f);};}exports['index']=function(_0x45cd75,_0xd58c27){var _0xfbd30f={},_0x511bf8={},_0x3b3a40={'count':0x0,'rows':[]};var _0x312f9a=_['map'](db['Campaign']['rawAttributes'],function(_0x5c5899){return{'name':_0x5c5899[_0xb4f8('0x2b')],'type':_0x5c5899[_0xb4f8('0x2c')][_0xb4f8('0x2d')]};});_0x511bf8[_0xb4f8('0x2e')]=_[_0xb4f8('0x2f')](_0x312f9a,_0xb4f8('0x29'));_0x511bf8['query']=_[_0xb4f8('0x30')](_0x45cd75[_0xb4f8('0x31')]);_0x511bf8[_0xb4f8('0x32')]=_[_0xb4f8('0x33')](_0x511bf8[_0xb4f8('0x2e')],_0x511bf8[_0xb4f8('0x31')]);_0xfbd30f['attributes']=_[_0xb4f8('0x33')](_0x511bf8['model'],qs['fields'](_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0xfbd30f[_0xb4f8('0x35')]=_0xfbd30f['attributes'][_0xb4f8('0x36')]?_0xfbd30f[_0xb4f8('0x35')]:_0x511bf8[_0xb4f8('0x2e')];if(!_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0xfbd30f['limit']=qs[_0xb4f8('0x1c')](_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0xfbd30f['offset']=qs[_0xb4f8('0x1a')](_0x45cd75['query']['offset']);}_0xfbd30f[_0xb4f8('0x39')]=qs[_0xb4f8('0x3a')](_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x3a')]);_0xfbd30f[_0xb4f8('0x3b')]=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0x45cd75['query'],_0x511bf8[_0xb4f8('0x32')]),_0x312f9a);if(_0x45cd75['query'][_0xb4f8('0x3d')]){_0xfbd30f['where']=_['merge'](_0xfbd30f[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x312f9a,function(_0x45a398){if(_0x45a398[_0xb4f8('0x2c')]!=='VIRTUAL'){var _0x61fbbb={};_0x61fbbb[_0x45a398[_0xb4f8('0x29')]]={'$like':'%'+_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x61fbbb;}})});}_0xfbd30f=_[_0xb4f8('0x3e')]({},_0xfbd30f,_0x45cd75[_0xb4f8('0x3f')]);var _0x541c17={'where':_0xfbd30f['where']};return db[_0xb4f8('0x40')][_0xb4f8('0x1d')](_0x541c17)[_0xb4f8('0x22')](function(_0x468066){_0x3b3a40[_0xb4f8('0x1d')]=_0x468066;if(_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x41')]){_0xfbd30f[_0xb4f8('0x42')]=[{'all':!![]}];}return db[_0xb4f8('0x40')][_0xb4f8('0x43')](_0xfbd30f);})[_0xb4f8('0x22')](function(_0x10910c){_0x3b3a40['rows']=_0x10910c;return _0x3b3a40;})['then'](respondWithFilteredResult(_0xd58c27,_0xfbd30f))[_0xb4f8('0x44')](handleError(_0xd58c27,null));};exports['show']=function(_0x3ebe57,_0x2b5526){var _0xb7ccef={'raw':![],'where':{'id':_0x3ebe57['params']['id']}},_0x20d4ef={};_0x20d4ef[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db['Campaign'][_0xb4f8('0x45')]);_0x20d4ef[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x3ebe57['query']);_0x20d4ef[_0xb4f8('0x32')]=_['intersection'](_0x20d4ef['model'],_0x20d4ef[_0xb4f8('0x31')]);_0xb7ccef[_0xb4f8('0x35')]=_[_0xb4f8('0x33')](_0x20d4ef[_0xb4f8('0x2e')],qs[_0xb4f8('0x34')](_0x3ebe57[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0xb7ccef[_0xb4f8('0x35')]=_0xb7ccef[_0xb4f8('0x35')][_0xb4f8('0x36')]?_0xb7ccef[_0xb4f8('0x35')]:_0x20d4ef['model'];if(_0x3ebe57[_0xb4f8('0x31')][_0xb4f8('0x41')]){_0xb7ccef[_0xb4f8('0x42')]=[{'all':!![]}];}_0xb7ccef=_['merge']({},_0xb7ccef,_0x3ebe57['options']);return db[_0xb4f8('0x40')][_0xb4f8('0x46')](_0xb7ccef)[_0xb4f8('0x22')](handleEntityNotFound(_0x2b5526,null))[_0xb4f8('0x22')](respondWithResult(_0x2b5526,null))['catch'](handleError(_0x2b5526,null));};exports['create']=function(_0x354193,_0xd6f96a){return db[_0xb4f8('0x40')]['create'](_0x354193['body'],{})[_0xb4f8('0x22')](function(_0x209080){var _0x5af092=_0x354193['user'][_0xb4f8('0x23')]({'plain':!![]});if(!_0x5af092)throw new Error(_0xb4f8('0x47'));if(_0x5af092[_0xb4f8('0x48')]===_0xb4f8('0x49')){var _0x764bee=_0x209080[_0xb4f8('0x23')]({'plain':!![]});var _0x2bedde='IvrCampaigns';return db['UserProfileSection'][_0xb4f8('0x46')]({'where':{'name':_0x2bedde,'userProfileId':_0x5af092[_0xb4f8('0x4a')]},'raw':!![]})[_0xb4f8('0x22')](function(_0x26b3e9){if(_0x26b3e9&&_0x26b3e9[_0xb4f8('0x4b')]===0x0){return db[_0xb4f8('0x25')][_0xb4f8('0x4c')]({'name':_0x764bee[_0xb4f8('0x29')],'resourceId':_0x764bee['id'],'type':_0x26b3e9[_0xb4f8('0x29')],'sectionId':_0x26b3e9['id']},{})[_0xb4f8('0x22')](function(){return _0x209080;});}else{return _0x209080;}})[_0xb4f8('0x44')](function(_0x2fa127){logger[_0xb4f8('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fa127);throw _0x2fa127;});}return _0x209080;})[_0xb4f8('0x22')](respondWithResult(_0xd6f96a,0xc9))[_0xb4f8('0x44')](handleError(_0xd6f96a,null));};exports[_0xb4f8('0x4e')]=function(_0x145972,_0x26ec45){var _0x19723f={'where':{'id':_0x145972[_0xb4f8('0x4f')]['id']}},_0x4f7d97={};_0x4f7d97[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x40')][_0xb4f8('0x45')]);_0x19723f[_0xb4f8('0x35')]=_['intersection'](_0x4f7d97[_0xb4f8('0x2e')],qs['fields'](_0x145972['query'][_0xb4f8('0x34')]));_0x19723f[_0xb4f8('0x35')]=_0x19723f[_0xb4f8('0x35')]['length']?_0x19723f['attributes']:_0x4f7d97[_0xb4f8('0x2e')];if(_0x145972[_0xb4f8('0x31')][_0xb4f8('0x41')]){_0x19723f[_0xb4f8('0x42')]=[{'all':!![]}];}_0x19723f=_[_0xb4f8('0x3e')]({},_0x19723f,_0x145972[_0xb4f8('0x3f')]);return db[_0xb4f8('0x40')][_0xb4f8('0x46')](_0x19723f)['then'](handleEntityNotFound(_0x26ec45,null))[_0xb4f8('0x22')](function(_0x2b5f3b){if(_0x2b5f3b){var _0xb7ff27=_0x2b5f3b[_0xb4f8('0x23')]({'plain':!![]});_0xb7ff27=qs[_0xb4f8('0x50')](_0xb7ff27,['id',_0xb4f8('0x51'),_0xb4f8('0x52')]);_0x145972[_0xb4f8('0x53')]=_[_0xb4f8('0x50')](_0x145972[_0xb4f8('0x53')],['id',_0xb4f8('0x51'),_0xb4f8('0x52')]);return db['Campaign'][_0xb4f8('0x4c')](_[_0xb4f8('0x3e')](_0xb7ff27,_0x145972[_0xb4f8('0x53')]),{'include':_0x145972['query']['includeAll']?[{'all':!![]}]:undefined})[_0xb4f8('0x22')](function(_0x190860){var _0x2b0e43=_0x145972[_0xb4f8('0x49')]['get']({'plain':!![]});if(!_0x2b0e43)throw new Error(_0xb4f8('0x47'));if(_0x2b0e43[_0xb4f8('0x48')]===_0xb4f8('0x49')){var _0x2b7c6f=_0x190860[_0xb4f8('0x23')]({'plain':!![]});var _0x2ed38c=_0xb4f8('0x24');return db['UserProfileSection'][_0xb4f8('0x46')]({'where':{'name':_0x2ed38c,'userProfileId':_0x2b0e43['userProfileId']},'raw':!![]})[_0xb4f8('0x22')](function(_0x4335a2){if(_0x4335a2&&_0x4335a2[_0xb4f8('0x4b')]===0x0){return db[_0xb4f8('0x25')][_0xb4f8('0x4c')]({'name':_0x2b7c6f[_0xb4f8('0x29')],'resourceId':_0x2b7c6f['id'],'type':_0x4335a2[_0xb4f8('0x29')],'sectionId':_0x4335a2['id']},{})[_0xb4f8('0x22')](function(){return _0x190860;});}else{return _0x190860;}})[_0xb4f8('0x44')](function(_0xe413a6){logger['error'](_0xb4f8('0x54'),_0xe413a6);throw _0xe413a6;});}return _0x190860;});}})[_0xb4f8('0x22')](respondWithResult(_0x26ec45,0xc9))['catch'](handleError(_0x26ec45,null));};exports[_0xb4f8('0x21')]=function(_0x5181da,_0x51036a){if(_0x5181da['body']['id']){delete _0x5181da[_0xb4f8('0x53')]['id'];}return db[_0xb4f8('0x40')]['find']({'where':{'id':_0x5181da[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x51036a,null))[_0xb4f8('0x22')](saveUpdates(_0x5181da[_0xb4f8('0x53')],null))[_0xb4f8('0x22')](respondWithResult(_0x51036a,null))['catch'](handleError(_0x51036a,null));};exports['destroy']=function(_0x287159,_0x4ad8cc){return db[_0xb4f8('0x40')][_0xb4f8('0x46')]({'where':{'id':_0x287159['params']['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x4ad8cc,null))['then'](removeEntity(_0x4ad8cc,null))[_0xb4f8('0x44')](handleError(_0x4ad8cc,null));};exports[_0xb4f8('0x55')]=function(_0x3d7c55,_0x27957e,_0x5cf35f){var _0x5c61c3={'raw':!![],'where':{}};var _0x2bf0af={};var _0x452fad={'count':0x0,'rows':[]};return db['Campaign'][_0xb4f8('0x56')]({'where':{'id':_0x3d7c55[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x27957e,null))[_0xb4f8('0x22')](function(_0x5b91b7){if(_0x5b91b7){_0x2bf0af[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x57')][_0xb4f8('0x45')]);_0x2bf0af[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x3d7c55['query']);_0x2bf0af[_0xb4f8('0x32')]=_['intersection'](_0x2bf0af[_0xb4f8('0x2e')],_0x2bf0af[_0xb4f8('0x31')]);_0x5c61c3[_0xb4f8('0x35')]=_['intersection'](_0x2bf0af[_0xb4f8('0x2e')],qs[_0xb4f8('0x34')](_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0x5c61c3[_0xb4f8('0x35')]=_0x5c61c3[_0xb4f8('0x35')]['length']?_0x5c61c3[_0xb4f8('0x35')]:_0x2bf0af[_0xb4f8('0x2e')];if(!_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0x5c61c3[_0xb4f8('0x1c')]=qs[_0xb4f8('0x1c')](_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0x5c61c3[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x1a')]);}_0x5c61c3[_0xb4f8('0x39')]=qs[_0xb4f8('0x3a')](_0x3d7c55[_0xb4f8('0x31')]['sort']);_0x5c61c3[_0xb4f8('0x3b')]=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0x3d7c55[_0xb4f8('0x31')],_0x2bf0af[_0xb4f8('0x32')]));_0x5c61c3[_0xb4f8('0x3b')][_0xb4f8('0x58')]=_0x5b91b7['id'];if(_0x3d7c55[_0xb4f8('0x31')]['filter']){_0x5c61c3[_0xb4f8('0x3b')]=_[_0xb4f8('0x3e')](_0x5c61c3[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x5c61c3[_0xb4f8('0x35')],function(_0x33d582){var _0x1ebf98={};_0x1ebf98[_0x33d582]={'$like':'%'+_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x1ebf98;})});}_0x5c61c3=_[_0xb4f8('0x3e')]({},_0x5c61c3,_0x3d7c55[_0xb4f8('0x3f')]);return db[_0xb4f8('0x57')][_0xb4f8('0x1d')]({'where':_0x5c61c3[_0xb4f8('0x3b')]})['then'](function(_0x504d70){_0x452fad['count']=_0x504d70;if(_0x3d7c55['query'][_0xb4f8('0x41')]){_0x5c61c3[_0xb4f8('0x42')]=[{'all':!![]}];}return db['CmHopper'][_0xb4f8('0x43')](_0x5c61c3);})['then'](function(_0x157c94){_0x452fad[_0xb4f8('0x59')]=_0x157c94;return _0x452fad;});}})['then'](respondWithFilteredResult(_0x27957e,_0x5c61c3))[_0xb4f8('0x44')](handleError(_0x27957e,null));};exports[_0xb4f8('0x5a')]=function(_0x3b0a96,_0x143f5e,_0xd679bb){var _0x38cf92={'raw':!![],'where':{}};var _0x10e684={};var _0x38ff42={'count':0x0,'rows':[]};return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0x3b0a96[_0xb4f8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x143f5e,null))[_0xb4f8('0x22')](function(_0x328f16){if(_0x328f16){_0x10e684[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db['CmHopperHistory']['rawAttributes']);_0x10e684[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x3b0a96[_0xb4f8('0x31')]);_0x10e684[_0xb4f8('0x32')]=_[_0xb4f8('0x33')](_0x10e684[_0xb4f8('0x2e')],_0x10e684[_0xb4f8('0x31')]);_0x38cf92[_0xb4f8('0x35')]=_['intersection'](_0x10e684[_0xb4f8('0x2e')],qs[_0xb4f8('0x34')](_0x3b0a96['query']['fields']));_0x38cf92[_0xb4f8('0x35')]=_0x38cf92[_0xb4f8('0x35')]['length']?_0x38cf92['attributes']:_0x10e684[_0xb4f8('0x2e')];if(!_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x37')]('nolimit')){_0x38cf92[_0xb4f8('0x1c')]=qs[_0xb4f8('0x1c')](_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0x38cf92[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x1a')]);}_0x38cf92[_0xb4f8('0x39')]=qs['sort'](_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x3a')]);_0x38cf92[_0xb4f8('0x3b')]=qs['filters'](_[_0xb4f8('0x3c')](_0x3b0a96['query'],_0x10e684['filters']));_0x38cf92[_0xb4f8('0x3b')]['CampaignId']=_0x328f16['id'];if(_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0x38cf92[_0xb4f8('0x3b')]=_[_0xb4f8('0x3e')](_0x38cf92[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x38cf92[_0xb4f8('0x35')],function(_0x6fdde9){var _0x56a972={};_0x56a972[_0x6fdde9]={'$like':'%'+_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x56a972;})});}_0x38cf92=_[_0xb4f8('0x3e')]({},_0x38cf92,_0x3b0a96[_0xb4f8('0x3f')]);return db[_0xb4f8('0x5b')]['count']({'where':_0x38cf92['where']})[_0xb4f8('0x22')](function(_0x11107c){_0x38ff42[_0xb4f8('0x1d')]=_0x11107c;if(_0x3b0a96['query'][_0xb4f8('0x41')]){_0x38cf92[_0xb4f8('0x42')]=[{'all':!![]}];}return db[_0xb4f8('0x5b')]['findAll'](_0x38cf92);})[_0xb4f8('0x22')](function(_0x51ac1c){_0x38ff42[_0xb4f8('0x59')]=_0x51ac1c;return _0x38ff42;});}})[_0xb4f8('0x22')](respondWithFilteredResult(_0x143f5e,_0x38cf92))[_0xb4f8('0x44')](handleError(_0x143f5e,null));};exports[_0xb4f8('0x5c')]=function(_0x2293de,_0x7efc72,_0x28ee6d){var _0x190b52={'raw':!![],'where':{}};var _0x16e5d1={};var _0x5f2268={'count':0x0,'rows':[]};return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0x2293de[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x7efc72,null))[_0xb4f8('0x22')](function(_0x260599){if(_0x260599){_0x16e5d1[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x5d')][_0xb4f8('0x45')]);_0x16e5d1[_0xb4f8('0x31')]=_['keys'](_0x2293de[_0xb4f8('0x31')]);_0x16e5d1[_0xb4f8('0x32')]=_['intersection'](_0x16e5d1[_0xb4f8('0x2e')],_0x16e5d1[_0xb4f8('0x31')]);_0x190b52[_0xb4f8('0x35')]=_[_0xb4f8('0x33')](_0x16e5d1[_0xb4f8('0x2e')],qs[_0xb4f8('0x34')](_0x2293de[_0xb4f8('0x31')]['fields']));_0x190b52[_0xb4f8('0x35')]=_0x190b52[_0xb4f8('0x35')][_0xb4f8('0x36')]?_0x190b52[_0xb4f8('0x35')]:_0x16e5d1['model'];if(!_0x2293de['query'][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0x190b52[_0xb4f8('0x1c')]=qs[_0xb4f8('0x1c')](_0x2293de[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0x190b52[_0xb4f8('0x1a')]=qs['offset'](_0x2293de['query'][_0xb4f8('0x1a')]);}_0x190b52['order']=qs[_0xb4f8('0x3a')](_0x2293de['query'][_0xb4f8('0x3a')]);_0x190b52['where']=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0x2293de[_0xb4f8('0x31')],_0x16e5d1[_0xb4f8('0x32')]));_0x190b52['where']['CampaignId']=_0x260599['id'];if(_0x2293de[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0x190b52[_0xb4f8('0x3b')]=_['merge'](_0x190b52[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x190b52[_0xb4f8('0x35')],function(_0x49ce04){var _0x429b74={};_0x429b74[_0x49ce04]={'$like':'%'+_0x2293de[_0xb4f8('0x31')]['filter']+'%'};return _0x429b74;})});}_0x190b52=_[_0xb4f8('0x3e')]({},_0x190b52,_0x2293de[_0xb4f8('0x3f')]);return db[_0xb4f8('0x5d')][_0xb4f8('0x1d')]({'where':_0x190b52[_0xb4f8('0x3b')]})[_0xb4f8('0x22')](function(_0x317852){_0x5f2268[_0xb4f8('0x1d')]=_0x317852;if(_0x2293de[_0xb4f8('0x31')][_0xb4f8('0x41')]){_0x190b52['include']=[{'all':!![]}];}return db[_0xb4f8('0x5d')][_0xb4f8('0x43')](_0x190b52);})[_0xb4f8('0x22')](function(_0x832959){_0x5f2268[_0xb4f8('0x59')]=_0x832959;return _0x5f2268;});}})[_0xb4f8('0x22')](respondWithFilteredResult(_0x7efc72,_0x190b52))['catch'](handleError(_0x7efc72,null));};exports['getHopperBlacks']=function(_0x4c3a22,_0x22e240,_0x523834){var _0x1d0f50={'raw':!![],'where':{}};var _0x5cdcf1={};var _0x13ca9c={'count':0x0,'rows':[]};return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0x4c3a22['params']['id']}})['then'](handleEntityNotFound(_0x22e240,null))['then'](function(_0xeaf7ea){if(_0xeaf7ea){_0x5cdcf1[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x5e')][_0xb4f8('0x45')]);_0x5cdcf1[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x4c3a22[_0xb4f8('0x31')]);_0x5cdcf1[_0xb4f8('0x32')]=_[_0xb4f8('0x33')](_0x5cdcf1[_0xb4f8('0x2e')],_0x5cdcf1[_0xb4f8('0x31')]);_0x1d0f50['attributes']=_[_0xb4f8('0x33')](_0x5cdcf1['model'],qs[_0xb4f8('0x34')](_0x4c3a22[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0x1d0f50[_0xb4f8('0x35')]=_0x1d0f50[_0xb4f8('0x35')]['length']?_0x1d0f50[_0xb4f8('0x35')]:_0x5cdcf1[_0xb4f8('0x2e')];if(!_0x4c3a22[_0xb4f8('0x31')][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0x1d0f50['limit']=qs[_0xb4f8('0x1c')](_0x4c3a22['query']['limit']);_0x1d0f50[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0x4c3a22[_0xb4f8('0x31')]['offset']);}_0x1d0f50[_0xb4f8('0x39')]=qs[_0xb4f8('0x3a')](_0x4c3a22['query'][_0xb4f8('0x3a')]);_0x1d0f50[_0xb4f8('0x3b')]=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0x4c3a22[_0xb4f8('0x31')],_0x5cdcf1[_0xb4f8('0x32')]));_0x1d0f50['where']['CampaignId']=_0xeaf7ea['id'];if(_0x4c3a22[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0x1d0f50[_0xb4f8('0x3b')]=_[_0xb4f8('0x3e')](_0x1d0f50[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x1d0f50[_0xb4f8('0x35')],function(_0x217727){var _0x402bc5={};_0x402bc5[_0x217727]={'$like':'%'+_0x4c3a22[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x402bc5;})});}_0x1d0f50=_['merge']({},_0x1d0f50,_0x4c3a22['options']);return db[_0xb4f8('0x5e')][_0xb4f8('0x1d')]({'where':_0x1d0f50[_0xb4f8('0x3b')]})[_0xb4f8('0x22')](function(_0x2f783c){_0x13ca9c[_0xb4f8('0x1d')]=_0x2f783c;if(_0x4c3a22['query']['includeAll']){_0x1d0f50[_0xb4f8('0x42')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xb4f8('0x43')](_0x1d0f50);})[_0xb4f8('0x22')](function(_0x4db640){_0x13ca9c[_0xb4f8('0x59')]=_0x4db640;return _0x13ca9c;});}})[_0xb4f8('0x22')](respondWithFilteredResult(_0x22e240,_0x1d0f50))[_0xb4f8('0x44')](handleError(_0x22e240,null));};exports['getLists']=function(_0x544389,_0x52dde0,_0x4ad351){var _0x9510d1={};var _0x16a448={};var _0x359578;var _0x1bf012;return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0x544389[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x52dde0,null))[_0xb4f8('0x22')](function(_0x2fcef7){if(_0x2fcef7){_0x359578=_0x2fcef7;_0x16a448[_0xb4f8('0x2e')]=_['keys'](db[_0xb4f8('0x5f')][_0xb4f8('0x45')]);_0x16a448[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x544389[_0xb4f8('0x31')]);_0x16a448['filters']=_[_0xb4f8('0x33')](_0x16a448[_0xb4f8('0x2e')],_0x16a448[_0xb4f8('0x31')]);_0x9510d1['attributes']=_[_0xb4f8('0x33')](_0x16a448[_0xb4f8('0x2e')],qs['fields'](_0x544389[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0x9510d1['attributes']=_0x9510d1[_0xb4f8('0x35')]['length']?_0x9510d1[_0xb4f8('0x35')]:_0x16a448[_0xb4f8('0x2e')];_0x9510d1[_0xb4f8('0x39')]=qs[_0xb4f8('0x3a')](_0x544389['query'][_0xb4f8('0x3a')]);_0x9510d1[_0xb4f8('0x3b')]=qs['filters'](_[_0xb4f8('0x3c')](_0x544389[_0xb4f8('0x31')],_0x16a448['filters']));if(_0x544389[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0x9510d1['where']=_[_0xb4f8('0x3e')](_0x9510d1[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x9510d1['attributes'],function(_0x39dfec){var _0x22475={};_0x22475[_0x39dfec]={'$like':'%'+_0x544389[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x22475;})});}_0x9510d1=_[_0xb4f8('0x3e')]({},_0x9510d1,_0x544389[_0xb4f8('0x3f')]);return _0x359578[_0xb4f8('0x60')](_0x9510d1);}})[_0xb4f8('0x22')](function(_0x650c44){if(_0x650c44){_0x1bf012=_0x650c44[_0xb4f8('0x36')];if(!_0x544389[_0xb4f8('0x31')][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0x9510d1['limit']=qs[_0xb4f8('0x1c')](_0x544389['query'][_0xb4f8('0x1c')]);_0x9510d1[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0x544389['query'][_0xb4f8('0x1a')]);}return _0x359578['getLists'](_0x9510d1);}})[_0xb4f8('0x22')](function(_0x57a8eb){if(_0x57a8eb){return _0x57a8eb?{'count':_0x1bf012,'rows':_0x57a8eb}:null;}})['then'](respondWithResult(_0x52dde0,null))[_0xb4f8('0x44')](handleError(_0x52dde0,null));};exports[_0xb4f8('0x61')]=function(_0x13ff2e,_0x2c3742,_0x261fda){var _0x3377ed,_0xbdc026;var _0x1cdb4e=[];var _0x5e598b=moment()[_0xb4f8('0x62')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xb4f8('0x40')]['find']({'where':{'id':_0x13ff2e[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x2c3742,null))[_0xb4f8('0x22')](function(_0x3c6af0){if(_0x3c6af0){_0xbdc026=_0x3c6af0;return _0x3c6af0[_0xb4f8('0x61')](_0x13ff2e[_0xb4f8('0x53')][_0xb4f8('0x63')],_[_0xb4f8('0x50')](_0x13ff2e[_0xb4f8('0x53')],[_0xb4f8('0x63'),'id'])||{});}return null;})[_0xb4f8('0x64')](function(_0x41e7e3){var _0x2da7b7;var _0x2f77e4;_0x3377ed=_0x41e7e3||[];var _0x1a27fd=[];if(_0x41e7e3){for(var _0x223316=0x0;_0x223316<_0x41e7e3[_0xb4f8('0x36')];_0x223316+=0x1){var _0x3c6efe=_0x41e7e3[_0x223316][_0xb4f8('0x23')]({'plain':!![]});_0xbdc026[_0xb4f8('0x65')]=_0x13ff2e['body'][_0xb4f8('0x65')]?_0x13ff2e['body'][_0xb4f8('0x65')]:_0xbdc026[_0xb4f8('0x65')];switch(_0xbdc026[_0xb4f8('0x65')]){case'always':_0x2da7b7=squel['insert']()['into']('cm_hopper')['fromQuery']([_0xb4f8('0x66'),_0xb4f8('0x67'),_0xb4f8('0x68'),_0xb4f8('0x69'),'CampaignId',_0xb4f8('0x51'),_0xb4f8('0x52')],squel[_0xb4f8('0x6a')]()['field'](_0xb4f8('0x66'),_0xb4f8('0x66'))[_0xb4f8('0x6b')](_0xb4f8('0x6c'),_0xb4f8('0x67'))[_0xb4f8('0x6b')]('id','ContactId')[_0xb4f8('0x6b')](_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')](),_0xb4f8('0x69'))[_0xb4f8('0x6b')](_0x13ff2e['params']['id'][_0xb4f8('0x6e')](),_0xb4f8('0x58'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27','createdAt')[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27',_0xb4f8('0x52'))['from'](_0xb4f8('0x6f'))['where'](_0xb4f8('0x70'))[_0xb4f8('0x3b')]('ListId\x20=\x20?',_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')]())['where'](_0xb4f8('0x71'))[_0xb4f8('0x3b')](_0xb4f8('0x72'),squel[_0xb4f8('0x6a')]()[_0xb4f8('0x6b')](_0xb4f8('0x73'))[_0xb4f8('0x74')](_0xb4f8('0x75'))[_0xb4f8('0x3b')](_0xb4f8('0x76'),_0x13ff2e[_0xb4f8('0x4f')]['id']['toString']()))[_0xb4f8('0x3b')](_0xb4f8('0x72'),squel[_0xb4f8('0x6a')]()[_0xb4f8('0x6b')]('COALESCE(phone,\x27\x27)')[_0xb4f8('0x74')](_0xb4f8('0x77'))[_0xb4f8('0x3b')]('CampaignId\x20=\x20?',_0x13ff2e[_0xb4f8('0x4f')]['id'][_0xb4f8('0x6e')]())))[_0xb4f8('0x6e')]();break;case _0xb4f8('0x78'):_0x2da7b7=squel[_0xb4f8('0x79')]()[_0xb4f8('0x7a')]('cm_hopper')[_0xb4f8('0x7b')](['phone',_0xb4f8('0x67'),'ContactId','ListId','CampaignId',_0xb4f8('0x51'),'updatedAt'],squel[_0xb4f8('0x6a')]()['field']('phone',_0xb4f8('0x66'))['field'](_0xb4f8('0x6c'),_0xb4f8('0x67'))['field']('id',_0xb4f8('0x68'))[_0xb4f8('0x6b')](_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')](),_0xb4f8('0x69'))[_0xb4f8('0x6b')](_0x13ff2e[_0xb4f8('0x4f')]['id']['toString'](),_0xb4f8('0x58'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27',_0xb4f8('0x51'))['field']('\x27'+_0x5e598b+'\x27','updatedAt')[_0xb4f8('0x74')](_0xb4f8('0x6f'))[_0xb4f8('0x3b')]('deletedAt\x20IS\x20NULL')[_0xb4f8('0x3b')]('ListId\x20=\x20?',_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')]())[_0xb4f8('0x3b')](_0xb4f8('0x71'))[_0xb4f8('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xb4f8('0x7c'))[_0xb4f8('0x74')](_0xb4f8('0x77'))[_0xb4f8('0x3b')](_0xb4f8('0x76'),_0x13ff2e['params']['id'][_0xb4f8('0x6e')]())))[_0xb4f8('0x6e')]();break;default:_0x2da7b7=squel[_0xb4f8('0x79')]()[_0xb4f8('0x7a')](_0xb4f8('0x77'))[_0xb4f8('0x7b')](['phone',_0xb4f8('0x67'),_0xb4f8('0x68'),_0xb4f8('0x69'),_0xb4f8('0x58'),_0xb4f8('0x51'),_0xb4f8('0x52')],squel['select']()[_0xb4f8('0x6b')]('phone',_0xb4f8('0x66'))['field'](_0xb4f8('0x6c'),_0xb4f8('0x67'))['field']('id',_0xb4f8('0x68'))[_0xb4f8('0x6b')](_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')](),_0xb4f8('0x69'))[_0xb4f8('0x6b')](_0x13ff2e[_0xb4f8('0x4f')]['id'][_0xb4f8('0x6e')](),_0xb4f8('0x58'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27',_0xb4f8('0x51'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27',_0xb4f8('0x52'))[_0xb4f8('0x74')](_0xb4f8('0x6f'))[_0xb4f8('0x3b')](_0xb4f8('0x70'))[_0xb4f8('0x3b')](_0xb4f8('0x7d'),_0x3c6efe['CmListId'][_0xb4f8('0x6e')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xb4f8('0x6e')]();}_0x2f77e4=squel[_0xb4f8('0x79')]()['into'](_0xb4f8('0x7e'))['fromQuery'](['cmHopperId','scheduledAt','phone','OrderBy',_0xb4f8('0x51'),'updatedAt'],squel[_0xb4f8('0x6a')]()['field'](_0xb4f8('0x7f'),'id')[_0xb4f8('0x6b')](_0xb4f8('0x6c'),_0xb4f8('0x67'))[_0xb4f8('0x6b')](_0xb4f8('0x80'),'phone')['field'](_0xb4f8('0x81'),_0xb4f8('0x82'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27','createdAt')[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27','updatedAt')[_0xb4f8('0x74')](_0xb4f8('0x83'),'ci')['join'](_0xb4f8('0x77'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0xb4f8('0x3b')](_0xb4f8('0x84'),_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')]())[_0xb4f8('0x3b')](_0xb4f8('0x85'),_0x13ff2e[_0xb4f8('0x4f')]['id'][_0xb4f8('0x6e')]())['where']('h.createdAt\x20=\x20?',_0x5e598b))[_0xb4f8('0x6e')]();_0x1a27fd[_0xb4f8('0x86')](db[_0xb4f8('0x87')]['query'](_0x2da7b7));_0x1cdb4e['push'](db[_0xb4f8('0x87')][_0xb4f8('0x31')](_0x2f77e4));}return BPromise[_0xb4f8('0x88')](_0x1a27fd);}})['then'](function(){return BPromise[_0xb4f8('0x88')](_0x1cdb4e);})[_0xb4f8('0x22')](function(){return _0x3377ed;})[_0xb4f8('0x22')](respondWithResult(_0x2c3742,null))[_0xb4f8('0x44')](handleError(_0x2c3742,null));};exports[_0xb4f8('0x89')]=function(_0x24352f,_0xf312f2,_0x1b8554){return db['Campaign'][_0xb4f8('0x46')]({'where':{'id':_0x24352f[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0xf312f2,null))[_0xb4f8('0x22')](function(_0x24a96c){if(_0x24a96c){return _0x24a96c[_0xb4f8('0x89')](_0x24352f['query'][_0xb4f8('0x63')]);}})[_0xb4f8('0x22')](function(_0x512186){if(_0x512186){return db[_0xb4f8('0x57')][_0xb4f8('0x26')]({'where':{'ListId':_0x24352f[_0xb4f8('0x31')][_0xb4f8('0x63')],'CampaignId':_0x24352f[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](function(){return _0x512186;});}})[_0xb4f8('0x22')](respondWithStatusCode(_0xf312f2,null))[_0xb4f8('0x44')](handleError(_0xf312f2,null));};exports[_0xb4f8('0x8a')]=function(_0xcb45c2,_0x3fc537,_0x4dc1b7){var _0xd35ee9={};var _0x231489={};var _0x26479;var _0x6448bf;return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0xcb45c2[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x3fc537,null))[_0xb4f8('0x22')](function(_0x3cfce2){if(_0x3cfce2){_0x26479=_0x3cfce2;_0x231489[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x5f')][_0xb4f8('0x45')]);_0x231489[_0xb4f8('0x31')]=_['keys'](_0xcb45c2[_0xb4f8('0x31')]);_0x231489[_0xb4f8('0x32')]=_[_0xb4f8('0x33')](_0x231489[_0xb4f8('0x2e')],_0x231489['query']);_0xd35ee9[_0xb4f8('0x35')]=_[_0xb4f8('0x33')](_0x231489['model'],qs[_0xb4f8('0x34')](_0xcb45c2[_0xb4f8('0x31')]['fields']));_0xd35ee9[_0xb4f8('0x35')]=_0xd35ee9[_0xb4f8('0x35')][_0xb4f8('0x36')]?_0xd35ee9[_0xb4f8('0x35')]:_0x231489['model'];_0xd35ee9[_0xb4f8('0x39')]=qs['sort'](_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x3a')]);_0xd35ee9[_0xb4f8('0x3b')]=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0xcb45c2[_0xb4f8('0x31')],_0x231489['filters']));if(_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0xd35ee9[_0xb4f8('0x3b')]=_[_0xb4f8('0x3e')](_0xd35ee9[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0xd35ee9[_0xb4f8('0x35')],function(_0x558c26){var _0x2dda50={};_0x2dda50[_0x558c26]={'$like':'%'+_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x2dda50;})});}_0xd35ee9=_['merge']({},_0xd35ee9,_0xcb45c2[_0xb4f8('0x3f')]);return _0x26479[_0xb4f8('0x8a')](_0xd35ee9);}})[_0xb4f8('0x22')](function(_0x5289c9){if(_0x5289c9){_0x6448bf=_0x5289c9[_0xb4f8('0x36')];if(!_0xcb45c2[_0xb4f8('0x31')]['hasOwnProperty']('nolimit')){_0xd35ee9[_0xb4f8('0x1c')]=qs['limit'](_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0xd35ee9[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x1a')]);}return _0x26479[_0xb4f8('0x8a')](_0xd35ee9);}})[_0xb4f8('0x22')](function(_0x40329d){if(_0x40329d){return _0x40329d?{'count':_0x6448bf,'rows':_0x40329d}:null;}})[_0xb4f8('0x22')](respondWithResult(_0x3fc537,null))[_0xb4f8('0x44')](handleError(_0x3fc537,null));};exports[_0xb4f8('0x8b')]=function(_0x503f08,_0x5a22a0,_0x319c39){var _0x2360b0,_0x48f759;var _0x4f686c=[];var _0x314d21=moment()[_0xb4f8('0x62')](_0xb4f8('0x8c'));return db['Campaign'][_0xb4f8('0x46')]({'where':{'id':_0x503f08[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x5a22a0,null))['then'](function(_0x18c7d3){if(_0x18c7d3){_0x48f759=_0x18c7d3;return _0x18c7d3[_0xb4f8('0x8b')](_0x503f08['body'][_0xb4f8('0x63')],_[_0xb4f8('0x50')](_0x503f08['body'],[_0xb4f8('0x63'),'id'])||{});}return null;})[_0xb4f8('0x64')](function(_0x4abfd0){var _0x19a586;var _0x4b4456;_0x2360b0=_0x4abfd0||[];var _0x53365d=[];if(_0x4abfd0){for(var _0x221c3a=0x0;_0x221c3a<_0x4abfd0['length'];_0x221c3a+=0x1){var _0x3ac0cc=_0x4abfd0[_0x221c3a][_0xb4f8('0x23')]({'plain':!![]});_0x19a586=squel[_0xb4f8('0x79')]()[_0xb4f8('0x7a')]('cm_hopper_black')[_0xb4f8('0x7b')](['phone',_0xb4f8('0x68'),_0xb4f8('0x69'),'CampaignId','createdAt',_0xb4f8('0x52')],squel[_0xb4f8('0x6a')]()[_0xb4f8('0x6b')]('phone',_0xb4f8('0x66'))[_0xb4f8('0x6b')]('id',_0xb4f8('0x68'))['field'](_0x3ac0cc[_0xb4f8('0x6d')][_0xb4f8('0x6e')](),_0xb4f8('0x69'))[_0xb4f8('0x6b')](_0x503f08[_0xb4f8('0x4f')]['id'][_0xb4f8('0x6e')](),'CampaignId')[_0xb4f8('0x6b')](_0xb4f8('0x6c'),_0xb4f8('0x51'))[_0xb4f8('0x6b')](_0xb4f8('0x6c'),'updatedAt')[_0xb4f8('0x74')](_0xb4f8('0x6f'))[_0xb4f8('0x3b')](_0xb4f8('0x70'))[_0xb4f8('0x3b')](_0xb4f8('0x7d'),_0x3ac0cc[_0xb4f8('0x6d')][_0xb4f8('0x6e')]())[_0xb4f8('0x3b')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x53365d[_0xb4f8('0x86')](db[_0xb4f8('0x87')][_0xb4f8('0x31')](_0x19a586));}return BPromise[_0xb4f8('0x88')](_0x53365d);}})[_0xb4f8('0x22')](function(){return _0x2360b0;})['then'](respondWithResult(_0x5a22a0,null))[_0xb4f8('0x44')](handleError(_0x5a22a0,null));};exports[_0xb4f8('0x8d')]=function(_0x5100d8,_0x380ca2,_0x13523d){return db[_0xb4f8('0x40')]['find']({'where':{'id':_0x5100d8[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x380ca2,null))[_0xb4f8('0x22')](function(_0x1df1a4){if(_0x1df1a4){return _0x1df1a4['removeBlackLists'](_0x5100d8[_0xb4f8('0x31')][_0xb4f8('0x63')]);}})[_0xb4f8('0x22')](function(_0x19346f){if(_0x19346f){return db[_0xb4f8('0x5e')][_0xb4f8('0x26')]({'where':{'ListId':_0x5100d8[_0xb4f8('0x31')][_0xb4f8('0x63')],'CampaignId':_0x5100d8[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](function(){return _0x19346f;});}})[_0xb4f8('0x22')](respondWithStatusCode(_0x380ca2,null))[_0xb4f8('0x44')](handleError(_0x380ca2,null));};
\ No newline at end of file
+var _0xf78d=['getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','IvrCampaigns','UserProfileResource','error','name','send','index','map','Campaign','rawAttributes','key','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','keys','options','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','catch','clone','find','omit','updatedAt','body','createdAt','findOne','CmHopper','order','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','phone','ContactId','ListId','select','field','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','fromQuery','NOW()','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists'];(function(_0x4a7b46,_0x5e916c){var _0x436bee=function(_0x1c98ba){while(--_0x1c98ba){_0x4a7b46['push'](_0x4a7b46['shift']());}};_0x436bee(++_0x5e916c);}(_0xf78d,0x1c7));var _0xdf78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf78d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf78('0x0'));var zipdir=require(_0xdf78('0x1'));var jsonpatch=require(_0xdf78('0x2'));var rp=require(_0xdf78('0x3'));var moment=require(_0xdf78('0x4'));var BPromise=require(_0xdf78('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdf78('0x6'));var sox=require(_0xdf78('0x7'));var csv=require(_0xdf78('0x8'));var ejs=require(_0xdf78('0x9'));var fs=require('fs');var fs_extra=require(_0xdf78('0xa'));var _=require(_0xdf78('0xb'));var squel=require(_0xdf78('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdf78('0xd'));var toCsv=require(_0xdf78('0x8'));var querystring=require('querystring');var Papa=require(_0xdf78('0xe'));var Redis=require(_0xdf78('0xf'));var authService=require(_0xdf78('0x10'));var qs=require(_0xdf78('0x11'));var as=require(_0xdf78('0x12'));var hardwareService=require(_0xdf78('0x13'));var logger=require(_0xdf78('0x14'))(_0xdf78('0x15'));var utils=require(_0xdf78('0x16'));var config=require(_0xdf78('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdf78('0x18'))['db'];function respondWithStatusCode(_0x568d77,_0x3b801f){_0x3b801f=_0x3b801f||0xcc;return function(_0x264c77){if(_0x264c77){return _0x568d77[_0xdf78('0x19')](_0x3b801f);}return _0x568d77[_0xdf78('0x1a')](_0x3b801f)[_0xdf78('0x1b')]();};}function respondWithResult(_0x3c3756,_0x49da82){_0x49da82=_0x49da82||0xc8;return function(_0x4d572d){if(_0x4d572d){return _0x3c3756[_0xdf78('0x1a')](_0x49da82)[_0xdf78('0x1c')](_0x4d572d);}};}function respondWithFilteredResult(_0x2c8038,_0x3bd337){return function(_0x38eeb7){if(_0x38eeb7){var _0x1a6afb=typeof _0x3bd337['offset']===_0xdf78('0x1d')&&typeof _0x3bd337[_0xdf78('0x1e')]===_0xdf78('0x1d');var _0x11dc81=_0x38eeb7[_0xdf78('0x1f')];var _0x9f719b=_0x1a6afb?0x0:_0x3bd337['offset'];var _0x47cc46=_0x1a6afb?_0x38eeb7['count']:_0x3bd337[_0xdf78('0x20')]+_0x3bd337[_0xdf78('0x1e')];var _0x2a869b;if(_0x47cc46>=_0x11dc81){_0x47cc46=_0x11dc81;_0x2a869b=0xc8;}else{_0x2a869b=0xce;}_0x2c8038[_0xdf78('0x1a')](_0x2a869b);return _0x2c8038[_0xdf78('0x21')]('Content-Range',_0x9f719b+'-'+_0x47cc46+'/'+_0x11dc81)[_0xdf78('0x1c')](_0x38eeb7);}return null;};}function patchUpdates(_0xd5e2ff){return function(_0x2e21fd){try{jsonpatch[_0xdf78('0x22')](_0x2e21fd,_0xd5e2ff,!![]);}catch(_0x5b40b3){return BPromise[_0xdf78('0x23')](_0x5b40b3);}return _0x2e21fd[_0xdf78('0x24')]();};}function saveUpdates(_0x490671,_0x486e90){return function(_0x3e6e9a){if(_0x3e6e9a){return _0x3e6e9a[_0xdf78('0x25')](_0x490671)['then'](function(_0x1ae1f8){return _0x1ae1f8;});}return null;};}function removeEntity(_0x358fc7,_0x13d9eb){return function(_0x109bb3){if(_0x109bb3){return _0x109bb3[_0xdf78('0x26')]()[_0xdf78('0x27')](function(){var _0x464c7e=_0x109bb3['get']({'plain':!![]});var _0x23c13e=_0xdf78('0x28');return db[_0xdf78('0x29')][_0xdf78('0x26')]({'where':{'type':_0x23c13e,'resourceId':_0x464c7e['id']}})['then'](function(){return _0x109bb3;});})[_0xdf78('0x27')](function(){_0x358fc7[_0xdf78('0x1a')](0xcc)[_0xdf78('0x1b')]();});}};}function handleEntityNotFound(_0x4bea0e,_0x29c7d1){return function(_0x43c853){if(!_0x43c853){_0x4bea0e[_0xdf78('0x19')](0x194);}return _0x43c853;};}function handleError(_0x4e33b2,_0x3bc0ee){_0x3bc0ee=_0x3bc0ee||0x1f4;return function(_0xb43a55){logger[_0xdf78('0x2a')](_0xb43a55['stack']);if(_0xb43a55[_0xdf78('0x2b')]){delete _0xb43a55[_0xdf78('0x2b')];}_0x4e33b2[_0xdf78('0x1a')](_0x3bc0ee)[_0xdf78('0x2c')](_0xb43a55);};}exports[_0xdf78('0x2d')]=function(_0x477a0a,_0x26a253){var _0x274d63={},_0x2582af={},_0xd346b2={'count':0x0,'rows':[]};var _0x7dad59=_[_0xdf78('0x2e')](db[_0xdf78('0x2f')][_0xdf78('0x30')],function(_0x586115){return{'name':_0x586115['fieldName'],'type':_0x586115['type'][_0xdf78('0x31')]};});_0x2582af[_0xdf78('0x32')]=_[_0xdf78('0x2e')](_0x7dad59,_0xdf78('0x2b'));_0x2582af['query']=_['keys'](_0x477a0a['query']);_0x2582af['filters']=_[_0xdf78('0x33')](_0x2582af[_0xdf78('0x32')],_0x2582af[_0xdf78('0x34')]);_0x274d63[_0xdf78('0x35')]=_[_0xdf78('0x33')](_0x2582af['model'],qs[_0xdf78('0x36')](_0x477a0a[_0xdf78('0x34')][_0xdf78('0x36')]));_0x274d63[_0xdf78('0x35')]=_0x274d63[_0xdf78('0x35')][_0xdf78('0x37')]?_0x274d63[_0xdf78('0x35')]:_0x2582af[_0xdf78('0x32')];if(!_0x477a0a[_0xdf78('0x34')][_0xdf78('0x38')](_0xdf78('0x39'))){_0x274d63[_0xdf78('0x1e')]=qs['limit'](_0x477a0a[_0xdf78('0x34')][_0xdf78('0x1e')]);_0x274d63[_0xdf78('0x20')]=qs[_0xdf78('0x20')](_0x477a0a[_0xdf78('0x34')]['offset']);}_0x274d63['order']=qs[_0xdf78('0x3a')](_0x477a0a[_0xdf78('0x34')][_0xdf78('0x3a')]);_0x274d63[_0xdf78('0x3b')]=qs[_0xdf78('0x3c')](_[_0xdf78('0x3d')](_0x477a0a[_0xdf78('0x34')],_0x2582af['filters']),_0x7dad59);if(_0x477a0a[_0xdf78('0x34')][_0xdf78('0x3e')]){_0x274d63[_0xdf78('0x3b')]=_[_0xdf78('0x3f')](_0x274d63[_0xdf78('0x3b')],{'$or':_[_0xdf78('0x2e')](_0x7dad59,function(_0xd7f2db){if(_0xd7f2db['type']!==_0xdf78('0x40')){var _0x16d381={};_0x16d381[_0xd7f2db[_0xdf78('0x2b')]]={'$like':'%'+_0x477a0a['query']['filter']+'%'};return _0x16d381;}})});}_0x274d63=_[_0xdf78('0x3f')]({},_0x274d63,_0x477a0a['options']);var _0x39672c={'where':_0x274d63[_0xdf78('0x3b')]};return db[_0xdf78('0x2f')][_0xdf78('0x1f')](_0x39672c)[_0xdf78('0x27')](function(_0x569095){_0xd346b2[_0xdf78('0x1f')]=_0x569095;if(_0x477a0a[_0xdf78('0x34')][_0xdf78('0x41')]){_0x274d63[_0xdf78('0x42')]=[{'all':!![]}];}return db[_0xdf78('0x2f')]['findAll'](_0x274d63);})[_0xdf78('0x27')](function(_0x44a03a){_0xd346b2[_0xdf78('0x43')]=_0x44a03a;return _0xd346b2;})[_0xdf78('0x27')](respondWithFilteredResult(_0x26a253,_0x274d63))['catch'](handleError(_0x26a253,null));};exports[_0xdf78('0x44')]=function(_0x434155,_0xe34589){var _0x20b470={'raw':![],'where':{'id':_0x434155[_0xdf78('0x45')]['id']}},_0x1da3d6={};_0x1da3d6['model']=_[_0xdf78('0x46')](db['Campaign']['rawAttributes']);_0x1da3d6['query']=_[_0xdf78('0x46')](_0x434155['query']);_0x1da3d6[_0xdf78('0x3c')]=_[_0xdf78('0x33')](_0x1da3d6[_0xdf78('0x32')],_0x1da3d6[_0xdf78('0x34')]);_0x20b470[_0xdf78('0x35')]=_[_0xdf78('0x33')](_0x1da3d6[_0xdf78('0x32')],qs[_0xdf78('0x36')](_0x434155[_0xdf78('0x34')][_0xdf78('0x36')]));_0x20b470['attributes']=_0x20b470[_0xdf78('0x35')][_0xdf78('0x37')]?_0x20b470[_0xdf78('0x35')]:_0x1da3d6[_0xdf78('0x32')];if(_0x434155[_0xdf78('0x34')][_0xdf78('0x41')]){_0x20b470[_0xdf78('0x42')]=[{'all':!![]}];}_0x20b470=_[_0xdf78('0x3f')]({},_0x20b470,_0x434155[_0xdf78('0x47')]);return db[_0xdf78('0x2f')]['find'](_0x20b470)[_0xdf78('0x27')](handleEntityNotFound(_0xe34589,null))[_0xdf78('0x27')](respondWithResult(_0xe34589,null))['catch'](handleError(_0xe34589,null));};exports[_0xdf78('0x48')]=function(_0x405160,_0x1fa09d){return db[_0xdf78('0x2f')][_0xdf78('0x48')](_0x405160['body'],{})['then'](function(_0xe78e5d){var _0x1df907=_0x405160['user'][_0xdf78('0x49')]({'plain':!![]});if(!_0x1df907)throw new Error(_0xdf78('0x4a'));if(_0x1df907[_0xdf78('0x4b')]===_0xdf78('0x4c')){var _0x175ad3=_0xe78e5d[_0xdf78('0x49')]({'plain':!![]});var _0xc71a68='IvrCampaigns';return db[_0xdf78('0x4d')]['find']({'where':{'name':_0xc71a68,'userProfileId':_0x1df907[_0xdf78('0x4e')]},'raw':!![]})['then'](function(_0x32b1b7){if(_0x32b1b7&&_0x32b1b7[_0xdf78('0x4f')]===0x0){return db[_0xdf78('0x29')][_0xdf78('0x48')]({'name':_0x175ad3[_0xdf78('0x2b')],'resourceId':_0x175ad3['id'],'type':_0x32b1b7[_0xdf78('0x2b')],'sectionId':_0x32b1b7['id']},{})[_0xdf78('0x27')](function(){return _0xe78e5d;});}else{return _0xe78e5d;}})[_0xdf78('0x50')](function(_0x58d756){logger[_0xdf78('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58d756);throw _0x58d756;});}return _0xe78e5d;})[_0xdf78('0x27')](respondWithResult(_0x1fa09d,0xc9))['catch'](handleError(_0x1fa09d,null));};exports[_0xdf78('0x51')]=function(_0x473ae9,_0x540555){var _0x251c98={'where':{'id':_0x473ae9[_0xdf78('0x45')]['id']}},_0x313b69={};_0x313b69[_0xdf78('0x32')]=_['keys'](db['Campaign'][_0xdf78('0x30')]);_0x251c98['attributes']=_[_0xdf78('0x33')](_0x313b69[_0xdf78('0x32')],qs[_0xdf78('0x36')](_0x473ae9[_0xdf78('0x34')]['fields']));_0x251c98[_0xdf78('0x35')]=_0x251c98['attributes'][_0xdf78('0x37')]?_0x251c98[_0xdf78('0x35')]:_0x313b69[_0xdf78('0x32')];if(_0x473ae9[_0xdf78('0x34')][_0xdf78('0x41')]){_0x251c98['include']=[{'all':!![]}];}_0x251c98=_[_0xdf78('0x3f')]({},_0x251c98,_0x473ae9[_0xdf78('0x47')]);return db[_0xdf78('0x2f')][_0xdf78('0x52')](_0x251c98)[_0xdf78('0x27')](handleEntityNotFound(_0x540555,null))['then'](function(_0x5a0b8f){if(_0x5a0b8f){var _0x608031=_0x5a0b8f['get']({'plain':!![]});_0x608031=qs[_0xdf78('0x53')](_0x608031,['id','createdAt',_0xdf78('0x54')]);_0x473ae9[_0xdf78('0x55')]=_[_0xdf78('0x53')](_0x473ae9[_0xdf78('0x55')],['id',_0xdf78('0x56'),_0xdf78('0x54')]);return db[_0xdf78('0x2f')][_0xdf78('0x48')](_[_0xdf78('0x3f')](_0x608031,_0x473ae9[_0xdf78('0x55')]),{'include':_0x473ae9[_0xdf78('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0xdf78('0x27')](function(_0x124bfe){var _0x121f49=_0x473ae9['user'][_0xdf78('0x49')]({'plain':!![]});if(!_0x121f49)throw new Error(_0xdf78('0x4a'));if(_0x121f49[_0xdf78('0x4b')]===_0xdf78('0x4c')){var _0xe12bde=_0x124bfe[_0xdf78('0x49')]({'plain':!![]});var _0x5e9f19=_0xdf78('0x28');return db[_0xdf78('0x4d')][_0xdf78('0x52')]({'where':{'name':_0x5e9f19,'userProfileId':_0x121f49[_0xdf78('0x4e')]},'raw':!![]})['then'](function(_0x564235){if(_0x564235&&_0x564235[_0xdf78('0x4f')]===0x0){return db[_0xdf78('0x29')][_0xdf78('0x48')]({'name':_0xe12bde[_0xdf78('0x2b')],'resourceId':_0xe12bde['id'],'type':_0x564235['name'],'sectionId':_0x564235['id']},{})[_0xdf78('0x27')](function(){return _0x124bfe;});}else{return _0x124bfe;}})[_0xdf78('0x50')](function(_0x424862){logger[_0xdf78('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x424862);throw _0x424862;});}return _0x124bfe;});}})[_0xdf78('0x27')](respondWithResult(_0x540555,0xc9))['catch'](handleError(_0x540555,null));};exports[_0xdf78('0x25')]=function(_0x39de07,_0x11ca82){if(_0x39de07[_0xdf78('0x55')]['id']){delete _0x39de07[_0xdf78('0x55')]['id'];}return db[_0xdf78('0x2f')][_0xdf78('0x52')]({'where':{'id':_0x39de07['params']['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x11ca82,null))[_0xdf78('0x27')](saveUpdates(_0x39de07[_0xdf78('0x55')],null))['then'](respondWithResult(_0x11ca82,null))[_0xdf78('0x50')](handleError(_0x11ca82,null));};exports[_0xdf78('0x26')]=function(_0x408971,_0x305857){return db[_0xdf78('0x2f')]['find']({'where':{'id':_0x408971[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x305857,null))[_0xdf78('0x27')](removeEntity(_0x305857,null))[_0xdf78('0x50')](handleError(_0x305857,null));};exports['getHoppers']=function(_0x55c3e0,_0x51ca55,_0x42e6de){var _0x1a1b9a={'raw':!![],'where':{}};var _0xeef722={};var _0x19019a={'count':0x0,'rows':[]};return db['Campaign'][_0xdf78('0x57')]({'where':{'id':_0x55c3e0[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x51ca55,null))[_0xdf78('0x27')](function(_0x137fc4){if(_0x137fc4){_0xeef722['model']=_[_0xdf78('0x46')](db[_0xdf78('0x58')][_0xdf78('0x30')]);_0xeef722[_0xdf78('0x34')]=_[_0xdf78('0x46')](_0x55c3e0[_0xdf78('0x34')]);_0xeef722[_0xdf78('0x3c')]=_[_0xdf78('0x33')](_0xeef722['model'],_0xeef722[_0xdf78('0x34')]);_0x1a1b9a[_0xdf78('0x35')]=_[_0xdf78('0x33')](_0xeef722[_0xdf78('0x32')],qs[_0xdf78('0x36')](_0x55c3e0[_0xdf78('0x34')][_0xdf78('0x36')]));_0x1a1b9a['attributes']=_0x1a1b9a[_0xdf78('0x35')][_0xdf78('0x37')]?_0x1a1b9a['attributes']:_0xeef722[_0xdf78('0x32')];if(!_0x55c3e0[_0xdf78('0x34')][_0xdf78('0x38')](_0xdf78('0x39'))){_0x1a1b9a[_0xdf78('0x1e')]=qs[_0xdf78('0x1e')](_0x55c3e0['query'][_0xdf78('0x1e')]);_0x1a1b9a['offset']=qs[_0xdf78('0x20')](_0x55c3e0[_0xdf78('0x34')][_0xdf78('0x20')]);}_0x1a1b9a[_0xdf78('0x59')]=qs[_0xdf78('0x3a')](_0x55c3e0[_0xdf78('0x34')][_0xdf78('0x3a')]);_0x1a1b9a['where']=qs[_0xdf78('0x3c')](_[_0xdf78('0x3d')](_0x55c3e0[_0xdf78('0x34')],_0xeef722['filters']));_0x1a1b9a[_0xdf78('0x3b')][_0xdf78('0x5a')]=_0x137fc4['id'];if(_0x55c3e0[_0xdf78('0x34')]['filter']){_0x1a1b9a[_0xdf78('0x3b')]=_[_0xdf78('0x3f')](_0x1a1b9a[_0xdf78('0x3b')],{'$or':_[_0xdf78('0x2e')](_0x1a1b9a[_0xdf78('0x35')],function(_0x10f9e3){var _0x3bd440={};_0x3bd440[_0x10f9e3]={'$like':'%'+_0x55c3e0[_0xdf78('0x34')][_0xdf78('0x3e')]+'%'};return _0x3bd440;})});}_0x1a1b9a=_['merge']({},_0x1a1b9a,_0x55c3e0[_0xdf78('0x47')]);return db[_0xdf78('0x58')][_0xdf78('0x1f')]({'where':_0x1a1b9a[_0xdf78('0x3b')]})[_0xdf78('0x27')](function(_0x3e99ba){_0x19019a['count']=_0x3e99ba;if(_0x55c3e0['query'][_0xdf78('0x41')]){_0x1a1b9a['include']=[{'all':!![]}];}return db[_0xdf78('0x58')][_0xdf78('0x5b')](_0x1a1b9a);})[_0xdf78('0x27')](function(_0x4052cb){_0x19019a[_0xdf78('0x43')]=_0x4052cb;return _0x19019a;});}})[_0xdf78('0x27')](respondWithFilteredResult(_0x51ca55,_0x1a1b9a))[_0xdf78('0x50')](handleError(_0x51ca55,null));};exports[_0xdf78('0x5c')]=function(_0x10c898,_0x478a16,_0x1cfa5e){var _0x430ea0={'raw':!![],'where':{}};var _0x539ff4={};var _0x17bead={'count':0x0,'rows':[]};return db[_0xdf78('0x2f')][_0xdf78('0x57')]({'where':{'id':_0x10c898[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x478a16,null))[_0xdf78('0x27')](function(_0x1c5c11){if(_0x1c5c11){_0x539ff4[_0xdf78('0x32')]=_['keys'](db[_0xdf78('0x5d')][_0xdf78('0x30')]);_0x539ff4[_0xdf78('0x34')]=_['keys'](_0x10c898[_0xdf78('0x34')]);_0x539ff4[_0xdf78('0x3c')]=_[_0xdf78('0x33')](_0x539ff4['model'],_0x539ff4[_0xdf78('0x34')]);_0x430ea0[_0xdf78('0x35')]=_[_0xdf78('0x33')](_0x539ff4[_0xdf78('0x32')],qs[_0xdf78('0x36')](_0x10c898[_0xdf78('0x34')][_0xdf78('0x36')]));_0x430ea0[_0xdf78('0x35')]=_0x430ea0[_0xdf78('0x35')][_0xdf78('0x37')]?_0x430ea0['attributes']:_0x539ff4[_0xdf78('0x32')];if(!_0x10c898[_0xdf78('0x34')][_0xdf78('0x38')]('nolimit')){_0x430ea0['limit']=qs['limit'](_0x10c898['query'][_0xdf78('0x1e')]);_0x430ea0['offset']=qs[_0xdf78('0x20')](_0x10c898[_0xdf78('0x34')][_0xdf78('0x20')]);}_0x430ea0[_0xdf78('0x59')]=qs[_0xdf78('0x3a')](_0x10c898[_0xdf78('0x34')][_0xdf78('0x3a')]);_0x430ea0[_0xdf78('0x3b')]=qs['filters'](_[_0xdf78('0x3d')](_0x10c898[_0xdf78('0x34')],_0x539ff4['filters']));_0x430ea0[_0xdf78('0x3b')]['CampaignId']=_0x1c5c11['id'];if(_0x10c898[_0xdf78('0x34')][_0xdf78('0x3e')]){_0x430ea0[_0xdf78('0x3b')]=_[_0xdf78('0x3f')](_0x430ea0[_0xdf78('0x3b')],{'$or':_[_0xdf78('0x2e')](_0x430ea0[_0xdf78('0x35')],function(_0x6b7884){var _0x367b86={};_0x367b86[_0x6b7884]={'$like':'%'+_0x10c898[_0xdf78('0x34')][_0xdf78('0x3e')]+'%'};return _0x367b86;})});}_0x430ea0=_[_0xdf78('0x3f')]({},_0x430ea0,_0x10c898[_0xdf78('0x47')]);return db['CmHopperHistory'][_0xdf78('0x1f')]({'where':_0x430ea0[_0xdf78('0x3b')]})['then'](function(_0x54ee79){_0x17bead[_0xdf78('0x1f')]=_0x54ee79;if(_0x10c898['query'][_0xdf78('0x41')]){_0x430ea0[_0xdf78('0x42')]=[{'all':!![]}];}return db[_0xdf78('0x5d')][_0xdf78('0x5b')](_0x430ea0);})[_0xdf78('0x27')](function(_0x2bb5f1){_0x17bead[_0xdf78('0x43')]=_0x2bb5f1;return _0x17bead;});}})[_0xdf78('0x27')](respondWithFilteredResult(_0x478a16,_0x430ea0))[_0xdf78('0x50')](handleError(_0x478a16,null));};exports[_0xdf78('0x5e')]=function(_0x56cba8,_0x64cbe3,_0x1db9df){var _0xd98929={'raw':!![],'where':{}};var _0x159071={};var _0x4154f1={'count':0x0,'rows':[]};return db['Campaign'][_0xdf78('0x57')]({'where':{'id':_0x56cba8[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x64cbe3,null))[_0xdf78('0x27')](function(_0x319a5e){if(_0x319a5e){_0x159071['model']=_[_0xdf78('0x46')](db[_0xdf78('0x5f')][_0xdf78('0x30')]);_0x159071[_0xdf78('0x34')]=_[_0xdf78('0x46')](_0x56cba8[_0xdf78('0x34')]);_0x159071[_0xdf78('0x3c')]=_[_0xdf78('0x33')](_0x159071['model'],_0x159071['query']);_0xd98929[_0xdf78('0x35')]=_[_0xdf78('0x33')](_0x159071['model'],qs[_0xdf78('0x36')](_0x56cba8[_0xdf78('0x34')][_0xdf78('0x36')]));_0xd98929['attributes']=_0xd98929[_0xdf78('0x35')][_0xdf78('0x37')]?_0xd98929[_0xdf78('0x35')]:_0x159071['model'];if(!_0x56cba8[_0xdf78('0x34')]['hasOwnProperty'](_0xdf78('0x39'))){_0xd98929[_0xdf78('0x1e')]=qs[_0xdf78('0x1e')](_0x56cba8['query'][_0xdf78('0x1e')]);_0xd98929[_0xdf78('0x20')]=qs[_0xdf78('0x20')](_0x56cba8['query'][_0xdf78('0x20')]);}_0xd98929['order']=qs[_0xdf78('0x3a')](_0x56cba8[_0xdf78('0x34')]['sort']);_0xd98929[_0xdf78('0x3b')]=qs['filters'](_['pick'](_0x56cba8[_0xdf78('0x34')],_0x159071['filters']));_0xd98929['where'][_0xdf78('0x5a')]=_0x319a5e['id'];if(_0x56cba8['query'][_0xdf78('0x3e')]){_0xd98929[_0xdf78('0x3b')]=_[_0xdf78('0x3f')](_0xd98929[_0xdf78('0x3b')],{'$or':_[_0xdf78('0x2e')](_0xd98929[_0xdf78('0x35')],function(_0x38cc8c){var _0x361226={};_0x361226[_0x38cc8c]={'$like':'%'+_0x56cba8['query'][_0xdf78('0x3e')]+'%'};return _0x361226;})});}_0xd98929=_[_0xdf78('0x3f')]({},_0xd98929,_0x56cba8[_0xdf78('0x47')]);return db['CmHopperFinal'][_0xdf78('0x1f')]({'where':_0xd98929[_0xdf78('0x3b')]})[_0xdf78('0x27')](function(_0x21b269){_0x4154f1[_0xdf78('0x1f')]=_0x21b269;if(_0x56cba8[_0xdf78('0x34')][_0xdf78('0x41')]){_0xd98929[_0xdf78('0x42')]=[{'all':!![]}];}return db[_0xdf78('0x5f')][_0xdf78('0x5b')](_0xd98929);})[_0xdf78('0x27')](function(_0x288834){_0x4154f1[_0xdf78('0x43')]=_0x288834;return _0x4154f1;});}})[_0xdf78('0x27')](respondWithFilteredResult(_0x64cbe3,_0xd98929))[_0xdf78('0x50')](handleError(_0x64cbe3,null));};exports[_0xdf78('0x60')]=function(_0x295d7f,_0x2efe2d,_0x21a907){var _0x4e88c4={'raw':!![],'where':{}};var _0x39f279={};var _0x5465fe={'count':0x0,'rows':[]};return db['Campaign'][_0xdf78('0x57')]({'where':{'id':_0x295d7f[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x2efe2d,null))[_0xdf78('0x27')](function(_0x10b13b){if(_0x10b13b){_0x39f279[_0xdf78('0x32')]=_['keys'](db[_0xdf78('0x61')][_0xdf78('0x30')]);_0x39f279[_0xdf78('0x34')]=_[_0xdf78('0x46')](_0x295d7f['query']);_0x39f279[_0xdf78('0x3c')]=_['intersection'](_0x39f279[_0xdf78('0x32')],_0x39f279[_0xdf78('0x34')]);_0x4e88c4['attributes']=_[_0xdf78('0x33')](_0x39f279[_0xdf78('0x32')],qs[_0xdf78('0x36')](_0x295d7f[_0xdf78('0x34')][_0xdf78('0x36')]));_0x4e88c4[_0xdf78('0x35')]=_0x4e88c4[_0xdf78('0x35')][_0xdf78('0x37')]?_0x4e88c4[_0xdf78('0x35')]:_0x39f279[_0xdf78('0x32')];if(!_0x295d7f[_0xdf78('0x34')][_0xdf78('0x38')](_0xdf78('0x39'))){_0x4e88c4[_0xdf78('0x1e')]=qs[_0xdf78('0x1e')](_0x295d7f['query'][_0xdf78('0x1e')]);_0x4e88c4[_0xdf78('0x20')]=qs[_0xdf78('0x20')](_0x295d7f[_0xdf78('0x34')]['offset']);}_0x4e88c4[_0xdf78('0x59')]=qs['sort'](_0x295d7f[_0xdf78('0x34')][_0xdf78('0x3a')]);_0x4e88c4[_0xdf78('0x3b')]=qs[_0xdf78('0x3c')](_['pick'](_0x295d7f[_0xdf78('0x34')],_0x39f279['filters']));_0x4e88c4[_0xdf78('0x3b')]['CampaignId']=_0x10b13b['id'];if(_0x295d7f[_0xdf78('0x34')][_0xdf78('0x3e')]){_0x4e88c4[_0xdf78('0x3b')]=_[_0xdf78('0x3f')](_0x4e88c4[_0xdf78('0x3b')],{'$or':_[_0xdf78('0x2e')](_0x4e88c4['attributes'],function(_0x167889){var _0x5790b1={};_0x5790b1[_0x167889]={'$like':'%'+_0x295d7f[_0xdf78('0x34')][_0xdf78('0x3e')]+'%'};return _0x5790b1;})});}_0x4e88c4=_[_0xdf78('0x3f')]({},_0x4e88c4,_0x295d7f[_0xdf78('0x47')]);return db[_0xdf78('0x61')][_0xdf78('0x1f')]({'where':_0x4e88c4[_0xdf78('0x3b')]})[_0xdf78('0x27')](function(_0x2a0650){_0x5465fe[_0xdf78('0x1f')]=_0x2a0650;if(_0x295d7f[_0xdf78('0x34')][_0xdf78('0x41')]){_0x4e88c4[_0xdf78('0x42')]=[{'all':!![]}];}return db[_0xdf78('0x61')][_0xdf78('0x5b')](_0x4e88c4);})[_0xdf78('0x27')](function(_0xd43b34){_0x5465fe[_0xdf78('0x43')]=_0xd43b34;return _0x5465fe;});}})[_0xdf78('0x27')](respondWithFilteredResult(_0x2efe2d,_0x4e88c4))[_0xdf78('0x50')](handleError(_0x2efe2d,null));};exports[_0xdf78('0x62')]=function(_0x323b3d,_0x176279,_0xa592ba){var _0x33095b={};var _0x1f12bc={};var _0x45e577;var _0x448ba5;return db[_0xdf78('0x2f')][_0xdf78('0x57')]({'where':{'id':_0x323b3d['params']['id']}})['then'](handleEntityNotFound(_0x176279,null))['then'](function(_0x2c8f52){if(_0x2c8f52){_0x45e577=_0x2c8f52;_0x1f12bc[_0xdf78('0x32')]=_[_0xdf78('0x46')](db[_0xdf78('0x63')][_0xdf78('0x30')]);_0x1f12bc[_0xdf78('0x34')]=_['keys'](_0x323b3d['query']);_0x1f12bc['filters']=_[_0xdf78('0x33')](_0x1f12bc[_0xdf78('0x32')],_0x1f12bc[_0xdf78('0x34')]);_0x33095b[_0xdf78('0x35')]=_[_0xdf78('0x33')](_0x1f12bc[_0xdf78('0x32')],qs[_0xdf78('0x36')](_0x323b3d['query']['fields']));_0x33095b[_0xdf78('0x35')]=_0x33095b[_0xdf78('0x35')][_0xdf78('0x37')]?_0x33095b[_0xdf78('0x35')]:_0x1f12bc[_0xdf78('0x32')];_0x33095b[_0xdf78('0x59')]=qs[_0xdf78('0x3a')](_0x323b3d['query'][_0xdf78('0x3a')]);_0x33095b[_0xdf78('0x3b')]=qs[_0xdf78('0x3c')](_[_0xdf78('0x3d')](_0x323b3d[_0xdf78('0x34')],_0x1f12bc[_0xdf78('0x3c')]));if(_0x323b3d['query'][_0xdf78('0x3e')]){_0x33095b[_0xdf78('0x3b')]=_['merge'](_0x33095b[_0xdf78('0x3b')],{'$or':_[_0xdf78('0x2e')](_0x33095b[_0xdf78('0x35')],function(_0x24811e){var _0x464e97={};_0x464e97[_0x24811e]={'$like':'%'+_0x323b3d[_0xdf78('0x34')][_0xdf78('0x3e')]+'%'};return _0x464e97;})});}_0x33095b=_[_0xdf78('0x3f')]({},_0x33095b,_0x323b3d['options']);return _0x45e577[_0xdf78('0x62')](_0x33095b);}})[_0xdf78('0x27')](function(_0x574d01){if(_0x574d01){_0x448ba5=_0x574d01[_0xdf78('0x37')];if(!_0x323b3d[_0xdf78('0x34')]['hasOwnProperty'](_0xdf78('0x39'))){_0x33095b[_0xdf78('0x1e')]=qs[_0xdf78('0x1e')](_0x323b3d['query']['limit']);_0x33095b[_0xdf78('0x20')]=qs[_0xdf78('0x20')](_0x323b3d[_0xdf78('0x34')][_0xdf78('0x20')]);}return _0x45e577[_0xdf78('0x62')](_0x33095b);}})[_0xdf78('0x27')](function(_0x21efb6){if(_0x21efb6){return _0x21efb6?{'count':_0x448ba5,'rows':_0x21efb6}:null;}})[_0xdf78('0x27')](respondWithResult(_0x176279,null))[_0xdf78('0x50')](handleError(_0x176279,null));};exports[_0xdf78('0x64')]=function(_0x25554a,_0x5c67d6,_0x323b8e){var _0x5623ab,_0x5080de;var _0x3a4460=[];var _0x40d1b1=moment()[_0xdf78('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xdf78('0x2f')][_0xdf78('0x52')]({'where':{'id':_0x25554a[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x5c67d6,null))['then'](function(_0x2e8dcb){if(_0x2e8dcb){_0x5080de=_0x2e8dcb;return _0x2e8dcb['addLists'](_0x25554a[_0xdf78('0x55')][_0xdf78('0x66')],_[_0xdf78('0x53')](_0x25554a['body'],['ids','id'])||{});}return null;})[_0xdf78('0x67')](function(_0x3a00ea){var _0x541dd0;var _0x594b4d;_0x5623ab=_0x3a00ea||[];var _0x2112f3=[];if(_0x3a00ea){for(var _0x289036=0x0;_0x289036<_0x3a00ea[_0xdf78('0x37')];_0x289036+=0x1){var _0x3f420a=_0x3a00ea[_0x289036]['get']({'plain':!![]});_0x5080de[_0xdf78('0x68')]=_0x25554a[_0xdf78('0x55')][_0xdf78('0x68')]?_0x25554a[_0xdf78('0x55')][_0xdf78('0x68')]:_0x5080de[_0xdf78('0x68')];switch(_0x5080de[_0xdf78('0x68')]){case _0xdf78('0x69'):_0x541dd0=squel[_0xdf78('0x6a')]()['into'](_0xdf78('0x6b'))['fromQuery']([_0xdf78('0x6c'),'scheduledAt',_0xdf78('0x6d'),_0xdf78('0x6e'),_0xdf78('0x5a'),'createdAt','updatedAt'],squel[_0xdf78('0x6f')]()[_0xdf78('0x70')]('phone','phone')['field']('NOW()',_0xdf78('0x71'))[_0xdf78('0x70')]('id','ContactId')['field'](_0x3f420a[_0xdf78('0x72')][_0xdf78('0x73')](),'ListId')[_0xdf78('0x70')](_0x25554a[_0xdf78('0x45')]['id']['toString'](),_0xdf78('0x5a'))[_0xdf78('0x70')]('\x27'+_0x40d1b1+'\x27',_0xdf78('0x56'))[_0xdf78('0x70')]('\x27'+_0x40d1b1+'\x27',_0xdf78('0x54'))[_0xdf78('0x74')](_0xdf78('0x75'))['where'](_0xdf78('0x76'))[_0xdf78('0x3b')](_0xdf78('0x77'),_0x3f420a[_0xdf78('0x72')]['toString']())[_0xdf78('0x3b')](_0xdf78('0x78'))[_0xdf78('0x3b')](_0xdf78('0x79'),squel[_0xdf78('0x6f')]()['field'](_0xdf78('0x7a'))[_0xdf78('0x74')](_0xdf78('0x7b'))[_0xdf78('0x3b')](_0xdf78('0x7c'),_0x25554a['params']['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xdf78('0x70')](_0xdf78('0x7d'))[_0xdf78('0x74')]('cm_hopper')[_0xdf78('0x3b')](_0xdf78('0x7c'),_0x25554a[_0xdf78('0x45')]['id']['toString']())))[_0xdf78('0x73')]();break;case _0xdf78('0x7e'):_0x541dd0=squel[_0xdf78('0x6a')]()[_0xdf78('0x7f')](_0xdf78('0x6b'))[_0xdf78('0x80')](['phone',_0xdf78('0x71'),_0xdf78('0x6d'),'ListId',_0xdf78('0x5a'),'createdAt',_0xdf78('0x54')],squel['select']()['field']('phone',_0xdf78('0x6c'))[_0xdf78('0x70')]('NOW()','scheduledAt')[_0xdf78('0x70')]('id','ContactId')[_0xdf78('0x70')](_0x3f420a[_0xdf78('0x72')][_0xdf78('0x73')](),_0xdf78('0x6e'))[_0xdf78('0x70')](_0x25554a[_0xdf78('0x45')]['id']['toString'](),_0xdf78('0x5a'))[_0xdf78('0x70')]('\x27'+_0x40d1b1+'\x27',_0xdf78('0x56'))[_0xdf78('0x70')]('\x27'+_0x40d1b1+'\x27',_0xdf78('0x54'))[_0xdf78('0x74')](_0xdf78('0x75'))[_0xdf78('0x3b')](_0xdf78('0x76'))[_0xdf78('0x3b')](_0xdf78('0x77'),_0x3f420a[_0xdf78('0x72')][_0xdf78('0x73')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xdf78('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0xdf78('0x6f')]()[_0xdf78('0x70')](_0xdf78('0x7d'))['from'](_0xdf78('0x6b'))[_0xdf78('0x3b')](_0xdf78('0x7c'),_0x25554a['params']['id']['toString']())))['toString']();break;default:_0x541dd0=squel[_0xdf78('0x6a')]()[_0xdf78('0x7f')](_0xdf78('0x6b'))[_0xdf78('0x80')]([_0xdf78('0x6c'),'scheduledAt',_0xdf78('0x6d'),_0xdf78('0x6e'),'CampaignId',_0xdf78('0x56'),_0xdf78('0x54')],squel[_0xdf78('0x6f')]()[_0xdf78('0x70')](_0xdf78('0x6c'),_0xdf78('0x6c'))[_0xdf78('0x70')](_0xdf78('0x81'),_0xdf78('0x71'))[_0xdf78('0x70')]('id',_0xdf78('0x6d'))[_0xdf78('0x70')](_0x3f420a[_0xdf78('0x72')][_0xdf78('0x73')](),_0xdf78('0x6e'))[_0xdf78('0x70')](_0x25554a[_0xdf78('0x45')]['id'][_0xdf78('0x73')](),_0xdf78('0x5a'))['field']('\x27'+_0x40d1b1+'\x27',_0xdf78('0x56'))[_0xdf78('0x70')]('\x27'+_0x40d1b1+'\x27',_0xdf78('0x54'))['from'](_0xdf78('0x75'))[_0xdf78('0x3b')](_0xdf78('0x76'))[_0xdf78('0x3b')]('ListId\x20=\x20?',_0x3f420a[_0xdf78('0x72')][_0xdf78('0x73')]())[_0xdf78('0x3b')](_0xdf78('0x78')))[_0xdf78('0x73')]();}_0x594b4d=squel['insert']()[_0xdf78('0x7f')](_0xdf78('0x82'))[_0xdf78('0x80')]([_0xdf78('0x83'),_0xdf78('0x71'),_0xdf78('0x6c'),_0xdf78('0x84'),'createdAt',_0xdf78('0x54')],squel['select']()[_0xdf78('0x70')](_0xdf78('0x85'),'id')[_0xdf78('0x70')](_0xdf78('0x81'),'scheduledAt')[_0xdf78('0x70')](_0xdf78('0x86'),_0xdf78('0x6c'))[_0xdf78('0x70')](_0xdf78('0x87'),_0xdf78('0x84'))[_0xdf78('0x70')]('\x27'+_0x40d1b1+'\x27','createdAt')[_0xdf78('0x70')]('\x27'+_0x40d1b1+'\x27','updatedAt')[_0xdf78('0x74')](_0xdf78('0x88'),'ci')['join'](_0xdf78('0x6b'),'h',_0xdf78('0x89'))['where'](_0xdf78('0x8a'),_0x3f420a[_0xdf78('0x72')][_0xdf78('0x73')]())[_0xdf78('0x3b')](_0xdf78('0x8b'),_0x25554a[_0xdf78('0x45')]['id'][_0xdf78('0x73')]())['where'](_0xdf78('0x8c'),_0x40d1b1))['toString']();_0x2112f3[_0xdf78('0x8d')](db[_0xdf78('0x8e')][_0xdf78('0x34')](_0x541dd0));_0x3a4460[_0xdf78('0x8d')](db[_0xdf78('0x8e')]['query'](_0x594b4d));}return BPromise[_0xdf78('0x8f')](_0x2112f3);}})['then'](function(){return BPromise['all'](_0x3a4460);})[_0xdf78('0x27')](function(){return _0x5623ab;})[_0xdf78('0x27')](respondWithResult(_0x5c67d6,null))[_0xdf78('0x50')](handleError(_0x5c67d6,null));};exports[_0xdf78('0x90')]=function(_0x228dc1,_0x2dc608,_0x125484){return db[_0xdf78('0x2f')]['find']({'where':{'id':_0x228dc1[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x2dc608,null))[_0xdf78('0x27')](function(_0x4c3999){if(_0x4c3999){return _0x4c3999[_0xdf78('0x90')](_0x228dc1[_0xdf78('0x34')][_0xdf78('0x66')]);}})['then'](function(_0x139c90){if(_0x139c90){return db[_0xdf78('0x58')]['destroy']({'where':{'ListId':_0x228dc1[_0xdf78('0x34')][_0xdf78('0x66')],'CampaignId':_0x228dc1[_0xdf78('0x45')]['id']}})['then'](function(){return _0x139c90;});}})[_0xdf78('0x27')](respondWithStatusCode(_0x2dc608,null))[_0xdf78('0x50')](handleError(_0x2dc608,null));};exports[_0xdf78('0x91')]=function(_0x181c12,_0x16fcea,_0x4562f7){var _0x46ebba={};var _0x5dcd6c={};var _0x1cb00a;var _0x397e2e;return db[_0xdf78('0x2f')][_0xdf78('0x57')]({'where':{'id':_0x181c12[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x16fcea,null))[_0xdf78('0x27')](function(_0xe1bc11){if(_0xe1bc11){_0x1cb00a=_0xe1bc11;_0x5dcd6c[_0xdf78('0x32')]=_[_0xdf78('0x46')](db[_0xdf78('0x63')][_0xdf78('0x30')]);_0x5dcd6c[_0xdf78('0x34')]=_[_0xdf78('0x46')](_0x181c12[_0xdf78('0x34')]);_0x5dcd6c['filters']=_[_0xdf78('0x33')](_0x5dcd6c[_0xdf78('0x32')],_0x5dcd6c['query']);_0x46ebba[_0xdf78('0x35')]=_[_0xdf78('0x33')](_0x5dcd6c[_0xdf78('0x32')],qs[_0xdf78('0x36')](_0x181c12[_0xdf78('0x34')][_0xdf78('0x36')]));_0x46ebba[_0xdf78('0x35')]=_0x46ebba[_0xdf78('0x35')][_0xdf78('0x37')]?_0x46ebba['attributes']:_0x5dcd6c[_0xdf78('0x32')];_0x46ebba[_0xdf78('0x59')]=qs['sort'](_0x181c12[_0xdf78('0x34')]['sort']);_0x46ebba['where']=qs[_0xdf78('0x3c')](_['pick'](_0x181c12[_0xdf78('0x34')],_0x5dcd6c['filters']));if(_0x181c12[_0xdf78('0x34')][_0xdf78('0x3e')]){_0x46ebba[_0xdf78('0x3b')]=_[_0xdf78('0x3f')](_0x46ebba[_0xdf78('0x3b')],{'$or':_[_0xdf78('0x2e')](_0x46ebba[_0xdf78('0x35')],function(_0x2f43f8){var _0x54b959={};_0x54b959[_0x2f43f8]={'$like':'%'+_0x181c12[_0xdf78('0x34')][_0xdf78('0x3e')]+'%'};return _0x54b959;})});}_0x46ebba=_['merge']({},_0x46ebba,_0x181c12['options']);return _0x1cb00a[_0xdf78('0x91')](_0x46ebba);}})['then'](function(_0x4c7f7e){if(_0x4c7f7e){_0x397e2e=_0x4c7f7e[_0xdf78('0x37')];if(!_0x181c12[_0xdf78('0x34')][_0xdf78('0x38')](_0xdf78('0x39'))){_0x46ebba[_0xdf78('0x1e')]=qs[_0xdf78('0x1e')](_0x181c12[_0xdf78('0x34')][_0xdf78('0x1e')]);_0x46ebba[_0xdf78('0x20')]=qs['offset'](_0x181c12[_0xdf78('0x34')][_0xdf78('0x20')]);}return _0x1cb00a[_0xdf78('0x91')](_0x46ebba);}})[_0xdf78('0x27')](function(_0x28df20){if(_0x28df20){return _0x28df20?{'count':_0x397e2e,'rows':_0x28df20}:null;}})[_0xdf78('0x27')](respondWithResult(_0x16fcea,null))[_0xdf78('0x50')](handleError(_0x16fcea,null));};exports[_0xdf78('0x92')]=function(_0x5d0d1d,_0x54b0bc,_0x2b4ca6){var _0x392490,_0x2cbe28;var _0x460249=[];var _0x354e30=moment()[_0xdf78('0x65')](_0xdf78('0x93'));return db[_0xdf78('0x2f')]['find']({'where':{'id':_0x5d0d1d[_0xdf78('0x45')]['id']}})['then'](handleEntityNotFound(_0x54b0bc,null))[_0xdf78('0x27')](function(_0x139d0b){if(_0x139d0b){_0x2cbe28=_0x139d0b;return _0x139d0b[_0xdf78('0x92')](_0x5d0d1d[_0xdf78('0x55')][_0xdf78('0x66')],_[_0xdf78('0x53')](_0x5d0d1d[_0xdf78('0x55')],[_0xdf78('0x66'),'id'])||{});}return null;})[_0xdf78('0x67')](function(_0x1a931f){var _0x3a7172;var _0x58689a;_0x392490=_0x1a931f||[];var _0x183b73=[];if(_0x1a931f){for(var _0x5a5e4c=0x0;_0x5a5e4c<_0x1a931f[_0xdf78('0x37')];_0x5a5e4c+=0x1){var _0x141c82=_0x1a931f[_0x5a5e4c][_0xdf78('0x49')]({'plain':!![]});_0x3a7172=squel[_0xdf78('0x6a')]()[_0xdf78('0x7f')](_0xdf78('0x94'))[_0xdf78('0x80')]([_0xdf78('0x6c'),_0xdf78('0x6d'),'ListId','CampaignId','createdAt',_0xdf78('0x54')],squel['select']()[_0xdf78('0x70')](_0xdf78('0x6c'),_0xdf78('0x6c'))[_0xdf78('0x70')]('id',_0xdf78('0x6d'))['field'](_0x141c82[_0xdf78('0x72')][_0xdf78('0x73')](),_0xdf78('0x6e'))[_0xdf78('0x70')](_0x5d0d1d['params']['id'][_0xdf78('0x73')](),_0xdf78('0x5a'))[_0xdf78('0x70')]('NOW()',_0xdf78('0x56'))[_0xdf78('0x70')](_0xdf78('0x81'),_0xdf78('0x54'))[_0xdf78('0x74')]('cm_contacts')[_0xdf78('0x3b')](_0xdf78('0x76'))[_0xdf78('0x3b')](_0xdf78('0x77'),_0x141c82[_0xdf78('0x72')]['toString']())[_0xdf78('0x3b')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x183b73[_0xdf78('0x8d')](db['sequelize']['query'](_0x3a7172));}return BPromise[_0xdf78('0x8f')](_0x183b73);}})[_0xdf78('0x27')](function(){return _0x392490;})[_0xdf78('0x27')](respondWithResult(_0x54b0bc,null))[_0xdf78('0x50')](handleError(_0x54b0bc,null));};exports['removeBlackLists']=function(_0xa928bd,_0x447680,_0x578b14){return db[_0xdf78('0x2f')][_0xdf78('0x52')]({'where':{'id':_0xa928bd['params']['id']}})['then'](handleEntityNotFound(_0x447680,null))[_0xdf78('0x27')](function(_0x338f5b){if(_0x338f5b){return _0x338f5b[_0xdf78('0x95')](_0xa928bd[_0xdf78('0x34')][_0xdf78('0x66')]);}})[_0xdf78('0x27')](function(_0x127904){if(_0x127904){return db[_0xdf78('0x61')][_0xdf78('0x26')]({'where':{'ListId':_0xa928bd['query'][_0xdf78('0x66')],'CampaignId':_0xa928bd[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](function(){return _0x127904;});}})[_0xdf78('0x27')](respondWithStatusCode(_0x447680,null))[_0xdf78('0x50')](handleError(_0x447680,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index fb720d6..1df0341 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x19c978,_0x451c13){var _0x1eab29=function(_0x382ac1){while(--_0x382ac1){_0x19c978['push'](_0x19c978['shift']());}};_0x1eab29(++_0x451c13);}(_0x7a54,0x106));var _0x47a5=function(_0xcc8c43,_0x2cce66){_0xcc8c43=_0xcc8c43-0x0;var _0x531584=_0x7a54[_0xcc8c43];return _0x531584;};'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 6fa8ce7..e29657f 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 _0x1fdc=['raw','attributes','limit','include','model','map','GetCampaign','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Campaign','findAll','options'];(function(_0x297b65,_0x2f9f76){var _0x58f565=function(_0x33da2b){while(--_0x33da2b){_0x297b65['push'](_0x297b65['shift']());}};_0x58f565(++_0x2f9f76);}(_0x1fdc,0x8b));var _0xc1fd=function(_0x178f52,_0x5d9675){_0x178f52=_0x178f52-0x0;var _0x556f99=_0x1fdc[_0x178f52];return _0x556f99;};'use strict';var _=require(_0xc1fd('0x0'));var util=require(_0xc1fd('0x1'));var moment=require('moment');var BPromise=require(_0xc1fd('0x2'));var rs=require(_0xc1fd('0x3'));var fs=require('fs');var Redis=require(_0xc1fd('0x4'));var db=require(_0xc1fd('0x5'))['db'];var utils=require(_0xc1fd('0x6'));var logger=require(_0xc1fd('0x7'))(_0xc1fd('0x8'));var config=require('../../config/environment');var jayson=require(_0xc1fd('0x9'));var client=jayson[_0xc1fd('0xa')][_0xc1fd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf6faef,_0x1865d0,_0x3eebe6){return new BPromise(function(_0x43b858,_0x2e06e4){return client[_0xc1fd('0xc')](_0xf6faef,_0x3eebe6)[_0xc1fd('0xd')](function(_0x37fb6c){logger[_0xc1fd('0xe')](_0xc1fd('0xf'),_0x1865d0,'request\x20sent');logger[_0xc1fd('0x10')](_0xc1fd('0x11'),_0x1865d0,'request\x20sent',JSON[_0xc1fd('0x12')](_0x37fb6c));if(_0x37fb6c['error']){if(_0x37fb6c[_0xc1fd('0x13')]['code']===0x1f4){logger[_0xc1fd('0x13')](_0xc1fd('0xf'),_0x1865d0,_0x37fb6c[_0xc1fd('0x13')]['message']);return _0x2e06e4(_0x37fb6c[_0xc1fd('0x13')][_0xc1fd('0x14')]);}logger[_0xc1fd('0x13')](_0xc1fd('0xf'),_0x1865d0,_0x37fb6c['error']['message']);return _0x43b858(_0x37fb6c[_0xc1fd('0x13')][_0xc1fd('0x14')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x1865d0,'request\x20sent');_0x43b858(_0x37fb6c[_0xc1fd('0x15')][_0xc1fd('0x14')]);}})[_0xc1fd('0x16')](function(_0x1ddbff){logger['error'](_0xc1fd('0xf'),_0x1865d0,_0x1ddbff);_0x2e06e4(_0x1ddbff);});});}exports['GetCampaign']=function(_0x3634e3){var _0x115b23=this;return new Promise(function(_0x12398e,_0x3a03a2){return db[_0xc1fd('0x17')][_0xc1fd('0x18')]({'raw':_0x3634e3[_0xc1fd('0x19')]?_0x3634e3[_0xc1fd('0x19')][_0xc1fd('0x1a')]===undefined?!![]:![]:!![],'where':_0x3634e3[_0xc1fd('0x19')]?_0x3634e3[_0xc1fd('0x19')]['where']||null:null,'attributes':_0x3634e3[_0xc1fd('0x19')]?_0x3634e3['options'][_0xc1fd('0x1b')]||null:null,'limit':_0x3634e3['options']?_0x3634e3[_0xc1fd('0x19')][_0xc1fd('0x1c')]||null:null,'include':_0x3634e3[_0xc1fd('0x19')]?_0x3634e3['options'][_0xc1fd('0x1d')]?_['map'](_0x3634e3[_0xc1fd('0x19')][_0xc1fd('0x1d')],function(_0x3cf4a2){return{'model':db[_0x3cf4a2[_0xc1fd('0x1e')]],'as':_0x3cf4a2['as'],'attributes':_0x3cf4a2[_0xc1fd('0x1b')],'include':_0x3cf4a2[_0xc1fd('0x1d')]?_[_0xc1fd('0x1f')](_0x3cf4a2['include'],function(_0x16509d){return{'model':db[_0x16509d['model']],'as':_0x16509d['as'],'attributes':_0x16509d['attributes'],'include':_0x16509d['include']?_[_0xc1fd('0x1f')](_0x16509d[_0xc1fd('0x1d')],function(_0x236efa){return{'model':db[_0x236efa[_0xc1fd('0x1e')]],'as':_0x236efa['as'],'attributes':_0x236efa[_0xc1fd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc1fd('0xd')](function(_0x25bf22){logger['info'](_0xc1fd('0x20'),_0x3634e3);logger[_0xc1fd('0x10')](_0xc1fd('0x20'),_0x3634e3,JSON[_0xc1fd('0x12')](_0x25bf22));_0x12398e(_0x25bf22);})[_0xc1fd('0x16')](function(_0x19bdef){logger[_0xc1fd('0x13')](_0xc1fd('0x20'),_0x19bdef[_0xc1fd('0x14')],_0x3634e3);_0x3a03a2(_0x115b23[_0xc1fd('0x13')](0x1f4,_0x19bdef['message']));});});};
\ No newline at end of file
+var _0x44a3=['limit','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','message','Campaign,\x20%s,\x20%s','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes'];(function(_0x2134c0,_0x3debba){var _0x397455=function(_0xa5f5ec){while(--_0xa5f5ec){_0x2134c0['push'](_0x2134c0['shift']());}};_0x397455(++_0x3debba);}(_0x44a3,0x1a9));var _0x344a=function(_0x38a62f,_0x26b533){_0x38a62f=_0x38a62f-0x0;var _0x1f734b=_0x44a3[_0x38a62f];return _0x1f734b;};'use strict';var _=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var moment=require(_0x344a('0x2'));var BPromise=require(_0x344a('0x3'));var rs=require(_0x344a('0x4'));var fs=require('fs');var Redis=require(_0x344a('0x5'));var db=require(_0x344a('0x6'))['db'];var utils=require(_0x344a('0x7'));var logger=require('../../config/logger')(_0x344a('0x8'));var config=require(_0x344a('0x9'));var jayson=require(_0x344a('0xa'));var client=jayson[_0x344a('0xb')][_0x344a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x504bd1,_0x553d97,_0x55ddca){return new BPromise(function(_0x484661,_0x475dab){return client[_0x344a('0xd')](_0x504bd1,_0x55ddca)[_0x344a('0xe')](function(_0x233ca1){logger[_0x344a('0xf')]('Campaign,\x20%s,\x20%s',_0x553d97,_0x344a('0x10'));logger[_0x344a('0x11')]('Campaign,\x20%s,\x20%s,\x20%s',_0x553d97,_0x344a('0x10'),JSON['stringify'](_0x233ca1));if(_0x233ca1[_0x344a('0x12')]){if(_0x233ca1['error'][_0x344a('0x13')]===0x1f4){logger[_0x344a('0x12')]('Campaign,\x20%s,\x20%s',_0x553d97,_0x233ca1['error'][_0x344a('0x14')]);return _0x475dab(_0x233ca1[_0x344a('0x12')][_0x344a('0x14')]);}logger[_0x344a('0x12')](_0x344a('0x15'),_0x553d97,_0x233ca1[_0x344a('0x12')]['message']);return _0x484661(_0x233ca1[_0x344a('0x12')][_0x344a('0x14')]);}else{logger[_0x344a('0xf')](_0x344a('0x15'),_0x553d97,'request\x20sent');_0x484661(_0x233ca1['result'][_0x344a('0x14')]);}})[_0x344a('0x16')](function(_0x36227e){logger[_0x344a('0x12')]('Campaign,\x20%s,\x20%s',_0x553d97,_0x36227e);_0x475dab(_0x36227e);});});}exports[_0x344a('0x17')]=function(_0x277c06){var _0x49b55f=this;return new Promise(function(_0x9fe854,_0x274016){return db[_0x344a('0x18')][_0x344a('0x19')]({'raw':_0x277c06[_0x344a('0x1a')]?_0x277c06[_0x344a('0x1a')][_0x344a('0x1b')]===undefined?!![]:![]:!![],'where':_0x277c06[_0x344a('0x1a')]?_0x277c06[_0x344a('0x1a')][_0x344a('0x1c')]||null:null,'attributes':_0x277c06['options']?_0x277c06[_0x344a('0x1a')][_0x344a('0x1d')]||null:null,'limit':_0x277c06[_0x344a('0x1a')]?_0x277c06[_0x344a('0x1a')][_0x344a('0x1e')]||null:null,'include':_0x277c06[_0x344a('0x1a')]?_0x277c06[_0x344a('0x1a')][_0x344a('0x1f')]?_[_0x344a('0x20')](_0x277c06[_0x344a('0x1a')][_0x344a('0x1f')],function(_0x3b2ab9){return{'model':db[_0x3b2ab9[_0x344a('0x21')]],'as':_0x3b2ab9['as'],'attributes':_0x3b2ab9[_0x344a('0x1d')],'include':_0x3b2ab9['include']?_[_0x344a('0x20')](_0x3b2ab9['include'],function(_0x2a5e49){return{'model':db[_0x2a5e49['model']],'as':_0x2a5e49['as'],'attributes':_0x2a5e49[_0x344a('0x1d')],'include':_0x2a5e49[_0x344a('0x1f')]?_[_0x344a('0x20')](_0x2a5e49[_0x344a('0x1f')],function(_0x26f059){return{'model':db[_0x26f059[_0x344a('0x21')]],'as':_0x26f059['as'],'attributes':_0x26f059[_0x344a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x344a('0xe')](function(_0x4f2499){logger[_0x344a('0xf')](_0x344a('0x17'),_0x277c06);logger[_0x344a('0x11')](_0x344a('0x17'),_0x277c06,JSON[_0x344a('0x22')](_0x4f2499));_0x9fe854(_0x4f2499);})[_0x344a('0x16')](function(_0x5b877d){logger[_0x344a('0x12')]('GetCampaign',_0x5b877d['message'],_0x277c06);_0x274016(_0x49b55f[_0x344a('0x12')](0x1f4,_0x5b877d[_0x344a('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index b78e907..cf74afd 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 _0x34bd=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','/:id/clone','post','addLists','addBlackLists','update','delete','removeLists','removeBlackLists','exports'];(function(_0x25ffd4,_0x16b31d){var _0x414452=function(_0x4440d2){while(--_0x4440d2){_0x25ffd4['push'](_0x25ffd4['shift']());}};_0x414452(++_0x16b31d);}(_0x34bd,0x10e));var _0xd34b=function(_0x4883cb,_0x3df63c){_0x4883cb=_0x4883cb-0x0;var _0x33aad7=_0x34bd[_0x4883cb];return _0x33aad7;};'use strict';var multer=require(_0xd34b('0x0'));var util=require('util');var path=require(_0xd34b('0x1'));var timeout=require(_0xd34b('0x2'));var express=require(_0xd34b('0x3'));var router=express[_0xd34b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd34b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd34b('0x6'));var controller=require(_0xd34b('0x7'));router[_0xd34b('0x8')]('/',auth[_0xd34b('0x9')](),controller['index']);router['get'](_0xd34b('0xa'),auth[_0xd34b('0x9')](),controller['show']);router[_0xd34b('0x8')]('/:id/hoppers',auth[_0xd34b('0x9')](),controller['getHoppers']);router[_0xd34b('0x8')](_0xd34b('0xb'),auth[_0xd34b('0x9')](),controller[_0xd34b('0xc')]);router[_0xd34b('0x8')](_0xd34b('0xd'),auth[_0xd34b('0x9')](),controller[_0xd34b('0xe')]);router[_0xd34b('0x8')](_0xd34b('0xf'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x10')]);router['get'](_0xd34b('0x11'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x12')]);router[_0xd34b('0x8')](_0xd34b('0x13'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth[_0xd34b('0x9')](),controller[_0xd34b('0x14')]);router['post'](_0xd34b('0x15'),auth[_0xd34b('0x9')](),controller['clone']);router[_0xd34b('0x16')](_0xd34b('0x11'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x17')]);router[_0xd34b('0x16')](_0xd34b('0x13'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x18')]);router['put'](_0xd34b('0xa'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x19')]);router['delete']('/:id',auth[_0xd34b('0x9')](),controller['destroy']);router[_0xd34b('0x1a')]('/:id/lists',auth[_0xd34b('0x9')](),controller[_0xd34b('0x1b')]);router[_0xd34b('0x1a')](_0xd34b('0x13'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x1c')]);module[_0xd34b('0x1d')]=router;
\ No newline at end of file
+var _0x970a=['/:id/hopper_black','getHopperBlacks','/:id/lists','post','create','clone','addLists','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x16b3df,_0x4af07f){var _0x486cca=function(_0x137847){while(--_0x137847){_0x16b3df['push'](_0x16b3df['shift']());}};_0x486cca(++_0x4af07f);}(_0x970a,0xee));var _0xa970=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x970a[_0x62c958];return _0x57ec61;};'use strict';var multer=require(_0xa970('0x0'));var util=require(_0xa970('0x1'));var path=require(_0xa970('0x2'));var timeout=require(_0xa970('0x3'));var express=require(_0xa970('0x4'));var router=express[_0xa970('0x5')]();var fs_extra=require(_0xa970('0x6'));var auth=require(_0xa970('0x7'));var interaction=require(_0xa970('0x8'));var config=require(_0xa970('0x9'));var controller=require(_0xa970('0xa'));router[_0xa970('0xb')]('/',auth[_0xa970('0xc')](),controller[_0xa970('0xd')]);router[_0xa970('0xb')](_0xa970('0xe'),auth['isAuthenticated'](),controller[_0xa970('0xf')]);router[_0xa970('0xb')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0xa970('0x10')]);router[_0xa970('0xb')](_0xa970('0x11'),auth[_0xa970('0xc')](),controller[_0xa970('0x12')]);router[_0xa970('0xb')](_0xa970('0x13'),auth[_0xa970('0xc')](),controller[_0xa970('0x14')]);router[_0xa970('0xb')](_0xa970('0x15'),auth[_0xa970('0xc')](),controller[_0xa970('0x16')]);router['get'](_0xa970('0x17'),auth[_0xa970('0xc')](),controller['getLists']);router[_0xa970('0xb')]('/:id/blacklists',auth[_0xa970('0xc')](),controller['getBlackLists']);router[_0xa970('0x18')]('/',auth[_0xa970('0xc')](),controller[_0xa970('0x19')]);router[_0xa970('0x18')]('/:id/clone',auth[_0xa970('0xc')](),controller[_0xa970('0x1a')]);router[_0xa970('0x18')](_0xa970('0x17'),auth[_0xa970('0xc')](),controller[_0xa970('0x1b')]);router[_0xa970('0x18')](_0xa970('0x1c'),auth['isAuthenticated'](),controller[_0xa970('0x1d')]);router[_0xa970('0x1e')](_0xa970('0xe'),auth[_0xa970('0xc')](),controller[_0xa970('0x1f')]);router[_0xa970('0x20')](_0xa970('0xe'),auth['isAuthenticated'](),controller[_0xa970('0x21')]);router[_0xa970('0x20')](_0xa970('0x17'),auth[_0xa970('0xc')](),controller[_0xa970('0x22')]);router['delete']('/:id/blacklists',auth[_0xa970('0xc')](),controller[_0xa970('0x23')]);module[_0xa970('0x24')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 9d22d98..bfcf98a 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 _0xab5e=['STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x2d489a,_0x25ce3c){var _0x11b301=function(_0x2bc6f1){while(--_0x2bc6f1){_0x2d489a['push'](_0x2d489a['shift']());}};_0x11b301(++_0x25ce3c);}(_0xab5e,0x1b8));var _0xeab5=function(_0x2836c2,_0x2524fa){_0x2836c2=_0x2836c2-0x0;var _0x1e6a75=_0xab5e[_0x2836c2];return _0x1e6a75;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0xeab5('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0xeab5('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xeab5('0x2')],'get':function(){return this[_0xeab5('0x3')]('key');}}};
\ No newline at end of file
+var _0x27f7=['getDataValue','key','exports','TEXT','STRING','VIRTUAL'];(function(_0x32e9e9,_0x3df5aa){var _0x400b63=function(_0x5d0454){while(--_0x5d0454){_0x32e9e9['push'](_0x32e9e9['shift']());}};_0x400b63(++_0x3df5aa);}(_0x27f7,0x1d0));var _0x727f=function(_0x9f5cc8,_0x48b161){_0x9f5cc8=_0x9f5cc8-0x0;var _0x30fc68=_0x27f7[_0x9f5cc8];return _0x30fc68;};'use strict';var Sequelize=require('sequelize');module[_0x727f('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x727f('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x727f('0x2')]},'name':{'type':Sequelize[_0x727f('0x3')],'get':function(){return this[_0x727f('0x4')](_0x727f('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 4709650..73511e6 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 _0xa5fa=['order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','find','body','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','CannedAnswers','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','filters','intersection','model','query','attributes','fields','length','nolimit'];(function(_0x80f331,_0x49a354){var _0x41f184=function(_0x1aa518){while(--_0x1aa518){_0x80f331['push'](_0x80f331['shift']());}};_0x41f184(++_0x49a354);}(_0xa5fa,0x73));var _0xaa5f=function(_0x1bdda0,_0x29dedf){_0x1bdda0=_0x1bdda0-0x0;var _0x269a8f=_0xa5fa[_0x1bdda0];return _0x269a8f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaa5f('0x0'));var jsonpatch=require(_0xaa5f('0x1'));var rp=require(_0xaa5f('0x2'));var moment=require(_0xaa5f('0x3'));var BPromise=require(_0xaa5f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xaa5f('0x5'));var sox=require(_0xaa5f('0x6'));var csv=require(_0xaa5f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa5f('0x8'));var _=require('lodash');var squel=require(_0xaa5f('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaa5f('0xa'));var toCsv=require(_0xaa5f('0x7'));var querystring=require(_0xaa5f('0xb'));var Papa=require('papaparse');var Redis=require(_0xaa5f('0xc'));var authService=require(_0xaa5f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xaa5f('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa5f('0xf'))('api');var utils=require(_0xaa5f('0x10'));var config=require(_0xaa5f('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2608bf,_0x2c1676){_0x2c1676=_0x2c1676||0xcc;return function(_0x4ba398){if(_0x4ba398){return _0x2608bf[_0xaa5f('0x12')](_0x2c1676);}return _0x2608bf[_0xaa5f('0x13')](_0x2c1676)[_0xaa5f('0x14')]();};}function respondWithResult(_0x36ce3a,_0xa5de96){_0xa5de96=_0xa5de96||0xc8;return function(_0x3ccc8b){if(_0x3ccc8b){return _0x36ce3a[_0xaa5f('0x13')](_0xa5de96)[_0xaa5f('0x15')](_0x3ccc8b);}};}function respondWithFilteredResult(_0x1d672e,_0x28fa45){return function(_0x5d1d12){if(_0x5d1d12){var _0x25be5f=typeof _0x28fa45[_0xaa5f('0x16')]==='undefined'&&typeof _0x28fa45[_0xaa5f('0x17')]===_0xaa5f('0x18');var _0x3c66f9=_0x5d1d12[_0xaa5f('0x19')];var _0x5a6a14=_0x25be5f?0x0:_0x28fa45['offset'];var _0xefd006=_0x25be5f?_0x5d1d12['count']:_0x28fa45[_0xaa5f('0x16')]+_0x28fa45['limit'];var _0x5b46f5;if(_0xefd006>=_0x3c66f9){_0xefd006=_0x3c66f9;_0x5b46f5=0xc8;}else{_0x5b46f5=0xce;}_0x1d672e['status'](_0x5b46f5);return _0x1d672e[_0xaa5f('0x1a')](_0xaa5f('0x1b'),_0x5a6a14+'-'+_0xefd006+'/'+_0x3c66f9)[_0xaa5f('0x15')](_0x5d1d12);}return null;};}function patchUpdates(_0x3805ea){return function(_0x5b2699){try{jsonpatch[_0xaa5f('0x1c')](_0x5b2699,_0x3805ea,!![]);}catch(_0x5958c7){return BPromise[_0xaa5f('0x1d')](_0x5958c7);}return _0x5b2699[_0xaa5f('0x1e')]();};}function saveUpdates(_0x26e74b,_0x9c0fd){return function(_0x473783){if(_0x473783){return _0x473783[_0xaa5f('0x1f')](_0x26e74b)[_0xaa5f('0x20')](function(_0x3e4933){return _0x3e4933;});}return null;};}function removeEntity(_0x546b6c,_0x4378a2){return function(_0x16b52c){if(_0x16b52c){return _0x16b52c[_0xaa5f('0x21')]()[_0xaa5f('0x20')](function(){var _0x28afde=_0x16b52c[_0xaa5f('0x22')]({'plain':!![]});var _0x15c022='CannedAnswers';return db[_0xaa5f('0x23')][_0xaa5f('0x21')]({'where':{'type':_0x15c022,'resourceId':_0x28afde['id']}})[_0xaa5f('0x20')](function(){return _0x16b52c;});})[_0xaa5f('0x20')](function(){_0x546b6c[_0xaa5f('0x13')](0xcc)[_0xaa5f('0x14')]();});}};}function handleEntityNotFound(_0x1bbce6,_0x1a32cb){return function(_0x5a3ccf){if(!_0x5a3ccf){_0x1bbce6['sendStatus'](0x194);}return _0x5a3ccf;};}function handleError(_0x5652b2,_0xff81f1){_0xff81f1=_0xff81f1||0x1f4;return function(_0x5532e4){logger[_0xaa5f('0x24')](_0x5532e4[_0xaa5f('0x25')]);if(_0x5532e4['name']){delete _0x5532e4[_0xaa5f('0x26')];}_0x5652b2[_0xaa5f('0x13')](_0xff81f1)[_0xaa5f('0x27')](_0x5532e4);};}exports[_0xaa5f('0x28')]=function(_0x2f3d68,_0x3ddaa1){var _0xaa08fb={},_0x181ddc={},_0x269411={'count':0x0,'rows':[]};var _0x2bd8ec=_[_0xaa5f('0x29')](db[_0xaa5f('0x2a')][_0xaa5f('0x2b')],function(_0x4201bd){return{'name':_0x4201bd[_0xaa5f('0x2c')],'type':_0x4201bd['type']['key']};});_0x181ddc['model']=_[_0xaa5f('0x29')](_0x2bd8ec,_0xaa5f('0x26'));_0x181ddc['query']=_['keys'](_0x2f3d68['query']);_0x181ddc[_0xaa5f('0x2d')]=_[_0xaa5f('0x2e')](_0x181ddc[_0xaa5f('0x2f')],_0x181ddc[_0xaa5f('0x30')]);_0xaa08fb[_0xaa5f('0x31')]=_[_0xaa5f('0x2e')](_0x181ddc[_0xaa5f('0x2f')],qs[_0xaa5f('0x32')](_0x2f3d68[_0xaa5f('0x30')][_0xaa5f('0x32')]));_0xaa08fb[_0xaa5f('0x31')]=_0xaa08fb[_0xaa5f('0x31')][_0xaa5f('0x33')]?_0xaa08fb[_0xaa5f('0x31')]:_0x181ddc['model'];if(!_0x2f3d68[_0xaa5f('0x30')]['hasOwnProperty'](_0xaa5f('0x34'))){_0xaa08fb[_0xaa5f('0x17')]=qs[_0xaa5f('0x17')](_0x2f3d68[_0xaa5f('0x30')]['limit']);_0xaa08fb[_0xaa5f('0x16')]=qs[_0xaa5f('0x16')](_0x2f3d68[_0xaa5f('0x30')]['offset']);}_0xaa08fb[_0xaa5f('0x35')]=qs[_0xaa5f('0x36')](_0x2f3d68['query']['sort']);_0xaa08fb[_0xaa5f('0x37')]=qs[_0xaa5f('0x2d')](_['pick'](_0x2f3d68['query'],_0x181ddc[_0xaa5f('0x2d')]),_0x2bd8ec);if(_0x2f3d68['query'][_0xaa5f('0x38')]){_0xaa08fb[_0xaa5f('0x37')]=_[_0xaa5f('0x39')](_0xaa08fb[_0xaa5f('0x37')],{'$or':[{'key':{'$like':'%'+_0x2f3d68[_0xaa5f('0x30')][_0xaa5f('0x38')]+'%'}},{'value':{'$like':'%'+_0x2f3d68[_0xaa5f('0x30')][_0xaa5f('0x38')]+'%'}}]});}_0xaa08fb=_[_0xaa5f('0x39')]({},_0xaa08fb,_0x2f3d68[_0xaa5f('0x3a')]);var _0xb57091={'where':_0xaa08fb[_0xaa5f('0x37')]};return db['CannedAnswer']['count'](_0xb57091)[_0xaa5f('0x20')](function(_0x301d0b){_0x269411[_0xaa5f('0x19')]=_0x301d0b;if(_0x2f3d68[_0xaa5f('0x30')][_0xaa5f('0x3b')]){_0xaa08fb[_0xaa5f('0x3c')]=[{'all':!![]}];}return db[_0xaa5f('0x2a')][_0xaa5f('0x3d')](_0xaa08fb);})[_0xaa5f('0x20')](function(_0x241223){_0x269411['rows']=_0x241223;return _0x269411;})[_0xaa5f('0x20')](respondWithFilteredResult(_0x3ddaa1,_0xaa08fb))[_0xaa5f('0x3e')](handleError(_0x3ddaa1,null));};exports[_0xaa5f('0x3f')]=function(_0x1491b6,_0xf45aa9){var _0x765dc4={'raw':!![],'where':{'id':_0x1491b6[_0xaa5f('0x40')]['id']}},_0x5f4dbd={};_0x5f4dbd['model']=_[_0xaa5f('0x41')](db[_0xaa5f('0x2a')]['rawAttributes']);_0x5f4dbd['query']=_['keys'](_0x1491b6['query']);_0x5f4dbd[_0xaa5f('0x2d')]=_['intersection'](_0x5f4dbd[_0xaa5f('0x2f')],_0x5f4dbd[_0xaa5f('0x30')]);_0x765dc4[_0xaa5f('0x31')]=_[_0xaa5f('0x2e')](_0x5f4dbd[_0xaa5f('0x2f')],qs[_0xaa5f('0x32')](_0x1491b6['query'][_0xaa5f('0x32')]));_0x765dc4[_0xaa5f('0x31')]=_0x765dc4['attributes'][_0xaa5f('0x33')]?_0x765dc4[_0xaa5f('0x31')]:_0x5f4dbd['model'];if(_0x1491b6[_0xaa5f('0x30')]['includeAll']){_0x765dc4[_0xaa5f('0x3c')]=[{'all':!![]}];}_0x765dc4=_['merge']({},_0x765dc4,_0x1491b6[_0xaa5f('0x3a')]);return db[_0xaa5f('0x2a')][_0xaa5f('0x42')](_0x765dc4)[_0xaa5f('0x20')](handleEntityNotFound(_0xf45aa9,null))[_0xaa5f('0x20')](respondWithResult(_0xf45aa9,null))[_0xaa5f('0x3e')](handleError(_0xf45aa9,null));};exports['update']=function(_0x325169,_0x49c3b8){if(_0x325169[_0xaa5f('0x43')]['id']){delete _0x325169['body']['id'];}return db[_0xaa5f('0x2a')][_0xaa5f('0x42')]({'where':{'id':_0x325169[_0xaa5f('0x40')]['id']}})[_0xaa5f('0x20')](handleEntityNotFound(_0x49c3b8,null))['then'](saveUpdates(_0x325169[_0xaa5f('0x43')],null))[_0xaa5f('0x20')](respondWithResult(_0x49c3b8,null))['catch'](handleError(_0x49c3b8,null));};exports['destroy']=function(_0x443a3d,_0xf32077){return db[_0xaa5f('0x2a')][_0xaa5f('0x42')]({'where':{'id':_0x443a3d[_0xaa5f('0x40')]['id']}})[_0xaa5f('0x20')](handleEntityNotFound(_0xf32077,null))[_0xaa5f('0x20')](removeEntity(_0xf32077,null))[_0xaa5f('0x3e')](handleError(_0xf32077,null));};exports['create']=function(_0x38cdbf,_0x246fd5){var _0x2d9d52={'key':_0x38cdbf['body'][_0xaa5f('0x44')]};if(_0x38cdbf[_0xaa5f('0x43')][_0xaa5f('0x45')]){_0x2d9d52['MailAccountId']=_0x38cdbf[_0xaa5f('0x43')]['MailAccountId'];}else if(_0x38cdbf[_0xaa5f('0x43')]['SmsAccountId']){_0x2d9d52[_0xaa5f('0x46')]=_0x38cdbf[_0xaa5f('0x43')][_0xaa5f('0x46')];}else if(_0x38cdbf[_0xaa5f('0x43')][_0xaa5f('0x47')]){_0x2d9d52[_0xaa5f('0x47')]=_0x38cdbf[_0xaa5f('0x43')][_0xaa5f('0x47')];}else if(_0x38cdbf['body'][_0xaa5f('0x48')]){_0x2d9d52[_0xaa5f('0x48')]=_0x38cdbf[_0xaa5f('0x43')]['ChatWebsiteId'];}return db[_0xaa5f('0x2a')]['find']({'where':_0x2d9d52})[_0xaa5f('0x20')](function(_0x3252ed){if(_0x3252ed){throw new db[(_0xaa5f('0x49'))][(_0xaa5f('0x4a'))](_0xaa5f('0x4b'));}return db[_0xaa5f('0x2a')]['create'](_0x38cdbf[_0xaa5f('0x43')]);})[_0xaa5f('0x20')](function(_0x4082e7){var _0x388bc2=_0x38cdbf['user'][_0xaa5f('0x22')]({'plain':!![]});if(!_0x388bc2)throw new Error(_0xaa5f('0x4c'));if(_0x388bc2[_0xaa5f('0x4d')]===_0xaa5f('0x4e')){var _0x26fe32=_0x4082e7['get']({'plain':!![]});return db[_0xaa5f('0x4f')][_0xaa5f('0x42')]({'where':{'name':_0xaa5f('0x50'),'userProfileId':_0x388bc2['userProfileId']},'raw':!![]})['then'](function(_0x54d8b8){if(_0x54d8b8&&_0x54d8b8[_0xaa5f('0x51')]===0x0){return db[_0xaa5f('0x23')][_0xaa5f('0x52')]({'name':_0x26fe32['name'],'resourceId':_0x26fe32['id'],'type':_0x54d8b8[_0xaa5f('0x26')],'sectionId':_0x54d8b8['id']},{})[_0xaa5f('0x20')](function(){return _0x4082e7;});}else{return _0x4082e7;}})['catch'](function(_0x36adf1){logger[_0xaa5f('0x24')](_0xaa5f('0x53'),_0x36adf1);throw _0x36adf1;});}return _0x4082e7;})[_0xaa5f('0x20')](respondWithResult(_0x246fd5,0xc9))[_0xaa5f('0x3e')](handleError(_0x246fd5,null));};
\ No newline at end of file
+var _0xa123=['keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','CannedAnswer','includeAll','findAll','rows','show','params','include','options','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','name','map','rawAttributes','type','key','query'];(function(_0x559d14,_0x3a0215){var _0x595aed=function(_0x56fdb9){while(--_0x56fdb9){_0x559d14['push'](_0x559d14['shift']());}};_0x595aed(++_0x3a0215);}(_0xa123,0x7f));var _0x3a12=function(_0x495857,_0x4c04b2){_0x495857=_0x495857-0x0;var _0x252d16=_0xa123[_0x495857];return _0x252d16;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a12('0x0'));var zipdir=require(_0x3a12('0x1'));var jsonpatch=require(_0x3a12('0x2'));var rp=require(_0x3a12('0x3'));var moment=require(_0x3a12('0x4'));var BPromise=require(_0x3a12('0x5'));var Mustache=require(_0x3a12('0x6'));var util=require(_0x3a12('0x7'));var path=require(_0x3a12('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3a12('0x9'));var fs=require('fs');var fs_extra=require(_0x3a12('0xa'));var _=require(_0x3a12('0xb'));var squel=require(_0x3a12('0xc'));var crypto=require('crypto');var jsforce=require(_0x3a12('0xd'));var deskjs=require(_0x3a12('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3a12('0xf'));var Papa=require(_0x3a12('0x10'));var Redis=require(_0x3a12('0x11'));var authService=require(_0x3a12('0x12'));var qs=require(_0x3a12('0x13'));var as=require(_0x3a12('0x14'));var hardwareService=require(_0x3a12('0x15'));var logger=require(_0x3a12('0x16'))(_0x3a12('0x17'));var utils=require(_0x3a12('0x18'));var config=require(_0x3a12('0x19'));var licenseUtil=require(_0x3a12('0x1a'));var db=require(_0x3a12('0x1b'))['db'];function respondWithStatusCode(_0x20cce2,_0x361696){_0x361696=_0x361696||0xcc;return function(_0x4871f6){if(_0x4871f6){return _0x20cce2[_0x3a12('0x1c')](_0x361696);}return _0x20cce2[_0x3a12('0x1d')](_0x361696)[_0x3a12('0x1e')]();};}function respondWithResult(_0x4177f4,_0x109fb8){_0x109fb8=_0x109fb8||0xc8;return function(_0x1998e2){if(_0x1998e2){return _0x4177f4['status'](_0x109fb8)[_0x3a12('0x1f')](_0x1998e2);}};}function respondWithFilteredResult(_0x42f70b,_0x4a79a0){return function(_0x3c3805){if(_0x3c3805){var _0x296f76=typeof _0x4a79a0['offset']===_0x3a12('0x20')&&typeof _0x4a79a0[_0x3a12('0x21')]===_0x3a12('0x20');var _0x1b0d55=_0x3c3805[_0x3a12('0x22')];var _0x4fc76f=_0x296f76?0x0:_0x4a79a0[_0x3a12('0x23')];var _0x41e2c9=_0x296f76?_0x3c3805[_0x3a12('0x22')]:_0x4a79a0[_0x3a12('0x23')]+_0x4a79a0[_0x3a12('0x21')];var _0x38ccd2;if(_0x41e2c9>=_0x1b0d55){_0x41e2c9=_0x1b0d55;_0x38ccd2=0xc8;}else{_0x38ccd2=0xce;}_0x42f70b[_0x3a12('0x1d')](_0x38ccd2);return _0x42f70b[_0x3a12('0x24')]('Content-Range',_0x4fc76f+'-'+_0x41e2c9+'/'+_0x1b0d55)['json'](_0x3c3805);}return null;};}function patchUpdates(_0x3b1de0){return function(_0x2f932f){try{jsonpatch[_0x3a12('0x25')](_0x2f932f,_0x3b1de0,!![]);}catch(_0x5c10cf){return BPromise[_0x3a12('0x26')](_0x5c10cf);}return _0x2f932f[_0x3a12('0x27')]();};}function saveUpdates(_0x394fe1,_0x1f88ee){return function(_0x26e014){if(_0x26e014){return _0x26e014[_0x3a12('0x28')](_0x394fe1)[_0x3a12('0x29')](function(_0x5c0089){return _0x5c0089;});}return null;};}function removeEntity(_0x5b2ca1,_0x1ddb2e){return function(_0x28eec7){if(_0x28eec7){return _0x28eec7[_0x3a12('0x2a')]()[_0x3a12('0x29')](function(){var _0xd3611=_0x28eec7[_0x3a12('0x2b')]({'plain':!![]});var _0x39648d=_0x3a12('0x2c');return db[_0x3a12('0x2d')][_0x3a12('0x2a')]({'where':{'type':_0x39648d,'resourceId':_0xd3611['id']}})['then'](function(){return _0x28eec7;});})[_0x3a12('0x29')](function(){_0x5b2ca1[_0x3a12('0x1d')](0xcc)[_0x3a12('0x1e')]();});}};}function handleEntityNotFound(_0x26a5d4,_0x3fb260){return function(_0xc8dbbf){if(!_0xc8dbbf){_0x26a5d4[_0x3a12('0x1c')](0x194);}return _0xc8dbbf;};}function handleError(_0x349c1c,_0x36afbf){_0x36afbf=_0x36afbf||0x1f4;return function(_0x499371){logger[_0x3a12('0x2e')](_0x499371['stack']);if(_0x499371['name']){delete _0x499371[_0x3a12('0x2f')];}_0x349c1c['status'](_0x36afbf)['send'](_0x499371);};}exports['index']=function(_0xf9a097,_0x59dbe5){var _0x3f4f9d={},_0x3bcaab={},_0x5acc5b={'count':0x0,'rows':[]};var _0x4d94d5=_[_0x3a12('0x30')](db['CannedAnswer'][_0x3a12('0x31')],function(_0x1f2920){return{'name':_0x1f2920['fieldName'],'type':_0x1f2920[_0x3a12('0x32')][_0x3a12('0x33')]};});_0x3bcaab['model']=_[_0x3a12('0x30')](_0x4d94d5,_0x3a12('0x2f'));_0x3bcaab[_0x3a12('0x34')]=_[_0x3a12('0x35')](_0xf9a097[_0x3a12('0x34')]);_0x3bcaab[_0x3a12('0x36')]=_[_0x3a12('0x37')](_0x3bcaab[_0x3a12('0x38')],_0x3bcaab[_0x3a12('0x34')]);_0x3f4f9d[_0x3a12('0x39')]=_[_0x3a12('0x37')](_0x3bcaab[_0x3a12('0x38')],qs[_0x3a12('0x3a')](_0xf9a097[_0x3a12('0x34')][_0x3a12('0x3a')]));_0x3f4f9d['attributes']=_0x3f4f9d[_0x3a12('0x39')]['length']?_0x3f4f9d[_0x3a12('0x39')]:_0x3bcaab[_0x3a12('0x38')];if(!_0xf9a097[_0x3a12('0x34')][_0x3a12('0x3b')](_0x3a12('0x3c'))){_0x3f4f9d[_0x3a12('0x21')]=qs['limit'](_0xf9a097[_0x3a12('0x34')]['limit']);_0x3f4f9d['offset']=qs[_0x3a12('0x23')](_0xf9a097['query'][_0x3a12('0x23')]);}_0x3f4f9d[_0x3a12('0x3d')]=qs[_0x3a12('0x3e')](_0xf9a097[_0x3a12('0x34')][_0x3a12('0x3e')]);_0x3f4f9d[_0x3a12('0x3f')]=qs[_0x3a12('0x36')](_[_0x3a12('0x40')](_0xf9a097[_0x3a12('0x34')],_0x3bcaab[_0x3a12('0x36')]),_0x4d94d5);if(_0xf9a097[_0x3a12('0x34')][_0x3a12('0x41')]){_0x3f4f9d['where']=_[_0x3a12('0x42')](_0x3f4f9d['where'],{'$or':[{'key':{'$like':'%'+_0xf9a097[_0x3a12('0x34')]['filter']+'%'}},{'value':{'$like':'%'+_0xf9a097[_0x3a12('0x34')][_0x3a12('0x41')]+'%'}}]});}_0x3f4f9d=_[_0x3a12('0x42')]({},_0x3f4f9d,_0xf9a097['options']);var _0x368572={'where':_0x3f4f9d['where']};return db[_0x3a12('0x43')][_0x3a12('0x22')](_0x368572)[_0x3a12('0x29')](function(_0x3861bd){_0x5acc5b['count']=_0x3861bd;if(_0xf9a097[_0x3a12('0x34')][_0x3a12('0x44')]){_0x3f4f9d['include']=[{'all':!![]}];}return db[_0x3a12('0x43')][_0x3a12('0x45')](_0x3f4f9d);})[_0x3a12('0x29')](function(_0x3e1d74){_0x5acc5b[_0x3a12('0x46')]=_0x3e1d74;return _0x5acc5b;})[_0x3a12('0x29')](respondWithFilteredResult(_0x59dbe5,_0x3f4f9d))['catch'](handleError(_0x59dbe5,null));};exports[_0x3a12('0x47')]=function(_0x3dbd8b,_0x524843){var _0x33fd2f={'raw':!![],'where':{'id':_0x3dbd8b[_0x3a12('0x48')]['id']}},_0x5e1020={};_0x5e1020[_0x3a12('0x38')]=_[_0x3a12('0x35')](db[_0x3a12('0x43')]['rawAttributes']);_0x5e1020[_0x3a12('0x34')]=_['keys'](_0x3dbd8b[_0x3a12('0x34')]);_0x5e1020['filters']=_[_0x3a12('0x37')](_0x5e1020['model'],_0x5e1020[_0x3a12('0x34')]);_0x33fd2f['attributes']=_[_0x3a12('0x37')](_0x5e1020[_0x3a12('0x38')],qs[_0x3a12('0x3a')](_0x3dbd8b['query']['fields']));_0x33fd2f[_0x3a12('0x39')]=_0x33fd2f[_0x3a12('0x39')]['length']?_0x33fd2f['attributes']:_0x5e1020[_0x3a12('0x38')];if(_0x3dbd8b[_0x3a12('0x34')][_0x3a12('0x44')]){_0x33fd2f[_0x3a12('0x49')]=[{'all':!![]}];}_0x33fd2f=_['merge']({},_0x33fd2f,_0x3dbd8b[_0x3a12('0x4a')]);return db[_0x3a12('0x43')][_0x3a12('0x4b')](_0x33fd2f)['then'](handleEntityNotFound(_0x524843,null))[_0x3a12('0x29')](respondWithResult(_0x524843,null))[_0x3a12('0x4c')](handleError(_0x524843,null));};exports[_0x3a12('0x28')]=function(_0x3b692c,_0xfa62){if(_0x3b692c[_0x3a12('0x4d')]['id']){delete _0x3b692c[_0x3a12('0x4d')]['id'];}return db[_0x3a12('0x43')][_0x3a12('0x4b')]({'where':{'id':_0x3b692c[_0x3a12('0x48')]['id']}})[_0x3a12('0x29')](handleEntityNotFound(_0xfa62,null))[_0x3a12('0x29')](saveUpdates(_0x3b692c[_0x3a12('0x4d')],null))[_0x3a12('0x29')](respondWithResult(_0xfa62,null))[_0x3a12('0x4c')](handleError(_0xfa62,null));};exports[_0x3a12('0x2a')]=function(_0x4f38c6,_0x27c13f){return db['CannedAnswer'][_0x3a12('0x4b')]({'where':{'id':_0x4f38c6['params']['id']}})[_0x3a12('0x29')](handleEntityNotFound(_0x27c13f,null))[_0x3a12('0x29')](removeEntity(_0x27c13f,null))['catch'](handleError(_0x27c13f,null));};exports[_0x3a12('0x4e')]=function(_0x109584,_0xefee9b){var _0x5e1647={'key':_0x109584[_0x3a12('0x4d')][_0x3a12('0x33')]};if(_0x109584[_0x3a12('0x4d')][_0x3a12('0x4f')]){_0x5e1647[_0x3a12('0x4f')]=_0x109584[_0x3a12('0x4d')][_0x3a12('0x4f')];}else if(_0x109584['body']['SmsAccountId']){_0x5e1647['SmsAccountId']=_0x109584['body'][_0x3a12('0x50')];}else if(_0x109584[_0x3a12('0x4d')]['OpenchannelAccountId']){_0x5e1647[_0x3a12('0x51')]=_0x109584[_0x3a12('0x4d')]['OpenchannelAccountId'];}else if(_0x109584[_0x3a12('0x4d')][_0x3a12('0x52')]){_0x5e1647[_0x3a12('0x52')]=_0x109584[_0x3a12('0x4d')]['ChatWebsiteId'];}return db[_0x3a12('0x43')][_0x3a12('0x4b')]({'where':_0x5e1647})['then'](function(_0x18a909){if(_0x18a909){throw new db[(_0x3a12('0x53'))][(_0x3a12('0x54'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x3a12('0x43')][_0x3a12('0x4e')](_0x109584[_0x3a12('0x4d')]);})['then'](function(_0x102205){var _0x5f1631=_0x109584['user'][_0x3a12('0x2b')]({'plain':!![]});if(!_0x5f1631)throw new Error(_0x3a12('0x55'));if(_0x5f1631[_0x3a12('0x56')]===_0x3a12('0x57')){var _0x3a691c=_0x102205[_0x3a12('0x2b')]({'plain':!![]});return db[_0x3a12('0x58')][_0x3a12('0x4b')]({'where':{'name':_0x3a12('0x2c'),'userProfileId':_0x5f1631['userProfileId']},'raw':!![]})['then'](function(_0xd2a945){if(_0xd2a945&&_0xd2a945['autoAssociation']===0x0){return db[_0x3a12('0x2d')][_0x3a12('0x4e')]({'name':_0x3a691c[_0x3a12('0x2f')],'resourceId':_0x3a691c['id'],'type':_0xd2a945[_0x3a12('0x2f')],'sectionId':_0xd2a945['id']},{})[_0x3a12('0x29')](function(){return _0x102205;});}else{return _0x102205;}})[_0x3a12('0x4c')](function(_0x4c1100){logger[_0x3a12('0x2e')](_0x3a12('0x59'),_0x4c1100);throw _0x4c1100;});}return _0x102205;})[_0x3a12('0x29')](respondWithResult(_0xefee9b,0xc9))['catch'](handleError(_0xefee9b,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 8df0ef5..ad72dfe 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 _0xc27f=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util'];(function(_0x176afa,_0x1b2eaa){var _0x1394c7=function(_0x323b7f){while(--_0x323b7f){_0x176afa['push'](_0x176afa['shift']());}};_0x1394c7(++_0x1b2eaa);}(_0xc27f,0x85));var _0xfc27=function(_0x2718cf,_0x48ebf6){_0x2718cf=_0x2718cf-0x0;var _0x89ce77=_0xc27f[_0x2718cf];return _0x89ce77;};'use strict';var _=require(_0xfc27('0x0'));var util=require(_0xfc27('0x1'));var logger=require(_0xfc27('0x2'))('api');var moment=require(_0xfc27('0x3'));var BPromise=require(_0xfc27('0x4'));var rp=require(_0xfc27('0x5'));var fs=require('fs');var path=require(_0xfc27('0x6'));var rimraf=require(_0xfc27('0x7'));var config=require(_0xfc27('0x8'));var attributes=require(_0xfc27('0x9'));module[_0xfc27('0xa')]=function(_0x14c86a,_0x15c405){return _0x14c86a[_0xfc27('0xb')](_0xfc27('0xc'),attributes,{'tableName':_0xfc27('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xfc27('0xe')});};
\ No newline at end of file
+var _0x324f=['define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','./cannedAnswer.attributes','exports'];(function(_0x270c25,_0x2f0ed7){var _0x3c8aa2=function(_0x4a3d20){while(--_0x4a3d20){_0x270c25['push'](_0x270c25['shift']());}};_0x3c8aa2(++_0x2f0ed7);}(_0x324f,0x94));var _0xf324=function(_0x43f1a6,_0x2458f6){_0x43f1a6=_0x43f1a6-0x0;var _0xd10cd3=_0x324f[_0x43f1a6];return _0xd10cd3;};'use strict';var _=require(_0xf324('0x0'));var util=require(_0xf324('0x1'));var logger=require(_0xf324('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf324('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf324('0x4'));var rimraf=require(_0xf324('0x5'));var config=require('../../config/environment');var attributes=require(_0xf324('0x6'));module[_0xf324('0x7')]=function(_0x5657a5,_0x19ef3b){return _0x5657a5[_0xf324('0x8')](_0xf324('0x9'),attributes,{'tableName':_0xf324('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf324('0xb'),'collate':_0xf324('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index a888d5d..26b16d6 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(_0x22ff5d,_0x171b60){var _0x4d706b=function(_0x163f26){while(--_0x163f26){_0x22ff5d['push'](_0x22ff5d['shift']());}};_0x4d706b(++_0x171b60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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(_0x215c3e,_0x391e25){var _0x1a52e7=function(_0x36970f){while(--_0x36970f){_0x215c3e['push'](_0x215c3e['shift']());}};_0x1a52e7(++_0x391e25);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 6cde163..23bffbf 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 _0x74dd=['/:id','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put'];(function(_0x10dfe6,_0x1a7a72){var _0x34dfe2=function(_0x2db5a8){while(--_0x2db5a8){_0x10dfe6['push'](_0x10dfe6['shift']());}};_0x34dfe2(++_0x1a7a72);}(_0x74dd,0xc3));var _0xd74d=function(_0x165834,_0x49e6d7){_0x165834=_0x165834-0x0;var _0x2f8df1=_0x74dd[_0x165834];return _0x2f8df1;};'use strict';var multer=require(_0xd74d('0x0'));var util=require(_0xd74d('0x1'));var path=require(_0xd74d('0x2'));var timeout=require('connect-timeout');var express=require(_0xd74d('0x3'));var router=express['Router']();var fs_extra=require(_0xd74d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd74d('0x5'));var config=require(_0xd74d('0x6'));var controller=require('./cannedAnswer.controller');router[_0xd74d('0x7')]('/',auth[_0xd74d('0x8')](),controller[_0xd74d('0x9')]);router[_0xd74d('0x7')]('/:id',auth[_0xd74d('0x8')](),controller[_0xd74d('0xa')]);router[_0xd74d('0xb')]('/',auth[_0xd74d('0x8')](),controller['create']);router[_0xd74d('0xc')](_0xd74d('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xd74d('0x8')](),controller[_0xd74d('0xe')]);module[_0xd74d('0xf')]=router;
\ No newline at end of file
+var _0x3d56=['create','put','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','post'];(function(_0x3da502,_0xc234d1){var _0x1263cd=function(_0x406caa){while(--_0x406caa){_0x3da502['push'](_0x3da502['shift']());}};_0x1263cd(++_0xc234d1);}(_0x3d56,0x156));var _0x63d5=function(_0x39b1fe,_0x4f8f17){_0x39b1fe=_0x39b1fe-0x0;var _0x306bfb=_0x3d56[_0x39b1fe];return _0x306bfb;};'use strict';var multer=require('multer');var util=require(_0x63d5('0x0'));var path=require(_0x63d5('0x1'));var timeout=require('connect-timeout');var express=require(_0x63d5('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x63d5('0x3'));var interaction=require(_0x63d5('0x4'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0x63d5('0x5')]('/',auth['isAuthenticated'](),controller[_0x63d5('0x6')]);router['get'](_0x63d5('0x7'),auth[_0x63d5('0x8')](),controller['show']);router[_0x63d5('0x9')]('/',auth[_0x63d5('0x8')](),controller[_0x63d5('0xa')]);router[_0x63d5('0xb')](_0x63d5('0x7'),auth[_0x63d5('0x8')](),controller[_0x63d5('0xc')]);router[_0x63d5('0xd')](_0x63d5('0x7'),auth['isAuthenticated'](),controller[_0x63d5('0xe')]);module[_0x63d5('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 11f80d2..3227aff 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 _0x8bf7=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x8bf7,0x139));var _0x78bf=function(_0x1e62f5,_0x4aba3f){_0x1e62f5=_0x1e62f5-0x0;var _0x5dfa2c=_0x8bf7[_0x1e62f5];return _0x5dfa2c;};'use strict';var Sequelize=require(_0x78bf('0x0'));module[_0x78bf('0x1')]={'calldate':{'type':Sequelize[_0x78bf('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x78bf('0x3')]},'src':{'type':Sequelize[_0x78bf('0x3')]},'dst':{'type':Sequelize[_0x78bf('0x3')]},'dcontext':{'type':Sequelize[_0x78bf('0x3')]},'channel':{'type':Sequelize[_0x78bf('0x3')]},'dstchannel':{'type':Sequelize[_0x78bf('0x3')]},'lastapp':{'type':Sequelize[_0x78bf('0x3')]},'lastdata':{'type':Sequelize[_0x78bf('0x3')]},'duration':{'type':Sequelize[_0x78bf('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x78bf('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x78bf('0x3')]},'amaflags':{'type':Sequelize[_0x78bf('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x78bf('0x3')]},'userfield':{'type':Sequelize[_0x78bf('0x3')]},'uniqueid':{'type':Sequelize[_0x78bf('0x3')]},'linkedid':{'type':Sequelize[_0x78bf('0x3')]},'sequence':{'type':Sequelize[_0x78bf('0x3')]},'peeraccount':{'type':Sequelize[_0x78bf('0x3')]},'type':{'type':Sequelize[_0x78bf('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4458=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x485357,_0x3b58c9){var _0xbf2b19=function(_0x490c3f){while(--_0x490c3f){_0x485357['push'](_0x485357['shift']());}};_0xbf2b19(++_0x3b58c9);}(_0x4458,0x1e4));var _0x8445=function(_0x14007e,_0x3a64ec){_0x14007e=_0x14007e-0x0;var _0x56b82f=_0x4458[_0x14007e];return _0x56b82f;};'use strict';var Sequelize=require(_0x8445('0x0'));module[_0x8445('0x1')]={'calldate':{'type':Sequelize[_0x8445('0x2')],'allowNull':![],'defaultValue':_0x8445('0x3')},'clid':{'type':Sequelize[_0x8445('0x4')]},'src':{'type':Sequelize[_0x8445('0x4')]},'dst':{'type':Sequelize[_0x8445('0x4')]},'dcontext':{'type':Sequelize[_0x8445('0x4')]},'channel':{'type':Sequelize[_0x8445('0x4')]},'dstchannel':{'type':Sequelize[_0x8445('0x4')]},'lastapp':{'type':Sequelize[_0x8445('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x8445('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8445('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8445('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x8445('0x4')]},'uniqueid':{'type':Sequelize[_0x8445('0x4')]},'linkedid':{'type':Sequelize[_0x8445('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x8445('0x4')]},'type':{'type':Sequelize[_0x8445('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 0e183b8..4ddc99b 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 _0xabce=['../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','map','Cdr','rawAttributes','type','model','query','keys','filters','attributes','fields','length','sort','where','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','params','intersection','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x23e779,_0x1663ff){var _0x3b0649=function(_0x1c4f69){while(--_0x1c4f69){_0x23e779['push'](_0x23e779['shift']());}};_0x3b0649(++_0x1663ff);}(_0xabce,0x103));var _0xeabc=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xabce[_0x5c3c0b];return _0x52ecd2;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}exports[_0xeabc('0x2a')]=function(_0x48fb52,_0x2163e6){var _0x38572d={},_0x2b568f={},_0x2f8633={'count':0x0,'rows':[]};var _0x149170=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')],function(_0x2915c1){return{'name':_0x2915c1['fieldName'],'type':_0x2915c1[_0xeabc('0x2e')]['key']};});_0x2b568f[_0xeabc('0x2f')]=_[_0xeabc('0x2b')](_0x149170,_0xeabc('0x28'));_0x2b568f[_0xeabc('0x30')]=_[_0xeabc('0x31')](_0x48fb52[_0xeabc('0x30')]);_0x2b568f[_0xeabc('0x32')]=_['intersection'](_0x2b568f[_0xeabc('0x2f')],_0x2b568f[_0xeabc('0x30')]);_0x38572d[_0xeabc('0x33')]=_['intersection'](_0x2b568f[_0xeabc('0x2f')],qs[_0xeabc('0x34')](_0x48fb52[_0xeabc('0x30')]['fields']));_0x38572d[_0xeabc('0x33')]=_0x38572d[_0xeabc('0x33')][_0xeabc('0x35')]?_0x38572d['attributes']:_0x2b568f[_0xeabc('0x2f')];if(!_0x48fb52[_0xeabc('0x30')]['hasOwnProperty']('nolimit')){_0x38572d[_0xeabc('0x1d')]=qs[_0xeabc('0x1d')](_0x48fb52['query'][_0xeabc('0x1d')]);_0x38572d[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x48fb52[_0xeabc('0x30')][_0xeabc('0x1f')]);}_0x38572d['order']=qs[_0xeabc('0x36')](_0x48fb52['query'][_0xeabc('0x36')]);_0x38572d[_0xeabc('0x37')]=qs[_0xeabc('0x32')](_['pick'](_0x48fb52['query'],_0x2b568f[_0xeabc('0x32')]),_0x149170);if(_0x48fb52['query'][_0xeabc('0x38')]){_0x38572d['where']=_['merge'](_0x38572d['where'],{'$or':_['map'](_0x149170,function(_0x1e222a){if(_0x1e222a['type']!==_0xeabc('0x39')){var _0x1ebfb6={};_0x1ebfb6[_0x1e222a['name']]={'$like':'%'+_0x48fb52[_0xeabc('0x30')]['filter']+'%'};return _0x1ebfb6;}})});}_0x38572d=_[_0xeabc('0x3a')]({},_0x38572d,_0x48fb52['options']);var _0xbd7f03={'where':_0x38572d[_0xeabc('0x37')]};return db[_0xeabc('0x2c')]['count'](_0xbd7f03)['then'](function(_0x54a3ae){_0x2f8633[_0xeabc('0x1e')]=_0x54a3ae;if(_0x48fb52[_0xeabc('0x30')][_0xeabc('0x3b')]){_0x38572d['include']=[{'all':!![]}];}return db['Cdr'][_0xeabc('0x3c')](_0x38572d);})[_0xeabc('0x25')](function(_0x5e9cb3){_0x2f8633[_0xeabc('0x3d')]=_0x5e9cb3;return _0x2f8633;})['then'](respondWithFilteredResult(_0x2163e6,_0x38572d))[_0xeabc('0x3e')](handleError(_0x2163e6,null));};exports['show']=function(_0x5defaa,_0x5cd04d){var _0x25958b={'raw':!![],'where':{'id':_0x5defaa[_0xeabc('0x3f')]['id']}},_0x37c926={};_0x37c926[_0xeabc('0x2f')]=_['keys'](db[_0xeabc('0x2c')]['rawAttributes']);_0x37c926[_0xeabc('0x30')]=_[_0xeabc('0x31')](_0x5defaa[_0xeabc('0x30')]);_0x37c926[_0xeabc('0x32')]=_[_0xeabc('0x40')](_0x37c926['model'],_0x37c926['query']);_0x25958b[_0xeabc('0x33')]=_['intersection'](_0x37c926[_0xeabc('0x2f')],qs[_0xeabc('0x34')](_0x5defaa['query'][_0xeabc('0x34')]));_0x25958b[_0xeabc('0x33')]=_0x25958b[_0xeabc('0x33')][_0xeabc('0x35')]?_0x25958b[_0xeabc('0x33')]:_0x37c926[_0xeabc('0x2f')];if(_0x5defaa[_0xeabc('0x30')]['includeAll']){_0x25958b[_0xeabc('0x41')]=[{'all':!![]}];}_0x25958b=_[_0xeabc('0x3a')]({},_0x25958b,_0x5defaa[_0xeabc('0x42')]);return db[_0xeabc('0x2c')][_0xeabc('0x43')](_0x25958b)[_0xeabc('0x25')](handleEntityNotFound(_0x5cd04d,null))[_0xeabc('0x25')](respondWithResult(_0x5cd04d,null))[_0xeabc('0x3e')](handleError(_0x5cd04d,null));};exports[_0xeabc('0x44')]=function(_0x44e714,_0x5689fc){return db[_0xeabc('0x2c')][_0xeabc('0x44')](_0x44e714[_0xeabc('0x45')],{})[_0xeabc('0x25')](respondWithResult(_0x5689fc,0xc9))[_0xeabc('0x3e')](handleError(_0x5689fc,null));};exports[_0xeabc('0x24')]=function(_0x268d95,_0x48df43){if(_0x268d95[_0xeabc('0x45')]['id']){delete _0x268d95[_0xeabc('0x45')]['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':{'id':_0x268d95[_0xeabc('0x3f')]['id']}})['then'](handleEntityNotFound(_0x48df43,null))[_0xeabc('0x25')](saveUpdates(_0x268d95[_0xeabc('0x45')],null))[_0xeabc('0x25')](respondWithResult(_0x48df43,null))[_0xeabc('0x3e')](handleError(_0x48df43,null));};exports['destroy']=function(_0x400b82,_0x1b3aa4){return db['Cdr'][_0xeabc('0x43')]({'where':{'id':_0x400b82['params']['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1b3aa4,null))['then'](removeEntity(_0x1b3aa4,null))[_0xeabc('0x3e')](handleError(_0x1b3aa4,null));};exports[_0xeabc('0x46')]=function(_0x38f988,_0x1524c3){return db[_0xeabc('0x2c')][_0xeabc('0x46')]()[_0xeabc('0x25')](respondWithResult(_0x1524c3,null))[_0xeabc('0x3e')](handleError(_0x1524c3,null));};
\ No newline at end of file
+var _0x7a59=['describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','Cdr','findAll','show','params','keys','include','find','create','body','catch','update'];(function(_0x2dd20a,_0x272c2e){var _0x57dacd=function(_0x4b7acf){while(--_0x4b7acf){_0x2dd20a['push'](_0x2dd20a['shift']());}};_0x57dacd(++_0x272c2e);}(_0x7a59,0x16e));var _0x97a5=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x7a59[_0x36ed48];return _0x51c63a;};'use strict';var emlformat=require(_0x97a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x97a5('0x1'));var rp=require(_0x97a5('0x2'));var moment=require(_0x97a5('0x3'));var BPromise=require(_0x97a5('0x4'));var Mustache=require(_0x97a5('0x5'));var util=require('util');var path=require(_0x97a5('0x6'));var sox=require(_0x97a5('0x7'));var csv=require(_0x97a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97a5('0x9'));var _=require(_0x97a5('0xa'));var squel=require(_0x97a5('0xb'));var crypto=require(_0x97a5('0xc'));var jsforce=require(_0x97a5('0xd'));var deskjs=require(_0x97a5('0xe'));var toCsv=require(_0x97a5('0x8'));var querystring=require('querystring');var Papa=require(_0x97a5('0xf'));var Redis=require(_0x97a5('0x10'));var authService=require(_0x97a5('0x11'));var qs=require(_0x97a5('0x12'));var as=require(_0x97a5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x97a5('0x14'));var utils=require(_0x97a5('0x15'));var config=require(_0x97a5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x97a5('0x17'))['db'];function respondWithStatusCode(_0x350720,_0x55305a){_0x55305a=_0x55305a||0xcc;return function(_0x4f85a0){if(_0x4f85a0){return _0x350720[_0x97a5('0x18')](_0x55305a);}return _0x350720[_0x97a5('0x19')](_0x55305a)['end']();};}function respondWithResult(_0x595437,_0x51d5e2){_0x51d5e2=_0x51d5e2||0xc8;return function(_0x5a4471){if(_0x5a4471){return _0x595437[_0x97a5('0x19')](_0x51d5e2)[_0x97a5('0x1a')](_0x5a4471);}};}function respondWithFilteredResult(_0x3603e4,_0x4d8ba7){return function(_0x1a7a62){if(_0x1a7a62){var _0x3fa986=typeof _0x4d8ba7['offset']===_0x97a5('0x1b')&&typeof _0x4d8ba7['limit']===_0x97a5('0x1b');var _0x55071b=_0x1a7a62['count'];var _0x52ce92=_0x3fa986?0x0:_0x4d8ba7[_0x97a5('0x1c')];var _0x5c5740=_0x3fa986?_0x1a7a62[_0x97a5('0x1d')]:_0x4d8ba7[_0x97a5('0x1c')]+_0x4d8ba7[_0x97a5('0x1e')];var _0x1efe8c;if(_0x5c5740>=_0x55071b){_0x5c5740=_0x55071b;_0x1efe8c=0xc8;}else{_0x1efe8c=0xce;}_0x3603e4['status'](_0x1efe8c);return _0x3603e4['set'](_0x97a5('0x1f'),_0x52ce92+'-'+_0x5c5740+'/'+_0x55071b)[_0x97a5('0x1a')](_0x1a7a62);}return null;};}function patchUpdates(_0x4e3386){return function(_0x51858b){try{jsonpatch[_0x97a5('0x20')](_0x51858b,_0x4e3386,!![]);}catch(_0x3d7dba){return BPromise[_0x97a5('0x21')](_0x3d7dba);}return _0x51858b['save']();};}function saveUpdates(_0x34fb55,_0x3a5849){return function(_0x23f4f8){if(_0x23f4f8){return _0x23f4f8['update'](_0x34fb55)[_0x97a5('0x22')](function(_0x33d6da){return _0x33d6da;});}return null;};}function removeEntity(_0x4e2074,_0x5e731e){return function(_0x469592){if(_0x469592){return _0x469592[_0x97a5('0x23')]()[_0x97a5('0x22')](function(){_0x4e2074[_0x97a5('0x19')](0xcc)[_0x97a5('0x24')]();});}};}function handleEntityNotFound(_0x302d78,_0xf7ad1e){return function(_0x4743e0){if(!_0x4743e0){_0x302d78['sendStatus'](0x194);}return _0x4743e0;};}function handleError(_0x2038dd,_0x46ee45){_0x46ee45=_0x46ee45||0x1f4;return function(_0x2ca97c){logger[_0x97a5('0x25')](_0x2ca97c[_0x97a5('0x26')]);if(_0x2ca97c[_0x97a5('0x27')]){delete _0x2ca97c['name'];}_0x2038dd[_0x97a5('0x19')](_0x46ee45)[_0x97a5('0x28')](_0x2ca97c);};}exports['index']=function(_0x274ccb,_0x52248f){var _0x48f1c1={},_0x1bdb74={},_0x2eaae4={'count':0x0,'rows':[]};var _0x5c1c67=_[_0x97a5('0x29')](db['Cdr'][_0x97a5('0x2a')],function(_0x3c5d02){return{'name':_0x3c5d02[_0x97a5('0x2b')],'type':_0x3c5d02[_0x97a5('0x2c')]['key']};});_0x1bdb74['model']=_[_0x97a5('0x29')](_0x5c1c67,_0x97a5('0x27'));_0x1bdb74[_0x97a5('0x2d')]=_['keys'](_0x274ccb[_0x97a5('0x2d')]);_0x1bdb74[_0x97a5('0x2e')]=_['intersection'](_0x1bdb74[_0x97a5('0x2f')],_0x1bdb74[_0x97a5('0x2d')]);_0x48f1c1['attributes']=_[_0x97a5('0x30')](_0x1bdb74[_0x97a5('0x2f')],qs[_0x97a5('0x31')](_0x274ccb['query'][_0x97a5('0x31')]));_0x48f1c1[_0x97a5('0x32')]=_0x48f1c1[_0x97a5('0x32')][_0x97a5('0x33')]?_0x48f1c1[_0x97a5('0x32')]:_0x1bdb74[_0x97a5('0x2f')];if(!_0x274ccb[_0x97a5('0x2d')]['hasOwnProperty'](_0x97a5('0x34'))){_0x48f1c1[_0x97a5('0x1e')]=qs[_0x97a5('0x1e')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x1e')]);_0x48f1c1[_0x97a5('0x1c')]=qs[_0x97a5('0x1c')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x1c')]);}_0x48f1c1[_0x97a5('0x35')]=qs[_0x97a5('0x36')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x36')]);_0x48f1c1['where']=qs[_0x97a5('0x2e')](_[_0x97a5('0x37')](_0x274ccb[_0x97a5('0x2d')],_0x1bdb74[_0x97a5('0x2e')]),_0x5c1c67);if(_0x274ccb[_0x97a5('0x2d')]['filter']){_0x48f1c1['where']=_[_0x97a5('0x38')](_0x48f1c1[_0x97a5('0x39')],{'$or':_[_0x97a5('0x29')](_0x5c1c67,function(_0x45a548){if(_0x45a548[_0x97a5('0x2c')]!==_0x97a5('0x3a')){var _0x57333b={};_0x57333b[_0x45a548[_0x97a5('0x27')]]={'$like':'%'+_0x274ccb['query'][_0x97a5('0x3b')]+'%'};return _0x57333b;}})});}_0x48f1c1=_[_0x97a5('0x38')]({},_0x48f1c1,_0x274ccb[_0x97a5('0x3c')]);var _0x798318={'where':_0x48f1c1[_0x97a5('0x39')]};return db['Cdr'][_0x97a5('0x1d')](_0x798318)[_0x97a5('0x22')](function(_0x64505){_0x2eaae4[_0x97a5('0x1d')]=_0x64505;if(_0x274ccb[_0x97a5('0x2d')]['includeAll']){_0x48f1c1['include']=[{'all':!![]}];}return db[_0x97a5('0x3d')][_0x97a5('0x3e')](_0x48f1c1);})[_0x97a5('0x22')](function(_0x20dbc6){_0x2eaae4['rows']=_0x20dbc6;return _0x2eaae4;})[_0x97a5('0x22')](respondWithFilteredResult(_0x52248f,_0x48f1c1))['catch'](handleError(_0x52248f,null));};exports[_0x97a5('0x3f')]=function(_0x331108,_0x111e72){var _0x5baf77={'raw':!![],'where':{'id':_0x331108[_0x97a5('0x40')]['id']}},_0xefb019={};_0xefb019['model']=_[_0x97a5('0x41')](db[_0x97a5('0x3d')][_0x97a5('0x2a')]);_0xefb019[_0x97a5('0x2d')]=_[_0x97a5('0x41')](_0x331108[_0x97a5('0x2d')]);_0xefb019[_0x97a5('0x2e')]=_[_0x97a5('0x30')](_0xefb019[_0x97a5('0x2f')],_0xefb019[_0x97a5('0x2d')]);_0x5baf77[_0x97a5('0x32')]=_[_0x97a5('0x30')](_0xefb019['model'],qs[_0x97a5('0x31')](_0x331108[_0x97a5('0x2d')][_0x97a5('0x31')]));_0x5baf77['attributes']=_0x5baf77[_0x97a5('0x32')][_0x97a5('0x33')]?_0x5baf77[_0x97a5('0x32')]:_0xefb019[_0x97a5('0x2f')];if(_0x331108[_0x97a5('0x2d')]['includeAll']){_0x5baf77[_0x97a5('0x42')]=[{'all':!![]}];}_0x5baf77=_[_0x97a5('0x38')]({},_0x5baf77,_0x331108[_0x97a5('0x3c')]);return db[_0x97a5('0x3d')][_0x97a5('0x43')](_0x5baf77)['then'](handleEntityNotFound(_0x111e72,null))[_0x97a5('0x22')](respondWithResult(_0x111e72,null))['catch'](handleError(_0x111e72,null));};exports[_0x97a5('0x44')]=function(_0x235f9d,_0x330f6a){return db['Cdr'][_0x97a5('0x44')](_0x235f9d[_0x97a5('0x45')],{})[_0x97a5('0x22')](respondWithResult(_0x330f6a,0xc9))[_0x97a5('0x46')](handleError(_0x330f6a,null));};exports[_0x97a5('0x47')]=function(_0x42ced6,_0x49b215){if(_0x42ced6[_0x97a5('0x45')]['id']){delete _0x42ced6[_0x97a5('0x45')]['id'];}return db[_0x97a5('0x3d')][_0x97a5('0x43')]({'where':{'id':_0x42ced6['params']['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x49b215,null))[_0x97a5('0x22')](saveUpdates(_0x42ced6['body'],null))[_0x97a5('0x22')](respondWithResult(_0x49b215,null))[_0x97a5('0x46')](handleError(_0x49b215,null));};exports[_0x97a5('0x23')]=function(_0x56890f,_0x2a6fa0){return db[_0x97a5('0x3d')]['find']({'where':{'id':_0x56890f[_0x97a5('0x40')]['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x2a6fa0,null))[_0x97a5('0x22')](removeEntity(_0x2a6fa0,null))['catch'](handleError(_0x2a6fa0,null));};exports[_0x97a5('0x48')]=function(_0xc3c9e5,_0x7adad){return db['Cdr']['describe']()[_0x97a5('0x22')](respondWithResult(_0x7adad,null))[_0x97a5('0x46')](handleError(_0x7adad,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 552800b..e14be76 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(_0x5a0918,_0x3f3a02){var _0x524d59=function(_0x1a0c72){while(--_0x1a0c72){_0x5a0918['push'](_0x5a0918['shift']());}};_0x524d59(++_0x3f3a02);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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(_0x3898ef,_0x39f8d2){var _0x70c0a4=function(_0x4bcd7d){while(--_0x4bcd7d){_0x3898ef['push'](_0x3898ef['shift']());}};_0x70c0a4(++_0x39f8d2);}(_0x7a54,0x106));var _0x47a5=function(_0x54773a,_0xe68d8e){_0x54773a=_0x54773a-0x0;var _0x3302f4=_0x7a54[_0x54773a];return _0x3302f4;};'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 615d7c0..bc0e709 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 _0x41d2=['error','code','message','info','request\x20sent','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x164271,_0x55ecdc){var _0xfd6455=function(_0x2b0d25){while(--_0x2b0d25){_0x164271['push'](_0x164271['shift']());}};_0xfd6455(++_0x55ecdc);}(_0x41d2,0x18c));var _0x241d=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x41d2[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x241d('0x0'));var util=require(_0x241d('0x1'));var moment=require(_0x241d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x241d('0x3'));var db=require(_0x241d('0x4'))['db'];var utils=require(_0x241d('0x5'));var logger=require(_0x241d('0x6'))(_0x241d('0x7'));var config=require(_0x241d('0x8'));var jayson=require(_0x241d('0x9'));var client=jayson[_0x241d('0xa')][_0x241d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39aadd,_0x3c1d54,_0x3447e){return new BPromise(function(_0x39ed5b,_0x60afc2){return client[_0x241d('0xc')](_0x39aadd,_0x3447e)[_0x241d('0xd')](function(_0x282534){logger['info'](_0x241d('0xe'),_0x3c1d54,'request\x20sent');logger[_0x241d('0xf')](_0x241d('0x10'),_0x3c1d54,'request\x20sent',JSON[_0x241d('0x11')](_0x282534));if(_0x282534[_0x241d('0x12')]){if(_0x282534[_0x241d('0x12')][_0x241d('0x13')]===0x1f4){logger[_0x241d('0x12')](_0x241d('0xe'),_0x3c1d54,_0x282534[_0x241d('0x12')][_0x241d('0x14')]);return _0x60afc2(_0x282534[_0x241d('0x12')][_0x241d('0x14')]);}logger['error'](_0x241d('0xe'),_0x3c1d54,_0x282534[_0x241d('0x12')]['message']);return _0x39ed5b(_0x282534[_0x241d('0x12')][_0x241d('0x14')]);}else{logger[_0x241d('0x15')]('Cdr,\x20%s,\x20%s',_0x3c1d54,_0x241d('0x16'));_0x39ed5b(_0x282534['result'][_0x241d('0x14')]);}})['catch'](function(_0x4a0e59){logger['error']('Cdr,\x20%s,\x20%s',_0x3c1d54,_0x4a0e59);_0x60afc2(_0x4a0e59);});});}
\ No newline at end of file
+var _0xca00=['stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','http','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xca00,0x1e0));var _0x0ca0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca00[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0ca0('0x0'));var util=require(_0x0ca0('0x1'));var moment=require('moment');var BPromise=require(_0x0ca0('0x2'));var rs=require(_0x0ca0('0x3'));var fs=require('fs');var Redis=require(_0x0ca0('0x4'));var db=require(_0x0ca0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0ca0('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0ca0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x142368,_0x3d0492,_0x441fca){return new BPromise(function(_0x4e0785,_0x5e0abe){return client['request'](_0x142368,_0x441fca)[_0x0ca0('0x8')](function(_0x2a24d1){logger[_0x0ca0('0x9')](_0x0ca0('0xa'),_0x3d0492,'request\x20sent');logger[_0x0ca0('0xb')](_0x0ca0('0xc'),_0x3d0492,_0x0ca0('0xd'),JSON[_0x0ca0('0xe')](_0x2a24d1));if(_0x2a24d1[_0x0ca0('0xf')]){if(_0x2a24d1['error'][_0x0ca0('0x10')]===0x1f4){logger[_0x0ca0('0xf')](_0x0ca0('0xa'),_0x3d0492,_0x2a24d1[_0x0ca0('0xf')][_0x0ca0('0x11')]);return _0x5e0abe(_0x2a24d1[_0x0ca0('0xf')][_0x0ca0('0x11')]);}logger[_0x0ca0('0xf')]('Cdr,\x20%s,\x20%s',_0x3d0492,_0x2a24d1[_0x0ca0('0xf')]['message']);return _0x4e0785(_0x2a24d1[_0x0ca0('0xf')][_0x0ca0('0x11')]);}else{logger[_0x0ca0('0x9')](_0x0ca0('0xa'),_0x3d0492,_0x0ca0('0xd'));_0x4e0785(_0x2a24d1[_0x0ca0('0x12')][_0x0ca0('0x11')]);}})['catch'](function(_0x15446a){logger[_0x0ca0('0xf')]('Cdr,\x20%s,\x20%s',_0x3d0492,_0x15446a);_0x5e0abe(_0x15446a);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 938923c..b843e33 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2238d6,_0x397180){var _0x3fcc31=function(_0x2e0997){while(--_0x2e0997){_0x2238d6['push'](_0x2238d6['shift']());}};_0x3fcc31(++_0x397180);}(_0xb10b,0x12a));var _0xbb10=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0xb10b[_0x4358f5];return _0x4d8104;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index c7e0f7e..3682bd0 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 _0x8750=['TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x16ca76,_0x258915){var _0xbfbbad=function(_0x5e1266){while(--_0x5e1266){_0x16ca76['push'](_0x16ca76['shift']());}};_0xbfbbad(++_0x258915);}(_0x8750,0x14c));var _0x0875=function(_0xa11dda,_0x4bbf0c){_0xa11dda=_0xa11dda-0x0;var _0x3a2138=_0x8750[_0xa11dda];return _0x3a2138;};'use strict';var Sequelize=require(_0x0875('0x0'));module['exports']={'priority':{'type':Sequelize[_0x0875('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0875('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0875('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0875('0x2')],'defaultValue':_0x0875('0x4')}};
\ No newline at end of file
+var _0x1cd5=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0x1cd5,0x79));var _0x51cd=function(_0x402122,_0x5d6a41){_0x402122=_0x402122-0x0;var _0x1791df=_0x1cd5[_0x402122];return _0x1791df;};'use strict';var Sequelize=require(_0x51cd('0x0'));module[_0x51cd('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x51cd('0x2')],'allowNull':![],'defaultValue':_0x51cd('0x3')},'appdata':{'type':Sequelize[_0x51cd('0x4')]()},'description':{'type':Sequelize[_0x51cd('0x2')]},'interval':{'type':Sequelize[_0x51cd('0x2')],'defaultValue':_0x51cd('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index a815873..ec497d1 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 _0xce3a=['../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','ChatApplication','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x476d90,_0x459710){var _0x56f307=function(_0x1082fb){while(--_0x1082fb){_0x476d90['push'](_0x476d90['shift']());}};_0x56f307(++_0x459710);}(_0xce3a,0x194));var _0xace3=function(_0x11e1b6,_0x28e796){_0x11e1b6=_0x11e1b6-0x0;var _0x275329=_0xce3a[_0x11e1b6];return _0x275329;};'use strict';var emlformat=require(_0xace3('0x0'));var rimraf=require(_0xace3('0x1'));var zipdir=require(_0xace3('0x2'));var jsonpatch=require(_0xace3('0x3'));var rp=require(_0xace3('0x4'));var moment=require(_0xace3('0x5'));var BPromise=require(_0xace3('0x6'));var Mustache=require(_0xace3('0x7'));var util=require(_0xace3('0x8'));var path=require(_0xace3('0x9'));var sox=require(_0xace3('0xa'));var csv=require(_0xace3('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xace3('0xc'));var _=require(_0xace3('0xd'));var squel=require(_0xace3('0xe'));var crypto=require(_0xace3('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xace3('0x10'));var toCsv=require('to-csv');var querystring=require(_0xace3('0x11'));var Papa=require(_0xace3('0x12'));var Redis=require(_0xace3('0x13'));var authService=require(_0xace3('0x14'));var qs=require(_0xace3('0x15'));var as=require(_0xace3('0x16'));var hardwareService=require(_0xace3('0x17'));var logger=require(_0xace3('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xace3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4be1f1,_0x3566ad){_0x3566ad=_0x3566ad||0xcc;return function(_0x5ac505){if(_0x5ac505){return _0x4be1f1[_0xace3('0x1a')](_0x3566ad);}return _0x4be1f1['status'](_0x3566ad)[_0xace3('0x1b')]();};}function respondWithResult(_0x19dc11,_0x16ef3e){_0x16ef3e=_0x16ef3e||0xc8;return function(_0x5983b9){if(_0x5983b9){return _0x19dc11[_0xace3('0x1c')](_0x16ef3e)[_0xace3('0x1d')](_0x5983b9);}};}function respondWithFilteredResult(_0x1cfa39,_0x54ec35){return function(_0x51ed6c){if(_0x51ed6c){var _0x1ad5c0=typeof _0x54ec35[_0xace3('0x1e')]===_0xace3('0x1f')&&typeof _0x54ec35[_0xace3('0x20')]==='undefined';var _0x3debc2=_0x51ed6c[_0xace3('0x21')];var _0x39536d=_0x1ad5c0?0x0:_0x54ec35[_0xace3('0x1e')];var _0x2ef370=_0x1ad5c0?_0x51ed6c[_0xace3('0x21')]:_0x54ec35['offset']+_0x54ec35['limit'];var _0x2ee18d;if(_0x2ef370>=_0x3debc2){_0x2ef370=_0x3debc2;_0x2ee18d=0xc8;}else{_0x2ee18d=0xce;}_0x1cfa39['status'](_0x2ee18d);return _0x1cfa39[_0xace3('0x22')](_0xace3('0x23'),_0x39536d+'-'+_0x2ef370+'/'+_0x3debc2)['json'](_0x51ed6c);}return null;};}function patchUpdates(_0xab91f7){return function(_0x16f406){try{jsonpatch['apply'](_0x16f406,_0xab91f7,!![]);}catch(_0x4b90c9){return BPromise['reject'](_0x4b90c9);}return _0x16f406[_0xace3('0x24')]();};}function saveUpdates(_0x1ed5fe,_0x3bbe41){return function(_0x34a7a5){if(_0x34a7a5){return _0x34a7a5[_0xace3('0x25')](_0x1ed5fe)[_0xace3('0x26')](function(_0xa9b5ed){return _0xa9b5ed;});}return null;};}function removeEntity(_0x3c0a56,_0x5a4c02){return function(_0x5980fe){if(_0x5980fe){return _0x5980fe['destroy']()['then'](function(){_0x3c0a56[_0xace3('0x1c')](0xcc)[_0xace3('0x1b')]();});}};}function handleEntityNotFound(_0x2c137d,_0xf42f4){return function(_0x4b287c){if(!_0x4b287c){_0x2c137d[_0xace3('0x1a')](0x194);}return _0x4b287c;};}function handleError(_0x3b4cb5,_0x144f86){_0x144f86=_0x144f86||0x1f4;return function(_0x32e39d){logger[_0xace3('0x27')](_0x32e39d[_0xace3('0x28')]);if(_0x32e39d[_0xace3('0x29')]){delete _0x32e39d['name'];}_0x3b4cb5[_0xace3('0x1c')](_0x144f86)[_0xace3('0x2a')](_0x32e39d);};}exports[_0xace3('0x2b')]=function(_0x3aa28a,_0x599e73){var _0x56efae={'raw':!![],'where':{'id':_0x3aa28a[_0xace3('0x2c')]['id']}},_0x3b1ad1={};_0x3b1ad1[_0xace3('0x2d')]=_[_0xace3('0x2e')](db['ChatApplication'][_0xace3('0x2f')]);_0x3b1ad1[_0xace3('0x30')]=_[_0xace3('0x2e')](_0x3aa28a[_0xace3('0x30')]);_0x3b1ad1[_0xace3('0x31')]=_[_0xace3('0x32')](_0x3b1ad1[_0xace3('0x2d')],_0x3b1ad1['query']);_0x56efae['attributes']=_[_0xace3('0x32')](_0x3b1ad1[_0xace3('0x2d')],qs[_0xace3('0x33')](_0x3aa28a[_0xace3('0x30')][_0xace3('0x33')]));_0x56efae[_0xace3('0x34')]=_0x56efae[_0xace3('0x34')][_0xace3('0x35')]?_0x56efae[_0xace3('0x34')]:_0x3b1ad1[_0xace3('0x2d')];if(_0x3aa28a[_0xace3('0x30')][_0xace3('0x36')]){_0x56efae[_0xace3('0x37')]=[{'all':!![]}];}_0x56efae=_[_0xace3('0x38')]({},_0x56efae,_0x3aa28a[_0xace3('0x39')]);return db[_0xace3('0x3a')]['find'](_0x56efae)[_0xace3('0x26')](handleEntityNotFound(_0x599e73,null))[_0xace3('0x26')](respondWithResult(_0x599e73,null))[_0xace3('0x3b')](handleError(_0x599e73,null));};exports[_0xace3('0x25')]=function(_0x39a447,_0xe0243b){if(_0x39a447[_0xace3('0x3c')]['id']){delete _0x39a447[_0xace3('0x3c')]['id'];}return db[_0xace3('0x3a')]['find']({'where':{'id':_0x39a447[_0xace3('0x2c')]['id']}})[_0xace3('0x26')](handleEntityNotFound(_0xe0243b,null))[_0xace3('0x26')](saveUpdates(_0x39a447[_0xace3('0x3c')],null))['then'](respondWithResult(_0xe0243b,null))['catch'](handleError(_0xe0243b,null));};exports['destroy']=function(_0x541d51,_0x181d79){return db[_0xace3('0x3a')]['find']({'where':{'id':_0x541d51[_0xace3('0x2c')]['id']}})['then'](handleEntityNotFound(_0x181d79,null))['then'](removeEntity(_0x181d79,null))[_0xace3('0x3b')](handleError(_0x181d79,null));};
\ No newline at end of file
+var _0x9ffd=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','update','then','error','name','send','params','model','keys','ChatApplication','rawAttributes','filters','intersection','attributes','fields','length','query','includeAll','include','merge','options','find','catch','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x3d38ae,_0x51102b){var _0x3757ee=function(_0x22bac8){while(--_0x22bac8){_0x3d38ae['push'](_0x3d38ae['shift']());}};_0x3757ee(++_0x51102b);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x3f78b9,_0xf6f234){_0x3f78b9=_0x3f78b9-0x0;var _0x768e6c=_0x9ffd[_0x3f78b9];return _0x768e6c;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var hardwareService=require(_0xd9ff('0x13'));var logger=require(_0xd9ff('0x14'))(_0xd9ff('0x15'));var utils=require(_0xd9ff('0x16'));var config=require(_0xd9ff('0x17'));var licenseUtil=require(_0xd9ff('0x18'));var db=require(_0xd9ff('0x19'))['db'];function respondWithStatusCode(_0x47d842,_0x47b0d7){_0x47b0d7=_0x47b0d7||0xcc;return function(_0xaaf7af){if(_0xaaf7af){return _0x47d842[_0xd9ff('0x1a')](_0x47b0d7);}return _0x47d842[_0xd9ff('0x1b')](_0x47b0d7)[_0xd9ff('0x1c')]();};}function respondWithResult(_0x12c39a,_0x556aa4){_0x556aa4=_0x556aa4||0xc8;return function(_0x2f78c1){if(_0x2f78c1){return _0x12c39a[_0xd9ff('0x1b')](_0x556aa4)['json'](_0x2f78c1);}};}function respondWithFilteredResult(_0xf14c9f,_0x5db010){return function(_0x4ffe54){if(_0x4ffe54){var _0x547e28=typeof _0x5db010['offset']===_0xd9ff('0x1d')&&typeof _0x5db010['limit']===_0xd9ff('0x1d');var _0xa30fd2=_0x4ffe54[_0xd9ff('0x1e')];var _0x3afd19=_0x547e28?0x0:_0x5db010[_0xd9ff('0x1f')];var _0x2d4df1=_0x547e28?_0x4ffe54[_0xd9ff('0x1e')]:_0x5db010[_0xd9ff('0x1f')]+_0x5db010[_0xd9ff('0x20')];var _0x1f028f;if(_0x2d4df1>=_0xa30fd2){_0x2d4df1=_0xa30fd2;_0x1f028f=0xc8;}else{_0x1f028f=0xce;}_0xf14c9f[_0xd9ff('0x1b')](_0x1f028f);return _0xf14c9f[_0xd9ff('0x21')](_0xd9ff('0x22'),_0x3afd19+'-'+_0x2d4df1+'/'+_0xa30fd2)['json'](_0x4ffe54);}return null;};}function patchUpdates(_0x4cf8ec){return function(_0x264a3d){try{jsonpatch[_0xd9ff('0x23')](_0x264a3d,_0x4cf8ec,!![]);}catch(_0x4eea4d){return BPromise['reject'](_0x4eea4d);}return _0x264a3d['save']();};}function saveUpdates(_0x4b1477,_0x1f4d9e){return function(_0x58eb5f){if(_0x58eb5f){return _0x58eb5f[_0xd9ff('0x24')](_0x4b1477)[_0xd9ff('0x25')](function(_0x291f52){return _0x291f52;});}return null;};}function removeEntity(_0x9f074e,_0x278b66){return function(_0x42a828){if(_0x42a828){return _0x42a828['destroy']()['then'](function(){_0x9f074e[_0xd9ff('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ca906,_0x4d86fe){return function(_0x285002){if(!_0x285002){_0x3ca906['sendStatus'](0x194);}return _0x285002;};}function handleError(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0x1f4;return function(_0x2138b4){logger[_0xd9ff('0x26')](_0x2138b4['stack']);if(_0x2138b4[_0xd9ff('0x27')]){delete _0x2138b4[_0xd9ff('0x27')];}_0x10cbdd[_0xd9ff('0x1b')](_0x159e56)[_0xd9ff('0x28')](_0x2138b4);};}exports['show']=function(_0x1d3684,_0x3792d9){var _0x44b5a7={'raw':!![],'where':{'id':_0x1d3684[_0xd9ff('0x29')]['id']}},_0x45fb63={};_0x45fb63[_0xd9ff('0x2a')]=_[_0xd9ff('0x2b')](db[_0xd9ff('0x2c')][_0xd9ff('0x2d')]);_0x45fb63['query']=_[_0xd9ff('0x2b')](_0x1d3684['query']);_0x45fb63[_0xd9ff('0x2e')]=_[_0xd9ff('0x2f')](_0x45fb63[_0xd9ff('0x2a')],_0x45fb63['query']);_0x44b5a7[_0xd9ff('0x30')]=_[_0xd9ff('0x2f')](_0x45fb63[_0xd9ff('0x2a')],qs[_0xd9ff('0x31')](_0x1d3684['query'][_0xd9ff('0x31')]));_0x44b5a7['attributes']=_0x44b5a7[_0xd9ff('0x30')][_0xd9ff('0x32')]?_0x44b5a7[_0xd9ff('0x30')]:_0x45fb63[_0xd9ff('0x2a')];if(_0x1d3684[_0xd9ff('0x33')][_0xd9ff('0x34')]){_0x44b5a7[_0xd9ff('0x35')]=[{'all':!![]}];}_0x44b5a7=_[_0xd9ff('0x36')]({},_0x44b5a7,_0x1d3684[_0xd9ff('0x37')]);return db[_0xd9ff('0x2c')][_0xd9ff('0x38')](_0x44b5a7)[_0xd9ff('0x25')](handleEntityNotFound(_0x3792d9,null))[_0xd9ff('0x25')](respondWithResult(_0x3792d9,null))[_0xd9ff('0x39')](handleError(_0x3792d9,null));};exports['update']=function(_0x13322f,_0x1ef7c3){if(_0x13322f[_0xd9ff('0x3a')]['id']){delete _0x13322f['body']['id'];}return db[_0xd9ff('0x2c')]['find']({'where':{'id':_0x13322f[_0xd9ff('0x29')]['id']}})['then'](handleEntityNotFound(_0x1ef7c3,null))[_0xd9ff('0x25')](saveUpdates(_0x13322f['body'],null))[_0xd9ff('0x25')](respondWithResult(_0x1ef7c3,null))[_0xd9ff('0x39')](handleError(_0x1ef7c3,null));};exports[_0xd9ff('0x3b')]=function(_0x5e2391,_0x4db3f6){return db['ChatApplication'][_0xd9ff('0x38')]({'where':{'id':_0x5e2391[_0xd9ff('0x29')]['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x4db3f6,null))[_0xd9ff('0x25')](removeEntity(_0x4db3f6,null))[_0xd9ff('0x39')](handleError(_0x4db3f6,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 88d3dc8..02d5131 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 _0x8e0d=['moment','request-promise','path','rimraf','../../config/environment','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','api'];(function(_0x8517b6,_0x1e38eb){var _0x2b1844=function(_0x4460b0){while(--_0x4460b0){_0x8517b6['push'](_0x8517b6['shift']());}};_0x2b1844(++_0x1e38eb);}(_0x8e0d,0x82));var _0xd8e0=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0x8e0d[_0x4ed4d2];return _0x15ae2e;};'use strict';var _=require(_0xd8e0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd8e0('0x1'));var moment=require(_0xd8e0('0x2'));var BPromise=require('bluebird');var rp=require(_0xd8e0('0x3'));var fs=require('fs');var path=require(_0xd8e0('0x4'));var rimraf=require(_0xd8e0('0x5'));var config=require(_0xd8e0('0x6'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x2e79ab,_0x33ff41){return _0x2e79ab[_0xd8e0('0x7')](_0xd8e0('0x8'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd8e0('0x9'),'collate':_0xd8e0('0xa')});};
\ No newline at end of file
+var _0xfe6a=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4'];(function(_0x380774,_0x2424bf){var _0x1e0bac=function(_0x46a6ec){while(--_0x46a6ec){_0x380774['push'](_0x380774['shift']());}};_0x1e0bac(++_0x2424bf);}(_0xfe6a,0x16c));var _0xafe6=function(_0x3fe8c1,_0x50a69a){_0x3fe8c1=_0x3fe8c1-0x0;var _0x25eced=_0xfe6a[_0x3fe8c1];return _0x25eced;};'use strict';var _=require(_0xafe6('0x0'));var util=require(_0xafe6('0x1'));var logger=require(_0xafe6('0x2'))('api');var moment=require(_0xafe6('0x3'));var BPromise=require(_0xafe6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xafe6('0x5'));var rimraf=require(_0xafe6('0x6'));var config=require(_0xafe6('0x7'));var attributes=require(_0xafe6('0x8'));module[_0xafe6('0x9')]=function(_0x14c224,_0x27d937){return _0x14c224[_0xafe6('0xa')](_0xafe6('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xafe6('0xc'),'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 64ae0a3..0ab8028 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 _0x33dd=['jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x33dd,0x1db));var _0xd33d=function(_0x354264,_0x58e09b){_0x354264=_0x354264-0x0;var _0x3a5e8e=_0x33dd[_0x354264];return _0x3a5e8e;};'use strict';var _=require('lodash');var util=require(_0xd33d('0x0'));var moment=require(_0xd33d('0x1'));var BPromise=require(_0xd33d('0x2'));var rs=require(_0xd33d('0x3'));var fs=require('fs');var Redis=require(_0xd33d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd33d('0x5'));var logger=require(_0xd33d('0x6'))('rpc');var config=require(_0xd33d('0x7'));var jayson=require(_0xd33d('0x8'));var client=jayson['client'][_0xd33d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x247d16,_0x4632b7,_0x23ac7a){return new BPromise(function(_0x4f503d,_0x43dfe0){return client[_0xd33d('0xa')](_0x247d16,_0x23ac7a)[_0xd33d('0xb')](function(_0x202625){logger[_0xd33d('0xc')](_0xd33d('0xd'),_0x4632b7,'request\x20sent');logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4632b7,_0xd33d('0xe'),JSON[_0xd33d('0xf')](_0x202625));if(_0x202625[_0xd33d('0x10')]){if(_0x202625[_0xd33d('0x10')][_0xd33d('0x11')]===0x1f4){logger[_0xd33d('0x10')](_0xd33d('0xd'),_0x4632b7,_0x202625[_0xd33d('0x10')]['message']);return _0x43dfe0(_0x202625['error'][_0xd33d('0x12')]);}logger[_0xd33d('0x10')](_0xd33d('0xd'),_0x4632b7,_0x202625[_0xd33d('0x10')][_0xd33d('0x12')]);return _0x4f503d(_0x202625[_0xd33d('0x10')]['message']);}else{logger['info'](_0xd33d('0xd'),_0x4632b7,_0xd33d('0xe'));_0x4f503d(_0x202625[_0xd33d('0x13')]['message']);}})[_0xd33d('0x14')](function(_0x5490dd){logger[_0xd33d('0x10')](_0xd33d('0xd'),_0x4632b7,_0x5490dd);_0x43dfe0(_0x5490dd);});});}
\ No newline at end of file
+var _0xdf30=['http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x35bdab,_0x28a695){var _0xbe96b0=function(_0x425977){while(--_0x425977){_0x35bdab['push'](_0x35bdab['shift']());}};_0xbe96b0(++_0x28a695);}(_0xdf30,0x65));var _0x0df3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf30[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0df3('0x0'));var util=require(_0x0df3('0x1'));var moment=require(_0x0df3('0x2'));var BPromise=require('bluebird');var rs=require(_0x0df3('0x3'));var fs=require('fs');var Redis=require(_0x0df3('0x4'));var db=require(_0x0df3('0x5'))['db'];var utils=require(_0x0df3('0x6'));var logger=require(_0x0df3('0x7'))(_0x0df3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0df3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34c0b4,_0x196ebd,_0x140541){return new BPromise(function(_0x153175,_0x1a74fc){return client[_0x0df3('0xa')](_0x34c0b4,_0x140541)[_0x0df3('0xb')](function(_0x41e02b){logger[_0x0df3('0xc')](_0x0df3('0xd'),_0x196ebd,_0x0df3('0xe'));logger[_0x0df3('0xf')](_0x0df3('0x10'),_0x196ebd,_0x0df3('0xe'),JSON[_0x0df3('0x11')](_0x41e02b));if(_0x41e02b['error']){if(_0x41e02b['error']['code']===0x1f4){logger[_0x0df3('0x12')](_0x0df3('0xd'),_0x196ebd,_0x41e02b['error'][_0x0df3('0x13')]);return _0x1a74fc(_0x41e02b[_0x0df3('0x12')][_0x0df3('0x13')]);}logger[_0x0df3('0x12')](_0x0df3('0xd'),_0x196ebd,_0x41e02b[_0x0df3('0x12')][_0x0df3('0x13')]);return _0x153175(_0x41e02b[_0x0df3('0x12')][_0x0df3('0x13')]);}else{logger[_0x0df3('0xc')]('ChatApplication,\x20%s,\x20%s',_0x196ebd,_0x0df3('0xe'));_0x153175(_0x41e02b[_0x0df3('0x14')][_0x0df3('0x13')]);}})[_0x0df3('0x15')](function(_0x4405ab){logger[_0x0df3('0x12')](_0x0df3('0xd'),_0x196ebd,_0x4405ab);_0x1a74fc(_0x4405ab);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 27720d5..30b47f9 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 _0xe2c0=['put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show'];(function(_0x53bea5,_0xfbebf2){var _0x10e9bc=function(_0x565ef6){while(--_0x565ef6){_0x53bea5['push'](_0x53bea5['shift']());}};_0x10e9bc(++_0xfbebf2);}(_0xe2c0,0x126));var _0x0e2c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe2c0[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x0e2c('0x0'));var util=require(_0x0e2c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0e2c('0x2'));var router=express[_0x0e2c('0x3')]();var fs_extra=require(_0x0e2c('0x4'));var auth=require(_0x0e2c('0x5'));var interaction=require(_0x0e2c('0x6'));var config=require(_0x0e2c('0x7'));var controller=require(_0x0e2c('0x8'));router['get'](_0x0e2c('0x9'),auth[_0x0e2c('0xa')](),controller[_0x0e2c('0xb')]);router[_0x0e2c('0xc')](_0x0e2c('0x9'),auth['isAuthenticated'](),controller[_0x0e2c('0xd')]);router[_0x0e2c('0xe')]('/:id',auth[_0x0e2c('0xa')](),controller[_0x0e2c('0xf')]);module[_0x0e2c('0x10')]=router;
\ No newline at end of file
+var _0x5511=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','/:id','isAuthenticated','put','delete','multer'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x5511,0x110));var _0x1551=function(_0x393ea8,_0x4ef9d4){_0x393ea8=_0x393ea8-0x0;var _0x1455af=_0x5511[_0x393ea8];return _0x1455af;};'use strict';var multer=require(_0x1551('0x0'));var util=require(_0x1551('0x1'));var path=require(_0x1551('0x2'));var timeout=require(_0x1551('0x3'));var express=require(_0x1551('0x4'));var router=express[_0x1551('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1551('0x6'));var interaction=require(_0x1551('0x7'));var config=require('../../config/environment');var controller=require(_0x1551('0x8'));router['get'](_0x1551('0x9'),auth[_0x1551('0xa')](),controller['show']);router[_0x1551('0xb')](_0x1551('0x9'),auth[_0x1551('0xa')](),controller['update']);router[_0x1551('0xc')](_0x1551('0x9'),auth[_0x1551('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 526073b..7e81ae0 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 _0x110e=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2e3f2c,_0x1ff03d){var _0x214fa6=function(_0x1fefce){while(--_0x1fefce){_0x2e3f2c['push'](_0x2e3f2c['shift']());}};_0x214fa6(++_0x1ff03d);}(_0x110e,0x68));var _0xe110=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x110e[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xe110('0x0'));module[_0xe110('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe110('0x2')]},'write':{'type':Sequelize[_0xe110('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x032f=['sequelize','exports','STRING'];(function(_0x408f4b,_0x9acffc){var _0x1c574e=function(_0x34d9f6){while(--_0x34d9f6){_0x408f4b['push'](_0x408f4b['shift']());}};_0x1c574e(++_0x9acffc);}(_0x032f,0x7b));var _0xf032=function(_0x254635,_0x472b4c){_0x254635=_0x254635-0x0;var _0x35293c=_0x032f[_0x254635];return _0x35293c;};'use strict';var Sequelize=require(_0xf032('0x0'));module[_0xf032('0x1')]={'name':{'type':Sequelize[_0xf032('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf032('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index da110ef..c5130a3 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 _0xb450=['format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','register','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','ChatGroup','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','rawAttributes','find','body','catch','params','ChatInternalMessage','toInteger','ids','getMembers','findOne','User','removeMembers','ChatGroupId','create','getMessages','$gte'];(function(_0x1108d7,_0x16c93c){var _0x1d7eca=function(_0x4925ce){while(--_0x4925ce){_0x1108d7['push'](_0x1108d7['shift']());}};_0x1d7eca(++_0x16c93c);}(_0xb450,0x172));var _0x0b45=function(_0x29e2fe,_0x6b9ce6){_0x29e2fe=_0x29e2fe-0x0;var _0x16f447=_0xb450[_0x29e2fe];return _0x16f447;};'use strict';var emlformat=require(_0x0b45('0x0'));var rimraf=require(_0x0b45('0x1'));var zipdir=require(_0x0b45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b45('0x3'));var moment=require(_0x0b45('0x4'));var BPromise=require(_0x0b45('0x5'));var Mustache=require(_0x0b45('0x6'));var util=require(_0x0b45('0x7'));var path=require(_0x0b45('0x8'));var sox=require(_0x0b45('0x9'));var csv=require(_0x0b45('0xa'));var ejs=require(_0x0b45('0xb'));var fs=require('fs');var fs_extra=require(_0x0b45('0xc'));var _=require(_0x0b45('0xd'));var squel=require(_0x0b45('0xe'));var crypto=require(_0x0b45('0xf'));var jsforce=require(_0x0b45('0x10'));var deskjs=require(_0x0b45('0x11'));var toCsv=require(_0x0b45('0xa'));var querystring=require(_0x0b45('0x12'));var Papa=require('papaparse');var Redis=require(_0x0b45('0x13'));var authService=require(_0x0b45('0x14'));var qs=require(_0x0b45('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b45('0x16'));var logger=require('../../config/logger')(_0x0b45('0x17'));var utils=require('../../config/utils');var config=require(_0x0b45('0x18'));var licenseUtil=require(_0x0b45('0x19'));var db=require(_0x0b45('0x1a'))['db'];config[_0x0b45('0x1b')]=_['defaults'](config[_0x0b45('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0b45('0x1b')]));require('./chatGroup.socket')[_0x0b45('0x1c')](socket);function respondWithStatusCode(_0x42a563,_0x111582){_0x111582=_0x111582||0xcc;return function(_0x415a6f){if(_0x415a6f){return _0x42a563[_0x0b45('0x1d')](_0x111582);}return _0x42a563['status'](_0x111582)[_0x0b45('0x1e')]();};}function respondWithResult(_0x270272,_0x122f10){_0x122f10=_0x122f10||0xc8;return function(_0x1ce2f7){if(_0x1ce2f7){return _0x270272['status'](_0x122f10)[_0x0b45('0x1f')](_0x1ce2f7);}};}function respondWithFilteredResult(_0x7226ab,_0x1337e5){return function(_0x16a57b){if(_0x16a57b){var _0x2d91ca=typeof _0x1337e5[_0x0b45('0x20')]==='undefined'&&typeof _0x1337e5[_0x0b45('0x21')]==='undefined';var _0x470101=_0x16a57b[_0x0b45('0x22')];var _0x4e9aea=_0x2d91ca?0x0:_0x1337e5[_0x0b45('0x20')];var _0x1c0782=_0x2d91ca?_0x16a57b['count']:_0x1337e5[_0x0b45('0x20')]+_0x1337e5[_0x0b45('0x21')];var _0x251f59;if(_0x1c0782>=_0x470101){_0x1c0782=_0x470101;_0x251f59=0xc8;}else{_0x251f59=0xce;}_0x7226ab[_0x0b45('0x23')](_0x251f59);return _0x7226ab[_0x0b45('0x24')](_0x0b45('0x25'),_0x4e9aea+'-'+_0x1c0782+'/'+_0x470101)[_0x0b45('0x1f')](_0x16a57b);}return null;};}function patchUpdates(_0x493299){return function(_0x29df47){try{jsonpatch[_0x0b45('0x26')](_0x29df47,_0x493299,!![]);}catch(_0x450aec){return BPromise[_0x0b45('0x27')](_0x450aec);}return _0x29df47[_0x0b45('0x28')]();};}function saveUpdates(_0x3bfaf3,_0x5722bf){return function(_0x1c228c){if(_0x1c228c){return _0x1c228c['update'](_0x3bfaf3)[_0x0b45('0x29')](function(_0x38fe15){return _0x38fe15;});}return null;};}function removeEntity(_0x1ef1bd,_0x83206e){return function(_0x10b421){if(_0x10b421){return _0x10b421[_0x0b45('0x2a')]()['then'](function(){_0x1ef1bd['status'](0xcc)[_0x0b45('0x1e')]();});}};}function handleEntityNotFound(_0x919961,_0x43bbfb){return function(_0x1b55f8){if(!_0x1b55f8){_0x919961['sendStatus'](0x194);}return _0x1b55f8;};}function handleError(_0x49f04b,_0x39d81c){_0x39d81c=_0x39d81c||0x1f4;return function(_0x4ba84e){logger[_0x0b45('0x2b')](_0x4ba84e['stack']);if(_0x4ba84e[_0x0b45('0x2c')]){delete _0x4ba84e[_0x0b45('0x2c')];}_0x49f04b[_0x0b45('0x23')](_0x39d81c)[_0x0b45('0x2d')](_0x4ba84e);};}exports[_0x0b45('0x2e')]=function(_0x5abf1b,_0x5c6bc8){var _0x2ede53={},_0x44e25d={},_0x4c536a={'count':0x0,'rows':[]};var _0x5aa47e=_[_0x0b45('0x2f')](db[_0x0b45('0x30')]['rawAttributes'],function(_0x448a5f){return{'name':_0x448a5f[_0x0b45('0x31')],'type':_0x448a5f[_0x0b45('0x32')][_0x0b45('0x33')]};});_0x44e25d['model']=_[_0x0b45('0x2f')](_0x5aa47e,'name');_0x44e25d[_0x0b45('0x34')]=_[_0x0b45('0x35')](_0x5abf1b[_0x0b45('0x34')]);_0x44e25d['filters']=_[_0x0b45('0x36')](_0x44e25d['model'],_0x44e25d[_0x0b45('0x34')]);_0x2ede53[_0x0b45('0x37')]=_[_0x0b45('0x36')](_0x44e25d[_0x0b45('0x38')],qs[_0x0b45('0x39')](_0x5abf1b[_0x0b45('0x34')][_0x0b45('0x39')]));_0x2ede53[_0x0b45('0x37')]=_0x2ede53['attributes'][_0x0b45('0x3a')]?_0x2ede53['attributes']:_0x44e25d[_0x0b45('0x38')];if(!_0x5abf1b['query'][_0x0b45('0x3b')](_0x0b45('0x3c'))){_0x2ede53['limit']=qs[_0x0b45('0x21')](_0x5abf1b[_0x0b45('0x34')]['limit']);_0x2ede53['offset']=qs[_0x0b45('0x20')](_0x5abf1b[_0x0b45('0x34')]['offset']);}_0x2ede53[_0x0b45('0x3d')]=qs[_0x0b45('0x3e')](_0x5abf1b[_0x0b45('0x34')]['sort']);_0x2ede53[_0x0b45('0x3f')]=qs[_0x0b45('0x40')](_[_0x0b45('0x41')](_0x5abf1b[_0x0b45('0x34')],_0x44e25d[_0x0b45('0x40')]),_0x5aa47e);if(_0x5abf1b[_0x0b45('0x34')][_0x0b45('0x42')]){_0x2ede53[_0x0b45('0x3f')]=_[_0x0b45('0x43')](_0x2ede53['where'],{'$or':_[_0x0b45('0x2f')](_0x5aa47e,function(_0x181b26){if(_0x181b26[_0x0b45('0x32')]!==_0x0b45('0x44')){var _0x50f278={};_0x50f278[_0x181b26[_0x0b45('0x2c')]]={'$like':'%'+_0x5abf1b[_0x0b45('0x34')][_0x0b45('0x42')]+'%'};return _0x50f278;}})});}_0x2ede53=_[_0x0b45('0x43')]({},_0x2ede53,_0x5abf1b[_0x0b45('0x45')]);var _0x427984={'where':_0x2ede53[_0x0b45('0x3f')]};return db[_0x0b45('0x30')]['count'](_0x427984)[_0x0b45('0x29')](function(_0x1c2ab8){_0x4c536a[_0x0b45('0x22')]=_0x1c2ab8;if(_0x5abf1b[_0x0b45('0x34')][_0x0b45('0x46')]){_0x2ede53[_0x0b45('0x47')]=[{'all':!![]}];}return db[_0x0b45('0x30')][_0x0b45('0x48')](_0x2ede53);})[_0x0b45('0x29')](function(_0x1135f0){_0x4c536a[_0x0b45('0x49')]=_0x1135f0;return _0x4c536a;})['then'](respondWithFilteredResult(_0x5c6bc8,_0x2ede53))['catch'](handleError(_0x5c6bc8,null));};exports['show']=function(_0x52eace,_0x547454){var _0x4554f4={'raw':!![],'where':{'id':_0x52eace['params']['id']}},_0x2fa93f={};_0x2fa93f[_0x0b45('0x38')]=_[_0x0b45('0x35')](db[_0x0b45('0x30')][_0x0b45('0x4a')]);_0x2fa93f[_0x0b45('0x34')]=_[_0x0b45('0x35')](_0x52eace[_0x0b45('0x34')]);_0x2fa93f[_0x0b45('0x40')]=_[_0x0b45('0x36')](_0x2fa93f['model'],_0x2fa93f['query']);_0x4554f4['attributes']=_['intersection'](_0x2fa93f[_0x0b45('0x38')],qs[_0x0b45('0x39')](_0x52eace[_0x0b45('0x34')][_0x0b45('0x39')]));_0x4554f4[_0x0b45('0x37')]=_0x4554f4[_0x0b45('0x37')][_0x0b45('0x3a')]?_0x4554f4['attributes']:_0x2fa93f[_0x0b45('0x38')];if(_0x52eace[_0x0b45('0x34')]['includeAll']){_0x4554f4[_0x0b45('0x47')]=[{'all':!![]}];}_0x4554f4=_[_0x0b45('0x43')]({},_0x4554f4,_0x52eace[_0x0b45('0x45')]);return db[_0x0b45('0x30')][_0x0b45('0x4b')](_0x4554f4)[_0x0b45('0x29')](handleEntityNotFound(_0x547454,null))['then'](respondWithResult(_0x547454,null))['catch'](handleError(_0x547454,null));};exports['create']=function(_0x3fb57b,_0x5a5419){return db[_0x0b45('0x30')]['create'](_0x3fb57b[_0x0b45('0x4c')],{})[_0x0b45('0x29')](respondWithResult(_0x5a5419,0xc9))[_0x0b45('0x4d')](handleError(_0x5a5419,null));};exports['update']=function(_0x52c1c1,_0x4f41cd){if(_0x52c1c1[_0x0b45('0x4c')]['id']){delete _0x52c1c1[_0x0b45('0x4c')]['id'];}return db[_0x0b45('0x30')][_0x0b45('0x4b')]({'where':{'id':_0x52c1c1[_0x0b45('0x4e')]['id']}})[_0x0b45('0x29')](handleEntityNotFound(_0x4f41cd,null))[_0x0b45('0x29')](saveUpdates(_0x52c1c1[_0x0b45('0x4c')],null))[_0x0b45('0x29')](respondWithResult(_0x4f41cd,null))[_0x0b45('0x4d')](handleError(_0x4f41cd,null));};exports[_0x0b45('0x2a')]=function(_0x885922,_0x2344e3){return db[_0x0b45('0x30')][_0x0b45('0x4b')]({'where':{'id':_0x885922[_0x0b45('0x4e')]['id']}})[_0x0b45('0x29')](handleEntityNotFound(_0x2344e3,null))[_0x0b45('0x29')](removeEntity(_0x2344e3,null))[_0x0b45('0x4d')](handleError(_0x2344e3,null));};exports['describe']=function(_0x142e68,_0x1c6b98){return db[_0x0b45('0x30')]['describe']()['then'](respondWithResult(_0x1c6b98,null))[_0x0b45('0x4d')](handleError(_0x1c6b98,null));};exports['getUnread']=function(_0x38cbeb,_0x4257c1,_0xc823d9){return db[_0x0b45('0x4f')][_0x0b45('0x22')]({'where':{'ChatGroupId':_0x38cbeb[_0x0b45('0x4e')]['id'],'ToId':_0x38cbeb['user']['id'],'read':![]}})[_0x0b45('0x29')](function(_0x4aaceb){return{'id':_[_0x0b45('0x50')](_0x38cbeb[_0x0b45('0x4e')]['id']),'count':_0x4aaceb};})['then'](respondWithResult(_0x4257c1,null))['catch'](handleError(_0x4257c1,null));};exports['addMembers']=function(_0x1c1f8f,_0x4bc576,_0x295fb8){return db[_0x0b45('0x30')][_0x0b45('0x4b')]({'where':{'id':_0x1c1f8f[_0x0b45('0x4e')]['id']}})[_0x0b45('0x29')](handleEntityNotFound(_0x4bc576,null))['then'](function(_0x5cd897){if(_0x5cd897){return _0x5cd897['addMembers'](_0x1c1f8f[_0x0b45('0x4c')][_0x0b45('0x51')],_['omit'](_0x1c1f8f[_0x0b45('0x4c')],['ids','id'])||{});}})['then'](respondWithResult(_0x4bc576,null))[_0x0b45('0x4d')](handleError(_0x4bc576,null));};exports[_0x0b45('0x52')]=function(_0x3d163a,_0x217f27,_0x52ca65){var _0x2af765={};var _0x415669={};var _0xcbced4;var _0x1da544;return db[_0x0b45('0x30')][_0x0b45('0x53')]({'where':{'id':_0x3d163a['params']['id']}})[_0x0b45('0x29')](handleEntityNotFound(_0x217f27,null))[_0x0b45('0x29')](function(_0x340504){if(_0x340504){_0xcbced4=_0x340504;_0x415669['model']=_[_0x0b45('0x35')](db[_0x0b45('0x54')][_0x0b45('0x4a')]);_0x415669[_0x0b45('0x34')]=_[_0x0b45('0x35')](_0x3d163a[_0x0b45('0x34')]);_0x415669[_0x0b45('0x40')]=_['intersection'](_0x415669[_0x0b45('0x38')],_0x415669[_0x0b45('0x34')]);_0x2af765[_0x0b45('0x37')]=_[_0x0b45('0x36')](_0x415669[_0x0b45('0x38')],qs[_0x0b45('0x39')](_0x3d163a[_0x0b45('0x34')][_0x0b45('0x39')]));_0x2af765[_0x0b45('0x37')]=_0x2af765[_0x0b45('0x37')][_0x0b45('0x3a')]?_0x2af765[_0x0b45('0x37')]:_0x415669[_0x0b45('0x38')];_0x2af765['order']=qs[_0x0b45('0x3e')](_0x3d163a[_0x0b45('0x34')][_0x0b45('0x3e')]);_0x2af765[_0x0b45('0x3f')]=qs[_0x0b45('0x40')](_[_0x0b45('0x41')](_0x3d163a['query'],_0x415669['filters']));if(_0x3d163a['query']['filter']){_0x2af765[_0x0b45('0x3f')]=_['merge'](_0x2af765[_0x0b45('0x3f')],{'$or':_[_0x0b45('0x2f')](_0x2af765[_0x0b45('0x37')],function(_0x19c736){var _0x249cdf={};_0x249cdf[_0x19c736]={'$like':'%'+_0x3d163a[_0x0b45('0x34')][_0x0b45('0x42')]+'%'};return _0x249cdf;})});}_0x2af765=_['merge']({},_0x2af765,_0x3d163a['options']);return _0xcbced4['getMembers'](_0x2af765);}})[_0x0b45('0x29')](function(_0x48e435){if(_0x48e435){_0x1da544=_0x48e435['length'];if(!_0x3d163a['query'][_0x0b45('0x3b')](_0x0b45('0x3c'))){_0x2af765[_0x0b45('0x21')]=qs[_0x0b45('0x21')](_0x3d163a['query'][_0x0b45('0x21')]);_0x2af765[_0x0b45('0x20')]=qs[_0x0b45('0x20')](_0x3d163a[_0x0b45('0x34')]['offset']);}return _0xcbced4[_0x0b45('0x52')](_0x2af765);}})[_0x0b45('0x29')](function(_0x3d9263){if(_0x3d9263){return _0x3d9263?{'count':_0x1da544,'rows':_0x3d9263}:null;}})[_0x0b45('0x29')](respondWithResult(_0x217f27,null))[_0x0b45('0x4d')](handleError(_0x217f27,null));};exports[_0x0b45('0x55')]=function(_0x3d2906,_0x64b159,_0x5d801a){return db[_0x0b45('0x30')][_0x0b45('0x4b')]({'where':{'id':_0x3d2906[_0x0b45('0x4e')]['id']}})['then'](handleEntityNotFound(_0x64b159,null))[_0x0b45('0x29')](function(_0x9a97b8){if(_0x9a97b8){return _0x9a97b8[_0x0b45('0x55')](_0x3d2906[_0x0b45('0x34')][_0x0b45('0x51')]);}})[_0x0b45('0x29')](respondWithStatusCode(_0x64b159,null))[_0x0b45('0x4d')](handleError(_0x64b159,null));};exports['addMessage']=function(_0x4656b1,_0xf0357a,_0x4a3945){if(_0x4656b1[_0x0b45('0x4c')]['id']){delete _0x4656b1[_0x0b45('0x4c')]['id'];}return db[_0x0b45('0x30')][_0x0b45('0x4b')]({'where':{'id':_0x4656b1[_0x0b45('0x4e')]['id']}})[_0x0b45('0x29')](handleEntityNotFound(_0xf0357a,null))['then'](function(_0x8966b6){if(_0x8966b6){_0x4656b1['body'][_0x0b45('0x56')]=_0x8966b6['id'];return db[_0x0b45('0x4f')][_0x0b45('0x57')](_0x4656b1[_0x0b45('0x4c')]);}})[_0x0b45('0x29')](respondWithResult(_0xf0357a,null))[_0x0b45('0x4d')](handleError(_0xf0357a,null));};exports[_0x0b45('0x58')]=function(_0x4cc2ba,_0x198379,_0x5a6c07){var _0x54fc96={};var _0x1024b4={};var _0x8e4512;var _0x4d4b30;return db[_0x0b45('0x30')]['findOne']({'where':{'id':_0x4cc2ba[_0x0b45('0x4e')]['id']}})['then'](handleEntityNotFound(_0x198379,null))[_0x0b45('0x29')](function(_0x4f4612){if(_0x4f4612){_0x8e4512=_0x4f4612;_0x1024b4[_0x0b45('0x38')]=_[_0x0b45('0x35')](db[_0x0b45('0x4f')][_0x0b45('0x4a')]);_0x1024b4['query']=_[_0x0b45('0x35')](_0x4cc2ba[_0x0b45('0x34')]);_0x1024b4[_0x0b45('0x40')]=_['intersection'](_0x1024b4[_0x0b45('0x38')],_0x1024b4[_0x0b45('0x34')]);_0x54fc96['attributes']=_[_0x0b45('0x36')](_0x1024b4[_0x0b45('0x38')],qs[_0x0b45('0x39')](_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x39')]));_0x54fc96['attributes']=_0x54fc96[_0x0b45('0x37')][_0x0b45('0x3a')]?_0x54fc96[_0x0b45('0x37')]:_0x1024b4[_0x0b45('0x38')];_0x54fc96[_0x0b45('0x3d')]=qs[_0x0b45('0x3e')](_0x4cc2ba[_0x0b45('0x34')]['sort']);_0x54fc96[_0x0b45('0x3f')]=qs[_0x0b45('0x40')](_[_0x0b45('0x41')](_0x4cc2ba[_0x0b45('0x34')],_0x1024b4[_0x0b45('0x40')]));if(_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x42')]){_0x54fc96[_0x0b45('0x3f')]=_['merge'](_0x54fc96[_0x0b45('0x3f')],{'$or':_['map'](_0x54fc96[_0x0b45('0x37')],function(_0x538471){var _0x13b954={};_0x13b954[_0x538471]={'$like':'%'+_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x42')]+'%'};return _0x13b954;})});}if(_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x59')]){var _0x596bf3=_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x59')]['split'](',');var _0x492be4={};_0x492be4[_0x596bf3[0x0]]={'$gte':moment(_0x596bf3[0x1])[_0x0b45('0x5a')](_0x0b45('0x5b'))};_0x54fc96[_0x0b45('0x3f')]=_[_0x0b45('0x43')](_0x54fc96[_0x0b45('0x3f')],_0x492be4);}_0x54fc96=_[_0x0b45('0x43')]({},_0x54fc96,_0x4cc2ba[_0x0b45('0x45')]);return _0x8e4512['getMessages'](_0x54fc96);}})[_0x0b45('0x29')](function(_0xb1c411){if(_0xb1c411){_0x4d4b30=_0xb1c411['length'];if(!_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x3b')](_0x0b45('0x3c'))){_0x54fc96[_0x0b45('0x21')]=qs[_0x0b45('0x21')](_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x21')]);_0x54fc96[_0x0b45('0x20')]=qs[_0x0b45('0x20')](_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x20')]);}return _0x8e4512[_0x0b45('0x58')](_0x54fc96);}})['then'](function(_0x710b0c){if(_0x710b0c){return _0x710b0c?{'count':_0x4d4b30,'rows':_0x710b0c}:null;}})[_0x0b45('0x29')](respondWithResult(_0x198379,null))['catch'](handleError(_0x198379,null));};
\ No newline at end of file
+var _0x07c4=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','merge','where','VIRTUAL','include','findAll','rows','catch','show','includeAll','options','find','create','body','params','describe','user','toInteger','addMembers','ids','omit','getMembers','keys','User','pick','addMessage','ChatInternalMessage','getMessages','findOne','$gte','format','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x07c4,0x1bf));var _0x407c=function(_0x3eca29,_0x54951b){_0x3eca29=_0x3eca29-0x0;var _0x44a019=_0x07c4[_0x3eca29];return _0x44a019;};'use strict';var emlformat=require(_0x407c('0x0'));var rimraf=require(_0x407c('0x1'));var zipdir=require(_0x407c('0x2'));var jsonpatch=require(_0x407c('0x3'));var rp=require(_0x407c('0x4'));var moment=require(_0x407c('0x5'));var BPromise=require(_0x407c('0x6'));var Mustache=require(_0x407c('0x7'));var util=require(_0x407c('0x8'));var path=require('path');var sox=require(_0x407c('0x9'));var csv=require(_0x407c('0xa'));var ejs=require(_0x407c('0xb'));var fs=require('fs');var fs_extra=require(_0x407c('0xc'));var _=require(_0x407c('0xd'));var squel=require(_0x407c('0xe'));var crypto=require(_0x407c('0xf'));var jsforce=require(_0x407c('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x407c('0xa'));var querystring=require(_0x407c('0x11'));var Papa=require(_0x407c('0x12'));var Redis=require(_0x407c('0x13'));var authService=require(_0x407c('0x14'));var qs=require(_0x407c('0x15'));var as=require(_0x407c('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x407c('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x407c('0x18')]=_[_0x407c('0x19')](config[_0x407c('0x18')],{'host':_0x407c('0x1a'),'port':0x18eb});var socket=require(_0x407c('0x1b'))(new Redis(config[_0x407c('0x18')]));require(_0x407c('0x1c'))['register'](socket);function respondWithStatusCode(_0x973426,_0x402144){_0x402144=_0x402144||0xcc;return function(_0x2296fe){if(_0x2296fe){return _0x973426[_0x407c('0x1d')](_0x402144);}return _0x973426[_0x407c('0x1e')](_0x402144)[_0x407c('0x1f')]();};}function respondWithResult(_0x29056b,_0x2322d7){_0x2322d7=_0x2322d7||0xc8;return function(_0x1986c8){if(_0x1986c8){return _0x29056b['status'](_0x2322d7)['json'](_0x1986c8);}};}function respondWithFilteredResult(_0x2a0094,_0x249565){return function(_0x43dce6){if(_0x43dce6){var _0x231a43=typeof _0x249565[_0x407c('0x20')]==='undefined'&&typeof _0x249565['limit']===_0x407c('0x21');var _0x702204=_0x43dce6[_0x407c('0x22')];var _0x5ab2ca=_0x231a43?0x0:_0x249565[_0x407c('0x20')];var _0x37997c=_0x231a43?_0x43dce6[_0x407c('0x22')]:_0x249565[_0x407c('0x20')]+_0x249565[_0x407c('0x23')];var _0xb88f6;if(_0x37997c>=_0x702204){_0x37997c=_0x702204;_0xb88f6=0xc8;}else{_0xb88f6=0xce;}_0x2a0094[_0x407c('0x1e')](_0xb88f6);return _0x2a0094['set'](_0x407c('0x24'),_0x5ab2ca+'-'+_0x37997c+'/'+_0x702204)['json'](_0x43dce6);}return null;};}function patchUpdates(_0x5c2813){return function(_0x35b9de){try{jsonpatch[_0x407c('0x25')](_0x35b9de,_0x5c2813,!![]);}catch(_0x10bd3f){return BPromise[_0x407c('0x26')](_0x10bd3f);}return _0x35b9de[_0x407c('0x27')]();};}function saveUpdates(_0x1ced44,_0x408323){return function(_0x59db4c){if(_0x59db4c){return _0x59db4c[_0x407c('0x28')](_0x1ced44)['then'](function(_0x43079e){return _0x43079e;});}return null;};}function removeEntity(_0x1b1015,_0x1fd53f){return function(_0x4f2f44){if(_0x4f2f44){return _0x4f2f44['destroy']()[_0x407c('0x29')](function(){_0x1b1015[_0x407c('0x1e')](0xcc)[_0x407c('0x1f')]();});}};}function handleEntityNotFound(_0x127df1,_0x5bce43){return function(_0x3d88c1){if(!_0x3d88c1){_0x127df1[_0x407c('0x1d')](0x194);}return _0x3d88c1;};}function handleError(_0x2ca55c,_0xfc5a7e){_0xfc5a7e=_0xfc5a7e||0x1f4;return function(_0x230590){logger[_0x407c('0x2a')](_0x230590['stack']);if(_0x230590[_0x407c('0x2b')]){delete _0x230590[_0x407c('0x2b')];}_0x2ca55c[_0x407c('0x1e')](_0xfc5a7e)[_0x407c('0x2c')](_0x230590);};}exports[_0x407c('0x2d')]=function(_0x533ec0,_0x3cb16a){var _0x133d01={},_0x43977d={},_0x163fae={'count':0x0,'rows':[]};var _0x117f77=_[_0x407c('0x2e')](db[_0x407c('0x2f')][_0x407c('0x30')],function(_0x5590ce){return{'name':_0x5590ce['fieldName'],'type':_0x5590ce[_0x407c('0x31')][_0x407c('0x32')]};});_0x43977d[_0x407c('0x33')]=_[_0x407c('0x2e')](_0x117f77,_0x407c('0x2b'));_0x43977d[_0x407c('0x34')]=_['keys'](_0x533ec0[_0x407c('0x34')]);_0x43977d[_0x407c('0x35')]=_[_0x407c('0x36')](_0x43977d[_0x407c('0x33')],_0x43977d[_0x407c('0x34')]);_0x133d01[_0x407c('0x37')]=_[_0x407c('0x36')](_0x43977d['model'],qs[_0x407c('0x38')](_0x533ec0['query'][_0x407c('0x38')]));_0x133d01[_0x407c('0x37')]=_0x133d01[_0x407c('0x37')][_0x407c('0x39')]?_0x133d01[_0x407c('0x37')]:_0x43977d[_0x407c('0x33')];if(!_0x533ec0['query']['hasOwnProperty'](_0x407c('0x3a'))){_0x133d01[_0x407c('0x23')]=qs[_0x407c('0x23')](_0x533ec0[_0x407c('0x34')]['limit']);_0x133d01[_0x407c('0x20')]=qs['offset'](_0x533ec0[_0x407c('0x34')][_0x407c('0x20')]);}_0x133d01[_0x407c('0x3b')]=qs[_0x407c('0x3c')](_0x533ec0[_0x407c('0x34')][_0x407c('0x3c')]);_0x133d01['where']=qs[_0x407c('0x35')](_['pick'](_0x533ec0[_0x407c('0x34')],_0x43977d[_0x407c('0x35')]),_0x117f77);if(_0x533ec0['query'][_0x407c('0x3d')]){_0x133d01['where']=_[_0x407c('0x3e')](_0x133d01[_0x407c('0x3f')],{'$or':_[_0x407c('0x2e')](_0x117f77,function(_0x501553){if(_0x501553[_0x407c('0x31')]!==_0x407c('0x40')){var _0x41eac4={};_0x41eac4[_0x501553['name']]={'$like':'%'+_0x533ec0[_0x407c('0x34')][_0x407c('0x3d')]+'%'};return _0x41eac4;}})});}_0x133d01=_[_0x407c('0x3e')]({},_0x133d01,_0x533ec0['options']);var _0x3ce804={'where':_0x133d01[_0x407c('0x3f')]};return db['ChatGroup']['count'](_0x3ce804)['then'](function(_0xa92283){_0x163fae[_0x407c('0x22')]=_0xa92283;if(_0x533ec0[_0x407c('0x34')]['includeAll']){_0x133d01[_0x407c('0x41')]=[{'all':!![]}];}return db[_0x407c('0x2f')][_0x407c('0x42')](_0x133d01);})[_0x407c('0x29')](function(_0x1798e2){_0x163fae[_0x407c('0x43')]=_0x1798e2;return _0x163fae;})[_0x407c('0x29')](respondWithFilteredResult(_0x3cb16a,_0x133d01))[_0x407c('0x44')](handleError(_0x3cb16a,null));};exports[_0x407c('0x45')]=function(_0x88fedd,_0x3a81fb){var _0x33bd85={'raw':!![],'where':{'id':_0x88fedd['params']['id']}},_0x29714c={};_0x29714c[_0x407c('0x33')]=_['keys'](db['ChatGroup'][_0x407c('0x30')]);_0x29714c['query']=_['keys'](_0x88fedd[_0x407c('0x34')]);_0x29714c[_0x407c('0x35')]=_[_0x407c('0x36')](_0x29714c[_0x407c('0x33')],_0x29714c['query']);_0x33bd85[_0x407c('0x37')]=_[_0x407c('0x36')](_0x29714c[_0x407c('0x33')],qs[_0x407c('0x38')](_0x88fedd[_0x407c('0x34')][_0x407c('0x38')]));_0x33bd85[_0x407c('0x37')]=_0x33bd85[_0x407c('0x37')][_0x407c('0x39')]?_0x33bd85[_0x407c('0x37')]:_0x29714c['model'];if(_0x88fedd['query'][_0x407c('0x46')]){_0x33bd85[_0x407c('0x41')]=[{'all':!![]}];}_0x33bd85=_['merge']({},_0x33bd85,_0x88fedd[_0x407c('0x47')]);return db[_0x407c('0x2f')][_0x407c('0x48')](_0x33bd85)[_0x407c('0x29')](handleEntityNotFound(_0x3a81fb,null))[_0x407c('0x29')](respondWithResult(_0x3a81fb,null))[_0x407c('0x44')](handleError(_0x3a81fb,null));};exports[_0x407c('0x49')]=function(_0x264a6e,_0x464264){return db[_0x407c('0x2f')][_0x407c('0x49')](_0x264a6e[_0x407c('0x4a')],{})['then'](respondWithResult(_0x464264,0xc9))[_0x407c('0x44')](handleError(_0x464264,null));};exports['update']=function(_0x316d12,_0x3bfe4e){if(_0x316d12[_0x407c('0x4a')]['id']){delete _0x316d12['body']['id'];}return db[_0x407c('0x2f')][_0x407c('0x48')]({'where':{'id':_0x316d12[_0x407c('0x4b')]['id']}})[_0x407c('0x29')](handleEntityNotFound(_0x3bfe4e,null))['then'](saveUpdates(_0x316d12[_0x407c('0x4a')],null))[_0x407c('0x29')](respondWithResult(_0x3bfe4e,null))[_0x407c('0x44')](handleError(_0x3bfe4e,null));};exports['destroy']=function(_0x1a010c,_0x14a2c2){return db['ChatGroup'][_0x407c('0x48')]({'where':{'id':_0x1a010c[_0x407c('0x4b')]['id']}})[_0x407c('0x29')](handleEntityNotFound(_0x14a2c2,null))[_0x407c('0x29')](removeEntity(_0x14a2c2,null))[_0x407c('0x44')](handleError(_0x14a2c2,null));};exports[_0x407c('0x4c')]=function(_0x3aaf16,_0x562b3a){return db[_0x407c('0x2f')][_0x407c('0x4c')]()[_0x407c('0x29')](respondWithResult(_0x562b3a,null))['catch'](handleError(_0x562b3a,null));};exports['getUnread']=function(_0x50a565,_0x188511,_0x1a4637){return db['ChatInternalMessage'][_0x407c('0x22')]({'where':{'ChatGroupId':_0x50a565[_0x407c('0x4b')]['id'],'ToId':_0x50a565[_0x407c('0x4d')]['id'],'read':![]}})['then'](function(_0x6205e0){return{'id':_[_0x407c('0x4e')](_0x50a565[_0x407c('0x4b')]['id']),'count':_0x6205e0};})[_0x407c('0x29')](respondWithResult(_0x188511,null))['catch'](handleError(_0x188511,null));};exports['addMembers']=function(_0x3e8dfc,_0x51c43d,_0x218ef6){return db[_0x407c('0x2f')][_0x407c('0x48')]({'where':{'id':_0x3e8dfc[_0x407c('0x4b')]['id']}})[_0x407c('0x29')](handleEntityNotFound(_0x51c43d,null))['then'](function(_0x2cd109){if(_0x2cd109){return _0x2cd109[_0x407c('0x4f')](_0x3e8dfc[_0x407c('0x4a')][_0x407c('0x50')],_[_0x407c('0x51')](_0x3e8dfc['body'],[_0x407c('0x50'),'id'])||{});}})[_0x407c('0x29')](respondWithResult(_0x51c43d,null))[_0x407c('0x44')](handleError(_0x51c43d,null));};exports[_0x407c('0x52')]=function(_0x35df04,_0x13933d,_0x3737ad){var _0x2a4512={};var _0x31bf64={};var _0x4fa90c;var _0x2498da;return db[_0x407c('0x2f')]['findOne']({'where':{'id':_0x35df04[_0x407c('0x4b')]['id']}})[_0x407c('0x29')](handleEntityNotFound(_0x13933d,null))['then'](function(_0xd2dc48){if(_0xd2dc48){_0x4fa90c=_0xd2dc48;_0x31bf64[_0x407c('0x33')]=_[_0x407c('0x53')](db[_0x407c('0x54')][_0x407c('0x30')]);_0x31bf64['query']=_[_0x407c('0x53')](_0x35df04[_0x407c('0x34')]);_0x31bf64[_0x407c('0x35')]=_[_0x407c('0x36')](_0x31bf64[_0x407c('0x33')],_0x31bf64[_0x407c('0x34')]);_0x2a4512[_0x407c('0x37')]=_[_0x407c('0x36')](_0x31bf64[_0x407c('0x33')],qs[_0x407c('0x38')](_0x35df04[_0x407c('0x34')][_0x407c('0x38')]));_0x2a4512[_0x407c('0x37')]=_0x2a4512['attributes'][_0x407c('0x39')]?_0x2a4512['attributes']:_0x31bf64[_0x407c('0x33')];_0x2a4512[_0x407c('0x3b')]=qs['sort'](_0x35df04['query'][_0x407c('0x3c')]);_0x2a4512[_0x407c('0x3f')]=qs[_0x407c('0x35')](_[_0x407c('0x55')](_0x35df04[_0x407c('0x34')],_0x31bf64[_0x407c('0x35')]));if(_0x35df04[_0x407c('0x34')][_0x407c('0x3d')]){_0x2a4512['where']=_['merge'](_0x2a4512[_0x407c('0x3f')],{'$or':_['map'](_0x2a4512[_0x407c('0x37')],function(_0x46fc80){var _0xf161c2={};_0xf161c2[_0x46fc80]={'$like':'%'+_0x35df04['query'][_0x407c('0x3d')]+'%'};return _0xf161c2;})});}_0x2a4512=_['merge']({},_0x2a4512,_0x35df04[_0x407c('0x47')]);return _0x4fa90c[_0x407c('0x52')](_0x2a4512);}})[_0x407c('0x29')](function(_0x353d80){if(_0x353d80){_0x2498da=_0x353d80['length'];if(!_0x35df04[_0x407c('0x34')]['hasOwnProperty']('nolimit')){_0x2a4512[_0x407c('0x23')]=qs[_0x407c('0x23')](_0x35df04['query'][_0x407c('0x23')]);_0x2a4512[_0x407c('0x20')]=qs['offset'](_0x35df04['query']['offset']);}return _0x4fa90c['getMembers'](_0x2a4512);}})[_0x407c('0x29')](function(_0x250305){if(_0x250305){return _0x250305?{'count':_0x2498da,'rows':_0x250305}:null;}})['then'](respondWithResult(_0x13933d,null))[_0x407c('0x44')](handleError(_0x13933d,null));};exports['removeMembers']=function(_0x3d9d96,_0x5812bc,_0x5e7b22){return db[_0x407c('0x2f')][_0x407c('0x48')]({'where':{'id':_0x3d9d96['params']['id']}})[_0x407c('0x29')](handleEntityNotFound(_0x5812bc,null))[_0x407c('0x29')](function(_0xb93433){if(_0xb93433){return _0xb93433['removeMembers'](_0x3d9d96[_0x407c('0x34')]['ids']);}})['then'](respondWithStatusCode(_0x5812bc,null))[_0x407c('0x44')](handleError(_0x5812bc,null));};exports[_0x407c('0x56')]=function(_0x1b4bfb,_0x2b103e,_0x3c6fdb){if(_0x1b4bfb[_0x407c('0x4a')]['id']){delete _0x1b4bfb[_0x407c('0x4a')]['id'];}return db[_0x407c('0x2f')][_0x407c('0x48')]({'where':{'id':_0x1b4bfb[_0x407c('0x4b')]['id']}})[_0x407c('0x29')](handleEntityNotFound(_0x2b103e,null))['then'](function(_0x2a911a){if(_0x2a911a){_0x1b4bfb['body']['ChatGroupId']=_0x2a911a['id'];return db[_0x407c('0x57')][_0x407c('0x49')](_0x1b4bfb['body']);}})[_0x407c('0x29')](respondWithResult(_0x2b103e,null))[_0x407c('0x44')](handleError(_0x2b103e,null));};exports[_0x407c('0x58')]=function(_0x566b82,_0x26c322,_0x485274){var _0x454a39={};var _0x289121={};var _0x7268bd;var _0xadcccc;return db[_0x407c('0x2f')][_0x407c('0x59')]({'where':{'id':_0x566b82[_0x407c('0x4b')]['id']}})[_0x407c('0x29')](handleEntityNotFound(_0x26c322,null))[_0x407c('0x29')](function(_0x4e1aed){if(_0x4e1aed){_0x7268bd=_0x4e1aed;_0x289121[_0x407c('0x33')]=_[_0x407c('0x53')](db['ChatInternalMessage'][_0x407c('0x30')]);_0x289121[_0x407c('0x34')]=_[_0x407c('0x53')](_0x566b82['query']);_0x289121['filters']=_[_0x407c('0x36')](_0x289121[_0x407c('0x33')],_0x289121[_0x407c('0x34')]);_0x454a39[_0x407c('0x37')]=_[_0x407c('0x36')](_0x289121[_0x407c('0x33')],qs[_0x407c('0x38')](_0x566b82[_0x407c('0x34')][_0x407c('0x38')]));_0x454a39[_0x407c('0x37')]=_0x454a39[_0x407c('0x37')]['length']?_0x454a39['attributes']:_0x289121[_0x407c('0x33')];_0x454a39[_0x407c('0x3b')]=qs[_0x407c('0x3c')](_0x566b82['query']['sort']);_0x454a39[_0x407c('0x3f')]=qs[_0x407c('0x35')](_[_0x407c('0x55')](_0x566b82['query'],_0x289121['filters']));if(_0x566b82['query'][_0x407c('0x3d')]){_0x454a39[_0x407c('0x3f')]=_[_0x407c('0x3e')](_0x454a39[_0x407c('0x3f')],{'$or':_[_0x407c('0x2e')](_0x454a39[_0x407c('0x37')],function(_0x6f29be){var _0x45285c={};_0x45285c[_0x6f29be]={'$like':'%'+_0x566b82['query'][_0x407c('0x3d')]+'%'};return _0x45285c;})});}if(_0x566b82[_0x407c('0x34')][_0x407c('0x5a')]){var _0x2dc30c=_0x566b82[_0x407c('0x34')][_0x407c('0x5a')]['split'](',');var _0x2a192c={};_0x2a192c[_0x2dc30c[0x0]]={'$gte':moment(_0x2dc30c[0x1])[_0x407c('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x454a39[_0x407c('0x3f')]=_[_0x407c('0x3e')](_0x454a39[_0x407c('0x3f')],_0x2a192c);}_0x454a39=_['merge']({},_0x454a39,_0x566b82[_0x407c('0x47')]);return _0x7268bd[_0x407c('0x58')](_0x454a39);}})[_0x407c('0x29')](function(_0x31face){if(_0x31face){_0xadcccc=_0x31face[_0x407c('0x39')];if(!_0x566b82[_0x407c('0x34')][_0x407c('0x5c')]('nolimit')){_0x454a39[_0x407c('0x23')]=qs['limit'](_0x566b82[_0x407c('0x34')]['limit']);_0x454a39[_0x407c('0x20')]=qs[_0x407c('0x20')](_0x566b82['query'][_0x407c('0x20')]);}return _0x7268bd[_0x407c('0x58')](_0x454a39);}})[_0x407c('0x29')](function(_0x1bd7e0){if(_0x1bd7e0){return _0x1bd7e0?{'count':_0xadcccc,'rows':_0x1bd7e0}:null;}})['then'](respondWithResult(_0x26c322,null))[_0x407c('0x44')](handleError(_0x26c322,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 3ec2c53..c26e0f7 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 _0x1c2f=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','emit','hook'];(function(_0x2feb93,_0x572c96){var _0x3254e2=function(_0x573dbd){while(--_0x573dbd){_0x2feb93['push'](_0x2feb93['shift']());}};_0x3254e2(++_0x572c96);}(_0x1c2f,0x1c3));var _0xf1c2=function(_0x526889,_0x3f9043){_0x526889=_0x526889-0x0;var _0x21ad5e=_0x1c2f[_0x526889];return _0x21ad5e;};'use strict';var EventEmitter=require(_0xf1c2('0x0'));var ChatGroup=require(_0xf1c2('0x1'))['db'][_0xf1c2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf1c2('0x3')](0x0);var events={'afterCreate':_0xf1c2('0x4'),'afterUpdate':_0xf1c2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2a5c9b){return function(_0x229abd,_0x1a0233,_0x296405){ChatGroupEvents['emit'](_0x2a5c9b+':'+_0x229abd['id'],_0x229abd);ChatGroupEvents[_0xf1c2('0x6')](_0x2a5c9b,_0x229abd);_0x296405(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xf1c2('0x7')](e,emitEvent(event));}}module[_0xf1c2('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xa3a4=['ChatGroup','setMaxListeners','update','remove','emit','hook','events','../../mysqldb'];(function(_0x222472,_0x33ea87){var _0x5d601f=function(_0x53fc6f){while(--_0x53fc6f){_0x222472['push'](_0x222472['shift']());}};_0x5d601f(++_0x33ea87);}(_0xa3a4,0x6e));var _0x4a3a=function(_0x4e2e88,_0x4e0be3){_0x4e2e88=_0x4e2e88-0x0;var _0x5bc238=_0xa3a4[_0x4e2e88];return _0x5bc238;};'use strict';var EventEmitter=require(_0x4a3a('0x0'));var ChatGroup=require(_0x4a3a('0x1'))['db'][_0x4a3a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4a3a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4a3a('0x4'),'afterDestroy':_0x4a3a('0x5')};function emitEvent(_0x465d18){return function(_0x27b07f,_0x5446e7,_0xcce8e0){ChatGroupEvents[_0x4a3a('0x6')](_0x465d18+':'+_0x27b07f['id'],_0x27b07f);ChatGroupEvents['emit'](_0x465d18,_0x27b07f);_0xcce8e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x4a3a('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index b48eed5..e313c45 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 _0x092d=['../../config/logger','bluebird','request-promise','path','../../config/environment','ChatGroup','chat_groups'];(function(_0x5cbad7,_0x54313c){var _0x540c34=function(_0x337b4b){while(--_0x337b4b){_0x5cbad7['push'](_0x5cbad7['shift']());}};_0x540c34(++_0x54313c);}(_0x092d,0xee));var _0xd092=function(_0x1b1c4f,_0x32eb9c){_0x1b1c4f=_0x1b1c4f-0x0;var _0x3f02c1=_0x092d[_0x1b1c4f];return _0x3f02c1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd092('0x0'))('api');var moment=require('moment');var BPromise=require(_0xd092('0x1'));var rp=require(_0xd092('0x2'));var fs=require('fs');var path=require(_0xd092('0x3'));var rimraf=require('rimraf');var config=require(_0xd092('0x4'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x32c2b9,_0x836db2){return _0x32c2b9['define'](_0xd092('0x5'),attributes,{'tableName':_0xd092('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe5d7=['bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups','util'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xe5d7,0x17b));var _0x7e5d=function(_0x3aed66,_0x11d651){_0x3aed66=_0x3aed66-0x0;var _0x1f51e9=_0xe5d7[_0x3aed66];return _0x1f51e9;};'use strict';var _=require('lodash');var util=require(_0x7e5d('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7e5d('0x1'));var rp=require(_0x7e5d('0x2'));var fs=require('fs');var path=require(_0x7e5d('0x3'));var rimraf=require(_0x7e5d('0x4'));var config=require(_0x7e5d('0x5'));var attributes=require(_0x7e5d('0x6'));module['exports']=function(_0x205825,_0x1d720e){return _0x205825[_0x7e5d('0x7')](_0x7e5d('0x8'),attributes,{'tableName':_0x7e5d('0x9'),'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 5c265da..3def441 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 _0x851c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x4ce860,_0x24ca0c){var _0x587afc=function(_0xc1a4e8){while(--_0xc1a4e8){_0x4ce860['push'](_0x4ce860['shift']());}};_0x587afc(++_0x24ca0c);}(_0x851c,0x19d));var _0xc851=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x851c[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xc851('0x0'));var util=require(_0xc851('0x1'));var moment=require(_0xc851('0x2'));var BPromise=require(_0xc851('0x3'));var rs=require(_0xc851('0x4'));var fs=require('fs');var Redis=require(_0xc851('0x5'));var db=require(_0xc851('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc851('0x7'))(_0xc851('0x8'));var config=require('../../config/environment');var jayson=require(_0xc851('0x9'));var client=jayson[_0xc851('0xa')]['http']({'port':0x232a});config[_0xc851('0xb')]=_['defaults'](config['redis'],{'host':_0xc851('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc851('0xd'))[_0xc851('0xe')](socket);function respondWithRpcPromise(_0x3b4e80,_0x177de0,_0x1f1524){return new BPromise(function(_0x1ee38d,_0x33772a){return client[_0xc851('0xf')](_0x3b4e80,_0x1f1524)['then'](function(_0x3a1ce8){logger[_0xc851('0x10')](_0xc851('0x11'),_0x177de0,_0xc851('0x12'));logger[_0xc851('0x13')](_0xc851('0x14'),_0x177de0,_0xc851('0x12'),JSON[_0xc851('0x15')](_0x3a1ce8));if(_0x3a1ce8[_0xc851('0x16')]){if(_0x3a1ce8[_0xc851('0x16')][_0xc851('0x17')]===0x1f4){logger[_0xc851('0x16')](_0xc851('0x11'),_0x177de0,_0x3a1ce8[_0xc851('0x16')][_0xc851('0x18')]);return _0x33772a(_0x3a1ce8[_0xc851('0x16')]['message']);}logger[_0xc851('0x16')]('ChatGroup,\x20%s,\x20%s',_0x177de0,_0x3a1ce8[_0xc851('0x16')]['message']);return _0x1ee38d(_0x3a1ce8[_0xc851('0x16')][_0xc851('0x18')]);}else{logger[_0xc851('0x10')](_0xc851('0x11'),_0x177de0,_0xc851('0x12'));_0x1ee38d(_0x3a1ce8[_0xc851('0x19')][_0xc851('0x18')]);}})['catch'](function(_0x27c098){logger[_0xc851('0x16')]('ChatGroup,\x20%s,\x20%s',_0x177de0,_0x27c098);_0x33772a(_0x27c098);});});}
\ No newline at end of file
+var _0x6315=['http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatGroup,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2ebb27,_0x206118){var _0x515e54=function(_0x5ebb86){while(--_0x5ebb86){_0x2ebb27['push'](_0x2ebb27['shift']());}};_0x515e54(++_0x206118);}(_0x6315,0x65));var _0x5631=function(_0x49899e,_0x68bbd5){_0x49899e=_0x49899e-0x0;var _0x11cf80=_0x6315[_0x49899e];return _0x11cf80;};'use strict';var _=require('lodash');var util=require(_0x5631('0x0'));var moment=require(_0x5631('0x1'));var BPromise=require(_0x5631('0x2'));var rs=require(_0x5631('0x3'));var fs=require('fs');var Redis=require(_0x5631('0x4'));var db=require(_0x5631('0x5'))['db'];var utils=require(_0x5631('0x6'));var logger=require(_0x5631('0x7'))(_0x5631('0x8'));var config=require(_0x5631('0x9'));var jayson=require(_0x5631('0xa'));var client=jayson['client'][_0x5631('0xb')]({'port':0x232a});config[_0x5631('0xc')]=_['defaults'](config[_0x5631('0xc')],{'host':_0x5631('0xd'),'port':0x18eb});var socket=require(_0x5631('0xe'))(new Redis(config[_0x5631('0xc')]));require(_0x5631('0xf'))[_0x5631('0x10')](socket);function respondWithRpcPromise(_0x525998,_0x2dbe9b,_0x5a214b){return new BPromise(function(_0x16db6a,_0x2d46b2){return client[_0x5631('0x11')](_0x525998,_0x5a214b)[_0x5631('0x12')](function(_0x4a88be){logger[_0x5631('0x13')]('ChatGroup,\x20%s,\x20%s',_0x2dbe9b,'request\x20sent');logger[_0x5631('0x14')](_0x5631('0x15'),_0x2dbe9b,_0x5631('0x16'),JSON[_0x5631('0x17')](_0x4a88be));if(_0x4a88be[_0x5631('0x18')]){if(_0x4a88be[_0x5631('0x18')]['code']===0x1f4){logger[_0x5631('0x18')](_0x5631('0x19'),_0x2dbe9b,_0x4a88be[_0x5631('0x18')][_0x5631('0x1a')]);return _0x2d46b2(_0x4a88be[_0x5631('0x18')][_0x5631('0x1a')]);}logger[_0x5631('0x18')]('ChatGroup,\x20%s,\x20%s',_0x2dbe9b,_0x4a88be[_0x5631('0x18')]['message']);return _0x16db6a(_0x4a88be[_0x5631('0x18')]['message']);}else{logger['info'](_0x5631('0x19'),_0x2dbe9b,_0x5631('0x16'));_0x16db6a(_0x4a88be['result'][_0x5631('0x1a')]);}})[_0x5631('0x1b')](function(_0x94386a){logger[_0x5631('0x18')](_0x5631('0x19'),_0x2dbe9b,_0x94386a);_0x2d46b2(_0x94386a);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index bea667c..4d13273 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 _0x0e95=['removeListener','register','length','./chatGroup.events','save','remove','emit'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x0e95,0x1d1));var _0x50e9=function(_0x2c2c86,_0x58399b){_0x2c2c86=_0x2c2c86-0x0;var _0xe6ede3=_0x0e95[_0x2c2c86];return _0xe6ede3;};'use strict';var ChatGroupEvents=require(_0x50e9('0x0'));var events=[_0x50e9('0x1'),_0x50e9('0x2'),'update'];function createListener(_0x55097d,_0x5712a6){return function(_0x4694f1){_0x5712a6[_0x50e9('0x3')](_0x55097d,_0x4694f1);};}function removeListener(_0x2ae11a,_0x483613){return function(){ChatGroupEvents[_0x50e9('0x4')](_0x2ae11a,_0x483613);};}exports[_0x50e9('0x5')]=function(_0x1be434){for(var _0x4ded02=0x0,_0x2d31d6=events[_0x50e9('0x6')];_0x4ded02<_0x2d31d6;_0x4ded02++){var _0x5e2a43=events[_0x4ded02];var _0x1e2bd1=createListener('chatGroup:'+_0x5e2a43,_0x1be434);ChatGroupEvents['on'](_0x5e2a43,_0x1e2bd1);}};
\ No newline at end of file
+var _0x4faf=['register','length','chatGroup:','./chatGroup.events','save','remove','update','emit','removeListener'];(function(_0x5ed493,_0x42449e){var _0x1dec6b=function(_0x1283e9){while(--_0x1283e9){_0x5ed493['push'](_0x5ed493['shift']());}};_0x1dec6b(++_0x42449e);}(_0x4faf,0x1d7));var _0xf4fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4faf[_0x20a584];return _0x4b41a8;};'use strict';var ChatGroupEvents=require(_0xf4fa('0x0'));var events=[_0xf4fa('0x1'),_0xf4fa('0x2'),_0xf4fa('0x3')];function createListener(_0x54627e,_0x428a21){return function(_0x564b8c){_0x428a21[_0xf4fa('0x4')](_0x54627e,_0x564b8c);};}function removeListener(_0x3518bd,_0x2bd5fb){return function(){ChatGroupEvents[_0xf4fa('0x5')](_0x3518bd,_0x2bd5fb);};}exports[_0xf4fa('0x6')]=function(_0x5608dd){for(var _0x50b5b2=0x0,_0x3f8a77=events[_0xf4fa('0x7')];_0x50b5b2<_0x3f8a77;_0x50b5b2++){var _0x29452b=events[_0x50b5b2];var _0x598c60=createListener(_0xf4fa('0x8')+_0x29452b,_0x5608dd);ChatGroupEvents['on'](_0x29452b,_0x598c60);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 07aed85..7759ab3 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 _0xe6d7=['../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','put','update','delete','removeMembers','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x734baa,_0x4072d5){var _0x1920d4=function(_0x4c02ba){while(--_0x4c02ba){_0x734baa['push'](_0x734baa['shift']());}};_0x1920d4(++_0x4072d5);}(_0xe6d7,0x124));var _0x7e6d=function(_0x4781b1,_0x109c44){_0x4781b1=_0x4781b1-0x0;var _0x13ecb1=_0xe6d7[_0x4781b1];return _0x13ecb1;};'use strict';var multer=require(_0x7e6d('0x0'));var util=require(_0x7e6d('0x1'));var path=require(_0x7e6d('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e6d('0x3'));var router=express[_0x7e6d('0x4')]();var fs_extra=require(_0x7e6d('0x5'));var auth=require(_0x7e6d('0x6'));var interaction=require(_0x7e6d('0x7'));var config=require(_0x7e6d('0x8'));var controller=require(_0x7e6d('0x9'));router[_0x7e6d('0xa')]('/',auth[_0x7e6d('0xb')](),controller[_0x7e6d('0xc')]);router[_0x7e6d('0xa')](_0x7e6d('0xd'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0xe')]);router[_0x7e6d('0xa')](_0x7e6d('0xf'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x10')]);router['get'](_0x7e6d('0x11'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x12')]);router[_0x7e6d('0xa')](_0x7e6d('0x13'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x14')]);router['get'](_0x7e6d('0x15'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x16')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7e6d('0x17')]);router[_0x7e6d('0x18')](_0x7e6d('0x13'),auth['isAuthenticated'](),controller[_0x7e6d('0x19')]);router[_0x7e6d('0x18')]('/:id/messages',auth[_0x7e6d('0xb')](),controller['addMessage']);router[_0x7e6d('0x1a')](_0x7e6d('0xf'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x1b')]);router[_0x7e6d('0x1c')](_0x7e6d('0xf'),auth[_0x7e6d('0xb')](),controller['destroy']);router[_0x7e6d('0x1c')](_0x7e6d('0x13'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x1d')]);module['exports']=router;
\ No newline at end of file
+var _0xafc6=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout'];(function(_0x389290,_0x16aa43){var _0x529d99=function(_0x12658c){while(--_0x12658c){_0x389290['push'](_0x389290['shift']());}};_0x529d99(++_0x16aa43);}(_0xafc6,0xaa));var _0x6afc=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0xafc6[_0x31a371];return _0x2a5bd6;};'use strict';var multer=require(_0x6afc('0x0'));var util=require(_0x6afc('0x1'));var path=require(_0x6afc('0x2'));var timeout=require(_0x6afc('0x3'));var express=require('express');var router=express[_0x6afc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6afc('0x5'));var interaction=require(_0x6afc('0x6'));var config=require(_0x6afc('0x7'));var controller=require(_0x6afc('0x8'));router[_0x6afc('0x9')]('/',auth[_0x6afc('0xa')](),controller['index']);router[_0x6afc('0x9')](_0x6afc('0xb'),auth[_0x6afc('0xa')](),controller[_0x6afc('0xc')]);router[_0x6afc('0x9')](_0x6afc('0xd'),auth[_0x6afc('0xa')](),controller[_0x6afc('0xe')]);router[_0x6afc('0x9')](_0x6afc('0xf'),auth['isAuthenticated'](),controller[_0x6afc('0x10')]);router[_0x6afc('0x9')](_0x6afc('0x11'),auth[_0x6afc('0xa')](),controller[_0x6afc('0x12')]);router[_0x6afc('0x9')](_0x6afc('0x13'),auth[_0x6afc('0xa')](),controller[_0x6afc('0x14')]);router['post']('/',auth[_0x6afc('0xa')](),controller['create']);router[_0x6afc('0x15')](_0x6afc('0x11'),auth[_0x6afc('0xa')](),controller['addMembers']);router[_0x6afc('0x15')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6afc('0x16')]);router[_0x6afc('0x17')](_0x6afc('0xd'),auth[_0x6afc('0xa')](),controller[_0x6afc('0x18')]);router[_0x6afc('0x19')](_0x6afc('0xd'),auth[_0x6afc('0xa')](),controller[_0x6afc('0x1a')]);router[_0x6afc('0x19')]('/:id/members',auth[_0x6afc('0xa')](),controller[_0x6afc('0x1b')]);module[_0x6afc('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 86ae0d7..70e123e 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 _0x1152=['long','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','DATE','STRING'];(function(_0x305cc5,_0x317607){var _0x3ef26f=function(_0x309528){while(--_0x309528){_0x305cc5['push'](_0x305cc5['shift']());}};_0x3ef26f(++_0x317607);}(_0x1152,0x182));var _0x2115=function(_0x23f50a,_0x1e0fbc){_0x23f50a=_0x23f50a-0x0;var _0x3d48e2=_0x1152[_0x23f50a];return _0x3d48e2;};'use strict';var Sequelize=require(_0x2115('0x0'));module[_0x2115('0x1')]={'closed':{'type':Sequelize[_0x2115('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2115('0x3')]},'ratingType':{'type':Sequelize[_0x2115('0x4')](_0x2115('0x5'),_0x2115('0x6')),'defaultValue':_0x2115('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x2115('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2115('0x8')]},'disposition':{'type':Sequelize[_0x2115('0x9')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x2115('0x9')]},'osVersion':{'type':Sequelize[_0x2115('0x9')]},'deviceModel':{'type':Sequelize[_0x2115('0x9')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x2115('0x9')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x2115('0x7')](_0x2115('0xa'))},'read1stAt':{'type':Sequelize[_0x2115('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2115('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2115('0x9')]},'customerPort':{'type':Sequelize[_0x2115('0x9')]},'vidaooSessionId':{'type':Sequelize[_0x2115('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x2115('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xa7fa=['long','BOOLEAN','sequelize','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x3b1743,_0x299e84){var _0x11a35e=function(_0x1da950){while(--_0x1da950){_0x3b1743['push'](_0x3b1743['shift']());}};_0x11a35e(++_0x299e84);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa7fa[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xaa7f('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xaa7f('0x1')]},'ratingType':{'type':Sequelize[_0xaa7f('0x2')](_0xaa7f('0x3'),_0xaa7f('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xaa7f('0x5')]},'pathTranscript':{'type':Sequelize[_0xaa7f('0x5')]},'mailTranscript':{'type':Sequelize[_0xaa7f('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xaa7f('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xaa7f('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xaa7f('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xaa7f('0x6')]},'osVersion':{'type':Sequelize[_0xaa7f('0x6')]},'deviceModel':{'type':Sequelize[_0xaa7f('0x6')]},'deviceVendor':{'type':Sequelize[_0xaa7f('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xaa7f('0x5')]},'customerIp':{'type':Sequelize[_0xaa7f('0x6')]},'formData':{'type':Sequelize['TEXT'](_0xaa7f('0x8'))},'read1stAt':{'type':Sequelize[_0xaa7f('0x7')]},'lastMsgAt':{'type':Sequelize[_0xaa7f('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xaa7f('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xaa7f('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xaa7f('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xaa7f('0x9')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 94b8e94..e2f246d 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 _0x3a2d=['rawAttributes','filters','intersection','attributes','fields','includeAll','include','merge','options','create','body','update','find','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','fullname','email','POST','vidaooTopic','isNull','follow','vidaooMetadata','parse','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','join_url','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','User','ChatWebsiteId','CmContact','ContactId','Messages','length','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','UserId','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','includeAgent','push','rows','addTags','spread','Tag','color','emit','removeTags','unix','toString','files','server','attachments','transcript-%d-%s.zip','createdAt','secret','read','Account','get','mkdirSync','Chat','Owner','N.A.','closedAt','disposition','osName','customerIp','customerPort','tail','existsSync','createReadStream','firstName','lastName','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','zip-dir','request-promise','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','destroy','stack','name','send','render','contact','agent','account','index','map','type','key','findAll','chat','query','user','catch','params','model','keys','ChatInteraction'];(function(_0xaa87c6,_0x20ed4f){var _0x4df3ed=function(_0x3c8b81){while(--_0x3c8b81){_0xaa87c6['push'](_0xaa87c6['shift']());}};_0x4df3ed(++_0x20ed4f);}(_0x3a2d,0x169));var _0xd3a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a2d[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xd3a2('0x0'));var rp=require(_0xd3a2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd3a2('0x2'));var util=require(_0xd3a2('0x3'));var path=require(_0xd3a2('0x4'));var ejs=require(_0xd3a2('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xd3a2('0x6'));var interaction=require(_0xd3a2('0x7'));var qs=require(_0xd3a2('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0xd3a2('0x9'))(_0xd3a2('0xa'));var config=require(_0xd3a2('0xb'));var db=require(_0xd3a2('0xc'))['db'];config[_0xd3a2('0xd')]=_['defaults'](config[_0xd3a2('0xd')],{'host':_0xd3a2('0xe'),'port':0x18eb});var socket=require(_0xd3a2('0xf'))(new Redis(config['redis']));require(_0xd3a2('0x10'))[_0xd3a2('0x11')](socket);var jayson=require(_0xd3a2('0x12'));var client=jayson[_0xd3a2('0x13')]['http']({'port':0x232b});var client9004=jayson[_0xd3a2('0x13')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4a2891,_0x304a13,_0x5964b0,_0x3afb38){return new BPromise(function(_0x42f1e9,_0x2c1347){var _0x48371f=_0x3afb38||client;return _0x48371f['request'](_0x4a2891,_0x5964b0)[_0xd3a2('0x14')](function(_0x47b003){logger[_0xd3a2('0x15')](_0xd3a2('0x16'),_0x304a13,_0xd3a2('0x17'));logger[_0xd3a2('0x18')](_0xd3a2('0x19'),_0x304a13,_0xd3a2('0x17'),JSON[_0xd3a2('0x1a')](_0x47b003));if(_0x47b003[_0xd3a2('0x1b')]){if(_0x47b003['error']['code']===0x1f4){logger[_0xd3a2('0x1b')](_0xd3a2('0x16'),_0x304a13,_0x47b003[_0xd3a2('0x1b')][_0xd3a2('0x1c')]);return _0x2c1347(_0x47b003[_0xd3a2('0x1b')]['message']);}logger[_0xd3a2('0x1b')](_0xd3a2('0x16'),_0x304a13,_0x47b003['error'][_0xd3a2('0x1c')]);return _0x42f1e9(_0x47b003[_0xd3a2('0x1b')][_0xd3a2('0x1c')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x304a13,_0xd3a2('0x17'));_0x42f1e9(_0x47b003['result'][_0xd3a2('0x1c')]);}})['catch'](function(_0x50c604){logger['error'](_0xd3a2('0x16'),_0x304a13,_0x50c604);_0x2c1347(_0x50c604);});});}function respondWithStatusCode(_0x301214,_0xcf1792){_0xcf1792=_0xcf1792||0xcc;return function(_0x1ee570){if(_0x1ee570){return _0x301214[_0xd3a2('0x1d')](_0xcf1792);}return _0x301214[_0xd3a2('0x1e')](_0xcf1792)['end']();};}function respondWithResult(_0x29e196,_0x383c92){_0x383c92=_0x383c92||0xc8;return function(_0x546886){if(_0x546886){return _0x29e196[_0xd3a2('0x1e')](_0x383c92)['json'](_0x546886);}};}function respondWithFilteredResult(_0x5822da,_0x49e0af){return function(_0x35a739){if(_0x35a739){var _0x340ce6=typeof _0x49e0af['offset']==='undefined'&&typeof _0x49e0af[_0xd3a2('0x1f')]===_0xd3a2('0x20');var _0x525a4e=_0x35a739[_0xd3a2('0x21')];var _0x315aff=_0x340ce6?0x0:_0x49e0af['offset'];var _0xf9f47f=_0x340ce6?_0x35a739[_0xd3a2('0x21')]:_0x49e0af[_0xd3a2('0x22')]+_0x49e0af[_0xd3a2('0x1f')];var _0x4f3cf8;if(_0xf9f47f>=_0x525a4e){_0xf9f47f=_0x525a4e;_0x4f3cf8=0xc8;}else{_0x4f3cf8=0xce;}_0x5822da['status'](_0x4f3cf8);return _0x5822da[_0xd3a2('0x23')](_0xd3a2('0x24'),_0x315aff+'-'+_0xf9f47f+'/'+_0x525a4e)[_0xd3a2('0x25')](_0x35a739);}return null;};}function saveUpdates(_0x3841f7){return function(_0x229322){if(_0x229322){return _0x229322['update'](_0x3841f7)[_0xd3a2('0x14')](function(_0x39f209){return _0x39f209;});}return null;};}function removeEntity(_0x575937){return function(_0x29bf89){if(_0x29bf89){return _0x29bf89[_0xd3a2('0x26')]()[_0xd3a2('0x14')](function(){_0x575937[_0xd3a2('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16afac){return function(_0x5265fa){if(!_0x5265fa){_0x16afac[_0xd3a2('0x1d')](0x194);}return _0x5265fa;};}function handleError(_0x24fb96,_0x46b71c){_0x46b71c=_0x46b71c||0x1f4;return function(_0x56720d){logger['error'](_0x56720d[_0xd3a2('0x27')]);if(_0x56720d[_0xd3a2('0x28')]){delete _0x56720d[_0xd3a2('0x28')];}_0x24fb96[_0xd3a2('0x1e')](_0x46b71c)[_0xd3a2('0x29')](_0x56720d);};}function getMustacheRender(_0x484f5f,_0x1db1d7){return Mustache[_0xd3a2('0x2a')](_0x484f5f,_['merge'](_0x1db1d7['body'],{'contact':_0x1db1d7[_0xd3a2('0x2b')],'message':_0x1db1d7[_0xd3a2('0x1c')],'agent':_0x1db1d7[_0xd3a2('0x2c')],'interaction':_0x1db1d7['interaction'],'account':_0x1db1d7[_0xd3a2('0x2d')]}))||'';}exports[_0xd3a2('0x2e')]=function(_0x336220,_0x1de314){var _0x5a8670={};var _0xab06ac=_[_0xd3a2('0x2f')](db['ChatInteraction']['rawAttributes'],function(_0x565833){return{'name':_0x565833['fieldName'],'type':_0x565833[_0xd3a2('0x30')][_0xd3a2('0x31')]};});_0x5a8670=qs['getOptions'](_0xab06ac,_0x336220);return interaction[_0xd3a2('0x32')](_0xd3a2('0x33'),_0x336220[_0xd3a2('0x34')],_0x336220[_0xd3a2('0x35')],_0x5a8670,_0xab06ac)['then'](respondWithFilteredResult(_0x1de314,_0x5a8670))[_0xd3a2('0x36')](handleError(_0x1de314,null));};exports['show']=function(_0x407be8,_0x3a9615){var _0xc930a3={'raw':![],'where':{'id':_0x407be8[_0xd3a2('0x37')]['id']}},_0x7b2150={};_0x7b2150[_0xd3a2('0x38')]=_[_0xd3a2('0x39')](db[_0xd3a2('0x3a')][_0xd3a2('0x3b')]);_0x7b2150[_0xd3a2('0x34')]=_[_0xd3a2('0x39')](_0x407be8['query']);_0x7b2150[_0xd3a2('0x3c')]=_[_0xd3a2('0x3d')](_0x7b2150[_0xd3a2('0x38')],_0x7b2150['query']);_0xc930a3[_0xd3a2('0x3e')]=_[_0xd3a2('0x3d')](_0x7b2150['model'],qs[_0xd3a2('0x3f')](_0x407be8[_0xd3a2('0x34')][_0xd3a2('0x3f')]));_0xc930a3['attributes']=_0xc930a3['attributes']['length']?_0xc930a3['attributes']:_0x7b2150[_0xd3a2('0x38')];if(_0x407be8['query'][_0xd3a2('0x40')]){_0xc930a3[_0xd3a2('0x41')]=[{'all':!![]}];}_0xc930a3=_[_0xd3a2('0x42')]({},_0xc930a3,_0x407be8[_0xd3a2('0x43')]);return db['ChatInteraction']['find'](_0xc930a3)[_0xd3a2('0x14')](handleEntityNotFound(_0x3a9615,null))['then'](respondWithResult(_0x3a9615,null))['catch'](handleError(_0x3a9615,null));};exports[_0xd3a2('0x44')]=function(_0x3ec1fb,_0x18a672){return db[_0xd3a2('0x3a')]['create'](_0x3ec1fb[_0xd3a2('0x45')],{})[_0xd3a2('0x14')](respondWithResult(_0x18a672,0xc9))[_0xd3a2('0x36')](handleError(_0x18a672,null));};exports[_0xd3a2('0x46')]=function(_0x325c0d,_0x298557){if(_0x325c0d[_0xd3a2('0x45')]['id']){delete _0x325c0d['body']['id'];}return db[_0xd3a2('0x3a')][_0xd3a2('0x47')]({'where':{'id':_0x325c0d[_0xd3a2('0x37')]['id']}})[_0xd3a2('0x14')](handleEntityNotFound(_0x298557,null))[_0xd3a2('0x14')](saveUpdates(_0x325c0d[_0xd3a2('0x45')],null))[_0xd3a2('0x14')](respondWithResult(_0x298557,null))[_0xd3a2('0x36')](handleError(_0x298557,null));};exports['destroy']=function(_0x1dca0a,_0x2719fd){return db['ChatInteraction']['find']({'where':{'id':_0x1dca0a[_0xd3a2('0x37')]['id']}})[_0xd3a2('0x14')](handleEntityNotFound(_0x2719fd,null))[_0xd3a2('0x14')](removeEntity(_0x2719fd,null))[_0xd3a2('0x36')](handleError(_0x2719fd,null));};exports[_0xd3a2('0x48')]=function(_0x425a6f,_0x2fa2bd){return db['ChatInteraction'][_0xd3a2('0x48')]()[_0xd3a2('0x14')](respondWithResult(_0x2fa2bd,null))[_0xd3a2('0x36')](handleError(_0x2fa2bd,null));};exports[_0xd3a2('0x49')]=function(_0x1ce12a,_0x5f3da2){var _0x201b34=_0x1ce12a[_0xd3a2('0x37')]['id'];var _0x15d713;var _0x22d4c7;var _0x2e0a42;return db[_0xd3a2('0x3a')][_0xd3a2('0x4a')]({'where':{'id':_0x201b34}})['then'](function(_0x1e8f3a){_0x15d713=_0x1e8f3a;return db[_0xd3a2('0x4b')][_0xd3a2('0x4a')]({'where':{'id':_0x1e8f3a['ChatWebsiteId']},'attributes':['id',_0xd3a2('0x4c'),_0xd3a2('0x4d'),'vidaooTopic',_0xd3a2('0x4e'),'vidaooMetadata'],'raw':!![]});})[_0xd3a2('0x14')](function(_0x3f32c8){if(_0x3f32c8&&_0x3f32c8[_0xd3a2('0x4c')]&&_0x3f32c8['vidaooEscalation']){_0x22d4c7=_0x3f32c8;var _0x5b3f2={'interaction':{'id':_0x201b34},'agent':{'id':_0x1ce12a[_0xd3a2('0x35')]['id'],'name':_0x1ce12a[_0xd3a2('0x35')][_0xd3a2('0x28')],'fullname':_0x1ce12a['user'][_0xd3a2('0x4f')],'email':_0x1ce12a['user'][_0xd3a2('0x50')]},'contact':_0x1ce12a[_0xd3a2('0x45')][_0xd3a2('0x2b')],'account':_0x1ce12a[_0xd3a2('0x45')][_0xd3a2('0x2d')]};var _0x1bf660={'rejectUnauthorized':![],'method':_0xd3a2('0x51'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3f32c8[_0xd3a2('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1ce12a[_0xd3a2('0x35')][_0xd3a2('0x50')]],'buttons':null,'topic':_0x22d4c7[_0xd3a2('0x52')],'note':_[_0xd3a2('0x53')](_0x22d4c7[_0xd3a2('0x4e')])?null:getMustacheRender(_0x22d4c7['vidaooNote'],_0x5b3f2),'metadata':null},'redirect':_0xd3a2('0x54'),'json':!![]};try{if(!_[_0xd3a2('0x53')](_0x22d4c7[_0xd3a2('0x55')])){var _0x59686d=getMustacheRender(_0x22d4c7[_0xd3a2('0x55')],_0x5b3f2);var _0x2bd1de=JSON[_0xd3a2('0x56')](_0x59686d);_0x1bf660[_0xd3a2('0x45')]['metadata']=_0x2bd1de;}}catch(_0x3ca44a){throw new db[(_0xd3a2('0x57'))]['ValidationError'](_0xd3a2('0x58'));}return rp(_0x1bf660);}else{throw new db[(_0xd3a2('0x57'))][(_0xd3a2('0x59'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd3a2('0x14')](function(_0x3a2a0d){_0x2e0a42=_0x3a2a0d;if(_0x2e0a42['id']){var _0x315f28={'body':_0x2e0a42[_0xd3a2('0x5a')],'ChatWebsiteId':_0x22d4c7['id'],'ChatInteractionId':_0x15d713['id'],'direction':'out','UserId':_0x1ce12a[_0xd3a2('0x35')]['id']};return db['ChatMessage'][_0xd3a2('0x44')](_0x315f28,{});}else{throw new db[(_0xd3a2('0x57'))]['ValidationError'](_0xd3a2('0x5b'));}})[_0xd3a2('0x14')](function(){return _0x15d713[_0xd3a2('0x5c')]({'vidaooSessionId':_0x2e0a42['id']});})[_0xd3a2('0x14')](respondWithResult(_0x5f3da2,null))[_0xd3a2('0x36')](handleError(_0x5f3da2,null));};exports[_0xd3a2('0x5d')]=function(_0x25290f,_0x5b943f){if(_0x25290f[_0xd3a2('0x45')]['id']){delete _0x25290f[_0xd3a2('0x45')]['id'];}return db[_0xd3a2('0x3a')]['find']({'where':{'id':_0x25290f[_0xd3a2('0x37')]['id']},'include':[{'model':db['CmContact'],'as':_0xd3a2('0x5e')}]})['then'](handleEntityNotFound(_0x5b943f,null))[_0xd3a2('0x14')](saveUpdates(_0x25290f[_0xd3a2('0x45')],null))[_0xd3a2('0x14')](respondWithResult(_0x5b943f,null))[_0xd3a2('0x36')](handleError(_0x5b943f,null));};exports[_0xd3a2('0x5f')]=function(_0x424742,_0x20bbc9){if(_0x424742[_0xd3a2('0x45')]['id']){delete _0x424742[_0xd3a2('0x45')]['id'];}return db[_0xd3a2('0x3a')][_0xd3a2('0x47')]({'where':{'id':_0x424742[_0xd3a2('0x37')]['id']}})[_0xd3a2('0x14')](function(_0x471226){if(!_0x471226){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xd3a2('0x5f'),0x194,_0xd3a2('0x60'));_0x20bbc9[_0xd3a2('0x1d')](0x194);}else{if(_0x471226['UserId']){throw new db[(_0xd3a2('0x57'))][(_0xd3a2('0x59'))](_0xd3a2('0x61'));}}return _0x471226;})['then'](function(_0x60a9c1){if(_0x60a9c1){return _0x60a9c1['update']({'closed':_0x424742[_0xd3a2('0x45')][_0xd3a2('0x62')],'disposition':_0x424742[_0xd3a2('0x45')]['disposition']})[_0xd3a2('0x14')](function(_0x587594){return _0x587594;});}})[_0xd3a2('0x14')](function(){return respondWithRpcPromise(_0xd3a2('0x63'),_0xd3a2('0x5f'),_0x424742[_0xd3a2('0x45')],client9004);})[_0xd3a2('0x14')](respondWithResult(_0x20bbc9,null))[_0xd3a2('0x36')](handleError(_0x20bbc9,null));};exports[_0xd3a2('0x64')]=function(_0x401adb,_0x481ab6){_0x401adb[_0xd3a2('0x45')]['name']=_0x401adb['file'][_0xd3a2('0x65')];_0x401adb[_0xd3a2('0x45')][_0xd3a2('0x66')]=_0x401adb[_0xd3a2('0x67')][_0xd3a2('0x68')];_0x401adb[_0xd3a2('0x45')]['type']=_0x401adb[_0xd3a2('0x67')][_0xd3a2('0x69')];return db['Attachment']['create'](_0x401adb[_0xd3a2('0x45')])[_0xd3a2('0x14')](respondWithResult(_0x481ab6,0xc9))[_0xd3a2('0x36')](handleError(_0x481ab6,null));};exports[_0xd3a2('0x6a')]=function(_0x128381,_0x540a05){return db[_0xd3a2('0x3a')][_0xd3a2('0x4a')]({'where':{'id':_0x128381[_0xd3a2('0x37')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x540a05,null))['then'](function(_0x534165){if(_0x534165){if(_0x534165['closed']){return _0x540a05[_0xd3a2('0x1e')](0x193)[_0xd3a2('0x25')]({'status':0x193,'message':_0xd3a2('0x6b')});}return db[_0xd3a2('0x6c')][_0xd3a2('0x4a')]({'where':{'id':_0x128381['query'][_0xd3a2('0x6d')]},'raw':!![]})['then'](handleEntityNotFound(_0x540a05,null));}})[_0xd3a2('0x14')](function(_0x1949f2){if(_0x1949f2){var _0x48b8a2=_0x1949f2[_0xd3a2('0x6e')]!==null;var _0xee6f5d=path[_0xd3a2('0x6f')](config[_0xd3a2('0x70')],'server/files/attachments/');if(_0x48b8a2){_0xee6f5d=path[_0xd3a2('0x6f')](_0xee6f5d,_0xd3a2('0x71'));}var _0x33380c=path[_0xd3a2('0x6f')](_0xee6f5d,_0x1949f2['basename']);return _0x540a05[_0xd3a2('0x72')](_0x33380c);}})[_0xd3a2('0x36')](handleError(_0x540a05,null));};exports[_0xd3a2('0x73')]=function(_0x1aac99,_0xbdb1ce){var _0x366162=null;var _0xd94ca7=null;var _0x5b1cd8=null;if(_0x1aac99[_0xd3a2('0x45')]['id']){delete _0x1aac99[_0xd3a2('0x45')]['id'];}if(_0x1aac99[_0xd3a2('0x45')][_0xd3a2('0x74')]){_0x5b1cd8=path[_0xd3a2('0x6f')](config[_0xd3a2('0x70')],_0xd3a2('0x75'),util[_0xd3a2('0x76')](_0xd3a2('0x77'),Date[_0xd3a2('0x78')]()));_0x1aac99[_0xd3a2('0x45')][_0xd3a2('0x79')]=_0x5b1cd8;}return db['ChatInteraction'][_0xd3a2('0x47')]({'where':{'id':_0x1aac99[_0xd3a2('0x37')]['id']},'include':[{'model':db[_0xd3a2('0x7a')],'as':'Messages','include':[{'model':db[_0xd3a2('0x7b')],'as':_0xd3a2('0x7b')}]}]})[_0xd3a2('0x14')](handleEntityNotFound(_0xbdb1ce,null))[_0xd3a2('0x14')](saveUpdates(_0x1aac99[_0xd3a2('0x45')],null))['then'](function(_0x3a7be7){if(_0x3a7be7){_0x366162=_0x3a7be7;return db[_0xd3a2('0x4b')][_0xd3a2('0x47')]({'where':{'id':_0x366162[_0xd3a2('0x7c')]}});}})[_0xd3a2('0x14')](function(_0x2cbbdf){if(_0x2cbbdf){_0xd94ca7=_0x2cbbdf;return db[_0xd3a2('0x7d')][_0xd3a2('0x47')]({'where':{'id':_0x366162[_0xd3a2('0x7e')]}});}})[_0xd3a2('0x14')](function(_0x5f26db){if(_0x5f26db){if(_0x5b1cd8){var _0x1bcdb1=null;for(var _0x9b58e0=0x1;_0x9b58e0<_0x366162[_0xd3a2('0x7f')][_0xd3a2('0x80')];++_0x9b58e0){_0x1bcdb1=_0x366162[_0xd3a2('0x7f')][_0x9b58e0];var _0x5a4a6d=_0x1bcdb1['UserId']?util[_0xd3a2('0x76')](_0xd3a2('0x81'),_0xd94ca7[_0xd3a2('0x82')],_0x1bcdb1['UserId']):_0xd3a2('0x83');var _0x28133c=_0x1aac99['body'][_0xd3a2('0x84')]||util[_0xd3a2('0x76')]('%s%d',_0xd3a2('0x85'),_0x1bcdb1[_0xd3a2('0x7e')]);switch(_0xd94ca7[_0xd3a2('0x86')]){case _0xd3a2('0x87'):_0x5a4a6d=_0x1bcdb1[_0xd3a2('0x88')]?util[_0xd3a2('0x76')](_0xd3a2('0x81'),_0xd94ca7['agentAlias'],_0x1bcdb1[_0xd3a2('0x88')]):'System';break;case _0xd3a2('0x89'):_0x5a4a6d=_0x1bcdb1[_0xd3a2('0x88')]?_0x1bcdb1['User'][_0xd3a2('0x8a')]||_0x1bcdb1[_0xd3a2('0x7b')][_0xd3a2('0x4f')]:_0xd3a2('0x83');break;case _0xd3a2('0x8b'):_0x5a4a6d=_0x1bcdb1[_0xd3a2('0x88')]?_0x1bcdb1[_0xd3a2('0x7b')][_0xd3a2('0x4f')]:_0xd3a2('0x83');break;default:_0x5a4a6d=_0x1bcdb1['UserId']?util[_0xd3a2('0x76')]('%s%d',_0xd94ca7[_0xd3a2('0x82')],_0x1bcdb1[_0xd3a2('0x88')]):_0xd3a2('0x83');}var _0x165cdc=util['format'](_0xd3a2('0x8c'),moment(_0x1bcdb1['createdAt'])[_0xd3a2('0x76')](_0xd3a2('0x8d')),_0x1bcdb1[_0xd3a2('0x8e')]==='in'?_0x28133c:_0x5a4a6d,_0x1bcdb1[_0xd3a2('0x45')]);if(!_0x1bcdb1['secret']){fs[_0xd3a2('0x8f')](_0x5b1cd8,_0x165cdc);}}return db[_0xd3a2('0x90')][_0xd3a2('0x4a')]({'where':{'service':!![]},'include':[{'model':db[_0xd3a2('0x91')],'as':_0xd3a2('0x92'),'raw':!![],'include':[{'model':db[_0xd3a2('0x93')],'as':_0xd3a2('0x93'),'raw':!![]}]}]});}}})[_0xd3a2('0x14')](function(_0x194a9c){if(!_0x194a9c||!_0x194a9c[_0xd3a2('0x92')]||!_0x1aac99['body'])return _0x366162;var _0x49d030=_0x194a9c['getSmtpOptions']();return respondWithRpcPromise(_0xd3a2('0x94'),'sendMail',{'account':_0x49d030,'message':{'from':util[_0xd3a2('0x76')](_0xd3a2('0x95'),_0x194a9c[_0xd3a2('0x28')],_0x194a9c[_0xd3a2('0x50')]||_0x194a9c[_0xd3a2('0x92')][_0xd3a2('0x35')]),'to':_0x1aac99['body'][_0xd3a2('0x74')],'subject':_0xd3a2('0x96'),'text':util[_0xd3a2('0x76')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x1aac99[_0xd3a2('0x45')][_0xd3a2('0x74')]),'attachments':[{'path':_0x5b1cd8}]}})[_0xd3a2('0x14')](function(){return _0x366162;})[_0xd3a2('0x36')](function(_0x404d00){logger[_0xd3a2('0x1b')](_0x404d00);});})['then'](respondWithStatusCode(_0xbdb1ce,0xc8))[_0xd3a2('0x36')](handleError(_0xbdb1ce,null));};exports[_0xd3a2('0x97')]=function(_0x40d87b,_0x22837e){return db['ChatMessage'][_0xd3a2('0x47')]({'where':{'id':_0x40d87b['params']['id']}})[_0xd3a2('0x14')](handleEntityNotFound(_0x22837e,null))['then'](function(_0x31689a){if(_0x31689a){return _0x31689a['addMessage'](_0x40d87b[_0xd3a2('0x45')][_0xd3a2('0x98')],_[_0xd3a2('0x99')](_0x40d87b[_0xd3a2('0x45')],[_0xd3a2('0x98'),'id'])||{});}})[_0xd3a2('0x14')](respondWithResult(_0x22837e,null))['catch'](handleError(_0x22837e,null));};exports[_0xd3a2('0x9a')]=function(_0x31f618,_0x448f1c){var _0x141a62={'raw':![],'where':{}};var _0x52a704={};var _0x3d5ddc={'count':0x0,'rows':[]};return db[_0xd3a2('0x3a')][_0xd3a2('0x4a')]({'where':{'id':_0x31f618['params']['id']}})[_0xd3a2('0x14')](handleEntityNotFound(_0x448f1c,null))[_0xd3a2('0x14')](function(_0x1ba39b){if(_0x1ba39b){_0x52a704[_0xd3a2('0x38')]=_[_0xd3a2('0x39')](db['ChatMessage'][_0xd3a2('0x3b')]);_0x52a704[_0xd3a2('0x34')]=_['keys'](_0x31f618[_0xd3a2('0x34')]);_0x52a704[_0xd3a2('0x3c')]=_[_0xd3a2('0x3d')](_0x52a704[_0xd3a2('0x38')],_0x52a704[_0xd3a2('0x34')]);_0x141a62[_0xd3a2('0x3e')]=_[_0xd3a2('0x3d')](_0x52a704['model'],qs[_0xd3a2('0x3f')](_0x31f618[_0xd3a2('0x34')][_0xd3a2('0x3f')]));_0x141a62[_0xd3a2('0x3e')]=_0x141a62[_0xd3a2('0x3e')][_0xd3a2('0x80')]?_0x141a62[_0xd3a2('0x3e')]:_0x52a704['model'];if(!_0x31f618[_0xd3a2('0x34')][_0xd3a2('0x9b')](_0xd3a2('0x9c'))){_0x141a62['limit']=qs[_0xd3a2('0x1f')](_0x31f618[_0xd3a2('0x34')][_0xd3a2('0x1f')]);_0x141a62[_0xd3a2('0x22')]=qs[_0xd3a2('0x22')](_0x31f618['query'][_0xd3a2('0x22')]);}_0x141a62[_0xd3a2('0x9d')]=qs[_0xd3a2('0x9e')](_0x31f618[_0xd3a2('0x34')][_0xd3a2('0x9e')]);_0x141a62[_0xd3a2('0x9f')]=qs[_0xd3a2('0x3c')](_[_0xd3a2('0xa0')](_0x31f618[_0xd3a2('0x34')],_0x52a704[_0xd3a2('0x3c')]));_0x141a62['where'][_0xd3a2('0xa1')]=_0x1ba39b['id'];if(_0x31f618['query'][_0xd3a2('0xa2')]){_0x141a62['where']=_['merge'](_0x141a62[_0xd3a2('0x9f')],{'$or':_['map'](_0x141a62[_0xd3a2('0x3e')],function(_0x5f51ac){var _0x519ae9={};_0x519ae9[_0x5f51ac]={'$like':'%'+_0x31f618['query'][_0xd3a2('0xa2')]+'%'};return _0x519ae9;})});}if(_0x31f618[_0xd3a2('0x34')][_0xd3a2('0xa3')]){var _0x13595e=_0x31f618[_0xd3a2('0x34')][_0xd3a2('0xa3')][_0xd3a2('0xa4')](',');var _0x13f07c={};_0x13f07c[_0x13595e[0x0]]={'$gte':moment(_0x13595e[0x1])[_0xd3a2('0x76')](_0xd3a2('0xa5'))};_0x141a62[_0xd3a2('0x9f')]=_[_0xd3a2('0x42')](_0x141a62[_0xd3a2('0x9f')],_0x13f07c);}_0x141a62=_[_0xd3a2('0x42')]({},_0x141a62,_0x31f618[_0xd3a2('0x43')]);return db[_0xd3a2('0x7a')][_0xd3a2('0x21')]({'where':_0x141a62['where']})[_0xd3a2('0x14')](function(_0x442d3d){_0x3d5ddc['count']=_0x442d3d;if(_0x31f618[_0xd3a2('0x34')][_0xd3a2('0x40')]){_0x141a62['include']=[{'all':!![]}];}return db[_0xd3a2('0x7a')][_0xd3a2('0x32')](_0x141a62);})[_0xd3a2('0x14')](function(_0xef8852){_0x3d5ddc['rows']=_0xef8852;return _0x3d5ddc;});}})[_0xd3a2('0x14')](respondWithFilteredResult(_0x448f1c,_0x141a62))[_0xd3a2('0x36')](handleError(_0x448f1c,null));};exports[_0xd3a2('0xa6')]=function(_0x34060d,_0x48dc64){var _0x12f512={'where':{}},_0x209474={},_0x2f9b01={'count':0x0,'rows':[]};return db[_0xd3a2('0x3a')][_0xd3a2('0x4a')]({'where':{'id':_0x34060d['params']['id']}})['then'](handleEntityNotFound(_0x48dc64,null))[_0xd3a2('0x14')](function(_0x468a3e){if(_0x468a3e){_0x209474[_0xd3a2('0x38')]=_[_0xd3a2('0x39')](db['ChatMessage'][_0xd3a2('0x3b')]);_0x209474[_0xd3a2('0x34')]=_[_0xd3a2('0x39')](_0x34060d[_0xd3a2('0x34')]);_0x209474[_0xd3a2('0x3c')]=_[_0xd3a2('0x3d')](_0x209474[_0xd3a2('0x38')],_0x209474[_0xd3a2('0x34')]);_0x12f512[_0xd3a2('0x3e')]=_[_0xd3a2('0x3d')](_0x209474[_0xd3a2('0x38')],qs[_0xd3a2('0x3f')](_0x34060d[_0xd3a2('0x34')][_0xd3a2('0x3f')]));_0x12f512[_0xd3a2('0x3e')]=_0x12f512[_0xd3a2('0x3e')][_0xd3a2('0x80')]?_0x12f512[_0xd3a2('0x3e')]:_0x209474[_0xd3a2('0x38')];if(!_0x34060d[_0xd3a2('0x34')][_0xd3a2('0x9b')](_0xd3a2('0x9c'))){_0x12f512[_0xd3a2('0x1f')]=qs[_0xd3a2('0x1f')](_0x34060d['query'][_0xd3a2('0x1f')]);_0x12f512[_0xd3a2('0x22')]=qs[_0xd3a2('0x22')](_0x34060d[_0xd3a2('0x34')]['offset']);}_0x12f512['order']=qs['sort'](_0x34060d[_0xd3a2('0x34')]['sort']);_0x12f512['where']=qs[_0xd3a2('0x3c')](_[_0xd3a2('0xa0')](_0x34060d['query'],_0x209474[_0xd3a2('0x3c')]));_0x12f512[_0xd3a2('0x9f')]['ChatInteractionId']=_0x468a3e['id'];if(_0x34060d[_0xd3a2('0x34')]['filter']){_0x12f512['where']=_[_0xd3a2('0x42')](_0x12f512['where'],{'$or':_[_0xd3a2('0x2f')](_0x12f512[_0xd3a2('0x3e')],function(_0x4d1030){var _0x51dd1e={};_0x51dd1e[_0x4d1030]={'$like':'%'+_0x34060d[_0xd3a2('0x34')][_0xd3a2('0xa2')]+'%'};return _0x51dd1e;})});}_0x12f512[_0xd3a2('0x9f')]['secret']=![];if(_0x34060d[_0xd3a2('0x34')]['id']){_0x12f512[_0xd3a2('0x9f')]['id']={'$gt':_0x34060d[_0xd3a2('0x34')]['id']};}_0x12f512=_[_0xd3a2('0x42')]({},_0x12f512,_0x34060d[_0xd3a2('0x43')]);return db['ChatMessage'][_0xd3a2('0x21')]({'where':_0x12f512[_0xd3a2('0x9f')]})[_0xd3a2('0x14')](function(_0x106e7b){_0x2f9b01[_0xd3a2('0x21')]=_0x106e7b;_0x12f512[_0xd3a2('0x41')]=[];if(_0x34060d['query'][_0xd3a2('0xa7')]){_0x12f512['include'][_0xd3a2('0xa8')]({'model':db['User'],'as':'User','attributes':['id',_0xd3a2('0x4f'),'alias']});}if(_0x34060d[_0xd3a2('0x34')][_0xd3a2('0x40')]){_0x12f512['include']=[{'all':!![]}];}return db[_0xd3a2('0x7a')][_0xd3a2('0x32')](_0x12f512);})['then'](function(_0x3a62a6){_0x2f9b01[_0xd3a2('0xa9')]=_0x3a62a6;return _0x2f9b01;});}})[_0xd3a2('0x14')](respondWithFilteredResult(_0x48dc64,_0x12f512))['catch'](handleError(_0x48dc64,null));};exports[_0xd3a2('0xaa')]=function(_0x37f23d,_0x3638dc){return db[_0xd3a2('0x3a')][_0xd3a2('0x47')]({'where':{'id':_0x37f23d[_0xd3a2('0x37')]['id']}})[_0xd3a2('0x14')](handleEntityNotFound(_0x3638dc,null))[_0xd3a2('0x14')](function(_0x50e43c){if(_0x50e43c){return _0x50e43c['setTags'](_0x37f23d[_0xd3a2('0x45')][_0xd3a2('0x98')],_[_0xd3a2('0x99')](_0x37f23d[_0xd3a2('0x45')],[_0xd3a2('0x98'),'id'])||{})[_0xd3a2('0xab')](function(){return db[_0xd3a2('0xac')][_0xd3a2('0x32')]({'attributes':['id',_0xd3a2('0x28'),_0xd3a2('0xad')],'where':{'id':_0x37f23d[_0xd3a2('0x45')][_0xd3a2('0x98')]}});})[_0xd3a2('0x14')](function(_0x1e9b25){socket[_0xd3a2('0xae')]('chatInteractionTags:save',{'id':Number(_0x37f23d['params']['id']),'tags':_0x1e9b25||[]});return{'id':Number(_0x37f23d['params']['id']),'tags':_0x1e9b25||[]};});}})[_0xd3a2('0x14')](respondWithResult(_0x3638dc,null))[_0xd3a2('0x36')](handleError(_0x3638dc,null));};exports[_0xd3a2('0xaf')]=function(_0x1569a3,_0x1b2995){return db[_0xd3a2('0x3a')]['find']({'where':{'id':_0x1569a3[_0xd3a2('0x37')]['id']}})['then'](handleEntityNotFound(_0x1b2995,null))[_0xd3a2('0x14')](function(_0x26db4b){if(_0x26db4b){return _0x26db4b['removeTags'](_0x1569a3[_0xd3a2('0x34')][_0xd3a2('0x98')]);}})[_0xd3a2('0x14')](respondWithStatusCode(_0x1b2995,null))[_0xd3a2('0x36')](handleError(_0x1b2995,null));};exports[_0xd3a2('0x72')]=function(_0x5e9266,_0x1cb4ae){var _0x1a8cfd=moment()[_0xd3a2('0xb0')]()[_0xd3a2('0xb1')]();var _0x130e6a=path['join'](config[_0xd3a2('0x70')],'server',_0xd3a2('0xb2'),'tmp');var _0xe25068=path['join'](config[_0xd3a2('0x70')],_0xd3a2('0xb3'),'files',_0xd3a2('0xb4'));var _0xd7612e=path[_0xd3a2('0x6f')](_0x130e6a,_0x1a8cfd);var _0x7a7737=util[_0xd3a2('0x76')](_0xd3a2('0xb5'),_0x5e9266[_0xd3a2('0x37')]['id'],_0x1a8cfd);var _0x8cb96f=path['join'](_0x130e6a,_0x7a7737);var _0x2562a0=[];_0x2562a0['push']({'model':db[_0xd3a2('0x7b')],'as':_0xd3a2('0x7b'),'attributes':['id',_0xd3a2('0x4f')],'raw':!![]});_0x2562a0[_0xd3a2('0xa8')]({'model':db[_0xd3a2('0x7d')],'as':_0xd3a2('0x5e'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x5e9266[_0xd3a2('0x34')][_0xd3a2('0xb4')]){_0x2562a0[_0xd3a2('0xa8')]({'model':db[_0xd3a2('0x6c')],'as':_0xd3a2('0x6c'),'raw':!![]});}var _0x27b020=[{'model':db[_0xd3a2('0x7a')],'as':_0xd3a2('0x7f'),'attributes':['id',_0xd3a2('0x45'),_0xd3a2('0xb6'),_0xd3a2('0x8e'),_0xd3a2('0xb7'),_0xd3a2('0xb8')],'include':_0x2562a0}];_0x27b020['push']({'model':db[_0xd3a2('0x4b')],'as':_0xd3a2('0xb9'),'attributes':['id','name']});_0x27b020[_0xd3a2('0xa8')]({'model':db['User'],'as':'Owner','attributes':['id',_0xd3a2('0x4f')]});return db[_0xd3a2('0x3a')]['find']({'where':{'id':_0x5e9266[_0xd3a2('0x37')]['id']},'include':_0x27b020})[_0xd3a2('0x14')](handleEntityNotFound(_0x1cb4ae,null))[_0xd3a2('0x14')](function(_0x263f61){if(_0x263f61){var _0x178605=_0x263f61[_0xd3a2('0xba')]({'plain':!![]});fs[_0xd3a2('0xbb')](_0xd7612e);var _0x3d687b={'channel':_0xd3a2('0xbc'),'account':_0x178605['Account']['name'],'agent':_0x178605['Owner']?_0x178605[_0xd3a2('0xbd')][_0xd3a2('0x4f')]:_0xd3a2('0xbe'),'createdAt':moment(_0x178605[_0xd3a2('0xb6')])[_0xd3a2('0x76')](_0xd3a2('0xa5'))[_0xd3a2('0xb1')](),'closedAt':_0x178605[_0xd3a2('0x62')]?moment(_0x178605[_0xd3a2('0xbf')])['format'](_0xd3a2('0xa5'))['toString']():'','disposition':_0x178605[_0xd3a2('0xc0')],'chatInfo':{'browser':_0x178605['browserName'],'os':_0x178605[_0xd3a2('0xc1')],'referer':_0x178605['referer'],'customerIp':_0x178605[_0xd3a2('0xc2')],'customerPort':_0x178605[_0xd3a2('0xc3')]?_0x178605[_0xd3a2('0xc3')]:_0xd3a2('0xbe')},'messages':_(_0x178605[_0xd3a2('0x7f')])[_0xd3a2('0xc4')]()[_0xd3a2('0xa2')]({'secret':![]})[_0xd3a2('0x2f')](function(_0x22a116){if(_0x22a116[_0xd3a2('0x6c')]){var _0x4d0dad=path[_0xd3a2('0x6f')](_0xe25068,_0x22a116['Attachment']['basename']);if(fs[_0xd3a2('0xc5')](_0x4d0dad)){fs[_0xd3a2('0xc6')](_0x4d0dad)['pipe'](fs['createWriteStream'](path[_0xd3a2('0x6f')](_0xd7612e,_0x22a116['Attachment'][_0xd3a2('0x66')])));}}return{'date':moment(_0x22a116['createdAt'])[_0xd3a2('0x76')](_0xd3a2('0xa5'))[_0xd3a2('0xb1')](),'sender':_0x22a116[_0xd3a2('0x8e')]==='out'?_0x22a116['User']?_0x22a116[_0xd3a2('0x7b')]['fullname']:_0xd3a2('0x83'):_0x22a116[_0xd3a2('0x5e')][_0xd3a2('0xc7')]+(_0x22a116[_0xd3a2('0x5e')]['lastName']?'\x20'+_0x22a116['Contact'][_0xd3a2('0xc8')]:''),'body':_0x22a116[_0xd3a2('0x6c')]?_0x22a116[_0xd3a2('0x6c')][_0xd3a2('0x66')]:_0x22a116['body'],'direction':_0x22a116[_0xd3a2('0x8e')]===_0xd3a2('0xc9')?'A':'C','secret':_0x22a116[_0xd3a2('0xb7')],'read':_0x22a116[_0xd3a2('0xb8')],'attachment':_0x22a116[_0xd3a2('0x6c')]};})[_0xd3a2('0xca')]()};return ejs[_0xd3a2('0xcb')](path[_0xd3a2('0x6f')](config[_0xd3a2('0x70')],_0xd3a2('0xb3'),_0xd3a2('0xcc'),_0xd3a2('0xcd')),{'interaction':_0x3d687b})[_0xd3a2('0x14')](function(_0xdac1d3){var _0xbde4a8=path['join'](_0xd7612e,_0xd3a2('0xce')+_0x178605['id']+'-'+_0x1a8cfd+_0xd3a2('0xcf'));var _0x150d07={'path':_0xbde4a8,'channel':'Chat','interactionId':_0x178605['id']};return pdf[_0xd3a2('0xd0')](_0xdac1d3,_0x150d07);})['then'](function(){return new Promise(function(_0x59ed47,_0x5b4076){zipdir(_0xd7612e,{'saveTo':_0x8cb96f},function(_0x13283a,_0x4b9e70){if(_0x13283a)return _0x5b4076(_0x13283a);return _0x59ed47(_0x4b9e70);});})[_0xd3a2('0x14')](function(){return new BPromise(function(_0x3d8176,_0x4141d3){rimraf(_0xd7612e,function(_0x3c1df5){if(_0x3c1df5)_0x4141d3(_0x3c1df5);return _0x3d8176();});});})[_0xd3a2('0x14')](function(){return _0x1cb4ae[_0xd3a2('0x72')](_0x8cb96f,_0x7a7737,function(_0x3c84d9){if(_0x3c84d9){logger['error'](_0xd3a2('0xd1'),_0x3c84d9);}else{fs['unlinkSync'](_0x8cb96f);}});});});}else{return _0x1cb4ae[_0xd3a2('0x1d')](0xc8);}})['catch'](handleError(_0x1cb4ae,null));};
\ No newline at end of file
+var _0x6e8f=['ChatInteraction','rawAttributes','fieldName','type','key','getOptions','chat','query','user','show','params','model','keys','attributes','fields','length','includeAll','options','create','update','find','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','now','Messages','User','ChatWebsiteId','ContactId','format','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','intersection','hasOwnProperty','nolimit','order','sort','where','filters','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','secret','includeAgent','push','alias','rows','addTags','setTags','omit','spread','Tag','color','emit','removeTags','unix','toString','server','files','CmContact','lastName','Account','mkdirSync','Chat','Owner','N.A.','osName','referer','customerIp','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','.pdf','err','unlinkSync','rimraf','request-promise','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatInteraction.socket','register','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','json','undefined','limit','offset','count','set','destroy','stack','name','send','render','merge','body','contact','agent','interaction','index','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e8f,0x16f));var _0xf6e8=function(_0xf0ebae,_0x4c6b6f){_0xf0ebae=_0xf0ebae-0x0;var _0x2588ff=_0x6e8f[_0xf0ebae];return _0x2588ff;};'use strict';var rimraf=require(_0xf6e8('0x0'));var zipdir=require('zip-dir');var rp=require(_0xf6e8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf6e8('0x2'));var path=require(_0xf6e8('0x3'));var ejs=require(_0xf6e8('0x4'));var fs=require('fs');var _=require(_0xf6e8('0x5'));var Redis=require(_0xf6e8('0x6'));var interaction=require(_0xf6e8('0x7'));var qs=require(_0xf6e8('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0xf6e8('0x9'))(_0xf6e8('0xa'));var config=require(_0xf6e8('0xb'));var db=require(_0xf6e8('0xc'))['db'];config['redis']=_['defaults'](config[_0xf6e8('0xd')],{'host':_0xf6e8('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf6e8('0xd')]));require(_0xf6e8('0xf'))[_0xf6e8('0x10')](socket);var jayson=require(_0xf6e8('0x11'));var client=jayson['client'][_0xf6e8('0x12')]({'port':0x232b});var client9004=jayson['client'][_0xf6e8('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x1a882b,_0x2805e6,_0x2465b0,_0x44b71f){return new BPromise(function(_0x51cd0a,_0x5ab3d2){var _0x492984=_0x44b71f||client;return _0x492984[_0xf6e8('0x13')](_0x1a882b,_0x2465b0)[_0xf6e8('0x14')](function(_0x4d2fbf){logger[_0xf6e8('0x15')](_0xf6e8('0x16'),_0x2805e6,'request\x20sent');logger[_0xf6e8('0x17')](_0xf6e8('0x18'),_0x2805e6,_0xf6e8('0x19'),JSON[_0xf6e8('0x1a')](_0x4d2fbf));if(_0x4d2fbf['error']){if(_0x4d2fbf['error']['code']===0x1f4){logger[_0xf6e8('0x1b')](_0xf6e8('0x16'),_0x2805e6,_0x4d2fbf['error'][_0xf6e8('0x1c')]);return _0x5ab3d2(_0x4d2fbf['error'][_0xf6e8('0x1c')]);}logger[_0xf6e8('0x1b')](_0xf6e8('0x16'),_0x2805e6,_0x4d2fbf['error'][_0xf6e8('0x1c')]);return _0x51cd0a(_0x4d2fbf[_0xf6e8('0x1b')][_0xf6e8('0x1c')]);}else{logger[_0xf6e8('0x15')](_0xf6e8('0x16'),_0x2805e6,'request\x20sent');_0x51cd0a(_0x4d2fbf['result'][_0xf6e8('0x1c')]);}})[_0xf6e8('0x1d')](function(_0x3ce618){logger[_0xf6e8('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x2805e6,_0x3ce618);_0x5ab3d2(_0x3ce618);});});}function respondWithStatusCode(_0xc45546,_0x107138){_0x107138=_0x107138||0xcc;return function(_0x42dabd){if(_0x42dabd){return _0xc45546[_0xf6e8('0x1e')](_0x107138);}return _0xc45546[_0xf6e8('0x1f')](_0x107138)[_0xf6e8('0x20')]();};}function respondWithResult(_0x223d37,_0x2e33cf){_0x2e33cf=_0x2e33cf||0xc8;return function(_0x1cf75d){if(_0x1cf75d){return _0x223d37[_0xf6e8('0x1f')](_0x2e33cf)[_0xf6e8('0x21')](_0x1cf75d);}};}function respondWithFilteredResult(_0x4a55f8,_0x38376f){return function(_0x742f22){if(_0x742f22){var _0x26536e=typeof _0x38376f['offset']===_0xf6e8('0x22')&&typeof _0x38376f[_0xf6e8('0x23')]===_0xf6e8('0x22');var _0x4d257f=_0x742f22['count'];var _0x1c7a9a=_0x26536e?0x0:_0x38376f[_0xf6e8('0x24')];var _0x4ae81c=_0x26536e?_0x742f22[_0xf6e8('0x25')]:_0x38376f['offset']+_0x38376f[_0xf6e8('0x23')];var _0x55100d;if(_0x4ae81c>=_0x4d257f){_0x4ae81c=_0x4d257f;_0x55100d=0xc8;}else{_0x55100d=0xce;}_0x4a55f8[_0xf6e8('0x1f')](_0x55100d);return _0x4a55f8[_0xf6e8('0x26')]('Content-Range',_0x1c7a9a+'-'+_0x4ae81c+'/'+_0x4d257f)[_0xf6e8('0x21')](_0x742f22);}return null;};}function saveUpdates(_0x29dcae){return function(_0x1e0265){if(_0x1e0265){return _0x1e0265['update'](_0x29dcae)[_0xf6e8('0x14')](function(_0x310ce7){return _0x310ce7;});}return null;};}function removeEntity(_0x1d9349){return function(_0xb0fe0e){if(_0xb0fe0e){return _0xb0fe0e[_0xf6e8('0x27')]()[_0xf6e8('0x14')](function(){_0x1d9349['status'](0xcc)[_0xf6e8('0x20')]();});}};}function handleEntityNotFound(_0x3c7730){return function(_0x1acc32){if(!_0x1acc32){_0x3c7730[_0xf6e8('0x1e')](0x194);}return _0x1acc32;};}function handleError(_0x3cb002,_0x28e966){_0x28e966=_0x28e966||0x1f4;return function(_0x4487f4){logger['error'](_0x4487f4[_0xf6e8('0x28')]);if(_0x4487f4[_0xf6e8('0x29')]){delete _0x4487f4['name'];}_0x3cb002[_0xf6e8('0x1f')](_0x28e966)[_0xf6e8('0x2a')](_0x4487f4);};}function getMustacheRender(_0xf34fea,_0xaa9867){return Mustache[_0xf6e8('0x2b')](_0xf34fea,_[_0xf6e8('0x2c')](_0xaa9867[_0xf6e8('0x2d')],{'contact':_0xaa9867[_0xf6e8('0x2e')],'message':_0xaa9867[_0xf6e8('0x1c')],'agent':_0xaa9867[_0xf6e8('0x2f')],'interaction':_0xaa9867[_0xf6e8('0x30')],'account':_0xaa9867['account']}))||'';}exports[_0xf6e8('0x31')]=function(_0xe978a2,_0x4b054d){var _0x532192={};var _0x551f05=_[_0xf6e8('0x32')](db[_0xf6e8('0x33')][_0xf6e8('0x34')],function(_0x3e7df1){return{'name':_0x3e7df1[_0xf6e8('0x35')],'type':_0x3e7df1[_0xf6e8('0x36')][_0xf6e8('0x37')]};});_0x532192=qs[_0xf6e8('0x38')](_0x551f05,_0xe978a2);return interaction['findAll'](_0xf6e8('0x39'),_0xe978a2[_0xf6e8('0x3a')],_0xe978a2[_0xf6e8('0x3b')],_0x532192,_0x551f05)[_0xf6e8('0x14')](respondWithFilteredResult(_0x4b054d,_0x532192))['catch'](handleError(_0x4b054d,null));};exports[_0xf6e8('0x3c')]=function(_0x42c844,_0x3363cb){var _0x6194dc={'raw':![],'where':{'id':_0x42c844[_0xf6e8('0x3d')]['id']}},_0x187a5d={};_0x187a5d[_0xf6e8('0x3e')]=_[_0xf6e8('0x3f')](db[_0xf6e8('0x33')][_0xf6e8('0x34')]);_0x187a5d[_0xf6e8('0x3a')]=_[_0xf6e8('0x3f')](_0x42c844[_0xf6e8('0x3a')]);_0x187a5d['filters']=_['intersection'](_0x187a5d[_0xf6e8('0x3e')],_0x187a5d['query']);_0x6194dc[_0xf6e8('0x40')]=_['intersection'](_0x187a5d[_0xf6e8('0x3e')],qs['fields'](_0x42c844['query'][_0xf6e8('0x41')]));_0x6194dc['attributes']=_0x6194dc[_0xf6e8('0x40')][_0xf6e8('0x42')]?_0x6194dc['attributes']:_0x187a5d[_0xf6e8('0x3e')];if(_0x42c844[_0xf6e8('0x3a')][_0xf6e8('0x43')]){_0x6194dc['include']=[{'all':!![]}];}_0x6194dc=_[_0xf6e8('0x2c')]({},_0x6194dc,_0x42c844[_0xf6e8('0x44')]);return db[_0xf6e8('0x33')]['find'](_0x6194dc)[_0xf6e8('0x14')](handleEntityNotFound(_0x3363cb,null))[_0xf6e8('0x14')](respondWithResult(_0x3363cb,null))[_0xf6e8('0x1d')](handleError(_0x3363cb,null));};exports[_0xf6e8('0x45')]=function(_0x1e452d,_0x407a39){return db[_0xf6e8('0x33')][_0xf6e8('0x45')](_0x1e452d[_0xf6e8('0x2d')],{})[_0xf6e8('0x14')](respondWithResult(_0x407a39,0xc9))[_0xf6e8('0x1d')](handleError(_0x407a39,null));};exports[_0xf6e8('0x46')]=function(_0x5a3c27,_0xcbfa86){if(_0x5a3c27['body']['id']){delete _0x5a3c27[_0xf6e8('0x2d')]['id'];}return db[_0xf6e8('0x33')][_0xf6e8('0x47')]({'where':{'id':_0x5a3c27[_0xf6e8('0x3d')]['id']}})[_0xf6e8('0x14')](handleEntityNotFound(_0xcbfa86,null))['then'](saveUpdates(_0x5a3c27[_0xf6e8('0x2d')],null))[_0xf6e8('0x14')](respondWithResult(_0xcbfa86,null))['catch'](handleError(_0xcbfa86,null));};exports[_0xf6e8('0x27')]=function(_0x52ea89,_0x12e507){return db[_0xf6e8('0x33')][_0xf6e8('0x47')]({'where':{'id':_0x52ea89['params']['id']}})[_0xf6e8('0x14')](handleEntityNotFound(_0x12e507,null))['then'](removeEntity(_0x12e507,null))[_0xf6e8('0x1d')](handleError(_0x12e507,null));};exports[_0xf6e8('0x48')]=function(_0x8e501a,_0x30570c){return db[_0xf6e8('0x33')]['describe']()[_0xf6e8('0x14')](respondWithResult(_0x30570c,null))[_0xf6e8('0x1d')](handleError(_0x30570c,null));};exports[_0xf6e8('0x49')]=function(_0x50fa7a,_0x3c008f){var _0x217bc8=_0x50fa7a[_0xf6e8('0x3d')]['id'];var _0xcda1ad;var _0x5dc90b;var _0x3c8ec2;return db['ChatInteraction'][_0xf6e8('0x4a')]({'where':{'id':_0x217bc8}})[_0xf6e8('0x14')](function(_0x2f9ee0){_0xcda1ad=_0x2f9ee0;return db[_0xf6e8('0x4b')][_0xf6e8('0x4a')]({'where':{'id':_0x2f9ee0['ChatWebsiteId']},'attributes':['id',_0xf6e8('0x4c'),_0xf6e8('0x4d'),'vidaooTopic',_0xf6e8('0x4e'),'vidaooMetadata'],'raw':!![]});})[_0xf6e8('0x14')](function(_0x9d9a34){if(_0x9d9a34&&_0x9d9a34[_0xf6e8('0x4c')]&&_0x9d9a34['vidaooEscalation']){_0x5dc90b=_0x9d9a34;var _0x1ee590={'interaction':{'id':_0x217bc8},'agent':{'id':_0x50fa7a[_0xf6e8('0x3b')]['id'],'name':_0x50fa7a[_0xf6e8('0x3b')][_0xf6e8('0x29')],'fullname':_0x50fa7a[_0xf6e8('0x3b')]['fullname'],'email':_0x50fa7a[_0xf6e8('0x3b')][_0xf6e8('0x4f')]},'contact':_0x50fa7a[_0xf6e8('0x2d')]['contact'],'account':_0x50fa7a[_0xf6e8('0x2d')][_0xf6e8('0x50')]};var _0x396845={'rejectUnauthorized':![],'method':_0xf6e8('0x51'),'url':_0xf6e8('0x52'),'headers':{'X-APIKEY':_0x9d9a34[_0xf6e8('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x50fa7a[_0xf6e8('0x3b')][_0xf6e8('0x4f')]],'buttons':null,'topic':_0x5dc90b[_0xf6e8('0x53')],'note':_[_0xf6e8('0x54')](_0x5dc90b['vidaooNote'])?null:getMustacheRender(_0x5dc90b['vidaooNote'],_0x1ee590),'metadata':null},'redirect':_0xf6e8('0x55'),'json':!![]};try{if(!_[_0xf6e8('0x54')](_0x5dc90b[_0xf6e8('0x56')])){var _0x342aeb=getMustacheRender(_0x5dc90b[_0xf6e8('0x56')],_0x1ee590);var _0x42f536=JSON[_0xf6e8('0x57')](_0x342aeb);_0x396845[_0xf6e8('0x2d')][_0xf6e8('0x58')]=_0x42f536;}}catch(_0x23ec6f){throw new db[(_0xf6e8('0x59'))][(_0xf6e8('0x5a'))](_0xf6e8('0x5b'));}return rp(_0x396845);}else{throw new db[(_0xf6e8('0x59'))]['ValidationError'](_0xf6e8('0x5c'));}})['then'](function(_0xa80fc1){_0x3c8ec2=_0xa80fc1;if(_0x3c8ec2['id']){var _0xa5adaf={'body':_0x3c8ec2[_0xf6e8('0x5d')],'ChatWebsiteId':_0x5dc90b['id'],'ChatInteractionId':_0xcda1ad['id'],'direction':_0xf6e8('0x5e'),'UserId':_0x50fa7a['user']['id']};return db[_0xf6e8('0x5f')][_0xf6e8('0x45')](_0xa5adaf,{});}else{throw new db[(_0xf6e8('0x59'))][(_0xf6e8('0x5a'))](_0xf6e8('0x60'));}})[_0xf6e8('0x14')](function(){return _0xcda1ad[_0xf6e8('0x61')]({'vidaooSessionId':_0x3c8ec2['id']});})[_0xf6e8('0x14')](respondWithResult(_0x3c008f,null))[_0xf6e8('0x1d')](handleError(_0x3c008f,null));};exports[_0xf6e8('0x62')]=function(_0x511bb2,_0x270812){if(_0x511bb2['body']['id']){delete _0x511bb2[_0xf6e8('0x2d')]['id'];}return db[_0xf6e8('0x33')]['find']({'where':{'id':_0x511bb2[_0xf6e8('0x3d')]['id']},'include':[{'model':db['CmContact'],'as':_0xf6e8('0x63')}]})[_0xf6e8('0x14')](handleEntityNotFound(_0x270812,null))[_0xf6e8('0x14')](saveUpdates(_0x511bb2[_0xf6e8('0x2d')],null))[_0xf6e8('0x14')](respondWithResult(_0x270812,null))[_0xf6e8('0x1d')](handleError(_0x270812,null));};exports[_0xf6e8('0x64')]=function(_0x797d9f,_0x192dca){if(_0x797d9f[_0xf6e8('0x2d')]['id']){delete _0x797d9f[_0xf6e8('0x2d')]['id'];}return db[_0xf6e8('0x33')][_0xf6e8('0x47')]({'where':{'id':_0x797d9f[_0xf6e8('0x3d')]['id']}})[_0xf6e8('0x14')](function(_0x4a6908){if(!_0x4a6908){logger['error'](_0xf6e8('0x65'),_0xf6e8('0x64'),0x194,_0xf6e8('0x66'));_0x192dca[_0xf6e8('0x1e')](0x194);}else{if(_0x4a6908[_0xf6e8('0x67')]){throw new db['Sequelize'][(_0xf6e8('0x5a'))](_0xf6e8('0x68'));}}return _0x4a6908;})[_0xf6e8('0x14')](function(_0x4e1359){if(_0x4e1359){return _0x4e1359[_0xf6e8('0x46')]({'closed':_0x797d9f[_0xf6e8('0x2d')][_0xf6e8('0x69')],'disposition':_0x797d9f['body'][_0xf6e8('0x6a')]})[_0xf6e8('0x14')](function(_0x2eceac){return _0x2eceac;});}})[_0xf6e8('0x14')](function(){return respondWithRpcPromise(_0xf6e8('0x6b'),_0xf6e8('0x64'),_0x797d9f[_0xf6e8('0x2d')],client9004);})[_0xf6e8('0x14')](respondWithResult(_0x192dca,null))['catch'](handleError(_0x192dca,null));};exports[_0xf6e8('0x6c')]=function(_0x15a0b0,_0x16a84a){_0x15a0b0[_0xf6e8('0x2d')][_0xf6e8('0x29')]=_0x15a0b0['file']['originalname'];_0x15a0b0[_0xf6e8('0x2d')][_0xf6e8('0x6d')]=_0x15a0b0[_0xf6e8('0x6e')][_0xf6e8('0x6f')];_0x15a0b0[_0xf6e8('0x2d')][_0xf6e8('0x36')]=_0x15a0b0[_0xf6e8('0x6e')][_0xf6e8('0x70')];return db[_0xf6e8('0x71')][_0xf6e8('0x45')](_0x15a0b0[_0xf6e8('0x2d')])['then'](respondWithResult(_0x16a84a,0xc9))[_0xf6e8('0x1d')](handleError(_0x16a84a,null));};exports[_0xf6e8('0x72')]=function(_0x2f61e8,_0x593718){return db[_0xf6e8('0x33')][_0xf6e8('0x4a')]({'where':{'id':_0x2f61e8[_0xf6e8('0x3d')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x593718,null))['then'](function(_0x487cd3){if(_0x487cd3){if(_0x487cd3[_0xf6e8('0x69')]){return _0x593718[_0xf6e8('0x1f')](0x193)[_0xf6e8('0x21')]({'status':0x193,'message':_0xf6e8('0x73')});}return db[_0xf6e8('0x71')]['findOne']({'where':{'id':_0x2f61e8[_0xf6e8('0x3a')]['attachId']},'raw':!![]})[_0xf6e8('0x14')](handleEntityNotFound(_0x593718,null));}})[_0xf6e8('0x14')](function(_0x109b4c){if(_0x109b4c){var _0xe59481=_0x109b4c['ChatOfflineMessageId']!==null;var _0x12a615=path[_0xf6e8('0x74')](config['root'],_0xf6e8('0x75'));if(_0xe59481){_0x12a615=path['join'](_0x12a615,_0xf6e8('0x76'));}var _0x5c7dce=path['join'](_0x12a615,_0x109b4c[_0xf6e8('0x6d')]);return _0x593718[_0xf6e8('0x77')](_0x5c7dce);}})[_0xf6e8('0x1d')](handleError(_0x593718,null));};exports[_0xf6e8('0x78')]=function(_0x307b96,_0x32b671){var _0x516fd4=null;var _0x5dd13c=null;var _0x299a93=null;if(_0x307b96[_0xf6e8('0x2d')]['id']){delete _0x307b96[_0xf6e8('0x2d')]['id'];}if(_0x307b96['body'][_0xf6e8('0x79')]){_0x299a93=path[_0xf6e8('0x74')](config[_0xf6e8('0x7a')],_0xf6e8('0x7b'),util['format'](_0xf6e8('0x7c'),Date[_0xf6e8('0x7d')]()));_0x307b96[_0xf6e8('0x2d')]['pathTranscript']=_0x299a93;}return db[_0xf6e8('0x33')]['find']({'where':{'id':_0x307b96['params']['id']},'include':[{'model':db[_0xf6e8('0x5f')],'as':_0xf6e8('0x7e'),'include':[{'model':db[_0xf6e8('0x7f')],'as':_0xf6e8('0x7f')}]}]})['then'](handleEntityNotFound(_0x32b671,null))[_0xf6e8('0x14')](saveUpdates(_0x307b96[_0xf6e8('0x2d')],null))[_0xf6e8('0x14')](function(_0x38b131){if(_0x38b131){_0x516fd4=_0x38b131;return db[_0xf6e8('0x4b')][_0xf6e8('0x47')]({'where':{'id':_0x516fd4[_0xf6e8('0x80')]}});}})['then'](function(_0x1569cc){if(_0x1569cc){_0x5dd13c=_0x1569cc;return db['CmContact'][_0xf6e8('0x47')]({'where':{'id':_0x516fd4[_0xf6e8('0x81')]}});}})['then'](function(_0x3edcf2){if(_0x3edcf2){if(_0x299a93){var _0x2d8767=null;for(var _0x2dba89=0x1;_0x2dba89<_0x516fd4[_0xf6e8('0x7e')][_0xf6e8('0x42')];++_0x2dba89){_0x2d8767=_0x516fd4['Messages'][_0x2dba89];var _0x4729b9=_0x2d8767['UserId']?util[_0xf6e8('0x82')]('%s%d',_0x5dd13c[_0xf6e8('0x83')],_0x2d8767[_0xf6e8('0x67')]):_0xf6e8('0x84');var _0x4fe4f8=_0x307b96[_0xf6e8('0x2d')][_0xf6e8('0x85')]||util['format'](_0xf6e8('0x86'),_0xf6e8('0x87'),_0x2d8767[_0xf6e8('0x81')]);switch(_0x5dd13c[_0xf6e8('0x88')]){case _0xf6e8('0x89'):_0x4729b9=_0x2d8767['UserId']?util[_0xf6e8('0x82')](_0xf6e8('0x86'),_0x5dd13c[_0xf6e8('0x83')],_0x2d8767[_0xf6e8('0x67')]):'System';break;case _0xf6e8('0x8a'):_0x4729b9=_0x2d8767[_0xf6e8('0x67')]?_0x2d8767[_0xf6e8('0x7f')]['alias']||_0x2d8767[_0xf6e8('0x7f')][_0xf6e8('0x8b')]:_0xf6e8('0x84');break;case _0xf6e8('0x8c'):_0x4729b9=_0x2d8767[_0xf6e8('0x67')]?_0x2d8767[_0xf6e8('0x7f')][_0xf6e8('0x8b')]:_0xf6e8('0x84');break;default:_0x4729b9=_0x2d8767[_0xf6e8('0x67')]?util['format'](_0xf6e8('0x86'),_0x5dd13c[_0xf6e8('0x83')],_0x2d8767['UserId']):'System';}var _0x45a3fb=util[_0xf6e8('0x82')](_0xf6e8('0x8d'),moment(_0x2d8767[_0xf6e8('0x8e')])[_0xf6e8('0x82')]('MM/DD/YYYY\x20HH:mm:ss'),_0x2d8767[_0xf6e8('0x8f')]==='in'?_0x4fe4f8:_0x4729b9,_0x2d8767['body']);if(!_0x2d8767['secret']){fs[_0xf6e8('0x90')](_0x299a93,_0x45a3fb);}}return db[_0xf6e8('0x91')][_0xf6e8('0x4a')]({'where':{'service':!![]},'include':[{'model':db[_0xf6e8('0x92')],'as':_0xf6e8('0x93'),'raw':!![],'include':[{'model':db[_0xf6e8('0x94')],'as':_0xf6e8('0x94'),'raw':!![]}]}]});}}})['then'](function(_0x3db798){if(!_0x3db798||!_0x3db798[_0xf6e8('0x93')]||!_0x307b96[_0xf6e8('0x2d')])return _0x516fd4;var _0x38a3f1=_0x3db798[_0xf6e8('0x95')]();return respondWithRpcPromise(_0xf6e8('0x96'),_0xf6e8('0x97'),{'account':_0x38a3f1,'message':{'from':util[_0xf6e8('0x82')](_0xf6e8('0x98'),_0x3db798[_0xf6e8('0x29')],_0x3db798[_0xf6e8('0x4f')]||_0x3db798[_0xf6e8('0x93')][_0xf6e8('0x3b')]),'to':_0x307b96[_0xf6e8('0x2d')]['mailTranscript'],'subject':_0xf6e8('0x99'),'text':util[_0xf6e8('0x82')](_0xf6e8('0x9a'),_0x307b96['body'][_0xf6e8('0x79')]),'attachments':[{'path':_0x299a93}]}})[_0xf6e8('0x14')](function(){return _0x516fd4;})[_0xf6e8('0x1d')](function(_0x37e9ae){logger['error'](_0x37e9ae);});})[_0xf6e8('0x14')](respondWithStatusCode(_0x32b671,0xc8))['catch'](handleError(_0x32b671,null));};exports[_0xf6e8('0x9b')]=function(_0x2c8ace,_0x2014e6){return db[_0xf6e8('0x5f')]['find']({'where':{'id':_0x2c8ace[_0xf6e8('0x3d')]['id']}})[_0xf6e8('0x14')](handleEntityNotFound(_0x2014e6,null))[_0xf6e8('0x14')](function(_0x4a242d){if(_0x4a242d){return _0x4a242d['addMessage'](_0x2c8ace[_0xf6e8('0x2d')][_0xf6e8('0x9c')],_['omit'](_0x2c8ace['body'],['ids','id'])||{});}})[_0xf6e8('0x14')](respondWithResult(_0x2014e6,null))[_0xf6e8('0x1d')](handleError(_0x2014e6,null));};exports['getMessages']=function(_0x2caa89,_0x451ea7){var _0x213a07={'raw':![],'where':{}};var _0x5ee162={};var _0x122a00={'count':0x0,'rows':[]};return db[_0xf6e8('0x33')]['findOne']({'where':{'id':_0x2caa89['params']['id']}})[_0xf6e8('0x14')](handleEntityNotFound(_0x451ea7,null))['then'](function(_0x52d113){if(_0x52d113){_0x5ee162[_0xf6e8('0x3e')]=_[_0xf6e8('0x3f')](db[_0xf6e8('0x5f')][_0xf6e8('0x34')]);_0x5ee162[_0xf6e8('0x3a')]=_['keys'](_0x2caa89[_0xf6e8('0x3a')]);_0x5ee162['filters']=_[_0xf6e8('0x9d')](_0x5ee162[_0xf6e8('0x3e')],_0x5ee162[_0xf6e8('0x3a')]);_0x213a07[_0xf6e8('0x40')]=_[_0xf6e8('0x9d')](_0x5ee162[_0xf6e8('0x3e')],qs['fields'](_0x2caa89['query'][_0xf6e8('0x41')]));_0x213a07['attributes']=_0x213a07[_0xf6e8('0x40')][_0xf6e8('0x42')]?_0x213a07['attributes']:_0x5ee162[_0xf6e8('0x3e')];if(!_0x2caa89[_0xf6e8('0x3a')][_0xf6e8('0x9e')](_0xf6e8('0x9f'))){_0x213a07[_0xf6e8('0x23')]=qs[_0xf6e8('0x23')](_0x2caa89[_0xf6e8('0x3a')]['limit']);_0x213a07[_0xf6e8('0x24')]=qs[_0xf6e8('0x24')](_0x2caa89[_0xf6e8('0x3a')][_0xf6e8('0x24')]);}_0x213a07[_0xf6e8('0xa0')]=qs[_0xf6e8('0xa1')](_0x2caa89[_0xf6e8('0x3a')]['sort']);_0x213a07[_0xf6e8('0xa2')]=qs[_0xf6e8('0xa3')](_[_0xf6e8('0xa4')](_0x2caa89[_0xf6e8('0x3a')],_0x5ee162[_0xf6e8('0xa3')]));_0x213a07[_0xf6e8('0xa2')][_0xf6e8('0xa5')]=_0x52d113['id'];if(_0x2caa89[_0xf6e8('0x3a')][_0xf6e8('0xa6')]){_0x213a07[_0xf6e8('0xa2')]=_['merge'](_0x213a07[_0xf6e8('0xa2')],{'$or':_[_0xf6e8('0x32')](_0x213a07['attributes'],function(_0x7e1ed6){var _0x3a2a5a={};_0x3a2a5a[_0x7e1ed6]={'$like':'%'+_0x2caa89['query'][_0xf6e8('0xa6')]+'%'};return _0x3a2a5a;})});}if(_0x2caa89[_0xf6e8('0x3a')]['$gte']){var _0x597e04=_0x2caa89['query'][_0xf6e8('0xa7')][_0xf6e8('0xa8')](',');var _0x9ae1c3={};_0x9ae1c3[_0x597e04[0x0]]={'$gte':moment(_0x597e04[0x1])['format'](_0xf6e8('0xa9'))};_0x213a07['where']=_['merge'](_0x213a07['where'],_0x9ae1c3);}_0x213a07=_['merge']({},_0x213a07,_0x2caa89[_0xf6e8('0x44')]);return db['ChatMessage']['count']({'where':_0x213a07[_0xf6e8('0xa2')]})[_0xf6e8('0x14')](function(_0x1f1903){_0x122a00[_0xf6e8('0x25')]=_0x1f1903;if(_0x2caa89['query']['includeAll']){_0x213a07[_0xf6e8('0xaa')]=[{'all':!![]}];}return db[_0xf6e8('0x5f')][_0xf6e8('0xab')](_0x213a07);})[_0xf6e8('0x14')](function(_0x3440d2){_0x122a00['rows']=_0x3440d2;return _0x122a00;});}})[_0xf6e8('0x14')](respondWithFilteredResult(_0x451ea7,_0x213a07))[_0xf6e8('0x1d')](handleError(_0x451ea7,null));};exports[_0xf6e8('0xac')]=function(_0x2abf38,_0x2ea641){var _0x406ce4={'where':{}},_0x583c7c={},_0xb99f4={'count':0x0,'rows':[]};return db[_0xf6e8('0x33')][_0xf6e8('0x4a')]({'where':{'id':_0x2abf38['params']['id']}})[_0xf6e8('0x14')](handleEntityNotFound(_0x2ea641,null))['then'](function(_0x2fa6fd){if(_0x2fa6fd){_0x583c7c[_0xf6e8('0x3e')]=_[_0xf6e8('0x3f')](db['ChatMessage'][_0xf6e8('0x34')]);_0x583c7c['query']=_[_0xf6e8('0x3f')](_0x2abf38['query']);_0x583c7c[_0xf6e8('0xa3')]=_['intersection'](_0x583c7c['model'],_0x583c7c['query']);_0x406ce4[_0xf6e8('0x40')]=_[_0xf6e8('0x9d')](_0x583c7c[_0xf6e8('0x3e')],qs['fields'](_0x2abf38[_0xf6e8('0x3a')][_0xf6e8('0x41')]));_0x406ce4[_0xf6e8('0x40')]=_0x406ce4[_0xf6e8('0x40')][_0xf6e8('0x42')]?_0x406ce4[_0xf6e8('0x40')]:_0x583c7c['model'];if(!_0x2abf38[_0xf6e8('0x3a')][_0xf6e8('0x9e')](_0xf6e8('0x9f'))){_0x406ce4['limit']=qs[_0xf6e8('0x23')](_0x2abf38[_0xf6e8('0x3a')][_0xf6e8('0x23')]);_0x406ce4[_0xf6e8('0x24')]=qs['offset'](_0x2abf38[_0xf6e8('0x3a')][_0xf6e8('0x24')]);}_0x406ce4[_0xf6e8('0xa0')]=qs[_0xf6e8('0xa1')](_0x2abf38['query']['sort']);_0x406ce4[_0xf6e8('0xa2')]=qs['filters'](_[_0xf6e8('0xa4')](_0x2abf38[_0xf6e8('0x3a')],_0x583c7c[_0xf6e8('0xa3')]));_0x406ce4['where'][_0xf6e8('0xa5')]=_0x2fa6fd['id'];if(_0x2abf38[_0xf6e8('0x3a')][_0xf6e8('0xa6')]){_0x406ce4[_0xf6e8('0xa2')]=_[_0xf6e8('0x2c')](_0x406ce4[_0xf6e8('0xa2')],{'$or':_[_0xf6e8('0x32')](_0x406ce4[_0xf6e8('0x40')],function(_0x4130a8){var _0x37cc22={};_0x37cc22[_0x4130a8]={'$like':'%'+_0x2abf38[_0xf6e8('0x3a')]['filter']+'%'};return _0x37cc22;})});}_0x406ce4[_0xf6e8('0xa2')][_0xf6e8('0xad')]=![];if(_0x2abf38[_0xf6e8('0x3a')]['id']){_0x406ce4[_0xf6e8('0xa2')]['id']={'$gt':_0x2abf38[_0xf6e8('0x3a')]['id']};}_0x406ce4=_[_0xf6e8('0x2c')]({},_0x406ce4,_0x2abf38['options']);return db['ChatMessage']['count']({'where':_0x406ce4[_0xf6e8('0xa2')]})[_0xf6e8('0x14')](function(_0x4ee5b2){_0xb99f4['count']=_0x4ee5b2;_0x406ce4[_0xf6e8('0xaa')]=[];if(_0x2abf38[_0xf6e8('0x3a')][_0xf6e8('0xae')]){_0x406ce4[_0xf6e8('0xaa')][_0xf6e8('0xaf')]({'model':db[_0xf6e8('0x7f')],'as':_0xf6e8('0x7f'),'attributes':['id',_0xf6e8('0x8b'),_0xf6e8('0xb0')]});}if(_0x2abf38[_0xf6e8('0x3a')][_0xf6e8('0x43')]){_0x406ce4['include']=[{'all':!![]}];}return db['ChatMessage'][_0xf6e8('0xab')](_0x406ce4);})[_0xf6e8('0x14')](function(_0x15b28c){_0xb99f4[_0xf6e8('0xb1')]=_0x15b28c;return _0xb99f4;});}})['then'](respondWithFilteredResult(_0x2ea641,_0x406ce4))[_0xf6e8('0x1d')](handleError(_0x2ea641,null));};exports[_0xf6e8('0xb2')]=function(_0x5e486d,_0x3fd7c2){return db[_0xf6e8('0x33')][_0xf6e8('0x47')]({'where':{'id':_0x5e486d['params']['id']}})['then'](handleEntityNotFound(_0x3fd7c2,null))[_0xf6e8('0x14')](function(_0x4caae0){if(_0x4caae0){return _0x4caae0[_0xf6e8('0xb3')](_0x5e486d[_0xf6e8('0x2d')]['ids'],_[_0xf6e8('0xb4')](_0x5e486d['body'],[_0xf6e8('0x9c'),'id'])||{})[_0xf6e8('0xb5')](function(){return db[_0xf6e8('0xb6')][_0xf6e8('0xab')]({'attributes':['id',_0xf6e8('0x29'),_0xf6e8('0xb7')],'where':{'id':_0x5e486d[_0xf6e8('0x2d')][_0xf6e8('0x9c')]}});})[_0xf6e8('0x14')](function(_0xfa3772){socket[_0xf6e8('0xb8')]('chatInteractionTags:save',{'id':Number(_0x5e486d[_0xf6e8('0x3d')]['id']),'tags':_0xfa3772||[]});return{'id':Number(_0x5e486d[_0xf6e8('0x3d')]['id']),'tags':_0xfa3772||[]};});}})[_0xf6e8('0x14')](respondWithResult(_0x3fd7c2,null))[_0xf6e8('0x1d')](handleError(_0x3fd7c2,null));};exports['removeTags']=function(_0x20fbc2,_0x5ae839){return db[_0xf6e8('0x33')][_0xf6e8('0x47')]({'where':{'id':_0x20fbc2[_0xf6e8('0x3d')]['id']}})[_0xf6e8('0x14')](handleEntityNotFound(_0x5ae839,null))[_0xf6e8('0x14')](function(_0x1bb33a){if(_0x1bb33a){return _0x1bb33a[_0xf6e8('0xb9')](_0x20fbc2[_0xf6e8('0x3a')][_0xf6e8('0x9c')]);}})[_0xf6e8('0x14')](respondWithStatusCode(_0x5ae839,null))[_0xf6e8('0x1d')](handleError(_0x5ae839,null));};exports[_0xf6e8('0x77')]=function(_0x597e3b,_0x2eecfa){var _0xda9469=moment()[_0xf6e8('0xba')]()[_0xf6e8('0xbb')]();var _0x58f61d=path['join'](config[_0xf6e8('0x7a')],_0xf6e8('0xbc'),_0xf6e8('0xbd'),'tmp');var _0x5c5d40=path[_0xf6e8('0x74')](config[_0xf6e8('0x7a')],'server','files','attachments');var _0x32f7ed=path['join'](_0x58f61d,_0xda9469);var _0x5cc39e=util[_0xf6e8('0x82')]('transcript-%d-%s.zip',_0x597e3b['params']['id'],_0xda9469);var _0x5627d0=path[_0xf6e8('0x74')](_0x58f61d,_0x5cc39e);var _0x683ef1=[];_0x683ef1['push']({'model':db[_0xf6e8('0x7f')],'as':_0xf6e8('0x7f'),'attributes':['id','fullname'],'raw':!![]});_0x683ef1[_0xf6e8('0xaf')]({'model':db[_0xf6e8('0xbe')],'as':_0xf6e8('0x63'),'attributes':['id','firstName',_0xf6e8('0xbf')],'raw':!![]});if(_0x597e3b['query']['attachments']){_0x683ef1[_0xf6e8('0xaf')]({'model':db[_0xf6e8('0x71')],'as':_0xf6e8('0x71'),'raw':!![]});}var _0x1b43ce=[{'model':db[_0xf6e8('0x5f')],'as':_0xf6e8('0x7e'),'attributes':['id',_0xf6e8('0x2d'),'createdAt',_0xf6e8('0x8f'),_0xf6e8('0xad'),'read'],'include':_0x683ef1}];_0x1b43ce[_0xf6e8('0xaf')]({'model':db[_0xf6e8('0x4b')],'as':_0xf6e8('0xc0'),'attributes':['id',_0xf6e8('0x29')]});_0x1b43ce[_0xf6e8('0xaf')]({'model':db[_0xf6e8('0x7f')],'as':'Owner','attributes':['id',_0xf6e8('0x8b')]});return db[_0xf6e8('0x33')]['find']({'where':{'id':_0x597e3b[_0xf6e8('0x3d')]['id']},'include':_0x1b43ce})[_0xf6e8('0x14')](handleEntityNotFound(_0x2eecfa,null))[_0xf6e8('0x14')](function(_0x2fb3fb){if(_0x2fb3fb){var _0x322220=_0x2fb3fb['get']({'plain':!![]});fs[_0xf6e8('0xc1')](_0x32f7ed);var _0x511f22={'channel':_0xf6e8('0xc2'),'account':_0x322220['Account'][_0xf6e8('0x29')],'agent':_0x322220[_0xf6e8('0xc3')]?_0x322220[_0xf6e8('0xc3')][_0xf6e8('0x8b')]:_0xf6e8('0xc4'),'createdAt':moment(_0x322220[_0xf6e8('0x8e')])[_0xf6e8('0x82')](_0xf6e8('0xa9'))[_0xf6e8('0xbb')](),'closedAt':_0x322220[_0xf6e8('0x69')]?moment(_0x322220['closedAt'])[_0xf6e8('0x82')](_0xf6e8('0xa9'))[_0xf6e8('0xbb')]():'','disposition':_0x322220[_0xf6e8('0x6a')],'chatInfo':{'browser':_0x322220['browserName'],'os':_0x322220[_0xf6e8('0xc5')],'referer':_0x322220[_0xf6e8('0xc6')],'customerIp':_0x322220[_0xf6e8('0xc7')],'customerPort':_0x322220['customerPort']?_0x322220['customerPort']:_0xf6e8('0xc4')},'messages':_(_0x322220[_0xf6e8('0x7e')])['tail']()[_0xf6e8('0xa6')]({'secret':![]})[_0xf6e8('0x32')](function(_0x59782e){if(_0x59782e[_0xf6e8('0x71')]){var _0x2c8225=path[_0xf6e8('0x74')](_0x5c5d40,_0x59782e['Attachment'][_0xf6e8('0x6d')]);if(fs[_0xf6e8('0xc8')](_0x2c8225)){fs[_0xf6e8('0xc9')](_0x2c8225)[_0xf6e8('0xca')](fs[_0xf6e8('0xcb')](path[_0xf6e8('0x74')](_0x32f7ed,_0x59782e[_0xf6e8('0x71')][_0xf6e8('0x6d')])));}}return{'date':moment(_0x59782e[_0xf6e8('0x8e')])[_0xf6e8('0x82')](_0xf6e8('0xa9'))['toString'](),'sender':_0x59782e[_0xf6e8('0x8f')]===_0xf6e8('0x5e')?_0x59782e[_0xf6e8('0x7f')]?_0x59782e['User'][_0xf6e8('0x8b')]:_0xf6e8('0x84'):_0x59782e[_0xf6e8('0x63')]['firstName']+(_0x59782e[_0xf6e8('0x63')]['lastName']?'\x20'+_0x59782e['Contact'][_0xf6e8('0xbf')]:''),'body':_0x59782e['Attachment']?_0x59782e[_0xf6e8('0x71')]['basename']:_0x59782e['body'],'direction':_0x59782e[_0xf6e8('0x8f')]==='out'?'A':'C','secret':_0x59782e[_0xf6e8('0xad')],'read':_0x59782e['read'],'attachment':_0x59782e['Attachment']};})[_0xf6e8('0xcc')]()};return ejs[_0xf6e8('0xcd')](path[_0xf6e8('0x74')](config[_0xf6e8('0x7a')],_0xf6e8('0xbc'),'views','downloadInteraction.ejs'),{'interaction':_0x511f22})[_0xf6e8('0x14')](function(_0x15d32f){var _0x14e785=path[_0xf6e8('0x74')](_0x32f7ed,'transcript-'+_0x322220['id']+'-'+_0xda9469+_0xf6e8('0xce'));var _0x166fc0={'path':_0x14e785,'channel':_0xf6e8('0xc2'),'interactionId':_0x322220['id']};return pdf['createPdfFromHTML'](_0x15d32f,_0x166fc0);})['then'](function(){return new Promise(function(_0x3efb1b,_0x1c6439){zipdir(_0x32f7ed,{'saveTo':_0x5627d0},function(_0x2ae667,_0x14cad5){if(_0x2ae667)return _0x1c6439(_0x2ae667);return _0x3efb1b(_0x14cad5);});})[_0xf6e8('0x14')](function(){return new BPromise(function(_0x3abad9,_0x33595a){rimraf(_0x32f7ed,function(_0xfa6e11){if(_0xfa6e11)_0x33595a(_0xfa6e11);return _0x3abad9();});});})[_0xf6e8('0x14')](function(){return _0x2eecfa[_0xf6e8('0x77')](_0x5627d0,_0x5cc39e,function(_0x57ed03){if(_0x57ed03){logger[_0xf6e8('0x1b')](_0xf6e8('0xcf'),_0x57ed03);}else{fs[_0xf6e8('0xd0')](_0x5627d0);}});});});}else{return _0x2eecfa[_0xf6e8('0x1e')](0xc8);}})[_0xf6e8('0x1d')](handleError(_0x2eecfa,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 2235edd..9e6d756 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 _0xa273=['getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove'];(function(_0xf49f22,_0x6ee4cf){var _0x3b7136=function(_0x3b0b22){while(--_0x3b0b22){_0xf49f22['push'](_0xf49f22['shift']());}};_0x3b7136(++_0x6ee4cf);}(_0xa273,0x1e7));var _0x3a27=function(_0x3cb704,_0x24fbb4){_0x3cb704=_0x3cb704-0x0;var _0x216b57=_0xa273[_0x3cb704];return _0x216b57;};'use strict';var EventEmitter=require(_0x3a27('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x3a27('0x1'))['db'][_0x3a27('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3a27('0x3')](0x0);var events={'afterCreate':_0x3a27('0x4'),'afterUpdate':'update','afterDestroy':_0x3a27('0x5')};function emitEvent(_0xee8c89){return function(_0x2759b0,_0x2e547b,_0x291555){_0x2759b0[_0x3a27('0x6')]({'attributes':['id'],'raw':!![]})[_0x3a27('0x7')](function(_0x230534){_0x2759b0['setDataValue'](_0x3a27('0x8'),_0x230534[_0x3a27('0x9')](function(_0x2ff5ba){return{'id':_0x2ff5ba['id']};}));return ChatMessage[_0x3a27('0xa')]({'where':{'ChatInteractionId':_0x2759b0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3a27('0x7')](function(_0x49e23e){_0x2759b0[_0x3a27('0xb')](_0x3a27('0xc'),_0x49e23e[_0x3a27('0xd')]);ChatInteractionEvents[_0x3a27('0xe')](_0xee8c89+':'+_0x2759b0['id'],_0x2759b0);ChatInteractionEvents[_0x3a27('0xe')](_0xee8c89,_0x2759b0);_0x291555(null);})[_0x3a27('0xf')](_0x291555(null));};}for(var e in events){if(events[_0x3a27('0x10')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x39f2=['setMaxListeners','save','update','remove','then','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','exports','../../mysqldb','ChatInteraction'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x39f2,0x166));var _0x239f=function(_0x828773,_0x1117a){_0x828773=_0x828773-0x0;var _0x216ad6=_0x39f2[_0x828773];return _0x216ad6;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x239f('0x0'))['db'][_0x239f('0x1')];var ChatMessage=require(_0x239f('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x239f('0x2')](0x0);var events={'afterCreate':_0x239f('0x3'),'afterUpdate':_0x239f('0x4'),'afterDestroy':_0x239f('0x5')};function emitEvent(_0x373290){return function(_0x310854,_0x256309,_0x505831){_0x310854['getUsers']({'attributes':['id'],'raw':!![]})[_0x239f('0x6')](function(_0x16f060){_0x310854['setDataValue'](_0x239f('0x7'),_0x16f060[_0x239f('0x8')](function(_0x545d72){return{'id':_0x545d72['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x310854['id'],'direction':'in','read':![]},'raw':!![]});})[_0x239f('0x6')](function(_0x341675){_0x310854['setDataValue'](_0x239f('0x9'),_0x341675[_0x239f('0xa')]);ChatInteractionEvents['emit'](_0x373290+':'+_0x310854['id'],_0x310854);ChatInteractionEvents[_0x239f('0xb')](_0x373290,_0x310854);_0x505831(null);})[_0x239f('0xc')](_0x505831(null));};}for(var e in events){if(events[_0x239f('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x239f('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 96ccdbb..8d2d039 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 _0x5934=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','util','../../config/logger'];(function(_0x476402,_0x1afd41){var _0x2b088f=function(_0x2e975a){while(--_0x2e975a){_0x476402['push'](_0x476402['shift']());}};_0x2b088f(++_0x1afd41);}(_0x5934,0x1ec));var _0x4593=function(_0x2b3040,_0x371507){_0x2b3040=_0x2b3040-0x0;var _0x415fed=_0x5934[_0x2b3040];return _0x415fed;};'use strict';var _=require('lodash');var util=require(_0x4593('0x0'));var logger=require(_0x4593('0x1'))(_0x4593('0x2'));var moment=require(_0x4593('0x3'));var BPromise=require(_0x4593('0x4'));var rp=require(_0x4593('0x5'));var fs=require('fs');var path=require(_0x4593('0x6'));var rimraf=require(_0x4593('0x7'));var config=require(_0x4593('0x8'));var attributes=require(_0x4593('0x9'));module[_0x4593('0xa')]=function(_0x973ee1,_0xe1fb6b){return _0x973ee1[_0x4593('0xb')](_0x4593('0xc'),attributes,{'tableName':_0x4593('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x31ed94,_0xb17c74,_0x1f9161){if(_0x31ed94['changed'](_0x4593('0xe'))){_0x31ed94[_0x4593('0xf')]=moment()[_0x4593('0x10')](_0x4593('0x11'));}_0x1f9161(null,_0x31ed94);}},'charset':_0x4593('0x12'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x32f1=['moment','request-promise','path','rimraf','./chatInteraction.attributes','exports','closedAt','utf8mb4','lodash','../../config/logger','api'];(function(_0x1ef183,_0x341141){var _0x7fd9e2=function(_0x58d089){while(--_0x58d089){_0x1ef183['push'](_0x1ef183['shift']());}};_0x7fd9e2(++_0x341141);}(_0x32f1,0xd9));var _0x132f=function(_0x469739,_0x40eab1){_0x469739=_0x469739-0x0;var _0x3e23fb=_0x32f1[_0x469739];return _0x3e23fb;};'use strict';var _=require(_0x132f('0x0'));var util=require('util');var logger=require(_0x132f('0x1'))(_0x132f('0x2'));var moment=require(_0x132f('0x3'));var BPromise=require('bluebird');var rp=require(_0x132f('0x4'));var fs=require('fs');var path=require(_0x132f('0x5'));var rimraf=require(_0x132f('0x6'));var config=require('../../config/environment');var attributes=require(_0x132f('0x7'));module[_0x132f('0x8')]=function(_0x304b27,_0x1676ea){return _0x304b27['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b247a,_0xb03c2f,_0x4b2ec1){if(_0x4b247a['changed']('closed')){_0x4b247a[_0x132f('0x9')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4b2ec1(null,_0x4b247a);}},'charset':_0x132f('0xa'),'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 53e1a3d..164c8fe 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 _0x41be=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','info','debug','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','body','options','where','attributes','then','UpdateChatInteraction','ChatInteraction','find','addTags','ids','spread','AddTags'];(function(_0x41bb2d,_0x534f1f){var _0x23b677=function(_0x4f53de){while(--_0x4f53de){_0x41bb2d['push'](_0x41bb2d['shift']());}};_0x23b677(++_0x534f1f);}(_0x41be,0x186));var _0xe41b=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x41be[_0x3ea913];return _0x2b4f28;};'use strict';var _=require(_0xe41b('0x0'));var util=require(_0xe41b('0x1'));var moment=require(_0xe41b('0x2'));var BPromise=require(_0xe41b('0x3'));var rs=require(_0xe41b('0x4'));var fs=require('fs');var Redis=require(_0xe41b('0x5'));var db=require(_0xe41b('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe41b('0x7'));var jayson=require(_0xe41b('0x8'));var client=jayson[_0xe41b('0x9')][_0xe41b('0xa')]({'port':0x232a});config[_0xe41b('0xb')]=_[_0xe41b('0xc')](config['redis'],{'host':_0xe41b('0xd'),'port':0x18eb});var socket=require(_0xe41b('0xe'))(new Redis(config['redis']));require(_0xe41b('0xf'))[_0xe41b('0x10')](socket);function respondWithRpcPromise(_0x455088,_0x404832,_0x2ae5e1){return new BPromise(function(_0x380cfa,_0x4c5132){return client['request'](_0x455088,_0x2ae5e1)['then'](function(_0x367cd1){logger[_0xe41b('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x404832,'request\x20sent');logger[_0xe41b('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x404832,_0xe41b('0x13'),JSON[_0xe41b('0x14')](_0x367cd1));if(_0x367cd1[_0xe41b('0x15')]){if(_0x367cd1[_0xe41b('0x15')][_0xe41b('0x16')]===0x1f4){logger[_0xe41b('0x15')](_0xe41b('0x17'),_0x404832,_0x367cd1[_0xe41b('0x15')][_0xe41b('0x18')]);return _0x4c5132(_0x367cd1['error'][_0xe41b('0x18')]);}logger['error'](_0xe41b('0x17'),_0x404832,_0x367cd1['error'][_0xe41b('0x18')]);return _0x380cfa(_0x367cd1[_0xe41b('0x15')][_0xe41b('0x18')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x404832,_0xe41b('0x13'));_0x380cfa(_0x367cd1[_0xe41b('0x19')][_0xe41b('0x18')]);}})[_0xe41b('0x1a')](function(_0x488efa){logger['error'](_0xe41b('0x17'),_0x404832,_0x488efa);_0x4c5132(_0x488efa);});});}exports['UpdateChatInteraction']=function(_0x36f7fc){var _0x5103ac=this;return new Promise(function(_0x24dfc1,_0x27c967){return db['ChatInteraction']['update'](_0x36f7fc[_0xe41b('0x1b')],{'raw':_0x36f7fc[_0xe41b('0x1c')]?_0x36f7fc[_0xe41b('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36f7fc['options']?_0x36f7fc[_0xe41b('0x1c')][_0xe41b('0x1d')]||null:null,'attributes':_0x36f7fc[_0xe41b('0x1c')]?_0x36f7fc[_0xe41b('0x1c')][_0xe41b('0x1e')]||null:null,'limit':_0x36f7fc[_0xe41b('0x1c')]?_0x36f7fc[_0xe41b('0x1c')]['limit']||null:null})[_0xe41b('0x1f')](function(_0x299444){logger[_0xe41b('0x11')](_0xe41b('0x20'),_0x36f7fc);logger[_0xe41b('0x12')](_0xe41b('0x20'),_0x36f7fc,JSON[_0xe41b('0x14')](_0x299444));_0x24dfc1(_0x299444);})[_0xe41b('0x1a')](function(_0x455379){logger[_0xe41b('0x15')](_0xe41b('0x20'),_0x455379[_0xe41b('0x18')],_0x36f7fc);_0x27c967(_0x5103ac['error'](0x1f4,_0x455379[_0xe41b('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x1861f6){return new Promise(function(_0x379d7e,_0x36ac72){return db[_0xe41b('0x21')][_0xe41b('0x22')]({'where':_0x1861f6[_0xe41b('0x1c')]?_0x1861f6[_0xe41b('0x1c')][_0xe41b('0x1d')]||null:null})[_0xe41b('0x1f')](function(_0x495b6e){if(_0x495b6e){return _0x495b6e[_0xe41b('0x23')](_0x1861f6[_0xe41b('0x1b')][_0xe41b('0x24')],_['omit'](_0x1861f6[_0xe41b('0x1b')],[_0xe41b('0x24'),'id'])||{});}})[_0xe41b('0x25')](function(_0x2a5cc2){logger[_0xe41b('0x11')](_0xe41b('0x26'),_0x1861f6);logger[_0xe41b('0x12')](_0xe41b('0x26'),_0x1861f6,JSON[_0xe41b('0x14')](_0x2a5cc2));_0x379d7e(_0x2a5cc2);})[_0xe41b('0x1a')](function(_0x5e823d){logger['error'](_0xe41b('0x26'),_0x5e823d[_0xe41b('0x18')],_0x1861f6);_0x36ac72(_this[_0xe41b('0x15')](0x1f4,_0x5e823d[_0xe41b('0x18')]));});});};
\ No newline at end of file
+var _0xc673=['jayson/promise','http','defaults','localhost','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ChatInteraction','update','body','options','raw','where','debug','UpdateChatInteraction','AddTagsToChatInteraction','addTags','ids','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2d8143,_0x26e147){var _0x118f5f=function(_0x114eb2){while(--_0x114eb2){_0x2d8143['push'](_0x2d8143['shift']());}};_0x118f5f(++_0x26e147);}(_0xc673,0xe0));var _0x3c67=function(_0x5df995,_0x269f1e){_0x5df995=_0x5df995-0x0;var _0x4b10a6=_0xc673[_0x5df995];return _0x4b10a6;};'use strict';var _=require(_0x3c67('0x0'));var util=require(_0x3c67('0x1'));var moment=require('moment');var BPromise=require(_0x3c67('0x2'));var rs=require(_0x3c67('0x3'));var fs=require('fs');var Redis=require(_0x3c67('0x4'));var db=require(_0x3c67('0x5'))['db'];var utils=require(_0x3c67('0x6'));var logger=require(_0x3c67('0x7'))(_0x3c67('0x8'));var config=require(_0x3c67('0x9'));var jayson=require(_0x3c67('0xa'));var client=jayson['client'][_0x3c67('0xb')]({'port':0x232a});config['redis']=_[_0x3c67('0xc')](config['redis'],{'host':_0x3c67('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c67('0xe')]));require(_0x3c67('0xf'))[_0x3c67('0x10')](socket);function respondWithRpcPromise(_0x5395cd,_0x42ae0a,_0x21fdcb){return new BPromise(function(_0x1dc297,_0x336320){return client[_0x3c67('0x11')](_0x5395cd,_0x21fdcb)[_0x3c67('0x12')](function(_0x3d2ef7){logger[_0x3c67('0x13')](_0x3c67('0x14'),_0x42ae0a,_0x3c67('0x15'));logger['debug'](_0x3c67('0x16'),_0x42ae0a,_0x3c67('0x15'),JSON[_0x3c67('0x17')](_0x3d2ef7));if(_0x3d2ef7[_0x3c67('0x18')]){if(_0x3d2ef7['error']['code']===0x1f4){logger[_0x3c67('0x18')](_0x3c67('0x14'),_0x42ae0a,_0x3d2ef7[_0x3c67('0x18')][_0x3c67('0x19')]);return _0x336320(_0x3d2ef7['error'][_0x3c67('0x19')]);}logger[_0x3c67('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x42ae0a,_0x3d2ef7[_0x3c67('0x18')][_0x3c67('0x19')]);return _0x1dc297(_0x3d2ef7[_0x3c67('0x18')][_0x3c67('0x19')]);}else{logger[_0x3c67('0x13')](_0x3c67('0x14'),_0x42ae0a,_0x3c67('0x15'));_0x1dc297(_0x3d2ef7['result'][_0x3c67('0x19')]);}})[_0x3c67('0x1a')](function(_0x3bb967){logger['error'](_0x3c67('0x14'),_0x42ae0a,_0x3bb967);_0x336320(_0x3bb967);});});}exports['UpdateChatInteraction']=function(_0x3586e2){var _0x2c595a=this;return new Promise(function(_0x485004,_0x30042c){return db[_0x3c67('0x1b')][_0x3c67('0x1c')](_0x3586e2[_0x3c67('0x1d')],{'raw':_0x3586e2['options']?_0x3586e2[_0x3c67('0x1e')][_0x3c67('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3586e2[_0x3c67('0x1e')]?_0x3586e2[_0x3c67('0x1e')][_0x3c67('0x20')]||null:null,'attributes':_0x3586e2[_0x3c67('0x1e')]?_0x3586e2[_0x3c67('0x1e')]['attributes']||null:null,'limit':_0x3586e2[_0x3c67('0x1e')]?_0x3586e2[_0x3c67('0x1e')]['limit']||null:null})['then'](function(_0x2f503b){logger['info']('UpdateChatInteraction',_0x3586e2);logger[_0x3c67('0x21')](_0x3c67('0x22'),_0x3586e2,JSON[_0x3c67('0x17')](_0x2f503b));_0x485004(_0x2f503b);})[_0x3c67('0x1a')](function(_0x13f4f3){logger[_0x3c67('0x18')](_0x3c67('0x22'),_0x13f4f3[_0x3c67('0x19')],_0x3586e2);_0x30042c(_0x2c595a[_0x3c67('0x18')](0x1f4,_0x13f4f3[_0x3c67('0x19')]));});});};exports[_0x3c67('0x23')]=function(_0x4bcafd){return new Promise(function(_0x142dea,_0x29fc70){return db['ChatInteraction']['find']({'where':_0x4bcafd[_0x3c67('0x1e')]?_0x4bcafd[_0x3c67('0x1e')][_0x3c67('0x20')]||null:null})[_0x3c67('0x12')](function(_0x29827f){if(_0x29827f){return _0x29827f[_0x3c67('0x24')](_0x4bcafd[_0x3c67('0x1d')][_0x3c67('0x25')],_['omit'](_0x4bcafd[_0x3c67('0x1d')],['ids','id'])||{});}})['spread'](function(_0x260523){logger[_0x3c67('0x13')]('AddTags',_0x4bcafd);logger[_0x3c67('0x21')](_0x3c67('0x26'),_0x4bcafd,JSON[_0x3c67('0x17')](_0x260523));_0x142dea(_0x260523);})[_0x3c67('0x1a')](function(_0x3342a5){logger[_0x3c67('0x18')](_0x3c67('0x26'),_0x3342a5['message'],_0x4bcafd);_0x29fc70(_this[_0x3c67('0x18')](0x1f4,_0x3342a5[_0x3c67('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 0d3871b..d63a246 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 _0x8b91=['emit','removeListener','register','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x5e20f6,_0x427b74){var _0x4e96d3=function(_0x1a7d3d){while(--_0x1a7d3d){_0x5e20f6['push'](_0x5e20f6['shift']());}};_0x4e96d3(++_0x427b74);}(_0x8b91,0x17e));var _0x18b9=function(_0x1c0abe,_0x28a701){_0x1c0abe=_0x1c0abe-0x0;var _0x24d9bf=_0x8b91[_0x1c0abe];return _0x24d9bf;};'use strict';var ChatInteractionEvents=require(_0x18b9('0x0'));var events=[_0x18b9('0x1'),_0x18b9('0x2'),'update'];function createListener(_0x194721,_0x3fb7d4){return function(_0xfeb4d3){_0x3fb7d4[_0x18b9('0x3')](_0x194721,_0xfeb4d3);};}function removeListener(_0xa87b43,_0x4071e3){return function(){ChatInteractionEvents[_0x18b9('0x4')](_0xa87b43,_0x4071e3);};}exports[_0x18b9('0x5')]=function(_0x10aa74){for(var _0x1c4e97=0x0,_0x4990c5=events['length'];_0x1c4e97<_0x4990c5;_0x1c4e97++){var _0x1839cf=events[_0x1c4e97];var _0x45dfcd=createListener(_0x18b9('0x6')+_0x1839cf,_0x10aa74);ChatInteractionEvents['on'](_0x1839cf,_0x45dfcd);}};
\ No newline at end of file
+var _0xbb50=['./chatInteraction.events','save','remove','update','emit','removeListener','length','chatInteraction:'];(function(_0x183196,_0x29bbb7){var _0x1d4d69=function(_0x4c2ba6){while(--_0x4c2ba6){_0x183196['push'](_0x183196['shift']());}};_0x1d4d69(++_0x29bbb7);}(_0xbb50,0x1d8));var _0x0bb5=function(_0x2d6138,_0x219734){_0x2d6138=_0x2d6138-0x0;var _0x55eb00=_0xbb50[_0x2d6138];return _0x55eb00;};'use strict';var ChatInteractionEvents=require(_0x0bb5('0x0'));var events=[_0x0bb5('0x1'),_0x0bb5('0x2'),_0x0bb5('0x3')];function createListener(_0x2bdf96,_0x51b347){return function(_0x53cd77){_0x51b347[_0x0bb5('0x4')](_0x2bdf96,_0x53cd77);};}function removeListener(_0x23ebdc,_0x5418c4){return function(){ChatInteractionEvents[_0x0bb5('0x5')](_0x23ebdc,_0x5418c4);};}exports['register']=function(_0x4e5835){for(var _0x26ddcc=0x0,_0x392049=events[_0x0bb5('0x6')];_0x26ddcc<_0x392049;_0x26ddcc++){var _0x2dfac9=events[_0x26ddcc];var _0xbf56=createListener(_0x0bb5('0x7')+_0x2dfac9,_0x4e5835);ChatInteractionEvents['on'](_0x2dfac9,_0xbf56);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 4405cd2..54b9590 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 _0xc3f2=['originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/close','close','chatinteraction:destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now'];(function(_0x449cee,_0x3d88b0){var _0x58de0a=function(_0x3636a6){while(--_0x3636a6){_0x449cee['push'](_0x449cee['shift']());}};_0x58de0a(++_0x3d88b0);}(_0xc3f2,0x144));var _0x2c3f=function(_0x5c9c01,_0x2d2fc5){_0x5c9c01=_0x5c9c01-0x0;var _0xee7501=_0xc3f2[_0x5c9c01];return _0xee7501;};'use strict';var multer=require(_0x2c3f('0x0'));var util=require('util');var path=require(_0x2c3f('0x1'));var timeout=require('connect-timeout');var express=require(_0x2c3f('0x2'));var router=express[_0x2c3f('0x3')]();var fs_extra=require(_0x2c3f('0x4'));var auth=require(_0x2c3f('0x5'));var interaction=require(_0x2c3f('0x6'));var config=require(_0x2c3f('0x7'));var controller=require(_0x2c3f('0x8'));router[_0x2c3f('0x9')]('/',auth[_0x2c3f('0xa')](),controller[_0x2c3f('0xb')]);router['get']('/describe',auth[_0x2c3f('0xa')](),controller[_0x2c3f('0xc')]);router[_0x2c3f('0x9')](_0x2c3f('0xd'),auth[_0x2c3f('0xe')](),controller[_0x2c3f('0xf')]);router[_0x2c3f('0x9')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x2c3f('0x10')]);router[_0x2c3f('0x9')](_0x2c3f('0x11'),auth[_0x2c3f('0xa')](),controller[_0x2c3f('0x12')]);router['get'](_0x2c3f('0x13'),auth[_0x2c3f('0xe')](),controller[_0x2c3f('0x14')]);router[_0x2c3f('0x9')](_0x2c3f('0x15'),auth['isAuthenticated'](),controller[_0x2c3f('0x16')]);router[_0x2c3f('0x17')]('/',auth['isAuthenticated'](),controller[_0x2c3f('0x18')]);router[_0x2c3f('0x17')](_0x2c3f('0x19'),auth[_0x2c3f('0xa')](),controller[_0x2c3f('0x1a')]);var upload=multer({'storage':multer[_0x2c3f('0x1b')]({'destination':function(_0x146ec6,_0x432c19,_0x1c0025){_0x1c0025(null,path[_0x2c3f('0x1c')](config[_0x2c3f('0x1d')],_0x2c3f('0x1e')));},'filename':function(_0x1c8124,_0x3a0770,_0x1c25ea){_0x1c25ea(null,util['format'](_0x2c3f('0x1f'),Date[_0x2c3f('0x20')](),_0x3a0770[_0x2c3f('0x21')][_0x2c3f('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2c3f('0x17')](_0x2c3f('0x23'),upload[_0x2c3f('0x24')](_0x2c3f('0x25')),controller[_0x2c3f('0x26')]);router['post']('/:id/messages',auth[_0x2c3f('0xe')](),controller[_0x2c3f('0x27')]);router['post'](_0x2c3f('0x28'),auth['isAuthenticated'](),interaction[_0x2c3f('0x29')](_0x2c3f('0x2a'),'chatinteraction:addtags'),controller[_0x2c3f('0x2b')]);router[_0x2c3f('0x2c')](_0x2c3f('0xd'),auth[_0x2c3f('0xa')](),interaction[_0x2c3f('0x29')](_0x2c3f('0x2a'),_0x2c3f('0x2d')),controller[_0x2c3f('0x2e')]);router['put'](_0x2c3f('0x2f'),controller['customUpdate']);router[_0x2c3f('0x2c')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0x2c3f('0x2c')](_0x2c3f('0x30'),controller[_0x2c3f('0x31')]);router['delete']('/:id',auth[_0x2c3f('0xa')](),interaction[_0x2c3f('0x29')](_0x2c3f('0x2a'),_0x2c3f('0x32')),controller['destroy']);router['delete'](_0x2c3f('0x28'),auth[_0x2c3f('0xa')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0x89f0=['/:id/attachment_upload','single','attachmentUpload','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','isChatInteractionAuthorized','getMyMessages','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace'];(function(_0x1e2f72,_0x4ecd3d){var _0x2f00a8=function(_0xf1ee63){while(--_0xf1ee63){_0x1e2f72['push'](_0x1e2f72['shift']());}};_0x2f00a8(++_0x4ecd3d);}(_0x89f0,0xb9));var _0x089f=function(_0xe80a60,_0x482e2b){_0xe80a60=_0xe80a60-0x0;var _0x2cca08=_0x89f0[_0xe80a60];return _0x2cca08;};'use strict';var multer=require(_0x089f('0x0'));var util=require(_0x089f('0x1'));var path=require(_0x089f('0x2'));var timeout=require(_0x089f('0x3'));var express=require(_0x089f('0x4'));var router=express[_0x089f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x089f('0x6'));var interaction=require(_0x089f('0x7'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x089f('0x8')]('/',auth[_0x089f('0x9')](),controller[_0x089f('0xa')]);router[_0x089f('0x8')](_0x089f('0xb'),auth[_0x089f('0x9')](),controller[_0x089f('0xc')]);router[_0x089f('0x8')](_0x089f('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x089f('0xe')]);router['get'](_0x089f('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x089f('0x10')]);router[_0x089f('0x8')](_0x089f('0x11'),auth[_0x089f('0x9')](),controller[_0x089f('0x12')]);router[_0x089f('0x8')](_0x089f('0x13'),auth[_0x089f('0x14')](),controller[_0x089f('0x15')]);router[_0x089f('0x8')]('/:id/download',auth[_0x089f('0x9')](),controller[_0x089f('0x16')]);router[_0x089f('0x17')]('/',auth[_0x089f('0x9')](),controller[_0x089f('0x18')]);router[_0x089f('0x17')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x089f('0x19')]);var upload=multer({'storage':multer[_0x089f('0x1a')]({'destination':function(_0x7875d0,_0x38a3ed,_0x3e073b){_0x3e073b(null,path[_0x089f('0x1b')](config[_0x089f('0x1c')],_0x089f('0x1d')));},'filename':function(_0x2f8337,_0x11f3bb,_0x30dc55){_0x30dc55(null,util[_0x089f('0x1e')](_0x089f('0x1f'),Date[_0x089f('0x20')](),_0x11f3bb[_0x089f('0x21')][_0x089f('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x089f('0x17')](_0x089f('0x23'),upload[_0x089f('0x24')]('file'),controller[_0x089f('0x25')]);router['post']('/:id/messages',auth[_0x089f('0x14')](),controller['addMessage']);router[_0x089f('0x17')](_0x089f('0x26'),auth[_0x089f('0x9')](),interaction['tracked']('chat',_0x089f('0x27')),controller[_0x089f('0x28')]);router[_0x089f('0x29')]('/:id',auth[_0x089f('0x9')](),interaction[_0x089f('0x2a')](_0x089f('0x2b'),'chatinteraction:update'),controller[_0x089f('0x2c')]);router['put'](_0x089f('0x2d'),controller[_0x089f('0x2e')]);router['put'](_0x089f('0x2f'),auth[_0x089f('0x14')](),controller[_0x089f('0x30')]);router[_0x089f('0x29')](_0x089f('0x31'),controller[_0x089f('0x32')]);router[_0x089f('0x33')](_0x089f('0xd'),auth[_0x089f('0x9')](),interaction[_0x089f('0x2a')](_0x089f('0x2b'),'chatinteraction:destroy'),controller[_0x089f('0x34')]);router[_0x089f('0x33')](_0x089f('0x26'),auth[_0x089f('0x9')](),controller[_0x089f('0x35')]);module[_0x089f('0x36')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index c205d55..f6d0e2c 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 _0x8ff2=['sequelize','exports','TEXT','medium'];(function(_0x45ad2b,_0x50d0b9){var _0x289a91=function(_0x2daa30){while(--_0x2daa30){_0x45ad2b['push'](_0x45ad2b['shift']());}};_0x289a91(++_0x50d0b9);}(_0x8ff2,0x190));var _0x28ff=function(_0x5a699d,_0x3327e7){_0x5a699d=_0x5a699d-0x0;var _0x2101f9=_0x8ff2[_0x5a699d];return _0x2101f9;};'use strict';var Sequelize=require(_0x28ff('0x0'));module[_0x28ff('0x1')]={'body':{'type':Sequelize[_0x28ff('0x2')](_0x28ff('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x48b2=['INTEGER','sequelize','exports','TEXT','BOOLEAN'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x48b2,0x173));var _0x248b=function(_0x4ac0cb,_0x53672c){_0x4ac0cb=_0x4ac0cb-0x0;var _0x2d28b6=_0x48b2[_0x4ac0cb];return _0x2d28b6;};'use strict';var Sequelize=require(_0x248b('0x0'));module[_0x248b('0x1')]={'body':{'type':Sequelize[_0x248b('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x248b('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x248b('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 22978ec..51378d6 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 _0x7e88=['options','ChatInternalMessage','includeAll','include','findAll','catch','show','params','intersection','find','create','body','describe','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','role','userpic','internal','online','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','name','send','map','rawAttributes','type','key','keys','model','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e88,0x1d6));var _0x87e8=function(_0x36ff64,_0x9f727a){_0x36ff64=_0x36ff64-0x0;var _0x4ac4b6=_0x7e88[_0x36ff64];return _0x4ac4b6;};'use strict';var emlformat=require(_0x87e8('0x0'));var rimraf=require(_0x87e8('0x1'));var zipdir=require(_0x87e8('0x2'));var jsonpatch=require(_0x87e8('0x3'));var rp=require('request-promise');var moment=require(_0x87e8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x87e8('0x5'));var path=require(_0x87e8('0x6'));var sox=require(_0x87e8('0x7'));var csv=require('to-csv');var ejs=require(_0x87e8('0x8'));var fs=require('fs');var fs_extra=require(_0x87e8('0x9'));var _=require(_0x87e8('0xa'));var squel=require(_0x87e8('0xb'));var crypto=require('crypto');var jsforce=require(_0x87e8('0xc'));var deskjs=require(_0x87e8('0xd'));var toCsv=require(_0x87e8('0xe'));var querystring=require(_0x87e8('0xf'));var Papa=require(_0x87e8('0x10'));var Redis=require('ioredis');var authService=require(_0x87e8('0x11'));var qs=require(_0x87e8('0x12'));var as=require(_0x87e8('0x13'));var hardwareService=require(_0x87e8('0x14'));var logger=require('../../config/logger')(_0x87e8('0x15'));var utils=require('../../config/utils');var config=require(_0x87e8('0x16'));var licenseUtil=require(_0x87e8('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x87e8('0x18')],{'host':_0x87e8('0x19'),'port':0x18eb});var socket=require(_0x87e8('0x1a'))(new Redis(config[_0x87e8('0x18')]));require(_0x87e8('0x1b'))[_0x87e8('0x1c')](socket);function respondWithStatusCode(_0x36d87d,_0x348486){_0x348486=_0x348486||0xcc;return function(_0x6d918c){if(_0x6d918c){return _0x36d87d[_0x87e8('0x1d')](_0x348486);}return _0x36d87d['status'](_0x348486)[_0x87e8('0x1e')]();};}function respondWithResult(_0x161205,_0x4359d3){_0x4359d3=_0x4359d3||0xc8;return function(_0x321a1b){if(_0x321a1b){return _0x161205[_0x87e8('0x1f')](_0x4359d3)[_0x87e8('0x20')](_0x321a1b);}};}function respondWithFilteredResult(_0x4aab58,_0x34e798){return function(_0x2e430d){if(_0x2e430d){var _0x33d72e=typeof _0x34e798[_0x87e8('0x21')]===_0x87e8('0x22')&&typeof _0x34e798[_0x87e8('0x23')]===_0x87e8('0x22');var _0x5039bf=_0x2e430d[_0x87e8('0x24')];var _0x9a8e2f=_0x33d72e?0x0:_0x34e798[_0x87e8('0x21')];var _0x5969d1=_0x33d72e?_0x2e430d['count']:_0x34e798['offset']+_0x34e798[_0x87e8('0x23')];var _0xa74854;if(_0x5969d1>=_0x5039bf){_0x5969d1=_0x5039bf;_0xa74854=0xc8;}else{_0xa74854=0xce;}_0x4aab58[_0x87e8('0x1f')](_0xa74854);return _0x4aab58[_0x87e8('0x25')]('Content-Range',_0x9a8e2f+'-'+_0x5969d1+'/'+_0x5039bf)['json'](_0x2e430d);}return null;};}function patchUpdates(_0x5657e6){return function(_0x4bdc30){try{jsonpatch[_0x87e8('0x26')](_0x4bdc30,_0x5657e6,!![]);}catch(_0xc0c843){return BPromise[_0x87e8('0x27')](_0xc0c843);}return _0x4bdc30[_0x87e8('0x28')]();};}function saveUpdates(_0x5dac13,_0x31e112){return function(_0x4b3437){if(_0x4b3437){return _0x4b3437[_0x87e8('0x29')](_0x5dac13)['then'](function(_0x1681a2){return _0x1681a2;});}return null;};}function removeEntity(_0x2f53af,_0x3b291a){return function(_0x1f0b9a){if(_0x1f0b9a){return _0x1f0b9a[_0x87e8('0x2a')]()[_0x87e8('0x2b')](function(){_0x2f53af[_0x87e8('0x1f')](0xcc)[_0x87e8('0x1e')]();});}};}function handleEntityNotFound(_0x422916,_0x523564){return function(_0x98fc24){if(!_0x98fc24){_0x422916['sendStatus'](0x194);}return _0x98fc24;};}function handleError(_0x499232,_0x1f8725){_0x1f8725=_0x1f8725||0x1f4;return function(_0x746d1f){logger['error'](_0x746d1f['stack']);if(_0x746d1f[_0x87e8('0x2c')]){delete _0x746d1f[_0x87e8('0x2c')];}_0x499232[_0x87e8('0x1f')](_0x1f8725)[_0x87e8('0x2d')](_0x746d1f);};}exports['index']=function(_0x3c6699,_0x538141){var _0x4e3f7c={},_0x437575={},_0x353f7c={'count':0x0,'rows':[]};var _0x34cfd4=_[_0x87e8('0x2e')](db['ChatInternalMessage'][_0x87e8('0x2f')],function(_0x5253f7){return{'name':_0x5253f7['fieldName'],'type':_0x5253f7[_0x87e8('0x30')][_0x87e8('0x31')]};});_0x437575['model']=_[_0x87e8('0x2e')](_0x34cfd4,_0x87e8('0x2c'));_0x437575['query']=_[_0x87e8('0x32')](_0x3c6699['query']);_0x437575['filters']=_['intersection'](_0x437575[_0x87e8('0x33')],_0x437575[_0x87e8('0x34')]);_0x4e3f7c['attributes']=_['intersection'](_0x437575['model'],qs[_0x87e8('0x35')](_0x3c6699[_0x87e8('0x34')][_0x87e8('0x35')]));_0x4e3f7c[_0x87e8('0x36')]=_0x4e3f7c[_0x87e8('0x36')][_0x87e8('0x37')]?_0x4e3f7c[_0x87e8('0x36')]:_0x437575['model'];if(!_0x3c6699[_0x87e8('0x34')][_0x87e8('0x38')](_0x87e8('0x39'))){_0x4e3f7c[_0x87e8('0x23')]=qs[_0x87e8('0x23')](_0x3c6699['query'][_0x87e8('0x23')]);_0x4e3f7c[_0x87e8('0x21')]=qs[_0x87e8('0x21')](_0x3c6699[_0x87e8('0x34')][_0x87e8('0x21')]);}_0x4e3f7c['order']=qs[_0x87e8('0x3a')](_0x3c6699[_0x87e8('0x34')]['sort']);_0x4e3f7c[_0x87e8('0x3b')]=qs[_0x87e8('0x3c')](_[_0x87e8('0x3d')](_0x3c6699['query'],_0x437575[_0x87e8('0x3c')]),_0x34cfd4);if(_0x3c6699[_0x87e8('0x34')]['filter']){_0x4e3f7c['where']=_[_0x87e8('0x3e')](_0x4e3f7c[_0x87e8('0x3b')],{'$or':_[_0x87e8('0x2e')](_0x34cfd4,function(_0x1dbc63){if(_0x1dbc63[_0x87e8('0x30')]!==_0x87e8('0x3f')){var _0x51d0f5={};_0x51d0f5[_0x1dbc63[_0x87e8('0x2c')]]={'$like':'%'+_0x3c6699['query'][_0x87e8('0x40')]+'%'};return _0x51d0f5;}})});}_0x4e3f7c=_[_0x87e8('0x3e')]({},_0x4e3f7c,_0x3c6699[_0x87e8('0x41')]);var _0x3f7326={'where':_0x4e3f7c[_0x87e8('0x3b')]};return db[_0x87e8('0x42')][_0x87e8('0x24')](_0x3f7326)[_0x87e8('0x2b')](function(_0x72047d){_0x353f7c[_0x87e8('0x24')]=_0x72047d;if(_0x3c6699['query'][_0x87e8('0x43')]){_0x4e3f7c[_0x87e8('0x44')]=[{'all':!![]}];}return db[_0x87e8('0x42')][_0x87e8('0x45')](_0x4e3f7c);})[_0x87e8('0x2b')](function(_0xae5a0a){_0x353f7c['rows']=_0xae5a0a;return _0x353f7c;})['then'](respondWithFilteredResult(_0x538141,_0x4e3f7c))[_0x87e8('0x46')](handleError(_0x538141,null));};exports[_0x87e8('0x47')]=function(_0x2ddc27,_0x58988f){var _0x4f0961={'raw':!![],'where':{'id':_0x2ddc27[_0x87e8('0x48')]['id']}},_0x828275={};_0x828275[_0x87e8('0x33')]=_['keys'](db[_0x87e8('0x42')][_0x87e8('0x2f')]);_0x828275[_0x87e8('0x34')]=_[_0x87e8('0x32')](_0x2ddc27[_0x87e8('0x34')]);_0x828275[_0x87e8('0x3c')]=_[_0x87e8('0x49')](_0x828275['model'],_0x828275[_0x87e8('0x34')]);_0x4f0961[_0x87e8('0x36')]=_[_0x87e8('0x49')](_0x828275[_0x87e8('0x33')],qs[_0x87e8('0x35')](_0x2ddc27[_0x87e8('0x34')]['fields']));_0x4f0961[_0x87e8('0x36')]=_0x4f0961[_0x87e8('0x36')]['length']?_0x4f0961[_0x87e8('0x36')]:_0x828275[_0x87e8('0x33')];if(_0x2ddc27['query'][_0x87e8('0x43')]){_0x4f0961[_0x87e8('0x44')]=[{'all':!![]}];}_0x4f0961=_[_0x87e8('0x3e')]({},_0x4f0961,_0x2ddc27[_0x87e8('0x41')]);return db[_0x87e8('0x42')][_0x87e8('0x4a')](_0x4f0961)[_0x87e8('0x2b')](handleEntityNotFound(_0x58988f,null))[_0x87e8('0x2b')](respondWithResult(_0x58988f,null))[_0x87e8('0x46')](handleError(_0x58988f,null));};exports[_0x87e8('0x4b')]=function(_0x4e71c2,_0x4852a6){return db[_0x87e8('0x42')][_0x87e8('0x4b')](_0x4e71c2['body'],{})['then'](respondWithResult(_0x4852a6,0xc9))[_0x87e8('0x46')](handleError(_0x4852a6,null));};exports[_0x87e8('0x29')]=function(_0x4e0346,_0x51c9c0){if(_0x4e0346[_0x87e8('0x4c')]['id']){delete _0x4e0346[_0x87e8('0x4c')]['id'];}return db[_0x87e8('0x42')][_0x87e8('0x4a')]({'where':{'id':_0x4e0346[_0x87e8('0x48')]['id']}})[_0x87e8('0x2b')](handleEntityNotFound(_0x51c9c0,null))[_0x87e8('0x2b')](saveUpdates(_0x4e0346[_0x87e8('0x4c')],null))[_0x87e8('0x2b')](respondWithResult(_0x51c9c0,null))[_0x87e8('0x46')](handleError(_0x51c9c0,null));};exports[_0x87e8('0x2a')]=function(_0x292240,_0x1a3ba8){return db['ChatInternalMessage'][_0x87e8('0x4a')]({'where':{'id':_0x292240[_0x87e8('0x48')]['id']}})[_0x87e8('0x2b')](handleEntityNotFound(_0x1a3ba8,null))[_0x87e8('0x2b')](removeEntity(_0x1a3ba8,null))[_0x87e8('0x46')](handleError(_0x1a3ba8,null));};exports[_0x87e8('0x4d')]=function(_0x5c022d,_0x204c40){return db[_0x87e8('0x42')]['describe']()['then'](respondWithResult(_0x204c40,null))[_0x87e8('0x46')](handleError(_0x204c40,null));};function wrapUser(_0x3af655){return function(_0x28c8fd){var _0x36b760=_0x3af655['get']({'plain':!![]});_0x36b760['messages']=[];if(_0x28c8fd){_0x36b760['lastMessageAt']=_0x28c8fd['createdAt'];_0x36b760['lastMessage']=_0x28c8fd;}else{_0x36b760[_0x87e8('0x4e')]=moment(0x0)[_0x87e8('0x4f')](_0x87e8('0x50'));_0x36b760[_0x87e8('0x51')]={};}return _0x36b760;};}exports[_0x87e8('0x52')]=function(_0x55eebd,_0x5cfffb,_0x4b2797){var _0x1a0200=[];return db[_0x87e8('0x53')][_0x87e8('0x45')]({'where':{'role':[_0x87e8('0x54'),_0x87e8('0x55'),_0x87e8('0x56')]},'attributes':['id','fullname',_0x87e8('0x2c'),_0x87e8('0x57'),_0x87e8('0x58'),_0x87e8('0x59'),_0x87e8('0x5a'),'lastLoginAt','allowmessenger','showWebBar'],'order':qs[_0x87e8('0x3a')](_0x87e8('0x5b')),'include':[{'model':db[_0x87e8('0x5c')],'as':_0x87e8('0x5d'),'attributes':['id',_0x87e8('0x2c'),_0x87e8('0x30')],'through':{'attributes':[]}}]})['then'](function(_0x3d4135){if(_0x3d4135){var _0x323633=_0x55eebd[_0x87e8('0x56')]['get']({'plain':!![]});if(!_0x323633)throw new Error(_0x87e8('0x5e'));if(_0x323633[_0x87e8('0x57')]===_0x87e8('0x56')){return db[_0x87e8('0x5f')][_0x87e8('0x4a')]({'where':{'name':_0x87e8('0x60'),'userProfileId':_0x323633[_0x87e8('0x61')]},'raw':!![]})[_0x87e8('0x2b')](function(_0x34c92e){if(_0x34c92e){if(_0x34c92e['autoAssociation']===0x0){return db[_0x87e8('0x62')]['findAll']({'where':{'sectionId':_0x34c92e['id']},'raw':!![]})['then'](function(_0x593cd2){var _0x3af402=[];if(_[_0x87e8('0x63')](_0x593cd2)){_0x3af402=_[_0x87e8('0x40')](_0x3d4135,function(_0x36eee6){if(_0x36eee6[_0x87e8('0x57')]!==_0x87e8('0x54')){return _0x36eee6;}});return _0x3af402;}else{for(var _0x183a51=0x0;_0x183a51<_0x3d4135['length'];_0x183a51++){var _0x52227a=_0x3d4135[_0x183a51];if(_0x52227a['role']===_0x87e8('0x54')){var _0x320e47=_[_0x87e8('0x4a')](_0x593cd2,function(_0x4ec2b0){return _0x4ec2b0[_0x87e8('0x64')]===_0x52227a['id'];});if(_0x320e47)_0x3af402[_0x87e8('0x65')](_0x52227a);}else{_0x3af402['push'](_0x52227a);}}return _0x3af402;}});}else{return _0x3d4135;}}else{var _0x149401=_[_0x87e8('0x40')](_0x3d4135,function(_0x2c6d4a){if(_0x2c6d4a[_0x87e8('0x57')]!=='agent'){return _0x2c6d4a;}});return _0x149401;}});}else{return _0x3d4135;}}})['then'](function(_0xf11f56){var _0x299463=[];if(_0xf11f56){_0x1a0200=_0xf11f56;for(var _0x49f957=0x0;_0x49f957<_0xf11f56[_0x87e8('0x37')];_0x49f957+=0x1){_0x1a0200[_0x49f957]['messages']=[];_0x299463[_0x87e8('0x65')](db[_0x87e8('0x42')][_0x87e8('0x4a')]({'where':{'FromId':[_0x55eebd['user']['id'],_0xf11f56[_0x49f957]['id']],'ToId':[_0x55eebd['user']['id'],_0xf11f56[_0x49f957]['id']],'ChatGroupId':null},'attributes':['id',_0x87e8('0x66'),_0x87e8('0x67'),'ToId',_0x87e8('0x68'),_0x87e8('0x4c')],'order':qs[_0x87e8('0x3a')](_0x87e8('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x87e8('0x2b')](wrapUser(_0xf11f56[_0x49f957])));}return BPromise[_0x87e8('0x6a')](_0x299463);}return[];})[_0x87e8('0x2b')](function(_0x1716e8){return{'rows':_0x1716e8,'count':_0x1716e8[_0x87e8('0x37')]};})[_0x87e8('0x2b')](respondWithResult(_0x5cfffb,null))[_0x87e8('0x46')](handleError(_0x5cfffb,null));};
\ No newline at end of file
+var _0x0d2d=['defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','limit','undefined','count','offset','apply','reject','save','update','then','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','include','findAll','catch','params','length','includeAll','find','create','body','describe','get','messages','lastMessage','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','role','userpic','internal','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis'];(function(_0x16db5c,_0x7d65ee){var _0x40e126=function(_0x5add7b){while(--_0x5add7b){_0x16db5c['push'](_0x16db5c['shift']());}};_0x40e126(++_0x7d65ee);}(_0x0d2d,0xc7));var _0xd0d2=function(_0x59562c,_0x1b801f){_0x59562c=_0x59562c-0x0;var _0xa27606=_0x0d2d[_0x59562c];return _0xa27606;};'use strict';var emlformat=require(_0xd0d2('0x0'));var rimraf=require(_0xd0d2('0x1'));var zipdir=require(_0xd0d2('0x2'));var jsonpatch=require(_0xd0d2('0x3'));var rp=require('request-promise');var moment=require(_0xd0d2('0x4'));var BPromise=require(_0xd0d2('0x5'));var Mustache=require(_0xd0d2('0x6'));var util=require(_0xd0d2('0x7'));var path=require('path');var sox=require(_0xd0d2('0x8'));var csv=require(_0xd0d2('0x9'));var ejs=require(_0xd0d2('0xa'));var fs=require('fs');var fs_extra=require(_0xd0d2('0xb'));var _=require(_0xd0d2('0xc'));var squel=require(_0xd0d2('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd0d2('0x9'));var querystring=require(_0xd0d2('0xe'));var Papa=require(_0xd0d2('0xf'));var Redis=require('ioredis');var authService=require(_0xd0d2('0x10'));var qs=require(_0xd0d2('0x11'));var as=require(_0xd0d2('0x12'));var hardwareService=require(_0xd0d2('0x13'));var logger=require(_0xd0d2('0x14'))(_0xd0d2('0x15'));var utils=require('../../config/utils');var config=require(_0xd0d2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd0d2('0x17'))['db'];config[_0xd0d2('0x18')]=_[_0xd0d2('0x19')](config[_0xd0d2('0x18')],{'host':_0xd0d2('0x1a'),'port':0x18eb});var socket=require(_0xd0d2('0x1b'))(new Redis(config[_0xd0d2('0x18')]));require(_0xd0d2('0x1c'))[_0xd0d2('0x1d')](socket);function respondWithStatusCode(_0x5ed312,_0x2e5b41){_0x2e5b41=_0x2e5b41||0xcc;return function(_0x395eb0){if(_0x395eb0){return _0x5ed312[_0xd0d2('0x1e')](_0x2e5b41);}return _0x5ed312[_0xd0d2('0x1f')](_0x2e5b41)['end']();};}function respondWithResult(_0x39e94f,_0x2c47cd){_0x2c47cd=_0x2c47cd||0xc8;return function(_0x39d4cc){if(_0x39d4cc){return _0x39e94f[_0xd0d2('0x1f')](_0x2c47cd)[_0xd0d2('0x20')](_0x39d4cc);}};}function respondWithFilteredResult(_0x21a754,_0x2a0dba){return function(_0x46c0e4){if(_0x46c0e4){var _0x4b9f68=typeof _0x2a0dba['offset']==='undefined'&&typeof _0x2a0dba[_0xd0d2('0x21')]===_0xd0d2('0x22');var _0x3ae9ba=_0x46c0e4[_0xd0d2('0x23')];var _0x509c14=_0x4b9f68?0x0:_0x2a0dba[_0xd0d2('0x24')];var _0x126a79=_0x4b9f68?_0x46c0e4[_0xd0d2('0x23')]:_0x2a0dba[_0xd0d2('0x24')]+_0x2a0dba[_0xd0d2('0x21')];var _0x48e98f;if(_0x126a79>=_0x3ae9ba){_0x126a79=_0x3ae9ba;_0x48e98f=0xc8;}else{_0x48e98f=0xce;}_0x21a754[_0xd0d2('0x1f')](_0x48e98f);return _0x21a754['set']('Content-Range',_0x509c14+'-'+_0x126a79+'/'+_0x3ae9ba)[_0xd0d2('0x20')](_0x46c0e4);}return null;};}function patchUpdates(_0x33a50c){return function(_0xa6e0c7){try{jsonpatch[_0xd0d2('0x25')](_0xa6e0c7,_0x33a50c,!![]);}catch(_0x52be66){return BPromise[_0xd0d2('0x26')](_0x52be66);}return _0xa6e0c7[_0xd0d2('0x27')]();};}function saveUpdates(_0x5e757c,_0x44f828){return function(_0x171631){if(_0x171631){return _0x171631[_0xd0d2('0x28')](_0x5e757c)[_0xd0d2('0x29')](function(_0x19ad26){return _0x19ad26;});}return null;};}function removeEntity(_0x39b1e2,_0x2dd776){return function(_0x1245d4){if(_0x1245d4){return _0x1245d4['destroy']()[_0xd0d2('0x29')](function(){_0x39b1e2['status'](0xcc)[_0xd0d2('0x2a')]();});}};}function handleEntityNotFound(_0x4b77f7,_0x10f8f5){return function(_0x125db2){if(!_0x125db2){_0x4b77f7[_0xd0d2('0x1e')](0x194);}return _0x125db2;};}function handleError(_0x38118e,_0x2eb363){_0x2eb363=_0x2eb363||0x1f4;return function(_0x5ad454){logger[_0xd0d2('0x2b')](_0x5ad454['stack']);if(_0x5ad454[_0xd0d2('0x2c')]){delete _0x5ad454[_0xd0d2('0x2c')];}_0x38118e[_0xd0d2('0x1f')](_0x2eb363)[_0xd0d2('0x2d')](_0x5ad454);};}exports[_0xd0d2('0x2e')]=function(_0x5c48a4,_0x1b1f74){var _0x445d81={},_0x183615={},_0x59d97d={'count':0x0,'rows':[]};var _0x9270b8=_[_0xd0d2('0x2f')](db['ChatInternalMessage'][_0xd0d2('0x30')],function(_0x49ff46){return{'name':_0x49ff46[_0xd0d2('0x31')],'type':_0x49ff46[_0xd0d2('0x32')][_0xd0d2('0x33')]};});_0x183615[_0xd0d2('0x34')]=_[_0xd0d2('0x2f')](_0x9270b8,_0xd0d2('0x2c'));_0x183615['query']=_[_0xd0d2('0x35')](_0x5c48a4[_0xd0d2('0x36')]);_0x183615[_0xd0d2('0x37')]=_[_0xd0d2('0x38')](_0x183615[_0xd0d2('0x34')],_0x183615['query']);_0x445d81[_0xd0d2('0x39')]=_[_0xd0d2('0x38')](_0x183615[_0xd0d2('0x34')],qs[_0xd0d2('0x3a')](_0x5c48a4['query'][_0xd0d2('0x3a')]));_0x445d81[_0xd0d2('0x39')]=_0x445d81[_0xd0d2('0x39')]['length']?_0x445d81['attributes']:_0x183615[_0xd0d2('0x34')];if(!_0x5c48a4['query'][_0xd0d2('0x3b')](_0xd0d2('0x3c'))){_0x445d81[_0xd0d2('0x21')]=qs[_0xd0d2('0x21')](_0x5c48a4[_0xd0d2('0x36')][_0xd0d2('0x21')]);_0x445d81[_0xd0d2('0x24')]=qs[_0xd0d2('0x24')](_0x5c48a4[_0xd0d2('0x36')][_0xd0d2('0x24')]);}_0x445d81[_0xd0d2('0x3d')]=qs[_0xd0d2('0x3e')](_0x5c48a4[_0xd0d2('0x36')][_0xd0d2('0x3e')]);_0x445d81[_0xd0d2('0x3f')]=qs[_0xd0d2('0x37')](_[_0xd0d2('0x40')](_0x5c48a4[_0xd0d2('0x36')],_0x183615['filters']),_0x9270b8);if(_0x5c48a4[_0xd0d2('0x36')][_0xd0d2('0x41')]){_0x445d81[_0xd0d2('0x3f')]=_[_0xd0d2('0x42')](_0x445d81[_0xd0d2('0x3f')],{'$or':_[_0xd0d2('0x2f')](_0x9270b8,function(_0x315d91){if(_0x315d91['type']!==_0xd0d2('0x43')){var _0x226641={};_0x226641[_0x315d91[_0xd0d2('0x2c')]]={'$like':'%'+_0x5c48a4[_0xd0d2('0x36')][_0xd0d2('0x41')]+'%'};return _0x226641;}})});}_0x445d81=_['merge']({},_0x445d81,_0x5c48a4[_0xd0d2('0x44')]);var _0x3e9de6={'where':_0x445d81[_0xd0d2('0x3f')]};return db[_0xd0d2('0x45')][_0xd0d2('0x23')](_0x3e9de6)['then'](function(_0x3217f0){_0x59d97d['count']=_0x3217f0;if(_0x5c48a4[_0xd0d2('0x36')]['includeAll']){_0x445d81[_0xd0d2('0x46')]=[{'all':!![]}];}return db[_0xd0d2('0x45')][_0xd0d2('0x47')](_0x445d81);})[_0xd0d2('0x29')](function(_0x259242){_0x59d97d['rows']=_0x259242;return _0x59d97d;})[_0xd0d2('0x29')](respondWithFilteredResult(_0x1b1f74,_0x445d81))[_0xd0d2('0x48')](handleError(_0x1b1f74,null));};exports['show']=function(_0x59133c,_0x723efb){var _0x3cba41={'raw':!![],'where':{'id':_0x59133c[_0xd0d2('0x49')]['id']}},_0x4e0746={};_0x4e0746[_0xd0d2('0x34')]=_[_0xd0d2('0x35')](db[_0xd0d2('0x45')]['rawAttributes']);_0x4e0746[_0xd0d2('0x36')]=_[_0xd0d2('0x35')](_0x59133c[_0xd0d2('0x36')]);_0x4e0746[_0xd0d2('0x37')]=_[_0xd0d2('0x38')](_0x4e0746['model'],_0x4e0746[_0xd0d2('0x36')]);_0x3cba41[_0xd0d2('0x39')]=_[_0xd0d2('0x38')](_0x4e0746['model'],qs[_0xd0d2('0x3a')](_0x59133c[_0xd0d2('0x36')][_0xd0d2('0x3a')]));_0x3cba41['attributes']=_0x3cba41[_0xd0d2('0x39')][_0xd0d2('0x4a')]?_0x3cba41[_0xd0d2('0x39')]:_0x4e0746['model'];if(_0x59133c['query'][_0xd0d2('0x4b')]){_0x3cba41[_0xd0d2('0x46')]=[{'all':!![]}];}_0x3cba41=_[_0xd0d2('0x42')]({},_0x3cba41,_0x59133c['options']);return db[_0xd0d2('0x45')][_0xd0d2('0x4c')](_0x3cba41)[_0xd0d2('0x29')](handleEntityNotFound(_0x723efb,null))['then'](respondWithResult(_0x723efb,null))[_0xd0d2('0x48')](handleError(_0x723efb,null));};exports[_0xd0d2('0x4d')]=function(_0x299f75,_0x30cc69){return db[_0xd0d2('0x45')][_0xd0d2('0x4d')](_0x299f75[_0xd0d2('0x4e')],{})[_0xd0d2('0x29')](respondWithResult(_0x30cc69,0xc9))[_0xd0d2('0x48')](handleError(_0x30cc69,null));};exports[_0xd0d2('0x28')]=function(_0x2dfd59,_0x41ff58){if(_0x2dfd59['body']['id']){delete _0x2dfd59[_0xd0d2('0x4e')]['id'];}return db[_0xd0d2('0x45')][_0xd0d2('0x4c')]({'where':{'id':_0x2dfd59['params']['id']}})[_0xd0d2('0x29')](handleEntityNotFound(_0x41ff58,null))[_0xd0d2('0x29')](saveUpdates(_0x2dfd59['body'],null))[_0xd0d2('0x29')](respondWithResult(_0x41ff58,null))[_0xd0d2('0x48')](handleError(_0x41ff58,null));};exports['destroy']=function(_0x181db4,_0x1fe7b6){return db[_0xd0d2('0x45')]['find']({'where':{'id':_0x181db4[_0xd0d2('0x49')]['id']}})['then'](handleEntityNotFound(_0x1fe7b6,null))[_0xd0d2('0x29')](removeEntity(_0x1fe7b6,null))[_0xd0d2('0x48')](handleError(_0x1fe7b6,null));};exports[_0xd0d2('0x4f')]=function(_0x51893f,_0x5dd716){return db[_0xd0d2('0x45')]['describe']()[_0xd0d2('0x29')](respondWithResult(_0x5dd716,null))[_0xd0d2('0x48')](handleError(_0x5dd716,null));};function wrapUser(_0x338f23){return function(_0x1fc6cf){var _0x505381=_0x338f23[_0xd0d2('0x50')]({'plain':!![]});_0x505381[_0xd0d2('0x51')]=[];if(_0x1fc6cf){_0x505381['lastMessageAt']=_0x1fc6cf['createdAt'];_0x505381[_0xd0d2('0x52')]=_0x1fc6cf;}else{_0x505381[_0xd0d2('0x53')]=moment(0x0)['format'](_0xd0d2('0x54'));_0x505381[_0xd0d2('0x52')]={};}return _0x505381;};}exports['getUsers']=function(_0x3434c0,_0x22cbbe,_0xa86f61){var _0x267ee6=[];return db[_0xd0d2('0x55')][_0xd0d2('0x47')]({'where':{'role':[_0xd0d2('0x56'),_0xd0d2('0x57'),'user']},'attributes':['id','fullname',_0xd0d2('0x2c'),_0xd0d2('0x58'),_0xd0d2('0x59'),_0xd0d2('0x5a'),'online',_0xd0d2('0x5b'),_0xd0d2('0x5c'),'showWebBar'],'order':qs[_0xd0d2('0x3e')](_0xd0d2('0x5d')),'include':[{'model':db[_0xd0d2('0x5e')],'as':_0xd0d2('0x5f'),'attributes':['id','name',_0xd0d2('0x32')],'through':{'attributes':[]}}]})['then'](function(_0x3363c3){if(_0x3363c3){var _0x5afe84=_0x3434c0[_0xd0d2('0x60')][_0xd0d2('0x50')]({'plain':!![]});if(!_0x5afe84)throw new Error(_0xd0d2('0x61'));if(_0x5afe84[_0xd0d2('0x58')]===_0xd0d2('0x60')){return db[_0xd0d2('0x62')][_0xd0d2('0x4c')]({'where':{'name':_0xd0d2('0x63'),'userProfileId':_0x5afe84[_0xd0d2('0x64')]},'raw':!![]})[_0xd0d2('0x29')](function(_0x2dc540){if(_0x2dc540){if(_0x2dc540[_0xd0d2('0x65')]===0x0){return db[_0xd0d2('0x66')]['findAll']({'where':{'sectionId':_0x2dc540['id']},'raw':!![]})[_0xd0d2('0x29')](function(_0x3cdd55){var _0xd05037=[];if(_[_0xd0d2('0x67')](_0x3cdd55)){_0xd05037=_[_0xd0d2('0x41')](_0x3363c3,function(_0x3f0961){if(_0x3f0961[_0xd0d2('0x58')]!==_0xd0d2('0x56')){return _0x3f0961;}});return _0xd05037;}else{for(var _0x223d27=0x0;_0x223d27<_0x3363c3[_0xd0d2('0x4a')];_0x223d27++){var _0xdd0480=_0x3363c3[_0x223d27];if(_0xdd0480[_0xd0d2('0x58')]===_0xd0d2('0x56')){var _0x496227=_[_0xd0d2('0x4c')](_0x3cdd55,function(_0xc1acd4){return _0xc1acd4[_0xd0d2('0x68')]===_0xdd0480['id'];});if(_0x496227)_0xd05037['push'](_0xdd0480);}else{_0xd05037[_0xd0d2('0x69')](_0xdd0480);}}return _0xd05037;}});}else{return _0x3363c3;}}else{var _0x1034e4=_['filter'](_0x3363c3,function(_0x571a43){if(_0x571a43[_0xd0d2('0x58')]!==_0xd0d2('0x56')){return _0x571a43;}});return _0x1034e4;}});}else{return _0x3363c3;}}})['then'](function(_0x318ddf){var _0x83db67=[];if(_0x318ddf){_0x267ee6=_0x318ddf;for(var _0xa54021=0x0;_0xa54021<_0x318ddf[_0xd0d2('0x4a')];_0xa54021+=0x1){_0x267ee6[_0xa54021][_0xd0d2('0x51')]=[];_0x83db67['push'](db[_0xd0d2('0x45')]['find']({'where':{'FromId':[_0x3434c0[_0xd0d2('0x60')]['id'],_0x318ddf[_0xa54021]['id']],'ToId':[_0x3434c0['user']['id'],_0x318ddf[_0xa54021]['id']],'ChatGroupId':null},'attributes':['id',_0xd0d2('0x6a'),_0xd0d2('0x6b'),_0xd0d2('0x6c'),_0xd0d2('0x6d'),_0xd0d2('0x4e')],'order':qs[_0xd0d2('0x3e')](_0xd0d2('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd0d2('0x29')](wrapUser(_0x318ddf[_0xa54021])));}return BPromise[_0xd0d2('0x6f')](_0x83db67);}return[];})[_0xd0d2('0x29')](function(_0x4f0123){return{'rows':_0x4f0123,'count':_0x4f0123[_0xd0d2('0x4a')]};})[_0xd0d2('0x29')](respondWithResult(_0x22cbbe,null))[_0xd0d2('0x48')](handleError(_0x22cbbe,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index ea41d1b..72ba116 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 _0x1c9e=['save','update','remove','emit','hook','exports','../../mysqldb','ChatInternalMessage'];(function(_0x5da2bd,_0x10eaab){var _0x59b4ce=function(_0x1362ae){while(--_0x1362ae){_0x5da2bd['push'](_0x5da2bd['shift']());}};_0x59b4ce(++_0x10eaab);}(_0x1c9e,0x146));var _0xe1c9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1c9e[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xe1c9('0x0'))['db'][_0xe1c9('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe1c9('0x2'),'afterUpdate':_0xe1c9('0x3'),'afterDestroy':_0xe1c9('0x4')};function emitEvent(_0xbd2502){return function(_0x186359,_0x1b8a78,_0x3212b4){ChatInternalMessageEvents['emit'](_0xbd2502+':'+_0x186359['id'],_0x186359);ChatInternalMessageEvents[_0xe1c9('0x5')](_0xbd2502,_0x186359);_0x3212b4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xe1c9('0x6')](e,emitEvent(event));}}module[_0xe1c9('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xb63d=['exports','events','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1ff7b4,_0x28ea89){var _0x34a452=function(_0x22ad3a){while(--_0x22ad3a){_0x1ff7b4['push'](_0x1ff7b4['shift']());}};_0x34a452(++_0x28ea89);}(_0xb63d,0x83));var _0xdb63=function(_0x2a2d81,_0x1fb7e7){_0x2a2d81=_0x2a2d81-0x0;var _0x29a338=_0xb63d[_0x2a2d81];return _0x29a338;};'use strict';var EventEmitter=require(_0xdb63('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xdb63('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xdb63('0x2')](0x0);var events={'afterCreate':_0xdb63('0x3'),'afterUpdate':_0xdb63('0x4'),'afterDestroy':_0xdb63('0x5')};function emitEvent(_0x4d8097){return function(_0x50c54f,_0x1fcdcb,_0x535271){ChatInternalMessageEvents[_0xdb63('0x6')](_0x4d8097+':'+_0x50c54f['id'],_0x50c54f);ChatInternalMessageEvents[_0xdb63('0x6')](_0x4d8097,_0x50c54f);_0x535271(null);};}for(var e in events){if(events[_0xdb63('0x7')](e)){var event=events[e];ChatInternalMessage[_0xdb63('0x8')](e,emitEvent(event));}}module[_0xdb63('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index c411071..f418796 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 _0x9a3b=['../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3f044e,_0x56ddcf){var _0x1ff697=function(_0x5c76e4){while(--_0x5c76e4){_0x3f044e['push'](_0x3f044e['shift']());}};_0x1ff697(++_0x56ddcf);}(_0x9a3b,0xbd));var _0xb9a3=function(_0x1411e8,_0x249a68){_0x1411e8=_0x1411e8-0x0;var _0x5b844e=_0x9a3b[_0x1411e8];return _0x5b844e;};'use strict';var _=require(_0xb9a3('0x0'));var util=require(_0xb9a3('0x1'));var logger=require(_0xb9a3('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb9a3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9a3('0x4'));var rimraf=require(_0xb9a3('0x5'));var config=require(_0xb9a3('0x6'));var attributes=require(_0xb9a3('0x7'));module['exports']=function(_0x7b0d5e,_0x2c7631){return _0x7b0d5e[_0xb9a3('0x8')](_0xb9a3('0x9'),attributes,{'tableName':_0xb9a3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb9a3('0xb'),'collate':_0xb9a3('0xc')});};
\ No newline at end of file
+var _0x61e2=['request-promise','rimraf','exports','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0x5eb6e6,_0x17f551){var _0x35c38b=function(_0xa3592){while(--_0xa3592){_0x5eb6e6['push'](_0x5eb6e6['shift']());}};_0x35c38b(++_0x17f551);}(_0x61e2,0x10e));var _0x261e=function(_0x113129,_0x3c4b4b){_0x113129=_0x113129-0x0;var _0xf36838=_0x61e2[_0x113129];return _0xf36838;};'use strict';var _=require(_0x261e('0x0'));var util=require(_0x261e('0x1'));var logger=require(_0x261e('0x2'))(_0x261e('0x3'));var moment=require('moment');var BPromise=require(_0x261e('0x4'));var rp=require(_0x261e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x261e('0x6'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x261e('0x7')]=function(_0x5c3fee,_0x5f12b9){return _0x5c3fee['define'](_0x261e('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x261e('0x9'),'collate':_0x261e('0xa')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 8ae9aef..28cc775 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 _0x6909=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','util','bluebird','randomstring'];(function(_0x45030e,_0x32b6b8){var _0x4df3be=function(_0x1fe781){while(--_0x1fe781){_0x45030e['push'](_0x45030e['shift']());}};_0x4df3be(++_0x32b6b8);}(_0x6909,0x1e3));var _0x9690=function(_0xc8c5bf,_0x5af025){_0xc8c5bf=_0xc8c5bf-0x0;var _0x5d53af=_0x6909[_0xc8c5bf];return _0x5d53af;};'use strict';var _=require('lodash');var util=require(_0x9690('0x0'));var moment=require('moment');var BPromise=require(_0x9690('0x1'));var rs=require(_0x9690('0x2'));var fs=require('fs');var Redis=require(_0x9690('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9690('0x4'));var logger=require(_0x9690('0x5'))(_0x9690('0x6'));var config=require('../../config/environment');var jayson=require(_0x9690('0x7'));var client=jayson[_0x9690('0x8')][_0x9690('0x9')]({'port':0x232a});config[_0x9690('0xa')]=_[_0x9690('0xb')](config[_0x9690('0xa')],{'host':_0x9690('0xc'),'port':0x18eb});var socket=require(_0x9690('0xd'))(new Redis(config[_0x9690('0xa')]));require(_0x9690('0xe'))['register'](socket);function respondWithRpcPromise(_0x3c89e0,_0x2658c6,_0x24eae8){return new BPromise(function(_0x39847f,_0x12b229){return client[_0x9690('0xf')](_0x3c89e0,_0x24eae8)[_0x9690('0x10')](function(_0x201381){logger[_0x9690('0x11')](_0x9690('0x12'),_0x2658c6,'request\x20sent');logger[_0x9690('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x2658c6,'request\x20sent',JSON[_0x9690('0x14')](_0x201381));if(_0x201381[_0x9690('0x15')]){if(_0x201381[_0x9690('0x15')][_0x9690('0x16')]===0x1f4){logger[_0x9690('0x15')](_0x9690('0x12'),_0x2658c6,_0x201381[_0x9690('0x15')][_0x9690('0x17')]);return _0x12b229(_0x201381[_0x9690('0x15')][_0x9690('0x17')]);}logger[_0x9690('0x15')](_0x9690('0x12'),_0x2658c6,_0x201381[_0x9690('0x15')][_0x9690('0x17')]);return _0x39847f(_0x201381[_0x9690('0x15')][_0x9690('0x17')]);}else{logger['info'](_0x9690('0x12'),_0x2658c6,_0x9690('0x18'));_0x39847f(_0x201381[_0x9690('0x19')][_0x9690('0x17')]);}})[_0x9690('0x1a')](function(_0x3ad729){logger[_0x9690('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2658c6,_0x3ad729);_0x12b229(_0x3ad729);});});}
\ No newline at end of file
+var _0xafc6=['http','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x1e6737,_0x3a00b9){var _0x13209b=function(_0x161523){while(--_0x161523){_0x1e6737['push'](_0x1e6737['shift']());}};_0x13209b(++_0x3a00b9);}(_0xafc6,0xf9));var _0x6afc=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xafc6[_0x3fba9f];return _0x192cf1;};'use strict';var _=require(_0x6afc('0x0'));var util=require(_0x6afc('0x1'));var moment=require(_0x6afc('0x2'));var BPromise=require(_0x6afc('0x3'));var rs=require(_0x6afc('0x4'));var fs=require('fs');var Redis=require(_0x6afc('0x5'));var db=require(_0x6afc('0x6'))['db'];var utils=require(_0x6afc('0x7'));var logger=require('../../config/logger')(_0x6afc('0x8'));var config=require(_0x6afc('0x9'));var jayson=require(_0x6afc('0xa'));var client=jayson[_0x6afc('0xb')][_0x6afc('0xc')]({'port':0x232a});config[_0x6afc('0xd')]=_[_0x6afc('0xe')](config[_0x6afc('0xd')],{'host':_0x6afc('0xf'),'port':0x18eb});var socket=require(_0x6afc('0x10'))(new Redis(config[_0x6afc('0xd')]));require('./chatInternalMessage.socket')[_0x6afc('0x11')](socket);function respondWithRpcPromise(_0x252760,_0x5b68d6,_0x4dc0ab){return new BPromise(function(_0x51454f,_0x3d687e){return client['request'](_0x252760,_0x4dc0ab)[_0x6afc('0x12')](function(_0x39348d){logger[_0x6afc('0x13')](_0x6afc('0x14'),_0x5b68d6,_0x6afc('0x15'));logger[_0x6afc('0x16')](_0x6afc('0x17'),_0x5b68d6,_0x6afc('0x15'),JSON[_0x6afc('0x18')](_0x39348d));if(_0x39348d[_0x6afc('0x19')]){if(_0x39348d[_0x6afc('0x19')]['code']===0x1f4){logger[_0x6afc('0x19')](_0x6afc('0x14'),_0x5b68d6,_0x39348d[_0x6afc('0x19')][_0x6afc('0x1a')]);return _0x3d687e(_0x39348d[_0x6afc('0x19')][_0x6afc('0x1a')]);}logger[_0x6afc('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x5b68d6,_0x39348d[_0x6afc('0x19')][_0x6afc('0x1a')]);return _0x51454f(_0x39348d['error']['message']);}else{logger[_0x6afc('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x5b68d6,'request\x20sent');_0x51454f(_0x39348d[_0x6afc('0x1b')][_0x6afc('0x1a')]);}})[_0x6afc('0x1c')](function(_0x1ed261){logger[_0x6afc('0x19')](_0x6afc('0x14'),_0x5b68d6,_0x1ed261);_0x3d687e(_0x1ed261);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 6191799..107db1f 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 _0xeb24=['removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0xecd71a,_0x3543fd){var _0x445a0a=function(_0x5e68f2){while(--_0x5e68f2){_0xecd71a['push'](_0xecd71a['shift']());}};_0x445a0a(++_0x3543fd);}(_0xeb24,0x9d));var _0x4eb2=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xeb24[_0x1694f5];return _0x5b4321;};'use strict';var ChatInternalMessageEvents=require(_0x4eb2('0x0'));var events=[_0x4eb2('0x1'),_0x4eb2('0x2'),_0x4eb2('0x3')];function createListener(_0x2217f5,_0x445280){return function(_0x388845){_0x445280['emit'](_0x2217f5,_0x388845);};}function removeListener(_0x26a55e,_0x3e4ce9){return function(){ChatInternalMessageEvents[_0x4eb2('0x4')](_0x26a55e,_0x3e4ce9);};}exports['register']=function(_0x15df94){for(var _0x5917c9=0x0,_0x230c79=events[_0x4eb2('0x5')];_0x5917c9<_0x230c79;_0x5917c9++){var _0x1c59fc=events[_0x5917c9];var _0x1afc00=createListener(_0x4eb2('0x6')+_0x1c59fc,_0x15df94);ChatInternalMessageEvents['on'](_0x1c59fc,_0x1afc00);}};
\ No newline at end of file
+var _0xf11f=['update','emit','removeListener','register','length','save','remove'];(function(_0x14f137,_0x3670a7){var _0x6169b6=function(_0x1f076e){while(--_0x1f076e){_0x14f137['push'](_0x14f137['shift']());}};_0x6169b6(++_0x3670a7);}(_0xf11f,0x1a9));var _0xff11=function(_0xf6e75d,_0xc70967){_0xf6e75d=_0xf6e75d-0x0;var _0x27514d=_0xf11f[_0xf6e75d];return _0x27514d;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xff11('0x0'),_0xff11('0x1'),_0xff11('0x2')];function createListener(_0x396e19,_0x3af83a){return function(_0x370f84){_0x3af83a[_0xff11('0x3')](_0x396e19,_0x370f84);};}function removeListener(_0x325f44,_0x1234d8){return function(){ChatInternalMessageEvents[_0xff11('0x4')](_0x325f44,_0x1234d8);};}exports[_0xff11('0x5')]=function(_0x4a846c){for(var _0x4cc7e9=0x0,_0x124c42=events[_0xff11('0x6')];_0x4cc7e9<_0x124c42;_0x4cc7e9++){var _0x39d076=events[_0x4cc7e9];var _0x47609a=createListener('chatInternalMessage:'+_0x39d076,_0x4a846c);ChatInternalMessageEvents['on'](_0x39d076,_0x47609a);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 2faff9f..c793dd7 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 _0x9028=['/describe','describe','/users','getUsers','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0xbbfe59,_0x46067f){var _0x28a2a4=function(_0xfe230){while(--_0xfe230){_0xbbfe59['push'](_0xbbfe59['shift']());}};_0x28a2a4(++_0x46067f);}(_0x9028,0x137));var _0x8902=function(_0xfb4ed5,_0x3ebd19){_0xfb4ed5=_0xfb4ed5-0x0;var _0x581224=_0x9028[_0xfb4ed5];return _0x581224;};'use strict';var multer=require(_0x8902('0x0'));var util=require(_0x8902('0x1'));var path=require(_0x8902('0x2'));var timeout=require(_0x8902('0x3'));var express=require(_0x8902('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8902('0x5'));var interaction=require(_0x8902('0x6'));var config=require(_0x8902('0x7'));var controller=require('./chatInternalMessage.controller');router[_0x8902('0x8')]('/',auth[_0x8902('0x9')](),controller[_0x8902('0xa')]);router[_0x8902('0x8')](_0x8902('0xb'),auth[_0x8902('0x9')](),controller[_0x8902('0xc')]);router['get'](_0x8902('0xd'),auth[_0x8902('0x9')](),controller[_0x8902('0xe')]);router[_0x8902('0x8')](_0x8902('0xf'),auth[_0x8902('0x9')](),controller[_0x8902('0x10')]);router[_0x8902('0x11')]('/',auth[_0x8902('0x9')](),controller[_0x8902('0x12')]);router[_0x8902('0x13')]('/:id',controller[_0x8902('0x14')]);router['delete'](_0x8902('0xf'),auth[_0x8902('0x9')](),controller[_0x8902('0x15')]);module[_0x8902('0x16')]=router;
\ No newline at end of file
+var _0xe8e6=['../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','describe','getUsers','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xe8e6,0x1c3));var _0x6e8e=function(_0x12c66e,_0xea7b4){_0x12c66e=_0x12c66e-0x0;var _0x19481a=_0xe8e6[_0x12c66e];return _0x19481a;};'use strict';var multer=require(_0x6e8e('0x0'));var util=require(_0x6e8e('0x1'));var path=require(_0x6e8e('0x2'));var timeout=require(_0x6e8e('0x3'));var express=require(_0x6e8e('0x4'));var router=express[_0x6e8e('0x5')]();var fs_extra=require(_0x6e8e('0x6'));var auth=require(_0x6e8e('0x7'));var interaction=require(_0x6e8e('0x8'));var config=require(_0x6e8e('0x9'));var controller=require(_0x6e8e('0xa'));router[_0x6e8e('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6e8e('0xb')](_0x6e8e('0xc'),auth[_0x6e8e('0xd')](),controller[_0x6e8e('0xe')]);router['get']('/users',auth['isAuthenticated'](),controller[_0x6e8e('0xf')]);router[_0x6e8e('0xb')](_0x6e8e('0x10'),auth['isAuthenticated'](),controller['show']);router[_0x6e8e('0x11')]('/',auth[_0x6e8e('0xd')](),controller[_0x6e8e('0x12')]);router['put'](_0x6e8e('0x10'),controller[_0x6e8e('0x13')]);router[_0x6e8e('0x14')](_0x6e8e('0x10'),auth[_0x6e8e('0xd')](),controller[_0x6e8e('0x15')]);module[_0x6e8e('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index a234ecc..38b7dbf 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 _0xadcc=['TEXT','medium','BOOLEAN','ENUM','DATE','STRING','sequelize'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xadcc,0x76));var _0xcadc=function(_0x52d8ae,_0x372b3e){_0x52d8ae=_0x52d8ae-0x0;var _0x43c27b=_0xadcc[_0x52d8ae];return _0x43c27b;};'use strict';var Sequelize=require(_0xcadc('0x0'));module['exports']={'body':{'type':Sequelize[_0xcadc('0x1')](_0xcadc('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xcadc('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xcadc('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcadc('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xcadc('0x5')]},'providerName':{'type':Sequelize[_0xcadc('0x6')]},'providerResponse':{'type':Sequelize[_0xcadc('0x1')]}};
\ No newline at end of file
+var _0x1bd1=['BOOLEAN','DATE','STRING','sequelize','exports','TEXT'];(function(_0x46bc83,_0xb1194e){var _0x51be8d=function(_0x4d97b6){while(--_0x4d97b6){_0x46bc83['push'](_0x46bc83['shift']());}};_0x51be8d(++_0xb1194e);}(_0x1bd1,0x123));var _0x11bd=function(_0x57b6ae,_0x2ca66e){_0x57b6ae=_0x57b6ae-0x0;var _0x8d7f4a=_0x1bd1[_0x57b6ae];return _0x8d7f4a;};'use strict';var Sequelize=require(_0x11bd('0x0'));module[_0x11bd('0x1')]={'body':{'type':Sequelize[_0x11bd('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x11bd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x11bd('0x4')]},'providerName':{'type':Sequelize[_0x11bd('0x5')]},'providerResponse':{'type':Sequelize[_0x11bd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index fec7052..30b1261 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 _0xb13a=['apply','save','update','sendStatus','name','send','index','map','ChatMessage','rawAttributes','type','key','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','chat-interactions','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','sequelize','Sequelize','interface','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','http','client','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','ChatMessage,\x20%s,\x20%s','message','result','end','json','offset','undefined','limit','count','status','Content-Range'];(function(_0x438dab,_0x2d002a){var _0x416056=function(_0x14715a){while(--_0x14715a){_0x438dab['push'](_0x438dab['shift']());}};_0x416056(++_0x2d002a);}(_0xb13a,0x1ee));var _0xab13=function(_0x4480a6,_0x8cd58e){_0x4480a6=_0x4480a6-0x0;var _0x162965=_0xb13a[_0x4480a6];return _0x162965;};'use strict';var emlformat=require(_0xab13('0x0'));var rimraf=require(_0xab13('0x1'));var zipdir=require(_0xab13('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab13('0x3'));var moment=require(_0xab13('0x4'));var BPromise=require(_0xab13('0x5'));var Mustache=require(_0xab13('0x6'));var util=require(_0xab13('0x7'));var path=require(_0xab13('0x8'));var sox=require(_0xab13('0x9'));var csv=require(_0xab13('0xa'));var ejs=require(_0xab13('0xb'));var fs=require('fs');var fs_extra=require(_0xab13('0xc'));var _=require(_0xab13('0xd'));var squel=require('squel');var crypto=require(_0xab13('0xe'));var jsforce=require(_0xab13('0xf'));var deskjs=require(_0xab13('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xab13('0x11'));var Redis=require(_0xab13('0x12'));var authService=require(_0xab13('0x13'));var qs=require(_0xab13('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab13('0x15'));var logger=require(_0xab13('0x16'))(_0xab13('0x17'));var utils=require(_0xab13('0x18'));var config=require(_0xab13('0x19'));var licenseUtil=require(_0xab13('0x1a'));var db=require(_0xab13('0x1b'))['db'];config[_0xab13('0x1c')]=_[_0xab13('0x1d')](config['redis'],{'host':_0xab13('0x1e'),'port':0x18eb});var socket=require(_0xab13('0x1f'))(new Redis(config[_0xab13('0x1c')]));require(_0xab13('0x20'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xab13('0x21')]({'port':0x232c});var client9002=jayson[_0xab13('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d2cfd,_0x42e85e,_0x5b9b66,_0x3cb6f4){return new BPromise(function(_0xcfb8d8,_0x4868a9){var _0x608187=_0x3cb6f4||client;return _0x608187['request'](_0x2d2cfd,_0x5b9b66)[_0xab13('0x23')](function(_0x4c8cf9){logger[_0xab13('0x24')]('ChatMessage,\x20%s,\x20%s',_0x42e85e,'request\x20sent');logger[_0xab13('0x25')](_0xab13('0x26'),_0x42e85e,_0xab13('0x27'),JSON[_0xab13('0x28')](_0x4c8cf9));if(_0x4c8cf9['error']){if(_0x4c8cf9['error'][_0xab13('0x29')]===0x1f4){logger[_0xab13('0x2a')](_0xab13('0x2b'),_0x42e85e,_0x4c8cf9[_0xab13('0x2a')][_0xab13('0x2c')]);return _0x4868a9(_0x4c8cf9[_0xab13('0x2a')]['message']);}logger[_0xab13('0x2a')](_0xab13('0x2b'),_0x42e85e,_0x4c8cf9[_0xab13('0x2a')][_0xab13('0x2c')]);return _0xcfb8d8(_0x4c8cf9['error'][_0xab13('0x2c')]);}else{logger['info'](_0xab13('0x2b'),_0x42e85e,_0xab13('0x27'));_0xcfb8d8(_0x4c8cf9[_0xab13('0x2d')]['message']);}})['catch'](function(_0x32f8ce){logger[_0xab13('0x2a')](_0xab13('0x2b'),_0x42e85e,_0x32f8ce);_0x4868a9(_0x32f8ce);});});}function respondWithStatusCode(_0x16d52b,_0x5e3a5a){_0x5e3a5a=_0x5e3a5a||0xcc;return function(_0x5f38f4){if(_0x5f38f4){return _0x16d52b['sendStatus'](_0x5e3a5a);}return _0x16d52b['status'](_0x5e3a5a)[_0xab13('0x2e')]();};}function respondWithResult(_0x351126,_0x203ba6){_0x203ba6=_0x203ba6||0xc8;return function(_0x13576a){if(_0x13576a){return _0x351126['status'](_0x203ba6)[_0xab13('0x2f')](_0x13576a);}};}function respondWithFilteredResult(_0x1f8d22,_0x32703d){return function(_0x38e41a){if(_0x38e41a){var _0x33664f=typeof _0x32703d[_0xab13('0x30')]===_0xab13('0x31')&&typeof _0x32703d[_0xab13('0x32')]===_0xab13('0x31');var _0x24b5c4=_0x38e41a[_0xab13('0x33')];var _0x54a1da=_0x33664f?0x0:_0x32703d[_0xab13('0x30')];var _0x388629=_0x33664f?_0x38e41a[_0xab13('0x33')]:_0x32703d['offset']+_0x32703d[_0xab13('0x32')];var _0x59521f;if(_0x388629>=_0x24b5c4){_0x388629=_0x24b5c4;_0x59521f=0xc8;}else{_0x59521f=0xce;}_0x1f8d22[_0xab13('0x34')](_0x59521f);return _0x1f8d22['set'](_0xab13('0x35'),_0x54a1da+'-'+_0x388629+'/'+_0x24b5c4)['json'](_0x38e41a);}return null;};}function patchUpdates(_0x31a475){return function(_0x1a136f){try{jsonpatch[_0xab13('0x36')](_0x1a136f,_0x31a475,!![]);}catch(_0x358e1b){return BPromise['reject'](_0x358e1b);}return _0x1a136f[_0xab13('0x37')]();};}function saveUpdates(_0x3d14e2,_0x5cfd7a){return function(_0x47e893){if(_0x47e893){return _0x47e893[_0xab13('0x38')](_0x3d14e2)[_0xab13('0x23')](function(_0x3b81f7){return _0x3b81f7;});}return null;};}function removeEntity(_0x23a57d,_0x2546b1){return function(_0x224718){if(_0x224718){return _0x224718['destroy']()[_0xab13('0x23')](function(){_0x23a57d[_0xab13('0x34')](0xcc)[_0xab13('0x2e')]();});}};}function handleEntityNotFound(_0x32b9ea,_0x120b0e){return function(_0x401dc8){if(!_0x401dc8){_0x32b9ea[_0xab13('0x39')](0x194);}return _0x401dc8;};}function handleError(_0x70bcda,_0x543107){_0x543107=_0x543107||0x1f4;return function(_0x299f25){logger['error'](_0x299f25['stack']);if(_0x299f25[_0xab13('0x3a')]){delete _0x299f25[_0xab13('0x3a')];}_0x70bcda[_0xab13('0x34')](_0x543107)[_0xab13('0x3b')](_0x299f25);};}exports[_0xab13('0x3c')]=function(_0x55a19b,_0x59432d){var _0x5245a5={},_0x58254f={},_0x3e7461={'count':0x0,'rows':[]};var _0x2dd284=_[_0xab13('0x3d')](db[_0xab13('0x3e')][_0xab13('0x3f')],function(_0x507519){return{'name':_0x507519['fieldName'],'type':_0x507519[_0xab13('0x40')][_0xab13('0x41')]};});_0x58254f['model']=_[_0xab13('0x3d')](_0x2dd284,'name');_0x58254f['query']=_['keys'](_0x55a19b['query']);_0x58254f[_0xab13('0x42')]=_[_0xab13('0x43')](_0x58254f[_0xab13('0x44')],_0x58254f['query']);_0x5245a5[_0xab13('0x45')]=_[_0xab13('0x43')](_0x58254f['model'],qs[_0xab13('0x46')](_0x55a19b[_0xab13('0x47')][_0xab13('0x46')]));_0x5245a5[_0xab13('0x45')]=_0x5245a5[_0xab13('0x45')][_0xab13('0x48')]?_0x5245a5[_0xab13('0x45')]:_0x58254f['model'];if(!_0x55a19b['query'][_0xab13('0x49')](_0xab13('0x4a'))){_0x5245a5[_0xab13('0x32')]=qs[_0xab13('0x32')](_0x55a19b[_0xab13('0x47')][_0xab13('0x32')]);_0x5245a5[_0xab13('0x30')]=qs[_0xab13('0x30')](_0x55a19b[_0xab13('0x47')][_0xab13('0x30')]);}_0x5245a5[_0xab13('0x4b')]=qs[_0xab13('0x4c')](_0x55a19b[_0xab13('0x47')]['sort']);_0x5245a5[_0xab13('0x4d')]=qs[_0xab13('0x42')](_[_0xab13('0x4e')](_0x55a19b[_0xab13('0x47')],_0x58254f[_0xab13('0x42')]),_0x2dd284);if(_0x55a19b[_0xab13('0x47')][_0xab13('0x4f')]){_0x5245a5[_0xab13('0x4d')]=_[_0xab13('0x50')](_0x5245a5[_0xab13('0x4d')],{'$or':_[_0xab13('0x3d')](_0x2dd284,function(_0xe2558b){if(_0xe2558b[_0xab13('0x40')]!==_0xab13('0x51')){var _0x312efb={};_0x312efb[_0xe2558b[_0xab13('0x3a')]]={'$like':'%'+_0x55a19b[_0xab13('0x47')]['filter']+'%'};return _0x312efb;}})});}_0x5245a5=_[_0xab13('0x50')]({},_0x5245a5,_0x55a19b['options']);var _0x842ad8={'where':_0x5245a5[_0xab13('0x4d')]};return db[_0xab13('0x3e')]['count'](_0x842ad8)[_0xab13('0x23')](function(_0x3a2c32){_0x3e7461['count']=_0x3a2c32;if(_0x55a19b[_0xab13('0x47')][_0xab13('0x52')]){_0x5245a5[_0xab13('0x53')]=[{'all':!![]}];}return db[_0xab13('0x3e')][_0xab13('0x54')](_0x5245a5);})['then'](function(_0xc7273c){_0x3e7461[_0xab13('0x55')]=_0xc7273c;return _0x3e7461;})[_0xab13('0x23')](respondWithFilteredResult(_0x59432d,_0x5245a5))[_0xab13('0x56')](handleError(_0x59432d,null));};exports[_0xab13('0x57')]=function(_0xd24b55,_0x5abc13){var _0x427c57={'raw':!![],'where':{'id':_0xd24b55[_0xab13('0x58')]['id']}},_0x42914a={};_0x42914a[_0xab13('0x44')]=_[_0xab13('0x59')](db[_0xab13('0x3e')][_0xab13('0x3f')]);_0x42914a[_0xab13('0x47')]=_[_0xab13('0x59')](_0xd24b55[_0xab13('0x47')]);_0x42914a[_0xab13('0x42')]=_[_0xab13('0x43')](_0x42914a[_0xab13('0x44')],_0x42914a[_0xab13('0x47')]);_0x427c57['attributes']=_[_0xab13('0x43')](_0x42914a[_0xab13('0x44')],qs['fields'](_0xd24b55[_0xab13('0x47')]['fields']));_0x427c57[_0xab13('0x45')]=_0x427c57['attributes']['length']?_0x427c57[_0xab13('0x45')]:_0x42914a[_0xab13('0x44')];if(_0xd24b55[_0xab13('0x47')][_0xab13('0x52')]){_0x427c57[_0xab13('0x53')]=[{'all':!![]}];}_0x427c57=_[_0xab13('0x50')]({},_0x427c57,_0xd24b55[_0xab13('0x5a')]);return db[_0xab13('0x3e')][_0xab13('0x5b')](_0x427c57)[_0xab13('0x23')](handleEntityNotFound(_0x5abc13,null))[_0xab13('0x23')](respondWithResult(_0x5abc13,null))[_0xab13('0x56')](handleError(_0x5abc13,null));};exports[_0xab13('0x5c')]=function(_0x31390b,_0x5b514e){return db[_0xab13('0x3e')][_0xab13('0x5c')](_0x31390b[_0xab13('0x5d')],{})[_0xab13('0x23')](respondWithResult(_0x5b514e,0xc9))['catch'](handleError(_0x5b514e,null));};exports['update']=function(_0x21394d,_0x27731a){if(_0x21394d['body']['id']){delete _0x21394d[_0xab13('0x5d')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x21394d['params']['id']}})[_0xab13('0x23')](handleEntityNotFound(_0x27731a,null))[_0xab13('0x23')](saveUpdates(_0x21394d[_0xab13('0x5d')],null))['then'](respondWithResult(_0x27731a,null))[_0xab13('0x56')](handleError(_0x27731a,null));};exports['destroy']=function(_0x1b9adc,_0x133437){return db['ChatMessage'][_0xab13('0x5b')]({'where':{'id':_0x1b9adc[_0xab13('0x58')]['id']}})['then'](handleEntityNotFound(_0x133437,null))[_0xab13('0x23')](removeEntity(_0x133437,null))[_0xab13('0x56')](handleError(_0x133437,null));};exports['describe']=function(_0x305792,_0x4ae8fb){return db['ChatMessage']['describe']()[_0xab13('0x23')](respondWithResult(_0x4ae8fb,null))['catch'](handleError(_0x4ae8fb,null));};var interaction_log=require(_0xab13('0x16'))('chat-interactions');exports['accept']=function(_0x431eac,_0x542ae8,_0x3b5f16){var _0x2ab668={'agent':{},'channel':_0xab13('0x5e')};if(_0x431eac[_0xab13('0x5d')]['id']){delete _0x431eac['body']['id'];}_0x431eac['body'][_0xab13('0x5f')]=!![];_0x431eac[_0xab13('0x5d')][_0xab13('0x60')]=moment()['format'](_0xab13('0x61'));_0x431eac[_0xab13('0x5d')]['UserId']=_0x431eac['body'][_0xab13('0x62')]||_0x431eac[_0xab13('0x63')]['id'];_0x2ab668['agent']['id']=_0x431eac[_0xab13('0x5d')][_0xab13('0x62')];return db['ChatMessage'][_0xab13('0x5b')]({'where':{'id':_0x431eac[_0xab13('0x58')]['id'],'UserId':null}})[_0xab13('0x23')](handleEntityNotFound(_0x542ae8,null))[_0xab13('0x23')](saveUpdates(_0x431eac['body'],null))['then'](function(_0x4649e9){if(_0x4649e9){_0x2ab668[_0xab13('0x2c')]=_0x4649e9['get']({'plain':!![]});return db[_0xab13('0x64')][_0xab13('0x5b')]({'where':{'id':_0x4649e9[_0xab13('0x65')]}});}return null;})[_0xab13('0x23')](handleEntityNotFound(_0x542ae8,null))[_0xab13('0x23')](function(_0x214338){if(_0x214338){return _0x214338[_0xab13('0x38')]({'UserId':_0x431eac['body']['UserId'],'read1stAt':_[_0xab13('0x66')](_0x214338[_0xab13('0x67')])?moment()['format'](_0xab13('0x61')):undefined});}return null;})[_0xab13('0x23')](function(_0xf9b0cf){if(_0xf9b0cf){_0x2ab668[_0xab13('0x68')]=_0xf9b0cf['get']({'plain':!![]});interaction_log['info'](_0xab13('0x69'),_0x431eac[_0xab13('0x63')]['id'],_0x431eac[_0xab13('0x63')][_0xab13('0x3a')],_0x431eac[_0xab13('0x63')][_0xab13('0x6a')],_0x2ab668[_0xab13('0x68')]['id'],_0x431eac[_0xab13('0x5d')]?JSON['stringify'](_0x431eac['body']):_0xab13('0x6b'));return respondWithRpcPromise(_0xab13('0x6c'),_0xab13('0x6d'),_0x2ab668);}return null;})['then'](function(_0x5041f6){var _0xb0b8ec=_0xab13('0x6e')+_0x5041f6[_0xab13('0x2c')]['ContactId'];return db['sequelize']['query'](_0xb0b8ec,{'type':db['Sequelize'][_0xab13('0x6f')][_0xab13('0x70')],'raw':!![]})[_0xab13('0x23')](function(_0x723896){return _0x723896;});})[_0xab13('0x23')](function(_0x358758){if(_0x358758){_0x2ab668[_0xab13('0x2c')][_0xab13('0x71')]=_0x358758[0x0];if(!_0x431eac[_0xab13('0x5d')][_0xab13('0x62')])return;return db[_0xab13('0x72')][_0xab13('0x5b')]({'where':{'id':_0x431eac[_0xab13('0x5d')][_0xab13('0x62')],'role':_0xab13('0x73')},'attributes':['id','name',_0xab13('0x74'),_0xab13('0x75'),_0xab13('0x76')],'raw':!![]});}return null;})[_0xab13('0x23')](function(_0x4e9ef6){if(!_0x4e9ef6)return null;_0x2ab668[_0xab13('0x2c')][_0xab13('0x73')]=_0x4e9ef6;return _0x2ab668;})[_0xab13('0x23')](function(_0x153717){if(_0x153717){if(_0x431eac[_0xab13('0x5d')][_0xab13('0x77')]){_0x2ab668[_0xab13('0x2c')]['interface']=util['format']('SIP/%s',_0x431eac[_0xab13('0x63')][_0xab13('0x3a')]);_0x2ab668[_0xab13('0x2c')][_0xab13('0x78')]=_0x2ab668['channel'];_0x2ab668[_0xab13('0x2c')][_0xab13('0x79')]=_0x2ab668[_0xab13('0x78')];_0x2ab668[_0xab13('0x2c')][_0xab13('0x7a')]=_0xab13('0x7b');return respondWithRpcPromise(_0xab13('0x7c'),'EventManager',{'event':_0xab13('0x7d'),'message':_[_0xab13('0x50')](_0x2ab668[_0xab13('0x2c')],JSON[_0xab13('0x7e')](_0x2ab668[_0xab13('0x68')][_0xab13('0x7f')]))},client9002)[_0xab13('0x23')](function(){return _0x2ab668;});}return _0x2ab668;}return null;})[_0xab13('0x23')](respondWithResult(_0x542ae8,null))[_0xab13('0x56')](handleError(_0x542ae8,null));};var interaction_log=require(_0xab13('0x16'))(_0xab13('0x80'));exports['reject']=function(_0x571d49,_0xbde7b4,_0x2de912){var _0x57ee36={'agent':{},'channel':_0xab13('0x5e')};if(_0x571d49[_0xab13('0x5d')]['id']){delete _0x571d49[_0xab13('0x5d')]['id'];}_0x571d49[_0xab13('0x5d')][_0xab13('0x62')]=_0x571d49[_0xab13('0x5d')][_0xab13('0x62')]||_0x571d49[_0xab13('0x63')]['id'];_0x57ee36[_0xab13('0x73')]['id']=_0x571d49[_0xab13('0x5d')][_0xab13('0x62')];return db[_0xab13('0x3e')][_0xab13('0x5b')]({'where':{'id':_0x571d49[_0xab13('0x58')]['id'],'UserId':null}})[_0xab13('0x23')](handleEntityNotFound(_0xbde7b4,null))['then'](function(_0x117dec){if(_0x117dec){_0x57ee36[_0xab13('0x2c')]=_0x117dec[_0xab13('0x81')]({'plain':!![]});return db[_0xab13('0x64')][_0xab13('0x5b')]({'where':{'id':_0x117dec[_0xab13('0x65')]}});}return null;})[_0xab13('0x23')](handleEntityNotFound(_0xbde7b4,null))[_0xab13('0x23')](function(_0x3a1dc3){if(_0x3a1dc3){_0x57ee36['interaction']=_0x3a1dc3[_0xab13('0x81')]({'plain':!![]});interaction_log[_0xab13('0x24')](_0xab13('0x82'),_0x571d49[_0xab13('0x63')]['id'],_0x571d49[_0xab13('0x63')][_0xab13('0x3a')],_0x571d49[_0xab13('0x63')][_0xab13('0x6a')],_0x57ee36[_0xab13('0x68')]['id'],_0x571d49['body']?JSON[_0xab13('0x28')](_0x571d49[_0xab13('0x5d')]):'null');return respondWithRpcPromise(_0xab13('0x83'),'rejectMessage',_0x57ee36);}return null;})[_0xab13('0x23')](function(_0x26613e){var _0x389b58='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x26613e[_0xab13('0x2c')][_0xab13('0x84')];return db[_0xab13('0x85')][_0xab13('0x47')](_0x389b58,{'type':db[_0xab13('0x86')][_0xab13('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x4dbe30){return _0x4dbe30;});})[_0xab13('0x23')](function(_0x113459){if(_0x113459){_0x57ee36[_0xab13('0x2c')][_0xab13('0x71')]=_0x113459[0x0];if(!_0x571d49[_0xab13('0x5d')]['UserId'])return;return db['User']['find']({'where':{'id':_0x571d49[_0xab13('0x5d')][_0xab13('0x62')],'role':_0xab13('0x73')},'attributes':['id',_0xab13('0x3a'),_0xab13('0x74'),_0xab13('0x75'),_0xab13('0x76')],'raw':!![]});}return null;})['then'](function(_0x33d718){if(!_0x33d718)return null;_0x57ee36[_0xab13('0x2c')][_0xab13('0x73')]=_0x33d718;return _0x57ee36;})[_0xab13('0x23')](function(_0x88cd6c){if(_0x88cd6c){_0x88cd6c[_0xab13('0x2c')][_0xab13('0x87')]=util['format']('SIP/%s',_0x571d49[_0xab13('0x63')][_0xab13('0x3a')]);_0x88cd6c[_0xab13('0x2c')]['channel']=_0x57ee36[_0xab13('0x78')];_0x88cd6c['message'][_0xab13('0x79')]=_0x57ee36[_0xab13('0x78')];_0x88cd6c[_0xab13('0x2c')]['event']='reject';respondWithRpcPromise(_0xab13('0x7c'),_0xab13('0x7c'),{'event':_0xab13('0x88'),'message':_['merge'](_0x57ee36[_0xab13('0x2c')],JSON[_0xab13('0x7e')](_0x57ee36[_0xab13('0x68')][_0xab13('0x7f')]))},client9002);return _0x57ee36;}return null;})['then'](respondWithResult(_0xbde7b4,null))[_0xab13('0x56')](handleError(_0xbde7b4,null));};
\ No newline at end of file
+var _0x1b03=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','ChatMessage','includeAll','findAll','catch','show','params','keys','find','create','body','update','describe','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','read1stAt','format','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','ContactId','contact','internal','interface','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x1b03,0x190));var _0x31b0=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1b03[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x31b0('0x0'));var rimraf=require(_0x31b0('0x1'));var zipdir=require(_0x31b0('0x2'));var jsonpatch=require(_0x31b0('0x3'));var rp=require(_0x31b0('0x4'));var moment=require(_0x31b0('0x5'));var BPromise=require(_0x31b0('0x6'));var Mustache=require('mustache');var util=require(_0x31b0('0x7'));var path=require(_0x31b0('0x8'));var sox=require(_0x31b0('0x9'));var csv=require('to-csv');var ejs=require(_0x31b0('0xa'));var fs=require('fs');var fs_extra=require(_0x31b0('0xb'));var _=require(_0x31b0('0xc'));var squel=require('squel');var crypto=require(_0x31b0('0xd'));var jsforce=require(_0x31b0('0xe'));var deskjs=require(_0x31b0('0xf'));var toCsv=require(_0x31b0('0x10'));var querystring=require(_0x31b0('0x11'));var Papa=require(_0x31b0('0x12'));var Redis=require(_0x31b0('0x13'));var authService=require(_0x31b0('0x14'));var qs=require(_0x31b0('0x15'));var as=require(_0x31b0('0x16'));var hardwareService=require(_0x31b0('0x17'));var logger=require(_0x31b0('0x18'))('api');var utils=require(_0x31b0('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x31b0('0x1a'));var db=require(_0x31b0('0x1b'))['db'];config[_0x31b0('0x1c')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x31b0('0x1d'))(new Redis(config[_0x31b0('0x1c')]));require(_0x31b0('0x1e'))[_0x31b0('0x1f')](socket);var jayson=require(_0x31b0('0x20'));var client=jayson[_0x31b0('0x21')][_0x31b0('0x22')]({'port':0x232c});var client9002=jayson[_0x31b0('0x21')][_0x31b0('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x4ba9e8,_0x5c2618,_0xf6a73a,_0x52a65a){return new BPromise(function(_0x20a2b1,_0x4f42a3){var _0x53e2d8=_0x52a65a||client;return _0x53e2d8[_0x31b0('0x23')](_0x4ba9e8,_0xf6a73a)[_0x31b0('0x24')](function(_0x349571){logger[_0x31b0('0x25')]('ChatMessage,\x20%s,\x20%s',_0x5c2618,_0x31b0('0x26'));logger[_0x31b0('0x27')](_0x31b0('0x28'),_0x5c2618,_0x31b0('0x26'),JSON[_0x31b0('0x29')](_0x349571));if(_0x349571[_0x31b0('0x2a')]){if(_0x349571[_0x31b0('0x2a')][_0x31b0('0x2b')]===0x1f4){logger['error'](_0x31b0('0x2c'),_0x5c2618,_0x349571['error']['message']);return _0x4f42a3(_0x349571[_0x31b0('0x2a')][_0x31b0('0x2d')]);}logger[_0x31b0('0x2a')](_0x31b0('0x2c'),_0x5c2618,_0x349571['error'][_0x31b0('0x2d')]);return _0x20a2b1(_0x349571[_0x31b0('0x2a')]['message']);}else{logger[_0x31b0('0x25')](_0x31b0('0x2c'),_0x5c2618,_0x31b0('0x26'));_0x20a2b1(_0x349571[_0x31b0('0x2e')]['message']);}})['catch'](function(_0x5eb8b8){logger[_0x31b0('0x2a')](_0x31b0('0x2c'),_0x5c2618,_0x5eb8b8);_0x4f42a3(_0x5eb8b8);});});}function respondWithStatusCode(_0x3b65cf,_0x16c0dd){_0x16c0dd=_0x16c0dd||0xcc;return function(_0x682042){if(_0x682042){return _0x3b65cf[_0x31b0('0x2f')](_0x16c0dd);}return _0x3b65cf['status'](_0x16c0dd)[_0x31b0('0x30')]();};}function respondWithResult(_0x44f2bf,_0xd205b9){_0xd205b9=_0xd205b9||0xc8;return function(_0x5c572f){if(_0x5c572f){return _0x44f2bf[_0x31b0('0x31')](_0xd205b9)[_0x31b0('0x32')](_0x5c572f);}};}function respondWithFilteredResult(_0x5974fc,_0x48797c){return function(_0x1d5e5d){if(_0x1d5e5d){var _0x579d89=typeof _0x48797c['offset']===_0x31b0('0x33')&&typeof _0x48797c[_0x31b0('0x34')]===_0x31b0('0x33');var _0x19eed5=_0x1d5e5d[_0x31b0('0x35')];var _0x17554c=_0x579d89?0x0:_0x48797c[_0x31b0('0x36')];var _0x4f902d=_0x579d89?_0x1d5e5d[_0x31b0('0x35')]:_0x48797c[_0x31b0('0x36')]+_0x48797c['limit'];var _0x26fab9;if(_0x4f902d>=_0x19eed5){_0x4f902d=_0x19eed5;_0x26fab9=0xc8;}else{_0x26fab9=0xce;}_0x5974fc[_0x31b0('0x31')](_0x26fab9);return _0x5974fc[_0x31b0('0x37')](_0x31b0('0x38'),_0x17554c+'-'+_0x4f902d+'/'+_0x19eed5)[_0x31b0('0x32')](_0x1d5e5d);}return null;};}function patchUpdates(_0x28a9c0){return function(_0x1b5f12){try{jsonpatch[_0x31b0('0x39')](_0x1b5f12,_0x28a9c0,!![]);}catch(_0x4c191b){return BPromise[_0x31b0('0x3a')](_0x4c191b);}return _0x1b5f12['save']();};}function saveUpdates(_0x465f33,_0x36c8af){return function(_0x39db3a){if(_0x39db3a){return _0x39db3a['update'](_0x465f33)[_0x31b0('0x24')](function(_0x5b24c8){return _0x5b24c8;});}return null;};}function removeEntity(_0x483c98,_0x491b6e){return function(_0x33ab44){if(_0x33ab44){return _0x33ab44[_0x31b0('0x3b')]()[_0x31b0('0x24')](function(){_0x483c98[_0x31b0('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20c10d,_0x4c1d69){return function(_0x2e56a2){if(!_0x2e56a2){_0x20c10d[_0x31b0('0x2f')](0x194);}return _0x2e56a2;};}function handleError(_0x19c412,_0x1ef7ee){_0x1ef7ee=_0x1ef7ee||0x1f4;return function(_0x21eebd){logger[_0x31b0('0x2a')](_0x21eebd[_0x31b0('0x3c')]);if(_0x21eebd[_0x31b0('0x3d')]){delete _0x21eebd['name'];}_0x19c412['status'](_0x1ef7ee)[_0x31b0('0x3e')](_0x21eebd);};}exports['index']=function(_0x2dd93e,_0x4c01e3){var _0x5e7237={},_0x45c661={},_0x38321b={'count':0x0,'rows':[]};var _0x1a6d91=_[_0x31b0('0x3f')](db['ChatMessage'][_0x31b0('0x40')],function(_0xb2fd28){return{'name':_0xb2fd28[_0x31b0('0x41')],'type':_0xb2fd28[_0x31b0('0x42')][_0x31b0('0x43')]};});_0x45c661[_0x31b0('0x44')]=_[_0x31b0('0x3f')](_0x1a6d91,_0x31b0('0x3d'));_0x45c661[_0x31b0('0x45')]=_['keys'](_0x2dd93e[_0x31b0('0x45')]);_0x45c661[_0x31b0('0x46')]=_[_0x31b0('0x47')](_0x45c661['model'],_0x45c661[_0x31b0('0x45')]);_0x5e7237[_0x31b0('0x48')]=_[_0x31b0('0x47')](_0x45c661[_0x31b0('0x44')],qs[_0x31b0('0x49')](_0x2dd93e[_0x31b0('0x45')]['fields']));_0x5e7237[_0x31b0('0x48')]=_0x5e7237['attributes'][_0x31b0('0x4a')]?_0x5e7237[_0x31b0('0x48')]:_0x45c661['model'];if(!_0x2dd93e[_0x31b0('0x45')][_0x31b0('0x4b')](_0x31b0('0x4c'))){_0x5e7237[_0x31b0('0x34')]=qs[_0x31b0('0x34')](_0x2dd93e[_0x31b0('0x45')]['limit']);_0x5e7237['offset']=qs[_0x31b0('0x36')](_0x2dd93e['query']['offset']);}_0x5e7237[_0x31b0('0x4d')]=qs[_0x31b0('0x4e')](_0x2dd93e[_0x31b0('0x45')][_0x31b0('0x4e')]);_0x5e7237['where']=qs[_0x31b0('0x46')](_[_0x31b0('0x4f')](_0x2dd93e['query'],_0x45c661[_0x31b0('0x46')]),_0x1a6d91);if(_0x2dd93e[_0x31b0('0x45')][_0x31b0('0x50')]){_0x5e7237[_0x31b0('0x51')]=_[_0x31b0('0x52')](_0x5e7237['where'],{'$or':_[_0x31b0('0x3f')](_0x1a6d91,function(_0x3abdeb){if(_0x3abdeb[_0x31b0('0x42')]!=='VIRTUAL'){var _0x231a9b={};_0x231a9b[_0x3abdeb[_0x31b0('0x3d')]]={'$like':'%'+_0x2dd93e['query'][_0x31b0('0x50')]+'%'};return _0x231a9b;}})});}_0x5e7237=_[_0x31b0('0x52')]({},_0x5e7237,_0x2dd93e[_0x31b0('0x53')]);var _0x3a759f={'where':_0x5e7237[_0x31b0('0x51')]};return db[_0x31b0('0x54')][_0x31b0('0x35')](_0x3a759f)['then'](function(_0x21c896){_0x38321b['count']=_0x21c896;if(_0x2dd93e[_0x31b0('0x45')][_0x31b0('0x55')]){_0x5e7237['include']=[{'all':!![]}];}return db[_0x31b0('0x54')][_0x31b0('0x56')](_0x5e7237);})[_0x31b0('0x24')](function(_0x124549){_0x38321b['rows']=_0x124549;return _0x38321b;})['then'](respondWithFilteredResult(_0x4c01e3,_0x5e7237))[_0x31b0('0x57')](handleError(_0x4c01e3,null));};exports[_0x31b0('0x58')]=function(_0xbdfbec,_0x97a37f){var _0x57c2d1={'raw':!![],'where':{'id':_0xbdfbec[_0x31b0('0x59')]['id']}},_0x5d71d5={};_0x5d71d5[_0x31b0('0x44')]=_['keys'](db[_0x31b0('0x54')]['rawAttributes']);_0x5d71d5[_0x31b0('0x45')]=_[_0x31b0('0x5a')](_0xbdfbec[_0x31b0('0x45')]);_0x5d71d5['filters']=_[_0x31b0('0x47')](_0x5d71d5[_0x31b0('0x44')],_0x5d71d5[_0x31b0('0x45')]);_0x57c2d1[_0x31b0('0x48')]=_[_0x31b0('0x47')](_0x5d71d5[_0x31b0('0x44')],qs[_0x31b0('0x49')](_0xbdfbec[_0x31b0('0x45')][_0x31b0('0x49')]));_0x57c2d1[_0x31b0('0x48')]=_0x57c2d1[_0x31b0('0x48')]['length']?_0x57c2d1[_0x31b0('0x48')]:_0x5d71d5[_0x31b0('0x44')];if(_0xbdfbec[_0x31b0('0x45')][_0x31b0('0x55')]){_0x57c2d1['include']=[{'all':!![]}];}_0x57c2d1=_[_0x31b0('0x52')]({},_0x57c2d1,_0xbdfbec['options']);return db[_0x31b0('0x54')][_0x31b0('0x5b')](_0x57c2d1)[_0x31b0('0x24')](handleEntityNotFound(_0x97a37f,null))[_0x31b0('0x24')](respondWithResult(_0x97a37f,null))['catch'](handleError(_0x97a37f,null));};exports[_0x31b0('0x5c')]=function(_0x28e225,_0x603d0e){return db[_0x31b0('0x54')][_0x31b0('0x5c')](_0x28e225[_0x31b0('0x5d')],{})['then'](respondWithResult(_0x603d0e,0xc9))['catch'](handleError(_0x603d0e,null));};exports[_0x31b0('0x5e')]=function(_0x29392d,_0x2afc96){if(_0x29392d[_0x31b0('0x5d')]['id']){delete _0x29392d['body']['id'];}return db[_0x31b0('0x54')][_0x31b0('0x5b')]({'where':{'id':_0x29392d['params']['id']}})[_0x31b0('0x24')](handleEntityNotFound(_0x2afc96,null))[_0x31b0('0x24')](saveUpdates(_0x29392d[_0x31b0('0x5d')],null))[_0x31b0('0x24')](respondWithResult(_0x2afc96,null))[_0x31b0('0x57')](handleError(_0x2afc96,null));};exports[_0x31b0('0x3b')]=function(_0x843ccb,_0x49f777){return db[_0x31b0('0x54')][_0x31b0('0x5b')]({'where':{'id':_0x843ccb[_0x31b0('0x59')]['id']}})[_0x31b0('0x24')](handleEntityNotFound(_0x49f777,null))[_0x31b0('0x24')](removeEntity(_0x49f777,null))[_0x31b0('0x57')](handleError(_0x49f777,null));};exports[_0x31b0('0x5f')]=function(_0x151c3b,_0x15bf7b){return db['ChatMessage']['describe']()[_0x31b0('0x24')](respondWithResult(_0x15bf7b,null))[_0x31b0('0x57')](handleError(_0x15bf7b,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x31b0('0x60')]=function(_0x4ad449,_0x219fff,_0xd701bb){var _0x28f00e={'agent':{},'channel':_0x31b0('0x61')};if(_0x4ad449[_0x31b0('0x5d')]['id']){delete _0x4ad449[_0x31b0('0x5d')]['id'];}_0x4ad449[_0x31b0('0x5d')][_0x31b0('0x62')]=!![];_0x4ad449[_0x31b0('0x5d')][_0x31b0('0x63')]=moment()['format'](_0x31b0('0x64'));_0x4ad449['body'][_0x31b0('0x65')]=_0x4ad449[_0x31b0('0x5d')][_0x31b0('0x65')]||_0x4ad449[_0x31b0('0x66')]['id'];_0x28f00e['agent']['id']=_0x4ad449[_0x31b0('0x5d')][_0x31b0('0x65')];return db['ChatMessage'][_0x31b0('0x5b')]({'where':{'id':_0x4ad449[_0x31b0('0x59')]['id'],'UserId':null}})[_0x31b0('0x24')](handleEntityNotFound(_0x219fff,null))['then'](saveUpdates(_0x4ad449[_0x31b0('0x5d')],null))['then'](function(_0x3dfb05){if(_0x3dfb05){_0x28f00e[_0x31b0('0x2d')]=_0x3dfb05[_0x31b0('0x67')]({'plain':!![]});return db[_0x31b0('0x68')][_0x31b0('0x5b')]({'where':{'id':_0x3dfb05[_0x31b0('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x219fff,null))[_0x31b0('0x24')](function(_0x430496){if(_0x430496){return _0x430496[_0x31b0('0x5e')]({'UserId':_0x4ad449[_0x31b0('0x5d')][_0x31b0('0x65')],'read1stAt':_['isNil'](_0x430496[_0x31b0('0x6a')])?moment()[_0x31b0('0x6b')](_0x31b0('0x64')):undefined});}return null;})[_0x31b0('0x24')](function(_0x1ad05a){if(_0x1ad05a){_0x28f00e[_0x31b0('0x6c')]=_0x1ad05a[_0x31b0('0x67')]({'plain':!![]});interaction_log[_0x31b0('0x25')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4ad449[_0x31b0('0x66')]['id'],_0x4ad449['user'][_0x31b0('0x3d')],_0x4ad449['user'][_0x31b0('0x6d')],_0x28f00e[_0x31b0('0x6c')]['id'],_0x4ad449['body']?JSON['stringify'](_0x4ad449[_0x31b0('0x5d')]):_0x31b0('0x6e'));return respondWithRpcPromise(_0x31b0('0x6f'),_0x31b0('0x70'),_0x28f00e);}return null;})[_0x31b0('0x24')](function(_0x47e329){var _0xb4f49c=_0x31b0('0x71')+_0x47e329[_0x31b0('0x2d')]['ContactId'];return db[_0x31b0('0x72')][_0x31b0('0x45')](_0xb4f49c,{'type':db[_0x31b0('0x73')][_0x31b0('0x74')][_0x31b0('0x75')],'raw':!![]})[_0x31b0('0x24')](function(_0x2d2446){return _0x2d2446;});})['then'](function(_0x2f0b4a){if(_0x2f0b4a){_0x28f00e[_0x31b0('0x2d')]['contact']=_0x2f0b4a[0x0];if(!_0x4ad449[_0x31b0('0x5d')][_0x31b0('0x65')])return;return db[_0x31b0('0x76')][_0x31b0('0x5b')]({'where':{'id':_0x4ad449[_0x31b0('0x5d')][_0x31b0('0x65')],'role':_0x31b0('0x77')},'attributes':['id',_0x31b0('0x3d'),_0x31b0('0x78'),_0x31b0('0x79'),'internal'],'raw':!![]});}return null;})['then'](function(_0x20fba3){if(!_0x20fba3)return null;_0x28f00e[_0x31b0('0x2d')][_0x31b0('0x77')]=_0x20fba3;return _0x28f00e;})[_0x31b0('0x24')](function(_0xade74e){if(_0xade74e){if(_0x4ad449['body'][_0x31b0('0x7a')]){_0x28f00e['message']['interface']=util['format'](_0x31b0('0x7b'),_0x4ad449[_0x31b0('0x66')][_0x31b0('0x3d')]);_0x28f00e[_0x31b0('0x2d')][_0x31b0('0x7c')]=_0x28f00e['channel'];_0x28f00e[_0x31b0('0x2d')][_0x31b0('0x7d')]=_0x28f00e[_0x31b0('0x7c')];_0x28f00e['message'][_0x31b0('0x7e')]=_0x31b0('0x60');return respondWithRpcPromise(_0x31b0('0x7f'),'EventManager',{'event':_0x31b0('0x80'),'message':_['merge'](_0x28f00e[_0x31b0('0x2d')],JSON[_0x31b0('0x81')](_0x28f00e[_0x31b0('0x6c')][_0x31b0('0x82')]))},client9002)[_0x31b0('0x24')](function(){return _0x28f00e;});}return _0x28f00e;}return null;})[_0x31b0('0x24')](respondWithResult(_0x219fff,null))[_0x31b0('0x57')](handleError(_0x219fff,null));};var interaction_log=require(_0x31b0('0x18'))(_0x31b0('0x83'));exports[_0x31b0('0x3a')]=function(_0xc60d5b,_0x4b0cb0,_0xcad88d){var _0x113c3f={'agent':{},'channel':'chat'};if(_0xc60d5b['body']['id']){delete _0xc60d5b[_0x31b0('0x5d')]['id'];}_0xc60d5b[_0x31b0('0x5d')][_0x31b0('0x65')]=_0xc60d5b[_0x31b0('0x5d')][_0x31b0('0x65')]||_0xc60d5b[_0x31b0('0x66')]['id'];_0x113c3f[_0x31b0('0x77')]['id']=_0xc60d5b[_0x31b0('0x5d')][_0x31b0('0x65')];return db[_0x31b0('0x54')][_0x31b0('0x5b')]({'where':{'id':_0xc60d5b['params']['id'],'UserId':null}})[_0x31b0('0x24')](handleEntityNotFound(_0x4b0cb0,null))['then'](function(_0x35ebd3){if(_0x35ebd3){_0x113c3f[_0x31b0('0x2d')]=_0x35ebd3[_0x31b0('0x67')]({'plain':!![]});return db['ChatInteraction'][_0x31b0('0x5b')]({'where':{'id':_0x35ebd3['ChatInteractionId']}});}return null;})[_0x31b0('0x24')](handleEntityNotFound(_0x4b0cb0,null))[_0x31b0('0x24')](function(_0x429883){if(_0x429883){_0x113c3f[_0x31b0('0x6c')]=_0x429883[_0x31b0('0x67')]({'plain':!![]});interaction_log[_0x31b0('0x25')](_0x31b0('0x84'),_0xc60d5b[_0x31b0('0x66')]['id'],_0xc60d5b[_0x31b0('0x66')]['name'],_0xc60d5b[_0x31b0('0x66')][_0x31b0('0x6d')],_0x113c3f[_0x31b0('0x6c')]['id'],_0xc60d5b[_0x31b0('0x5d')]?JSON[_0x31b0('0x29')](_0xc60d5b[_0x31b0('0x5d')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x113c3f);}return null;})[_0x31b0('0x24')](function(_0x2e8eb1){var _0x348a87=_0x31b0('0x71')+_0x2e8eb1[_0x31b0('0x2d')][_0x31b0('0x85')];return db[_0x31b0('0x72')]['query'](_0x348a87,{'type':db['Sequelize'][_0x31b0('0x74')][_0x31b0('0x75')],'raw':!![]})[_0x31b0('0x24')](function(_0x39f095){return _0x39f095;});})['then'](function(_0x4d3e7a){if(_0x4d3e7a){_0x113c3f[_0x31b0('0x2d')][_0x31b0('0x86')]=_0x4d3e7a[0x0];if(!_0xc60d5b[_0x31b0('0x5d')][_0x31b0('0x65')])return;return db[_0x31b0('0x76')]['find']({'where':{'id':_0xc60d5b[_0x31b0('0x5d')][_0x31b0('0x65')],'role':_0x31b0('0x77')},'attributes':['id',_0x31b0('0x3d'),_0x31b0('0x78'),_0x31b0('0x79'),_0x31b0('0x87')],'raw':!![]});}return null;})[_0x31b0('0x24')](function(_0x4bf925){if(!_0x4bf925)return null;_0x113c3f[_0x31b0('0x2d')]['agent']=_0x4bf925;return _0x113c3f;})['then'](function(_0x451153){if(_0x451153){_0x451153[_0x31b0('0x2d')][_0x31b0('0x88')]=util[_0x31b0('0x6b')](_0x31b0('0x7b'),_0xc60d5b[_0x31b0('0x66')]['name']);_0x451153[_0x31b0('0x2d')]['channel']=_0x113c3f[_0x31b0('0x7c')];_0x451153['message'][_0x31b0('0x7d')]=_0x113c3f['channel'];_0x451153[_0x31b0('0x2d')][_0x31b0('0x7e')]=_0x31b0('0x3a');respondWithRpcPromise(_0x31b0('0x7f'),_0x31b0('0x7f'),{'event':_0x31b0('0x89'),'message':_[_0x31b0('0x52')](_0x113c3f[_0x31b0('0x2d')],JSON[_0x31b0('0x81')](_0x113c3f['interaction']['formData']))},client9002);return _0x113c3f;}return null;})[_0x31b0('0x24')](respondWithResult(_0x4b0cb0,null))[_0x31b0('0x57')](handleError(_0x4b0cb0,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index c91aa73..235d076 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 _0x3b59=['hook','exports','events','../../mysqldb','ChatMessage','save','remove','emit'];(function(_0x31fc7d,_0x1b97e5){var _0x50b1bb=function(_0x506980){while(--_0x506980){_0x31fc7d['push'](_0x31fc7d['shift']());}};_0x50b1bb(++_0x1b97e5);}(_0x3b59,0xb2));var _0x93b5=function(_0x3f7a85,_0x165430){_0x3f7a85=_0x3f7a85-0x0;var _0x3bddbd=_0x3b59[_0x3f7a85];return _0x3bddbd;};'use strict';var EventEmitter=require(_0x93b5('0x0'));var ChatMessage=require(_0x93b5('0x1'))['db'][_0x93b5('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x93b5('0x3'),'afterUpdate':'update','afterDestroy':_0x93b5('0x4')};function emitEvent(_0xb42f55){return function(_0x166110,_0x3280e4,_0x109e73){ChatMessageEvents['emit'](_0xb42f55+':'+_0x166110['id'],_0x166110);ChatMessageEvents[_0x93b5('0x5')](_0xb42f55,_0x166110);_0x109e73(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x93b5('0x6')](e,emitEvent(event));}}module[_0x93b5('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x42d9=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x42d9,0x14d));var _0x942d=function(_0x17aa7a,_0x2be8e4){_0x17aa7a=_0x17aa7a-0x0;var _0x2321f8=_0x42d9[_0x17aa7a];return _0x2321f8;};'use strict';var EventEmitter=require(_0x942d('0x0'));var ChatMessage=require(_0x942d('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x942d('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1186b8){return function(_0xe26964,_0x5e03d1,_0x31cc6e){ChatMessageEvents['emit'](_0x1186b8+':'+_0xe26964['id'],_0xe26964);ChatMessageEvents[_0x942d('0x3')](_0x1186b8,_0xe26964);_0x31cc6e(null);};}for(var e in events){if(events[_0x942d('0x4')](e)){var event=events[e];ChatMessage[_0x942d('0x5')](e,emitEvent(event));}}module[_0x942d('0x6')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 8a71839..2d67734 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 _0x048f=['isNil','ChatInteraction','findOne','ChatInteractionId','then','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','toLowerCase','direction','out'];(function(_0x21322f,_0x483b21){var _0x33e9d1=function(_0x24b3c5){while(--_0x24b3c5){_0x21322f['push'](_0x21322f['shift']());}};_0x33e9d1(++_0x483b21);}(_0x048f,0xcd));var _0xf048=function(_0x3d91a1,_0x35073a){_0x3d91a1=_0x3d91a1-0x0;var _0x1c2f8f=_0x048f[_0x3d91a1];return _0x1c2f8f;};'use strict';var _=require(_0xf048('0x0'));var util=require(_0xf048('0x1'));var logger=require(_0xf048('0x2'))(_0xf048('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf048('0x4'));var fs=require('fs');var path=require(_0xf048('0x5'));var rimraf=require(_0xf048('0x6'));var config=require(_0xf048('0x7'));var attributes=require(_0xf048('0x8'));module[_0xf048('0x9')]=function(_0x766333,_0xa9a18b){return _0x766333[_0xf048('0xa')](_0xf048('0xb'),attributes,{'tableName':_0xf048('0xc'),'paranoid':![],'indexes':[{'name':_0xf048('0xd'),'fields':['body'],'type':_0xf048('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x513f6c,_0x3faa04,_0x2a160c){var _0x477835=_0x766333[_0xf048('0xf')];var _0x34e4f9=_0x513f6c['get']({'plain':!![]});if(_0x34e4f9['direction'][_0xf048('0x10')]()==='in'||_0x34e4f9[_0xf048('0x11')][_0xf048('0x10')]()===_0xf048('0x12')&&!_0x34e4f9['secret']&&!_[_0xf048('0x13')](_0x34e4f9['UserId'])){_0x477835[_0xf048('0x14')][_0xf048('0x15')]({'where':{'id':_0x34e4f9[_0xf048('0x16')]}})[_0xf048('0x17')](function(_0x202932){if(_0x202932){_0x202932['update']({'lastMsgAt':_0x34e4f9['createdAt'],'lastMsgDirection':_0x34e4f9['direction'][_0xf048('0x10')]()});}})[_0xf048('0x18')](function(_0x53f2a5){console[_0xf048('0x19')](_0x53f2a5);});}_0x2a160c();}},'charset':_0xf048('0x1a'),'collate':_0xf048('0x1b')});};
\ No newline at end of file
+var _0x89c3=['direction','toLowerCase','out','UserId','ChatInteraction','findOne','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','fti_chat_messages','body','FULLTEXT','models'];(function(_0x25e350,_0x43988b){var _0x4391b8=function(_0x4beaa0){while(--_0x4beaa0){_0x25e350['push'](_0x25e350['shift']());}};_0x4391b8(++_0x43988b);}(_0x89c3,0xff));var _0x389c=function(_0x86e220,_0x3a8190){_0x86e220=_0x86e220-0x0;var _0x327dfe=_0x89c3[_0x86e220];return _0x327dfe;};'use strict';var _=require(_0x389c('0x0'));var util=require(_0x389c('0x1'));var logger=require(_0x389c('0x2'))(_0x389c('0x3'));var moment=require(_0x389c('0x4'));var BPromise=require(_0x389c('0x5'));var rp=require(_0x389c('0x6'));var fs=require('fs');var path=require(_0x389c('0x7'));var rimraf=require('rimraf');var config=require(_0x389c('0x8'));var attributes=require('./chatMessage.attributes');module[_0x389c('0x9')]=function(_0x4bece6,_0x51f5f5){return _0x4bece6[_0x389c('0xa')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x389c('0xb'),'fields':[_0x389c('0xc')],'type':_0x389c('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2efa82,_0x41c92b,_0x1c574b){var _0x2a7d64=_0x4bece6[_0x389c('0xe')];var _0x13b41=_0x2efa82['get']({'plain':!![]});if(_0x13b41[_0x389c('0xf')][_0x389c('0x10')]()==='in'||_0x13b41[_0x389c('0xf')][_0x389c('0x10')]()===_0x389c('0x11')&&!_0x13b41['secret']&&!_['isNil'](_0x13b41[_0x389c('0x12')])){_0x2a7d64[_0x389c('0x13')][_0x389c('0x14')]({'where':{'id':_0x13b41['ChatInteractionId']}})[_0x389c('0x15')](function(_0x4bde6d){if(_0x4bde6d){_0x4bde6d[_0x389c('0x16')]({'lastMsgAt':_0x13b41[_0x389c('0x17')],'lastMsgDirection':_0x13b41['direction'][_0x389c('0x10')]()});}})[_0x389c('0x18')](function(_0x36c118){console['error'](_0x36c118);});}_0x1c574b();}},'charset':_0x389c('0x19'),'collate':_0x389c('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 68552c7..8fa70fd 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 _0x427e=['client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x78d885,_0x19dec7){var _0x317585=function(_0x3da287){while(--_0x3da287){_0x78d885['push'](_0x78d885['shift']());}};_0x317585(++_0x19dec7);}(_0x427e,0x11a));var _0xe427=function(_0x108c50,_0x1d4f5e){_0x108c50=_0x108c50-0x0;var _0x12b058=_0x427e[_0x108c50];return _0x12b058;};'use strict';var _=require(_0xe427('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe427('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe427('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xe427('0x3'))(_0xe427('0x4'));var config=require('../../config/environment');var jayson=require(_0xe427('0x5'));var client=jayson[_0xe427('0x6')][_0xe427('0x7')]({'port':0x232a});config[_0xe427('0x8')]=_[_0xe427('0x9')](config[_0xe427('0x8')],{'host':_0xe427('0xa'),'port':0x18eb});var socket=require(_0xe427('0xb'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xe427('0xc')](socket);function respondWithRpcPromise(_0x1416b6,_0x381c7f,_0x25a1bc){return new BPromise(function(_0x3b3f9d,_0x2aecd7){return client[_0xe427('0xd')](_0x1416b6,_0x25a1bc)[_0xe427('0xe')](function(_0x5f2fad){logger['info'](_0xe427('0xf'),_0x381c7f,_0xe427('0x10'));logger['debug'](_0xe427('0x11'),_0x381c7f,_0xe427('0x10'),JSON[_0xe427('0x12')](_0x5f2fad));if(_0x5f2fad[_0xe427('0x13')]){if(_0x5f2fad[_0xe427('0x13')][_0xe427('0x14')]===0x1f4){logger[_0xe427('0x13')](_0xe427('0xf'),_0x381c7f,_0x5f2fad[_0xe427('0x13')]['message']);return _0x2aecd7(_0x5f2fad['error'][_0xe427('0x15')]);}logger[_0xe427('0x13')](_0xe427('0xf'),_0x381c7f,_0x5f2fad['error'][_0xe427('0x15')]);return _0x3b3f9d(_0x5f2fad[_0xe427('0x13')][_0xe427('0x15')]);}else{logger[_0xe427('0x16')](_0xe427('0xf'),_0x381c7f,'request\x20sent');_0x3b3f9d(_0x5f2fad[_0xe427('0x17')][_0xe427('0x15')]);}})[_0xe427('0x18')](function(_0x58637e){logger[_0xe427('0x13')](_0xe427('0xf'),_0x381c7f,_0x58637e);_0x2aecd7(_0x58637e);});});}exports[_0xe427('0x19')]=function(_0x1c49dc){var _0x5bc6ac=this;return new Promise(function(_0x5b1ef9,_0x219dde){return db[_0xe427('0x1a')][_0xe427('0x1b')](_0x1c49dc[_0xe427('0x1c')],{'raw':_0x1c49dc[_0xe427('0x1d')]?_0x1c49dc[_0xe427('0x1d')][_0xe427('0x1e')]===undefined?!![]:![]:!![]})[_0xe427('0xe')](function(_0x283bc4){logger['info'](_0xe427('0x19'),_0x1c49dc);logger[_0xe427('0x1f')](_0xe427('0x19'),_0x1c49dc,JSON[_0xe427('0x12')](_0x283bc4));_0x5b1ef9(_0x283bc4);})[_0xe427('0x18')](function(_0x90c4ce){logger['error'](_0xe427('0x19'),_0x90c4ce[_0xe427('0x15')],_0x1c49dc);_0x219dde(_0x5bc6ac['error'](0x1f4,_0x90c4ce[_0xe427('0x15')]));});});};
\ No newline at end of file
+var _0xfeea=['client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfeea,0xf7));var _0xafee=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xfeea[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require(_0xafee('0x0'));var util=require(_0xafee('0x1'));var moment=require(_0xafee('0x2'));var BPromise=require(_0xafee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xafee('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xafee('0x5'));var logger=require(_0xafee('0x6'))(_0xafee('0x7'));var config=require('../../config/environment');var jayson=require(_0xafee('0x8'));var client=jayson[_0xafee('0x9')]['http']({'port':0x232a});config[_0xafee('0xa')]=_[_0xafee('0xb')](config[_0xafee('0xa')],{'host':_0xafee('0xc'),'port':0x18eb});var socket=require(_0xafee('0xd'))(new Redis(config[_0xafee('0xa')]));require(_0xafee('0xe'))['register'](socket);function respondWithRpcPromise(_0xa36673,_0x19b930,_0x23ff35){return new BPromise(function(_0x3db012,_0x304cf4){return client[_0xafee('0xf')](_0xa36673,_0x23ff35)[_0xafee('0x10')](function(_0x4c040e){logger[_0xafee('0x11')](_0xafee('0x12'),_0x19b930,'request\x20sent');logger[_0xafee('0x13')](_0xafee('0x14'),_0x19b930,'request\x20sent',JSON[_0xafee('0x15')](_0x4c040e));if(_0x4c040e[_0xafee('0x16')]){if(_0x4c040e['error'][_0xafee('0x17')]===0x1f4){logger['error'](_0xafee('0x12'),_0x19b930,_0x4c040e[_0xafee('0x16')]['message']);return _0x304cf4(_0x4c040e[_0xafee('0x16')][_0xafee('0x18')]);}logger[_0xafee('0x16')](_0xafee('0x12'),_0x19b930,_0x4c040e[_0xafee('0x16')][_0xafee('0x18')]);return _0x3db012(_0x4c040e['error']['message']);}else{logger[_0xafee('0x11')](_0xafee('0x12'),_0x19b930,_0xafee('0x19'));_0x3db012(_0x4c040e['result']['message']);}})['catch'](function(_0x5e41e1){logger[_0xafee('0x16')](_0xafee('0x12'),_0x19b930,_0x5e41e1);_0x304cf4(_0x5e41e1);});});}exports[_0xafee('0x1a')]=function(_0x276f50){var _0x392ff0=this;return new Promise(function(_0x3f4437,_0x18e62b){return db[_0xafee('0x1b')][_0xafee('0x1c')](_0x276f50[_0xafee('0x1d')],{'raw':_0x276f50[_0xafee('0x1e')]?_0x276f50['options'][_0xafee('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0xc7c699){logger[_0xafee('0x11')](_0xafee('0x1a'),_0x276f50);logger[_0xafee('0x13')]('CreateChatMessage',_0x276f50,JSON[_0xafee('0x15')](_0xc7c699));_0x3f4437(_0xc7c699);})['catch'](function(_0x508379){logger[_0xafee('0x16')](_0xafee('0x1a'),_0x508379['message'],_0x276f50);_0x18e62b(_0x392ff0[_0xafee('0x16')](0x1f4,_0x508379[_0xafee('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index de89a6f..9cf9654 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 _0x10af=['./chatMessage.events','remove','update','emit','register','length','chatMessage:'];(function(_0x37d6d4,_0x143af3){var _0x179d36=function(_0x4be729){while(--_0x4be729){_0x37d6d4['push'](_0x37d6d4['shift']());}};_0x179d36(++_0x143af3);}(_0x10af,0xfc));var _0xf10a=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x10af[_0xac151d];return _0x111dba;};'use strict';var ChatMessageEvents=require(_0xf10a('0x0'));var events=['save',_0xf10a('0x1'),_0xf10a('0x2')];function createListener(_0x1e42f5,_0x211890){return function(_0x453e1a){_0x211890[_0xf10a('0x3')](_0x1e42f5,_0x453e1a);};}function removeListener(_0xbffc71,_0x13b338){return function(){ChatMessageEvents['removeListener'](_0xbffc71,_0x13b338);};}exports[_0xf10a('0x4')]=function(_0xf86ea1){for(var _0x5c9a4c=0x0,_0x4cd7e4=events[_0xf10a('0x5')];_0x5c9a4c<_0x4cd7e4;_0x5c9a4c++){var _0x1563fb=events[_0x5c9a4c];var _0x2ade36=createListener(_0xf10a('0x6')+_0x1563fb,_0xf86ea1);ChatMessageEvents['on'](_0x1563fb,_0x2ade36);}};
\ No newline at end of file
+var _0x1501=['save','remove','update','emit','removeListener','length','chatMessage:'];(function(_0x20cf8a,_0x44cd6b){var _0x54e165=function(_0xcce1d0){while(--_0xcce1d0){_0x20cf8a['push'](_0x20cf8a['shift']());}};_0x54e165(++_0x44cd6b);}(_0x1501,0x126));var _0x1150=function(_0x479f6f,_0x1c26c4){_0x479f6f=_0x479f6f-0x0;var _0x24e701=_0x1501[_0x479f6f];return _0x24e701;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x1150('0x0'),_0x1150('0x1'),_0x1150('0x2')];function createListener(_0x4c704f,_0x14d425){return function(_0x323ec2){_0x14d425[_0x1150('0x3')](_0x4c704f,_0x323ec2);};}function removeListener(_0x28eb65,_0x4d218f){return function(){ChatMessageEvents[_0x1150('0x4')](_0x28eb65,_0x4d218f);};}exports['register']=function(_0x63c724){for(var _0x316a7d=0x0,_0x2fc391=events[_0x1150('0x5')];_0x316a7d<_0x2fc391;_0x316a7d++){var _0x24340c=events[_0x316a7d];var _0x321d80=createListener(_0x1150('0x6')+_0x24340c,_0x63c724);ChatMessageEvents['on'](_0x24340c,_0x321d80);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 87805af..bf48dd4 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 _0x2d1b=['get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x2d1b,0x12b));var _0xb2d1=function(_0x1b04d2,_0x43190c){_0x1b04d2=_0x1b04d2-0x0;var _0x95da=_0x2d1b[_0x1b04d2];return _0x95da;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb2d1('0x0'));var timeout=require(_0xb2d1('0x1'));var express=require(_0xb2d1('0x2'));var router=express[_0xb2d1('0x3')]();var fs_extra=require(_0xb2d1('0x4'));var auth=require(_0xb2d1('0x5'));var interaction=require(_0xb2d1('0x6'));var config=require(_0xb2d1('0x7'));var controller=require(_0xb2d1('0x8'));router[_0xb2d1('0x9')]('/',auth[_0xb2d1('0xa')](),controller[_0xb2d1('0xb')]);router['get'](_0xb2d1('0xc'),auth['isAuthenticated'](),controller[_0xb2d1('0xd')]);router[_0xb2d1('0x9')](_0xb2d1('0xe'),auth['isAuthenticated'](),controller[_0xb2d1('0xf')]);router[_0xb2d1('0x10')]('/',auth['isAuthenticated'](),interaction[_0xb2d1('0x11')]('chat',_0xb2d1('0x12')),controller[_0xb2d1('0x13')]);router[_0xb2d1('0x14')]('/:id',controller['update']);router[_0xb2d1('0x14')](_0xb2d1('0x15'),auth[_0xb2d1('0xa')](),controller[_0xb2d1('0x16')]);router[_0xb2d1('0x14')](_0xb2d1('0x17'),auth[_0xb2d1('0xa')](),controller[_0xb2d1('0x18')]);router[_0xb2d1('0x19')](_0xb2d1('0xe'),auth[_0xb2d1('0xa')](),controller[_0xb2d1('0x1a')]);module[_0xb2d1('0x1b')]=router;
\ No newline at end of file
+var _0xf05d=['create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','chat','chatmessage:create'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0xf05d,0x18f));var _0xdf05=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf05d[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdf05('0x0'));var timeout=require(_0xdf05('0x1'));var express=require(_0xdf05('0x2'));var router=express[_0xdf05('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdf05('0x4'));var interaction=require(_0xdf05('0x5'));var config=require('../../config/environment');var controller=require(_0xdf05('0x6'));router[_0xdf05('0x7')]('/',auth[_0xdf05('0x8')](),controller[_0xdf05('0x9')]);router[_0xdf05('0x7')](_0xdf05('0xa'),auth[_0xdf05('0x8')](),controller[_0xdf05('0xb')]);router[_0xdf05('0x7')](_0xdf05('0xc'),auth[_0xdf05('0x8')](),controller['show']);router[_0xdf05('0xd')]('/',auth[_0xdf05('0x8')](),interaction[_0xdf05('0xe')](_0xdf05('0xf'),_0xdf05('0x10')),controller[_0xdf05('0x11')]);router[_0xdf05('0x12')](_0xdf05('0xc'),controller[_0xdf05('0x13')]);router[_0xdf05('0x12')](_0xdf05('0x14'),auth[_0xdf05('0x8')](),controller[_0xdf05('0x15')]);router[_0xdf05('0x12')](_0xdf05('0x16'),auth[_0xdf05('0x8')](),controller[_0xdf05('0x17')]);router[_0xdf05('0x18')]('/:id',auth[_0xdf05('0x8')](),controller[_0xdf05('0x19')]);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 5b78079..42900a6 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 _0x2032=['medium','exports','TEXT'];(function(_0x3a7941,_0x55edac){var _0x1aa996=function(_0x3a3d50){while(--_0x3a3d50){_0x3a7941['push'](_0x3a7941['shift']());}};_0x1aa996(++_0x55edac);}(_0x2032,0xd9));var _0x2203=function(_0x44827b,_0x19bce6){_0x44827b=_0x44827b-0x0;var _0x63346b=_0x2032[_0x44827b];return _0x63346b;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xb10b=['medium','sequelize','TEXT'];(function(_0x2ae482,_0x276e1e){var _0x4379b7=function(_0x4af7d5){while(--_0x4af7d5){_0x2ae482['push'](_0x2ae482['shift']());}};_0x4379b7(++_0x276e1e);}(_0xb10b,0x12a));var _0xbb10=function(_0xfcf737,_0x132075){_0xfcf737=_0xfcf737-0x0;var _0x5eccbe=_0xb10b[_0xfcf737];return _0x5eccbe;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index e14d4c9..2dba45f 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(_0x5a73ad,_0x2a42fb){var _0x35cffc=function(_0x4dec93){while(--_0x4dec93){_0x5a73ad['push'](_0x5a73ad['shift']());}};_0x35cffc(++_0x2a42fb);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _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(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7a54,0x106));var _0x47a5=function(_0x28dc5e,_0xddcafb){_0x28dc5e=_0x28dc5e-0x0;var _0x3f0126=_0x7a54[_0x28dc5e];return _0x3f0126;};'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 8880626..84456fe 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 _0x49b9=['hasOwnProperty','hook','../../mysqldb','ChatOfflineMessage','setMaxListeners','update','remove','emit'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x49b9,0xaa));var _0x949b=function(_0x19901f,_0x52bc26){_0x19901f=_0x19901f-0x0;var _0x12b88a=_0x49b9[_0x19901f];return _0x12b88a;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x949b('0x0'))['db'][_0x949b('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x949b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x949b('0x3'),'afterDestroy':_0x949b('0x4')};function emitEvent(_0x1ded3c){return function(_0x1e77d1,_0x202b64,_0x134f2b){ChatOfflineMessageEvents[_0x949b('0x5')](_0x1ded3c+':'+_0x1e77d1['id'],_0x1e77d1);ChatOfflineMessageEvents[_0x949b('0x5')](_0x1ded3c,_0x1e77d1);_0x134f2b(null);};}for(var e in events){if(events[_0x949b('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x949b('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x2447=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2447,0x1dd));var _0x7244=function(_0x482bc7,_0x172d4a){_0x482bc7=_0x482bc7-0x0;var _0x43d0b6=_0x2447[_0x482bc7];return _0x43d0b6;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x7244('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x7244('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7244('0x2'),'afterDestroy':_0x7244('0x3')};function emitEvent(_0x463433){return function(_0x30f6a4,_0x1c10bf,_0x4eb872){ChatOfflineMessageEvents[_0x7244('0x4')](_0x463433+':'+_0x30f6a4['id'],_0x30f6a4);ChatOfflineMessageEvents[_0x7244('0x4')](_0x463433,_0x30f6a4);_0x4eb872(null);};}for(var e in events){if(events[_0x7244('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x7244('0x6')](e,emitEvent(event));}}module[_0x7244('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 4b865a4..b71da66 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 _0x5ae4=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0x5ae4,0x12f));var _0x45ae=function(_0x35e5dd,_0x1ffea9){_0x35e5dd=_0x35e5dd-0x0;var _0xa8bef7=_0x5ae4[_0x35e5dd];return _0xa8bef7;};'use strict';var attributes=require(_0x45ae('0x0'));module[_0x45ae('0x1')]=function(_0x2e76dc){return _0x2e76dc['define']('ChatOfflineMessage',attributes,{'tableName':_0x45ae('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x45ae('0x3'),'collate':_0x45ae('0x4')});};
\ No newline at end of file
+var _0x142f=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','utf8mb4'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x142f,0x136));var _0xf142=function(_0x816de3,_0x38d085){_0x816de3=_0x816de3-0x0;var _0x1e539e=_0x142f[_0x816de3];return _0x1e539e;};'use strict';var attributes=require(_0xf142('0x0'));module['exports']=function(_0x39e1df){return _0x39e1df['define']('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf142('0x1'),'collate':_0xf142('0x2')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index c640954..143e53b 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 _0x63b7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x63b7,0x1e2));var _0x763b=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0x63b7[_0x4fbb15];return _0x436338;};'use strict';var _=require('lodash');var util=require(_0x763b('0x0'));var moment=require('moment');var BPromise=require(_0x763b('0x1'));var rs=require(_0x763b('0x2'));var fs=require('fs');var Redis=require(_0x763b('0x3'));var db=require(_0x763b('0x4'))['db'];var utils=require(_0x763b('0x5'));var logger=require('../../config/logger')(_0x763b('0x6'));var config=require(_0x763b('0x7'));var jayson=require(_0x763b('0x8'));var client=jayson['client'][_0x763b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbe9cf0,_0x464ab0,_0x218a1f){return new BPromise(function(_0xffb979,_0x476fc4){return client[_0x763b('0xa')](_0xbe9cf0,_0x218a1f)[_0x763b('0xb')](function(_0x2833b2){logger['info'](_0x763b('0xc'),_0x464ab0,_0x763b('0xd'));logger[_0x763b('0xe')](_0x763b('0xf'),_0x464ab0,_0x763b('0xd'),JSON[_0x763b('0x10')](_0x2833b2));if(_0x2833b2['error']){if(_0x2833b2[_0x763b('0x11')][_0x763b('0x12')]===0x1f4){logger[_0x763b('0x11')](_0x763b('0xc'),_0x464ab0,_0x2833b2[_0x763b('0x11')][_0x763b('0x13')]);return _0x476fc4(_0x2833b2[_0x763b('0x11')][_0x763b('0x13')]);}logger[_0x763b('0x11')](_0x763b('0xc'),_0x464ab0,_0x2833b2[_0x763b('0x11')][_0x763b('0x13')]);return _0xffb979(_0x2833b2['error'][_0x763b('0x13')]);}else{logger[_0x763b('0x14')](_0x763b('0xc'),_0x464ab0,'request\x20sent');_0xffb979(_0x2833b2[_0x763b('0x15')]['message']);}})[_0x763b('0x16')](function(_0x493346){logger[_0x763b('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x464ab0,_0x493346);_0x476fc4(_0x493346);});});}
\ No newline at end of file
+var _0x7fcf=['ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','info'];(function(_0x3a7bdf,_0x58bdd8){var _0x35a9a8=function(_0x21da98){while(--_0x21da98){_0x3a7bdf['push'](_0x3a7bdf['shift']());}};_0x35a9a8(++_0x58bdd8);}(_0x7fcf,0xce));var _0xf7fc=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x7fcf[_0x18ab2a];return _0x16dcee;};'use strict';var _=require('lodash');var util=require(_0xf7fc('0x0'));var moment=require(_0xf7fc('0x1'));var BPromise=require(_0xf7fc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf7fc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf7fc('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf7fc('0x5'));var jayson=require(_0xf7fc('0x6'));var client=jayson[_0xf7fc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x87869b,_0x5efb7a,_0x44007d){return new BPromise(function(_0x246819,_0x75925a){return client[_0xf7fc('0x8')](_0x87869b,_0x44007d)['then'](function(_0x383197){logger[_0xf7fc('0x9')](_0xf7fc('0xa'),_0x5efb7a,'request\x20sent');logger[_0xf7fc('0xb')](_0xf7fc('0xc'),_0x5efb7a,_0xf7fc('0xd'),JSON[_0xf7fc('0xe')](_0x383197));if(_0x383197[_0xf7fc('0xf')]){if(_0x383197[_0xf7fc('0xf')][_0xf7fc('0x10')]===0x1f4){logger[_0xf7fc('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5efb7a,_0x383197[_0xf7fc('0xf')][_0xf7fc('0x11')]);return _0x75925a(_0x383197[_0xf7fc('0xf')]['message']);}logger['error'](_0xf7fc('0xa'),_0x5efb7a,_0x383197['error'][_0xf7fc('0x11')]);return _0x246819(_0x383197['error'][_0xf7fc('0x11')]);}else{logger[_0xf7fc('0x9')](_0xf7fc('0xa'),_0x5efb7a,'request\x20sent');_0x246819(_0x383197['result']['message']);}})['catch'](function(_0x13e07c){logger[_0xf7fc('0xf')](_0xf7fc('0xa'),_0x5efb7a,_0x13e07c);_0x75925a(_0x13e07c);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index d826b4f..6a0b8ec 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 _0x3d39=['describe','/:id','post','create','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x326c48,_0x31eee6){var _0xf71bc5=function(_0x391b95){while(--_0x391b95){_0x326c48['push'](_0x326c48['shift']());}};_0xf71bc5(++_0x31eee6);}(_0x3d39,0x1d6));var _0x93d3=function(_0x288339,_0x1b55cb){_0x288339=_0x288339-0x0;var _0x31d315=_0x3d39[_0x288339];return _0x31d315;};'use strict';var multer=require('multer');var util=require(_0x93d3('0x0'));var path=require('path');var timeout=require(_0x93d3('0x1'));var express=require(_0x93d3('0x2'));var router=express[_0x93d3('0x3')]();var fs_extra=require(_0x93d3('0x4'));var auth=require(_0x93d3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x93d3('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x93d3('0x7')]('/',auth[_0x93d3('0x8')](),controller[_0x93d3('0x9')]);router[_0x93d3('0x7')]('/describe',auth[_0x93d3('0x8')](),controller[_0x93d3('0xa')]);router['get'](_0x93d3('0xb'),auth[_0x93d3('0x8')](),controller['show']);router[_0x93d3('0xc')]('/',auth[_0x93d3('0x8')](),controller[_0x93d3('0xd')]);router['put'](_0x93d3('0xb'),auth['isAuthenticated'](),controller[_0x93d3('0xe')]);router['delete'](_0x93d3('0xb'),auth[_0x93d3('0x8')](),controller[_0x93d3('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xc689=['destroy','exports','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','post','update','delete'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xc689,0x1a2));var _0x9c68=function(_0x4c3ffe,_0x457374){_0x4c3ffe=_0x4c3ffe-0x0;var _0x28d3eb=_0xc689[_0x4c3ffe];return _0x28d3eb;};'use strict';var multer=require('multer');var util=require(_0x9c68('0x0'));var path=require('path');var timeout=require(_0x9c68('0x1'));var express=require(_0x9c68('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9c68('0x3'));var config=require(_0x9c68('0x4'));var controller=require(_0x9c68('0x5'));router[_0x9c68('0x6')]('/',auth[_0x9c68('0x7')](),controller[_0x9c68('0x8')]);router['get'](_0x9c68('0x9'),auth[_0x9c68('0x7')](),controller['describe']);router[_0x9c68('0x6')](_0x9c68('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9c68('0xb')]('/',auth[_0x9c68('0x7')](),controller['create']);router['put']('/:id',auth[_0x9c68('0x7')](),controller[_0x9c68('0xc')]);router[_0x9c68('0xd')](_0x9c68('0xa'),auth['isAuthenticated'](),controller[_0x9c68('0xe')]);module[_0x9c68('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 2fe1625..8396dfa 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 _0x08cb=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver','timeout'];(function(_0x558d22,_0x43749f){var _0x1c20af=function(_0x382fcd){while(--_0x382fcd){_0x558d22['push'](_0x558d22['shift']());}};_0x1c20af(++_0x43749f);}(_0x08cb,0x135));var _0xb08c=function(_0x381b14,_0x44738b){_0x381b14=_0x381b14-0x0;var _0x271127=_0x08cb[_0x381b14];return _0x271127;};'use strict';var Sequelize=require(_0xb08c('0x0'));module[_0xb08c('0x1')]={'name':{'type':Sequelize[_0xb08c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb08c('0x3')](_0xb08c('0x4'),_0xb08c('0x5')),'defaultValue':_0xb08c('0x4')},'selector':{'type':Sequelize[_0xb08c('0x2')]},'timeout':{'type':Sequelize[_0xb08c('0x6')]}};
\ No newline at end of file
+var _0xa511=['timeout','INTEGER','exports','STRING','ENUM','mouseOver'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa511,0x158));var _0x1a51=function(_0x1f34c3,_0x3ce50b){_0x1f34c3=_0x1f34c3-0x0;var _0x46608b=_0xa511[_0x1f34c3];return _0x46608b;};'use strict';var Sequelize=require('sequelize');module[_0x1a51('0x0')]={'name':{'type':Sequelize[_0x1a51('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1a51('0x2')](_0x1a51('0x3'),_0x1a51('0x4')),'defaultValue':_0x1a51('0x3')},'selector':{'type':Sequelize[_0x1a51('0x1')]},'timeout':{'type':Sequelize[_0x1a51('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 9f788d5..9c6ec60 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 _0xe64a=['length','merge','options','ChatProactiveAction','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','params','keys','query','filters','intersection','model','attributes','fields'];(function(_0x1e1962,_0x5a2061){var _0x3c06be=function(_0x37761b){while(--_0x37761b){_0x1e1962['push'](_0x1e1962['shift']());}};_0x3c06be(++_0x5a2061);}(_0xe64a,0x1e0));var _0xae64=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe64a[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xae64('0x0'));var rimraf=require(_0xae64('0x1'));var zipdir=require(_0xae64('0x2'));var jsonpatch=require(_0xae64('0x3'));var rp=require(_0xae64('0x4'));var moment=require(_0xae64('0x5'));var BPromise=require(_0xae64('0x6'));var Mustache=require(_0xae64('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xae64('0x8'));var fs=require('fs');var fs_extra=require(_0xae64('0x9'));var _=require(_0xae64('0xa'));var squel=require(_0xae64('0xb'));var crypto=require(_0xae64('0xc'));var jsforce=require(_0xae64('0xd'));var deskjs=require(_0xae64('0xe'));var toCsv=require(_0xae64('0xf'));var querystring=require(_0xae64('0x10'));var Papa=require(_0xae64('0x11'));var Redis=require(_0xae64('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xae64('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xae64('0x14'))(_0xae64('0x15'));var utils=require(_0xae64('0x16'));var config=require(_0xae64('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xae64('0x18'))['db'];function respondWithStatusCode(_0x58d0de,_0x59b60a){_0x59b60a=_0x59b60a||0xcc;return function(_0x345caf){if(_0x345caf){return _0x58d0de[_0xae64('0x19')](_0x59b60a);}return _0x58d0de[_0xae64('0x1a')](_0x59b60a)['end']();};}function respondWithResult(_0x1247b0,_0x760b31){_0x760b31=_0x760b31||0xc8;return function(_0x306804){if(_0x306804){return _0x1247b0[_0xae64('0x1a')](_0x760b31)[_0xae64('0x1b')](_0x306804);}};}function respondWithFilteredResult(_0x4c7d1c,_0x2950c5){return function(_0x37bc58){if(_0x37bc58){var _0x717724=typeof _0x2950c5[_0xae64('0x1c')]===_0xae64('0x1d')&&typeof _0x2950c5['limit']===_0xae64('0x1d');var _0x21c285=_0x37bc58[_0xae64('0x1e')];var _0x4613d9=_0x717724?0x0:_0x2950c5[_0xae64('0x1c')];var _0x227223=_0x717724?_0x37bc58[_0xae64('0x1e')]:_0x2950c5[_0xae64('0x1c')]+_0x2950c5['limit'];var _0x3cdd98;if(_0x227223>=_0x21c285){_0x227223=_0x21c285;_0x3cdd98=0xc8;}else{_0x3cdd98=0xce;}_0x4c7d1c[_0xae64('0x1a')](_0x3cdd98);return _0x4c7d1c[_0xae64('0x1f')](_0xae64('0x20'),_0x4613d9+'-'+_0x227223+'/'+_0x21c285)[_0xae64('0x1b')](_0x37bc58);}return null;};}function patchUpdates(_0x20ca7f){return function(_0x49bab9){try{jsonpatch[_0xae64('0x21')](_0x49bab9,_0x20ca7f,!![]);}catch(_0x4a4c4e){return BPromise[_0xae64('0x22')](_0x4a4c4e);}return _0x49bab9[_0xae64('0x23')]();};}function saveUpdates(_0x12d94d,_0x394afa){return function(_0x4406dc){if(_0x4406dc){return _0x4406dc[_0xae64('0x24')](_0x12d94d)[_0xae64('0x25')](function(_0x127ae2){return _0x127ae2;});}return null;};}function removeEntity(_0x24a35f,_0x2e6852){return function(_0x131225){if(_0x131225){return _0x131225[_0xae64('0x26')]()[_0xae64('0x25')](function(){_0x24a35f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6eb56,_0xd5ecaf){return function(_0x22d91a){if(!_0x22d91a){_0x6eb56[_0xae64('0x19')](0x194);}return _0x22d91a;};}function handleError(_0x4d987f,_0x518969){_0x518969=_0x518969||0x1f4;return function(_0x562c2d){logger[_0xae64('0x27')](_0x562c2d[_0xae64('0x28')]);if(_0x562c2d['name']){delete _0x562c2d[_0xae64('0x29')];}_0x4d987f[_0xae64('0x1a')](_0x518969)[_0xae64('0x2a')](_0x562c2d);};}exports['show']=function(_0x3b946c,_0x562eb4){var _0x55f53d={'raw':!![],'where':{'id':_0x3b946c[_0xae64('0x2b')]['id']}},_0x5e4b2c={};_0x5e4b2c['model']=_[_0xae64('0x2c')](db['ChatProactiveAction']['rawAttributes']);_0x5e4b2c['query']=_[_0xae64('0x2c')](_0x3b946c[_0xae64('0x2d')]);_0x5e4b2c[_0xae64('0x2e')]=_[_0xae64('0x2f')](_0x5e4b2c[_0xae64('0x30')],_0x5e4b2c[_0xae64('0x2d')]);_0x55f53d[_0xae64('0x31')]=_[_0xae64('0x2f')](_0x5e4b2c[_0xae64('0x30')],qs['fields'](_0x3b946c[_0xae64('0x2d')][_0xae64('0x32')]));_0x55f53d[_0xae64('0x31')]=_0x55f53d[_0xae64('0x31')][_0xae64('0x33')]?_0x55f53d[_0xae64('0x31')]:_0x5e4b2c['model'];if(_0x3b946c[_0xae64('0x2d')]['includeAll']){_0x55f53d['include']=[{'all':!![]}];}_0x55f53d=_[_0xae64('0x34')]({},_0x55f53d,_0x3b946c[_0xae64('0x35')]);return db[_0xae64('0x36')][_0xae64('0x37')](_0x55f53d)[_0xae64('0x25')](handleEntityNotFound(_0x562eb4,null))[_0xae64('0x25')](respondWithResult(_0x562eb4,null))[_0xae64('0x38')](handleError(_0x562eb4,null));};exports['create']=function(_0xe53734,_0x4437e9){return db[_0xae64('0x36')][_0xae64('0x39')](_0xe53734[_0xae64('0x3a')],{})[_0xae64('0x25')](respondWithResult(_0x4437e9,0xc9))['catch'](handleError(_0x4437e9,null));};exports[_0xae64('0x24')]=function(_0x28269b,_0x3afc79){if(_0x28269b[_0xae64('0x3a')]['id']){delete _0x28269b['body']['id'];}return db[_0xae64('0x36')][_0xae64('0x37')]({'where':{'id':_0x28269b['params']['id']}})[_0xae64('0x25')](handleEntityNotFound(_0x3afc79,null))[_0xae64('0x25')](saveUpdates(_0x28269b['body'],null))[_0xae64('0x25')](respondWithResult(_0x3afc79,null))[_0xae64('0x38')](handleError(_0x3afc79,null));};exports[_0xae64('0x26')]=function(_0x19a5b7,_0x4c55b3){return db[_0xae64('0x36')][_0xae64('0x37')]({'where':{'id':_0x19a5b7[_0xae64('0x2b')]['id']}})[_0xae64('0x25')](handleEntityNotFound(_0x4c55b3,null))[_0xae64('0x25')](removeEntity(_0x4c55b3,null))[_0xae64('0x38')](handleError(_0x4c55b3,null));};
\ No newline at end of file
+var _0x5a01=['intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','filters'];(function(_0x2274e4,_0x5ed9e6){var _0x4d8a02=function(_0x187e19){while(--_0x187e19){_0x2274e4['push'](_0x2274e4['shift']());}};_0x4d8a02(++_0x5ed9e6);}(_0x5a01,0x1af));var _0x15a0=function(_0x5e31e2,_0x273090){_0x5e31e2=_0x5e31e2-0x0;var _0x294e2c=_0x5a01[_0x5e31e2];return _0x294e2c;};'use strict';var emlformat=require(_0x15a0('0x0'));var rimraf=require(_0x15a0('0x1'));var zipdir=require(_0x15a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x15a0('0x3'));var BPromise=require(_0x15a0('0x4'));var Mustache=require('mustache');var util=require(_0x15a0('0x5'));var path=require(_0x15a0('0x6'));var sox=require(_0x15a0('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15a0('0x8'));var _=require(_0x15a0('0x9'));var squel=require(_0x15a0('0xa'));var crypto=require('crypto');var jsforce=require(_0x15a0('0xb'));var deskjs=require(_0x15a0('0xc'));var toCsv=require(_0x15a0('0xd'));var querystring=require(_0x15a0('0xe'));var Papa=require(_0x15a0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x15a0('0x10'));var as=require(_0x15a0('0x11'));var hardwareService=require(_0x15a0('0x12'));var logger=require(_0x15a0('0x13'))(_0x15a0('0x14'));var utils=require(_0x15a0('0x15'));var config=require(_0x15a0('0x16'));var licenseUtil=require(_0x15a0('0x17'));var db=require(_0x15a0('0x18'))['db'];function respondWithStatusCode(_0x131ea2,_0x17108f){_0x17108f=_0x17108f||0xcc;return function(_0x418907){if(_0x418907){return _0x131ea2['sendStatus'](_0x17108f);}return _0x131ea2['status'](_0x17108f)[_0x15a0('0x19')]();};}function respondWithResult(_0x1bacb4,_0xa580bf){_0xa580bf=_0xa580bf||0xc8;return function(_0x1c4d39){if(_0x1c4d39){return _0x1bacb4[_0x15a0('0x1a')](_0xa580bf)[_0x15a0('0x1b')](_0x1c4d39);}};}function respondWithFilteredResult(_0x2595c1,_0x2568ee){return function(_0x2b8a17){if(_0x2b8a17){var _0x547d10=typeof _0x2568ee[_0x15a0('0x1c')]==='undefined'&&typeof _0x2568ee['limit']===_0x15a0('0x1d');var _0x2896bb=_0x2b8a17[_0x15a0('0x1e')];var _0x29383c=_0x547d10?0x0:_0x2568ee['offset'];var _0x5e7b01=_0x547d10?_0x2b8a17[_0x15a0('0x1e')]:_0x2568ee[_0x15a0('0x1c')]+_0x2568ee['limit'];var _0x1a71b6;if(_0x5e7b01>=_0x2896bb){_0x5e7b01=_0x2896bb;_0x1a71b6=0xc8;}else{_0x1a71b6=0xce;}_0x2595c1['status'](_0x1a71b6);return _0x2595c1[_0x15a0('0x1f')](_0x15a0('0x20'),_0x29383c+'-'+_0x5e7b01+'/'+_0x2896bb)[_0x15a0('0x1b')](_0x2b8a17);}return null;};}function patchUpdates(_0xc035d3){return function(_0x225aac){try{jsonpatch[_0x15a0('0x21')](_0x225aac,_0xc035d3,!![]);}catch(_0x43f77b){return BPromise['reject'](_0x43f77b);}return _0x225aac['save']();};}function saveUpdates(_0x32eafd,_0x23a2f6){return function(_0x349623){if(_0x349623){return _0x349623[_0x15a0('0x22')](_0x32eafd)[_0x15a0('0x23')](function(_0x3a06cc){return _0x3a06cc;});}return null;};}function removeEntity(_0x42dc91,_0x53e470){return function(_0x559024){if(_0x559024){return _0x559024[_0x15a0('0x24')]()['then'](function(){_0x42dc91[_0x15a0('0x1a')](0xcc)[_0x15a0('0x19')]();});}};}function handleEntityNotFound(_0xd7e6b3,_0x2845ec){return function(_0x23a06b){if(!_0x23a06b){_0xd7e6b3[_0x15a0('0x25')](0x194);}return _0x23a06b;};}function handleError(_0x3b050f,_0x299183){_0x299183=_0x299183||0x1f4;return function(_0x3608d6){logger[_0x15a0('0x26')](_0x3608d6[_0x15a0('0x27')]);if(_0x3608d6['name']){delete _0x3608d6[_0x15a0('0x28')];}_0x3b050f['status'](_0x299183)[_0x15a0('0x29')](_0x3608d6);};}exports['show']=function(_0x14f059,_0x192b11){var _0x1a20ed={'raw':!![],'where':{'id':_0x14f059[_0x15a0('0x2a')]['id']}},_0x15a2e7={};_0x15a2e7[_0x15a0('0x2b')]=_[_0x15a0('0x2c')](db[_0x15a0('0x2d')][_0x15a0('0x2e')]);_0x15a2e7[_0x15a0('0x2f')]=_[_0x15a0('0x2c')](_0x14f059[_0x15a0('0x2f')]);_0x15a2e7[_0x15a0('0x30')]=_[_0x15a0('0x31')](_0x15a2e7[_0x15a0('0x2b')],_0x15a2e7['query']);_0x1a20ed[_0x15a0('0x32')]=_[_0x15a0('0x31')](_0x15a2e7['model'],qs['fields'](_0x14f059[_0x15a0('0x2f')][_0x15a0('0x33')]));_0x1a20ed['attributes']=_0x1a20ed[_0x15a0('0x32')][_0x15a0('0x34')]?_0x1a20ed['attributes']:_0x15a2e7[_0x15a0('0x2b')];if(_0x14f059[_0x15a0('0x2f')][_0x15a0('0x35')]){_0x1a20ed['include']=[{'all':!![]}];}_0x1a20ed=_[_0x15a0('0x36')]({},_0x1a20ed,_0x14f059[_0x15a0('0x37')]);return db[_0x15a0('0x2d')][_0x15a0('0x38')](_0x1a20ed)['then'](handleEntityNotFound(_0x192b11,null))[_0x15a0('0x23')](respondWithResult(_0x192b11,null))[_0x15a0('0x39')](handleError(_0x192b11,null));};exports['create']=function(_0x502fc5,_0x4faadc){return db[_0x15a0('0x2d')][_0x15a0('0x3a')](_0x502fc5[_0x15a0('0x3b')],{})[_0x15a0('0x23')](respondWithResult(_0x4faadc,0xc9))[_0x15a0('0x39')](handleError(_0x4faadc,null));};exports[_0x15a0('0x22')]=function(_0x4703fe,_0x31e58d){if(_0x4703fe[_0x15a0('0x3b')]['id']){delete _0x4703fe[_0x15a0('0x3b')]['id'];}return db[_0x15a0('0x2d')][_0x15a0('0x38')]({'where':{'id':_0x4703fe[_0x15a0('0x2a')]['id']}})[_0x15a0('0x23')](handleEntityNotFound(_0x31e58d,null))[_0x15a0('0x23')](saveUpdates(_0x4703fe[_0x15a0('0x3b')],null))[_0x15a0('0x23')](respondWithResult(_0x31e58d,null))[_0x15a0('0x39')](handleError(_0x31e58d,null));};exports[_0x15a0('0x24')]=function(_0x475430,_0xe7f6bd){return db[_0x15a0('0x2d')]['find']({'where':{'id':_0x475430[_0x15a0('0x2a')]['id']}})[_0x15a0('0x23')](handleEntityNotFound(_0xe7f6bd,null))[_0x15a0('0x23')](removeEntity(_0xe7f6bd,null))[_0x15a0('0x39')](handleError(_0xe7f6bd,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 702ba23..9d0f4bb 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 _0x1b4e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api'];(function(_0x2f0eba,_0x21bcdf){var _0x586783=function(_0x261d26){while(--_0x261d26){_0x2f0eba['push'](_0x2f0eba['shift']());}};_0x586783(++_0x21bcdf);}(_0x1b4e,0x14c));var _0xe1b4=function(_0xa80bab,_0x1a6417){_0xa80bab=_0xa80bab-0x0;var _0xcae729=_0x1b4e[_0xa80bab];return _0xcae729;};'use strict';var _=require(_0xe1b4('0x0'));var util=require(_0xe1b4('0x1'));var logger=require(_0xe1b4('0x2'))(_0xe1b4('0x3'));var moment=require(_0xe1b4('0x4'));var BPromise=require(_0xe1b4('0x5'));var rp=require(_0xe1b4('0x6'));var fs=require('fs');var path=require(_0xe1b4('0x7'));var rimraf=require(_0xe1b4('0x8'));var config=require(_0xe1b4('0x9'));var attributes=require(_0xe1b4('0xa'));module['exports']=function(_0x560488,_0x4278b4){return _0x560488[_0xe1b4('0xb')](_0xe1b4('0xc'),attributes,{'tableName':_0xe1b4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a51=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x2d4d56,_0x2b0908){var _0x43136f=function(_0x1c7060){while(--_0x1c7060){_0x2d4d56['push'](_0x2d4d56['shift']());}};_0x43136f(++_0x2b0908);}(_0x0a51,0x8d));var _0x10a5=function(_0x1d3321,_0x118267){_0x1d3321=_0x1d3321-0x0;var _0x359aa3=_0x0a51[_0x1d3321];return _0x359aa3;};'use strict';var _=require(_0x10a5('0x0'));var util=require(_0x10a5('0x1'));var logger=require(_0x10a5('0x2'))('api');var moment=require(_0x10a5('0x3'));var BPromise=require(_0x10a5('0x4'));var rp=require(_0x10a5('0x5'));var fs=require('fs');var path=require(_0x10a5('0x6'));var rimraf=require(_0x10a5('0x7'));var config=require('../../config/environment');var attributes=require(_0x10a5('0x8'));module[_0x10a5('0x9')]=function(_0x529e56,_0x292c5d){return _0x529e56[_0x10a5('0xa')](_0x10a5('0xb'),attributes,{'tableName':_0x10a5('0xc'),'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 e6281ba..ed7c763 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 _0xd0c8=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd0c8,0x119));var _0x8d0c=function(_0x46c947,_0x32abe8){_0x46c947=_0x46c947-0x0;var _0x530a46=_0xd0c8[_0x46c947];return _0x530a46;};'use strict';var _=require('lodash');var util=require(_0x8d0c('0x0'));var moment=require(_0x8d0c('0x1'));var BPromise=require(_0x8d0c('0x2'));var rs=require(_0x8d0c('0x3'));var fs=require('fs');var Redis=require(_0x8d0c('0x4'));var db=require(_0x8d0c('0x5'))['db'];var utils=require(_0x8d0c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8d0c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8d0c('0x8')][_0x8d0c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9b3cf8,_0x4ed527,_0x1e2d7b){return new BPromise(function(_0x509623,_0x57e4cd){return client[_0x8d0c('0xa')](_0x9b3cf8,_0x1e2d7b)[_0x8d0c('0xb')](function(_0x1b24bc){logger[_0x8d0c('0xc')](_0x8d0c('0xd'),_0x4ed527,_0x8d0c('0xe'));logger[_0x8d0c('0xf')](_0x8d0c('0x10'),_0x4ed527,_0x8d0c('0xe'),JSON[_0x8d0c('0x11')](_0x1b24bc));if(_0x1b24bc[_0x8d0c('0x12')]){if(_0x1b24bc['error'][_0x8d0c('0x13')]===0x1f4){logger[_0x8d0c('0x12')](_0x8d0c('0xd'),_0x4ed527,_0x1b24bc[_0x8d0c('0x12')][_0x8d0c('0x14')]);return _0x57e4cd(_0x1b24bc[_0x8d0c('0x12')][_0x8d0c('0x14')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4ed527,_0x1b24bc[_0x8d0c('0x12')]['message']);return _0x509623(_0x1b24bc[_0x8d0c('0x12')][_0x8d0c('0x14')]);}else{logger[_0x8d0c('0xc')](_0x8d0c('0xd'),_0x4ed527,_0x8d0c('0xe'));_0x509623(_0x1b24bc[_0x8d0c('0x15')]['message']);}})[_0x8d0c('0x16')](function(_0x2a8ebe){logger[_0x8d0c('0x12')](_0x8d0c('0xd'),_0x4ed527,_0x2a8ebe);_0x57e4cd(_0x2a8ebe);});});}
\ No newline at end of file
+var _0xf14f=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xf14f,0x8a));var _0xff14=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xf14f[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require(_0xff14('0x0'));var util=require(_0xff14('0x1'));var moment=require(_0xff14('0x2'));var BPromise=require(_0xff14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff14('0x4'));var db=require(_0xff14('0x5'))['db'];var utils=require(_0xff14('0x6'));var logger=require(_0xff14('0x7'))(_0xff14('0x8'));var config=require(_0xff14('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff14('0xa')][_0xff14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b228d,_0x3d9047,_0x18e19a){return new BPromise(function(_0x323ee5,_0xa7090e){return client[_0xff14('0xc')](_0x5b228d,_0x18e19a)[_0xff14('0xd')](function(_0x1115e3){logger[_0xff14('0xe')](_0xff14('0xf'),_0x3d9047,_0xff14('0x10'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x3d9047,_0xff14('0x10'),JSON[_0xff14('0x11')](_0x1115e3));if(_0x1115e3[_0xff14('0x12')]){if(_0x1115e3[_0xff14('0x12')][_0xff14('0x13')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x3d9047,_0x1115e3[_0xff14('0x12')][_0xff14('0x14')]);return _0xa7090e(_0x1115e3['error'][_0xff14('0x14')]);}logger[_0xff14('0x12')](_0xff14('0xf'),_0x3d9047,_0x1115e3[_0xff14('0x12')][_0xff14('0x14')]);return _0x323ee5(_0x1115e3[_0xff14('0x12')][_0xff14('0x14')]);}else{logger[_0xff14('0xe')](_0xff14('0xf'),_0x3d9047,'request\x20sent');_0x323ee5(_0x1115e3[_0xff14('0x15')]['message']);}})[_0xff14('0x16')](function(_0x5a5845){logger[_0xff14('0x12')](_0xff14('0xf'),_0x3d9047,_0x5a5845);_0xa7090e(_0x5a5845);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 9cf87e6..3103c43 100644
--- a/server/api/chatProactiveAction/index.js
+++ b/server/api/chatProactiveAction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x5f2000,_0x11e9f7){var _0x11e7ee=function(_0x2e27e7){while(--_0x2e27e7){_0x5f2000['push'](_0x5f2000['shift']());}};_0x11e7ee(++_0x11e9f7);}(_0x032e,0x124));var _0xe032=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x032e[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router;
\ No newline at end of file
+var _0x4819=['post','isAuthenticated','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x568fc3,_0x56fedc){var _0x160dbe=function(_0xf8583d){while(--_0xf8583d){_0x568fc3['push'](_0x568fc3['shift']());}};_0x160dbe(++_0x56fedc);}(_0x4819,0xcd));var _0x9481=function(_0x81d23e,_0x176dc5){_0x81d23e=_0x81d23e-0x0;var _0x1ec56d=_0x4819[_0x81d23e];return _0x1ec56d;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get'](_0x9481('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9481('0xb')]('/',auth[_0x9481('0xc')](),controller[_0x9481('0xd')]);router[_0x9481('0xe')](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['delete'](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0x10')]);module[_0x9481('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 2cbda1f..12c78f0 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 _0x8ed7=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x248b46,_0x4d7f9d){var _0x21b566=function(_0x192675){while(--_0x192675){_0x248b46['push'](_0x248b46['shift']());}};_0x21b566(++_0x4d7f9d);}(_0x8ed7,0xe6));var _0x78ed=function(_0x132987,_0x2ff9f6){_0x132987=_0x132987-0x0;var _0x4a8073=_0x8ed7[_0x132987];return _0x4a8073;};'use strict';var Sequelize=require(_0x78ed('0x0'));module[_0x78ed('0x1')]={'name':{'type':Sequelize[_0x78ed('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x78ed('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x78ed('0x4')](_0x78ed('0x5'),_0x78ed('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0x45f8=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x45f8,0xbf));var _0x845f=function(_0x7feb90,_0x28e700){_0x7feb90=_0x7feb90-0x0;var _0x3c5b33=_0x45f8[_0x7feb90];return _0x3c5b33;};'use strict';var Sequelize=require(_0x845f('0x0'));module[_0x845f('0x1')]={'name':{'type':Sequelize[_0x845f('0x2')],'unique':_0x845f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x845f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x845f('0x5')](_0x845f('0x6'),_0x845f('0x7'),_0x845f('0x8'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 0440ff0..e6aaafd 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 _0x6713=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','UserProfileResource','name','map','ChatQueue','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserChatQueue','length','nolimit','order','ChatQueueId','User','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','union','compact','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x263149,_0x1529c5){var _0x49c433=function(_0x189a39){while(--_0x189a39){_0x263149['push'](_0x263149['shift']());}};_0x49c433(++_0x1529c5);}(_0x6713,0x112));var _0x3671=function(_0x343090,_0x433a80){_0x343090=_0x343090-0x0;var _0x3ff3e8=_0x6713[_0x343090];return _0x3ff3e8;};'use strict';var emlformat=require(_0x3671('0x0'));var rimraf=require(_0x3671('0x1'));var zipdir=require(_0x3671('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3671('0x3'));var moment=require(_0x3671('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3671('0x5'));var path=require('path');var sox=require(_0x3671('0x6'));var csv=require('to-csv');var ejs=require(_0x3671('0x7'));var fs=require('fs');var fs_extra=require(_0x3671('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3671('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x3671('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3671('0xb'));var Papa=require(_0x3671('0xc'));var Redis=require(_0x3671('0xd'));var authService=require(_0x3671('0xe'));var qs=require(_0x3671('0xf'));var as=require(_0x3671('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3671('0x11'))('api');var utils=require(_0x3671('0x12'));var config=require(_0x3671('0x13'));var licenseUtil=require(_0x3671('0x14'));var db=require(_0x3671('0x15'))['db'];config['redis']=_[_0x3671('0x16')](config[_0x3671('0x17')],{'host':_0x3671('0x18'),'port':0x18eb});var socket=require(_0x3671('0x19'))(new Redis(config[_0x3671('0x17')]));require('./chatQueue.socket')[_0x3671('0x1a')](socket);var jayson=require(_0x3671('0x1b'));var client=jayson[_0x3671('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53b9df,_0x508f5d,_0x765daa,_0x2d65f9){return new BPromise(function(_0x50bcce,_0x57adb9){var _0x186d85=_0x2d65f9||client;return _0x186d85[_0x3671('0x1d')](_0x53b9df,_0x765daa)[_0x3671('0x1e')](function(_0x2cbaba){logger[_0x3671('0x1f')](_0x3671('0x20'),_0x508f5d,_0x3671('0x21'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x508f5d,_0x3671('0x21'),JSON[_0x3671('0x22')](_0x2cbaba));if(_0x2cbaba[_0x3671('0x23')]){if(_0x2cbaba[_0x3671('0x23')][_0x3671('0x24')]===0x1f4){logger[_0x3671('0x23')](_0x3671('0x20'),_0x508f5d,_0x2cbaba[_0x3671('0x23')][_0x3671('0x25')]);return _0x57adb9(_0x2cbaba['error']['message']);}logger['error'](_0x3671('0x20'),_0x508f5d,_0x2cbaba[_0x3671('0x23')][_0x3671('0x25')]);return _0x50bcce(_0x2cbaba[_0x3671('0x23')][_0x3671('0x25')]);}else{logger[_0x3671('0x1f')](_0x3671('0x20'),_0x508f5d,_0x3671('0x21'));_0x50bcce(_0x2cbaba[_0x3671('0x26')]['message']);}})['catch'](function(_0x1c566e){logger['error'](_0x3671('0x20'),_0x508f5d,_0x1c566e);_0x57adb9(_0x1c566e);});});}function respondWithStatusCode(_0x1ca26b,_0xbc35f6){_0xbc35f6=_0xbc35f6||0xcc;return function(_0x1bf11d){if(_0x1bf11d){return _0x1ca26b[_0x3671('0x27')](_0xbc35f6);}return _0x1ca26b[_0x3671('0x28')](_0xbc35f6)[_0x3671('0x29')]();};}function respondWithResult(_0x491465,_0x10e6b9){_0x10e6b9=_0x10e6b9||0xc8;return function(_0x184302){if(_0x184302){return _0x491465[_0x3671('0x28')](_0x10e6b9)[_0x3671('0x2a')](_0x184302);}};}function respondWithFilteredResult(_0x2720f2,_0x32d258){return function(_0x5cf443){if(_0x5cf443){var _0x5a487e=typeof _0x32d258[_0x3671('0x2b')]==='undefined'&&typeof _0x32d258[_0x3671('0x2c')]===_0x3671('0x2d');var _0xb44e80=_0x5cf443[_0x3671('0x2e')];var _0x4b17e8=_0x5a487e?0x0:_0x32d258[_0x3671('0x2b')];var _0x7dbdbf=_0x5a487e?_0x5cf443['count']:_0x32d258[_0x3671('0x2b')]+_0x32d258['limit'];var _0x5b30aa;if(_0x7dbdbf>=_0xb44e80){_0x7dbdbf=_0xb44e80;_0x5b30aa=0xc8;}else{_0x5b30aa=0xce;}_0x2720f2['status'](_0x5b30aa);return _0x2720f2[_0x3671('0x2f')](_0x3671('0x30'),_0x4b17e8+'-'+_0x7dbdbf+'/'+_0xb44e80)['json'](_0x5cf443);}return null;};}function patchUpdates(_0x38bf26){return function(_0x5e77ff){try{jsonpatch['apply'](_0x5e77ff,_0x38bf26,!![]);}catch(_0x2b39d6){return BPromise['reject'](_0x2b39d6);}return _0x5e77ff['save']();};}function saveUpdates(_0x14f95a,_0x2c3b42){return function(_0x462416){if(_0x462416){return _0x462416[_0x3671('0x31')](_0x14f95a)[_0x3671('0x1e')](function(_0x2b2ac3){return _0x2b2ac3;});}return null;};}function removeEntity(_0x2e2a48,_0x3e3806){return function(_0x2e51ca){if(_0x2e51ca){return _0x2e51ca[_0x3671('0x32')]()[_0x3671('0x1e')](function(){var _0x2777ba=_0x2e51ca[_0x3671('0x33')]({'plain':!![]});var _0x152ddf='ChatQueues';return db[_0x3671('0x34')]['destroy']({'where':{'type':_0x152ddf,'resourceId':_0x2777ba['id']}})[_0x3671('0x1e')](function(){return _0x2e51ca;});})[_0x3671('0x1e')](function(){_0x2e2a48['status'](0xcc)[_0x3671('0x29')]();});}};}function handleEntityNotFound(_0x17e22a,_0x56509a){return function(_0x5167b5){if(!_0x5167b5){_0x17e22a[_0x3671('0x27')](0x194);}return _0x5167b5;};}function handleError(_0xb7a8ee,_0x2ce012){_0x2ce012=_0x2ce012||0x1f4;return function(_0x5172b5){logger[_0x3671('0x23')](_0x5172b5['stack']);if(_0x5172b5[_0x3671('0x35')]){delete _0x5172b5[_0x3671('0x35')];}_0xb7a8ee['status'](_0x2ce012)['send'](_0x5172b5);};}exports['index']=function(_0x28a233,_0x52f145){var _0xe04a0c={},_0x2aa638={},_0x16a270={'count':0x0,'rows':[]};var _0x30e1dc=_[_0x3671('0x36')](db[_0x3671('0x37')][_0x3671('0x38')],function(_0x266a4d){return{'name':_0x266a4d[_0x3671('0x39')],'type':_0x266a4d[_0x3671('0x3a')]['key']};});_0x2aa638[_0x3671('0x3b')]=_[_0x3671('0x36')](_0x30e1dc,_0x3671('0x35'));_0x2aa638[_0x3671('0x3c')]=_['keys'](_0x28a233[_0x3671('0x3c')]);_0x2aa638[_0x3671('0x3d')]=_[_0x3671('0x3e')](_0x2aa638[_0x3671('0x3b')],_0x2aa638['query']);_0xe04a0c[_0x3671('0x3f')]=_['intersection'](_0x2aa638[_0x3671('0x3b')],qs[_0x3671('0x40')](_0x28a233['query'][_0x3671('0x40')]));_0xe04a0c[_0x3671('0x3f')]=_0xe04a0c[_0x3671('0x3f')]['length']?_0xe04a0c[_0x3671('0x3f')]:_0x2aa638[_0x3671('0x3b')];if(!_0x28a233[_0x3671('0x3c')][_0x3671('0x41')]('nolimit')){_0xe04a0c[_0x3671('0x2c')]=qs[_0x3671('0x2c')](_0x28a233['query']['limit']);_0xe04a0c['offset']=qs['offset'](_0x28a233['query'][_0x3671('0x2b')]);}_0xe04a0c['order']=qs['sort'](_0x28a233['query'][_0x3671('0x42')]);_0xe04a0c[_0x3671('0x43')]=qs[_0x3671('0x3d')](_[_0x3671('0x44')](_0x28a233[_0x3671('0x3c')],_0x2aa638[_0x3671('0x3d')]),_0x30e1dc);if(_0x28a233[_0x3671('0x3c')][_0x3671('0x45')]){_0xe04a0c[_0x3671('0x43')]=_['merge'](_0xe04a0c[_0x3671('0x43')],{'$or':_[_0x3671('0x36')](_0x30e1dc,function(_0x5098bf){if(_0x5098bf[_0x3671('0x3a')]!==_0x3671('0x46')){var _0x51c92d={};_0x51c92d[_0x5098bf[_0x3671('0x35')]]={'$like':'%'+_0x28a233['query'][_0x3671('0x45')]+'%'};return _0x51c92d;}})});}_0xe04a0c=_[_0x3671('0x47')]({},_0xe04a0c,_0x28a233[_0x3671('0x48')]);var _0x132b52={'where':_0xe04a0c[_0x3671('0x43')]};return db[_0x3671('0x37')][_0x3671('0x2e')](_0x132b52)[_0x3671('0x1e')](function(_0x5ad692){_0x16a270['count']=_0x5ad692;if(_0x28a233[_0x3671('0x3c')]['includeAll']){_0xe04a0c[_0x3671('0x49')]=[{'all':!![]}];}return db['ChatQueue'][_0x3671('0x4a')](_0xe04a0c);})[_0x3671('0x1e')](function(_0x40d309){_0x16a270[_0x3671('0x4b')]=_0x40d309;return _0x16a270;})[_0x3671('0x1e')](respondWithFilteredResult(_0x52f145,_0xe04a0c))['catch'](handleError(_0x52f145,null));};exports[_0x3671('0x4c')]=function(_0x2c9cf7,_0x25c942){var _0x159be2={'raw':!![],'where':{'id':_0x2c9cf7[_0x3671('0x4d')]['id']}},_0x5222a4={};_0x5222a4[_0x3671('0x3b')]=_[_0x3671('0x4e')](db[_0x3671('0x37')][_0x3671('0x38')]);_0x5222a4[_0x3671('0x3c')]=_[_0x3671('0x4e')](_0x2c9cf7[_0x3671('0x3c')]);_0x5222a4['filters']=_[_0x3671('0x3e')](_0x5222a4['model'],_0x5222a4[_0x3671('0x3c')]);_0x159be2[_0x3671('0x3f')]=_[_0x3671('0x3e')](_0x5222a4[_0x3671('0x3b')],qs[_0x3671('0x40')](_0x2c9cf7[_0x3671('0x3c')][_0x3671('0x40')]));_0x159be2['attributes']=_0x159be2[_0x3671('0x3f')]['length']?_0x159be2[_0x3671('0x3f')]:_0x5222a4[_0x3671('0x3b')];if(_0x2c9cf7[_0x3671('0x3c')]['includeAll']){_0x159be2[_0x3671('0x49')]=[{'all':!![]}];}_0x159be2=_['merge']({},_0x159be2,_0x2c9cf7[_0x3671('0x48')]);return db[_0x3671('0x37')][_0x3671('0x4f')](_0x159be2)[_0x3671('0x1e')](handleEntityNotFound(_0x25c942,null))[_0x3671('0x1e')](respondWithResult(_0x25c942,null))[_0x3671('0x50')](handleError(_0x25c942,null));};exports[_0x3671('0x51')]=function(_0x16e3c5,_0x57aa7d){return db[_0x3671('0x37')]['create'](_0x16e3c5['body'],{})[_0x3671('0x1e')](function(_0xa96db8){var _0x42fcb8=_0x16e3c5[_0x3671('0x52')][_0x3671('0x33')]({'plain':!![]});if(!_0x42fcb8)throw new Error(_0x3671('0x53'));if(_0x42fcb8[_0x3671('0x54')]===_0x3671('0x52')){var _0x12a95=_0xa96db8[_0x3671('0x33')]({'plain':!![]});var _0x3d6d28='ChatQueues';return db[_0x3671('0x55')][_0x3671('0x4f')]({'where':{'name':_0x3d6d28,'userProfileId':_0x42fcb8[_0x3671('0x56')]},'raw':!![]})[_0x3671('0x1e')](function(_0x2c3595){if(_0x2c3595&&_0x2c3595[_0x3671('0x57')]===0x0){return db['UserProfileResource'][_0x3671('0x51')]({'name':_0x12a95[_0x3671('0x35')],'resourceId':_0x12a95['id'],'type':_0x2c3595[_0x3671('0x35')],'sectionId':_0x2c3595['id']},{})[_0x3671('0x1e')](function(){return _0xa96db8;});}else{return _0xa96db8;}})[_0x3671('0x50')](function(_0x25c0a1){logger[_0x3671('0x23')](_0x3671('0x58'),_0x25c0a1);throw _0x25c0a1;});}return _0xa96db8;})[_0x3671('0x1e')](respondWithResult(_0x57aa7d,0xc9))[_0x3671('0x50')](handleError(_0x57aa7d,null));};exports[_0x3671('0x31')]=function(_0x46a19a,_0x541be8){if(_0x46a19a[_0x3671('0x59')]['id']){delete _0x46a19a[_0x3671('0x59')]['id'];}return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0x46a19a[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x541be8,null))[_0x3671('0x1e')](saveUpdates(_0x46a19a[_0x3671('0x59')],null))[_0x3671('0x1e')](respondWithResult(_0x541be8,null))[_0x3671('0x50')](handleError(_0x541be8,null));};exports[_0x3671('0x32')]=function(_0x21ba83,_0x3a9fa7){return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0x21ba83[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x3a9fa7,null))[_0x3671('0x1e')](removeEntity(_0x3a9fa7,null))[_0x3671('0x50')](handleError(_0x3a9fa7,null));};exports[_0x3671('0x5a')]=function(_0x5abba8,_0x15ce03){return db[_0x3671('0x37')][_0x3671('0x5a')]()[_0x3671('0x1e')](respondWithResult(_0x15ce03,null))[_0x3671('0x50')](handleError(_0x15ce03,null));};exports['getMembers']=function(_0x5a0ece,_0x2be030,_0x1d3683){var _0x45075c={'raw':!![],'where':{}},_0x9256ef={},_0x51586e;return db[_0x3671('0x37')][_0x3671('0x5b')]({'where':{'id':_0x5a0ece['params']['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x2be030,null))[_0x3671('0x1e')](function(_0x56d7db){if(_0x56d7db){_0x51586e=_0x56d7db[_0x3671('0x33')]({'plain':!![]});_0x9256ef['model']=_[_0x3671('0x4e')](db[_0x3671('0x5c')][_0x3671('0x38')]);_0x9256ef[_0x3671('0x3c')]=_['keys'](_0x5a0ece[_0x3671('0x3c')]);_0x9256ef[_0x3671('0x3d')]=_[_0x3671('0x3e')](_0x9256ef[_0x3671('0x3b')],_0x9256ef[_0x3671('0x3c')]);_0x45075c[_0x3671('0x3f')]=_[_0x3671('0x3e')](_0x9256ef[_0x3671('0x3b')],qs[_0x3671('0x40')](_0x5a0ece[_0x3671('0x3c')][_0x3671('0x40')]));_0x45075c[_0x3671('0x3f')]=_0x45075c[_0x3671('0x3f')][_0x3671('0x5d')]?_0x45075c[_0x3671('0x3f')]:_0x9256ef['model'];if(!_0x5a0ece[_0x3671('0x3c')][_0x3671('0x41')](_0x3671('0x5e'))){_0x45075c[_0x3671('0x2c')]=qs[_0x3671('0x2c')](_0x5a0ece['query'][_0x3671('0x2c')]);_0x45075c['offset']=qs[_0x3671('0x2b')](_0x5a0ece[_0x3671('0x3c')]['offset']);}_0x45075c[_0x3671('0x5f')]=qs['sort'](_0x5a0ece['query'][_0x3671('0x42')]);_0x45075c[_0x3671('0x43')]=qs['filters'](_[_0x3671('0x44')](_0x5a0ece[_0x3671('0x3c')],_0x9256ef[_0x3671('0x3d')]));_0x45075c['where'][_0x3671('0x60')]=_0x56d7db['id'];if(_0x5a0ece[_0x3671('0x3c')][_0x3671('0x45')]){_0x45075c[_0x3671('0x43')]=_[_0x3671('0x47')](_0x45075c['where'],{'$or':_[_0x3671('0x36')](_0x45075c[_0x3671('0x3f')],function(_0x1ab6ce){var _0x5e4557={};_0x5e4557[_0x1ab6ce]={'$like':'%'+_0x5a0ece[_0x3671('0x3c')][_0x3671('0x45')]+'%'};return _0x5e4557;})});}_0x45075c=_[_0x3671('0x47')]({},_0x45075c,_0x5a0ece['options']);return db[_0x3671('0x5c')][_0x3671('0x4a')](_0x45075c);}})[_0x3671('0x1e')](function(_0x3942c2){if(_0x3942c2){return db[_0x3671('0x61')]['findAndCountAll']({'where':{'id':_[_0x3671('0x36')](_0x3942c2,_0x3671('0x62')),'role':_0x3671('0x63')},'attributes':['id',_0x3671('0x35'),_0x3671('0x64'),_0x3671('0x65'),_0x3671('0x66')]});}})['then'](function(_0x2a08cf){if(_0x2a08cf){return{'count':_0x2a08cf['count'],'rows':_[_0x3671('0x36')](_0x2a08cf[_0x3671('0x4b')],function(_0x36e1c6){return{'membername':_0x36e1c6[_0x3671('0x35')],'UserId':_0x36e1c6['id'],'queue_name':_0x51586e[_0x3671('0x35')],'ChatQueueId':_0x51586e['id'],'interface':util[_0x3671('0x67')](_0x3671('0x68'),_0x3671('0x69'),_0x36e1c6[_0x3671('0x35')]),'penalty':0x0,'paused':_0x36e1c6[_0x3671('0x64')],'createdAt':_0x36e1c6[_0x3671('0x66')],'updatedAt':_0x36e1c6[_0x3671('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3671('0x1e')](respondWithFilteredResult(_0x2be030,_0x45075c))[_0x3671('0x50')](handleError(_0x2be030,null));};exports[_0x3671('0x6a')]=function(_0xaf3d09,_0x567c1d,_0x23b647){var _0x5e7528={};var _0x3fb376={};var _0x4bd66b;var _0xa342b;return db[_0x3671('0x37')]['findOne']({'where':{'id':_0xaf3d09[_0x3671('0x4d')]['id']}})['then'](handleEntityNotFound(_0x567c1d,null))[_0x3671('0x1e')](function(_0x5adf6a){if(_0x5adf6a){_0x4bd66b=_0x5adf6a;_0x3fb376[_0x3671('0x3b')]=_[_0x3671('0x4e')](db[_0x3671('0x6b')]['rawAttributes']);_0x3fb376[_0x3671('0x3c')]=_['keys'](_0xaf3d09[_0x3671('0x3c')]);_0x3fb376[_0x3671('0x3d')]=_['intersection'](_0x3fb376[_0x3671('0x3b')],_0x3fb376[_0x3671('0x3c')]);_0x5e7528[_0x3671('0x3f')]=_[_0x3671('0x3e')](_0x3fb376[_0x3671('0x3b')],qs[_0x3671('0x40')](_0xaf3d09['query']['fields']));_0x5e7528[_0x3671('0x3f')]=_0x5e7528[_0x3671('0x3f')][_0x3671('0x5d')]?_0x5e7528[_0x3671('0x3f')]:_0x3fb376[_0x3671('0x3b')];_0x5e7528[_0x3671('0x5f')]=qs['sort'](_0xaf3d09[_0x3671('0x3c')][_0x3671('0x42')]);_0x5e7528[_0x3671('0x43')]=qs[_0x3671('0x3d')](_[_0x3671('0x44')](_0xaf3d09[_0x3671('0x3c')],_0x3fb376[_0x3671('0x3d')]));if(_0xaf3d09[_0x3671('0x3c')][_0x3671('0x45')]){_0x5e7528['where']=_[_0x3671('0x47')](_0x5e7528['where'],{'$or':_[_0x3671('0x36')](_0x5e7528['attributes'],function(_0x41d937){var _0x4e743e={};_0x4e743e[_0x41d937]={'$like':'%'+_0xaf3d09[_0x3671('0x3c')][_0x3671('0x45')]+'%'};return _0x4e743e;})});}_0x5e7528=_['merge']({},_0x5e7528,_0xaf3d09['options']);return _0x4bd66b[_0x3671('0x6a')](_0x5e7528);}})['then'](function(_0x2b61ae){if(_0x2b61ae){_0xa342b=_0x2b61ae[_0x3671('0x5d')];if(!_0xaf3d09[_0x3671('0x3c')]['hasOwnProperty'](_0x3671('0x5e'))){_0x5e7528[_0x3671('0x2c')]=qs[_0x3671('0x2c')](_0xaf3d09['query'][_0x3671('0x2c')]);_0x5e7528[_0x3671('0x2b')]=qs[_0x3671('0x2b')](_0xaf3d09['query']['offset']);}return _0x4bd66b[_0x3671('0x6a')](_0x5e7528);}})[_0x3671('0x1e')](function(_0x5b0ee0){if(_0x5b0ee0){return _0x5b0ee0?{'count':_0xa342b,'rows':_0x5b0ee0}:null;}})[_0x3671('0x1e')](respondWithResult(_0x567c1d,null))['catch'](handleError(_0x567c1d,null));};exports[_0x3671('0x6c')]=function(_0x5de147,_0xc3dfcf,_0xf3f272){var _0x28278f=_0x5de147[_0x3671('0x59')][_0x3671('0x6d')];return db['Team']['findAll']({'where':{'id':_0x28278f},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x3671('0x35'),_0x3671('0x6e'),_0x3671('0x6f'),_0x3671('0x70')],'raw':!![]}]})[_0x3671('0x1e')](function(_0x288f49){if(_0x288f49){var _0x2a94e8=_[_0x3671('0x71')](_0x288f49,function(_0x309ee9){var _0xaf8224=_0x309ee9[_0x3671('0x33')]({'plain':!![]});return _0xaf8224['Agents'];});return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0x5de147[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](function(_0x2efd82){return db[_0x3671('0x72')]['transaction'](function(_0x53d32f){return _0x2efd82[_0x3671('0x6c')](_0x28278f,{'transaction':_0x53d32f})[_0x3671('0x1e')](function(){return BPromise[_0x3671('0x73')](_0x2a94e8,function(_0x5f3bf3){return db['UserChatQueue'][_0x3671('0x74')]({'where':{'UserId':_0x5f3bf3['id'],'ChatQueueId':_0x5de147[_0x3671('0x4d')]['id']},'transaction':_0x53d32f});});})[_0x3671('0x1e')](function(){_0x2a94e8[_0x3671('0x75')](function(_0x59efa9){socket[_0x3671('0x76')](_0x3671('0x77'),{'UserId':_0x59efa9['id'],'ChatQueueId':_0x2efd82['id']});});});});});}})[_0x3671('0x1e')](respondWithStatusCode(_0xc3dfcf,null))[_0x3671('0x50')](handleError(_0xc3dfcf,null));};exports[_0x3671('0x78')]=function(_0x2da42d,_0x1e5b25,_0x151133){return db[_0x3671('0x6b')][_0x3671('0x4a')]({'where':{'id':_0x2da42d[_0x3671('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db[_0x3671('0x61')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x3671('0x1e')](handleEntityNotFound(_0x1e5b25,null))[_0x3671('0x1e')](function(_0x59f3e8){var _0x135d86=_[_0x3671('0x36')](_0x59f3e8,'id');var _0xd7b0f3=[];var _0xba0076=[];var _0x412051=squel['select']();_0x412051['field'](_0x3671('0x79'))[_0x3671('0x7a')](_0x3671('0x7b'),'tq')['join'](_0x3671('0x7c'),'ut',_0x3671('0x7d'))[_0x3671('0x43')](_0x3671('0x7e'),_0x2da42d[_0x3671('0x4d')]['id']);for(var _0x5143ab=0x0;_0x5143ab<_0x59f3e8[_0x3671('0x5d')];_0x5143ab+=0x1){let _0x4f12da=_0x59f3e8[_0x5143ab];for(var _0x13b51d=0x0;_0x13b51d<_0x4f12da['Agents'][_0x3671('0x5d')];_0x13b51d+=0x1){let _0x3f10e4=_0x4f12da['Agents'][_0x13b51d];var _0x2c983a=_0x412051['clone']();_0x2c983a[_0x3671('0x43')](_0x3671('0x7f'),_0x3f10e4['id']);_0xba0076[_0x3671('0x80')](db['sequelize'][_0x3671('0x3c')](_0x2c983a[_0x3671('0x81')](),{'type':db[_0x3671('0x72')][_0x3671('0x82')][_0x3671('0x83')]})[_0x3671('0x1e')](function(_0x17c69f){if(_0x17c69f['length']===0x1){return _0x3f10e4['id'];}else{var _0x3e09c5=_['every'](_[_0x3671('0x36')](_0x17c69f,_0x3671('0x84')),function(_0x3c9799){return _[_0x3671('0x85')](_0x135d86,_0x3c9799);});if(_0x3e09c5){return _0x3f10e4['id'];}}}));}}return BPromise['all'](_0xba0076)['then'](function(_0x1c80db){_0xd7b0f3=_(_0xd7b0f3)[_0x3671('0x86')](_0x1c80db)[_0x3671('0x87')]()['value']();return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0x2da42d['params']['id']}})[_0x3671('0x1e')](function(_0x56b57a){return db[_0x3671('0x72')][_0x3671('0x88')](function(_0x9d7615){return _0x56b57a[_0x3671('0x78')](_0x2da42d[_0x3671('0x3c')][_0x3671('0x6d')],{'transaction':_0x9d7615})[_0x3671('0x1e')](function(){if(!_[_0x3671('0x89')](_0xd7b0f3)){return _0x56b57a[_0x3671('0x8a')](_0xd7b0f3,{'transaction':_0x9d7615});}})['then'](function(){_0xd7b0f3['forEach'](function(_0x27f129){socket['emit'](_0x3671('0x8b'),{'UserId':_0x27f129,'ChatQueueId':_0x56b57a['id']});});});});});});})['then'](respondWithStatusCode(_0x1e5b25,null))[_0x3671('0x50')](handleError(_0x1e5b25,null));};exports[_0x3671('0x8c')]=function(_0x3ccf90,_0x4361a0,_0x4bda5a){return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0x3ccf90[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x4361a0,null))[_0x3671('0x1e')](function(_0x236714){if(_0x236714){return _0x236714[_0x3671('0x8c')](_0x3ccf90[_0x3671('0x59')][_0x3671('0x6d')],_[_0x3671('0x8d')](_0x3ccf90[_0x3671('0x59')],[_0x3671('0x6d'),'id'])||{})['spread'](function(_0x29d083){for(var _0x14d685=0x0;_0x14d685<_0x3ccf90[_0x3671('0x59')]['ids'][_0x3671('0x5d')];_0x14d685+=0x1){socket[_0x3671('0x76')](_0x3671('0x77'),{'UserId':Number(_0x3ccf90[_0x3671('0x59')][_0x3671('0x6d')][_0x14d685]),'ChatQueueId':Number(_0x3ccf90[_0x3671('0x4d')]['id'])});}return _0x29d083;});}})[_0x3671('0x1e')](respondWithResult(_0x4361a0,null))[_0x3671('0x50')](handleError(_0x4361a0,null));};exports['removeAgents']=function(_0xbaea02,_0x1db395,_0x243062){return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0xbaea02[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x1db395,null))['then'](function(_0x195fea){if(_0x195fea){return _0x195fea[_0x3671('0x8a')](_0xbaea02['query'][_0x3671('0x6d')])[_0x3671('0x1e')](function(){if(_[_0x3671('0x8e')](_0xbaea02[_0x3671('0x3c')][_0x3671('0x6d')])){for(var _0x19b2fc=0x0;_0x19b2fc<_0xbaea02['query'][_0x3671('0x6d')][_0x3671('0x5d')];_0x19b2fc+=0x1){socket[_0x3671('0x76')]('userChatQueue:remove',{'UserId':Number(_0xbaea02[_0x3671('0x3c')]['ids'][_0x19b2fc]),'ChatQueueId':Number(_0xbaea02[_0x3671('0x4d')]['id'])});}}else{socket[_0x3671('0x76')](_0x3671('0x8b'),{'UserId':Number(_0xbaea02[_0x3671('0x3c')]['ids']),'ChatQueueId':Number(_0xbaea02[_0x3671('0x4d')]['id'])});}});}})[_0x3671('0x1e')](respondWithStatusCode(_0x1db395,null))[_0x3671('0x50')](handleError(_0x1db395,null));};exports[_0x3671('0x8f')]=function(_0xbc2696,_0x3d3bc9,_0x135286){var _0x1469b9={};var _0x4cf558={};var _0x588e23;var _0xcca819;return db[_0x3671('0x37')][_0x3671('0x5b')]({'where':{'id':_0xbc2696[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x3d3bc9,null))[_0x3671('0x1e')](function(_0x19ff6c){if(_0x19ff6c){_0x588e23=_0x19ff6c;_0x4cf558['model']=_[_0x3671('0x4e')](db[_0x3671('0x61')][_0x3671('0x38')]);_0x4cf558['query']=_[_0x3671('0x4e')](_0xbc2696['query']);_0x4cf558[_0x3671('0x3d')]=_[_0x3671('0x3e')](_0x4cf558[_0x3671('0x3b')],_0x4cf558[_0x3671('0x3c')]);_0x1469b9[_0x3671('0x3f')]=_[_0x3671('0x3e')](_0x4cf558[_0x3671('0x3b')],qs['fields'](_0xbc2696[_0x3671('0x3c')][_0x3671('0x40')]));_0x1469b9[_0x3671('0x3f')]=_0x1469b9[_0x3671('0x3f')]['length']?_0x1469b9[_0x3671('0x3f')]:_0x4cf558[_0x3671('0x3b')];_0x1469b9['order']=qs['sort'](_0xbc2696[_0x3671('0x3c')][_0x3671('0x42')]);_0x1469b9[_0x3671('0x43')]=qs[_0x3671('0x3d')](_[_0x3671('0x44')](_0xbc2696['query'],_0x4cf558[_0x3671('0x3d')]));if(_0xbc2696[_0x3671('0x3c')]['filter']){_0x1469b9['where']=_[_0x3671('0x47')](_0x1469b9[_0x3671('0x43')],{'$or':_['map'](_0x1469b9[_0x3671('0x3f')],function(_0x552667){var _0x1af9f2={};_0x1af9f2[_0x552667]={'$like':'%'+_0xbc2696[_0x3671('0x3c')][_0x3671('0x45')]+'%'};return _0x1af9f2;})});}_0x1469b9=_['merge']({},_0x1469b9,_0xbc2696[_0x3671('0x48')]);return _0x588e23[_0x3671('0x8f')](_0x1469b9);}})['then'](function(_0x47b3af){if(_0x47b3af){_0xcca819=_0x47b3af['length'];if(!_0xbc2696[_0x3671('0x3c')][_0x3671('0x41')](_0x3671('0x5e'))){_0x1469b9[_0x3671('0x2c')]=qs['limit'](_0xbc2696[_0x3671('0x3c')][_0x3671('0x2c')]);_0x1469b9[_0x3671('0x2b')]=qs[_0x3671('0x2b')](_0xbc2696[_0x3671('0x3c')][_0x3671('0x2b')]);}return _0x588e23[_0x3671('0x8f')](_0x1469b9);}})['then'](function(_0x9ac553){if(_0x9ac553){return _0x9ac553?{'count':_0xcca819,'rows':_0x9ac553}:null;}})[_0x3671('0x1e')](respondWithResult(_0x3d3bc9,null))['catch'](handleError(_0x3d3bc9,null));};
\ No newline at end of file
+var _0xc62c=['includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','UserChatQueue','ChatQueueId','User','findAndCountAll','chatPause','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','TeamId','includes','all','union','value','isEmpty','forEach','userChatQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','params'];(function(_0x157d89,_0x31c6b3){var _0x592f7c=function(_0xfede7d){while(--_0xfede7d){_0x157d89['push'](_0x157d89['shift']());}};_0x592f7c(++_0x31c6b3);}(_0xc62c,0xdb));var _0xcc62=function(_0xac8961,_0xf8bea5){_0xac8961=_0xac8961-0x0;var _0x27727f=_0xc62c[_0xac8961];return _0x27727f;};'use strict';var emlformat=require(_0xcc62('0x0'));var rimraf=require(_0xcc62('0x1'));var zipdir=require(_0xcc62('0x2'));var jsonpatch=require(_0xcc62('0x3'));var rp=require('request-promise');var moment=require(_0xcc62('0x4'));var BPromise=require(_0xcc62('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcc62('0x6'));var sox=require(_0xcc62('0x7'));var csv=require(_0xcc62('0x8'));var ejs=require(_0xcc62('0x9'));var fs=require('fs');var fs_extra=require(_0xcc62('0xa'));var _=require('lodash');var squel=require(_0xcc62('0xb'));var crypto=require(_0xcc62('0xc'));var jsforce=require(_0xcc62('0xd'));var deskjs=require(_0xcc62('0xe'));var toCsv=require(_0xcc62('0x8'));var querystring=require('querystring');var Papa=require(_0xcc62('0xf'));var Redis=require(_0xcc62('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcc62('0x11'));var as=require(_0xcc62('0x12'));var hardwareService=require(_0xcc62('0x13'));var logger=require(_0xcc62('0x14'))(_0xcc62('0x15'));var utils=require(_0xcc62('0x16'));var config=require(_0xcc62('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc62('0x18'))['db'];config[_0xcc62('0x19')]=_[_0xcc62('0x1a')](config['redis'],{'host':_0xcc62('0x1b'),'port':0x18eb});var socket=require(_0xcc62('0x1c'))(new Redis(config[_0xcc62('0x19')]));require(_0xcc62('0x1d'))['register'](socket);var jayson=require(_0xcc62('0x1e'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x307eb7,_0x171021,_0x1be36b,_0x5dc646){return new BPromise(function(_0x459b66,_0x119b17){var _0x324bd7=_0x5dc646||client;return _0x324bd7[_0xcc62('0x1f')](_0x307eb7,_0x1be36b)[_0xcc62('0x20')](function(_0xd41b2c){logger[_0xcc62('0x21')](_0xcc62('0x22'),_0x171021,_0xcc62('0x23'));logger[_0xcc62('0x24')](_0xcc62('0x25'),_0x171021,_0xcc62('0x23'),JSON[_0xcc62('0x26')](_0xd41b2c));if(_0xd41b2c[_0xcc62('0x27')]){if(_0xd41b2c['error'][_0xcc62('0x28')]===0x1f4){logger[_0xcc62('0x27')]('ChatQueue,\x20%s,\x20%s',_0x171021,_0xd41b2c[_0xcc62('0x27')][_0xcc62('0x29')]);return _0x119b17(_0xd41b2c[_0xcc62('0x27')][_0xcc62('0x29')]);}logger['error'](_0xcc62('0x22'),_0x171021,_0xd41b2c['error']['message']);return _0x459b66(_0xd41b2c[_0xcc62('0x27')][_0xcc62('0x29')]);}else{logger[_0xcc62('0x21')](_0xcc62('0x22'),_0x171021,_0xcc62('0x23'));_0x459b66(_0xd41b2c['result'][_0xcc62('0x29')]);}})[_0xcc62('0x2a')](function(_0x158dba){logger[_0xcc62('0x27')](_0xcc62('0x22'),_0x171021,_0x158dba);_0x119b17(_0x158dba);});});}function respondWithStatusCode(_0x49f3b9,_0x4bb506){_0x4bb506=_0x4bb506||0xcc;return function(_0x2bb2e6){if(_0x2bb2e6){return _0x49f3b9[_0xcc62('0x2b')](_0x4bb506);}return _0x49f3b9['status'](_0x4bb506)[_0xcc62('0x2c')]();};}function respondWithResult(_0x4f6236,_0x5593b8){_0x5593b8=_0x5593b8||0xc8;return function(_0xd0702e){if(_0xd0702e){return _0x4f6236[_0xcc62('0x2d')](_0x5593b8)[_0xcc62('0x2e')](_0xd0702e);}};}function respondWithFilteredResult(_0x48ae7f,_0x33fc22){return function(_0xbc361e){if(_0xbc361e){var _0x33c3c8=typeof _0x33fc22[_0xcc62('0x2f')]===_0xcc62('0x30')&&typeof _0x33fc22[_0xcc62('0x31')]===_0xcc62('0x30');var _0x28a21f=_0xbc361e[_0xcc62('0x32')];var _0xb3febc=_0x33c3c8?0x0:_0x33fc22[_0xcc62('0x2f')];var _0x27d713=_0x33c3c8?_0xbc361e[_0xcc62('0x32')]:_0x33fc22[_0xcc62('0x2f')]+_0x33fc22[_0xcc62('0x31')];var _0x1d3e0d;if(_0x27d713>=_0x28a21f){_0x27d713=_0x28a21f;_0x1d3e0d=0xc8;}else{_0x1d3e0d=0xce;}_0x48ae7f['status'](_0x1d3e0d);return _0x48ae7f[_0xcc62('0x33')](_0xcc62('0x34'),_0xb3febc+'-'+_0x27d713+'/'+_0x28a21f)[_0xcc62('0x2e')](_0xbc361e);}return null;};}function patchUpdates(_0x44c030){return function(_0x2a723a){try{jsonpatch[_0xcc62('0x35')](_0x2a723a,_0x44c030,!![]);}catch(_0x47940e){return BPromise[_0xcc62('0x36')](_0x47940e);}return _0x2a723a[_0xcc62('0x37')]();};}function saveUpdates(_0x455215,_0x57d8fb){return function(_0x187207){if(_0x187207){return _0x187207['update'](_0x455215)[_0xcc62('0x20')](function(_0x343250){return _0x343250;});}return null;};}function removeEntity(_0x1bac77,_0x299711){return function(_0x1c336e){if(_0x1c336e){return _0x1c336e[_0xcc62('0x38')]()[_0xcc62('0x20')](function(){var _0xba67fb=_0x1c336e['get']({'plain':!![]});var _0xed77ff='ChatQueues';return db[_0xcc62('0x39')][_0xcc62('0x38')]({'where':{'type':_0xed77ff,'resourceId':_0xba67fb['id']}})[_0xcc62('0x20')](function(){return _0x1c336e;});})[_0xcc62('0x20')](function(){_0x1bac77[_0xcc62('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22aec2,_0xed77b1){return function(_0x3bb597){if(!_0x3bb597){_0x22aec2[_0xcc62('0x2b')](0x194);}return _0x3bb597;};}function handleError(_0x155b1c,_0x3ad46f){_0x3ad46f=_0x3ad46f||0x1f4;return function(_0x2b0061){logger['error'](_0x2b0061['stack']);if(_0x2b0061[_0xcc62('0x3a')]){delete _0x2b0061[_0xcc62('0x3a')];}_0x155b1c[_0xcc62('0x2d')](_0x3ad46f)[_0xcc62('0x3b')](_0x2b0061);};}exports[_0xcc62('0x3c')]=function(_0x21bceb,_0x1d1de8){var _0x3685ad={},_0x1d6384={},_0x44e6ff={'count':0x0,'rows':[]};var _0x401a05=_[_0xcc62('0x3d')](db[_0xcc62('0x3e')][_0xcc62('0x3f')],function(_0x3bd2ef){return{'name':_0x3bd2ef[_0xcc62('0x40')],'type':_0x3bd2ef[_0xcc62('0x41')]['key']};});_0x1d6384[_0xcc62('0x42')]=_['map'](_0x401a05,_0xcc62('0x3a'));_0x1d6384['query']=_[_0xcc62('0x43')](_0x21bceb[_0xcc62('0x44')]);_0x1d6384[_0xcc62('0x45')]=_['intersection'](_0x1d6384[_0xcc62('0x42')],_0x1d6384[_0xcc62('0x44')]);_0x3685ad[_0xcc62('0x46')]=_[_0xcc62('0x47')](_0x1d6384['model'],qs['fields'](_0x21bceb[_0xcc62('0x44')][_0xcc62('0x48')]));_0x3685ad['attributes']=_0x3685ad[_0xcc62('0x46')][_0xcc62('0x49')]?_0x3685ad['attributes']:_0x1d6384[_0xcc62('0x42')];if(!_0x21bceb['query'][_0xcc62('0x4a')](_0xcc62('0x4b'))){_0x3685ad[_0xcc62('0x31')]=qs[_0xcc62('0x31')](_0x21bceb[_0xcc62('0x44')][_0xcc62('0x31')]);_0x3685ad['offset']=qs[_0xcc62('0x2f')](_0x21bceb['query'][_0xcc62('0x2f')]);}_0x3685ad[_0xcc62('0x4c')]=qs[_0xcc62('0x4d')](_0x21bceb[_0xcc62('0x44')][_0xcc62('0x4d')]);_0x3685ad[_0xcc62('0x4e')]=qs[_0xcc62('0x45')](_[_0xcc62('0x4f')](_0x21bceb['query'],_0x1d6384[_0xcc62('0x45')]),_0x401a05);if(_0x21bceb[_0xcc62('0x44')][_0xcc62('0x50')]){_0x3685ad['where']=_[_0xcc62('0x51')](_0x3685ad['where'],{'$or':_[_0xcc62('0x3d')](_0x401a05,function(_0x33c230){if(_0x33c230[_0xcc62('0x41')]!=='VIRTUAL'){var _0x26d44b={};_0x26d44b[_0x33c230[_0xcc62('0x3a')]]={'$like':'%'+_0x21bceb[_0xcc62('0x44')]['filter']+'%'};return _0x26d44b;}})});}_0x3685ad=_[_0xcc62('0x51')]({},_0x3685ad,_0x21bceb[_0xcc62('0x52')]);var _0x5a171c={'where':_0x3685ad[_0xcc62('0x4e')]};return db[_0xcc62('0x3e')]['count'](_0x5a171c)[_0xcc62('0x20')](function(_0x8e5c5d){_0x44e6ff[_0xcc62('0x32')]=_0x8e5c5d;if(_0x21bceb[_0xcc62('0x44')]['includeAll']){_0x3685ad[_0xcc62('0x53')]=[{'all':!![]}];}return db['ChatQueue'][_0xcc62('0x54')](_0x3685ad);})[_0xcc62('0x20')](function(_0x46f35a){_0x44e6ff[_0xcc62('0x55')]=_0x46f35a;return _0x44e6ff;})[_0xcc62('0x20')](respondWithFilteredResult(_0x1d1de8,_0x3685ad))['catch'](handleError(_0x1d1de8,null));};exports['show']=function(_0x1d7408,_0x252e3a){var _0x290f60={'raw':!![],'where':{'id':_0x1d7408[_0xcc62('0x56')]['id']}},_0x3b96d1={};_0x3b96d1[_0xcc62('0x42')]=_[_0xcc62('0x43')](db[_0xcc62('0x3e')]['rawAttributes']);_0x3b96d1[_0xcc62('0x44')]=_['keys'](_0x1d7408[_0xcc62('0x44')]);_0x3b96d1[_0xcc62('0x45')]=_[_0xcc62('0x47')](_0x3b96d1[_0xcc62('0x42')],_0x3b96d1[_0xcc62('0x44')]);_0x290f60[_0xcc62('0x46')]=_['intersection'](_0x3b96d1['model'],qs[_0xcc62('0x48')](_0x1d7408[_0xcc62('0x44')]['fields']));_0x290f60['attributes']=_0x290f60[_0xcc62('0x46')][_0xcc62('0x49')]?_0x290f60[_0xcc62('0x46')]:_0x3b96d1[_0xcc62('0x42')];if(_0x1d7408[_0xcc62('0x44')][_0xcc62('0x57')]){_0x290f60[_0xcc62('0x53')]=[{'all':!![]}];}_0x290f60=_[_0xcc62('0x51')]({},_0x290f60,_0x1d7408[_0xcc62('0x52')]);return db[_0xcc62('0x3e')]['find'](_0x290f60)[_0xcc62('0x20')](handleEntityNotFound(_0x252e3a,null))[_0xcc62('0x20')](respondWithResult(_0x252e3a,null))[_0xcc62('0x2a')](handleError(_0x252e3a,null));};exports['create']=function(_0x1f1d89,_0x2949ec){return db[_0xcc62('0x3e')][_0xcc62('0x58')](_0x1f1d89[_0xcc62('0x59')],{})[_0xcc62('0x20')](function(_0x5e8bcd){var _0x4e2b13=_0x1f1d89[_0xcc62('0x5a')][_0xcc62('0x5b')]({'plain':!![]});if(!_0x4e2b13)throw new Error(_0xcc62('0x5c'));if(_0x4e2b13[_0xcc62('0x5d')]==='user'){var _0x471eb5=_0x5e8bcd[_0xcc62('0x5b')]({'plain':!![]});var _0x3f4963=_0xcc62('0x5e');return db[_0xcc62('0x5f')][_0xcc62('0x60')]({'where':{'name':_0x3f4963,'userProfileId':_0x4e2b13[_0xcc62('0x61')]},'raw':!![]})[_0xcc62('0x20')](function(_0x2984b4){if(_0x2984b4&&_0x2984b4[_0xcc62('0x62')]===0x0){return db[_0xcc62('0x39')][_0xcc62('0x58')]({'name':_0x471eb5['name'],'resourceId':_0x471eb5['id'],'type':_0x2984b4[_0xcc62('0x3a')],'sectionId':_0x2984b4['id']},{})[_0xcc62('0x20')](function(){return _0x5e8bcd;});}else{return _0x5e8bcd;}})['catch'](function(_0x24b6ed){logger[_0xcc62('0x27')](_0xcc62('0x63'),_0x24b6ed);throw _0x24b6ed;});}return _0x5e8bcd;})[_0xcc62('0x20')](respondWithResult(_0x2949ec,0xc9))[_0xcc62('0x2a')](handleError(_0x2949ec,null));};exports[_0xcc62('0x64')]=function(_0x1880ed,_0x278992){if(_0x1880ed[_0xcc62('0x59')]['id']){delete _0x1880ed[_0xcc62('0x59')]['id'];}return db['ChatQueue'][_0xcc62('0x60')]({'where':{'id':_0x1880ed['params']['id']}})[_0xcc62('0x20')](handleEntityNotFound(_0x278992,null))[_0xcc62('0x20')](saveUpdates(_0x1880ed[_0xcc62('0x59')],null))[_0xcc62('0x20')](respondWithResult(_0x278992,null))[_0xcc62('0x2a')](handleError(_0x278992,null));};exports[_0xcc62('0x38')]=function(_0xa810c6,_0x4dd379){return db[_0xcc62('0x3e')][_0xcc62('0x60')]({'where':{'id':_0xa810c6[_0xcc62('0x56')]['id']}})['then'](handleEntityNotFound(_0x4dd379,null))['then'](removeEntity(_0x4dd379,null))[_0xcc62('0x2a')](handleError(_0x4dd379,null));};exports['describe']=function(_0x498c73,_0x59f771){return db[_0xcc62('0x3e')][_0xcc62('0x65')]()['then'](respondWithResult(_0x59f771,null))[_0xcc62('0x2a')](handleError(_0x59f771,null));};exports[_0xcc62('0x66')]=function(_0x442bb0,_0x82bc1e,_0x1a6d8a){var _0x213517={'raw':!![],'where':{}},_0x288fd2={},_0x296e80;return db['ChatQueue']['findOne']({'where':{'id':_0x442bb0[_0xcc62('0x56')]['id']}})[_0xcc62('0x20')](handleEntityNotFound(_0x82bc1e,null))[_0xcc62('0x20')](function(_0x193a6b){if(_0x193a6b){_0x296e80=_0x193a6b['get']({'plain':!![]});_0x288fd2[_0xcc62('0x42')]=_[_0xcc62('0x43')](db[_0xcc62('0x67')]['rawAttributes']);_0x288fd2[_0xcc62('0x44')]=_[_0xcc62('0x43')](_0x442bb0['query']);_0x288fd2[_0xcc62('0x45')]=_['intersection'](_0x288fd2['model'],_0x288fd2[_0xcc62('0x44')]);_0x213517[_0xcc62('0x46')]=_[_0xcc62('0x47')](_0x288fd2[_0xcc62('0x42')],qs[_0xcc62('0x48')](_0x442bb0[_0xcc62('0x44')]['fields']));_0x213517[_0xcc62('0x46')]=_0x213517[_0xcc62('0x46')][_0xcc62('0x49')]?_0x213517[_0xcc62('0x46')]:_0x288fd2[_0xcc62('0x42')];if(!_0x442bb0[_0xcc62('0x44')]['hasOwnProperty'](_0xcc62('0x4b'))){_0x213517[_0xcc62('0x31')]=qs[_0xcc62('0x31')](_0x442bb0['query']['limit']);_0x213517['offset']=qs[_0xcc62('0x2f')](_0x442bb0[_0xcc62('0x44')][_0xcc62('0x2f')]);}_0x213517['order']=qs[_0xcc62('0x4d')](_0x442bb0[_0xcc62('0x44')][_0xcc62('0x4d')]);_0x213517[_0xcc62('0x4e')]=qs[_0xcc62('0x45')](_[_0xcc62('0x4f')](_0x442bb0[_0xcc62('0x44')],_0x288fd2['filters']));_0x213517[_0xcc62('0x4e')][_0xcc62('0x68')]=_0x193a6b['id'];if(_0x442bb0[_0xcc62('0x44')][_0xcc62('0x50')]){_0x213517[_0xcc62('0x4e')]=_[_0xcc62('0x51')](_0x213517[_0xcc62('0x4e')],{'$or':_[_0xcc62('0x3d')](_0x213517[_0xcc62('0x46')],function(_0x13fd88){var _0x13f6b6={};_0x13f6b6[_0x13fd88]={'$like':'%'+_0x442bb0[_0xcc62('0x44')][_0xcc62('0x50')]+'%'};return _0x13f6b6;})});}_0x213517=_['merge']({},_0x213517,_0x442bb0[_0xcc62('0x52')]);return db[_0xcc62('0x67')]['findAll'](_0x213517);}})[_0xcc62('0x20')](function(_0x4725d1){if(_0x4725d1){return db[_0xcc62('0x69')][_0xcc62('0x6a')]({'where':{'id':_[_0xcc62('0x3d')](_0x4725d1,'UserId'),'role':'agent'},'attributes':['id',_0xcc62('0x3a'),_0xcc62('0x6b'),'updatedAt','createdAt']});}})[_0xcc62('0x20')](function(_0x3ebe47){if(_0x3ebe47){return{'count':_0x3ebe47['count'],'rows':_[_0xcc62('0x3d')](_0x3ebe47['rows'],function(_0x1214e3){return{'membername':_0x1214e3[_0xcc62('0x3a')],'UserId':_0x1214e3['id'],'queue_name':_0x296e80[_0xcc62('0x3a')],'ChatQueueId':_0x296e80['id'],'interface':util[_0xcc62('0x6c')](_0xcc62('0x6d'),_0xcc62('0x6e'),_0x1214e3[_0xcc62('0x3a')]),'penalty':0x0,'paused':_0x1214e3[_0xcc62('0x6b')],'createdAt':_0x1214e3[_0xcc62('0x6f')],'updatedAt':_0x1214e3['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x82bc1e,_0x213517))[_0xcc62('0x2a')](handleError(_0x82bc1e,null));};exports[_0xcc62('0x70')]=function(_0x4cd0c8,_0x34e607,_0x1be142){var _0x4423cb={};var _0x5d2d72={};var _0x41d633;var _0x1648fd;return db[_0xcc62('0x3e')]['findOne']({'where':{'id':_0x4cd0c8['params']['id']}})[_0xcc62('0x20')](handleEntityNotFound(_0x34e607,null))[_0xcc62('0x20')](function(_0x5f2de4){if(_0x5f2de4){_0x41d633=_0x5f2de4;_0x5d2d72['model']=_['keys'](db[_0xcc62('0x71')]['rawAttributes']);_0x5d2d72[_0xcc62('0x44')]=_[_0xcc62('0x43')](_0x4cd0c8['query']);_0x5d2d72[_0xcc62('0x45')]=_['intersection'](_0x5d2d72[_0xcc62('0x42')],_0x5d2d72[_0xcc62('0x44')]);_0x4423cb[_0xcc62('0x46')]=_['intersection'](_0x5d2d72[_0xcc62('0x42')],qs[_0xcc62('0x48')](_0x4cd0c8[_0xcc62('0x44')][_0xcc62('0x48')]));_0x4423cb['attributes']=_0x4423cb[_0xcc62('0x46')][_0xcc62('0x49')]?_0x4423cb[_0xcc62('0x46')]:_0x5d2d72['model'];_0x4423cb[_0xcc62('0x4c')]=qs['sort'](_0x4cd0c8[_0xcc62('0x44')]['sort']);_0x4423cb[_0xcc62('0x4e')]=qs[_0xcc62('0x45')](_[_0xcc62('0x4f')](_0x4cd0c8[_0xcc62('0x44')],_0x5d2d72[_0xcc62('0x45')]));if(_0x4cd0c8[_0xcc62('0x44')][_0xcc62('0x50')]){_0x4423cb['where']=_[_0xcc62('0x51')](_0x4423cb[_0xcc62('0x4e')],{'$or':_[_0xcc62('0x3d')](_0x4423cb['attributes'],function(_0x442749){var _0x4fdd6f={};_0x4fdd6f[_0x442749]={'$like':'%'+_0x4cd0c8[_0xcc62('0x44')][_0xcc62('0x50')]+'%'};return _0x4fdd6f;})});}_0x4423cb=_['merge']({},_0x4423cb,_0x4cd0c8['options']);return _0x41d633['getTeams'](_0x4423cb);}})[_0xcc62('0x20')](function(_0x59c0c6){if(_0x59c0c6){_0x1648fd=_0x59c0c6[_0xcc62('0x49')];if(!_0x4cd0c8[_0xcc62('0x44')]['hasOwnProperty'](_0xcc62('0x4b'))){_0x4423cb[_0xcc62('0x31')]=qs['limit'](_0x4cd0c8[_0xcc62('0x44')][_0xcc62('0x31')]);_0x4423cb[_0xcc62('0x2f')]=qs[_0xcc62('0x2f')](_0x4cd0c8[_0xcc62('0x44')][_0xcc62('0x2f')]);}return _0x41d633[_0xcc62('0x70')](_0x4423cb);}})[_0xcc62('0x20')](function(_0x2f5316){if(_0x2f5316){return _0x2f5316?{'count':_0x1648fd,'rows':_0x2f5316}:null;}})[_0xcc62('0x20')](respondWithResult(_0x34e607,null))[_0xcc62('0x2a')](handleError(_0x34e607,null));};exports[_0xcc62('0x72')]=function(_0x14927b,_0x157110,_0x24b03d){var _0x41cf98=_0x14927b[_0xcc62('0x59')][_0xcc62('0x73')];return db[_0xcc62('0x71')][_0xcc62('0x54')]({'where':{'id':_0x41cf98},'attributes':['id'],'include':[{'model':db[_0xcc62('0x69')],'as':_0xcc62('0x74'),'attributes':['id',_0xcc62('0x3a'),_0xcc62('0x75'),_0xcc62('0x76'),'interface'],'raw':!![]}]})[_0xcc62('0x20')](function(_0x5b789a){if(_0x5b789a){var _0x1dd461=_[_0xcc62('0x77')](_0x5b789a,function(_0x56d085){var _0x258695=_0x56d085[_0xcc62('0x5b')]({'plain':!![]});return _0x258695[_0xcc62('0x74')];});return db[_0xcc62('0x3e')]['find']({'where':{'id':_0x14927b[_0xcc62('0x56')]['id']}})[_0xcc62('0x20')](function(_0x1a12f5){return db[_0xcc62('0x78')][_0xcc62('0x79')](function(_0xf7903d){return _0x1a12f5[_0xcc62('0x72')](_0x41cf98,{'transaction':_0xf7903d})[_0xcc62('0x20')](function(){return BPromise['each'](_0x1dd461,function(_0x22f449){return db['UserChatQueue'][_0xcc62('0x7a')]({'where':{'UserId':_0x22f449['id'],'ChatQueueId':_0x14927b[_0xcc62('0x56')]['id']},'transaction':_0xf7903d});});})['then'](function(){_0x1dd461['forEach'](function(_0x1595fe){socket[_0xcc62('0x7b')](_0xcc62('0x7c'),{'UserId':_0x1595fe['id'],'ChatQueueId':_0x1a12f5['id']});});});});});}})[_0xcc62('0x20')](respondWithStatusCode(_0x157110,null))[_0xcc62('0x2a')](handleError(_0x157110,null));};exports[_0xcc62('0x7d')]=function(_0x3ef4b8,_0x5765d6,_0x4bf26b){return db[_0xcc62('0x71')][_0xcc62('0x54')]({'where':{'id':_0x3ef4b8[_0xcc62('0x44')][_0xcc62('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcc62('0x74'),'attributes':['id'],'raw':!![]}]})[_0xcc62('0x20')](handleEntityNotFound(_0x5765d6,null))[_0xcc62('0x20')](function(_0x336d76){var _0x17481e=_[_0xcc62('0x3d')](_0x336d76,'id');var _0x5af7ac=[];var _0x3c943b=[];var _0x635c9e=squel[_0xcc62('0x7e')]();_0x635c9e[_0xcc62('0x7f')](_0xcc62('0x80'))[_0xcc62('0x81')](_0xcc62('0x82'),'tq')[_0xcc62('0x83')](_0xcc62('0x84'),'ut',_0xcc62('0x85'))[_0xcc62('0x4e')](_0xcc62('0x86'),_0x3ef4b8[_0xcc62('0x56')]['id']);for(var _0x1ed40e=0x0;_0x1ed40e<_0x336d76[_0xcc62('0x49')];_0x1ed40e+=0x1){let _0x517abb=_0x336d76[_0x1ed40e];for(var _0x19dcb2=0x0;_0x19dcb2<_0x517abb['Agents'][_0xcc62('0x49')];_0x19dcb2+=0x1){let _0x33ba08=_0x517abb[_0xcc62('0x74')][_0x19dcb2];var _0x674c03=_0x635c9e[_0xcc62('0x87')]();_0x674c03[_0xcc62('0x4e')]('ut.UserId\x20=\x20?',_0x33ba08['id']);_0x3c943b[_0xcc62('0x88')](db[_0xcc62('0x78')]['query'](_0x674c03[_0xcc62('0x89')](),{'type':db[_0xcc62('0x78')][_0xcc62('0x8a')]['SELECT']})[_0xcc62('0x20')](function(_0x9677d1){if(_0x9677d1[_0xcc62('0x49')]===0x1){return _0x33ba08['id'];}else{var _0x181bfd=_['every'](_['map'](_0x9677d1,_0xcc62('0x8b')),function(_0x5aacd4){return _[_0xcc62('0x8c')](_0x17481e,_0x5aacd4);});if(_0x181bfd){return _0x33ba08['id'];}}}));}}return BPromise[_0xcc62('0x8d')](_0x3c943b)['then'](function(_0x31c4de){_0x5af7ac=_(_0x5af7ac)[_0xcc62('0x8e')](_0x31c4de)['compact']()[_0xcc62('0x8f')]();return db[_0xcc62('0x3e')][_0xcc62('0x60')]({'where':{'id':_0x3ef4b8[_0xcc62('0x56')]['id']}})[_0xcc62('0x20')](function(_0x4a3bc8){return db[_0xcc62('0x78')]['transaction'](function(_0x451ae3){return _0x4a3bc8[_0xcc62('0x7d')](_0x3ef4b8['query'][_0xcc62('0x73')],{'transaction':_0x451ae3})['then'](function(){if(!_[_0xcc62('0x90')](_0x5af7ac)){return _0x4a3bc8['removeAgents'](_0x5af7ac,{'transaction':_0x451ae3});}})[_0xcc62('0x20')](function(){_0x5af7ac[_0xcc62('0x91')](function(_0x4456f0){socket[_0xcc62('0x7b')](_0xcc62('0x92'),{'UserId':_0x4456f0,'ChatQueueId':_0x4a3bc8['id']});});});});});});})[_0xcc62('0x20')](respondWithStatusCode(_0x5765d6,null))[_0xcc62('0x2a')](handleError(_0x5765d6,null));};exports[_0xcc62('0x93')]=function(_0x389c5b,_0x542013,_0x485683){return db[_0xcc62('0x3e')][_0xcc62('0x60')]({'where':{'id':_0x389c5b[_0xcc62('0x56')]['id']}})[_0xcc62('0x20')](handleEntityNotFound(_0x542013,null))['then'](function(_0x354f36){if(_0x354f36){return _0x354f36['addAgents'](_0x389c5b[_0xcc62('0x59')][_0xcc62('0x73')],_['omit'](_0x389c5b[_0xcc62('0x59')],[_0xcc62('0x73'),'id'])||{})[_0xcc62('0x94')](function(_0x3a0088){for(var _0x529b1d=0x0;_0x529b1d<_0x389c5b[_0xcc62('0x59')][_0xcc62('0x73')][_0xcc62('0x49')];_0x529b1d+=0x1){socket[_0xcc62('0x7b')]('userChatQueue:save',{'UserId':Number(_0x389c5b[_0xcc62('0x59')][_0xcc62('0x73')][_0x529b1d]),'ChatQueueId':Number(_0x389c5b[_0xcc62('0x56')]['id'])});}return _0x3a0088;});}})['then'](respondWithResult(_0x542013,null))[_0xcc62('0x2a')](handleError(_0x542013,null));};exports[_0xcc62('0x95')]=function(_0x2b1d17,_0x4c3929,_0x5ebb15){return db[_0xcc62('0x3e')][_0xcc62('0x60')]({'where':{'id':_0x2b1d17[_0xcc62('0x56')]['id']}})['then'](handleEntityNotFound(_0x4c3929,null))[_0xcc62('0x20')](function(_0x1e6eb0){if(_0x1e6eb0){return _0x1e6eb0[_0xcc62('0x95')](_0x2b1d17[_0xcc62('0x44')][_0xcc62('0x73')])['then'](function(){if(_[_0xcc62('0x96')](_0x2b1d17[_0xcc62('0x44')][_0xcc62('0x73')])){for(var _0x210bba=0x0;_0x210bba<_0x2b1d17[_0xcc62('0x44')][_0xcc62('0x73')][_0xcc62('0x49')];_0x210bba+=0x1){socket['emit'](_0xcc62('0x92'),{'UserId':Number(_0x2b1d17['query'][_0xcc62('0x73')][_0x210bba]),'ChatQueueId':Number(_0x2b1d17['params']['id'])});}}else{socket[_0xcc62('0x7b')](_0xcc62('0x92'),{'UserId':Number(_0x2b1d17[_0xcc62('0x44')][_0xcc62('0x73')]),'ChatQueueId':Number(_0x2b1d17[_0xcc62('0x56')]['id'])});}});}})[_0xcc62('0x20')](respondWithStatusCode(_0x4c3929,null))[_0xcc62('0x2a')](handleError(_0x4c3929,null));};exports[_0xcc62('0x97')]=function(_0x3e4d20,_0x451bdd,_0x3c51cc){var _0x42e847={};var _0x4fae9c={};var _0x491cbe;var _0x5bda80;return db['ChatQueue'][_0xcc62('0x98')]({'where':{'id':_0x3e4d20[_0xcc62('0x56')]['id']}})[_0xcc62('0x20')](handleEntityNotFound(_0x451bdd,null))['then'](function(_0x51fa46){if(_0x51fa46){_0x491cbe=_0x51fa46;_0x4fae9c['model']=_['keys'](db[_0xcc62('0x69')][_0xcc62('0x3f')]);_0x4fae9c[_0xcc62('0x44')]=_[_0xcc62('0x43')](_0x3e4d20[_0xcc62('0x44')]);_0x4fae9c[_0xcc62('0x45')]=_[_0xcc62('0x47')](_0x4fae9c['model'],_0x4fae9c[_0xcc62('0x44')]);_0x42e847[_0xcc62('0x46')]=_[_0xcc62('0x47')](_0x4fae9c[_0xcc62('0x42')],qs[_0xcc62('0x48')](_0x3e4d20[_0xcc62('0x44')][_0xcc62('0x48')]));_0x42e847[_0xcc62('0x46')]=_0x42e847[_0xcc62('0x46')]['length']?_0x42e847[_0xcc62('0x46')]:_0x4fae9c[_0xcc62('0x42')];_0x42e847['order']=qs['sort'](_0x3e4d20['query'][_0xcc62('0x4d')]);_0x42e847[_0xcc62('0x4e')]=qs[_0xcc62('0x45')](_[_0xcc62('0x4f')](_0x3e4d20[_0xcc62('0x44')],_0x4fae9c[_0xcc62('0x45')]));if(_0x3e4d20[_0xcc62('0x44')][_0xcc62('0x50')]){_0x42e847['where']=_[_0xcc62('0x51')](_0x42e847['where'],{'$or':_[_0xcc62('0x3d')](_0x42e847['attributes'],function(_0x3bd5f4){var _0x44ed74={};_0x44ed74[_0x3bd5f4]={'$like':'%'+_0x3e4d20[_0xcc62('0x44')][_0xcc62('0x50')]+'%'};return _0x44ed74;})});}_0x42e847=_['merge']({},_0x42e847,_0x3e4d20[_0xcc62('0x52')]);return _0x491cbe[_0xcc62('0x97')](_0x42e847);}})[_0xcc62('0x20')](function(_0x380d64){if(_0x380d64){_0x5bda80=_0x380d64[_0xcc62('0x49')];if(!_0x3e4d20[_0xcc62('0x44')][_0xcc62('0x4a')](_0xcc62('0x4b'))){_0x42e847['limit']=qs[_0xcc62('0x31')](_0x3e4d20[_0xcc62('0x44')][_0xcc62('0x31')]);_0x42e847[_0xcc62('0x2f')]=qs[_0xcc62('0x2f')](_0x3e4d20['query']['offset']);}return _0x491cbe[_0xcc62('0x97')](_0x42e847);}})[_0xcc62('0x20')](function(_0x23b322){if(_0x23b322){return _0x23b322?{'count':_0x5bda80,'rows':_0x23b322}:null;}})[_0xcc62('0x20')](respondWithResult(_0x451bdd,null))[_0xcc62('0x2a')](handleError(_0x451bdd,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 775a539..7be0090 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 _0x75df=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners','update','remove'];(function(_0x2ed95a,_0x334656){var _0x57cd63=function(_0x5d36d9){while(--_0x5d36d9){_0x2ed95a['push'](_0x2ed95a['shift']());}};_0x57cd63(++_0x334656);}(_0x75df,0x1e9));var _0xf75d=function(_0xf88ceb,_0x151528){_0xf88ceb=_0xf88ceb-0x0;var _0x217c3a=_0x75df[_0xf88ceb];return _0x217c3a;};'use strict';var EventEmitter=require(_0xf75d('0x0'));var ChatQueue=require(_0xf75d('0x1'))['db'][_0xf75d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf75d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf75d('0x4'),'afterDestroy':_0xf75d('0x5')};function emitEvent(_0x397c53){return function(_0x359de0,_0x306aec,_0x4f8bcf){ChatQueueEvents[_0xf75d('0x6')](_0x397c53+':'+_0x359de0['id'],_0x359de0);ChatQueueEvents[_0xf75d('0x6')](_0x397c53,_0x359de0);_0x4f8bcf(null);};}for(var e in events){if(events[_0xf75d('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xf75d('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x9a45=['update','remove','hook','ChatQueue','setMaxListeners','save'];(function(_0x3c24ff,_0x4d3305){var _0x41ac70=function(_0x20209b){while(--_0x20209b){_0x3c24ff['push'](_0x3c24ff['shift']());}};_0x41ac70(++_0x4d3305);}(_0x9a45,0x11d));var _0x59a4=function(_0xa23904,_0x2dc7a9){_0xa23904=_0xa23904-0x0;var _0x7548c6=_0x9a45[_0xa23904];return _0x7548c6;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x59a4('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x59a4('0x1')](0x0);var events={'afterCreate':_0x59a4('0x2'),'afterUpdate':_0x59a4('0x3'),'afterDestroy':_0x59a4('0x4')};function emitEvent(_0x2c06ef){return function(_0xeb0162,_0x16da99,_0x25e40b){ChatQueueEvents['emit'](_0x2c06ef+':'+_0xeb0162['id'],_0xeb0162);ChatQueueEvents['emit'](_0x2c06ef,_0xeb0162);_0x25e40b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x59a4('0x5')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index f4a1f68..3b3118e 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 _0x0390=['../../config/logger','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util'];(function(_0x23b38e,_0x5df2a5){var _0x28723b=function(_0x4e6420){while(--_0x4e6420){_0x23b38e['push'](_0x23b38e['shift']());}};_0x28723b(++_0x5df2a5);}(_0x0390,0x112));var _0x0039=function(_0x80ee51,_0x3ca199){_0x80ee51=_0x80ee51-0x0;var _0x4f20ef=_0x0390[_0x80ee51];return _0x4f20ef;};'use strict';var _=require(_0x0039('0x0'));var util=require(_0x0039('0x1'));var logger=require(_0x0039('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0039('0x3'));var rp=require(_0x0039('0x4'));var fs=require('fs');var path=require(_0x0039('0x5'));var rimraf=require(_0x0039('0x6'));var config=require('../../config/environment');var attributes=require(_0x0039('0x7'));module[_0x0039('0x8')]=function(_0x42cc63,_0x1bfd94){return _0x42cc63[_0x0039('0x9')](_0x0039('0xa'),attributes,{'tableName':_0x0039('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2085=['bluebird','request-promise','rimraf','./chatQueue.attributes','ChatQueue','chat_queues','lodash','util'];(function(_0x496b4b,_0x16d3ff){var _0x192549=function(_0x159dff){while(--_0x159dff){_0x496b4b['push'](_0x496b4b['shift']());}};_0x192549(++_0x16d3ff);}(_0x2085,0x136));var _0x5208=function(_0x2bf8ac,_0x4226be){_0x2bf8ac=_0x2bf8ac-0x0;var _0x3ef094=_0x2085[_0x2bf8ac];return _0x3ef094;};'use strict';var _=require(_0x5208('0x0'));var util=require(_0x5208('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5208('0x2'));var rp=require(_0x5208('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5208('0x4'));var config=require('../../config/environment');var attributes=require(_0x5208('0x5'));module['exports']=function(_0x416d86,_0x4f8f42){return _0x416d86['define'](_0x5208('0x6'),attributes,{'tableName':_0x5208('0x7'),'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 6dd25f2..998df33 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 _0x3276=['model','map','ShowChatQueue','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include'];(function(_0x318248,_0x3d2dbc){var _0x3eb033=function(_0xb4dce){while(--_0xb4dce){_0x318248['push'](_0x318248['shift']());}};_0x3eb033(++_0x3d2dbc);}(_0x3276,0xc7));var _0x6327=function(_0x4c6e82,_0x1cfb6f){_0x4c6e82=_0x4c6e82-0x0;var _0x30785b=_0x3276[_0x4c6e82];return _0x30785b;};'use strict';var _=require(_0x6327('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6327('0x1'));var rs=require(_0x6327('0x2'));var fs=require('fs');var Redis=require(_0x6327('0x3'));var db=require(_0x6327('0x4'))['db'];var utils=require(_0x6327('0x5'));var logger=require(_0x6327('0x6'))(_0x6327('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6327('0x8')][_0x6327('0x9')]({'port':0x232a});config[_0x6327('0xa')]=_['defaults'](config[_0x6327('0xa')],{'host':_0x6327('0xb'),'port':0x18eb});var socket=require(_0x6327('0xc'))(new Redis(config[_0x6327('0xa')]));require('./chatQueue.socket')[_0x6327('0xd')](socket);function respondWithRpcPromise(_0x1687c4,_0x4e8256,_0x443b6f){return new BPromise(function(_0x289415,_0x572a9f){return client[_0x6327('0xe')](_0x1687c4,_0x443b6f)[_0x6327('0xf')](function(_0x95c9be){logger['info'](_0x6327('0x10'),_0x4e8256,_0x6327('0x11'));logger[_0x6327('0x12')](_0x6327('0x13'),_0x4e8256,_0x6327('0x11'),JSON[_0x6327('0x14')](_0x95c9be));if(_0x95c9be[_0x6327('0x15')]){if(_0x95c9be[_0x6327('0x15')][_0x6327('0x16')]===0x1f4){logger[_0x6327('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4e8256,_0x95c9be[_0x6327('0x15')]['message']);return _0x572a9f(_0x95c9be[_0x6327('0x15')][_0x6327('0x17')]);}logger[_0x6327('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4e8256,_0x95c9be[_0x6327('0x15')][_0x6327('0x17')]);return _0x289415(_0x95c9be[_0x6327('0x15')][_0x6327('0x17')]);}else{logger[_0x6327('0x18')](_0x6327('0x10'),_0x4e8256,_0x6327('0x11'));_0x289415(_0x95c9be[_0x6327('0x19')][_0x6327('0x17')]);}})[_0x6327('0x1a')](function(_0x7168f7){logger[_0x6327('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4e8256,_0x7168f7);_0x572a9f(_0x7168f7);});});}exports[_0x6327('0x1b')]=function(_0x12c33f){var _0x29b061=this;return new Promise(function(_0x341916,_0x4cbc80){return db['ChatQueue'][_0x6327('0x1c')]({'raw':_0x12c33f[_0x6327('0x1d')]?_0x12c33f[_0x6327('0x1d')][_0x6327('0x1e')]===undefined?!![]:![]:!![],'where':_0x12c33f[_0x6327('0x1d')]?_0x12c33f[_0x6327('0x1d')][_0x6327('0x1f')]||null:null,'attributes':_0x12c33f[_0x6327('0x1d')]?_0x12c33f[_0x6327('0x1d')][_0x6327('0x20')]||null:null,'limit':_0x12c33f[_0x6327('0x1d')]?_0x12c33f[_0x6327('0x1d')][_0x6327('0x21')]||null:null,'include':_0x12c33f[_0x6327('0x1d')]?_0x12c33f[_0x6327('0x1d')][_0x6327('0x22')]?_['map'](_0x12c33f['options'][_0x6327('0x22')],function(_0x499321){return{'model':db[_0x499321[_0x6327('0x23')]],'as':_0x499321['as'],'attributes':_0x499321['attributes'],'include':_0x499321[_0x6327('0x22')]?_['map'](_0x499321[_0x6327('0x22')],function(_0x1eae65){return{'model':db[_0x1eae65['model']],'as':_0x1eae65['as'],'attributes':_0x1eae65[_0x6327('0x20')],'include':_0x1eae65[_0x6327('0x22')]?_[_0x6327('0x24')](_0x1eae65[_0x6327('0x22')],function(_0x894157){return{'model':db[_0x894157[_0x6327('0x23')]],'as':_0x894157['as'],'attributes':_0x894157[_0x6327('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6327('0xf')](function(_0x58b590){logger[_0x6327('0x18')](_0x6327('0x1b'),_0x12c33f);logger['debug'](_0x6327('0x1b'),_0x12c33f,JSON[_0x6327('0x14')](_0x58b590));_0x341916(_0x58b590);})['catch'](function(_0x43bcd0){logger[_0x6327('0x15')](_0x6327('0x1b'),_0x43bcd0['message'],_0x12c33f);_0x4cbc80(_0x29b061[_0x6327('0x15')](0x1f4,_0x43bcd0[_0x6327('0x17')]));});});};exports[_0x6327('0x25')]=function(_0x2c986a){var _0x523b52=this;return new Promise(function(_0xf7b0a3,_0x543d31){return db['ChatQueue'][_0x6327('0x26')]({'raw':_0x2c986a[_0x6327('0x1d')]?_0x2c986a[_0x6327('0x1d')][_0x6327('0x1e')]===undefined?!![]:![]:!![],'where':_0x2c986a['options']?_0x2c986a[_0x6327('0x1d')][_0x6327('0x1f')]||null:null,'attributes':_0x2c986a[_0x6327('0x1d')]?_0x2c986a[_0x6327('0x1d')]['attributes']||null:null,'include':_0x2c986a[_0x6327('0x1d')]?_0x2c986a[_0x6327('0x1d')][_0x6327('0x22')]?_['map'](_0x2c986a[_0x6327('0x1d')][_0x6327('0x22')],function(_0x456090){return{'model':db[_0x456090['model']],'as':_0x456090['as'],'attributes':_0x456090['attributes'],'include':_0x456090[_0x6327('0x22')]?_['map'](_0x456090[_0x6327('0x22')],function(_0x4b3d89){return{'model':db[_0x4b3d89[_0x6327('0x23')]],'as':_0x4b3d89['as'],'attributes':_0x4b3d89[_0x6327('0x20')],'include':_0x4b3d89[_0x6327('0x22')]?_[_0x6327('0x24')](_0x4b3d89[_0x6327('0x22')],function(_0x2b1982){return{'model':db[_0x2b1982['model']],'as':_0x2b1982['as'],'attributes':_0x2b1982[_0x6327('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6327('0xf')](function(_0x154733){logger[_0x6327('0x18')]('ShowChatQueue',_0x2c986a);logger['debug'](_0x6327('0x25'),_0x2c986a,JSON[_0x6327('0x14')](_0x154733));_0xf7b0a3(_0x154733);})[_0x6327('0x1a')](function(_0x2b1b3f){logger[_0x6327('0x15')]('ShowChatQueue',_0x2b1b3f[_0x6327('0x17')],_0x2c986a);_0x543d31(_0x523b52[_0x6327('0x15')](0x1f4,_0x2b1b3f[_0x6327('0x17')]));});});};
\ No newline at end of file
+var _0x9f4d=['attributes','limit','include','model','map','GetChatQueue','stringify','catch','ShowChatQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','ChatQueue','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x113876,_0x2d243d){_0x113876=_0x113876-0x0;var _0x3da554=_0x9f4d[_0x113876];return _0x3da554;};'use strict';var _=require(_0xd9f4('0x0'));var util=require(_0xd9f4('0x1'));var moment=require(_0xd9f4('0x2'));var BPromise=require(_0xd9f4('0x3'));var rs=require(_0xd9f4('0x4'));var fs=require('fs');var Redis=require(_0xd9f4('0x5'));var db=require(_0xd9f4('0x6'))['db'];var utils=require(_0xd9f4('0x7'));var logger=require(_0xd9f4('0x8'))('rpc');var config=require(_0xd9f4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd9f4('0xa')][_0xd9f4('0xb')]({'port':0x232a});config[_0xd9f4('0xc')]=_[_0xd9f4('0xd')](config['redis'],{'host':_0xd9f4('0xe'),'port':0x18eb});var socket=require(_0xd9f4('0xf'))(new Redis(config['redis']));require(_0xd9f4('0x10'))['register'](socket);function respondWithRpcPromise(_0x16cacf,_0x41709a,_0x2deeb5){return new BPromise(function(_0x429d90,_0x2bd084){return client['request'](_0x16cacf,_0x2deeb5)[_0xd9f4('0x11')](function(_0x312d09){logger[_0xd9f4('0x12')](_0xd9f4('0x13'),_0x41709a,_0xd9f4('0x14'));logger[_0xd9f4('0x15')](_0xd9f4('0x16'),_0x41709a,_0xd9f4('0x14'),JSON['stringify'](_0x312d09));if(_0x312d09[_0xd9f4('0x17')]){if(_0x312d09[_0xd9f4('0x17')][_0xd9f4('0x18')]===0x1f4){logger[_0xd9f4('0x17')](_0xd9f4('0x13'),_0x41709a,_0x312d09[_0xd9f4('0x17')][_0xd9f4('0x19')]);return _0x2bd084(_0x312d09[_0xd9f4('0x17')][_0xd9f4('0x19')]);}logger[_0xd9f4('0x17')](_0xd9f4('0x13'),_0x41709a,_0x312d09[_0xd9f4('0x17')][_0xd9f4('0x19')]);return _0x429d90(_0x312d09['error']['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x41709a,_0xd9f4('0x14'));_0x429d90(_0x312d09[_0xd9f4('0x1a')][_0xd9f4('0x19')]);}})['catch'](function(_0x45f93c){logger[_0xd9f4('0x17')](_0xd9f4('0x13'),_0x41709a,_0x45f93c);_0x2bd084(_0x45f93c);});});}exports['GetChatQueue']=function(_0x32ab66){var _0x591be1=this;return new Promise(function(_0x313bf2,_0x93e8df){return db[_0xd9f4('0x1b')]['findAll']({'raw':_0x32ab66[_0xd9f4('0x1c')]?_0x32ab66[_0xd9f4('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x32ab66['options']?_0x32ab66[_0xd9f4('0x1c')]['where']||null:null,'attributes':_0x32ab66[_0xd9f4('0x1c')]?_0x32ab66[_0xd9f4('0x1c')][_0xd9f4('0x1d')]||null:null,'limit':_0x32ab66[_0xd9f4('0x1c')]?_0x32ab66[_0xd9f4('0x1c')][_0xd9f4('0x1e')]||null:null,'include':_0x32ab66[_0xd9f4('0x1c')]?_0x32ab66[_0xd9f4('0x1c')][_0xd9f4('0x1f')]?_['map'](_0x32ab66[_0xd9f4('0x1c')][_0xd9f4('0x1f')],function(_0x1fe43b){return{'model':db[_0x1fe43b[_0xd9f4('0x20')]],'as':_0x1fe43b['as'],'attributes':_0x1fe43b[_0xd9f4('0x1d')],'include':_0x1fe43b[_0xd9f4('0x1f')]?_[_0xd9f4('0x21')](_0x1fe43b['include'],function(_0x17e017){return{'model':db[_0x17e017[_0xd9f4('0x20')]],'as':_0x17e017['as'],'attributes':_0x17e017[_0xd9f4('0x1d')],'include':_0x17e017[_0xd9f4('0x1f')]?_['map'](_0x17e017['include'],function(_0x478bc6){return{'model':db[_0x478bc6[_0xd9f4('0x20')]],'as':_0x478bc6['as'],'attributes':_0x478bc6['attributes']};}):[]};}):[]};}):[]:[]})[_0xd9f4('0x11')](function(_0x453a08){logger['info']('GetChatQueue',_0x32ab66);logger[_0xd9f4('0x15')](_0xd9f4('0x22'),_0x32ab66,JSON[_0xd9f4('0x23')](_0x453a08));_0x313bf2(_0x453a08);})[_0xd9f4('0x24')](function(_0x8c3e50){logger[_0xd9f4('0x17')](_0xd9f4('0x22'),_0x8c3e50[_0xd9f4('0x19')],_0x32ab66);_0x93e8df(_0x591be1[_0xd9f4('0x17')](0x1f4,_0x8c3e50[_0xd9f4('0x19')]));});});};exports[_0xd9f4('0x25')]=function(_0x40b489){var _0x52d081=this;return new Promise(function(_0x2924e6,_0x505867){return db[_0xd9f4('0x1b')][_0xd9f4('0x26')]({'raw':_0x40b489[_0xd9f4('0x1c')]?_0x40b489[_0xd9f4('0x1c')][_0xd9f4('0x27')]===undefined?!![]:![]:!![],'where':_0x40b489[_0xd9f4('0x1c')]?_0x40b489[_0xd9f4('0x1c')][_0xd9f4('0x28')]||null:null,'attributes':_0x40b489[_0xd9f4('0x1c')]?_0x40b489[_0xd9f4('0x1c')][_0xd9f4('0x1d')]||null:null,'include':_0x40b489[_0xd9f4('0x1c')]?_0x40b489[_0xd9f4('0x1c')]['include']?_['map'](_0x40b489['options'][_0xd9f4('0x1f')],function(_0x9c3f8b){return{'model':db[_0x9c3f8b[_0xd9f4('0x20')]],'as':_0x9c3f8b['as'],'attributes':_0x9c3f8b[_0xd9f4('0x1d')],'include':_0x9c3f8b[_0xd9f4('0x1f')]?_[_0xd9f4('0x21')](_0x9c3f8b[_0xd9f4('0x1f')],function(_0x2c313f){return{'model':db[_0x2c313f[_0xd9f4('0x20')]],'as':_0x2c313f['as'],'attributes':_0x2c313f[_0xd9f4('0x1d')],'include':_0x2c313f[_0xd9f4('0x1f')]?_['map'](_0x2c313f['include'],function(_0x1ba715){return{'model':db[_0x1ba715[_0xd9f4('0x20')]],'as':_0x1ba715['as'],'attributes':_0x1ba715[_0xd9f4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd9f4('0x11')](function(_0x3dea70){logger[_0xd9f4('0x12')](_0xd9f4('0x25'),_0x40b489);logger[_0xd9f4('0x15')](_0xd9f4('0x25'),_0x40b489,JSON[_0xd9f4('0x23')](_0x3dea70));_0x2924e6(_0x3dea70);})[_0xd9f4('0x24')](function(_0x32bd8b){logger[_0xd9f4('0x17')]('ShowChatQueue',_0x32bd8b['message'],_0x40b489);_0x505867(_0x52d081[_0xd9f4('0x17')](0x1f4,_0x32bd8b[_0xd9f4('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index bff65b2..3c8bcff 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 _0xb903=['update','emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0xb903,0x185));var _0x3b90=function(_0x13d403,_0x21edc6){_0x13d403=_0x13d403-0x0;var _0x56d417=_0xb903[_0x13d403];return _0x56d417;};'use strict';var ChatQueueEvents=require(_0x3b90('0x0'));var events=[_0x3b90('0x1'),_0x3b90('0x2'),_0x3b90('0x3')];function createListener(_0x5191d8,_0x3312ca){return function(_0xf414f4){_0x3312ca[_0x3b90('0x4')](_0x5191d8,_0xf414f4);};}function removeListener(_0x1cd5d8,_0x30d8db){return function(){ChatQueueEvents[_0x3b90('0x5')](_0x1cd5d8,_0x30d8db);};}exports[_0x3b90('0x6')]=function(_0x5acd76){for(var _0x15b68f=0x0,_0x5e845a=events['length'];_0x15b68f<_0x5e845a;_0x15b68f++){var _0x153283=events[_0x15b68f];var _0x2e4c06=createListener(_0x3b90('0x7')+_0x153283,_0x5acd76);ChatQueueEvents['on'](_0x153283,_0x2e4c06);}};
\ No newline at end of file
+var _0xb66c=['chatQueue:','./chatQueue.events','remove','removeListener','register','length'];(function(_0xdaab62,_0x2728ab){var _0x13d767=function(_0x14bf14){while(--_0x14bf14){_0xdaab62['push'](_0xdaab62['shift']());}};_0x13d767(++_0x2728ab);}(_0xb66c,0x175));var _0xcb66=function(_0xaa9a84,_0x421998){_0xaa9a84=_0xaa9a84-0x0;var _0x22ee25=_0xb66c[_0xaa9a84];return _0x22ee25;};'use strict';var ChatQueueEvents=require(_0xcb66('0x0'));var events=['save',_0xcb66('0x1'),'update'];function createListener(_0x2afcb8,_0x24ea13){return function(_0xf7ccc5){_0x24ea13['emit'](_0x2afcb8,_0xf7ccc5);};}function removeListener(_0x35d439,_0x386241){return function(){ChatQueueEvents[_0xcb66('0x2')](_0x35d439,_0x386241);};}exports[_0xcb66('0x3')]=function(_0x5d766d){for(var _0x518163=0x0,_0x19adf5=events[_0xcb66('0x4')];_0x518163<_0x19adf5;_0x518163++){var _0xa3993=events[_0x518163];var _0x439f3d=createListener(_0xcb66('0x5')+_0xa3993,_0x5d766d);ChatQueueEvents['on'](_0xa3993,_0x439f3d);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 3b1855c..3610c33 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 _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x160ad5,_0x596e86){var _0x11fb42=function(_0x1fdaa5){while(--_0x1fdaa5){_0x160ad5['push'](_0x160ad5['shift']());}};_0x11fb42(++_0x596e86);}(_0x008c,0x188));var _0xc008=function(_0x32084f,_0x28fc38){_0x32084f=_0x32084f-0x0;var _0x187302=_0x008c[_0x32084f];return _0x187302;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x2810e4,_0x528e9e){var _0x17d891=function(_0x174b60){while(--_0x174b60){_0x2810e4['push'](_0x2810e4['shift']());}};_0x17d891(++_0x528e9e);}(_0x55ca,0x126));var _0xa55c=function(_0x7e918f,_0x48cf10){_0x7e918f=_0x7e918f-0x0;var _0x5b35ab=_0x55ca[_0x7e918f];return _0x5b35ab;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 894fe54..3552b33 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 _0xf304=['STRING','DATE','moment','sequelize','exports'];(function(_0x67788c,_0x3d2b63){var _0x49d59a=function(_0x5883ab){while(--_0x5883ab){_0x67788c['push'](_0x67788c['shift']());}};_0x49d59a(++_0x3d2b63);}(_0xf304,0x1c4));var _0x4f30=function(_0x327fd2,_0x22bb1a){_0x327fd2=_0x327fd2-0x0;var _0x30f4f3=_0xf304[_0x327fd2];return _0x30f4f3;};'use strict';var moment=require(_0x4f30('0x0'));var Sequelize=require(_0x4f30('0x1'));module[_0x4f30('0x2')]={'uniqueid':{'type':Sequelize[_0x4f30('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4f30('0x3')]},'joinAt':{'type':Sequelize[_0x4f30('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x4f30('0x4')]},'reason':{'type':Sequelize[_0x4f30('0x3')]}};
\ No newline at end of file
+var _0x2f66=['moment','sequelize','exports','STRING','DATE'];(function(_0x1ac6dc,_0x1b26f0){var _0x1081d1=function(_0x43ad04){while(--_0x43ad04){_0x1ac6dc['push'](_0x1ac6dc['shift']());}};_0x1081d1(++_0x1b26f0);}(_0x2f66,0x1ea));var _0x62f6=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0x2f66[_0x1f44e4];return _0x591989;};'use strict';var moment=require(_0x62f6('0x0'));var Sequelize=require(_0x62f6('0x1'));module[_0x62f6('0x2')]={'uniqueid':{'type':Sequelize[_0x62f6('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x62f6('0x3')]},'joinAt':{'type':Sequelize[_0x62f6('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x62f6('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x62f6('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 52a86c8..93d4a2f 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 _0x9962=['type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ChatQueueReport','count','includeAll','include','rows','catch','keys','rawAttributes','find','create','update','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','map','fieldName'];(function(_0x382ddf,_0x2b149a){var _0x23914c=function(_0x3b0cb8){while(--_0x3b0cb8){_0x382ddf['push'](_0x382ddf['shift']());}};_0x23914c(++_0x2b149a);}(_0x9962,0xb8));var _0x2996=function(_0x574b67,_0x38cfc1){_0x574b67=_0x574b67-0x0;var _0x5a8ccd=_0x9962[_0x574b67];return _0x5a8ccd;};'use strict';var emlformat=require(_0x2996('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2996('0x1'));var jsonpatch=require(_0x2996('0x2'));var rp=require(_0x2996('0x3'));var moment=require('moment');var BPromise=require(_0x2996('0x4'));var Mustache=require('mustache');var util=require(_0x2996('0x5'));var path=require(_0x2996('0x6'));var sox=require('sox');var csv=require(_0x2996('0x7'));var ejs=require(_0x2996('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2996('0x9'));var squel=require(_0x2996('0xa'));var crypto=require(_0x2996('0xb'));var jsforce=require(_0x2996('0xc'));var deskjs=require(_0x2996('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2996('0xe'));var Papa=require('papaparse');var Redis=require(_0x2996('0xf'));var authService=require(_0x2996('0x10'));var qs=require(_0x2996('0x11'));var as=require(_0x2996('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2996('0x13'))(_0x2996('0x14'));var utils=require(_0x2996('0x15'));var config=require(_0x2996('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2996('0x17'))['db'];function respondWithStatusCode(_0x21f096,_0x10a958){_0x10a958=_0x10a958||0xcc;return function(_0x30b5e4){if(_0x30b5e4){return _0x21f096['sendStatus'](_0x10a958);}return _0x21f096[_0x2996('0x18')](_0x10a958)['end']();};}function respondWithResult(_0x4117f5,_0x468a4f){_0x468a4f=_0x468a4f||0xc8;return function(_0x5b942f){if(_0x5b942f){return _0x4117f5[_0x2996('0x18')](_0x468a4f)[_0x2996('0x19')](_0x5b942f);}};}function respondWithFilteredResult(_0x39b18e,_0x43e380){return function(_0xc267fb){if(_0xc267fb){var _0xb50801=typeof _0x43e380[_0x2996('0x1a')]==='undefined'&&typeof _0x43e380['limit']===_0x2996('0x1b');var _0x5d8236=_0xc267fb['count'];var _0x4c29bd=_0xb50801?0x0:_0x43e380[_0x2996('0x1a')];var _0x149c68=_0xb50801?_0xc267fb['count']:_0x43e380[_0x2996('0x1a')]+_0x43e380[_0x2996('0x1c')];var _0x9743ee;if(_0x149c68>=_0x5d8236){_0x149c68=_0x5d8236;_0x9743ee=0xc8;}else{_0x9743ee=0xce;}_0x39b18e[_0x2996('0x18')](_0x9743ee);return _0x39b18e[_0x2996('0x1d')](_0x2996('0x1e'),_0x4c29bd+'-'+_0x149c68+'/'+_0x5d8236)[_0x2996('0x19')](_0xc267fb);}return null;};}function patchUpdates(_0x232ec9){return function(_0x2c5cb3){try{jsonpatch[_0x2996('0x1f')](_0x2c5cb3,_0x232ec9,!![]);}catch(_0x5bfc6d){return BPromise[_0x2996('0x20')](_0x5bfc6d);}return _0x2c5cb3[_0x2996('0x21')]();};}function saveUpdates(_0x43e835,_0x64a05b){return function(_0xa39f6d){if(_0xa39f6d){return _0xa39f6d['update'](_0x43e835)[_0x2996('0x22')](function(_0x42e5f5){return _0x42e5f5;});}return null;};}function removeEntity(_0x2bfb2b,_0x4de34d){return function(_0xbc555a){if(_0xbc555a){return _0xbc555a[_0x2996('0x23')]()[_0x2996('0x22')](function(){_0x2bfb2b['status'](0xcc)[_0x2996('0x24')]();});}};}function handleEntityNotFound(_0x88f1c5,_0x2177b1){return function(_0x53c636){if(!_0x53c636){_0x88f1c5[_0x2996('0x25')](0x194);}return _0x53c636;};}function handleError(_0x15ab22,_0x5636eb){_0x5636eb=_0x5636eb||0x1f4;return function(_0x229fad){logger[_0x2996('0x26')](_0x229fad[_0x2996('0x27')]);if(_0x229fad[_0x2996('0x28')]){delete _0x229fad['name'];}_0x15ab22[_0x2996('0x18')](_0x5636eb)[_0x2996('0x29')](_0x229fad);};}exports['index']=function(_0x52b2e6,_0x12959f){var _0x4941c3={},_0x3adddd={},_0x3a509f={'count':0x0,'rows':[]};var _0x13bfc0=_[_0x2996('0x2a')](db['ChatQueueReport']['rawAttributes'],function(_0x365ea1){return{'name':_0x365ea1[_0x2996('0x2b')],'type':_0x365ea1[_0x2996('0x2c')][_0x2996('0x2d')]};});_0x3adddd[_0x2996('0x2e')]=_[_0x2996('0x2a')](_0x13bfc0,_0x2996('0x28'));_0x3adddd[_0x2996('0x2f')]=_['keys'](_0x52b2e6[_0x2996('0x2f')]);_0x3adddd[_0x2996('0x30')]=_['intersection'](_0x3adddd[_0x2996('0x2e')],_0x3adddd['query']);_0x4941c3[_0x2996('0x31')]=_[_0x2996('0x32')](_0x3adddd[_0x2996('0x2e')],qs['fields'](_0x52b2e6['query'][_0x2996('0x33')]));_0x4941c3['attributes']=_0x4941c3[_0x2996('0x31')][_0x2996('0x34')]?_0x4941c3['attributes']:_0x3adddd[_0x2996('0x2e')];if(!_0x52b2e6[_0x2996('0x2f')][_0x2996('0x35')](_0x2996('0x36'))){_0x4941c3[_0x2996('0x1c')]=qs[_0x2996('0x1c')](_0x52b2e6['query']['limit']);_0x4941c3[_0x2996('0x1a')]=qs[_0x2996('0x1a')](_0x52b2e6[_0x2996('0x2f')][_0x2996('0x1a')]);}_0x4941c3[_0x2996('0x37')]=qs[_0x2996('0x38')](_0x52b2e6['query'][_0x2996('0x38')]);_0x4941c3[_0x2996('0x39')]=qs['filters'](_['pick'](_0x52b2e6[_0x2996('0x2f')],_0x3adddd[_0x2996('0x30')]),_0x13bfc0);if(_0x52b2e6['query'][_0x2996('0x3a')]){_0x4941c3[_0x2996('0x39')]=_[_0x2996('0x3b')](_0x4941c3[_0x2996('0x39')],{'$or':_[_0x2996('0x2a')](_0x13bfc0,function(_0x32c13f){if(_0x32c13f[_0x2996('0x2c')]!==_0x2996('0x3c')){var _0x4fb862={};_0x4fb862[_0x32c13f[_0x2996('0x28')]]={'$like':'%'+_0x52b2e6[_0x2996('0x2f')][_0x2996('0x3a')]+'%'};return _0x4fb862;}})});}_0x4941c3=_['merge']({},_0x4941c3,_0x52b2e6[_0x2996('0x3d')]);var _0x4d825e={'where':_0x4941c3[_0x2996('0x39')]};return db[_0x2996('0x3e')][_0x2996('0x3f')](_0x4d825e)[_0x2996('0x22')](function(_0x308984){_0x3a509f[_0x2996('0x3f')]=_0x308984;if(_0x52b2e6[_0x2996('0x2f')][_0x2996('0x40')]){_0x4941c3[_0x2996('0x41')]=[{'all':!![]}];}return db[_0x2996('0x3e')]['findAll'](_0x4941c3);})[_0x2996('0x22')](function(_0x329c71){_0x3a509f[_0x2996('0x42')]=_0x329c71;return _0x3a509f;})['then'](respondWithFilteredResult(_0x12959f,_0x4941c3))[_0x2996('0x43')](handleError(_0x12959f,null));};exports['show']=function(_0x59965f,_0x19eeae){var _0x256190={'raw':!![],'where':{'id':_0x59965f['params']['id']}},_0x134437={};_0x134437[_0x2996('0x2e')]=_[_0x2996('0x44')](db[_0x2996('0x3e')][_0x2996('0x45')]);_0x134437[_0x2996('0x2f')]=_[_0x2996('0x44')](_0x59965f['query']);_0x134437['filters']=_[_0x2996('0x32')](_0x134437[_0x2996('0x2e')],_0x134437[_0x2996('0x2f')]);_0x256190[_0x2996('0x31')]=_[_0x2996('0x32')](_0x134437[_0x2996('0x2e')],qs[_0x2996('0x33')](_0x59965f[_0x2996('0x2f')]['fields']));_0x256190['attributes']=_0x256190['attributes'][_0x2996('0x34')]?_0x256190[_0x2996('0x31')]:_0x134437['model'];if(_0x59965f[_0x2996('0x2f')][_0x2996('0x40')]){_0x256190[_0x2996('0x41')]=[{'all':!![]}];}_0x256190=_['merge']({},_0x256190,_0x59965f[_0x2996('0x3d')]);return db[_0x2996('0x3e')][_0x2996('0x46')](_0x256190)[_0x2996('0x22')](handleEntityNotFound(_0x19eeae,null))[_0x2996('0x22')](respondWithResult(_0x19eeae,null))[_0x2996('0x43')](handleError(_0x19eeae,null));};exports[_0x2996('0x47')]=function(_0xf9427e,_0x246351){return db[_0x2996('0x3e')]['create'](_0xf9427e['body'],{})['then'](respondWithResult(_0x246351,0xc9))[_0x2996('0x43')](handleError(_0x246351,null));};exports[_0x2996('0x48')]=function(_0x1a4ea5,_0x7d35b5){if(_0x1a4ea5[_0x2996('0x49')]['id']){delete _0x1a4ea5[_0x2996('0x49')]['id'];}return db[_0x2996('0x3e')][_0x2996('0x46')]({'where':{'id':_0x1a4ea5[_0x2996('0x4a')]['id']}})[_0x2996('0x22')](handleEntityNotFound(_0x7d35b5,null))['then'](saveUpdates(_0x1a4ea5['body'],null))[_0x2996('0x22')](respondWithResult(_0x7d35b5,null))[_0x2996('0x43')](handleError(_0x7d35b5,null));};exports[_0x2996('0x23')]=function(_0x2ecb3a,_0x17c346){return db[_0x2996('0x3e')][_0x2996('0x46')]({'where':{'id':_0x2ecb3a['params']['id']}})[_0x2996('0x22')](handleEntityNotFound(_0x17c346,null))[_0x2996('0x22')](removeEntity(_0x17c346,null))[_0x2996('0x43')](handleError(_0x17c346,null));};exports[_0x2996('0x4b')]=function(_0x223fba,_0x1805fd){return db['ChatQueueReport'][_0x2996('0x4b')]()[_0x2996('0x22')](respondWithResult(_0x1805fd,null))[_0x2996('0x43')](handleError(_0x1805fd,null));};
\ No newline at end of file
+var _0x5496=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','ChatQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','fields','include','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x5104a0,_0x3aa5a7){var _0x21346e=function(_0x5d1fe6){while(--_0x5d1fe6){_0x5104a0['push'](_0x5104a0['shift']());}};_0x21346e(++_0x3aa5a7);}(_0x5496,0x175));var _0x6549=function(_0x15b696,_0x2aeaf4){_0x15b696=_0x15b696-0x0;var _0x4a699b=_0x5496[_0x15b696];return _0x4a699b;};'use strict';var emlformat=require(_0x6549('0x0'));var rimraf=require(_0x6549('0x1'));var zipdir=require(_0x6549('0x2'));var jsonpatch=require(_0x6549('0x3'));var rp=require(_0x6549('0x4'));var moment=require('moment');var BPromise=require(_0x6549('0x5'));var Mustache=require('mustache');var util=require(_0x6549('0x6'));var path=require(_0x6549('0x7'));var sox=require(_0x6549('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6549('0x9'));var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var as=require(_0x6549('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6549('0x14'));var utils=require(_0x6549('0x15'));var config=require(_0x6549('0x16'));var licenseUtil=require(_0x6549('0x17'));var db=require(_0x6549('0x18'))['db'];function respondWithStatusCode(_0x5bc018,_0x4dfb06){_0x4dfb06=_0x4dfb06||0xcc;return function(_0x3f844f){if(_0x3f844f){return _0x5bc018[_0x6549('0x19')](_0x4dfb06);}return _0x5bc018['status'](_0x4dfb06)[_0x6549('0x1a')]();};}function respondWithResult(_0x150fc8,_0x195d25){_0x195d25=_0x195d25||0xc8;return function(_0x12b068){if(_0x12b068){return _0x150fc8[_0x6549('0x1b')](_0x195d25)[_0x6549('0x1c')](_0x12b068);}};}function respondWithFilteredResult(_0x55c112,_0x5db86d){return function(_0x384f75){if(_0x384f75){var _0x25da29=typeof _0x5db86d['offset']===_0x6549('0x1d')&&typeof _0x5db86d[_0x6549('0x1e')]===_0x6549('0x1d');var _0x387e60=_0x384f75[_0x6549('0x1f')];var _0x53b12b=_0x25da29?0x0:_0x5db86d['offset'];var _0x26a212=_0x25da29?_0x384f75['count']:_0x5db86d['offset']+_0x5db86d[_0x6549('0x1e')];var _0x1e5079;if(_0x26a212>=_0x387e60){_0x26a212=_0x387e60;_0x1e5079=0xc8;}else{_0x1e5079=0xce;}_0x55c112[_0x6549('0x1b')](_0x1e5079);return _0x55c112[_0x6549('0x20')](_0x6549('0x21'),_0x53b12b+'-'+_0x26a212+'/'+_0x387e60)['json'](_0x384f75);}return null;};}function patchUpdates(_0x228117){return function(_0x4b40c1){try{jsonpatch[_0x6549('0x22')](_0x4b40c1,_0x228117,!![]);}catch(_0x72322b){return BPromise[_0x6549('0x23')](_0x72322b);}return _0x4b40c1[_0x6549('0x24')]();};}function saveUpdates(_0x22bcf8,_0x12d547){return function(_0x427b47){if(_0x427b47){return _0x427b47[_0x6549('0x25')](_0x22bcf8)[_0x6549('0x26')](function(_0x6ae00c){return _0x6ae00c;});}return null;};}function removeEntity(_0x40d3f9,_0x1fbfa4){return function(_0x23c0ba){if(_0x23c0ba){return _0x23c0ba['destroy']()[_0x6549('0x26')](function(){_0x40d3f9[_0x6549('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x126967,_0x29f89e){return function(_0x3768cb){if(!_0x3768cb){_0x126967['sendStatus'](0x194);}return _0x3768cb;};}function handleError(_0x31a95,_0xfb51a1){_0xfb51a1=_0xfb51a1||0x1f4;return function(_0x14de1f){logger[_0x6549('0x27')](_0x14de1f[_0x6549('0x28')]);if(_0x14de1f[_0x6549('0x29')]){delete _0x14de1f[_0x6549('0x29')];}_0x31a95[_0x6549('0x1b')](_0xfb51a1)['send'](_0x14de1f);};}exports[_0x6549('0x2a')]=function(_0x136518,_0x17fdfb){var _0x4c605c={},_0x3f1502={},_0x4acaf5={'count':0x0,'rows':[]};var _0x4f0ad1=_['map'](db[_0x6549('0x2b')][_0x6549('0x2c')],function(_0x4f3069){return{'name':_0x4f3069[_0x6549('0x2d')],'type':_0x4f3069[_0x6549('0x2e')][_0x6549('0x2f')]};});_0x3f1502[_0x6549('0x30')]=_[_0x6549('0x31')](_0x4f0ad1,_0x6549('0x29'));_0x3f1502[_0x6549('0x32')]=_['keys'](_0x136518[_0x6549('0x32')]);_0x3f1502[_0x6549('0x33')]=_[_0x6549('0x34')](_0x3f1502[_0x6549('0x30')],_0x3f1502[_0x6549('0x32')]);_0x4c605c[_0x6549('0x35')]=_['intersection'](_0x3f1502[_0x6549('0x30')],qs['fields'](_0x136518[_0x6549('0x32')]['fields']));_0x4c605c[_0x6549('0x35')]=_0x4c605c[_0x6549('0x35')][_0x6549('0x36')]?_0x4c605c['attributes']:_0x3f1502[_0x6549('0x30')];if(!_0x136518[_0x6549('0x32')][_0x6549('0x37')](_0x6549('0x38'))){_0x4c605c['limit']=qs['limit'](_0x136518['query'][_0x6549('0x1e')]);_0x4c605c[_0x6549('0x39')]=qs['offset'](_0x136518[_0x6549('0x32')][_0x6549('0x39')]);}_0x4c605c[_0x6549('0x3a')]=qs[_0x6549('0x3b')](_0x136518[_0x6549('0x32')]['sort']);_0x4c605c['where']=qs[_0x6549('0x33')](_[_0x6549('0x3c')](_0x136518[_0x6549('0x32')],_0x3f1502[_0x6549('0x33')]),_0x4f0ad1);if(_0x136518[_0x6549('0x32')][_0x6549('0x3d')]){_0x4c605c[_0x6549('0x3e')]=_[_0x6549('0x3f')](_0x4c605c[_0x6549('0x3e')],{'$or':_[_0x6549('0x31')](_0x4f0ad1,function(_0x525f82){if(_0x525f82[_0x6549('0x2e')]!==_0x6549('0x40')){var _0x2ea977={};_0x2ea977[_0x525f82[_0x6549('0x29')]]={'$like':'%'+_0x136518[_0x6549('0x32')]['filter']+'%'};return _0x2ea977;}})});}_0x4c605c=_['merge']({},_0x4c605c,_0x136518['options']);var _0x22b919={'where':_0x4c605c[_0x6549('0x3e')]};return db[_0x6549('0x2b')][_0x6549('0x1f')](_0x22b919)['then'](function(_0x56ce9f){_0x4acaf5[_0x6549('0x1f')]=_0x56ce9f;if(_0x136518[_0x6549('0x32')][_0x6549('0x41')]){_0x4c605c['include']=[{'all':!![]}];}return db[_0x6549('0x2b')]['findAll'](_0x4c605c);})[_0x6549('0x26')](function(_0x2ec614){_0x4acaf5[_0x6549('0x42')]=_0x2ec614;return _0x4acaf5;})[_0x6549('0x26')](respondWithFilteredResult(_0x17fdfb,_0x4c605c))[_0x6549('0x43')](handleError(_0x17fdfb,null));};exports[_0x6549('0x44')]=function(_0xbbfdc9,_0x4deaab){var _0x132625={'raw':!![],'where':{'id':_0xbbfdc9[_0x6549('0x45')]['id']}},_0x309f45={};_0x309f45[_0x6549('0x30')]=_[_0x6549('0x46')](db[_0x6549('0x2b')][_0x6549('0x2c')]);_0x309f45[_0x6549('0x32')]=_[_0x6549('0x46')](_0xbbfdc9[_0x6549('0x32')]);_0x309f45[_0x6549('0x33')]=_[_0x6549('0x34')](_0x309f45[_0x6549('0x30')],_0x309f45[_0x6549('0x32')]);_0x132625[_0x6549('0x35')]=_[_0x6549('0x34')](_0x309f45['model'],qs[_0x6549('0x47')](_0xbbfdc9[_0x6549('0x32')][_0x6549('0x47')]));_0x132625[_0x6549('0x35')]=_0x132625['attributes'][_0x6549('0x36')]?_0x132625['attributes']:_0x309f45[_0x6549('0x30')];if(_0xbbfdc9[_0x6549('0x32')]['includeAll']){_0x132625[_0x6549('0x48')]=[{'all':!![]}];}_0x132625=_[_0x6549('0x3f')]({},_0x132625,_0xbbfdc9[_0x6549('0x49')]);return db[_0x6549('0x2b')][_0x6549('0x4a')](_0x132625)['then'](handleEntityNotFound(_0x4deaab,null))['then'](respondWithResult(_0x4deaab,null))[_0x6549('0x43')](handleError(_0x4deaab,null));};exports[_0x6549('0x4b')]=function(_0x41d675,_0x1712f3){return db[_0x6549('0x2b')]['create'](_0x41d675[_0x6549('0x4c')],{})[_0x6549('0x26')](respondWithResult(_0x1712f3,0xc9))[_0x6549('0x43')](handleError(_0x1712f3,null));};exports[_0x6549('0x25')]=function(_0xa4c650,_0x25a6ee){if(_0xa4c650[_0x6549('0x4c')]['id']){delete _0xa4c650[_0x6549('0x4c')]['id'];}return db['ChatQueueReport'][_0x6549('0x4a')]({'where':{'id':_0xa4c650['params']['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x25a6ee,null))[_0x6549('0x26')](saveUpdates(_0xa4c650[_0x6549('0x4c')],null))['then'](respondWithResult(_0x25a6ee,null))[_0x6549('0x43')](handleError(_0x25a6ee,null));};exports[_0x6549('0x4d')]=function(_0x2ef4d2,_0x5300c8){return db[_0x6549('0x2b')][_0x6549('0x4a')]({'where':{'id':_0x2ef4d2[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x5300c8,null))[_0x6549('0x26')](removeEntity(_0x5300c8,null))[_0x6549('0x43')](handleError(_0x5300c8,null));};exports['describe']=function(_0x28af00,_0x4bbc61){return db[_0x6549('0x2b')][_0x6549('0x4e')]()[_0x6549('0x26')](respondWithResult(_0x4bbc61,null))[_0x6549('0x43')](handleError(_0x4bbc61,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index fa15de0..f542349 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x2f256e,_0x37b94a){var _0x425d16=function(_0x5303b5){while(--_0x5303b5){_0x2f256e['push'](_0x2f256e['shift']());}};_0x425d16(++_0x37b94a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x46bad4,_0x3b00ae){var _0x445453=function(_0x35a08f){while(--_0x35a08f){_0x46bad4['push'](_0x46bad4['shift']());}};_0x445453(++_0x3b00ae);}(_0x757a,0xde));var _0xa757=function(_0x51f847,_0x58d557){_0x51f847=_0x51f847-0x0;var _0x4edd00=_0x757a[_0x51f847];return _0x4edd00;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 4010cc5..257f90d 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 _0x0c29=['error','code','message','result','CreateChatQueueReport','ChatQueueReport','options','raw','catch','UpdateChatQueueReport','update','body','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4d3ef6,_0x1e4798){var _0xa4be17=function(_0x492d8a){while(--_0x492d8a){_0x4d3ef6['push'](_0x4d3ef6['shift']());}};_0xa4be17(++_0x1e4798);}(_0x0c29,0x69));var _0x90c2=function(_0x32c012,_0xe3c576){_0x32c012=_0x32c012-0x0;var _0x48562e=_0x0c29[_0x32c012];return _0x48562e;};'use strict';var _=require(_0x90c2('0x0'));var util=require('util');var moment=require(_0x90c2('0x1'));var BPromise=require(_0x90c2('0x2'));var rs=require(_0x90c2('0x3'));var fs=require('fs');var Redis=require(_0x90c2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x90c2('0x5'));var config=require(_0x90c2('0x6'));var jayson=require(_0x90c2('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x30ba30,_0x279aae,_0x14b516){return new BPromise(function(_0xed30ba,_0x103cfa){return client['request'](_0x30ba30,_0x14b516)[_0x90c2('0x8')](function(_0x53aaea){logger[_0x90c2('0x9')](_0x90c2('0xa'),_0x279aae,_0x90c2('0xb'));logger[_0x90c2('0xc')](_0x90c2('0xd'),_0x279aae,_0x90c2('0xb'),JSON[_0x90c2('0xe')](_0x53aaea));if(_0x53aaea['error']){if(_0x53aaea[_0x90c2('0xf')][_0x90c2('0x10')]===0x1f4){logger[_0x90c2('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x279aae,_0x53aaea[_0x90c2('0xf')][_0x90c2('0x11')]);return _0x103cfa(_0x53aaea[_0x90c2('0xf')][_0x90c2('0x11')]);}logger[_0x90c2('0xf')](_0x90c2('0xa'),_0x279aae,_0x53aaea[_0x90c2('0xf')]['message']);return _0xed30ba(_0x53aaea[_0x90c2('0xf')]['message']);}else{logger['info'](_0x90c2('0xa'),_0x279aae,_0x90c2('0xb'));_0xed30ba(_0x53aaea[_0x90c2('0x12')][_0x90c2('0x11')]);}})['catch'](function(_0x357f42){logger[_0x90c2('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x279aae,_0x357f42);_0x103cfa(_0x357f42);});});}exports[_0x90c2('0x13')]=function(_0xe8b6a9){var _0x5b338c=this;return new Promise(function(_0x5097ec,_0xddb970){return db[_0x90c2('0x14')]['create'](_0xe8b6a9['body'],{'raw':_0xe8b6a9['options']?_0xe8b6a9[_0x90c2('0x15')][_0x90c2('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x348db2){logger[_0x90c2('0x9')](_0x90c2('0x13'),_0xe8b6a9);logger['debug'](_0x90c2('0x13'),_0xe8b6a9,JSON['stringify'](_0x348db2));_0x5097ec(_0x348db2);})[_0x90c2('0x17')](function(_0x2184d4){logger[_0x90c2('0xf')](_0x90c2('0x13'),_0x2184d4[_0x90c2('0x11')],_0xe8b6a9);_0xddb970(_0x5b338c['error'](0x1f4,_0x2184d4[_0x90c2('0x11')]));});});};exports[_0x90c2('0x18')]=function(_0x409baf){var _0xe4cd8=this;return new Promise(function(_0x447adc,_0x54e6da){return db[_0x90c2('0x14')][_0x90c2('0x19')](_0x409baf[_0x90c2('0x1a')],{'raw':_0x409baf[_0x90c2('0x15')]?_0x409baf[_0x90c2('0x15')][_0x90c2('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x409baf[_0x90c2('0x15')]?_0x409baf[_0x90c2('0x15')][_0x90c2('0x1b')]||null:null,'attributes':_0x409baf[_0x90c2('0x15')]?_0x409baf[_0x90c2('0x15')][_0x90c2('0x1c')]||null:null,'limit':_0x409baf['options']?_0x409baf[_0x90c2('0x15')][_0x90c2('0x1d')]||null:null})[_0x90c2('0x8')](function(_0x1e5463){logger[_0x90c2('0x9')](_0x90c2('0x18'),_0x409baf);logger[_0x90c2('0xc')](_0x90c2('0x18'),_0x409baf,JSON[_0x90c2('0xe')](_0x1e5463));_0x447adc(_0x1e5463);})[_0x90c2('0x17')](function(_0xb88f91){logger['error'](_0x90c2('0x18'),_0xb88f91[_0x90c2('0x11')],_0x409baf);_0x54e6da(_0xe4cd8[_0x90c2('0xf')](0x1f4,_0xb88f91['message']));});});};
\ No newline at end of file
+var _0x746e=['ChatQueueReport','create','body','options','raw','then','debug','stringify','CreateChatQueueReport','UpdateChatQueueReport','update','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x2224a7,_0x188491){var _0x55bc4a=function(_0x46ed8f){while(--_0x46ed8f){_0x2224a7['push'](_0x2224a7['shift']());}};_0x55bc4a(++_0x188491);}(_0x746e,0x140));var _0xe746=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x746e[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0xe746('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe746('0x1'));var rs=require(_0xe746('0x2'));var fs=require('fs');var Redis=require(_0xe746('0x3'));var db=require(_0xe746('0x4'))['db'];var utils=require(_0xe746('0x5'));var logger=require('../../config/logger')(_0xe746('0x6'));var config=require(_0xe746('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe746('0x8')][_0xe746('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1fb899,_0xe6a104,_0x5e28eb){return new BPromise(function(_0xc37940,_0xab6d11){return client[_0xe746('0xa')](_0x1fb899,_0x5e28eb)['then'](function(_0x30d4e2){logger[_0xe746('0xb')](_0xe746('0xc'),_0xe6a104,'request\x20sent');logger['debug'](_0xe746('0xd'),_0xe6a104,_0xe746('0xe'),JSON['stringify'](_0x30d4e2));if(_0x30d4e2[_0xe746('0xf')]){if(_0x30d4e2[_0xe746('0xf')][_0xe746('0x10')]===0x1f4){logger[_0xe746('0xf')](_0xe746('0xc'),_0xe6a104,_0x30d4e2[_0xe746('0xf')][_0xe746('0x11')]);return _0xab6d11(_0x30d4e2[_0xe746('0xf')][_0xe746('0x11')]);}logger['error'](_0xe746('0xc'),_0xe6a104,_0x30d4e2[_0xe746('0xf')][_0xe746('0x11')]);return _0xc37940(_0x30d4e2[_0xe746('0xf')]['message']);}else{logger['info'](_0xe746('0xc'),_0xe6a104,'request\x20sent');_0xc37940(_0x30d4e2[_0xe746('0x12')]['message']);}})[_0xe746('0x13')](function(_0x4b6ad7){logger[_0xe746('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0xe6a104,_0x4b6ad7);_0xab6d11(_0x4b6ad7);});});}exports['CreateChatQueueReport']=function(_0x185b7f){var _0x2cb71c=this;return new Promise(function(_0x317693,_0x15ba8c){return db[_0xe746('0x14')][_0xe746('0x15')](_0x185b7f[_0xe746('0x16')],{'raw':_0x185b7f[_0xe746('0x17')]?_0x185b7f[_0xe746('0x17')][_0xe746('0x18')]===undefined?!![]:![]:!![]})[_0xe746('0x19')](function(_0x32190a){logger[_0xe746('0xb')]('CreateChatQueueReport',_0x185b7f);logger[_0xe746('0x1a')]('CreateChatQueueReport',_0x185b7f,JSON[_0xe746('0x1b')](_0x32190a));_0x317693(_0x32190a);})[_0xe746('0x13')](function(_0x312b38){logger[_0xe746('0xf')](_0xe746('0x1c'),_0x312b38['message'],_0x185b7f);_0x15ba8c(_0x2cb71c[_0xe746('0xf')](0x1f4,_0x312b38[_0xe746('0x11')]));});});};exports[_0xe746('0x1d')]=function(_0x421e22){var _0x195715=this;return new Promise(function(_0x392afd,_0x57c2bc){return db[_0xe746('0x14')][_0xe746('0x1e')](_0x421e22[_0xe746('0x16')],{'raw':_0x421e22['options']?_0x421e22['options'][_0xe746('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x421e22[_0xe746('0x17')]?_0x421e22['options'][_0xe746('0x1f')]||null:null,'attributes':_0x421e22['options']?_0x421e22[_0xe746('0x17')][_0xe746('0x20')]||null:null,'limit':_0x421e22['options']?_0x421e22[_0xe746('0x17')][_0xe746('0x21')]||null:null})[_0xe746('0x19')](function(_0x1915ed){logger[_0xe746('0xb')](_0xe746('0x1d'),_0x421e22);logger['debug'](_0xe746('0x1d'),_0x421e22,JSON[_0xe746('0x1b')](_0x1915ed));_0x392afd(_0x1915ed);})['catch'](function(_0x1ed4f5){logger[_0xe746('0xf')](_0xe746('0x1d'),_0x1ed4f5[_0xe746('0x11')],_0x421e22);_0x57c2bc(_0x195715[_0xe746('0xf')](0x1f4,_0x1ed4f5[_0xe746('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 7e6c8af..6ea4b47 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 _0x8eae=['multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','/describe','isAuthenticated','describe','get','/:id','show','put','update','delete','destroy','exports'];(function(_0x3fc97b,_0x20ca29){var _0x3a0c82=function(_0x1c15ec){while(--_0x1c15ec){_0x3fc97b['push'](_0x3fc97b['shift']());}};_0x3a0c82(++_0x20ca29);}(_0x8eae,0xfc));var _0xe8ea=function(_0xf7dd0f,_0x396c3b){_0xf7dd0f=_0xf7dd0f-0x0;var _0x3fc64b=_0x8eae[_0xf7dd0f];return _0x3fc64b;};'use strict';var multer=require(_0xe8ea('0x0'));var util=require(_0xe8ea('0x1'));var path=require(_0xe8ea('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe8ea('0x3')]();var fs_extra=require(_0xe8ea('0x4'));var auth=require(_0xe8ea('0x5'));var interaction=require(_0xe8ea('0x6'));var config=require(_0xe8ea('0x7'));var controller=require(_0xe8ea('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe8ea('0x9')]);router['get'](_0xe8ea('0xa'),auth[_0xe8ea('0xb')](),controller[_0xe8ea('0xc')]);router[_0xe8ea('0xd')](_0xe8ea('0xe'),auth['isAuthenticated'](),controller[_0xe8ea('0xf')]);router['post']('/',auth[_0xe8ea('0xb')](),controller['create']);router[_0xe8ea('0x10')]('/:id',auth[_0xe8ea('0xb')](),controller[_0xe8ea('0x11')]);router[_0xe8ea('0x12')]('/:id',auth[_0xe8ea('0xb')](),controller[_0xe8ea('0x13')]);module[_0xe8ea('0x14')]=router;
\ No newline at end of file
+var _0x4438=['get','isAuthenticated','index','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller'];(function(_0x51b8e0,_0x3a2475){var _0x2689c5=function(_0x39905f){while(--_0x39905f){_0x51b8e0['push'](_0x51b8e0['shift']());}};_0x2689c5(++_0x3a2475);}(_0x4438,0x1c4));var _0x8443=function(_0x45d85f,_0xdd9183){_0x45d85f=_0x45d85f-0x0;var _0x4619d5=_0x4438[_0x45d85f];return _0x4619d5;};'use strict';var multer=require(_0x8443('0x0'));var util=require(_0x8443('0x1'));var path=require(_0x8443('0x2'));var timeout=require(_0x8443('0x3'));var express=require('express');var router=express[_0x8443('0x4')]();var fs_extra=require(_0x8443('0x5'));var auth=require(_0x8443('0x6'));var interaction=require(_0x8443('0x7'));var config=require(_0x8443('0x8'));var controller=require(_0x8443('0x9'));router[_0x8443('0xa')]('/',auth[_0x8443('0xb')](),controller[_0x8443('0xc')]);router[_0x8443('0xa')]('/describe',auth[_0x8443('0xb')](),controller[_0x8443('0xd')]);router[_0x8443('0xa')](_0x8443('0xe'),auth['isAuthenticated'](),controller[_0x8443('0xf')]);router[_0x8443('0x10')]('/',auth['isAuthenticated'](),controller[_0x8443('0x11')]);router[_0x8443('0x12')](_0x8443('0xe'),auth['isAuthenticated'](),controller[_0x8443('0x13')]);router['delete'](_0x8443('0xe'),auth[_0x8443('0xb')](),controller[_0x8443('0x14')]);module[_0x8443('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index f3bc246..d370288 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1a96db,_0x3e9f20){_0x1a96db=_0x1a96db-0x0;var _0x5a4091=_0xb43b[_0x1a96db];return _0x5a4091;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x3b0eb4,_0x34d616){var _0x1bef6a=function(_0x2042cb){while(--_0x2042cb){_0x3b0eb4['push'](_0x3b0eb4['shift']());}};_0x1bef6a(++_0x34d616);}(_0x70e0,0x17b));var _0x070e=function(_0x163133,_0x2a6853){_0x163133=_0x163133-0x0;var _0x15352d=_0x70e0[_0x163133];return _0x15352d;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 588a931..b658ecc 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 _0xd112=['Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count'];(function(_0x5d2999,_0x3a6edd){var _0x59aec0=function(_0x159fab){while(--_0x159fab){_0x5d2999['push'](_0x5d2999['shift']());}};_0x59aec0(++_0x3a6edd);}(_0xd112,0x10a));var _0x2d11=function(_0x568e7c,_0x5ea152){_0x568e7c=_0x568e7c-0x0;var _0x4682a7=_0xd112[_0x568e7c];return _0x4682a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d11('0x0'));var zipdir=require(_0x2d11('0x1'));var jsonpatch=require(_0x2d11('0x2'));var rp=require(_0x2d11('0x3'));var moment=require(_0x2d11('0x4'));var BPromise=require(_0x2d11('0x5'));var Mustache=require(_0x2d11('0x6'));var util=require(_0x2d11('0x7'));var path=require('path');var sox=require(_0x2d11('0x8'));var csv=require('to-csv');var ejs=require(_0x2d11('0x9'));var fs=require('fs');var fs_extra=require(_0x2d11('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2d11('0xb'));var jsforce=require(_0x2d11('0xc'));var deskjs=require(_0x2d11('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2d11('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2d11('0xf'));var hardwareService=require(_0x2d11('0x10'));var logger=require(_0x2d11('0x11'))(_0x2d11('0x12'));var utils=require(_0x2d11('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2d11('0x14'));var db=require(_0x2d11('0x15'))['db'];function respondWithStatusCode(_0x3b7209,_0x4051fe){_0x4051fe=_0x4051fe||0xcc;return function(_0x389aff){if(_0x389aff){return _0x3b7209[_0x2d11('0x16')](_0x4051fe);}return _0x3b7209[_0x2d11('0x17')](_0x4051fe)[_0x2d11('0x18')]();};}function respondWithResult(_0x247c79,_0x4dfa4e){_0x4dfa4e=_0x4dfa4e||0xc8;return function(_0x400e2e){if(_0x400e2e){return _0x247c79[_0x2d11('0x17')](_0x4dfa4e)[_0x2d11('0x19')](_0x400e2e);}};}function respondWithFilteredResult(_0x427bbc,_0x33906b){return function(_0x4a1c71){if(_0x4a1c71){var _0x39648d=typeof _0x33906b['offset']==='undefined'&&typeof _0x33906b[_0x2d11('0x1a')]===_0x2d11('0x1b');var _0x33f7d9=_0x4a1c71['count'];var _0x2a7a49=_0x39648d?0x0:_0x33906b[_0x2d11('0x1c')];var _0x28233f=_0x39648d?_0x4a1c71[_0x2d11('0x1d')]:_0x33906b[_0x2d11('0x1c')]+_0x33906b['limit'];var _0xbdf6a4;if(_0x28233f>=_0x33f7d9){_0x28233f=_0x33f7d9;_0xbdf6a4=0xc8;}else{_0xbdf6a4=0xce;}_0x427bbc[_0x2d11('0x17')](_0xbdf6a4);return _0x427bbc['set'](_0x2d11('0x1e'),_0x2a7a49+'-'+_0x28233f+'/'+_0x33f7d9)['json'](_0x4a1c71);}return null;};}function patchUpdates(_0x2dd685){return function(_0x4498ba){try{jsonpatch[_0x2d11('0x1f')](_0x4498ba,_0x2dd685,!![]);}catch(_0x15c3d4){return BPromise[_0x2d11('0x20')](_0x15c3d4);}return _0x4498ba[_0x2d11('0x21')]();};}function saveUpdates(_0x32b4c9,_0x34d0fb){return function(_0x43a366){if(_0x43a366){return _0x43a366[_0x2d11('0x22')](_0x32b4c9)[_0x2d11('0x23')](function(_0x49f64c){return _0x49f64c;});}return null;};}function removeEntity(_0x3959f0,_0x442959){return function(_0x4a7103){if(_0x4a7103){return _0x4a7103[_0x2d11('0x24')]()[_0x2d11('0x23')](function(){_0x3959f0[_0x2d11('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c1c0b,_0xbb6f9c){return function(_0x1e5e5f){if(!_0x1e5e5f){_0x2c1c0b[_0x2d11('0x16')](0x194);}return _0x1e5e5f;};}function handleError(_0x3b6448,_0x11d4a4){_0x11d4a4=_0x11d4a4||0x1f4;return function(_0x2990ad){logger[_0x2d11('0x25')](_0x2990ad['stack']);if(_0x2990ad[_0x2d11('0x26')]){delete _0x2990ad[_0x2d11('0x26')];}_0x3b6448[_0x2d11('0x17')](_0x11d4a4)[_0x2d11('0x27')](_0x2990ad);};}exports[_0x2d11('0x28')]=function(_0x5bb753,_0x4da22e){var _0x5c327c={},_0x2e2169={},_0x294343={'count':0x0,'rows':[]};var _0x282045=_[_0x2d11('0x29')](db[_0x2d11('0x2a')][_0x2d11('0x2b')],function(_0x1391a1){return{'name':_0x1391a1[_0x2d11('0x2c')],'type':_0x1391a1[_0x2d11('0x2d')][_0x2d11('0x2e')]};});_0x2e2169[_0x2d11('0x2f')]=_[_0x2d11('0x29')](_0x282045,'name');_0x2e2169['query']=_['keys'](_0x5bb753[_0x2d11('0x30')]);_0x2e2169[_0x2d11('0x31')]=_[_0x2d11('0x32')](_0x2e2169[_0x2d11('0x2f')],_0x2e2169[_0x2d11('0x30')]);_0x5c327c[_0x2d11('0x33')]=_[_0x2d11('0x32')](_0x2e2169[_0x2d11('0x2f')],qs[_0x2d11('0x34')](_0x5bb753[_0x2d11('0x30')][_0x2d11('0x34')]));_0x5c327c[_0x2d11('0x33')]=_0x5c327c[_0x2d11('0x33')][_0x2d11('0x35')]?_0x5c327c['attributes']:_0x2e2169[_0x2d11('0x2f')];if(!_0x5bb753[_0x2d11('0x30')]['hasOwnProperty'](_0x2d11('0x36'))){_0x5c327c['limit']=qs['limit'](_0x5bb753[_0x2d11('0x30')][_0x2d11('0x1a')]);_0x5c327c[_0x2d11('0x1c')]=qs['offset'](_0x5bb753[_0x2d11('0x30')]['offset']);}_0x5c327c[_0x2d11('0x37')]=qs[_0x2d11('0x38')](_0x5bb753[_0x2d11('0x30')][_0x2d11('0x38')]);_0x5c327c[_0x2d11('0x39')]=qs[_0x2d11('0x31')](_[_0x2d11('0x3a')](_0x5bb753[_0x2d11('0x30')],_0x2e2169['filters']),_0x282045);if(_0x5bb753[_0x2d11('0x30')][_0x2d11('0x3b')]){_0x5c327c[_0x2d11('0x39')]=_[_0x2d11('0x3c')](_0x5c327c[_0x2d11('0x39')],{'$or':_['map'](_0x282045,function(_0x33c4f2){if(_0x33c4f2['type']!==_0x2d11('0x3d')){var _0x4629bc={};_0x4629bc[_0x33c4f2[_0x2d11('0x26')]]={'$like':'%'+_0x5bb753[_0x2d11('0x30')][_0x2d11('0x3b')]+'%'};return _0x4629bc;}})});}_0x5c327c=_[_0x2d11('0x3c')]({},_0x5c327c,_0x5bb753[_0x2d11('0x3e')]);var _0x267bac={'where':_0x5c327c['where']};return db[_0x2d11('0x2a')][_0x2d11('0x1d')](_0x267bac)[_0x2d11('0x23')](function(_0xcfd2c8){_0x294343[_0x2d11('0x1d')]=_0xcfd2c8;if(_0x5bb753[_0x2d11('0x30')][_0x2d11('0x3f')]){_0x5c327c[_0x2d11('0x40')]=[{'all':!![]}];}return db[_0x2d11('0x2a')][_0x2d11('0x41')](_0x5c327c);})['then'](function(_0x702954){_0x294343[_0x2d11('0x42')]=_0x702954;return _0x294343;})[_0x2d11('0x23')](respondWithFilteredResult(_0x4da22e,_0x5c327c))[_0x2d11('0x43')](handleError(_0x4da22e,null));};exports['show']=function(_0x184a4e,_0x195c53){var _0x34e9bc={'raw':!![],'where':{'id':_0x184a4e[_0x2d11('0x44')]['id']}},_0x18198b={};_0x18198b[_0x2d11('0x2f')]=_[_0x2d11('0x45')](db[_0x2d11('0x2a')][_0x2d11('0x2b')]);_0x18198b[_0x2d11('0x30')]=_['keys'](_0x184a4e[_0x2d11('0x30')]);_0x18198b[_0x2d11('0x31')]=_['intersection'](_0x18198b[_0x2d11('0x2f')],_0x18198b[_0x2d11('0x30')]);_0x34e9bc[_0x2d11('0x33')]=_[_0x2d11('0x32')](_0x18198b[_0x2d11('0x2f')],qs[_0x2d11('0x34')](_0x184a4e[_0x2d11('0x30')][_0x2d11('0x34')]));_0x34e9bc[_0x2d11('0x33')]=_0x34e9bc[_0x2d11('0x33')]['length']?_0x34e9bc[_0x2d11('0x33')]:_0x18198b[_0x2d11('0x2f')];if(_0x184a4e[_0x2d11('0x30')]['includeAll']){_0x34e9bc[_0x2d11('0x40')]=[{'all':!![]}];}_0x34e9bc=_[_0x2d11('0x3c')]({},_0x34e9bc,_0x184a4e[_0x2d11('0x3e')]);return db[_0x2d11('0x2a')]['find'](_0x34e9bc)[_0x2d11('0x23')](handleEntityNotFound(_0x195c53,null))[_0x2d11('0x23')](respondWithResult(_0x195c53,null))[_0x2d11('0x43')](handleError(_0x195c53,null));};exports['create']=function(_0x4874de,_0x15aef8){return db['ChatTransferReport'][_0x2d11('0x46')](_0x4874de[_0x2d11('0x47')],{})[_0x2d11('0x23')](respondWithResult(_0x15aef8,0xc9))[_0x2d11('0x43')](handleError(_0x15aef8,null));};exports[_0x2d11('0x22')]=function(_0x299f8f,_0x457fab){if(_0x299f8f[_0x2d11('0x47')]['id']){delete _0x299f8f[_0x2d11('0x47')]['id'];}return db[_0x2d11('0x2a')]['find']({'where':{'id':_0x299f8f[_0x2d11('0x44')]['id']}})['then'](handleEntityNotFound(_0x457fab,null))['then'](saveUpdates(_0x299f8f[_0x2d11('0x47')],null))['then'](respondWithResult(_0x457fab,null))[_0x2d11('0x43')](handleError(_0x457fab,null));};exports[_0x2d11('0x24')]=function(_0x3bedb1,_0x2b515b){return db[_0x2d11('0x2a')][_0x2d11('0x48')]({'where':{'id':_0x3bedb1[_0x2d11('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b515b,null))[_0x2d11('0x23')](removeEntity(_0x2b515b,null))[_0x2d11('0x43')](handleError(_0x2b515b,null));};exports[_0x2d11('0x49')]=function(_0x21ec11,_0x38a2d5){return db[_0x2d11('0x2a')][_0x2d11('0x49')]()[_0x2d11('0x23')](respondWithResult(_0x38a2d5,null))[_0x2d11('0x43')](handleError(_0x38a2d5,null));};
\ No newline at end of file
+var _0xa797=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','save','update','then','destroy','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','rimraf','zip-dir'];(function(_0x364f8e,_0x5def7b){var _0xe226d8=function(_0x2e9889){while(--_0x2e9889){_0x364f8e['push'](_0x364f8e['shift']());}};_0xe226d8(++_0x5def7b);}(_0xa797,0x90));var _0x7a79=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0xa797[_0x1406ae];return _0x23a076;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7a79('0x0'));var zipdir=require(_0x7a79('0x1'));var jsonpatch=require(_0x7a79('0x2'));var rp=require(_0x7a79('0x3'));var moment=require(_0x7a79('0x4'));var BPromise=require(_0x7a79('0x5'));var Mustache=require(_0x7a79('0x6'));var util=require(_0x7a79('0x7'));var path=require(_0x7a79('0x8'));var sox=require(_0x7a79('0x9'));var csv=require(_0x7a79('0xa'));var ejs=require(_0x7a79('0xb'));var fs=require('fs');var fs_extra=require(_0x7a79('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7a79('0xd'));var deskjs=require(_0x7a79('0xe'));var toCsv=require(_0x7a79('0xa'));var querystring=require('querystring');var Papa=require(_0x7a79('0xf'));var Redis=require(_0x7a79('0x10'));var authService=require(_0x7a79('0x11'));var qs=require(_0x7a79('0x12'));var as=require(_0x7a79('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7a79('0x14'));var utils=require(_0x7a79('0x15'));var config=require(_0x7a79('0x16'));var licenseUtil=require(_0x7a79('0x17'));var db=require(_0x7a79('0x18'))['db'];function respondWithStatusCode(_0x2e0ed0,_0x4887a3){_0x4887a3=_0x4887a3||0xcc;return function(_0x37f795){if(_0x37f795){return _0x2e0ed0[_0x7a79('0x19')](_0x4887a3);}return _0x2e0ed0[_0x7a79('0x1a')](_0x4887a3)[_0x7a79('0x1b')]();};}function respondWithResult(_0x4c1960,_0x33292d){_0x33292d=_0x33292d||0xc8;return function(_0x5bce9c){if(_0x5bce9c){return _0x4c1960[_0x7a79('0x1a')](_0x33292d)['json'](_0x5bce9c);}};}function respondWithFilteredResult(_0x3498cc,_0x3539df){return function(_0x44fa17){if(_0x44fa17){var _0x38ab21=typeof _0x3539df[_0x7a79('0x1c')]===_0x7a79('0x1d')&&typeof _0x3539df[_0x7a79('0x1e')]===_0x7a79('0x1d');var _0x4c81f7=_0x44fa17['count'];var _0x506a2d=_0x38ab21?0x0:_0x3539df[_0x7a79('0x1c')];var _0xa13c26=_0x38ab21?_0x44fa17[_0x7a79('0x1f')]:_0x3539df[_0x7a79('0x1c')]+_0x3539df[_0x7a79('0x1e')];var _0x53bcbf;if(_0xa13c26>=_0x4c81f7){_0xa13c26=_0x4c81f7;_0x53bcbf=0xc8;}else{_0x53bcbf=0xce;}_0x3498cc[_0x7a79('0x1a')](_0x53bcbf);return _0x3498cc['set']('Content-Range',_0x506a2d+'-'+_0xa13c26+'/'+_0x4c81f7)[_0x7a79('0x20')](_0x44fa17);}return null;};}function patchUpdates(_0x4c77d8){return function(_0x1aebe7){try{jsonpatch[_0x7a79('0x21')](_0x1aebe7,_0x4c77d8,!![]);}catch(_0x1a0f40){return BPromise['reject'](_0x1a0f40);}return _0x1aebe7[_0x7a79('0x22')]();};}function saveUpdates(_0x222845,_0x6e6917){return function(_0x129660){if(_0x129660){return _0x129660[_0x7a79('0x23')](_0x222845)[_0x7a79('0x24')](function(_0x3617f1){return _0x3617f1;});}return null;};}function removeEntity(_0x50c6c6,_0x424ef3){return function(_0x43b447){if(_0x43b447){return _0x43b447[_0x7a79('0x25')]()['then'](function(){_0x50c6c6[_0x7a79('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x655492,_0x2fb100){return function(_0xd17c08){if(!_0xd17c08){_0x655492[_0x7a79('0x19')](0x194);}return _0xd17c08;};}function handleError(_0x12b58e,_0x51d137){_0x51d137=_0x51d137||0x1f4;return function(_0x3b8c7e){logger[_0x7a79('0x26')](_0x3b8c7e['stack']);if(_0x3b8c7e[_0x7a79('0x27')]){delete _0x3b8c7e[_0x7a79('0x27')];}_0x12b58e[_0x7a79('0x1a')](_0x51d137)['send'](_0x3b8c7e);};}exports[_0x7a79('0x28')]=function(_0x23a14b,_0x5ecf2d){var _0x5dff39={},_0x5b9a6e={},_0x22e896={'count':0x0,'rows':[]};var _0xa317fa=_[_0x7a79('0x29')](db[_0x7a79('0x2a')][_0x7a79('0x2b')],function(_0x3676c6){return{'name':_0x3676c6[_0x7a79('0x2c')],'type':_0x3676c6['type'][_0x7a79('0x2d')]};});_0x5b9a6e[_0x7a79('0x2e')]=_[_0x7a79('0x29')](_0xa317fa,_0x7a79('0x27'));_0x5b9a6e['query']=_[_0x7a79('0x2f')](_0x23a14b[_0x7a79('0x30')]);_0x5b9a6e[_0x7a79('0x31')]=_[_0x7a79('0x32')](_0x5b9a6e[_0x7a79('0x2e')],_0x5b9a6e[_0x7a79('0x30')]);_0x5dff39['attributes']=_[_0x7a79('0x32')](_0x5b9a6e[_0x7a79('0x2e')],qs['fields'](_0x23a14b['query'][_0x7a79('0x33')]));_0x5dff39[_0x7a79('0x34')]=_0x5dff39[_0x7a79('0x34')][_0x7a79('0x35')]?_0x5dff39['attributes']:_0x5b9a6e['model'];if(!_0x23a14b[_0x7a79('0x30')][_0x7a79('0x36')](_0x7a79('0x37'))){_0x5dff39[_0x7a79('0x1e')]=qs[_0x7a79('0x1e')](_0x23a14b[_0x7a79('0x30')]['limit']);_0x5dff39[_0x7a79('0x1c')]=qs[_0x7a79('0x1c')](_0x23a14b[_0x7a79('0x30')]['offset']);}_0x5dff39['order']=qs['sort'](_0x23a14b[_0x7a79('0x30')][_0x7a79('0x38')]);_0x5dff39[_0x7a79('0x39')]=qs[_0x7a79('0x31')](_[_0x7a79('0x3a')](_0x23a14b['query'],_0x5b9a6e[_0x7a79('0x31')]),_0xa317fa);if(_0x23a14b[_0x7a79('0x30')]['filter']){_0x5dff39['where']=_[_0x7a79('0x3b')](_0x5dff39['where'],{'$or':_['map'](_0xa317fa,function(_0xdd1826){if(_0xdd1826[_0x7a79('0x3c')]!=='VIRTUAL'){var _0xac42c4={};_0xac42c4[_0xdd1826[_0x7a79('0x27')]]={'$like':'%'+_0x23a14b[_0x7a79('0x30')][_0x7a79('0x3d')]+'%'};return _0xac42c4;}})});}_0x5dff39=_['merge']({},_0x5dff39,_0x23a14b[_0x7a79('0x3e')]);var _0x19964e={'where':_0x5dff39[_0x7a79('0x39')]};return db[_0x7a79('0x2a')][_0x7a79('0x1f')](_0x19964e)[_0x7a79('0x24')](function(_0xee5b1a){_0x22e896['count']=_0xee5b1a;if(_0x23a14b[_0x7a79('0x30')][_0x7a79('0x3f')]){_0x5dff39[_0x7a79('0x40')]=[{'all':!![]}];}return db[_0x7a79('0x2a')][_0x7a79('0x41')](_0x5dff39);})[_0x7a79('0x24')](function(_0x4d3757){_0x22e896[_0x7a79('0x42')]=_0x4d3757;return _0x22e896;})[_0x7a79('0x24')](respondWithFilteredResult(_0x5ecf2d,_0x5dff39))[_0x7a79('0x43')](handleError(_0x5ecf2d,null));};exports['show']=function(_0x352d11,_0x5d0775){var _0x519977={'raw':!![],'where':{'id':_0x352d11[_0x7a79('0x44')]['id']}},_0x26cc31={};_0x26cc31[_0x7a79('0x2e')]=_[_0x7a79('0x2f')](db[_0x7a79('0x2a')][_0x7a79('0x2b')]);_0x26cc31[_0x7a79('0x30')]=_[_0x7a79('0x2f')](_0x352d11['query']);_0x26cc31[_0x7a79('0x31')]=_[_0x7a79('0x32')](_0x26cc31[_0x7a79('0x2e')],_0x26cc31[_0x7a79('0x30')]);_0x519977['attributes']=_[_0x7a79('0x32')](_0x26cc31[_0x7a79('0x2e')],qs['fields'](_0x352d11['query'][_0x7a79('0x33')]));_0x519977[_0x7a79('0x34')]=_0x519977[_0x7a79('0x34')][_0x7a79('0x35')]?_0x519977[_0x7a79('0x34')]:_0x26cc31[_0x7a79('0x2e')];if(_0x352d11['query']['includeAll']){_0x519977[_0x7a79('0x40')]=[{'all':!![]}];}_0x519977=_[_0x7a79('0x3b')]({},_0x519977,_0x352d11[_0x7a79('0x3e')]);return db[_0x7a79('0x2a')][_0x7a79('0x45')](_0x519977)['then'](handleEntityNotFound(_0x5d0775,null))[_0x7a79('0x24')](respondWithResult(_0x5d0775,null))[_0x7a79('0x43')](handleError(_0x5d0775,null));};exports[_0x7a79('0x46')]=function(_0x2a5eb4,_0x3a7265){return db[_0x7a79('0x2a')][_0x7a79('0x46')](_0x2a5eb4[_0x7a79('0x47')],{})[_0x7a79('0x24')](respondWithResult(_0x3a7265,0xc9))[_0x7a79('0x43')](handleError(_0x3a7265,null));};exports[_0x7a79('0x23')]=function(_0x5088ff,_0x54f289){if(_0x5088ff['body']['id']){delete _0x5088ff['body']['id'];}return db[_0x7a79('0x2a')]['find']({'where':{'id':_0x5088ff['params']['id']}})['then'](handleEntityNotFound(_0x54f289,null))[_0x7a79('0x24')](saveUpdates(_0x5088ff[_0x7a79('0x47')],null))['then'](respondWithResult(_0x54f289,null))[_0x7a79('0x43')](handleError(_0x54f289,null));};exports[_0x7a79('0x25')]=function(_0x5b36e8,_0x4fe009){return db[_0x7a79('0x2a')][_0x7a79('0x45')]({'where':{'id':_0x5b36e8['params']['id']}})[_0x7a79('0x24')](handleEntityNotFound(_0x4fe009,null))[_0x7a79('0x24')](removeEntity(_0x4fe009,null))[_0x7a79('0x43')](handleError(_0x4fe009,null));};exports[_0x7a79('0x48')]=function(_0x426aa5,_0xfbbd96){return db[_0x7a79('0x2a')][_0x7a79('0x48')]()['then'](respondWithResult(_0xfbbd96,null))[_0x7a79('0x43')](handleError(_0xfbbd96,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 3936301..31d6712 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 _0xcb49=['exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatTransferReport.attributes'];(function(_0x836cfe,_0x3654f5){var _0x102c56=function(_0x8c5895){while(--_0x8c5895){_0x836cfe['push'](_0x836cfe['shift']());}};_0x102c56(++_0x3654f5);}(_0xcb49,0x109));var _0x9cb4=function(_0x3c9a89,_0x378778){_0x3c9a89=_0x3c9a89-0x0;var _0x1eb47b=_0xcb49[_0x3c9a89];return _0x1eb47b;};'use strict';var _=require('lodash');var util=require(_0x9cb4('0x0'));var logger=require(_0x9cb4('0x1'))(_0x9cb4('0x2'));var moment=require(_0x9cb4('0x3'));var BPromise=require(_0x9cb4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cb4('0x5'));var rimraf=require(_0x9cb4('0x6'));var config=require('../../config/environment');var attributes=require(_0x9cb4('0x7'));module[_0x9cb4('0x8')]=function(_0x3a48ad,_0x119b69){return _0x3a48ad[_0x9cb4('0x9')](_0x9cb4('0xa'),attributes,{'tableName':_0x9cb4('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9cb4('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9576=['../../config/logger','api','moment','bluebird','path','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x16fc52,_0x20de03){var _0x580914=function(_0x1d6d24){while(--_0x1d6d24){_0x16fc52['push'](_0x16fc52['shift']());}};_0x580914(++_0x20de03);}(_0x9576,0x1ab));var _0x6957=function(_0x15271c,_0x31ff9b){_0x15271c=_0x15271c-0x0;var _0x338f64=_0x9576[_0x15271c];return _0x338f64;};'use strict';var _=require(_0x6957('0x0'));var util=require(_0x6957('0x1'));var logger=require(_0x6957('0x2'))(_0x6957('0x3'));var moment=require(_0x6957('0x4'));var BPromise=require(_0x6957('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6957('0x6'));var rimraf=require('rimraf');var config=require(_0x6957('0x7'));var attributes=require(_0x6957('0x8'));module['exports']=function(_0x40e58c,_0x17d277){return _0x40e58c[_0x6957('0x9')](_0x6957('0xa'),attributes,{'tableName':_0x6957('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6957('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 344a68f..21cf583 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 _0x0423=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','randomstring','../../mysqldb','../../config/utils'];(function(_0x5c5fe7,_0x2a64eb){var _0xd817f=function(_0x54b2f2){while(--_0x54b2f2){_0x5c5fe7['push'](_0x5c5fe7['shift']());}};_0xd817f(++_0x2a64eb);}(_0x0423,0x18b));var _0x3042=function(_0x43028e,_0x33a648){_0x43028e=_0x43028e-0x0;var _0x2fed6d=_0x0423[_0x43028e];return _0x2fed6d;};'use strict';var _=require(_0x3042('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3042('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3042('0x2'))['db'];var utils=require(_0x3042('0x3'));var logger=require(_0x3042('0x4'))(_0x3042('0x5'));var config=require(_0x3042('0x6'));var jayson=require(_0x3042('0x7'));var client=jayson['client'][_0x3042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21a40d,_0x298fff,_0x55ce30){return new BPromise(function(_0x37daed,_0x373f35){return client[_0x3042('0x9')](_0x21a40d,_0x55ce30)[_0x3042('0xa')](function(_0x514e3a){logger['info'](_0x3042('0xb'),_0x298fff,_0x3042('0xc'));logger['debug'](_0x3042('0xd'),_0x298fff,'request\x20sent',JSON[_0x3042('0xe')](_0x514e3a));if(_0x514e3a[_0x3042('0xf')]){if(_0x514e3a[_0x3042('0xf')]['code']===0x1f4){logger[_0x3042('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x298fff,_0x514e3a[_0x3042('0xf')][_0x3042('0x10')]);return _0x373f35(_0x514e3a[_0x3042('0xf')][_0x3042('0x10')]);}logger[_0x3042('0xf')](_0x3042('0xb'),_0x298fff,_0x514e3a['error'][_0x3042('0x10')]);return _0x37daed(_0x514e3a[_0x3042('0xf')][_0x3042('0x10')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x298fff,_0x3042('0xc'));_0x37daed(_0x514e3a[_0x3042('0x11')][_0x3042('0x10')]);}})[_0x3042('0x12')](function(_0x41884d){logger[_0x3042('0xf')](_0x3042('0xb'),_0x298fff,_0x41884d);_0x373f35(_0x41884d);});});}
\ No newline at end of file
+var _0x0f62=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x486b7c,_0x9e78bd){var _0x22c5d7=function(_0x59530c){while(--_0x59530c){_0x486b7c['push'](_0x486b7c['shift']());}};_0x22c5d7(++_0x9e78bd);}(_0x0f62,0x190));var _0x20f6=function(_0x452cbe,_0x17501d){_0x452cbe=_0x452cbe-0x0;var _0x7f5fd=_0x0f62[_0x452cbe];return _0x7f5fd;};'use strict';var _=require(_0x20f6('0x0'));var util=require(_0x20f6('0x1'));var moment=require(_0x20f6('0x2'));var BPromise=require(_0x20f6('0x3'));var rs=require(_0x20f6('0x4'));var fs=require('fs');var Redis=require(_0x20f6('0x5'));var db=require(_0x20f6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x20f6('0x7'))('rpc');var config=require(_0x20f6('0x8'));var jayson=require(_0x20f6('0x9'));var client=jayson[_0x20f6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x319d4d,_0x11762b,_0x4fe6af){return new BPromise(function(_0xc2757f,_0xe60ed6){return client[_0x20f6('0xb')](_0x319d4d,_0x4fe6af)[_0x20f6('0xc')](function(_0x3d17d1){logger[_0x20f6('0xd')](_0x20f6('0xe'),_0x11762b,_0x20f6('0xf'));logger['debug'](_0x20f6('0x10'),_0x11762b,_0x20f6('0xf'),JSON[_0x20f6('0x11')](_0x3d17d1));if(_0x3d17d1[_0x20f6('0x12')]){if(_0x3d17d1[_0x20f6('0x12')][_0x20f6('0x13')]===0x1f4){logger[_0x20f6('0x12')](_0x20f6('0xe'),_0x11762b,_0x3d17d1['error'][_0x20f6('0x14')]);return _0xe60ed6(_0x3d17d1[_0x20f6('0x12')]['message']);}logger[_0x20f6('0x12')](_0x20f6('0xe'),_0x11762b,_0x3d17d1['error'][_0x20f6('0x14')]);return _0xc2757f(_0x3d17d1[_0x20f6('0x12')]['message']);}else{logger['info'](_0x20f6('0xe'),_0x11762b,'request\x20sent');_0xc2757f(_0x3d17d1[_0x20f6('0x15')][_0x20f6('0x14')]);}})['catch'](function(_0x4f082f){logger[_0x20f6('0x12')](_0x20f6('0xe'),_0x11762b,_0x4f082f);_0xe60ed6(_0x4f082f);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 06bb73c..e98846d 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 _0x88ce=['create','/:id','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','index','/describe','isAuthenticated','describe','get','show','post'];(function(_0x3abbbc,_0x2ad6e6){var _0x4d33de=function(_0x3fd049){while(--_0x3fd049){_0x3abbbc['push'](_0x3abbbc['shift']());}};_0x4d33de(++_0x2ad6e6);}(_0x88ce,0x159));var _0xe88c=function(_0x479127,_0x43686d){_0x479127=_0x479127-0x0;var _0x16eb43=_0x88ce[_0x479127];return _0x16eb43;};'use strict';var multer=require(_0xe88c('0x0'));var util=require(_0xe88c('0x1'));var path=require('path');var timeout=require(_0xe88c('0x2'));var express=require('express');var router=express[_0xe88c('0x3')]();var fs_extra=require(_0xe88c('0x4'));var auth=require(_0xe88c('0x5'));var interaction=require(_0xe88c('0x6'));var config=require('../../config/environment');var controller=require(_0xe88c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe88c('0x8')]);router['get'](_0xe88c('0x9'),auth[_0xe88c('0xa')](),controller[_0xe88c('0xb')]);router[_0xe88c('0xc')]('/:id',auth[_0xe88c('0xa')](),controller[_0xe88c('0xd')]);router[_0xe88c('0xe')]('/',auth[_0xe88c('0xa')](),controller[_0xe88c('0xf')]);router['put'](_0xe88c('0x10'),auth[_0xe88c('0xa')](),controller[_0xe88c('0x11')]);router[_0xe88c('0x12')]('/:id',auth[_0xe88c('0xa')](),controller['destroy']);module[_0xe88c('0x13')]=router;
\ No newline at end of file
+var _0xff1d=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xff1d,0x11b));var _0xdff1=function(_0x1ba8ff,_0x19a44b){_0x1ba8ff=_0x1ba8ff-0x0;var _0x8ba836=_0xff1d[_0x1ba8ff];return _0x8ba836;};'use strict';var multer=require(_0xdff1('0x0'));var util=require(_0xdff1('0x1'));var path=require(_0xdff1('0x2'));var timeout=require(_0xdff1('0x3'));var express=require(_0xdff1('0x4'));var router=express[_0xdff1('0x5')]();var fs_extra=require(_0xdff1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdff1('0x7'));var config=require('../../config/environment');var controller=require(_0xdff1('0x8'));router[_0xdff1('0x9')]('/',auth[_0xdff1('0xa')](),controller[_0xdff1('0xb')]);router['get'](_0xdff1('0xc'),auth[_0xdff1('0xa')](),controller[_0xdff1('0xd')]);router[_0xdff1('0x9')]('/:id',auth[_0xdff1('0xa')](),controller[_0xdff1('0xe')]);router[_0xdff1('0xf')]('/',auth[_0xdff1('0xa')](),controller['create']);router[_0xdff1('0x10')]('/:id',auth[_0xdff1('0xa')](),controller['update']);router['delete'](_0xdff1('0x11'),auth['isAuthenticated'](),controller[_0xdff1('0x12')]);module[_0xdff1('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index b0fd0c1..00c8d27 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 _0xee5b=['rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','text','setDataValue','onlineForm','TEXT','textarea','Comments','getDataValue','offlineForm','parse','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x2a8f2d,_0xd027fa){var _0x1084c4=function(_0xe3cac2){while(--_0xe3cac2){_0x2a8f2d['push'](_0x2a8f2d['shift']());}};_0x1084c4(++_0xd027fa);}(_0xee5b,0x1f4));var _0xbee5=function(_0x4587bb,_0xcea66a){_0x4587bb=_0x4587bb-0x0;var _0x46b1a2=_0xee5b[_0x4587bb];return _0x46b1a2;};'use strict';var Sequelize=require(_0xbee5('0x0'));var rs=require('randomstring');module[_0xbee5('0x1')]={'name':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbee5('0x3')},'description':{'type':Sequelize[_0xbee5('0x2')]},'mapKey':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x5')},'customerAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0xa'),_0xbee5('0xb')),'defaultValue':_0xbee5('0xa')},'header_online':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xc')},'start_chat_button':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xf')},'download_transcript':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x12')},'closingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x13')},'closingMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'skipMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'conditionAgreement':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x15')},'ratingType':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0x16'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'variable':null,'config':{'placeholder':_0xbee5('0x19'),'type':_0xbee5('0x1a'),'required':!![]},'props':{'title':_0xbee5('0x19'),'helpText':''}},{'type':_0xbee5('0x18'),'props':{'title':_0xbee5('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x1af3de){return this[_0xbee5('0x1b')](_0xbee5('0x1c'),JSON[_0xbee5('0x17')](_0x1af3de));}},'offlineForm':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null},{'type':_0xbee5('0x1e'),'config':{'placeholder':_0xbee5('0x1f')},'props':{'title':_0xbee5('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xbee5('0x20')](_0xbee5('0x21'))?JSON[_0xbee5('0x22')](this[_0xbee5('0x20')](_0xbee5('0x21'))):{};},'set':function(_0x26abe3){return this[_0xbee5('0x1b')](_0xbee5('0x21'),JSON[_0xbee5('0x17')](_0x26abe3));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbee5('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbee5('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbee5('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x24')},'waitingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'sendUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showAgentAvatar':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbee5('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbee5('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xbee5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x28')},'verticalAlignment':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x29')},'messagesAlignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x2c')},'systemAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbee5('0x7')],'comment':_0xbee5('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbee5('0x2e'),'set':function(_0x2819e2){if(!_0x2819e2)this[_0xbee5('0x1b')](_0xbee5('0x2f'),null);this[_0xbee5('0x1b')](_0xbee5('0x30'),_0x2819e2);}},'vidaooEscalation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbee5('0x2')]},'vidaooTopic':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xbee5('0x32');}},'vidaooMetadata':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xbee5('0x1d')]}};
\ No newline at end of file
+var _0xaa88=['#011F6A','#ffffff','BOOLEAN','ENUM','rounded','Chat','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Send','Skip','Feedback','star','thumb','input','text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','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.','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','bottom_right','INTEGER','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xaa88,0x137));var _0x8aa8=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0xaa88[_0x261e29];return _0x25ef43;};'use strict';var Sequelize=require(_0x8aa8('0x0'));var rs=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'name':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8aa8('0x4')},'description':{'type':Sequelize[_0x8aa8('0x3')]},'mapKey':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x5')},'mapKeyOffline':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8aa8('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8aa8('0x3')]},'animation':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x8aa8('0xa')](_0x8aa8('0xb'),'squared'),'defaultValue':_0x8aa8('0xb')},'header_online':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xc')},'offline_chat_button':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xd')},'download_transcript':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8aa8('0xe')]},'closingQuestion':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x11')},'noteTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x13')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x14')},'conditionAgreement':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x15')},'ratingType':{'type':Sequelize[_0x8aa8('0xa')](_0x8aa8('0x16'),_0x8aa8('0x17')),'defaultValue':_0x8aa8('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x8aa8('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x8aa8('0x19'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x8aa8('0x18'),'props':{'title':_0x8aa8('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x8aa8('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8aa8('0x1a')](_0x8aa8('0x1b'))?JSON[_0x8aa8('0x1c')](this['getDataValue']('onlineForm')):{};},'set':function(_0x2d1508){return this[_0x8aa8('0x1d')](_0x8aa8('0x1b'),JSON[_0x8aa8('0x1e')](_0x2d1508));}},'offlineForm':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x8aa8('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x8aa8('0x5'),'type':_0x8aa8('0x5')},'variable':null},{'type':_0x8aa8('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x8aa8('0x20')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x8aa8('0x21'))?JSON[_0x8aa8('0x1c')](this[_0x8aa8('0x1a')](_0x8aa8('0x21'))):{};},'set':function(_0xe07a83){return this['setDataValue'](_0x8aa8('0x21'),JSON[_0x8aa8('0x1e')](_0xe07a83));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8aa8('0x22')]();}},'autoclose':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x8aa8('0x3')]},'forwardOffline':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8aa8('0x3')]},'waitingTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x23')},'waitingMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x25')},'offlineMessageBody':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x27')},'skipUnmanaged':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x14')},'sendUnmanaged':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x13')},'enableCustomerAttachment':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return _0x8aa8('0x28');}},'notificationSound':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x2a')},'verticalAlignment':{'type':Sequelize[_0x8aa8('0x2b')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x2c')},'messagesAlignment':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x8aa8('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x8aa8('0x2b')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8aa8('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8aa8('0x2b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8aa8('0x2b')],'comment':_0x8aa8('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8aa8('0x30'),'set':function(_0x3c6115){if(!_0x3c6115)this[_0x8aa8('0x1d')](_0x8aa8('0x31'),null);this[_0x8aa8('0x1d')](_0x8aa8('0x32'),_0x3c6115);}},'vidaooEscalation':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8aa8('0x3')]},'vidaooTopic':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x33')},'vidaooNote':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':function(){return _0x8aa8('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8aa8('0xe')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index e33c076..d6f91e5 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 _0x7a82=['priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','interaction','spread','messageId','created','push','close','unmanaged','ChatMessage','AttachmentId','UserId','unshift','forcedOwnership','startRouting','Start','EventManager','offline','files','CompanyId','from\x20is\x20mandatory','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','fromString','originalname','mimetype','server','offline-chat','basename','openNewInteraction','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','NotifyMailAccount','notifyMail','attachments','addInteraction','ids','getInteractions','Contact','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','getProactiveActions','License','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','replace','alignment','labelText','textColor','textButtonColor','color_button','backgroundColor','IntervalId','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','Attachments','omit','userChatWebsite:save','isArray','emit','userChatWebsite:remove','getAgents','User','bluebird','mustache','util','path','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','http','client','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','get','ChatWebsites','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','include','rows','removeDispositions','CannedAnswer','getAnswers','order','removeAnswers','sitepic','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','Contacts','DESC','ChatApplication','Applications','List','account','applications','list'];(function(_0x31bf14,_0x2c3fd3){var _0x9e9c5c=function(_0x2c8ccb){while(--_0x2c8ccb){_0x31bf14['push'](_0x31bf14['shift']());}};_0x9e9c5c(++_0x2c3fd3);}(_0x7a82,0x1aa));var _0x27a8=function(_0x13a11e,_0x472c7b){_0x13a11e=_0x13a11e-0x0;var _0x34e24=_0x7a82[_0x13a11e];return _0x34e24;};'use strict';var BPromise=require(_0x27a8('0x0'));var Mustache=require(_0x27a8('0x1'));var util=require(_0x27a8('0x2'));var path=require(_0x27a8('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x27a8('0x4'));var Redis=require(_0x27a8('0x5'));var qs=require(_0x27a8('0x6'));var logger=require(_0x27a8('0x7'))(_0x27a8('0x8'));var config=require(_0x27a8('0x9'));var db=require(_0x27a8('0xa'))['db'];config['redis']=_[_0x27a8('0xb')](config[_0x27a8('0xc')],{'host':_0x27a8('0xd'),'port':0x18eb});var socket=require(_0x27a8('0xe'))(new Redis(config[_0x27a8('0xc')]));require(_0x27a8('0xf'))[_0x27a8('0x10')](socket);var htmlToText=require(_0x27a8('0x11'));var jayson=require(_0x27a8('0x12'));var client=jayson['client'][_0x27a8('0x13')]({'port':0x232c});var client9002=jayson[_0x27a8('0x14')][_0x27a8('0x13')]({'port':0x232a});var client9003=jayson['client'][_0x27a8('0x13')]({'port':0x232b});var client9001=jayson[_0x27a8('0x14')][_0x27a8('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x332399,_0x16005b,_0x360bd7,_0x36c180){return new BPromise(function(_0xf04bae,_0x509522){var _0x18439a=_0x36c180||client;return _0x18439a['request'](_0x332399,_0x360bd7)[_0x27a8('0x15')](function(_0x448357){logger[_0x27a8('0x16')](_0x27a8('0x17'),_0x16005b,'request\x20sent');logger[_0x27a8('0x18')](_0x27a8('0x19'),_0x16005b,_0x27a8('0x1a'),JSON[_0x27a8('0x1b')](_0x448357));if(_0x448357[_0x27a8('0x1c')]){if(_0x448357[_0x27a8('0x1c')]['code']===0x1f4){logger['error'](_0x27a8('0x17'),_0x16005b,_0x448357[_0x27a8('0x1c')][_0x27a8('0x1d')]);return _0x509522(_0x448357[_0x27a8('0x1c')]['message']);}logger[_0x27a8('0x1c')](_0x27a8('0x17'),_0x16005b,_0x448357[_0x27a8('0x1c')][_0x27a8('0x1d')]);return _0xf04bae(_0x448357[_0x27a8('0x1c')]['message']);}else{logger[_0x27a8('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x16005b,_0x27a8('0x1a'));_0xf04bae(_0x448357['result'][_0x27a8('0x1d')]);}})[_0x27a8('0x1e')](function(_0x233f85){logger[_0x27a8('0x1c')](_0x27a8('0x17'),_0x16005b,_0x233f85);_0x509522(_0x233f85);});});}function respondWithStatusCode(_0x5b0bf4,_0x32fee7){_0x32fee7=_0x32fee7||0xcc;return function(_0x5760d2){if(_0x5760d2){return _0x5b0bf4[_0x27a8('0x1f')](_0x32fee7);}return _0x5b0bf4[_0x27a8('0x20')](_0x32fee7)[_0x27a8('0x21')]();};}function respondWithResult(_0x1e4e98,_0x8ea839){_0x8ea839=_0x8ea839||0xc8;return function(_0x15fbf1){if(_0x15fbf1){return _0x1e4e98[_0x27a8('0x20')](_0x8ea839)[_0x27a8('0x22')](_0x15fbf1);}};}function respondWithFilteredResult(_0x89a919,_0x36074f){return function(_0x29f49b){if(_0x29f49b){var _0x3f4bf7=typeof _0x36074f[_0x27a8('0x23')]===_0x27a8('0x24')&&typeof _0x36074f[_0x27a8('0x25')]===_0x27a8('0x24');var _0x407eaf=_0x29f49b[_0x27a8('0x26')];var _0x465c7e=_0x3f4bf7?0x0:_0x36074f[_0x27a8('0x23')];var _0x37ae32=_0x3f4bf7?_0x29f49b[_0x27a8('0x26')]:_0x36074f['offset']+_0x36074f[_0x27a8('0x25')];var _0x25af59;if(_0x37ae32>=_0x407eaf){_0x37ae32=_0x407eaf;_0x25af59=0xc8;}else{_0x25af59=0xce;}_0x89a919[_0x27a8('0x20')](_0x25af59);return _0x89a919[_0x27a8('0x27')](_0x27a8('0x28'),_0x465c7e+'-'+_0x37ae32+'/'+_0x407eaf)[_0x27a8('0x22')](_0x29f49b);}return null;};}function saveUpdates(_0x5107a5){return function(_0x1911d4){if(_0x1911d4){return _0x1911d4['update'](_0x5107a5)[_0x27a8('0x15')](function(_0xb9962b){return _0xb9962b;});}return null;};}function removeEntity(_0x528863){return function(_0x55beaf){if(_0x55beaf){return _0x55beaf[_0x27a8('0x29')]()[_0x27a8('0x15')](function(){var _0x2573c5=_0x55beaf[_0x27a8('0x2a')]({'plain':!![]});var _0x4f2de4=_0x27a8('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x4f2de4,'resourceId':_0x2573c5['id']}})['then'](function(){return _0x55beaf;});})['then'](function(){_0x528863['status'](0xcc)[_0x27a8('0x21')]();});}};}function handleEntityNotFound(_0x3f1580){return function(_0x43d24f){if(!_0x43d24f){_0x3f1580[_0x27a8('0x1f')](0x194);}return _0x43d24f;};}function handleError(_0x38469b,_0x2f7032){_0x2f7032=_0x2f7032||0x1f4;return function(_0x5281e1){logger['error'](_0x5281e1[_0x27a8('0x2c')]);if(_0x5281e1[_0x27a8('0x2d')]){delete _0x5281e1[_0x27a8('0x2d')];}_0x38469b[_0x27a8('0x20')](_0x2f7032)[_0x27a8('0x2e')](_0x5281e1);};}exports[_0x27a8('0x2f')]=function(_0x4599cd,_0x406272){var _0x20c0a7={'include':[{'model':db['Pause'],'as':_0x27a8('0x30')}]},_0x3a3d95={},_0x2d9fc0={'count':0x0,'rows':[]};var _0x512600=_[_0x27a8('0x31')](db[_0x27a8('0x32')][_0x27a8('0x33')],function(_0x3e3a73){return{'name':_0x3e3a73[_0x27a8('0x34')],'type':_0x3e3a73[_0x27a8('0x35')][_0x27a8('0x36')]};});_0x3a3d95[_0x27a8('0x37')]=_[_0x27a8('0x31')](_0x512600,'name');_0x3a3d95[_0x27a8('0x38')]=_['keys'](_0x4599cd['query']);_0x3a3d95[_0x27a8('0x39')]=_[_0x27a8('0x3a')](_0x3a3d95['model'],_0x3a3d95['query']);_0x20c0a7[_0x27a8('0x3b')]=_[_0x27a8('0x3a')](_0x3a3d95['model'],qs[_0x27a8('0x3c')](_0x4599cd[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x20c0a7[_0x27a8('0x3b')]=_0x20c0a7[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x20c0a7[_0x27a8('0x3b')]:_0x3a3d95[_0x27a8('0x37')];if(!_0x4599cd['query'][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x20c0a7[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x4599cd[_0x27a8('0x38')]['limit']);_0x20c0a7[_0x27a8('0x23')]=qs[_0x27a8('0x23')](_0x4599cd[_0x27a8('0x38')][_0x27a8('0x23')]);}_0x20c0a7['order']=qs[_0x27a8('0x40')](_0x4599cd[_0x27a8('0x38')][_0x27a8('0x40')]);_0x20c0a7['where']=qs[_0x27a8('0x39')](_[_0x27a8('0x41')](_0x4599cd[_0x27a8('0x38')],_0x3a3d95[_0x27a8('0x39')]),_0x512600);if(_0x4599cd['query'][_0x27a8('0x42')]){_0x20c0a7[_0x27a8('0x43')]=_[_0x27a8('0x44')](_0x20c0a7[_0x27a8('0x43')],{'$or':_[_0x27a8('0x31')](_0x512600,function(_0x4a7eb7){if(_0x4a7eb7['type']!==_0x27a8('0x45')){var _0x328fd4={};_0x328fd4[_0x4a7eb7[_0x27a8('0x2d')]]={'$like':'%'+_0x4599cd['query'][_0x27a8('0x42')]+'%'};return _0x328fd4;}})});}_0x20c0a7=_[_0x27a8('0x44')]({},_0x20c0a7,_0x4599cd[_0x27a8('0x46')]);var _0x9082a4={'where':_0x20c0a7[_0x27a8('0x43')]};return db[_0x27a8('0x32')][_0x27a8('0x26')](_0x9082a4)['then'](function(_0x3704b4){_0x2d9fc0[_0x27a8('0x26')]=_0x3704b4;if(_0x4599cd[_0x27a8('0x38')][_0x27a8('0x47')]){_0x20c0a7['include']=[{'all':!![]}];}return db[_0x27a8('0x32')][_0x27a8('0x48')](_0x20c0a7);})['then'](function(_0x2e0088){_0x2d9fc0['rows']=_0x2e0088;return _0x2d9fc0;})[_0x27a8('0x15')](respondWithFilteredResult(_0x406272,_0x20c0a7))[_0x27a8('0x1e')](handleError(_0x406272,null));};exports[_0x27a8('0x49')]=function(_0x37d886,_0x1cfb24){var _0x15f9ea={'raw':![],'where':{'id':_0x37d886[_0x27a8('0x4a')]['id']},'include':[{'model':db['Pause'],'as':_0x27a8('0x30')}]},_0x3f54c3={};_0x3f54c3[_0x27a8('0x37')]=_[_0x27a8('0x4b')](db[_0x27a8('0x32')]['rawAttributes']);_0x3f54c3[_0x27a8('0x38')]=_['keys'](_0x37d886['query']);_0x3f54c3[_0x27a8('0x39')]=_[_0x27a8('0x3a')](_0x3f54c3[_0x27a8('0x37')],_0x3f54c3['query']);_0x15f9ea['attributes']=_[_0x27a8('0x3a')](_0x3f54c3[_0x27a8('0x37')],qs[_0x27a8('0x3c')](_0x37d886[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x15f9ea[_0x27a8('0x3b')]=_0x15f9ea[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x15f9ea[_0x27a8('0x3b')]:_0x3f54c3[_0x27a8('0x37')];if(_0x37d886['query'][_0x27a8('0x47')]){_0x15f9ea['include']=[{'all':!![]}];}_0x15f9ea=_[_0x27a8('0x44')]({},_0x15f9ea,_0x37d886[_0x27a8('0x46')]);return db[_0x27a8('0x32')][_0x27a8('0x4c')](_0x15f9ea)[_0x27a8('0x15')](handleEntityNotFound(_0x1cfb24,null))[_0x27a8('0x15')](respondWithResult(_0x1cfb24,null))['catch'](handleError(_0x1cfb24,null));};exports[_0x27a8('0x4d')]=function(_0xbba4dc,_0x1f1df7){return db[_0x27a8('0x32')][_0x27a8('0x4d')](_0xbba4dc[_0x27a8('0x4e')],{})[_0x27a8('0x15')](function(_0x1ad217){var _0x273823=_0xbba4dc[_0x27a8('0x4f')]['get']({'plain':!![]});if(!_0x273823)throw new Error(_0x27a8('0x50'));if(_0x273823[_0x27a8('0x51')]===_0x27a8('0x4f')){var _0x45d039=_0x1ad217[_0x27a8('0x2a')]({'plain':!![]});var _0x594c63=_0x27a8('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x594c63,'userProfileId':_0x273823[_0x27a8('0x52')]},'raw':!![]})[_0x27a8('0x15')](function(_0x114725){if(_0x114725&&_0x114725[_0x27a8('0x53')]===0x0){return db[_0x27a8('0x54')]['create']({'name':_0x45d039['name'],'resourceId':_0x45d039['id'],'type':_0x114725[_0x27a8('0x2d')],'sectionId':_0x114725['id']},{})[_0x27a8('0x15')](function(){return _0x1ad217;});}else{return _0x1ad217;}})[_0x27a8('0x1e')](function(_0xfe4ea7){logger['error'](_0x27a8('0x55'),_0xfe4ea7);throw _0xfe4ea7;});}return _0x1ad217;})[_0x27a8('0x15')](respondWithResult(_0x1f1df7,0xc9))['catch'](handleError(_0x1f1df7,null));};exports[_0x27a8('0x56')]=function(_0x4223f9,_0x3b855f){if(_0x4223f9[_0x27a8('0x4e')]['id']){delete _0x4223f9[_0x27a8('0x4e')]['id'];}return db[_0x27a8('0x32')][_0x27a8('0x4c')]({'where':{'id':_0x4223f9['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x27a8('0x15')](handleEntityNotFound(_0x3b855f,null))[_0x27a8('0x15')](saveUpdates(_0x4223f9[_0x27a8('0x4e')],null))[_0x27a8('0x15')](respondWithResult(_0x3b855f,null))[_0x27a8('0x1e')](handleError(_0x3b855f,null));};exports['destroy']=function(_0x51411a,_0x271648){return db[_0x27a8('0x32')][_0x27a8('0x4c')]({'where':{'id':_0x51411a['params']['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x271648,null))[_0x27a8('0x15')](removeEntity(_0x271648,null))[_0x27a8('0x1e')](handleError(_0x271648,null));};exports['describe']=function(_0x55cfda,_0x2574a7){return db['ChatWebsite']['describe']()[_0x27a8('0x15')](respondWithResult(_0x2574a7,null))['catch'](handleError(_0x2574a7,null));};exports[_0x27a8('0x57')]=function(_0x5212ca,_0x2aaa29){if(_0x5212ca[_0x27a8('0x4e')]['id']){delete _0x5212ca[_0x27a8('0x4e')]['id'];}return db[_0x27a8('0x32')]['find']({'where':{'id':_0x5212ca[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x2aaa29,null))[_0x27a8('0x15')](function(_0x36b449){if(_0x36b449){_0x5212ca['body'][_0x27a8('0x58')]=_0x36b449['id'];return db[_0x27a8('0x59')][_0x27a8('0x4d')](_0x5212ca[_0x27a8('0x4e')]);}})[_0x27a8('0x15')](respondWithResult(_0x2aaa29,null))[_0x27a8('0x1e')](handleError(_0x2aaa29,null));};exports[_0x27a8('0x5a')]=function(_0x3fa588,_0x4a8dc4){var _0x5ab9bc={'raw':![],'where':{}};var _0x5492f5={};var _0x500a7e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x27a8('0x5b')]({'where':{'id':_0x3fa588[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x4a8dc4,null))[_0x27a8('0x15')](function(_0x36c339){if(_0x36c339){_0x5492f5['model']=_['keys'](db['Disposition'][_0x27a8('0x33')]);_0x5492f5[_0x27a8('0x38')]=_[_0x27a8('0x4b')](_0x3fa588[_0x27a8('0x38')]);_0x5492f5['filters']=_[_0x27a8('0x3a')](_0x5492f5['model'],_0x5492f5[_0x27a8('0x38')]);_0x5ab9bc['attributes']=_[_0x27a8('0x3a')](_0x5492f5[_0x27a8('0x37')],qs[_0x27a8('0x3c')](_0x3fa588[_0x27a8('0x38')]['fields']));_0x5ab9bc[_0x27a8('0x3b')]=_0x5ab9bc['attributes'][_0x27a8('0x3d')]?_0x5ab9bc[_0x27a8('0x3b')]:_0x5492f5[_0x27a8('0x37')];if(!_0x3fa588['query'][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x5ab9bc[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x3fa588[_0x27a8('0x38')]['limit']);_0x5ab9bc[_0x27a8('0x23')]=qs['offset'](_0x3fa588[_0x27a8('0x38')][_0x27a8('0x23')]);}_0x5ab9bc['order']=qs[_0x27a8('0x40')](_0x3fa588[_0x27a8('0x38')][_0x27a8('0x40')]);_0x5ab9bc[_0x27a8('0x43')]=qs[_0x27a8('0x39')](_[_0x27a8('0x41')](_0x3fa588[_0x27a8('0x38')],_0x5492f5['filters']));_0x5ab9bc['where'][_0x27a8('0x58')]=_0x36c339['id'];if(_0x3fa588['query'][_0x27a8('0x42')]){_0x5ab9bc[_0x27a8('0x43')]=_[_0x27a8('0x44')](_0x5ab9bc['where'],{'$or':_[_0x27a8('0x31')](_0x5ab9bc[_0x27a8('0x3b')],function(_0x328b23){var _0x838e53={};_0x838e53[_0x328b23]={'$like':'%'+_0x3fa588['query'][_0x27a8('0x42')]+'%'};return _0x838e53;})});}_0x5ab9bc=_[_0x27a8('0x44')]({},_0x5ab9bc,_0x3fa588[_0x27a8('0x46')]);return db[_0x27a8('0x59')][_0x27a8('0x26')]({'where':_0x5ab9bc['where']})[_0x27a8('0x15')](function(_0x1cb673){_0x500a7e[_0x27a8('0x26')]=_0x1cb673;if(_0x3fa588[_0x27a8('0x38')][_0x27a8('0x47')]){_0x5ab9bc[_0x27a8('0x5c')]=[{'all':!![]}];}return db[_0x27a8('0x59')]['findAll'](_0x5ab9bc);})['then'](function(_0x1e2940){_0x500a7e[_0x27a8('0x5d')]=_0x1e2940;return _0x500a7e;});}})[_0x27a8('0x15')](respondWithFilteredResult(_0x4a8dc4,_0x5ab9bc))[_0x27a8('0x1e')](handleError(_0x4a8dc4,null));};exports[_0x27a8('0x5e')]=function(_0x32c81a,_0x3b5901){return db[_0x27a8('0x32')][_0x27a8('0x4c')]({'where':{'id':_0x32c81a['params']['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x3b5901,null))[_0x27a8('0x15')](function(_0x9dbf72){if(_0x9dbf72){return _0x9dbf72[_0x27a8('0x5e')](_0x32c81a['query']['ids']);}})[_0x27a8('0x15')](respondWithStatusCode(_0x3b5901,null))[_0x27a8('0x1e')](handleError(_0x3b5901,null));};exports['addAnswer']=function(_0x15331b,_0x10921a){if(_0x15331b[_0x27a8('0x4e')]['id']){delete _0x15331b[_0x27a8('0x4e')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x15331b[_0x27a8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x10921a,null))[_0x27a8('0x15')](function(_0xcdf3b2){if(_0xcdf3b2){_0x15331b[_0x27a8('0x4e')][_0x27a8('0x58')]=_0xcdf3b2['id'];return db[_0x27a8('0x5f')][_0x27a8('0x4d')](_0x15331b[_0x27a8('0x4e')]);}})['then'](respondWithResult(_0x10921a,null))[_0x27a8('0x1e')](handleError(_0x10921a,null));};exports[_0x27a8('0x60')]=function(_0x3c3065,_0xff14db){var _0x39b3b9={'raw':![],'where':{}};var _0x18ecb5={};var _0x2a9ae1={'count':0x0,'rows':[]};return db[_0x27a8('0x32')]['findOne']({'where':{'id':_0x3c3065[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0xff14db,null))[_0x27a8('0x15')](function(_0xeb1d8){if(_0xeb1d8){_0x18ecb5['model']=_[_0x27a8('0x4b')](db[_0x27a8('0x5f')][_0x27a8('0x33')]);_0x18ecb5[_0x27a8('0x38')]=_[_0x27a8('0x4b')](_0x3c3065[_0x27a8('0x38')]);_0x18ecb5[_0x27a8('0x39')]=_['intersection'](_0x18ecb5[_0x27a8('0x37')],_0x18ecb5['query']);_0x39b3b9[_0x27a8('0x3b')]=_[_0x27a8('0x3a')](_0x18ecb5[_0x27a8('0x37')],qs['fields'](_0x3c3065[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x39b3b9['attributes']=_0x39b3b9[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x39b3b9[_0x27a8('0x3b')]:_0x18ecb5[_0x27a8('0x37')];if(!_0x3c3065[_0x27a8('0x38')][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x39b3b9[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x3c3065[_0x27a8('0x38')][_0x27a8('0x25')]);_0x39b3b9[_0x27a8('0x23')]=qs[_0x27a8('0x23')](_0x3c3065[_0x27a8('0x38')]['offset']);}_0x39b3b9[_0x27a8('0x61')]=qs[_0x27a8('0x40')](_0x3c3065[_0x27a8('0x38')][_0x27a8('0x40')]);_0x39b3b9[_0x27a8('0x43')]=qs[_0x27a8('0x39')](_[_0x27a8('0x41')](_0x3c3065[_0x27a8('0x38')],_0x18ecb5[_0x27a8('0x39')]));_0x39b3b9['where']['ChatWebsiteId']=_0xeb1d8['id'];if(_0x3c3065[_0x27a8('0x38')]['filter']){_0x39b3b9['where']=_[_0x27a8('0x44')](_0x39b3b9[_0x27a8('0x43')],{'$or':_['map'](_0x39b3b9['attributes'],function(_0x25d8a2){var _0x53d7f7={};_0x53d7f7[_0x25d8a2]={'$like':'%'+_0x3c3065['query']['filter']+'%'};return _0x53d7f7;})});}_0x39b3b9=_[_0x27a8('0x44')]({},_0x39b3b9,_0x3c3065[_0x27a8('0x46')]);return db[_0x27a8('0x5f')][_0x27a8('0x26')]({'where':_0x39b3b9['where']})['then'](function(_0x4aef7d){_0x2a9ae1['count']=_0x4aef7d;if(_0x3c3065[_0x27a8('0x38')]['includeAll']){_0x39b3b9[_0x27a8('0x5c')]=[{'all':!![]}];}return db[_0x27a8('0x5f')][_0x27a8('0x48')](_0x39b3b9);})[_0x27a8('0x15')](function(_0x5833de){_0x2a9ae1[_0x27a8('0x5d')]=_0x5833de;return _0x2a9ae1;});}})[_0x27a8('0x15')](respondWithFilteredResult(_0xff14db,_0x39b3b9))[_0x27a8('0x1e')](handleError(_0xff14db,null));};exports[_0x27a8('0x62')]=function(_0x193003,_0x2fb868){return db['ChatWebsite'][_0x27a8('0x4c')]({'where':{'id':_0x193003[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x2fb868,null))['then'](function(_0x30dc7d){if(_0x30dc7d){return _0x30dc7d[_0x27a8('0x62')](_0x193003[_0x27a8('0x38')]['ids']);}})[_0x27a8('0x15')](respondWithStatusCode(_0x2fb868,null))['catch'](handleError(_0x2fb868,null));};exports['addLogo']=function(_0x52435d,_0x2321b7){_0x52435d['body'][_0x27a8('0x63')]=_0x52435d[_0x27a8('0x64')][_0x27a8('0x65')];return db[_0x27a8('0x32')]['find']({'where':{'id':_0x52435d[_0x27a8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2321b7,null))[_0x27a8('0x15')](saveUpdates(_0x52435d[_0x27a8('0x4e')],null))['then'](respondWithResult(_0x2321b7,null))['catch'](handleError(_0x2321b7,null));};exports['addAvatar']=function(_0x3c8b5f,_0x2d2627){_0x3c8b5f[_0x27a8('0x4e')]['agentAvatar']=_0x3c8b5f[_0x27a8('0x64')]['filename'];return db['ChatWebsite'][_0x27a8('0x4c')]({'where':{'id':_0x3c8b5f[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x2d2627,null))[_0x27a8('0x15')](saveUpdates(_0x3c8b5f[_0x27a8('0x4e')],null))[_0x27a8('0x15')](respondWithResult(_0x2d2627,null))[_0x27a8('0x1e')](handleError(_0x2d2627,null));};exports[_0x27a8('0x66')]=function(_0x1f23b6,_0x1d9a88){_0x1f23b6[_0x27a8('0x4e')][_0x27a8('0x67')]=_0x1f23b6[_0x27a8('0x64')][_0x27a8('0x65')];return db[_0x27a8('0x32')]['find']({'where':{'id':_0x1f23b6['params']['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x1d9a88,null))[_0x27a8('0x15')](saveUpdates(_0x1f23b6['body'],null))['then'](respondWithResult(_0x1d9a88,null))['catch'](handleError(_0x1d9a88,null));};exports[_0x27a8('0x68')]=function(_0x1652b5,_0x7348be){_0x1652b5['body'][_0x27a8('0x69')]=_0x1652b5['file'][_0x27a8('0x65')];return db[_0x27a8('0x32')]['find']({'where':{'id':_0x1652b5[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x7348be,null))['then'](saveUpdates(_0x1652b5['body'],null))[_0x27a8('0x15')](respondWithResult(_0x7348be,null))[_0x27a8('0x1e')](handleError(_0x7348be,null));};exports[_0x27a8('0x6a')]=function(_0x281b11,_0x9cb4b0){var _0x5c0c6f=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],'server/files/images/logos/default_logo.svg');var _0xc9f49a={'where':{'id':_0x281b11[_0x27a8('0x4a')]['id']},'attributes':['id',_0x27a8('0x63')],'raw':!![]};var _0x20f334=![];return require(_0x27a8('0x6d'))[_0x27a8('0x6e')]()['then'](function(_0x247fe8){if(_0x247fe8){_0x20f334=_0x247fe8[_0x27a8('0x6f')];}})[_0x27a8('0x15')](function(){return db[_0x27a8('0x32')][_0x27a8('0x4c')](_0xc9f49a);})[_0x27a8('0x15')](handleEntityNotFound(_0x9cb4b0,null))[_0x27a8('0x15')](function(_0x37ec00){if(_0x37ec00){if(!_[_0x27a8('0x70')](_0x37ec00[_0x27a8('0x63')])){if(fs[_0x27a8('0x71')](path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x72'),_0x37ec00[_0x27a8('0x63')]))&&_0x20f334){_0x5c0c6f=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x72'),_0x37ec00[_0x27a8('0x63')]);}}return _0x9cb4b0[_0x27a8('0x73')](_0x5c0c6f);}})[_0x27a8('0x1e')](handleError(_0x9cb4b0,null));};exports[_0x27a8('0x74')]=function(_0x45f655,_0x182339){var _0x25fc49=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x75'));var _0x4c2068={'where':{'id':_0x45f655['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x27a8('0x32')][_0x27a8('0x4c')](_0x4c2068)['then'](handleEntityNotFound(_0x182339,null))[_0x27a8('0x15')](function(_0x130a44){if(_0x130a44){if(!_['isNil'](_0x130a44[_0x27a8('0x76')])){if(fs[_0x27a8('0x71')](path['join'](config[_0x27a8('0x6c')],_0x27a8('0x77'),_0x130a44[_0x27a8('0x76')]))){_0x25fc49=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],'server/files/images/avatars/',_0x130a44[_0x27a8('0x76')]);}}return _0x182339[_0x27a8('0x73')](_0x25fc49);}})[_0x27a8('0x1e')](handleError(_0x182339,null));};exports[_0x27a8('0x78')]=function(_0x4b1404,_0x1a0a07){var _0x284100=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x79'));var _0x370398={'where':{'id':_0x4b1404[_0x27a8('0x4a')]['id']},'attributes':['id',_0x27a8('0x67'),_0x27a8('0x7a')],'raw':!![]};return db[_0x27a8('0x32')][_0x27a8('0x4c')](_0x370398)['then'](handleEntityNotFound(_0x1a0a07,null))[_0x27a8('0x15')](function(_0x1abd35){if(_0x1abd35){if(!_['isNil'](_0x1abd35['customerAvatar'])){if(fs[_0x27a8('0x71')](path[_0x27a8('0x6b')](config['root'],_0x27a8('0x77'),_0x1abd35[_0x27a8('0x67')]))&&_0x1abd35[_0x27a8('0x7a')]){_0x284100=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x77'),_0x1abd35[_0x27a8('0x67')]);}}return _0x1a0a07[_0x27a8('0x73')](_0x284100);}})[_0x27a8('0x1e')](handleError(_0x1a0a07,null));};exports[_0x27a8('0x7b')]=function(_0x3f75a3,_0x3a6515){var _0x2f95cc=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x7c'));var _0x37578b={'where':{'id':_0x3f75a3[_0x27a8('0x4a')]['id']},'attributes':['id',_0x27a8('0x69')],'raw':!![]};return db[_0x27a8('0x32')][_0x27a8('0x4c')](_0x37578b)['then'](handleEntityNotFound(_0x3a6515,null))['then'](function(_0x18c9a5){if(_0x18c9a5){if(!_[_0x27a8('0x70')](_0x18c9a5[_0x27a8('0x69')])){if(fs[_0x27a8('0x71')](path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x77'),_0x18c9a5[_0x27a8('0x69')]))){_0x2f95cc=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x77'),_0x18c9a5[_0x27a8('0x69')]);}}return _0x3a6515[_0x27a8('0x73')](_0x2f95cc);}})[_0x27a8('0x1e')](handleError(_0x3a6515,null));};exports[_0x27a8('0x7d')]=function(_0x38df5b,_0xcab211){var _0x1d4272=require(_0x27a8('0x7e'));var _0xc9995c=new _0x1d4272();var _0xc8723b=_0xc9995c[_0x27a8('0x7f')](_0x38df5b[_0x27a8('0x80')]['user-agent'])[_0x27a8('0x81')]();var _0x39c32b={'body':_0x38df5b[_0x27a8('0x4e')],'channel':_0x27a8('0x82')};var _0x3f500e=[];var _0x14092b=[];var _0x5b262f={};var _0x32fa91=![];return db[_0x27a8('0x83')][_0x27a8('0x84')]()[_0x27a8('0x15')](function(_0x335e12){if(!_0x335e12){throw new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))](_0x27a8('0x87'));}_0x3f500e=_[_0x27a8('0x88')](_[_0x27a8('0x4b')](_0x335e12),[_0x27a8('0x89'),_0x27a8('0x8a')]);_0x14092b=_['difference'](_[_0x27a8('0x4b')](_0x335e12),[_0x27a8('0x89'),_0x27a8('0x8a'),'CompanyId',_0x27a8('0x8b')]);if(_0x38df5b[_0x27a8('0x4e')]['id']){delete _0x38df5b[_0x27a8('0x4e')]['id'];}if(_['isNil'](_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x8c')])){throw new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))]('from\x20is\x20mandatory');}if(_[_0x27a8('0x70')](_0x38df5b['body'][_0x27a8('0x4e')])||_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x4e')]===''){throw new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))](_0x27a8('0x8d'));}if(_[_0x27a8('0x70')](_0x38df5b['body']['mapKey'])){throw new db['Sequelize'][(_0x27a8('0x86'))](_0x27a8('0x8e')+_0x14092b);}if(!_[_0x27a8('0x8f')](_0x14092b,_0x38df5b[_0x27a8('0x4e')]['mapKey'])){throw new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x14092b);}_0x5b262f[_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x90')]]=_0x38df5b[_0x27a8('0x4e')]['from'];})[_0x27a8('0x15')](function(){return db['ChatWebsite'][_0x27a8('0x4c')]({'where':{'id':_0x38df5b[_0x27a8('0x4a')]['id']},'include':[{'model':db[_0x27a8('0x91')],'as':'List','include':[{'model':db['CmContact'],'as':_0x27a8('0x92'),'where':_0x5b262f,'limit':0x1,'order':[[_0x27a8('0x8a'),_0x27a8('0x93')]]}]},{'model':db[_0x27a8('0x94')],'as':_0x27a8('0x95')}]});})['then'](handleEntityNotFound(_0xcab211,null))['then'](function(_0x433de3){if(_0x433de3&&_0x433de3[_0x27a8('0x96')]){_0x39c32b[_0x27a8('0x97')]=_0x433de3;_0x39c32b[_0x27a8('0x98')]=_0x433de3['Applications'];_0x39c32b[_0x27a8('0x99')]=_0x433de3[_0x27a8('0x96')];_0x39c32b[_0x27a8('0x98')]=_['orderBy'](_0x39c32b['applications'],[_0x27a8('0x9a')],[_0x27a8('0x9b')]);if(_0x39c32b[_0x27a8('0x97')][_0x27a8('0x95')]){delete _0x39c32b['account'][_0x27a8('0x95')];}if(_0x39c32b['account'][_0x27a8('0x96')]&&_0x39c32b[_0x27a8('0x97')][_0x27a8('0x96')][_0x27a8('0x92')][_0x27a8('0x3d')]){return _0x39c32b[_0x27a8('0x97')]['List']['Contacts'][0x0];}var _0x754075=_[_0x27a8('0xb')](_0x38df5b[_0x27a8('0x4e')],{'firstName':_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x8c')],'ListId':_0x433de3[_0x27a8('0x8b')]});_0x754075[_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x90')]]=_0x38df5b['body'][_0x27a8('0x8c')];return db[_0x27a8('0x83')]['create'](_0x754075,{'fields':_0x3f500e,'raw':!![]});}})[_0x27a8('0x15')](handleEntityNotFound(_0xcab211,null))[_0x27a8('0x15')](function(_0x4b9d1a){_0x39c32b[_0x27a8('0x9c')]=_0x4b9d1a;var _0x397d60=_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x9d')];if(_0x38df5b[_0x27a8('0x80')][_0x27a8('0x9e')]){_0x397d60=_0x38df5b[_0x27a8('0x80')][_0x27a8('0x9e')];}else if(_0x38df5b[_0x27a8('0x80')][_0x27a8('0x9f')]){_0x397d60=_[_0x27a8('0xa0')](_0x38df5b[_0x27a8('0x80')][_0x27a8('0x9f')][_0x27a8('0xa1')](','));}if(_0x4b9d1a){var _0x21b562={'ContactId':_0x4b9d1a['id'],'ChatWebsiteId':_0x38df5b[_0x27a8('0x4a')]['id'],'from':(_0x4b9d1a[_0x27a8('0xa2')]||'')+'\x20'+(_0x4b9d1a[_0x27a8('0xa3')]||''),'customerIp':_0x397d60,'customerPort':_0x38df5b[_0x27a8('0x80')][_0x27a8('0xa4')]?_0x38df5b['headers'][_0x27a8('0xa4')]:null,'referer':_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xa5')],'browserName':_0xc8723b[_0x27a8('0xa6')][_0x27a8('0x2d')]&&_0xc8723b[_0x27a8('0xa6')][_0x27a8('0xa7')]?util['format'](_0x27a8('0xa8'),_0xc8723b[_0x27a8('0xa6')]['name'],_0xc8723b['browser']['version']):_0x27a8('0xa9'),'browserVersion':_0xc8723b[_0x27a8('0xa6')]['version']||_0x27a8('0xa9'),'osName':util[_0x27a8('0xaa')]('%s\x20%s',_0xc8723b['os'][_0x27a8('0x2d')],_0xc8723b['os'][_0x27a8('0xa7')]),'osVersion':_0xc8723b['os'][_0x27a8('0xa7')],'deviceModel':_0xc8723b[_0x27a8('0xab')][_0x27a8('0x37')]&&_0xc8723b['device'][_0x27a8('0xac')]?util[_0x27a8('0xaa')](_0x27a8('0xad'),_0xc8723b[_0x27a8('0xab')][_0x27a8('0x37')],_0xc8723b['device'][_0x27a8('0xac')],_0xc8723b[_0x27a8('0xab')][_0x27a8('0x35')]):null,'deviceVendor':_0xc8723b[_0x27a8('0xab')][_0x27a8('0xac')],'deviceType':_0xc8723b[_0x27a8('0xab')][_0x27a8('0x35')],'formData':JSON[_0x27a8('0x1b')](_0x38df5b[_0x27a8('0x4e')])};var _0x6384d4={'ChatWebsiteId':_0x38df5b['params']['id'],'closed':![]};if(_0x38df5b['body'][_0x27a8('0xae')]){_0x6384d4[_0x27a8('0xae')]=_0x38df5b['body'][_0x27a8('0xae')];return db['ChatInteraction'][_0x27a8('0x4c')]({'where':_0x6384d4})[_0x27a8('0x15')](function(_0x226a52){if(_0x226a52){return[_0x226a52,![]];}_0x21b562[_0x27a8('0xae')]=_0x38df5b['body'][_0x27a8('0xae')];_0x21b562[_0x27a8('0xaf')]=_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xaf')];return db[_0x27a8('0xb0')][_0x27a8('0x4d')](_0x21b562)[_0x27a8('0x15')](function(_0x3b69db){return[_0x3b69db,!![]];});});}_0x6384d4['ContactId']=_0x4b9d1a['id'];if(_0x38df5b[_0x27a8('0x4e')]['interaction']&&_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb1')]['id']){_0x6384d4['id']=_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb1')]['id'];return db['ChatInteraction'][_0x27a8('0x4c')]({'where':_0x6384d4})['then'](function(_0x2ed05a){if(_0x2ed05a){return[_0x2ed05a,![]];}return db['ChatInteraction'][_0x27a8('0x4d')](_0x21b562)[_0x27a8('0x15')](function(_0x4b2005){return[_0x4b2005,!![]];});});}return db[_0x27a8('0xb0')][_0x27a8('0x4d')](_0x21b562)[_0x27a8('0x15')](function(_0x539c1e){return[_0x539c1e,!![]];});}})[_0x27a8('0xb2')](function(_0x24e81b,_0x149012){if(_0x24e81b){_0x32fa91=_0x149012;if(!_0x149012){var _0x4b9240={'from':(_0x39c32b[_0x27a8('0x9c')][_0x27a8('0xa2')]||'')+'\x20'+(_0x39c32b[_0x27a8('0x9c')]['lastName']||'')};if(_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xae')]&&_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb3')]&&_0x38df5b[_0x27a8('0x4e')]['threadId']!=_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb3')]){_0x4b9240[_0x27a8('0xae')]=_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb3')];}return _0x24e81b['update'](_0x4b9240);}else{return _0x24e81b;}}})['then'](function(_0x320a29){_0x39c32b[_0x27a8('0xb1')]=_0x320a29[_0x27a8('0x2a')]({'plain':!![]});_0x39c32b['interaction'][_0x27a8('0xb4')]=_0x32fa91;if(_0x39c32b['interaction'][_0x27a8('0xb4')]){if(_0x39c32b[_0x27a8('0x97')]['autoclose']){_0x39c32b['applications'][_0x27a8('0xb5')]({'id':0x0,'priority':_0x39c32b[_0x27a8('0x98')][_0x27a8('0x3d')]+0x1,'app':_0x27a8('0xb6'),'appdata':_0x27a8('0xb7'),'interval':'*,*,*,*'});}}return db[_0x27a8('0xb8')][_0x27a8('0x4d')]({'body':_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x4e')],'ChatWebsiteId':_0x38df5b[_0x27a8('0x4a')]['id'],'ChatInteractionId':_0x320a29['id'],'direction':'in','ContactId':_0x39c32b[_0x27a8('0x9c')]['id'],'AttachmentId':_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb9')]});})['then'](function(_0x5977e0){_0x39c32b[_0x27a8('0x1d')]=_0x5977e0;if(_0x39c32b[_0x27a8('0xb1')]['UserId']){return db['User'][_0x27a8('0x4c')]({'attributes':['id',_0x27a8('0x2d')],'where':{'id':_0x39c32b[_0x27a8('0xb1')][_0x27a8('0xba')]}})[_0x27a8('0x15')](function(_0x5ec681){if(_0x5ec681){_0x39c32b[_0x27a8('0x98')][_0x27a8('0xbb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5ec681[_0x27a8('0x2d')]+','+(_0x39c32b['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x39c32b[_0x27a8('0xbc')]=!![];}return respondWithRpcPromise('Start',_0x27a8('0xbd'),_0x39c32b);});}return respondWithRpcPromise(_0x27a8('0xbe'),_0x27a8('0xbd'),_0x39c32b);})[_0x27a8('0x15')](function(_0x568d9b){respondWithRpcPromise(_0x27a8('0xbf'),_0x27a8('0xbf'),{'event':'notify','message':_0x568d9b},client9002);return _0x568d9b;})[_0x27a8('0x15')](respondWithResult(_0xcab211,null))['catch'](handleError(_0xcab211,null));};exports[_0x27a8('0xc0')]=function(_0x1ed75b,_0x5454c2){var _0x457cd1,_0x2ce6dd,_0x406b0e;var _0x2a5b45=[];var _0xdeb614={};var _0x37cd9e=_0x1ed75b[_0x27a8('0xc1')]||[];var _0x44d8e8=[];var _0x172ab1;return db[_0x27a8('0x83')][_0x27a8('0x84')]()[_0x27a8('0x15')](function(_0x39fbf2){if(!_0x39fbf2){throw new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))]('no\x20available\x20attributes');}_0x2a5b45=_[_0x27a8('0x88')](_[_0x27a8('0x4b')](_0x39fbf2),[_0x27a8('0x89'),_0x27a8('0x8a'),_0x27a8('0xc2'),_0x27a8('0x8b')]);if(_0x1ed75b[_0x27a8('0x4e')]['id']){delete _0x1ed75b[_0x27a8('0x4e')]['id'];}if(_[_0x27a8('0x70')](_0x1ed75b[_0x27a8('0x4e')][_0x27a8('0x8c')])){throw _0x5454c2['status'](0x1f4)['send'](new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))](_0x27a8('0xc3')));}if(_[_0x27a8('0x70')](_0x1ed75b[_0x27a8('0x4e')]['body'])||_0x1ed75b['body'][_0x27a8('0x4e')]===''){throw _0x5454c2[_0x27a8('0x20')](0x1f4)[_0x27a8('0x2e')](new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))](_0x27a8('0x8d')));}if(_[_0x27a8('0x70')](_0x1ed75b['body'][_0x27a8('0xc4')])){throw _0x5454c2[_0x27a8('0x20')](0x1f4)[_0x27a8('0x2e')](new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2a5b45));}if(!_[_0x27a8('0x8f')](_0x2a5b45,_0x1ed75b['body'][_0x27a8('0xc4')])){throw _0x5454c2[_0x27a8('0x20')](0x1f4)['send'](new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2a5b45));}_0xdeb614[_0x1ed75b[_0x27a8('0x4e')][_0x27a8('0xc4')]]=_0x1ed75b[_0x27a8('0x4e')]['from'];})[_0x27a8('0x15')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x1ed75b[_0x27a8('0x4a')]['id']},'include':[{'model':db[_0x27a8('0x91')],'as':_0x27a8('0x96')},{'model':db[_0x27a8('0xc5')],'as':_0x27a8('0xc5')}]});})[_0x27a8('0x15')](handleEntityNotFound(_0x5454c2,null))[_0x27a8('0x15')](function(_0x50456b){if(_0x50456b&&_0x50456b[_0x27a8('0x96')]){_0x2ce6dd=_0x50456b;var _0x57961c=_[_0x27a8('0xb')](_0x1ed75b['body'],{'firstName':_0x1ed75b[_0x27a8('0x4e')][_0x27a8('0x8c')],'phone':_0x1ed75b[_0x27a8('0x4e')]['from'],'ListId':_0x50456b[_0x27a8('0x8b')]});_0x57961c[_0x1ed75b[_0x27a8('0x4e')]['mapKeyOffline']]=_0x1ed75b[_0x27a8('0x4e')]['from'];return db['CmContact'][_0x27a8('0xc6')]({'where':_0xdeb614,'defaults':_0x57961c});}})[_0x27a8('0xb2')](function(_0xf09e8e){if(_0xf09e8e){_0x406b0e=_0xf09e8e;var _0x213df4=fs[_0x27a8('0xc7')](path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0xc8')),_0x27a8('0xc9'));var _0x27faa3=ejs[_0x27a8('0xca')](_0x213df4,{'body':_['toPairs'](_0x1ed75b[_0x27a8('0x4e')][_0x27a8('0x4e')]),'bodyTitle':_0x2ce6dd['offlineMessageBody']});return db['ChatOfflineMessage'][_0x27a8('0x4d')]({'body':_0x27faa3,'plainBody':htmlToText[_0x27a8('0xcb')](_0x27faa3),'ContactId':_0xf09e8e['id'],'ChatWebsiteId':_0x2ce6dd['id']});}})['then'](function(_0x32df13){_0x172ab1=_0x32df13;if(_0x37cd9e[_0x27a8('0x3d')]){var _0xd09318=_0x37cd9e[_0x27a8('0x31')](function(_0x68cc7a){return{'name':_0x68cc7a[_0x27a8('0xcc')],'basename':_0x68cc7a[_0x27a8('0x65')],'type':_0x68cc7a[_0x27a8('0xcd')],'ChatOfflineMessageId':_0x32df13['id']};});_0x44d8e8=_0xd09318[_0x27a8('0x31')](_0x8509c5=>{var _0x2cecfc={'filename':_0x8509c5[_0x27a8('0x2d')],'path':path['join'](config[_0x27a8('0x6c')],_0x27a8('0xce'),'files','attachments',_0x27a8('0xcf'),_0x8509c5[_0x27a8('0xd0')])};return _0x2cecfc;});if(!_0x2ce6dd[_0x27a8('0xd1')]){return db['sequelize'][_0x27a8('0xd2')](function(_0x1fd9de){return db[_0x27a8('0xd3')]['bulkCreate'](_0xd09318,{'transaction':_0x1fd9de});});}}})[_0x27a8('0x15')](function(){if(_0x172ab1){_0x457cd1=_0x172ab1;return db['MailAccount'][_0x27a8('0x5b')]({'where':{'service':!![]},'include':[{'model':db[_0x27a8('0xd4')],'as':_0x27a8('0xd5'),'raw':!![],'include':[{'model':db[_0x27a8('0xd6')],'as':_0x27a8('0xd6'),'raw':!![]}]}]});}})['then'](function(_0x46318c){if(_0x46318c&&_0x46318c[_0x27a8('0xd5')]&&_0x2ce6dd[_0x27a8('0xd7')]&&_0x2ce6dd[_0x27a8('0xd8')]){var _0x1f7a58=_0x46318c[_0x27a8('0xd9')]();return respondWithRpcPromise(_0x27a8('0xda'),_0x27a8('0xdb'),{'account':_0x1f7a58,'message':{'from':util[_0x27a8('0xaa')](_0x27a8('0xdc'),_0x46318c[_0x27a8('0x2d')],_0x46318c['email']||_0x46318c[_0x27a8('0xd5')][_0x27a8('0x4f')]),'to':_0x2ce6dd[_0x27a8('0xd8')],'subject':_0x2ce6dd[_0x27a8('0xdd')],'html':_0x457cd1[_0x27a8('0x4e')],'attachments':_0x44d8e8}},client9003)[_0x27a8('0x15')](function(){return _0x457cd1;})[_0x27a8('0x1e')](function(_0xf8b1e8){logger[_0x27a8('0x1c')](_0xf8b1e8);});}})[_0x27a8('0x15')](function(){if(_0x2ce6dd&&_0x2ce6dd[_0x27a8('0xd1')]&&_0x2ce6dd[_0x27a8('0xde')]){var _0x5771c7=[];if(_0x37cd9e['length']){_0x5771c7=_0x37cd9e[_0x27a8('0x31')](function(_0x31768d){return{'name':_0x31768d[_0x27a8('0xcc')],'basename':_0x31768d[_0x27a8('0x65')],'type':_0x31768d['mimetype'],'ChatOfflineMessageId':_0x172ab1['id']};});}var _0x85d97;if(!_[_0x27a8('0x70')](_0x2ce6dd[_0x27a8('0xdf')])){var _0xed8c32=_[_0x27a8('0x31')](_0x1ed75b['body'],function(_0x1fdb16){return _0x1fdb16;});var _0x362f58=_[_0x27a8('0xe0')](_0xed8c32)[0x0];var _0x1d17e8=_[_0x27a8('0xe1')](_0x362f58,function(_0x283f30){return _0x283f30;});_0x85d97=_0x1d17e8[0x1][_0x2ce6dd[_0x27a8('0xdf')]];}var _0x3e7f89={'from':_0x406b0e[_0x27a8('0xe2')],'firstName':_0x406b0e[_0x27a8('0xa2')],'lastName':_0x406b0e['lastName'],'mapKey':_0x27a8('0xe2'),'message':{'from':_0x406b0e[_0x27a8('0xe2')],'to':_0x2ce6dd[_0x27a8('0xc5')][_0x27a8('0xe2')],'cc':'','subject':_['isNil'](_0x85d97)?_0x2ce6dd[_0x27a8('0xdd')]:_0x85d97,'messageId':'','sentAt':new Date(),'attach':_0x5771c7[_0x27a8('0x3d')],'attachments':_0x5771c7,'originChannel':'Chat','ChatWebsiteId':_0x2ce6dd['id'],'ChatOfflineMessageId':_0x457cd1['id'],'originTo':_0x2ce6dd[_0x27a8('0xc5')][_0x27a8('0xe2')]},'body':_0x457cd1['body']};var _0x2096a1={'account':{'id':_0x2ce6dd[_0x27a8('0xde')]},'body':_0x3e7f89,'log':_0x27a8('0xe3')};return respondWithRpcPromise(_0x27a8('0xe3'),_0x27a8('0xe4'),_0x2096a1,client9001)[_0x27a8('0x15')](function(){return _0x457cd1;})['catch'](function(_0x2cc2d4){logger[_0x27a8('0x1c')](_0x2cc2d4);});}return;})[_0x27a8('0x15')](function(){if(_0x457cd1){return _0x457cd1;}})[_0x27a8('0x15')](respondWithResult(_0x5454c2,null))[_0x27a8('0x1e')](function(_0x1eff23){logger[_0x27a8('0x1c')](_0x27a8('0x1e'),_0x1eff23);for(var _0x2432fe of _0x37cd9e){var _0x17f099=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0xce'),_0x27a8('0xc1'),_0x27a8('0xe5'),_0x27a8('0xcf'),_0x2432fe[_0x27a8('0x65')]);fs_extra['remove'](_0x17f099)['catch'](function(_0x161705){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x17f099,_0x161705);});}});};exports[_0x27a8('0xe6')]=function(_0x199387,_0x8d9f9c){return db[_0x27a8('0xb0')][_0x27a8('0x4c')]({'where':{'id':_0x199387['params']['id']}})['then'](handleEntityNotFound(_0x8d9f9c,null))[_0x27a8('0x15')](function(_0x314206){if(_0x314206){return _0x314206[_0x27a8('0xe6')](_0x199387[_0x27a8('0x4e')][_0x27a8('0xe7')],_['omit'](_0x199387['body'],[_0x27a8('0xe7'),'id'])||{});}})[_0x27a8('0x15')](respondWithResult(_0x8d9f9c,null))[_0x27a8('0x1e')](handleError(_0x8d9f9c,null));};exports[_0x27a8('0xe8')]=function(_0x1c6c8c,_0x3c4ab1){var _0x2b3e00={'raw':![],'where':{}};var _0x161f6f={};var _0x2541e5={'count':0x0,'rows':[]};return db[_0x27a8('0x32')][_0x27a8('0x5b')]({'where':{'id':_0x1c6c8c['params']['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x3c4ab1,null))['then'](function(_0x1d2664){if(_0x1d2664){_0x161f6f[_0x27a8('0x37')]=_['keys'](db['ChatInteraction'][_0x27a8('0x33')]);_0x161f6f['query']=_['keys'](_0x1c6c8c[_0x27a8('0x38')]);_0x161f6f[_0x27a8('0x39')]=_[_0x27a8('0x3a')](_0x161f6f[_0x27a8('0x37')],_0x161f6f['query']);_0x2b3e00[_0x27a8('0x3b')]=_['intersection'](_0x161f6f[_0x27a8('0x37')],qs['fields'](_0x1c6c8c['query']['fields']));_0x2b3e00['attributes']=_0x2b3e00[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x2b3e00[_0x27a8('0x3b')]:_0x161f6f[_0x27a8('0x37')];if(!_0x1c6c8c['query']['hasOwnProperty'](_0x27a8('0x3f'))){_0x2b3e00[_0x27a8('0x25')]=qs['limit'](_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0x25')]);_0x2b3e00['offset']=qs['offset'](_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0x23')]);}_0x2b3e00[_0x27a8('0x61')]=qs[_0x27a8('0x40')](_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0x40')]);_0x2b3e00['where']=qs['filters'](_[_0x27a8('0x41')](_0x1c6c8c[_0x27a8('0x38')],_0x161f6f[_0x27a8('0x39')]));_0x2b3e00[_0x27a8('0x43')]['ChatWebsiteId']=_0x1d2664['id'];if(_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0x42')]){_0x2b3e00[_0x27a8('0x43')]=_[_0x27a8('0x44')](_0x2b3e00[_0x27a8('0x43')],{'$or':_[_0x27a8('0x31')](_0x2b3e00[_0x27a8('0x3b')],function(_0x22692f){var _0x346323={};_0x346323[_0x22692f]={'$like':'%'+_0x1c6c8c[_0x27a8('0x38')]['filter']+'%'};return _0x346323;})});}_0x2b3e00=_['merge']({},_0x2b3e00,_0x1c6c8c['options']);return db['ChatInteraction'][_0x27a8('0x26')]({'where':_0x2b3e00[_0x27a8('0x43')]})['then'](function(_0x280528){_0x2541e5[_0x27a8('0x26')]=_0x280528;if(_0x1c6c8c['query']['includeAll']){_0x2b3e00['include']=[{'model':db[_0x27a8('0x83')],'as':_0x27a8('0xe9'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x27a8('0xea'),_0x27a8('0xeb')],'required':![]},{'model':db[_0x27a8('0xec')],'as':'Tags','attributes':['id',_0x27a8('0x2d'),_0x27a8('0xed')],'where':_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0xee')]?{'id':_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0xee')]}:undefined,'required':_0x1c6c8c['query']['tag']?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x2b3e00);})['then'](function(_0x261aaf){_0x2541e5[_0x27a8('0x5d')]=_0x261aaf;return _0x2541e5;});}})['then'](respondWithFilteredResult(_0x3c4ab1,_0x2b3e00))[_0x27a8('0x1e')](handleError(_0x3c4ab1,null));};function iftimePromise(_0x2e593f,_0x4bae04){return respondWithRpcPromise(_0x27a8('0xef'),_0x27a8('0xf0'),{'command':_0x4bae04[_0x27a8('0xf1')]?util[_0x27a8('0xaa')]('iftime\x20%s,%s',_0x2e593f['interval'],_0x4bae04[_0x27a8('0xf1')]):util['format'](_0x27a8('0xf2'),_0x2e593f['interval'])},client9002)[_0x27a8('0x15')](function(_0x6c3943){var _0xb9ce30=_0x6c3943&&_0x6c3943['indexOf'](_0x27a8('0xf3'))>=0x0?!![]:![];logger[_0x27a8('0x16')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4bae04['id'],_0x2e593f['id'],_0x2e593f['interval'],_0xb9ce30?_0x27a8('0xf4'):_0x27a8('0xf5'),_0x4bae04[_0x27a8('0xf1')]?_0x4bae04[_0x27a8('0xf1')]:_0x27a8('0xf6'));return _0xb9ce30;})['catch'](function(_0x3f1f40){logger[_0x27a8('0x1c')](_0x27a8('0xf7'),_0x4bae04['id'],_0x2e593f['id'],_0x2e593f['interval'],util[_0x27a8('0xf8')](_0x3f1f40,{'showHidden':![],'depth':null}),_0x4bae04[_0x27a8('0xf1')]?_0x4bae04[_0x27a8('0xf1')]:_0x27a8('0xf6'));return![];});}exports[_0x27a8('0xf0')]=function(_0x4e6888,_0x32c4c8){var _0x4d1abd=0x0;var _0x20c8ff=0x0;var _0x766c78=![];var _0x45b2fb;var _0x27baf5;return db[_0x27a8('0x32')][_0x27a8('0x4c')]({'where':{'id':_0x4e6888['params']['id']},'include':[{'model':db['Interval'],'as':_0x27a8('0xf9'),'include':[{'model':db[_0x27a8('0xf9')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x27a8('0x15')](handleEntityNotFound(_0x32c4c8,null))[_0x27a8('0x15')](function(_0x467130){if(_0x467130){_0x45b2fb=_0x467130;return _0x467130[_0x27a8('0xfa')]({'raw':!![]});}})[_0x27a8('0x15')](function(_0x3fda45){if(_0x45b2fb){if(_0x3fda45){_0x27baf5=_0x3fda45;}}return require(_0x27a8('0x6d'))[_0x27a8('0x6e')]();})[_0x27a8('0x15')](function(_0x44dea6){if(_0x44dea6){_0x20c8ff=_0x44dea6['virtual'];_0x766c78=_0x44dea6['custom'];}})[_0x27a8('0x15')](function(){return db['ChatInteraction'][_0x27a8('0x26')]({'where':{'closed':![]}});})[_0x27a8('0x15')](function(_0x24f062){_0x4d1abd=_0x24f062;if(_0x20c8ff&&_0x24f062>_0x20c8ff){return db[_0x27a8('0xfb')][_0x27a8('0x5b')]({'where':{'id':0x1}})[_0x27a8('0x15')](function(_0x1c9d01){if(_0x1c9d01){_0x1c9d01['increment'](_0x27a8('0xfc'));}});}})[_0x27a8('0x15')](function(){if(_0x45b2fb[_0x27a8('0xf9')]&&_0x45b2fb[_0x27a8('0xf9')][_0x27a8('0xfd')]){var _0x3a57bf=[];for(var _0x12fc5b=0x0;_0x12fc5b<_0x45b2fb[_0x27a8('0xf9')][_0x27a8('0xfd')][_0x27a8('0x3d')];_0x12fc5b++){var _0x4c44e0=_0x45b2fb[_0x27a8('0xf9')][_0x27a8('0xfd')][_0x12fc5b][_0x27a8('0x2a')]({'plain':!![]});_0x3a57bf[_0x27a8('0xb5')](iftimePromise(_0x4c44e0,_0x45b2fb));}return BPromise[_0x27a8('0xfe')](_0x3a57bf)[_0x27a8('0x15')](function(_0x4da9f4){return _[_0x27a8('0xff')](_0x4da9f4);});}else{return!![];}})[_0x27a8('0x15')](function(_0x22dcc7){var _0x2df73d=fs['readFileSync'](path[_0x27a8('0x6b')](config['root'],_0x27a8('0x100')),_0x27a8('0xc9'));var _0x10c754={'remote':_0x45b2fb[_0x27a8('0x101')],'query':querystring[_0x27a8('0x1b')](_[_0x27a8('0x44')](_0x45b2fb['get']({'plain':!![]}),{'customerIp':_0x4e6888['headers'][_0x27a8('0x9f')]||_0x4e6888['headers']['x-real-ip']||_0x4e6888['connection']['remoteAddress']||_0x4e6888['ip'],'referer':_0x4e6888[_0x27a8('0x80')]['referer'],'openedInteractions':_0x4d1abd,'maxInteractions':_0x20c8ff,'virtual':_0x766c78['virtual'],'online':_0x22dcc7,'custom':_0x766c78}))[_0x27a8('0x102')](/'/g,'\x5c\x27')};_0x32c4c8[_0x27a8('0x2e')](ejs[_0x27a8('0xca')](Mustache[_0x27a8('0xca')](_0x2df73d,_0x10c754),{'proactiveActions':_0x27baf5,'alignment':_0x45b2fb[_0x27a8('0x103')],'verticalAlignment':_0x45b2fb['verticalAlignment'],'div_color':_0x45b2fb[_0x27a8('0xed')],'labelText':_0x45b2fb[_0x27a8('0x104')],'text_color':_0x45b2fb[_0x27a8('0x105')],'text_button_color':_0x45b2fb[_0x27a8('0x106')],'button_color':_0x45b2fb[_0x27a8('0x107')],'background_color':_0x45b2fb[_0x27a8('0x108')],'hideWhenOffline':_0x45b2fb['hideWhenOffline'],'interval':_0x45b2fb[_0x27a8('0x109')]}));})[_0x27a8('0x1e')](handleError(_0x32c4c8,null));};exports['addApplications']=function(_0xd5fbb9,_0x3c54d4){var _0x395a8d=_0xd5fbb9[_0x27a8('0x4a')]['id'];var _0x613c6e=_0xd5fbb9[_0x27a8('0x4e')];var _0x265ea9=0xc8;var _0x2f7065=null;return db['sequelize'][_0x27a8('0xd2')]({'isolationLevel':db[_0x27a8('0x10a')][_0x27a8('0x10b')][_0x27a8('0x10c')][_0x27a8('0x10d')]},function(_0x2db188){return db['ChatWebsite'][_0x27a8('0x5b')]({'where':{'id':_0x395a8d},'transaction':_0x2db188})[_0x27a8('0x15')](function(_0x5dbb93){if(_0x5dbb93){return db[_0x27a8('0x94')][_0x27a8('0x29')]({'where':{'ChatWebsiteId':_0x395a8d},'transaction':_0x2db188})[_0x27a8('0x15')](function(){var _0x9d3337=_[_0x27a8('0x31')](_0x613c6e,function(_0xf38248){_0xf38248[_0x27a8('0x58')]=_0x395a8d;return _0xf38248;});return db['ChatApplication'][_0x27a8('0x10e')](_0x9d3337,{'transaction':_0x2db188});});}else{_0x265ea9=0x194;_0x2f7065=[];}});})[_0x27a8('0x15')](function(){if(_0x265ea9!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x395a8d},'order':_0x27a8('0x9a')})[_0x27a8('0x15')](function(_0x2bc8a3){_0x2f7065=_0x2bc8a3;});}})[_0x27a8('0x1e')](function(_0xd6ee99){_0x265ea9=0x1f4;logger['error'](_0xd6ee99['stack']);if(_0xd6ee99[_0x27a8('0x2d')]){delete _0xd6ee99[_0x27a8('0x2d')];}_0x2f7065=_0xd6ee99;})[_0x27a8('0x10f')](function(){if(_0x2f7065===null){_0x3c54d4[_0x27a8('0x1f')](_0x265ea9);}else{if(_0x265ea9===0x1f4){_0x3c54d4[_0x27a8('0x20')](_0x265ea9)[_0x27a8('0x2e')](_0x2f7065);}else{_0x3c54d4[_0x27a8('0x20')](_0x265ea9)[_0x27a8('0x22')](_0x2f7065);}}});};exports[_0x27a8('0x110')]=function(_0x6ea4ae,_0x59d4fe){var _0x32e56f={};var _0x20b9dd={};var _0x5c879d;var _0x4ef215;return db[_0x27a8('0x32')]['findOne']({'where':{'id':_0x6ea4ae[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x59d4fe,null))[_0x27a8('0x15')](function(_0x1ddac9){if(_0x1ddac9){_0x5c879d=_0x1ddac9;_0x20b9dd[_0x27a8('0x37')]=_[_0x27a8('0x4b')](db['ChatApplication']['rawAttributes']);_0x20b9dd[_0x27a8('0x38')]=_[_0x27a8('0x4b')](_0x6ea4ae['query']);_0x20b9dd[_0x27a8('0x39')]=_['intersection'](_0x20b9dd[_0x27a8('0x37')],_0x20b9dd['query']);_0x32e56f[_0x27a8('0x3b')]=_[_0x27a8('0x3a')](_0x20b9dd[_0x27a8('0x37')],qs[_0x27a8('0x3c')](_0x6ea4ae[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x32e56f[_0x27a8('0x3b')]=_0x32e56f[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x32e56f['attributes']:_0x20b9dd[_0x27a8('0x37')];_0x32e56f[_0x27a8('0x61')]=qs[_0x27a8('0x40')](_0x6ea4ae[_0x27a8('0x38')]['sort']);_0x32e56f['where']=qs['filters'](_[_0x27a8('0x41')](_0x6ea4ae[_0x27a8('0x38')],_0x20b9dd[_0x27a8('0x39')]));if(_0x6ea4ae[_0x27a8('0x38')][_0x27a8('0x42')]){_0x32e56f['where']=_['merge'](_0x32e56f[_0x27a8('0x43')],{'$or':_[_0x27a8('0x31')](_0x32e56f[_0x27a8('0x3b')],function(_0x5e82be){var _0x227ac0={};_0x227ac0[_0x5e82be]={'$like':'%'+_0x6ea4ae[_0x27a8('0x38')]['filter']+'%'};return _0x227ac0;})});}_0x32e56f=_[_0x27a8('0x44')]({},_0x32e56f,_0x6ea4ae['options']);return _0x5c879d[_0x27a8('0x110')](_0x32e56f);}})[_0x27a8('0x15')](function(_0x17d410){if(_0x17d410){_0x4ef215=_0x17d410['length'];if(!_0x6ea4ae['query'][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x32e56f[_0x27a8('0x25')]=qs['limit'](_0x6ea4ae[_0x27a8('0x38')]['limit']);_0x32e56f[_0x27a8('0x23')]=qs[_0x27a8('0x23')](_0x6ea4ae[_0x27a8('0x38')][_0x27a8('0x23')]);}return _0x5c879d['getApplications'](_0x32e56f);}})[_0x27a8('0x15')](function(_0x14fce6){if(_0x14fce6){return _0x14fce6?{'count':_0x4ef215,'rows':_0x14fce6}:null;}})[_0x27a8('0x15')](respondWithResult(_0x59d4fe,null))[_0x27a8('0x1e')](handleError(_0x59d4fe,null));};exports[_0x27a8('0x111')]=function(_0x2b4cac,_0x245de7){return db[_0x27a8('0x112')][_0x27a8('0x4c')]({'where':{'id':_0x2b4cac[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x245de7,null))['then'](function(_0x644328){if(_0x644328){return _0x644328['addProactiveActions'](_0x2b4cac[_0x27a8('0x4e')]['ids'],_['omit'](_0x2b4cac[_0x27a8('0x4e')],['ids','id'])||{});}})[_0x27a8('0x15')](respondWithResult(_0x245de7,null))['catch'](handleError(_0x245de7,null));};exports['getProactiveActions']=function(_0x306d58,_0x2a6e64){var _0x40ddbc={};var _0x31f722={};var _0x497948;var _0x472fbf;return db[_0x27a8('0x32')][_0x27a8('0x5b')]({'where':{'id':_0x306d58[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x2a6e64,null))[_0x27a8('0x15')](function(_0x8d9d90){if(_0x8d9d90){_0x497948=_0x8d9d90;_0x31f722[_0x27a8('0x37')]=_['keys'](db['ChatProactiveAction'][_0x27a8('0x33')]);_0x31f722[_0x27a8('0x38')]=_['keys'](_0x306d58[_0x27a8('0x38')]);_0x31f722[_0x27a8('0x39')]=_[_0x27a8('0x3a')](_0x31f722[_0x27a8('0x37')],_0x31f722[_0x27a8('0x38')]);_0x40ddbc[_0x27a8('0x3b')]=_['intersection'](_0x31f722['model'],qs['fields'](_0x306d58[_0x27a8('0x38')]['fields']));_0x40ddbc[_0x27a8('0x3b')]=_0x40ddbc[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x40ddbc[_0x27a8('0x3b')]:_0x31f722[_0x27a8('0x37')];_0x40ddbc['order']=qs[_0x27a8('0x40')](_0x306d58[_0x27a8('0x38')][_0x27a8('0x40')]);_0x40ddbc['where']=qs['filters'](_[_0x27a8('0x41')](_0x306d58[_0x27a8('0x38')],_0x31f722[_0x27a8('0x39')]));if(_0x306d58[_0x27a8('0x38')][_0x27a8('0x42')]){_0x40ddbc[_0x27a8('0x43')]=_[_0x27a8('0x44')](_0x40ddbc[_0x27a8('0x43')],{'$or':_[_0x27a8('0x31')](_0x40ddbc[_0x27a8('0x3b')],function(_0xc5dfa9){var _0x1e2921={};_0x1e2921[_0xc5dfa9]={'$like':'%'+_0x306d58[_0x27a8('0x38')]['filter']+'%'};return _0x1e2921;})});}_0x40ddbc=_[_0x27a8('0x44')]({},_0x40ddbc,_0x306d58[_0x27a8('0x46')]);return _0x497948[_0x27a8('0xfa')](_0x40ddbc);}})[_0x27a8('0x15')](function(_0x306f19){if(_0x306f19){_0x472fbf=_0x306f19[_0x27a8('0x3d')];if(!_0x306d58[_0x27a8('0x38')][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x40ddbc[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x306d58[_0x27a8('0x38')][_0x27a8('0x25')]);_0x40ddbc[_0x27a8('0x23')]=qs[_0x27a8('0x23')](_0x306d58[_0x27a8('0x38')][_0x27a8('0x23')]);}return _0x497948[_0x27a8('0xfa')](_0x40ddbc);}})[_0x27a8('0x15')](function(_0x3442a7){if(_0x3442a7){return _0x3442a7?{'count':_0x472fbf,'rows':_0x3442a7}:null;}})[_0x27a8('0x15')](respondWithResult(_0x2a6e64,null))[_0x27a8('0x1e')](handleError(_0x2a6e64,null));};exports[_0x27a8('0x113')]=function(_0x1b0a3b,_0x5b7b4c){var _0x168439=_0x1b0a3b[_0x27a8('0x38')]['online']===_0x27a8('0x114')?_0x27a8('0x115'):_0x27a8('0x116');return db[_0x27a8('0x32')]['find']({'attributes':['id',_0x168439],'where':{'id':_0x1b0a3b[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x5b7b4c,null))[_0x27a8('0x15')](function(_0x97777a){if(_0x97777a){var _0x4d4ecf=_0x97777a[_0x168439];var _0x4b3552=_0x4d4ecf&&_0x4d4ecf[_0x27a8('0x117')]?_0x4d4ecf[_0x27a8('0x117')]:[];_0x5b7b4c[_0x27a8('0x2e')]({'fromKey':_[_0x27a8('0x70')](_0x4d4ecf['fromKey'])?undefined:_0x4d4ecf[_0x27a8('0x118')],'count':_0x4b3552[_0x27a8('0x3d')],'rows':_0x4b3552});}})[_0x27a8('0x1e')](handleError(_0x5b7b4c,null));};exports['getOfflineMessages']=function(_0x25dc08,_0x7740f5){var _0x3a2083={'raw':![],'where':{}};var _0x1d20d2={};var _0x24d204={'count':0x0,'rows':[]};return db[_0x27a8('0x32')][_0x27a8('0x5b')]({'where':{'id':_0x25dc08[_0x27a8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x7740f5,null))[_0x27a8('0x15')](function(_0x170cf9){if(_0x170cf9){_0x1d20d2[_0x27a8('0x37')]=_[_0x27a8('0x4b')](db['ChatOfflineMessage'][_0x27a8('0x33')]);_0x1d20d2[_0x27a8('0x38')]=_[_0x27a8('0x4b')](_0x25dc08[_0x27a8('0x38')]);_0x1d20d2['filters']=_[_0x27a8('0x3a')](_0x1d20d2[_0x27a8('0x37')],_0x1d20d2[_0x27a8('0x38')]);_0x3a2083['attributes']=_[_0x27a8('0x3a')](_0x1d20d2[_0x27a8('0x37')],qs[_0x27a8('0x3c')](_0x25dc08[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x3a2083['attributes']=_0x3a2083[_0x27a8('0x3b')]['length']?_0x3a2083[_0x27a8('0x3b')]:_0x1d20d2[_0x27a8('0x37')];if(!_0x25dc08[_0x27a8('0x38')][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x3a2083[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x25dc08[_0x27a8('0x38')][_0x27a8('0x25')]);_0x3a2083[_0x27a8('0x23')]=qs[_0x27a8('0x23')](_0x25dc08['query']['offset']);}_0x3a2083['order']=qs[_0x27a8('0x40')](_0x25dc08[_0x27a8('0x38')]['sort']);_0x3a2083['where']=qs['filters'](_[_0x27a8('0x41')](_0x25dc08[_0x27a8('0x38')],_0x1d20d2['filters']));_0x3a2083['where'][_0x27a8('0x58')]=_0x170cf9['id'];if(_0x25dc08[_0x27a8('0x38')][_0x27a8('0x42')]){_0x3a2083[_0x27a8('0x43')]=_['merge'](_0x3a2083[_0x27a8('0x43')],{'$or':_[_0x27a8('0x31')](_0x3a2083[_0x27a8('0x3b')],function(_0x31b13e){var _0x3b32f8={};_0x3b32f8[_0x31b13e]={'$like':'%'+_0x25dc08[_0x27a8('0x38')]['filter']+'%'};return _0x3b32f8;})});}_0x3a2083=_[_0x27a8('0x44')]({},_0x3a2083,_0x25dc08['options']);return db[_0x27a8('0x119')][_0x27a8('0x26')]({'where':_0x3a2083[_0x27a8('0x43')]})[_0x27a8('0x15')](function(_0x5a8976){_0x24d204['count']=_0x5a8976;if(_0x25dc08[_0x27a8('0x38')][_0x27a8('0x47')]){_0x3a2083[_0x27a8('0x5c')]=[{'all':!![]}];}else{_0x3a2083[_0x27a8('0x5c')]=[{'model':db[_0x27a8('0x83')],'as':_0x27a8('0xe9'),'required':![]},{'model':db[_0x27a8('0xd3')],'as':_0x27a8('0x11a'),'required':![]}];}return db[_0x27a8('0x119')]['findAll'](_0x3a2083);})[_0x27a8('0x15')](function(_0x13e046){_0x24d204[_0x27a8('0x5d')]=_0x13e046;return _0x24d204;});}})[_0x27a8('0x15')](respondWithFilteredResult(_0x7740f5,_0x3a2083))[_0x27a8('0x1e')](handleError(_0x7740f5,null));};exports['addAgents']=function(_0x3d1c19,_0x5d8ce9){return db[_0x27a8('0x32')]['find']({'where':{'id':_0x3d1c19[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x5d8ce9,null))['then'](function(_0x13ec03){if(_0x13ec03){return _0x13ec03['addAgents'](_0x3d1c19[_0x27a8('0x4e')][_0x27a8('0xe7')],_[_0x27a8('0x11b')](_0x3d1c19[_0x27a8('0x4e')],['ids','id'])||{})[_0x27a8('0xb2')](function(_0x495bbd){for(var _0x1368cd=0x0;_0x1368cd<_0x3d1c19[_0x27a8('0x4e')][_0x27a8('0xe7')][_0x27a8('0x3d')];_0x1368cd+=0x1){socket['emit'](_0x27a8('0x11c'),{'UserId':Number(_0x3d1c19['body'][_0x27a8('0xe7')][_0x1368cd]),'ChatWebsiteId':Number(_0x3d1c19[_0x27a8('0x4a')]['id'])});}return _0x495bbd;});}})[_0x27a8('0x15')](respondWithResult(_0x5d8ce9,null))[_0x27a8('0x1e')](handleError(_0x5d8ce9,null));};exports['removeAgents']=function(_0x2704b2,_0x10e447){return db['ChatWebsite'][_0x27a8('0x4c')]({'where':{'id':_0x2704b2[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x10e447,null))[_0x27a8('0x15')](function(_0xc00666){if(_0xc00666){return _0xc00666['removeAgents'](_0x2704b2['query'][_0x27a8('0xe7')])['then'](function(){if(_[_0x27a8('0x11d')](_0x2704b2[_0x27a8('0x38')][_0x27a8('0xe7')])){for(var _0xcb15b9=0x0;_0xcb15b9<_0x2704b2[_0x27a8('0x38')]['ids'][_0x27a8('0x3d')];_0xcb15b9+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x2704b2['query']['ids'][_0xcb15b9]),'ChatWebsiteId':Number(_0x2704b2[_0x27a8('0x4a')]['id'])});}}else{socket[_0x27a8('0x11e')](_0x27a8('0x11f'),{'UserId':Number(_0x2704b2[_0x27a8('0x38')][_0x27a8('0xe7')]),'ChatWebsiteId':Number(_0x2704b2[_0x27a8('0x4a')]['id'])});}});}})[_0x27a8('0x15')](respondWithStatusCode(_0x10e447,null))['catch'](handleError(_0x10e447,null));};exports[_0x27a8('0x120')]=function(_0x47307c,_0x11026e){var _0x46f5d3={};var _0x555d59={};var _0x52daa9;var _0x19bbaa;return db[_0x27a8('0x32')][_0x27a8('0x5b')]({'where':{'id':_0x47307c['params']['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x11026e,null))['then'](function(_0x22bd18){if(_0x22bd18){_0x52daa9=_0x22bd18;_0x555d59['model']=_[_0x27a8('0x4b')](db[_0x27a8('0x121')][_0x27a8('0x33')]);_0x555d59[_0x27a8('0x38')]=_[_0x27a8('0x4b')](_0x47307c[_0x27a8('0x38')]);_0x555d59[_0x27a8('0x39')]=_[_0x27a8('0x3a')](_0x555d59[_0x27a8('0x37')],_0x555d59[_0x27a8('0x38')]);_0x46f5d3[_0x27a8('0x3b')]=_[_0x27a8('0x3a')](_0x555d59[_0x27a8('0x37')],qs[_0x27a8('0x3c')](_0x47307c[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x46f5d3['attributes']=_0x46f5d3[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x46f5d3[_0x27a8('0x3b')]:_0x555d59[_0x27a8('0x37')];_0x46f5d3['order']=qs['sort'](_0x47307c[_0x27a8('0x38')][_0x27a8('0x40')]);_0x46f5d3['where']=qs['filters'](_[_0x27a8('0x41')](_0x47307c[_0x27a8('0x38')],_0x555d59[_0x27a8('0x39')]));if(_0x47307c['query'][_0x27a8('0x42')]){_0x46f5d3[_0x27a8('0x43')]=_[_0x27a8('0x44')](_0x46f5d3[_0x27a8('0x43')],{'$or':_['map'](_0x46f5d3['attributes'],function(_0xd15ec9){var _0x3a7d58={};_0x3a7d58[_0xd15ec9]={'$like':'%'+_0x47307c['query'][_0x27a8('0x42')]+'%'};return _0x3a7d58;})});}_0x46f5d3=_[_0x27a8('0x44')]({},_0x46f5d3,_0x47307c[_0x27a8('0x46')]);return _0x52daa9[_0x27a8('0x120')](_0x46f5d3);}})['then'](function(_0x337722){if(_0x337722){_0x19bbaa=_0x337722['length'];if(!_0x47307c[_0x27a8('0x38')][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x46f5d3[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x47307c[_0x27a8('0x38')]['limit']);_0x46f5d3['offset']=qs['offset'](_0x47307c[_0x27a8('0x38')][_0x27a8('0x23')]);}return _0x52daa9[_0x27a8('0x120')](_0x46f5d3);}})[_0x27a8('0x15')](function(_0x8c1c0a){if(_0x8c1c0a){return _0x8c1c0a?{'count':_0x19bbaa,'rows':_0x8c1c0a}:null;}})[_0x27a8('0x15')](respondWithResult(_0x11026e,null))[_0x27a8('0x1e')](handleError(_0x11026e,null));};
\ No newline at end of file
+var _0x812b=['toPairsIn','mapValues','email','Chat','MailAccountId','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','internal','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','getLicense','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','replace','verticalAlignment','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','transaction','Transaction','ISOLATION_LEVELS','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','html-to-text','http','client','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','end','json','undefined','limit','count','offset','status','set','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','ChatWebsiteId','findOne','Disposition','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','order','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','isNil','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','user-agent','getResult','chat','no\x20available\x20attributes','difference','updatedAt','createdAt','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','headers','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','ChatInteraction','threadId','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','UserId','User','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','offline','files','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','offlineMessageSubject','openNewInteraction','subjectOffline'];(function(_0x561b0d,_0x2de288){var _0x4e4bcf=function(_0x13834f){while(--_0x13834f){_0x561b0d['push'](_0x561b0d['shift']());}};_0x4e4bcf(++_0x2de288);}(_0x812b,0x17c));var _0xb812=function(_0xbda849,_0x2dcb1a){_0xbda849=_0xbda849-0x0;var _0x2d3e9d=_0x812b[_0xbda849];return _0x2d3e9d;};'use strict';var BPromise=require(_0xb812('0x0'));var Mustache=require(_0xb812('0x1'));var util=require(_0xb812('0x2'));var path=require(_0xb812('0x3'));var ejs=require(_0xb812('0x4'));var fs=require('fs');var fs_extra=require(_0xb812('0x5'));var _=require(_0xb812('0x6'));var querystring=require(_0xb812('0x7'));var Redis=require(_0xb812('0x8'));var qs=require(_0xb812('0x9'));var logger=require(_0xb812('0xa'))('api');var config=require('../../config/environment');var db=require(_0xb812('0xb'))['db'];config[_0xb812('0xc')]=_[_0xb812('0xd')](config[_0xb812('0xc')],{'host':_0xb812('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb812('0xc')]));require(_0xb812('0xf'))[_0xb812('0x10')](socket);var htmlToText=require(_0xb812('0x11'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb812('0x12')]({'port':0x232c});var client9002=jayson['client'][_0xb812('0x12')]({'port':0x232a});var client9003=jayson['client'][_0xb812('0x12')]({'port':0x232b});var client9001=jayson[_0xb812('0x13')][_0xb812('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x1624ca,_0x2f571a,_0xf51b5c,_0x2709de){return new BPromise(function(_0x2c5847,_0x544a6c){var _0x1164e8=_0x2709de||client;return _0x1164e8[_0xb812('0x14')](_0x1624ca,_0xf51b5c)[_0xb812('0x15')](function(_0x27a446){logger[_0xb812('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x2f571a,'request\x20sent');logger[_0xb812('0x17')](_0xb812('0x18'),_0x2f571a,_0xb812('0x19'),JSON[_0xb812('0x1a')](_0x27a446));if(_0x27a446[_0xb812('0x1b')]){if(_0x27a446[_0xb812('0x1b')][_0xb812('0x1c')]===0x1f4){logger[_0xb812('0x1b')](_0xb812('0x1d'),_0x2f571a,_0x27a446[_0xb812('0x1b')][_0xb812('0x1e')]);return _0x544a6c(_0x27a446['error']['message']);}logger[_0xb812('0x1b')](_0xb812('0x1d'),_0x2f571a,_0x27a446[_0xb812('0x1b')][_0xb812('0x1e')]);return _0x2c5847(_0x27a446[_0xb812('0x1b')][_0xb812('0x1e')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2f571a,_0xb812('0x19'));_0x2c5847(_0x27a446[_0xb812('0x1f')][_0xb812('0x1e')]);}})[_0xb812('0x20')](function(_0x2d05e1){logger[_0xb812('0x1b')](_0xb812('0x1d'),_0x2f571a,_0x2d05e1);_0x544a6c(_0x2d05e1);});});}function respondWithStatusCode(_0x1d955e,_0x294222){_0x294222=_0x294222||0xcc;return function(_0x30121a){if(_0x30121a){return _0x1d955e['sendStatus'](_0x294222);}return _0x1d955e['status'](_0x294222)[_0xb812('0x21')]();};}function respondWithResult(_0x42298b,_0x1f28ab){_0x1f28ab=_0x1f28ab||0xc8;return function(_0x547c0f){if(_0x547c0f){return _0x42298b['status'](_0x1f28ab)[_0xb812('0x22')](_0x547c0f);}};}function respondWithFilteredResult(_0x3381a0,_0x452f75){return function(_0x39f3ff){if(_0x39f3ff){var _0x1ed76e=typeof _0x452f75['offset']===_0xb812('0x23')&&typeof _0x452f75[_0xb812('0x24')]===_0xb812('0x23');var _0x4b340a=_0x39f3ff[_0xb812('0x25')];var _0x5a75de=_0x1ed76e?0x0:_0x452f75[_0xb812('0x26')];var _0x1ac24f=_0x1ed76e?_0x39f3ff[_0xb812('0x25')]:_0x452f75['offset']+_0x452f75[_0xb812('0x24')];var _0x21ed16;if(_0x1ac24f>=_0x4b340a){_0x1ac24f=_0x4b340a;_0x21ed16=0xc8;}else{_0x21ed16=0xce;}_0x3381a0[_0xb812('0x27')](_0x21ed16);return _0x3381a0[_0xb812('0x28')]('Content-Range',_0x5a75de+'-'+_0x1ac24f+'/'+_0x4b340a)[_0xb812('0x22')](_0x39f3ff);}return null;};}function saveUpdates(_0x2ac7e4){return function(_0x2c716b){if(_0x2c716b){return _0x2c716b['update'](_0x2ac7e4)[_0xb812('0x15')](function(_0x5cadb3){return _0x5cadb3;});}return null;};}function removeEntity(_0x31f5f7){return function(_0x5ea3fd){if(_0x5ea3fd){return _0x5ea3fd[_0xb812('0x29')]()['then'](function(){var _0x1a23f1=_0x5ea3fd[_0xb812('0x2a')]({'plain':!![]});var _0x1ecc28='ChatWebsites';return db[_0xb812('0x2b')][_0xb812('0x29')]({'where':{'type':_0x1ecc28,'resourceId':_0x1a23f1['id']}})[_0xb812('0x15')](function(){return _0x5ea3fd;});})['then'](function(){_0x31f5f7[_0xb812('0x27')](0xcc)[_0xb812('0x21')]();});}};}function handleEntityNotFound(_0x5804c8){return function(_0x47732c){if(!_0x47732c){_0x5804c8['sendStatus'](0x194);}return _0x47732c;};}function handleError(_0x189729,_0x4f9974){_0x4f9974=_0x4f9974||0x1f4;return function(_0x6e32cd){logger[_0xb812('0x1b')](_0x6e32cd[_0xb812('0x2c')]);if(_0x6e32cd[_0xb812('0x2d')]){delete _0x6e32cd['name'];}_0x189729[_0xb812('0x27')](_0x4f9974)[_0xb812('0x2e')](_0x6e32cd);};}exports[_0xb812('0x2f')]=function(_0x25e47c,_0xcc912){var _0x4961d3={'include':[{'model':db[_0xb812('0x30')],'as':_0xb812('0x31')}]},_0x5d64d8={},_0x4fcf97={'count':0x0,'rows':[]};var _0x420123=_[_0xb812('0x32')](db[_0xb812('0x33')]['rawAttributes'],function(_0x32e02f){return{'name':_0x32e02f['fieldName'],'type':_0x32e02f['type'][_0xb812('0x34')]};});_0x5d64d8[_0xb812('0x35')]=_[_0xb812('0x32')](_0x420123,_0xb812('0x2d'));_0x5d64d8['query']=_[_0xb812('0x36')](_0x25e47c[_0xb812('0x37')]);_0x5d64d8[_0xb812('0x38')]=_['intersection'](_0x5d64d8[_0xb812('0x35')],_0x5d64d8[_0xb812('0x37')]);_0x4961d3['attributes']=_[_0xb812('0x39')](_0x5d64d8[_0xb812('0x35')],qs[_0xb812('0x3a')](_0x25e47c['query'][_0xb812('0x3a')]));_0x4961d3[_0xb812('0x3b')]=_0x4961d3[_0xb812('0x3b')][_0xb812('0x3c')]?_0x4961d3['attributes']:_0x5d64d8['model'];if(!_0x25e47c[_0xb812('0x37')][_0xb812('0x3d')](_0xb812('0x3e'))){_0x4961d3[_0xb812('0x24')]=qs['limit'](_0x25e47c[_0xb812('0x37')]['limit']);_0x4961d3[_0xb812('0x26')]=qs[_0xb812('0x26')](_0x25e47c[_0xb812('0x37')][_0xb812('0x26')]);}_0x4961d3['order']=qs[_0xb812('0x3f')](_0x25e47c[_0xb812('0x37')][_0xb812('0x3f')]);_0x4961d3[_0xb812('0x40')]=qs[_0xb812('0x38')](_[_0xb812('0x41')](_0x25e47c[_0xb812('0x37')],_0x5d64d8[_0xb812('0x38')]),_0x420123);if(_0x25e47c['query'][_0xb812('0x42')]){_0x4961d3[_0xb812('0x40')]=_['merge'](_0x4961d3[_0xb812('0x40')],{'$or':_[_0xb812('0x32')](_0x420123,function(_0x3ca266){if(_0x3ca266[_0xb812('0x43')]!==_0xb812('0x44')){var _0x3555e4={};_0x3555e4[_0x3ca266[_0xb812('0x2d')]]={'$like':'%'+_0x25e47c[_0xb812('0x37')][_0xb812('0x42')]+'%'};return _0x3555e4;}})});}_0x4961d3=_[_0xb812('0x45')]({},_0x4961d3,_0x25e47c[_0xb812('0x46')]);var _0x5076fb={'where':_0x4961d3[_0xb812('0x40')]};return db[_0xb812('0x33')]['count'](_0x5076fb)[_0xb812('0x15')](function(_0x1613e5){_0x4fcf97[_0xb812('0x25')]=_0x1613e5;if(_0x25e47c[_0xb812('0x37')][_0xb812('0x47')]){_0x4961d3[_0xb812('0x48')]=[{'all':!![]}];}return db[_0xb812('0x33')][_0xb812('0x49')](_0x4961d3);})['then'](function(_0x265ea3){_0x4fcf97[_0xb812('0x4a')]=_0x265ea3;return _0x4fcf97;})[_0xb812('0x15')](respondWithFilteredResult(_0xcc912,_0x4961d3))[_0xb812('0x20')](handleError(_0xcc912,null));};exports[_0xb812('0x4b')]=function(_0x439ade,_0x519bd6){var _0xa7968a={'raw':![],'where':{'id':_0x439ade['params']['id']},'include':[{'model':db[_0xb812('0x30')],'as':_0xb812('0x31')}]},_0x1e05aa={};_0x1e05aa['model']=_[_0xb812('0x36')](db['ChatWebsite'][_0xb812('0x4c')]);_0x1e05aa['query']=_[_0xb812('0x36')](_0x439ade['query']);_0x1e05aa[_0xb812('0x38')]=_[_0xb812('0x39')](_0x1e05aa[_0xb812('0x35')],_0x1e05aa[_0xb812('0x37')]);_0xa7968a[_0xb812('0x3b')]=_[_0xb812('0x39')](_0x1e05aa[_0xb812('0x35')],qs[_0xb812('0x3a')](_0x439ade[_0xb812('0x37')]['fields']));_0xa7968a[_0xb812('0x3b')]=_0xa7968a[_0xb812('0x3b')]['length']?_0xa7968a[_0xb812('0x3b')]:_0x1e05aa['model'];if(_0x439ade[_0xb812('0x37')][_0xb812('0x47')]){_0xa7968a[_0xb812('0x48')]=[{'all':!![]}];}_0xa7968a=_[_0xb812('0x45')]({},_0xa7968a,_0x439ade[_0xb812('0x46')]);return db[_0xb812('0x33')][_0xb812('0x4d')](_0xa7968a)[_0xb812('0x15')](handleEntityNotFound(_0x519bd6,null))[_0xb812('0x15')](respondWithResult(_0x519bd6,null))[_0xb812('0x20')](handleError(_0x519bd6,null));};exports['create']=function(_0x5aff41,_0x6fe28c){return db[_0xb812('0x33')]['create'](_0x5aff41[_0xb812('0x4e')],{})[_0xb812('0x15')](function(_0x375351){var _0x1e224f=_0x5aff41[_0xb812('0x4f')]['get']({'plain':!![]});if(!_0x1e224f)throw new Error(_0xb812('0x50'));if(_0x1e224f[_0xb812('0x51')]===_0xb812('0x4f')){var _0x98752=_0x375351[_0xb812('0x2a')]({'plain':!![]});var _0xb10bfc=_0xb812('0x52');return db[_0xb812('0x53')][_0xb812('0x4d')]({'where':{'name':_0xb10bfc,'userProfileId':_0x1e224f[_0xb812('0x54')]},'raw':!![]})['then'](function(_0x2f3312){if(_0x2f3312&&_0x2f3312[_0xb812('0x55')]===0x0){return db['UserProfileResource'][_0xb812('0x56')]({'name':_0x98752[_0xb812('0x2d')],'resourceId':_0x98752['id'],'type':_0x2f3312[_0xb812('0x2d')],'sectionId':_0x2f3312['id']},{})[_0xb812('0x15')](function(){return _0x375351;});}else{return _0x375351;}})[_0xb812('0x20')](function(_0x3c5253){logger['error'](_0xb812('0x57'),_0x3c5253);throw _0x3c5253;});}return _0x375351;})[_0xb812('0x15')](respondWithResult(_0x6fe28c,0xc9))['catch'](handleError(_0x6fe28c,null));};exports[_0xb812('0x58')]=function(_0x560d18,_0x4d7efe){if(_0x560d18['body']['id']){delete _0x560d18[_0xb812('0x4e')]['id'];}return db['ChatWebsite'][_0xb812('0x4d')]({'where':{'id':_0x560d18[_0xb812('0x59')]['id']},'include':[{'model':db[_0xb812('0x30')],'as':_0xb812('0x31')}]})[_0xb812('0x15')](handleEntityNotFound(_0x4d7efe,null))['then'](saveUpdates(_0x560d18[_0xb812('0x4e')],null))[_0xb812('0x15')](respondWithResult(_0x4d7efe,null))[_0xb812('0x20')](handleError(_0x4d7efe,null));};exports[_0xb812('0x29')]=function(_0x37eb6d,_0x58717c){return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x37eb6d['params']['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x58717c,null))[_0xb812('0x15')](removeEntity(_0x58717c,null))[_0xb812('0x20')](handleError(_0x58717c,null));};exports[_0xb812('0x5a')]=function(_0x3a8d21,_0x4d55cb){return db[_0xb812('0x33')][_0xb812('0x5a')]()[_0xb812('0x15')](respondWithResult(_0x4d55cb,null))[_0xb812('0x20')](handleError(_0x4d55cb,null));};exports[_0xb812('0x5b')]=function(_0x1a0a8d,_0xbf2242){if(_0x1a0a8d[_0xb812('0x4e')]['id']){delete _0x1a0a8d[_0xb812('0x4e')]['id'];}return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x1a0a8d[_0xb812('0x59')]['id']}})['then'](handleEntityNotFound(_0xbf2242,null))['then'](function(_0xf7e82c){if(_0xf7e82c){_0x1a0a8d[_0xb812('0x4e')][_0xb812('0x5c')]=_0xf7e82c['id'];return db['Disposition'][_0xb812('0x56')](_0x1a0a8d[_0xb812('0x4e')]);}})[_0xb812('0x15')](respondWithResult(_0xbf2242,null))[_0xb812('0x20')](handleError(_0xbf2242,null));};exports['getDispositions']=function(_0x55afc0,_0x16967a){var _0x1df794={'raw':![],'where':{}};var _0x54a066={};var _0xf1c82a={'count':0x0,'rows':[]};return db[_0xb812('0x33')][_0xb812('0x5d')]({'where':{'id':_0x55afc0[_0xb812('0x59')]['id']}})['then'](handleEntityNotFound(_0x16967a,null))['then'](function(_0x3da0b4){if(_0x3da0b4){_0x54a066['model']=_[_0xb812('0x36')](db[_0xb812('0x5e')]['rawAttributes']);_0x54a066[_0xb812('0x37')]=_[_0xb812('0x36')](_0x55afc0['query']);_0x54a066['filters']=_[_0xb812('0x39')](_0x54a066[_0xb812('0x35')],_0x54a066['query']);_0x1df794[_0xb812('0x3b')]=_[_0xb812('0x39')](_0x54a066['model'],qs[_0xb812('0x3a')](_0x55afc0['query']['fields']));_0x1df794[_0xb812('0x3b')]=_0x1df794[_0xb812('0x3b')][_0xb812('0x3c')]?_0x1df794[_0xb812('0x3b')]:_0x54a066[_0xb812('0x35')];if(!_0x55afc0[_0xb812('0x37')][_0xb812('0x3d')](_0xb812('0x3e'))){_0x1df794[_0xb812('0x24')]=qs[_0xb812('0x24')](_0x55afc0[_0xb812('0x37')][_0xb812('0x24')]);_0x1df794[_0xb812('0x26')]=qs['offset'](_0x55afc0[_0xb812('0x37')][_0xb812('0x26')]);}_0x1df794['order']=qs['sort'](_0x55afc0['query'][_0xb812('0x3f')]);_0x1df794[_0xb812('0x40')]=qs['filters'](_[_0xb812('0x41')](_0x55afc0[_0xb812('0x37')],_0x54a066['filters']));_0x1df794[_0xb812('0x40')]['ChatWebsiteId']=_0x3da0b4['id'];if(_0x55afc0[_0xb812('0x37')]['filter']){_0x1df794[_0xb812('0x40')]=_[_0xb812('0x45')](_0x1df794['where'],{'$or':_[_0xb812('0x32')](_0x1df794[_0xb812('0x3b')],function(_0x2e5e04){var _0x573e4e={};_0x573e4e[_0x2e5e04]={'$like':'%'+_0x55afc0['query'][_0xb812('0x42')]+'%'};return _0x573e4e;})});}_0x1df794=_[_0xb812('0x45')]({},_0x1df794,_0x55afc0['options']);return db[_0xb812('0x5e')][_0xb812('0x25')]({'where':_0x1df794['where']})['then'](function(_0x49a188){_0xf1c82a[_0xb812('0x25')]=_0x49a188;if(_0x55afc0['query'][_0xb812('0x47')]){_0x1df794['include']=[{'all':!![]}];}return db[_0xb812('0x5e')]['findAll'](_0x1df794);})['then'](function(_0x1d9b55){_0xf1c82a[_0xb812('0x4a')]=_0x1d9b55;return _0xf1c82a;});}})['then'](respondWithFilteredResult(_0x16967a,_0x1df794))['catch'](handleError(_0x16967a,null));};exports[_0xb812('0x5f')]=function(_0x5f33e8,_0x30ba59){return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x5f33e8[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x30ba59,null))[_0xb812('0x15')](function(_0x543603){if(_0x543603){return _0x543603[_0xb812('0x5f')](_0x5f33e8[_0xb812('0x37')][_0xb812('0x60')]);}})[_0xb812('0x15')](respondWithStatusCode(_0x30ba59,null))[_0xb812('0x20')](handleError(_0x30ba59,null));};exports[_0xb812('0x61')]=function(_0x32d4cf,_0x480e5a){if(_0x32d4cf['body']['id']){delete _0x32d4cf['body']['id'];}return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x32d4cf['params']['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x480e5a,null))[_0xb812('0x15')](function(_0x422416){if(_0x422416){_0x32d4cf['body'][_0xb812('0x5c')]=_0x422416['id'];return db['CannedAnswer']['create'](_0x32d4cf[_0xb812('0x4e')]);}})[_0xb812('0x15')](respondWithResult(_0x480e5a,null))[_0xb812('0x20')](handleError(_0x480e5a,null));};exports[_0xb812('0x62')]=function(_0x4364cf,_0x3f3974){var _0x4c1702={'raw':![],'where':{}};var _0x3ccf45={};var _0x5647a4={'count':0x0,'rows':[]};return db[_0xb812('0x33')][_0xb812('0x5d')]({'where':{'id':_0x4364cf[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x3f3974,null))[_0xb812('0x15')](function(_0x4b50d8){if(_0x4b50d8){_0x3ccf45['model']=_[_0xb812('0x36')](db[_0xb812('0x63')][_0xb812('0x4c')]);_0x3ccf45[_0xb812('0x37')]=_['keys'](_0x4364cf['query']);_0x3ccf45['filters']=_[_0xb812('0x39')](_0x3ccf45[_0xb812('0x35')],_0x3ccf45['query']);_0x4c1702[_0xb812('0x3b')]=_[_0xb812('0x39')](_0x3ccf45[_0xb812('0x35')],qs[_0xb812('0x3a')](_0x4364cf[_0xb812('0x37')]['fields']));_0x4c1702[_0xb812('0x3b')]=_0x4c1702[_0xb812('0x3b')]['length']?_0x4c1702['attributes']:_0x3ccf45[_0xb812('0x35')];if(!_0x4364cf[_0xb812('0x37')][_0xb812('0x3d')](_0xb812('0x3e'))){_0x4c1702[_0xb812('0x24')]=qs[_0xb812('0x24')](_0x4364cf[_0xb812('0x37')][_0xb812('0x24')]);_0x4c1702[_0xb812('0x26')]=qs[_0xb812('0x26')](_0x4364cf['query']['offset']);}_0x4c1702[_0xb812('0x64')]=qs[_0xb812('0x3f')](_0x4364cf[_0xb812('0x37')][_0xb812('0x3f')]);_0x4c1702[_0xb812('0x40')]=qs[_0xb812('0x38')](_['pick'](_0x4364cf['query'],_0x3ccf45[_0xb812('0x38')]));_0x4c1702[_0xb812('0x40')][_0xb812('0x5c')]=_0x4b50d8['id'];if(_0x4364cf[_0xb812('0x37')][_0xb812('0x42')]){_0x4c1702['where']=_[_0xb812('0x45')](_0x4c1702[_0xb812('0x40')],{'$or':_[_0xb812('0x32')](_0x4c1702[_0xb812('0x3b')],function(_0x5a5ba9){var _0x44d830={};_0x44d830[_0x5a5ba9]={'$like':'%'+_0x4364cf['query']['filter']+'%'};return _0x44d830;})});}_0x4c1702=_[_0xb812('0x45')]({},_0x4c1702,_0x4364cf[_0xb812('0x46')]);return db[_0xb812('0x63')][_0xb812('0x25')]({'where':_0x4c1702[_0xb812('0x40')]})['then'](function(_0x4e837e){_0x5647a4[_0xb812('0x25')]=_0x4e837e;if(_0x4364cf[_0xb812('0x37')][_0xb812('0x47')]){_0x4c1702[_0xb812('0x48')]=[{'all':!![]}];}return db[_0xb812('0x63')][_0xb812('0x49')](_0x4c1702);})['then'](function(_0x314be3){_0x5647a4[_0xb812('0x4a')]=_0x314be3;return _0x5647a4;});}})[_0xb812('0x15')](respondWithFilteredResult(_0x3f3974,_0x4c1702))[_0xb812('0x20')](handleError(_0x3f3974,null));};exports['removeAnswers']=function(_0x440343,_0x161ff6){return db['ChatWebsite'][_0xb812('0x4d')]({'where':{'id':_0x440343[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x161ff6,null))[_0xb812('0x15')](function(_0x56957a){if(_0x56957a){return _0x56957a[_0xb812('0x65')](_0x440343[_0xb812('0x37')][_0xb812('0x60')]);}})[_0xb812('0x15')](respondWithStatusCode(_0x161ff6,null))[_0xb812('0x20')](handleError(_0x161ff6,null));};exports[_0xb812('0x66')]=function(_0xca083f,_0xcd1cfa){_0xca083f['body'][_0xb812('0x67')]=_0xca083f[_0xb812('0x68')][_0xb812('0x69')];return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0xca083f[_0xb812('0x59')]['id']}})['then'](handleEntityNotFound(_0xcd1cfa,null))['then'](saveUpdates(_0xca083f['body'],null))[_0xb812('0x15')](respondWithResult(_0xcd1cfa,null))[_0xb812('0x20')](handleError(_0xcd1cfa,null));};exports[_0xb812('0x6a')]=function(_0x374b6e,_0x1ff8d5){_0x374b6e[_0xb812('0x4e')]['agentAvatar']=_0x374b6e[_0xb812('0x68')][_0xb812('0x69')];return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x374b6e[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x1ff8d5,null))['then'](saveUpdates(_0x374b6e[_0xb812('0x4e')],null))['then'](respondWithResult(_0x1ff8d5,null))[_0xb812('0x20')](handleError(_0x1ff8d5,null));};exports[_0xb812('0x6b')]=function(_0x5c4c8f,_0x1b4f8a){_0x5c4c8f['body']['customerAvatar']=_0x5c4c8f[_0xb812('0x68')][_0xb812('0x69')];return db['ChatWebsite'][_0xb812('0x4d')]({'where':{'id':_0x5c4c8f[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x1b4f8a,null))[_0xb812('0x15')](saveUpdates(_0x5c4c8f[_0xb812('0x4e')],null))['then'](respondWithResult(_0x1b4f8a,null))[_0xb812('0x20')](handleError(_0x1b4f8a,null));};exports[_0xb812('0x6c')]=function(_0x4b7e78,_0x3334a6){_0x4b7e78['body'][_0xb812('0x6d')]=_0x4b7e78[_0xb812('0x68')][_0xb812('0x69')];return db['ChatWebsite']['find']({'where':{'id':_0x4b7e78[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x3334a6,null))[_0xb812('0x15')](saveUpdates(_0x4b7e78[_0xb812('0x4e')],null))[_0xb812('0x15')](respondWithResult(_0x3334a6,null))[_0xb812('0x20')](handleError(_0x3334a6,null));};exports[_0xb812('0x6e')]=function(_0x2fa724,_0x5c212d){var _0x36120d=path['join'](config[_0xb812('0x6f')],_0xb812('0x70'));var _0x46eebc={'where':{'id':_0x2fa724[_0xb812('0x59')]['id']},'attributes':['id',_0xb812('0x67')],'raw':!![]};var _0x148108=![];return require('../../config/license/util')['getLicense']()[_0xb812('0x15')](function(_0x3d9007){if(_0x3d9007){_0x148108=_0x3d9007[_0xb812('0x71')];}})[_0xb812('0x15')](function(){return db['ChatWebsite'][_0xb812('0x4d')](_0x46eebc);})['then'](handleEntityNotFound(_0x5c212d,null))[_0xb812('0x15')](function(_0x37a9db){if(_0x37a9db){if(!_['isNil'](_0x37a9db[_0xb812('0x67')])){if(fs[_0xb812('0x72')](path[_0xb812('0x73')](config[_0xb812('0x6f')],_0xb812('0x74'),_0x37a9db[_0xb812('0x67')]))&&_0x148108){_0x36120d=path[_0xb812('0x73')](config[_0xb812('0x6f')],'server/files/images/logos/',_0x37a9db[_0xb812('0x67')]);}}return _0x5c212d[_0xb812('0x75')](_0x36120d);}})[_0xb812('0x20')](handleError(_0x5c212d,null));};exports[_0xb812('0x76')]=function(_0x5d2871,_0x43bdbb){var _0x373e2f=path[_0xb812('0x73')](config['root'],_0xb812('0x77'));var _0x35c136={'where':{'id':_0x5d2871['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x35c136)[_0xb812('0x15')](handleEntityNotFound(_0x43bdbb,null))[_0xb812('0x15')](function(_0x323429){if(_0x323429){if(!_['isNil'](_0x323429[_0xb812('0x78')])){if(fs['existsSync'](path['join'](config[_0xb812('0x6f')],_0xb812('0x79'),_0x323429[_0xb812('0x78')]))){_0x373e2f=path['join'](config['root'],_0xb812('0x79'),_0x323429[_0xb812('0x78')]);}}return _0x43bdbb[_0xb812('0x75')](_0x373e2f);}})[_0xb812('0x20')](handleError(_0x43bdbb,null));};exports[_0xb812('0x7a')]=function(_0x3b2f3e,_0x24474c){var _0x316591=path[_0xb812('0x73')](config[_0xb812('0x6f')],_0xb812('0x7b'));var _0x153542={'where':{'id':_0x3b2f3e[_0xb812('0x59')]['id']},'attributes':['id',_0xb812('0x7c'),_0xb812('0x7d')],'raw':!![]};return db['ChatWebsite']['find'](_0x153542)[_0xb812('0x15')](handleEntityNotFound(_0x24474c,null))[_0xb812('0x15')](function(_0x4e2860){if(_0x4e2860){if(!_[_0xb812('0x7e')](_0x4e2860[_0xb812('0x7c')])){if(fs[_0xb812('0x72')](path[_0xb812('0x73')](config[_0xb812('0x6f')],_0xb812('0x79'),_0x4e2860[_0xb812('0x7c')]))&&_0x4e2860[_0xb812('0x7d')]){_0x316591=path['join'](config['root'],'server/files/images/avatars/',_0x4e2860['customerAvatar']);}}return _0x24474c[_0xb812('0x75')](_0x316591);}})[_0xb812('0x20')](handleError(_0x24474c,null));};exports[_0xb812('0x7f')]=function(_0x5c3130,_0x499772){var _0x5dcc94=path[_0xb812('0x73')](config['root'],_0xb812('0x80'));var _0xfeedf6={'where':{'id':_0x5c3130['params']['id']},'attributes':['id',_0xb812('0x6d')],'raw':!![]};return db['ChatWebsite'][_0xb812('0x4d')](_0xfeedf6)[_0xb812('0x15')](handleEntityNotFound(_0x499772,null))['then'](function(_0xf98ae1){if(_0xf98ae1){if(!_['isNil'](_0xf98ae1['systemAvatar'])){if(fs[_0xb812('0x72')](path[_0xb812('0x73')](config['root'],_0xb812('0x79'),_0xf98ae1[_0xb812('0x6d')]))){_0x5dcc94=path[_0xb812('0x73')](config[_0xb812('0x6f')],'server/files/images/avatars/',_0xf98ae1['systemAvatar']);}}return _0x499772['download'](_0x5dcc94);}})[_0xb812('0x20')](handleError(_0x499772,null));};exports[_0xb812('0x81')]=function(_0x48b316,_0x296ca6){var _0x45fc2d=require(_0xb812('0x82'));var _0x74c64d=new _0x45fc2d();var _0x40ff1a=_0x74c64d['setUA'](_0x48b316['headers'][_0xb812('0x83')])[_0xb812('0x84')]();var _0x20ec6b={'body':_0x48b316[_0xb812('0x4e')],'channel':_0xb812('0x85')};var _0x49d0e7=[];var _0x179bd7=[];var _0x13e838={};var _0x468492=![];return db['CmContact']['describe']()[_0xb812('0x15')](function(_0x2df5f4){if(!_0x2df5f4){throw new db['Sequelize']['ValidationError'](_0xb812('0x86'));}_0x49d0e7=_[_0xb812('0x87')](_[_0xb812('0x36')](_0x2df5f4),['createdAt',_0xb812('0x88')]);_0x179bd7=_[_0xb812('0x87')](_[_0xb812('0x36')](_0x2df5f4),[_0xb812('0x89'),_0xb812('0x88'),'CompanyId','ListId']);if(_0x48b316['body']['id']){delete _0x48b316[_0xb812('0x4e')]['id'];}if(_['isNil'](_0x48b316[_0xb812('0x4e')]['from'])){throw new db[(_0xb812('0x8a'))][(_0xb812('0x8b'))](_0xb812('0x8c'));}if(_['isNil'](_0x48b316['body'][_0xb812('0x4e')])||_0x48b316[_0xb812('0x4e')][_0xb812('0x4e')]===''){throw new db[(_0xb812('0x8a'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb812('0x7e')](_0x48b316[_0xb812('0x4e')][_0xb812('0x8d')])){throw new db[(_0xb812('0x8a'))][(_0xb812('0x8b'))](_0xb812('0x8e')+_0x179bd7);}if(!_['includes'](_0x179bd7,_0x48b316[_0xb812('0x4e')][_0xb812('0x8d')])){throw new db['Sequelize'][(_0xb812('0x8b'))](_0xb812('0x8f')+_0x179bd7);}_0x13e838[_0x48b316[_0xb812('0x4e')][_0xb812('0x8d')]]=_0x48b316[_0xb812('0x4e')][_0xb812('0x90')];})[_0xb812('0x15')](function(){return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x48b316['params']['id']},'include':[{'model':db[_0xb812('0x91')],'as':_0xb812('0x92'),'include':[{'model':db[_0xb812('0x93')],'as':_0xb812('0x94'),'where':_0x13e838,'limit':0x1,'order':[[_0xb812('0x88'),_0xb812('0x95')]]}]},{'model':db[_0xb812('0x96')],'as':_0xb812('0x97')}]});})[_0xb812('0x15')](handleEntityNotFound(_0x296ca6,null))['then'](function(_0x4184dc){if(_0x4184dc&&_0x4184dc[_0xb812('0x92')]){_0x20ec6b[_0xb812('0x98')]=_0x4184dc;_0x20ec6b[_0xb812('0x99')]=_0x4184dc[_0xb812('0x97')];_0x20ec6b[_0xb812('0x9a')]=_0x4184dc[_0xb812('0x92')];_0x20ec6b[_0xb812('0x99')]=_[_0xb812('0x9b')](_0x20ec6b[_0xb812('0x99')],[_0xb812('0x9c')],[_0xb812('0x9d')]);if(_0x20ec6b[_0xb812('0x98')][_0xb812('0x97')]){delete _0x20ec6b[_0xb812('0x98')]['Applications'];}if(_0x20ec6b[_0xb812('0x98')][_0xb812('0x92')]&&_0x20ec6b[_0xb812('0x98')][_0xb812('0x92')][_0xb812('0x94')][_0xb812('0x3c')]){return _0x20ec6b['account'][_0xb812('0x92')][_0xb812('0x94')][0x0];}var _0x294c60=_['defaults'](_0x48b316[_0xb812('0x4e')],{'firstName':_0x48b316[_0xb812('0x4e')][_0xb812('0x90')],'ListId':_0x4184dc['ListId']});_0x294c60[_0x48b316[_0xb812('0x4e')][_0xb812('0x8d')]]=_0x48b316[_0xb812('0x4e')][_0xb812('0x90')];return db[_0xb812('0x93')]['create'](_0x294c60,{'fields':_0x49d0e7,'raw':!![]});}})[_0xb812('0x15')](handleEntityNotFound(_0x296ca6,null))[_0xb812('0x15')](function(_0xbec519){_0x20ec6b[_0xb812('0x9e')]=_0xbec519;var _0x37aa85=_0x48b316[_0xb812('0x4e')][_0xb812('0x9f')];if(_0x48b316['headers'][_0xb812('0xa0')]){_0x37aa85=_0x48b316[_0xb812('0xa1')]['cf-connecting-ip'];}else if(_0x48b316['headers'][_0xb812('0xa2')]){_0x37aa85=_[_0xb812('0xa3')](_0x48b316[_0xb812('0xa1')]['x-forwarded-for'][_0xb812('0xa4')](','));}if(_0xbec519){var _0x274841={'ContactId':_0xbec519['id'],'ChatWebsiteId':_0x48b316[_0xb812('0x59')]['id'],'from':(_0xbec519[_0xb812('0xa5')]||'')+'\x20'+(_0xbec519[_0xb812('0xa6')]||''),'customerIp':_0x37aa85,'customerPort':_0x48b316[_0xb812('0xa1')][_0xb812('0xa7')]?_0x48b316[_0xb812('0xa1')][_0xb812('0xa7')]:null,'referer':_0x48b316['body']['referer'],'browserName':_0x40ff1a[_0xb812('0xa8')]['name']&&_0x40ff1a[_0xb812('0xa8')][_0xb812('0xa9')]?util[_0xb812('0xaa')](_0xb812('0xab'),_0x40ff1a[_0xb812('0xa8')][_0xb812('0x2d')],_0x40ff1a[_0xb812('0xa8')]['version']):_0xb812('0xac'),'browserVersion':_0x40ff1a[_0xb812('0xa8')][_0xb812('0xa9')]||_0xb812('0xac'),'osName':util['format']('%s\x20%s',_0x40ff1a['os']['name'],_0x40ff1a['os']['version']),'osVersion':_0x40ff1a['os'][_0xb812('0xa9')],'deviceModel':_0x40ff1a['device'][_0xb812('0x35')]&&_0x40ff1a[_0xb812('0xad')][_0xb812('0xae')]?util[_0xb812('0xaa')](_0xb812('0xaf'),_0x40ff1a[_0xb812('0xad')][_0xb812('0x35')],_0x40ff1a[_0xb812('0xad')][_0xb812('0xae')],_0x40ff1a[_0xb812('0xad')][_0xb812('0x43')]):null,'deviceVendor':_0x40ff1a['device'][_0xb812('0xae')],'deviceType':_0x40ff1a[_0xb812('0xad')]['type'],'formData':JSON[_0xb812('0x1a')](_0x48b316[_0xb812('0x4e')])};var _0x14d876={'ChatWebsiteId':_0x48b316[_0xb812('0x59')]['id'],'closed':![]};if(_0x48b316[_0xb812('0x4e')]['threadId']){_0x14d876['threadId']=_0x48b316['body']['threadId'];return db[_0xb812('0xb0')]['find']({'where':_0x14d876})[_0xb812('0x15')](function(_0x12898d){if(_0x12898d){return[_0x12898d,![]];}_0x274841[_0xb812('0xb1')]=_0x48b316['body'][_0xb812('0xb1')];_0x274841[_0xb812('0xb2')]=_0x48b316[_0xb812('0x4e')]['externalUrl'];return db['ChatInteraction'][_0xb812('0x56')](_0x274841)['then'](function(_0xf65210){return[_0xf65210,!![]];});});}_0x14d876[_0xb812('0xb3')]=_0xbec519['id'];if(_0x48b316[_0xb812('0x4e')]['interaction']&&_0x48b316[_0xb812('0x4e')][_0xb812('0xb4')]['id']){_0x14d876['id']=_0x48b316[_0xb812('0x4e')]['interaction']['id'];return db[_0xb812('0xb0')][_0xb812('0x4d')]({'where':_0x14d876})[_0xb812('0x15')](function(_0x6978fb){if(_0x6978fb){return[_0x6978fb,![]];}return db[_0xb812('0xb0')][_0xb812('0x56')](_0x274841)[_0xb812('0x15')](function(_0x45adb6){return[_0x45adb6,!![]];});});}return db['ChatInteraction']['create'](_0x274841)[_0xb812('0x15')](function(_0x4c31bd){return[_0x4c31bd,!![]];});}})['spread'](function(_0x33c3a2,_0xeb64cf){if(_0x33c3a2){_0x468492=_0xeb64cf;if(!_0xeb64cf){var _0xc5b70a={'from':(_0x20ec6b[_0xb812('0x9e')][_0xb812('0xa5')]||'')+'\x20'+(_0x20ec6b['contact'][_0xb812('0xa6')]||'')};if(_0x48b316[_0xb812('0x4e')][_0xb812('0xb1')]&&_0x48b316['body']['messageId']&&_0x48b316[_0xb812('0x4e')]['threadId']!=_0x48b316[_0xb812('0x4e')][_0xb812('0xb5')]){_0xc5b70a['threadId']=_0x48b316[_0xb812('0x4e')][_0xb812('0xb5')];}return _0x33c3a2['update'](_0xc5b70a);}else{return _0x33c3a2;}}})[_0xb812('0x15')](function(_0x353ee6){_0x20ec6b['interaction']=_0x353ee6[_0xb812('0x2a')]({'plain':!![]});_0x20ec6b['interaction']['created']=_0x468492;if(_0x20ec6b[_0xb812('0xb4')][_0xb812('0xb6')]){if(_0x20ec6b[_0xb812('0x98')][_0xb812('0xb7')]){_0x20ec6b[_0xb812('0x99')][_0xb812('0xb8')]({'id':0x0,'priority':_0x20ec6b['applications']['length']+0x1,'app':_0xb812('0xb9'),'appdata':_0xb812('0xba'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0xb812('0x56')]({'body':_0x48b316[_0xb812('0x4e')][_0xb812('0x4e')],'ChatWebsiteId':_0x48b316[_0xb812('0x59')]['id'],'ChatInteractionId':_0x353ee6['id'],'direction':'in','ContactId':_0x20ec6b[_0xb812('0x9e')]['id'],'AttachmentId':_0x48b316['body']['AttachmentId']});})[_0xb812('0x15')](function(_0x3db82f){_0x20ec6b[_0xb812('0x1e')]=_0x3db82f;if(_0x20ec6b[_0xb812('0xb4')][_0xb812('0xbb')]){return db[_0xb812('0xbc')][_0xb812('0x4d')]({'attributes':['id','name'],'where':{'id':_0x20ec6b['interaction'][_0xb812('0xbb')]}})[_0xb812('0x15')](function(_0x1831b1){if(_0x1831b1){_0x20ec6b[_0xb812('0x99')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1831b1[_0xb812('0x2d')]+','+(_0x20ec6b[_0xb812('0x98')][_0xb812('0xbd')]||0xa),'interval':_0xb812('0xbe')});_0x20ec6b['forcedOwnership']=!![];}return respondWithRpcPromise(_0xb812('0xbf'),'startRouting',_0x20ec6b);});}return respondWithRpcPromise(_0xb812('0xbf'),_0xb812('0xc0'),_0x20ec6b);})['then'](function(_0x6643b3){respondWithRpcPromise(_0xb812('0xc1'),'EventManager',{'event':_0xb812('0x81'),'message':_0x6643b3},client9002);return _0x6643b3;})[_0xb812('0x15')](respondWithResult(_0x296ca6,null))[_0xb812('0x20')](handleError(_0x296ca6,null));};exports[_0xb812('0xc2')]=function(_0x9b85cc,_0x2ee8f5){var _0x37d4aa,_0x381547,_0x54316f;var _0x26f310=[];var _0x2c376d={};var _0x18d95c=_0x9b85cc[_0xb812('0xc3')]||[];var _0x1ee497=[];var _0x305c1c;return db[_0xb812('0x93')][_0xb812('0x5a')]()['then'](function(_0xf4a335){if(!_0xf4a335){throw new db['Sequelize'][(_0xb812('0x8b'))]('no\x20available\x20attributes');}_0x26f310=_[_0xb812('0x87')](_['keys'](_0xf4a335),['createdAt',_0xb812('0x88'),'CompanyId',_0xb812('0xc4')]);if(_0x9b85cc[_0xb812('0x4e')]['id']){delete _0x9b85cc['body']['id'];}if(_[_0xb812('0x7e')](_0x9b85cc[_0xb812('0x4e')][_0xb812('0x90')])){throw _0x2ee8f5[_0xb812('0x27')](0x1f4)['send'](new db[(_0xb812('0x8a'))][(_0xb812('0x8b'))](_0xb812('0x8c')));}if(_[_0xb812('0x7e')](_0x9b85cc[_0xb812('0x4e')][_0xb812('0x4e')])||_0x9b85cc['body'][_0xb812('0x4e')]===''){throw _0x2ee8f5[_0xb812('0x27')](0x1f4)[_0xb812('0x2e')](new db[(_0xb812('0x8a'))][(_0xb812('0x8b'))](_0xb812('0xc5')));}if(_[_0xb812('0x7e')](_0x9b85cc[_0xb812('0x4e')][_0xb812('0xc6')])){throw _0x2ee8f5['status'](0x1f4)['send'](new db['Sequelize'][(_0xb812('0x8b'))](_0xb812('0xc7')+_0x26f310));}if(!_[_0xb812('0xc8')](_0x26f310,_0x9b85cc[_0xb812('0x4e')]['mapKeyOffline'])){throw _0x2ee8f5[_0xb812('0x27')](0x1f4)['send'](new db[(_0xb812('0x8a'))]['ValidationError'](_0xb812('0xc9')+_0x26f310));}_0x2c376d[_0x9b85cc[_0xb812('0x4e')][_0xb812('0xc6')]]=_0x9b85cc['body']['from'];})[_0xb812('0x15')](function(){return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x9b85cc[_0xb812('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0xb812('0x92')},{'model':db[_0xb812('0xca')],'as':_0xb812('0xca')}]});})['then'](handleEntityNotFound(_0x2ee8f5,null))[_0xb812('0x15')](function(_0x2f1025){if(_0x2f1025&&_0x2f1025['List']){_0x381547=_0x2f1025;var _0x42c0d4=_[_0xb812('0xd')](_0x9b85cc['body'],{'firstName':_0x9b85cc['body'][_0xb812('0x90')],'phone':_0x9b85cc['body'][_0xb812('0x90')],'ListId':_0x2f1025[_0xb812('0xc4')]});_0x42c0d4[_0x9b85cc[_0xb812('0x4e')][_0xb812('0xc6')]]=_0x9b85cc[_0xb812('0x4e')][_0xb812('0x90')];return db['CmContact'][_0xb812('0xcb')]({'where':_0x2c376d,'defaults':_0x42c0d4});}})[_0xb812('0xcc')](function(_0x2d6070){if(_0x2d6070){_0x54316f=_0x2d6070;var _0x16b21a=fs[_0xb812('0xcd')](path['join'](config[_0xb812('0x6f')],_0xb812('0xce')),_0xb812('0xcf'));var _0x5deeb7=ejs[_0xb812('0xd0')](_0x16b21a,{'body':_[_0xb812('0xd1')](_0x9b85cc[_0xb812('0x4e')][_0xb812('0x4e')]),'bodyTitle':_0x381547[_0xb812('0xd2')]});return db[_0xb812('0xd3')][_0xb812('0x56')]({'body':_0x5deeb7,'plainBody':htmlToText[_0xb812('0xd4')](_0x5deeb7),'ContactId':_0x2d6070['id'],'ChatWebsiteId':_0x381547['id']});}})[_0xb812('0x15')](function(_0x569ce9){_0x305c1c=_0x569ce9;if(_0x18d95c[_0xb812('0x3c')]){var _0x2705c5=_0x18d95c[_0xb812('0x32')](function(_0x321561){return{'name':_0x321561[_0xb812('0xd5')],'basename':_0x321561[_0xb812('0x69')],'type':_0x321561[_0xb812('0xd6')],'ChatOfflineMessageId':_0x569ce9['id']};});_0x1ee497=_0x2705c5[_0xb812('0x32')](_0x475265=>{var _0x13d412={'filename':_0x475265[_0xb812('0x2d')],'path':path['join'](config[_0xb812('0x6f')],_0xb812('0xd7'),_0xb812('0xc3'),_0xb812('0xd8'),_0xb812('0xd9'),_0x475265['basename'])};return _0x13d412;});if(!_0x381547['openNewInteraction']){return db[_0xb812('0xda')]['transaction'](function(_0x2241d4){return db[_0xb812('0xdb')][_0xb812('0xdc')](_0x2705c5,{'transaction':_0x2241d4});});}}})['then'](function(){if(_0x305c1c){_0x37d4aa=_0x305c1c;return db['MailAccount'][_0xb812('0x5d')]({'where':{'service':!![]},'include':[{'model':db[_0xb812('0xdd')],'as':_0xb812('0xde'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xb812('0xdf'),'raw':!![]}]}]});}})[_0xb812('0x15')](function(_0x37b171){if(_0x37b171&&_0x37b171[_0xb812('0xde')]&&_0x381547[_0xb812('0xe0')]&&_0x381547[_0xb812('0xe1')]){var _0x563d42=_0x37b171[_0xb812('0xe2')]();return respondWithRpcPromise(_0xb812('0xe3'),_0xb812('0xe4'),{'account':_0x563d42,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x37b171['name'],_0x37b171['email']||_0x37b171[_0xb812('0xde')][_0xb812('0x4f')]),'to':_0x381547[_0xb812('0xe1')],'subject':_0x381547[_0xb812('0xe5')],'html':_0x37d4aa[_0xb812('0x4e')],'attachments':_0x1ee497}},client9003)['then'](function(){return _0x37d4aa;})['catch'](function(_0x4d77d1){logger['error'](_0x4d77d1);});}})['then'](function(){if(_0x381547&&_0x381547[_0xb812('0xe6')]&&_0x381547['MailAccountId']){var _0x3caa93=[];if(_0x18d95c['length']){_0x3caa93=_0x18d95c[_0xb812('0x32')](function(_0x190001){return{'name':_0x190001[_0xb812('0xd5')],'basename':_0x190001[_0xb812('0x69')],'type':_0x190001['mimetype'],'ChatOfflineMessageId':_0x305c1c['id']};});}var _0x10a88c;if(!_[_0xb812('0x7e')](_0x381547[_0xb812('0xe7')])){var _0x252ab1=_['map'](_0x9b85cc['body'],function(_0x4d44d0){return _0x4d44d0;});var _0x16929a=_[_0xb812('0xe8')](_0x252ab1)[0x0];var _0x5efcdc=_[_0xb812('0xe9')](_0x16929a,function(_0x328bfc){return _0x328bfc;});_0x10a88c=_0x5efcdc[0x1][_0x381547[_0xb812('0xe7')]];}var _0x53c48c={'from':_0x54316f[_0xb812('0xea')],'firstName':_0x54316f[_0xb812('0xa5')],'lastName':_0x54316f[_0xb812('0xa6')],'mapKey':_0xb812('0xea'),'message':{'from':_0x54316f['email'],'to':_0x381547[_0xb812('0xca')][_0xb812('0xea')],'cc':'','subject':_[_0xb812('0x7e')](_0x10a88c)?_0x381547['offlineMessageSubject']:_0x10a88c,'messageId':'','sentAt':new Date(),'attach':_0x3caa93[_0xb812('0x3c')],'attachments':_0x3caa93,'originChannel':_0xb812('0xeb'),'ChatWebsiteId':_0x381547['id'],'ChatOfflineMessageId':_0x37d4aa['id'],'originTo':_0x381547[_0xb812('0xca')][_0xb812('0xea')]},'body':_0x37d4aa['body']};var _0x3b1b0c={'account':{'id':_0x381547[_0xb812('0xec')]},'body':_0x53c48c,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x3b1b0c,client9001)[_0xb812('0x15')](function(){return _0x37d4aa;})[_0xb812('0x20')](function(_0x25a167){logger[_0xb812('0x1b')](_0x25a167);});}return;})[_0xb812('0x15')](function(){if(_0x37d4aa){return _0x37d4aa;}})[_0xb812('0x15')](respondWithResult(_0x2ee8f5,null))[_0xb812('0x20')](function(_0x61aa6a){logger[_0xb812('0x1b')](_0xb812('0x20'),_0x61aa6a);for(var _0x1b309f of _0x18d95c){var _0x2417fe=path[_0xb812('0x73')](config[_0xb812('0x6f')],_0xb812('0xd7'),_0xb812('0xc3'),_0xb812('0xd8'),_0xb812('0xd9'),_0x1b309f[_0xb812('0x69')]);fs_extra[_0xb812('0xed')](_0x2417fe)[_0xb812('0x20')](function(_0x4e2cf9){logger[_0xb812('0x1b')](_0xb812('0xee'),_0x2417fe,_0x4e2cf9);});}});};exports[_0xb812('0xef')]=function(_0x1e1a3f,_0x348bd0){return db[_0xb812('0xb0')][_0xb812('0x4d')]({'where':{'id':_0x1e1a3f[_0xb812('0x59')]['id']}})['then'](handleEntityNotFound(_0x348bd0,null))[_0xb812('0x15')](function(_0x400770){if(_0x400770){return _0x400770[_0xb812('0xef')](_0x1e1a3f[_0xb812('0x4e')][_0xb812('0x60')],_[_0xb812('0xf0')](_0x1e1a3f[_0xb812('0x4e')],[_0xb812('0x60'),'id'])||{});}})[_0xb812('0x15')](respondWithResult(_0x348bd0,null))['catch'](handleError(_0x348bd0,null));};exports[_0xb812('0xf1')]=function(_0x519882,_0xded69b){var _0x16c3f1={'raw':![],'where':{}};var _0x155487={};var _0x49bd50={'count':0x0,'rows':[]};return db[_0xb812('0x33')][_0xb812('0x5d')]({'where':{'id':_0x519882['params']['id']}})[_0xb812('0x15')](handleEntityNotFound(_0xded69b,null))[_0xb812('0x15')](function(_0x110796){if(_0x110796){_0x155487[_0xb812('0x35')]=_['keys'](db[_0xb812('0xb0')]['rawAttributes']);_0x155487[_0xb812('0x37')]=_[_0xb812('0x36')](_0x519882[_0xb812('0x37')]);_0x155487[_0xb812('0x38')]=_[_0xb812('0x39')](_0x155487[_0xb812('0x35')],_0x155487[_0xb812('0x37')]);_0x16c3f1[_0xb812('0x3b')]=_[_0xb812('0x39')](_0x155487[_0xb812('0x35')],qs[_0xb812('0x3a')](_0x519882['query'][_0xb812('0x3a')]));_0x16c3f1[_0xb812('0x3b')]=_0x16c3f1[_0xb812('0x3b')][_0xb812('0x3c')]?_0x16c3f1[_0xb812('0x3b')]:_0x155487[_0xb812('0x35')];if(!_0x519882[_0xb812('0x37')][_0xb812('0x3d')](_0xb812('0x3e'))){_0x16c3f1[_0xb812('0x24')]=qs[_0xb812('0x24')](_0x519882['query'][_0xb812('0x24')]);_0x16c3f1[_0xb812('0x26')]=qs[_0xb812('0x26')](_0x519882[_0xb812('0x37')]['offset']);}_0x16c3f1[_0xb812('0x64')]=qs['sort'](_0x519882[_0xb812('0x37')]['sort']);_0x16c3f1[_0xb812('0x40')]=qs[_0xb812('0x38')](_[_0xb812('0x41')](_0x519882[_0xb812('0x37')],_0x155487[_0xb812('0x38')]));_0x16c3f1[_0xb812('0x40')]['ChatWebsiteId']=_0x110796['id'];if(_0x519882[_0xb812('0x37')][_0xb812('0x42')]){_0x16c3f1[_0xb812('0x40')]=_[_0xb812('0x45')](_0x16c3f1['where'],{'$or':_['map'](_0x16c3f1['attributes'],function(_0x9fae00){var _0xb2798={};_0xb2798[_0x9fae00]={'$like':'%'+_0x519882[_0xb812('0x37')]['filter']+'%'};return _0xb2798;})});}_0x16c3f1=_[_0xb812('0x45')]({},_0x16c3f1,_0x519882[_0xb812('0x46')]);return db['ChatInteraction']['count']({'where':_0x16c3f1[_0xb812('0x40')]})['then'](function(_0x535e5d){_0x49bd50[_0xb812('0x25')]=_0x535e5d;if(_0x519882[_0xb812('0x37')][_0xb812('0x47')]){_0x16c3f1[_0xb812('0x48')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0xb812('0xf2'),'attributes':['name','fullname',_0xb812('0xf3')],'required':![]},{'model':db['Tag'],'as':_0xb812('0xf4'),'attributes':['id',_0xb812('0x2d'),_0xb812('0xf5')],'where':_0x519882['query'][_0xb812('0xf6')]?{'id':_0x519882['query'][_0xb812('0xf6')]}:undefined,'required':_0x519882[_0xb812('0x37')][_0xb812('0xf6')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x16c3f1);})[_0xb812('0x15')](function(_0x44de53){_0x49bd50[_0xb812('0x4a')]=_0x44de53;return _0x49bd50;});}})['then'](respondWithFilteredResult(_0xded69b,_0x16c3f1))[_0xb812('0x20')](handleError(_0xded69b,null));};function iftimePromise(_0x2d3fc0,_0x1c98b9){return respondWithRpcPromise(_0xb812('0xf7'),_0xb812('0xf8'),{'command':_0x1c98b9['timezone']?util[_0xb812('0xaa')](_0xb812('0xf9'),_0x2d3fc0[_0xb812('0xfa')],_0x1c98b9[_0xb812('0xfb')]):util[_0xb812('0xaa')](_0xb812('0xfc'),_0x2d3fc0[_0xb812('0xfa')])},client9002)[_0xb812('0x15')](function(_0xac4122){var _0x3ed0cd=_0xac4122&&_0xac4122[_0xb812('0xfd')](_0xb812('0xfe'))>=0x0?!![]:![];logger[_0xb812('0x16')](_0xb812('0xff'),_0x1c98b9['id'],_0x2d3fc0['id'],_0x2d3fc0[_0xb812('0xfa')],_0x3ed0cd?_0xb812('0x100'):_0xb812('0x101'),_0x1c98b9[_0xb812('0xfb')]?_0x1c98b9[_0xb812('0xfb')]:_0xb812('0x102'));return _0x3ed0cd;})['catch'](function(_0xdeffac){logger['error'](_0xb812('0xff'),_0x1c98b9['id'],_0x2d3fc0['id'],_0x2d3fc0['interval'],util[_0xb812('0x103')](_0xdeffac,{'showHidden':![],'depth':null}),_0x1c98b9['timezone']?_0x1c98b9[_0xb812('0xfb')]:_0xb812('0x102'));return![];});}exports[_0xb812('0xf8')]=function(_0x23c066,_0x40f135){var _0x3dbc68=0x0;var _0x100573=0x0;var _0x40735c=![];var _0x6ed7cc;var _0x790f2d;return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x23c066[_0xb812('0x59')]['id']},'include':[{'model':db[_0xb812('0x104')],'as':_0xb812('0x104'),'include':[{'model':db[_0xb812('0x104')],'as':_0xb812('0x105'),'attributes':['id',_0xb812('0xfa')],'raw':!![]}]}]})[_0xb812('0x15')](handleEntityNotFound(_0x40f135,null))[_0xb812('0x15')](function(_0x126fa9){if(_0x126fa9){_0x6ed7cc=_0x126fa9;return _0x126fa9[_0xb812('0x106')]({'raw':!![]});}})[_0xb812('0x15')](function(_0x4701d8){if(_0x6ed7cc){if(_0x4701d8){_0x790f2d=_0x4701d8;}}return require(_0xb812('0x107'))[_0xb812('0x108')]();})[_0xb812('0x15')](function(_0x490713){if(_0x490713){_0x100573=_0x490713[_0xb812('0x109')];_0x40735c=_0x490713[_0xb812('0x71')];}})[_0xb812('0x15')](function(){return db['ChatInteraction'][_0xb812('0x25')]({'where':{'closed':![]}});})[_0xb812('0x15')](function(_0x376974){_0x3dbc68=_0x376974;if(_0x100573&&_0x376974>_0x100573){return db[_0xb812('0x10a')][_0xb812('0x5d')]({'where':{'id':0x1}})['then'](function(_0x4438af){if(_0x4438af){_0x4438af[_0xb812('0x10b')](_0xb812('0x10c'));}});}})[_0xb812('0x15')](function(){if(_0x6ed7cc[_0xb812('0x104')]&&_0x6ed7cc[_0xb812('0x104')][_0xb812('0x105')]){var _0x129aaf=[];for(var _0x2c4720=0x0;_0x2c4720<_0x6ed7cc[_0xb812('0x104')][_0xb812('0x105')][_0xb812('0x3c')];_0x2c4720++){var _0xbe166b=_0x6ed7cc['Interval'][_0xb812('0x105')][_0x2c4720][_0xb812('0x2a')]({'plain':!![]});_0x129aaf['push'](iftimePromise(_0xbe166b,_0x6ed7cc));}return BPromise[_0xb812('0x10d')](_0x129aaf)[_0xb812('0x15')](function(_0x4902ac){return _[_0xb812('0x10e')](_0x4902ac);});}else{return!![];}})['then'](function(_0x20f87b){var _0x4d0a2c=fs[_0xb812('0xcd')](path['join'](config[_0xb812('0x6f')],_0xb812('0x10f')),'utf8');var _0x29172f={'remote':_0x6ed7cc[_0xb812('0x110')],'query':querystring[_0xb812('0x1a')](_[_0xb812('0x45')](_0x6ed7cc['get']({'plain':!![]}),{'customerIp':_0x23c066['headers'][_0xb812('0xa2')]||_0x23c066[_0xb812('0xa1')][_0xb812('0x111')]||_0x23c066[_0xb812('0x112')][_0xb812('0x113')]||_0x23c066['ip'],'referer':_0x23c066[_0xb812('0xa1')][_0xb812('0x114')],'openedInteractions':_0x3dbc68,'maxInteractions':_0x100573,'virtual':_0x40735c[_0xb812('0x109')],'online':_0x20f87b,'custom':_0x40735c}))[_0xb812('0x115')](/'/g,'\x5c\x27')};_0x40f135[_0xb812('0x2e')](ejs[_0xb812('0xd0')](Mustache[_0xb812('0xd0')](_0x4d0a2c,_0x29172f),{'proactiveActions':_0x790f2d,'alignment':_0x6ed7cc['alignment'],'verticalAlignment':_0x6ed7cc[_0xb812('0x116')],'div_color':_0x6ed7cc[_0xb812('0xf5')],'labelText':_0x6ed7cc['labelText'],'text_color':_0x6ed7cc[_0xb812('0x117')],'text_button_color':_0x6ed7cc[_0xb812('0x118')],'button_color':_0x6ed7cc[_0xb812('0x119')],'background_color':_0x6ed7cc['backgroundColor'],'hideWhenOffline':_0x6ed7cc[_0xb812('0x11a')],'interval':_0x6ed7cc[_0xb812('0x11b')]}));})[_0xb812('0x20')](handleError(_0x40f135,null));};exports['addApplications']=function(_0x33a445,_0x26faeb){var _0xd073f=_0x33a445[_0xb812('0x59')]['id'];var _0x3d34fb=_0x33a445[_0xb812('0x4e')];var _0x481acb=0xc8;var _0xb806b=null;return db[_0xb812('0xda')][_0xb812('0x11c')]({'isolationLevel':db[_0xb812('0xda')][_0xb812('0x11d')][_0xb812('0x11e')]['READ_COMMITTED']},function(_0x1b4beb){return db[_0xb812('0x33')][_0xb812('0x5d')]({'where':{'id':_0xd073f},'transaction':_0x1b4beb})[_0xb812('0x15')](function(_0x1d365a){if(_0x1d365a){return db[_0xb812('0x96')]['destroy']({'where':{'ChatWebsiteId':_0xd073f},'transaction':_0x1b4beb})[_0xb812('0x15')](function(){var _0x4ae62e=_[_0xb812('0x32')](_0x3d34fb,function(_0x341a98){_0x341a98[_0xb812('0x5c')]=_0xd073f;return _0x341a98;});return db['ChatApplication'][_0xb812('0xdc')](_0x4ae62e,{'transaction':_0x1b4beb});});}else{_0x481acb=0x194;_0xb806b=[];}});})[_0xb812('0x15')](function(){if(_0x481acb!==0x194){return db[_0xb812('0x96')][_0xb812('0x11f')]({'where':{'ChatWebsiteId':_0xd073f},'order':_0xb812('0x9c')})['then'](function(_0x972968){_0xb806b=_0x972968;});}})[_0xb812('0x20')](function(_0x5d4a09){_0x481acb=0x1f4;logger['error'](_0x5d4a09[_0xb812('0x2c')]);if(_0x5d4a09['name']){delete _0x5d4a09[_0xb812('0x2d')];}_0xb806b=_0x5d4a09;})['finally'](function(){if(_0xb806b===null){_0x26faeb['sendStatus'](_0x481acb);}else{if(_0x481acb===0x1f4){_0x26faeb[_0xb812('0x27')](_0x481acb)[_0xb812('0x2e')](_0xb806b);}else{_0x26faeb[_0xb812('0x27')](_0x481acb)[_0xb812('0x22')](_0xb806b);}}});};exports['getApplications']=function(_0x25ad4a,_0x4d602b){var _0x1f83ca={};var _0x14ef56={};var _0x8bdf5d;var _0x36b7b0;return db['ChatWebsite'][_0xb812('0x5d')]({'where':{'id':_0x25ad4a[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x4d602b,null))[_0xb812('0x15')](function(_0x57f2e3){if(_0x57f2e3){_0x8bdf5d=_0x57f2e3;_0x14ef56[_0xb812('0x35')]=_[_0xb812('0x36')](db[_0xb812('0x96')]['rawAttributes']);_0x14ef56['query']=_[_0xb812('0x36')](_0x25ad4a[_0xb812('0x37')]);_0x14ef56[_0xb812('0x38')]=_['intersection'](_0x14ef56['model'],_0x14ef56[_0xb812('0x37')]);_0x1f83ca[_0xb812('0x3b')]=_[_0xb812('0x39')](_0x14ef56[_0xb812('0x35')],qs[_0xb812('0x3a')](_0x25ad4a[_0xb812('0x37')][_0xb812('0x3a')]));_0x1f83ca['attributes']=_0x1f83ca['attributes'][_0xb812('0x3c')]?_0x1f83ca[_0xb812('0x3b')]:_0x14ef56[_0xb812('0x35')];_0x1f83ca['order']=qs[_0xb812('0x3f')](_0x25ad4a[_0xb812('0x37')][_0xb812('0x3f')]);_0x1f83ca[_0xb812('0x40')]=qs[_0xb812('0x38')](_[_0xb812('0x41')](_0x25ad4a[_0xb812('0x37')],_0x14ef56[_0xb812('0x38')]));if(_0x25ad4a[_0xb812('0x37')][_0xb812('0x42')]){_0x1f83ca['where']=_[_0xb812('0x45')](_0x1f83ca[_0xb812('0x40')],{'$or':_[_0xb812('0x32')](_0x1f83ca['attributes'],function(_0x3f2adb){var _0x4bffef={};_0x4bffef[_0x3f2adb]={'$like':'%'+_0x25ad4a[_0xb812('0x37')][_0xb812('0x42')]+'%'};return _0x4bffef;})});}_0x1f83ca=_['merge']({},_0x1f83ca,_0x25ad4a[_0xb812('0x46')]);return _0x8bdf5d[_0xb812('0x120')](_0x1f83ca);}})[_0xb812('0x15')](function(_0x50d7f7){if(_0x50d7f7){_0x36b7b0=_0x50d7f7[_0xb812('0x3c')];if(!_0x25ad4a['query'][_0xb812('0x3d')](_0xb812('0x3e'))){_0x1f83ca[_0xb812('0x24')]=qs[_0xb812('0x24')](_0x25ad4a['query'][_0xb812('0x24')]);_0x1f83ca[_0xb812('0x26')]=qs['offset'](_0x25ad4a['query'][_0xb812('0x26')]);}return _0x8bdf5d[_0xb812('0x120')](_0x1f83ca);}})[_0xb812('0x15')](function(_0x596cee){if(_0x596cee){return _0x596cee?{'count':_0x36b7b0,'rows':_0x596cee}:null;}})[_0xb812('0x15')](respondWithResult(_0x4d602b,null))['catch'](handleError(_0x4d602b,null));};exports[_0xb812('0x121')]=function(_0x420af5,_0x364695){return db[_0xb812('0x122')][_0xb812('0x4d')]({'where':{'id':_0x420af5[_0xb812('0x59')]['id']}})['then'](handleEntityNotFound(_0x364695,null))['then'](function(_0x261cca){if(_0x261cca){return _0x261cca[_0xb812('0x121')](_0x420af5[_0xb812('0x4e')][_0xb812('0x60')],_[_0xb812('0xf0')](_0x420af5['body'],[_0xb812('0x60'),'id'])||{});}})[_0xb812('0x15')](respondWithResult(_0x364695,null))[_0xb812('0x20')](handleError(_0x364695,null));};exports[_0xb812('0x106')]=function(_0x5061ef,_0x3d5c7c){var _0x3e05f3={};var _0x219452={};var _0x26e6eb;var _0x250f7c;return db[_0xb812('0x33')][_0xb812('0x5d')]({'where':{'id':_0x5061ef['params']['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x3d5c7c,null))[_0xb812('0x15')](function(_0x160b54){if(_0x160b54){_0x26e6eb=_0x160b54;_0x219452['model']=_['keys'](db[_0xb812('0x123')][_0xb812('0x4c')]);_0x219452[_0xb812('0x37')]=_['keys'](_0x5061ef[_0xb812('0x37')]);_0x219452[_0xb812('0x38')]=_[_0xb812('0x39')](_0x219452[_0xb812('0x35')],_0x219452[_0xb812('0x37')]);_0x3e05f3[_0xb812('0x3b')]=_['intersection'](_0x219452['model'],qs[_0xb812('0x3a')](_0x5061ef[_0xb812('0x37')]['fields']));_0x3e05f3['attributes']=_0x3e05f3[_0xb812('0x3b')]['length']?_0x3e05f3['attributes']:_0x219452[_0xb812('0x35')];_0x3e05f3[_0xb812('0x64')]=qs[_0xb812('0x3f')](_0x5061ef[_0xb812('0x37')]['sort']);_0x3e05f3[_0xb812('0x40')]=qs[_0xb812('0x38')](_[_0xb812('0x41')](_0x5061ef[_0xb812('0x37')],_0x219452[_0xb812('0x38')]));if(_0x5061ef['query']['filter']){_0x3e05f3['where']=_['merge'](_0x3e05f3[_0xb812('0x40')],{'$or':_[_0xb812('0x32')](_0x3e05f3['attributes'],function(_0x60c370){var _0x4fc3d0={};_0x4fc3d0[_0x60c370]={'$like':'%'+_0x5061ef[_0xb812('0x37')][_0xb812('0x42')]+'%'};return _0x4fc3d0;})});}_0x3e05f3=_[_0xb812('0x45')]({},_0x3e05f3,_0x5061ef[_0xb812('0x46')]);return _0x26e6eb[_0xb812('0x106')](_0x3e05f3);}})[_0xb812('0x15')](function(_0x2f780b){if(_0x2f780b){_0x250f7c=_0x2f780b[_0xb812('0x3c')];if(!_0x5061ef['query'][_0xb812('0x3d')](_0xb812('0x3e'))){_0x3e05f3['limit']=qs['limit'](_0x5061ef[_0xb812('0x37')][_0xb812('0x24')]);_0x3e05f3['offset']=qs[_0xb812('0x26')](_0x5061ef[_0xb812('0x37')]['offset']);}return _0x26e6eb[_0xb812('0x106')](_0x3e05f3);}})[_0xb812('0x15')](function(_0x4e42f2){if(_0x4e42f2){return _0x4e42f2?{'count':_0x250f7c,'rows':_0x4e42f2}:null;}})[_0xb812('0x15')](respondWithResult(_0x3d5c7c,null))[_0xb812('0x20')](handleError(_0x3d5c7c,null));};exports[_0xb812('0x124')]=function(_0x38dd21,_0x401c04){var _0x5b8c57=_0x38dd21[_0xb812('0x37')][_0xb812('0x125')]===_0xb812('0x126')?_0xb812('0x127'):_0xb812('0x128');return db[_0xb812('0x33')][_0xb812('0x4d')]({'attributes':['id',_0x5b8c57],'where':{'id':_0x38dd21[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x401c04,null))['then'](function(_0x1a80cf){if(_0x1a80cf){var _0x5d5152=_0x1a80cf[_0x5b8c57];var _0x5ba97f=_0x5d5152&&_0x5d5152[_0xb812('0x129')]?_0x5d5152[_0xb812('0x129')]:[];_0x401c04['send']({'fromKey':_[_0xb812('0x7e')](_0x5d5152[_0xb812('0x12a')])?undefined:_0x5d5152[_0xb812('0x12a')],'count':_0x5ba97f[_0xb812('0x3c')],'rows':_0x5ba97f});}})[_0xb812('0x20')](handleError(_0x401c04,null));};exports[_0xb812('0x12b')]=function(_0x45d88d,_0x33d17a){var _0xa6e790={'raw':![],'where':{}};var _0xc59ec4={};var _0xe8c692={'count':0x0,'rows':[]};return db[_0xb812('0x33')]['findOne']({'where':{'id':_0x45d88d[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x33d17a,null))['then'](function(_0x4bfd92){if(_0x4bfd92){_0xc59ec4[_0xb812('0x35')]=_[_0xb812('0x36')](db[_0xb812('0xd3')][_0xb812('0x4c')]);_0xc59ec4[_0xb812('0x37')]=_[_0xb812('0x36')](_0x45d88d[_0xb812('0x37')]);_0xc59ec4['filters']=_[_0xb812('0x39')](_0xc59ec4['model'],_0xc59ec4[_0xb812('0x37')]);_0xa6e790['attributes']=_['intersection'](_0xc59ec4[_0xb812('0x35')],qs[_0xb812('0x3a')](_0x45d88d['query'][_0xb812('0x3a')]));_0xa6e790[_0xb812('0x3b')]=_0xa6e790['attributes'][_0xb812('0x3c')]?_0xa6e790[_0xb812('0x3b')]:_0xc59ec4[_0xb812('0x35')];if(!_0x45d88d['query']['hasOwnProperty'](_0xb812('0x3e'))){_0xa6e790[_0xb812('0x24')]=qs[_0xb812('0x24')](_0x45d88d['query']['limit']);_0xa6e790[_0xb812('0x26')]=qs[_0xb812('0x26')](_0x45d88d[_0xb812('0x37')]['offset']);}_0xa6e790[_0xb812('0x64')]=qs['sort'](_0x45d88d[_0xb812('0x37')][_0xb812('0x3f')]);_0xa6e790[_0xb812('0x40')]=qs[_0xb812('0x38')](_[_0xb812('0x41')](_0x45d88d[_0xb812('0x37')],_0xc59ec4[_0xb812('0x38')]));_0xa6e790[_0xb812('0x40')]['ChatWebsiteId']=_0x4bfd92['id'];if(_0x45d88d[_0xb812('0x37')][_0xb812('0x42')]){_0xa6e790['where']=_[_0xb812('0x45')](_0xa6e790[_0xb812('0x40')],{'$or':_['map'](_0xa6e790[_0xb812('0x3b')],function(_0x2a30e2){var _0x3d4eba={};_0x3d4eba[_0x2a30e2]={'$like':'%'+_0x45d88d[_0xb812('0x37')][_0xb812('0x42')]+'%'};return _0x3d4eba;})});}_0xa6e790=_[_0xb812('0x45')]({},_0xa6e790,_0x45d88d[_0xb812('0x46')]);return db[_0xb812('0xd3')][_0xb812('0x25')]({'where':_0xa6e790['where']})[_0xb812('0x15')](function(_0x146eac){_0xe8c692[_0xb812('0x25')]=_0x146eac;if(_0x45d88d['query'][_0xb812('0x47')]){_0xa6e790[_0xb812('0x48')]=[{'all':!![]}];}else{_0xa6e790[_0xb812('0x48')]=[{'model':db[_0xb812('0x93')],'as':'Contact','required':![]},{'model':db[_0xb812('0xdb')],'as':'Attachments','required':![]}];}return db[_0xb812('0xd3')][_0xb812('0x49')](_0xa6e790);})['then'](function(_0x4b6555){_0xe8c692[_0xb812('0x4a')]=_0x4b6555;return _0xe8c692;});}})['then'](respondWithFilteredResult(_0x33d17a,_0xa6e790))[_0xb812('0x20')](handleError(_0x33d17a,null));};exports['addAgents']=function(_0x581422,_0x1be14e){return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x581422[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x1be14e,null))[_0xb812('0x15')](function(_0x4bad3e){if(_0x4bad3e){return _0x4bad3e[_0xb812('0x12c')](_0x581422[_0xb812('0x4e')]['ids'],_[_0xb812('0xf0')](_0x581422[_0xb812('0x4e')],[_0xb812('0x60'),'id'])||{})['spread'](function(_0x5e2970){for(var _0x5bcb9a=0x0;_0x5bcb9a<_0x581422[_0xb812('0x4e')]['ids'][_0xb812('0x3c')];_0x5bcb9a+=0x1){socket[_0xb812('0x12d')](_0xb812('0x12e'),{'UserId':Number(_0x581422[_0xb812('0x4e')][_0xb812('0x60')][_0x5bcb9a]),'ChatWebsiteId':Number(_0x581422[_0xb812('0x59')]['id'])});}return _0x5e2970;});}})[_0xb812('0x15')](respondWithResult(_0x1be14e,null))[_0xb812('0x20')](handleError(_0x1be14e,null));};exports[_0xb812('0x12f')]=function(_0x7d443a,_0x4c5794){return db['ChatWebsite']['find']({'where':{'id':_0x7d443a[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x4c5794,null))[_0xb812('0x15')](function(_0x4448f4){if(_0x4448f4){return _0x4448f4['removeAgents'](_0x7d443a[_0xb812('0x37')][_0xb812('0x60')])[_0xb812('0x15')](function(){if(_[_0xb812('0x130')](_0x7d443a[_0xb812('0x37')][_0xb812('0x60')])){for(var _0x3d6c02=0x0;_0x3d6c02<_0x7d443a[_0xb812('0x37')]['ids'][_0xb812('0x3c')];_0x3d6c02+=0x1){socket[_0xb812('0x12d')]('userChatWebsite:remove',{'UserId':Number(_0x7d443a[_0xb812('0x37')]['ids'][_0x3d6c02]),'ChatWebsiteId':Number(_0x7d443a[_0xb812('0x59')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x7d443a['query'][_0xb812('0x60')]),'ChatWebsiteId':Number(_0x7d443a[_0xb812('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x4c5794,null))[_0xb812('0x20')](handleError(_0x4c5794,null));};exports[_0xb812('0x131')]=function(_0x1fa3e5,_0xee328b){var _0x269e6a={};var _0x1f982b={};var _0x573115;var _0x111733;return db[_0xb812('0x33')][_0xb812('0x5d')]({'where':{'id':_0x1fa3e5[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0xee328b,null))[_0xb812('0x15')](function(_0x3141ad){if(_0x3141ad){_0x573115=_0x3141ad;_0x1f982b[_0xb812('0x35')]=_[_0xb812('0x36')](db[_0xb812('0xbc')][_0xb812('0x4c')]);_0x1f982b[_0xb812('0x37')]=_[_0xb812('0x36')](_0x1fa3e5[_0xb812('0x37')]);_0x1f982b[_0xb812('0x38')]=_[_0xb812('0x39')](_0x1f982b[_0xb812('0x35')],_0x1f982b['query']);_0x269e6a['attributes']=_[_0xb812('0x39')](_0x1f982b[_0xb812('0x35')],qs[_0xb812('0x3a')](_0x1fa3e5[_0xb812('0x37')][_0xb812('0x3a')]));_0x269e6a[_0xb812('0x3b')]=_0x269e6a[_0xb812('0x3b')]['length']?_0x269e6a[_0xb812('0x3b')]:_0x1f982b['model'];_0x269e6a[_0xb812('0x64')]=qs[_0xb812('0x3f')](_0x1fa3e5[_0xb812('0x37')][_0xb812('0x3f')]);_0x269e6a[_0xb812('0x40')]=qs['filters'](_[_0xb812('0x41')](_0x1fa3e5['query'],_0x1f982b[_0xb812('0x38')]));if(_0x1fa3e5[_0xb812('0x37')]['filter']){_0x269e6a[_0xb812('0x40')]=_[_0xb812('0x45')](_0x269e6a[_0xb812('0x40')],{'$or':_[_0xb812('0x32')](_0x269e6a['attributes'],function(_0x2c21a2){var _0x39e8da={};_0x39e8da[_0x2c21a2]={'$like':'%'+_0x1fa3e5['query'][_0xb812('0x42')]+'%'};return _0x39e8da;})});}_0x269e6a=_[_0xb812('0x45')]({},_0x269e6a,_0x1fa3e5[_0xb812('0x46')]);return _0x573115[_0xb812('0x131')](_0x269e6a);}})[_0xb812('0x15')](function(_0x8840e6){if(_0x8840e6){_0x111733=_0x8840e6[_0xb812('0x3c')];if(!_0x1fa3e5['query'][_0xb812('0x3d')](_0xb812('0x3e'))){_0x269e6a[_0xb812('0x24')]=qs['limit'](_0x1fa3e5['query'][_0xb812('0x24')]);_0x269e6a[_0xb812('0x26')]=qs['offset'](_0x1fa3e5[_0xb812('0x37')][_0xb812('0x26')]);}return _0x573115[_0xb812('0x131')](_0x269e6a);}})[_0xb812('0x15')](function(_0x497b49){if(_0x497b49){return _0x497b49?{'count':_0x111733,'rows':_0x497b49}:null;}})[_0xb812('0x15')](respondWithResult(_0xee328b,null))['catch'](handleError(_0xee328b,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 3d1feaf..d9d3543 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 _0xc01b=['hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update','remove','emit'];(function(_0x142ea2,_0x49f3dd){var _0x181e26=function(_0x2bd79c){while(--_0x2bd79c){_0x142ea2['push'](_0x142ea2['shift']());}};_0x181e26(++_0x49f3dd);}(_0xc01b,0x65));var _0xbc01=function(_0x3ebe26,_0x4e880f){_0x3ebe26=_0x3ebe26-0x0;var _0x3e7ac7=_0xc01b[_0x3ebe26];return _0x3e7ac7;};'use strict';var EventEmitter=require(_0xbc01('0x0'));var ChatWebsite=require(_0xbc01('0x1'))['db'][_0xbc01('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xbc01('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbc01('0x4'),'afterDestroy':_0xbc01('0x5')};function emitEvent(_0x48fa3f){return function(_0x538b32,_0x52b070,_0x17f136){ChatWebsiteEvents[_0xbc01('0x6')](_0x48fa3f+':'+_0x538b32['id'],_0x538b32);ChatWebsiteEvents['emit'](_0x48fa3f,_0x538b32);_0x17f136(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xbc01('0x7')](e,emitEvent(event));}}module[_0xbc01('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x7250=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x7250,0x1b1));var _0x0725=function(_0x1829c7,_0x34b9e0){_0x1829c7=_0x1829c7-0x0;var _0x2a76b6=_0x7250[_0x1829c7];return _0x2a76b6;};'use strict';var EventEmitter=require(_0x0725('0x0'));var ChatWebsite=require(_0x0725('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0725('0x2')](0x0);var events={'afterCreate':_0x0725('0x3'),'afterUpdate':_0x0725('0x4'),'afterDestroy':_0x0725('0x5')};function emitEvent(_0x425376){return function(_0x4724ef,_0x53cc59,_0x34a7d5){ChatWebsiteEvents['emit'](_0x425376+':'+_0x4724ef['id'],_0x4724ef);ChatWebsiteEvents['emit'](_0x425376,_0x4724ef);_0x34a7d5(null);};}for(var e in events){if(events[_0x0725('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x0725('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 3e6beb9..bdc6fc7 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 _0x5973=['request-promise','path','rimraf','./chatWebsite.attributes','lodash','../../config/logger','api','bluebird'];(function(_0x4909de,_0x5bc251){var _0x384a9f=function(_0x5226b4){while(--_0x5226b4){_0x4909de['push'](_0x4909de['shift']());}};_0x384a9f(++_0x5bc251);}(_0x5973,0x10c));var _0x3597=function(_0x4aa4af,_0x210cde){_0x4aa4af=_0x4aa4af-0x0;var _0x3bf44a=_0x5973[_0x4aa4af];return _0x3bf44a;};'use strict';var _=require(_0x3597('0x0'));var util=require('util');var logger=require(_0x3597('0x1'))(_0x3597('0x2'));var moment=require('moment');var BPromise=require(_0x3597('0x3'));var rp=require(_0x3597('0x4'));var fs=require('fs');var path=require(_0x3597('0x5'));var rimraf=require(_0x3597('0x6'));var config=require('../../config/environment');var attributes=require(_0x3597('0x7'));module['exports']=function(_0x19e278,_0x2d25cd){return _0x19e278['define']('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9816=['define','ChatWebsite','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9816,0x1f0));var _0x6981=function(_0x29a513,_0x364b5d){_0x29a513=_0x29a513-0x0;var _0x1f777b=_0x9816[_0x29a513];return _0x1f777b;};'use strict';var _=require('lodash');var util=require(_0x6981('0x0'));var logger=require(_0x6981('0x1'))(_0x6981('0x2'));var moment=require(_0x6981('0x3'));var BPromise=require(_0x6981('0x4'));var rp=require(_0x6981('0x5'));var fs=require('fs');var path=require(_0x6981('0x6'));var rimraf=require(_0x6981('0x7'));var config=require(_0x6981('0x8'));var attributes=require(_0x6981('0x9'));module[_0x6981('0xa')]=function(_0x265e6c,_0xa4f67c){return _0x265e6c[_0x6981('0xb')](_0x6981('0xc'),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 0fa3e0b..f5d5e64 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 _0x1b5d=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','util','moment'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x1b5d,0x183));var _0xd1b5=function(_0x5a0b6c,_0x175969){_0x5a0b6c=_0x5a0b6c-0x0;var _0x539441=_0x1b5d[_0x5a0b6c];return _0x539441;};'use strict';var _=require(_0xd1b5('0x0'));var util=require(_0xd1b5('0x1'));var moment=require(_0xd1b5('0x2'));var BPromise=require(_0xd1b5('0x3'));var rs=require(_0xd1b5('0x4'));var fs=require('fs');var Redis=require(_0xd1b5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd1b5('0x6'));var logger=require('../../config/logger')(_0xd1b5('0x7'));var config=require(_0xd1b5('0x8'));var jayson=require(_0xd1b5('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xd1b5('0xa')]=_[_0xd1b5('0xb')](config['redis'],{'host':_0xd1b5('0xc'),'port':0x18eb});var socket=require(_0xd1b5('0xd'))(new Redis(config['redis']));require(_0xd1b5('0xe'))[_0xd1b5('0xf')](socket);function respondWithRpcPromise(_0x5d7dd8,_0x1c7d48,_0x41c233){return new BPromise(function(_0x53070c,_0x110800){return client[_0xd1b5('0x10')](_0x5d7dd8,_0x41c233)['then'](function(_0x9dc7fc){logger[_0xd1b5('0x11')](_0xd1b5('0x12'),_0x1c7d48,'request\x20sent');logger[_0xd1b5('0x13')](_0xd1b5('0x14'),_0x1c7d48,'request\x20sent',JSON[_0xd1b5('0x15')](_0x9dc7fc));if(_0x9dc7fc[_0xd1b5('0x16')]){if(_0x9dc7fc[_0xd1b5('0x16')][_0xd1b5('0x17')]===0x1f4){logger['error'](_0xd1b5('0x12'),_0x1c7d48,_0x9dc7fc['error']['message']);return _0x110800(_0x9dc7fc[_0xd1b5('0x16')][_0xd1b5('0x18')]);}logger[_0xd1b5('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1c7d48,_0x9dc7fc[_0xd1b5('0x16')]['message']);return _0x53070c(_0x9dc7fc[_0xd1b5('0x16')]['message']);}else{logger[_0xd1b5('0x11')](_0xd1b5('0x12'),_0x1c7d48,_0xd1b5('0x19'));_0x53070c(_0x9dc7fc['result'][_0xd1b5('0x18')]);}})['catch'](function(_0x20d430){logger['error'](_0xd1b5('0x12'),_0x1c7d48,_0x20d430);_0x110800(_0x20d430);});});}
\ No newline at end of file
+var _0xc318=['request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s'];(function(_0x18c861,_0xd8380){var _0x5be7da=function(_0x886d27){while(--_0x886d27){_0x18c861['push'](_0x18c861['shift']());}};_0x5be7da(++_0xd8380);}(_0xc318,0xb6));var _0x8c31=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xc318[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x8c31('0x0'));var util=require(_0x8c31('0x1'));var moment=require(_0x8c31('0x2'));var BPromise=require(_0x8c31('0x3'));var rs=require(_0x8c31('0x4'));var fs=require('fs');var Redis=require(_0x8c31('0x5'));var db=require(_0x8c31('0x6'))['db'];var utils=require(_0x8c31('0x7'));var logger=require(_0x8c31('0x8'))(_0x8c31('0x9'));var config=require(_0x8c31('0xa'));var jayson=require(_0x8c31('0xb'));var client=jayson[_0x8c31('0xc')]['http']({'port':0x232a});config[_0x8c31('0xd')]=_['defaults'](config['redis'],{'host':_0x8c31('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8c31('0xd')]));require(_0x8c31('0xf'))[_0x8c31('0x10')](socket);function respondWithRpcPromise(_0x464b17,_0x36c6b3,_0xbe9c5a){return new BPromise(function(_0x3be848,_0x1d8116){return client[_0x8c31('0x11')](_0x464b17,_0xbe9c5a)[_0x8c31('0x12')](function(_0x75cb4){logger[_0x8c31('0x13')](_0x8c31('0x14'),_0x36c6b3,_0x8c31('0x15'));logger[_0x8c31('0x16')](_0x8c31('0x17'),_0x36c6b3,_0x8c31('0x15'),JSON['stringify'](_0x75cb4));if(_0x75cb4[_0x8c31('0x18')]){if(_0x75cb4[_0x8c31('0x18')][_0x8c31('0x19')]===0x1f4){logger[_0x8c31('0x18')](_0x8c31('0x14'),_0x36c6b3,_0x75cb4[_0x8c31('0x18')][_0x8c31('0x1a')]);return _0x1d8116(_0x75cb4[_0x8c31('0x18')][_0x8c31('0x1a')]);}logger[_0x8c31('0x18')](_0x8c31('0x14'),_0x36c6b3,_0x75cb4[_0x8c31('0x18')][_0x8c31('0x1a')]);return _0x3be848(_0x75cb4['error']['message']);}else{logger[_0x8c31('0x13')](_0x8c31('0x14'),_0x36c6b3,_0x8c31('0x15'));_0x3be848(_0x75cb4[_0x8c31('0x1b')][_0x8c31('0x1a')]);}})[_0x8c31('0x1c')](function(_0x4149f7){logger[_0x8c31('0x18')](_0x8c31('0x14'),_0x36c6b3,_0x4149f7);_0x1d8116(_0x4149f7);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 7408d20..aefbe9e 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 _0x5587=['update','removeListener','register','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x14bf27,_0x4888c5){var _0x3fbf35=function(_0x2a36e9){while(--_0x2a36e9){_0x14bf27['push'](_0x14bf27['shift']());}};_0x3fbf35(++_0x4888c5);}(_0x5587,0x1ee));var _0x7558=function(_0x3e1a3c,_0x2292fc){_0x3e1a3c=_0x3e1a3c-0x0;var _0x246da8=_0x5587[_0x3e1a3c];return _0x246da8;};'use strict';var ChatWebsiteEvents=require(_0x7558('0x0'));var events=[_0x7558('0x1'),_0x7558('0x2'),_0x7558('0x3')];function createListener(_0x22fa8e,_0x5868f9){return function(_0x47412b){_0x5868f9['emit'](_0x22fa8e,_0x47412b);};}function removeListener(_0x2a953e,_0x2afc0c){return function(){ChatWebsiteEvents[_0x7558('0x4')](_0x2a953e,_0x2afc0c);};}exports[_0x7558('0x5')]=function(_0x506fe5){for(var _0x37124e=0x0,_0x1a754d=events['length'];_0x37124e<_0x1a754d;_0x37124e++){var _0x125e34=events[_0x37124e];var _0x3026df=createListener(_0x7558('0x6')+_0x125e34,_0x506fe5);ChatWebsiteEvents['on'](_0x125e34,_0x3026df);}};
\ No newline at end of file
+var _0x1899=['chatWebsite:','remove','update','removeListener','register','length'];(function(_0x4a29b4,_0x6cad7b){var _0x280ffb=function(_0x531666){while(--_0x531666){_0x4a29b4['push'](_0x4a29b4['shift']());}};_0x280ffb(++_0x6cad7b);}(_0x1899,0x79));var _0x9189=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1899[_0x59ee6f];return _0x4c0979;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0x9189('0x0'),_0x9189('0x1')];function createListener(_0x401abe,_0x407dac){return function(_0x104198){_0x407dac['emit'](_0x401abe,_0x104198);};}function removeListener(_0x24b6fe,_0xaedbb4){return function(){ChatWebsiteEvents[_0x9189('0x2')](_0x24b6fe,_0xaedbb4);};}exports[_0x9189('0x3')]=function(_0x5be503){for(var _0x5e0c2a=0x0,_0x4c832b=events[_0x9189('0x4')];_0x5e0c2a<_0x4c832b;_0x5e0c2a++){var _0x5a19a1=events[_0x5e0c2a];var _0x4ad3b8=createListener(_0x9189('0x5')+_0x5a19a1,_0x5be503);ChatWebsiteEvents['on'](_0x5a19a1,_0x4ad3b8);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 6932fed..84e74b3 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 _0x837e=['replace','/:id/offline','addInteraction','/:id/applications','addApplications','addAgents','put','/:id','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','/:id/system_avatar','getInteractions','/:id/proactive_actions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','post','addDisposition','root','server/files/images/logos/','%s-%s','originalname','/:id/logo','file','addLogo','now','single','addAvatar','join','server/files/images/avatars/','format','/:id/customer_avatar','addCustomerAvatar','diskStorage','addSystemAvatar','/:id/notify','attachments','offline-chat','ensureDir','extname'];(function(_0x18fab5,_0x26cc8f){var _0x4dedae=function(_0x4cf737){while(--_0x4cf737){_0x18fab5['push'](_0x18fab5['shift']());}};_0x4dedae(++_0x26cc8f);}(_0x837e,0x90));var _0xe837=function(_0x5200ec,_0x5401b2){_0x5200ec=_0x5200ec-0x0;var _0x27ab97=_0x837e[_0x5200ec];return _0x27ab97;};'use strict';var multer=require(_0xe837('0x0'));var util=require(_0xe837('0x1'));var path=require(_0xe837('0x2'));var timeout=require(_0xe837('0x3'));var express=require(_0xe837('0x4'));var router=express[_0xe837('0x5')]();var fs_extra=require(_0xe837('0x6'));var auth=require(_0xe837('0x7'));var interaction=require(_0xe837('0x8'));var config=require(_0xe837('0x9'));var controller=require('./chatWebsite.controller');router[_0xe837('0xa')]('/',auth[_0xe837('0xb')](),controller['index']);router['get'](_0xe837('0xc'),auth[_0xe837('0xb')](),controller[_0xe837('0xd')]);router['get']('/:id',auth[_0xe837('0xb')](),controller[_0xe837('0xe')]);router['get'](_0xe837('0xf'),auth[_0xe837('0xb')](),controller['getDispositions']);router[_0xe837('0xa')](_0xe837('0x10'),auth[_0xe837('0xb')](),controller[_0xe837('0x11')]);router['get']('/:id/logo',controller[_0xe837('0x12')]);router[_0xe837('0xa')](_0xe837('0x13'),controller['getAvatar']);router[_0xe837('0xa')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0xe837('0xa')](_0xe837('0x14'),controller['getSystemAvatar']);router[_0xe837('0xa')]('/:id/interactions',auth[_0xe837('0xb')](),controller[_0xe837('0x15')]);router[_0xe837('0xa')]('/:id/snippet',controller['getSnippet']);router['get']('/:id/applications',auth[_0xe837('0xb')](),controller['getApplications']);router[_0xe837('0xa')](_0xe837('0x16'),auth[_0xe837('0xb')](),controller['getProactiveActions']);router[_0xe837('0xa')](_0xe837('0x17'),controller['getFields']);router[_0xe837('0xa')](_0xe837('0x18'),auth[_0xe837('0xb')](),controller[_0xe837('0x19')]);router[_0xe837('0xa')](_0xe837('0x1a'),auth[_0xe837('0xb')](),controller['getAgents']);router[_0xe837('0x1b')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe837('0x1b')](_0xe837('0xf'),auth[_0xe837('0xb')](),controller[_0xe837('0x1c')]);router[_0xe837('0x1b')](_0xe837('0x10'),auth[_0xe837('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x37595e,_0xdf1739,_0x353189){_0x353189(null,path['join'](config[_0xe837('0x1d')],_0xe837('0x1e')));},'filename':function(_0x128bc1,_0x59c59b,_0xc515d1){_0xc515d1(null,util['format'](_0xe837('0x1f'),Date['now'](),_0x59c59b[_0xe837('0x20')]));}})});router[_0xe837('0x1b')](_0xe837('0x21'),upload['single'](_0xe837('0x22')),controller[_0xe837('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x51fc12,_0x11cfe8,_0x18a954){_0x18a954(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x3b73a0,_0x728779,_0x208e2b){_0x208e2b(null,util['format']('%s-%s',Date[_0xe837('0x24')](),_0x728779[_0xe837('0x20')]));}})});router[_0xe837('0x1b')](_0xe837('0x13'),upload[_0xe837('0x25')](_0xe837('0x22')),controller[_0xe837('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3a53ee,_0x3f96fa,_0x5e7e0d){_0x5e7e0d(null,path[_0xe837('0x27')](config['root'],_0xe837('0x28')));},'filename':function(_0x1eda6f,_0x1cc840,_0x5523b2){_0x5523b2(null,util[_0xe837('0x29')](_0xe837('0x1f'),Date[_0xe837('0x24')](),_0x1cc840[_0xe837('0x20')]));}})});router[_0xe837('0x1b')](_0xe837('0x2a'),upload[_0xe837('0x25')](_0xe837('0x22')),controller[_0xe837('0x2b')]);var upload=multer({'storage':multer[_0xe837('0x2c')]({'destination':function(_0x38d555,_0x4fe8bd,_0xb05bca){_0xb05bca(null,path[_0xe837('0x27')](config[_0xe837('0x1d')],_0xe837('0x28')));},'filename':function(_0x533f92,_0x52f361,_0xb1a4fb){_0xb1a4fb(null,util['format'](_0xe837('0x1f'),Date[_0xe837('0x24')](),_0x52f361['originalname']));}})});router[_0xe837('0x1b')](_0xe837('0x14'),upload['single'](_0xe837('0x22')),controller[_0xe837('0x2d')]);router[_0xe837('0x1b')](_0xe837('0x2e'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xe837('0x2c')]({'destination':function(_0x2c7fa0,_0x16230c,_0x26f57c){const _0x30c0c9=path[_0xe837('0x27')](config[_0xe837('0x1d')],'server/files',_0xe837('0x2f'),_0xe837('0x30'));fs_extra[_0xe837('0x31')](_0x30c0c9,function(){_0x26f57c(null,_0x30c0c9);});},'filename':function(_0x202ca3,_0x68022e,_0x3cb680){const _0x12df1d=_0x68022e[_0xe837('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x398dc9=path[_0xe837('0x32')](_0x12df1d);const _0x33d998=Date[_0xe837('0x24')]()+'-'+_0x12df1d[_0xe837('0x33')](_0x398dc9,'')+_0x398dc9;_0x3cb680(null,_0x33d998);}})});router[_0xe837('0x1b')](_0xe837('0x34'),offlineUploadMulter['any'](),controller['offline']);router[_0xe837('0x1b')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xe837('0x35')]);router['post'](_0xe837('0x36'),auth[_0xe837('0xb')](),controller[_0xe837('0x37')]);router[_0xe837('0x1b')]('/:id/proactive_actions',auth[_0xe837('0xb')](),controller['addProactiveActions']);router['post'](_0xe837('0x1a'),auth[_0xe837('0xb')](),controller[_0xe837('0x38')]);router[_0xe837('0x39')](_0xe837('0x3a'),auth[_0xe837('0xb')](),controller['update']);router['delete'](_0xe837('0x3a'),auth[_0xe837('0xb')](),controller[_0xe837('0x3b')]);router[_0xe837('0x3c')](_0xe837('0xf'),auth[_0xe837('0xb')](),controller[_0xe837('0x3d')]);router[_0xe837('0x3c')](_0xe837('0x10'),auth[_0xe837('0xb')](),controller[_0xe837('0x3e')]);router[_0xe837('0x3c')](_0xe837('0x1a'),auth[_0xe837('0xb')](),controller[_0xe837('0x3f')]);module[_0xe837('0x40')]=router;
\ No newline at end of file
+var _0x292d=['originalname','single','file','addLogo','join','root','%s-%s','addAvatar','server/files/images/avatars/','notify','server/files','attachments','offline-chat','ensureDir','/:id/offline','any','offline','addInteraction','/:id/applications','addProactiveActions','addAgents','put','update','destroy','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','server/files/images/logos/','format','now'];(function(_0x4721e4,_0x52615b){var _0x168c20=function(_0x525e1e){while(--_0x525e1e){_0x4721e4['push'](_0x4721e4['shift']());}};_0x168c20(++_0x52615b);}(_0x292d,0x134));var _0xd292=function(_0x55e059,_0x2df2c5){_0x55e059=_0x55e059-0x0;var _0x1e6bb7=_0x292d[_0x55e059];return _0x1e6bb7;};'use strict';var multer=require(_0xd292('0x0'));var util=require(_0xd292('0x1'));var path=require(_0xd292('0x2'));var timeout=require(_0xd292('0x3'));var express=require(_0xd292('0x4'));var router=express[_0xd292('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd292('0x6'));var config=require(_0xd292('0x7'));var controller=require(_0xd292('0x8'));router[_0xd292('0x9')]('/',auth[_0xd292('0xa')](),controller[_0xd292('0xb')]);router['get']('/describe',auth[_0xd292('0xa')](),controller[_0xd292('0xc')]);router[_0xd292('0x9')](_0xd292('0xd'),auth[_0xd292('0xa')](),controller[_0xd292('0xe')]);router['get'](_0xd292('0xf'),auth[_0xd292('0xa')](),controller[_0xd292('0x10')]);router['get'](_0xd292('0x11'),auth[_0xd292('0xa')](),controller['getAnswers']);router[_0xd292('0x9')](_0xd292('0x12'),controller['getLogo']);router[_0xd292('0x9')](_0xd292('0x13'),controller[_0xd292('0x14')]);router['get'](_0xd292('0x15'),controller[_0xd292('0x16')]);router[_0xd292('0x9')]('/:id/system_avatar',controller[_0xd292('0x17')]);router[_0xd292('0x9')](_0xd292('0x18'),auth[_0xd292('0xa')](),controller[_0xd292('0x19')]);router['get'](_0xd292('0x1a'),controller['getSnippet']);router['get']('/:id/applications',auth[_0xd292('0xa')](),controller[_0xd292('0x1b')]);router['get'](_0xd292('0x1c'),auth[_0xd292('0xa')](),controller[_0xd292('0x1d')]);router[_0xd292('0x9')](_0xd292('0x1e'),controller['getFields']);router[_0xd292('0x9')](_0xd292('0x1f'),auth[_0xd292('0xa')](),controller[_0xd292('0x20')]);router[_0xd292('0x9')](_0xd292('0x21'),auth[_0xd292('0xa')](),controller['getAgents']);router[_0xd292('0x22')]('/',auth[_0xd292('0xa')](),controller[_0xd292('0x23')]);router['post'](_0xd292('0xf'),auth[_0xd292('0xa')](),controller[_0xd292('0x24')]);router[_0xd292('0x22')](_0xd292('0x11'),auth['isAuthenticated'](),controller[_0xd292('0x25')]);var upload=multer({'storage':multer[_0xd292('0x26')]({'destination':function(_0x3719fb,_0x188d70,_0x49e141){_0x49e141(null,path['join'](config['root'],_0xd292('0x27')));},'filename':function(_0x45f17b,_0x43b3ac,_0xf6c15f){_0xf6c15f(null,util[_0xd292('0x28')]('%s-%s',Date[_0xd292('0x29')](),_0x43b3ac[_0xd292('0x2a')]));}})});router[_0xd292('0x22')](_0xd292('0x12'),upload[_0xd292('0x2b')](_0xd292('0x2c')),controller[_0xd292('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5bbb4,_0x2aaa77,_0x4127b5){_0x4127b5(null,path[_0xd292('0x2e')](config[_0xd292('0x2f')],'server/files/images/avatars/'));},'filename':function(_0x107cbb,_0x4ce20f,_0x2f3fed){_0x2f3fed(null,util['format'](_0xd292('0x30'),Date[_0xd292('0x29')](),_0x4ce20f['originalname']));}})});router[_0xd292('0x22')]('/:id/avatar',upload[_0xd292('0x2b')]('file'),controller[_0xd292('0x31')]);var upload=multer({'storage':multer[_0xd292('0x26')]({'destination':function(_0x3bc015,_0x5316a1,_0x2c75aa){_0x2c75aa(null,path[_0xd292('0x2e')](config[_0xd292('0x2f')],_0xd292('0x32')));},'filename':function(_0x549cff,_0x32af85,_0x4fef45){_0x4fef45(null,util[_0xd292('0x28')](_0xd292('0x30'),Date['now'](),_0x32af85['originalname']));}})});router[_0xd292('0x22')](_0xd292('0x15'),upload[_0xd292('0x2b')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xd292('0x26')]({'destination':function(_0x12f399,_0x187920,_0x185aec){_0x185aec(null,path[_0xd292('0x2e')](config[_0xd292('0x2f')],_0xd292('0x32')));},'filename':function(_0xc99e2c,_0x2832f3,_0x6c8ea5){_0x6c8ea5(null,util[_0xd292('0x28')]('%s-%s',Date[_0xd292('0x29')](),_0x2832f3[_0xd292('0x2a')]));}})});router[_0xd292('0x22')]('/:id/system_avatar',upload[_0xd292('0x2b')](_0xd292('0x2c')),controller['addSystemAvatar']);router[_0xd292('0x22')]('/:id/notify',controller[_0xd292('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0xd292('0x26')]({'destination':function(_0x2e020c,_0x395a35,_0xca99ea){const _0x5f3f8b=path[_0xd292('0x2e')](config[_0xd292('0x2f')],_0xd292('0x34'),_0xd292('0x35'),_0xd292('0x36'));fs_extra[_0xd292('0x37')](_0x5f3f8b,function(){_0xca99ea(null,_0x5f3f8b);});},'filename':function(_0x8feb04,_0x50949e,_0x567c70){const _0x164460=_0x50949e[_0xd292('0x2a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xa99af5=path['extname'](_0x164460);const _0x501584=Date['now']()+'-'+_0x164460['replace'](_0xa99af5,'')+_0xa99af5;_0x567c70(null,_0x501584);}})});router[_0xd292('0x22')](_0xd292('0x38'),offlineUploadMulter[_0xd292('0x39')](),controller[_0xd292('0x3a')]);router[_0xd292('0x22')](_0xd292('0x18'),auth[_0xd292('0xa')](),controller[_0xd292('0x3b')]);router[_0xd292('0x22')](_0xd292('0x3c'),auth[_0xd292('0xa')](),controller['addApplications']);router[_0xd292('0x22')](_0xd292('0x1c'),auth[_0xd292('0xa')](),controller[_0xd292('0x3d')]);router[_0xd292('0x22')](_0xd292('0x21'),auth[_0xd292('0xa')](),controller[_0xd292('0x3e')]);router[_0xd292('0x3f')](_0xd292('0xd'),auth[_0xd292('0xa')](),controller[_0xd292('0x40')]);router['delete']('/:id',auth[_0xd292('0xa')](),controller[_0xd292('0x41')]);router['delete'](_0xd292('0xf'),auth[_0xd292('0xa')](),controller['removeDispositions']);router[_0xd292('0x42')]('/:id/canned_answers',auth[_0xd292('0xa')](),controller[_0xd292('0x43')]);router[_0xd292('0x42')](_0xd292('0x21'),auth['isAuthenticated'](),controller[_0xd292('0x44')]);module[_0xd292('0x45')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 02bec9f..e823182 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 _0x8d16=['/client-logs','use','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d16,0xac));var _0x68d1=function(_0x56db77,_0x36c201){_0x56db77=_0x56db77-0x0;var _0x1536b5=_0x8d16[_0x56db77];return _0x1536b5;};var beaverLogger=require(_0x68d1('0x0'));var express=require('express');var auth=require(_0x68d1('0x1'));var config=require(_0x68d1('0x2'));var router=express[_0x68d1('0x3')]();var isProduction=config['env']===_0x68d1('0x4')||![];function clientSideLogs(_0x159c69,_0x239eb5,_0x350e3d){var _0x227d4b=_0x159c69[_0x68d1('0x5')][_0x68d1('0x6')](_0x68d1('0x7'));if(!_0x227d4b){throw new Error(_0x68d1('0x8'));}return beaverLogger[_0x68d1('0x9')]({'uri':_0x68d1('0xa'),'logger':_0x227d4b,'enableCors':!isProduction})(_0x159c69,_0x239eb5,_0x350e3d);}router[_0x68d1('0xb')](auth['isAuthenticated'](),clientSideLogs);module[_0x68d1('0xc')]=router;
\ No newline at end of file
+var _0xa6aa=['Router','env','production','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0xa6aa,0x88));var _0xaa6a=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0xa6aa[_0x4914e2];return _0x2dcd07;};var beaverLogger=require(_0xaa6a('0x0'));var express=require(_0xaa6a('0x1'));var auth=require(_0xaa6a('0x2'));var config=require(_0xaa6a('0x3'));var router=express[_0xaa6a('0x4')]();var isProduction=config[_0xaa6a('0x5')]===_0xaa6a('0x6')||![];function clientSideLogs(_0x4f1579,_0x409bfe,_0x22dd76){var _0x47c78f=_0x4f1579[_0xaa6a('0x7')][_0xaa6a('0x8')]('client-side-logger');if(!_0x47c78f){throw new Error(_0xaa6a('0x9'));}return beaverLogger[_0xaa6a('0xa')]({'uri':'/client-logs','logger':_0x47c78f,'enableCors':!isProduction})(_0x4f1579,_0x409bfe,_0x22dd76);}router[_0xaa6a('0xb')](auth[_0xaa6a('0xc')](),clientSideLogs);module[_0xaa6a('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 0b99df9..b401a2c 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 _0xff86=['TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0x3dd3b9,_0xe55c40){var _0x1e70f0=function(_0x38a5a5){while(--_0x38a5a5){_0x3dd3b9['push'](_0x3dd3b9['shift']());}};_0x1e70f0(++_0xe55c40);}(_0xff86,0xff));var _0x6ff8=function(_0x360a3b,_0x10b3a6){_0x360a3b=_0x360a3b-0x0;var _0x3a8938=_0xff86[_0x360a3b];return _0x3a8938;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6ff8('0x0')](_0x6ff8('0x1'),_0x6ff8('0x2'),_0x6ff8('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x6ff8('0x0')](_0x6ff8('0x4'),_0x6ff8('0x5'))},'data1':{'type':Sequelize[_0x6ff8('0x6')],'comment':_0x6ff8('0x7')},'data2':{'type':Sequelize[_0x6ff8('0x6')],'comment':_0x6ff8('0x8')},'data3':{'type':Sequelize[_0x6ff8('0x6')],'comment':_0x6ff8('0x9')},'data4':{'type':Sequelize[_0x6ff8('0x6')],'comment':_0x6ff8('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x6ff8('0xb')],'comment':_0x6ff8('0xc')},'data7':{'type':Sequelize[_0x6ff8('0xb')],'comment':_0x6ff8('0xd')}};
\ No newline at end of file
+var _0x90c2=['ENUM','Google','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports'];(function(_0x1d3aef,_0x4002ea){var _0xa94a6a=function(_0xd26f4b){while(--_0xd26f4b){_0x1d3aef['push'](_0x1d3aef['shift']());}};_0xa94a6a(++_0x4002ea);}(_0x90c2,0x1a2));var _0x290c=function(_0x5d1f6a,_0xf6481c){_0x5d1f6a=_0x5d1f6a-0x0;var _0x9d09e8=_0x90c2[_0x5d1f6a];return _0x9d09e8;};'use strict';var Sequelize=require(_0x290c('0x0'));module[_0x290c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x290c('0x2')]('AmazonAWS',_0x290c('0x3'),_0x290c('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x290c('0x2')](_0x290c('0x5'),_0x290c('0x6'))},'data1':{'type':Sequelize[_0x290c('0x7')],'comment':_0x290c('0x8')},'data2':{'type':Sequelize[_0x290c('0x7')],'comment':_0x290c('0x9')},'data3':{'type':Sequelize[_0x290c('0x7')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x290c('0x7')],'comment':_0x290c('0xa')},'data5':{'type':Sequelize[_0x290c('0xb')],'comment':_0x290c('0xc')},'data6':{'type':Sequelize[_0x290c('0xb')],'comment':_0x290c('0xd')},'data7':{'type':Sequelize['TEXT'],'comment':_0x290c('0xe')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 37aa1dc..55b4da8 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 _0x09a0=['find','Name\x20parameter\x20not\x20specified','body','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','microsoftAuthorization:success','emit','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','sendStatus','status','end','json','offset','count','limit','set','Content-Range','update','then','destroy','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','params','length'];(function(_0x324642,_0x1adc4e){var _0x16d6f6=function(_0x30d3c5){while(--_0x30d3c5){_0x324642['push'](_0x324642['shift']());}};_0x16d6f6(++_0x1adc4e);}(_0x09a0,0x191));var _0x009a=function(_0x212212,_0x45c310){_0x212212=_0x212212-0x0;var _0x351f5a=_0x09a0[_0x212212];return _0x351f5a;};'use strict';var _=require(_0x009a('0x0'));var Redis=require(_0x009a('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x009a('0x2'));var config=require(_0x009a('0x3'));var logger=require(_0x009a('0x4'))(_0x009a('0x5'));var db=require(_0x009a('0x6'))['db'];var oauth=require(_0x009a('0x7'));config['redis']=_[_0x009a('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0x009a('0x9')]);function respondWithStatusCode(_0x347559,_0x4770ce){_0x4770ce=_0x4770ce||0xcc;return function(_0x545155){if(_0x545155){return _0x347559[_0x009a('0xa')](_0x4770ce);}return _0x347559[_0x009a('0xb')](_0x4770ce)[_0x009a('0xc')]();};}function respondWithResult(_0x50e3c1,_0x31bb9d){_0x31bb9d=_0x31bb9d||0xc8;return function(_0x473512){if(_0x473512){return _0x50e3c1['status'](_0x31bb9d)[_0x009a('0xd')](_0x473512);}};}function respondWithFilteredResult(_0x318ea1,_0x5d48b3){return function(_0x5addfd){if(_0x5addfd){var _0x511b81=typeof _0x5d48b3[_0x009a('0xe')]==='undefined'&&typeof _0x5d48b3['limit']==='undefined';var _0x62b735=_0x5addfd[_0x009a('0xf')];var _0x41c02a=_0x511b81?0x0:_0x5d48b3['offset'];var _0x10897b=_0x511b81?_0x5addfd['count']:_0x5d48b3['offset']+_0x5d48b3[_0x009a('0x10')];var _0x1316f7;if(_0x10897b>=_0x62b735){_0x10897b=_0x62b735;_0x1316f7=0xc8;}else{_0x1316f7=0xce;}_0x318ea1[_0x009a('0xb')](_0x1316f7);return _0x318ea1[_0x009a('0x11')](_0x009a('0x12'),_0x41c02a+'-'+_0x10897b+'/'+_0x62b735)[_0x009a('0xd')](_0x5addfd);}return null;};}function saveUpdates(_0x1643ad){return function(_0x7d7837){if(_0x7d7837){return _0x7d7837[_0x009a('0x13')](_0x1643ad)[_0x009a('0x14')](function(_0xeccff){return _0xeccff;});}return null;};}function removeEntity(_0x10677e){return function(_0x5acc9f){if(_0x5acc9f){return _0x5acc9f[_0x009a('0x15')]()['then'](function(){_0x10677e[_0x009a('0xb')](0xcc)[_0x009a('0xc')]();});}};}function handleEntityNotFound(_0x29bfbe){return function(_0x2e7f14){if(!_0x2e7f14){_0x29bfbe['sendStatus'](0x194);}return _0x2e7f14;};}function handleError(_0xd66d51,_0x30cf18){_0x30cf18=_0x30cf18||0x1f4;return function(_0x2f0b3c){logger[_0x009a('0x16')](_0x2f0b3c['stack']);if(_0x2f0b3c[_0x009a('0x17')]){delete _0x2f0b3c[_0x009a('0x17')];}_0xd66d51[_0x009a('0xb')](_0x30cf18)[_0x009a('0x18')](_0x2f0b3c);};}function maskClientSecret(_0x527506){return _[_0x009a('0x19')](_0x527506[_0x009a('0x1a')](0x0,0x3),0x14,'*');}exports[_0x009a('0x1b')]=function(_0x5ab2a4,_0x2c8b3a){var _0x1381de={},_0x10fa70={},_0x12ff93={'count':0x0,'rows':[]};var _0x3dc4fb=_[_0x009a('0x1c')](db[_0x009a('0x1d')][_0x009a('0x1e')],function(_0x22160f){return{'name':_0x22160f[_0x009a('0x1f')],'type':_0x22160f[_0x009a('0x20')][_0x009a('0x21')]};});_0x10fa70['model']=_[_0x009a('0x1c')](_0x3dc4fb,_0x009a('0x17'));_0x10fa70[_0x009a('0x22')]=_[_0x009a('0x23')](_0x5ab2a4['query']);_0x10fa70[_0x009a('0x24')]=_[_0x009a('0x25')](_0x10fa70[_0x009a('0x26')],_0x10fa70[_0x009a('0x22')]);_0x1381de[_0x009a('0x27')]=_[_0x009a('0x25')](_0x10fa70[_0x009a('0x26')],qs['fields'](_0x5ab2a4[_0x009a('0x22')][_0x009a('0x28')]));_0x1381de['attributes']=_0x1381de[_0x009a('0x27')]['length']?_0x1381de['attributes']:_0x10fa70[_0x009a('0x26')];if(!_0x5ab2a4[_0x009a('0x22')][_0x009a('0x29')](_0x009a('0x2a'))){_0x1381de[_0x009a('0x10')]=qs['limit'](_0x5ab2a4[_0x009a('0x22')][_0x009a('0x10')]);_0x1381de[_0x009a('0xe')]=qs[_0x009a('0xe')](_0x5ab2a4[_0x009a('0x22')][_0x009a('0xe')]);}_0x1381de['order']=qs[_0x009a('0x2b')](_0x5ab2a4[_0x009a('0x22')][_0x009a('0x2b')]);_0x1381de['where']=qs[_0x009a('0x24')](_['pick'](_0x5ab2a4[_0x009a('0x22')],_0x10fa70['filters']),_0x3dc4fb);if(_0x5ab2a4['query'][_0x009a('0x2c')]){_0x1381de[_0x009a('0x2d')]=_[_0x009a('0x2e')](_0x1381de['where'],{'$or':_[_0x009a('0x1c')](_0x3dc4fb,function(_0x57603e){if(_0x57603e[_0x009a('0x20')]!==_0x009a('0x2f')){var _0x2c27fc={};_0x2c27fc[_0x57603e[_0x009a('0x17')]]={'$like':'%'+_0x5ab2a4[_0x009a('0x22')][_0x009a('0x2c')]+'%'};return _0x2c27fc;}})});}_0x1381de=_[_0x009a('0x2e')]({},_0x1381de,_0x5ab2a4[_0x009a('0x30')]);var _0x37312d={'where':_0x1381de[_0x009a('0x2d')]};return db[_0x009a('0x1d')][_0x009a('0xf')](_0x37312d)[_0x009a('0x14')](function(_0x11f701){_0x12ff93[_0x009a('0xf')]=_0x11f701;if(_0x5ab2a4[_0x009a('0x22')][_0x009a('0x31')]){_0x1381de['include']=[{'all':!![]}];}return db[_0x009a('0x1d')][_0x009a('0x32')](_0x1381de);})[_0x009a('0x14')](function(_0x98012e){_0x12ff93['rows']=_[_0x009a('0x1c')](_0x98012e,function(_0x43ea5b){if(_0x43ea5b[_0x009a('0x33')]===_0x009a('0x34')){var _0x45241e=encryptor[_0x009a('0x35')](_0x43ea5b['data3']);_0x43ea5b[_0x009a('0x36')]=maskClientSecret(_0x45241e);}return _0x43ea5b;});return _0x12ff93;})[_0x009a('0x14')](respondWithFilteredResult(_0x2c8b3a,_0x1381de))[_0x009a('0x37')](handleError(_0x2c8b3a,null));};exports[_0x009a('0x38')]=function(_0x2a97a6,_0x2c4aa6){var _0x4d923f={'raw':!![],'where':{'id':_0x2a97a6[_0x009a('0x39')]['id']}},_0x40d44e={};_0x40d44e[_0x009a('0x26')]=_[_0x009a('0x23')](db['CloudProvider'][_0x009a('0x1e')]);_0x40d44e[_0x009a('0x22')]=_[_0x009a('0x23')](_0x2a97a6['query']);_0x40d44e['filters']=_[_0x009a('0x25')](_0x40d44e[_0x009a('0x26')],_0x40d44e['query']);_0x4d923f[_0x009a('0x27')]=_['intersection'](_0x40d44e[_0x009a('0x26')],qs[_0x009a('0x28')](_0x2a97a6[_0x009a('0x22')][_0x009a('0x28')]));_0x4d923f['attributes']=_0x4d923f['attributes'][_0x009a('0x3a')]?_0x4d923f[_0x009a('0x27')]:_0x40d44e[_0x009a('0x26')];if(_0x2a97a6[_0x009a('0x22')][_0x009a('0x31')]){_0x4d923f['include']=[{'all':!![]}];}_0x4d923f=_['merge']({},_0x4d923f,_0x2a97a6[_0x009a('0x30')]);return db[_0x009a('0x1d')][_0x009a('0x3b')](_0x4d923f)['then'](handleEntityNotFound(_0x2c4aa6,null))[_0x009a('0x14')](function(_0x565175){if(_0x565175[_0x009a('0x33')]==='MicrosoftAzure'){var _0x3be605=encryptor[_0x009a('0x35')](_0x565175[_0x009a('0x36')]);_0x565175[_0x009a('0x36')]=maskClientSecret(_0x3be605);}return _0x565175;})[_0x009a('0x14')](respondWithResult(_0x2c4aa6,null))['catch'](handleError(_0x2c4aa6,null));};exports['create']=function(_0x2de557,_0x1c77fc){if(!_0x2de557['body'][_0x009a('0x17')])throw new Error(_0x009a('0x3c'));if(!_0x2de557[_0x009a('0x3d')][_0x009a('0x33')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x22bfa0=db[_0x009a('0x1d')][_0x009a('0x1e')][_0x009a('0x33')][_0x009a('0x3e')];if(!_0x22bfa0['includes'](_0x2de557['body'][_0x009a('0x33')]))throw new Error(_0x009a('0x3f')+_0x22bfa0[_0x009a('0x40')](',\x20'));if(_0x2de557['body'][_0x009a('0x33')]===_0x009a('0x34')&&_0x2de557['body'][_0x009a('0x36')]){_0x2de557[_0x009a('0x3d')][_0x009a('0x36')]=encryptor['encryptString'](_0x2de557['body'][_0x009a('0x36')]);}return db[_0x009a('0x1d')]['create'](_0x2de557[_0x009a('0x3d')],{})[_0x009a('0x14')](respondWithResult(_0x1c77fc,0xc9))[_0x009a('0x37')](handleError(_0x1c77fc,null));};exports[_0x009a('0x13')]=function(_0xed6156,_0x3ddb8e){if(_0xed6156['body']['id']){delete _0xed6156[_0x009a('0x3d')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0xed6156[_0x009a('0x39')]['id']}})[_0x009a('0x14')](handleEntityNotFound(_0x3ddb8e,null))['then'](function(_0x235f2f){if(_0x235f2f[_0x009a('0x33')]===_0x009a('0x34')&&_0xed6156['body'][_0x009a('0x36')]){_0xed6156[_0x009a('0x3d')][_0x009a('0x36')]=encryptor[_0x009a('0x41')](_0xed6156[_0x009a('0x3d')][_0x009a('0x36')]);}return _0x235f2f;})[_0x009a('0x14')](saveUpdates(_0xed6156['body'],null))[_0x009a('0x14')](respondWithResult(_0x3ddb8e,null))[_0x009a('0x37')](handleError(_0x3ddb8e,null));};exports['destroy']=function(_0x45e8bb,_0x23c94b){return db[_0x009a('0x1d')]['find']({'where':{'id':_0x45e8bb[_0x009a('0x39')]['id']}})['then'](handleEntityNotFound(_0x23c94b,null))[_0x009a('0x14')](removeEntity(_0x23c94b,null))[_0x009a('0x37')](handleError(_0x23c94b,null));};exports[_0x009a('0x42')]=function(_0x42c4e1,_0x6bb874){return db[_0x009a('0x1d')]['findOne']({'where':{'id':_0x42c4e1[_0x009a('0x39')]['id']},'raw':!![]})[_0x009a('0x14')](function(_0x5d1bcd){if(!_0x5d1bcd)return _0x6bb874[_0x009a('0xa')](0x194);return{'url':oauth[_0x009a('0x43')](_0x5d1bcd,_0x42c4e1['user']['id'])};})[_0x009a('0x14')](respondWithResult(_0x6bb874,null))[_0x009a('0x37')](handleError(_0x6bb874,null));};exports[_0x009a('0x44')]=function(_0x535c63,_0x291286){var _0x13593c=_0x535c63[_0x009a('0x3d')];var _0x1ebeaa;var _0x3d0121;if(_0x13593c[_0x009a('0x16')])throw _0x13593c;redis[_0x009a('0x45')](_0x13593c['state'])[_0x009a('0x14')](function(_0x2980bc){if(!_0x2980bc)throw new Error(_0x009a('0x46'));_0x1ebeaa=JSON[_0x009a('0x47')](_0x2980bc);var _0x297e94=Buffer[_0x009a('0x48')](_0x13593c[_0x009a('0x49')],'base64')[_0x009a('0x4a')](_0x009a('0x4b'));_0x3d0121=JSON[_0x009a('0x47')](_0x297e94);if(!oauth[_0x009a('0x4c')](_0x13593c[_0x009a('0x4d')],_0x1ebeaa[_0x009a('0x4e')]))throw new Error(_0x009a('0x4f'));redis['del'](_0x13593c['state']);return oauth[_0x009a('0x50')](_0x13593c[_0x009a('0x51')],_0x1ebeaa);})[_0x009a('0x14')](function(_0x2a3a72){_0x1ebeaa[_0x009a('0x52')]=_0x2a3a72['access_token'];_0x1ebeaa[_0x009a('0x53')]=_0x2a3a72[_0x009a('0x54')];return db['CloudProvider']['update']({'data5':_0x1ebeaa['data5'],'data6':_0x1ebeaa[_0x009a('0x53')]},{'where':{'id':_0x1ebeaa['id']}});})[_0x009a('0x14')](function(){oauth[_0x009a('0x55')](_0x1ebeaa);socket['emit'](_0x009a('0x56'),{'id':_0x3d0121['id']});return;})[_0x009a('0x14')](respondWithStatusCode(_0x291286,null))['catch'](function(_0x5d9796){if(_0x3d0121){socket[_0x009a('0x57')]('microsoftAuthorization:error',{'id':_0x3d0121['id']});}if(!_0x1ebeaa){logger[_0x009a('0x16')](_0x009a('0x58'),_0x5d9796);return _0x291286[_0x009a('0xb')](0x1f4)[_0x009a('0x18')](_0x5d9796[_0x009a('0x59')]);}logger[_0x009a('0x16')](_0x009a('0x5a'),_0x1ebeaa['id'],JSON[_0x009a('0x5b')](_0x5d9796));});};
\ No newline at end of file
+var _0x0b20=['sort','where','pick','VIRTUAL','filter','merge','options','then','include','findAll','rows','MicrosoftAzure','decryptString','data3','show','includeAll','find','service','catch','create','body','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','params','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','access_token','refresh_token','data6','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','set','Content-Range','update','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','order'];(function(_0x485d2c,_0x4a841a){var _0x41308c=function(_0x22e5e1){while(--_0x22e5e1){_0x485d2c['push'](_0x485d2c['shift']());}};_0x41308c(++_0x4a841a);}(_0x0b20,0xe8));var _0x00b2=function(_0x484c46,_0x1b2295){_0x484c46=_0x484c46-0x0;var _0x225ff1=_0x0b20[_0x484c46];return _0x225ff1;};'use strict';var _=require(_0x00b2('0x0'));var Redis=require(_0x00b2('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x00b2('0x2'));var config=require('../../config/environment');var logger=require(_0x00b2('0x3'))(_0x00b2('0x4'));var db=require(_0x00b2('0x5'))['db'];var oauth=require(_0x00b2('0x6'));config[_0x00b2('0x7')]=_[_0x00b2('0x8')](config['redis'],{'host':_0x00b2('0x9'),'port':0x18eb});var socket=require(_0x00b2('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x00b2('0x7')]);function respondWithStatusCode(_0x1136e2,_0x13657c){_0x13657c=_0x13657c||0xcc;return function(_0x27b797){if(_0x27b797){return _0x1136e2['sendStatus'](_0x13657c);}return _0x1136e2[_0x00b2('0xb')](_0x13657c)[_0x00b2('0xc')]();};}function respondWithResult(_0x3fbb1e,_0x24c15f){_0x24c15f=_0x24c15f||0xc8;return function(_0x4f217c){if(_0x4f217c){return _0x3fbb1e['status'](_0x24c15f)[_0x00b2('0xd')](_0x4f217c);}};}function respondWithFilteredResult(_0x46b5ac,_0x2d1eff){return function(_0x49796e){if(_0x49796e){var _0x25c775=typeof _0x2d1eff[_0x00b2('0xe')]===_0x00b2('0xf')&&typeof _0x2d1eff[_0x00b2('0x10')]===_0x00b2('0xf');var _0x257ee7=_0x49796e[_0x00b2('0x11')];var _0x3c464e=_0x25c775?0x0:_0x2d1eff[_0x00b2('0xe')];var _0x30b528=_0x25c775?_0x49796e['count']:_0x2d1eff['offset']+_0x2d1eff[_0x00b2('0x10')];var _0x22c816;if(_0x30b528>=_0x257ee7){_0x30b528=_0x257ee7;_0x22c816=0xc8;}else{_0x22c816=0xce;}_0x46b5ac[_0x00b2('0xb')](_0x22c816);return _0x46b5ac[_0x00b2('0x12')](_0x00b2('0x13'),_0x3c464e+'-'+_0x30b528+'/'+_0x257ee7)[_0x00b2('0xd')](_0x49796e);}return null;};}function saveUpdates(_0x1cc679){return function(_0x3e505a){if(_0x3e505a){return _0x3e505a[_0x00b2('0x14')](_0x1cc679)['then'](function(_0x4332fb){return _0x4332fb;});}return null;};}function removeEntity(_0x2a9ff0){return function(_0x121d42){if(_0x121d42){return _0x121d42['destroy']()['then'](function(){_0x2a9ff0[_0x00b2('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x506448){return function(_0x293546){if(!_0x293546){_0x506448['sendStatus'](0x194);}return _0x293546;};}function handleError(_0x22eb83,_0x52afe7){_0x52afe7=_0x52afe7||0x1f4;return function(_0x49078e){logger[_0x00b2('0x15')](_0x49078e['stack']);if(_0x49078e[_0x00b2('0x16')]){delete _0x49078e[_0x00b2('0x16')];}_0x22eb83[_0x00b2('0xb')](_0x52afe7)[_0x00b2('0x17')](_0x49078e);};}function maskClientSecret(_0x4d2e2f){return _[_0x00b2('0x18')](_0x4d2e2f[_0x00b2('0x19')](0x0,0x3),0x14,'*');}exports[_0x00b2('0x1a')]=function(_0x496653,_0x23f4d0){var _0x34d138={},_0x278302={},_0x8a2513={'count':0x0,'rows':[]};var _0xd071ee=_[_0x00b2('0x1b')](db[_0x00b2('0x1c')][_0x00b2('0x1d')],function(_0x596558){return{'name':_0x596558[_0x00b2('0x1e')],'type':_0x596558[_0x00b2('0x1f')][_0x00b2('0x20')]};});_0x278302['model']=_[_0x00b2('0x1b')](_0xd071ee,_0x00b2('0x16'));_0x278302['query']=_[_0x00b2('0x21')](_0x496653[_0x00b2('0x22')]);_0x278302[_0x00b2('0x23')]=_[_0x00b2('0x24')](_0x278302['model'],_0x278302[_0x00b2('0x22')]);_0x34d138[_0x00b2('0x25')]=_['intersection'](_0x278302[_0x00b2('0x26')],qs[_0x00b2('0x27')](_0x496653[_0x00b2('0x22')][_0x00b2('0x27')]));_0x34d138[_0x00b2('0x25')]=_0x34d138['attributes']['length']?_0x34d138[_0x00b2('0x25')]:_0x278302[_0x00b2('0x26')];if(!_0x496653[_0x00b2('0x22')]['hasOwnProperty']('nolimit')){_0x34d138[_0x00b2('0x10')]=qs[_0x00b2('0x10')](_0x496653[_0x00b2('0x22')][_0x00b2('0x10')]);_0x34d138[_0x00b2('0xe')]=qs[_0x00b2('0xe')](_0x496653[_0x00b2('0x22')][_0x00b2('0xe')]);}_0x34d138[_0x00b2('0x28')]=qs['sort'](_0x496653[_0x00b2('0x22')][_0x00b2('0x29')]);_0x34d138[_0x00b2('0x2a')]=qs[_0x00b2('0x23')](_[_0x00b2('0x2b')](_0x496653[_0x00b2('0x22')],_0x278302[_0x00b2('0x23')]),_0xd071ee);if(_0x496653[_0x00b2('0x22')]['filter']){_0x34d138['where']=_['merge'](_0x34d138[_0x00b2('0x2a')],{'$or':_[_0x00b2('0x1b')](_0xd071ee,function(_0x1d3bdd){if(_0x1d3bdd['type']!==_0x00b2('0x2c')){var _0xea7172={};_0xea7172[_0x1d3bdd[_0x00b2('0x16')]]={'$like':'%'+_0x496653[_0x00b2('0x22')][_0x00b2('0x2d')]+'%'};return _0xea7172;}})});}_0x34d138=_[_0x00b2('0x2e')]({},_0x34d138,_0x496653[_0x00b2('0x2f')]);var _0xf1a7a1={'where':_0x34d138[_0x00b2('0x2a')]};return db['CloudProvider'][_0x00b2('0x11')](_0xf1a7a1)[_0x00b2('0x30')](function(_0xe074fb){_0x8a2513[_0x00b2('0x11')]=_0xe074fb;if(_0x496653[_0x00b2('0x22')]['includeAll']){_0x34d138[_0x00b2('0x31')]=[{'all':!![]}];}return db[_0x00b2('0x1c')][_0x00b2('0x32')](_0x34d138);})[_0x00b2('0x30')](function(_0x57af2c){_0x8a2513[_0x00b2('0x33')]=_[_0x00b2('0x1b')](_0x57af2c,function(_0x28ea64){if(_0x28ea64['service']===_0x00b2('0x34')){var _0x294b1a=encryptor[_0x00b2('0x35')](_0x28ea64[_0x00b2('0x36')]);_0x28ea64[_0x00b2('0x36')]=maskClientSecret(_0x294b1a);}return _0x28ea64;});return _0x8a2513;})[_0x00b2('0x30')](respondWithFilteredResult(_0x23f4d0,_0x34d138))['catch'](handleError(_0x23f4d0,null));};exports[_0x00b2('0x37')]=function(_0x5652e9,_0x58e279){var _0x8b2997={'raw':!![],'where':{'id':_0x5652e9['params']['id']}},_0x226e67={};_0x226e67[_0x00b2('0x26')]=_['keys'](db[_0x00b2('0x1c')]['rawAttributes']);_0x226e67[_0x00b2('0x22')]=_['keys'](_0x5652e9[_0x00b2('0x22')]);_0x226e67[_0x00b2('0x23')]=_[_0x00b2('0x24')](_0x226e67[_0x00b2('0x26')],_0x226e67[_0x00b2('0x22')]);_0x8b2997[_0x00b2('0x25')]=_['intersection'](_0x226e67['model'],qs[_0x00b2('0x27')](_0x5652e9[_0x00b2('0x22')][_0x00b2('0x27')]));_0x8b2997[_0x00b2('0x25')]=_0x8b2997['attributes']['length']?_0x8b2997[_0x00b2('0x25')]:_0x226e67[_0x00b2('0x26')];if(_0x5652e9[_0x00b2('0x22')][_0x00b2('0x38')]){_0x8b2997[_0x00b2('0x31')]=[{'all':!![]}];}_0x8b2997=_[_0x00b2('0x2e')]({},_0x8b2997,_0x5652e9[_0x00b2('0x2f')]);return db[_0x00b2('0x1c')][_0x00b2('0x39')](_0x8b2997)[_0x00b2('0x30')](handleEntityNotFound(_0x58e279,null))['then'](function(_0x403867){if(_0x403867[_0x00b2('0x3a')]===_0x00b2('0x34')){var _0x30681f=encryptor[_0x00b2('0x35')](_0x403867[_0x00b2('0x36')]);_0x403867[_0x00b2('0x36')]=maskClientSecret(_0x30681f);}return _0x403867;})['then'](respondWithResult(_0x58e279,null))[_0x00b2('0x3b')](handleError(_0x58e279,null));};exports[_0x00b2('0x3c')]=function(_0x1b6d3c,_0x1be2ed){if(!_0x1b6d3c[_0x00b2('0x3d')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x1b6d3c[_0x00b2('0x3d')][_0x00b2('0x3a')])throw new Error(_0x00b2('0x3e'));var _0x3c5f42=db[_0x00b2('0x1c')][_0x00b2('0x1d')][_0x00b2('0x3a')][_0x00b2('0x3f')];if(!_0x3c5f42[_0x00b2('0x40')](_0x1b6d3c['body'][_0x00b2('0x3a')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x3c5f42[_0x00b2('0x41')](',\x20'));if(_0x1b6d3c['body'][_0x00b2('0x3a')]===_0x00b2('0x34')&&_0x1b6d3c[_0x00b2('0x3d')][_0x00b2('0x36')]){_0x1b6d3c[_0x00b2('0x3d')][_0x00b2('0x36')]=encryptor[_0x00b2('0x42')](_0x1b6d3c['body'][_0x00b2('0x36')]);}return db['CloudProvider']['create'](_0x1b6d3c[_0x00b2('0x3d')],{})[_0x00b2('0x30')](respondWithResult(_0x1be2ed,0xc9))[_0x00b2('0x3b')](handleError(_0x1be2ed,null));};exports['update']=function(_0x499fc4,_0x220433){if(_0x499fc4['body']['id']){delete _0x499fc4['body']['id'];}return db[_0x00b2('0x1c')][_0x00b2('0x39')]({'where':{'id':_0x499fc4[_0x00b2('0x43')]['id']}})[_0x00b2('0x30')](handleEntityNotFound(_0x220433,null))[_0x00b2('0x30')](function(_0xdc9b52){if(_0xdc9b52[_0x00b2('0x3a')]==='MicrosoftAzure'&&_0x499fc4[_0x00b2('0x3d')][_0x00b2('0x36')]){_0x499fc4['body'][_0x00b2('0x36')]=encryptor[_0x00b2('0x42')](_0x499fc4[_0x00b2('0x3d')][_0x00b2('0x36')]);}return _0xdc9b52;})[_0x00b2('0x30')](saveUpdates(_0x499fc4['body'],null))[_0x00b2('0x30')](respondWithResult(_0x220433,null))['catch'](handleError(_0x220433,null));};exports['destroy']=function(_0x2d9a5f,_0xa20362){return db[_0x00b2('0x1c')]['find']({'where':{'id':_0x2d9a5f[_0x00b2('0x43')]['id']}})['then'](handleEntityNotFound(_0xa20362,null))[_0x00b2('0x30')](removeEntity(_0xa20362,null))[_0x00b2('0x3b')](handleError(_0xa20362,null));};exports[_0x00b2('0x44')]=function(_0xa5f3c4,_0x3efc80){return db[_0x00b2('0x1c')]['findOne']({'where':{'id':_0xa5f3c4[_0x00b2('0x43')]['id']},'raw':!![]})[_0x00b2('0x30')](function(_0x3d2a8b){if(!_0x3d2a8b)return _0x3efc80['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x3d2a8b,_0xa5f3c4['user']['id'])};})['then'](respondWithResult(_0x3efc80,null))[_0x00b2('0x3b')](handleError(_0x3efc80,null));};exports[_0x00b2('0x45')]=function(_0xd51740,_0x42988f){var _0x11c8aa=_0xd51740[_0x00b2('0x3d')];var _0x16043c;var _0x1e0070;if(_0x11c8aa[_0x00b2('0x15')])throw _0x11c8aa;redis[_0x00b2('0x46')](_0x11c8aa[_0x00b2('0x47')])[_0x00b2('0x30')](function(_0xb34f1b){if(!_0xb34f1b)throw new Error(_0x00b2('0x48'));_0x16043c=JSON[_0x00b2('0x49')](_0xb34f1b);var _0x409398=Buffer[_0x00b2('0x4a')](_0x11c8aa['state'],_0x00b2('0x4b'))[_0x00b2('0x4c')](_0x00b2('0x4d'));_0x1e0070=JSON[_0x00b2('0x49')](_0x409398);if(!oauth['isValidIdToken'](_0x11c8aa[_0x00b2('0x4e')],_0x16043c[_0x00b2('0x4f')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x00b2('0x50')](_0x11c8aa[_0x00b2('0x47')]);return oauth[_0x00b2('0x51')](_0x11c8aa[_0x00b2('0x52')],_0x16043c);})[_0x00b2('0x30')](function(_0x3a3390){_0x16043c['data5']=_0x3a3390[_0x00b2('0x53')];_0x16043c['data6']=_0x3a3390[_0x00b2('0x54')];return db['CloudProvider']['update']({'data5':_0x16043c['data5'],'data6':_0x16043c[_0x00b2('0x55')]},{'where':{'id':_0x16043c['id']}});})[_0x00b2('0x30')](function(){oauth['startRefreshInterval'](_0x16043c);socket['emit']('microsoftAuthorization:success',{'id':_0x1e0070['id']});return;})[_0x00b2('0x30')](respondWithStatusCode(_0x42988f,null))[_0x00b2('0x3b')](function(_0x12ec4e){if(_0x1e0070){socket['emit'](_0x00b2('0x56'),{'id':_0x1e0070['id']});}if(!_0x16043c){logger[_0x00b2('0x15')](_0x00b2('0x57'),_0x12ec4e);return _0x42988f['status'](0x1f4)[_0x00b2('0x17')](_0x12ec4e[_0x00b2('0x58')]);}logger['error'](_0x00b2('0x59'),_0x16043c['id'],JSON[_0x00b2('0x5a')](_0x12ec4e));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 485d8b8..837dc56 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 _0xf57e=['path','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','lodash','util','api','moment'];(function(_0x2391d5,_0x1073a5){var _0x1387b1=function(_0x38e514){while(--_0x38e514){_0x2391d5['push'](_0x2391d5['shift']());}};_0x1387b1(++_0x1073a5);}(_0xf57e,0xa6));var _0xef57=function(_0x1066e1,_0x433c9d){_0x1066e1=_0x1066e1-0x0;var _0x83cf2f=_0xf57e[_0x1066e1];return _0x83cf2f;};'use strict';var _=require(_0xef57('0x0'));var util=require(_0xef57('0x1'));var logger=require('../../config/logger')(_0xef57('0x2'));var moment=require(_0xef57('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xef57('0x4'));var rimraf=require('rimraf');var config=require(_0xef57('0x5'));var attributes=require(_0xef57('0x6'));module[_0xef57('0x7')]=function(_0x1b9591,_0x1715f1){return _0x1b9591[_0xef57('0x8')]('CloudProvider',attributes,{'tableName':_0xef57('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2e29=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','cloud_providers','lodash'];(function(_0x992c91,_0x5d8313){var _0x504c90=function(_0x2fcd84){while(--_0x2fcd84){_0x992c91['push'](_0x992c91['shift']());}};_0x504c90(++_0x5d8313);}(_0x2e29,0x185));var _0x92e2=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x2e29[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x92e2('0x0'));var util=require(_0x92e2('0x1'));var logger=require(_0x92e2('0x2'))(_0x92e2('0x3'));var moment=require(_0x92e2('0x4'));var BPromise=require(_0x92e2('0x5'));var rp=require(_0x92e2('0x6'));var fs=require('fs');var path=require(_0x92e2('0x7'));var rimraf=require(_0x92e2('0x8'));var config=require(_0x92e2('0x9'));var attributes=require(_0x92e2('0xa'));module[_0x92e2('0xb')]=function(_0x91a1b0,_0x2ba275){return _0x91a1b0['define']('CloudProvider',attributes,{'tableName':_0x92e2('0xc'),'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 2e6a7c0..6b7bb03 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 _0x0e93=['client_id','response_type','redirect_uri','data4','response_mode','scope','state','nonce','prompt','login','key','value','oauth2/','data1','decode','aud','audience','unix','resolve','findOne','then','data6','decryptString','data3','POST','data5','access_token','CloudProvider','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data2','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','code','from','stringify','toString','base64','randomBytes'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x0e93,0x1e7));var _0x30e9=function(_0x38f953,_0x3f66bd){_0x38f953=_0x38f953-0x0;var _0x4a7531=_0x0e93[_0x38f953];return _0x4a7531;};'use strict';var _=require('lodash');var crypto=require(_0x30e9('0x0'));var jwt=require(_0x30e9('0x1'));var moment=require(_0x30e9('0x2'));var Redis=require(_0x30e9('0x3'));var rp=require(_0x30e9('0x4'));var util=require(_0x30e9('0x5'));var encryptor=require(_0x30e9('0x6'));var config=require(_0x30e9('0x7'));var logger=require('../../config/logger')(_0x30e9('0x8'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x30e9('0x9'))['db'];config['redis']=_[_0x30e9('0xa')](config[_0x30e9('0xb')],{'host':_0x30e9('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x30e9('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x30e9('0xe'),_0x30e9('0xf'),_0x30e9('0x10'),_0x30e9('0x11'),_0x30e9('0x12'),'https://outlook.office.com/POP.AccessAsUser.All',_0x30e9('0x13')],'Dynamics365':[_0x30e9('0xe'),_0x30e9('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x30e9('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x30e9('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x580044){var _0x24eace=_[_0x30e9('0x16')](AZURE_AUTH_SCOPES[_0x580044[_0x30e9('0x17')]]);if(_0x580044[_0x30e9('0x17')]===_0x30e9('0x18'))_0x24eace[_0x30e9('0x19')](_0x580044[_0x30e9('0x1a')]+_0x30e9('0x1b'));return _0x24eace[_0x30e9('0x1c')]('\x20');}function getAccessTokenScope(_0x3128f5){if(_0x3128f5[_0x30e9('0x17')]===_0x30e9('0x1d'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x3128f5[_0x30e9('0x17')]===_0x30e9('0x18'))return _0x3128f5[_0x30e9('0x1a')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0xcabd73,_0x99cfc2){var _0x2496e3=MICROSOFT_AUTH_URL[_0x30e9('0x1e')](_0x30e9('0x1f'),_0xcabd73['data2']);var _0x264a84=[_0x30e9('0x20'),'id_token'];var _0x34d9f2=Buffer[_0x30e9('0x21')](JSON[_0x30e9('0x22')]({'id':_0x99cfc2}))[_0x30e9('0x23')](_0x30e9('0x24'));var _0x1111d7=crypto[_0x30e9('0x25')](0x10)[_0x30e9('0x23')]('hex');var _0x6e7e51=getAuthorizationScopes(_0xcabd73);var _0x2f7a83=[{'key':_0x30e9('0x26'),'value':_0xcabd73['data1']},{'key':_0x30e9('0x27'),'value':encodeURIComponent(_0x264a84[_0x30e9('0x1c')]('\x20'))},{'key':_0x30e9('0x28'),'value':_0xcabd73[_0x30e9('0x29')]},{'key':_0x30e9('0x2a'),'value':'form_post'},{'key':_0x30e9('0x2b'),'value':encodeURIComponent(_0x6e7e51)},{'key':_0x30e9('0x2c'),'value':_0x34d9f2},{'key':_0x30e9('0x2d'),'value':_0x1111d7},{'key':_0x30e9('0x2e'),'value':_0x30e9('0x2f')}];var _0x2ed3e7=_0x2496e3+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x30e9('0x16')](_0x2f7a83,function(_0x328818){return _0x328818[_0x30e9('0x30')]+'='+_0x328818[_0x30e9('0x31')];})[_0x30e9('0x1c')]('&');_0xcabd73['oauth2Claims']={'issuer':_0x2496e3[_0x30e9('0x1e')](_0x30e9('0x32'),''),'audience':_0xcabd73[_0x30e9('0x33')],'state':_0x34d9f2,'nonce':_0x1111d7};redis['set'](_0x34d9f2,JSON['stringify'](_0xcabd73));return _0x2ed3e7;}function isValidIdToken(_0x3f27cb,_0x59ce56){try{var _0x58fa30=jwt[_0x30e9('0x34')](_0x3f27cb,{'complete':!![]});var _0x2cfde3=_0x58fa30['payload'];if(_0x2cfde3['iss']!==_0x59ce56['issuer'])return![];if(_0x2cfde3[_0x30e9('0x35')]!==_0x59ce56[_0x30e9('0x36')])return![];if(_0x2cfde3[_0x30e9('0x2d')]!==_0x59ce56[_0x30e9('0x2d')])return![];if(moment()['isAfter'](moment[_0x30e9('0x37')](_0x2cfde3['exp'])))return![];return!![];}catch(_0x403716){throw _0x403716;}}function refreshOauth2MicrosoftAccessToken(_0x2232c0){return Promise[_0x30e9('0x38')]()['then'](function(){if(_0x2232c0['data3'])return _0x2232c0;return db['CloudProvider'][_0x30e9('0x39')]({'where':{'id':_0x2232c0['id']},'raw':!![]});})[_0x30e9('0x3a')](function(_0x526103){var _0x2e74f6={'grant_type':'refresh_token','refresh_token':_0x526103[_0x30e9('0x3b')],'scope':getAccessTokenScope(_0x526103),'redirect_uri':_0x526103[_0x30e9('0x29')],'client_id':_0x526103[_0x30e9('0x33')],'client_secret':encryptor[_0x30e9('0x3c')](_0x526103[_0x30e9('0x3d')])};var _0xfac8bc={'method':_0x30e9('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x30e9('0x1e')](_0x30e9('0x1f'),_0x526103['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2e74f6,'json':!![]};return rp(_0xfac8bc);})[_0x30e9('0x3a')](function(_0x325409){_0x2232c0[_0x30e9('0x3f')]=_0x325409[_0x30e9('0x40')];_0x2232c0[_0x30e9('0x3b')]=_0x325409['refresh_token'];return db[_0x30e9('0x41')]['update']({'data5':_0x2232c0[_0x30e9('0x3f')],'data6':_0x2232c0[_0x30e9('0x3b')]},{'where':{'id':_0x2232c0['id']}});})[_0x30e9('0x3a')](function(){return _0x2232c0;})[_0x30e9('0x42')](function(_0x350c99){logger[_0x30e9('0x43')](_0x30e9('0x44'),_0x2232c0['id'],_0x350c99);});}function getOauth2MicrosoftAccessToken(_0x203ca0,_0x3fa448){var _0x44997f={'grant_type':_0x30e9('0x45'),'code':_0x203ca0,'scope':getAccessTokenScope(_0x3fa448),'redirect_uri':_0x3fa448[_0x30e9('0x29')],'client_id':_0x3fa448[_0x30e9('0x33')],'client_secret':encryptor['decryptString'](_0x3fa448[_0x30e9('0x3d')])};var _0x3d7335={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x30e9('0x1e')](_0x30e9('0x1f'),_0x3fa448[_0x30e9('0x46')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x44997f,'json':!![]};return rp(_0x3d7335);}function startRefreshInterval(_0x149a50){var _0x280a92=schedule['intervals'];if(_0x280a92[_0x149a50['id']])clearInterval(_0x280a92[_0x149a50['id']]);_0x280a92[_0x149a50['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x149a50['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x280a92;}function startAllRefreshIntervals(){return db[_0x30e9('0x41')][_0x30e9('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x30e9('0x3a')](function(_0x340ed7){var _0x62ed43=_0x340ed7[_0x30e9('0x16')](function(_0x4d0df1){return refreshOauth2MicrosoftAccessToken(_0x4d0df1)['then'](function(_0x2813a1){startRefreshInterval(_0x2813a1);});});return Promise[_0x30e9('0x48')](_0x62ed43);})[_0x30e9('0x42')](function(_0xe776b4){var _0xb5f0de=_0xe776b4?util[_0x30e9('0x49')](_0xe776b4,{'showHidden':![],'depth':null}):'';logger[_0x30e9('0x43')](_0x30e9('0x4a'),_0xb5f0de);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xea42=['Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data4','bind','intervals','findAll','all','inspect','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','Outlook365','replace','{TENANT_ID}','code','from','base64','randomBytes','client_id','data1','response_type','redirect_uri','form_post','scope','state','nonce','prompt','login','key','join','stringify','decode','iss','issuer','aud','isAfter','unix','resolve','then','data3','findOne','refresh_token','decryptString','POST','data2','data5','access_token','CloudProvider','data6','catch','error'];(function(_0x8907b9,_0x3484b9){var _0x60982d=function(_0x2a5a09){while(--_0x2a5a09){_0x8907b9['push'](_0x8907b9['shift']());}};_0x60982d(++_0x3484b9);}(_0xea42,0xf9));var _0x2ea4=function(_0x1e08e0,_0x1c7e1c){_0x1e08e0=_0x1e08e0-0x0;var _0x15ce0e=_0xea42[_0x1e08e0];return _0x15ce0e;};'use strict';var _=require(_0x2ea4('0x0'));var crypto=require(_0x2ea4('0x1'));var jwt=require(_0x2ea4('0x2'));var moment=require('moment');var Redis=require(_0x2ea4('0x3'));var rp=require(_0x2ea4('0x4'));var util=require(_0x2ea4('0x5'));var encryptor=require(_0x2ea4('0x6'));var config=require(_0x2ea4('0x7'));var logger=require(_0x2ea4('0x8'))(_0x2ea4('0x9'));var schedule=require(_0x2ea4('0xa'));var db=require(_0x2ea4('0xb'))['db'];config[_0x2ea4('0xc')]=_[_0x2ea4('0xd')](config[_0x2ea4('0xc')],{'host':_0x2ea4('0xe'),'port':0x18eb});var redis=new Redis(config[_0x2ea4('0xc')]);var MICROSOFT_AUTH_URL=_0x2ea4('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x2ea4('0x10'),_0x2ea4('0x11'),_0x2ea4('0x12'),_0x2ea4('0x13'),_0x2ea4('0x14'),_0x2ea4('0x15'),_0x2ea4('0x16')],'Dynamics365':[_0x2ea4('0x10'),_0x2ea4('0x13')]};var MICROSOFT_AUTH_ENDPOINT=_0x2ea4('0x17');var MICROSOFT_TOKEN_ENDPOINT=_0x2ea4('0x18');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1758fc){var _0x4b44fc=_[_0x2ea4('0x19')](AZURE_AUTH_SCOPES[_0x1758fc['type']]);if(_0x1758fc[_0x2ea4('0x1a')]===_0x2ea4('0x1b'))_0x4b44fc[_0x2ea4('0x1c')](_0x1758fc[_0x2ea4('0x1d')]+_0x2ea4('0x1e'));return _0x4b44fc['join']('\x20');}function getAccessTokenScope(_0x228c99){if(_0x228c99[_0x2ea4('0x1a')]===_0x2ea4('0x1f'))return _0x2ea4('0x14');if(_0x228c99[_0x2ea4('0x1a')]===_0x2ea4('0x1b'))return _0x228c99[_0x2ea4('0x1d')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0xfcc38e,_0x4c708a){var _0x5350c9=MICROSOFT_AUTH_URL[_0x2ea4('0x20')](_0x2ea4('0x21'),_0xfcc38e['data2']);var _0x52ac3b=[_0x2ea4('0x22'),'id_token'];var _0x293ea2=Buffer[_0x2ea4('0x23')](JSON['stringify']({'id':_0x4c708a}))['toString'](_0x2ea4('0x24'));var _0x2c0b65=crypto[_0x2ea4('0x25')](0x10)['toString']('hex');var _0x521bcc=getAuthorizationScopes(_0xfcc38e);var _0x3c65e8=[{'key':_0x2ea4('0x26'),'value':_0xfcc38e[_0x2ea4('0x27')]},{'key':_0x2ea4('0x28'),'value':encodeURIComponent(_0x52ac3b['join']('\x20'))},{'key':_0x2ea4('0x29'),'value':_0xfcc38e['data4']},{'key':'response_mode','value':_0x2ea4('0x2a')},{'key':_0x2ea4('0x2b'),'value':encodeURIComponent(_0x521bcc)},{'key':_0x2ea4('0x2c'),'value':_0x293ea2},{'key':_0x2ea4('0x2d'),'value':_0x2c0b65},{'key':_0x2ea4('0x2e'),'value':_0x2ea4('0x2f')}];var _0x51f08b=_0x5350c9+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x2ea4('0x19')](_0x3c65e8,function(_0x38273b){return _0x38273b[_0x2ea4('0x30')]+'='+_0x38273b['value'];})[_0x2ea4('0x31')]('&');_0xfcc38e['oauth2Claims']={'issuer':_0x5350c9['replace']('oauth2/',''),'audience':_0xfcc38e['data1'],'state':_0x293ea2,'nonce':_0x2c0b65};redis['set'](_0x293ea2,JSON[_0x2ea4('0x32')](_0xfcc38e));return _0x51f08b;}function isValidIdToken(_0x44e67b,_0x4b10c2){try{var _0x33d62d=jwt[_0x2ea4('0x33')](_0x44e67b,{'complete':!![]});var _0x360eee=_0x33d62d['payload'];if(_0x360eee[_0x2ea4('0x34')]!==_0x4b10c2[_0x2ea4('0x35')])return![];if(_0x360eee[_0x2ea4('0x36')]!==_0x4b10c2['audience'])return![];if(_0x360eee['nonce']!==_0x4b10c2[_0x2ea4('0x2d')])return![];if(moment()[_0x2ea4('0x37')](moment[_0x2ea4('0x38')](_0x360eee['exp'])))return![];return!![];}catch(_0x4cf61a){throw _0x4cf61a;}}function refreshOauth2MicrosoftAccessToken(_0x1a8be7){return Promise[_0x2ea4('0x39')]()[_0x2ea4('0x3a')](function(){if(_0x1a8be7[_0x2ea4('0x3b')])return _0x1a8be7;return db['CloudProvider'][_0x2ea4('0x3c')]({'where':{'id':_0x1a8be7['id']},'raw':!![]});})[_0x2ea4('0x3a')](function(_0x1b7709){var _0x18ee80={'grant_type':_0x2ea4('0x3d'),'refresh_token':_0x1b7709['data6'],'scope':getAccessTokenScope(_0x1b7709),'redirect_uri':_0x1b7709['data4'],'client_id':_0x1b7709['data1'],'client_secret':encryptor[_0x2ea4('0x3e')](_0x1b7709[_0x2ea4('0x3b')])};var _0x5bb2c3={'method':_0x2ea4('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0x2ea4('0x21'),_0x1b7709[_0x2ea4('0x40')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x18ee80,'json':!![]};return rp(_0x5bb2c3);})[_0x2ea4('0x3a')](function(_0x21a3d2){_0x1a8be7[_0x2ea4('0x41')]=_0x21a3d2[_0x2ea4('0x42')];_0x1a8be7['data6']=_0x21a3d2[_0x2ea4('0x3d')];return db[_0x2ea4('0x43')]['update']({'data5':_0x1a8be7[_0x2ea4('0x41')],'data6':_0x1a8be7[_0x2ea4('0x44')]},{'where':{'id':_0x1a8be7['id']}});})[_0x2ea4('0x3a')](function(){return _0x1a8be7;})[_0x2ea4('0x45')](function(_0x485f78){logger[_0x2ea4('0x46')](_0x2ea4('0x47'),_0x1a8be7['id'],_0x485f78);});}function getOauth2MicrosoftAccessToken(_0x2141ae,_0x35824e){var _0x12a377={'grant_type':_0x2ea4('0x48'),'code':_0x2141ae,'scope':getAccessTokenScope(_0x35824e),'redirect_uri':_0x35824e[_0x2ea4('0x49')],'client_id':_0x35824e[_0x2ea4('0x27')],'client_secret':encryptor['decryptString'](_0x35824e[_0x2ea4('0x3b')])};var _0x347afb={'method':_0x2ea4('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x2ea4('0x20')]('{TENANT_ID}',_0x35824e['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x12a377,'json':!![]};return rp(_0x347afb);}function startRefreshInterval(_0xab50b4){var _0x4b8be2=schedule['intervals'];if(_0x4b8be2[_0xab50b4['id']])clearInterval(_0x4b8be2[_0xab50b4['id']]);_0x4b8be2[_0xab50b4['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x2ea4('0x4a')](this,{'id':_0xab50b4['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x2ea4('0x4b')]=_0x4b8be2;}function startAllRefreshIntervals(){return db[_0x2ea4('0x43')][_0x2ea4('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x2ea4('0x3a')](function(_0x37f71f){var _0x15565e=_0x37f71f[_0x2ea4('0x19')](function(_0x52c248){return refreshOauth2MicrosoftAccessToken(_0x52c248)[_0x2ea4('0x3a')](function(_0xf5d5ee){startRefreshInterval(_0xf5d5ee);});});return Promise[_0x2ea4('0x4d')](_0x15565e);})[_0x2ea4('0x45')](function(_0x1c5d56){var _0x302bbb=_0x1c5d56?util[_0x2ea4('0x4e')](_0x1c5d56,{'showHidden':![],'depth':null}):'';logger[_0x2ea4('0x46')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x302bbb);});}module[_0x2ea4('0x4f')]={'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 bbfe184..1de8f0f 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 _0x3d3d=['info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','result','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x1e729a,_0x52f00e){var _0x3a8044=function(_0x303fa0){while(--_0x303fa0){_0x1e729a['push'](_0x1e729a['shift']());}};_0x3a8044(++_0x52f00e);}(_0x3d3d,0xab));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd3d3('0x0'));var moment=require(_0xd3d3('0x1'));var BPromise=require('bluebird');var rs=require(_0xd3d3('0x2'));var fs=require('fs');var Redis=require(_0xd3d3('0x3'));var db=require(_0xd3d3('0x4'))['db'];var utils=require(_0xd3d3('0x5'));var logger=require(_0xd3d3('0x6'))(_0xd3d3('0x7'));var config=require(_0xd3d3('0x8'));var jayson=require(_0xd3d3('0x9'));var client=jayson[_0xd3d3('0xa')][_0xd3d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4aa421,_0x1f47fe,_0x263940){return new BPromise(function(_0x3fe58e,_0x2ed96f){return client['request'](_0x4aa421,_0x263940)[_0xd3d3('0xc')](function(_0x412054){logger[_0xd3d3('0xd')](_0xd3d3('0xe'),_0x1f47fe,'request\x20sent');logger[_0xd3d3('0xf')](_0xd3d3('0x10'),_0x1f47fe,_0xd3d3('0x11'),JSON[_0xd3d3('0x12')](_0x412054));if(_0x412054[_0xd3d3('0x13')]){if(_0x412054[_0xd3d3('0x13')]['code']===0x1f4){logger[_0xd3d3('0x13')]('CloudProvider,\x20%s,\x20%s',_0x1f47fe,_0x412054['error']['message']);return _0x2ed96f(_0x412054[_0xd3d3('0x13')]['message']);}logger['error'](_0xd3d3('0xe'),_0x1f47fe,_0x412054[_0xd3d3('0x13')]['message']);return _0x3fe58e(_0x412054[_0xd3d3('0x13')]['message']);}else{logger['info'](_0xd3d3('0xe'),_0x1f47fe,_0xd3d3('0x11'));_0x3fe58e(_0x412054[_0xd3d3('0x14')][_0xd3d3('0x15')]);}})[_0xd3d3('0x16')](function(_0x5c3462){logger[_0xd3d3('0x13')](_0xd3d3('0xe'),_0x1f47fe,_0x5c3462);_0x2ed96f(_0x5c3462);});});}
\ No newline at end of file
+var _0x6ac2=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6ac2,0x184));var _0x26ac=function(_0x5bca5e,_0x3852c){_0x5bca5e=_0x5bca5e-0x0;var _0x1dc1ea=_0x6ac2[_0x5bca5e];return _0x1dc1ea;};'use strict';var _=require(_0x26ac('0x0'));var util=require('util');var moment=require(_0x26ac('0x1'));var BPromise=require(_0x26ac('0x2'));var rs=require(_0x26ac('0x3'));var fs=require('fs');var Redis=require(_0x26ac('0x4'));var db=require(_0x26ac('0x5'))['db'];var utils=require(_0x26ac('0x6'));var logger=require('../../config/logger')(_0x26ac('0x7'));var config=require('../../config/environment');var jayson=require(_0x26ac('0x8'));var client=jayson[_0x26ac('0x9')][_0x26ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x159ba6,_0x36389c,_0x444ca1){return new BPromise(function(_0x1906d0,_0xd8b1e5){return client['request'](_0x159ba6,_0x444ca1)['then'](function(_0x27ff15){logger[_0x26ac('0xb')](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));logger['debug'](_0x26ac('0xe'),_0x36389c,_0x26ac('0xd'),JSON[_0x26ac('0xf')](_0x27ff15));if(_0x27ff15[_0x26ac('0x10')]){if(_0x27ff15['error']['code']===0x1f4){logger[_0x26ac('0x10')](_0x26ac('0xc'),_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0xd8b1e5(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}logger[_0x26ac('0x10')]('CloudProvider,\x20%s,\x20%s',_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0x1906d0(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}else{logger['info'](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));_0x1906d0(_0x27ff15['result'][_0x26ac('0x11')]);}})[_0x26ac('0x12')](function(_0x3b7c5d){logger[_0x26ac('0x10')]('CloudProvider,\x20%s,\x20%s',_0x36389c,_0x3b7c5d);_0xd8b1e5(_0x3b7c5d);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 6ddeaf8..9071c85 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x2192d5,_0x58909a){var _0x2e7eb9=function(_0x48c970){while(--_0x48c970){_0x2192d5['push'](_0x2192d5['shift']());}};_0x2e7eb9(++_0x58909a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7a54,0x106));var _0x47a5=function(_0x1a0e7c,_0x1545a1){_0x1a0e7c=_0x1a0e7c-0x0;var _0x1180ae=_0x7a54[_0x1a0e7c];return _0x1180ae;};'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 b0ccce4..4a79c4d 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 _0xd0a7=['STRING'];(function(_0x25fd8b,_0x4f6771){var _0x2ebe10=function(_0x13cd93){while(--_0x13cd93){_0x25fd8b['push'](_0x25fd8b['shift']());}};_0x2ebe10(++_0x4f6771);}(_0xd0a7,0x11b));var _0x7d0a=function(_0x4b54f8,_0x419eca){_0x4b54f8=_0x4b54f8-0x0;var _0x3c1443=_0xd0a7[_0x4b54f8];return _0x3c1443;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7d0a('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7d0a('0x0')]},'companyId':{'type':Sequelize[_0x7d0a('0x0')]},'website':{'type':Sequelize[_0x7d0a('0x0')]},'phone':{'type':Sequelize[_0x7d0a('0x0')]},'fax':{'type':Sequelize[_0x7d0a('0x0')]},'type':{'type':Sequelize[_0x7d0a('0x0')]},'street':{'type':Sequelize[_0x7d0a('0x0')]},'postalCode':{'type':Sequelize[_0x7d0a('0x0')]},'city':{'type':Sequelize[_0x7d0a('0x0')]},'country':{'type':Sequelize[_0x7d0a('0x0')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x7d0a('0x0')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x7d0a('0x0')]},'sCity':{'type':Sequelize[_0x7d0a('0x0')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7d0a('0x0')]}};
\ No newline at end of file
+var _0xee74=['STRING','name','exports'];(function(_0x448666,_0x30e0f3){var _0x506f4c=function(_0x5c1255){while(--_0x5c1255){_0x448666['push'](_0x448666['shift']());}};_0x506f4c(++_0x30e0f3);}(_0xee74,0x1eb));var _0x4ee7=function(_0x534d1c,_0x2413b6){_0x534d1c=_0x534d1c-0x0;var _0x39adfe=_0xee74[_0x534d1c];return _0x39adfe;};'use strict';var Sequelize=require('sequelize');module[_0x4ee7('0x0')]={'name':{'type':Sequelize[_0x4ee7('0x1')],'unique':_0x4ee7('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4ee7('0x1')]},'companyId':{'type':Sequelize[_0x4ee7('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x4ee7('0x1')]},'fax':{'type':Sequelize[_0x4ee7('0x1')]},'type':{'type':Sequelize[_0x4ee7('0x1')]},'street':{'type':Sequelize[_0x4ee7('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x4ee7('0x1')]},'country':{'type':Sequelize[_0x4ee7('0x1')]},'email':{'type':Sequelize[_0x4ee7('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4ee7('0x1')]},'sStreet':{'type':Sequelize[_0x4ee7('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x4ee7('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 113f499..acf94da 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 _0x56e3=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','get','UserProfileResource','error','stack','name','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','include','findAll','rows','catch','show','params','length','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addContacts','CmContact','omit','ids','rawAttributes','getContacts','eml-format','rimraf','zip-dir'];(function(_0x2c4d2c,_0x433527){var _0x769dcf=function(_0x3c31db){while(--_0x3c31db){_0x2c4d2c['push'](_0x2c4d2c['shift']());}};_0x769dcf(++_0x433527);}(_0x56e3,0xb1));var _0x356e=function(_0x532c60,_0x408037){_0x532c60=_0x532c60-0x0;var _0x49daa9=_0x56e3[_0x532c60];return _0x49daa9;};'use strict';var emlformat=require(_0x356e('0x0'));var rimraf=require(_0x356e('0x1'));var zipdir=require(_0x356e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x356e('0x3'));var moment=require(_0x356e('0x4'));var BPromise=require(_0x356e('0x5'));var Mustache=require(_0x356e('0x6'));var util=require(_0x356e('0x7'));var path=require('path');var sox=require(_0x356e('0x8'));var csv=require(_0x356e('0x9'));var ejs=require(_0x356e('0xa'));var fs=require('fs');var fs_extra=require(_0x356e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x356e('0xc'));var jsforce=require(_0x356e('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x356e('0xe'));var Papa=require(_0x356e('0xf'));var Redis=require(_0x356e('0x10'));var authService=require(_0x356e('0x11'));var qs=require(_0x356e('0x12'));var as=require(_0x356e('0x13'));var hardwareService=require(_0x356e('0x14'));var logger=require(_0x356e('0x15'))('api');var utils=require(_0x356e('0x16'));var config=require(_0x356e('0x17'));var licenseUtil=require(_0x356e('0x18'));var db=require(_0x356e('0x19'))['db'];function respondWithStatusCode(_0x2b3c82,_0x319c7e){_0x319c7e=_0x319c7e||0xcc;return function(_0x14cb35){if(_0x14cb35){return _0x2b3c82[_0x356e('0x1a')](_0x319c7e);}return _0x2b3c82[_0x356e('0x1b')](_0x319c7e)[_0x356e('0x1c')]();};}function respondWithResult(_0x3f9341,_0x347b3f){_0x347b3f=_0x347b3f||0xc8;return function(_0x50b4a3){if(_0x50b4a3){return _0x3f9341[_0x356e('0x1b')](_0x347b3f)['json'](_0x50b4a3);}};}function respondWithFilteredResult(_0xf79876,_0x3e0b82){return function(_0x1c79f1){if(_0x1c79f1){var _0x640a31=typeof _0x3e0b82[_0x356e('0x1d')]===_0x356e('0x1e')&&typeof _0x3e0b82[_0x356e('0x1f')]===_0x356e('0x1e');var _0x2d0f65=_0x1c79f1[_0x356e('0x20')];var _0x237ce2=_0x640a31?0x0:_0x3e0b82[_0x356e('0x1d')];var _0x3f3a49=_0x640a31?_0x1c79f1[_0x356e('0x20')]:_0x3e0b82[_0x356e('0x1d')]+_0x3e0b82['limit'];var _0x21cdad;if(_0x3f3a49>=_0x2d0f65){_0x3f3a49=_0x2d0f65;_0x21cdad=0xc8;}else{_0x21cdad=0xce;}_0xf79876['status'](_0x21cdad);return _0xf79876[_0x356e('0x21')]('Content-Range',_0x237ce2+'-'+_0x3f3a49+'/'+_0x2d0f65)[_0x356e('0x22')](_0x1c79f1);}return null;};}function patchUpdates(_0x49cf69){return function(_0x28a4be){try{jsonpatch[_0x356e('0x23')](_0x28a4be,_0x49cf69,!![]);}catch(_0x444515){return BPromise[_0x356e('0x24')](_0x444515);}return _0x28a4be[_0x356e('0x25')]();};}function saveUpdates(_0xfb013d,_0x2a274c){return function(_0x47f546){if(_0x47f546){return _0x47f546[_0x356e('0x26')](_0xfb013d)[_0x356e('0x27')](function(_0x3546ab){return _0x3546ab;});}return null;};}function removeEntity(_0xd95b04,_0x2eec8e){return function(_0x2c633f){if(_0x2c633f){return _0x2c633f['destroy']()[_0x356e('0x27')](function(){var _0x25b65b=_0x2c633f[_0x356e('0x28')]({'plain':!![]});var _0x522675='Companies';return db[_0x356e('0x29')]['destroy']({'where':{'type':_0x522675,'resourceId':_0x25b65b['id']}})[_0x356e('0x27')](function(){return _0x2c633f;});})[_0x356e('0x27')](function(){_0xd95b04['status'](0xcc)[_0x356e('0x1c')]();});}};}function handleEntityNotFound(_0x39c3d8,_0x2e347e){return function(_0xedbf05){if(!_0xedbf05){_0x39c3d8[_0x356e('0x1a')](0x194);}return _0xedbf05;};}function handleError(_0x341b2a,_0x4db357){_0x4db357=_0x4db357||0x1f4;return function(_0x140593){logger[_0x356e('0x2a')](_0x140593[_0x356e('0x2b')]);if(_0x140593[_0x356e('0x2c')]){delete _0x140593['name'];}_0x341b2a['status'](_0x4db357)['send'](_0x140593);};}exports['index']=function(_0x5989d6,_0x245f1e){var _0x48a1ff={},_0x3eaa35={},_0x4c2aa7={'count':0x0,'rows':[]};return db[_0x356e('0x2d')][_0x356e('0x2e')]()['then'](function(_0xac1a77){_0x3eaa35[_0x356e('0x2f')]=_['keys'](_0xac1a77);_0x3eaa35[_0x356e('0x30')]=_[_0x356e('0x31')](_0x5989d6['query']);_0x3eaa35[_0x356e('0x32')]=_[_0x356e('0x33')](_0x3eaa35[_0x356e('0x2f')],_0x3eaa35[_0x356e('0x30')]);_0x48a1ff[_0x356e('0x34')]=_[_0x356e('0x33')](_0x3eaa35['model'],qs[_0x356e('0x35')](_0x5989d6['query'][_0x356e('0x35')]));_0x48a1ff['attributes']=_0x48a1ff[_0x356e('0x34')]['length']?_0x48a1ff[_0x356e('0x34')]:_0x3eaa35[_0x356e('0x2f')];if(!_0x5989d6[_0x356e('0x30')][_0x356e('0x36')](_0x356e('0x37'))){_0x48a1ff[_0x356e('0x1f')]=qs[_0x356e('0x1f')](_0x5989d6[_0x356e('0x30')]['limit']);_0x48a1ff[_0x356e('0x1d')]=qs[_0x356e('0x1d')](_0x5989d6[_0x356e('0x30')][_0x356e('0x1d')]);}_0x48a1ff[_0x356e('0x38')]=qs[_0x356e('0x39')](_0x5989d6[_0x356e('0x30')]['sort']);_0x48a1ff[_0x356e('0x3a')]=qs['filters'](_[_0x356e('0x3b')](_0x5989d6[_0x356e('0x30')],_0x3eaa35[_0x356e('0x32')]),_0xac1a77);if(_0x5989d6['query'][_0x356e('0x3c')]){_0x48a1ff[_0x356e('0x3a')]=_[_0x356e('0x3d')](_0x48a1ff['where'],{'$or':_[_0x356e('0x3e')](_0x48a1ff[_0x356e('0x34')],function(_0x4a6a78){var _0x5dc2b4={};_0x5dc2b4[_0x4a6a78]={'$like':'%'+_0x5989d6['query'][_0x356e('0x3c')]+'%'};return _0x5dc2b4;})});}_0x48a1ff=_[_0x356e('0x3d')]({},_0x48a1ff,_0x5989d6[_0x356e('0x3f')]);var _0x4e0ce5={'where':_0x48a1ff[_0x356e('0x3a')]};return db[_0x356e('0x2d')][_0x356e('0x20')](_0x4e0ce5)[_0x356e('0x27')](function(_0x59b4db){_0x4c2aa7['count']=_0x59b4db;if(_0x5989d6[_0x356e('0x30')]['includeAll']){_0x48a1ff[_0x356e('0x40')]=[{'all':!![]}];}return db['CmCompany'][_0x356e('0x41')](_0x48a1ff);})[_0x356e('0x27')](function(_0x256def){_0x4c2aa7[_0x356e('0x42')]=_0x256def;return _0x4c2aa7;})[_0x356e('0x27')](respondWithFilteredResult(_0x245f1e,_0x48a1ff))[_0x356e('0x43')](handleError(_0x245f1e,null));})[_0x356e('0x43')](handleError(_0x245f1e,null));};exports[_0x356e('0x44')]=function(_0x327571,_0x2a239c){var _0x2da428={'raw':![],'where':{'id':_0x327571[_0x356e('0x45')]['id']}},_0xa528ef={};_0xa528ef[_0x356e('0x2f')]=_['keys'](db['CmCompany']['rawAttributes']);_0xa528ef[_0x356e('0x30')]=_[_0x356e('0x31')](_0x327571[_0x356e('0x30')]);_0xa528ef['filters']=_[_0x356e('0x33')](_0xa528ef[_0x356e('0x2f')],_0xa528ef['query']);_0x2da428[_0x356e('0x34')]=_[_0x356e('0x33')](_0xa528ef[_0x356e('0x2f')],qs['fields'](_0x327571['query']['fields']));_0x2da428['attributes']=_0x2da428[_0x356e('0x34')][_0x356e('0x46')]?_0x2da428[_0x356e('0x34')]:_0xa528ef['model'];if(_0x327571[_0x356e('0x30')][_0x356e('0x47')]){_0x2da428[_0x356e('0x40')]=[{'all':!![]}];}_0x2da428=_[_0x356e('0x3d')]({},_0x2da428,_0x327571[_0x356e('0x3f')]);return db['CmCompany']['find'](_0x2da428)['then'](handleEntityNotFound(_0x2a239c,null))[_0x356e('0x27')](respondWithResult(_0x2a239c,null))[_0x356e('0x43')](handleError(_0x2a239c,null));};exports[_0x356e('0x48')]=function(_0x1a6981,_0x4fca88){return db[_0x356e('0x2d')]['create'](_0x1a6981[_0x356e('0x49')],{})['then'](function(_0x36c7bb){var _0x2616e5=_0x1a6981[_0x356e('0x4a')]['get']({'plain':!![]});if(!_0x2616e5)throw new Error(_0x356e('0x4b'));if(_0x2616e5[_0x356e('0x4c')]===_0x356e('0x4a')){var _0x4772b7=_0x36c7bb[_0x356e('0x28')]({'plain':!![]});var _0x45be74=_0x356e('0x4d');return db[_0x356e('0x4e')][_0x356e('0x4f')]({'where':{'name':_0x45be74,'userProfileId':_0x2616e5[_0x356e('0x50')]},'raw':!![]})['then'](function(_0x419784){if(_0x419784&&_0x419784[_0x356e('0x51')]===0x0){return db[_0x356e('0x29')][_0x356e('0x48')]({'name':_0x4772b7[_0x356e('0x2c')],'resourceId':_0x4772b7['id'],'type':_0x419784[_0x356e('0x2c')],'sectionId':_0x419784['id']},{})[_0x356e('0x27')](function(){return _0x36c7bb;});}else{return _0x36c7bb;}})[_0x356e('0x43')](function(_0x3d6f94){logger[_0x356e('0x2a')](_0x356e('0x52'),_0x3d6f94);throw _0x3d6f94;});}return _0x36c7bb;})[_0x356e('0x27')](respondWithResult(_0x4fca88,0xc9))[_0x356e('0x43')](handleError(_0x4fca88,null));};exports['update']=function(_0x256b8d,_0x258c45){if(_0x256b8d[_0x356e('0x49')]['id']){delete _0x256b8d[_0x356e('0x49')]['id'];}return db[_0x356e('0x2d')][_0x356e('0x4f')]({'where':{'id':_0x256b8d[_0x356e('0x45')]['id']}})[_0x356e('0x27')](handleEntityNotFound(_0x258c45,null))[_0x356e('0x27')](saveUpdates(_0x256b8d[_0x356e('0x49')],null))[_0x356e('0x27')](respondWithResult(_0x258c45,null))['catch'](handleError(_0x258c45,null));};exports[_0x356e('0x53')]=function(_0x432f5f,_0x1e4d4d){return db[_0x356e('0x2d')][_0x356e('0x4f')]({'where':{'id':_0x432f5f[_0x356e('0x45')]['id']}})[_0x356e('0x27')](handleEntityNotFound(_0x1e4d4d,null))[_0x356e('0x27')](removeEntity(_0x1e4d4d,null))[_0x356e('0x43')](handleError(_0x1e4d4d,null));};exports['describe']=function(_0x5bafd9,_0x1c69d4){return db[_0x356e('0x2d')][_0x356e('0x2e')]()['then'](respondWithResult(_0x1c69d4,null))['catch'](handleError(_0x1c69d4,null));};exports[_0x356e('0x54')]=function(_0x4a0522,_0x44d1b0,_0x102270){return db[_0x356e('0x55')][_0x356e('0x4f')]({'where':{'id':_0x4a0522[_0x356e('0x45')]['id']}})['then'](handleEntityNotFound(_0x44d1b0,null))[_0x356e('0x27')](function(_0x3a6ea7){if(_0x3a6ea7){return _0x3a6ea7[_0x356e('0x54')](_0x4a0522[_0x356e('0x49')]['ids'],_[_0x356e('0x56')](_0x4a0522[_0x356e('0x49')],[_0x356e('0x57'),'id'])||{});}})['then'](respondWithResult(_0x44d1b0,null))['catch'](handleError(_0x44d1b0,null));};exports['getContacts']=function(_0x32fcb0,_0x4b64c7,_0x587bf2){var _0x4ad12a={};var _0x3e4d17={};var _0x4980fc;var _0x40ca20;return db[_0x356e('0x2d')]['findOne']({'where':{'id':_0x32fcb0[_0x356e('0x45')]['id']}})[_0x356e('0x27')](handleEntityNotFound(_0x4b64c7,null))[_0x356e('0x27')](function(_0x3868c4){if(_0x3868c4){_0x4980fc=_0x3868c4;_0x3e4d17[_0x356e('0x2f')]=_[_0x356e('0x31')](db[_0x356e('0x55')][_0x356e('0x58')]);_0x3e4d17[_0x356e('0x30')]=_['keys'](_0x32fcb0[_0x356e('0x30')]);_0x3e4d17[_0x356e('0x32')]=_[_0x356e('0x33')](_0x3e4d17[_0x356e('0x2f')],_0x3e4d17[_0x356e('0x30')]);_0x4ad12a[_0x356e('0x34')]=_['intersection'](_0x3e4d17[_0x356e('0x2f')],qs[_0x356e('0x35')](_0x32fcb0[_0x356e('0x30')]['fields']));_0x4ad12a[_0x356e('0x34')]=_0x4ad12a['attributes'][_0x356e('0x46')]?_0x4ad12a[_0x356e('0x34')]:_0x3e4d17['model'];_0x4ad12a[_0x356e('0x38')]=qs['sort'](_0x32fcb0[_0x356e('0x30')]['sort']);_0x4ad12a['where']=qs[_0x356e('0x32')](_[_0x356e('0x3b')](_0x32fcb0[_0x356e('0x30')],_0x3e4d17[_0x356e('0x32')]));if(_0x32fcb0[_0x356e('0x30')]['filter']){_0x4ad12a[_0x356e('0x3a')]=_[_0x356e('0x3d')](_0x4ad12a[_0x356e('0x3a')],{'$or':_[_0x356e('0x3e')](_0x4ad12a[_0x356e('0x34')],function(_0x29749b){var _0x339331={};_0x339331[_0x29749b]={'$like':'%'+_0x32fcb0[_0x356e('0x30')][_0x356e('0x3c')]+'%'};return _0x339331;})});}_0x4ad12a=_[_0x356e('0x3d')]({},_0x4ad12a,_0x32fcb0[_0x356e('0x3f')]);return _0x4980fc['getContacts'](_0x4ad12a);}})[_0x356e('0x27')](function(_0x5cb3ae){if(_0x5cb3ae){_0x40ca20=_0x5cb3ae[_0x356e('0x46')];if(!_0x32fcb0[_0x356e('0x30')][_0x356e('0x36')](_0x356e('0x37'))){_0x4ad12a[_0x356e('0x1f')]=qs['limit'](_0x32fcb0[_0x356e('0x30')][_0x356e('0x1f')]);_0x4ad12a['offset']=qs[_0x356e('0x1d')](_0x32fcb0[_0x356e('0x30')]['offset']);}return _0x4980fc[_0x356e('0x59')](_0x4ad12a);}})[_0x356e('0x27')](function(_0x3a175b){if(_0x3a175b){return _0x3a175b?{'count':_0x40ca20,'rows':_0x3a175b}:null;}})[_0x356e('0x27')](respondWithResult(_0x4b64c7,null))[_0x356e('0x43')](handleError(_0x4b64c7,null));};
\ No newline at end of file
+var _0xeb5c=['user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','CmContact','addContacts','ids','getContacts','rawAttributes','map','eml-format','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','get','Companies','error','stack','name','send','index','CmCompany','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','merge','where','filter','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x46ca9b,_0x3e05d4){var _0x35f75b=function(_0x169cdf){while(--_0x169cdf){_0x46ca9b['push'](_0x46ca9b['shift']());}};_0x35f75b(++_0x3e05d4);}(_0xeb5c,0x114));var _0xceb5=function(_0x5924c8,_0x3326f2){_0x5924c8=_0x5924c8-0x0;var _0x2cf1c9=_0xeb5c[_0x5924c8];return _0x2cf1c9;};'use strict';var emlformat=require(_0xceb5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xceb5('0x1'));var jsonpatch=require(_0xceb5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xceb5('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xceb5('0x4'));var sox=require(_0xceb5('0x5'));var csv=require(_0xceb5('0x6'));var ejs=require(_0xceb5('0x7'));var fs=require('fs');var fs_extra=require(_0xceb5('0x8'));var _=require(_0xceb5('0x9'));var squel=require(_0xceb5('0xa'));var crypto=require(_0xceb5('0xb'));var jsforce=require(_0xceb5('0xc'));var deskjs=require(_0xceb5('0xd'));var toCsv=require(_0xceb5('0x6'));var querystring=require(_0xceb5('0xe'));var Papa=require(_0xceb5('0xf'));var Redis=require(_0xceb5('0x10'));var authService=require(_0xceb5('0x11'));var qs=require(_0xceb5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xceb5('0x13'))(_0xceb5('0x14'));var utils=require(_0xceb5('0x15'));var config=require(_0xceb5('0x16'));var licenseUtil=require(_0xceb5('0x17'));var db=require(_0xceb5('0x18'))['db'];function respondWithStatusCode(_0x23b797,_0xd2b5fa){_0xd2b5fa=_0xd2b5fa||0xcc;return function(_0x414bd3){if(_0x414bd3){return _0x23b797[_0xceb5('0x19')](_0xd2b5fa);}return _0x23b797[_0xceb5('0x1a')](_0xd2b5fa)[_0xceb5('0x1b')]();};}function respondWithResult(_0x2e1865,_0x2c8e52){_0x2c8e52=_0x2c8e52||0xc8;return function(_0xc7b6be){if(_0xc7b6be){return _0x2e1865['status'](_0x2c8e52)[_0xceb5('0x1c')](_0xc7b6be);}};}function respondWithFilteredResult(_0x1d6e8b,_0x52092c){return function(_0xb23481){if(_0xb23481){var _0x3fc01e=typeof _0x52092c[_0xceb5('0x1d')]===_0xceb5('0x1e')&&typeof _0x52092c['limit']==='undefined';var _0x20b33b=_0xb23481[_0xceb5('0x1f')];var _0x34faed=_0x3fc01e?0x0:_0x52092c[_0xceb5('0x1d')];var _0x3206c1=_0x3fc01e?_0xb23481['count']:_0x52092c[_0xceb5('0x1d')]+_0x52092c['limit'];var _0x318778;if(_0x3206c1>=_0x20b33b){_0x3206c1=_0x20b33b;_0x318778=0xc8;}else{_0x318778=0xce;}_0x1d6e8b[_0xceb5('0x1a')](_0x318778);return _0x1d6e8b['set'](_0xceb5('0x20'),_0x34faed+'-'+_0x3206c1+'/'+_0x20b33b)[_0xceb5('0x1c')](_0xb23481);}return null;};}function patchUpdates(_0x22b187){return function(_0x1da8a8){try{jsonpatch[_0xceb5('0x21')](_0x1da8a8,_0x22b187,!![]);}catch(_0x4d7c3e){return BPromise[_0xceb5('0x22')](_0x4d7c3e);}return _0x1da8a8['save']();};}function saveUpdates(_0x52b583,_0x5c31c1){return function(_0x5cce1d){if(_0x5cce1d){return _0x5cce1d[_0xceb5('0x23')](_0x52b583)[_0xceb5('0x24')](function(_0x284db4){return _0x284db4;});}return null;};}function removeEntity(_0x54a68e,_0xb3ef43){return function(_0x5d1a1a){if(_0x5d1a1a){return _0x5d1a1a[_0xceb5('0x25')]()[_0xceb5('0x24')](function(){var _0x5e1f0f=_0x5d1a1a[_0xceb5('0x26')]({'plain':!![]});var _0x1594e2=_0xceb5('0x27');return db['UserProfileResource'][_0xceb5('0x25')]({'where':{'type':_0x1594e2,'resourceId':_0x5e1f0f['id']}})[_0xceb5('0x24')](function(){return _0x5d1a1a;});})[_0xceb5('0x24')](function(){_0x54a68e[_0xceb5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a310b,_0x2d3679){return function(_0x358a6d){if(!_0x358a6d){_0x1a310b[_0xceb5('0x19')](0x194);}return _0x358a6d;};}function handleError(_0x436eb8,_0x3ee204){_0x3ee204=_0x3ee204||0x1f4;return function(_0x13cf1e){logger[_0xceb5('0x28')](_0x13cf1e[_0xceb5('0x29')]);if(_0x13cf1e[_0xceb5('0x2a')]){delete _0x13cf1e[_0xceb5('0x2a')];}_0x436eb8[_0xceb5('0x1a')](_0x3ee204)[_0xceb5('0x2b')](_0x13cf1e);};}exports[_0xceb5('0x2c')]=function(_0x87d3a8,_0x33014f){var _0x221114={},_0x2145be={},_0x19e01e={'count':0x0,'rows':[]};return db[_0xceb5('0x2d')]['describe']()['then'](function(_0x4b76c0){_0x2145be['model']=_['keys'](_0x4b76c0);_0x2145be[_0xceb5('0x2e')]=_[_0xceb5('0x2f')](_0x87d3a8[_0xceb5('0x2e')]);_0x2145be[_0xceb5('0x30')]=_['intersection'](_0x2145be[_0xceb5('0x31')],_0x2145be[_0xceb5('0x2e')]);_0x221114[_0xceb5('0x32')]=_[_0xceb5('0x33')](_0x2145be['model'],qs[_0xceb5('0x34')](_0x87d3a8['query'][_0xceb5('0x34')]));_0x221114['attributes']=_0x221114[_0xceb5('0x32')][_0xceb5('0x35')]?_0x221114[_0xceb5('0x32')]:_0x2145be[_0xceb5('0x31')];if(!_0x87d3a8['query'][_0xceb5('0x36')](_0xceb5('0x37'))){_0x221114[_0xceb5('0x38')]=qs[_0xceb5('0x38')](_0x87d3a8['query'][_0xceb5('0x38')]);_0x221114[_0xceb5('0x1d')]=qs[_0xceb5('0x1d')](_0x87d3a8[_0xceb5('0x2e')][_0xceb5('0x1d')]);}_0x221114[_0xceb5('0x39')]=qs[_0xceb5('0x3a')](_0x87d3a8[_0xceb5('0x2e')][_0xceb5('0x3a')]);_0x221114['where']=qs[_0xceb5('0x30')](_[_0xceb5('0x3b')](_0x87d3a8['query'],_0x2145be['filters']),_0x4b76c0);if(_0x87d3a8[_0xceb5('0x2e')]['filter']){_0x221114['where']=_[_0xceb5('0x3c')](_0x221114[_0xceb5('0x3d')],{'$or':_['map'](_0x221114['attributes'],function(_0x57fb8f){var _0x3b40a5={};_0x3b40a5[_0x57fb8f]={'$like':'%'+_0x87d3a8[_0xceb5('0x2e')][_0xceb5('0x3e')]+'%'};return _0x3b40a5;})});}_0x221114=_['merge']({},_0x221114,_0x87d3a8['options']);var _0x39dbfa={'where':_0x221114[_0xceb5('0x3d')]};return db[_0xceb5('0x2d')][_0xceb5('0x1f')](_0x39dbfa)[_0xceb5('0x24')](function(_0x5100a3){_0x19e01e[_0xceb5('0x1f')]=_0x5100a3;if(_0x87d3a8[_0xceb5('0x2e')]['includeAll']){_0x221114['include']=[{'all':!![]}];}return db['CmCompany'][_0xceb5('0x3f')](_0x221114);})[_0xceb5('0x24')](function(_0x41330d){_0x19e01e[_0xceb5('0x40')]=_0x41330d;return _0x19e01e;})[_0xceb5('0x24')](respondWithFilteredResult(_0x33014f,_0x221114))[_0xceb5('0x41')](handleError(_0x33014f,null));})[_0xceb5('0x41')](handleError(_0x33014f,null));};exports[_0xceb5('0x42')]=function(_0x19ecc1,_0x429553){var _0x49e002={'raw':![],'where':{'id':_0x19ecc1[_0xceb5('0x43')]['id']}},_0x593849={};_0x593849[_0xceb5('0x31')]=_['keys'](db['CmCompany']['rawAttributes']);_0x593849[_0xceb5('0x2e')]=_[_0xceb5('0x2f')](_0x19ecc1[_0xceb5('0x2e')]);_0x593849[_0xceb5('0x30')]=_['intersection'](_0x593849['model'],_0x593849[_0xceb5('0x2e')]);_0x49e002[_0xceb5('0x32')]=_[_0xceb5('0x33')](_0x593849[_0xceb5('0x31')],qs[_0xceb5('0x34')](_0x19ecc1[_0xceb5('0x2e')][_0xceb5('0x34')]));_0x49e002['attributes']=_0x49e002[_0xceb5('0x32')]['length']?_0x49e002[_0xceb5('0x32')]:_0x593849[_0xceb5('0x31')];if(_0x19ecc1[_0xceb5('0x2e')][_0xceb5('0x44')]){_0x49e002[_0xceb5('0x45')]=[{'all':!![]}];}_0x49e002=_[_0xceb5('0x3c')]({},_0x49e002,_0x19ecc1[_0xceb5('0x46')]);return db[_0xceb5('0x2d')][_0xceb5('0x47')](_0x49e002)[_0xceb5('0x24')](handleEntityNotFound(_0x429553,null))[_0xceb5('0x24')](respondWithResult(_0x429553,null))[_0xceb5('0x41')](handleError(_0x429553,null));};exports['create']=function(_0x3cf319,_0xf67136){return db[_0xceb5('0x2d')][_0xceb5('0x48')](_0x3cf319[_0xceb5('0x49')],{})[_0xceb5('0x24')](function(_0x38d6d8){var _0x3c10ec=_0x3cf319['user'][_0xceb5('0x26')]({'plain':!![]});if(!_0x3c10ec)throw new Error(_0xceb5('0x4a'));if(_0x3c10ec[_0xceb5('0x4b')]===_0xceb5('0x4c')){var _0xccc0cd=_0x38d6d8[_0xceb5('0x26')]({'plain':!![]});var _0x3af57f=_0xceb5('0x27');return db[_0xceb5('0x4d')][_0xceb5('0x47')]({'where':{'name':_0x3af57f,'userProfileId':_0x3c10ec['userProfileId']},'raw':!![]})[_0xceb5('0x24')](function(_0x42e5b1){if(_0x42e5b1&&_0x42e5b1[_0xceb5('0x4e')]===0x0){return db[_0xceb5('0x4f')][_0xceb5('0x48')]({'name':_0xccc0cd[_0xceb5('0x2a')],'resourceId':_0xccc0cd['id'],'type':_0x42e5b1[_0xceb5('0x2a')],'sectionId':_0x42e5b1['id']},{})[_0xceb5('0x24')](function(){return _0x38d6d8;});}else{return _0x38d6d8;}})[_0xceb5('0x41')](function(_0x26514b){logger[_0xceb5('0x28')](_0xceb5('0x50'),_0x26514b);throw _0x26514b;});}return _0x38d6d8;})[_0xceb5('0x24')](respondWithResult(_0xf67136,0xc9))[_0xceb5('0x41')](handleError(_0xf67136,null));};exports[_0xceb5('0x23')]=function(_0x4f442b,_0xda2f7d){if(_0x4f442b[_0xceb5('0x49')]['id']){delete _0x4f442b['body']['id'];}return db['CmCompany'][_0xceb5('0x47')]({'where':{'id':_0x4f442b['params']['id']}})[_0xceb5('0x24')](handleEntityNotFound(_0xda2f7d,null))[_0xceb5('0x24')](saveUpdates(_0x4f442b[_0xceb5('0x49')],null))[_0xceb5('0x24')](respondWithResult(_0xda2f7d,null))[_0xceb5('0x41')](handleError(_0xda2f7d,null));};exports[_0xceb5('0x25')]=function(_0x32f74a,_0x1265c8){return db['CmCompany'][_0xceb5('0x47')]({'where':{'id':_0x32f74a[_0xceb5('0x43')]['id']}})[_0xceb5('0x24')](handleEntityNotFound(_0x1265c8,null))['then'](removeEntity(_0x1265c8,null))[_0xceb5('0x41')](handleError(_0x1265c8,null));};exports['describe']=function(_0x25e1e6,_0x4c4adc){return db[_0xceb5('0x2d')][_0xceb5('0x51')]()[_0xceb5('0x24')](respondWithResult(_0x4c4adc,null))[_0xceb5('0x41')](handleError(_0x4c4adc,null));};exports['addContacts']=function(_0x15dc80,_0x187a42,_0x576e2d){return db[_0xceb5('0x52')][_0xceb5('0x47')]({'where':{'id':_0x15dc80[_0xceb5('0x43')]['id']}})[_0xceb5('0x24')](handleEntityNotFound(_0x187a42,null))[_0xceb5('0x24')](function(_0x38ff69){if(_0x38ff69){return _0x38ff69[_0xceb5('0x53')](_0x15dc80['body'][_0xceb5('0x54')],_['omit'](_0x15dc80[_0xceb5('0x49')],[_0xceb5('0x54'),'id'])||{});}})[_0xceb5('0x24')](respondWithResult(_0x187a42,null))[_0xceb5('0x41')](handleError(_0x187a42,null));};exports[_0xceb5('0x55')]=function(_0x8b9862,_0x3c3cbe,_0x554b86){var _0x4b0764={};var _0x44982f={};var _0xfd1463;var _0x90f27c;return db[_0xceb5('0x2d')]['findOne']({'where':{'id':_0x8b9862[_0xceb5('0x43')]['id']}})['then'](handleEntityNotFound(_0x3c3cbe,null))[_0xceb5('0x24')](function(_0x4f915f){if(_0x4f915f){_0xfd1463=_0x4f915f;_0x44982f['model']=_[_0xceb5('0x2f')](db[_0xceb5('0x52')][_0xceb5('0x56')]);_0x44982f[_0xceb5('0x2e')]=_[_0xceb5('0x2f')](_0x8b9862['query']);_0x44982f[_0xceb5('0x30')]=_[_0xceb5('0x33')](_0x44982f['model'],_0x44982f['query']);_0x4b0764[_0xceb5('0x32')]=_[_0xceb5('0x33')](_0x44982f[_0xceb5('0x31')],qs['fields'](_0x8b9862[_0xceb5('0x2e')][_0xceb5('0x34')]));_0x4b0764[_0xceb5('0x32')]=_0x4b0764['attributes'][_0xceb5('0x35')]?_0x4b0764[_0xceb5('0x32')]:_0x44982f['model'];_0x4b0764[_0xceb5('0x39')]=qs[_0xceb5('0x3a')](_0x8b9862['query'][_0xceb5('0x3a')]);_0x4b0764[_0xceb5('0x3d')]=qs[_0xceb5('0x30')](_['pick'](_0x8b9862['query'],_0x44982f[_0xceb5('0x30')]));if(_0x8b9862['query'][_0xceb5('0x3e')]){_0x4b0764[_0xceb5('0x3d')]=_[_0xceb5('0x3c')](_0x4b0764['where'],{'$or':_[_0xceb5('0x57')](_0x4b0764[_0xceb5('0x32')],function(_0x1dbf59){var _0x50ca0e={};_0x50ca0e[_0x1dbf59]={'$like':'%'+_0x8b9862[_0xceb5('0x2e')]['filter']+'%'};return _0x50ca0e;})});}_0x4b0764=_[_0xceb5('0x3c')]({},_0x4b0764,_0x8b9862[_0xceb5('0x46')]);return _0xfd1463[_0xceb5('0x55')](_0x4b0764);}})[_0xceb5('0x24')](function(_0x3be68f){if(_0x3be68f){_0x90f27c=_0x3be68f['length'];if(!_0x8b9862[_0xceb5('0x2e')]['hasOwnProperty'](_0xceb5('0x37'))){_0x4b0764['limit']=qs[_0xceb5('0x38')](_0x8b9862[_0xceb5('0x2e')][_0xceb5('0x38')]);_0x4b0764[_0xceb5('0x1d')]=qs[_0xceb5('0x1d')](_0x8b9862[_0xceb5('0x2e')]['offset']);}return _0xfd1463[_0xceb5('0x55')](_0x4b0764);}})[_0xceb5('0x24')](function(_0x558ee9){if(_0x558ee9){return _0x558ee9?{'count':_0x90f27c,'rows':_0x558ee9}:null;}})['then'](respondWithResult(_0x3c3cbe,null))[_0xceb5('0x41')](handleError(_0x3c3cbe,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index d56adc5..4314186 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 _0x10cc=['cm_companies','lodash','moment','request-promise','path','rimraf','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x4ef48d,_0x373152){var _0x1e9115=function(_0xa99fb6){while(--_0xa99fb6){_0x4ef48d['push'](_0x4ef48d['shift']());}};_0x1e9115(++_0x373152);}(_0x10cc,0x6f));var _0xc10c=function(_0x1e7600,_0x11348d){_0x1e7600=_0x1e7600-0x0;var _0x80b052=_0x10cc[_0x1e7600];return _0x80b052;};'use strict';var _=require(_0xc10c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc10c('0x1'));var BPromise=require('bluebird');var rp=require(_0xc10c('0x2'));var fs=require('fs');var path=require(_0xc10c('0x3'));var rimraf=require(_0xc10c('0x4'));var config=require('../../config/environment');var attributes=require(_0xc10c('0x5'));module[_0xc10c('0x6')]=function(_0x482cc2,_0x3a9e2f){return _0x482cc2[_0xc10c('0x7')](_0xc10c('0x8'),attributes,{'tableName':_0xc10c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf767=['CmCompany','cm_companies','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0xf767,0x77));var _0x7f76=function(_0xe1a3a5,_0xd3e341){_0xe1a3a5=_0xe1a3a5-0x0;var _0x362646=_0xf767[_0xe1a3a5];return _0x362646;};'use strict';var _=require(_0x7f76('0x0'));var util=require(_0x7f76('0x1'));var logger=require('../../config/logger')(_0x7f76('0x2'));var moment=require(_0x7f76('0x3'));var BPromise=require(_0x7f76('0x4'));var rp=require(_0x7f76('0x5'));var fs=require('fs');var path=require(_0x7f76('0x6'));var rimraf=require('rimraf');var config=require(_0x7f76('0x7'));var attributes=require(_0x7f76('0x8'));module[_0x7f76('0x9')]=function(_0x495355,_0x4832d1){return _0x495355[_0x7f76('0xa')](_0x7f76('0xb'),attributes,{'tableName':_0x7f76('0xc'),'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 ff512c7..5847130 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 _0xd483=['error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5eaa0b,_0x433b2f){var _0x28b295=function(_0x5e4f6d){while(--_0x5e4f6d){_0x5eaa0b['push'](_0x5eaa0b['shift']());}};_0x28b295(++_0x433b2f);}(_0xd483,0x158));var _0x3d48=function(_0x493f9b,_0x3df205){_0x493f9b=_0x493f9b-0x0;var _0x1cb2e4=_0xd483[_0x493f9b];return _0x1cb2e4;};'use strict';var _=require('lodash');var util=require(_0x3d48('0x0'));var moment=require(_0x3d48('0x1'));var BPromise=require(_0x3d48('0x2'));var rs=require(_0x3d48('0x3'));var fs=require('fs');var Redis=require(_0x3d48('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3d48('0x5'))(_0x3d48('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d48('0x7')][_0x3d48('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c1f9e,_0x19d8f0,_0x423c26){return new BPromise(function(_0x1899eb,_0x504d53){return client[_0x3d48('0x9')](_0x3c1f9e,_0x423c26)[_0x3d48('0xa')](function(_0x373278){logger[_0x3d48('0xb')](_0x3d48('0xc'),_0x19d8f0,_0x3d48('0xd'));logger[_0x3d48('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x19d8f0,_0x3d48('0xd'),JSON[_0x3d48('0xf')](_0x373278));if(_0x373278[_0x3d48('0x10')]){if(_0x373278['error']['code']===0x1f4){logger[_0x3d48('0x10')](_0x3d48('0xc'),_0x19d8f0,_0x373278[_0x3d48('0x10')][_0x3d48('0x11')]);return _0x504d53(_0x373278[_0x3d48('0x10')]['message']);}logger[_0x3d48('0x10')]('CmCompany,\x20%s,\x20%s',_0x19d8f0,_0x373278[_0x3d48('0x10')][_0x3d48('0x11')]);return _0x1899eb(_0x373278[_0x3d48('0x10')]['message']);}else{logger[_0x3d48('0xb')](_0x3d48('0xc'),_0x19d8f0,_0x3d48('0xd'));_0x1899eb(_0x373278[_0x3d48('0x12')][_0x3d48('0x11')]);}})[_0x3d48('0x13')](function(_0x53a278){logger['error']('CmCompany,\x20%s,\x20%s',_0x19d8f0,_0x53a278);_0x504d53(_0x53a278);});});}
\ No newline at end of file
+var _0xcb1c=['result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x2b0fed,_0x2a4779){var _0x34bfad=function(_0x47852b){while(--_0x47852b){_0x2b0fed['push'](_0x2b0fed['shift']());}};_0x34bfad(++_0x2a4779);}(_0xcb1c,0x1e6));var _0xccb1=function(_0x3a17b0,_0x32a3b6){_0x3a17b0=_0x3a17b0-0x0;var _0xda8c4=_0xcb1c[_0x3a17b0];return _0xda8c4;};'use strict';var _=require(_0xccb1('0x0'));var util=require(_0xccb1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xccb1('0x2'));var fs=require('fs');var Redis=require(_0xccb1('0x3'));var db=require(_0xccb1('0x4'))['db'];var utils=require(_0xccb1('0x5'));var logger=require(_0xccb1('0x6'))(_0xccb1('0x7'));var config=require(_0xccb1('0x8'));var jayson=require(_0xccb1('0x9'));var client=jayson['client'][_0xccb1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12730c,_0x4f8ace,_0x43d6f9){return new BPromise(function(_0x7e694d,_0x462892){return client[_0xccb1('0xb')](_0x12730c,_0x43d6f9)[_0xccb1('0xc')](function(_0x6be1ce){logger[_0xccb1('0xd')](_0xccb1('0xe'),_0x4f8ace,_0xccb1('0xf'));logger['debug'](_0xccb1('0x10'),_0x4f8ace,_0xccb1('0xf'),JSON[_0xccb1('0x11')](_0x6be1ce));if(_0x6be1ce['error']){if(_0x6be1ce[_0xccb1('0x12')]['code']===0x1f4){logger[_0xccb1('0x12')](_0xccb1('0xe'),_0x4f8ace,_0x6be1ce[_0xccb1('0x12')]['message']);return _0x462892(_0x6be1ce[_0xccb1('0x12')]['message']);}logger[_0xccb1('0x12')]('CmCompany,\x20%s,\x20%s',_0x4f8ace,_0x6be1ce[_0xccb1('0x12')]['message']);return _0x7e694d(_0x6be1ce[_0xccb1('0x12')][_0xccb1('0x13')]);}else{logger[_0xccb1('0xd')]('CmCompany,\x20%s,\x20%s',_0x4f8ace,_0xccb1('0xf'));_0x7e694d(_0x6be1ce[_0xccb1('0x14')][_0xccb1('0x13')]);}})[_0xccb1('0x15')](function(_0x11791b){logger[_0xccb1('0x12')](_0xccb1('0xe'),_0x4f8ace,_0x11791b);_0x462892(_0x11791b);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index b646b02..34a4c00 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 _0x910f=['post','create','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/describe','/:id','show','/:id/contacts','getContacts'];(function(_0x3ac2d9,_0x74b171){var _0x226f20=function(_0x508369){while(--_0x508369){_0x3ac2d9['push'](_0x3ac2d9['shift']());}};_0x226f20(++_0x74b171);}(_0x910f,0xb0));var _0xf910=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0x910f[_0x2850c0];return _0x21e830;};'use strict';var multer=require(_0xf910('0x0'));var util=require(_0xf910('0x1'));var path=require(_0xf910('0x2'));var timeout=require(_0xf910('0x3'));var express=require(_0xf910('0x4'));var router=express[_0xf910('0x5')]();var fs_extra=require(_0xf910('0x6'));var auth=require(_0xf910('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router['get']('/',auth[_0xf910('0x8')](),controller[_0xf910('0x9')]);router[_0xf910('0xa')](_0xf910('0xb'),auth[_0xf910('0x8')](),controller['describe']);router[_0xf910('0xa')](_0xf910('0xc'),auth[_0xf910('0x8')](),controller[_0xf910('0xd')]);router[_0xf910('0xa')](_0xf910('0xe'),auth['isAuthenticated'](),controller[_0xf910('0xf')]);router[_0xf910('0x10')]('/',auth[_0xf910('0x8')](),controller[_0xf910('0x11')]);router[_0xf910('0x10')]('/:id/contacts',auth[_0xf910('0x8')](),controller[_0xf910('0x12')]);router[_0xf910('0x13')](_0xf910('0xc'),auth['isAuthenticated'](),controller[_0xf910('0x14')]);router[_0xf910('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xf910('0x16')]);module[_0xf910('0x17')]=router;
\ No newline at end of file
+var _0x6523=['/:id','show','post','/:id/contacts','addContacts','update','destroy','exports','path','express','Router','../../config/environment','./cmCompany.controller','get','isAuthenticated','describe'];(function(_0x7ca45d,_0x2859ad){var _0x211de5=function(_0x3ddb6b){while(--_0x3ddb6b){_0x7ca45d['push'](_0x7ca45d['shift']());}};_0x211de5(++_0x2859ad);}(_0x6523,0x148));var _0x3652=function(_0x7074d5,_0x427953){_0x7074d5=_0x7074d5-0x0;var _0xced075=_0x6523[_0x7074d5];return _0xced075;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3652('0x0'));var timeout=require('connect-timeout');var express=require(_0x3652('0x1'));var router=express[_0x3652('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3652('0x3'));var controller=require(_0x3652('0x4'));router[_0x3652('0x5')]('/',auth[_0x3652('0x6')](),controller['index']);router[_0x3652('0x5')]('/describe',auth[_0x3652('0x6')](),controller[_0x3652('0x7')]);router['get'](_0x3652('0x8'),auth['isAuthenticated'](),controller[_0x3652('0x9')]);router[_0x3652('0x5')]('/:id/contacts',auth[_0x3652('0x6')](),controller['getContacts']);router[_0x3652('0xa')]('/',auth[_0x3652('0x6')](),controller['create']);router['post'](_0x3652('0xb'),auth['isAuthenticated'](),controller[_0x3652('0xc')]);router['put']('/:id',auth[_0x3652('0x6')](),controller[_0x3652('0xd')]);router['delete'](_0x3652('0x8'),auth[_0x3652('0x6')](),controller[_0x3652('0xe')]);module[_0x3652('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 90a564c..9a7a061 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 _0x1d50=['lodash','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x1d50,0xfc));var _0x01d5=function(_0x5023ff,_0x3b7100){_0x5023ff=_0x5023ff-0x0;var _0x409ec3=_0x1d50[_0x5023ff];return _0x409ec3;};'use strict';var _=require(_0x01d5('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0x01d5('0x1')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x01d5('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x01d5('0x1')]},'description':{'type':Sequelize[_0x01d5('0x2')]},'phone':{'type':Sequelize[_0x01d5('0x1')]},'mobile':{'type':Sequelize[_0x01d5('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x01d5('0x1')]},'facebook':{'type':Sequelize[_0x01d5('0x1')]},'fb_data':{'type':Sequelize[_0x01d5('0x1')]},'twitter':{'type':Sequelize[_0x01d5('0x1')]},'skype':{'type':Sequelize[_0x01d5('0x1')]},'teams':{'type':Sequelize[_0x01d5('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x01d5('0x1')]},'wechat':{'type':Sequelize[_0x01d5('0x1')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x01d5('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x01d5('0x1')]},'priority':{'type':Sequelize[_0x01d5('0x3')](0x2)[_0x01d5('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x01d5('0x5')],'defaultValue':Sequelize[_0x01d5('0x6')]},'dialTimezone':{'type':Sequelize[_0x01d5('0x1')]},'utcOffset':{'type':Sequelize[_0x01d5('0x3')]}};
\ No newline at end of file
+var _0x29b9=['DATE','NOW','lodash','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x3cf227,_0x2b6213){var _0x5590c2=function(_0x48c11c){while(--_0x48c11c){_0x3cf227['push'](_0x3cf227['shift']());}};_0x5590c2(++_0x2b6213);}(_0x29b9,0x17c));var _0x929b=function(_0xefed01,_0x5bac62){_0xefed01=_0xefed01-0x0;var _0x138c35=_0x29b9[_0xefed01];return _0x138c35;};'use strict';var _=require(_0x929b('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x929b('0x1')]},'street':{'type':Sequelize[_0x929b('0x1')]},'postalCode':{'type':Sequelize[_0x929b('0x1')]},'city':{'type':Sequelize[_0x929b('0x1')]},'country':{'type':Sequelize[_0x929b('0x1')]},'dateOfBirth':{'type':Sequelize[_0x929b('0x1')]},'description':{'type':Sequelize[_0x929b('0x2')]},'phone':{'type':Sequelize[_0x929b('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x929b('0x1')]},'facebook':{'type':Sequelize[_0x929b('0x1')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x929b('0x1')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x929b('0x1')]},'viber':{'type':Sequelize[_0x929b('0x1')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x929b('0x1')]},'telegram':{'type':Sequelize[_0x929b('0x1')]},'UserId':{'type':Sequelize[_0x929b('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x929b('0x1')]},'priority':{'type':Sequelize[_0x929b('0x3')](0x2)[_0x929b('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x929b('0x5')],'defaultValue':Sequelize[_0x929b('0x6')]},'dialTimezone':{'type':Sequelize[_0x929b('0x1')]},'utcOffset':{'type':Sequelize[_0x929b('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 4ec716d..e5ca75f 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Title','Data','utf-8','toString','base64','lodash','randomstring','path','util','email'];(function(_0x4bebef,_0x1a55f7){var _0x4d74e5=function(_0x5691a9){while(--_0x5691a9){_0x4bebef['push'](_0x4bebef['shift']());}};_0x4d74e5(++_0x1a55f7);}(_0xe2d9,0x193));var _0x9e2d=function(_0xb2e457,_0x305895){_0xb2e457=_0xb2e457-0x0;var _0x375570=_0xe2d9[_0xb2e457];return _0x375570;};'use strict';var _=require(_0x9e2d('0x0'));var moment=require('moment');var random=require(_0x9e2d('0x1'));var fs=require('fs');var path=require(_0x9e2d('0x2'));var util=require(_0x9e2d('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x9e2d('0x4'));var config=require(_0x9e2d('0x5'));function getAddress(_0x3d9f2d){var _0x4caa88=_['head'](_0x3d9f2d[_0x9e2d('0x6')]);return _0x4caa88&&_0x4caa88[_0x9e2d('0x7')]?_0x4caa88['address']:'anonymous'+random[_0x9e2d('0x8')](0x6)+_0x9e2d('0x9');}function getFirstName(_0x1d634d){var _0x43d15d=_['head'](_0x1d634d[_0x9e2d('0x6')]);if(_0x43d15d&&_0x43d15d[_0x9e2d('0xa')]){if(_0x43d15d[_0x9e2d('0xa')]==_0x43d15d[_0x9e2d('0x7')]){return _0x43d15d[_0x9e2d('0xa')][_0x9e2d('0xb')](0x0,_0x43d15d[_0x9e2d('0xa')][_0x9e2d('0xc')]('@'));}var _0xca12de=_0x43d15d[_0x9e2d('0xa')][_0x9e2d('0xd')](/\s+/);return _0xca12de[_0x9e2d('0xe')]>0x1?_0xca12de[_0x9e2d('0xf')](0x0,-0x1)['join']('\x20'):_0x43d15d[_0x9e2d('0xa')];}return _0x9e2d('0x10');}function getLastName(_0x3ca201){var _0x229efe=_[_0x9e2d('0x11')](_0x3ca201[_0x9e2d('0x6')]);if(_0x229efe&&_0x229efe['name']){var _0x544a91=_0x229efe[_0x9e2d('0xa')]['split'](/\s+/);return _0x544a91['length']>0x1?_0x544a91['pop']():'';}return'';}function getMails(_0x2513aa,_0x3d7823){var _0xcd69c4='';for(var _0x597ebb=0x0;_0x597ebb<_0x3d7823['value'][_0x9e2d('0xe')];_0x597ebb+=0x1){if(_0x3d7823[_0x9e2d('0x6')][_0x597ebb][_0x9e2d('0x7')]!==_0x2513aa){if(!_[_0x9e2d('0x12')](_0xcd69c4)){_0xcd69c4+=',';}_0xcd69c4+=_0x3d7823[_0x9e2d('0x6')][_0x597ebb][_0x9e2d('0xa')]||_0x3d7823[_0x9e2d('0x6')][_0x597ebb][_0x9e2d('0x7')]||'';_0xcd69c4+='\x20<';_0xcd69c4+=_0x3d7823[_0x9e2d('0x6')][_0x597ebb][_0x9e2d('0x7')]?_0x3d7823[_0x9e2d('0x6')][_0x597ebb]['address']:_0x9e2d('0x13')+random[_0x9e2d('0x8')](0x6)+'@xcally.com';_0xcd69c4+='>';}}return _0xcd69c4;}function parseEmail(_0x42d451,_0x51ea51,_0xdbceca){if(_0x51ea51['html']){var _0x147dde=/