From: Andrea Amorese
Date: Mon, 13 Sep 2021 15:03:16 +0000 (+0200)
Subject: Built motion from commit 3e8e1dcf.|2.5.35
X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=b2760f80809f51f72d716bc411d4ad7e15051399;p=motion2.git
Built motion from commit 3e8e1dcf.|2.5.35
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 79999d9..2a0309c 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-13T13:59:04.740Z",
+ "time": "2021-09-13T14:49:58.123Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 56f2dd2..b455ce8 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-13T13:59:04.740Z",
+ "time": "2021-09-13T14:49:58.123Z",
"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 bb7b904..134ba7d 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 _0x9be3=['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]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward'];(function(_0x16d435,_0x5d6d2c){var _0x4f4e79=function(_0xde600e){while(--_0xde600e){_0x16d435['push'](_0x16d435['shift']());}};_0x4f4e79(++_0x5d6d2c);}(_0x9be3,0xd2));var _0x39be=function(_0x4d4576,_0x373606){_0x4d4576=_0x4d4576-0x0;var _0x437769=_0x9be3[_0x4d4576];return _0x437769;};'use strict';var Sequelize=require(_0x39be('0x0'));module[_0x39be('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x17b77d){return this[_0x39be('0x2')](_0x39be('0x3'));}},'action':{'type':Sequelize[_0x39be('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x39be('0x5'),_0x39be('0x6'),_0x39be('0x7'),_0x39be('0x8'),_0x39be('0x9'),'browser',_0x39be('0xa'),_0x39be('0xb')]],'msg':_0x39be('0xc')}},'comment':_0x39be('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x39be('0xd')},'data2':{'type':Sequelize[_0x39be('0x4')](0x1000),'comment':_0x39be('0xe')},'data3':{'type':Sequelize[_0x39be('0x4')](0x1000),'comment':_0x39be('0xf')},'data4':{'type':Sequelize[_0x39be('0x4')](0x1000),'comments':_0x39be('0x10')},'data5':{'type':Sequelize[_0x39be('0x4')](0x1000),'comments':_0x39be('0x11')},'data6':{'type':Sequelize['STRING'],'comments':_0x39be('0x12')},'data7':{'type':Sequelize['TEXT'],'comments':_0x39be('0x13')}};
\ No newline at end of file
+var _0x6be8=['bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','urlForward'];(function(_0x2b7cd1,_0x26db39){var _0x58b4f3=function(_0x18c777){while(--_0x18c777){_0x2b7cd1['push'](_0x2b7cd1['shift']());}};_0x58b4f3(++_0x26db39);}(_0x6be8,0x76));var _0x86be=function(_0x351ae1,_0x5d7aca){_0x351ae1=_0x351ae1-0x0;var _0x5e13b2=_0x6be8[_0x351ae1];return _0x5e13b2;};'use strict';var Sequelize=require(_0x86be('0x0'));module['exports']={'name':{'type':Sequelize[_0x86be('0x1')],'get':function(_0x44e38a){return this[_0x86be('0x2')]('action');}},'action':{'type':Sequelize[_0x86be('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x86be('0x4'),_0x86be('0x5'),_0x86be('0x6'),'jscripty',_0x86be('0x7'),'browser',_0x86be('0x8'),_0x86be('0x9')]],'msg':_0x86be('0xa')}},'comment':_0x86be('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x86be('0x3')](0x1000),'comment':_0x86be('0xb')},'data3':{'type':Sequelize[_0x86be('0x3')](0x1000),'comment':_0x86be('0xc')},'data4':{'type':Sequelize[_0x86be('0x3')](0x1000),'comments':_0x86be('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x86be('0xe')},'data6':{'type':Sequelize['STRING'],'comments':_0x86be('0xf')},'data7':{'type':Sequelize[_0x86be('0x10')],'comments':_0x86be('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 8084f7a..838f916 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 _0x68c6=['end','status','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','body','Action','find','catch','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x3d0827,_0x299609){var _0x52a5d8=function(_0x214025){while(--_0x214025){_0x3d0827['push'](_0x3d0827['shift']());}};_0x52a5d8(++_0x299609);}(_0x68c6,0x166));var _0x668c=function(_0x81e39d,_0x4c3934){_0x81e39d=_0x81e39d-0x0;var _0x548fbb=_0x68c6[_0x81e39d];return _0x548fbb;};'use strict';var emlformat=require(_0x668c('0x0'));var rimraf=require(_0x668c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x668c('0x2'));var rp=require(_0x668c('0x3'));var moment=require('moment');var BPromise=require(_0x668c('0x4'));var Mustache=require(_0x668c('0x5'));var util=require(_0x668c('0x6'));var path=require(_0x668c('0x7'));var sox=require('sox');var csv=require(_0x668c('0x8'));var ejs=require(_0x668c('0x9'));var fs=require('fs');var fs_extra=require(_0x668c('0xa'));var _=require(_0x668c('0xb'));var squel=require(_0x668c('0xc'));var crypto=require(_0x668c('0xd'));var jsforce=require(_0x668c('0xe'));var deskjs=require(_0x668c('0xf'));var toCsv=require(_0x668c('0x8'));var querystring=require(_0x668c('0x10'));var Papa=require(_0x668c('0x11'));var Redis=require(_0x668c('0x12'));var authService=require(_0x668c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x668c('0x14'));var hardwareService=require(_0x668c('0x15'));var logger=require(_0x668c('0x16'))('api');var utils=require(_0x668c('0x17'));var config=require(_0x668c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x668c('0x19'))['db'];function respondWithStatusCode(_0x1efb9c,_0x10eb04){_0x10eb04=_0x10eb04||0xcc;return function(_0x4e9f77){if(_0x4e9f77){return _0x1efb9c['sendStatus'](_0x10eb04);}return _0x1efb9c['status'](_0x10eb04)[_0x668c('0x1a')]();};}function respondWithResult(_0x333038,_0x1891be){_0x1891be=_0x1891be||0xc8;return function(_0x46b513){if(_0x46b513){return _0x333038[_0x668c('0x1b')](_0x1891be)[_0x668c('0x1c')](_0x46b513);}};}function respondWithFilteredResult(_0x1a1802,_0x173dbd){return function(_0x51bef0){if(_0x51bef0){var _0x28aa9b=typeof _0x173dbd[_0x668c('0x1d')]===_0x668c('0x1e')&&typeof _0x173dbd['limit']===_0x668c('0x1e');var _0x3ff644=_0x51bef0[_0x668c('0x1f')];var _0x34314d=_0x28aa9b?0x0:_0x173dbd[_0x668c('0x1d')];var _0x6261d0=_0x28aa9b?_0x51bef0['count']:_0x173dbd[_0x668c('0x1d')]+_0x173dbd[_0x668c('0x20')];var _0x58d218;if(_0x6261d0>=_0x3ff644){_0x6261d0=_0x3ff644;_0x58d218=0xc8;}else{_0x58d218=0xce;}_0x1a1802[_0x668c('0x1b')](_0x58d218);return _0x1a1802['set']('Content-Range',_0x34314d+'-'+_0x6261d0+'/'+_0x3ff644)[_0x668c('0x1c')](_0x51bef0);}return null;};}function patchUpdates(_0x35476b){return function(_0x183cef){try{jsonpatch[_0x668c('0x21')](_0x183cef,_0x35476b,!![]);}catch(_0x5064ee){return BPromise[_0x668c('0x22')](_0x5064ee);}return _0x183cef[_0x668c('0x23')]();};}function saveUpdates(_0x5ad618,_0x13183a){return function(_0xbbbf43){if(_0xbbbf43){return _0xbbbf43[_0x668c('0x24')](_0x5ad618)[_0x668c('0x25')](function(_0x4d3f5f){return _0x4d3f5f;});}return null;};}function removeEntity(_0x522e3a,_0x74993f){return function(_0x35415e){if(_0x35415e){return _0x35415e[_0x668c('0x26')]()[_0x668c('0x25')](function(){_0x522e3a[_0x668c('0x1b')](0xcc)[_0x668c('0x1a')]();});}};}function handleEntityNotFound(_0x39aabe,_0x538940){return function(_0x9195de){if(!_0x9195de){_0x39aabe[_0x668c('0x27')](0x194);}return _0x9195de;};}function handleError(_0x17ed4f,_0x5aefdd){_0x5aefdd=_0x5aefdd||0x1f4;return function(_0x338ca6){logger['error'](_0x338ca6[_0x668c('0x28')]);if(_0x338ca6[_0x668c('0x29')]){delete _0x338ca6[_0x668c('0x29')];}_0x17ed4f[_0x668c('0x1b')](_0x5aefdd)[_0x668c('0x2a')](_0x338ca6);};}exports[_0x668c('0x24')]=function(_0x54b542,_0x57ef14){if(_0x54b542[_0x668c('0x2b')]['id']){delete _0x54b542[_0x668c('0x2b')]['id'];}return db[_0x668c('0x2c')][_0x668c('0x2d')]({'where':{'id':_0x54b542['params']['id']}})['then'](handleEntityNotFound(_0x57ef14,null))['then'](saveUpdates(_0x54b542[_0x668c('0x2b')],null))[_0x668c('0x25')](respondWithResult(_0x57ef14,null))[_0x668c('0x2e')](handleError(_0x57ef14,null));};exports[_0x668c('0x26')]=function(_0x48d0fb,_0x3eda2c){return db['Action'][_0x668c('0x2d')]({'where':{'id':_0x48d0fb[_0x668c('0x2f')]['id']}})[_0x668c('0x25')](handleEntityNotFound(_0x3eda2c,null))[_0x668c('0x25')](removeEntity(_0x3eda2c,null))[_0x668c('0x2e')](handleError(_0x3eda2c,null));};
\ No newline at end of file
+var _0xcd5f=['limit','set','Content-Range','save','then','destroy','error','stack','name','send','update','Action','params','body','catch','find','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined'];(function(_0x38983a,_0xd83acb){var _0x2f7fda=function(_0x16dad3){while(--_0x16dad3){_0x38983a['push'](_0x38983a['shift']());}};_0x2f7fda(++_0xd83acb);}(_0xcd5f,0x6a));var _0xfcd5=function(_0x4dcba5,_0x2e19bb){_0x4dcba5=_0x4dcba5-0x0;var _0x313325=_0xcd5f[_0x4dcba5];return _0x313325;};'use strict';var emlformat=require(_0xfcd5('0x0'));var rimraf=require(_0xfcd5('0x1'));var zipdir=require(_0xfcd5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfcd5('0x3'));var BPromise=require(_0xfcd5('0x4'));var Mustache=require(_0xfcd5('0x5'));var util=require('util');var path=require('path');var sox=require(_0xfcd5('0x6'));var csv=require(_0xfcd5('0x7'));var ejs=require(_0xfcd5('0x8'));var fs=require('fs');var fs_extra=require(_0xfcd5('0x9'));var _=require(_0xfcd5('0xa'));var squel=require(_0xfcd5('0xb'));var crypto=require(_0xfcd5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfcd5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfcd5('0xe'));var Papa=require(_0xfcd5('0xf'));var Redis=require('ioredis');var authService=require(_0xfcd5('0x10'));var qs=require(_0xfcd5('0x11'));var as=require(_0xfcd5('0x12'));var hardwareService=require(_0xfcd5('0x13'));var logger=require('../../config/logger')(_0xfcd5('0x14'));var utils=require(_0xfcd5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfcd5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4876d4,_0x189376){_0x189376=_0x189376||0xcc;return function(_0x1954eb){if(_0x1954eb){return _0x4876d4[_0xfcd5('0x17')](_0x189376);}return _0x4876d4['status'](_0x189376)[_0xfcd5('0x18')]();};}function respondWithResult(_0x1a27e1,_0x36a6c8){_0x36a6c8=_0x36a6c8||0xc8;return function(_0x2f6098){if(_0x2f6098){return _0x1a27e1[_0xfcd5('0x19')](_0x36a6c8)[_0xfcd5('0x1a')](_0x2f6098);}};}function respondWithFilteredResult(_0x1ccb0e,_0x5adf5e){return function(_0x382e93){if(_0x382e93){var _0x5288f4=typeof _0x5adf5e[_0xfcd5('0x1b')]===_0xfcd5('0x1c')&&typeof _0x5adf5e[_0xfcd5('0x1d')]==='undefined';var _0x47d87c=_0x382e93['count'];var _0x382e86=_0x5288f4?0x0:_0x5adf5e['offset'];var _0x2152ff=_0x5288f4?_0x382e93['count']:_0x5adf5e['offset']+_0x5adf5e[_0xfcd5('0x1d')];var _0x64c027;if(_0x2152ff>=_0x47d87c){_0x2152ff=_0x47d87c;_0x64c027=0xc8;}else{_0x64c027=0xce;}_0x1ccb0e[_0xfcd5('0x19')](_0x64c027);return _0x1ccb0e[_0xfcd5('0x1e')](_0xfcd5('0x1f'),_0x382e86+'-'+_0x2152ff+'/'+_0x47d87c)[_0xfcd5('0x1a')](_0x382e93);}return null;};}function patchUpdates(_0x332455){return function(_0x253eea){try{jsonpatch['apply'](_0x253eea,_0x332455,!![]);}catch(_0x3f6631){return BPromise['reject'](_0x3f6631);}return _0x253eea[_0xfcd5('0x20')]();};}function saveUpdates(_0x55dba8,_0x4e34b2){return function(_0x4e8e5f){if(_0x4e8e5f){return _0x4e8e5f['update'](_0x55dba8)[_0xfcd5('0x21')](function(_0x2f4c90){return _0x2f4c90;});}return null;};}function removeEntity(_0x33179b,_0x34e4e8){return function(_0x23762d){if(_0x23762d){return _0x23762d[_0xfcd5('0x22')]()['then'](function(){_0x33179b[_0xfcd5('0x19')](0xcc)[_0xfcd5('0x18')]();});}};}function handleEntityNotFound(_0x1240ce,_0xd217ce){return function(_0x4fd50a){if(!_0x4fd50a){_0x1240ce[_0xfcd5('0x17')](0x194);}return _0x4fd50a;};}function handleError(_0x73e631,_0x22e5e7){_0x22e5e7=_0x22e5e7||0x1f4;return function(_0xf509d1){logger[_0xfcd5('0x23')](_0xf509d1[_0xfcd5('0x24')]);if(_0xf509d1['name']){delete _0xf509d1[_0xfcd5('0x25')];}_0x73e631[_0xfcd5('0x19')](_0x22e5e7)[_0xfcd5('0x26')](_0xf509d1);};}exports[_0xfcd5('0x27')]=function(_0x136abe,_0x2596f4){if(_0x136abe['body']['id']){delete _0x136abe['body']['id'];}return db[_0xfcd5('0x28')]['find']({'where':{'id':_0x136abe[_0xfcd5('0x29')]['id']}})[_0xfcd5('0x21')](handleEntityNotFound(_0x2596f4,null))[_0xfcd5('0x21')](saveUpdates(_0x136abe[_0xfcd5('0x2a')],null))[_0xfcd5('0x21')](respondWithResult(_0x2596f4,null))[_0xfcd5('0x2b')](handleError(_0x2596f4,null));};exports[_0xfcd5('0x22')]=function(_0x354885,_0xa3721b){return db[_0xfcd5('0x28')][_0xfcd5('0x2c')]({'where':{'id':_0x354885[_0xfcd5('0x29')]['id']}})[_0xfcd5('0x21')](handleEntityNotFound(_0xa3721b,null))['then'](removeEntity(_0xa3721b,null))[_0xfcd5('0x2b')](handleError(_0xa3721b,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index be5e6da..9ba84a3 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 _0xe25b=['api','moment','bluebird','request-promise','rimraf','./action.attributes','define','Action','tools_actions','lodash','util','../../config/logger'];(function(_0x1837da,_0x5e3681){var _0x3b0ba2=function(_0x2ed3b6){while(--_0x2ed3b6){_0x1837da['push'](_0x1837da['shift']());}};_0x3b0ba2(++_0x5e3681);}(_0xe25b,0x129));var _0xbe25=function(_0x30be39,_0xfb49ad){_0x30be39=_0x30be39-0x0;var _0x4d99d6=_0xe25b[_0x30be39];return _0x4d99d6;};'use strict';var _=require(_0xbe25('0x0'));var util=require(_0xbe25('0x1'));var logger=require(_0xbe25('0x2'))(_0xbe25('0x3'));var moment=require(_0xbe25('0x4'));var BPromise=require(_0xbe25('0x5'));var rp=require(_0xbe25('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbe25('0x7'));var config=require('../../config/environment');var attributes=require(_0xbe25('0x8'));module['exports']=function(_0xef92c9,_0x567d2c){return _0xef92c9[_0xbe25('0x9')](_0xbe25('0xa'),attributes,{'tableName':_0xbe25('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x03bc=['./action.attributes','exports','define','Action','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4fa40c,_0x32fcf8){var _0x389186=function(_0x266915){while(--_0x266915){_0x4fa40c['push'](_0x4fa40c['shift']());}};_0x389186(++_0x32fcf8);}(_0x03bc,0x1a8));var _0xc03b=function(_0x5d75ff,_0x5bc7ac){_0x5d75ff=_0x5d75ff-0x0;var _0x1c1894=_0x03bc[_0x5d75ff];return _0x1c1894;};'use strict';var _=require(_0xc03b('0x0'));var util=require(_0xc03b('0x1'));var logger=require('../../config/logger')(_0xc03b('0x2'));var moment=require(_0xc03b('0x3'));var BPromise=require(_0xc03b('0x4'));var rp=require(_0xc03b('0x5'));var fs=require('fs');var path=require(_0xc03b('0x6'));var rimraf=require(_0xc03b('0x7'));var config=require('../../config/environment');var attributes=require(_0xc03b('0x8'));module[_0xc03b('0x9')]=function(_0x5dfca7,_0x4ab744){return _0x5dfca7[_0xc03b('0xa')](_0xc03b('0xb'),attributes,{'tableName':'tools_actions','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 edbd371..298207e 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x5b6a47,_0x2338b9){var _0xf4a5f0=function(_0x56e498){while(--_0x56e498){_0x5b6a47['push'](_0x5b6a47['shift']());}};_0xf4a5f0(++_0x2338b9);}(_0xabce,0x103));var _0xeabc=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xabce[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
+var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x212517,_0x2f737a){var _0xa6466=function(_0x1b29e7){while(--_0x1b29e7){_0x212517['push'](_0x212517['shift']());}};_0xa6466(++_0x2f737a);}(_0x1261,0x144));var _0x1126=function(_0xc45596,_0x5c410e){_0xc45596=_0xc45596-0x0;var _0x425ffe=_0x1261[_0xc45596];return _0x425ffe;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index dba6223..9c056fd 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 _0x2785=['../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x2785,0x140));var _0x5278=function(_0x3ee935,_0x293a98){_0x3ee935=_0x3ee935-0x0;var _0x586db7=_0x2785[_0x3ee935];return _0x586db7;};'use strict';var multer=require(_0x5278('0x0'));var util=require(_0x5278('0x1'));var path=require('path');var timeout=require(_0x5278('0x2'));var express=require('express');var router=express[_0x5278('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5278('0x4'));var config=require(_0x5278('0x5'));var controller=require('./action.controller');router[_0x5278('0x6')](_0x5278('0x7'),auth[_0x5278('0x8')](),controller['update']);router[_0x5278('0x9')](_0x5278('0x7'),auth[_0x5278('0x8')](),controller[_0x5278('0xa')]);module[_0x5278('0xb')]=router;
\ No newline at end of file
+var _0x5f0c=['connect-timeout','express','fs-extra','./action.controller','put','/:id','delete','isAuthenticated','destroy','exports','multer','util','path'];(function(_0x5a8555,_0x4c8aa9){var _0x56fef8=function(_0x2ea160){while(--_0x2ea160){_0x5a8555['push'](_0x5a8555['shift']());}};_0x56fef8(++_0x4c8aa9);}(_0x5f0c,0xcd));var _0xc5f0=function(_0x195a12,_0x558d3c){_0x195a12=_0x195a12-0x0;var _0x5aaf55=_0x5f0c[_0x195a12];return _0x5aaf55;};'use strict';var multer=require(_0xc5f0('0x0'));var util=require(_0xc5f0('0x1'));var path=require(_0xc5f0('0x2'));var timeout=require(_0xc5f0('0x3'));var express=require(_0xc5f0('0x4'));var router=express['Router']();var fs_extra=require(_0xc5f0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc5f0('0x6'));router[_0xc5f0('0x7')](_0xc5f0('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xc5f0('0x9')](_0xc5f0('0x8'),auth[_0xc5f0('0xa')](),controller[_0xc5f0('0xb')]);module[_0xc5f0('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 83c2c62..fef43a0 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 _0x2675=['sequelize','STRING','TEXT'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x2675,0x75));var _0x5267=function(_0x50fa04,_0xcfb27){_0x50fa04=_0x50fa04-0x0;var _0xb49bbc=_0x2675[_0x50fa04];return _0xb49bbc;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
+var _0x1883=['exports','STRING','TEXT','sequelize'];(function(_0x58b06c,_0x53ea01){var _0x4b7db8=function(_0xd151c4){while(--_0xd151c4){_0x58b06c['push'](_0x58b06c['shift']());}};_0x4b7db8(++_0x53ea01);}(_0x1883,0xab));var _0x3188=function(_0xa8fef9,_0x273f58){_0xa8fef9=_0xa8fef9-0x0;var _0x1e6c39=_0x1883[_0xa8fef9];return _0x1e6c39;};'use strict';var Sequelize=require(_0x3188('0x0'));module[_0x3188('0x1')]={'name':{'type':Sequelize[_0x3188('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3188('0x2')]},'parent':{'type':Sequelize[_0x3188('0x2')]},'table':{'type':Sequelize[_0x3188('0x2')]},'conditions':{'type':Sequelize[_0x3188('0x3')]},'joins':{'type':Sequelize[_0x3188('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 7e01fe5..4dba350 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 _0x0a5f=['SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','IS\x20NOT\x20EMPTY','Sequelize','ValidationErrorItem','alias','output','web','fullPath','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','run','runReport','eml-format','rimraf','zip-dir','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','CustomReports','UserProfileResource','sendStatus','stack','name','send','index','fieldName','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','options','AnalyticCustomReport','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join'];(function(_0xdc66e7,_0x13a216){var _0x1a46af=function(_0x4a11a5){while(--_0x4a11a5){_0xdc66e7['push'](_0xdc66e7['shift']());}};_0x1a46af(++_0x13a216);}(_0x0a5f,0x192));var _0xf0a5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0a5f[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xf0a5('0x0'));var rimraf=require(_0xf0a5('0x1'));var zipdir=require(_0xf0a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf0a5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf0a5('0x4'));var util=require(_0xf0a5('0x5'));var path=require(_0xf0a5('0x6'));var sox=require('sox');var csv=require(_0xf0a5('0x7'));var ejs=require(_0xf0a5('0x8'));var fs=require('fs');var fs_extra=require(_0xf0a5('0x9'));var _=require('lodash');var squel=require(_0xf0a5('0xa'));var crypto=require(_0xf0a5('0xb'));var jsforce=require(_0xf0a5('0xc'));var deskjs=require(_0xf0a5('0xd'));var toCsv=require(_0xf0a5('0x7'));var querystring=require(_0xf0a5('0xe'));var Papa=require(_0xf0a5('0xf'));var Redis=require(_0xf0a5('0x10'));var authService=require(_0xf0a5('0x11'));var qs=require(_0xf0a5('0x12'));var as=require(_0xf0a5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf0a5('0x14'));var utils=require(_0xf0a5('0x15'));var config=require(_0xf0a5('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0xf0a5('0x17'))['dbH'];function respondWithStatusCode(_0x465c3e,_0x2d2f37){_0x2d2f37=_0x2d2f37||0xcc;return function(_0x579b57){if(_0x579b57){return _0x465c3e['sendStatus'](_0x2d2f37);}return _0x465c3e[_0xf0a5('0x18')](_0x2d2f37)[_0xf0a5('0x19')]();};}function respondWithResult(_0x86a4c,_0x2305e6){_0x2305e6=_0x2305e6||0xc8;return function(_0x5eaaa6){if(_0x5eaaa6){return _0x86a4c[_0xf0a5('0x18')](_0x2305e6)[_0xf0a5('0x1a')](_0x5eaaa6);}};}function respondWithFilteredResult(_0xfe660e,_0x477529){return function(_0x432e4f){if(_0x432e4f){var _0x36f558=typeof _0x477529[_0xf0a5('0x1b')]===_0xf0a5('0x1c')&&typeof _0x477529[_0xf0a5('0x1d')]===_0xf0a5('0x1c');var _0x1e4b8e=_0x432e4f[_0xf0a5('0x1e')];var _0x51d9af=_0x36f558?0x0:_0x477529[_0xf0a5('0x1b')];var _0x16c654=_0x36f558?_0x432e4f['count']:_0x477529['offset']+_0x477529[_0xf0a5('0x1d')];var _0x4a7c0b;if(_0x16c654>=_0x1e4b8e){_0x16c654=_0x1e4b8e;_0x4a7c0b=0xc8;}else{_0x4a7c0b=0xce;}_0xfe660e[_0xf0a5('0x18')](_0x4a7c0b);return _0xfe660e[_0xf0a5('0x1f')](_0xf0a5('0x20'),_0x51d9af+'-'+_0x16c654+'/'+_0x1e4b8e)['json'](_0x432e4f);}return null;};}function patchUpdates(_0x4ddd15){return function(_0x541bde){try{jsonpatch[_0xf0a5('0x21')](_0x541bde,_0x4ddd15,!![]);}catch(_0x34e2a4){return BPromise[_0xf0a5('0x22')](_0x34e2a4);}return _0x541bde['save']();};}function saveUpdates(_0x51a44c,_0x2f0980){return function(_0x21d579){if(_0x21d579){return _0x21d579[_0xf0a5('0x23')](_0x51a44c)[_0xf0a5('0x24')](function(_0x415ec2){return _0x415ec2;});}return null;};}function removeEntity(_0xd8b72e,_0x150a39){return function(_0x39aaac){if(_0x39aaac){return _0x39aaac[_0xf0a5('0x25')]()[_0xf0a5('0x24')](function(){var _0x12d773=_0x39aaac['get']({'plain':!![]});var _0x5c5b6e=_0xf0a5('0x26');return db[_0xf0a5('0x27')][_0xf0a5('0x25')]({'where':{'type':_0x5c5b6e,'resourceId':_0x12d773['id']}})[_0xf0a5('0x24')](function(){return _0x39aaac;});})['then'](function(){_0xd8b72e['status'](0xcc)[_0xf0a5('0x19')]();});}};}function handleEntityNotFound(_0x2a7a4e,_0x10a156){return function(_0x1281ee){if(!_0x1281ee){_0x2a7a4e[_0xf0a5('0x28')](0x194);}return _0x1281ee;};}function handleError(_0x199260,_0x361ab2){_0x361ab2=_0x361ab2||0x1f4;return function(_0x3f3db6){logger['error'](_0x3f3db6[_0xf0a5('0x29')]);if(_0x3f3db6[_0xf0a5('0x2a')]){delete _0x3f3db6[_0xf0a5('0x2a')];}_0x199260[_0xf0a5('0x18')](_0x361ab2)[_0xf0a5('0x2b')](_0x3f3db6);};}exports[_0xf0a5('0x2c')]=function(_0x478b7e,_0x42de00){var _0x11df05={},_0x40580b={},_0x40cda8={'count':0x0,'rows':[]};var _0x4995fb=_['map'](db['AnalyticCustomReport']['rawAttributes'],function(_0x371cf2){return{'name':_0x371cf2[_0xf0a5('0x2d')],'type':_0x371cf2['type']['key']};});_0x40580b[_0xf0a5('0x2e')]=_[_0xf0a5('0x2f')](_0x4995fb,'name');_0x40580b[_0xf0a5('0x30')]=_[_0xf0a5('0x31')](_0x478b7e[_0xf0a5('0x30')]);_0x40580b['filters']=_[_0xf0a5('0x32')](_0x40580b[_0xf0a5('0x2e')],_0x40580b[_0xf0a5('0x30')]);_0x11df05[_0xf0a5('0x33')]=_[_0xf0a5('0x32')](_0x40580b[_0xf0a5('0x2e')],qs[_0xf0a5('0x34')](_0x478b7e[_0xf0a5('0x30')][_0xf0a5('0x34')]));_0x11df05['attributes']=_0x11df05[_0xf0a5('0x33')][_0xf0a5('0x35')]?_0x11df05[_0xf0a5('0x33')]:_0x40580b[_0xf0a5('0x2e')];if(!_0x478b7e['query'][_0xf0a5('0x36')](_0xf0a5('0x37'))){_0x11df05['limit']=qs[_0xf0a5('0x1d')](_0x478b7e['query'][_0xf0a5('0x1d')]);_0x11df05['offset']=qs[_0xf0a5('0x1b')](_0x478b7e[_0xf0a5('0x30')][_0xf0a5('0x1b')]);}_0x11df05[_0xf0a5('0x38')]=qs['sort'](_0x478b7e[_0xf0a5('0x30')][_0xf0a5('0x39')]);_0x11df05[_0xf0a5('0x3a')]=qs[_0xf0a5('0x3b')](_[_0xf0a5('0x3c')](_0x478b7e[_0xf0a5('0x30')],_0x40580b[_0xf0a5('0x3b')]),_0x4995fb);if(_0x478b7e[_0xf0a5('0x30')]['filter']){_0x11df05['where']=_['merge'](_0x11df05[_0xf0a5('0x3a')],{'$or':_[_0xf0a5('0x2f')](_0x4995fb,function(_0x17a7cc){if(_0x17a7cc['type']!==_0xf0a5('0x3d')){var _0x51a61b={};_0x51a61b[_0x17a7cc[_0xf0a5('0x2a')]]={'$like':'%'+_0x478b7e[_0xf0a5('0x30')]['filter']+'%'};return _0x51a61b;}})});}_0x11df05=_[_0xf0a5('0x3e')]({},_0x11df05,_0x478b7e[_0xf0a5('0x3f')]);var _0x1f503c={'where':_0x11df05[_0xf0a5('0x3a')]};return db[_0xf0a5('0x40')][_0xf0a5('0x1e')](_0x1f503c)[_0xf0a5('0x24')](function(_0x56bb8a){_0x40cda8[_0xf0a5('0x1e')]=_0x56bb8a;if(_0x478b7e[_0xf0a5('0x30')][_0xf0a5('0x41')]){_0x11df05['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xf0a5('0x42')](_0x11df05);})[_0xf0a5('0x24')](function(_0x4fe734){_0x40cda8[_0xf0a5('0x43')]=_0x4fe734;return _0x40cda8;})[_0xf0a5('0x24')](respondWithFilteredResult(_0x42de00,_0x11df05))[_0xf0a5('0x44')](handleError(_0x42de00,null));};exports['show']=function(_0x4e0555,_0xf02b75){var _0x378a09={'raw':![],'where':{'id':_0x4e0555[_0xf0a5('0x45')]['id']}},_0x10cb6e={};_0x10cb6e[_0xf0a5('0x2e')]=_[_0xf0a5('0x31')](db['AnalyticCustomReport'][_0xf0a5('0x46')]);_0x10cb6e[_0xf0a5('0x30')]=_[_0xf0a5('0x31')](_0x4e0555[_0xf0a5('0x30')]);_0x10cb6e['filters']=_['intersection'](_0x10cb6e[_0xf0a5('0x2e')],_0x10cb6e[_0xf0a5('0x30')]);_0x378a09[_0xf0a5('0x33')]=_['intersection'](_0x10cb6e[_0xf0a5('0x2e')],qs[_0xf0a5('0x34')](_0x4e0555[_0xf0a5('0x30')][_0xf0a5('0x34')]));_0x378a09[_0xf0a5('0x33')]=_0x378a09['attributes'][_0xf0a5('0x35')]?_0x378a09[_0xf0a5('0x33')]:_0x10cb6e[_0xf0a5('0x2e')];if(_0x4e0555[_0xf0a5('0x30')][_0xf0a5('0x41')]){_0x378a09[_0xf0a5('0x47')]=[{'all':!![]}];}_0x378a09=_['merge']({},_0x378a09,_0x4e0555['options']);return db[_0xf0a5('0x40')][_0xf0a5('0x48')](_0x378a09)[_0xf0a5('0x24')](handleEntityNotFound(_0xf02b75,null))[_0xf0a5('0x24')](respondWithResult(_0xf02b75,null))[_0xf0a5('0x44')](handleError(_0xf02b75,null));};exports[_0xf0a5('0x49')]=function(_0x4a1266,_0x1cd22c){return db['AnalyticCustomReport'][_0xf0a5('0x49')](_0x4a1266[_0xf0a5('0x4a')],{})['then'](function(_0x525755){var _0x36e36d=_0x4a1266[_0xf0a5('0x4b')]['get']({'plain':!![]});if(!_0x36e36d)throw new Error(_0xf0a5('0x4c'));if(_0x36e36d[_0xf0a5('0x4d')]===_0xf0a5('0x4b')){var _0x3ac758=_0x525755[_0xf0a5('0x4e')]({'plain':!![]});var _0x492334='Reports';return db[_0xf0a5('0x4f')]['find']({'where':{'name':_0x492334,'userProfileId':_0x36e36d['userProfileId']},'raw':!![]})[_0xf0a5('0x24')](function(_0x4d648f){if(_0x4d648f&&_0x4d648f['autoAssociation']===0x0){return db[_0xf0a5('0x27')][_0xf0a5('0x49')]({'name':_0x3ac758[_0xf0a5('0x2a')],'resourceId':_0x3ac758['id'],'type':_0xf0a5('0x26'),'sectionId':_0x4d648f['id']},{})[_0xf0a5('0x24')](function(){return _0x525755;});}else{return _0x525755;}})[_0xf0a5('0x44')](function(_0x5499ed){logger[_0xf0a5('0x50')](_0xf0a5('0x51'),_0x5499ed);throw _0x5499ed;});}return _0x525755;})['then'](respondWithResult(_0x1cd22c,0xc9))[_0xf0a5('0x44')](handleError(_0x1cd22c,null));};exports[_0xf0a5('0x23')]=function(_0x4585db,_0xf97337){if(_0x4585db['body']['id']){delete _0x4585db['body']['id'];}return db[_0xf0a5('0x40')][_0xf0a5('0x48')]({'where':{'id':_0x4585db['params']['id']}})['then'](handleEntityNotFound(_0xf97337,null))[_0xf0a5('0x24')](saveUpdates(_0x4585db[_0xf0a5('0x4a')],null))['then'](respondWithResult(_0xf97337,null))[_0xf0a5('0x44')](handleError(_0xf97337,null));};exports[_0xf0a5('0x25')]=function(_0x159cc9,_0x2fc8fb){return db[_0xf0a5('0x40')][_0xf0a5('0x48')]({'where':{'id':_0x159cc9[_0xf0a5('0x45')]['id']}})[_0xf0a5('0x24')](handleEntityNotFound(_0x2fc8fb,null))[_0xf0a5('0x24')](removeEntity(_0x2fc8fb,null))['catch'](handleError(_0x2fc8fb,null));};exports[_0xf0a5('0x52')]=function(_0x5c841c,_0x513473){var _0x1983b2=0xa;var _0x4dc52b=[_0xf0a5('0x53'),_0xf0a5('0x54'),_0xf0a5('0x55'),_0xf0a5('0x56')];var _0x3bff7b={'SUM':_0xf0a5('0x57'),'COUNT':_0xf0a5('0x58'),'COUNT DISTINCT':_0xf0a5('0x59'),'MAX':_0xf0a5('0x5a'),'MIN':'MIN(%s)','AVG':_0xf0a5('0x5b'),'GROUP_CONCAT':_0xf0a5('0x5c'),'GROUP_CONCAT ASC':_0xf0a5('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f4910={'SEC_TO_TIME':_0xf0a5('0x5e'),'DATE':_0xf0a5('0x5f'),'HOUR':_0xf0a5('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xf0a5('0x61')};var _0x53b619=function(_0x225efa){return!_[_0xf0a5('0x62')]([_0xf0a5('0x63'),_0xf0a5('0x64'),_0xf0a5('0x65'),'IS\x20NOT\x20EMPTY'],_0x225efa);};var _0x3bc095=function(_0x332b2e){if(!_0x332b2e||!_0x332b2e[_0xf0a5('0x66')][_0xf0a5('0x35')]){return'';}for(var _0xa002ae='(',_0x580bae=0x0;_0x580bae<_0x332b2e[_0xf0a5('0x66')][_0xf0a5('0x35')];_0x580bae+=0x1){_0x580bae>0x0&&(_0xa002ae+='\x20'+_0x332b2e[_0xf0a5('0x67')]+'\x20');_0xa002ae+=_0x332b2e[_0xf0a5('0x66')][_0x580bae][_0xf0a5('0x68')]?_0x3bc095(_0x332b2e[_0xf0a5('0x66')][_0x580bae]['group']):_0x332b2e[_0xf0a5('0x66')][_0x580bae]['field']+'\x20'+_0x332b2e['rules'][_0x580bae][_0xf0a5('0x69')]+(_0x53b619(_0x332b2e[_0xf0a5('0x66')][_0x580bae][_0xf0a5('0x69')])?'\x20'+_0x332b2e[_0xf0a5('0x66')][_0x580bae][_0xf0a5('0x6a')]:'');}return _0xa002ae+')';};var _0x79e599={'where':{'id':_0x5c841c[_0xf0a5('0x45')]['id']}},_0x1b4e15,_0x588d6c,_0x21ba02,_0x36024a,_0x543a83;_0x79e599=_[_0xf0a5('0x3e')]({},_0x79e599,_0x5c841c[_0xf0a5('0x3f')]);return db[_0xf0a5('0x40')][_0xf0a5('0x48')](_0x79e599)[_0xf0a5('0x24')](function(_0x55a150){if(_0x55a150){_0x1b4e15=_0x55a150;return _0x55a150[_0xf0a5('0x6b')]();}return null;})[_0xf0a5('0x24')](function(_0x3f8f91){if(_0x3f8f91){if(!_0x3f8f91[_0xf0a5('0x35')]){throw new db['Sequelize']['ValidationErrorItem'](_0xf0a5('0x6c'),0x193);}_0x588d6c=_0x3f8f91;return db[_0xf0a5('0x6d')][_0xf0a5('0x42')]({'raw':!![]});}return null;})['then'](function(_0x516ecd){if(_0x516ecd){_0x21ba02=_[_0xf0a5('0x6e')](_0x516ecd,'id');var _0x553699;var _0x1fb04b=squel[_0xf0a5('0x6f')]();_0x1fb04b[_0xf0a5('0x70')](_0x1b4e15[_0xf0a5('0x71')]);for(var _0x7a67bd=0x0;_0x7a67bd<_0x588d6c['length'];_0x7a67bd+=0x1){_0x553699=_0x588d6c[_0x7a67bd][_0xf0a5('0x72')]?_0x21ba02[_0x588d6c[_0x7a67bd][_0xf0a5('0x72')]][_0xf0a5('0x73')]:_0x588d6c[_0x7a67bd][_0xf0a5('0x74')];_0x553699=_0x588d6c[_0x7a67bd][_0xf0a5('0x75')]?_[_0xf0a5('0x76')](_0x3bff7b[_0x588d6c[_0x7a67bd][_0xf0a5('0x75')]],'%s',_0x553699):_0x553699;_0x553699=_0x588d6c[_0x7a67bd][_0xf0a5('0x77')]?_[_0xf0a5('0x76')](_0x1f4910[_0x588d6c[_0x7a67bd][_0xf0a5('0x77')]],'%s',_0x553699):_0x553699;if(_0x588d6c[_0x7a67bd][_0xf0a5('0x78')]){_0x1fb04b['group'](_0x553699);}_0x588d6c[_0x7a67bd][_0xf0a5('0x79')]&&_0x1fb04b[_0xf0a5('0x38')](_0x553699,_0x588d6c[_0x7a67bd][_0xf0a5('0x79')]===_0xf0a5('0x7a')?![]:!![]);_0x1fb04b[_0xf0a5('0x74')](_0x553699,_0x588d6c[_0x7a67bd]['alias']||_0x553699);}if(_0x1b4e15[_0xf0a5('0x7b')]){_0x1b4e15[_0xf0a5('0x7b')]=JSON[_0xf0a5('0x7c')](_0x1b4e15[_0xf0a5('0x7b')]);for(var _0x5622e9=0x0;_0x5622e9<_0x1b4e15[_0xf0a5('0x7b')][_0xf0a5('0x35')];_0x5622e9+=0x1){if(_0x1b4e15['joins'][_0x5622e9][_0xf0a5('0x7d')]&&_[_0xf0a5('0x62')](_0x4dc52b,_0x1b4e15[_0xf0a5('0x7b')][_0x5622e9][_0xf0a5('0x7d')])&&_0x1b4e15['joins'][_0x5622e9][_0xf0a5('0x7e')]&&_0x1b4e15[_0xf0a5('0x7b')][_0x5622e9][_0xf0a5('0x7f')]&&_0x1b4e15['joins'][_0x5622e9][_0xf0a5('0x80')]){_0x1fb04b[_0x1b4e15['joins'][_0x5622e9][_0xf0a5('0x7d')]](_0x1b4e15['joins'][_0x5622e9][_0xf0a5('0x7f')],null,util[_0xf0a5('0x77')](_0xf0a5('0x81'),_0x1b4e15['table'],_0x1b4e15[_0xf0a5('0x7b')][_0x5622e9][_0xf0a5('0x7e')],_0x1b4e15['joins'][_0x5622e9]['foreignTable'],_0x1b4e15[_0xf0a5('0x7b')][_0x5622e9]['foreignKey']));}}}if(_0x1b4e15[_0xf0a5('0x82')]){_0x1b4e15[_0xf0a5('0x82')]=JSON[_0xf0a5('0x7c')](_0x1b4e15[_0xf0a5('0x82')]);_0x1fb04b['where'](_0x3bc095(_0x1b4e15[_0xf0a5('0x82')][_0xf0a5('0x68')]));}_0x543a83=_0x1fb04b[_0xf0a5('0x83')]();_0x1fb04b['limit'](_0x1983b2);_0x1fb04b[_0xf0a5('0x1b')](0x0);logger[_0xf0a5('0x84')](_0xf0a5('0x85'),_0x1fb04b[_0xf0a5('0x86')]());return dbH['sequelize']['query'](_0x1fb04b[_0xf0a5('0x86')](),{'type':dbH[_0xf0a5('0x87')][_0xf0a5('0x88')][_0xf0a5('0x89')]});}})[_0xf0a5('0x24')](respondWithResult(_0x513473,null))['catch'](handleError(_0x513473,null));};function runReport(_0x4f4899,_0x169316,_0x4462c0){var _0x2d0718=_0x169316[_0xf0a5('0x2a')];var _0x299c0b=0xa;var _0x52e585=[_0xf0a5('0x53'),_0xf0a5('0x54'),_0xf0a5('0x55'),_0xf0a5('0x56')];var _0x44deb0={'SUM':_0xf0a5('0x57'),'COUNT':_0xf0a5('0x58'),'COUNT DISTINCT':_0xf0a5('0x59'),'MAX':_0xf0a5('0x5a'),'MIN':_0xf0a5('0x8a'),'AVG':_0xf0a5('0x5b'),'GROUP_CONCAT':_0xf0a5('0x5c'),'GROUP_CONCAT ASC':_0xf0a5('0x5d'),'GROUP_CONCAT DESC':_0xf0a5('0x8b')};var _0x5b13eb={'SEC_TO_TIME':_0xf0a5('0x5e'),'DATE':_0xf0a5('0x5f'),'HOUR':_0xf0a5('0x60'),'ROUND':_0xf0a5('0x8c'),'UNIX_TIMESTAMP':_0xf0a5('0x61')};var _0x466b55=function(_0x1aea53){return!_[_0xf0a5('0x62')]([_0xf0a5('0x63'),_0xf0a5('0x64'),_0xf0a5('0x65'),_0xf0a5('0x8d')],_0x1aea53);};var _0x2f63f2=function(_0x173a39){if(!_0x173a39||!_0x173a39['rules'][_0xf0a5('0x35')]){return'';}for(var _0x337ecc='(',_0x18c2b4=0x0;_0x18c2b4<_0x173a39[_0xf0a5('0x66')][_0xf0a5('0x35')];_0x18c2b4+=0x1){_0x18c2b4>0x0&&(_0x337ecc+='\x20'+_0x173a39[_0xf0a5('0x67')]+'\x20');_0x337ecc+=_0x173a39[_0xf0a5('0x66')][_0x18c2b4][_0xf0a5('0x68')]?_0x2f63f2(_0x173a39[_0xf0a5('0x66')][_0x18c2b4][_0xf0a5('0x68')]):_0x173a39[_0xf0a5('0x66')][_0x18c2b4][_0xf0a5('0x74')]+'\x20'+_0x173a39['rules'][_0x18c2b4][_0xf0a5('0x69')]+(_0x466b55(_0x173a39['rules'][_0x18c2b4][_0xf0a5('0x69')])?'\x20'+_0x173a39[_0xf0a5('0x66')][_0x18c2b4][_0xf0a5('0x6a')]:'');}return _0x337ecc+')';};var _0x37a619={'where':{'id':_0x4f4899['id']}},_0x1f7954,_0x25c362,_0x130c9a,_0x1b6ea7,_0x5b40a4;_0x37a619=_[_0xf0a5('0x3e')]({},_0x37a619,_0x4462c0);return db['AnalyticCustomReport'][_0xf0a5('0x48')](_0x37a619)[_0xf0a5('0x24')](function(_0x30d62a){if(_0x30d62a){_0x1f7954=_0x30d62a;return _0x30d62a[_0xf0a5('0x6b')]();}return null;})[_0xf0a5('0x24')](function(_0x3adad8){if(_0x3adad8){if(!_0x3adad8[_0xf0a5('0x35')]){throw new db[(_0xf0a5('0x8e'))][(_0xf0a5('0x8f'))](_0xf0a5('0x6c'),0x193);}_0x25c362=_0x3adad8;return db[_0xf0a5('0x6d')][_0xf0a5('0x42')]({'raw':!![]});}return null;})[_0xf0a5('0x24')](function(_0x2f40ef){if(_0x2f40ef){_0x130c9a=_[_0xf0a5('0x6e')](_0x2f40ef,'id');var _0x1d56e9;var _0x29a3ec=squel[_0xf0a5('0x6f')]();_0x29a3ec[_0xf0a5('0x70')](_0x1f7954[_0xf0a5('0x71')]);for(var _0x2a3c90=0x0;_0x2a3c90<_0x25c362[_0xf0a5('0x35')];_0x2a3c90+=0x1){_0x1d56e9=_0x25c362[_0x2a3c90]['MetricId']?_0x130c9a[_0x25c362[_0x2a3c90][_0xf0a5('0x72')]][_0xf0a5('0x73')]:_0x25c362[_0x2a3c90][_0xf0a5('0x74')];_0x1d56e9=_0x25c362[_0x2a3c90][_0xf0a5('0x75')]?_[_0xf0a5('0x76')](_0x44deb0[_0x25c362[_0x2a3c90][_0xf0a5('0x75')]],'%s',_0x1d56e9):_0x1d56e9;_0x1d56e9=_0x25c362[_0x2a3c90][_0xf0a5('0x77')]?_[_0xf0a5('0x76')](_0x5b13eb[_0x25c362[_0x2a3c90][_0xf0a5('0x77')]],'%s',_0x1d56e9):_0x1d56e9;if(_0x25c362[_0x2a3c90][_0xf0a5('0x78')]){_0x29a3ec[_0xf0a5('0x68')](_0x1d56e9);}_0x25c362[_0x2a3c90]['orderBy']&&_0x29a3ec[_0xf0a5('0x38')](_0x1d56e9,_0x25c362[_0x2a3c90]['orderBy']===_0xf0a5('0x7a')?![]:!![]);_0x29a3ec[_0xf0a5('0x74')](_0x1d56e9,_0x25c362[_0x2a3c90][_0xf0a5('0x90')]||_0x1d56e9);}if(_0x1f7954[_0xf0a5('0x7b')]){_0x1f7954['joins']=JSON[_0xf0a5('0x7c')](_0x1f7954[_0xf0a5('0x7b')]);for(var _0x590db6=0x0;_0x590db6<_0x1f7954[_0xf0a5('0x7b')][_0xf0a5('0x35')];_0x590db6+=0x1){if(_0x1f7954['joins'][_0x590db6][_0xf0a5('0x7d')]&&_[_0xf0a5('0x62')](_0x52e585,_0x1f7954[_0xf0a5('0x7b')][_0x590db6][_0xf0a5('0x7d')])&&_0x1f7954['joins'][_0x590db6][_0xf0a5('0x7e')]&&_0x1f7954[_0xf0a5('0x7b')][_0x590db6][_0xf0a5('0x7f')]&&_0x1f7954['joins'][_0x590db6][_0xf0a5('0x80')]){_0x29a3ec[_0x1f7954[_0xf0a5('0x7b')][_0x590db6]['type']](_0x1f7954[_0xf0a5('0x7b')][_0x590db6][_0xf0a5('0x7f')],null,util[_0xf0a5('0x77')](_0xf0a5('0x81'),_0x1f7954[_0xf0a5('0x71')],_0x1f7954[_0xf0a5('0x7b')][_0x590db6][_0xf0a5('0x7e')],_0x1f7954[_0xf0a5('0x7b')][_0x590db6][_0xf0a5('0x7f')],_0x1f7954[_0xf0a5('0x7b')][_0x590db6]['foreignKey']));}}}if(_0x1f7954[_0xf0a5('0x82')]){_0x1f7954[_0xf0a5('0x82')]=JSON[_0xf0a5('0x7c')](_0x1f7954[_0xf0a5('0x82')]);_0x29a3ec[_0xf0a5('0x3a')](_0x2f63f2(_0x1f7954[_0xf0a5('0x82')]['group']));}_0x5b40a4=_0x29a3ec[_0xf0a5('0x83')]();_0x29a3ec[_0xf0a5('0x1d')](_0x299c0b);_0x29a3ec['offset'](0x0);return;}})[_0xf0a5('0x24')](function(){if(_0x169316[_0xf0a5('0x91')]===_0xf0a5('0x92')){return null;}var _0x23a7ec=_[_0xf0a5('0x3e')](_0x169316,{'name':_0x169316[_0xf0a5('0x93')]||_0x169316[_0xf0a5('0x2a')]||_0x1f7954[_0xf0a5('0x2a')],'basename':_0x2d0718,'savename':util[_0xf0a5('0x77')](_0xf0a5('0x94'),_0x169316[_0xf0a5('0x2a')]||_0x1f7954[_0xf0a5('0x2a')],require(_0xf0a5('0x95'))[_0xf0a5('0x96')](0x4),_0x169316[_0xf0a5('0x91')]||'csv'),'reportId':_0x1f7954['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xf0a5('0x49')](_0x23a7ec,{'raw':!![]});})[_0xf0a5('0x24')](function(_0x255ba9){if(_0x1f7954[_0xf0a5('0x71')]===_0xf0a5('0x97')){_0x5b40a4[_0xf0a5('0x3a')](_0x1f7954['table']+_0xf0a5('0x98'),_0x169316['startDate'],_0x169316['endDate']);}else{_0x5b40a4[_0xf0a5('0x3a')](_0x1f7954[_0xf0a5('0x71')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x169316['startDate'],_0x169316[_0xf0a5('0x99')]);}if(_0x255ba9){logger['info'](_0xf0a5('0x9a'),_0x5b40a4[_0xf0a5('0x86')]());require(_0xf0a5('0x9b'))[_0xf0a5('0x9c')](path[_0xf0a5('0x53')](__dirname,_0xf0a5('0x9d'),_0x255ba9['output']),[_0x255ba9['id'],_0x5b40a4[_0xf0a5('0x86')](),path[_0xf0a5('0x53')](__dirname,'../../files/reports',_0x255ba9[_0xf0a5('0x9e')]),_0x2d0718]);return _0x255ba9;}else{var _0x3723ec=squel[_0xf0a5('0x6f')]();_0x3723ec[_0xf0a5('0x70')]('('+_0x5b40a4[_0xf0a5('0x86')]()+')',_0xf0a5('0x9f'));_0x3723ec[_0xf0a5('0x74')](_0xf0a5('0xa0'),_0xf0a5('0x1e'));_0x5b40a4[_0xf0a5('0x1d')](_0x169316[_0xf0a5('0x1d')]||_0x299c0b);_0x5b40a4['offset'](_0x169316[_0xf0a5('0x1b')]||0x0);return dbH[_0xf0a5('0x87')][_0xf0a5('0x30')](_0x3723ec[_0xf0a5('0x86')](),{'type':dbH['sequelize'][_0xf0a5('0x88')][_0xf0a5('0x89')]})[_0xf0a5('0x24')](function(_0x42b85a){if(!_0x42b85a[_0xf0a5('0x35')]){_0x1b6ea7=0x0;}else{_0x1b6ea7=_0x42b85a[0x0][_0xf0a5('0x1e')]||0x0;}return dbH[_0xf0a5('0x87')][_0xf0a5('0x30')](_0x5b40a4[_0xf0a5('0x86')](),{'type':dbH[_0xf0a5('0x87')][_0xf0a5('0x88')][_0xf0a5('0x89')]});})[_0xf0a5('0x24')](function(_0x48958c){return{'rows':_0x48958c||[],'count':_0x1b6ea7};});}});}exports[_0xf0a5('0xa1')]=function(_0x6e64d0,_0x105614){return runReport(_0x6e64d0['params'],_0x6e64d0[_0xf0a5('0x30')],_0x6e64d0[_0xf0a5('0x3f')])[_0xf0a5('0x24')](respondWithResult(_0x105614,null))[_0xf0a5('0x44')](handleError(_0x105614,null));};exports[_0xf0a5('0xa2')]=runReport;exports[_0xf0a5('0x30')]=function(_0x6a5cde,_0x40b990){var _0x2b26a3=0xa;var _0x36c376=[_0xf0a5('0x53'),'left_join','right_join',_0xf0a5('0x56')];var _0x4bb581={'SUM':_0xf0a5('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xf0a5('0x59'),'MAX':_0xf0a5('0x5a'),'MIN':_0xf0a5('0x8a'),'AVG':_0xf0a5('0x5b'),'GROUP_CONCAT':_0xf0a5('0x5c'),'GROUP_CONCAT ASC':_0xf0a5('0x5d'),'GROUP_CONCAT DESC':_0xf0a5('0x8b')};var _0x5b8673={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xf0a5('0x60'),'ROUND':_0xf0a5('0x8c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1fdafe=function(_0x5c137b){return!_[_0xf0a5('0x62')]([_0xf0a5('0x63'),_0xf0a5('0x64'),'IS\x20EMPTY',_0xf0a5('0x8d')],_0x5c137b);};var _0x5dc200=function(_0x3d39aa){if(!_0x3d39aa||!_0x3d39aa[_0xf0a5('0x66')][_0xf0a5('0x35')]){return'';}for(var _0x277a78='(',_0x232f4e=0x0;_0x232f4e<_0x3d39aa['rules'][_0xf0a5('0x35')];_0x232f4e+=0x1){_0x232f4e>0x0&&(_0x277a78+='\x20'+_0x3d39aa[_0xf0a5('0x67')]+'\x20');_0x277a78+=_0x3d39aa['rules'][_0x232f4e]['group']?_0x5dc200(_0x3d39aa[_0xf0a5('0x66')][_0x232f4e][_0xf0a5('0x68')]):_0x3d39aa[_0xf0a5('0x66')][_0x232f4e][_0xf0a5('0x74')]+'\x20'+_0x3d39aa[_0xf0a5('0x66')][_0x232f4e]['condition']+(_0x1fdafe(_0x3d39aa[_0xf0a5('0x66')][_0x232f4e][_0xf0a5('0x69')])?'\x20'+_0x3d39aa[_0xf0a5('0x66')][_0x232f4e][_0xf0a5('0x6a')]:'');}return _0x277a78+')';};var _0x5a6297={'where':{'id':_0x6a5cde[_0xf0a5('0x45')]['id']}},_0x583898,_0x42f772,_0x370a41,_0x29da40,_0x12445b;_0x5a6297=_[_0xf0a5('0x3e')]({},_0x5a6297,_0x6a5cde[_0xf0a5('0x3f')]);return db[_0xf0a5('0x40')]['find'](_0x5a6297)['then'](function(_0x54a269){if(_0x54a269){_0x583898=_0x54a269;return _0x54a269[_0xf0a5('0x6b')]();}return null;})[_0xf0a5('0x24')](function(_0x213b8f){if(_0x213b8f){if(!_0x213b8f[_0xf0a5('0x35')]){throw new db[(_0xf0a5('0x8e'))][(_0xf0a5('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x42f772=_0x213b8f;return db['AnalyticMetric'][_0xf0a5('0x42')]({'raw':!![]});}return null;})[_0xf0a5('0x24')](function(_0x3a223a){if(_0x3a223a){_0x370a41=_['keyBy'](_0x3a223a,'id');var _0x3d4976;var _0x101a2b=squel[_0xf0a5('0x6f')]();_0x101a2b['from'](_0x583898['table']);for(var _0x3cd58b=0x0;_0x3cd58b<_0x42f772[_0xf0a5('0x35')];_0x3cd58b+=0x1){_0x3d4976=_0x42f772[_0x3cd58b][_0xf0a5('0x72')]?_0x370a41[_0x42f772[_0x3cd58b][_0xf0a5('0x72')]]['metric']:_0x42f772[_0x3cd58b][_0xf0a5('0x74')];_0x3d4976=_0x42f772[_0x3cd58b]['function']?_['replace'](_0x4bb581[_0x42f772[_0x3cd58b][_0xf0a5('0x75')]],'%s',_0x3d4976):_0x3d4976;_0x3d4976=_0x42f772[_0x3cd58b][_0xf0a5('0x77')]?_[_0xf0a5('0x76')](_0x5b8673[_0x42f772[_0x3cd58b][_0xf0a5('0x77')]],'%s',_0x3d4976):_0x3d4976;if(_0x42f772[_0x3cd58b][_0xf0a5('0x78')]){_0x101a2b[_0xf0a5('0x68')](_0x3d4976);}_0x42f772[_0x3cd58b][_0xf0a5('0x79')]&&_0x101a2b[_0xf0a5('0x38')](_0x3d4976,_0x42f772[_0x3cd58b]['orderBy']===_0xf0a5('0x7a')?![]:!![]);_0x101a2b[_0xf0a5('0x74')](_0x3d4976,_0x42f772[_0x3cd58b][_0xf0a5('0x90')]||_0x3d4976);}if(_0x583898[_0xf0a5('0x7b')]){_0x583898[_0xf0a5('0x7b')]=JSON[_0xf0a5('0x7c')](_0x583898[_0xf0a5('0x7b')]);for(var _0x213fa4=0x0;_0x213fa4<_0x583898['joins'][_0xf0a5('0x35')];_0x213fa4+=0x1){if(_0x583898['joins'][_0x213fa4][_0xf0a5('0x7d')]&&_['includes'](_0x36c376,_0x583898['joins'][_0x213fa4][_0xf0a5('0x7d')])&&_0x583898[_0xf0a5('0x7b')][_0x213fa4][_0xf0a5('0x7e')]&&_0x583898[_0xf0a5('0x7b')][_0x213fa4]['foreignTable']&&_0x583898[_0xf0a5('0x7b')][_0x213fa4][_0xf0a5('0x80')]){_0x101a2b[_0x583898[_0xf0a5('0x7b')][_0x213fa4]['type']](_0x583898['joins'][_0x213fa4][_0xf0a5('0x7f')],null,util[_0xf0a5('0x77')](_0xf0a5('0x81'),_0x583898[_0xf0a5('0x71')],_0x583898[_0xf0a5('0x7b')][_0x213fa4][_0xf0a5('0x7e')],_0x583898['joins'][_0x213fa4]['foreignTable'],_0x583898['joins'][_0x213fa4][_0xf0a5('0x80')]));}}}if(_0x583898[_0xf0a5('0x82')]){_0x583898[_0xf0a5('0x82')]=JSON[_0xf0a5('0x7c')](_0x583898[_0xf0a5('0x82')]);_0x101a2b[_0xf0a5('0x3a')](_0x5dc200(_0x583898[_0xf0a5('0x82')][_0xf0a5('0x68')]));}_0x12445b=_0x101a2b[_0xf0a5('0x83')]();_0x101a2b[_0xf0a5('0x1d')](_0x2b26a3);_0x101a2b[_0xf0a5('0x1b')](0x0);logger[_0xf0a5('0x84')](_0xf0a5('0x85'),_0x101a2b[_0xf0a5('0x86')]());return dbH[_0xf0a5('0x87')][_0xf0a5('0x30')](_0x101a2b['toString'](),{'type':dbH[_0xf0a5('0x87')][_0xf0a5('0x88')][_0xf0a5('0x89')]});}})[_0xf0a5('0x24')](function(){return{'sql':_0x12445b['toString']()};})[_0xf0a5('0x24')](respondWithResult(_0x40b990,null))[_0xf0a5('0x44')](handleError(_0x40b990,null));};
\ No newline at end of file
+var _0xe04a=['pick','merge','type','filter','include','rows','catch','show','params','rawAttributes','includeAll','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','select','from','MetricId','metric','function','replace','format','orderBy','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','left_join','cross_join','DATE(%s)','ROUND(%s)','IS\x20EMPTY','AnalyticMetric','keyBy','groupBy','DESC','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','QueryTypes','run','runReport','right_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters'];(function(_0x4d1536,_0x146875){var _0x17ce2c=function(_0x4b0c03){while(--_0x4b0c03){_0x4d1536['push'](_0x4d1536['shift']());}};_0x17ce2c(++_0x146875);}(_0xe04a,0x10f));var _0xae04=function(_0x556bd0,_0x310258){_0x556bd0=_0x556bd0-0x0;var _0xd63243=_0xe04a[_0x556bd0];return _0xd63243;};'use strict';var emlformat=require(_0xae04('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xae04('0x1'));var jsonpatch=require(_0xae04('0x2'));var rp=require(_0xae04('0x3'));var moment=require(_0xae04('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xae04('0x5'));var util=require(_0xae04('0x6'));var path=require(_0xae04('0x7'));var sox=require('sox');var csv=require(_0xae04('0x8'));var ejs=require(_0xae04('0x9'));var fs=require('fs');var fs_extra=require(_0xae04('0xa'));var _=require(_0xae04('0xb'));var squel=require(_0xae04('0xc'));var crypto=require(_0xae04('0xd'));var jsforce=require(_0xae04('0xe'));var deskjs=require(_0xae04('0xf'));var toCsv=require(_0xae04('0x8'));var querystring=require(_0xae04('0x10'));var Papa=require('papaparse');var Redis=require(_0xae04('0x11'));var authService=require(_0xae04('0x12'));var qs=require(_0xae04('0x13'));var as=require(_0xae04('0x14'));var hardwareService=require(_0xae04('0x15'));var logger=require('../../config/logger')(_0xae04('0x16'));var utils=require(_0xae04('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xae04('0x18'));var db=require(_0xae04('0x19'))['db'];var dbH=require(_0xae04('0x19'))[_0xae04('0x1a')];function respondWithStatusCode(_0x24c1a9,_0x115852){_0x115852=_0x115852||0xcc;return function(_0x316ca6){if(_0x316ca6){return _0x24c1a9[_0xae04('0x1b')](_0x115852);}return _0x24c1a9['status'](_0x115852)[_0xae04('0x1c')]();};}function respondWithResult(_0x177830,_0x133c7b){_0x133c7b=_0x133c7b||0xc8;return function(_0x4ed01a){if(_0x4ed01a){return _0x177830[_0xae04('0x1d')](_0x133c7b)['json'](_0x4ed01a);}};}function respondWithFilteredResult(_0x588bfa,_0x17d5e2){return function(_0x1c2a32){if(_0x1c2a32){var _0x1db557=typeof _0x17d5e2['offset']===_0xae04('0x1e')&&typeof _0x17d5e2[_0xae04('0x1f')]==='undefined';var _0x7c401c=_0x1c2a32[_0xae04('0x20')];var _0x3b861f=_0x1db557?0x0:_0x17d5e2[_0xae04('0x21')];var _0x55e925=_0x1db557?_0x1c2a32[_0xae04('0x20')]:_0x17d5e2[_0xae04('0x21')]+_0x17d5e2[_0xae04('0x1f')];var _0x4792fe;if(_0x55e925>=_0x7c401c){_0x55e925=_0x7c401c;_0x4792fe=0xc8;}else{_0x4792fe=0xce;}_0x588bfa[_0xae04('0x1d')](_0x4792fe);return _0x588bfa['set'](_0xae04('0x22'),_0x3b861f+'-'+_0x55e925+'/'+_0x7c401c)[_0xae04('0x23')](_0x1c2a32);}return null;};}function patchUpdates(_0x3f64d2){return function(_0x38d6fa){try{jsonpatch[_0xae04('0x24')](_0x38d6fa,_0x3f64d2,!![]);}catch(_0x38fe38){return BPromise[_0xae04('0x25')](_0x38fe38);}return _0x38d6fa[_0xae04('0x26')]();};}function saveUpdates(_0x4214e6,_0xe6a4ed){return function(_0x12bdd1){if(_0x12bdd1){return _0x12bdd1[_0xae04('0x27')](_0x4214e6)['then'](function(_0x3da1fb){return _0x3da1fb;});}return null;};}function removeEntity(_0x4ae87d,_0x44fa3e){return function(_0x29e447){if(_0x29e447){return _0x29e447[_0xae04('0x28')]()[_0xae04('0x29')](function(){var _0x3f6451=_0x29e447[_0xae04('0x2a')]({'plain':!![]});var _0x28ceda=_0xae04('0x2b');return db[_0xae04('0x2c')]['destroy']({'where':{'type':_0x28ceda,'resourceId':_0x3f6451['id']}})[_0xae04('0x29')](function(){return _0x29e447;});})['then'](function(){_0x4ae87d[_0xae04('0x1d')](0xcc)[_0xae04('0x1c')]();});}};}function handleEntityNotFound(_0x228ff7,_0x136235){return function(_0xee4d71){if(!_0xee4d71){_0x228ff7[_0xae04('0x1b')](0x194);}return _0xee4d71;};}function handleError(_0x25ce75,_0xba6a11){_0xba6a11=_0xba6a11||0x1f4;return function(_0x309ca4){logger[_0xae04('0x2d')](_0x309ca4[_0xae04('0x2e')]);if(_0x309ca4[_0xae04('0x2f')]){delete _0x309ca4[_0xae04('0x2f')];}_0x25ce75['status'](_0xba6a11)[_0xae04('0x30')](_0x309ca4);};}exports[_0xae04('0x31')]=function(_0x55fd15,_0xf71d2){var _0x1819ad={},_0x3340ab={},_0x21971c={'count':0x0,'rows':[]};var _0x55f1cb=_[_0xae04('0x32')](db[_0xae04('0x33')]['rawAttributes'],function(_0x15adf3){return{'name':_0x15adf3[_0xae04('0x34')],'type':_0x15adf3['type'][_0xae04('0x35')]};});_0x3340ab[_0xae04('0x36')]=_[_0xae04('0x32')](_0x55f1cb,_0xae04('0x2f'));_0x3340ab[_0xae04('0x37')]=_[_0xae04('0x38')](_0x55fd15[_0xae04('0x37')]);_0x3340ab['filters']=_[_0xae04('0x39')](_0x3340ab['model'],_0x3340ab['query']);_0x1819ad[_0xae04('0x3a')]=_[_0xae04('0x39')](_0x3340ab[_0xae04('0x36')],qs['fields'](_0x55fd15[_0xae04('0x37')][_0xae04('0x3b')]));_0x1819ad[_0xae04('0x3a')]=_0x1819ad[_0xae04('0x3a')][_0xae04('0x3c')]?_0x1819ad['attributes']:_0x3340ab[_0xae04('0x36')];if(!_0x55fd15[_0xae04('0x37')]['hasOwnProperty']('nolimit')){_0x1819ad[_0xae04('0x1f')]=qs[_0xae04('0x1f')](_0x55fd15[_0xae04('0x37')][_0xae04('0x1f')]);_0x1819ad[_0xae04('0x21')]=qs[_0xae04('0x21')](_0x55fd15[_0xae04('0x37')][_0xae04('0x21')]);}_0x1819ad[_0xae04('0x3d')]=qs[_0xae04('0x3e')](_0x55fd15[_0xae04('0x37')]['sort']);_0x1819ad[_0xae04('0x3f')]=qs[_0xae04('0x40')](_[_0xae04('0x41')](_0x55fd15[_0xae04('0x37')],_0x3340ab[_0xae04('0x40')]),_0x55f1cb);if(_0x55fd15[_0xae04('0x37')]['filter']){_0x1819ad[_0xae04('0x3f')]=_[_0xae04('0x42')](_0x1819ad[_0xae04('0x3f')],{'$or':_[_0xae04('0x32')](_0x55f1cb,function(_0x43b06d){if(_0x43b06d[_0xae04('0x43')]!=='VIRTUAL'){var _0x3ebcaf={};_0x3ebcaf[_0x43b06d['name']]={'$like':'%'+_0x55fd15[_0xae04('0x37')][_0xae04('0x44')]+'%'};return _0x3ebcaf;}})});}_0x1819ad=_['merge']({},_0x1819ad,_0x55fd15['options']);var _0x4f40c0={'where':_0x1819ad[_0xae04('0x3f')]};return db[_0xae04('0x33')]['count'](_0x4f40c0)[_0xae04('0x29')](function(_0x41212f){_0x21971c[_0xae04('0x20')]=_0x41212f;if(_0x55fd15[_0xae04('0x37')]['includeAll']){_0x1819ad[_0xae04('0x45')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x1819ad);})[_0xae04('0x29')](function(_0x55e01c){_0x21971c[_0xae04('0x46')]=_0x55e01c;return _0x21971c;})[_0xae04('0x29')](respondWithFilteredResult(_0xf71d2,_0x1819ad))[_0xae04('0x47')](handleError(_0xf71d2,null));};exports[_0xae04('0x48')]=function(_0x3b5456,_0xacd48d){var _0x480753={'raw':![],'where':{'id':_0x3b5456[_0xae04('0x49')]['id']}},_0x8064fa={};_0x8064fa[_0xae04('0x36')]=_[_0xae04('0x38')](db[_0xae04('0x33')][_0xae04('0x4a')]);_0x8064fa['query']=_[_0xae04('0x38')](_0x3b5456[_0xae04('0x37')]);_0x8064fa[_0xae04('0x40')]=_[_0xae04('0x39')](_0x8064fa['model'],_0x8064fa[_0xae04('0x37')]);_0x480753['attributes']=_[_0xae04('0x39')](_0x8064fa[_0xae04('0x36')],qs[_0xae04('0x3b')](_0x3b5456['query'][_0xae04('0x3b')]));_0x480753[_0xae04('0x3a')]=_0x480753[_0xae04('0x3a')][_0xae04('0x3c')]?_0x480753[_0xae04('0x3a')]:_0x8064fa[_0xae04('0x36')];if(_0x3b5456['query'][_0xae04('0x4b')]){_0x480753[_0xae04('0x45')]=[{'all':!![]}];}_0x480753=_['merge']({},_0x480753,_0x3b5456[_0xae04('0x4c')]);return db[_0xae04('0x33')]['find'](_0x480753)[_0xae04('0x29')](handleEntityNotFound(_0xacd48d,null))[_0xae04('0x29')](respondWithResult(_0xacd48d,null))[_0xae04('0x47')](handleError(_0xacd48d,null));};exports[_0xae04('0x4d')]=function(_0x3b0139,_0x4d3871){return db[_0xae04('0x33')]['create'](_0x3b0139['body'],{})[_0xae04('0x29')](function(_0x31aaa4){var _0x14dc1c=_0x3b0139[_0xae04('0x4e')][_0xae04('0x2a')]({'plain':!![]});if(!_0x14dc1c)throw new Error(_0xae04('0x4f'));if(_0x14dc1c['role']===_0xae04('0x4e')){var _0x57ed49=_0x31aaa4[_0xae04('0x2a')]({'plain':!![]});var _0x1c3e12='Reports';return db[_0xae04('0x50')][_0xae04('0x51')]({'where':{'name':_0x1c3e12,'userProfileId':_0x14dc1c['userProfileId']},'raw':!![]})[_0xae04('0x29')](function(_0xe721ea){if(_0xe721ea&&_0xe721ea[_0xae04('0x52')]===0x0){return db['UserProfileResource'][_0xae04('0x4d')]({'name':_0x57ed49[_0xae04('0x2f')],'resourceId':_0x57ed49['id'],'type':_0xae04('0x2b'),'sectionId':_0xe721ea['id']},{})['then'](function(){return _0x31aaa4;});}else{return _0x31aaa4;}})[_0xae04('0x47')](function(_0x4d8d8a){logger[_0xae04('0x2d')](_0xae04('0x53'),_0x4d8d8a);throw _0x4d8d8a;});}return _0x31aaa4;})[_0xae04('0x29')](respondWithResult(_0x4d3871,0xc9))[_0xae04('0x47')](handleError(_0x4d3871,null));};exports[_0xae04('0x27')]=function(_0x16b431,_0x48325d){if(_0x16b431[_0xae04('0x54')]['id']){delete _0x16b431[_0xae04('0x54')]['id'];}return db[_0xae04('0x33')][_0xae04('0x51')]({'where':{'id':_0x16b431[_0xae04('0x49')]['id']}})[_0xae04('0x29')](handleEntityNotFound(_0x48325d,null))[_0xae04('0x29')](saveUpdates(_0x16b431[_0xae04('0x54')],null))[_0xae04('0x29')](respondWithResult(_0x48325d,null))[_0xae04('0x47')](handleError(_0x48325d,null));};exports['destroy']=function(_0x22b4d6,_0x3d152){return db[_0xae04('0x33')][_0xae04('0x51')]({'where':{'id':_0x22b4d6[_0xae04('0x49')]['id']}})[_0xae04('0x29')](handleEntityNotFound(_0x3d152,null))['then'](removeEntity(_0x3d152,null))['catch'](handleError(_0x3d152,null));};exports[_0xae04('0x55')]=function(_0xd4f50c,_0x2fd8e6){var _0xe4bcfa=0xa;var _0x284571=[_0xae04('0x56'),'left_join','right_join','cross_join'];var _0x851256={'SUM':_0xae04('0x57'),'COUNT':_0xae04('0x58'),'COUNT DISTINCT':_0xae04('0x59'),'MAX':_0xae04('0x5a'),'MIN':_0xae04('0x5b'),'AVG':_0xae04('0x5c'),'GROUP_CONCAT':_0xae04('0x5d'),'GROUP_CONCAT ASC':_0xae04('0x5e'),'GROUP_CONCAT DESC':_0xae04('0x5f')};var _0x43bb48={'SEC_TO_TIME':_0xae04('0x60'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4841ac=function(_0x25204d){return!_[_0xae04('0x61')]([_0xae04('0x62'),_0xae04('0x63'),'IS\x20EMPTY',_0xae04('0x64')],_0x25204d);};var _0x309c74=function(_0x44dab4){if(!_0x44dab4||!_0x44dab4['rules']['length']){return'';}for(var _0x406b0d='(',_0x13dd67=0x0;_0x13dd67<_0x44dab4[_0xae04('0x65')]['length'];_0x13dd67+=0x1){_0x13dd67>0x0&&(_0x406b0d+='\x20'+_0x44dab4[_0xae04('0x66')]+'\x20');_0x406b0d+=_0x44dab4['rules'][_0x13dd67][_0xae04('0x67')]?_0x309c74(_0x44dab4[_0xae04('0x65')][_0x13dd67]['group']):_0x44dab4['rules'][_0x13dd67][_0xae04('0x68')]+'\x20'+_0x44dab4[_0xae04('0x65')][_0x13dd67][_0xae04('0x69')]+(_0x4841ac(_0x44dab4['rules'][_0x13dd67][_0xae04('0x69')])?'\x20'+_0x44dab4[_0xae04('0x65')][_0x13dd67][_0xae04('0x6a')]:'');}return _0x406b0d+')';};var _0x4371bd={'where':{'id':_0xd4f50c[_0xae04('0x49')]['id']}},_0x37cae4,_0x224bbe,_0x12e96f,_0x33346b,_0x146912;_0x4371bd=_[_0xae04('0x42')]({},_0x4371bd,_0xd4f50c[_0xae04('0x4c')]);return db[_0xae04('0x33')]['find'](_0x4371bd)[_0xae04('0x29')](function(_0x3d4969){if(_0x3d4969){_0x37cae4=_0x3d4969;return _0x3d4969[_0xae04('0x6b')]();}return null;})[_0xae04('0x29')](function(_0x534301){if(_0x534301){if(!_0x534301[_0xae04('0x3c')]){throw new db[(_0xae04('0x6c'))][(_0xae04('0x6d'))](_0xae04('0x6e'),0x193);}_0x224bbe=_0x534301;return db['AnalyticMetric'][_0xae04('0x6f')]({'raw':!![]});}return null;})['then'](function(_0xd68457){if(_0xd68457){_0x12e96f=_['keyBy'](_0xd68457,'id');var _0x22c545;var _0x44c7c5=squel[_0xae04('0x70')]();_0x44c7c5[_0xae04('0x71')](_0x37cae4['table']);for(var _0x216465=0x0;_0x216465<_0x224bbe['length'];_0x216465+=0x1){_0x22c545=_0x224bbe[_0x216465][_0xae04('0x72')]?_0x12e96f[_0x224bbe[_0x216465][_0xae04('0x72')]][_0xae04('0x73')]:_0x224bbe[_0x216465][_0xae04('0x68')];_0x22c545=_0x224bbe[_0x216465][_0xae04('0x74')]?_[_0xae04('0x75')](_0x851256[_0x224bbe[_0x216465][_0xae04('0x74')]],'%s',_0x22c545):_0x22c545;_0x22c545=_0x224bbe[_0x216465]['format']?_[_0xae04('0x75')](_0x43bb48[_0x224bbe[_0x216465][_0xae04('0x76')]],'%s',_0x22c545):_0x22c545;if(_0x224bbe[_0x216465]['groupBy']){_0x44c7c5['group'](_0x22c545);}_0x224bbe[_0x216465][_0xae04('0x77')]&&_0x44c7c5['order'](_0x22c545,_0x224bbe[_0x216465][_0xae04('0x77')]==='DESC'?![]:!![]);_0x44c7c5[_0xae04('0x68')](_0x22c545,_0x224bbe[_0x216465][_0xae04('0x78')]||_0x22c545);}if(_0x37cae4[_0xae04('0x79')]){_0x37cae4[_0xae04('0x79')]=JSON[_0xae04('0x7a')](_0x37cae4[_0xae04('0x79')]);for(var _0x23c4ae=0x0;_0x23c4ae<_0x37cae4[_0xae04('0x79')][_0xae04('0x3c')];_0x23c4ae+=0x1){if(_0x37cae4['joins'][_0x23c4ae][_0xae04('0x43')]&&_[_0xae04('0x61')](_0x284571,_0x37cae4['joins'][_0x23c4ae][_0xae04('0x43')])&&_0x37cae4['joins'][_0x23c4ae][_0xae04('0x7b')]&&_0x37cae4[_0xae04('0x79')][_0x23c4ae]['foreignTable']&&_0x37cae4[_0xae04('0x79')][_0x23c4ae]['foreignKey']){_0x44c7c5[_0x37cae4[_0xae04('0x79')][_0x23c4ae][_0xae04('0x43')]](_0x37cae4[_0xae04('0x79')][_0x23c4ae][_0xae04('0x7c')],null,util[_0xae04('0x76')](_0xae04('0x7d'),_0x37cae4[_0xae04('0x7e')],_0x37cae4[_0xae04('0x79')][_0x23c4ae][_0xae04('0x7b')],_0x37cae4[_0xae04('0x79')][_0x23c4ae][_0xae04('0x7c')],_0x37cae4['joins'][_0x23c4ae][_0xae04('0x7f')]));}}}if(_0x37cae4[_0xae04('0x80')]){_0x37cae4[_0xae04('0x80')]=JSON[_0xae04('0x7a')](_0x37cae4[_0xae04('0x80')]);_0x44c7c5['where'](_0x309c74(_0x37cae4[_0xae04('0x80')][_0xae04('0x67')]));}_0x146912=_0x44c7c5[_0xae04('0x81')]();_0x44c7c5[_0xae04('0x1f')](_0xe4bcfa);_0x44c7c5['offset'](0x0);logger[_0xae04('0x82')](_0xae04('0x83'),_0x44c7c5['toString']());return dbH[_0xae04('0x84')][_0xae04('0x37')](_0x44c7c5[_0xae04('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0xae04('0x86')]});}})[_0xae04('0x29')](respondWithResult(_0x2fd8e6,null))[_0xae04('0x47')](handleError(_0x2fd8e6,null));};function runReport(_0x36b725,_0x560308,_0x5a45ba){var _0xa5635b=_0x560308['name'];var _0x156741=0xa;var _0x34d07e=['join',_0xae04('0x87'),'right_join',_0xae04('0x88')];var _0x459509={'SUM':_0xae04('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xae04('0x5a'),'MIN':'MIN(%s)','AVG':_0xae04('0x5c'),'GROUP_CONCAT':_0xae04('0x5d'),'GROUP_CONCAT ASC':_0xae04('0x5e'),'GROUP_CONCAT DESC':_0xae04('0x5f')};var _0x1be9f1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xae04('0x89'),'HOUR':'HOUR(%s)','ROUND':_0xae04('0x8a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x7b199=function(_0x132477){return!_[_0xae04('0x61')]([_0xae04('0x62'),_0xae04('0x63'),_0xae04('0x8b'),'IS\x20NOT\x20EMPTY'],_0x132477);};var _0x4f1217=function(_0x2fa878){if(!_0x2fa878||!_0x2fa878[_0xae04('0x65')]['length']){return'';}for(var _0x277899='(',_0x4145c6=0x0;_0x4145c6<_0x2fa878[_0xae04('0x65')][_0xae04('0x3c')];_0x4145c6+=0x1){_0x4145c6>0x0&&(_0x277899+='\x20'+_0x2fa878[_0xae04('0x66')]+'\x20');_0x277899+=_0x2fa878[_0xae04('0x65')][_0x4145c6]['group']?_0x4f1217(_0x2fa878[_0xae04('0x65')][_0x4145c6][_0xae04('0x67')]):_0x2fa878[_0xae04('0x65')][_0x4145c6][_0xae04('0x68')]+'\x20'+_0x2fa878[_0xae04('0x65')][_0x4145c6][_0xae04('0x69')]+(_0x7b199(_0x2fa878[_0xae04('0x65')][_0x4145c6][_0xae04('0x69')])?'\x20'+_0x2fa878[_0xae04('0x65')][_0x4145c6][_0xae04('0x6a')]:'');}return _0x277899+')';};var _0x4fe988={'where':{'id':_0x36b725['id']}},_0x29f79e,_0x1e7dce,_0x5d8493,_0x3b27a2,_0x145725;_0x4fe988=_[_0xae04('0x42')]({},_0x4fe988,_0x5a45ba);return db[_0xae04('0x33')]['find'](_0x4fe988)[_0xae04('0x29')](function(_0x1442ea){if(_0x1442ea){_0x29f79e=_0x1442ea;return _0x1442ea['getFields']();}return null;})[_0xae04('0x29')](function(_0xb7ec8e){if(_0xb7ec8e){if(!_0xb7ec8e[_0xae04('0x3c')]){throw new db[(_0xae04('0x6c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1e7dce=_0xb7ec8e;return db[_0xae04('0x8c')][_0xae04('0x6f')]({'raw':!![]});}return null;})[_0xae04('0x29')](function(_0x4f82a7){if(_0x4f82a7){_0x5d8493=_[_0xae04('0x8d')](_0x4f82a7,'id');var _0xa8ad54;var _0x5298f5=squel['select']();_0x5298f5[_0xae04('0x71')](_0x29f79e[_0xae04('0x7e')]);for(var _0x5e104c=0x0;_0x5e104c<_0x1e7dce['length'];_0x5e104c+=0x1){_0xa8ad54=_0x1e7dce[_0x5e104c][_0xae04('0x72')]?_0x5d8493[_0x1e7dce[_0x5e104c][_0xae04('0x72')]][_0xae04('0x73')]:_0x1e7dce[_0x5e104c][_0xae04('0x68')];_0xa8ad54=_0x1e7dce[_0x5e104c]['function']?_['replace'](_0x459509[_0x1e7dce[_0x5e104c][_0xae04('0x74')]],'%s',_0xa8ad54):_0xa8ad54;_0xa8ad54=_0x1e7dce[_0x5e104c][_0xae04('0x76')]?_[_0xae04('0x75')](_0x1be9f1[_0x1e7dce[_0x5e104c]['format']],'%s',_0xa8ad54):_0xa8ad54;if(_0x1e7dce[_0x5e104c][_0xae04('0x8e')]){_0x5298f5[_0xae04('0x67')](_0xa8ad54);}_0x1e7dce[_0x5e104c][_0xae04('0x77')]&&_0x5298f5[_0xae04('0x3d')](_0xa8ad54,_0x1e7dce[_0x5e104c][_0xae04('0x77')]===_0xae04('0x8f')?![]:!![]);_0x5298f5[_0xae04('0x68')](_0xa8ad54,_0x1e7dce[_0x5e104c][_0xae04('0x78')]||_0xa8ad54);}if(_0x29f79e[_0xae04('0x79')]){_0x29f79e[_0xae04('0x79')]=JSON[_0xae04('0x7a')](_0x29f79e['joins']);for(var _0x26fcf5=0x0;_0x26fcf5<_0x29f79e[_0xae04('0x79')][_0xae04('0x3c')];_0x26fcf5+=0x1){if(_0x29f79e[_0xae04('0x79')][_0x26fcf5][_0xae04('0x43')]&&_[_0xae04('0x61')](_0x34d07e,_0x29f79e[_0xae04('0x79')][_0x26fcf5][_0xae04('0x43')])&&_0x29f79e['joins'][_0x26fcf5][_0xae04('0x7b')]&&_0x29f79e[_0xae04('0x79')][_0x26fcf5][_0xae04('0x7c')]&&_0x29f79e[_0xae04('0x79')][_0x26fcf5][_0xae04('0x7f')]){_0x5298f5[_0x29f79e[_0xae04('0x79')][_0x26fcf5]['type']](_0x29f79e['joins'][_0x26fcf5][_0xae04('0x7c')],null,util[_0xae04('0x76')](_0xae04('0x7d'),_0x29f79e[_0xae04('0x7e')],_0x29f79e[_0xae04('0x79')][_0x26fcf5][_0xae04('0x7b')],_0x29f79e['joins'][_0x26fcf5]['foreignTable'],_0x29f79e[_0xae04('0x79')][_0x26fcf5]['foreignKey']));}}}if(_0x29f79e[_0xae04('0x80')]){_0x29f79e[_0xae04('0x80')]=JSON[_0xae04('0x7a')](_0x29f79e[_0xae04('0x80')]);_0x5298f5[_0xae04('0x3f')](_0x4f1217(_0x29f79e['conditions'][_0xae04('0x67')]));}_0x145725=_0x5298f5[_0xae04('0x81')]();_0x5298f5[_0xae04('0x1f')](_0x156741);_0x5298f5[_0xae04('0x21')](0x0);return;}})[_0xae04('0x29')](function(){if(_0x560308['output']===_0xae04('0x90')){return null;}var _0x29c5a1=_[_0xae04('0x42')](_0x560308,{'name':_0x560308[_0xae04('0x91')]||_0x560308[_0xae04('0x2f')]||_0x29f79e['name'],'basename':_0xa5635b,'savename':util[_0xae04('0x76')](_0xae04('0x92'),_0x560308[_0xae04('0x2f')]||_0x29f79e[_0xae04('0x2f')],require(_0xae04('0x93'))[_0xae04('0x94')](0x4),_0x560308[_0xae04('0x95')]||_0xae04('0x96')),'reportId':_0x29f79e['id'],'reportType':_0xae04('0x97')});return db['AnalyticExtractedReport'][_0xae04('0x4d')](_0x29c5a1,{'raw':!![]});})[_0xae04('0x29')](function(_0x5bf88f){if(_0x29f79e[_0xae04('0x7e')]===_0xae04('0x98')){_0x145725[_0xae04('0x3f')](_0x29f79e[_0xae04('0x7e')]+_0xae04('0x99'),_0x560308[_0xae04('0x9a')],_0x560308['endDate']);}else{_0x145725['where'](_0x29f79e[_0xae04('0x7e')]+_0xae04('0x9b'),_0x560308[_0xae04('0x9a')],_0x560308['endDate']);}if(_0x5bf88f){logger[_0xae04('0x9c')](_0xae04('0x9d'),_0x145725[_0xae04('0x85')]());require(_0xae04('0x9e'))[_0xae04('0x9f')](path['join'](__dirname,'../../components/export/',_0x5bf88f[_0xae04('0x95')]),[_0x5bf88f['id'],_0x145725['toString'](),path['join'](__dirname,_0xae04('0xa0'),_0x5bf88f[_0xae04('0xa1')]),_0xa5635b]);return _0x5bf88f;}else{var _0x20f193=squel[_0xae04('0x70')]();_0x20f193[_0xae04('0x71')]('('+_0x145725[_0xae04('0x85')]()+')','countTable');_0x20f193['field']('COUNT(*)',_0xae04('0x20'));_0x145725['limit'](_0x560308['limit']||_0x156741);_0x145725[_0xae04('0x21')](_0x560308['offset']||0x0);return dbH['sequelize'][_0xae04('0x37')](_0x20f193[_0xae04('0x85')](),{'type':dbH['sequelize'][_0xae04('0xa2')][_0xae04('0x86')]})[_0xae04('0x29')](function(_0x147609){if(!_0x147609[_0xae04('0x3c')]){_0x3b27a2=0x0;}else{_0x3b27a2=_0x147609[0x0][_0xae04('0x20')]||0x0;}return dbH[_0xae04('0x84')]['query'](_0x145725['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xae04('0x86')]});})[_0xae04('0x29')](function(_0xb6f427){return{'rows':_0xb6f427||[],'count':_0x3b27a2};});}});}exports[_0xae04('0xa3')]=function(_0x542966,_0x2e3e6c){return runReport(_0x542966[_0xae04('0x49')],_0x542966[_0xae04('0x37')],_0x542966[_0xae04('0x4c')])[_0xae04('0x29')](respondWithResult(_0x2e3e6c,null))[_0xae04('0x47')](handleError(_0x2e3e6c,null));};exports[_0xae04('0xa4')]=runReport;exports[_0xae04('0x37')]=function(_0x56e200,_0x25a048){var _0x24cf08=0xa;var _0x39ec08=[_0xae04('0x56'),_0xae04('0x87'),_0xae04('0xa5'),_0xae04('0x88')];var _0x1a5fc2={'SUM':_0xae04('0x57'),'COUNT':_0xae04('0x58'),'COUNT DISTINCT':_0xae04('0x59'),'MAX':_0xae04('0x5a'),'MIN':_0xae04('0x5b'),'AVG':_0xae04('0x5c'),'GROUP_CONCAT':_0xae04('0x5d'),'GROUP_CONCAT ASC':_0xae04('0x5e'),'GROUP_CONCAT DESC':_0xae04('0x5f')};var _0x1e9824={'SEC_TO_TIME':_0xae04('0x60'),'DATE':'DATE(%s)','HOUR':_0xae04('0xa6'),'ROUND':_0xae04('0x8a'),'UNIX_TIMESTAMP':_0xae04('0xa7')};var _0x4c9221=function(_0x230bc1){return!_['includes'](['IS\x20NULL',_0xae04('0x63'),'IS\x20EMPTY',_0xae04('0x64')],_0x230bc1);};var _0x1ccd44=function(_0x2f8e51){if(!_0x2f8e51||!_0x2f8e51[_0xae04('0x65')][_0xae04('0x3c')]){return'';}for(var _0x4d0f22='(',_0x4bc9c5=0x0;_0x4bc9c5<_0x2f8e51[_0xae04('0x65')]['length'];_0x4bc9c5+=0x1){_0x4bc9c5>0x0&&(_0x4d0f22+='\x20'+_0x2f8e51[_0xae04('0x66')]+'\x20');_0x4d0f22+=_0x2f8e51[_0xae04('0x65')][_0x4bc9c5]['group']?_0x1ccd44(_0x2f8e51['rules'][_0x4bc9c5][_0xae04('0x67')]):_0x2f8e51[_0xae04('0x65')][_0x4bc9c5][_0xae04('0x68')]+'\x20'+_0x2f8e51[_0xae04('0x65')][_0x4bc9c5][_0xae04('0x69')]+(_0x4c9221(_0x2f8e51[_0xae04('0x65')][_0x4bc9c5][_0xae04('0x69')])?'\x20'+_0x2f8e51[_0xae04('0x65')][_0x4bc9c5][_0xae04('0x6a')]:'');}return _0x4d0f22+')';};var _0x20d311={'where':{'id':_0x56e200['params']['id']}},_0x4b77b3,_0x48bfa7,_0x3d12f2,_0x3698ee,_0x237cd1;_0x20d311=_[_0xae04('0x42')]({},_0x20d311,_0x56e200['options']);return db['AnalyticCustomReport'][_0xae04('0x51')](_0x20d311)[_0xae04('0x29')](function(_0x504a6e){if(_0x504a6e){_0x4b77b3=_0x504a6e;return _0x504a6e['getFields']();}return null;})[_0xae04('0x29')](function(_0x345195){if(_0x345195){if(!_0x345195['length']){throw new db[(_0xae04('0x6c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x48bfa7=_0x345195;return db[_0xae04('0x8c')][_0xae04('0x6f')]({'raw':!![]});}return null;})[_0xae04('0x29')](function(_0x153589){if(_0x153589){_0x3d12f2=_[_0xae04('0x8d')](_0x153589,'id');var _0x4bc423;var _0x1d1e6d=squel[_0xae04('0x70')]();_0x1d1e6d[_0xae04('0x71')](_0x4b77b3[_0xae04('0x7e')]);for(var _0x38c074=0x0;_0x38c074<_0x48bfa7[_0xae04('0x3c')];_0x38c074+=0x1){_0x4bc423=_0x48bfa7[_0x38c074][_0xae04('0x72')]?_0x3d12f2[_0x48bfa7[_0x38c074][_0xae04('0x72')]][_0xae04('0x73')]:_0x48bfa7[_0x38c074][_0xae04('0x68')];_0x4bc423=_0x48bfa7[_0x38c074][_0xae04('0x74')]?_['replace'](_0x1a5fc2[_0x48bfa7[_0x38c074][_0xae04('0x74')]],'%s',_0x4bc423):_0x4bc423;_0x4bc423=_0x48bfa7[_0x38c074]['format']?_[_0xae04('0x75')](_0x1e9824[_0x48bfa7[_0x38c074][_0xae04('0x76')]],'%s',_0x4bc423):_0x4bc423;if(_0x48bfa7[_0x38c074]['groupBy']){_0x1d1e6d[_0xae04('0x67')](_0x4bc423);}_0x48bfa7[_0x38c074][_0xae04('0x77')]&&_0x1d1e6d[_0xae04('0x3d')](_0x4bc423,_0x48bfa7[_0x38c074][_0xae04('0x77')]===_0xae04('0x8f')?![]:!![]);_0x1d1e6d['field'](_0x4bc423,_0x48bfa7[_0x38c074][_0xae04('0x78')]||_0x4bc423);}if(_0x4b77b3[_0xae04('0x79')]){_0x4b77b3['joins']=JSON[_0xae04('0x7a')](_0x4b77b3['joins']);for(var _0x48a6c7=0x0;_0x48a6c7<_0x4b77b3[_0xae04('0x79')][_0xae04('0x3c')];_0x48a6c7+=0x1){if(_0x4b77b3[_0xae04('0x79')][_0x48a6c7][_0xae04('0x43')]&&_['includes'](_0x39ec08,_0x4b77b3['joins'][_0x48a6c7]['type'])&&_0x4b77b3[_0xae04('0x79')][_0x48a6c7][_0xae04('0x7b')]&&_0x4b77b3[_0xae04('0x79')][_0x48a6c7]['foreignTable']&&_0x4b77b3['joins'][_0x48a6c7][_0xae04('0x7f')]){_0x1d1e6d[_0x4b77b3[_0xae04('0x79')][_0x48a6c7][_0xae04('0x43')]](_0x4b77b3[_0xae04('0x79')][_0x48a6c7]['foreignTable'],null,util[_0xae04('0x76')]('%s.%s\x20=\x20%s.%s',_0x4b77b3[_0xae04('0x7e')],_0x4b77b3[_0xae04('0x79')][_0x48a6c7][_0xae04('0x7b')],_0x4b77b3[_0xae04('0x79')][_0x48a6c7][_0xae04('0x7c')],_0x4b77b3[_0xae04('0x79')][_0x48a6c7][_0xae04('0x7f')]));}}}if(_0x4b77b3[_0xae04('0x80')]){_0x4b77b3[_0xae04('0x80')]=JSON[_0xae04('0x7a')](_0x4b77b3['conditions']);_0x1d1e6d[_0xae04('0x3f')](_0x1ccd44(_0x4b77b3[_0xae04('0x80')][_0xae04('0x67')]));}_0x237cd1=_0x1d1e6d[_0xae04('0x81')]();_0x1d1e6d[_0xae04('0x1f')](_0x24cf08);_0x1d1e6d['offset'](0x0);logger[_0xae04('0x82')](_0xae04('0x83'),_0x1d1e6d['toString']());return dbH['sequelize'][_0xae04('0x37')](_0x1d1e6d[_0xae04('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0xae04('0x86')]});}})['then'](function(){return{'sql':_0x237cd1[_0xae04('0x85')]()};})[_0xae04('0x29')](respondWithResult(_0x25a048,null))[_0xae04('0x47')](handleError(_0x25a048,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 9c7ee8b..3d8582f 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 _0x3941=['request-promise','path','rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x3941,0x6a));var _0x1394=function(_0x25f4c5,_0x22f5a6){_0x25f4c5=_0x25f4c5-0x0;var _0x440929=_0x3941[_0x25f4c5];return _0x440929;};'use strict';var _=require(_0x1394('0x0'));var util=require(_0x1394('0x1'));var logger=require(_0x1394('0x2'))(_0x1394('0x3'));var moment=require(_0x1394('0x4'));var BPromise=require(_0x1394('0x5'));var rp=require(_0x1394('0x6'));var fs=require('fs');var path=require(_0x1394('0x7'));var rimraf=require(_0x1394('0x8'));var config=require(_0x1394('0x9'));var attributes=require('./analyticCustomReport.attributes');module[_0x1394('0xa')]=function(_0x5b0445,_0x181acd){return _0x5b0445[_0x1394('0xb')](_0x1394('0xc'),attributes,{'tableName':_0x1394('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6066=['define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','request-promise','../../config/environment','exports'];(function(_0x3b8edd,_0x188207){var _0x770a4a=function(_0x154b3c){while(--_0x154b3c){_0x3b8edd['push'](_0x3b8edd['shift']());}};_0x770a4a(++_0x188207);}(_0x6066,0x107));var _0x6606=function(_0x1aeda2,_0x1217eb){_0x1aeda2=_0x1aeda2-0x0;var _0x32dc6d=_0x6066[_0x1aeda2];return _0x32dc6d;};'use strict';var _=require(_0x6606('0x0'));var util=require(_0x6606('0x1'));var logger=require(_0x6606('0x2'))(_0x6606('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6606('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6606('0x5'));var attributes=require('./analyticCustomReport.attributes');module[_0x6606('0x6')]=function(_0x20e869,_0x4a11b7){return _0x20e869[_0x6606('0x7')](_0x6606('0x8'),attributes,{'tableName':_0x6606('0x9'),'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 3372b28..7d12666 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 _0xf44a=['code','message','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0xf44a,0xfa));var _0xaf44=function(_0x35bb79,_0x85479d){_0x35bb79=_0x35bb79-0x0;var _0x481165=_0xf44a[_0x35bb79];return _0x481165;};'use strict';var _=require(_0xaf44('0x0'));var util=require(_0xaf44('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaf44('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaf44('0x3'));var logger=require(_0xaf44('0x4'))(_0xaf44('0x5'));var config=require('../../config/environment');var jayson=require(_0xaf44('0x6'));var client=jayson[_0xaf44('0x7')][_0xaf44('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d0700,_0x394624,_0x49aeec){return new BPromise(function(_0xbdafbf,_0x5075b0){return client['request'](_0x3d0700,_0x49aeec)[_0xaf44('0x9')](function(_0x1bf696){logger[_0xaf44('0xa')](_0xaf44('0xb'),_0x394624,'request\x20sent');logger[_0xaf44('0xc')](_0xaf44('0xd'),_0x394624,_0xaf44('0xe'),JSON['stringify'](_0x1bf696));if(_0x1bf696[_0xaf44('0xf')]){if(_0x1bf696[_0xaf44('0xf')][_0xaf44('0x10')]===0x1f4){logger[_0xaf44('0xf')](_0xaf44('0xb'),_0x394624,_0x1bf696[_0xaf44('0xf')][_0xaf44('0x11')]);return _0x5075b0(_0x1bf696['error']['message']);}logger[_0xaf44('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x394624,_0x1bf696[_0xaf44('0xf')][_0xaf44('0x11')]);return _0xbdafbf(_0x1bf696[_0xaf44('0xf')][_0xaf44('0x11')]);}else{logger['info'](_0xaf44('0xb'),_0x394624,_0xaf44('0xe'));_0xbdafbf(_0x1bf696['result'][_0xaf44('0x11')]);}})[_0xaf44('0x12')](function(_0x13677b){logger[_0xaf44('0xf')](_0xaf44('0xb'),_0x394624,_0x13677b);_0x5075b0(_0x13677b);});});}
\ No newline at end of file
+var _0x6853=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash','util','bluebird','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6853,0x13c));var _0x3685=function(_0x35f1e7,_0x50f26e){_0x35f1e7=_0x35f1e7-0x0;var _0xefc085=_0x6853[_0x35f1e7];return _0xefc085;};'use strict';var _=require(_0x3685('0x0'));var util=require(_0x3685('0x1'));var moment=require('moment');var BPromise=require(_0x3685('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3685('0x3'));var db=require(_0x3685('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3685('0x5'))(_0x3685('0x6'));var config=require(_0x3685('0x7'));var jayson=require(_0x3685('0x8'));var client=jayson[_0x3685('0x9')][_0x3685('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8cc512,_0x5cff6f,_0x2959c2){return new BPromise(function(_0x4e2872,_0xd08cb1){return client[_0x3685('0xb')](_0x8cc512,_0x2959c2)[_0x3685('0xc')](function(_0xebb3f2){logger[_0x3685('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5cff6f,_0x3685('0xe'));logger['debug'](_0x3685('0xf'),_0x5cff6f,_0x3685('0xe'),JSON['stringify'](_0xebb3f2));if(_0xebb3f2[_0x3685('0x10')]){if(_0xebb3f2[_0x3685('0x10')]['code']===0x1f4){logger[_0x3685('0x10')](_0x3685('0x11'),_0x5cff6f,_0xebb3f2[_0x3685('0x10')][_0x3685('0x12')]);return _0xd08cb1(_0xebb3f2[_0x3685('0x10')][_0x3685('0x12')]);}logger[_0x3685('0x10')](_0x3685('0x11'),_0x5cff6f,_0xebb3f2[_0x3685('0x10')][_0x3685('0x12')]);return _0x4e2872(_0xebb3f2[_0x3685('0x10')]['message']);}else{logger['info'](_0x3685('0x11'),_0x5cff6f,'request\x20sent');_0x4e2872(_0xebb3f2[_0x3685('0x13')]['message']);}})['catch'](function(_0x297dce){logger['error'](_0x3685('0x11'),_0x5cff6f,_0x297dce);_0xd08cb1(_0x297dce);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 745032b..a33ac02 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 _0x32e9=['/:id','show','/:id/preview','/:id/run','run','/:id/query','query','post','put','update','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x32e9,0x1c2));var _0x932e=function(_0x13a275,_0x3959a5){_0x13a275=_0x13a275-0x0;var _0x45919a=_0x32e9[_0x13a275];return _0x45919a;};'use strict';var multer=require(_0x932e('0x0'));var util=require(_0x932e('0x1'));var path=require(_0x932e('0x2'));var timeout=require(_0x932e('0x3'));var express=require(_0x932e('0x4'));var router=express['Router']();var fs_extra=require(_0x932e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x932e('0x6'));var config=require(_0x932e('0x7'));var controller=require(_0x932e('0x8'));router['get']('/',auth[_0x932e('0x9')](),controller[_0x932e('0xa')]);router[_0x932e('0xb')](_0x932e('0xc'),auth['isAuthenticated'](),controller[_0x932e('0xd')]);router['get'](_0x932e('0xe'),auth['isAuthenticated'](),controller['preview']);router[_0x932e('0xb')](_0x932e('0xf'),auth[_0x932e('0x9')](),controller[_0x932e('0x10')]);router[_0x932e('0xb')](_0x932e('0x11'),auth[_0x932e('0x9')](),controller[_0x932e('0x12')]);router[_0x932e('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x932e('0x14')](_0x932e('0xc'),auth['isAuthenticated'](),controller[_0x932e('0x15')]);router['delete'](_0x932e('0xc'),auth[_0x932e('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xc0b2=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','preview','/:id/run','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0xc0b2,0x151));var _0x2c0b=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xc0b2[_0x513aa5];return _0x1a1a7c;};'use strict';var multer=require(_0x2c0b('0x0'));var util=require(_0x2c0b('0x1'));var path=require(_0x2c0b('0x2'));var timeout=require(_0x2c0b('0x3'));var express=require(_0x2c0b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2c0b('0x5'));var interaction=require(_0x2c0b('0x6'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x2c0b('0x7')](),controller[_0x2c0b('0x8')]);router[_0x2c0b('0x9')](_0x2c0b('0xa'),auth[_0x2c0b('0x7')](),controller['show']);router[_0x2c0b('0x9')]('/:id/preview',auth[_0x2c0b('0x7')](),controller[_0x2c0b('0xb')]);router[_0x2c0b('0x9')](_0x2c0b('0xc'),auth[_0x2c0b('0x7')](),controller['run']);router['get']('/:id/query',auth[_0x2c0b('0x7')](),controller['query']);router[_0x2c0b('0xd')]('/',auth['isAuthenticated'](),controller[_0x2c0b('0xe')]);router[_0x2c0b('0xf')]('/:id',auth[_0x2c0b('0x7')](),controller[_0x2c0b('0x10')]);router[_0x2c0b('0x11')](_0x2c0b('0xa'),auth[_0x2c0b('0x7')](),controller[_0x2c0b('0x12')]);module[_0x2c0b('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index e822b25..d1fc09a 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 _0xafc4=['sequelize','STRING','TEXT'];(function(_0x483ab9,_0x419148){var _0x35043b=function(_0x3453a3){while(--_0x3453a3){_0x483ab9['push'](_0x483ab9['shift']());}};_0x35043b(++_0x419148);}(_0xafc4,0x69));var _0x4afc=function(_0x45de3a,_0x304cd8){_0x45de3a=_0x45de3a-0x0;var _0xec97ae=_0xafc4[_0x45de3a];return _0xec97ae;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}};
\ No newline at end of file
+var _0xafc4=['sequelize','STRING','TEXT'];(function(_0x9a3e0f,_0x2f796d){var _0x3d2a9a=function(_0x3aeb03){while(--_0x3aeb03){_0x9a3e0f['push'](_0x9a3e0f['shift']());}};_0x3d2a9a(++_0x2f796d);}(_0xafc4,0x69));var _0x4afc=function(_0x29140c,_0x3ac196){_0x29140c=_0x29140c-0x0;var _0x46f44f=_0xafc4[_0x29140c];return _0x46f44f;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 4441685..85eeb18 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 _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x561e0a,_0x3217b6){var _0x510ec1=function(_0x29536b){while(--_0x29536b){_0x561e0a['push'](_0x561e0a['shift']());}};_0x510ec1(++_0x3217b6);}(_0x814b,0x1a2));var _0xb814=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0x814b[_0xc7348b];return _0x307cec;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));};
\ No newline at end of file
+var _0xc6ac=['keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','field','condition','value','Sequelize','AnalyticMetric','select','from','table','MetricId','replace','format','group','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','function','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x973ea5,_0x35dbd4){_0x973ea5=_0x973ea5-0x0;var _0x2f135b=_0xc6ac[_0x973ea5];return _0x2f135b;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcc6a('0x1b')];function respondWithStatusCode(_0x211444,_0x4300c0){_0x4300c0=_0x4300c0||0xcc;return function(_0x559a0a){if(_0x559a0a){return _0x211444['sendStatus'](_0x4300c0);}return _0x211444[_0xcc6a('0x1c')](_0x4300c0)[_0xcc6a('0x1d')]();};}function respondWithResult(_0x43710d,_0x348af7){_0x348af7=_0x348af7||0xc8;return function(_0x96f9de){if(_0x96f9de){return _0x43710d[_0xcc6a('0x1c')](_0x348af7)[_0xcc6a('0x1e')](_0x96f9de);}};}function respondWithFilteredResult(_0x403b18,_0x56ffb0){return function(_0x4e628f){if(_0x4e628f){var _0x4d021a=typeof _0x56ffb0[_0xcc6a('0x1f')]===_0xcc6a('0x20')&&typeof _0x56ffb0[_0xcc6a('0x21')]===_0xcc6a('0x20');var _0x33079c=_0x4e628f[_0xcc6a('0x22')];var _0x2d9585=_0x4d021a?0x0:_0x56ffb0[_0xcc6a('0x1f')];var _0x374e51=_0x4d021a?_0x4e628f[_0xcc6a('0x22')]:_0x56ffb0[_0xcc6a('0x1f')]+_0x56ffb0['limit'];var _0xfec60f;if(_0x374e51>=_0x33079c){_0x374e51=_0x33079c;_0xfec60f=0xc8;}else{_0xfec60f=0xce;}_0x403b18[_0xcc6a('0x1c')](_0xfec60f);return _0x403b18[_0xcc6a('0x23')](_0xcc6a('0x24'),_0x2d9585+'-'+_0x374e51+'/'+_0x33079c)[_0xcc6a('0x1e')](_0x4e628f);}return null;};}function patchUpdates(_0x30b8ed){return function(_0x36c80f){try{jsonpatch[_0xcc6a('0x25')](_0x36c80f,_0x30b8ed,!![]);}catch(_0x2254a8){return BPromise[_0xcc6a('0x26')](_0x2254a8);}return _0x36c80f[_0xcc6a('0x27')]();};}function saveUpdates(_0x845088,_0x51be9a){return function(_0x41c4c8){if(_0x41c4c8){return _0x41c4c8[_0xcc6a('0x28')](_0x845088)[_0xcc6a('0x29')](function(_0x581aae){return _0x581aae;});}return null;};}function removeEntity(_0x10016a,_0x294486){return function(_0x3a00e5){if(_0x3a00e5){return _0x3a00e5[_0xcc6a('0x2a')]()[_0xcc6a('0x29')](function(){var _0x5fc697=_0x3a00e5['get']({'plain':!![]});var _0x26def8=_0xcc6a('0x2b');return db[_0xcc6a('0x2c')]['destroy']({'where':{'type':_0x26def8,'resourceId':_0x5fc697['id']}})[_0xcc6a('0x29')](function(){return _0x3a00e5;});})[_0xcc6a('0x29')](function(){_0x10016a['status'](0xcc)[_0xcc6a('0x1d')]();});}};}function handleEntityNotFound(_0x8b1b2b,_0x3233d1){return function(_0x473f88){if(!_0x473f88){_0x8b1b2b['sendStatus'](0x194);}return _0x473f88;};}function handleError(_0x194aab,_0x3cf14c){_0x3cf14c=_0x3cf14c||0x1f4;return function(_0x2c6d88){logger['error'](_0x2c6d88[_0xcc6a('0x2d')]);if(_0x2c6d88['name']){delete _0x2c6d88['name'];}_0x194aab[_0xcc6a('0x1c')](_0x3cf14c)[_0xcc6a('0x2e')](_0x2c6d88);};}exports[_0xcc6a('0x2f')]=function(_0x11b481,_0x2b575d){var _0x131138={},_0x4e2de4={},_0x7b2b54={'count':0x0,'rows':[]};var _0x28e3c3=_[_0xcc6a('0x30')](db[_0xcc6a('0x31')][_0xcc6a('0x32')],function(_0x152ebd){return{'name':_0x152ebd[_0xcc6a('0x33')],'type':_0x152ebd[_0xcc6a('0x34')]['key']};});_0x4e2de4[_0xcc6a('0x35')]=_[_0xcc6a('0x30')](_0x28e3c3,_0xcc6a('0x36'));_0x4e2de4[_0xcc6a('0x37')]=_[_0xcc6a('0x38')](_0x11b481[_0xcc6a('0x37')]);_0x4e2de4[_0xcc6a('0x39')]=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],_0x4e2de4['query']);_0x131138['attributes']=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3a')]));_0x131138[_0xcc6a('0x3b')]=_0x131138['attributes']['length']?_0x131138[_0xcc6a('0x3b')]:_0x4e2de4[_0xcc6a('0x35')];if(!_0x11b481[_0xcc6a('0x37')]['hasOwnProperty'](_0xcc6a('0x3c'))){_0x131138[_0xcc6a('0x21')]=qs[_0xcc6a('0x21')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x21')]);_0x131138[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x1f')]);}_0x131138[_0xcc6a('0x3d')]=qs[_0xcc6a('0x3e')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3e')]);_0x131138[_0xcc6a('0x3f')]=qs[_0xcc6a('0x39')](_[_0xcc6a('0x40')](_0x11b481[_0xcc6a('0x37')],_0x4e2de4[_0xcc6a('0x39')]),_0x28e3c3);if(_0x11b481['query']['filter']){_0x131138[_0xcc6a('0x3f')]=_[_0xcc6a('0x41')](_0x131138[_0xcc6a('0x3f')],{'$or':_[_0xcc6a('0x30')](_0x28e3c3,function(_0x1e628b){if(_0x1e628b[_0xcc6a('0x34')]!==_0xcc6a('0x42')){var _0x1199f1={};_0x1199f1[_0x1e628b['name']]={'$like':'%'+_0x11b481['query'][_0xcc6a('0x43')]+'%'};return _0x1199f1;}})});}_0x131138=_['merge']({},_0x131138,_0x11b481['options']);var _0x5cf1ba={'where':_0x131138[_0xcc6a('0x3f')]};return db[_0xcc6a('0x31')][_0xcc6a('0x22')](_0x5cf1ba)[_0xcc6a('0x29')](function(_0xe8056f){_0x7b2b54['count']=_0xe8056f;if(_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x44')]){_0x131138[_0xcc6a('0x45')]=[{'all':!![]}];}return db[_0xcc6a('0x31')][_0xcc6a('0x46')](_0x131138);})[_0xcc6a('0x29')](function(_0x54f862){_0x7b2b54[_0xcc6a('0x47')]=_0x54f862;return _0x7b2b54;})[_0xcc6a('0x29')](respondWithFilteredResult(_0x2b575d,_0x131138))[_0xcc6a('0x48')](handleError(_0x2b575d,null));};exports[_0xcc6a('0x49')]=function(_0x494904,_0x1fe723){var _0x4a9cea={'raw':!![],'where':{'id':_0x494904[_0xcc6a('0x4a')]['id']}},_0x351529={};_0x351529[_0xcc6a('0x35')]=_['keys'](db[_0xcc6a('0x31')][_0xcc6a('0x32')]);_0x351529[_0xcc6a('0x37')]=_['keys'](_0x494904['query']);_0x351529[_0xcc6a('0x39')]=_[_0xcc6a('0x4b')](_0x351529[_0xcc6a('0x35')],_0x351529[_0xcc6a('0x37')]);_0x4a9cea[_0xcc6a('0x3b')]=_['intersection'](_0x351529[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x494904['query'][_0xcc6a('0x3a')]));_0x4a9cea[_0xcc6a('0x3b')]=_0x4a9cea[_0xcc6a('0x3b')][_0xcc6a('0x4c')]?_0x4a9cea[_0xcc6a('0x3b')]:_0x351529[_0xcc6a('0x35')];if(_0x494904['query']['includeAll']){_0x4a9cea['include']=[{'all':!![]}];}_0x4a9cea=_[_0xcc6a('0x41')]({},_0x4a9cea,_0x494904[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4a9cea)['then'](handleEntityNotFound(_0x1fe723,null))[_0xcc6a('0x29')](respondWithResult(_0x1fe723,null))['catch'](handleError(_0x1fe723,null));};exports[_0xcc6a('0x4f')]=function(_0x4299ca,_0xcfc540){return db[_0xcc6a('0x31')][_0xcc6a('0x4f')](_0x4299ca[_0xcc6a('0x50')],{})['then'](function(_0x1a3b82){var _0x7288b2=_0x4299ca[_0xcc6a('0x51')][_0xcc6a('0x52')]({'plain':!![]});if(!_0x7288b2)throw new Error(_0xcc6a('0x53'));if(_0x7288b2[_0xcc6a('0x54')]===_0xcc6a('0x51')){var _0x392805=_0x1a3b82[_0xcc6a('0x52')]({'plain':!![]});var _0x30d0ef='Reports';return db[_0xcc6a('0x55')][_0xcc6a('0x4e')]({'where':{'name':_0x30d0ef,'userProfileId':_0x7288b2[_0xcc6a('0x56')]},'raw':!![]})[_0xcc6a('0x29')](function(_0x14f5e5){if(_0x14f5e5&&_0x14f5e5[_0xcc6a('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x392805[_0xcc6a('0x36')],'resourceId':_0x392805['id'],'type':'DefaultReports','sectionId':_0x14f5e5['id']},{})[_0xcc6a('0x29')](function(){return _0x1a3b82;});}else{return _0x1a3b82;}})[_0xcc6a('0x48')](function(_0x2b5782){logger[_0xcc6a('0x58')](_0xcc6a('0x59'),_0x2b5782);throw _0x2b5782;});}return _0x1a3b82;})[_0xcc6a('0x29')](respondWithResult(_0xcfc540,0xc9))[_0xcc6a('0x48')](handleError(_0xcfc540,null));};exports[_0xcc6a('0x28')]=function(_0x68b823,_0x27b074){if(_0x68b823[_0xcc6a('0x50')]['id']){delete _0x68b823['body']['id'];}return db[_0xcc6a('0x31')]['find']({'where':{'id':_0x68b823[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x27b074,null))[_0xcc6a('0x29')](saveUpdates(_0x68b823['body'],null))[_0xcc6a('0x29')](respondWithResult(_0x27b074,null))['catch'](handleError(_0x27b074,null));};exports[_0xcc6a('0x2a')]=function(_0x5db3b5,_0x3c0b1c){return db[_0xcc6a('0x31')][_0xcc6a('0x4e')]({'where':{'id':_0x5db3b5[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x3c0b1c,null))[_0xcc6a('0x29')](removeEntity(_0x3c0b1c,null))[_0xcc6a('0x48')](handleError(_0x3c0b1c,null));};exports[_0xcc6a('0x5a')]=function(_0x506311,_0x14d3ff){var _0x56d512=0xa;var _0x3a6b7e=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x586789={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x389e5f={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2cc561=function(_0x483aa4){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x483aa4);};var _0x46d93b=function(_0x4ed702){if(!_0x4ed702||!_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x20a16b='(',_0x19a578=0x0;_0x19a578<_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')];_0x19a578+=0x1){_0x19a578>0x0&&(_0x20a16b+='\x20'+_0x4ed702[_0xcc6a('0x6f')]+'\x20');_0x20a16b+=_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['group']?_0x46d93b(_0x4ed702['rules'][_0x19a578]['group']):_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x70')]+'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['condition']+(_0x2cc561(_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x71')])?'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x72')]:'');}return _0x20a16b+')';};var _0x5e1c69={'where':{'id':_0x506311['params']['id']}},_0x481d25,_0xaec5e8,_0x41527b,_0x4403d3,_0x386a74;_0x5e1c69=_[_0xcc6a('0x41')]({},_0x5e1c69,_0x506311[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x5e1c69)[_0xcc6a('0x29')](function(_0x55d129){if(_0x55d129){_0x481d25=_0x55d129;return _0x55d129['getFields']();}return null;})[_0xcc6a('0x29')](function(_0xd1a27b){if(_0xd1a27b){if(!_0xd1a27b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaec5e8=_0xd1a27b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x421d0b){if(_0x421d0b){_0x41527b=_['keyBy'](_0x421d0b,'id');var _0x4a8863;var _0x58e6b4=squel[_0xcc6a('0x75')]();_0x58e6b4[_0xcc6a('0x76')](_0x481d25[_0xcc6a('0x77')]);for(var _0x729b2=0x0;_0x729b2<_0xaec5e8['length'];_0x729b2+=0x1){_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x78')]?_0x41527b[_0xaec5e8[_0x729b2][_0xcc6a('0x78')]]['metric']:_0xaec5e8[_0x729b2][_0xcc6a('0x70')];_0x4a8863=_0xaec5e8[_0x729b2]['function']?_[_0xcc6a('0x79')](_0x586789[_0xaec5e8[_0x729b2]['function']],'%s',_0x4a8863):_0x4a8863;_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x389e5f[_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]],'%s',_0x4a8863):_0x4a8863;if(_0xaec5e8[_0x729b2]['groupBy']){_0x58e6b4[_0xcc6a('0x7b')](_0x4a8863);}_0xaec5e8[_0x729b2]['orderBy']&&_0x58e6b4[_0xcc6a('0x3d')](_0x4a8863,_0xaec5e8[_0x729b2]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x58e6b4[_0xcc6a('0x70')](_0x4a8863,_0xaec5e8[_0x729b2][_0xcc6a('0x7d')]||_0x4a8863);}if(_0x481d25[_0xcc6a('0x7e')]){_0x481d25[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x481d25['joins']);for(var _0x18f5dc=0x0;_0x18f5dc<_0x481d25[_0xcc6a('0x7e')][_0xcc6a('0x4c')];_0x18f5dc+=0x1){if(_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]&&_['includes'](_0x3a6b7e,_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')])&&_0x481d25['joins'][_0x18f5dc]['parentKey']&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x80')]&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]){_0x58e6b4[_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]](_0x481d25['joins'][_0x18f5dc][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x481d25[_0xcc6a('0x77')],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x83')],_0x481d25['joins'][_0x18f5dc]['foreignTable'],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]));}}}if(_0x481d25[_0xcc6a('0x84')]){_0x481d25[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x481d25[_0xcc6a('0x84')]);_0x58e6b4[_0xcc6a('0x3f')](_0x46d93b(_0x481d25['conditions'][_0xcc6a('0x7b')]));}_0x386a74=_0x58e6b4[_0xcc6a('0x85')]();_0x58e6b4[_0xcc6a('0x21')](_0x56d512);_0x58e6b4[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x58e6b4['toString']());return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x58e6b4[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')][_0xcc6a('0x8b')]});}})[_0xcc6a('0x29')](respondWithResult(_0x14d3ff,null))[_0xcc6a('0x48')](handleError(_0x14d3ff,null));};function runReport(_0x2a25df,_0x1f1ff7,_0x565bcd){var _0x45c45f=_0x1f1ff7[_0xcc6a('0x36')];var _0x58cd56=0xa;var _0x1848dd=[_0xcc6a('0x8c'),_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x5abd5c={'SUM':_0xcc6a('0x5e'),'COUNT':_0xcc6a('0x8d'),'COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x5be65b={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2b5c15=function(_0x3207b2){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0xcc6a('0x8f')],_0x3207b2);};var _0x58fdb3=function(_0xb4b2b4){if(!_0xb4b2b4||!_0xb4b2b4[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x275e15='(',_0x53b419=0x0;_0x53b419<_0xb4b2b4[_0xcc6a('0x6e')]['length'];_0x53b419+=0x1){_0x53b419>0x0&&(_0x275e15+='\x20'+_0xb4b2b4[_0xcc6a('0x6f')]+'\x20');_0x275e15+=_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]?_0x58fdb3(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]):_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x70')]+'\x20'+_0xb4b2b4['rules'][_0x53b419][_0xcc6a('0x71')]+(_0x2b5c15(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x71')])?'\x20'+_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x72')]:'');}return _0x275e15+')';};var _0x4473ab={'where':{'id':_0x2a25df['id']}},_0x558e2f,_0x14a957,_0x350766,_0x589bff,_0x5661b5;_0x4473ab=_[_0xcc6a('0x41')]({},_0x4473ab,_0x565bcd);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4473ab)[_0xcc6a('0x29')](function(_0x2f0b79){if(_0x2f0b79){_0x558e2f=_0x2f0b79;return _0x2f0b79['getFields']();}return null;})[_0xcc6a('0x29')](function(_0x4a268b){if(_0x4a268b){if(!_0x4a268b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x14a957=_0x4a268b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x1f4c4e){if(_0x1f4c4e){_0x350766=_['keyBy'](_0x1f4c4e,'id');var _0x312431;var _0x2a850c=squel[_0xcc6a('0x75')]();_0x2a850c['from'](_0x558e2f[_0xcc6a('0x77')]);for(var _0xd5b9f3=0x0;_0xd5b9f3<_0x14a957[_0xcc6a('0x4c')];_0xd5b9f3+=0x1){_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]?_0x350766[_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x14a957[_0xd5b9f3][_0xcc6a('0x70')];_0x312431=_0x14a957[_0xd5b9f3]['function']?_[_0xcc6a('0x79')](_0x5abd5c[_0x14a957[_0xd5b9f3][_0xcc6a('0x93')]],'%s',_0x312431):_0x312431;_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x5be65b[_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]],'%s',_0x312431):_0x312431;if(_0x14a957[_0xd5b9f3][_0xcc6a('0x94')]){_0x2a850c[_0xcc6a('0x7b')](_0x312431);}_0x14a957[_0xd5b9f3][_0xcc6a('0x95')]&&_0x2a850c['order'](_0x312431,_0x14a957[_0xd5b9f3]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x2a850c['field'](_0x312431,_0x14a957[_0xd5b9f3][_0xcc6a('0x7d')]||_0x312431);}if(_0x558e2f[_0xcc6a('0x7e')]){_0x558e2f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x7e')]);for(var _0x1f7ee5=0x0;_0x1f7ee5<_0x558e2f[_0xcc6a('0x7e')]['length'];_0x1f7ee5+=0x1){if(_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type']&&_['includes'](_0x1848dd,_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type'])&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')]&&_0x558e2f['joins'][_0x1f7ee5]['foreignTable']&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['foreignKey']){_0x2a850c[_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x34')]](_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x558e2f['table'],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],_0x558e2f['joins'][_0x1f7ee5][_0xcc6a('0x81')]));}}}if(_0x558e2f[_0xcc6a('0x84')]){_0x558e2f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x84')]);_0x2a850c[_0xcc6a('0x3f')](_0x58fdb3(_0x558e2f[_0xcc6a('0x84')]['group']));}_0x5661b5=_0x2a850c[_0xcc6a('0x85')]();_0x2a850c[_0xcc6a('0x21')](_0x58cd56);_0x2a850c['offset'](0x0);return;}})[_0xcc6a('0x29')](function(){if(_0x1f1ff7[_0xcc6a('0x96')]===_0xcc6a('0x97')){return null;}var _0x2297ea=_[_0xcc6a('0x41')](_0x1f1ff7,{'name':_0x1f1ff7[_0xcc6a('0x98')]||_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],'basename':_0x45c45f,'savename':util[_0xcc6a('0x7a')](_0xcc6a('0x99'),_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],require(_0xcc6a('0x9a'))[_0xcc6a('0x9b')](0x4),_0x1f1ff7['output']||'csv'),'reportId':_0x558e2f['id'],'reportType':_0xcc6a('0x9c')});return db[_0xcc6a('0x9d')]['create'](_0x2297ea,{'raw':!![]});})[_0xcc6a('0x29')](function(_0x1e74a4){if(_0x558e2f[_0xcc6a('0x77')]==='cdr'){_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0x9e'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7['endDate']);}else{_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0xa0'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7[_0xcc6a('0xa1')]);}if(_0x1e74a4){logger[_0xcc6a('0xa2')](_0xcc6a('0xa3'),_0x5661b5[_0xcc6a('0x89')]());require('child_process')['fork'](path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa4'),_0x1e74a4[_0xcc6a('0x96')]),[_0x1e74a4['id'],_0x5661b5['toString'](),path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa5'),_0x1e74a4[_0xcc6a('0xa6')]),_0x45c45f]);return _0x1e74a4;}else{var _0x3b7b43=squel['select']();_0x3b7b43[_0xcc6a('0x76')]('('+_0x5661b5[_0xcc6a('0x89')]()+')',_0xcc6a('0xa7'));_0x3b7b43['field'](_0xcc6a('0xa8'),'count');_0x5661b5[_0xcc6a('0x21')](_0x1f1ff7[_0xcc6a('0x21')]||_0x58cd56);_0x5661b5['offset'](_0x1f1ff7[_0xcc6a('0x1f')]||0x0);return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x3b7b43[_0xcc6a('0x89')](),{'type':dbH[_0xcc6a('0x88')][_0xcc6a('0x8a')][_0xcc6a('0x8b')]})[_0xcc6a('0x29')](function(_0x25ba57){if(!_0x25ba57[_0xcc6a('0x4c')]){_0x589bff=0x0;}else{_0x589bff=_0x25ba57[0x0][_0xcc6a('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5661b5[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});})['then'](function(_0x32ced0){return{'rows':_0x32ced0||[],'count':_0x589bff};});}});}exports[_0xcc6a('0xa9')]=function(_0xc638ae,_0x3367e8){return runReport(_0xc638ae['params'],_0xc638ae[_0xcc6a('0x37')],_0xc638ae['options'])['then'](respondWithResult(_0x3367e8,null))[_0xcc6a('0x48')](handleError(_0x3367e8,null));};exports[_0xcc6a('0xaa')]=runReport;exports[_0xcc6a('0x37')]=function(_0x38d805,_0x3f5f97){var _0x399eb6=0xa;var _0x2ae391=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x50b948={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x1d2ae0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x41d17b=function(_0x1827e6){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),'IS\x20NOT\x20NULL',_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x1827e6);};var _0xa70fa=function(_0x33ec76){if(!_0x33ec76||!_0x33ec76[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x30162c='(',_0x48746a=0x0;_0x48746a<_0x33ec76['rules'][_0xcc6a('0x4c')];_0x48746a+=0x1){_0x48746a>0x0&&(_0x30162c+='\x20'+_0x33ec76[_0xcc6a('0x6f')]+'\x20');_0x30162c+=_0x33ec76['rules'][_0x48746a][_0xcc6a('0x7b')]?_0xa70fa(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x7b')]):_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x70')]+'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['condition']+(_0x41d17b(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x71')])?'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['value']:'');}return _0x30162c+')';};var _0x54f0e4={'where':{'id':_0x38d805[_0xcc6a('0x4a')]['id']}},_0x559f4f,_0x545b15,_0x17a4e1,_0x5a7da7,_0x434c8b;_0x54f0e4=_['merge']({},_0x54f0e4,_0x38d805[_0xcc6a('0x4d')]);return db['AnalyticDefaultReport'][_0xcc6a('0x4e')](_0x54f0e4)[_0xcc6a('0x29')](function(_0xe9231f){if(_0xe9231f){_0x559f4f=_0xe9231f;return _0xe9231f[_0xcc6a('0xab')]();}return null;})[_0xcc6a('0x29')](function(_0x197961){if(_0x197961){if(!_0x197961[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x545b15=_0x197961;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x171a2a){if(_0x171a2a){_0x17a4e1=_[_0xcc6a('0xac')](_0x171a2a,'id');var _0x13860b;var _0x3b52f7=squel[_0xcc6a('0x75')]();_0x3b52f7[_0xcc6a('0x76')](_0x559f4f[_0xcc6a('0x77')]);for(var _0x319f4a=0x0;_0x319f4a<_0x545b15[_0xcc6a('0x4c')];_0x319f4a+=0x1){_0x13860b=_0x545b15[_0x319f4a]['MetricId']?_0x17a4e1[_0x545b15[_0x319f4a][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x545b15[_0x319f4a][_0xcc6a('0x70')];_0x13860b=_0x545b15[_0x319f4a]['function']?_[_0xcc6a('0x79')](_0x50b948[_0x545b15[_0x319f4a][_0xcc6a('0x93')]],'%s',_0x13860b):_0x13860b;_0x13860b=_0x545b15[_0x319f4a]['format']?_[_0xcc6a('0x79')](_0x1d2ae0[_0x545b15[_0x319f4a][_0xcc6a('0x7a')]],'%s',_0x13860b):_0x13860b;if(_0x545b15[_0x319f4a]['groupBy']){_0x3b52f7[_0xcc6a('0x7b')](_0x13860b);}_0x545b15[_0x319f4a][_0xcc6a('0x95')]&&_0x3b52f7[_0xcc6a('0x3d')](_0x13860b,_0x545b15[_0x319f4a][_0xcc6a('0x95')]===_0xcc6a('0x7c')?![]:!![]);_0x3b52f7[_0xcc6a('0x70')](_0x13860b,_0x545b15[_0x319f4a]['alias']||_0x13860b);}if(_0x559f4f['joins']){_0x559f4f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x559f4f['joins']);for(var _0x154885=0x0;_0x154885<_0x559f4f['joins'][_0xcc6a('0x4c')];_0x154885+=0x1){if(_0x559f4f['joins'][_0x154885][_0xcc6a('0x34')]&&_[_0xcc6a('0x6a')](_0x2ae391,_0x559f4f[_0xcc6a('0x7e')][_0x154885]['type'])&&_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')]&&_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignTable']&&_0x559f4f['joins'][_0x154885]['foreignKey']){_0x3b52f7[_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x34')]](_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x559f4f[_0xcc6a('0x77')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignKey']));}}}if(_0x559f4f[_0xcc6a('0x84')]){_0x559f4f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x559f4f['conditions']);_0x3b52f7[_0xcc6a('0x3f')](_0xa70fa(_0x559f4f[_0xcc6a('0x84')][_0xcc6a('0x7b')]));}_0x434c8b=_0x3b52f7['clone']();_0x3b52f7[_0xcc6a('0x21')](_0x399eb6);_0x3b52f7[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x3b52f7['toString']());return dbH[_0xcc6a('0x88')]['query'](_0x3b52f7['toString'](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x434c8b[_0xcc6a('0x89')]()};})[_0xcc6a('0x29')](respondWithResult(_0x3f5f97,null))[_0xcc6a('0x48')](handleError(_0x3f5f97,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index f15342c..fecd710 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 _0xd16f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','util','../../config/logger'];(function(_0x335549,_0x58caa2){var _0x18ec8a=function(_0x52dcc4){while(--_0x52dcc4){_0x335549['push'](_0x335549['shift']());}};_0x18ec8a(++_0x58caa2);}(_0xd16f,0x1af));var _0xfd16=function(_0x52a655,_0x5bf43f){_0x52a655=_0x52a655-0x0;var _0x3e2990=_0xd16f[_0x52a655];return _0x3e2990;};'use strict';var _=require(_0xfd16('0x0'));var util=require(_0xfd16('0x1'));var logger=require(_0xfd16('0x2'))(_0xfd16('0x3'));var moment=require(_0xfd16('0x4'));var BPromise=require(_0xfd16('0x5'));var rp=require(_0xfd16('0x6'));var fs=require('fs');var path=require(_0xfd16('0x7'));var rimraf=require(_0xfd16('0x8'));var config=require(_0xfd16('0x9'));var attributes=require(_0xfd16('0xa'));module[_0xfd16('0xb')]=function(_0x6eb4c8,_0x5ba79a){return _0x6eb4c8[_0xfd16('0xc')](_0xfd16('0xd'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x713b=['rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x270c32,_0x190eab){var _0x397ac0=function(_0xcb60ef){while(--_0xcb60ef){_0x270c32['push'](_0x270c32['shift']());}};_0x397ac0(++_0x190eab);}(_0x713b,0x172));var _0xb713=function(_0x58f245,_0x3e4f31){_0x58f245=_0x58f245-0x0;var _0x1f0cfb=_0x713b[_0x58f245];return _0x1f0cfb;};'use strict';var _=require(_0xb713('0x0'));var util=require(_0xb713('0x1'));var logger=require(_0xb713('0x2'))(_0xb713('0x3'));var moment=require(_0xb713('0x4'));var BPromise=require(_0xb713('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb713('0x6'));var rimraf=require(_0xb713('0x7'));var config=require(_0xb713('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0xb713('0x9')]=function(_0x408560,_0x1ba991){return _0x408560[_0xb713('0xa')](_0xb713('0xb'),attributes,{'tableName':_0xb713('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 2d46a8d..96410cd 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 _0xbb58=['rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x21f98e,_0x52f35d){var _0x3f263a=function(_0x32bc33){while(--_0x32bc33){_0x21f98e['push'](_0x21f98e['shift']());}};_0x3f263a(++_0x52f35d);}(_0xbb58,0x1f2));var _0x8bb5=function(_0x50a655,_0x1a063a){_0x50a655=_0x50a655-0x0;var _0x5d683b=_0xbb58[_0x50a655];return _0x5d683b;};'use strict';var _=require('lodash');var util=require(_0x8bb5('0x0'));var moment=require('moment');var BPromise=require(_0x8bb5('0x1'));var rs=require(_0x8bb5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bb5('0x3'))['db'];var utils=require(_0x8bb5('0x4'));var logger=require(_0x8bb5('0x5'))(_0x8bb5('0x6'));var config=require(_0x8bb5('0x7'));var jayson=require(_0x8bb5('0x8'));var client=jayson[_0x8bb5('0x9')][_0x8bb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfc5c6c,_0x373ed2,_0x1293b7){return new BPromise(function(_0x3415d0,_0x44deec){return client[_0x8bb5('0xb')](_0xfc5c6c,_0x1293b7)[_0x8bb5('0xc')](function(_0x10f419){logger['info'](_0x8bb5('0xd'),_0x373ed2,_0x8bb5('0xe'));logger[_0x8bb5('0xf')](_0x8bb5('0x10'),_0x373ed2,_0x8bb5('0xe'),JSON[_0x8bb5('0x11')](_0x10f419));if(_0x10f419[_0x8bb5('0x12')]){if(_0x10f419['error'][_0x8bb5('0x13')]===0x1f4){logger['error'](_0x8bb5('0xd'),_0x373ed2,_0x10f419[_0x8bb5('0x12')][_0x8bb5('0x14')]);return _0x44deec(_0x10f419[_0x8bb5('0x12')]['message']);}logger[_0x8bb5('0x12')](_0x8bb5('0xd'),_0x373ed2,_0x10f419[_0x8bb5('0x12')][_0x8bb5('0x14')]);return _0x3415d0(_0x10f419[_0x8bb5('0x12')]['message']);}else{logger[_0x8bb5('0x15')](_0x8bb5('0xd'),_0x373ed2,_0x8bb5('0xe'));_0x3415d0(_0x10f419[_0x8bb5('0x16')][_0x8bb5('0x14')]);}})[_0x8bb5('0x17')](function(_0x47c94f){logger[_0x8bb5('0x12')](_0x8bb5('0xd'),_0x373ed2,_0x47c94f);_0x44deec(_0x47c94f);});});}
\ No newline at end of file
+var _0x1f7f=['code','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x11b5cf,_0x10367d){var _0xece1ae=function(_0x462fda){while(--_0x462fda){_0x11b5cf['push'](_0x11b5cf['shift']());}};_0xece1ae(++_0x10367d);}(_0x1f7f,0x14f));var _0xf1f7=function(_0x3bd497,_0x37d7a8){_0x3bd497=_0x3bd497-0x0;var _0x32f967=_0x1f7f[_0x3bd497];return _0x32f967;};'use strict';var _=require(_0xf1f7('0x0'));var util=require(_0xf1f7('0x1'));var moment=require(_0xf1f7('0x2'));var BPromise=require(_0xf1f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf1f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf1f7('0x5'));var logger=require(_0xf1f7('0x6'))(_0xf1f7('0x7'));var config=require(_0xf1f7('0x8'));var jayson=require(_0xf1f7('0x9'));var client=jayson[_0xf1f7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10c701,_0xe7fb95,_0x353889){return new BPromise(function(_0x319c71,_0xf988d0){return client['request'](_0x10c701,_0x353889)[_0xf1f7('0xb')](function(_0x10fc23){logger[_0xf1f7('0xc')](_0xf1f7('0xd'),_0xe7fb95,'request\x20sent');logger['debug'](_0xf1f7('0xe'),_0xe7fb95,_0xf1f7('0xf'),JSON[_0xf1f7('0x10')](_0x10fc23));if(_0x10fc23['error']){if(_0x10fc23['error'][_0xf1f7('0x11')]===0x1f4){logger[_0xf1f7('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xe7fb95,_0x10fc23[_0xf1f7('0x12')][_0xf1f7('0x13')]);return _0xf988d0(_0x10fc23[_0xf1f7('0x12')]['message']);}logger[_0xf1f7('0x12')](_0xf1f7('0xd'),_0xe7fb95,_0x10fc23[_0xf1f7('0x12')][_0xf1f7('0x13')]);return _0x319c71(_0x10fc23[_0xf1f7('0x12')]['message']);}else{logger[_0xf1f7('0xc')](_0xf1f7('0xd'),_0xe7fb95,_0xf1f7('0xf'));_0x319c71(_0x10fc23[_0xf1f7('0x14')][_0xf1f7('0x13')]);}})[_0xf1f7('0x15')](function(_0x59749d){logger[_0xf1f7('0x12')](_0xf1f7('0xd'),_0xe7fb95,_0x59749d);_0xf988d0(_0x59749d);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 414ff77..2161ffb 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 _0xfe73=['../../components/auth/service','./analyticDefaultReport.controller','/:id','show','get','/:id/preview','isAuthenticated','preview','/:id/run','run','/:id/query','query','post','create','update','delete','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x1e765a,_0x4a7c55){var _0x5bc8a1=function(_0x8dbd4d){while(--_0x8dbd4d){_0x1e765a['push'](_0x1e765a['shift']());}};_0x5bc8a1(++_0x4a7c55);}(_0xfe73,0x12f));var _0x3fe7=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xfe73[_0x580647];return _0x5f0792;};'use strict';var multer=require(_0x3fe7('0x0'));var util=require(_0x3fe7('0x1'));var path=require(_0x3fe7('0x2'));var timeout=require(_0x3fe7('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3fe7('0x4'));var auth=require(_0x3fe7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3fe7('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3fe7('0x7'),auth['isAuthenticated'](),controller[_0x3fe7('0x8')]);router[_0x3fe7('0x9')](_0x3fe7('0xa'),auth[_0x3fe7('0xb')](),controller[_0x3fe7('0xc')]);router['get'](_0x3fe7('0xd'),auth['isAuthenticated'](),controller[_0x3fe7('0xe')]);router[_0x3fe7('0x9')](_0x3fe7('0xf'),auth[_0x3fe7('0xb')](),controller[_0x3fe7('0x10')]);router[_0x3fe7('0x11')]('/',auth[_0x3fe7('0xb')](),controller[_0x3fe7('0x12')]);router['put'](_0x3fe7('0x7'),auth['isAuthenticated'](),controller[_0x3fe7('0x13')]);router[_0x3fe7('0x14')](_0x3fe7('0x7'),auth[_0x3fe7('0xb')](),controller['destroy']);module[_0x3fe7('0x15')]=router;
\ No newline at end of file
+var _0xca84=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','run','/:id/query','query','post','delete','exports','multer','util'];(function(_0x1bb312,_0x2d1709){var _0x222bd7=function(_0x3d1890){while(--_0x3d1890){_0x1bb312['push'](_0x1bb312['shift']());}};_0x222bd7(++_0x2d1709);}(_0xca84,0xf5));var _0x4ca8=function(_0x2e5066,_0x4d9a48){_0x2e5066=_0x2e5066-0x0;var _0x499afb=_0xca84[_0x2e5066];return _0x499afb;};'use strict';var multer=require(_0x4ca8('0x0'));var util=require(_0x4ca8('0x1'));var path=require(_0x4ca8('0x2'));var timeout=require('connect-timeout');var express=require(_0x4ca8('0x3'));var router=express[_0x4ca8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4ca8('0x5'));var interaction=require(_0x4ca8('0x6'));var config=require(_0x4ca8('0x7'));var controller=require(_0x4ca8('0x8'));router[_0x4ca8('0x9')]('/',auth[_0x4ca8('0xa')](),controller[_0x4ca8('0xb')]);router[_0x4ca8('0x9')](_0x4ca8('0xc'),auth[_0x4ca8('0xa')](),controller['show']);router[_0x4ca8('0x9')]('/:id/preview',auth[_0x4ca8('0xa')](),controller['preview']);router[_0x4ca8('0x9')]('/:id/run',auth[_0x4ca8('0xa')](),controller[_0x4ca8('0xd')]);router[_0x4ca8('0x9')](_0x4ca8('0xe'),auth[_0x4ca8('0xa')](),controller[_0x4ca8('0xf')]);router[_0x4ca8('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x4ca8('0xa')](),controller['update']);router[_0x4ca8('0x11')](_0x4ca8('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x4ca8('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 3598026..73bb403 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 _0x5ea3=['manual','scheduled','UNSIGNED','STRING','moment','exports','ENUM','csv','xlsx','DATE'];(function(_0x13ea1c,_0x216164){var _0x2eee5d=function(_0x52b7f8){while(--_0x52b7f8){_0x13ea1c['push'](_0x13ea1c['shift']());}};_0x2eee5d(++_0x216164);}(_0x5ea3,0xe0));var _0x35ea=function(_0x399e7f,_0x3d2794){_0x399e7f=_0x399e7f-0x0;var _0x13e1b2=_0x5ea3[_0x399e7f];return _0x13e1b2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x35ea('0x0'));module[_0x35ea('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x35ea('0x2')](_0x35ea('0x3'),'pdf',_0x35ea('0x4')),'allowNull':![],'defaultValue':_0x35ea('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x35ea('0x5')]},'endDate':{'type':Sequelize[_0x35ea('0x5')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x35ea('0x6'),_0x35ea('0x7')),'allowNull':![],'defaultValue':_0x35ea('0x6')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x35ea('0x8')]},'reportType':{'type':Sequelize[_0x35ea('0x9')]}};
\ No newline at end of file
+var _0x3289=['UNSIGNED','sequelize','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','scheduled','manual','INTEGER'];(function(_0x477cfb,_0xa3c864){var _0x3f20c3=function(_0x1738dd){while(--_0x1738dd){_0x477cfb['push'](_0x477cfb['shift']());}};_0x3f20c3(++_0xa3c864);}(_0x3289,0xaa));var _0x9328=function(_0x3556e9,_0x1a6ab7){_0x3556e9=_0x3556e9-0x0;var _0x112adc=_0x3289[_0x3556e9];return _0x112adc;};'use strict';var Sequelize=require(_0x9328('0x0'));var moment=require('moment');module[_0x9328('0x1')]={'name':{'type':Sequelize[_0x9328('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x9328('0x3')](_0x9328('0x4'),_0x9328('0x5'),_0x9328('0x6')),'allowNull':![],'defaultValue':_0x9328('0x4')},'savename':{'type':Sequelize[_0x9328('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x9328('0x7')]},'endDate':{'type':Sequelize[_0x9328('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x9328('0x8')},'type':{'type':Sequelize[_0x9328('0x3')]('manual',_0x9328('0x9')),'allowNull':![],'defaultValue':_0x9328('0xa')},'reportId':{'type':Sequelize[_0x9328('0xb')](0xb)[_0x9328('0xc')]},'reportType':{'type':Sequelize[_0x9328('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 9131341..17d43ff 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 _0x8803=['Report\x20not\x20found\x20or\x20empty','exists','sendStatus','download','savename','format','%s.%s','output','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','ExtractedReports','error','name','send','index','rawAttributes','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','findAll','catch','show','params','include','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','existsSync','join','root','server/files/reports','Sequelize'];(function(_0x1a5861,_0x676eb1){var _0x216116=function(_0x55a958){while(--_0x55a958){_0x1a5861['push'](_0x1a5861['shift']());}};_0x216116(++_0x676eb1);}(_0x8803,0x17c));var _0x3880=function(_0x2e7e4d,_0x466190){_0x2e7e4d=_0x2e7e4d-0x0;var _0x52dcad=_0x8803[_0x2e7e4d];return _0x52dcad;};'use strict';var emlformat=require(_0x3880('0x0'));var rimraf=require(_0x3880('0x1'));var zipdir=require(_0x3880('0x2'));var jsonpatch=require(_0x3880('0x3'));var rp=require(_0x3880('0x4'));var moment=require(_0x3880('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3880('0x6'));var util=require(_0x3880('0x7'));var path=require(_0x3880('0x8'));var sox=require('sox');var csv=require(_0x3880('0x9'));var ejs=require(_0x3880('0xa'));var fs=require('fs');var fs_extra=require(_0x3880('0xb'));var _=require('lodash');var squel=require(_0x3880('0xc'));var crypto=require(_0x3880('0xd'));var jsforce=require(_0x3880('0xe'));var deskjs=require(_0x3880('0xf'));var toCsv=require(_0x3880('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3880('0x10'));var qs=require(_0x3880('0x11'));var as=require(_0x3880('0x12'));var hardwareService=require(_0x3880('0x13'));var logger=require(_0x3880('0x14'))(_0x3880('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3880('0x16'));var db=require(_0x3880('0x17'))['db'];function respondWithStatusCode(_0x206e19,_0x42d394){_0x42d394=_0x42d394||0xcc;return function(_0x10924e){if(_0x10924e){return _0x206e19['sendStatus'](_0x42d394);}return _0x206e19['status'](_0x42d394)['end']();};}function respondWithResult(_0x17c98a,_0x555515){_0x555515=_0x555515||0xc8;return function(_0x5e2918){if(_0x5e2918){return _0x17c98a[_0x3880('0x18')](_0x555515)[_0x3880('0x19')](_0x5e2918);}};}function respondWithFilteredResult(_0x22b9a5,_0x5cb7a1){return function(_0x5db88a){if(_0x5db88a){var _0x20444c=typeof _0x5cb7a1[_0x3880('0x1a')]===_0x3880('0x1b')&&typeof _0x5cb7a1[_0x3880('0x1c')]===_0x3880('0x1b');var _0x58a1be=_0x5db88a['count'];var _0x31f617=_0x20444c?0x0:_0x5cb7a1['offset'];var _0x1348c5=_0x20444c?_0x5db88a[_0x3880('0x1d')]:_0x5cb7a1['offset']+_0x5cb7a1[_0x3880('0x1c')];var _0x4b47fc;if(_0x1348c5>=_0x58a1be){_0x1348c5=_0x58a1be;_0x4b47fc=0xc8;}else{_0x4b47fc=0xce;}_0x22b9a5['status'](_0x4b47fc);return _0x22b9a5[_0x3880('0x1e')](_0x3880('0x1f'),_0x31f617+'-'+_0x1348c5+'/'+_0x58a1be)[_0x3880('0x19')](_0x5db88a);}return null;};}function patchUpdates(_0x192ba3){return function(_0x170200){try{jsonpatch[_0x3880('0x20')](_0x170200,_0x192ba3,!![]);}catch(_0xc15bb3){return BPromise['reject'](_0xc15bb3);}return _0x170200['save']();};}function saveUpdates(_0x3c9933,_0x3a6c3b){return function(_0x3387be){if(_0x3387be){return _0x3387be[_0x3880('0x21')](_0x3c9933)[_0x3880('0x22')](function(_0x19beb8){return _0x19beb8;});}return null;};}function removeEntity(_0x349e3b,_0x39d481){return function(_0x5dfea4){if(_0x5dfea4){return _0x5dfea4[_0x3880('0x23')]()['then'](function(){var _0x32081b=_0x5dfea4['get']({'plain':!![]});var _0x2ded48=_0x3880('0x24');return db['UserProfileResource'][_0x3880('0x23')]({'where':{'type':_0x2ded48,'resourceId':_0x32081b['id']}})['then'](function(){return _0x5dfea4;});})[_0x3880('0x22')](function(){_0x349e3b[_0x3880('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e5c9b,_0x50c19d){return function(_0xbe116a){if(!_0xbe116a){_0x1e5c9b['sendStatus'](0x194);}return _0xbe116a;};}function handleError(_0x38784b,_0x2fc471){_0x2fc471=_0x2fc471||0x1f4;return function(_0x12fd67){logger[_0x3880('0x25')](_0x12fd67['stack']);if(_0x12fd67[_0x3880('0x26')]){delete _0x12fd67[_0x3880('0x26')];}_0x38784b[_0x3880('0x18')](_0x2fc471)[_0x3880('0x27')](_0x12fd67);};}exports[_0x3880('0x28')]=function(_0x2416ba,_0x3fd3bf){var _0x6560e9={},_0x4bb0db={},_0xccc2f4={'count':0x0,'rows':[]};var _0x2c54dc=_['map'](db['AnalyticExtractedReport'][_0x3880('0x29')],function(_0xee2530){return{'name':_0xee2530['fieldName'],'type':_0xee2530[_0x3880('0x2a')][_0x3880('0x2b')]};});_0x4bb0db[_0x3880('0x2c')]=_[_0x3880('0x2d')](_0x2c54dc,'name');_0x4bb0db[_0x3880('0x2e')]=_[_0x3880('0x2f')](_0x2416ba[_0x3880('0x2e')]);_0x4bb0db['filters']=_['intersection'](_0x4bb0db['model'],_0x4bb0db[_0x3880('0x2e')]);_0x6560e9[_0x3880('0x30')]=_[_0x3880('0x31')](_0x4bb0db['model'],qs[_0x3880('0x32')](_0x2416ba[_0x3880('0x2e')]['fields']));_0x6560e9['attributes']=_0x6560e9['attributes'][_0x3880('0x33')]?_0x6560e9[_0x3880('0x30')]:_0x4bb0db[_0x3880('0x2c')];if(!_0x2416ba[_0x3880('0x2e')][_0x3880('0x34')]('nolimit')){_0x6560e9[_0x3880('0x1c')]=qs[_0x3880('0x1c')](_0x2416ba[_0x3880('0x2e')]['limit']);_0x6560e9['offset']=qs['offset'](_0x2416ba[_0x3880('0x2e')][_0x3880('0x1a')]);}_0x6560e9[_0x3880('0x35')]=qs[_0x3880('0x36')](_0x2416ba[_0x3880('0x2e')]['sort']);_0x6560e9[_0x3880('0x37')]=qs[_0x3880('0x38')](_['pick'](_0x2416ba[_0x3880('0x2e')],_0x4bb0db[_0x3880('0x38')]),_0x2c54dc);if(_0x2416ba['query'][_0x3880('0x39')]){_0x6560e9['where']=_[_0x3880('0x3a')](_0x6560e9[_0x3880('0x37')],{'$or':_[_0x3880('0x2d')](_0x2c54dc,function(_0x377f5d){if(_0x377f5d['type']!==_0x3880('0x3b')){var _0x35090e={};_0x35090e[_0x377f5d[_0x3880('0x26')]]={'$like':'%'+_0x2416ba['query']['filter']+'%'};return _0x35090e;}})});}_0x6560e9=_[_0x3880('0x3a')]({},_0x6560e9,_0x2416ba[_0x3880('0x3c')]);var _0x33c8e4={'where':_0x6560e9[_0x3880('0x37')]};return db[_0x3880('0x3d')]['count'](_0x33c8e4)[_0x3880('0x22')](function(_0x12936e){_0xccc2f4['count']=_0x12936e;if(_0x2416ba[_0x3880('0x2e')][_0x3880('0x3e')]){_0x6560e9['include']=[{'all':!![]}];}return db[_0x3880('0x3d')][_0x3880('0x3f')](_0x6560e9);})[_0x3880('0x22')](function(_0x22dc45){_0xccc2f4['rows']=_0x22dc45;return _0xccc2f4;})['then'](respondWithFilteredResult(_0x3fd3bf,_0x6560e9))[_0x3880('0x40')](handleError(_0x3fd3bf,null));};exports[_0x3880('0x41')]=function(_0x159c9a,_0x2292f9){var _0x917b1f={'raw':!![],'where':{'id':_0x159c9a[_0x3880('0x42')]['id']}},_0x243431={};_0x243431['model']=_[_0x3880('0x2f')](db[_0x3880('0x3d')]['rawAttributes']);_0x243431[_0x3880('0x2e')]=_[_0x3880('0x2f')](_0x159c9a[_0x3880('0x2e')]);_0x243431[_0x3880('0x38')]=_[_0x3880('0x31')](_0x243431[_0x3880('0x2c')],_0x243431['query']);_0x917b1f[_0x3880('0x30')]=_['intersection'](_0x243431['model'],qs[_0x3880('0x32')](_0x159c9a[_0x3880('0x2e')]['fields']));_0x917b1f[_0x3880('0x30')]=_0x917b1f['attributes'][_0x3880('0x33')]?_0x917b1f['attributes']:_0x243431[_0x3880('0x2c')];if(_0x159c9a[_0x3880('0x2e')]['includeAll']){_0x917b1f[_0x3880('0x43')]=[{'all':!![]}];}_0x917b1f=_[_0x3880('0x3a')]({},_0x917b1f,_0x159c9a[_0x3880('0x3c')]);return db['AnalyticExtractedReport'][_0x3880('0x44')](_0x917b1f)['then'](handleEntityNotFound(_0x2292f9,null))[_0x3880('0x22')](respondWithResult(_0x2292f9,null))[_0x3880('0x40')](handleError(_0x2292f9,null));};exports['create']=function(_0x597389,_0x16e415){return db['AnalyticExtractedReport']['create'](_0x597389[_0x3880('0x45')],{})[_0x3880('0x22')](function(_0x2fdc83){var _0xed82fa=_0x597389[_0x3880('0x46')][_0x3880('0x47')]({'plain':!![]});if(!_0xed82fa)throw new Error(_0x3880('0x48'));if(_0xed82fa[_0x3880('0x49')]===_0x3880('0x46')){var _0x5201c2=_0x2fdc83[_0x3880('0x47')]({'plain':!![]});var _0x5bdabd=_0x3880('0x24');return db[_0x3880('0x4a')]['find']({'where':{'name':_0x5bdabd,'userProfileId':_0xed82fa['userProfileId']},'raw':!![]})[_0x3880('0x22')](function(_0x1142d5){if(_0x1142d5&&_0x1142d5[_0x3880('0x4b')]===0x0){return db[_0x3880('0x4c')][_0x3880('0x4d')]({'name':_0x5201c2[_0x3880('0x26')],'resourceId':_0x5201c2['id'],'type':_0x1142d5['name'],'sectionId':_0x1142d5['id']},{})[_0x3880('0x22')](function(){return _0x2fdc83;});}else{return _0x2fdc83;}})[_0x3880('0x40')](function(_0x33115f){logger[_0x3880('0x25')](_0x3880('0x4e'),_0x33115f);throw _0x33115f;});}return _0x2fdc83;})[_0x3880('0x22')](respondWithResult(_0x16e415,0xc9))[_0x3880('0x40')](handleError(_0x16e415,null));};exports[_0x3880('0x21')]=function(_0x1a4378,_0xa86047){if(_0x1a4378[_0x3880('0x45')]['id']){delete _0x1a4378[_0x3880('0x45')]['id'];}return db[_0x3880('0x3d')][_0x3880('0x44')]({'where':{'id':_0x1a4378['params']['id']}})[_0x3880('0x22')](handleEntityNotFound(_0xa86047,null))[_0x3880('0x22')](saveUpdates(_0x1a4378['body'],null))['then'](respondWithResult(_0xa86047,null))[_0x3880('0x40')](handleError(_0xa86047,null));};exports[_0x3880('0x23')]=function(_0x1b6bbc,_0x4008ff){return db[_0x3880('0x3d')][_0x3880('0x44')]({'where':{'id':_0x1b6bbc[_0x3880('0x42')]['id']}})['then'](handleEntityNotFound(_0x4008ff,null))[_0x3880('0x22')](removeEntity(_0x4008ff,null))[_0x3880('0x40')](handleError(_0x4008ff,null));};exports['download']=function(_0x2dadbc,_0x4936d0,_0x74fdb0){return db['AnalyticExtractedReport'][_0x3880('0x44')]({'where':{'id':_0x2dadbc[_0x3880('0x42')]['id']},'attributes':[_0x3880('0x26'),_0x3880('0x4f'),'savename','output'],'raw':!![]})['then'](handleEntityNotFound(_0x4936d0,null))[_0x3880('0x22')](function(_0x2f1297){if(_0x2f1297){if(!fs[_0x3880('0x50')](path[_0x3880('0x51')](config[_0x3880('0x52')],_0x3880('0x53'),_0x2f1297['savename']))){throw new db[(_0x3880('0x54'))]['ValidationError'](_0x3880('0x55'));}if(_0x2dadbc['query'][_0x3880('0x56')]){return _0x4936d0[_0x3880('0x57')](0xc8);}return _0x4936d0[_0x3880('0x58')](path[_0x3880('0x51')](config[_0x3880('0x52')],_0x3880('0x53'),_0x2f1297[_0x3880('0x59')]),util[_0x3880('0x5a')](_0x3880('0x5b'),_0x2f1297[_0x3880('0x4f')]||_0x2f1297['name'],_0x2f1297[_0x3880('0x5c')]['toLowerCase']()));}})[_0x3880('0x40')](handleError(_0x4936d0,null));};
\ No newline at end of file
+var _0xc9cf=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','stack','name','index','AnalyticExtractedReport','type','key','model','map','keys','intersection','attributes','fields','length','query','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','output','join','root','server/files/reports','Sequelize','savename','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0xc9cf,0x103));var _0xfc9c=function(_0x26c112,_0x41e2fd){_0x26c112=_0x26c112-0x0;var _0x4933d8=_0xc9cf[_0x26c112];return _0x4933d8;};'use strict';var emlformat=require(_0xfc9c('0x0'));var rimraf=require(_0xfc9c('0x1'));var zipdir=require(_0xfc9c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfc9c('0x3'));var BPromise=require(_0xfc9c('0x4'));var Mustache=require(_0xfc9c('0x5'));var util=require(_0xfc9c('0x6'));var path=require(_0xfc9c('0x7'));var sox=require(_0xfc9c('0x8'));var csv=require(_0xfc9c('0x9'));var ejs=require(_0xfc9c('0xa'));var fs=require('fs');var fs_extra=require(_0xfc9c('0xb'));var _=require(_0xfc9c('0xc'));var squel=require(_0xfc9c('0xd'));var crypto=require(_0xfc9c('0xe'));var jsforce=require(_0xfc9c('0xf'));var deskjs=require(_0xfc9c('0x10'));var toCsv=require(_0xfc9c('0x9'));var querystring=require(_0xfc9c('0x11'));var Papa=require(_0xfc9c('0x12'));var Redis=require(_0xfc9c('0x13'));var authService=require(_0xfc9c('0x14'));var qs=require(_0xfc9c('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc9c('0x16'));var logger=require(_0xfc9c('0x17'))(_0xfc9c('0x18'));var utils=require('../../config/utils');var config=require(_0xfc9c('0x19'));var licenseUtil=require(_0xfc9c('0x1a'));var db=require(_0xfc9c('0x1b'))['db'];function respondWithStatusCode(_0x5123f4,_0x53832f){_0x53832f=_0x53832f||0xcc;return function(_0x24cd7f){if(_0x24cd7f){return _0x5123f4[_0xfc9c('0x1c')](_0x53832f);}return _0x5123f4[_0xfc9c('0x1d')](_0x53832f)[_0xfc9c('0x1e')]();};}function respondWithResult(_0x4bd02a,_0x3fda3d){_0x3fda3d=_0x3fda3d||0xc8;return function(_0x4897ee){if(_0x4897ee){return _0x4bd02a[_0xfc9c('0x1d')](_0x3fda3d)[_0xfc9c('0x1f')](_0x4897ee);}};}function respondWithFilteredResult(_0x453c4a,_0x91d08a){return function(_0x4ff9a8){if(_0x4ff9a8){var _0x24e037=typeof _0x91d08a[_0xfc9c('0x20')]===_0xfc9c('0x21')&&typeof _0x91d08a['limit']===_0xfc9c('0x21');var _0x38152f=_0x4ff9a8[_0xfc9c('0x22')];var _0x283afe=_0x24e037?0x0:_0x91d08a['offset'];var _0x1eaab8=_0x24e037?_0x4ff9a8[_0xfc9c('0x22')]:_0x91d08a['offset']+_0x91d08a[_0xfc9c('0x23')];var _0xec0ff7;if(_0x1eaab8>=_0x38152f){_0x1eaab8=_0x38152f;_0xec0ff7=0xc8;}else{_0xec0ff7=0xce;}_0x453c4a[_0xfc9c('0x1d')](_0xec0ff7);return _0x453c4a['set'](_0xfc9c('0x24'),_0x283afe+'-'+_0x1eaab8+'/'+_0x38152f)[_0xfc9c('0x1f')](_0x4ff9a8);}return null;};}function patchUpdates(_0x50d6df){return function(_0xea3310){try{jsonpatch[_0xfc9c('0x25')](_0xea3310,_0x50d6df,!![]);}catch(_0xdd757){return BPromise[_0xfc9c('0x26')](_0xdd757);}return _0xea3310[_0xfc9c('0x27')]();};}function saveUpdates(_0x52be30,_0x2ec1d3){return function(_0x2d6911){if(_0x2d6911){return _0x2d6911[_0xfc9c('0x28')](_0x52be30)[_0xfc9c('0x29')](function(_0x481da1){return _0x481da1;});}return null;};}function removeEntity(_0x53ef65,_0x10bb7c){return function(_0x40a661){if(_0x40a661){return _0x40a661['destroy']()[_0xfc9c('0x29')](function(){var _0x434ec4=_0x40a661[_0xfc9c('0x2a')]({'plain':!![]});var _0x2b9ace=_0xfc9c('0x2b');return db[_0xfc9c('0x2c')]['destroy']({'where':{'type':_0x2b9ace,'resourceId':_0x434ec4['id']}})['then'](function(){return _0x40a661;});})[_0xfc9c('0x29')](function(){_0x53ef65['status'](0xcc)[_0xfc9c('0x1e')]();});}};}function handleEntityNotFound(_0x351bfa,_0x17b4d3){return function(_0x3e3aa3){if(!_0x3e3aa3){_0x351bfa[_0xfc9c('0x1c')](0x194);}return _0x3e3aa3;};}function handleError(_0x11c800,_0x2b7bdd){_0x2b7bdd=_0x2b7bdd||0x1f4;return function(_0x5c2ab9){logger['error'](_0x5c2ab9[_0xfc9c('0x2d')]);if(_0x5c2ab9[_0xfc9c('0x2e')]){delete _0x5c2ab9[_0xfc9c('0x2e')];}_0x11c800[_0xfc9c('0x1d')](_0x2b7bdd)['send'](_0x5c2ab9);};}exports[_0xfc9c('0x2f')]=function(_0x322f9f,_0xab2d69){var _0x32cc85={},_0x419c6f={},_0x37c5ec={'count':0x0,'rows':[]};var _0x406a99=_['map'](db[_0xfc9c('0x30')]['rawAttributes'],function(_0x5c2121){return{'name':_0x5c2121['fieldName'],'type':_0x5c2121[_0xfc9c('0x31')][_0xfc9c('0x32')]};});_0x419c6f[_0xfc9c('0x33')]=_[_0xfc9c('0x34')](_0x406a99,_0xfc9c('0x2e'));_0x419c6f['query']=_[_0xfc9c('0x35')](_0x322f9f['query']);_0x419c6f['filters']=_[_0xfc9c('0x36')](_0x419c6f[_0xfc9c('0x33')],_0x419c6f['query']);_0x32cc85[_0xfc9c('0x37')]=_[_0xfc9c('0x36')](_0x419c6f[_0xfc9c('0x33')],qs['fields'](_0x322f9f['query'][_0xfc9c('0x38')]));_0x32cc85['attributes']=_0x32cc85['attributes'][_0xfc9c('0x39')]?_0x32cc85['attributes']:_0x419c6f[_0xfc9c('0x33')];if(!_0x322f9f[_0xfc9c('0x3a')]['hasOwnProperty'](_0xfc9c('0x3b'))){_0x32cc85['limit']=qs[_0xfc9c('0x23')](_0x322f9f[_0xfc9c('0x3a')][_0xfc9c('0x23')]);_0x32cc85[_0xfc9c('0x20')]=qs[_0xfc9c('0x20')](_0x322f9f['query'][_0xfc9c('0x20')]);}_0x32cc85[_0xfc9c('0x3c')]=qs['sort'](_0x322f9f[_0xfc9c('0x3a')][_0xfc9c('0x3d')]);_0x32cc85[_0xfc9c('0x3e')]=qs[_0xfc9c('0x3f')](_[_0xfc9c('0x40')](_0x322f9f[_0xfc9c('0x3a')],_0x419c6f['filters']),_0x406a99);if(_0x322f9f[_0xfc9c('0x3a')][_0xfc9c('0x41')]){_0x32cc85[_0xfc9c('0x3e')]=_['merge'](_0x32cc85[_0xfc9c('0x3e')],{'$or':_[_0xfc9c('0x34')](_0x406a99,function(_0x38f468){if(_0x38f468['type']!==_0xfc9c('0x42')){var _0x3fa671={};_0x3fa671[_0x38f468[_0xfc9c('0x2e')]]={'$like':'%'+_0x322f9f['query']['filter']+'%'};return _0x3fa671;}})});}_0x32cc85=_[_0xfc9c('0x43')]({},_0x32cc85,_0x322f9f[_0xfc9c('0x44')]);var _0x362e17={'where':_0x32cc85[_0xfc9c('0x3e')]};return db[_0xfc9c('0x30')][_0xfc9c('0x22')](_0x362e17)[_0xfc9c('0x29')](function(_0x598b2e){_0x37c5ec[_0xfc9c('0x22')]=_0x598b2e;if(_0x322f9f[_0xfc9c('0x3a')][_0xfc9c('0x45')]){_0x32cc85['include']=[{'all':!![]}];}return db[_0xfc9c('0x30')][_0xfc9c('0x46')](_0x32cc85);})[_0xfc9c('0x29')](function(_0x7ce0f6){_0x37c5ec[_0xfc9c('0x47')]=_0x7ce0f6;return _0x37c5ec;})[_0xfc9c('0x29')](respondWithFilteredResult(_0xab2d69,_0x32cc85))[_0xfc9c('0x48')](handleError(_0xab2d69,null));};exports[_0xfc9c('0x49')]=function(_0x2fbcf9,_0x462bfb){var _0x3b2ce5={'raw':!![],'where':{'id':_0x2fbcf9['params']['id']}},_0xcb2549={};_0xcb2549[_0xfc9c('0x33')]=_[_0xfc9c('0x35')](db[_0xfc9c('0x30')][_0xfc9c('0x4a')]);_0xcb2549['query']=_[_0xfc9c('0x35')](_0x2fbcf9[_0xfc9c('0x3a')]);_0xcb2549[_0xfc9c('0x3f')]=_[_0xfc9c('0x36')](_0xcb2549[_0xfc9c('0x33')],_0xcb2549[_0xfc9c('0x3a')]);_0x3b2ce5[_0xfc9c('0x37')]=_[_0xfc9c('0x36')](_0xcb2549[_0xfc9c('0x33')],qs[_0xfc9c('0x38')](_0x2fbcf9['query'][_0xfc9c('0x38')]));_0x3b2ce5[_0xfc9c('0x37')]=_0x3b2ce5[_0xfc9c('0x37')]['length']?_0x3b2ce5[_0xfc9c('0x37')]:_0xcb2549[_0xfc9c('0x33')];if(_0x2fbcf9['query'][_0xfc9c('0x45')]){_0x3b2ce5[_0xfc9c('0x4b')]=[{'all':!![]}];}_0x3b2ce5=_[_0xfc9c('0x43')]({},_0x3b2ce5,_0x2fbcf9[_0xfc9c('0x44')]);return db[_0xfc9c('0x30')][_0xfc9c('0x4c')](_0x3b2ce5)[_0xfc9c('0x29')](handleEntityNotFound(_0x462bfb,null))['then'](respondWithResult(_0x462bfb,null))[_0xfc9c('0x48')](handleError(_0x462bfb,null));};exports[_0xfc9c('0x4d')]=function(_0x47670c,_0x3a3fd6){return db[_0xfc9c('0x30')][_0xfc9c('0x4d')](_0x47670c[_0xfc9c('0x4e')],{})[_0xfc9c('0x29')](function(_0x40940c){var _0x1894c7=_0x47670c[_0xfc9c('0x4f')][_0xfc9c('0x2a')]({'plain':!![]});if(!_0x1894c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1894c7[_0xfc9c('0x50')]===_0xfc9c('0x4f')){var _0x589a62=_0x40940c[_0xfc9c('0x2a')]({'plain':!![]});var _0x186e0d='ExtractedReports';return db[_0xfc9c('0x51')][_0xfc9c('0x4c')]({'where':{'name':_0x186e0d,'userProfileId':_0x1894c7['userProfileId']},'raw':!![]})[_0xfc9c('0x29')](function(_0x3fa49f){if(_0x3fa49f&&_0x3fa49f['autoAssociation']===0x0){return db['UserProfileResource'][_0xfc9c('0x4d')]({'name':_0x589a62[_0xfc9c('0x2e')],'resourceId':_0x589a62['id'],'type':_0x3fa49f[_0xfc9c('0x2e')],'sectionId':_0x3fa49f['id']},{})['then'](function(){return _0x40940c;});}else{return _0x40940c;}})[_0xfc9c('0x48')](function(_0x28270b){logger[_0xfc9c('0x52')](_0xfc9c('0x53'),_0x28270b);throw _0x28270b;});}return _0x40940c;})[_0xfc9c('0x29')](respondWithResult(_0x3a3fd6,0xc9))[_0xfc9c('0x48')](handleError(_0x3a3fd6,null));};exports[_0xfc9c('0x28')]=function(_0x1b4642,_0x3f31e7){if(_0x1b4642[_0xfc9c('0x4e')]['id']){delete _0x1b4642[_0xfc9c('0x4e')]['id'];}return db[_0xfc9c('0x30')][_0xfc9c('0x4c')]({'where':{'id':_0x1b4642[_0xfc9c('0x54')]['id']}})[_0xfc9c('0x29')](handleEntityNotFound(_0x3f31e7,null))[_0xfc9c('0x29')](saveUpdates(_0x1b4642[_0xfc9c('0x4e')],null))['then'](respondWithResult(_0x3f31e7,null))[_0xfc9c('0x48')](handleError(_0x3f31e7,null));};exports['destroy']=function(_0x9a7ba7,_0x276223){return db[_0xfc9c('0x30')][_0xfc9c('0x4c')]({'where':{'id':_0x9a7ba7[_0xfc9c('0x54')]['id']}})[_0xfc9c('0x29')](handleEntityNotFound(_0x276223,null))[_0xfc9c('0x29')](removeEntity(_0x276223,null))[_0xfc9c('0x48')](handleError(_0x276223,null));};exports[_0xfc9c('0x55')]=function(_0x36a867,_0xea74b6,_0x2644cc){return db[_0xfc9c('0x30')][_0xfc9c('0x4c')]({'where':{'id':_0x36a867[_0xfc9c('0x54')]['id']},'attributes':['name','basename','savename',_0xfc9c('0x56')],'raw':!![]})[_0xfc9c('0x29')](handleEntityNotFound(_0xea74b6,null))[_0xfc9c('0x29')](function(_0x2331bd){if(_0x2331bd){if(!fs['existsSync'](path[_0xfc9c('0x57')](config[_0xfc9c('0x58')],_0xfc9c('0x59'),_0x2331bd['savename']))){throw new db[(_0xfc9c('0x5a'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x36a867[_0xfc9c('0x3a')]['exists']){return _0xea74b6['sendStatus'](0xc8);}return _0xea74b6[_0xfc9c('0x55')](path[_0xfc9c('0x57')](config[_0xfc9c('0x58')],'server/files/reports',_0x2331bd[_0xfc9c('0x5b')]),util[_0xfc9c('0x5c')](_0xfc9c('0x5d'),_0x2331bd['basename']||_0x2331bd['name'],_0x2331bd[_0xfc9c('0x56')][_0xfc9c('0x5e')]()));}})[_0xfc9c('0x48')](handleError(_0xea74b6,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 73474bf..3cb4ba6 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 _0x172a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0x172a,0x1ba));var _0xa172=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0x172a[_0x119280];return _0x481797;};'use strict';var _=require(_0xa172('0x0'));var util=require(_0xa172('0x1'));var logger=require(_0xa172('0x2'))(_0xa172('0x3'));var moment=require(_0xa172('0x4'));var BPromise=require(_0xa172('0x5'));var rp=require(_0xa172('0x6'));var fs=require('fs');var path=require(_0xa172('0x7'));var rimraf=require(_0xa172('0x8'));var config=require(_0xa172('0x9'));var attributes=require(_0xa172('0xa'));module[_0xa172('0xb')]=function(_0x3284fb,_0x514186){return _0x3284fb[_0xa172('0xc')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3882=['moment','request-promise','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger'];(function(_0x2d10f7,_0x36abd0){var _0x94c2f7=function(_0xcb5708){while(--_0xcb5708){_0x2d10f7['push'](_0x2d10f7['shift']());}};_0x94c2f7(++_0x36abd0);}(_0x3882,0x152));var _0x2388=function(_0x418413,_0x105785){_0x418413=_0x418413-0x0;var _0x4cd7ef=_0x3882[_0x418413];return _0x4cd7ef;};'use strict';var _=require('lodash');var util=require(_0x2388('0x0'));var logger=require(_0x2388('0x1'))('api');var moment=require(_0x2388('0x2'));var BPromise=require('bluebird');var rp=require(_0x2388('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2388('0x4'));var attributes=require(_0x2388('0x5'));module[_0x2388('0x6')]=function(_0x308ca2,_0x8a7e73){return _0x308ca2[_0x2388('0x7')](_0x2388('0x8'),attributes,{'tableName':_0x2388('0x9'),'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 24eb859..a84e803 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 _0x5330=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','../../config/utils'];(function(_0x307bf6,_0x55bdd5){var _0x2878fc=function(_0x4fa44f){while(--_0x4fa44f){_0x307bf6['push'](_0x307bf6['shift']());}};_0x2878fc(++_0x55bdd5);}(_0x5330,0x13c));var _0x0533=function(_0x3a8100,_0x5406cf){_0x3a8100=_0x3a8100-0x0;var _0x120743=_0x5330[_0x3a8100];return _0x120743;};'use strict';var _=require(_0x0533('0x0'));var util=require(_0x0533('0x1'));var moment=require(_0x0533('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0533('0x3'));var logger=require(_0x0533('0x4'))(_0x0533('0x5'));var config=require(_0x0533('0x6'));var jayson=require(_0x0533('0x7'));var client=jayson[_0x0533('0x8')][_0x0533('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x455e18,_0x361a3d,_0x339af6){return new BPromise(function(_0x245a50,_0x2e90ba){return client[_0x0533('0xa')](_0x455e18,_0x339af6)['then'](function(_0x18b7d2){logger[_0x0533('0xb')](_0x0533('0xc'),_0x361a3d,_0x0533('0xd'));logger[_0x0533('0xe')](_0x0533('0xf'),_0x361a3d,_0x0533('0xd'),JSON[_0x0533('0x10')](_0x18b7d2));if(_0x18b7d2[_0x0533('0x11')]){if(_0x18b7d2['error'][_0x0533('0x12')]===0x1f4){logger[_0x0533('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x361a3d,_0x18b7d2[_0x0533('0x11')]['message']);return _0x2e90ba(_0x18b7d2['error'][_0x0533('0x13')]);}logger[_0x0533('0x11')](_0x0533('0xc'),_0x361a3d,_0x18b7d2['error'][_0x0533('0x13')]);return _0x245a50(_0x18b7d2['error'][_0x0533('0x13')]);}else{logger[_0x0533('0xb')](_0x0533('0xc'),_0x361a3d,'request\x20sent');_0x245a50(_0x18b7d2['result'][_0x0533('0x13')]);}})['catch'](function(_0x36f2ed){logger[_0x0533('0x11')](_0x0533('0xc'),_0x361a3d,_0x36f2ed);_0x2e90ba(_0x36f2ed);});});}
\ No newline at end of file
+var _0xc80f=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc80f,0x1a5));var _0xfc80=function(_0x143b0a,_0x78c96b){_0x143b0a=_0x143b0a-0x0;var _0x39bf44=_0xc80f[_0x143b0a];return _0x39bf44;};'use strict';var _=require(_0xfc80('0x0'));var util=require(_0xfc80('0x1'));var moment=require(_0xfc80('0x2'));var BPromise=require(_0xfc80('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc80('0x4'));var db=require(_0xfc80('0x5'))['db'];var utils=require(_0xfc80('0x6'));var logger=require(_0xfc80('0x7'))(_0xfc80('0x8'));var config=require(_0xfc80('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21b3ad,_0x33a770,_0x3a8630){return new BPromise(function(_0x39146b,_0x21b074){return client[_0xfc80('0xa')](_0x21b3ad,_0x3a8630)['then'](function(_0x380877){logger['info'](_0xfc80('0xb'),_0x33a770,_0xfc80('0xc'));logger['debug'](_0xfc80('0xd'),_0x33a770,'request\x20sent',JSON[_0xfc80('0xe')](_0x380877));if(_0x380877[_0xfc80('0xf')]){if(_0x380877[_0xfc80('0xf')]['code']===0x1f4){logger[_0xfc80('0xf')](_0xfc80('0xb'),_0x33a770,_0x380877[_0xfc80('0xf')][_0xfc80('0x10')]);return _0x21b074(_0x380877[_0xfc80('0xf')]['message']);}logger['error'](_0xfc80('0xb'),_0x33a770,_0x380877[_0xfc80('0xf')][_0xfc80('0x10')]);return _0x39146b(_0x380877['error'][_0xfc80('0x10')]);}else{logger[_0xfc80('0x11')](_0xfc80('0xb'),_0x33a770,'request\x20sent');_0x39146b(_0x380877[_0xfc80('0x12')]['message']);}})[_0xfc80('0x13')](function(_0x5f4d3d){logger[_0xfc80('0xf')](_0xfc80('0xb'),_0x33a770,_0x5f4d3d);_0x21b074(_0x5f4d3d);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index dabeda9..01947ec 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 _0x9a39=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x9a39,0x7a));var _0x99a3=function(_0x26c1f1,_0x5bbb45){_0x26c1f1=_0x26c1f1-0x0;var _0x19e92f=_0x9a39[_0x26c1f1];return _0x19e92f;};'use strict';var multer=require('multer');var util=require(_0x99a3('0x0'));var path=require(_0x99a3('0x1'));var timeout=require(_0x99a3('0x2'));var express=require(_0x99a3('0x3'));var router=express[_0x99a3('0x4')]();var fs_extra=require(_0x99a3('0x5'));var auth=require(_0x99a3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x99a3('0x7')]('/',auth[_0x99a3('0x8')](),controller[_0x99a3('0x9')]);router[_0x99a3('0x7')](_0x99a3('0xa'),auth[_0x99a3('0x8')](),controller[_0x99a3('0xb')]);router[_0x99a3('0x7')](_0x99a3('0xc'),auth[_0x99a3('0x8')](),controller[_0x99a3('0xd')]);router[_0x99a3('0xe')]('/',auth['isAuthenticated'](),controller[_0x99a3('0xf')]);router[_0x99a3('0x10')](_0x99a3('0xa'),auth[_0x99a3('0x8')](),controller[_0x99a3('0x11')]);router['delete']('/:id',auth[_0x99a3('0x8')](),controller[_0x99a3('0x12')]);module[_0x99a3('0x13')]=router;
\ No newline at end of file
+var _0x7791=['Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x2f1d18,_0x4f65ee){var _0x3caada=function(_0x3daaca){while(--_0x3daaca){_0x2f1d18['push'](_0x2f1d18['shift']());}};_0x3caada(++_0x4f65ee);}(_0x7791,0x1b4));var _0x1779=function(_0x3432c6,_0x1d2fcf){_0x3432c6=_0x3432c6-0x0;var _0x2a893f=_0x7791[_0x3432c6];return _0x2a893f;};'use strict';var multer=require('multer');var util=require(_0x1779('0x0'));var path=require(_0x1779('0x1'));var timeout=require(_0x1779('0x2'));var express=require(_0x1779('0x3'));var router=express[_0x1779('0x4')]();var fs_extra=require(_0x1779('0x5'));var auth=require(_0x1779('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1779('0x7'));var controller=require(_0x1779('0x8'));router[_0x1779('0x9')]('/',auth[_0x1779('0xa')](),controller[_0x1779('0xb')]);router[_0x1779('0x9')]('/:id',auth[_0x1779('0xa')](),controller[_0x1779('0xc')]);router[_0x1779('0x9')](_0x1779('0xd'),auth[_0x1779('0xa')](),controller[_0x1779('0xe')]);router[_0x1779('0xf')]('/',auth[_0x1779('0xa')](),controller[_0x1779('0x10')]);router[_0x1779('0x11')](_0x1779('0x12'),auth[_0x1779('0xa')](),controller[_0x1779('0x13')]);router[_0x1779('0x14')](_0x1779('0x12'),auth[_0x1779('0xa')](),controller[_0x1779('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 1cb0b15..82415f1 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 _0x9276=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x4f034b,_0x4ae230){var _0xac374c=function(_0x880d3e){while(--_0x880d3e){_0x4f034b['push'](_0x4f034b['shift']());}};_0xac374c(++_0x4ae230);}(_0x9276,0x12e));var _0x6927=function(_0x26a8a3,_0x1fdc1b){_0x26a8a3=_0x26a8a3-0x0;var _0x23ab23=_0x9276[_0x26a8a3];return _0x23ab23;};'use strict';var Sequelize=require(_0x6927('0x0'));module[_0x6927('0x1')]={'field':{'type':Sequelize[_0x6927('0x2')]},'alias':{'type':Sequelize[_0x6927('0x3')]},'function':{'type':Sequelize[_0x6927('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6927('0x3')]},'custom':{'type':Sequelize[_0x6927('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xf06d=['STRING','BOOLEAN','sequelize'];(function(_0x2bba14,_0x463a51){var _0x308039=function(_0x32a3da){while(--_0x32a3da){_0x2bba14['push'](_0x2bba14['shift']());}};_0x308039(++_0x463a51);}(_0xf06d,0x113));var _0xdf06=function(_0xc2ab78,_0xf702d6){_0xc2ab78=_0xc2ab78-0x0;var _0x20e87d=_0xf06d[_0xc2ab78];return _0x20e87d;};'use strict';var Sequelize=require(_0xdf06('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xdf06('0x1')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xdf06('0x1')]},'groupBy':{'type':Sequelize[_0xdf06('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xdf06('0x1')]},'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 c5875e8..36fd991 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 _0x3d15=['transaction','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','destroy','then','stack','name','index','map','AnalyticFieldReport','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','rawAttributes','find','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne'];(function(_0xb6dbeb,_0x36182e){var _0xc69262=function(_0x44883e){while(--_0x44883e){_0xb6dbeb['push'](_0xb6dbeb['shift']());}};_0xc69262(++_0x36182e);}(_0x3d15,0x142));var _0x53d1=function(_0xd6a568,_0x4d39e9){_0xd6a568=_0xd6a568-0x0;var _0x56e5ab=_0x3d15[_0xd6a568];return _0x56e5ab;};'use strict';var emlformat=require(_0x53d1('0x0'));var rimraf=require(_0x53d1('0x1'));var zipdir=require(_0x53d1('0x2'));var jsonpatch=require(_0x53d1('0x3'));var rp=require('request-promise');var moment=require(_0x53d1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x53d1('0x5'));var util=require(_0x53d1('0x6'));var path=require(_0x53d1('0x7'));var sox=require(_0x53d1('0x8'));var csv=require(_0x53d1('0x9'));var ejs=require(_0x53d1('0xa'));var fs=require('fs');var fs_extra=require(_0x53d1('0xb'));var _=require(_0x53d1('0xc'));var squel=require(_0x53d1('0xd'));var crypto=require(_0x53d1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x53d1('0xf'));var toCsv=require(_0x53d1('0x9'));var querystring=require(_0x53d1('0x10'));var Papa=require(_0x53d1('0x11'));var Redis=require(_0x53d1('0x12'));var authService=require(_0x53d1('0x13'));var qs=require(_0x53d1('0x14'));var as=require(_0x53d1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x53d1('0x16'));var utils=require(_0x53d1('0x17'));var config=require(_0x53d1('0x18'));var licenseUtil=require(_0x53d1('0x19'));var db=require(_0x53d1('0x1a'))['db'];function respondWithStatusCode(_0x39a064,_0x41d04d){_0x41d04d=_0x41d04d||0xcc;return function(_0x54dbc5){if(_0x54dbc5){return _0x39a064[_0x53d1('0x1b')](_0x41d04d);}return _0x39a064[_0x53d1('0x1c')](_0x41d04d)[_0x53d1('0x1d')]();};}function respondWithResult(_0x5958b3,_0x57e40e){_0x57e40e=_0x57e40e||0xc8;return function(_0xddfb4d){if(_0xddfb4d){return _0x5958b3[_0x53d1('0x1c')](_0x57e40e)[_0x53d1('0x1e')](_0xddfb4d);}};}function respondWithFilteredResult(_0x17b1bd,_0x201d0e){return function(_0x150bbf){if(_0x150bbf){var _0x79eebe=typeof _0x201d0e[_0x53d1('0x1f')]==='undefined'&&typeof _0x201d0e[_0x53d1('0x20')]==='undefined';var _0x498bac=_0x150bbf['count'];var _0x58313d=_0x79eebe?0x0:_0x201d0e[_0x53d1('0x1f')];var _0x45f575=_0x79eebe?_0x150bbf['count']:_0x201d0e[_0x53d1('0x1f')]+_0x201d0e[_0x53d1('0x20')];var _0x11d938;if(_0x45f575>=_0x498bac){_0x45f575=_0x498bac;_0x11d938=0xc8;}else{_0x11d938=0xce;}_0x17b1bd[_0x53d1('0x1c')](_0x11d938);return _0x17b1bd['set'](_0x53d1('0x21'),_0x58313d+'-'+_0x45f575+'/'+_0x498bac)[_0x53d1('0x1e')](_0x150bbf);}return null;};}function patchUpdates(_0x3f961d){return function(_0x107a0d){try{jsonpatch[_0x53d1('0x22')](_0x107a0d,_0x3f961d,!![]);}catch(_0x29c52f){return BPromise[_0x53d1('0x23')](_0x29c52f);}return _0x107a0d['save']();};}function saveUpdates(_0x1910d9,_0x43859e){return function(_0x1a41cd){if(_0x1a41cd){return _0x1a41cd[_0x53d1('0x24')](_0x1910d9)['then'](function(_0x34d738){return _0x34d738;});}return null;};}function removeEntity(_0x4892d7,_0x2fb615){return function(_0x3d0027){if(_0x3d0027){return _0x3d0027[_0x53d1('0x25')]()[_0x53d1('0x26')](function(){_0x4892d7['status'](0xcc)[_0x53d1('0x1d')]();});}};}function handleEntityNotFound(_0x3b2529,_0x3cb855){return function(_0x2246f6){if(!_0x2246f6){_0x3b2529[_0x53d1('0x1b')](0x194);}return _0x2246f6;};}function handleError(_0x1416c0,_0x12bff2){_0x12bff2=_0x12bff2||0x1f4;return function(_0x8643ad){logger['error'](_0x8643ad[_0x53d1('0x27')]);if(_0x8643ad[_0x53d1('0x28')]){delete _0x8643ad[_0x53d1('0x28')];}_0x1416c0['status'](_0x12bff2)['send'](_0x8643ad);};}exports[_0x53d1('0x29')]=function(_0x427de5,_0x9209a6){var _0x1c3e8d={},_0x16de4b={},_0xafbe09={'count':0x0,'rows':[]};var _0x2092e3=_[_0x53d1('0x2a')](db[_0x53d1('0x2b')]['rawAttributes'],function(_0x35ed1a){return{'name':_0x35ed1a['fieldName'],'type':_0x35ed1a[_0x53d1('0x2c')][_0x53d1('0x2d')]};});_0x16de4b[_0x53d1('0x2e')]=_[_0x53d1('0x2a')](_0x2092e3,'name');_0x16de4b[_0x53d1('0x2f')]=_[_0x53d1('0x30')](_0x427de5[_0x53d1('0x2f')]);_0x16de4b['filters']=_[_0x53d1('0x31')](_0x16de4b[_0x53d1('0x2e')],_0x16de4b[_0x53d1('0x2f')]);_0x1c3e8d[_0x53d1('0x32')]=_[_0x53d1('0x31')](_0x16de4b[_0x53d1('0x2e')],qs[_0x53d1('0x33')](_0x427de5[_0x53d1('0x2f')][_0x53d1('0x33')]));_0x1c3e8d[_0x53d1('0x32')]=_0x1c3e8d[_0x53d1('0x32')][_0x53d1('0x34')]?_0x1c3e8d[_0x53d1('0x32')]:_0x16de4b[_0x53d1('0x2e')];if(!_0x427de5['query']['hasOwnProperty'](_0x53d1('0x35'))){_0x1c3e8d[_0x53d1('0x20')]=qs[_0x53d1('0x20')](_0x427de5['query']['limit']);_0x1c3e8d['offset']=qs[_0x53d1('0x1f')](_0x427de5[_0x53d1('0x2f')]['offset']);}_0x1c3e8d[_0x53d1('0x36')]=qs[_0x53d1('0x37')](_0x427de5[_0x53d1('0x2f')][_0x53d1('0x37')]);_0x1c3e8d[_0x53d1('0x38')]=qs[_0x53d1('0x39')](_[_0x53d1('0x3a')](_0x427de5[_0x53d1('0x2f')],_0x16de4b[_0x53d1('0x39')]),_0x2092e3);if(_0x427de5['query'][_0x53d1('0x3b')]){_0x1c3e8d[_0x53d1('0x38')]=_[_0x53d1('0x3c')](_0x1c3e8d[_0x53d1('0x38')],{'$or':_[_0x53d1('0x2a')](_0x2092e3,function(_0x1b7d88){if(_0x1b7d88[_0x53d1('0x2c')]!==_0x53d1('0x3d')){var _0x4ca619={};_0x4ca619[_0x1b7d88[_0x53d1('0x28')]]={'$like':'%'+_0x427de5[_0x53d1('0x2f')][_0x53d1('0x3b')]+'%'};return _0x4ca619;}})});}_0x1c3e8d=_[_0x53d1('0x3c')]({},_0x1c3e8d,_0x427de5[_0x53d1('0x3e')]);var _0x283fe4={'where':_0x1c3e8d[_0x53d1('0x38')]};return db[_0x53d1('0x2b')][_0x53d1('0x3f')](_0x283fe4)[_0x53d1('0x26')](function(_0xa8e74){_0xafbe09['count']=_0xa8e74;if(_0x427de5['query'][_0x53d1('0x40')]){_0x1c3e8d['include']=[{'all':!![]}];}return db[_0x53d1('0x2b')]['findAll'](_0x1c3e8d);})[_0x53d1('0x26')](function(_0x3cc009){_0xafbe09[_0x53d1('0x41')]=_0x3cc009;return _0xafbe09;})['then'](respondWithFilteredResult(_0x9209a6,_0x1c3e8d))[_0x53d1('0x42')](handleError(_0x9209a6,null));};exports[_0x53d1('0x43')]=function(_0xae6f25,_0x4ead2f){var _0x4aac55={'raw':![],'where':{'id':_0xae6f25[_0x53d1('0x44')]['id']}},_0x60444d={};_0x60444d[_0x53d1('0x2e')]=_[_0x53d1('0x30')](db[_0x53d1('0x2b')][_0x53d1('0x45')]);_0x60444d[_0x53d1('0x2f')]=_['keys'](_0xae6f25[_0x53d1('0x2f')]);_0x60444d[_0x53d1('0x39')]=_[_0x53d1('0x31')](_0x60444d['model'],_0x60444d[_0x53d1('0x2f')]);_0x4aac55['attributes']=_[_0x53d1('0x31')](_0x60444d['model'],qs[_0x53d1('0x33')](_0xae6f25[_0x53d1('0x2f')][_0x53d1('0x33')]));_0x4aac55['attributes']=_0x4aac55[_0x53d1('0x32')]['length']?_0x4aac55[_0x53d1('0x32')]:_0x60444d[_0x53d1('0x2e')];if(_0xae6f25[_0x53d1('0x2f')]['includeAll']){_0x4aac55['include']=[{'all':!![]}];}_0x4aac55=_[_0x53d1('0x3c')]({},_0x4aac55,_0xae6f25[_0x53d1('0x3e')]);return db[_0x53d1('0x2b')][_0x53d1('0x46')](_0x4aac55)['then'](handleEntityNotFound(_0x4ead2f,null))[_0x53d1('0x26')](respondWithResult(_0x4ead2f,null))[_0x53d1('0x42')](handleError(_0x4ead2f,null));};exports['create']=function(_0x550cda,_0x334158){return db[_0x53d1('0x2b')]['create'](_0x550cda[_0x53d1('0x47')],{})[_0x53d1('0x26')](respondWithResult(_0x334158,0xc9))[_0x53d1('0x42')](handleError(_0x334158,null));};exports[_0x53d1('0x48')]=function(_0x3e51da,_0x403635){return db['AnalyticFieldReport'][_0x53d1('0x48')](_0x3e51da[_0x53d1('0x47')],{'raw':![],'individualHooks':!![]})[_0x53d1('0x26')](respondWithResult(_0x403635,0xc9))[_0x53d1('0x42')](handleError(_0x403635,null));};exports[_0x53d1('0x24')]=function(_0x5df16c,_0x2f1aee){if(_0x5df16c[_0x53d1('0x47')]['id']){delete _0x5df16c[_0x53d1('0x47')]['id'];}return db[_0x53d1('0x2b')][_0x53d1('0x46')]({'where':{'id':_0x5df16c['params']['id']}})[_0x53d1('0x26')](handleEntityNotFound(_0x2f1aee,null))[_0x53d1('0x26')](saveUpdates(_0x5df16c['body'],null))[_0x53d1('0x26')](respondWithResult(_0x2f1aee,null))['catch'](handleError(_0x2f1aee,null));};exports[_0x53d1('0x25')]=function(_0x283b15,_0x549ffa){return db[_0x53d1('0x2b')][_0x53d1('0x46')]({'where':{'id':_0x283b15['params']['id']}})[_0x53d1('0x26')](handleEntityNotFound(_0x549ffa,null))['then'](removeEntity(_0x549ffa,null))['catch'](handleError(_0x549ffa,null));};exports[_0x53d1('0x49')]=function(_0x4fb647,_0x5c8556){return db['AnalyticFieldReport'][_0x53d1('0x25')]({'where':{'id':_0x4fb647[_0x53d1('0x2f')][_0x53d1('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x53d1('0x26')](respondWithResult(_0x5c8556,0xcc))[_0x53d1('0x42')](handleError(_0x5c8556,null));};exports[_0x53d1('0x4b')]=function(_0x270103,_0x35090e,_0x312fc2){return db[_0x53d1('0x4c')][_0x53d1('0x4d')]({'where':{'id':_0x270103[_0x53d1('0x44')]['id']}})[_0x53d1('0x26')](handleEntityNotFound(_0x35090e,null))['then'](function(_0x7af176){if(_0x7af176){return db['sequelize'][_0x53d1('0x4e')](function(_0x28e63f){return db[_0x53d1('0x2b')]['destroy']({'where':{'CustomReportId':_0x270103[_0x53d1('0x44')]['id']},'transaction':_0x28e63f})[_0x53d1('0x26')](function(_0x33b1f9){var _0x277095=_[_0x53d1('0x2a')](_0x270103[_0x53d1('0x47')],function(_0x30c5d4){delete _0x30c5d4['id'];_0x30c5d4['CustomReportId']=_0x270103[_0x53d1('0x44')]['id'];return _0x30c5d4;});return db['AnalyticFieldReport'][_0x53d1('0x48')](_0x277095,{'transaction':_0x28e63f});});})[_0x53d1('0x26')](function(){return db[_0x53d1('0x2b')][_0x53d1('0x4f')]({'where':{'CustomReportId':_0x270103[_0x53d1('0x44')]['id']}});});}})[_0x53d1('0x26')](respondWithResult(_0x35090e,null))[_0x53d1('0x42')](handleError(_0x35090e,null));};
\ No newline at end of file
+var _0xfc90=['options','AnalyticFieldReport','count','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','bulkDestroy','AnalyticCustomReport','findOne','sequelize','CustomReportId','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','set','Content-Range','json','apply','then','destroy','error','stack','name','send','index','map','rawAttributes','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xfc90,0xfd));var _0x0fc9=function(_0x354777,_0x17cc7b){_0x354777=_0x354777-0x0;var _0x31c0e7=_0xfc90[_0x354777];return _0x31c0e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fc9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fc9('0x1'));var rp=require(_0x0fc9('0x2'));var moment=require(_0x0fc9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0fc9('0x4'));var util=require(_0x0fc9('0x5'));var path=require(_0x0fc9('0x6'));var sox=require(_0x0fc9('0x7'));var csv=require(_0x0fc9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0fc9('0x9'));var _=require(_0x0fc9('0xa'));var squel=require('squel');var crypto=require(_0x0fc9('0xb'));var jsforce=require(_0x0fc9('0xc'));var deskjs=require(_0x0fc9('0xd'));var toCsv=require(_0x0fc9('0x8'));var querystring=require(_0x0fc9('0xe'));var Papa=require(_0x0fc9('0xf'));var Redis=require(_0x0fc9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0fc9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0fc9('0x12'));var logger=require(_0x0fc9('0x13'))(_0x0fc9('0x14'));var utils=require(_0x0fc9('0x15'));var config=require(_0x0fc9('0x16'));var licenseUtil=require(_0x0fc9('0x17'));var db=require(_0x0fc9('0x18'))['db'];function respondWithStatusCode(_0x781651,_0x4cf98a){_0x4cf98a=_0x4cf98a||0xcc;return function(_0x3eaa2c){if(_0x3eaa2c){return _0x781651['sendStatus'](_0x4cf98a);}return _0x781651[_0x0fc9('0x19')](_0x4cf98a)[_0x0fc9('0x1a')]();};}function respondWithResult(_0x46cdbb,_0x31e1a2){_0x31e1a2=_0x31e1a2||0xc8;return function(_0x5c55b4){if(_0x5c55b4){return _0x46cdbb['status'](_0x31e1a2)['json'](_0x5c55b4);}};}function respondWithFilteredResult(_0x134a4a,_0x56e564){return function(_0xde5c9a){if(_0xde5c9a){var _0x127445=typeof _0x56e564[_0x0fc9('0x1b')]===_0x0fc9('0x1c')&&typeof _0x56e564['limit']===_0x0fc9('0x1c');var _0x4fa23a=_0xde5c9a['count'];var _0x81ccec=_0x127445?0x0:_0x56e564[_0x0fc9('0x1b')];var _0x3da07a=_0x127445?_0xde5c9a['count']:_0x56e564['offset']+_0x56e564['limit'];var _0x36b978;if(_0x3da07a>=_0x4fa23a){_0x3da07a=_0x4fa23a;_0x36b978=0xc8;}else{_0x36b978=0xce;}_0x134a4a[_0x0fc9('0x19')](_0x36b978);return _0x134a4a[_0x0fc9('0x1d')](_0x0fc9('0x1e'),_0x81ccec+'-'+_0x3da07a+'/'+_0x4fa23a)[_0x0fc9('0x1f')](_0xde5c9a);}return null;};}function patchUpdates(_0x1295fd){return function(_0x2f81b0){try{jsonpatch[_0x0fc9('0x20')](_0x2f81b0,_0x1295fd,!![]);}catch(_0x25fbef){return BPromise['reject'](_0x25fbef);}return _0x2f81b0['save']();};}function saveUpdates(_0x3b3a7f,_0x2c3312){return function(_0x1f2456){if(_0x1f2456){return _0x1f2456['update'](_0x3b3a7f)[_0x0fc9('0x21')](function(_0x4d6449){return _0x4d6449;});}return null;};}function removeEntity(_0x3dbabd,_0x2ef50){return function(_0x1d8ee0){if(_0x1d8ee0){return _0x1d8ee0[_0x0fc9('0x22')]()[_0x0fc9('0x21')](function(){_0x3dbabd[_0x0fc9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43ee02,_0x21e511){return function(_0xd21605){if(!_0xd21605){_0x43ee02['sendStatus'](0x194);}return _0xd21605;};}function handleError(_0x1e00c8,_0xd3f6f9){_0xd3f6f9=_0xd3f6f9||0x1f4;return function(_0x1266c8){logger[_0x0fc9('0x23')](_0x1266c8[_0x0fc9('0x24')]);if(_0x1266c8[_0x0fc9('0x25')]){delete _0x1266c8[_0x0fc9('0x25')];}_0x1e00c8[_0x0fc9('0x19')](_0xd3f6f9)[_0x0fc9('0x26')](_0x1266c8);};}exports[_0x0fc9('0x27')]=function(_0x275a7f,_0x28afa8){var _0x755743={},_0x512d9a={},_0x29bbc2={'count':0x0,'rows':[]};var _0xf934fa=_[_0x0fc9('0x28')](db['AnalyticFieldReport'][_0x0fc9('0x29')],function(_0x3d6ee8){return{'name':_0x3d6ee8['fieldName'],'type':_0x3d6ee8['type'][_0x0fc9('0x2a')]};});_0x512d9a['model']=_[_0x0fc9('0x28')](_0xf934fa,'name');_0x512d9a[_0x0fc9('0x2b')]=_[_0x0fc9('0x2c')](_0x275a7f['query']);_0x512d9a['filters']=_[_0x0fc9('0x2d')](_0x512d9a[_0x0fc9('0x2e')],_0x512d9a[_0x0fc9('0x2b')]);_0x755743[_0x0fc9('0x2f')]=_[_0x0fc9('0x2d')](_0x512d9a['model'],qs[_0x0fc9('0x30')](_0x275a7f['query'][_0x0fc9('0x30')]));_0x755743[_0x0fc9('0x2f')]=_0x755743[_0x0fc9('0x2f')]['length']?_0x755743[_0x0fc9('0x2f')]:_0x512d9a[_0x0fc9('0x2e')];if(!_0x275a7f['query'][_0x0fc9('0x31')](_0x0fc9('0x32'))){_0x755743[_0x0fc9('0x33')]=qs['limit'](_0x275a7f['query'][_0x0fc9('0x33')]);_0x755743[_0x0fc9('0x1b')]=qs['offset'](_0x275a7f['query']['offset']);}_0x755743[_0x0fc9('0x34')]=qs[_0x0fc9('0x35')](_0x275a7f[_0x0fc9('0x2b')][_0x0fc9('0x35')]);_0x755743['where']=qs[_0x0fc9('0x36')](_[_0x0fc9('0x37')](_0x275a7f[_0x0fc9('0x2b')],_0x512d9a[_0x0fc9('0x36')]),_0xf934fa);if(_0x275a7f[_0x0fc9('0x2b')][_0x0fc9('0x38')]){_0x755743[_0x0fc9('0x39')]=_[_0x0fc9('0x3a')](_0x755743['where'],{'$or':_[_0x0fc9('0x28')](_0xf934fa,function(_0x4e2763){if(_0x4e2763['type']!=='VIRTUAL'){var _0x5d45a6={};_0x5d45a6[_0x4e2763[_0x0fc9('0x25')]]={'$like':'%'+_0x275a7f[_0x0fc9('0x2b')][_0x0fc9('0x38')]+'%'};return _0x5d45a6;}})});}_0x755743=_[_0x0fc9('0x3a')]({},_0x755743,_0x275a7f[_0x0fc9('0x3b')]);var _0x33c3f3={'where':_0x755743['where']};return db[_0x0fc9('0x3c')]['count'](_0x33c3f3)[_0x0fc9('0x21')](function(_0x251233){_0x29bbc2[_0x0fc9('0x3d')]=_0x251233;if(_0x275a7f[_0x0fc9('0x2b')]['includeAll']){_0x755743[_0x0fc9('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x0fc9('0x3f')](_0x755743);})[_0x0fc9('0x21')](function(_0xbbaf9b){_0x29bbc2[_0x0fc9('0x40')]=_0xbbaf9b;return _0x29bbc2;})[_0x0fc9('0x21')](respondWithFilteredResult(_0x28afa8,_0x755743))[_0x0fc9('0x41')](handleError(_0x28afa8,null));};exports[_0x0fc9('0x42')]=function(_0x399d41,_0x1d8bda){var _0x3c6cc0={'raw':![],'where':{'id':_0x399d41[_0x0fc9('0x43')]['id']}},_0x83996a={};_0x83996a[_0x0fc9('0x2e')]=_['keys'](db[_0x0fc9('0x3c')][_0x0fc9('0x29')]);_0x83996a[_0x0fc9('0x2b')]=_['keys'](_0x399d41['query']);_0x83996a[_0x0fc9('0x36')]=_[_0x0fc9('0x2d')](_0x83996a['model'],_0x83996a[_0x0fc9('0x2b')]);_0x3c6cc0[_0x0fc9('0x2f')]=_['intersection'](_0x83996a['model'],qs[_0x0fc9('0x30')](_0x399d41[_0x0fc9('0x2b')][_0x0fc9('0x30')]));_0x3c6cc0[_0x0fc9('0x2f')]=_0x3c6cc0[_0x0fc9('0x2f')][_0x0fc9('0x44')]?_0x3c6cc0[_0x0fc9('0x2f')]:_0x83996a[_0x0fc9('0x2e')];if(_0x399d41[_0x0fc9('0x2b')][_0x0fc9('0x45')]){_0x3c6cc0[_0x0fc9('0x3e')]=[{'all':!![]}];}_0x3c6cc0=_['merge']({},_0x3c6cc0,_0x399d41[_0x0fc9('0x3b')]);return db[_0x0fc9('0x3c')][_0x0fc9('0x46')](_0x3c6cc0)['then'](handleEntityNotFound(_0x1d8bda,null))[_0x0fc9('0x21')](respondWithResult(_0x1d8bda,null))['catch'](handleError(_0x1d8bda,null));};exports[_0x0fc9('0x47')]=function(_0x256e34,_0x102a0a){return db[_0x0fc9('0x3c')]['create'](_0x256e34[_0x0fc9('0x48')],{})[_0x0fc9('0x21')](respondWithResult(_0x102a0a,0xc9))['catch'](handleError(_0x102a0a,null));};exports['bulkCreate']=function(_0x397375,_0xf26d37){return db[_0x0fc9('0x3c')]['bulkCreate'](_0x397375['body'],{'raw':![],'individualHooks':!![]})[_0x0fc9('0x21')](respondWithResult(_0xf26d37,0xc9))[_0x0fc9('0x41')](handleError(_0xf26d37,null));};exports['update']=function(_0x53bc21,_0x770b71){if(_0x53bc21['body']['id']){delete _0x53bc21[_0x0fc9('0x48')]['id'];}return db[_0x0fc9('0x3c')][_0x0fc9('0x46')]({'where':{'id':_0x53bc21[_0x0fc9('0x43')]['id']}})[_0x0fc9('0x21')](handleEntityNotFound(_0x770b71,null))[_0x0fc9('0x21')](saveUpdates(_0x53bc21[_0x0fc9('0x48')],null))[_0x0fc9('0x21')](respondWithResult(_0x770b71,null))[_0x0fc9('0x41')](handleError(_0x770b71,null));};exports[_0x0fc9('0x22')]=function(_0x35e182,_0x7f8a19){return db['AnalyticFieldReport'][_0x0fc9('0x46')]({'where':{'id':_0x35e182[_0x0fc9('0x43')]['id']}})['then'](handleEntityNotFound(_0x7f8a19,null))[_0x0fc9('0x21')](removeEntity(_0x7f8a19,null))[_0x0fc9('0x41')](handleError(_0x7f8a19,null));};exports[_0x0fc9('0x49')]=function(_0x32b13a,_0x1b853b){return db[_0x0fc9('0x3c')][_0x0fc9('0x22')]({'where':{'id':_0x32b13a[_0x0fc9('0x2b')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x0fc9('0x21')](respondWithResult(_0x1b853b,0xcc))['catch'](handleError(_0x1b853b,null));};exports['addFields']=function(_0x233138,_0x25941e,_0x5a73b7){return db[_0x0fc9('0x4a')][_0x0fc9('0x4b')]({'where':{'id':_0x233138[_0x0fc9('0x43')]['id']}})['then'](handleEntityNotFound(_0x25941e,null))[_0x0fc9('0x21')](function(_0x2a8866){if(_0x2a8866){return db[_0x0fc9('0x4c')]['transaction'](function(_0x45f250){return db[_0x0fc9('0x3c')]['destroy']({'where':{'CustomReportId':_0x233138[_0x0fc9('0x43')]['id']},'transaction':_0x45f250})['then'](function(_0x4805a5){var _0x2aba5a=_[_0x0fc9('0x28')](_0x233138[_0x0fc9('0x48')],function(_0x3c6cd0){delete _0x3c6cd0['id'];_0x3c6cd0[_0x0fc9('0x4d')]=_0x233138[_0x0fc9('0x43')]['id'];return _0x3c6cd0;});return db[_0x0fc9('0x3c')]['bulkCreate'](_0x2aba5a,{'transaction':_0x45f250});});})[_0x0fc9('0x21')](function(){return db[_0x0fc9('0x3c')]['findAll']({'where':{'CustomReportId':_0x233138['params']['id']}});});}})['then'](respondWithResult(_0x25941e,null))[_0x0fc9('0x41')](handleError(_0x25941e,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index bd2b7e5..b9efd59 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 _0x20b0=['define','analytics_report_fields','util','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes'];(function(_0x529f1c,_0x437ed1){var _0x4d57ab=function(_0x39d479){while(--_0x39d479){_0x529f1c['push'](_0x529f1c['shift']());}};_0x4d57ab(++_0x437ed1);}(_0x20b0,0x8e));var _0x020b=function(_0xe9ed2f,_0x5a4322){_0xe9ed2f=_0xe9ed2f-0x0;var _0x1a2d27=_0x20b0[_0xe9ed2f];return _0x1a2d27;};'use strict';var _=require('lodash');var util=require(_0x020b('0x0'));var logger=require('../../config/logger')(_0x020b('0x1'));var moment=require(_0x020b('0x2'));var BPromise=require(_0x020b('0x3'));var rp=require(_0x020b('0x4'));var fs=require('fs');var path=require(_0x020b('0x5'));var rimraf=require('rimraf');var config=require(_0x020b('0x6'));var attributes=require(_0x020b('0x7'));module['exports']=function(_0x4bb21b,_0x1437d1){return _0x4bb21b[_0x020b('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0x020b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8297=['lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x49eaff,_0x455798){var _0x32e8ae=function(_0x564245){while(--_0x564245){_0x49eaff['push'](_0x49eaff['shift']());}};_0x32e8ae(++_0x455798);}(_0x8297,0xd8));var _0x7829=function(_0x39e0d4,_0x57e185){_0x39e0d4=_0x39e0d4-0x0;var _0x542b9a=_0x8297[_0x39e0d4];return _0x542b9a;};'use strict';var _=require(_0x7829('0x0'));var util=require('util');var logger=require(_0x7829('0x1'))(_0x7829('0x2'));var moment=require(_0x7829('0x3'));var BPromise=require(_0x7829('0x4'));var rp=require(_0x7829('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7829('0x6'));var attributes=require(_0x7829('0x7'));module[_0x7829('0x8')]=function(_0x15ee7d,_0x329d46){return _0x15ee7d[_0x7829('0x9')](_0x7829('0xa'),attributes,{'tableName':_0x7829('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index f738e21..7820945 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 _0x8f96=['code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','then','info','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xbc0b4d,_0x48d139){var _0x5920d7=function(_0x280edb){while(--_0x280edb){_0xbc0b4d['push'](_0xbc0b4d['shift']());}};_0x5920d7(++_0x48d139);}(_0x8f96,0x1a3));var _0x68f9=function(_0x52d459,_0x42ad9c){_0x52d459=_0x52d459-0x0;var _0x5e068d=_0x8f96[_0x52d459];return _0x5e068d;};'use strict';var _=require(_0x68f9('0x0'));var util=require(_0x68f9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x68f9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x68f9('0x3'))['db'];var utils=require(_0x68f9('0x4'));var logger=require('../../config/logger')(_0x68f9('0x5'));var config=require('../../config/environment');var jayson=require(_0x68f9('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49c280,_0x1e0b31,_0x139021){return new BPromise(function(_0x3fc26c,_0x558ae4){return client['request'](_0x49c280,_0x139021)[_0x68f9('0x7')](function(_0x1e566f){logger[_0x68f9('0x8')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1e0b31,'request\x20sent');logger['debug'](_0x68f9('0x9'),_0x1e0b31,_0x68f9('0xa'),JSON[_0x68f9('0xb')](_0x1e566f));if(_0x1e566f[_0x68f9('0xc')]){if(_0x1e566f[_0x68f9('0xc')][_0x68f9('0xd')]===0x1f4){logger['error'](_0x68f9('0xe'),_0x1e0b31,_0x1e566f[_0x68f9('0xc')][_0x68f9('0xf')]);return _0x558ae4(_0x1e566f[_0x68f9('0xc')][_0x68f9('0xf')]);}logger[_0x68f9('0xc')](_0x68f9('0xe'),_0x1e0b31,_0x1e566f[_0x68f9('0xc')][_0x68f9('0xf')]);return _0x3fc26c(_0x1e566f[_0x68f9('0xc')][_0x68f9('0xf')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x1e0b31,_0x68f9('0xa'));_0x3fc26c(_0x1e566f[_0x68f9('0x10')][_0x68f9('0xf')]);}})[_0x68f9('0x11')](function(_0x8553ed){logger['error'](_0x68f9('0xe'),_0x1e0b31,_0x8553ed);_0x558ae4(_0x8553ed);});});}
\ No newline at end of file
+var _0x049e=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x7e1a56,_0x56a560){var _0x5c4a8c=function(_0x24c54e){while(--_0x24c54e){_0x7e1a56['push'](_0x7e1a56['shift']());}};_0x5c4a8c(++_0x56a560);}(_0x049e,0x64));var _0xe049=function(_0x59ee41,_0xaf7db8){_0x59ee41=_0x59ee41-0x0;var _0x3ecd3e=_0x049e[_0x59ee41];return _0x3ecd3e;};'use strict';var _=require(_0xe049('0x0'));var util=require(_0xe049('0x1'));var moment=require(_0xe049('0x2'));var BPromise=require(_0xe049('0x3'));var rs=require(_0xe049('0x4'));var fs=require('fs');var Redis=require(_0xe049('0x5'));var db=require(_0xe049('0x6'))['db'];var utils=require(_0xe049('0x7'));var logger=require(_0xe049('0x8'))(_0xe049('0x9'));var config=require('../../config/environment');var jayson=require(_0xe049('0xa'));var client=jayson['client'][_0xe049('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc9b888,_0x5d9590,_0x108446){return new BPromise(function(_0xbb691f,_0x50e19b){return client[_0xe049('0xc')](_0xc9b888,_0x108446)[_0xe049('0xd')](function(_0x5155f4){logger[_0xe049('0xe')](_0xe049('0xf'),_0x5d9590,'request\x20sent');logger[_0xe049('0x10')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5d9590,_0xe049('0x11'),JSON[_0xe049('0x12')](_0x5155f4));if(_0x5155f4[_0xe049('0x13')]){if(_0x5155f4[_0xe049('0x13')][_0xe049('0x14')]===0x1f4){logger['error'](_0xe049('0xf'),_0x5d9590,_0x5155f4[_0xe049('0x13')][_0xe049('0x15')]);return _0x50e19b(_0x5155f4[_0xe049('0x13')]['message']);}logger[_0xe049('0x13')](_0xe049('0xf'),_0x5d9590,_0x5155f4[_0xe049('0x13')][_0xe049('0x15')]);return _0xbb691f(_0x5155f4[_0xe049('0x13')][_0xe049('0x15')]);}else{logger[_0xe049('0xe')](_0xe049('0xf'),_0x5d9590,_0xe049('0x11'));_0xbb691f(_0x5155f4[_0xe049('0x16')][_0xe049('0x15')]);}})[_0xe049('0x17')](function(_0x54be48){logger['error'](_0xe049('0xf'),_0x5d9590,_0x54be48);_0x50e19b(_0x54be48);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index cdf4af2..b080ebf 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(_0x1a0145,_0x5df481){var _0x193aa1=function(_0xd29a49){while(--_0xd29a49){_0x1a0145['push'](_0x1a0145['shift']());}};_0x193aa1(++_0x5df481);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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(_0x4c563d,_0x412a74){var _0x5a758c=function(_0x226c77){while(--_0x226c77){_0x4c563d['push'](_0x4c563d['shift']());}};_0x5a758c(++_0x412a74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index b1d20da..03d1800 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 _0x2179=['name','TEXT','sequelize','exports','STRING'];(function(_0x2b35a8,_0x7aec2){var _0x1a1129=function(_0x3ca887){while(--_0x3ca887){_0x2b35a8['push'](_0x2b35a8['shift']());}};_0x1a1129(++_0x7aec2);}(_0x2179,0xc0));var _0x9217=function(_0xf55e73,_0x3fecc5){_0xf55e73=_0xf55e73-0x0;var _0x116b99=_0x2179[_0xf55e73];return _0x116b99;};'use strict';var Sequelize=require(_0x9217('0x0'));module[_0x9217('0x1')]={'name':{'type':Sequelize[_0x9217('0x2')],'allowNull':![],'unique':_0x9217('0x3')},'table':{'type':Sequelize[_0x9217('0x2')]},'metric':{'type':Sequelize[_0x9217('0x4')]},'description':{'type':Sequelize[_0x9217('0x2')]}};
\ No newline at end of file
+var _0x4227=['STRING','sequelize','name','TEXT'];(function(_0x59a135,_0x5316d8){var _0x3cd388=function(_0x4075c7){while(--_0x4075c7){_0x59a135['push'](_0x59a135['shift']());}};_0x3cd388(++_0x5316d8);}(_0x4227,0x89));var _0x7422=function(_0x6a8207,_0x1f6d55){_0x6a8207=_0x6a8207-0x0;var _0x1dfcce=_0x4227[_0x6a8207];return _0x1dfcce;};'use strict';var Sequelize=require(_0x7422('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7422('0x1')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x7422('0x2')]},'description':{'type':Sequelize[_0x7422('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 65dfd4a..1cd466d 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 _0xa41a=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Metrics','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','send','map','AnalyticMetric','type','key','model','query','keys','intersection','fields'];(function(_0x2628c0,_0x34447b){var _0x41d104=function(_0x40ecd8){while(--_0x40ecd8){_0x2628c0['push'](_0x2628c0['shift']());}};_0x41d104(++_0x34447b);}(_0xa41a,0x6b));var _0xaa41=function(_0xf34b55,_0xc4c8af){_0xf34b55=_0xf34b55-0x0;var _0x52517e=_0xa41a[_0xf34b55];return _0x52517e;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){var _0x5c3074=_0x21f596['get']({'plain':!![]});var _0x16aec5='Metrics';return db['UserProfileResource'][_0xaa41('0x24')]({'where':{'type':_0x16aec5,'resourceId':_0x5c3074['id']}})['then'](function(){return _0x21f596;});})['then'](function(){_0x43a85c[_0xaa41('0x1a')](0xcc)[_0xaa41('0x1b')]();});}};}function handleEntityNotFound(_0x392214,_0x632fd2){return function(_0x3f5272){if(!_0x3f5272){_0x392214[_0xaa41('0x19')](0x194);}return _0x3f5272;};}function handleError(_0x57ef96,_0x30a174){_0x30a174=_0x30a174||0x1f4;return function(_0x1f0275){logger[_0xaa41('0x26')](_0x1f0275[_0xaa41('0x27')]);if(_0x1f0275[_0xaa41('0x28')]){delete _0x1f0275[_0xaa41('0x28')];}_0x57ef96[_0xaa41('0x1a')](_0x30a174)[_0xaa41('0x29')](_0x1f0275);};}exports['index']=function(_0x377add,_0x48b48b){var _0x5dad80={},_0x714537={},_0x1176bd={'count':0x0,'rows':[]};var _0x534a85=_[_0xaa41('0x2a')](db[_0xaa41('0x2b')]['rawAttributes'],function(_0x5022fb){return{'name':_0x5022fb['fieldName'],'type':_0x5022fb[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x714537[_0xaa41('0x2e')]=_[_0xaa41('0x2a')](_0x534a85,'name');_0x714537[_0xaa41('0x2f')]=_[_0xaa41('0x30')](_0x377add[_0xaa41('0x2f')]);_0x714537['filters']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],_0x714537[_0xaa41('0x2f')]);_0x5dad80['attributes']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],qs['fields'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x5dad80[_0xaa41('0x33')]=_0x5dad80['attributes'][_0xaa41('0x34')]?_0x5dad80['attributes']:_0x714537[_0xaa41('0x2e')];if(!_0x377add[_0xaa41('0x2f')][_0xaa41('0x35')]('nolimit')){_0x5dad80['limit']=qs['limit'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x1e')]);_0x5dad80[_0xaa41('0x20')]=qs[_0xaa41('0x20')](_0x377add['query']['offset']);}_0x5dad80[_0xaa41('0x36')]=qs[_0xaa41('0x37')](_0x377add[_0xaa41('0x2f')][_0xaa41('0x37')]);_0x5dad80[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_[_0xaa41('0x3a')](_0x377add['query'],_0x714537[_0xaa41('0x39')]),_0x534a85);if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]){_0x5dad80[_0xaa41('0x38')]=_['merge'](_0x5dad80['where'],{'$or':_[_0xaa41('0x2a')](_0x534a85,function(_0x275fa3){if(_0x275fa3['type']!==_0xaa41('0x3c')){var _0x563687={};_0x563687[_0x275fa3[_0xaa41('0x28')]]={'$like':'%'+_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]+'%'};return _0x563687;}})});}_0x5dad80=_[_0xaa41('0x3d')]({},_0x5dad80,_0x377add[_0xaa41('0x3e')]);var _0x12ba1a={'where':_0x5dad80[_0xaa41('0x38')]};return db[_0xaa41('0x2b')]['count'](_0x12ba1a)[_0xaa41('0x25')](function(_0x2abf39){_0x1176bd[_0xaa41('0x1f')]=_0x2abf39;if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x5dad80[_0xaa41('0x40')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5dad80);})[_0xaa41('0x25')](function(_0x4f9086){_0x1176bd[_0xaa41('0x41')]=_0x4f9086;return _0x1176bd;})[_0xaa41('0x25')](respondWithFilteredResult(_0x48b48b,_0x5dad80))[_0xaa41('0x42')](handleError(_0x48b48b,null));};exports[_0xaa41('0x43')]=function(_0x2aac10,_0x10bf09){var _0x2db8d6={'raw':!![],'where':{'id':_0x2aac10[_0xaa41('0x44')]['id']}},_0x5ee74c={};_0x5ee74c['model']=_['keys'](db[_0xaa41('0x2b')]['rawAttributes']);_0x5ee74c['query']=_['keys'](_0x2aac10[_0xaa41('0x2f')]);_0x5ee74c['filters']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],_0x5ee74c['query']);_0x2db8d6['attributes']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],qs[_0xaa41('0x32')](_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x2db8d6[_0xaa41('0x33')]=_0x2db8d6[_0xaa41('0x33')][_0xaa41('0x34')]?_0x2db8d6[_0xaa41('0x33')]:_0x5ee74c['model'];if(_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x2db8d6[_0xaa41('0x40')]=[{'all':!![]}];}_0x2db8d6=_[_0xaa41('0x3d')]({},_0x2db8d6,_0x2aac10[_0xaa41('0x3e')]);return db[_0xaa41('0x2b')]['find'](_0x2db8d6)[_0xaa41('0x25')](handleEntityNotFound(_0x10bf09,null))[_0xaa41('0x25')](respondWithResult(_0x10bf09,null))[_0xaa41('0x42')](handleError(_0x10bf09,null));};exports[_0xaa41('0x45')]=function(_0x57d1f6,_0x23bc61){return db['AnalyticMetric']['create'](_0x57d1f6[_0xaa41('0x46')],{})[_0xaa41('0x25')](function(_0x3e16ef){var _0x4ca114=_0x57d1f6[_0xaa41('0x47')][_0xaa41('0x48')]({'plain':!![]});if(!_0x4ca114)throw new Error(_0xaa41('0x49'));if(_0x4ca114['role']===_0xaa41('0x47')){var _0x3c4f24=_0x3e16ef[_0xaa41('0x48')]({'plain':!![]});var _0x1378f9=_0xaa41('0x4a');return db[_0xaa41('0x4b')][_0xaa41('0x4c')]({'where':{'name':_0x1378f9,'userProfileId':_0x4ca114[_0xaa41('0x4d')]},'raw':!![]})['then'](function(_0x9f0a81){if(_0x9f0a81&&_0x9f0a81['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x45')]({'name':_0x3c4f24[_0xaa41('0x28')],'resourceId':_0x3c4f24['id'],'type':_0x9f0a81[_0xaa41('0x28')],'sectionId':_0x9f0a81['id']},{})[_0xaa41('0x25')](function(){return _0x3e16ef;});}else{return _0x3e16ef;}})[_0xaa41('0x42')](function(_0x288db3){logger[_0xaa41('0x26')](_0xaa41('0x4e'),_0x288db3);throw _0x288db3;});}return _0x3e16ef;})['then'](respondWithResult(_0x23bc61,0xc9))[_0xaa41('0x42')](handleError(_0x23bc61,null));};exports[_0xaa41('0x23')]=function(_0x1d518f,_0x4f9e92){if(_0x1d518f[_0xaa41('0x46')]['id']){delete _0x1d518f[_0xaa41('0x46')]['id'];}return db['AnalyticMetric'][_0xaa41('0x4c')]({'where':{'id':_0x1d518f[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x4f9e92,null))['then'](saveUpdates(_0x1d518f[_0xaa41('0x46')],null))[_0xaa41('0x25')](respondWithResult(_0x4f9e92,null))['catch'](handleError(_0x4f9e92,null));};exports['destroy']=function(_0x3745ed,_0x3cd14f){return db[_0xaa41('0x2b')]['find']({'where':{'id':_0x3745ed[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x3cd14f,null))[_0xaa41('0x25')](removeEntity(_0x3cd14f,null))[_0xaa41('0x42')](handleError(_0x3cd14f,null));};
\ No newline at end of file
+var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x526eff,_0x32da5d){var _0x4e66ce=function(_0x193928){while(--_0x193928){_0x526eff['push'](_0x526eff['shift']());}};_0x4e66ce(++_0x32da5d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x18b5e8,_0x51e875){_0x18b5e8=_0x18b5e8-0x0;var _0x25baed=_0x7fbe[_0x18b5e8];return _0x25baed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 669677a..2755496 100644
--- a/server/api/analyticMetric/analyticMetric.model.js
+++ b/server/api/analyticMetric/analyticMetric.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb091=['moment','request-promise','../../config/environment','./analyticMetric.attributes','define','analytics_metrics','util','../../config/logger','api'];(function(_0x205d00,_0x56b8fa){var _0xe9c1f6=function(_0x53d5a8){while(--_0x53d5a8){_0x205d00['push'](_0x205d00['shift']());}};_0xe9c1f6(++_0x56b8fa);}(_0xb091,0x16e));var _0x1b09=function(_0x44eae2,_0x3a7e29){_0x44eae2=_0x44eae2-0x0;var _0x1741ba=_0xb091[_0x44eae2];return _0x1741ba;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var logger=require(_0x1b09('0x1'))(_0x1b09('0x2'));var moment=require(_0x1b09('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b09('0x5'));var attributes=require(_0x1b09('0x6'));module['exports']=function(_0xda8caa,_0x5fa348){return _0xda8caa[_0x1b09('0x7')]('AnalyticMetric',attributes,{'tableName':_0x1b09('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb2ad=['path','../../config/environment','./analyticMetric.attributes','exports','analytics_metrics','util','api','moment','bluebird','request-promise'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x4fe4cf,_0x53fb23){_0x4fe4cf=_0x4fe4cf-0x0;var _0x4c4dfc=_0xb2ad[_0x4fe4cf];return _0x4c4dfc;};'use strict';var _=require('lodash');var util=require(_0xdb2a('0x0'));var logger=require('../../config/logger')(_0xdb2a('0x1'));var moment=require(_0xdb2a('0x2'));var BPromise=require(_0xdb2a('0x3'));var rp=require(_0xdb2a('0x4'));var fs=require('fs');var path=require(_0xdb2a('0x5'));var rimraf=require('rimraf');var config=require(_0xdb2a('0x6'));var attributes=require(_0xdb2a('0x7'));module[_0xdb2a('0x8')]=function(_0x1f9551,_0x5c69b1){return _0x1f9551['define']('AnalyticMetric',attributes,{'tableName':_0xdb2a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 1210650..63be85e 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 _0x95e1=['../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x8b87a,_0x22ffc0){var _0x16ca13=function(_0x3938e5){while(--_0x3938e5){_0x8b87a['push'](_0x8b87a['shift']());}};_0x16ca13(++_0x22ffc0);}(_0x95e1,0x1b4));var _0x195e=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x95e1[_0x5608a3];return _0x1ed50a;};'use strict';var _=require('lodash');var util=require(_0x195e('0x0'));var moment=require(_0x195e('0x1'));var BPromise=require(_0x195e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x195e('0x3'));var db=require(_0x195e('0x4'))['db'];var utils=require(_0x195e('0x5'));var logger=require(_0x195e('0x6'))('rpc');var config=require(_0x195e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x195e('0x8')][_0x195e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb207,_0x3a43b8,_0x14d801){return new BPromise(function(_0x139d24,_0x52fe85){return client[_0x195e('0xa')](_0x5eb207,_0x14d801)[_0x195e('0xb')](function(_0x8d7634){logger[_0x195e('0xc')](_0x195e('0xd'),_0x3a43b8,_0x195e('0xe'));logger[_0x195e('0xf')](_0x195e('0x10'),_0x3a43b8,_0x195e('0xe'),JSON[_0x195e('0x11')](_0x8d7634));if(_0x8d7634[_0x195e('0x12')]){if(_0x8d7634[_0x195e('0x12')][_0x195e('0x13')]===0x1f4){logger['error'](_0x195e('0xd'),_0x3a43b8,_0x8d7634['error'][_0x195e('0x14')]);return _0x52fe85(_0x8d7634[_0x195e('0x12')][_0x195e('0x14')]);}logger[_0x195e('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x3a43b8,_0x8d7634[_0x195e('0x12')][_0x195e('0x14')]);return _0x139d24(_0x8d7634['error'][_0x195e('0x14')]);}else{logger[_0x195e('0xc')](_0x195e('0xd'),_0x3a43b8,'request\x20sent');_0x139d24(_0x8d7634['result']['message']);}})['catch'](function(_0x42ca06){logger[_0x195e('0x12')](_0x195e('0xd'),_0x3a43b8,_0x42ca06);_0x52fe85(_0x42ca06);});});}
\ No newline at end of file
+var _0xf0b0=['../../config/utils','../../config/logger','rpc','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x194f4c,_0x59908d){var _0x42672e=function(_0x37a317){while(--_0x37a317){_0x194f4c['push'](_0x194f4c['shift']());}};_0x42672e(++_0x59908d);}(_0xf0b0,0xcc));var _0x0f0b=function(_0x1501b9,_0x2be13e){_0x1501b9=_0x1501b9-0x0;var _0x2f5cca=_0xf0b0[_0x1501b9];return _0x2f5cca;};'use strict';var _=require('lodash');var util=require(_0x0f0b('0x0'));var moment=require('moment');var BPromise=require(_0x0f0b('0x1'));var rs=require(_0x0f0b('0x2'));var fs=require('fs');var Redis=require(_0x0f0b('0x3'));var db=require(_0x0f0b('0x4'))['db'];var utils=require(_0x0f0b('0x5'));var logger=require(_0x0f0b('0x6'))(_0x0f0b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0f0b('0x8')][_0x0f0b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5431e6,_0x473807,_0x5b2db1){return new BPromise(function(_0x21f834,_0x59c457){return client[_0x0f0b('0xa')](_0x5431e6,_0x5b2db1)[_0x0f0b('0xb')](function(_0x391f5b){logger['info'](_0x0f0b('0xc'),_0x473807,_0x0f0b('0xd'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x473807,_0x0f0b('0xd'),JSON[_0x0f0b('0xe')](_0x391f5b));if(_0x391f5b[_0x0f0b('0xf')]){if(_0x391f5b['error']['code']===0x1f4){logger[_0x0f0b('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x473807,_0x391f5b[_0x0f0b('0xf')][_0x0f0b('0x10')]);return _0x59c457(_0x391f5b[_0x0f0b('0xf')][_0x0f0b('0x10')]);}logger['error'](_0x0f0b('0xc'),_0x473807,_0x391f5b['error'][_0x0f0b('0x10')]);return _0x21f834(_0x391f5b[_0x0f0b('0xf')][_0x0f0b('0x10')]);}else{logger[_0x0f0b('0x11')](_0x0f0b('0xc'),_0x473807,_0x0f0b('0xd'));_0x21f834(_0x391f5b[_0x0f0b('0x12')]['message']);}})['catch'](function(_0x1cf64d){logger[_0x0f0b('0xf')](_0x0f0b('0xc'),_0x473807,_0x1cf64d);_0x59c457(_0x1cf64d);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 8efb0e7..c1b69f2 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 _0xf873=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','path'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0xf873,0xb2));var _0x3f87=function(_0x33cf7a,_0x54fb25){_0x33cf7a=_0x33cf7a-0x0;var _0x405ebf=_0xf873[_0x33cf7a];return _0x405ebf;};'use strict';var multer=require('multer');var util=require(_0x3f87('0x0'));var path=require(_0x3f87('0x1'));var timeout=require(_0x3f87('0x2'));var express=require(_0x3f87('0x3'));var router=express[_0x3f87('0x4')]();var fs_extra=require(_0x3f87('0x5'));var auth=require(_0x3f87('0x6'));var interaction=require(_0x3f87('0x7'));var config=require(_0x3f87('0x8'));var controller=require('./analyticMetric.controller');router[_0x3f87('0x9')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0xb')]);router['get'](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0xd')]);router[_0x3f87('0xe')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0xf')]);router['put'](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x10')]);router[_0x3f87('0x11')](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x12')]);module[_0x3f87('0x13')]=router;
\ No newline at end of file
+var _0x8c46=['index','/:id','show','post','put','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c46,0x171));var _0x68c4=function(_0x235996,_0x370c7f){_0x235996=_0x235996-0x0;var _0x200c7f=_0x8c46[_0x235996];return _0x200c7f;};'use strict';var multer=require(_0x68c4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x68c4('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x68c4('0x2'));var auth=require(_0x68c4('0x3'));var interaction=require(_0x68c4('0x4'));var config=require(_0x68c4('0x5'));var controller=require(_0x68c4('0x6'));router[_0x68c4('0x7')]('/',auth[_0x68c4('0x8')](),controller[_0x68c4('0x9')]);router[_0x68c4('0x7')](_0x68c4('0xa'),auth['isAuthenticated'](),controller[_0x68c4('0xb')]);router[_0x68c4('0xc')]('/',auth[_0x68c4('0x8')](),controller['create']);router[_0x68c4('0xd')](_0x68c4('0xa'),auth[_0x68c4('0x8')](),controller['update']);router['delete'](_0x68c4('0xa'),auth[_0x68c4('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 15f7d9f..3a505e5 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 _0xb81d=['TEXT','sequelize'];(function(_0x30e24a,_0x3216e9){var _0x5970e0=function(_0x549186){while(--_0x549186){_0x30e24a['push'](_0x30e24a['shift']());}};_0x5970e0(++_0x3216e9);}(_0xb81d,0x73));var _0xdb81=function(_0x54b086,_0x38e566){_0x54b086=_0x54b086-0x0;var _0x1ad08b=_0xb81d[_0x54b086];return _0x1ad08b;};'use strict';var Sequelize=require(_0xdb81('0x0'));module['exports']={'tree':{'type':Sequelize[_0xdb81('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xcf34=['sequelize','TEXT'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xcf34,0x7c));var _0x4cf3=function(_0x142020,_0x1f7233){_0x142020=_0x142020-0x0;var _0x40da8f=_0xcf34[_0x142020];return _0x40da8f;};'use strict';var Sequelize=require(_0x4cf3('0x0'));module['exports']={'tree':{'type':Sequelize[_0x4cf3('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 5b129ab..bfa1c5b 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 _0x417e=['merge','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','update','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x417e,0x121));var _0xe417=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0x417e[_0x2ef44b];return _0x2405b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe417('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe417('0x1'));var rp=require('request-promise');var moment=require(_0xe417('0x2'));var BPromise=require(_0xe417('0x3'));var Mustache=require(_0xe417('0x4'));var util=require('util');var path=require(_0xe417('0x5'));var sox=require(_0xe417('0x6'));var csv=require(_0xe417('0x7'));var ejs=require(_0xe417('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe417('0x9'));var squel=require(_0xe417('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe417('0x7'));var querystring=require(_0xe417('0xb'));var Papa=require(_0xe417('0xc'));var Redis=require(_0xe417('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe417('0xe'))(_0xe417('0xf'));var utils=require('../../config/utils');var config=require(_0xe417('0x10'));var licenseUtil=require(_0xe417('0x11'));var db=require(_0xe417('0x12'))['db'];function respondWithStatusCode(_0x4cd1f3,_0x5021ad){_0x5021ad=_0x5021ad||0xcc;return function(_0x56a0a5){if(_0x56a0a5){return _0x4cd1f3[_0xe417('0x13')](_0x5021ad);}return _0x4cd1f3[_0xe417('0x14')](_0x5021ad)[_0xe417('0x15')]();};}function respondWithResult(_0x1f0322,_0x3e6bdc){_0x3e6bdc=_0x3e6bdc||0xc8;return function(_0x1c6fb3){if(_0x1c6fb3){return _0x1f0322['status'](_0x3e6bdc)['json'](_0x1c6fb3);}};}function respondWithFilteredResult(_0x3b7e79,_0x281e05){return function(_0x16f38a){if(_0x16f38a){var _0x154bd8=typeof _0x281e05[_0xe417('0x16')]==='undefined'&&typeof _0x281e05[_0xe417('0x17')]===_0xe417('0x18');var _0x4256ea=_0x16f38a[_0xe417('0x19')];var _0x3de4a2=_0x154bd8?0x0:_0x281e05[_0xe417('0x16')];var _0x1a0d65=_0x154bd8?_0x16f38a[_0xe417('0x19')]:_0x281e05[_0xe417('0x16')]+_0x281e05[_0xe417('0x17')];var _0xb42fee;if(_0x1a0d65>=_0x4256ea){_0x1a0d65=_0x4256ea;_0xb42fee=0xc8;}else{_0xb42fee=0xce;}_0x3b7e79[_0xe417('0x14')](_0xb42fee);return _0x3b7e79[_0xe417('0x1a')](_0xe417('0x1b'),_0x3de4a2+'-'+_0x1a0d65+'/'+_0x4256ea)[_0xe417('0x1c')](_0x16f38a);}return null;};}function patchUpdates(_0x3a20c9){return function(_0x55e4d2){try{jsonpatch[_0xe417('0x1d')](_0x55e4d2,_0x3a20c9,!![]);}catch(_0x9dbff3){return BPromise[_0xe417('0x1e')](_0x9dbff3);}return _0x55e4d2['save']();};}function saveUpdates(_0x4c2efd,_0x3ac4a1){return function(_0x5ef3db){if(_0x5ef3db){return _0x5ef3db['update'](_0x4c2efd)[_0xe417('0x1f')](function(_0x4e5d30){return _0x4e5d30;});}return null;};}function removeEntity(_0x2a2889,_0x110d0e){return function(_0x1a977c){if(_0x1a977c){return _0x1a977c[_0xe417('0x20')]()[_0xe417('0x1f')](function(){_0x2a2889['status'](0xcc)[_0xe417('0x15')]();});}};}function handleEntityNotFound(_0x18a997,_0x30d058){return function(_0x441b03){if(!_0x441b03){_0x18a997['sendStatus'](0x194);}return _0x441b03;};}function handleError(_0x474dc9,_0x206e2a){_0x206e2a=_0x206e2a||0x1f4;return function(_0x38d48f){logger[_0xe417('0x21')](_0x38d48f[_0xe417('0x22')]);if(_0x38d48f[_0xe417('0x23')]){delete _0x38d48f[_0xe417('0x23')];}_0x474dc9['status'](_0x206e2a)['send'](_0x38d48f);};}exports[_0xe417('0x24')]=function(_0x552362,_0x18a090){var _0x4d8f9e={},_0xb61128={},_0x43648e={'count':0x0,'rows':[]};var _0x37bb14=_[_0xe417('0x25')](db[_0xe417('0x26')][_0xe417('0x27')],function(_0x8bb263){return{'name':_0x8bb263[_0xe417('0x28')],'type':_0x8bb263[_0xe417('0x29')]['key']};});_0xb61128[_0xe417('0x2a')]=_[_0xe417('0x25')](_0x37bb14,_0xe417('0x23'));_0xb61128[_0xe417('0x2b')]=_['keys'](_0x552362['query']);_0xb61128['filters']=_['intersection'](_0xb61128[_0xe417('0x2a')],_0xb61128[_0xe417('0x2b')]);_0x4d8f9e[_0xe417('0x2c')]=_[_0xe417('0x2d')](_0xb61128[_0xe417('0x2a')],qs['fields'](_0x552362['query'][_0xe417('0x2e')]));_0x4d8f9e[_0xe417('0x2c')]=_0x4d8f9e[_0xe417('0x2c')][_0xe417('0x2f')]?_0x4d8f9e[_0xe417('0x2c')]:_0xb61128[_0xe417('0x2a')];if(!_0x552362[_0xe417('0x2b')][_0xe417('0x30')](_0xe417('0x31'))){_0x4d8f9e['limit']=qs[_0xe417('0x17')](_0x552362[_0xe417('0x2b')][_0xe417('0x17')]);_0x4d8f9e[_0xe417('0x16')]=qs[_0xe417('0x16')](_0x552362['query'][_0xe417('0x16')]);}_0x4d8f9e[_0xe417('0x32')]=qs['sort'](_0x552362[_0xe417('0x2b')][_0xe417('0x33')]);_0x4d8f9e[_0xe417('0x34')]=qs[_0xe417('0x35')](_[_0xe417('0x36')](_0x552362[_0xe417('0x2b')],_0xb61128[_0xe417('0x35')]),_0x37bb14);if(_0x552362['query'][_0xe417('0x37')]){_0x4d8f9e['where']=_[_0xe417('0x38')](_0x4d8f9e[_0xe417('0x34')],{'$or':_[_0xe417('0x25')](_0x37bb14,function(_0xb7725){if(_0xb7725['type']!=='VIRTUAL'){var _0x3390d3={};_0x3390d3[_0xb7725[_0xe417('0x23')]]={'$like':'%'+_0x552362[_0xe417('0x2b')][_0xe417('0x37')]+'%'};return _0x3390d3;}})});}_0x4d8f9e=_[_0xe417('0x38')]({},_0x4d8f9e,_0x552362[_0xe417('0x39')]);var _0x3c34ca={'where':_0x4d8f9e[_0xe417('0x34')]};return db[_0xe417('0x26')][_0xe417('0x19')](_0x3c34ca)[_0xe417('0x1f')](function(_0x118539){_0x43648e[_0xe417('0x19')]=_0x118539;if(_0x552362['query'][_0xe417('0x3a')]){_0x4d8f9e[_0xe417('0x3b')]=[{'all':!![]}];}return db[_0xe417('0x26')][_0xe417('0x3c')](_0x4d8f9e);})[_0xe417('0x1f')](function(_0x2de6db){_0x43648e[_0xe417('0x3d')]=_0x2de6db;return _0x43648e;})['then'](respondWithFilteredResult(_0x18a090,_0x4d8f9e))['catch'](handleError(_0x18a090,null));};exports['show']=function(_0x3c65f2,_0x3f01e9){var _0x49b0ee={'raw':!![],'where':{'id':_0x3c65f2[_0xe417('0x3e')]['id']}},_0x390a3d={};_0x390a3d[_0xe417('0x2a')]=_['keys'](db[_0xe417('0x26')][_0xe417('0x27')]);_0x390a3d[_0xe417('0x2b')]=_[_0xe417('0x3f')](_0x3c65f2['query']);_0x390a3d['filters']=_['intersection'](_0x390a3d['model'],_0x390a3d['query']);_0x49b0ee[_0xe417('0x2c')]=_[_0xe417('0x2d')](_0x390a3d[_0xe417('0x2a')],qs[_0xe417('0x2e')](_0x3c65f2['query'][_0xe417('0x2e')]));_0x49b0ee[_0xe417('0x2c')]=_0x49b0ee[_0xe417('0x2c')][_0xe417('0x2f')]?_0x49b0ee[_0xe417('0x2c')]:_0x390a3d[_0xe417('0x2a')];if(_0x3c65f2['query']['includeAll']){_0x49b0ee[_0xe417('0x3b')]=[{'all':!![]}];}_0x49b0ee=_['merge']({},_0x49b0ee,_0x3c65f2[_0xe417('0x39')]);return db[_0xe417('0x26')][_0xe417('0x40')](_0x49b0ee)[_0xe417('0x1f')](handleEntityNotFound(_0x3f01e9,null))['then'](respondWithResult(_0x3f01e9,null))[_0xe417('0x41')](handleError(_0x3f01e9,null));};exports[_0xe417('0x42')]=function(_0x35a8b8,_0x42145f){return db['AnalyticTreeReport'][_0xe417('0x42')](_0x35a8b8[_0xe417('0x43')],{})[_0xe417('0x1f')](respondWithResult(_0x42145f,0xc9))[_0xe417('0x41')](handleError(_0x42145f,null));};exports[_0xe417('0x44')]=function(_0x3f7611,_0x55195a){if(_0x3f7611[_0xe417('0x43')]['id']){delete _0x3f7611[_0xe417('0x43')]['id'];}return db['AnalyticTreeReport'][_0xe417('0x40')]({'where':{'id':_0x3f7611[_0xe417('0x3e')]['id']}})['then'](handleEntityNotFound(_0x55195a,null))[_0xe417('0x1f')](saveUpdates(_0x3f7611['body'],null))[_0xe417('0x1f')](respondWithResult(_0x55195a,null))[_0xe417('0x41')](handleError(_0x55195a,null));};exports[_0xe417('0x20')]=function(_0x49228d,_0x15422f){return db[_0xe417('0x26')]['find']({'where':{'id':_0x49228d[_0xe417('0x3e')]['id']}})['then'](handleEntityNotFound(_0x15422f,null))[_0xe417('0x1f')](removeEntity(_0x15422f,null))['catch'](handleError(_0x15422f,null));};
\ No newline at end of file
+var _0xc36e=['then','destroy','sendStatus','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','intersection','length','find','catch','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','set','Content-Range','apply','reject'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc36e,0x122));var _0xec36=function(_0x39bc9a,_0xde9de8){_0x39bc9a=_0x39bc9a-0x0;var _0x65088d=_0xc36e[_0x39bc9a];return _0x65088d;};'use strict';var emlformat=require(_0xec36('0x0'));var rimraf=require(_0xec36('0x1'));var zipdir=require(_0xec36('0x2'));var jsonpatch=require(_0xec36('0x3'));var rp=require(_0xec36('0x4'));var moment=require(_0xec36('0x5'));var BPromise=require(_0xec36('0x6'));var Mustache=require(_0xec36('0x7'));var util=require(_0xec36('0x8'));var path=require(_0xec36('0x9'));var sox=require(_0xec36('0xa'));var csv=require(_0xec36('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec36('0xc'));var squel=require(_0xec36('0xd'));var crypto=require(_0xec36('0xe'));var jsforce=require(_0xec36('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xec36('0x10'));var Papa=require(_0xec36('0x11'));var Redis=require(_0xec36('0x12'));var authService=require(_0xec36('0x13'));var qs=require(_0xec36('0x14'));var as=require(_0xec36('0x15'));var hardwareService=require(_0xec36('0x16'));var logger=require('../../config/logger')(_0xec36('0x17'));var utils=require(_0xec36('0x18'));var config=require(_0xec36('0x19'));var licenseUtil=require(_0xec36('0x1a'));var db=require(_0xec36('0x1b'))['db'];function respondWithStatusCode(_0x387a34,_0x36ce0b){_0x36ce0b=_0x36ce0b||0xcc;return function(_0x418c59){if(_0x418c59){return _0x387a34['sendStatus'](_0x36ce0b);}return _0x387a34['status'](_0x36ce0b)[_0xec36('0x1c')]();};}function respondWithResult(_0x132f34,_0x2e7b50){_0x2e7b50=_0x2e7b50||0xc8;return function(_0x5ad06a){if(_0x5ad06a){return _0x132f34[_0xec36('0x1d')](_0x2e7b50)[_0xec36('0x1e')](_0x5ad06a);}};}function respondWithFilteredResult(_0x22a299,_0x1af60a){return function(_0x1ad549){if(_0x1ad549){var _0x1aac68=typeof _0x1af60a[_0xec36('0x1f')]===_0xec36('0x20')&&typeof _0x1af60a['limit']===_0xec36('0x20');var _0x331811=_0x1ad549[_0xec36('0x21')];var _0xc4920=_0x1aac68?0x0:_0x1af60a['offset'];var _0x24146d=_0x1aac68?_0x1ad549[_0xec36('0x21')]:_0x1af60a[_0xec36('0x1f')]+_0x1af60a['limit'];var _0x557adb;if(_0x24146d>=_0x331811){_0x24146d=_0x331811;_0x557adb=0xc8;}else{_0x557adb=0xce;}_0x22a299[_0xec36('0x1d')](_0x557adb);return _0x22a299[_0xec36('0x22')](_0xec36('0x23'),_0xc4920+'-'+_0x24146d+'/'+_0x331811)['json'](_0x1ad549);}return null;};}function patchUpdates(_0x107bd7){return function(_0x1f8548){try{jsonpatch[_0xec36('0x24')](_0x1f8548,_0x107bd7,!![]);}catch(_0x2cf444){return BPromise[_0xec36('0x25')](_0x2cf444);}return _0x1f8548['save']();};}function saveUpdates(_0x14fa7a,_0x26ecaf){return function(_0x554eb8){if(_0x554eb8){return _0x554eb8['update'](_0x14fa7a)[_0xec36('0x26')](function(_0x33db54){return _0x33db54;});}return null;};}function removeEntity(_0xdb7c19,_0x55c9c4){return function(_0x53086c){if(_0x53086c){return _0x53086c[_0xec36('0x27')]()[_0xec36('0x26')](function(){_0xdb7c19[_0xec36('0x1d')](0xcc)[_0xec36('0x1c')]();});}};}function handleEntityNotFound(_0xef19a2,_0x46f41d){return function(_0x187fed){if(!_0x187fed){_0xef19a2[_0xec36('0x28')](0x194);}return _0x187fed;};}function handleError(_0xda3a3c,_0x4c6947){_0x4c6947=_0x4c6947||0x1f4;return function(_0x4c226e){logger[_0xec36('0x29')](_0x4c226e[_0xec36('0x2a')]);if(_0x4c226e[_0xec36('0x2b')]){delete _0x4c226e['name'];}_0xda3a3c['status'](_0x4c6947)[_0xec36('0x2c')](_0x4c226e);};}exports[_0xec36('0x2d')]=function(_0x274224,_0x1fa3c3){var _0x19a882={},_0x424caa={},_0x31cc86={'count':0x0,'rows':[]};var _0x5039e0=_['map'](db[_0xec36('0x2e')][_0xec36('0x2f')],function(_0x42be9d){return{'name':_0x42be9d[_0xec36('0x30')],'type':_0x42be9d[_0xec36('0x31')][_0xec36('0x32')]};});_0x424caa[_0xec36('0x33')]=_[_0xec36('0x34')](_0x5039e0,_0xec36('0x2b'));_0x424caa[_0xec36('0x35')]=_['keys'](_0x274224['query']);_0x424caa[_0xec36('0x36')]=_['intersection'](_0x424caa['model'],_0x424caa[_0xec36('0x35')]);_0x19a882[_0xec36('0x37')]=_['intersection'](_0x424caa[_0xec36('0x33')],qs[_0xec36('0x38')](_0x274224[_0xec36('0x35')]['fields']));_0x19a882[_0xec36('0x37')]=_0x19a882[_0xec36('0x37')]['length']?_0x19a882[_0xec36('0x37')]:_0x424caa[_0xec36('0x33')];if(!_0x274224[_0xec36('0x35')][_0xec36('0x39')](_0xec36('0x3a'))){_0x19a882[_0xec36('0x3b')]=qs[_0xec36('0x3b')](_0x274224[_0xec36('0x35')][_0xec36('0x3b')]);_0x19a882[_0xec36('0x1f')]=qs[_0xec36('0x1f')](_0x274224['query'][_0xec36('0x1f')]);}_0x19a882[_0xec36('0x3c')]=qs[_0xec36('0x3d')](_0x274224[_0xec36('0x35')][_0xec36('0x3d')]);_0x19a882[_0xec36('0x3e')]=qs[_0xec36('0x36')](_[_0xec36('0x3f')](_0x274224[_0xec36('0x35')],_0x424caa['filters']),_0x5039e0);if(_0x274224[_0xec36('0x35')][_0xec36('0x40')]){_0x19a882[_0xec36('0x3e')]=_[_0xec36('0x41')](_0x19a882['where'],{'$or':_['map'](_0x5039e0,function(_0x22adfd){if(_0x22adfd[_0xec36('0x31')]!==_0xec36('0x42')){var _0x8b9be={};_0x8b9be[_0x22adfd[_0xec36('0x2b')]]={'$like':'%'+_0x274224[_0xec36('0x35')]['filter']+'%'};return _0x8b9be;}})});}_0x19a882=_[_0xec36('0x41')]({},_0x19a882,_0x274224[_0xec36('0x43')]);var _0x46e6c1={'where':_0x19a882['where']};return db[_0xec36('0x2e')][_0xec36('0x21')](_0x46e6c1)['then'](function(_0x444c65){_0x31cc86[_0xec36('0x21')]=_0x444c65;if(_0x274224[_0xec36('0x35')][_0xec36('0x44')]){_0x19a882[_0xec36('0x45')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xec36('0x46')](_0x19a882);})[_0xec36('0x26')](function(_0xa3feca){_0x31cc86[_0xec36('0x47')]=_0xa3feca;return _0x31cc86;})['then'](respondWithFilteredResult(_0x1fa3c3,_0x19a882))['catch'](handleError(_0x1fa3c3,null));};exports[_0xec36('0x48')]=function(_0xcb015,_0x4caad7){var _0x2c74af={'raw':!![],'where':{'id':_0xcb015['params']['id']}},_0x19e417={};_0x19e417[_0xec36('0x33')]=_[_0xec36('0x49')](db[_0xec36('0x2e')][_0xec36('0x2f')]);_0x19e417[_0xec36('0x35')]=_[_0xec36('0x49')](_0xcb015[_0xec36('0x35')]);_0x19e417['filters']=_[_0xec36('0x4a')](_0x19e417[_0xec36('0x33')],_0x19e417[_0xec36('0x35')]);_0x2c74af['attributes']=_[_0xec36('0x4a')](_0x19e417['model'],qs[_0xec36('0x38')](_0xcb015[_0xec36('0x35')][_0xec36('0x38')]));_0x2c74af[_0xec36('0x37')]=_0x2c74af[_0xec36('0x37')][_0xec36('0x4b')]?_0x2c74af[_0xec36('0x37')]:_0x19e417[_0xec36('0x33')];if(_0xcb015['query'][_0xec36('0x44')]){_0x2c74af[_0xec36('0x45')]=[{'all':!![]}];}_0x2c74af=_[_0xec36('0x41')]({},_0x2c74af,_0xcb015[_0xec36('0x43')]);return db[_0xec36('0x2e')][_0xec36('0x4c')](_0x2c74af)[_0xec36('0x26')](handleEntityNotFound(_0x4caad7,null))[_0xec36('0x26')](respondWithResult(_0x4caad7,null))[_0xec36('0x4d')](handleError(_0x4caad7,null));};exports[_0xec36('0x4e')]=function(_0x256f3c,_0x32ce13){return db['AnalyticTreeReport'][_0xec36('0x4e')](_0x256f3c['body'],{})[_0xec36('0x26')](respondWithResult(_0x32ce13,0xc9))['catch'](handleError(_0x32ce13,null));};exports[_0xec36('0x4f')]=function(_0x26e234,_0x4bd048){if(_0x26e234[_0xec36('0x50')]['id']){delete _0x26e234[_0xec36('0x50')]['id'];}return db[_0xec36('0x2e')][_0xec36('0x4c')]({'where':{'id':_0x26e234['params']['id']}})[_0xec36('0x26')](handleEntityNotFound(_0x4bd048,null))[_0xec36('0x26')](saveUpdates(_0x26e234[_0xec36('0x50')],null))[_0xec36('0x26')](respondWithResult(_0x4bd048,null))[_0xec36('0x4d')](handleError(_0x4bd048,null));};exports[_0xec36('0x27')]=function(_0x44af5f,_0x3af236){return db[_0xec36('0x2e')][_0xec36('0x4c')]({'where':{'id':_0x44af5f[_0xec36('0x51')]['id']}})[_0xec36('0x26')](handleEntityNotFound(_0x3af236,null))['then'](removeEntity(_0x3af236,null))[_0xec36('0x4d')](handleError(_0x3af236,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 0236f6c..33d408a 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 _0xe8d5=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe8d5,0x103));var _0x5e8d=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xe8d5[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x5e8d('0x0'));var util=require(_0x5e8d('0x1'));var logger=require(_0x5e8d('0x2'))(_0x5e8d('0x3'));var moment=require('moment');var BPromise=require(_0x5e8d('0x4'));var rp=require(_0x5e8d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e8d('0x6'));var config=require(_0x5e8d('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0x5e8d('0x8')]=function(_0x2f48fb,_0x1d252a){return _0x2f48fb[_0x5e8d('0x9')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa79d=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','lodash'];(function(_0x590db6,_0x15b718){var _0x54d30c=function(_0x38d280){while(--_0x38d280){_0x590db6['push'](_0x590db6['shift']());}};_0x54d30c(++_0x15b718);}(_0xa79d,0x13e));var _0xda79=function(_0x451f7c,_0x189e08){_0x451f7c=_0x451f7c-0x0;var _0x2eaab7=_0xa79d[_0x451f7c];return _0x2eaab7;};'use strict';var _=require(_0xda79('0x0'));var util=require(_0xda79('0x1'));var logger=require('../../config/logger')(_0xda79('0x2'));var moment=require(_0xda79('0x3'));var BPromise=require(_0xda79('0x4'));var rp=require(_0xda79('0x5'));var fs=require('fs');var path=require(_0xda79('0x6'));var rimraf=require(_0xda79('0x7'));var config=require(_0xda79('0x8'));var attributes=require(_0xda79('0x9'));module[_0xda79('0xa')]=function(_0x8c3e71,_0x265893){return _0x8c3e71['define']('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 7f05eee..70c272b 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2c0961,_0x498c9f){var _0x39996e=function(_0x142532){while(--_0x142532){_0x2c0961['push'](_0x2c0961['shift']());}};_0x39996e(++_0x498c9f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1611f8,_0x2d2178){_0x1611f8=_0x1611f8-0x0;var _0x54ba82=_0x5f2f[_0x1611f8];return _0x54ba82;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _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(_0x3072ee,_0x40b136){var _0x47041d=function(_0x47c8ee){while(--_0x47c8ee){_0x3072ee['push'](_0x3072ee['shift']());}};_0x47041d(++_0x40b136);}(_0x2ef3,0xba));var _0x32ef=function(_0x3e6e29,_0x25af27){_0x3e6e29=_0x3e6e29-0x0;var _0x95ff65=_0x2ef3[_0x3e6e29];return _0x95ff65;};'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 aa70928..7f201ac 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 _0xb8d5=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x33ac0c,_0x2d7d3c){var _0x564ac9=function(_0x4e9de4){while(--_0x4e9de4){_0x33ac0c['push'](_0x33ac0c['shift']());}};_0x564ac9(++_0x2d7d3c);}(_0xb8d5,0x67));var _0x5b8d=function(_0x294557,_0xc4dd63){_0x294557=_0x294557-0x0;var _0xf41961=_0xb8d5[_0x294557];return _0xf41961;};'use strict';var multer=require(_0x5b8d('0x0'));var util=require(_0x5b8d('0x1'));var path=require(_0x5b8d('0x2'));var timeout=require(_0x5b8d('0x3'));var express=require(_0x5b8d('0x4'));var router=express[_0x5b8d('0x5')]();var fs_extra=require(_0x5b8d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5b8d('0x7'));var config=require('../../config/environment');var controller=require(_0x5b8d('0x8'));router[_0x5b8d('0x9')]('/',auth[_0x5b8d('0xa')](),controller[_0x5b8d('0xb')]);router['get'](_0x5b8d('0xc'),auth[_0x5b8d('0xa')](),controller[_0x5b8d('0xd')]);router[_0x5b8d('0xe')]('/',auth[_0x5b8d('0xa')](),controller[_0x5b8d('0xf')]);router[_0x5b8d('0x10')](_0x5b8d('0xc'),auth[_0x5b8d('0xa')](),controller[_0x5b8d('0x11')]);router[_0x5b8d('0x12')](_0x5b8d('0xc'),auth[_0x5b8d('0xa')](),controller[_0x5b8d('0x13')]);module[_0x5b8d('0x14')]=router;
\ No newline at end of file
+var _0xc703=['update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','put'];(function(_0x5712f8,_0x17156b){var _0x14a364=function(_0x1da9de){while(--_0x1da9de){_0x5712f8['push'](_0x5712f8['shift']());}};_0x14a364(++_0x17156b);}(_0xc703,0x10f));var _0x3c70=function(_0x188d31,_0x576e87){_0x188d31=_0x188d31-0x0;var _0x30ed33=_0xc703[_0x188d31];return _0x30ed33;};'use strict';var multer=require(_0x3c70('0x0'));var util=require('util');var path=require(_0x3c70('0x1'));var timeout=require(_0x3c70('0x2'));var express=require(_0x3c70('0x3'));var router=express[_0x3c70('0x4')]();var fs_extra=require(_0x3c70('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3c70('0x6'));var config=require(_0x3c70('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x3c70('0x8')]('/',auth['isAuthenticated'](),controller[_0x3c70('0x9')]);router[_0x3c70('0x8')]('/:id',auth[_0x3c70('0xa')](),controller[_0x3c70('0xb')]);router[_0x3c70('0xc')]('/',auth[_0x3c70('0xa')](),controller['create']);router[_0x3c70('0xd')]('/:id',auth[_0x3c70('0xa')](),controller[_0x3c70('0xe')]);router[_0x3c70('0xf')](_0x3c70('0x10'),auth[_0x3c70('0xa')](),controller[_0x3c70('0x11')]);module[_0x3c70('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index b2dfb64..24e2e45 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 _0x0ba7=['STRING','sequelize'];(function(_0x9a743c,_0x2e597a){var _0x114a7b=function(_0x1c6867){while(--_0x1c6867){_0x9a743c['push'](_0x9a743c['shift']());}};_0x114a7b(++_0x2e597a);}(_0x0ba7,0x16d));var _0x70ba=function(_0x551cc9,_0x254d15){_0x551cc9=_0x551cc9-0x0;var _0x39bad1=_0x0ba7[_0x551cc9];return _0x39bad1;};'use strict';var Sequelize=require(_0x70ba('0x0'));module['exports']={'name':{'type':Sequelize[_0x70ba('0x1')]},'basename':{'type':Sequelize[_0x70ba('0x1')]},'type':{'type':Sequelize[_0x70ba('0x1')]}};
\ No newline at end of file
+var _0xdace=['STRING','sequelize'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xdace,0xc5));var _0xedac=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xdace[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'name':{'type':Sequelize[_0xedac('0x1')]},'basename':{'type':Sequelize[_0xedac('0x1')]},'type':{'type':Sequelize[_0xedac('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 2566819..8691b08 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 _0x4662=['create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','index','map','rawAttributes','type','key','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','Attachment','include','findAll','rows','catch','params','keys','includeAll','find','clone','get','omit','updatedAt','body','createdAt'];(function(_0x20cf8a,_0x44cd6b){var _0x54e165=function(_0xcce1d0){while(--_0xcce1d0){_0x20cf8a['push'](_0x20cf8a['shift']());}};_0x54e165(++_0x44cd6b);}(_0x4662,0x1d4));var _0x2466=function(_0x504a19,_0x4735bc){_0x504a19=_0x504a19-0x0;var _0x4bd704=_0x4662[_0x504a19];return _0x4bd704;};'use strict';var emlformat=require(_0x2466('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2466('0x1'));var jsonpatch=require(_0x2466('0x2'));var rp=require(_0x2466('0x3'));var moment=require('moment');var BPromise=require(_0x2466('0x4'));var Mustache=require(_0x2466('0x5'));var util=require('util');var path=require(_0x2466('0x6'));var sox=require(_0x2466('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2466('0x8'));var _=require('lodash');var squel=require(_0x2466('0x9'));var crypto=require(_0x2466('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2466('0xb'));var toCsv=require(_0x2466('0xc'));var querystring=require(_0x2466('0xd'));var Papa=require(_0x2466('0xe'));var Redis=require(_0x2466('0xf'));var authService=require(_0x2466('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2466('0x11'));var hardwareService=require(_0x2466('0x12'));var logger=require(_0x2466('0x13'))(_0x2466('0x14'));var utils=require('../../config/utils');var config=require(_0x2466('0x15'));var licenseUtil=require(_0x2466('0x16'));var db=require(_0x2466('0x17'))['db'];function respondWithStatusCode(_0x1baca6,_0x160a9b){_0x160a9b=_0x160a9b||0xcc;return function(_0x3b55b0){if(_0x3b55b0){return _0x1baca6[_0x2466('0x18')](_0x160a9b);}return _0x1baca6[_0x2466('0x19')](_0x160a9b)[_0x2466('0x1a')]();};}function respondWithResult(_0x51989b,_0x5114ed){_0x5114ed=_0x5114ed||0xc8;return function(_0x15a7ab){if(_0x15a7ab){return _0x51989b[_0x2466('0x19')](_0x5114ed)[_0x2466('0x1b')](_0x15a7ab);}};}function respondWithFilteredResult(_0x11619c,_0x5a8d93){return function(_0x2a9e41){if(_0x2a9e41){var _0x17cc93=typeof _0x5a8d93[_0x2466('0x1c')]===_0x2466('0x1d')&&typeof _0x5a8d93[_0x2466('0x1e')]===_0x2466('0x1d');var _0x197dd4=_0x2a9e41[_0x2466('0x1f')];var _0x159b7a=_0x17cc93?0x0:_0x5a8d93[_0x2466('0x1c')];var _0x2c235a=_0x17cc93?_0x2a9e41[_0x2466('0x1f')]:_0x5a8d93[_0x2466('0x1c')]+_0x5a8d93[_0x2466('0x1e')];var _0x4fb4de;if(_0x2c235a>=_0x197dd4){_0x2c235a=_0x197dd4;_0x4fb4de=0xc8;}else{_0x4fb4de=0xce;}_0x11619c['status'](_0x4fb4de);return _0x11619c[_0x2466('0x20')](_0x2466('0x21'),_0x159b7a+'-'+_0x2c235a+'/'+_0x197dd4)[_0x2466('0x1b')](_0x2a9e41);}return null;};}function patchUpdates(_0x391548){return function(_0x284b8e){try{jsonpatch[_0x2466('0x22')](_0x284b8e,_0x391548,!![]);}catch(_0x34e09f){return BPromise['reject'](_0x34e09f);}return _0x284b8e[_0x2466('0x23')]();};}function saveUpdates(_0x58ed0d,_0x1a7459){return function(_0x4a2538){if(_0x4a2538){return _0x4a2538[_0x2466('0x24')](_0x58ed0d)[_0x2466('0x25')](function(_0x331ff4){return _0x331ff4;});}return null;};}function removeEntity(_0x380e54,_0x220810){return function(_0x3673d1){if(_0x3673d1){return _0x3673d1['destroy']()[_0x2466('0x25')](function(){_0x380e54[_0x2466('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x599057,_0x5a5694){return function(_0xb5ea23){if(!_0xb5ea23){_0x599057[_0x2466('0x18')](0x194);}return _0xb5ea23;};}function handleError(_0x4e9085,_0x193d25){_0x193d25=_0x193d25||0x1f4;return function(_0x34c4d8){logger[_0x2466('0x26')](_0x34c4d8[_0x2466('0x27')]);if(_0x34c4d8[_0x2466('0x28')]){delete _0x34c4d8['name'];}_0x4e9085[_0x2466('0x19')](_0x193d25)['send'](_0x34c4d8);};}exports[_0x2466('0x29')]=function(_0x535dae,_0x5fd07){var _0x5b11eb={},_0x4972d9={},_0x11bbf6={'count':0x0,'rows':[]};var _0x2437a1=_[_0x2466('0x2a')](db['Attachment'][_0x2466('0x2b')],function(_0x4d2cae){return{'name':_0x4d2cae['fieldName'],'type':_0x4d2cae[_0x2466('0x2c')][_0x2466('0x2d')]};});_0x4972d9['model']=_[_0x2466('0x2a')](_0x2437a1,_0x2466('0x28'));_0x4972d9['query']=_['keys'](_0x535dae[_0x2466('0x2e')]);_0x4972d9[_0x2466('0x2f')]=_[_0x2466('0x30')](_0x4972d9[_0x2466('0x31')],_0x4972d9[_0x2466('0x2e')]);_0x5b11eb['attributes']=_[_0x2466('0x30')](_0x4972d9[_0x2466('0x31')],qs[_0x2466('0x32')](_0x535dae[_0x2466('0x2e')][_0x2466('0x32')]));_0x5b11eb['attributes']=_0x5b11eb['attributes'][_0x2466('0x33')]?_0x5b11eb[_0x2466('0x34')]:_0x4972d9[_0x2466('0x31')];if(!_0x535dae['query'][_0x2466('0x35')](_0x2466('0x36'))){_0x5b11eb[_0x2466('0x1e')]=qs[_0x2466('0x1e')](_0x535dae['query']['limit']);_0x5b11eb[_0x2466('0x1c')]=qs[_0x2466('0x1c')](_0x535dae[_0x2466('0x2e')][_0x2466('0x1c')]);}_0x5b11eb[_0x2466('0x37')]=qs['sort'](_0x535dae['query'][_0x2466('0x38')]);_0x5b11eb[_0x2466('0x39')]=qs[_0x2466('0x2f')](_[_0x2466('0x3a')](_0x535dae[_0x2466('0x2e')],_0x4972d9[_0x2466('0x2f')]),_0x2437a1);if(_0x535dae['query'][_0x2466('0x3b')]){_0x5b11eb[_0x2466('0x39')]=_['merge'](_0x5b11eb[_0x2466('0x39')],{'$or':_[_0x2466('0x2a')](_0x2437a1,function(_0x3a30f1){if(_0x3a30f1[_0x2466('0x2c')]!==_0x2466('0x3c')){var _0x2754e9={};_0x2754e9[_0x3a30f1['name']]={'$like':'%'+_0x535dae[_0x2466('0x2e')][_0x2466('0x3b')]+'%'};return _0x2754e9;}})});}_0x5b11eb=_[_0x2466('0x3d')]({},_0x5b11eb,_0x535dae[_0x2466('0x3e')]);var _0x3c2e62={'where':_0x5b11eb[_0x2466('0x39')]};return db[_0x2466('0x3f')][_0x2466('0x1f')](_0x3c2e62)[_0x2466('0x25')](function(_0x5ecba4){_0x11bbf6[_0x2466('0x1f')]=_0x5ecba4;if(_0x535dae['query']['includeAll']){_0x5b11eb[_0x2466('0x40')]=[{'all':!![]}];}return db[_0x2466('0x3f')][_0x2466('0x41')](_0x5b11eb);})[_0x2466('0x25')](function(_0x142238){_0x11bbf6[_0x2466('0x42')]=_0x142238;return _0x11bbf6;})[_0x2466('0x25')](respondWithFilteredResult(_0x5fd07,_0x5b11eb))[_0x2466('0x43')](handleError(_0x5fd07,null));};exports['show']=function(_0x146ec2,_0x164f22){var _0x29b730={'raw':!![],'where':{'id':_0x146ec2[_0x2466('0x44')]['id']}},_0x4f5bf3={};_0x4f5bf3['model']=_[_0x2466('0x45')](db[_0x2466('0x3f')]['rawAttributes']);_0x4f5bf3[_0x2466('0x2e')]=_[_0x2466('0x45')](_0x146ec2[_0x2466('0x2e')]);_0x4f5bf3[_0x2466('0x2f')]=_[_0x2466('0x30')](_0x4f5bf3[_0x2466('0x31')],_0x4f5bf3['query']);_0x29b730[_0x2466('0x34')]=_[_0x2466('0x30')](_0x4f5bf3[_0x2466('0x31')],qs[_0x2466('0x32')](_0x146ec2[_0x2466('0x2e')][_0x2466('0x32')]));_0x29b730['attributes']=_0x29b730['attributes'][_0x2466('0x33')]?_0x29b730[_0x2466('0x34')]:_0x4f5bf3[_0x2466('0x31')];if(_0x146ec2[_0x2466('0x2e')][_0x2466('0x46')]){_0x29b730[_0x2466('0x40')]=[{'all':!![]}];}_0x29b730=_['merge']({},_0x29b730,_0x146ec2[_0x2466('0x3e')]);return db[_0x2466('0x3f')][_0x2466('0x47')](_0x29b730)['then'](handleEntityNotFound(_0x164f22,null))[_0x2466('0x25')](respondWithResult(_0x164f22,null))[_0x2466('0x43')](handleError(_0x164f22,null));};exports[_0x2466('0x48')]=function(_0xfa82c,_0x5b3765){var _0x55e16e={'where':{'id':_0xfa82c[_0x2466('0x44')]['id']}},_0x3f506d={};_0x3f506d[_0x2466('0x31')]=_['keys'](db[_0x2466('0x3f')][_0x2466('0x2b')]);_0x55e16e[_0x2466('0x34')]=_[_0x2466('0x30')](_0x3f506d[_0x2466('0x31')],qs[_0x2466('0x32')](_0xfa82c['query'][_0x2466('0x32')]));_0x55e16e[_0x2466('0x34')]=_0x55e16e[_0x2466('0x34')][_0x2466('0x33')]?_0x55e16e[_0x2466('0x34')]:_0x3f506d[_0x2466('0x31')];if(_0xfa82c[_0x2466('0x2e')][_0x2466('0x46')]){_0x55e16e['include']=[{'all':!![]}];}_0x55e16e=_[_0x2466('0x3d')]({},_0x55e16e,_0xfa82c[_0x2466('0x3e')]);return db[_0x2466('0x3f')][_0x2466('0x47')](_0x55e16e)[_0x2466('0x25')](handleEntityNotFound(_0x5b3765,null))[_0x2466('0x25')](function(_0x5cc7ac){if(_0x5cc7ac){var _0x733cb2=_0x5cc7ac[_0x2466('0x49')]({'plain':!![]});_0x733cb2=qs[_0x2466('0x4a')](_0x733cb2,['id','createdAt',_0x2466('0x4b')]);_0xfa82c[_0x2466('0x4c')]=_[_0x2466('0x4a')](_0xfa82c[_0x2466('0x4c')],['id',_0x2466('0x4d'),_0x2466('0x4b')]);return db['Attachment'][_0x2466('0x4e')](_['merge'](_0x733cb2,_0xfa82c['body']),{'include':_0xfa82c['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x2466('0x25')](respondWithResult(_0x5b3765,0xc9))[_0x2466('0x43')](handleError(_0x5b3765,null));};exports['update']=function(_0x4d05ef,_0x18757a){if(_0x4d05ef[_0x2466('0x4c')]['id']){delete _0x4d05ef[_0x2466('0x4c')]['id'];}return db[_0x2466('0x3f')][_0x2466('0x47')]({'where':{'id':_0x4d05ef[_0x2466('0x44')]['id']}})[_0x2466('0x25')](handleEntityNotFound(_0x18757a,null))['then'](saveUpdates(_0x4d05ef[_0x2466('0x4c')],null))[_0x2466('0x25')](respondWithResult(_0x18757a,null))[_0x2466('0x43')](handleError(_0x18757a,null));};exports['destroy']=function(_0x2dd179,_0x38c124){return db['Attachment'][_0x2466('0x47')]({'where':{'id':_0x2dd179[_0x2466('0x44')]['id']}})[_0x2466('0x25')](handleEntityNotFound(_0x38c124,null))[_0x2466('0x25')](removeEntity(_0x38c124,null))['catch'](handleError(_0x38c124,null));};exports['create']=function(_0x5a8f63,_0x110273,_0x12fd6c){_0x5a8f63[_0x2466('0x4c')]['name']=_0x5a8f63[_0x2466('0x4f')][_0x2466('0x50')];_0x5a8f63[_0x2466('0x4c')][_0x2466('0x51')]=_0x5a8f63[_0x2466('0x4f')][_0x2466('0x52')];_0x5a8f63[_0x2466('0x4c')][_0x2466('0x2c')]=_0x5a8f63['file'][_0x2466('0x53')];return db[_0x2466('0x3f')]['create'](_0x5a8f63[_0x2466('0x4c')])[_0x2466('0x25')](respondWithResult(_0x110273,0xc9))[_0x2466('0x43')](handleError(_0x110273,null));};exports[_0x2466('0x54')]=function(_0x2fdc2f,_0x3606f0,_0x5e8a5f){return db['Attachment'][_0x2466('0x55')]({'where':{'id':_0x2fdc2f[_0x2466('0x44')]['id']},'raw':!![]})[_0x2466('0x25')](handleEntityNotFound(_0x3606f0,null))[_0x2466('0x25')](function(_0x27a75f){if(_0x27a75f){var _0x36004c=_0x27a75f[_0x2466('0x56')]!==null;var _0x3de41a=path['join'](config[_0x2466('0x57')],_0x2466('0x58'));if(_0x36004c){_0x3de41a=path[_0x2466('0x59')](_0x3de41a,_0x2466('0x5a'));}var _0x44d45d=path['join'](_0x3de41a,_0x27a75f[_0x2466('0x51')]);return _0x3606f0[_0x2466('0x54')](_0x44d45d);}})[_0x2466('0x43')](handleError(_0x3606f0,null));};
\ No newline at end of file
+var _0x7d52=['download','findOne','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','Attachment','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','length','find','get','omit','createdAt','updatedAt','body','create','file','basename','filename'];(function(_0x19206e,_0x3baba3){var _0x1cb7a0=function(_0x40f9be){while(--_0x40f9be){_0x19206e['push'](_0x19206e['shift']());}};_0x1cb7a0(++_0x3baba3);}(_0x7d52,0x1c3));var _0x27d5=function(_0x3c1105,_0x5c45c1){_0x3c1105=_0x3c1105-0x0;var _0x35e7ab=_0x7d52[_0x3c1105];return _0x35e7ab;};'use strict';var emlformat=require(_0x27d5('0x0'));var rimraf=require(_0x27d5('0x1'));var zipdir=require(_0x27d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x27d5('0x3'));var moment=require(_0x27d5('0x4'));var BPromise=require(_0x27d5('0x5'));var Mustache=require(_0x27d5('0x6'));var util=require('util');var path=require(_0x27d5('0x7'));var sox=require(_0x27d5('0x8'));var csv=require(_0x27d5('0x9'));var ejs=require(_0x27d5('0xa'));var fs=require('fs');var fs_extra=require(_0x27d5('0xb'));var _=require('lodash');var squel=require(_0x27d5('0xc'));var crypto=require(_0x27d5('0xd'));var jsforce=require(_0x27d5('0xe'));var deskjs=require(_0x27d5('0xf'));var toCsv=require(_0x27d5('0x9'));var querystring=require('querystring');var Papa=require(_0x27d5('0x10'));var Redis=require(_0x27d5('0x11'));var authService=require(_0x27d5('0x12'));var qs=require(_0x27d5('0x13'));var as=require(_0x27d5('0x14'));var hardwareService=require(_0x27d5('0x15'));var logger=require(_0x27d5('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x27d5('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4782c0,_0x3b5cde){_0x3b5cde=_0x3b5cde||0xcc;return function(_0x336b1a){if(_0x336b1a){return _0x4782c0[_0x27d5('0x18')](_0x3b5cde);}return _0x4782c0['status'](_0x3b5cde)[_0x27d5('0x19')]();};}function respondWithResult(_0x21fc9b,_0x373fb8){_0x373fb8=_0x373fb8||0xc8;return function(_0x248646){if(_0x248646){return _0x21fc9b[_0x27d5('0x1a')](_0x373fb8)[_0x27d5('0x1b')](_0x248646);}};}function respondWithFilteredResult(_0x566e0c,_0x2038f3){return function(_0x49e91d){if(_0x49e91d){var _0x36fcad=typeof _0x2038f3['offset']===_0x27d5('0x1c')&&typeof _0x2038f3[_0x27d5('0x1d')]===_0x27d5('0x1c');var _0xf2e9e3=_0x49e91d[_0x27d5('0x1e')];var _0x2c228c=_0x36fcad?0x0:_0x2038f3['offset'];var _0x5b82f6=_0x36fcad?_0x49e91d[_0x27d5('0x1e')]:_0x2038f3['offset']+_0x2038f3[_0x27d5('0x1d')];var _0x2000f6;if(_0x5b82f6>=_0xf2e9e3){_0x5b82f6=_0xf2e9e3;_0x2000f6=0xc8;}else{_0x2000f6=0xce;}_0x566e0c['status'](_0x2000f6);return _0x566e0c[_0x27d5('0x1f')](_0x27d5('0x20'),_0x2c228c+'-'+_0x5b82f6+'/'+_0xf2e9e3)[_0x27d5('0x1b')](_0x49e91d);}return null;};}function patchUpdates(_0x4fd793){return function(_0x30c809){try{jsonpatch[_0x27d5('0x21')](_0x30c809,_0x4fd793,!![]);}catch(_0x6894e9){return BPromise[_0x27d5('0x22')](_0x6894e9);}return _0x30c809[_0x27d5('0x23')]();};}function saveUpdates(_0x4113fc,_0x3c1133){return function(_0x238a85){if(_0x238a85){return _0x238a85[_0x27d5('0x24')](_0x4113fc)[_0x27d5('0x25')](function(_0xe26a47){return _0xe26a47;});}return null;};}function removeEntity(_0x32d762,_0xdf9f4a){return function(_0x3cfb3a){if(_0x3cfb3a){return _0x3cfb3a[_0x27d5('0x26')]()['then'](function(){_0x32d762[_0x27d5('0x1a')](0xcc)[_0x27d5('0x19')]();});}};}function handleEntityNotFound(_0x4329dd,_0x15acff){return function(_0x334e18){if(!_0x334e18){_0x4329dd['sendStatus'](0x194);}return _0x334e18;};}function handleError(_0x4808ec,_0x3d0089){_0x3d0089=_0x3d0089||0x1f4;return function(_0x52b861){logger[_0x27d5('0x27')](_0x52b861[_0x27d5('0x28')]);if(_0x52b861[_0x27d5('0x29')]){delete _0x52b861[_0x27d5('0x29')];}_0x4808ec['status'](_0x3d0089)['send'](_0x52b861);};}exports[_0x27d5('0x2a')]=function(_0x4c960c,_0x1d77d5){var _0x2d8e64={},_0x15006a={},_0x3d26a0={'count':0x0,'rows':[]};var _0x2e2e51=_[_0x27d5('0x2b')](db[_0x27d5('0x2c')]['rawAttributes'],function(_0x51643e){return{'name':_0x51643e[_0x27d5('0x2d')],'type':_0x51643e[_0x27d5('0x2e')][_0x27d5('0x2f')]};});_0x15006a[_0x27d5('0x30')]=_[_0x27d5('0x2b')](_0x2e2e51,_0x27d5('0x29'));_0x15006a[_0x27d5('0x31')]=_[_0x27d5('0x32')](_0x4c960c['query']);_0x15006a['filters']=_[_0x27d5('0x33')](_0x15006a[_0x27d5('0x30')],_0x15006a['query']);_0x2d8e64[_0x27d5('0x34')]=_[_0x27d5('0x33')](_0x15006a[_0x27d5('0x30')],qs['fields'](_0x4c960c['query'][_0x27d5('0x35')]));_0x2d8e64[_0x27d5('0x34')]=_0x2d8e64[_0x27d5('0x34')]['length']?_0x2d8e64['attributes']:_0x15006a[_0x27d5('0x30')];if(!_0x4c960c['query'][_0x27d5('0x36')](_0x27d5('0x37'))){_0x2d8e64['limit']=qs[_0x27d5('0x1d')](_0x4c960c[_0x27d5('0x31')]['limit']);_0x2d8e64[_0x27d5('0x38')]=qs['offset'](_0x4c960c[_0x27d5('0x31')][_0x27d5('0x38')]);}_0x2d8e64[_0x27d5('0x39')]=qs[_0x27d5('0x3a')](_0x4c960c['query'][_0x27d5('0x3a')]);_0x2d8e64[_0x27d5('0x3b')]=qs[_0x27d5('0x3c')](_[_0x27d5('0x3d')](_0x4c960c[_0x27d5('0x31')],_0x15006a[_0x27d5('0x3c')]),_0x2e2e51);if(_0x4c960c[_0x27d5('0x31')][_0x27d5('0x3e')]){_0x2d8e64[_0x27d5('0x3b')]=_[_0x27d5('0x3f')](_0x2d8e64[_0x27d5('0x3b')],{'$or':_['map'](_0x2e2e51,function(_0x2284e7){if(_0x2284e7[_0x27d5('0x2e')]!==_0x27d5('0x40')){var _0x24e391={};_0x24e391[_0x2284e7['name']]={'$like':'%'+_0x4c960c[_0x27d5('0x31')][_0x27d5('0x3e')]+'%'};return _0x24e391;}})});}_0x2d8e64=_[_0x27d5('0x3f')]({},_0x2d8e64,_0x4c960c[_0x27d5('0x41')]);var _0x45494d={'where':_0x2d8e64[_0x27d5('0x3b')]};return db[_0x27d5('0x2c')][_0x27d5('0x1e')](_0x45494d)['then'](function(_0x23a4e7){_0x3d26a0[_0x27d5('0x1e')]=_0x23a4e7;if(_0x4c960c['query'][_0x27d5('0x42')]){_0x2d8e64[_0x27d5('0x43')]=[{'all':!![]}];}return db[_0x27d5('0x2c')][_0x27d5('0x44')](_0x2d8e64);})[_0x27d5('0x25')](function(_0x559c6a){_0x3d26a0['rows']=_0x559c6a;return _0x3d26a0;})[_0x27d5('0x25')](respondWithFilteredResult(_0x1d77d5,_0x2d8e64))[_0x27d5('0x45')](handleError(_0x1d77d5,null));};exports['show']=function(_0x1670a2,_0x393c42){var _0x31d40c={'raw':!![],'where':{'id':_0x1670a2[_0x27d5('0x46')]['id']}},_0x3aad27={};_0x3aad27['model']=_['keys'](db[_0x27d5('0x2c')][_0x27d5('0x47')]);_0x3aad27[_0x27d5('0x31')]=_[_0x27d5('0x32')](_0x1670a2[_0x27d5('0x31')]);_0x3aad27[_0x27d5('0x3c')]=_[_0x27d5('0x33')](_0x3aad27[_0x27d5('0x30')],_0x3aad27[_0x27d5('0x31')]);_0x31d40c['attributes']=_[_0x27d5('0x33')](_0x3aad27[_0x27d5('0x30')],qs['fields'](_0x1670a2[_0x27d5('0x31')][_0x27d5('0x35')]));_0x31d40c['attributes']=_0x31d40c[_0x27d5('0x34')][_0x27d5('0x48')]?_0x31d40c[_0x27d5('0x34')]:_0x3aad27[_0x27d5('0x30')];if(_0x1670a2[_0x27d5('0x31')][_0x27d5('0x42')]){_0x31d40c[_0x27d5('0x43')]=[{'all':!![]}];}_0x31d40c=_[_0x27d5('0x3f')]({},_0x31d40c,_0x1670a2[_0x27d5('0x41')]);return db['Attachment'][_0x27d5('0x49')](_0x31d40c)[_0x27d5('0x25')](handleEntityNotFound(_0x393c42,null))[_0x27d5('0x25')](respondWithResult(_0x393c42,null))['catch'](handleError(_0x393c42,null));};exports['clone']=function(_0x184b79,_0x418742){var _0xbc312d={'where':{'id':_0x184b79[_0x27d5('0x46')]['id']}},_0x3028a1={};_0x3028a1[_0x27d5('0x30')]=_['keys'](db[_0x27d5('0x2c')][_0x27d5('0x47')]);_0xbc312d[_0x27d5('0x34')]=_[_0x27d5('0x33')](_0x3028a1[_0x27d5('0x30')],qs['fields'](_0x184b79[_0x27d5('0x31')][_0x27d5('0x35')]));_0xbc312d[_0x27d5('0x34')]=_0xbc312d[_0x27d5('0x34')][_0x27d5('0x48')]?_0xbc312d[_0x27d5('0x34')]:_0x3028a1[_0x27d5('0x30')];if(_0x184b79['query'][_0x27d5('0x42')]){_0xbc312d[_0x27d5('0x43')]=[{'all':!![]}];}_0xbc312d=_[_0x27d5('0x3f')]({},_0xbc312d,_0x184b79[_0x27d5('0x41')]);return db[_0x27d5('0x2c')][_0x27d5('0x49')](_0xbc312d)['then'](handleEntityNotFound(_0x418742,null))['then'](function(_0x2ee679){if(_0x2ee679){var _0x1e5360=_0x2ee679[_0x27d5('0x4a')]({'plain':!![]});_0x1e5360=qs[_0x27d5('0x4b')](_0x1e5360,['id',_0x27d5('0x4c'),_0x27d5('0x4d')]);_0x184b79['body']=_[_0x27d5('0x4b')](_0x184b79[_0x27d5('0x4e')],['id',_0x27d5('0x4c'),_0x27d5('0x4d')]);return db[_0x27d5('0x2c')][_0x27d5('0x4f')](_['merge'](_0x1e5360,_0x184b79[_0x27d5('0x4e')]),{'include':_0x184b79[_0x27d5('0x31')][_0x27d5('0x42')]?[{'all':!![]}]:undefined});}})[_0x27d5('0x25')](respondWithResult(_0x418742,0xc9))[_0x27d5('0x45')](handleError(_0x418742,null));};exports[_0x27d5('0x24')]=function(_0x28941c,_0x43e5c5){if(_0x28941c[_0x27d5('0x4e')]['id']){delete _0x28941c[_0x27d5('0x4e')]['id'];}return db[_0x27d5('0x2c')][_0x27d5('0x49')]({'where':{'id':_0x28941c['params']['id']}})[_0x27d5('0x25')](handleEntityNotFound(_0x43e5c5,null))[_0x27d5('0x25')](saveUpdates(_0x28941c[_0x27d5('0x4e')],null))[_0x27d5('0x25')](respondWithResult(_0x43e5c5,null))[_0x27d5('0x45')](handleError(_0x43e5c5,null));};exports[_0x27d5('0x26')]=function(_0x3fc8e6,_0x50095f){return db[_0x27d5('0x2c')][_0x27d5('0x49')]({'where':{'id':_0x3fc8e6['params']['id']}})[_0x27d5('0x25')](handleEntityNotFound(_0x50095f,null))[_0x27d5('0x25')](removeEntity(_0x50095f,null))[_0x27d5('0x45')](handleError(_0x50095f,null));};exports[_0x27d5('0x4f')]=function(_0xcfb94b,_0x30887b,_0x497788){_0xcfb94b['body'][_0x27d5('0x29')]=_0xcfb94b[_0x27d5('0x50')]['originalname'];_0xcfb94b[_0x27d5('0x4e')][_0x27d5('0x51')]=_0xcfb94b[_0x27d5('0x50')][_0x27d5('0x52')];_0xcfb94b['body'][_0x27d5('0x2e')]=_0xcfb94b['file']['mimetype'];return db[_0x27d5('0x2c')][_0x27d5('0x4f')](_0xcfb94b[_0x27d5('0x4e')])[_0x27d5('0x25')](respondWithResult(_0x30887b,0xc9))[_0x27d5('0x45')](handleError(_0x30887b,null));};exports[_0x27d5('0x53')]=function(_0xb51343,_0x27364f,_0x26b676){return db[_0x27d5('0x2c')][_0x27d5('0x54')]({'where':{'id':_0xb51343[_0x27d5('0x46')]['id']},'raw':!![]})[_0x27d5('0x25')](handleEntityNotFound(_0x27364f,null))[_0x27d5('0x25')](function(_0x47cdd0){if(_0x47cdd0){var _0x40b342=_0x47cdd0['ChatOfflineMessageId']!==null;var _0x2bbdcf=path[_0x27d5('0x55')](config[_0x27d5('0x56')],_0x27d5('0x57'));if(_0x40b342){_0x2bbdcf=path[_0x27d5('0x55')](_0x2bbdcf,_0x27d5('0x58'));}var _0x521796=path[_0x27d5('0x55')](_0x2bbdcf,_0x47cdd0[_0x27d5('0x51')]);return _0x27364f[_0x27d5('0x53')](_0x521796);}})['catch'](handleError(_0x27364f,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index b391466..9cf7234 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 _0x1a12=['define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports'];(function(_0x3a0b77,_0x32d3b7){var _0x32f1c4=function(_0x2e157b){while(--_0x2e157b){_0x3a0b77['push'](_0x3a0b77['shift']());}};_0x32f1c4(++_0x32d3b7);}(_0x1a12,0xab));var _0x21a1=function(_0x2bd4ee,_0x3fb78e){_0x2bd4ee=_0x2bd4ee-0x0;var _0x15ccd5=_0x1a12[_0x2bd4ee];return _0x15ccd5;};'use strict';var _=require(_0x21a1('0x0'));var util=require(_0x21a1('0x1'));var logger=require(_0x21a1('0x2'))(_0x21a1('0x3'));var moment=require(_0x21a1('0x4'));var BPromise=require(_0x21a1('0x5'));var rp=require(_0x21a1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x21a1('0x7'));var config=require(_0x21a1('0x8'));var attributes=require(_0x21a1('0x9'));module[_0x21a1('0xa')]=function(_0x5a4610,_0x4b3855){return _0x5a4610[_0x21a1('0xb')](_0x21a1('0xc'),attributes,{'tableName':_0x21a1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6a4d=['attachments','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Attachment'];(function(_0xc053a,_0x1d0055){var _0x5d16ab=function(_0x532692){while(--_0x532692){_0xc053a['push'](_0xc053a['shift']());}};_0x5d16ab(++_0x1d0055);}(_0x6a4d,0x115));var _0xd6a4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x6a4d[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var util=require(_0xd6a4('0x0'));var logger=require(_0xd6a4('0x1'))(_0xd6a4('0x2'));var moment=require(_0xd6a4('0x3'));var BPromise=require(_0xd6a4('0x4'));var rp=require(_0xd6a4('0x5'));var fs=require('fs');var path=require(_0xd6a4('0x6'));var rimraf=require(_0xd6a4('0x7'));var config=require(_0xd6a4('0x8'));var attributes=require('./attachment.attributes');module[_0xd6a4('0x9')]=function(_0x12b82e,_0x55994c){return _0x12b82e['define'](_0xd6a4('0xa'),attributes,{'tableName':_0xd6a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 4f85207..c5a7981 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 _0x81d5=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateAttachment','Attachment','body','options','raw','then','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x5e5b72,_0x486a42){var _0x2247d1=function(_0x505fb5){while(--_0x505fb5){_0x5e5b72['push'](_0x5e5b72['shift']());}};_0x2247d1(++_0x486a42);}(_0x81d5,0x1ab));var _0x581d=function(_0x7ed107,_0x441306){_0x7ed107=_0x7ed107-0x0;var _0xab54dc=_0x81d5[_0x7ed107];return _0xab54dc;};'use strict';var _=require(_0x581d('0x0'));var util=require(_0x581d('0x1'));var moment=require('moment');var BPromise=require(_0x581d('0x2'));var rs=require(_0x581d('0x3'));var fs=require('fs');var Redis=require(_0x581d('0x4'));var db=require(_0x581d('0x5'))['db'];var utils=require(_0x581d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x581d('0x7'));var jayson=require(_0x581d('0x8'));var client=jayson[_0x581d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16067b,_0x2f32bf,_0x43124c){return new BPromise(function(_0x497368,_0xf1a3b6){return client['request'](_0x16067b,_0x43124c)['then'](function(_0x5d8fa3){logger[_0x581d('0xa')](_0x581d('0xb'),_0x2f32bf,_0x581d('0xc'));logger[_0x581d('0xd')](_0x581d('0xe'),_0x2f32bf,'request\x20sent',JSON[_0x581d('0xf')](_0x5d8fa3));if(_0x5d8fa3[_0x581d('0x10')]){if(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x11')]===0x1f4){logger[_0x581d('0x10')](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);return _0xf1a3b6(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);}logger['error'](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')]['message']);return _0x497368(_0x5d8fa3['error']['message']);}else{logger['info'](_0x581d('0xb'),_0x2f32bf,'request\x20sent');_0x497368(_0x5d8fa3[_0x581d('0x13')][_0x581d('0x12')]);}})['catch'](function(_0x1890d0){logger['error'](_0x581d('0xb'),_0x2f32bf,_0x1890d0);_0xf1a3b6(_0x1890d0);});});}exports[_0x581d('0x14')]=function(_0x1e059d){var _0x42f7db=this;return new Promise(function(_0x1f790f,_0x2cff0d){return db[_0x581d('0x15')]['create'](_0x1e059d[_0x581d('0x16')],{'raw':_0x1e059d[_0x581d('0x17')]?_0x1e059d[_0x581d('0x17')][_0x581d('0x18')]===undefined?!![]:![]:!![]})[_0x581d('0x19')](function(_0x2a2aba){logger[_0x581d('0xa')](_0x581d('0x14'),_0x1e059d);logger[_0x581d('0xd')](_0x581d('0x14'),_0x1e059d,JSON[_0x581d('0xf')](_0x2a2aba));_0x1f790f(_0x2a2aba);})[_0x581d('0x1a')](function(_0x5add13){logger[_0x581d('0x10')](_0x581d('0x14'),_0x5add13[_0x581d('0x12')],_0x1e059d);_0x2cff0d(_0x42f7db[_0x581d('0x10')](0x1f4,_0x5add13[_0x581d('0x12')]));});});};
\ No newline at end of file
+var _0x9c44=['code','error','message','Attachment,\x20%s,\x20%s','info','result','catch','CreateAttachment','Attachment','body','options','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('Attachment,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('Attachment,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('Attachment,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('Attachment,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});}exports[_0x49c4('0x15')]=function(_0x4c3253){var _0x512650=this;return new Promise(function(_0x3c782d,_0x2f82d5){return db[_0x49c4('0x16')]['create'](_0x4c3253[_0x49c4('0x17')],{'raw':_0x4c3253['options']?_0x4c3253[_0x49c4('0x18')][_0x49c4('0x19')]===undefined?!![]:![]:!![]})[_0x49c4('0xa')](function(_0x291526){logger[_0x49c4('0x12')](_0x49c4('0x15'),_0x4c3253);logger[_0x49c4('0xc')](_0x49c4('0x15'),_0x4c3253,JSON[_0x49c4('0xd')](_0x291526));_0x3c782d(_0x291526);})['catch'](function(_0x527126){logger['error'](_0x49c4('0x15'),_0x527126['message'],_0x4c3253);_0x2f82d5(_0x512650['error'](0x1f4,_0x527126[_0x49c4('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index cef4c3b..1367a25 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2fcd50,_0x51b76c){var _0x576508=function(_0x5128b9){while(--_0x5128b9){_0x2fcd50['push'](_0x2fcd50['shift']());}};_0x576508(++_0x51b76c);}(_0x2032,0xd9));var _0x2203=function(_0x4a85bf,_0x45cadc){_0x4a85bf=_0x4a85bf-0x0;var _0x92d3e8=_0x2032[_0x4a85bf];return _0x92d3e8;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _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(_0x37f157,_0x4ffeb1){var _0xe48d0b=function(_0xb30bdb){while(--_0xb30bdb){_0x37f157['push'](_0x37f157['shift']());}};_0xe48d0b(++_0x4ffeb1);}(_0xadb5,0xad));var _0x5adb=function(_0x5cf43b,_0x14c9eb){_0x5cf43b=_0x5cf43b-0x0;var _0x37d159=_0xadb5[_0x5cf43b];return _0x37d159;};'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/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index f331835..9925516 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 _0xd253=['then','disabled','blockDuration','blocked','clearBlockUser','getLicense','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','catch','lodash','passport','Strategy','moment','../../config/environment','../../config/utils','authenticate','google','/login','profile','callback','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','emails','admin','user','agent'];(function(_0x235f49,_0x2992b4){var _0x551139=function(_0x35565c){while(--_0x35565c){_0x235f49['push'](_0x235f49['shift']());}};_0x551139(++_0x2992b4);}(_0xd253,0x152));var _0x3d25=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xd253[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x3d25('0x0'));var passport=require(_0x3d25('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0x3d25('0x2')];var moment=require(_0x3d25('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0x3d25('0x4'));var signToken=require('../../components/auth/service')['signToken'];var utils=require(_0x3d25('0x5'));exports['login']=passport[_0x3d25('0x6')](_0x3d25('0x7'),{'failureRedirect':_0x3d25('0x8'),'scope':[_0x3d25('0x9'),'email'],'session':![]});exports[_0x3d25('0xa')]=passport[_0x3d25('0x6')](_0x3d25('0x7'),{'failureRedirect':_0x3d25('0x8'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x3d25('0x7')]?config['google']['clientID']:'id','clientSecret':config[_0x3d25('0x7')]?config[_0x3d25('0x7')][_0x3d25('0xb')]:_0x3d25('0xc'),'callbackURL':config[_0x3d25('0x7')]?config[_0x3d25('0x7')][_0x3d25('0xd')]:''},function(_0xa6fe2a,_0x5872fa,_0x2b63bc,_0x3bc40e){var _0x466a49,_0x2008de;return db[_0x3d25('0xe')][_0x3d25('0xf')]({'where':{'id':0x1},'attributes':[_0x3d25('0x10'),'blockDuration'],'raw':!![]})['then'](function(_0x3692c9){_0x466a49=_0x3692c9;return db[_0x3d25('0x11')]['find']({'where':{'email':_['map'](_0x2b63bc[_0x3d25('0x12')],'value'),'role':{'$or':[_0x3d25('0x13'),_0x3d25('0x14'),_0x3d25('0x15')]}}});})[_0x3d25('0x16')](function(_0x3745a2){_0x2008de=_0x3745a2;if(_0x2008de){if(_0x2008de[_0x3d25('0x17')]){return _0x3bc40e('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x466a49[_0x3d25('0x18')]>0x0){if(_0x2008de[_0x3d25('0x19')]){if(moment(_0x2008de['blockedAt'])['add'](_0x466a49[_0x3d25('0x18')],'minutes')>moment()){return _0x3bc40e('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x3d25('0x1a')](_0x2008de,0x0,![],null)[_0x3d25('0x16')](function(){return utils['getLicense'](_0x2008de);})['then'](function(){return _0x3bc40e(null,_0x2008de);});}}else{return utils[_0x3d25('0x1b')](_0x2008de)['then'](function(){return _0x3bc40e(null,_0x2008de);});}}else{return utils[_0x3d25('0x1b')](_0x2008de)[_0x3d25('0x16')](function(){return _0x3bc40e(null,_0x2008de);});}}return _0x3bc40e(_0x3d25('0x1c'));})[_0x3d25('0x1d')](function(_0x1668b7){_0x3bc40e(_0x1668b7);});}));
\ No newline at end of file
+var _0x9ff8=['then','User','value','admin','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','clearBlockUser','getLicense','catch','lodash','passport','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','profile','email','callback','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts'];(function(_0xfe0d96,_0x595dd0){var _0x4ffd30=function(_0x4a83d8){while(--_0x4a83d8){_0xfe0d96['push'](_0xfe0d96['shift']());}};_0x4ffd30(++_0x595dd0);}(_0x9ff8,0x18e));var _0x89ff=function(_0x3925b4,_0x58064d){_0x3925b4=_0x3925b4-0x0;var _0x1d62fa=_0x9ff8[_0x3925b4];return _0x1d62fa;};'use strict';var _=require(_0x89ff('0x0'));var passport=require(_0x89ff('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0x89ff('0x2')];var moment=require('moment');var db=require(_0x89ff('0x3'))['db'];var config=require(_0x89ff('0x4'));var signToken=require(_0x89ff('0x5'))[_0x89ff('0x6')];var utils=require(_0x89ff('0x7'));exports[_0x89ff('0x8')]=passport[_0x89ff('0x9')](_0x89ff('0xa'),{'failureRedirect':_0x89ff('0xb'),'scope':[_0x89ff('0xc'),_0x89ff('0xd')],'session':![]});exports[_0x89ff('0xe')]=passport[_0x89ff('0x9')](_0x89ff('0xa'),{'failureRedirect':_0x89ff('0xb'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config['google']?config['google'][_0x89ff('0xf')]:'id','clientSecret':config[_0x89ff('0xa')]?config[_0x89ff('0xa')][_0x89ff('0x10')]:_0x89ff('0x11'),'callbackURL':config[_0x89ff('0xa')]?config['google'][_0x89ff('0x12')]:''},function(_0x59dbe6,_0x234b3d,_0x349d9f,_0x5c4f7b){var _0x31430c,_0x2ccd86;return db[_0x89ff('0x13')][_0x89ff('0x14')]({'where':{'id':0x1},'attributes':[_0x89ff('0x15'),'blockDuration'],'raw':!![]})[_0x89ff('0x16')](function(_0x2c93f5){_0x31430c=_0x2c93f5;return db[_0x89ff('0x17')]['find']({'where':{'email':_['map'](_0x349d9f['emails'],_0x89ff('0x18')),'role':{'$or':[_0x89ff('0x19'),'user','agent']}}});})[_0x89ff('0x16')](function(_0x48a7e9){_0x2ccd86=_0x48a7e9;if(_0x2ccd86){if(_0x2ccd86[_0x89ff('0x1a')]){return _0x5c4f7b(_0x89ff('0x1b'));}else if(_0x31430c[_0x89ff('0x1c')]>0x0){if(_0x2ccd86[_0x89ff('0x1d')]){if(moment(_0x2ccd86[_0x89ff('0x1e')])[_0x89ff('0x1f')](_0x31430c[_0x89ff('0x1c')],'minutes')>moment()){return _0x5c4f7b(_0x89ff('0x1b'));}else{return utils[_0x89ff('0x20')](_0x2ccd86,0x0,![],null)[_0x89ff('0x16')](function(){return utils['getLicense'](_0x2ccd86);})[_0x89ff('0x16')](function(){return _0x5c4f7b(null,_0x2ccd86);});}}else{return utils[_0x89ff('0x21')](_0x2ccd86)['then'](function(){return _0x5c4f7b(null,_0x2ccd86);});}}else{return utils[_0x89ff('0x21')](_0x2ccd86)[_0x89ff('0x16')](function(){return _0x5c4f7b(null,_0x2ccd86);});}}return _0x5c4f7b(_0x89ff('0x1b'));})[_0x89ff('0x22')](function(_0x3bc678){_0x5c4f7b(_0x3bc678);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 2c2f937..3d96396 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 _0x8f7d=['setTokenCookie','exports','express','passport','./authGoogle.controller','get','/callback','callback','isMiddleware'];(function(_0x1395b1,_0x21d72c){var _0x7d91a=function(_0x2f78e7){while(--_0x2f78e7){_0x1395b1['push'](_0x1395b1['shift']());}};_0x7d91a(++_0x21d72c);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x59170f,_0x560c2d){_0x59170f=_0x59170f-0x0;var _0x3f8792=_0x8f7d[_0x59170f];return _0x3f8792;};'use strict';var express=require(_0xd8f7('0x0'));var passport=require(_0xd8f7('0x1'));var router=express['Router']();var controller=require(_0xd8f7('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0xd8f7('0x3')]('/',controller['login']);router[_0xd8f7('0x3')](_0xd8f7('0x4'),controller[_0xd8f7('0x5')],authService[_0xd8f7('0x6')],userController['login'],authService[_0xd8f7('0x7')]);module[_0xd8f7('0x8')]=router;
\ No newline at end of file
+var _0x861a=['../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','express','Router','./authGoogle.controller'];(function(_0x1ee5be,_0x5f46e3){var _0x177140=function(_0x162779){while(--_0x162779){_0x1ee5be['push'](_0x1ee5be['shift']());}};_0x177140(++_0x5f46e3);}(_0x861a,0x194));var _0xa861=function(_0x24d06a,_0x59c850){_0x24d06a=_0x24d06a-0x0;var _0x4a987d=_0x861a[_0x24d06a];return _0x4a987d;};'use strict';var express=require(_0xa861('0x0'));var passport=require('passport');var router=express[_0xa861('0x1')]();var controller=require(_0xa861('0x2'));var userController=require(_0xa861('0x3'));var authService=require(_0xa861('0x4'));router[_0xa861('0x5')]('/',controller[_0xa861('0x6')]);router['get'](_0xa861('0x7'),controller[_0xa861('0x8')],authService[_0xa861('0x9')],userController[_0xa861('0x6')],authService[_0xa861('0xa')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 1c7f4ed..d0840b4 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 _0xbc01=['client','http','Setting','findOne','then','name','password','salt','role','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blockDuration','blockedAt','add','minutes','clearBlockUser','disabled','getLicense','catch','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','login','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','validatePasswordHistory','save','send','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc01,0xaf));var _0x1bc0=function(_0x4e5d27,_0x247b84){_0x4e5d27=_0x4e5d27-0x0;var _0x1c7046=_0xbc01[_0x4e5d27];return _0x1c7046;};'use strict';var util=require(_0x1bc0('0x0'));var passport=require(_0x1bc0('0x1'));var LocalStrategy=require(_0x1bc0('0x2'))['Strategy'];var jayson=require(_0x1bc0('0x3'));var _=require(_0x1bc0('0x4'));var rs=require('randomstring');var moment=require(_0x1bc0('0x5'));var db=require(_0x1bc0('0x6'))['db'];var authService=require(_0x1bc0('0x7'));var utils=require(_0x1bc0('0x8'));var client=jayson[_0x1bc0('0x9')][_0x1bc0('0xa')]({'port':0x232b});function localAuthenticate(_0x17cbcc,_0x273469,_0x20f5e5,_0x2f7940){var _0x16a877,_0x307c8a;return db[_0x1bc0('0xb')][_0x1bc0('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x1bc0('0xd')](function(_0x41e732){_0x16a877=_0x41e732;return _0x17cbcc[_0x1bc0('0xc')]({'attributes':['id',_0x1bc0('0xe'),_0x1bc0('0xf'),_0x1bc0('0x10'),_0x1bc0('0x11'),'disabled',_0x1bc0('0x12'),'blockedAt',_0x1bc0('0x13')],'where':{'name':_0x273469,'role':{'$or':[_0x1bc0('0x14'),_0x1bc0('0x15'),_0x1bc0('0x16')]}}});})['then'](function(_0x4b667d){if(!_0x4b667d||_0x4b667d&&_0x4b667d[_0x1bc0('0xe')]!==_0x273469){throw new Error(_0x1bc0('0x17'));}else{_0x307c8a=_0x4b667d;return _0x307c8a;}})[_0x1bc0('0xd')](function(){_0x307c8a['authenticate'](_0x20f5e5,function(_0x596be3,_0x5c63dd){var _0x233d2b=_0x307c8a['loginAttempts']+0x1;if(_0x596be3){return _0x2f7940(_0x596be3);}else if(!_0x5c63dd){if(_0x307c8a['disabled']){return _0x2f7940(null,![],{'message':_0x1bc0('0x17')});}else if(_0x16a877[_0x1bc0('0x18')]>0x0){if(_0x307c8a[_0x1bc0('0x12')]){if(_0x16a877[_0x1bc0('0x19')]>0x0){if(moment(_0x307c8a[_0x1bc0('0x1a')])[_0x1bc0('0x1b')](_0x16a877[_0x1bc0('0x19')],_0x1bc0('0x1c'))>moment()){return _0x2f7940(null,![],{'message':_0x1bc0('0x17')});}else{return utils[_0x1bc0('0x1d')](_0x307c8a,_0x233d2b,![],null)['then'](function(){return _0x2f7940(null,![],{'message':_0x1bc0('0x17')});});}}else{return _0x2f7940(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x233d2b>=_0x16a877['allowedLoginAttempts']){return utils[_0x1bc0('0x1d')](_0x307c8a,0x0,!![],moment())['then'](function(){return _0x2f7940(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x307c8a,_0x233d2b,![],null)[_0x1bc0('0xd')](function(){return _0x2f7940(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x2f7940(null,![],{'message':_0x1bc0('0x17')});}}else{if(_0x307c8a[_0x1bc0('0x1e')]){return _0x2f7940(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x16a877[_0x1bc0('0x18')]>0x0){if(_0x307c8a[_0x1bc0('0x12')]){if(_0x16a877[_0x1bc0('0x19')]>0x0){if(moment(_0x307c8a[_0x1bc0('0x1a')])['add'](_0x16a877['blockDuration'],_0x1bc0('0x1c'))>moment()){return _0x2f7940(null,![],{'message':_0x1bc0('0x17')});}else{return utils['clearBlockUser'](_0x307c8a,0x0,![],null)['then'](function(){return utils['getLicense'](_0x307c8a);})['then'](function(){return _0x2f7940(null,_0x307c8a);});}}else{return _0x2f7940(null,![],{'message':_0x1bc0('0x17')});}}else{return utils[_0x1bc0('0x1d')](_0x307c8a,0x0,![],null)[_0x1bc0('0xd')](function(){return utils[_0x1bc0('0x1f')](_0x307c8a);})[_0x1bc0('0xd')](function(){return _0x2f7940(null,_0x307c8a);})[_0x1bc0('0x20')](function(_0xb501aa){return _0x2f7940(null,![],_0xb501aa);});}}else{if(_0x307c8a[_0x1bc0('0x12')]){return _0x2f7940(null,![],{'message':_0x1bc0('0x17')});}else{return utils[_0x1bc0('0x1f')](_0x307c8a)['then'](function(){return _0x2f7940(null,_0x307c8a);});}}}});})[_0x1bc0('0x20')](function(_0xba5492){return _0x2f7940(null,![],_0xba5492);});}function sendServiceMail(_0x19ea66){return db['MailAccount'][_0x1bc0('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0x1bc0('0x22')],'include':[{'model':db[_0x1bc0('0x23')],'as':'Smtp'}]})[_0x1bc0('0xd')](function(_0x596e74){if(!_0x596e74){throw new Error(_0x1bc0('0x24'));}var _0x141bef={'tls':{'rejectUnauthorized':![]}};if(_0x596e74[_0x1bc0('0x25')][_0x1bc0('0x26')]){_0x141bef[_0x1bc0('0x26')]=_0x596e74[_0x1bc0('0x25')][_0x1bc0('0x26')];}else{_0x141bef['host']=_0x596e74[_0x1bc0('0x25')]['host'];_0x141bef[_0x1bc0('0x27')]=_0x596e74[_0x1bc0('0x25')]['port'];_0x141bef[_0x1bc0('0x28')]=_0x596e74[_0x1bc0('0x25')][_0x1bc0('0x28')];}if(_0x596e74['Smtp'][_0x1bc0('0x29')]){_0x141bef[_0x1bc0('0x2a')]={'user':_0x596e74[_0x1bc0('0x25')]['user'],'pass':_0x596e74['Smtp'][_0x1bc0('0x2b')]};}var _0x469dc7={'account':_0x141bef,'message':_['merge']({'from':util[_0x1bc0('0x2c')](_0x1bc0('0x2d'),_0x596e74['name'],_0x596e74[_0x1bc0('0x22')]||_0x596e74[_0x1bc0('0x25')][_0x1bc0('0x15')])},_0x19ea66)};return client[_0x1bc0('0x2e')](_0x1bc0('0x2f'),_0x469dc7);})['then'](function(_0x4867bc){if(_0x4867bc[_0x1bc0('0x30')]){throw new Error(util[_0x1bc0('0x2c')](_0x1bc0('0x31'),_0x4867bc[_0x1bc0('0x30')]['message']||JSON['stringify'](_0x4867bc[_0x1bc0('0x30')])));}return!![];});}function handleError(_0x1ee44d,_0x4a5241,_0x446778){return _0x1ee44d['status'](_0x4a5241||0x1f4)['send']({'message':_0x446778?_0x446778['message']||_0x446778:''});}exports[_0x1bc0('0x32')]=function(_0x1ea3c1,_0x234d42,_0x3a6ef3){passport[_0x1bc0('0x33')](_0x1bc0('0x34'),function(_0x5ed5bf,_0x1b66f6,_0x3830b4){var _0x57dff6=_0x5ed5bf||_0x3830b4;if(_0x57dff6){return handleError(_0x234d42,0x191,_0x57dff6);}if(!_0x1b66f6){return handleError(_0x234d42,0x194,{'message':_0x1bc0('0x35')});}else{var _0xe2cdb0={'payload':{'id':_0x1b66f6['id'],'role':_0x1b66f6[_0x1bc0('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x1bc0('0x36')](_0xe2cdb0)[_0x1bc0('0xd')](function(_0x4515cd){_0x234d42[_0x1bc0('0x37')]({'id':_0x1b66f6['id'],'token':_0x4515cd,'statusCall':'','isAlreadyLogged':_0x1b66f6[_0x1bc0('0x38')]});});}})(_0x1ea3c1,_0x234d42,_0x3a6ef3);};exports[_0x1bc0('0x39')]=function(_0x5dfefe,_0x2c86d5,_0x47f180){if(!_0x5dfefe[_0x1bc0('0x3a')][_0x1bc0('0x22')]){return handleError(_0x2c86d5,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x3dde3b=rs[_0x1bc0('0x3b')]();_0x5dfefe[_0x1bc0('0x3a')]['email']=_0x5dfefe['body'][_0x1bc0('0x22')][_0x1bc0('0x3c')]()[_0x1bc0('0x3d')]();var _0x2f7f3b;return db['Setting'][_0x1bc0('0xc')]({'where':{'id':0x1},'attributes':[_0x1bc0('0x18'),_0x1bc0('0x19')],'raw':!![]})[_0x1bc0('0xd')](function(_0x4b7a98){_0x2f7f3b=_0x4b7a98;return db[_0x1bc0('0x3e')][_0x1bc0('0x21')]({'where':{'email':_0x5dfefe[_0x1bc0('0x3a')][_0x1bc0('0x22')]}});})['then'](function(_0x3486a9){if(!_0x3486a9){throw new Error(_0x1bc0('0x3f'));}if(_0x3486a9[_0x1bc0('0x1e')]){throw new Error(_0x1bc0('0x40'));}if(_0x3486a9[_0x1bc0('0x12')]){if(moment(_0x3486a9[_0x1bc0('0x1a')])[_0x1bc0('0x1b')](_0x2f7f3b[_0x1bc0('0x19')],_0x1bc0('0x1c'))>moment()){throw new Error(_0x1bc0('0x41'));}else{_0x3486a9[_0x1bc0('0x12')]=![];_0x3486a9[_0x1bc0('0x1a')]=null;}}_0x3486a9[_0x1bc0('0x42')]=_0x3dde3b;_0x3486a9[_0x1bc0('0x43')]=Date[_0x1bc0('0x44')]()+0x36ee80;return _0x3486a9['save']();})[_0x1bc0('0xd')](function(){return sendServiceMail({'to':_0x5dfefe[_0x1bc0('0x3a')][_0x1bc0('0x22')],'subject':_0x1bc0('0x45'),'text':_0x1bc0('0x46')+_0x1bc0('0x47')+_0x1bc0('0x48')+_0x5dfefe[_0x1bc0('0x49')][_0x1bc0('0x4a')]+_0x1bc0('0x4b')+_0x3dde3b+'\x0a\x0a'+_0x1bc0('0x4c')});})[_0x1bc0('0xd')](function(){_0x2c86d5[_0x1bc0('0x4d')](0xc8)['send']({'message':_0x1bc0('0x4e')});})[_0x1bc0('0x20')](function(_0x46f3b8){return handleError(_0x2c86d5,0x1f4,_0x46f3b8);});};exports[_0x1bc0('0x4f')]=function(_0x2ae10a,_0x578623,_0x1ba4a2){return db['User'][_0x1bc0('0x21')]({'where':{'resetPasswordToken':_0x2ae10a[_0x1bc0('0x50')][_0x1bc0('0x51')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x295a24){if(!_0x295a24){throw new Error(_0x1bc0('0x52'));}return db['Setting'][_0x1bc0('0xc')]({'attributes':['id',_0x1bc0('0x53'),'enforcePasswordHistory',_0x1bc0('0x54')]})[_0x1bc0('0xd')](function(_0xb40a37){if(_0xb40a37['securePassword'])authService['validatePasswordPattern'](_0x2ae10a[_0x1bc0('0x3a')]['password']);if(!_0xb40a37[_0x1bc0('0x55')]||!_0x295a24[_0x1bc0('0x56')])return _0x295a24;authService[_0x1bc0('0x57')](_0x2ae10a[_0x1bc0('0x3a')][_0x1bc0('0xf')],_0x295a24[_0x1bc0('0x56')],_0xb40a37['passwordHistoryLimit']);return _0x295a24;})['then'](function(){_0x295a24['password']=_0x2ae10a[_0x1bc0('0x3a')][_0x1bc0('0xf')];_0x295a24[_0x1bc0('0x42')]=null;_0x295a24['resetPasswordExpires']=null;return _0x295a24[_0x1bc0('0x58')]();});})['then'](function(){_0x578623[_0x1bc0('0x4d')](0xc8)[_0x1bc0('0x59')]({'message':_0x1bc0('0x5a')});})[_0x1bc0('0x20')](function(_0x5c668d){return handleError(_0x578623,0x1f4,_0x5c668d);});};passport[_0x1bc0('0x5b')](new LocalStrategy({'usernameField':_0x1bc0('0xe'),'passwordField':_0x1bc0('0xf')},function(_0x4ec1c2,_0xf0e21,_0x4ed10c){return localAuthenticate(db['User'],_0x4ec1c2,_0xf0e21,_0x4ed10c);}));
\ No newline at end of file
+var _0x6bc9=['util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','allowedLoginAttempts','blockDuration','findOne','name','password','salt','role','disabled','blocked','blockedAt','admin','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','user','pass','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','send','message','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','enforcePasswordHistory','validatePasswordHistory','Password\x20reset!','use'];(function(_0x3f2695,_0x4f6e5f){var _0x405993=function(_0x170912){while(--_0x170912){_0x3f2695['push'](_0x3f2695['shift']());}};_0x405993(++_0x4f6e5f);}(_0x6bc9,0x1c2));var _0x96bc=function(_0x2b152a,_0x3dd988){_0x2b152a=_0x2b152a-0x0;var _0x2ad4c7=_0x6bc9[_0x2b152a];return _0x2ad4c7;};'use strict';var util=require(_0x96bc('0x0'));var passport=require(_0x96bc('0x1'));var LocalStrategy=require('passport-local')[_0x96bc('0x2')];var jayson=require(_0x96bc('0x3'));var _=require(_0x96bc('0x4'));var rs=require(_0x96bc('0x5'));var moment=require(_0x96bc('0x6'));var db=require(_0x96bc('0x7'))['db'];var authService=require(_0x96bc('0x8'));var utils=require(_0x96bc('0x9'));var client=jayson['client'][_0x96bc('0xa')]({'port':0x232b});function localAuthenticate(_0x5afeba,_0x4f5a48,_0x6ab158,_0x5059ec){var _0x330839,_0x3166fe;return db[_0x96bc('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x96bc('0xc'),_0x96bc('0xd')],'raw':!![]})['then'](function(_0xa8688a){_0x330839=_0xa8688a;return _0x5afeba[_0x96bc('0xe')]({'attributes':['id',_0x96bc('0xf'),_0x96bc('0x10'),_0x96bc('0x11'),_0x96bc('0x12'),_0x96bc('0x13'),_0x96bc('0x14'),_0x96bc('0x15'),'loginAttempts'],'where':{'name':_0x4f5a48,'role':{'$or':[_0x96bc('0x16'),'user',_0x96bc('0x17')]}}});})[_0x96bc('0x18')](function(_0xf131bc){if(!_0xf131bc||_0xf131bc&&_0xf131bc['name']!==_0x4f5a48){throw new Error(_0x96bc('0x19'));}else{_0x3166fe=_0xf131bc;return _0x3166fe;}})['then'](function(){_0x3166fe[_0x96bc('0x1a')](_0x6ab158,function(_0x19a33b,_0x4e13da){var _0x4df295=_0x3166fe[_0x96bc('0x1b')]+0x1;if(_0x19a33b){return _0x5059ec(_0x19a33b);}else if(!_0x4e13da){if(_0x3166fe[_0x96bc('0x13')]){return _0x5059ec(null,![],{'message':_0x96bc('0x19')});}else if(_0x330839[_0x96bc('0xc')]>0x0){if(_0x3166fe['blocked']){if(_0x330839[_0x96bc('0xd')]>0x0){if(moment(_0x3166fe[_0x96bc('0x15')])[_0x96bc('0x1c')](_0x330839[_0x96bc('0xd')],_0x96bc('0x1d'))>moment()){return _0x5059ec(null,![],{'message':_0x96bc('0x19')});}else{return utils[_0x96bc('0x1e')](_0x3166fe,_0x4df295,![],null)['then'](function(){return _0x5059ec(null,![],{'message':_0x96bc('0x19')});});}}else{return _0x5059ec(null,![],{'message':_0x96bc('0x19')});}}else{if(_0x4df295>=_0x330839['allowedLoginAttempts']){return utils['clearBlockUser'](_0x3166fe,0x0,!![],moment())[_0x96bc('0x18')](function(){return _0x5059ec(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x3166fe,_0x4df295,![],null)['then'](function(){return _0x5059ec(null,![],{'message':_0x96bc('0x19')});});}}}else{return _0x5059ec(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3166fe[_0x96bc('0x13')]){return _0x5059ec(null,![],{'message':_0x96bc('0x19')});}else if(_0x330839['allowedLoginAttempts']>0x0){if(_0x3166fe[_0x96bc('0x14')]){if(_0x330839[_0x96bc('0xd')]>0x0){if(moment(_0x3166fe[_0x96bc('0x15')])[_0x96bc('0x1c')](_0x330839[_0x96bc('0xd')],'minutes')>moment()){return _0x5059ec(null,![],{'message':_0x96bc('0x19')});}else{return utils['clearBlockUser'](_0x3166fe,0x0,![],null)[_0x96bc('0x18')](function(){return utils[_0x96bc('0x1f')](_0x3166fe);})['then'](function(){return _0x5059ec(null,_0x3166fe);});}}else{return _0x5059ec(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x3166fe,0x0,![],null)['then'](function(){return utils[_0x96bc('0x1f')](_0x3166fe);})[_0x96bc('0x18')](function(){return _0x5059ec(null,_0x3166fe);})['catch'](function(_0xc51c3c){return _0x5059ec(null,![],_0xc51c3c);});}}else{if(_0x3166fe[_0x96bc('0x14')]){return _0x5059ec(null,![],{'message':_0x96bc('0x19')});}else{return utils['getLicense'](_0x3166fe)[_0x96bc('0x18')](function(){return _0x5059ec(null,_0x3166fe);});}}}});})[_0x96bc('0x20')](function(_0x1ea5af){return _0x5059ec(null,![],_0x1ea5af);});}function sendServiceMail(_0x4342f1){return db[_0x96bc('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0x96bc('0xf'),'email'],'include':[{'model':db[_0x96bc('0x22')],'as':_0x96bc('0x23')}]})['then'](function(_0x30041f){if(!_0x30041f){throw new Error(_0x96bc('0x24'));}var _0x4294a9={'tls':{'rejectUnauthorized':![]}};if(_0x30041f[_0x96bc('0x23')][_0x96bc('0x25')]){_0x4294a9['service']=_0x30041f[_0x96bc('0x23')][_0x96bc('0x25')];}else{_0x4294a9[_0x96bc('0x26')]=_0x30041f[_0x96bc('0x23')]['host'];_0x4294a9[_0x96bc('0x27')]=_0x30041f['Smtp'][_0x96bc('0x27')];_0x4294a9[_0x96bc('0x28')]=_0x30041f[_0x96bc('0x23')][_0x96bc('0x28')];}if(_0x30041f[_0x96bc('0x23')][_0x96bc('0x29')]){_0x4294a9[_0x96bc('0x2a')]={'user':_0x30041f[_0x96bc('0x23')][_0x96bc('0x2b')],'pass':_0x30041f[_0x96bc('0x23')][_0x96bc('0x2c')]};}var _0x186128={'account':_0x4294a9,'message':_[_0x96bc('0x2d')]({'from':util[_0x96bc('0x2e')](_0x96bc('0x2f'),_0x30041f[_0x96bc('0xf')],_0x30041f[_0x96bc('0x30')]||_0x30041f['Smtp'][_0x96bc('0x2b')])},_0x4342f1)};return client[_0x96bc('0x31')](_0x96bc('0x32'),_0x186128);})[_0x96bc('0x18')](function(_0x477842){if(_0x477842[_0x96bc('0x33')]){throw new Error(util[_0x96bc('0x2e')](_0x96bc('0x34'),_0x477842[_0x96bc('0x33')]['message']||JSON['stringify'](_0x477842[_0x96bc('0x33')])));}return!![];});}function handleError(_0x4eacce,_0x57a8bd,_0x26d046){return _0x4eacce[_0x96bc('0x35')](_0x57a8bd||0x1f4)[_0x96bc('0x36')]({'message':_0x26d046?_0x26d046[_0x96bc('0x37')]||_0x26d046:''});}exports['login']=function(_0x4183e0,_0x17d6e5,_0x41d90a){passport[_0x96bc('0x1a')](_0x96bc('0x38'),function(_0x11f52a,_0x316885,_0x15f1a9){var _0x2d424c=_0x11f52a||_0x15f1a9;if(_0x2d424c){return handleError(_0x17d6e5,0x191,_0x2d424c);}if(!_0x316885){return handleError(_0x17d6e5,0x194,{'message':_0x96bc('0x39')});}else{var _0x377456={'payload':{'id':_0x316885['id'],'role':_0x316885[_0x96bc('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x96bc('0x3a')](_0x377456)[_0x96bc('0x18')](function(_0x2173d1){_0x17d6e5['json']({'id':_0x316885['id'],'token':_0x2173d1,'statusCall':'','isAlreadyLogged':_0x316885[_0x96bc('0x3b')]});});}})(_0x4183e0,_0x17d6e5,_0x41d90a);};exports[_0x96bc('0x3c')]=function(_0x1a4e97,_0x2b49f7,_0x2db3d7){if(!_0x1a4e97[_0x96bc('0x3d')]['email']){return handleError(_0x2b49f7,0x1f4,{'message':_0x96bc('0x3e')});}var _0x47b6f6=rs[_0x96bc('0x3f')]();_0x1a4e97[_0x96bc('0x3d')][_0x96bc('0x30')]=_0x1a4e97['body'][_0x96bc('0x30')][_0x96bc('0x40')]()[_0x96bc('0x41')]();var _0x1cc343;return db[_0x96bc('0xb')][_0x96bc('0xe')]({'where':{'id':0x1},'attributes':[_0x96bc('0xc'),_0x96bc('0xd')],'raw':!![]})[_0x96bc('0x18')](function(_0x910a2c){_0x1cc343=_0x910a2c;return db[_0x96bc('0x42')][_0x96bc('0x43')]({'where':{'email':_0x1a4e97[_0x96bc('0x3d')]['email']}});})[_0x96bc('0x18')](function(_0x137946){if(!_0x137946){throw new Error(_0x96bc('0x44'));}if(_0x137946['disabled']){throw new Error(_0x96bc('0x45'));}if(_0x137946[_0x96bc('0x14')]){if(moment(_0x137946['blockedAt'])['add'](_0x1cc343[_0x96bc('0xd')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x137946[_0x96bc('0x14')]=![];_0x137946[_0x96bc('0x15')]=null;}}_0x137946[_0x96bc('0x46')]=_0x47b6f6;_0x137946[_0x96bc('0x47')]=Date[_0x96bc('0x48')]()+0x36ee80;return _0x137946[_0x96bc('0x49')]();})['then'](function(){return sendServiceMail({'to':_0x1a4e97[_0x96bc('0x3d')][_0x96bc('0x30')],'subject':_0x96bc('0x4a'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x96bc('0x4b')+_0x96bc('0x4c')+_0x1a4e97[_0x96bc('0x4d')][_0x96bc('0x26')]+_0x96bc('0x4e')+_0x47b6f6+'\x0a\x0a'+_0x96bc('0x4f')});})[_0x96bc('0x18')](function(){_0x2b49f7[_0x96bc('0x35')](0xc8)['send']({'message':_0x96bc('0x50')});})[_0x96bc('0x20')](function(_0x379d97){return handleError(_0x2b49f7,0x1f4,_0x379d97);});};exports['reset']=function(_0x2eade1,_0x826a13,_0x4f8fa4){return db[_0x96bc('0x42')][_0x96bc('0x43')]({'where':{'resetPasswordToken':_0x2eade1[_0x96bc('0x51')][_0x96bc('0x52')],'resetPasswordExpires':{'$gt':Date[_0x96bc('0x48')]()}}})['then'](function(_0x286355){if(!_0x286355){throw new Error(_0x96bc('0x53'));}return db[_0x96bc('0xb')]['findOne']({'attributes':['id',_0x96bc('0x54'),'enforcePasswordHistory',_0x96bc('0x55')]})['then'](function(_0x5e98da){if(_0x5e98da['securePassword'])authService['validatePasswordPattern'](_0x2eade1[_0x96bc('0x3d')][_0x96bc('0x10')]);if(!_0x5e98da[_0x96bc('0x56')]||!_0x286355['previousPasswords'])return _0x286355;authService[_0x96bc('0x57')](_0x2eade1[_0x96bc('0x3d')][_0x96bc('0x10')],_0x286355['previousPasswords'],_0x5e98da['passwordHistoryLimit']);return _0x286355;})['then'](function(){_0x286355[_0x96bc('0x10')]=_0x2eade1[_0x96bc('0x3d')]['password'];_0x286355[_0x96bc('0x46')]=null;_0x286355[_0x96bc('0x47')]=null;return _0x286355['save']();});})['then'](function(){_0x826a13[_0x96bc('0x35')](0xc8)[_0x96bc('0x36')]({'message':_0x96bc('0x58')});})[_0x96bc('0x20')](function(_0x46bd2e){return handleError(_0x826a13,0x1f4,_0x46bd2e);});};passport[_0x96bc('0x59')](new LocalStrategy({'usernameField':_0x96bc('0xf'),'passwordField':_0x96bc('0x10')},function(_0x5aff94,_0x1b11c0,_0x1ca7aa){return localAuthenticate(db[_0x96bc('0x42')],_0x5aff94,_0x1b11c0,_0x1ca7aa);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 4e6f544..406fc1c 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 _0x5531=['reset','exports','express','./authLocal.controller','post','login','/forgot','forgot','/reset/:token'];(function(_0x352b49,_0x16a4ee){var _0x2e314a=function(_0x339d73){while(--_0x339d73){_0x352b49['push'](_0x352b49['shift']());}};_0x2e314a(++_0x16a4ee);}(_0x5531,0x1cd));var _0x1553=function(_0x7f3cac,_0x3a3ebf){_0x7f3cac=_0x7f3cac-0x0;var _0x473692=_0x5531[_0x7f3cac];return _0x473692;};'use strict';var express=require(_0x1553('0x0'));var router=express['Router']();var controller=require(_0x1553('0x1'));router[_0x1553('0x2')]('/',controller[_0x1553('0x3')]);router[_0x1553('0x2')](_0x1553('0x4'),controller[_0x1553('0x5')]);router['post'](_0x1553('0x6'),controller[_0x1553('0x7')]);module[_0x1553('0x8')]=router;
\ No newline at end of file
+var _0x11ad=['login','/reset/:token','exports','express','./authLocal.controller','post'];(function(_0x301064,_0x1b5aa3){var _0x294f02=function(_0x39f98b){while(--_0x39f98b){_0x301064['push'](_0x301064['shift']());}};_0x294f02(++_0x1b5aa3);}(_0x11ad,0x12f));var _0xd11a=function(_0x51b475,_0x24beb4){_0x51b475=_0x51b475-0x0;var _0x35ab63=_0x11ad[_0x51b475];return _0x35ab63;};'use strict';var express=require(_0xd11a('0x0'));var router=express['Router']();var controller=require(_0xd11a('0x1'));router[_0xd11a('0x2')]('/',controller[_0xd11a('0x3')]);router[_0xd11a('0x2')]('/forgot',controller['forgot']);router['post'](_0xd11a('0x4'),controller['reset']);module[_0xd11a('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 975b1d9..c04e2bc 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 _0xafe0=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x232533,_0x4f53ef){var _0x17eeb8=function(_0x818dc9){while(--_0x818dc9){_0x232533['push'](_0x232533['shift']());}};_0x17eeb8(++_0x4f53ef);}(_0xafe0,0x151));var _0x0afe=function(_0x54fbed,_0x3c77a7){_0x54fbed=_0x54fbed-0x0;var _0x333bbc=_0xafe0[_0x54fbed];return _0x333bbc;};'use strict';var Sequelize=require(_0x0afe('0x0'));module[_0x0afe('0x1')]={'name':{'type':Sequelize[_0x0afe('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x0afe('0x2')]},'description':{'type':Sequelize[_0x0afe('0x2')]},'status':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0afe('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x6e89=['BOOLEAN','sequelize','exports','STRING'];(function(_0x29e860,_0x1845e8){var _0xb994ef=function(_0x4dcd97){while(--_0x4dcd97){_0x29e860['push'](_0x29e860['shift']());}};_0xb994ef(++_0x1845e8);}(_0x6e89,0x1bd));var _0x96e8=function(_0x23ecc4,_0x243141){_0x23ecc4=_0x23ecc4-0x0;var _0x22ff25=_0x6e89[_0x23ecc4];return _0x22ff25;};'use strict';var Sequelize=require(_0x96e8('0x0'));module[_0x96e8('0x1')]={'name':{'type':Sequelize[_0x96e8('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x96e8('0x2')]},'status':{'type':Sequelize[_0x96e8('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 90d7529..06bfdfc 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 _0x8a2f=['send','index','Automation','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','params','keys','find','create','body','addConditions','Condition','ids','omit','getConditions','addActions','Action','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name'];(function(_0x3adafa,_0x1ff5ea){var _0x229947=function(_0x3ad71b){while(--_0x3ad71b){_0x3adafa['push'](_0x3adafa['shift']());}};_0x229947(++_0x1ff5ea);}(_0x8a2f,0x81));var _0xf8a2=function(_0x42b204,_0x58d8b0){_0x42b204=_0x42b204-0x0;var _0xbff449=_0x8a2f[_0x42b204];return _0xbff449;};'use strict';var emlformat=require(_0xf8a2('0x0'));var rimraf=require(_0xf8a2('0x1'));var zipdir=require(_0xf8a2('0x2'));var jsonpatch=require(_0xf8a2('0x3'));var rp=require(_0xf8a2('0x4'));var moment=require(_0xf8a2('0x5'));var BPromise=require(_0xf8a2('0x6'));var Mustache=require(_0xf8a2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf8a2('0x8'));var csv=require('to-csv');var ejs=require(_0xf8a2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf8a2('0xa'));var squel=require(_0xf8a2('0xb'));var crypto=require(_0xf8a2('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf8a2('0xd'));var querystring=require(_0xf8a2('0xe'));var Papa=require(_0xf8a2('0xf'));var Redis=require(_0xf8a2('0x10'));var authService=require(_0xf8a2('0x11'));var qs=require(_0xf8a2('0x12'));var as=require(_0xf8a2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf8a2('0x14'))(_0xf8a2('0x15'));var utils=require(_0xf8a2('0x16'));var config=require(_0xf8a2('0x17'));var licenseUtil=require(_0xf8a2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3597f9,_0x174b4e){_0x174b4e=_0x174b4e||0xcc;return function(_0xc5081e){if(_0xc5081e){return _0x3597f9[_0xf8a2('0x19')](_0x174b4e);}return _0x3597f9['status'](_0x174b4e)['end']();};}function respondWithResult(_0x9997d3,_0x52ad7d){_0x52ad7d=_0x52ad7d||0xc8;return function(_0x3113b9){if(_0x3113b9){return _0x9997d3[_0xf8a2('0x1a')](_0x52ad7d)[_0xf8a2('0x1b')](_0x3113b9);}};}function respondWithFilteredResult(_0xca3bfb,_0x2cb8bd){return function(_0x3c2adc){if(_0x3c2adc){var _0x2e2999=typeof _0x2cb8bd[_0xf8a2('0x1c')]===_0xf8a2('0x1d')&&typeof _0x2cb8bd[_0xf8a2('0x1e')]===_0xf8a2('0x1d');var _0x355d5d=_0x3c2adc[_0xf8a2('0x1f')];var _0x19f6c5=_0x2e2999?0x0:_0x2cb8bd[_0xf8a2('0x1c')];var _0x3abdee=_0x2e2999?_0x3c2adc[_0xf8a2('0x1f')]:_0x2cb8bd[_0xf8a2('0x1c')]+_0x2cb8bd['limit'];var _0x2f9301;if(_0x3abdee>=_0x355d5d){_0x3abdee=_0x355d5d;_0x2f9301=0xc8;}else{_0x2f9301=0xce;}_0xca3bfb[_0xf8a2('0x1a')](_0x2f9301);return _0xca3bfb['set'](_0xf8a2('0x20'),_0x19f6c5+'-'+_0x3abdee+'/'+_0x355d5d)['json'](_0x3c2adc);}return null;};}function patchUpdates(_0x3f0cf5){return function(_0x2d5e98){try{jsonpatch['apply'](_0x2d5e98,_0x3f0cf5,!![]);}catch(_0x386ce7){return BPromise['reject'](_0x386ce7);}return _0x2d5e98[_0xf8a2('0x21')]();};}function saveUpdates(_0x5e25f7,_0x237b8b){return function(_0x1c98be){if(_0x1c98be){return _0x1c98be[_0xf8a2('0x22')](_0x5e25f7)[_0xf8a2('0x23')](function(_0x1d917d){return _0x1d917d;});}return null;};}function removeEntity(_0xf138a6,_0x5d9221){return function(_0x4d80fd){if(_0x4d80fd){return _0x4d80fd[_0xf8a2('0x24')]()['then'](function(){_0xf138a6[_0xf8a2('0x1a')](0xcc)[_0xf8a2('0x25')]();});}};}function handleEntityNotFound(_0x4c44ce,_0x18ab36){return function(_0x58b530){if(!_0x58b530){_0x4c44ce['sendStatus'](0x194);}return _0x58b530;};}function handleError(_0x12f446,_0x1918cd){_0x1918cd=_0x1918cd||0x1f4;return function(_0x403612){logger[_0xf8a2('0x26')](_0x403612[_0xf8a2('0x27')]);if(_0x403612[_0xf8a2('0x28')]){delete _0x403612['name'];}_0x12f446[_0xf8a2('0x1a')](_0x1918cd)[_0xf8a2('0x29')](_0x403612);};}exports[_0xf8a2('0x2a')]=function(_0xf07852,_0x47899e){var _0x589caf={},_0x2c44b2={},_0x13e25a={'count':0x0,'rows':[]};var _0x2b214=_['map'](db[_0xf8a2('0x2b')][_0xf8a2('0x2c')],function(_0x310d84){return{'name':_0x310d84[_0xf8a2('0x2d')],'type':_0x310d84['type'][_0xf8a2('0x2e')]};});_0x2c44b2[_0xf8a2('0x2f')]=_[_0xf8a2('0x30')](_0x2b214,_0xf8a2('0x28'));_0x2c44b2['query']=_['keys'](_0xf07852[_0xf8a2('0x31')]);_0x2c44b2[_0xf8a2('0x32')]=_[_0xf8a2('0x33')](_0x2c44b2[_0xf8a2('0x2f')],_0x2c44b2[_0xf8a2('0x31')]);_0x589caf[_0xf8a2('0x34')]=_[_0xf8a2('0x33')](_0x2c44b2['model'],qs['fields'](_0xf07852['query'][_0xf8a2('0x35')]));_0x589caf['attributes']=_0x589caf[_0xf8a2('0x34')][_0xf8a2('0x36')]?_0x589caf[_0xf8a2('0x34')]:_0x2c44b2[_0xf8a2('0x2f')];if(!_0xf07852[_0xf8a2('0x31')][_0xf8a2('0x37')](_0xf8a2('0x38'))){_0x589caf[_0xf8a2('0x1e')]=qs['limit'](_0xf07852['query']['limit']);_0x589caf[_0xf8a2('0x1c')]=qs[_0xf8a2('0x1c')](_0xf07852['query'][_0xf8a2('0x1c')]);}_0x589caf[_0xf8a2('0x39')]=qs[_0xf8a2('0x3a')](_0xf07852['query']['sort']);_0x589caf['where']=qs[_0xf8a2('0x32')](_[_0xf8a2('0x3b')](_0xf07852[_0xf8a2('0x31')],_0x2c44b2[_0xf8a2('0x32')]),_0x2b214);if(_0xf07852[_0xf8a2('0x31')][_0xf8a2('0x3c')]){_0x589caf['where']=_[_0xf8a2('0x3d')](_0x589caf['where'],{'$or':_['map'](_0x2b214,function(_0x5d5e4b){if(_0x5d5e4b[_0xf8a2('0x3e')]!==_0xf8a2('0x3f')){var _0x5342d9={};_0x5342d9[_0x5d5e4b[_0xf8a2('0x28')]]={'$like':'%'+_0xf07852[_0xf8a2('0x31')][_0xf8a2('0x3c')]+'%'};return _0x5342d9;}})});}_0x589caf=_[_0xf8a2('0x3d')]({},_0x589caf,_0xf07852[_0xf8a2('0x40')]);var _0x236f9a={'where':_0x589caf[_0xf8a2('0x41')]};return db['Automation'][_0xf8a2('0x1f')](_0x236f9a)[_0xf8a2('0x23')](function(_0x11ad1a){_0x13e25a[_0xf8a2('0x1f')]=_0x11ad1a;if(_0xf07852[_0xf8a2('0x31')][_0xf8a2('0x42')]){_0x589caf[_0xf8a2('0x43')]=[{'all':!![]}];}return db['Automation'][_0xf8a2('0x44')](_0x589caf);})[_0xf8a2('0x23')](function(_0x20d12a){_0x13e25a[_0xf8a2('0x45')]=_0x20d12a;return _0x13e25a;})[_0xf8a2('0x23')](respondWithFilteredResult(_0x47899e,_0x589caf))[_0xf8a2('0x46')](handleError(_0x47899e,null));};exports['show']=function(_0x5863cc,_0x3018c5){var _0x35ac7e={'raw':![],'where':{'id':_0x5863cc[_0xf8a2('0x47')]['id']}},_0x5d3ec7={};_0x5d3ec7[_0xf8a2('0x2f')]=_[_0xf8a2('0x48')](db[_0xf8a2('0x2b')][_0xf8a2('0x2c')]);_0x5d3ec7['query']=_[_0xf8a2('0x48')](_0x5863cc[_0xf8a2('0x31')]);_0x5d3ec7['filters']=_[_0xf8a2('0x33')](_0x5d3ec7[_0xf8a2('0x2f')],_0x5d3ec7[_0xf8a2('0x31')]);_0x35ac7e[_0xf8a2('0x34')]=_[_0xf8a2('0x33')](_0x5d3ec7['model'],qs[_0xf8a2('0x35')](_0x5863cc[_0xf8a2('0x31')][_0xf8a2('0x35')]));_0x35ac7e[_0xf8a2('0x34')]=_0x35ac7e[_0xf8a2('0x34')][_0xf8a2('0x36')]?_0x35ac7e[_0xf8a2('0x34')]:_0x5d3ec7[_0xf8a2('0x2f')];if(_0x5863cc[_0xf8a2('0x31')][_0xf8a2('0x42')]){_0x35ac7e[_0xf8a2('0x43')]=[{'all':!![]}];}_0x35ac7e=_[_0xf8a2('0x3d')]({},_0x35ac7e,_0x5863cc[_0xf8a2('0x40')]);return db[_0xf8a2('0x2b')][_0xf8a2('0x49')](_0x35ac7e)[_0xf8a2('0x23')](handleEntityNotFound(_0x3018c5,null))['then'](respondWithResult(_0x3018c5,null))[_0xf8a2('0x46')](handleError(_0x3018c5,null));};exports[_0xf8a2('0x4a')]=function(_0x1184f2,_0x47f92a){return db[_0xf8a2('0x2b')][_0xf8a2('0x4a')](_0x1184f2[_0xf8a2('0x4b')],{})['then'](respondWithResult(_0x47f92a,0xc9))[_0xf8a2('0x46')](handleError(_0x47f92a,null));};exports[_0xf8a2('0x22')]=function(_0xfec5a3,_0x9af4c8){if(_0xfec5a3[_0xf8a2('0x4b')]['id']){delete _0xfec5a3[_0xf8a2('0x4b')]['id'];}return db['Automation'][_0xf8a2('0x49')]({'where':{'id':_0xfec5a3[_0xf8a2('0x47')]['id']}})[_0xf8a2('0x23')](handleEntityNotFound(_0x9af4c8,null))[_0xf8a2('0x23')](saveUpdates(_0xfec5a3[_0xf8a2('0x4b')],null))[_0xf8a2('0x23')](respondWithResult(_0x9af4c8,null))[_0xf8a2('0x46')](handleError(_0x9af4c8,null));};exports['destroy']=function(_0x54561b,_0x82445a){return db['Automation'][_0xf8a2('0x49')]({'where':{'id':_0x54561b[_0xf8a2('0x47')]['id']}})[_0xf8a2('0x23')](handleEntityNotFound(_0x82445a,null))['then'](removeEntity(_0x82445a,null))[_0xf8a2('0x46')](handleError(_0x82445a,null));};exports[_0xf8a2('0x4c')]=function(_0x76ff46,_0x9fe5f4,_0x431c0b){return db[_0xf8a2('0x4d')][_0xf8a2('0x49')]({'where':{'id':_0x76ff46[_0xf8a2('0x47')]['id']}})['then'](handleEntityNotFound(_0x9fe5f4,null))[_0xf8a2('0x23')](function(_0x1ebcef){if(_0x1ebcef){return _0x1ebcef[_0xf8a2('0x4c')](_0x76ff46[_0xf8a2('0x4b')][_0xf8a2('0x4e')],_[_0xf8a2('0x4f')](_0x76ff46['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x9fe5f4,null))[_0xf8a2('0x46')](handleError(_0x9fe5f4,null));};exports[_0xf8a2('0x50')]=function(_0xfd45f,_0x3b110c,_0x24689d){var _0x4868c9={};var _0x39301b={};var _0xdc461f;var _0x3aa1a5;return db[_0xf8a2('0x2b')]['findOne']({'where':{'id':_0xfd45f[_0xf8a2('0x47')]['id']}})[_0xf8a2('0x23')](handleEntityNotFound(_0x3b110c,null))['then'](function(_0x263572){if(_0x263572){_0xdc461f=_0x263572;_0x39301b['model']=_[_0xf8a2('0x48')](db[_0xf8a2('0x4d')]['rawAttributes']);_0x39301b[_0xf8a2('0x31')]=_[_0xf8a2('0x48')](_0xfd45f['query']);_0x39301b['filters']=_['intersection'](_0x39301b[_0xf8a2('0x2f')],_0x39301b[_0xf8a2('0x31')]);_0x4868c9['attributes']=_[_0xf8a2('0x33')](_0x39301b['model'],qs[_0xf8a2('0x35')](_0xfd45f[_0xf8a2('0x31')][_0xf8a2('0x35')]));_0x4868c9[_0xf8a2('0x34')]=_0x4868c9['attributes'][_0xf8a2('0x36')]?_0x4868c9['attributes']:_0x39301b[_0xf8a2('0x2f')];_0x4868c9['order']=qs['sort'](_0xfd45f['query']['sort']);_0x4868c9['where']=qs[_0xf8a2('0x32')](_['pick'](_0xfd45f[_0xf8a2('0x31')],_0x39301b[_0xf8a2('0x32')]));if(_0xfd45f[_0xf8a2('0x31')][_0xf8a2('0x3c')]){_0x4868c9[_0xf8a2('0x41')]=_[_0xf8a2('0x3d')](_0x4868c9[_0xf8a2('0x41')],{'$or':_[_0xf8a2('0x30')](_0x4868c9[_0xf8a2('0x34')],function(_0xe17f8b){var _0xafd46e={};_0xafd46e[_0xe17f8b]={'$like':'%'+_0xfd45f['query'][_0xf8a2('0x3c')]+'%'};return _0xafd46e;})});}_0x4868c9=_[_0xf8a2('0x3d')]({},_0x4868c9,_0xfd45f[_0xf8a2('0x40')]);return _0xdc461f[_0xf8a2('0x50')](_0x4868c9);}})[_0xf8a2('0x23')](function(_0x521975){if(_0x521975){_0x3aa1a5=_0x521975[_0xf8a2('0x36')];if(!_0xfd45f['query'][_0xf8a2('0x37')]('nolimit')){_0x4868c9[_0xf8a2('0x1e')]=qs[_0xf8a2('0x1e')](_0xfd45f['query'][_0xf8a2('0x1e')]);_0x4868c9[_0xf8a2('0x1c')]=qs[_0xf8a2('0x1c')](_0xfd45f[_0xf8a2('0x31')]['offset']);}return _0xdc461f['getConditions'](_0x4868c9);}})['then'](function(_0x419f29){if(_0x419f29){return _0x419f29?{'count':_0x3aa1a5,'rows':_0x419f29}:null;}})['then'](respondWithResult(_0x3b110c,null))[_0xf8a2('0x46')](handleError(_0x3b110c,null));};exports[_0xf8a2('0x51')]=function(_0x557121,_0x277430,_0x33acca){return db[_0xf8a2('0x52')][_0xf8a2('0x49')]({'where':{'id':_0x557121['params']['id']}})[_0xf8a2('0x23')](handleEntityNotFound(_0x277430,null))['then'](function(_0x43c6ae){if(_0x43c6ae){return _0x43c6ae[_0xf8a2('0x51')](_0x557121[_0xf8a2('0x4b')]['ids'],_['omit'](_0x557121[_0xf8a2('0x4b')],[_0xf8a2('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x277430,null))[_0xf8a2('0x46')](handleError(_0x277430,null));};exports[_0xf8a2('0x53')]=function(_0x1c307b,_0x1c0a3c,_0x4da5f1){var _0x26c8fc={};var _0x58591d={};var _0xf2f9b1;var _0x2fba48;return db[_0xf8a2('0x2b')][_0xf8a2('0x54')]({'where':{'id':_0x1c307b['params']['id']}})[_0xf8a2('0x23')](handleEntityNotFound(_0x1c0a3c,null))[_0xf8a2('0x23')](function(_0x5c5da7){if(_0x5c5da7){_0xf2f9b1=_0x5c5da7;_0x58591d[_0xf8a2('0x2f')]=_[_0xf8a2('0x48')](db[_0xf8a2('0x52')][_0xf8a2('0x2c')]);_0x58591d[_0xf8a2('0x31')]=_[_0xf8a2('0x48')](_0x1c307b[_0xf8a2('0x31')]);_0x58591d[_0xf8a2('0x32')]=_[_0xf8a2('0x33')](_0x58591d[_0xf8a2('0x2f')],_0x58591d[_0xf8a2('0x31')]);_0x26c8fc[_0xf8a2('0x34')]=_[_0xf8a2('0x33')](_0x58591d[_0xf8a2('0x2f')],qs[_0xf8a2('0x35')](_0x1c307b[_0xf8a2('0x31')][_0xf8a2('0x35')]));_0x26c8fc[_0xf8a2('0x34')]=_0x26c8fc[_0xf8a2('0x34')][_0xf8a2('0x36')]?_0x26c8fc[_0xf8a2('0x34')]:_0x58591d['model'];_0x26c8fc[_0xf8a2('0x39')]=qs[_0xf8a2('0x3a')](_0x1c307b['query'][_0xf8a2('0x3a')]);_0x26c8fc['where']=qs['filters'](_[_0xf8a2('0x3b')](_0x1c307b['query'],_0x58591d['filters']));if(_0x1c307b[_0xf8a2('0x31')][_0xf8a2('0x3c')]){_0x26c8fc['where']=_['merge'](_0x26c8fc[_0xf8a2('0x41')],{'$or':_[_0xf8a2('0x30')](_0x26c8fc[_0xf8a2('0x34')],function(_0x47d7e1){var _0x22d3de={};_0x22d3de[_0x47d7e1]={'$like':'%'+_0x1c307b[_0xf8a2('0x31')]['filter']+'%'};return _0x22d3de;})});}_0x26c8fc=_['merge']({},_0x26c8fc,_0x1c307b['options']);return _0xf2f9b1[_0xf8a2('0x53')](_0x26c8fc);}})[_0xf8a2('0x23')](function(_0x566648){if(_0x566648){_0x2fba48=_0x566648[_0xf8a2('0x36')];if(!_0x1c307b[_0xf8a2('0x31')][_0xf8a2('0x37')]('nolimit')){_0x26c8fc[_0xf8a2('0x1e')]=qs['limit'](_0x1c307b[_0xf8a2('0x31')][_0xf8a2('0x1e')]);_0x26c8fc['offset']=qs[_0xf8a2('0x1c')](_0x1c307b[_0xf8a2('0x31')][_0xf8a2('0x1c')]);}return _0xf2f9b1[_0xf8a2('0x53')](_0x26c8fc);}})[_0xf8a2('0x23')](function(_0x1e1d5e){if(_0x1e1d5e){return _0x1e1d5e?{'count':_0x2fba48,'rows':_0x1e1d5e}:null;}})[_0xf8a2('0x23')](respondWithResult(_0x1c0a3c,null))[_0xf8a2('0x46')](handleError(_0x1c0a3c,null));};
\ No newline at end of file
+var _0x7852=['body','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Automation','count','include','findAll','rows','catch','show','params','length','find','create'];(function(_0x261304,_0x2754c3){var _0x4231a6=function(_0x18fa3d){while(--_0x18fa3d){_0x261304['push'](_0x261304['shift']());}};_0x4231a6(++_0x2754c3);}(_0x7852,0x162));var _0x2785=function(_0x1384c1,_0x428311){_0x1384c1=_0x1384c1-0x0;var _0x452d8d=_0x7852[_0x1384c1];return _0x452d8d;};'use strict';var emlformat=require(_0x2785('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2785('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2785('0x2'));var moment=require(_0x2785('0x3'));var BPromise=require(_0x2785('0x4'));var Mustache=require(_0x2785('0x5'));var util=require('util');var path=require(_0x2785('0x6'));var sox=require('sox');var csv=require(_0x2785('0x7'));var ejs=require(_0x2785('0x8'));var fs=require('fs');var fs_extra=require(_0x2785('0x9'));var _=require(_0x2785('0xa'));var squel=require(_0x2785('0xb'));var crypto=require(_0x2785('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2785('0xd'));var Papa=require(_0x2785('0xe'));var Redis=require(_0x2785('0xf'));var authService=require(_0x2785('0x10'));var qs=require(_0x2785('0x11'));var as=require(_0x2785('0x12'));var hardwareService=require(_0x2785('0x13'));var logger=require(_0x2785('0x14'))(_0x2785('0x15'));var utils=require(_0x2785('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2785('0x17'))['db'];function respondWithStatusCode(_0x5d4c3c,_0x5a5d74){_0x5a5d74=_0x5a5d74||0xcc;return function(_0x1c4c1e){if(_0x1c4c1e){return _0x5d4c3c[_0x2785('0x18')](_0x5a5d74);}return _0x5d4c3c[_0x2785('0x19')](_0x5a5d74)[_0x2785('0x1a')]();};}function respondWithResult(_0x3fdb39,_0x50a5e5){_0x50a5e5=_0x50a5e5||0xc8;return function(_0x6a586f){if(_0x6a586f){return _0x3fdb39['status'](_0x50a5e5)[_0x2785('0x1b')](_0x6a586f);}};}function respondWithFilteredResult(_0x2bc743,_0x5cd42a){return function(_0xfd9704){if(_0xfd9704){var _0x1fe771=typeof _0x5cd42a[_0x2785('0x1c')]===_0x2785('0x1d')&&typeof _0x5cd42a['limit']===_0x2785('0x1d');var _0x3043f7=_0xfd9704['count'];var _0x3b7fe7=_0x1fe771?0x0:_0x5cd42a[_0x2785('0x1c')];var _0x9a6d23=_0x1fe771?_0xfd9704['count']:_0x5cd42a[_0x2785('0x1c')]+_0x5cd42a[_0x2785('0x1e')];var _0x2e9cfd;if(_0x9a6d23>=_0x3043f7){_0x9a6d23=_0x3043f7;_0x2e9cfd=0xc8;}else{_0x2e9cfd=0xce;}_0x2bc743['status'](_0x2e9cfd);return _0x2bc743[_0x2785('0x1f')](_0x2785('0x20'),_0x3b7fe7+'-'+_0x9a6d23+'/'+_0x3043f7)[_0x2785('0x1b')](_0xfd9704);}return null;};}function patchUpdates(_0x594340){return function(_0x56f7eb){try{jsonpatch[_0x2785('0x21')](_0x56f7eb,_0x594340,!![]);}catch(_0x2f8d3b){return BPromise[_0x2785('0x22')](_0x2f8d3b);}return _0x56f7eb[_0x2785('0x23')]();};}function saveUpdates(_0x334048,_0x2ec3bd){return function(_0x3e8cf7){if(_0x3e8cf7){return _0x3e8cf7[_0x2785('0x24')](_0x334048)[_0x2785('0x25')](function(_0x415d88){return _0x415d88;});}return null;};}function removeEntity(_0x14581b,_0x5bd57a){return function(_0x6703b8){if(_0x6703b8){return _0x6703b8[_0x2785('0x26')]()['then'](function(){_0x14581b[_0x2785('0x19')](0xcc)[_0x2785('0x1a')]();});}};}function handleEntityNotFound(_0x187707,_0x597c13){return function(_0x123237){if(!_0x123237){_0x187707[_0x2785('0x18')](0x194);}return _0x123237;};}function handleError(_0x17a520,_0x2044a8){_0x2044a8=_0x2044a8||0x1f4;return function(_0xbaf44e){logger[_0x2785('0x27')](_0xbaf44e[_0x2785('0x28')]);if(_0xbaf44e[_0x2785('0x29')]){delete _0xbaf44e['name'];}_0x17a520[_0x2785('0x19')](_0x2044a8)[_0x2785('0x2a')](_0xbaf44e);};}exports[_0x2785('0x2b')]=function(_0x17ed78,_0x23da3e){var _0x4adc16={},_0x525dc6={},_0x100f45={'count':0x0,'rows':[]};var _0x124256=_[_0x2785('0x2c')](db['Automation'][_0x2785('0x2d')],function(_0x4fa28d){return{'name':_0x4fa28d[_0x2785('0x2e')],'type':_0x4fa28d[_0x2785('0x2f')][_0x2785('0x30')]};});_0x525dc6['model']=_['map'](_0x124256,_0x2785('0x29'));_0x525dc6[_0x2785('0x31')]=_[_0x2785('0x32')](_0x17ed78[_0x2785('0x31')]);_0x525dc6[_0x2785('0x33')]=_[_0x2785('0x34')](_0x525dc6[_0x2785('0x35')],_0x525dc6[_0x2785('0x31')]);_0x4adc16[_0x2785('0x36')]=_['intersection'](_0x525dc6[_0x2785('0x35')],qs[_0x2785('0x37')](_0x17ed78['query'][_0x2785('0x37')]));_0x4adc16[_0x2785('0x36')]=_0x4adc16['attributes']['length']?_0x4adc16['attributes']:_0x525dc6[_0x2785('0x35')];if(!_0x17ed78[_0x2785('0x31')][_0x2785('0x38')](_0x2785('0x39'))){_0x4adc16[_0x2785('0x1e')]=qs[_0x2785('0x1e')](_0x17ed78[_0x2785('0x31')][_0x2785('0x1e')]);_0x4adc16[_0x2785('0x1c')]=qs[_0x2785('0x1c')](_0x17ed78[_0x2785('0x31')]['offset']);}_0x4adc16[_0x2785('0x3a')]=qs[_0x2785('0x3b')](_0x17ed78[_0x2785('0x31')][_0x2785('0x3b')]);_0x4adc16[_0x2785('0x3c')]=qs['filters'](_[_0x2785('0x3d')](_0x17ed78['query'],_0x525dc6[_0x2785('0x33')]),_0x124256);if(_0x17ed78['query'][_0x2785('0x3e')]){_0x4adc16[_0x2785('0x3c')]=_[_0x2785('0x3f')](_0x4adc16[_0x2785('0x3c')],{'$or':_['map'](_0x124256,function(_0x258970){if(_0x258970[_0x2785('0x2f')]!=='VIRTUAL'){var _0xce4297={};_0xce4297[_0x258970[_0x2785('0x29')]]={'$like':'%'+_0x17ed78[_0x2785('0x31')][_0x2785('0x3e')]+'%'};return _0xce4297;}})});}_0x4adc16=_[_0x2785('0x3f')]({},_0x4adc16,_0x17ed78[_0x2785('0x40')]);var _0x6551cb={'where':_0x4adc16['where']};return db[_0x2785('0x41')][_0x2785('0x42')](_0x6551cb)[_0x2785('0x25')](function(_0x582959){_0x100f45[_0x2785('0x42')]=_0x582959;if(_0x17ed78[_0x2785('0x31')]['includeAll']){_0x4adc16[_0x2785('0x43')]=[{'all':!![]}];}return db['Automation'][_0x2785('0x44')](_0x4adc16);})[_0x2785('0x25')](function(_0x483100){_0x100f45[_0x2785('0x45')]=_0x483100;return _0x100f45;})['then'](respondWithFilteredResult(_0x23da3e,_0x4adc16))[_0x2785('0x46')](handleError(_0x23da3e,null));};exports[_0x2785('0x47')]=function(_0xf39ee7,_0xe6b887){var _0x1ee3a5={'raw':![],'where':{'id':_0xf39ee7[_0x2785('0x48')]['id']}},_0x1bf107={};_0x1bf107[_0x2785('0x35')]=_['keys'](db[_0x2785('0x41')]['rawAttributes']);_0x1bf107['query']=_[_0x2785('0x32')](_0xf39ee7[_0x2785('0x31')]);_0x1bf107[_0x2785('0x33')]=_['intersection'](_0x1bf107['model'],_0x1bf107[_0x2785('0x31')]);_0x1ee3a5[_0x2785('0x36')]=_['intersection'](_0x1bf107[_0x2785('0x35')],qs[_0x2785('0x37')](_0xf39ee7[_0x2785('0x31')][_0x2785('0x37')]));_0x1ee3a5['attributes']=_0x1ee3a5[_0x2785('0x36')][_0x2785('0x49')]?_0x1ee3a5[_0x2785('0x36')]:_0x1bf107[_0x2785('0x35')];if(_0xf39ee7[_0x2785('0x31')]['includeAll']){_0x1ee3a5[_0x2785('0x43')]=[{'all':!![]}];}_0x1ee3a5=_['merge']({},_0x1ee3a5,_0xf39ee7[_0x2785('0x40')]);return db[_0x2785('0x41')][_0x2785('0x4a')](_0x1ee3a5)[_0x2785('0x25')](handleEntityNotFound(_0xe6b887,null))['then'](respondWithResult(_0xe6b887,null))[_0x2785('0x46')](handleError(_0xe6b887,null));};exports[_0x2785('0x4b')]=function(_0x199cac,_0x447900){return db[_0x2785('0x41')][_0x2785('0x4b')](_0x199cac[_0x2785('0x4c')],{})[_0x2785('0x25')](respondWithResult(_0x447900,0xc9))[_0x2785('0x46')](handleError(_0x447900,null));};exports['update']=function(_0x5142ef,_0x8b2cbe){if(_0x5142ef[_0x2785('0x4c')]['id']){delete _0x5142ef[_0x2785('0x4c')]['id'];}return db[_0x2785('0x41')][_0x2785('0x4a')]({'where':{'id':_0x5142ef[_0x2785('0x48')]['id']}})[_0x2785('0x25')](handleEntityNotFound(_0x8b2cbe,null))[_0x2785('0x25')](saveUpdates(_0x5142ef['body'],null))[_0x2785('0x25')](respondWithResult(_0x8b2cbe,null))[_0x2785('0x46')](handleError(_0x8b2cbe,null));};exports[_0x2785('0x26')]=function(_0x2db0e1,_0x1850b1){return db[_0x2785('0x41')]['find']({'where':{'id':_0x2db0e1[_0x2785('0x48')]['id']}})['then'](handleEntityNotFound(_0x1850b1,null))['then'](removeEntity(_0x1850b1,null))[_0x2785('0x46')](handleError(_0x1850b1,null));};exports[_0x2785('0x4d')]=function(_0x1c42bc,_0x287f8c,_0x392df8){return db[_0x2785('0x4e')][_0x2785('0x4a')]({'where':{'id':_0x1c42bc[_0x2785('0x48')]['id']}})['then'](handleEntityNotFound(_0x287f8c,null))[_0x2785('0x25')](function(_0x5b229e){if(_0x5b229e){return _0x5b229e[_0x2785('0x4d')](_0x1c42bc['body'][_0x2785('0x4f')],_[_0x2785('0x50')](_0x1c42bc[_0x2785('0x4c')],[_0x2785('0x4f'),'id'])||{});}})[_0x2785('0x25')](respondWithResult(_0x287f8c,null))[_0x2785('0x46')](handleError(_0x287f8c,null));};exports[_0x2785('0x51')]=function(_0x5d3229,_0x33d476,_0x560bde){var _0x5e0d75={};var _0xea1ed0={};var _0x58fadc;var _0xfd0ce3;return db[_0x2785('0x41')][_0x2785('0x52')]({'where':{'id':_0x5d3229[_0x2785('0x48')]['id']}})[_0x2785('0x25')](handleEntityNotFound(_0x33d476,null))[_0x2785('0x25')](function(_0x592450){if(_0x592450){_0x58fadc=_0x592450;_0xea1ed0[_0x2785('0x35')]=_['keys'](db[_0x2785('0x4e')][_0x2785('0x2d')]);_0xea1ed0[_0x2785('0x31')]=_[_0x2785('0x32')](_0x5d3229['query']);_0xea1ed0[_0x2785('0x33')]=_[_0x2785('0x34')](_0xea1ed0[_0x2785('0x35')],_0xea1ed0[_0x2785('0x31')]);_0x5e0d75[_0x2785('0x36')]=_[_0x2785('0x34')](_0xea1ed0['model'],qs[_0x2785('0x37')](_0x5d3229['query'][_0x2785('0x37')]));_0x5e0d75['attributes']=_0x5e0d75[_0x2785('0x36')][_0x2785('0x49')]?_0x5e0d75[_0x2785('0x36')]:_0xea1ed0[_0x2785('0x35')];_0x5e0d75['order']=qs[_0x2785('0x3b')](_0x5d3229['query'][_0x2785('0x3b')]);_0x5e0d75['where']=qs[_0x2785('0x33')](_[_0x2785('0x3d')](_0x5d3229[_0x2785('0x31')],_0xea1ed0[_0x2785('0x33')]));if(_0x5d3229[_0x2785('0x31')][_0x2785('0x3e')]){_0x5e0d75[_0x2785('0x3c')]=_[_0x2785('0x3f')](_0x5e0d75[_0x2785('0x3c')],{'$or':_['map'](_0x5e0d75['attributes'],function(_0x1b6ff9){var _0x87f69c={};_0x87f69c[_0x1b6ff9]={'$like':'%'+_0x5d3229[_0x2785('0x31')][_0x2785('0x3e')]+'%'};return _0x87f69c;})});}_0x5e0d75=_[_0x2785('0x3f')]({},_0x5e0d75,_0x5d3229['options']);return _0x58fadc[_0x2785('0x51')](_0x5e0d75);}})[_0x2785('0x25')](function(_0x2eb481){if(_0x2eb481){_0xfd0ce3=_0x2eb481[_0x2785('0x49')];if(!_0x5d3229[_0x2785('0x31')][_0x2785('0x38')](_0x2785('0x39'))){_0x5e0d75[_0x2785('0x1e')]=qs[_0x2785('0x1e')](_0x5d3229[_0x2785('0x31')][_0x2785('0x1e')]);_0x5e0d75[_0x2785('0x1c')]=qs['offset'](_0x5d3229[_0x2785('0x31')][_0x2785('0x1c')]);}return _0x58fadc[_0x2785('0x51')](_0x5e0d75);}})[_0x2785('0x25')](function(_0x36295f){if(_0x36295f){return _0x36295f?{'count':_0xfd0ce3,'rows':_0x36295f}:null;}})[_0x2785('0x25')](respondWithResult(_0x33d476,null))['catch'](handleError(_0x33d476,null));};exports[_0x2785('0x53')]=function(_0x200932,_0x2f1bdf,_0x41a93b){return db[_0x2785('0x54')][_0x2785('0x4a')]({'where':{'id':_0x200932[_0x2785('0x48')]['id']}})[_0x2785('0x25')](handleEntityNotFound(_0x2f1bdf,null))[_0x2785('0x25')](function(_0x55bf05){if(_0x55bf05){return _0x55bf05[_0x2785('0x53')](_0x200932[_0x2785('0x4c')][_0x2785('0x4f')],_[_0x2785('0x50')](_0x200932[_0x2785('0x4c')],[_0x2785('0x4f'),'id'])||{});}})[_0x2785('0x25')](respondWithResult(_0x2f1bdf,null))[_0x2785('0x46')](handleError(_0x2f1bdf,null));};exports['getActions']=function(_0x1df0f9,_0x413369,_0x267ab4){var _0x35af52={};var _0x4d55d5={};var _0x3c9f7e;var _0x31e4b9;return db['Automation']['findOne']({'where':{'id':_0x1df0f9['params']['id']}})[_0x2785('0x25')](handleEntityNotFound(_0x413369,null))[_0x2785('0x25')](function(_0x51827c){if(_0x51827c){_0x3c9f7e=_0x51827c;_0x4d55d5[_0x2785('0x35')]=_[_0x2785('0x32')](db['Action']['rawAttributes']);_0x4d55d5[_0x2785('0x31')]=_[_0x2785('0x32')](_0x1df0f9[_0x2785('0x31')]);_0x4d55d5[_0x2785('0x33')]=_['intersection'](_0x4d55d5[_0x2785('0x35')],_0x4d55d5[_0x2785('0x31')]);_0x35af52['attributes']=_[_0x2785('0x34')](_0x4d55d5[_0x2785('0x35')],qs[_0x2785('0x37')](_0x1df0f9[_0x2785('0x31')][_0x2785('0x37')]));_0x35af52[_0x2785('0x36')]=_0x35af52[_0x2785('0x36')]['length']?_0x35af52['attributes']:_0x4d55d5[_0x2785('0x35')];_0x35af52[_0x2785('0x3a')]=qs[_0x2785('0x3b')](_0x1df0f9['query'][_0x2785('0x3b')]);_0x35af52['where']=qs[_0x2785('0x33')](_[_0x2785('0x3d')](_0x1df0f9[_0x2785('0x31')],_0x4d55d5[_0x2785('0x33')]));if(_0x1df0f9[_0x2785('0x31')][_0x2785('0x3e')]){_0x35af52[_0x2785('0x3c')]=_[_0x2785('0x3f')](_0x35af52[_0x2785('0x3c')],{'$or':_[_0x2785('0x2c')](_0x35af52['attributes'],function(_0x5cb470){var _0x25dc33={};_0x25dc33[_0x5cb470]={'$like':'%'+_0x1df0f9[_0x2785('0x31')][_0x2785('0x3e')]+'%'};return _0x25dc33;})});}_0x35af52=_[_0x2785('0x3f')]({},_0x35af52,_0x1df0f9[_0x2785('0x40')]);return _0x3c9f7e[_0x2785('0x55')](_0x35af52);}})['then'](function(_0x1df078){if(_0x1df078){_0x31e4b9=_0x1df078[_0x2785('0x49')];if(!_0x1df0f9[_0x2785('0x31')][_0x2785('0x38')](_0x2785('0x39'))){_0x35af52['limit']=qs[_0x2785('0x1e')](_0x1df0f9[_0x2785('0x31')][_0x2785('0x1e')]);_0x35af52['offset']=qs[_0x2785('0x1c')](_0x1df0f9[_0x2785('0x31')][_0x2785('0x1c')]);}return _0x3c9f7e[_0x2785('0x55')](_0x35af52);}})[_0x2785('0x25')](function(_0x405a28){if(_0x405a28){return _0x405a28?{'count':_0x31e4b9,'rows':_0x405a28}:null;}})['then'](respondWithResult(_0x413369,null))['catch'](handleError(_0x413369,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index b933804..a82e4ba 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 _0x6335=['./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x49fae9,_0x48058e){var _0x231b71=function(_0x3b891e){while(--_0x3b891e){_0x49fae9['push'](_0x49fae9['shift']());}};_0x231b71(++_0x48058e);}(_0x6335,0x1cc));var _0x5633=function(_0x338aca,_0x52c9ac){_0x338aca=_0x338aca-0x0;var _0x172eb8=_0x6335[_0x338aca];return _0x172eb8;};'use strict';var _=require(_0x5633('0x0'));var util=require(_0x5633('0x1'));var logger=require(_0x5633('0x2'))(_0x5633('0x3'));var moment=require(_0x5633('0x4'));var BPromise=require('bluebird');var rp=require(_0x5633('0x5'));var fs=require('fs');var path=require(_0x5633('0x6'));var rimraf=require(_0x5633('0x7'));var config=require('../../config/environment');var attributes=require(_0x5633('0x8'));module[_0x5633('0x9')]=function(_0x517e45,_0x369d5d){return _0x517e45[_0x5633('0xa')](_0x5633('0xb'),attributes,{'tableName':_0x5633('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd221=['path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd221,0xd7));var _0x1d22=function(_0x14d187,_0x4a92dd){_0x14d187=_0x14d187-0x0;var _0x4eb39f=_0xd221[_0x14d187];return _0x4eb39f;};'use strict';var _=require(_0x1d22('0x0'));var util=require('util');var logger=require(_0x1d22('0x1'))(_0x1d22('0x2'));var moment=require(_0x1d22('0x3'));var BPromise=require(_0x1d22('0x4'));var rp=require(_0x1d22('0x5'));var fs=require('fs');var path=require(_0x1d22('0x6'));var rimraf=require(_0x1d22('0x7'));var config=require(_0x1d22('0x8'));var attributes=require(_0x1d22('0x9'));module[_0x1d22('0xa')]=function(_0x277ea0,_0x2740ee){return _0x277ea0[_0x1d22('0xb')](_0x1d22('0xc'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 9888439..7cdb21a 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 _0xa064=['stringify','error','message','Automation,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x36f304,_0x4025ea){var _0x4dd9f3=function(_0x13c480){while(--_0x13c480){_0x36f304['push'](_0x36f304['shift']());}};_0x4dd9f3(++_0x4025ea);}(_0xa064,0x192));var _0x4a06=function(_0x295fe9,_0x345828){_0x295fe9=_0x295fe9-0x0;var _0x3b80df=_0xa064[_0x295fe9];return _0x3b80df;};'use strict';var _=require(_0x4a06('0x0'));var util=require(_0x4a06('0x1'));var moment=require(_0x4a06('0x2'));var BPromise=require(_0x4a06('0x3'));var rs=require(_0x4a06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a06('0x5'));var logger=require('../../config/logger')(_0x4a06('0x6'));var config=require(_0x4a06('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4a06('0x8')][_0x4a06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55d4e3,_0x3b01cc,_0x454574){return new BPromise(function(_0x4c966b,_0x5e3342){return client[_0x4a06('0xa')](_0x55d4e3,_0x454574)[_0x4a06('0xb')](function(_0x3a8db5){logger[_0x4a06('0xc')]('Automation,\x20%s,\x20%s',_0x3b01cc,_0x4a06('0xd'));logger[_0x4a06('0xe')](_0x4a06('0xf'),_0x3b01cc,_0x4a06('0xd'),JSON[_0x4a06('0x10')](_0x3a8db5));if(_0x3a8db5[_0x4a06('0x11')]){if(_0x3a8db5[_0x4a06('0x11')]['code']===0x1f4){logger[_0x4a06('0x11')]('Automation,\x20%s,\x20%s',_0x3b01cc,_0x3a8db5[_0x4a06('0x11')][_0x4a06('0x12')]);return _0x5e3342(_0x3a8db5[_0x4a06('0x11')]['message']);}logger[_0x4a06('0x11')](_0x4a06('0x13'),_0x3b01cc,_0x3a8db5[_0x4a06('0x11')]['message']);return _0x4c966b(_0x3a8db5[_0x4a06('0x11')][_0x4a06('0x12')]);}else{logger[_0x4a06('0xc')]('Automation,\x20%s,\x20%s',_0x3b01cc,_0x4a06('0xd'));_0x4c966b(_0x3a8db5[_0x4a06('0x14')][_0x4a06('0x12')]);}})[_0x4a06('0x15')](function(_0x15b067){logger['error'](_0x4a06('0x13'),_0x3b01cc,_0x15b067);_0x5e3342(_0x15b067);});});}
\ No newline at end of file
+var _0x3423=['rpc','../../config/environment','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','stringify','error','code','message','info','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3342('0x0'));var BPromise=require(_0x3342('0x1'));var rs=require(_0x3342('0x2'));var fs=require('fs');var Redis=require(_0x3342('0x3'));var db=require(_0x3342('0x4'))['db'];var utils=require(_0x3342('0x5'));var logger=require(_0x3342('0x6'))(_0x3342('0x7'));var config=require(_0x3342('0x8'));var jayson=require(_0x3342('0x9'));var client=jayson[_0x3342('0xa')][_0x3342('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29c40c,_0x420d4b,_0x76422d){return new BPromise(function(_0xce08ab,_0x305d13){return client[_0x3342('0xc')](_0x29c40c,_0x76422d)[_0x3342('0xd')](function(_0x4ae4f3){logger['info'](_0x3342('0xe'),_0x420d4b,'request\x20sent');logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x420d4b,'request\x20sent',JSON[_0x3342('0xf')](_0x4ae4f3));if(_0x4ae4f3[_0x3342('0x10')]){if(_0x4ae4f3['error'][_0x3342('0x11')]===0x1f4){logger['error'](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')]['message']);return _0x305d13(_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);}logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);return _0xce08ab(_0x4ae4f3[_0x3342('0x10')]['message']);}else{logger[_0x3342('0x13')](_0x3342('0xe'),_0x420d4b,'request\x20sent');_0xce08ab(_0x4ae4f3[_0x3342('0x14')][_0x3342('0x12')]);}})['catch'](function(_0x554f9c){logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x554f9c);_0x305d13(_0x554f9c);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 01970ca..71b01a1 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 _0x5cea=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','destroy'];(function(_0x240362,_0x156794){var _0x26de18=function(_0x4a4431){while(--_0x4a4431){_0x240362['push'](_0x240362['shift']());}};_0x26de18(++_0x156794);}(_0x5cea,0x151));var _0xa5ce=function(_0x53a7ad,_0x16d1a4){_0x53a7ad=_0x53a7ad-0x0;var _0x364325=_0x5cea[_0x53a7ad];return _0x364325;};'use strict';var multer=require('multer');var util=require(_0xa5ce('0x0'));var path=require(_0xa5ce('0x1'));var timeout=require(_0xa5ce('0x2'));var express=require(_0xa5ce('0x3'));var router=express[_0xa5ce('0x4')]();var fs_extra=require(_0xa5ce('0x5'));var auth=require(_0xa5ce('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa5ce('0x7'));var controller=require(_0xa5ce('0x8'));router[_0xa5ce('0x9')]('/',auth[_0xa5ce('0xa')](),controller[_0xa5ce('0xb')]);router[_0xa5ce('0x9')](_0xa5ce('0xc'),auth[_0xa5ce('0xa')](),controller[_0xa5ce('0xd')]);router[_0xa5ce('0x9')](_0xa5ce('0xe'),auth[_0xa5ce('0xa')](),controller[_0xa5ce('0xf')]);router[_0xa5ce('0x9')](_0xa5ce('0x10'),auth['isAuthenticated'](),controller[_0xa5ce('0x11')]);router[_0xa5ce('0x12')]('/',auth[_0xa5ce('0xa')](),controller['create']);router['post']('/:id/conditions',auth['isAuthenticated'](),controller[_0xa5ce('0x13')]);router['post'](_0xa5ce('0x10'),auth['isAuthenticated'](),controller[_0xa5ce('0x14')]);router[_0xa5ce('0x15')](_0xa5ce('0xc'),auth[_0xa5ce('0xa')](),controller['update']);router['delete'](_0xa5ce('0xc'),auth[_0xa5ce('0xa')](),controller[_0xa5ce('0x16')]);module[_0xa5ce('0x17')]=router;
\ No newline at end of file
+var _0xe3ee=['fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','getConditions','/:id/actions','post','create','/:id/conditions','addConditions','addActions','put','update','delete','destroy','path','connect-timeout'];(function(_0x12926a,_0xb3be90){var _0x2db765=function(_0x32e279){while(--_0x32e279){_0x12926a['push'](_0x12926a['shift']());}};_0x2db765(++_0xb3be90);}(_0xe3ee,0x116));var _0xee3e=function(_0x5a5bdf,_0x575008){_0x5a5bdf=_0x5a5bdf-0x0;var _0x5286e1=_0xe3ee[_0x5a5bdf];return _0x5286e1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee3e('0x0'));var timeout=require(_0xee3e('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xee3e('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xee3e('0x3'));var controller=require('./automation.controller');router[_0xee3e('0x4')]('/',auth[_0xee3e('0x5')](),controller[_0xee3e('0x6')]);router[_0xee3e('0x4')](_0xee3e('0x7'),auth[_0xee3e('0x5')](),controller[_0xee3e('0x8')]);router[_0xee3e('0x4')]('/:id/conditions',auth[_0xee3e('0x5')](),controller[_0xee3e('0x9')]);router['get'](_0xee3e('0xa'),auth[_0xee3e('0x5')](),controller['getActions']);router[_0xee3e('0xb')]('/',auth[_0xee3e('0x5')](),controller[_0xee3e('0xc')]);router[_0xee3e('0xb')](_0xee3e('0xd'),auth[_0xee3e('0x5')](),controller[_0xee3e('0xe')]);router[_0xee3e('0xb')]('/:id/actions',auth['isAuthenticated'](),controller[_0xee3e('0xf')]);router[_0xee3e('0x10')]('/:id',auth[_0xee3e('0x5')](),controller[_0xee3e('0x11')]);router[_0xee3e('0x12')]('/:id',auth[_0xee3e('0x5')](),controller[_0xee3e('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 8ad2cd3..e88d0ad 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 _0x87cd=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','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\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting'];(function(_0x56d2be,_0x417f9e){var _0x467209=function(_0x101622){while(--_0x101622){_0x56d2be['push'](_0x56d2be['shift']());}};_0x467209(++_0x417f9e);}(_0x87cd,0xe6));var _0xd87c=function(_0x12049f,_0x25f34f){_0x12049f=_0x12049f-0x0;var _0x23667e=_0x87cd[_0x12049f];return _0x23667e;};'use strict';var Sequelize=require(_0xd87c('0x0'));module[_0xd87c('0x1')]={'name':{'type':Sequelize[_0xd87c('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd87c('0x3')](_0xd87c('0x4')),'allowNull':![],'defaultValue':_0xd87c('0x4')},'description':{'type':Sequelize[_0xd87c('0x2')]},'active':{'type':Sequelize[_0xd87c('0x5')],'defaultValue':0x0,'comment':_0xd87c('0x6')},'limitCalls':{'type':Sequelize[_0xd87c('0x7')](0x4)[_0xd87c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd87c('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd87c('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd87c('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd87c('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd87c('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd87c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd87c('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xd87c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd87c('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'defaultValue':0x3,'comment':_0xd87c('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd87c('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd87c('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd87c('0x2')],'defaultValue':_0xd87c('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xd87c('0x3')](_0xd87c('0x11'),_0xd87c('0x12'),_0xd87c('0x13')),'defaultValue':_0xd87c('0x11')},'dialAMDActive':{'type':Sequelize[_0xd87c('0x5')],'defaultValue':0x0,'comment':_0xd87c('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xd87c('0x7')](0x9)[_0xd87c('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd87c('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd87c('0x7')](0x9)[_0xd87c('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd87c('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd87c('0x7')](0x9)[_0xd87c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd87c('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xd87c('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd87c('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd87c('0x7')](0x9)[_0xd87c('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd87c('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd87c('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd87c('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd87c('0x7')](0x5)[_0xd87c('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xd87c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd87c('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd87c('0x3')]('DESC',_0xd87c('0x1c')),'defaultValue':_0xd87c('0x1d')},'dialPrefix':{'type':Sequelize[_0xd87c('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd87c('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd87c('0x7')](0x5)[_0xd87c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd87c('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xd87c('0x7')](0x5)[_0xd87c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd87c('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd87c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd87c('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd87c('0x7')](0x5)[_0xd87c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd87c('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xd87c('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd87c('0x7')](0x3)[_0xd87c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd87c('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd87c('0x7')](0x5)[_0xd87c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0xf915=['STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.'];(function(_0x4be5be,_0xf5ea52){var _0x5525d8=function(_0x5c6e32){while(--_0x5c6e32){_0x4be5be['push'](_0x4be5be['shift']());}};_0x5525d8(++_0xf5ea52);}(_0xf915,0x6e));var _0x5f91=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf915[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x5f91('0x0'));module[_0x5f91('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5f91('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5f91('0x3')](_0x5f91('0x4')),'allowNull':![],'defaultValue':_0x5f91('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x5f91('0x5')],'defaultValue':0x0,'comment':_0x5f91('0x6')},'limitCalls':{'type':Sequelize[_0x5f91('0x7')](0x4)[_0x5f91('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5f91('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5f91('0xa')]},'dialOriginateTimeout':{'type':Sequelize[_0x5f91('0x7')](0x3)[_0x5f91('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f91('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5f91('0x7')](0x3)[_0x5f91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f91('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5f91('0x7')](0x5)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f91('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x5f91('0x7')](0x3)[_0x5f91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f91('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5f91('0x7')](0x5)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f91('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5f91('0x8')],'defaultValue':0x3,'comment':_0x5f91('0x10')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5f91('0x7')](0x5)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f91('0x11')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5f91('0x7')](0x3)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5f91('0x12')},'dialTimezone':{'type':Sequelize[_0x5f91('0xa')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x5f91('0x13')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x5f91('0x14'),_0x5f91('0x15')),'defaultValue':_0x5f91('0x16')},'dialAMDActive':{'type':Sequelize[_0x5f91('0x5')],'defaultValue':0x0,'comment':_0x5f91('0x17')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x5f91('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5f91('0x18')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5f91('0x19')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5f91('0x7')](0x9)[_0x5f91('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5f91('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5f91('0x1a')},'dialAMDMinWordLength':{'type':Sequelize[_0x5f91('0x7')](0x9)[_0x5f91('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5f91('0x7')](0x9)[_0x5f91('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5f91('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5f91('0x7')](0x9)[_0x5f91('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5f91('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5f91('0x7')](0x5)[_0x5f91('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5f91('0x1d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5f91('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x5f91('0x3')](_0x5f91('0x1e'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x5f91('0xa')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x5f91('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5f91('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5f91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5f91('0x7')](0x5)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f91('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x5f91('0x7')](0x3)[_0x5f91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f91('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5f91('0x7')](0x3)[_0x5f91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f91('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5f91('0x7')](0x5)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f91('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x5f91('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f91('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5f91('0x7')](0x5)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f91('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5f91('0x7')](0x3)[_0x5f91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f91('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5f91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f91('0x27')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 307380a..00de116 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 _0x7410=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','end','status','undefined','limit','offset','set','Content-Range','json','apply','reject','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','clone','omit','createdAt','body','UserProfileSection','autoAssociation','update','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','ContactId','select','field','phone','NOW()','scheduledAt','CmListId','toString','ListId','updatedAt','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','into','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7410,0x8a));var _0x0741=function(_0x275369,_0x30c7f2){_0x275369=_0x275369-0x0;var _0x41df41=_0x7410[_0x275369];return _0x41df41;};'use strict';var emlformat=require(_0x0741('0x0'));var rimraf=require(_0x0741('0x1'));var zipdir=require(_0x0741('0x2'));var jsonpatch=require(_0x0741('0x3'));var rp=require(_0x0741('0x4'));var moment=require(_0x0741('0x5'));var BPromise=require(_0x0741('0x6'));var Mustache=require(_0x0741('0x7'));var util=require(_0x0741('0x8'));var path=require(_0x0741('0x9'));var sox=require(_0x0741('0xa'));var csv=require(_0x0741('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0741('0xc'));var _=require(_0x0741('0xd'));var squel=require(_0x0741('0xe'));var crypto=require(_0x0741('0xf'));var jsforce=require(_0x0741('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0741('0x11'));var Papa=require(_0x0741('0x12'));var Redis=require(_0x0741('0x13'));var authService=require(_0x0741('0x14'));var qs=require(_0x0741('0x15'));var as=require(_0x0741('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0741('0x17'));var utils=require('../../config/utils');var config=require(_0x0741('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0741('0x19'))['db'];function respondWithStatusCode(_0x19fa4a,_0x4e27e3){_0x4e27e3=_0x4e27e3||0xcc;return function(_0x119156){if(_0x119156){return _0x19fa4a['sendStatus'](_0x4e27e3);}return _0x19fa4a['status'](_0x4e27e3)[_0x0741('0x1a')]();};}function respondWithResult(_0x340d6f,_0x262fcb){_0x262fcb=_0x262fcb||0xc8;return function(_0x3a04fc){if(_0x3a04fc){return _0x340d6f[_0x0741('0x1b')](_0x262fcb)['json'](_0x3a04fc);}};}function respondWithFilteredResult(_0x102b6b,_0x48f76c){return function(_0x35af2f){if(_0x35af2f){var _0x23a261=typeof _0x48f76c['offset']===_0x0741('0x1c')&&typeof _0x48f76c[_0x0741('0x1d')]===_0x0741('0x1c');var _0xf1253e=_0x35af2f['count'];var _0x2d9880=_0x23a261?0x0:_0x48f76c['offset'];var _0x568ef4=_0x23a261?_0x35af2f['count']:_0x48f76c[_0x0741('0x1e')]+_0x48f76c[_0x0741('0x1d')];var _0x48c6ab;if(_0x568ef4>=_0xf1253e){_0x568ef4=_0xf1253e;_0x48c6ab=0xc8;}else{_0x48c6ab=0xce;}_0x102b6b[_0x0741('0x1b')](_0x48c6ab);return _0x102b6b[_0x0741('0x1f')](_0x0741('0x20'),_0x2d9880+'-'+_0x568ef4+'/'+_0xf1253e)[_0x0741('0x21')](_0x35af2f);}return null;};}function patchUpdates(_0x19ec3d){return function(_0xe80312){try{jsonpatch[_0x0741('0x22')](_0xe80312,_0x19ec3d,!![]);}catch(_0x2bc1b6){return BPromise[_0x0741('0x23')](_0x2bc1b6);}return _0xe80312['save']();};}function saveUpdates(_0x2d676e,_0x3f1e1c){return function(_0x5d20c6){if(_0x5d20c6){return _0x5d20c6['update'](_0x2d676e)[_0x0741('0x24')](function(_0x47dc9a){return _0x47dc9a;});}return null;};}function removeEntity(_0x2d999b,_0x7cfccd){return function(_0x3acd2e){if(_0x3acd2e){return _0x3acd2e[_0x0741('0x25')]()[_0x0741('0x24')](function(){var _0x9b8a2e=_0x3acd2e[_0x0741('0x26')]({'plain':!![]});var _0x57126c=_0x0741('0x27');return db[_0x0741('0x28')][_0x0741('0x25')]({'where':{'type':_0x57126c,'resourceId':_0x9b8a2e['id']}})['then'](function(){return _0x3acd2e;});})[_0x0741('0x24')](function(){_0x2d999b[_0x0741('0x1b')](0xcc)[_0x0741('0x1a')]();});}};}function handleEntityNotFound(_0x1b954a,_0xd43f1a){return function(_0x24cce6){if(!_0x24cce6){_0x1b954a[_0x0741('0x29')](0x194);}return _0x24cce6;};}function handleError(_0x22bfcc,_0x5b1989){_0x5b1989=_0x5b1989||0x1f4;return function(_0x36c010){logger[_0x0741('0x2a')](_0x36c010[_0x0741('0x2b')]);if(_0x36c010[_0x0741('0x2c')]){delete _0x36c010[_0x0741('0x2c')];}_0x22bfcc[_0x0741('0x1b')](_0x5b1989)[_0x0741('0x2d')](_0x36c010);};}exports[_0x0741('0x2e')]=function(_0x235d1c,_0xf4adf9){var _0x27fa1a={},_0x4a8dd0={},_0x4a24f5={'count':0x0,'rows':[]};var _0x34b3f9=_[_0x0741('0x2f')](db[_0x0741('0x30')][_0x0741('0x31')],function(_0x222bc5){return{'name':_0x222bc5[_0x0741('0x32')],'type':_0x222bc5['type'][_0x0741('0x33')]};});_0x4a8dd0[_0x0741('0x34')]=_[_0x0741('0x2f')](_0x34b3f9,_0x0741('0x2c'));_0x4a8dd0[_0x0741('0x35')]=_['keys'](_0x235d1c[_0x0741('0x35')]);_0x4a8dd0[_0x0741('0x36')]=_[_0x0741('0x37')](_0x4a8dd0[_0x0741('0x34')],_0x4a8dd0[_0x0741('0x35')]);_0x27fa1a['attributes']=_[_0x0741('0x37')](_0x4a8dd0[_0x0741('0x34')],qs['fields'](_0x235d1c[_0x0741('0x35')][_0x0741('0x38')]));_0x27fa1a['attributes']=_0x27fa1a['attributes'][_0x0741('0x39')]?_0x27fa1a[_0x0741('0x3a')]:_0x4a8dd0[_0x0741('0x34')];if(!_0x235d1c[_0x0741('0x35')][_0x0741('0x3b')](_0x0741('0x3c'))){_0x27fa1a[_0x0741('0x1d')]=qs['limit'](_0x235d1c[_0x0741('0x35')]['limit']);_0x27fa1a['offset']=qs[_0x0741('0x1e')](_0x235d1c[_0x0741('0x35')]['offset']);}_0x27fa1a[_0x0741('0x3d')]=qs['sort'](_0x235d1c[_0x0741('0x35')][_0x0741('0x3e')]);_0x27fa1a[_0x0741('0x3f')]=qs[_0x0741('0x36')](_[_0x0741('0x40')](_0x235d1c[_0x0741('0x35')],_0x4a8dd0[_0x0741('0x36')]),_0x34b3f9);if(_0x235d1c['query'][_0x0741('0x41')]){_0x27fa1a[_0x0741('0x3f')]=_[_0x0741('0x42')](_0x27fa1a[_0x0741('0x3f')],{'$or':_[_0x0741('0x2f')](_0x34b3f9,function(_0x739dd8){if(_0x739dd8[_0x0741('0x43')]!=='VIRTUAL'){var _0x1f234e={};_0x1f234e[_0x739dd8[_0x0741('0x2c')]]={'$like':'%'+_0x235d1c['query'][_0x0741('0x41')]+'%'};return _0x1f234e;}})});}_0x27fa1a=_[_0x0741('0x42')]({},_0x27fa1a,_0x235d1c[_0x0741('0x44')]);var _0x5cf7b7={'where':_0x27fa1a[_0x0741('0x3f')]};return db['Campaign'][_0x0741('0x45')](_0x5cf7b7)['then'](function(_0x292621){_0x4a24f5[_0x0741('0x45')]=_0x292621;if(_0x235d1c[_0x0741('0x35')][_0x0741('0x46')]){_0x27fa1a[_0x0741('0x47')]=[{'all':!![]}];}return db[_0x0741('0x30')][_0x0741('0x48')](_0x27fa1a);})['then'](function(_0x103ca8){_0x4a24f5[_0x0741('0x49')]=_0x103ca8;return _0x4a24f5;})[_0x0741('0x24')](respondWithFilteredResult(_0xf4adf9,_0x27fa1a))[_0x0741('0x4a')](handleError(_0xf4adf9,null));};exports[_0x0741('0x4b')]=function(_0x543b6e,_0x239bcc){var _0x4f66e6={'raw':![],'where':{'id':_0x543b6e[_0x0741('0x4c')]['id']}},_0x2400b1={};_0x2400b1[_0x0741('0x34')]=_[_0x0741('0x4d')](db[_0x0741('0x30')][_0x0741('0x31')]);_0x2400b1[_0x0741('0x35')]=_[_0x0741('0x4d')](_0x543b6e[_0x0741('0x35')]);_0x2400b1[_0x0741('0x36')]=_[_0x0741('0x37')](_0x2400b1['model'],_0x2400b1[_0x0741('0x35')]);_0x4f66e6[_0x0741('0x3a')]=_[_0x0741('0x37')](_0x2400b1[_0x0741('0x34')],qs[_0x0741('0x38')](_0x543b6e['query'][_0x0741('0x38')]));_0x4f66e6[_0x0741('0x3a')]=_0x4f66e6['attributes'][_0x0741('0x39')]?_0x4f66e6[_0x0741('0x3a')]:_0x2400b1['model'];if(_0x543b6e[_0x0741('0x35')][_0x0741('0x46')]){_0x4f66e6['include']=[{'all':!![]}];}_0x4f66e6=_[_0x0741('0x42')]({},_0x4f66e6,_0x543b6e['options']);return db[_0x0741('0x30')][_0x0741('0x4e')](_0x4f66e6)[_0x0741('0x24')](handleEntityNotFound(_0x239bcc,null))[_0x0741('0x24')](respondWithResult(_0x239bcc,null))[_0x0741('0x4a')](handleError(_0x239bcc,null));};exports[_0x0741('0x4f')]=function(_0xe7b4c8,_0x400f4f){return db['Campaign'][_0x0741('0x4f')](_0xe7b4c8['body'],{})[_0x0741('0x24')](function(_0x3f2aab){var _0x42938b=_0xe7b4c8[_0x0741('0x50')][_0x0741('0x26')]({'plain':!![]});if(!_0x42938b)throw new Error(_0x0741('0x51'));if(_0x42938b[_0x0741('0x52')]===_0x0741('0x50')){var _0x2700bf=_0x3f2aab['get']({'plain':!![]});var _0x138d39='IvrCampaigns';return db['UserProfileSection'][_0x0741('0x4e')]({'where':{'name':_0x138d39,'userProfileId':_0x42938b[_0x0741('0x53')]},'raw':!![]})[_0x0741('0x24')](function(_0x417690){if(_0x417690&&_0x417690['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2700bf[_0x0741('0x2c')],'resourceId':_0x2700bf['id'],'type':_0x417690[_0x0741('0x2c')],'sectionId':_0x417690['id']},{})['then'](function(){return _0x3f2aab;});}else{return _0x3f2aab;}})[_0x0741('0x4a')](function(_0x1009e8){logger[_0x0741('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1009e8);throw _0x1009e8;});}return _0x3f2aab;})[_0x0741('0x24')](respondWithResult(_0x400f4f,0xc9))[_0x0741('0x4a')](handleError(_0x400f4f,null));};exports[_0x0741('0x54')]=function(_0x2636e8,_0xa3c24a){var _0x11a77a={'where':{'id':_0x2636e8[_0x0741('0x4c')]['id']}},_0x1c87a7={};_0x1c87a7[_0x0741('0x34')]=_[_0x0741('0x4d')](db[_0x0741('0x30')]['rawAttributes']);_0x11a77a[_0x0741('0x3a')]=_['intersection'](_0x1c87a7['model'],qs['fields'](_0x2636e8[_0x0741('0x35')][_0x0741('0x38')]));_0x11a77a[_0x0741('0x3a')]=_0x11a77a[_0x0741('0x3a')][_0x0741('0x39')]?_0x11a77a[_0x0741('0x3a')]:_0x1c87a7[_0x0741('0x34')];if(_0x2636e8[_0x0741('0x35')][_0x0741('0x46')]){_0x11a77a[_0x0741('0x47')]=[{'all':!![]}];}_0x11a77a=_[_0x0741('0x42')]({},_0x11a77a,_0x2636e8[_0x0741('0x44')]);return db[_0x0741('0x30')][_0x0741('0x4e')](_0x11a77a)[_0x0741('0x24')](handleEntityNotFound(_0xa3c24a,null))[_0x0741('0x24')](function(_0x12f4d7){if(_0x12f4d7){var _0x265d19=_0x12f4d7[_0x0741('0x26')]({'plain':!![]});_0x265d19=qs[_0x0741('0x55')](_0x265d19,['id',_0x0741('0x56'),'updatedAt']);_0x2636e8[_0x0741('0x57')]=_[_0x0741('0x55')](_0x2636e8[_0x0741('0x57')],['id',_0x0741('0x56'),'updatedAt']);return db[_0x0741('0x30')][_0x0741('0x4f')](_[_0x0741('0x42')](_0x265d19,_0x2636e8[_0x0741('0x57')]),{'include':_0x2636e8[_0x0741('0x35')][_0x0741('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x22f274){var _0x469c52=_0x2636e8[_0x0741('0x50')][_0x0741('0x26')]({'plain':!![]});if(!_0x469c52)throw new Error(_0x0741('0x51'));if(_0x469c52[_0x0741('0x52')]==='user'){var _0x216750=_0x22f274[_0x0741('0x26')]({'plain':!![]});var _0x4c345c='IvrCampaigns';return db[_0x0741('0x58')][_0x0741('0x4e')]({'where':{'name':_0x4c345c,'userProfileId':_0x469c52[_0x0741('0x53')]},'raw':!![]})[_0x0741('0x24')](function(_0x163d10){if(_0x163d10&&_0x163d10[_0x0741('0x59')]===0x0){return db[_0x0741('0x28')][_0x0741('0x4f')]({'name':_0x216750[_0x0741('0x2c')],'resourceId':_0x216750['id'],'type':_0x163d10[_0x0741('0x2c')],'sectionId':_0x163d10['id']},{})[_0x0741('0x24')](function(){return _0x22f274;});}else{return _0x22f274;}})[_0x0741('0x4a')](function(_0xda2659){logger[_0x0741('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xda2659);throw _0xda2659;});}return _0x22f274;});}})[_0x0741('0x24')](respondWithResult(_0xa3c24a,0xc9))[_0x0741('0x4a')](handleError(_0xa3c24a,null));};exports[_0x0741('0x5a')]=function(_0xf13ae8,_0x26d257){if(_0xf13ae8[_0x0741('0x57')]['id']){delete _0xf13ae8[_0x0741('0x57')]['id'];}return db[_0x0741('0x30')][_0x0741('0x4e')]({'where':{'id':_0xf13ae8[_0x0741('0x4c')]['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x26d257,null))['then'](saveUpdates(_0xf13ae8['body'],null))[_0x0741('0x24')](respondWithResult(_0x26d257,null))[_0x0741('0x4a')](handleError(_0x26d257,null));};exports[_0x0741('0x25')]=function(_0x48ad88,_0x250b68){return db[_0x0741('0x30')]['find']({'where':{'id':_0x48ad88['params']['id']}})['then'](handleEntityNotFound(_0x250b68,null))[_0x0741('0x24')](removeEntity(_0x250b68,null))[_0x0741('0x4a')](handleError(_0x250b68,null));};exports['getHoppers']=function(_0x334444,_0x4f347c,_0x4edc2b){var _0x806a12={'raw':!![],'where':{}};var _0x52f6e1={};var _0x57f6a6={'count':0x0,'rows':[]};return db[_0x0741('0x30')][_0x0741('0x5b')]({'where':{'id':_0x334444[_0x0741('0x4c')]['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x4f347c,null))[_0x0741('0x24')](function(_0x1ad6bb){if(_0x1ad6bb){_0x52f6e1[_0x0741('0x34')]=_[_0x0741('0x4d')](db[_0x0741('0x5c')][_0x0741('0x31')]);_0x52f6e1[_0x0741('0x35')]=_[_0x0741('0x4d')](_0x334444['query']);_0x52f6e1[_0x0741('0x36')]=_['intersection'](_0x52f6e1[_0x0741('0x34')],_0x52f6e1[_0x0741('0x35')]);_0x806a12[_0x0741('0x3a')]=_[_0x0741('0x37')](_0x52f6e1['model'],qs['fields'](_0x334444[_0x0741('0x35')][_0x0741('0x38')]));_0x806a12[_0x0741('0x3a')]=_0x806a12[_0x0741('0x3a')][_0x0741('0x39')]?_0x806a12['attributes']:_0x52f6e1[_0x0741('0x34')];if(!_0x334444[_0x0741('0x35')][_0x0741('0x3b')](_0x0741('0x3c'))){_0x806a12['limit']=qs['limit'](_0x334444[_0x0741('0x35')][_0x0741('0x1d')]);_0x806a12[_0x0741('0x1e')]=qs['offset'](_0x334444[_0x0741('0x35')]['offset']);}_0x806a12[_0x0741('0x3d')]=qs[_0x0741('0x3e')](_0x334444[_0x0741('0x35')][_0x0741('0x3e')]);_0x806a12[_0x0741('0x3f')]=qs[_0x0741('0x36')](_['pick'](_0x334444[_0x0741('0x35')],_0x52f6e1[_0x0741('0x36')]));_0x806a12['where'][_0x0741('0x5d')]=_0x1ad6bb['id'];if(_0x334444[_0x0741('0x35')][_0x0741('0x41')]){_0x806a12[_0x0741('0x3f')]=_['merge'](_0x806a12[_0x0741('0x3f')],{'$or':_[_0x0741('0x2f')](_0x806a12[_0x0741('0x3a')],function(_0x5aa3be){var _0x3cebc6={};_0x3cebc6[_0x5aa3be]={'$like':'%'+_0x334444['query'][_0x0741('0x41')]+'%'};return _0x3cebc6;})});}_0x806a12=_[_0x0741('0x42')]({},_0x806a12,_0x334444[_0x0741('0x44')]);return db[_0x0741('0x5c')]['count']({'where':_0x806a12[_0x0741('0x3f')]})[_0x0741('0x24')](function(_0x3b0205){_0x57f6a6[_0x0741('0x45')]=_0x3b0205;if(_0x334444['query']['includeAll']){_0x806a12[_0x0741('0x47')]=[{'all':!![]}];}return db[_0x0741('0x5c')][_0x0741('0x48')](_0x806a12);})[_0x0741('0x24')](function(_0x93283e){_0x57f6a6[_0x0741('0x49')]=_0x93283e;return _0x57f6a6;});}})[_0x0741('0x24')](respondWithFilteredResult(_0x4f347c,_0x806a12))[_0x0741('0x4a')](handleError(_0x4f347c,null));};exports[_0x0741('0x5e')]=function(_0xb590d4,_0x4a9af1,_0x5f42f3){var _0x3c47aa={'raw':!![],'where':{}};var _0x54b4c9={};var _0x186075={'count':0x0,'rows':[]};return db[_0x0741('0x30')]['findOne']({'where':{'id':_0xb590d4['params']['id']}})['then'](handleEntityNotFound(_0x4a9af1,null))[_0x0741('0x24')](function(_0x45a75b){if(_0x45a75b){_0x54b4c9[_0x0741('0x34')]=_[_0x0741('0x4d')](db['CmHopperHistory'][_0x0741('0x31')]);_0x54b4c9[_0x0741('0x35')]=_[_0x0741('0x4d')](_0xb590d4[_0x0741('0x35')]);_0x54b4c9[_0x0741('0x36')]=_[_0x0741('0x37')](_0x54b4c9[_0x0741('0x34')],_0x54b4c9[_0x0741('0x35')]);_0x3c47aa[_0x0741('0x3a')]=_[_0x0741('0x37')](_0x54b4c9[_0x0741('0x34')],qs[_0x0741('0x38')](_0xb590d4[_0x0741('0x35')]['fields']));_0x3c47aa[_0x0741('0x3a')]=_0x3c47aa[_0x0741('0x3a')][_0x0741('0x39')]?_0x3c47aa['attributes']:_0x54b4c9[_0x0741('0x34')];if(!_0xb590d4['query']['hasOwnProperty']('nolimit')){_0x3c47aa['limit']=qs[_0x0741('0x1d')](_0xb590d4[_0x0741('0x35')]['limit']);_0x3c47aa[_0x0741('0x1e')]=qs[_0x0741('0x1e')](_0xb590d4[_0x0741('0x35')][_0x0741('0x1e')]);}_0x3c47aa['order']=qs[_0x0741('0x3e')](_0xb590d4['query']['sort']);_0x3c47aa[_0x0741('0x3f')]=qs[_0x0741('0x36')](_[_0x0741('0x40')](_0xb590d4[_0x0741('0x35')],_0x54b4c9[_0x0741('0x36')]));_0x3c47aa[_0x0741('0x3f')]['CampaignId']=_0x45a75b['id'];if(_0xb590d4[_0x0741('0x35')]['filter']){_0x3c47aa['where']=_[_0x0741('0x42')](_0x3c47aa['where'],{'$or':_[_0x0741('0x2f')](_0x3c47aa[_0x0741('0x3a')],function(_0x3de5c5){var _0xe15a5={};_0xe15a5[_0x3de5c5]={'$like':'%'+_0xb590d4[_0x0741('0x35')][_0x0741('0x41')]+'%'};return _0xe15a5;})});}_0x3c47aa=_['merge']({},_0x3c47aa,_0xb590d4['options']);return db[_0x0741('0x5f')]['count']({'where':_0x3c47aa[_0x0741('0x3f')]})[_0x0741('0x24')](function(_0x4cfacd){_0x186075['count']=_0x4cfacd;if(_0xb590d4[_0x0741('0x35')]['includeAll']){_0x3c47aa[_0x0741('0x47')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0741('0x48')](_0x3c47aa);})['then'](function(_0x4314e0){_0x186075['rows']=_0x4314e0;return _0x186075;});}})['then'](respondWithFilteredResult(_0x4a9af1,_0x3c47aa))[_0x0741('0x4a')](handleError(_0x4a9af1,null));};exports[_0x0741('0x60')]=function(_0x3ef1f1,_0x1e256c,_0x58d6a2){var _0x589dee={'raw':!![],'where':{}};var _0x548a30={};var _0x51ab33={'count':0x0,'rows':[]};return db[_0x0741('0x30')]['findOne']({'where':{'id':_0x3ef1f1[_0x0741('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1e256c,null))[_0x0741('0x24')](function(_0x4574ec){if(_0x4574ec){_0x548a30['model']=_[_0x0741('0x4d')](db[_0x0741('0x61')]['rawAttributes']);_0x548a30[_0x0741('0x35')]=_[_0x0741('0x4d')](_0x3ef1f1[_0x0741('0x35')]);_0x548a30[_0x0741('0x36')]=_['intersection'](_0x548a30[_0x0741('0x34')],_0x548a30[_0x0741('0x35')]);_0x589dee[_0x0741('0x3a')]=_[_0x0741('0x37')](_0x548a30['model'],qs[_0x0741('0x38')](_0x3ef1f1[_0x0741('0x35')]['fields']));_0x589dee[_0x0741('0x3a')]=_0x589dee['attributes'][_0x0741('0x39')]?_0x589dee[_0x0741('0x3a')]:_0x548a30['model'];if(!_0x3ef1f1[_0x0741('0x35')][_0x0741('0x3b')](_0x0741('0x3c'))){_0x589dee[_0x0741('0x1d')]=qs[_0x0741('0x1d')](_0x3ef1f1[_0x0741('0x35')]['limit']);_0x589dee['offset']=qs['offset'](_0x3ef1f1['query'][_0x0741('0x1e')]);}_0x589dee[_0x0741('0x3d')]=qs['sort'](_0x3ef1f1[_0x0741('0x35')][_0x0741('0x3e')]);_0x589dee[_0x0741('0x3f')]=qs[_0x0741('0x36')](_['pick'](_0x3ef1f1[_0x0741('0x35')],_0x548a30[_0x0741('0x36')]));_0x589dee['where'][_0x0741('0x5d')]=_0x4574ec['id'];if(_0x3ef1f1[_0x0741('0x35')][_0x0741('0x41')]){_0x589dee['where']=_[_0x0741('0x42')](_0x589dee['where'],{'$or':_[_0x0741('0x2f')](_0x589dee[_0x0741('0x3a')],function(_0x585d11){var _0x24d87e={};_0x24d87e[_0x585d11]={'$like':'%'+_0x3ef1f1[_0x0741('0x35')]['filter']+'%'};return _0x24d87e;})});}_0x589dee=_['merge']({},_0x589dee,_0x3ef1f1[_0x0741('0x44')]);return db[_0x0741('0x61')][_0x0741('0x45')]({'where':_0x589dee[_0x0741('0x3f')]})[_0x0741('0x24')](function(_0x2429e5){_0x51ab33[_0x0741('0x45')]=_0x2429e5;if(_0x3ef1f1['query'][_0x0741('0x46')]){_0x589dee[_0x0741('0x47')]=[{'all':!![]}];}return db[_0x0741('0x61')][_0x0741('0x48')](_0x589dee);})[_0x0741('0x24')](function(_0x376940){_0x51ab33[_0x0741('0x49')]=_0x376940;return _0x51ab33;});}})[_0x0741('0x24')](respondWithFilteredResult(_0x1e256c,_0x589dee))[_0x0741('0x4a')](handleError(_0x1e256c,null));};exports[_0x0741('0x62')]=function(_0x56e5f1,_0x467f90,_0x43ae96){var _0xc6bb9={'raw':!![],'where':{}};var _0x27d484={};var _0x4b0b22={'count':0x0,'rows':[]};return db[_0x0741('0x30')][_0x0741('0x5b')]({'where':{'id':_0x56e5f1[_0x0741('0x4c')]['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x467f90,null))[_0x0741('0x24')](function(_0x11c0f7){if(_0x11c0f7){_0x27d484['model']=_[_0x0741('0x4d')](db[_0x0741('0x63')][_0x0741('0x31')]);_0x27d484['query']=_['keys'](_0x56e5f1[_0x0741('0x35')]);_0x27d484[_0x0741('0x36')]=_[_0x0741('0x37')](_0x27d484[_0x0741('0x34')],_0x27d484[_0x0741('0x35')]);_0xc6bb9[_0x0741('0x3a')]=_[_0x0741('0x37')](_0x27d484[_0x0741('0x34')],qs[_0x0741('0x38')](_0x56e5f1[_0x0741('0x35')][_0x0741('0x38')]));_0xc6bb9[_0x0741('0x3a')]=_0xc6bb9[_0x0741('0x3a')][_0x0741('0x39')]?_0xc6bb9[_0x0741('0x3a')]:_0x27d484['model'];if(!_0x56e5f1[_0x0741('0x35')][_0x0741('0x3b')](_0x0741('0x3c'))){_0xc6bb9[_0x0741('0x1d')]=qs['limit'](_0x56e5f1[_0x0741('0x35')][_0x0741('0x1d')]);_0xc6bb9[_0x0741('0x1e')]=qs['offset'](_0x56e5f1[_0x0741('0x35')][_0x0741('0x1e')]);}_0xc6bb9[_0x0741('0x3d')]=qs['sort'](_0x56e5f1[_0x0741('0x35')]['sort']);_0xc6bb9[_0x0741('0x3f')]=qs[_0x0741('0x36')](_[_0x0741('0x40')](_0x56e5f1[_0x0741('0x35')],_0x27d484[_0x0741('0x36')]));_0xc6bb9[_0x0741('0x3f')]['CampaignId']=_0x11c0f7['id'];if(_0x56e5f1[_0x0741('0x35')][_0x0741('0x41')]){_0xc6bb9[_0x0741('0x3f')]=_[_0x0741('0x42')](_0xc6bb9['where'],{'$or':_[_0x0741('0x2f')](_0xc6bb9['attributes'],function(_0x572858){var _0x603fde={};_0x603fde[_0x572858]={'$like':'%'+_0x56e5f1['query'][_0x0741('0x41')]+'%'};return _0x603fde;})});}_0xc6bb9=_[_0x0741('0x42')]({},_0xc6bb9,_0x56e5f1[_0x0741('0x44')]);return db['CmHopperBlack'][_0x0741('0x45')]({'where':_0xc6bb9[_0x0741('0x3f')]})['then'](function(_0x41939c){_0x4b0b22[_0x0741('0x45')]=_0x41939c;if(_0x56e5f1[_0x0741('0x35')][_0x0741('0x46')]){_0xc6bb9[_0x0741('0x47')]=[{'all':!![]}];}return db[_0x0741('0x63')]['findAll'](_0xc6bb9);})[_0x0741('0x24')](function(_0x1f333a){_0x4b0b22[_0x0741('0x49')]=_0x1f333a;return _0x4b0b22;});}})[_0x0741('0x24')](respondWithFilteredResult(_0x467f90,_0xc6bb9))[_0x0741('0x4a')](handleError(_0x467f90,null));};exports[_0x0741('0x64')]=function(_0x14b6b9,_0x543565,_0x1f4f00){var _0x4ab117={};var _0x53610c={};var _0x2d35ed;var _0x2099f3;return db[_0x0741('0x30')][_0x0741('0x5b')]({'where':{'id':_0x14b6b9[_0x0741('0x4c')]['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x543565,null))[_0x0741('0x24')](function(_0x48015f){if(_0x48015f){_0x2d35ed=_0x48015f;_0x53610c[_0x0741('0x34')]=_[_0x0741('0x4d')](db['CmList'][_0x0741('0x31')]);_0x53610c['query']=_['keys'](_0x14b6b9[_0x0741('0x35')]);_0x53610c[_0x0741('0x36')]=_[_0x0741('0x37')](_0x53610c[_0x0741('0x34')],_0x53610c[_0x0741('0x35')]);_0x4ab117[_0x0741('0x3a')]=_[_0x0741('0x37')](_0x53610c['model'],qs['fields'](_0x14b6b9[_0x0741('0x35')][_0x0741('0x38')]));_0x4ab117[_0x0741('0x3a')]=_0x4ab117[_0x0741('0x3a')]['length']?_0x4ab117[_0x0741('0x3a')]:_0x53610c[_0x0741('0x34')];_0x4ab117['order']=qs[_0x0741('0x3e')](_0x14b6b9[_0x0741('0x35')][_0x0741('0x3e')]);_0x4ab117[_0x0741('0x3f')]=qs[_0x0741('0x36')](_[_0x0741('0x40')](_0x14b6b9['query'],_0x53610c[_0x0741('0x36')]));if(_0x14b6b9[_0x0741('0x35')][_0x0741('0x41')]){_0x4ab117[_0x0741('0x3f')]=_['merge'](_0x4ab117['where'],{'$or':_['map'](_0x4ab117['attributes'],function(_0x2c3f8e){var _0x3b0600={};_0x3b0600[_0x2c3f8e]={'$like':'%'+_0x14b6b9[_0x0741('0x35')][_0x0741('0x41')]+'%'};return _0x3b0600;})});}_0x4ab117=_[_0x0741('0x42')]({},_0x4ab117,_0x14b6b9[_0x0741('0x44')]);return _0x2d35ed[_0x0741('0x64')](_0x4ab117);}})[_0x0741('0x24')](function(_0x56f031){if(_0x56f031){_0x2099f3=_0x56f031[_0x0741('0x39')];if(!_0x14b6b9[_0x0741('0x35')][_0x0741('0x3b')](_0x0741('0x3c'))){_0x4ab117[_0x0741('0x1d')]=qs[_0x0741('0x1d')](_0x14b6b9[_0x0741('0x35')][_0x0741('0x1d')]);_0x4ab117[_0x0741('0x1e')]=qs['offset'](_0x14b6b9['query'][_0x0741('0x1e')]);}return _0x2d35ed['getLists'](_0x4ab117);}})[_0x0741('0x24')](function(_0x181346){if(_0x181346){return _0x181346?{'count':_0x2099f3,'rows':_0x181346}:null;}})[_0x0741('0x24')](respondWithResult(_0x543565,null))[_0x0741('0x4a')](handleError(_0x543565,null));};exports[_0x0741('0x65')]=function(_0x54df94,_0x56a7b9,_0x3c8172){var _0x1c45a2,_0x1d159d;return db[_0x0741('0x30')][_0x0741('0x4e')]({'where':{'id':_0x54df94[_0x0741('0x4c')]['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x56a7b9,null))[_0x0741('0x24')](function(_0x56b31d){if(_0x56b31d){_0x1d159d=_0x56b31d;return _0x56b31d[_0x0741('0x65')](_0x54df94[_0x0741('0x57')][_0x0741('0x66')],_['omit'](_0x54df94[_0x0741('0x57')],['ids','id'])||{});}return null;})[_0x0741('0x67')](function(_0x26828f){var _0x5f1dbe;_0x1c45a2=_0x26828f||[];var _0x55faf9=[];if(_0x26828f){for(var _0x407f9=0x0;_0x407f9<_0x26828f[_0x0741('0x39')];_0x407f9+=0x1){var _0x2bc376=_0x26828f[_0x407f9][_0x0741('0x26')]({'plain':!![]});_0x1d159d[_0x0741('0x68')]=_0x54df94[_0x0741('0x57')][_0x0741('0x68')]?_0x54df94[_0x0741('0x57')]['dialCheckDuplicateType']:_0x1d159d[_0x0741('0x68')];switch(_0x1d159d[_0x0741('0x68')]){case _0x0741('0x69'):_0x5f1dbe=squel[_0x0741('0x6a')]()['into'](_0x0741('0x6b'))[_0x0741('0x6c')](['phone','scheduledAt',_0x0741('0x6d'),'ListId',_0x0741('0x5d'),_0x0741('0x56'),'updatedAt'],squel[_0x0741('0x6e')]()[_0x0741('0x6f')](_0x0741('0x70'),'phone')[_0x0741('0x6f')](_0x0741('0x71'),_0x0741('0x72'))[_0x0741('0x6f')]('id',_0x0741('0x6d'))[_0x0741('0x6f')](_0x2bc376[_0x0741('0x73')][_0x0741('0x74')](),_0x0741('0x75'))[_0x0741('0x6f')](_0x54df94[_0x0741('0x4c')]['id'][_0x0741('0x74')](),_0x0741('0x5d'))[_0x0741('0x6f')](_0x0741('0x71'),_0x0741('0x56'))['field'](_0x0741('0x71'),_0x0741('0x76'))[_0x0741('0x77')](_0x0741('0x78'))[_0x0741('0x3f')](_0x0741('0x79'))[_0x0741('0x3f')](_0x0741('0x7a'),_0x2bc376[_0x0741('0x73')][_0x0741('0x74')]())['where'](_0x0741('0x7b'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x0741('0x6f')](_0x0741('0x7c'))[_0x0741('0x77')](_0x0741('0x7d'))[_0x0741('0x3f')](_0x0741('0x7e'),_0x54df94['params']['id'][_0x0741('0x74')]()))[_0x0741('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0741('0x6e')]()[_0x0741('0x6f')]('COALESCE(phone,\x27\x27)')[_0x0741('0x77')](_0x0741('0x6b'))[_0x0741('0x3f')](_0x0741('0x7e'),_0x54df94[_0x0741('0x4c')]['id'][_0x0741('0x74')]())))['toString']();break;case _0x0741('0x7f'):_0x5f1dbe=squel[_0x0741('0x6a')]()['into'](_0x0741('0x6b'))['fromQuery']([_0x0741('0x70'),_0x0741('0x72'),'ContactId',_0x0741('0x75'),_0x0741('0x5d'),_0x0741('0x56'),'updatedAt'],squel['select']()['field'](_0x0741('0x70'),'phone')['field']('NOW()',_0x0741('0x72'))[_0x0741('0x6f')]('id','ContactId')[_0x0741('0x6f')](_0x2bc376[_0x0741('0x73')][_0x0741('0x74')](),_0x0741('0x75'))[_0x0741('0x6f')](_0x54df94[_0x0741('0x4c')]['id'][_0x0741('0x74')](),_0x0741('0x5d'))[_0x0741('0x6f')](_0x0741('0x71'),'createdAt')[_0x0741('0x6f')](_0x0741('0x71'),_0x0741('0x76'))[_0x0741('0x77')](_0x0741('0x78'))['where'](_0x0741('0x79'))['where']('ListId\x20=\x20?',_0x2bc376['CmListId']['toString']())[_0x0741('0x3f')](_0x0741('0x7b'))[_0x0741('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0741('0x6e')]()[_0x0741('0x6f')]('COALESCE(phone,\x27\x27)')[_0x0741('0x77')](_0x0741('0x6b'))['where']('CampaignId\x20=\x20?',_0x54df94[_0x0741('0x4c')]['id'][_0x0741('0x74')]())))[_0x0741('0x74')]();break;default:_0x5f1dbe=squel[_0x0741('0x6a')]()[_0x0741('0x80')](_0x0741('0x6b'))[_0x0741('0x6c')](['phone',_0x0741('0x72'),'ContactId',_0x0741('0x75'),'CampaignId',_0x0741('0x56'),_0x0741('0x76')],squel['select']()['field'](_0x0741('0x70'),'phone')[_0x0741('0x6f')](_0x0741('0x71'),_0x0741('0x72'))[_0x0741('0x6f')]('id',_0x0741('0x6d'))[_0x0741('0x6f')](_0x2bc376[_0x0741('0x73')][_0x0741('0x74')](),_0x0741('0x75'))[_0x0741('0x6f')](_0x54df94[_0x0741('0x4c')]['id']['toString'](),'CampaignId')[_0x0741('0x6f')](_0x0741('0x71'),_0x0741('0x56'))[_0x0741('0x6f')](_0x0741('0x71'),_0x0741('0x76'))[_0x0741('0x77')](_0x0741('0x78'))['where'](_0x0741('0x79'))[_0x0741('0x3f')]('ListId\x20=\x20?',_0x2bc376[_0x0741('0x73')][_0x0741('0x74')]())[_0x0741('0x3f')](_0x0741('0x7b')))['toString']();}_0x55faf9[_0x0741('0x81')](db[_0x0741('0x82')][_0x0741('0x35')](_0x5f1dbe));}return BPromise[_0x0741('0x83')](_0x55faf9);}})['then'](function(){return _0x1c45a2;})[_0x0741('0x24')](respondWithResult(_0x56a7b9,null))['catch'](handleError(_0x56a7b9,null));};exports[_0x0741('0x84')]=function(_0x31b939,_0x214d3c,_0x307ee0){return db[_0x0741('0x30')][_0x0741('0x4e')]({'where':{'id':_0x31b939['params']['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x214d3c,null))[_0x0741('0x24')](function(_0x4cec16){if(_0x4cec16){return _0x4cec16['removeLists'](_0x31b939[_0x0741('0x35')][_0x0741('0x66')]);}})[_0x0741('0x24')](function(_0x3e1d71){if(_0x3e1d71){return db[_0x0741('0x5c')][_0x0741('0x25')]({'where':{'ListId':_0x31b939['query'][_0x0741('0x66')],'CampaignId':_0x31b939[_0x0741('0x4c')]['id']}})[_0x0741('0x24')](function(){return _0x3e1d71;});}})[_0x0741('0x24')](respondWithStatusCode(_0x214d3c,null))[_0x0741('0x4a')](handleError(_0x214d3c,null));};exports[_0x0741('0x85')]=function(_0x520072,_0x2eb9ab,_0x4356eb){var _0x1e2f88={};var _0x3419ef={};var _0x525bc7;var _0x2260b0;return db['Campaign'][_0x0741('0x5b')]({'where':{'id':_0x520072['params']['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x2eb9ab,null))[_0x0741('0x24')](function(_0x349b80){if(_0x349b80){_0x525bc7=_0x349b80;_0x3419ef['model']=_[_0x0741('0x4d')](db[_0x0741('0x86')][_0x0741('0x31')]);_0x3419ef['query']=_['keys'](_0x520072[_0x0741('0x35')]);_0x3419ef[_0x0741('0x36')]=_[_0x0741('0x37')](_0x3419ef[_0x0741('0x34')],_0x3419ef['query']);_0x1e2f88['attributes']=_[_0x0741('0x37')](_0x3419ef['model'],qs['fields'](_0x520072[_0x0741('0x35')]['fields']));_0x1e2f88[_0x0741('0x3a')]=_0x1e2f88['attributes'][_0x0741('0x39')]?_0x1e2f88[_0x0741('0x3a')]:_0x3419ef[_0x0741('0x34')];_0x1e2f88[_0x0741('0x3d')]=qs[_0x0741('0x3e')](_0x520072[_0x0741('0x35')][_0x0741('0x3e')]);_0x1e2f88[_0x0741('0x3f')]=qs[_0x0741('0x36')](_[_0x0741('0x40')](_0x520072[_0x0741('0x35')],_0x3419ef[_0x0741('0x36')]));if(_0x520072[_0x0741('0x35')]['filter']){_0x1e2f88[_0x0741('0x3f')]=_['merge'](_0x1e2f88['where'],{'$or':_[_0x0741('0x2f')](_0x1e2f88[_0x0741('0x3a')],function(_0x5d532a){var _0x2cc506={};_0x2cc506[_0x5d532a]={'$like':'%'+_0x520072['query'][_0x0741('0x41')]+'%'};return _0x2cc506;})});}_0x1e2f88=_[_0x0741('0x42')]({},_0x1e2f88,_0x520072['options']);return _0x525bc7['getBlackLists'](_0x1e2f88);}})['then'](function(_0x4a183b){if(_0x4a183b){_0x2260b0=_0x4a183b[_0x0741('0x39')];if(!_0x520072[_0x0741('0x35')][_0x0741('0x3b')](_0x0741('0x3c'))){_0x1e2f88[_0x0741('0x1d')]=qs[_0x0741('0x1d')](_0x520072['query'][_0x0741('0x1d')]);_0x1e2f88[_0x0741('0x1e')]=qs['offset'](_0x520072[_0x0741('0x35')][_0x0741('0x1e')]);}return _0x525bc7[_0x0741('0x85')](_0x1e2f88);}})[_0x0741('0x24')](function(_0x129417){if(_0x129417){return _0x129417?{'count':_0x2260b0,'rows':_0x129417}:null;}})['then'](respondWithResult(_0x2eb9ab,null))[_0x0741('0x4a')](handleError(_0x2eb9ab,null));};exports[_0x0741('0x87')]=function(_0x5ae756,_0x1d518a,_0x260e4d){var _0x1c2d59,_0x578750;return db[_0x0741('0x30')][_0x0741('0x4e')]({'where':{'id':_0x5ae756[_0x0741('0x4c')]['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x1d518a,null))[_0x0741('0x24')](function(_0x56a3e8){if(_0x56a3e8){_0x578750=_0x56a3e8;return _0x56a3e8[_0x0741('0x87')](_0x5ae756[_0x0741('0x57')][_0x0741('0x66')],_['omit'](_0x5ae756[_0x0741('0x57')],['ids','id'])||{});}return null;})[_0x0741('0x67')](function(_0x27f6f1){var _0x446de6;_0x1c2d59=_0x27f6f1||[];var _0x328202=[];if(_0x27f6f1){for(var _0x5a3000=0x0;_0x5a3000<_0x27f6f1[_0x0741('0x39')];_0x5a3000+=0x1){var _0x1b117c=_0x27f6f1[_0x5a3000][_0x0741('0x26')]({'plain':!![]});_0x446de6=squel[_0x0741('0x6a')]()[_0x0741('0x80')](_0x0741('0x88'))['fromQuery']([_0x0741('0x70'),_0x0741('0x6d'),'ListId',_0x0741('0x5d'),_0x0741('0x56'),_0x0741('0x76')],squel[_0x0741('0x6e')]()[_0x0741('0x6f')](_0x0741('0x70'),_0x0741('0x70'))[_0x0741('0x6f')]('id','ContactId')[_0x0741('0x6f')](_0x1b117c[_0x0741('0x73')][_0x0741('0x74')](),_0x0741('0x75'))['field'](_0x5ae756[_0x0741('0x4c')]['id'][_0x0741('0x74')](),_0x0741('0x5d'))['field'](_0x0741('0x71'),'createdAt')[_0x0741('0x6f')](_0x0741('0x71'),_0x0741('0x76'))[_0x0741('0x77')]('cm_contacts')[_0x0741('0x3f')](_0x0741('0x79'))[_0x0741('0x3f')]('ListId\x20=\x20?',_0x1b117c[_0x0741('0x73')][_0x0741('0x74')]())[_0x0741('0x3f')](_0x0741('0x7b')))[_0x0741('0x74')]();_0x328202[_0x0741('0x81')](db[_0x0741('0x82')]['query'](_0x446de6));}return BPromise['all'](_0x328202);}})[_0x0741('0x24')](function(){return _0x1c2d59;})['then'](respondWithResult(_0x1d518a,null))[_0x0741('0x4a')](handleError(_0x1d518a,null));};exports['removeBlackLists']=function(_0x10adb0,_0x1eb49c,_0x12a7de){return db['Campaign'][_0x0741('0x4e')]({'where':{'id':_0x10adb0['params']['id']}})[_0x0741('0x24')](handleEntityNotFound(_0x1eb49c,null))['then'](function(_0x5e9423){if(_0x5e9423){return _0x5e9423[_0x0741('0x89')](_0x10adb0[_0x0741('0x35')][_0x0741('0x66')]);}})[_0x0741('0x24')](function(_0x3cff44){if(_0x3cff44){return db[_0x0741('0x63')][_0x0741('0x25')]({'where':{'ListId':_0x10adb0[_0x0741('0x35')][_0x0741('0x66')],'CampaignId':_0x10adb0[_0x0741('0x4c')]['id']}})[_0x0741('0x24')](function(){return _0x3cff44;});}})[_0x0741('0x24')](respondWithStatusCode(_0x1eb49c,null))[_0x0741('0x4a')](handleError(_0x1eb49c,null));};
\ No newline at end of file
+var _0xb71b=['type','map','query','keys','filters','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','intersection','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','IvrCampaigns','getHoppers','findOne','CmHopper','nolimit','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','updatedAt','field','NOW()','scheduledAt','ContactId','CmListId','toString','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)','onlyIfOpen','into','ListId','cm_contacts','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','stack','name','index','Campaign','rawAttributes','fieldName'];(function(_0x108fc4,_0x4b0585){var _0x545e35=function(_0x3e0dd7){while(--_0x3e0dd7){_0x108fc4['push'](_0x108fc4['shift']());}};_0x545e35(++_0x4b0585);}(_0xb71b,0x1e8));var _0xbb71=function(_0x383a9d,_0x46d8f1){_0x383a9d=_0x383a9d-0x0;var _0x128f90=_0xb71b[_0x383a9d];return _0x128f90;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb71('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb71('0x1'));var rp=require(_0xbb71('0x2'));var moment=require(_0xbb71('0x3'));var BPromise=require(_0xbb71('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbb71('0x5'));var sox=require(_0xbb71('0x6'));var csv=require(_0xbb71('0x7'));var ejs=require(_0xbb71('0x8'));var fs=require('fs');var fs_extra=require(_0xbb71('0x9'));var _=require(_0xbb71('0xa'));var squel=require(_0xbb71('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbb71('0xc'));var toCsv=require(_0xbb71('0x7'));var querystring=require(_0xbb71('0xd'));var Papa=require(_0xbb71('0xe'));var Redis=require(_0xbb71('0xf'));var authService=require(_0xbb71('0x10'));var qs=require(_0xbb71('0x11'));var as=require(_0xbb71('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb71('0x13'))(_0xbb71('0x14'));var utils=require(_0xbb71('0x15'));var config=require(_0xbb71('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb71('0x17'))['db'];function respondWithStatusCode(_0xf6cf92,_0x3992f1){_0x3992f1=_0x3992f1||0xcc;return function(_0x24cd09){if(_0x24cd09){return _0xf6cf92[_0xbb71('0x18')](_0x3992f1);}return _0xf6cf92[_0xbb71('0x19')](_0x3992f1)[_0xbb71('0x1a')]();};}function respondWithResult(_0x58b833,_0x483fbd){_0x483fbd=_0x483fbd||0xc8;return function(_0x496bba){if(_0x496bba){return _0x58b833[_0xbb71('0x19')](_0x483fbd)[_0xbb71('0x1b')](_0x496bba);}};}function respondWithFilteredResult(_0x2ff567,_0x557b59){return function(_0x345065){if(_0x345065){var _0x27c2e0=typeof _0x557b59[_0xbb71('0x1c')]===_0xbb71('0x1d')&&typeof _0x557b59[_0xbb71('0x1e')]===_0xbb71('0x1d');var _0xba8221=_0x345065[_0xbb71('0x1f')];var _0x278b5d=_0x27c2e0?0x0:_0x557b59[_0xbb71('0x1c')];var _0x29bdc7=_0x27c2e0?_0x345065['count']:_0x557b59[_0xbb71('0x1c')]+_0x557b59[_0xbb71('0x1e')];var _0x29a322;if(_0x29bdc7>=_0xba8221){_0x29bdc7=_0xba8221;_0x29a322=0xc8;}else{_0x29a322=0xce;}_0x2ff567[_0xbb71('0x19')](_0x29a322);return _0x2ff567[_0xbb71('0x20')]('Content-Range',_0x278b5d+'-'+_0x29bdc7+'/'+_0xba8221)[_0xbb71('0x1b')](_0x345065);}return null;};}function patchUpdates(_0x5c9b8e){return function(_0x390465){try{jsonpatch[_0xbb71('0x21')](_0x390465,_0x5c9b8e,!![]);}catch(_0x3d0dec){return BPromise[_0xbb71('0x22')](_0x3d0dec);}return _0x390465[_0xbb71('0x23')]();};}function saveUpdates(_0x46dcf4,_0x1ee89b){return function(_0x1bb91f){if(_0x1bb91f){return _0x1bb91f['update'](_0x46dcf4)[_0xbb71('0x24')](function(_0x18c931){return _0x18c931;});}return null;};}function removeEntity(_0x71536,_0x19ded1){return function(_0x5654d4){if(_0x5654d4){return _0x5654d4[_0xbb71('0x25')]()[_0xbb71('0x24')](function(){var _0x5d61a7=_0x5654d4['get']({'plain':!![]});var _0x2c946c='IvrCampaigns';return db['UserProfileResource'][_0xbb71('0x25')]({'where':{'type':_0x2c946c,'resourceId':_0x5d61a7['id']}})['then'](function(){return _0x5654d4;});})['then'](function(){_0x71536[_0xbb71('0x19')](0xcc)[_0xbb71('0x1a')]();});}};}function handleEntityNotFound(_0x43fa35,_0x457f0){return function(_0xfd8684){if(!_0xfd8684){_0x43fa35[_0xbb71('0x18')](0x194);}return _0xfd8684;};}function handleError(_0x7b6e33,_0xe02996){_0xe02996=_0xe02996||0x1f4;return function(_0x597b83){logger['error'](_0x597b83[_0xbb71('0x26')]);if(_0x597b83[_0xbb71('0x27')]){delete _0x597b83[_0xbb71('0x27')];}_0x7b6e33[_0xbb71('0x19')](_0xe02996)['send'](_0x597b83);};}exports[_0xbb71('0x28')]=function(_0x3b8dee,_0x59d2f3){var _0x52563b={},_0x2a6653={},_0x4e5cb6={'count':0x0,'rows':[]};var _0x1cfd3b=_['map'](db[_0xbb71('0x29')][_0xbb71('0x2a')],function(_0xaaf442){return{'name':_0xaaf442[_0xbb71('0x2b')],'type':_0xaaf442[_0xbb71('0x2c')]['key']};});_0x2a6653['model']=_[_0xbb71('0x2d')](_0x1cfd3b,_0xbb71('0x27'));_0x2a6653[_0xbb71('0x2e')]=_[_0xbb71('0x2f')](_0x3b8dee[_0xbb71('0x2e')]);_0x2a6653[_0xbb71('0x30')]=_['intersection'](_0x2a6653[_0xbb71('0x31')],_0x2a6653[_0xbb71('0x2e')]);_0x52563b[_0xbb71('0x32')]=_['intersection'](_0x2a6653[_0xbb71('0x31')],qs['fields'](_0x3b8dee[_0xbb71('0x2e')][_0xbb71('0x33')]));_0x52563b[_0xbb71('0x32')]=_0x52563b[_0xbb71('0x32')]['length']?_0x52563b[_0xbb71('0x32')]:_0x2a6653['model'];if(!_0x3b8dee[_0xbb71('0x2e')][_0xbb71('0x34')]('nolimit')){_0x52563b[_0xbb71('0x1e')]=qs[_0xbb71('0x1e')](_0x3b8dee[_0xbb71('0x2e')]['limit']);_0x52563b[_0xbb71('0x1c')]=qs['offset'](_0x3b8dee[_0xbb71('0x2e')][_0xbb71('0x1c')]);}_0x52563b[_0xbb71('0x35')]=qs[_0xbb71('0x36')](_0x3b8dee[_0xbb71('0x2e')][_0xbb71('0x36')]);_0x52563b[_0xbb71('0x37')]=qs[_0xbb71('0x30')](_[_0xbb71('0x38')](_0x3b8dee['query'],_0x2a6653[_0xbb71('0x30')]),_0x1cfd3b);if(_0x3b8dee[_0xbb71('0x2e')][_0xbb71('0x39')]){_0x52563b['where']=_[_0xbb71('0x3a')](_0x52563b[_0xbb71('0x37')],{'$or':_[_0xbb71('0x2d')](_0x1cfd3b,function(_0x47789d){if(_0x47789d[_0xbb71('0x2c')]!=='VIRTUAL'){var _0x3e55a6={};_0x3e55a6[_0x47789d[_0xbb71('0x27')]]={'$like':'%'+_0x3b8dee['query'][_0xbb71('0x39')]+'%'};return _0x3e55a6;}})});}_0x52563b=_[_0xbb71('0x3a')]({},_0x52563b,_0x3b8dee[_0xbb71('0x3b')]);var _0x1f63f7={'where':_0x52563b[_0xbb71('0x37')]};return db[_0xbb71('0x29')][_0xbb71('0x1f')](_0x1f63f7)['then'](function(_0x532c03){_0x4e5cb6[_0xbb71('0x1f')]=_0x532c03;if(_0x3b8dee[_0xbb71('0x2e')][_0xbb71('0x3c')]){_0x52563b[_0xbb71('0x3d')]=[{'all':!![]}];}return db['Campaign'][_0xbb71('0x3e')](_0x52563b);})[_0xbb71('0x24')](function(_0x565337){_0x4e5cb6[_0xbb71('0x3f')]=_0x565337;return _0x4e5cb6;})[_0xbb71('0x24')](respondWithFilteredResult(_0x59d2f3,_0x52563b))[_0xbb71('0x40')](handleError(_0x59d2f3,null));};exports[_0xbb71('0x41')]=function(_0x370f1e,_0x341c1e){var _0xb6203e={'raw':![],'where':{'id':_0x370f1e['params']['id']}},_0x1bfcfe={};_0x1bfcfe['model']=_[_0xbb71('0x2f')](db[_0xbb71('0x29')][_0xbb71('0x2a')]);_0x1bfcfe[_0xbb71('0x2e')]=_[_0xbb71('0x2f')](_0x370f1e[_0xbb71('0x2e')]);_0x1bfcfe['filters']=_[_0xbb71('0x42')](_0x1bfcfe[_0xbb71('0x31')],_0x1bfcfe[_0xbb71('0x2e')]);_0xb6203e[_0xbb71('0x32')]=_[_0xbb71('0x42')](_0x1bfcfe['model'],qs[_0xbb71('0x33')](_0x370f1e[_0xbb71('0x2e')][_0xbb71('0x33')]));_0xb6203e[_0xbb71('0x32')]=_0xb6203e[_0xbb71('0x32')][_0xbb71('0x43')]?_0xb6203e['attributes']:_0x1bfcfe['model'];if(_0x370f1e[_0xbb71('0x2e')][_0xbb71('0x3c')]){_0xb6203e[_0xbb71('0x3d')]=[{'all':!![]}];}_0xb6203e=_[_0xbb71('0x3a')]({},_0xb6203e,_0x370f1e[_0xbb71('0x3b')]);return db[_0xbb71('0x29')]['find'](_0xb6203e)['then'](handleEntityNotFound(_0x341c1e,null))[_0xbb71('0x24')](respondWithResult(_0x341c1e,null))['catch'](handleError(_0x341c1e,null));};exports[_0xbb71('0x44')]=function(_0x4f44d5,_0x43cf31){return db[_0xbb71('0x29')]['create'](_0x4f44d5[_0xbb71('0x45')],{})[_0xbb71('0x24')](function(_0x48daa6){var _0x25cc25=_0x4f44d5[_0xbb71('0x46')]['get']({'plain':!![]});if(!_0x25cc25)throw new Error(_0xbb71('0x47'));if(_0x25cc25[_0xbb71('0x48')]==='user'){var _0x4c7d52=_0x48daa6[_0xbb71('0x49')]({'plain':!![]});var _0x19acf6='IvrCampaigns';return db[_0xbb71('0x4a')][_0xbb71('0x4b')]({'where':{'name':_0x19acf6,'userProfileId':_0x25cc25[_0xbb71('0x4c')]},'raw':!![]})['then'](function(_0x21c761){if(_0x21c761&&_0x21c761[_0xbb71('0x4d')]===0x0){return db[_0xbb71('0x4e')][_0xbb71('0x44')]({'name':_0x4c7d52['name'],'resourceId':_0x4c7d52['id'],'type':_0x21c761['name'],'sectionId':_0x21c761['id']},{})[_0xbb71('0x24')](function(){return _0x48daa6;});}else{return _0x48daa6;}})[_0xbb71('0x40')](function(_0x362e1a){logger[_0xbb71('0x4f')](_0xbb71('0x50'),_0x362e1a);throw _0x362e1a;});}return _0x48daa6;})[_0xbb71('0x24')](respondWithResult(_0x43cf31,0xc9))[_0xbb71('0x40')](handleError(_0x43cf31,null));};exports[_0xbb71('0x51')]=function(_0x3c025c,_0x34155c){var _0xa434c9={'where':{'id':_0x3c025c[_0xbb71('0x52')]['id']}},_0x85f7f5={};_0x85f7f5[_0xbb71('0x31')]=_[_0xbb71('0x2f')](db['Campaign'][_0xbb71('0x2a')]);_0xa434c9[_0xbb71('0x32')]=_[_0xbb71('0x42')](_0x85f7f5['model'],qs[_0xbb71('0x33')](_0x3c025c[_0xbb71('0x2e')][_0xbb71('0x33')]));_0xa434c9[_0xbb71('0x32')]=_0xa434c9['attributes'][_0xbb71('0x43')]?_0xa434c9[_0xbb71('0x32')]:_0x85f7f5['model'];if(_0x3c025c[_0xbb71('0x2e')]['includeAll']){_0xa434c9[_0xbb71('0x3d')]=[{'all':!![]}];}_0xa434c9=_[_0xbb71('0x3a')]({},_0xa434c9,_0x3c025c[_0xbb71('0x3b')]);return db[_0xbb71('0x29')]['find'](_0xa434c9)[_0xbb71('0x24')](handleEntityNotFound(_0x34155c,null))[_0xbb71('0x24')](function(_0x44556c){if(_0x44556c){var _0x2fdcc9=_0x44556c[_0xbb71('0x49')]({'plain':!![]});_0x2fdcc9=qs[_0xbb71('0x53')](_0x2fdcc9,['id',_0xbb71('0x54'),'updatedAt']);_0x3c025c['body']=_[_0xbb71('0x53')](_0x3c025c['body'],['id',_0xbb71('0x54'),'updatedAt']);return db[_0xbb71('0x29')]['create'](_[_0xbb71('0x3a')](_0x2fdcc9,_0x3c025c[_0xbb71('0x45')]),{'include':_0x3c025c[_0xbb71('0x2e')]['includeAll']?[{'all':!![]}]:undefined})[_0xbb71('0x24')](function(_0x499f8a){var _0x3ce858=_0x3c025c[_0xbb71('0x46')]['get']({'plain':!![]});if(!_0x3ce858)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ce858['role']==='user'){var _0x179121=_0x499f8a[_0xbb71('0x49')]({'plain':!![]});var _0x44dfe4=_0xbb71('0x55');return db['UserProfileSection'][_0xbb71('0x4b')]({'where':{'name':_0x44dfe4,'userProfileId':_0x3ce858['userProfileId']},'raw':!![]})[_0xbb71('0x24')](function(_0x1ca9d0){if(_0x1ca9d0&&_0x1ca9d0[_0xbb71('0x4d')]===0x0){return db[_0xbb71('0x4e')][_0xbb71('0x44')]({'name':_0x179121[_0xbb71('0x27')],'resourceId':_0x179121['id'],'type':_0x1ca9d0['name'],'sectionId':_0x1ca9d0['id']},{})['then'](function(){return _0x499f8a;});}else{return _0x499f8a;}})[_0xbb71('0x40')](function(_0x1c8f6f){logger[_0xbb71('0x4f')](_0xbb71('0x50'),_0x1c8f6f);throw _0x1c8f6f;});}return _0x499f8a;});}})[_0xbb71('0x24')](respondWithResult(_0x34155c,0xc9))[_0xbb71('0x40')](handleError(_0x34155c,null));};exports['update']=function(_0x270852,_0x1b14a9){if(_0x270852[_0xbb71('0x45')]['id']){delete _0x270852[_0xbb71('0x45')]['id'];}return db[_0xbb71('0x29')]['find']({'where':{'id':_0x270852[_0xbb71('0x52')]['id']}})[_0xbb71('0x24')](handleEntityNotFound(_0x1b14a9,null))[_0xbb71('0x24')](saveUpdates(_0x270852[_0xbb71('0x45')],null))[_0xbb71('0x24')](respondWithResult(_0x1b14a9,null))[_0xbb71('0x40')](handleError(_0x1b14a9,null));};exports[_0xbb71('0x25')]=function(_0x5ad4c9,_0x2bd7b1){return db[_0xbb71('0x29')]['find']({'where':{'id':_0x5ad4c9[_0xbb71('0x52')]['id']}})[_0xbb71('0x24')](handleEntityNotFound(_0x2bd7b1,null))[_0xbb71('0x24')](removeEntity(_0x2bd7b1,null))['catch'](handleError(_0x2bd7b1,null));};exports[_0xbb71('0x56')]=function(_0x5cbf14,_0xc6c9e5,_0x3d7f48){var _0x3f8e6d={'raw':!![],'where':{}};var _0x12d4cf={};var _0x1bde0f={'count':0x0,'rows':[]};return db[_0xbb71('0x29')][_0xbb71('0x57')]({'where':{'id':_0x5cbf14[_0xbb71('0x52')]['id']}})[_0xbb71('0x24')](handleEntityNotFound(_0xc6c9e5,null))[_0xbb71('0x24')](function(_0x31ffe6){if(_0x31ffe6){_0x12d4cf[_0xbb71('0x31')]=_['keys'](db[_0xbb71('0x58')][_0xbb71('0x2a')]);_0x12d4cf[_0xbb71('0x2e')]=_[_0xbb71('0x2f')](_0x5cbf14[_0xbb71('0x2e')]);_0x12d4cf[_0xbb71('0x30')]=_['intersection'](_0x12d4cf[_0xbb71('0x31')],_0x12d4cf[_0xbb71('0x2e')]);_0x3f8e6d[_0xbb71('0x32')]=_[_0xbb71('0x42')](_0x12d4cf['model'],qs['fields'](_0x5cbf14['query'][_0xbb71('0x33')]));_0x3f8e6d['attributes']=_0x3f8e6d[_0xbb71('0x32')]['length']?_0x3f8e6d[_0xbb71('0x32')]:_0x12d4cf[_0xbb71('0x31')];if(!_0x5cbf14['query'][_0xbb71('0x34')](_0xbb71('0x59'))){_0x3f8e6d[_0xbb71('0x1e')]=qs[_0xbb71('0x1e')](_0x5cbf14['query'][_0xbb71('0x1e')]);_0x3f8e6d[_0xbb71('0x1c')]=qs[_0xbb71('0x1c')](_0x5cbf14[_0xbb71('0x2e')][_0xbb71('0x1c')]);}_0x3f8e6d[_0xbb71('0x35')]=qs[_0xbb71('0x36')](_0x5cbf14['query'][_0xbb71('0x36')]);_0x3f8e6d['where']=qs['filters'](_[_0xbb71('0x38')](_0x5cbf14[_0xbb71('0x2e')],_0x12d4cf[_0xbb71('0x30')]));_0x3f8e6d[_0xbb71('0x37')][_0xbb71('0x5a')]=_0x31ffe6['id'];if(_0x5cbf14[_0xbb71('0x2e')]['filter']){_0x3f8e6d['where']=_['merge'](_0x3f8e6d[_0xbb71('0x37')],{'$or':_['map'](_0x3f8e6d[_0xbb71('0x32')],function(_0x5a999d){var _0x4b2704={};_0x4b2704[_0x5a999d]={'$like':'%'+_0x5cbf14[_0xbb71('0x2e')][_0xbb71('0x39')]+'%'};return _0x4b2704;})});}_0x3f8e6d=_[_0xbb71('0x3a')]({},_0x3f8e6d,_0x5cbf14[_0xbb71('0x3b')]);return db['CmHopper'][_0xbb71('0x1f')]({'where':_0x3f8e6d['where']})[_0xbb71('0x24')](function(_0x5d7179){_0x1bde0f[_0xbb71('0x1f')]=_0x5d7179;if(_0x5cbf14[_0xbb71('0x2e')]['includeAll']){_0x3f8e6d[_0xbb71('0x3d')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x3f8e6d);})[_0xbb71('0x24')](function(_0x31d754){_0x1bde0f['rows']=_0x31d754;return _0x1bde0f;});}})[_0xbb71('0x24')](respondWithFilteredResult(_0xc6c9e5,_0x3f8e6d))[_0xbb71('0x40')](handleError(_0xc6c9e5,null));};exports[_0xbb71('0x5b')]=function(_0x234f64,_0x3a293d,_0x211b0b){var _0x5a9129={'raw':!![],'where':{}};var _0x4a4084={};var _0x1cf5d2={'count':0x0,'rows':[]};return db[_0xbb71('0x29')][_0xbb71('0x57')]({'where':{'id':_0x234f64[_0xbb71('0x52')]['id']}})[_0xbb71('0x24')](handleEntityNotFound(_0x3a293d,null))[_0xbb71('0x24')](function(_0x2a66f9){if(_0x2a66f9){_0x4a4084[_0xbb71('0x31')]=_[_0xbb71('0x2f')](db[_0xbb71('0x5c')][_0xbb71('0x2a')]);_0x4a4084[_0xbb71('0x2e')]=_[_0xbb71('0x2f')](_0x234f64[_0xbb71('0x2e')]);_0x4a4084['filters']=_[_0xbb71('0x42')](_0x4a4084[_0xbb71('0x31')],_0x4a4084[_0xbb71('0x2e')]);_0x5a9129[_0xbb71('0x32')]=_[_0xbb71('0x42')](_0x4a4084[_0xbb71('0x31')],qs[_0xbb71('0x33')](_0x234f64[_0xbb71('0x2e')][_0xbb71('0x33')]));_0x5a9129['attributes']=_0x5a9129['attributes']['length']?_0x5a9129[_0xbb71('0x32')]:_0x4a4084[_0xbb71('0x31')];if(!_0x234f64[_0xbb71('0x2e')][_0xbb71('0x34')]('nolimit')){_0x5a9129[_0xbb71('0x1e')]=qs[_0xbb71('0x1e')](_0x234f64[_0xbb71('0x2e')][_0xbb71('0x1e')]);_0x5a9129['offset']=qs[_0xbb71('0x1c')](_0x234f64[_0xbb71('0x2e')][_0xbb71('0x1c')]);}_0x5a9129[_0xbb71('0x35')]=qs[_0xbb71('0x36')](_0x234f64['query']['sort']);_0x5a9129['where']=qs[_0xbb71('0x30')](_[_0xbb71('0x38')](_0x234f64[_0xbb71('0x2e')],_0x4a4084[_0xbb71('0x30')]));_0x5a9129['where'][_0xbb71('0x5a')]=_0x2a66f9['id'];if(_0x234f64[_0xbb71('0x2e')][_0xbb71('0x39')]){_0x5a9129[_0xbb71('0x37')]=_[_0xbb71('0x3a')](_0x5a9129[_0xbb71('0x37')],{'$or':_[_0xbb71('0x2d')](_0x5a9129['attributes'],function(_0x252b04){var _0x1c4e6e={};_0x1c4e6e[_0x252b04]={'$like':'%'+_0x234f64[_0xbb71('0x2e')][_0xbb71('0x39')]+'%'};return _0x1c4e6e;})});}_0x5a9129=_['merge']({},_0x5a9129,_0x234f64[_0xbb71('0x3b')]);return db[_0xbb71('0x5c')][_0xbb71('0x1f')]({'where':_0x5a9129[_0xbb71('0x37')]})[_0xbb71('0x24')](function(_0x310532){_0x1cf5d2[_0xbb71('0x1f')]=_0x310532;if(_0x234f64[_0xbb71('0x2e')][_0xbb71('0x3c')]){_0x5a9129[_0xbb71('0x3d')]=[{'all':!![]}];}return db[_0xbb71('0x5c')]['findAll'](_0x5a9129);})[_0xbb71('0x24')](function(_0x344263){_0x1cf5d2[_0xbb71('0x3f')]=_0x344263;return _0x1cf5d2;});}})[_0xbb71('0x24')](respondWithFilteredResult(_0x3a293d,_0x5a9129))['catch'](handleError(_0x3a293d,null));};exports[_0xbb71('0x5d')]=function(_0x2826b3,_0x38043e,_0x2e8aba){var _0x9ef327={'raw':!![],'where':{}};var _0x11df5c={};var _0x26482b={'count':0x0,'rows':[]};return db['Campaign'][_0xbb71('0x57')]({'where':{'id':_0x2826b3[_0xbb71('0x52')]['id']}})['then'](handleEntityNotFound(_0x38043e,null))[_0xbb71('0x24')](function(_0x3f1242){if(_0x3f1242){_0x11df5c[_0xbb71('0x31')]=_[_0xbb71('0x2f')](db['CmHopperFinal']['rawAttributes']);_0x11df5c[_0xbb71('0x2e')]=_[_0xbb71('0x2f')](_0x2826b3[_0xbb71('0x2e')]);_0x11df5c[_0xbb71('0x30')]=_[_0xbb71('0x42')](_0x11df5c[_0xbb71('0x31')],_0x11df5c[_0xbb71('0x2e')]);_0x9ef327[_0xbb71('0x32')]=_['intersection'](_0x11df5c[_0xbb71('0x31')],qs['fields'](_0x2826b3[_0xbb71('0x2e')]['fields']));_0x9ef327['attributes']=_0x9ef327[_0xbb71('0x32')][_0xbb71('0x43')]?_0x9ef327[_0xbb71('0x32')]:_0x11df5c[_0xbb71('0x31')];if(!_0x2826b3[_0xbb71('0x2e')][_0xbb71('0x34')](_0xbb71('0x59'))){_0x9ef327[_0xbb71('0x1e')]=qs[_0xbb71('0x1e')](_0x2826b3[_0xbb71('0x2e')]['limit']);_0x9ef327[_0xbb71('0x1c')]=qs['offset'](_0x2826b3[_0xbb71('0x2e')][_0xbb71('0x1c')]);}_0x9ef327[_0xbb71('0x35')]=qs[_0xbb71('0x36')](_0x2826b3['query'][_0xbb71('0x36')]);_0x9ef327[_0xbb71('0x37')]=qs[_0xbb71('0x30')](_[_0xbb71('0x38')](_0x2826b3[_0xbb71('0x2e')],_0x11df5c[_0xbb71('0x30')]));_0x9ef327[_0xbb71('0x37')][_0xbb71('0x5a')]=_0x3f1242['id'];if(_0x2826b3[_0xbb71('0x2e')][_0xbb71('0x39')]){_0x9ef327[_0xbb71('0x37')]=_['merge'](_0x9ef327[_0xbb71('0x37')],{'$or':_[_0xbb71('0x2d')](_0x9ef327['attributes'],function(_0x7d0178){var _0x298acb={};_0x298acb[_0x7d0178]={'$like':'%'+_0x2826b3['query'][_0xbb71('0x39')]+'%'};return _0x298acb;})});}_0x9ef327=_['merge']({},_0x9ef327,_0x2826b3[_0xbb71('0x3b')]);return db['CmHopperFinal'][_0xbb71('0x1f')]({'where':_0x9ef327['where']})['then'](function(_0x1e9084){_0x26482b[_0xbb71('0x1f')]=_0x1e9084;if(_0x2826b3[_0xbb71('0x2e')][_0xbb71('0x3c')]){_0x9ef327['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xbb71('0x3e')](_0x9ef327);})['then'](function(_0x202fa8){_0x26482b[_0xbb71('0x3f')]=_0x202fa8;return _0x26482b;});}})[_0xbb71('0x24')](respondWithFilteredResult(_0x38043e,_0x9ef327))[_0xbb71('0x40')](handleError(_0x38043e,null));};exports[_0xbb71('0x5e')]=function(_0x48fe06,_0x235b63,_0x1d79a3){var _0x47a621={'raw':!![],'where':{}};var _0x580c00={};var _0x271899={'count':0x0,'rows':[]};return db[_0xbb71('0x29')][_0xbb71('0x57')]({'where':{'id':_0x48fe06[_0xbb71('0x52')]['id']}})['then'](handleEntityNotFound(_0x235b63,null))[_0xbb71('0x24')](function(_0x7e1104){if(_0x7e1104){_0x580c00[_0xbb71('0x31')]=_[_0xbb71('0x2f')](db[_0xbb71('0x5f')][_0xbb71('0x2a')]);_0x580c00[_0xbb71('0x2e')]=_[_0xbb71('0x2f')](_0x48fe06[_0xbb71('0x2e')]);_0x580c00[_0xbb71('0x30')]=_['intersection'](_0x580c00[_0xbb71('0x31')],_0x580c00['query']);_0x47a621[_0xbb71('0x32')]=_[_0xbb71('0x42')](_0x580c00[_0xbb71('0x31')],qs[_0xbb71('0x33')](_0x48fe06[_0xbb71('0x2e')][_0xbb71('0x33')]));_0x47a621['attributes']=_0x47a621[_0xbb71('0x32')][_0xbb71('0x43')]?_0x47a621[_0xbb71('0x32')]:_0x580c00['model'];if(!_0x48fe06[_0xbb71('0x2e')][_0xbb71('0x34')]('nolimit')){_0x47a621[_0xbb71('0x1e')]=qs['limit'](_0x48fe06[_0xbb71('0x2e')][_0xbb71('0x1e')]);_0x47a621[_0xbb71('0x1c')]=qs[_0xbb71('0x1c')](_0x48fe06[_0xbb71('0x2e')]['offset']);}_0x47a621[_0xbb71('0x35')]=qs[_0xbb71('0x36')](_0x48fe06[_0xbb71('0x2e')][_0xbb71('0x36')]);_0x47a621[_0xbb71('0x37')]=qs[_0xbb71('0x30')](_[_0xbb71('0x38')](_0x48fe06[_0xbb71('0x2e')],_0x580c00[_0xbb71('0x30')]));_0x47a621[_0xbb71('0x37')][_0xbb71('0x5a')]=_0x7e1104['id'];if(_0x48fe06[_0xbb71('0x2e')][_0xbb71('0x39')]){_0x47a621[_0xbb71('0x37')]=_[_0xbb71('0x3a')](_0x47a621[_0xbb71('0x37')],{'$or':_[_0xbb71('0x2d')](_0x47a621[_0xbb71('0x32')],function(_0x51c51a){var _0x2e7cf2={};_0x2e7cf2[_0x51c51a]={'$like':'%'+_0x48fe06[_0xbb71('0x2e')]['filter']+'%'};return _0x2e7cf2;})});}_0x47a621=_[_0xbb71('0x3a')]({},_0x47a621,_0x48fe06['options']);return db[_0xbb71('0x5f')][_0xbb71('0x1f')]({'where':_0x47a621[_0xbb71('0x37')]})[_0xbb71('0x24')](function(_0x3fb1a6){_0x271899[_0xbb71('0x1f')]=_0x3fb1a6;if(_0x48fe06[_0xbb71('0x2e')]['includeAll']){_0x47a621['include']=[{'all':!![]}];}return db[_0xbb71('0x5f')][_0xbb71('0x3e')](_0x47a621);})[_0xbb71('0x24')](function(_0x2c16f1){_0x271899[_0xbb71('0x3f')]=_0x2c16f1;return _0x271899;});}})['then'](respondWithFilteredResult(_0x235b63,_0x47a621))['catch'](handleError(_0x235b63,null));};exports[_0xbb71('0x60')]=function(_0xbe53ff,_0x53bc7b,_0x543e19){var _0x1b6c14={};var _0x410e51={};var _0x32ce5f;var _0x3c1d44;return db[_0xbb71('0x29')][_0xbb71('0x57')]({'where':{'id':_0xbe53ff[_0xbb71('0x52')]['id']}})['then'](handleEntityNotFound(_0x53bc7b,null))[_0xbb71('0x24')](function(_0x21873a){if(_0x21873a){_0x32ce5f=_0x21873a;_0x410e51[_0xbb71('0x31')]=_[_0xbb71('0x2f')](db[_0xbb71('0x61')][_0xbb71('0x2a')]);_0x410e51[_0xbb71('0x2e')]=_[_0xbb71('0x2f')](_0xbe53ff[_0xbb71('0x2e')]);_0x410e51['filters']=_[_0xbb71('0x42')](_0x410e51[_0xbb71('0x31')],_0x410e51[_0xbb71('0x2e')]);_0x1b6c14[_0xbb71('0x32')]=_[_0xbb71('0x42')](_0x410e51['model'],qs['fields'](_0xbe53ff[_0xbb71('0x2e')][_0xbb71('0x33')]));_0x1b6c14['attributes']=_0x1b6c14[_0xbb71('0x32')][_0xbb71('0x43')]?_0x1b6c14[_0xbb71('0x32')]:_0x410e51[_0xbb71('0x31')];_0x1b6c14['order']=qs['sort'](_0xbe53ff[_0xbb71('0x2e')][_0xbb71('0x36')]);_0x1b6c14[_0xbb71('0x37')]=qs[_0xbb71('0x30')](_['pick'](_0xbe53ff[_0xbb71('0x2e')],_0x410e51[_0xbb71('0x30')]));if(_0xbe53ff['query'][_0xbb71('0x39')]){_0x1b6c14[_0xbb71('0x37')]=_[_0xbb71('0x3a')](_0x1b6c14[_0xbb71('0x37')],{'$or':_[_0xbb71('0x2d')](_0x1b6c14[_0xbb71('0x32')],function(_0x573ae5){var _0x4d0d6f={};_0x4d0d6f[_0x573ae5]={'$like':'%'+_0xbe53ff[_0xbb71('0x2e')]['filter']+'%'};return _0x4d0d6f;})});}_0x1b6c14=_[_0xbb71('0x3a')]({},_0x1b6c14,_0xbe53ff[_0xbb71('0x3b')]);return _0x32ce5f[_0xbb71('0x60')](_0x1b6c14);}})[_0xbb71('0x24')](function(_0xfb11f1){if(_0xfb11f1){_0x3c1d44=_0xfb11f1[_0xbb71('0x43')];if(!_0xbe53ff[_0xbb71('0x2e')][_0xbb71('0x34')](_0xbb71('0x59'))){_0x1b6c14[_0xbb71('0x1e')]=qs['limit'](_0xbe53ff[_0xbb71('0x2e')]['limit']);_0x1b6c14['offset']=qs[_0xbb71('0x1c')](_0xbe53ff['query'][_0xbb71('0x1c')]);}return _0x32ce5f[_0xbb71('0x60')](_0x1b6c14);}})[_0xbb71('0x24')](function(_0x411cb7){if(_0x411cb7){return _0x411cb7?{'count':_0x3c1d44,'rows':_0x411cb7}:null;}})[_0xbb71('0x24')](respondWithResult(_0x53bc7b,null))[_0xbb71('0x40')](handleError(_0x53bc7b,null));};exports['addLists']=function(_0x3b9e64,_0x2740c0,_0x2bb43d){var _0x4c0657,_0x24eaf6;return db[_0xbb71('0x29')][_0xbb71('0x4b')]({'where':{'id':_0x3b9e64[_0xbb71('0x52')]['id']}})['then'](handleEntityNotFound(_0x2740c0,null))[_0xbb71('0x24')](function(_0x59b667){if(_0x59b667){_0x24eaf6=_0x59b667;return _0x59b667[_0xbb71('0x62')](_0x3b9e64[_0xbb71('0x45')][_0xbb71('0x63')],_[_0xbb71('0x53')](_0x3b9e64['body'],['ids','id'])||{});}return null;})[_0xbb71('0x64')](function(_0x314982){var _0x28604a;_0x4c0657=_0x314982||[];var _0x1cfee1=[];if(_0x314982){for(var _0x3a4b1a=0x0;_0x3a4b1a<_0x314982[_0xbb71('0x43')];_0x3a4b1a+=0x1){var _0x38f473=_0x314982[_0x3a4b1a][_0xbb71('0x49')]({'plain':!![]});_0x24eaf6[_0xbb71('0x65')]=_0x3b9e64['body']['dialCheckDuplicateType']?_0x3b9e64[_0xbb71('0x45')][_0xbb71('0x65')]:_0x24eaf6['dialCheckDuplicateType'];switch(_0x24eaf6[_0xbb71('0x65')]){case _0xbb71('0x66'):_0x28604a=squel[_0xbb71('0x67')]()['into'](_0xbb71('0x68'))[_0xbb71('0x69')]([_0xbb71('0x6a'),'scheduledAt','ContactId','ListId',_0xbb71('0x5a'),_0xbb71('0x54'),_0xbb71('0x6b')],squel['select']()['field'](_0xbb71('0x6a'),'phone')[_0xbb71('0x6c')](_0xbb71('0x6d'),_0xbb71('0x6e'))[_0xbb71('0x6c')]('id',_0xbb71('0x6f'))['field'](_0x38f473[_0xbb71('0x70')]['toString'](),'ListId')[_0xbb71('0x6c')](_0x3b9e64['params']['id'][_0xbb71('0x71')](),_0xbb71('0x5a'))['field'](_0xbb71('0x6d'),_0xbb71('0x54'))[_0xbb71('0x6c')]('NOW()','updatedAt')[_0xbb71('0x72')]('cm_contacts')[_0xbb71('0x37')](_0xbb71('0x73'))[_0xbb71('0x37')]('ListId\x20=\x20?',_0x38f473[_0xbb71('0x70')]['toString']())[_0xbb71('0x37')](_0xbb71('0x74'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()['field']('COALESCE(calleridnum,\x27\x27)')[_0xbb71('0x72')]('cm_hopper_final')[_0xbb71('0x37')](_0xbb71('0x75'),_0x3b9e64['params']['id'][_0xbb71('0x71')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xbb71('0x76')]()['field'](_0xbb71('0x77'))[_0xbb71('0x72')](_0xbb71('0x68'))[_0xbb71('0x37')](_0xbb71('0x75'),_0x3b9e64[_0xbb71('0x52')]['id'][_0xbb71('0x71')]())))[_0xbb71('0x71')]();break;case _0xbb71('0x78'):_0x28604a=squel['insert']()[_0xbb71('0x79')](_0xbb71('0x68'))[_0xbb71('0x69')]([_0xbb71('0x6a'),_0xbb71('0x6e'),_0xbb71('0x6f'),_0xbb71('0x7a'),_0xbb71('0x5a'),_0xbb71('0x54'),_0xbb71('0x6b')],squel[_0xbb71('0x76')]()[_0xbb71('0x6c')](_0xbb71('0x6a'),'phone')[_0xbb71('0x6c')](_0xbb71('0x6d'),_0xbb71('0x6e'))[_0xbb71('0x6c')]('id',_0xbb71('0x6f'))[_0xbb71('0x6c')](_0x38f473[_0xbb71('0x70')][_0xbb71('0x71')](),_0xbb71('0x7a'))['field'](_0x3b9e64['params']['id']['toString'](),_0xbb71('0x5a'))[_0xbb71('0x6c')]('NOW()',_0xbb71('0x54'))[_0xbb71('0x6c')](_0xbb71('0x6d'),_0xbb71('0x6b'))[_0xbb71('0x72')](_0xbb71('0x7b'))[_0xbb71('0x37')](_0xbb71('0x73'))[_0xbb71('0x37')]('ListId\x20=\x20?',_0x38f473[_0xbb71('0x70')][_0xbb71('0x71')]())['where'](_0xbb71('0x74'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xbb71('0x76')]()[_0xbb71('0x6c')]('COALESCE(phone,\x27\x27)')[_0xbb71('0x72')](_0xbb71('0x68'))[_0xbb71('0x37')]('CampaignId\x20=\x20?',_0x3b9e64['params']['id'][_0xbb71('0x71')]())))[_0xbb71('0x71')]();break;default:_0x28604a=squel[_0xbb71('0x67')]()[_0xbb71('0x79')](_0xbb71('0x68'))['fromQuery']([_0xbb71('0x6a'),_0xbb71('0x6e'),_0xbb71('0x6f'),_0xbb71('0x7a'),_0xbb71('0x5a'),_0xbb71('0x54'),'updatedAt'],squel['select']()[_0xbb71('0x6c')](_0xbb71('0x6a'),_0xbb71('0x6a'))[_0xbb71('0x6c')]('NOW()',_0xbb71('0x6e'))[_0xbb71('0x6c')]('id',_0xbb71('0x6f'))[_0xbb71('0x6c')](_0x38f473['CmListId'][_0xbb71('0x71')](),'ListId')[_0xbb71('0x6c')](_0x3b9e64['params']['id'][_0xbb71('0x71')](),_0xbb71('0x5a'))['field'](_0xbb71('0x6d'),'createdAt')[_0xbb71('0x6c')](_0xbb71('0x6d'),_0xbb71('0x6b'))[_0xbb71('0x72')](_0xbb71('0x7b'))[_0xbb71('0x37')]('deletedAt\x20IS\x20NULL')[_0xbb71('0x37')](_0xbb71('0x7c'),_0x38f473[_0xbb71('0x70')][_0xbb71('0x71')]())[_0xbb71('0x37')](_0xbb71('0x74')))['toString']();}_0x1cfee1[_0xbb71('0x7d')](db[_0xbb71('0x7e')][_0xbb71('0x2e')](_0x28604a));}return BPromise[_0xbb71('0x7f')](_0x1cfee1);}})[_0xbb71('0x24')](function(){return _0x4c0657;})[_0xbb71('0x24')](respondWithResult(_0x2740c0,null))[_0xbb71('0x40')](handleError(_0x2740c0,null));};exports[_0xbb71('0x80')]=function(_0x5479a7,_0xc0c4bd,_0x165fa8){return db['Campaign'][_0xbb71('0x4b')]({'where':{'id':_0x5479a7[_0xbb71('0x52')]['id']}})[_0xbb71('0x24')](handleEntityNotFound(_0xc0c4bd,null))[_0xbb71('0x24')](function(_0x83c1d7){if(_0x83c1d7){return _0x83c1d7[_0xbb71('0x80')](_0x5479a7[_0xbb71('0x2e')][_0xbb71('0x63')]);}})['then'](function(_0x1867c9){if(_0x1867c9){return db['CmHopper'][_0xbb71('0x25')]({'where':{'ListId':_0x5479a7['query'][_0xbb71('0x63')],'CampaignId':_0x5479a7[_0xbb71('0x52')]['id']}})[_0xbb71('0x24')](function(){return _0x1867c9;});}})[_0xbb71('0x24')](respondWithStatusCode(_0xc0c4bd,null))[_0xbb71('0x40')](handleError(_0xc0c4bd,null));};exports['getBlackLists']=function(_0x51fcc7,_0x28f5e7,_0x60845b){var _0x54c457={};var _0x1435d6={};var _0x4fcb3;var _0x39434d;return db['Campaign'][_0xbb71('0x57')]({'where':{'id':_0x51fcc7[_0xbb71('0x52')]['id']}})[_0xbb71('0x24')](handleEntityNotFound(_0x28f5e7,null))[_0xbb71('0x24')](function(_0x4bcd51){if(_0x4bcd51){_0x4fcb3=_0x4bcd51;_0x1435d6[_0xbb71('0x31')]=_[_0xbb71('0x2f')](db[_0xbb71('0x61')][_0xbb71('0x2a')]);_0x1435d6[_0xbb71('0x2e')]=_['keys'](_0x51fcc7[_0xbb71('0x2e')]);_0x1435d6[_0xbb71('0x30')]=_[_0xbb71('0x42')](_0x1435d6[_0xbb71('0x31')],_0x1435d6[_0xbb71('0x2e')]);_0x54c457['attributes']=_[_0xbb71('0x42')](_0x1435d6[_0xbb71('0x31')],qs[_0xbb71('0x33')](_0x51fcc7['query'][_0xbb71('0x33')]));_0x54c457[_0xbb71('0x32')]=_0x54c457['attributes']['length']?_0x54c457[_0xbb71('0x32')]:_0x1435d6[_0xbb71('0x31')];_0x54c457['order']=qs[_0xbb71('0x36')](_0x51fcc7[_0xbb71('0x2e')][_0xbb71('0x36')]);_0x54c457[_0xbb71('0x37')]=qs[_0xbb71('0x30')](_[_0xbb71('0x38')](_0x51fcc7['query'],_0x1435d6[_0xbb71('0x30')]));if(_0x51fcc7[_0xbb71('0x2e')][_0xbb71('0x39')]){_0x54c457[_0xbb71('0x37')]=_[_0xbb71('0x3a')](_0x54c457[_0xbb71('0x37')],{'$or':_[_0xbb71('0x2d')](_0x54c457[_0xbb71('0x32')],function(_0x4cdd93){var _0x5987cb={};_0x5987cb[_0x4cdd93]={'$like':'%'+_0x51fcc7[_0xbb71('0x2e')][_0xbb71('0x39')]+'%'};return _0x5987cb;})});}_0x54c457=_['merge']({},_0x54c457,_0x51fcc7['options']);return _0x4fcb3[_0xbb71('0x81')](_0x54c457);}})[_0xbb71('0x24')](function(_0x521c30){if(_0x521c30){_0x39434d=_0x521c30[_0xbb71('0x43')];if(!_0x51fcc7[_0xbb71('0x2e')]['hasOwnProperty'](_0xbb71('0x59'))){_0x54c457[_0xbb71('0x1e')]=qs['limit'](_0x51fcc7[_0xbb71('0x2e')][_0xbb71('0x1e')]);_0x54c457['offset']=qs[_0xbb71('0x1c')](_0x51fcc7[_0xbb71('0x2e')][_0xbb71('0x1c')]);}return _0x4fcb3[_0xbb71('0x81')](_0x54c457);}})[_0xbb71('0x24')](function(_0xbd0a84){if(_0xbd0a84){return _0xbd0a84?{'count':_0x39434d,'rows':_0xbd0a84}:null;}})[_0xbb71('0x24')](respondWithResult(_0x28f5e7,null))[_0xbb71('0x40')](handleError(_0x28f5e7,null));};exports[_0xbb71('0x82')]=function(_0x46b08b,_0x35f032,_0x5ad3ae){var _0x457173,_0xaa89fa;return db[_0xbb71('0x29')]['find']({'where':{'id':_0x46b08b['params']['id']}})['then'](handleEntityNotFound(_0x35f032,null))[_0xbb71('0x24')](function(_0x3295d5){if(_0x3295d5){_0xaa89fa=_0x3295d5;return _0x3295d5[_0xbb71('0x82')](_0x46b08b[_0xbb71('0x45')][_0xbb71('0x63')],_[_0xbb71('0x53')](_0x46b08b['body'],[_0xbb71('0x63'),'id'])||{});}return null;})[_0xbb71('0x64')](function(_0x27b48e){var _0x10d37c;_0x457173=_0x27b48e||[];var _0x59dd17=[];if(_0x27b48e){for(var _0x4c7256=0x0;_0x4c7256<_0x27b48e[_0xbb71('0x43')];_0x4c7256+=0x1){var _0x2209ba=_0x27b48e[_0x4c7256][_0xbb71('0x49')]({'plain':!![]});_0x10d37c=squel[_0xbb71('0x67')]()[_0xbb71('0x79')](_0xbb71('0x83'))[_0xbb71('0x69')]([_0xbb71('0x6a'),_0xbb71('0x6f'),_0xbb71('0x7a'),_0xbb71('0x5a'),_0xbb71('0x54'),_0xbb71('0x6b')],squel[_0xbb71('0x76')]()[_0xbb71('0x6c')]('phone','phone')[_0xbb71('0x6c')]('id',_0xbb71('0x6f'))[_0xbb71('0x6c')](_0x2209ba[_0xbb71('0x70')][_0xbb71('0x71')](),_0xbb71('0x7a'))[_0xbb71('0x6c')](_0x46b08b['params']['id'][_0xbb71('0x71')](),_0xbb71('0x5a'))[_0xbb71('0x6c')](_0xbb71('0x6d'),_0xbb71('0x54'))[_0xbb71('0x6c')]('NOW()',_0xbb71('0x6b'))['from'](_0xbb71('0x7b'))[_0xbb71('0x37')](_0xbb71('0x73'))[_0xbb71('0x37')](_0xbb71('0x7c'),_0x2209ba[_0xbb71('0x70')][_0xbb71('0x71')]())['where'](_0xbb71('0x74')))['toString']();_0x59dd17['push'](db[_0xbb71('0x7e')]['query'](_0x10d37c));}return BPromise[_0xbb71('0x7f')](_0x59dd17);}})[_0xbb71('0x24')](function(){return _0x457173;})[_0xbb71('0x24')](respondWithResult(_0x35f032,null))[_0xbb71('0x40')](handleError(_0x35f032,null));};exports[_0xbb71('0x84')]=function(_0x4e3007,_0x5168a4,_0x22fddc){return db[_0xbb71('0x29')][_0xbb71('0x4b')]({'where':{'id':_0x4e3007[_0xbb71('0x52')]['id']}})[_0xbb71('0x24')](handleEntityNotFound(_0x5168a4,null))[_0xbb71('0x24')](function(_0x36362a){if(_0x36362a){return _0x36362a['removeBlackLists'](_0x4e3007[_0xbb71('0x2e')]['ids']);}})[_0xbb71('0x24')](function(_0x38d125){if(_0x38d125){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x4e3007[_0xbb71('0x2e')][_0xbb71('0x63')],'CampaignId':_0x4e3007[_0xbb71('0x52')]['id']}})['then'](function(){return _0x38d125;});}})[_0xbb71('0x24')](respondWithStatusCode(_0x5168a4,null))[_0xbb71('0x40')](handleError(_0x5168a4,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 72fc077..cd14b77 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(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index fef586b..99c5dcf 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 _0x33a4=['catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','include','model','map','info','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x5c7e53,_0x174ce5){var _0x1c9af9=function(_0x38895d){while(--_0x38895d){_0x5c7e53['push'](_0x5c7e53['shift']());}};_0x1c9af9(++_0x174ce5);}(_0x33a4,0x88));var _0x433a=function(_0x3d6abc,_0x55019e){_0x3d6abc=_0x3d6abc-0x0;var _0x537904=_0x33a4[_0x3d6abc];return _0x537904;};'use strict';var _=require('lodash');var util=require(_0x433a('0x0'));var moment=require('moment');var BPromise=require(_0x433a('0x1'));var rs=require(_0x433a('0x2'));var fs=require('fs');var Redis=require(_0x433a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x433a('0x4'));var config=require(_0x433a('0x5'));var jayson=require(_0x433a('0x6'));var client=jayson[_0x433a('0x7')][_0x433a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fcc88,_0x422eb9,_0x58e65c){return new BPromise(function(_0x2c2404,_0x3156ec){return client[_0x433a('0x9')](_0x4fcc88,_0x58e65c)[_0x433a('0xa')](function(_0x4c1057){logger['info'](_0x433a('0xb'),_0x422eb9,_0x433a('0xc'));logger[_0x433a('0xd')](_0x433a('0xe'),_0x422eb9,_0x433a('0xc'),JSON['stringify'](_0x4c1057));if(_0x4c1057['error']){if(_0x4c1057[_0x433a('0xf')][_0x433a('0x10')]===0x1f4){logger[_0x433a('0xf')](_0x433a('0xb'),_0x422eb9,_0x4c1057['error'][_0x433a('0x11')]);return _0x3156ec(_0x4c1057[_0x433a('0xf')]['message']);}logger[_0x433a('0xf')]('Campaign,\x20%s,\x20%s',_0x422eb9,_0x4c1057[_0x433a('0xf')][_0x433a('0x11')]);return _0x2c2404(_0x4c1057[_0x433a('0xf')]['message']);}else{logger['info'](_0x433a('0xb'),_0x422eb9,_0x433a('0xc'));_0x2c2404(_0x4c1057[_0x433a('0x12')][_0x433a('0x11')]);}})[_0x433a('0x13')](function(_0x4df77a){logger['error'](_0x433a('0xb'),_0x422eb9,_0x4df77a);_0x3156ec(_0x4df77a);});});}exports[_0x433a('0x14')]=function(_0x4254c4){var _0x1975b7=this;return new Promise(function(_0x255e47,_0xfcdced){return db[_0x433a('0x15')][_0x433a('0x16')]({'raw':_0x4254c4[_0x433a('0x17')]?_0x4254c4[_0x433a('0x17')][_0x433a('0x18')]===undefined?!![]:![]:!![],'where':_0x4254c4['options']?_0x4254c4[_0x433a('0x17')]['where']||null:null,'attributes':_0x4254c4[_0x433a('0x17')]?_0x4254c4['options'][_0x433a('0x19')]||null:null,'limit':_0x4254c4[_0x433a('0x17')]?_0x4254c4[_0x433a('0x17')][_0x433a('0x1a')]||null:null,'include':_0x4254c4[_0x433a('0x17')]?_0x4254c4[_0x433a('0x17')][_0x433a('0x1b')]?_['map'](_0x4254c4['options'][_0x433a('0x1b')],function(_0x5a50ff){return{'model':db[_0x5a50ff[_0x433a('0x1c')]],'as':_0x5a50ff['as'],'attributes':_0x5a50ff['attributes'],'include':_0x5a50ff[_0x433a('0x1b')]?_[_0x433a('0x1d')](_0x5a50ff[_0x433a('0x1b')],function(_0x3ef4ab){return{'model':db[_0x3ef4ab[_0x433a('0x1c')]],'as':_0x3ef4ab['as'],'attributes':_0x3ef4ab[_0x433a('0x19')],'include':_0x3ef4ab['include']?_[_0x433a('0x1d')](_0x3ef4ab[_0x433a('0x1b')],function(_0x4792ff){return{'model':db[_0x4792ff[_0x433a('0x1c')]],'as':_0x4792ff['as'],'attributes':_0x4792ff['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ec211){logger[_0x433a('0x1e')]('GetCampaign',_0x4254c4);logger[_0x433a('0xd')]('GetCampaign',_0x4254c4,JSON['stringify'](_0x5ec211));_0x255e47(_0x5ec211);})[_0x433a('0x13')](function(_0x1d5d78){logger[_0x433a('0xf')]('GetCampaign',_0x1d5d78[_0x433a('0x11')],_0x4254c4);_0xfcdced(_0x1975b7[_0x433a('0xf')](0x1f4,_0x1d5d78[_0x433a('0x11')]));});});};
\ No newline at end of file
+var _0xbe31=['map','model','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Campaign,\x20%s,\x20%s','GetCampaign','Campaign','findAll','options','raw','limit','include'];(function(_0x3899cb,_0xb95555){var _0x3fe239=function(_0x12a2dc){while(--_0x12a2dc){_0x3899cb['push'](_0x3899cb['shift']());}};_0x3fe239(++_0xb95555);}(_0xbe31,0x83));var _0x1be3=function(_0x5cfe0a,_0x4b14ac){_0x5cfe0a=_0x5cfe0a-0x0;var _0x8da0d4=_0xbe31[_0x5cfe0a];return _0x8da0d4;};'use strict';var _=require('lodash');var util=require(_0x1be3('0x0'));var moment=require(_0x1be3('0x1'));var BPromise=require(_0x1be3('0x2'));var rs=require(_0x1be3('0x3'));var fs=require('fs');var Redis=require(_0x1be3('0x4'));var db=require(_0x1be3('0x5'))['db'];var utils=require(_0x1be3('0x6'));var logger=require(_0x1be3('0x7'))(_0x1be3('0x8'));var config=require('../../config/environment');var jayson=require(_0x1be3('0x9'));var client=jayson['client'][_0x1be3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa757b9,_0x3c925a,_0x2c3965){return new BPromise(function(_0x2bb749,_0x2e4488){return client[_0x1be3('0xb')](_0xa757b9,_0x2c3965)[_0x1be3('0xc')](function(_0x359742){logger[_0x1be3('0xd')]('Campaign,\x20%s,\x20%s',_0x3c925a,_0x1be3('0xe'));logger[_0x1be3('0xf')](_0x1be3('0x10'),_0x3c925a,_0x1be3('0xe'),JSON[_0x1be3('0x11')](_0x359742));if(_0x359742[_0x1be3('0x12')]){if(_0x359742[_0x1be3('0x12')][_0x1be3('0x13')]===0x1f4){logger[_0x1be3('0x12')]('Campaign,\x20%s,\x20%s',_0x3c925a,_0x359742[_0x1be3('0x12')]['message']);return _0x2e4488(_0x359742[_0x1be3('0x12')][_0x1be3('0x14')]);}logger['error'](_0x1be3('0x15'),_0x3c925a,_0x359742['error'][_0x1be3('0x14')]);return _0x2bb749(_0x359742[_0x1be3('0x12')][_0x1be3('0x14')]);}else{logger[_0x1be3('0xd')](_0x1be3('0x15'),_0x3c925a,_0x1be3('0xe'));_0x2bb749(_0x359742['result']['message']);}})['catch'](function(_0x52d2f2){logger[_0x1be3('0x12')]('Campaign,\x20%s,\x20%s',_0x3c925a,_0x52d2f2);_0x2e4488(_0x52d2f2);});});}exports[_0x1be3('0x16')]=function(_0x6b7edf){var _0xaa1d7b=this;return new Promise(function(_0x1d0c2b,_0x21668a){return db[_0x1be3('0x17')][_0x1be3('0x18')]({'raw':_0x6b7edf[_0x1be3('0x19')]?_0x6b7edf[_0x1be3('0x19')][_0x1be3('0x1a')]===undefined?!![]:![]:!![],'where':_0x6b7edf[_0x1be3('0x19')]?_0x6b7edf[_0x1be3('0x19')]['where']||null:null,'attributes':_0x6b7edf['options']?_0x6b7edf[_0x1be3('0x19')]['attributes']||null:null,'limit':_0x6b7edf[_0x1be3('0x19')]?_0x6b7edf[_0x1be3('0x19')][_0x1be3('0x1b')]||null:null,'include':_0x6b7edf[_0x1be3('0x19')]?_0x6b7edf[_0x1be3('0x19')][_0x1be3('0x1c')]?_[_0x1be3('0x1d')](_0x6b7edf['options'][_0x1be3('0x1c')],function(_0x48862c){return{'model':db[_0x48862c[_0x1be3('0x1e')]],'as':_0x48862c['as'],'attributes':_0x48862c[_0x1be3('0x1f')],'include':_0x48862c['include']?_[_0x1be3('0x1d')](_0x48862c['include'],function(_0x134d79){return{'model':db[_0x134d79[_0x1be3('0x1e')]],'as':_0x134d79['as'],'attributes':_0x134d79[_0x1be3('0x1f')],'include':_0x134d79[_0x1be3('0x1c')]?_['map'](_0x134d79[_0x1be3('0x1c')],function(_0x8d1f58){return{'model':db[_0x8d1f58['model']],'as':_0x8d1f58['as'],'attributes':_0x8d1f58[_0x1be3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1be3('0xc')](function(_0x44da09){logger[_0x1be3('0xd')](_0x1be3('0x16'),_0x6b7edf);logger[_0x1be3('0xf')]('GetCampaign',_0x6b7edf,JSON[_0x1be3('0x11')](_0x44da09));_0x1d0c2b(_0x44da09);})['catch'](function(_0x25ed26){logger['error'](_0x1be3('0x16'),_0x25ed26[_0x1be3('0x14')],_0x6b7edf);_0x21668a(_0xaa1d7b['error'](0x1f4,_0x25ed26['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 3c1ad90..ad93c3e 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 _0xf83f=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','getHopperHistories','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addBlackLists','put','delete','destroy','removeLists','removeBlackLists'];(function(_0x528a46,_0x532e92){var _0x2a18df=function(_0xcbf0ab){while(--_0xcbf0ab){_0x528a46['push'](_0x528a46['shift']());}};_0x2a18df(++_0x532e92);}(_0xf83f,0xf8));var _0xff83=function(_0xe7b7dd,_0x249439){_0xe7b7dd=_0xe7b7dd-0x0;var _0x14303e=_0xf83f[_0xe7b7dd];return _0x14303e;};'use strict';var multer=require(_0xff83('0x0'));var util=require(_0xff83('0x1'));var path=require('path');var timeout=require(_0xff83('0x2'));var express=require(_0xff83('0x3'));var router=express[_0xff83('0x4')]();var fs_extra=require(_0xff83('0x5'));var auth=require(_0xff83('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xff83('0x7'));var controller=require('./campaign.controller');router[_0xff83('0x8')]('/',auth['isAuthenticated'](),controller[_0xff83('0x9')]);router[_0xff83('0x8')](_0xff83('0xa'),auth[_0xff83('0xb')](),controller[_0xff83('0xc')]);router[_0xff83('0x8')](_0xff83('0xd'),auth['isAuthenticated'](),controller[_0xff83('0xe')]);router[_0xff83('0x8')]('/:id/hopper_histories',auth[_0xff83('0xb')](),controller[_0xff83('0xf')]);router['get']('/:id/hopper_finals',auth[_0xff83('0xb')](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0xff83('0xb')](),controller[_0xff83('0x10')]);router[_0xff83('0x8')](_0xff83('0x11'),auth[_0xff83('0xb')](),controller[_0xff83('0x12')]);router['get'](_0xff83('0x13'),auth[_0xff83('0xb')](),controller[_0xff83('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0xff83('0x15')]);router[_0xff83('0x16')](_0xff83('0x17'),auth[_0xff83('0xb')](),controller[_0xff83('0x18')]);router['post'](_0xff83('0x11'),auth['isAuthenticated'](),controller['addLists']);router['post'](_0xff83('0x13'),auth[_0xff83('0xb')](),controller[_0xff83('0x19')]);router[_0xff83('0x1a')]('/:id',auth[_0xff83('0xb')](),controller['update']);router[_0xff83('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xff83('0x1c')]);router[_0xff83('0x1b')]('/:id/lists',auth[_0xff83('0xb')](),controller[_0xff83('0x1d')]);router[_0xff83('0x1b')](_0xff83('0x13'),auth[_0xff83('0xb')](),controller[_0xff83('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0xcee0=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','clone','addLists','put','update','/:id','destroy','delete','removeLists','removeBlackLists','exports'];(function(_0x5dd882,_0xb6cc65){var _0x21bfa9=function(_0x4bdf23){while(--_0x4bdf23){_0x5dd882['push'](_0x5dd882['shift']());}};_0x21bfa9(++_0xb6cc65);}(_0xcee0,0x1e1));var _0x0cee=function(_0x1f83a5,_0x59843f){_0x1f83a5=_0x1f83a5-0x0;var _0x45edf0=_0xcee0[_0x1f83a5];return _0x45edf0;};'use strict';var multer=require(_0x0cee('0x0'));var util=require(_0x0cee('0x1'));var path=require(_0x0cee('0x2'));var timeout=require(_0x0cee('0x3'));var express=require(_0x0cee('0x4'));var router=express[_0x0cee('0x5')]();var fs_extra=require(_0x0cee('0x6'));var auth=require(_0x0cee('0x7'));var interaction=require(_0x0cee('0x8'));var config=require('../../config/environment');var controller=require(_0x0cee('0x9'));router[_0x0cee('0xa')]('/',auth[_0x0cee('0xb')](),controller[_0x0cee('0xc')]);router[_0x0cee('0xa')]('/:id',auth[_0x0cee('0xb')](),controller[_0x0cee('0xd')]);router[_0x0cee('0xa')](_0x0cee('0xe'),auth[_0x0cee('0xb')](),controller[_0x0cee('0xf')]);router[_0x0cee('0xa')](_0x0cee('0x10'),auth[_0x0cee('0xb')](),controller[_0x0cee('0x11')]);router[_0x0cee('0xa')](_0x0cee('0x12'),auth['isAuthenticated'](),controller[_0x0cee('0x13')]);router[_0x0cee('0xa')](_0x0cee('0x14'),auth[_0x0cee('0xb')](),controller[_0x0cee('0x15')]);router[_0x0cee('0xa')](_0x0cee('0x16'),auth[_0x0cee('0xb')](),controller['getLists']);router[_0x0cee('0xa')](_0x0cee('0x17'),auth[_0x0cee('0xb')](),controller[_0x0cee('0x18')]);router[_0x0cee('0x19')]('/',auth[_0x0cee('0xb')](),controller[_0x0cee('0x1a')]);router[_0x0cee('0x19')]('/:id/clone',auth[_0x0cee('0xb')](),controller[_0x0cee('0x1b')]);router[_0x0cee('0x19')](_0x0cee('0x16'),auth[_0x0cee('0xb')](),controller[_0x0cee('0x1c')]);router[_0x0cee('0x19')](_0x0cee('0x17'),auth[_0x0cee('0xb')](),controller['addBlackLists']);router[_0x0cee('0x1d')]('/:id',auth[_0x0cee('0xb')](),controller[_0x0cee('0x1e')]);router['delete'](_0x0cee('0x1f'),auth[_0x0cee('0xb')](),controller[_0x0cee('0x20')]);router[_0x0cee('0x21')](_0x0cee('0x16'),auth[_0x0cee('0xb')](),controller[_0x0cee('0x22')]);router[_0x0cee('0x21')](_0x0cee('0x17'),auth[_0x0cee('0xb')](),controller[_0x0cee('0x23')]);module[_0x0cee('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 38af73f..7d7b582 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 _0x2608=['key','sequelize','TEXT','STRING','VIRTUAL','getDataValue'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x2608,0x67));var _0x8260=function(_0x39ab26,_0x13fc03){_0x39ab26=_0x39ab26-0x0;var _0x25b1d4=_0x2608[_0x39ab26];return _0x25b1d4;};'use strict';var Sequelize=require(_0x8260('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x8260('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8260('0x2')]},'name':{'type':Sequelize[_0x8260('0x3')],'get':function(){return this[_0x8260('0x4')](_0x8260('0x5'));}}};
\ No newline at end of file
+var _0xcf90=['STRING','TEXT','VIRTUAL','key','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcf90,0x17e));var _0x0cf9=function(_0x37344b,_0x2ce638){_0x37344b=_0x37344b-0x0;var _0x598372=_0xcf90[_0x37344b];return _0x598372;};'use strict';var Sequelize=require(_0x0cf9('0x0'));module[_0x0cf9('0x1')]={'key':{'type':Sequelize[_0x0cf9('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x0cf9('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x0cf9('0x4')],'get':function(){return this['getDataValue'](_0x0cf9('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 1a4ab73..740465d 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 _0x10f1=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','CannedAnswers','error','stack','name','CannedAnswer','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','body','params','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path'];(function(_0x47f711,_0x1cb459){var _0x307fb8=function(_0x2802fa){while(--_0x2802fa){_0x47f711['push'](_0x47f711['shift']());}};_0x307fb8(++_0x1cb459);}(_0x10f1,0xaf));var _0x110f=function(_0x51ede2,_0x3a0317){_0x51ede2=_0x51ede2-0x0;var _0x412063=_0x10f1[_0x51ede2];return _0x412063;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x110f('0x0'));var zipdir=require(_0x110f('0x1'));var jsonpatch=require(_0x110f('0x2'));var rp=require(_0x110f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x110f('0x4'));var util=require(_0x110f('0x5'));var path=require(_0x110f('0x6'));var sox=require(_0x110f('0x7'));var csv=require(_0x110f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x110f('0x9'));var _=require(_0x110f('0xa'));var squel=require(_0x110f('0xb'));var crypto=require(_0x110f('0xc'));var jsforce=require(_0x110f('0xd'));var deskjs=require(_0x110f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x110f('0xf'));var Papa=require('papaparse');var Redis=require(_0x110f('0x10'));var authService=require(_0x110f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x110f('0x12'));var hardwareService=require(_0x110f('0x13'));var logger=require(_0x110f('0x14'))(_0x110f('0x15'));var utils=require(_0x110f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x110f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48655c,_0x180668){_0x180668=_0x180668||0xcc;return function(_0x15ec22){if(_0x15ec22){return _0x48655c[_0x110f('0x18')](_0x180668);}return _0x48655c[_0x110f('0x19')](_0x180668)[_0x110f('0x1a')]();};}function respondWithResult(_0x4cea0b,_0x4c21d9){_0x4c21d9=_0x4c21d9||0xc8;return function(_0x31b850){if(_0x31b850){return _0x4cea0b[_0x110f('0x19')](_0x4c21d9)['json'](_0x31b850);}};}function respondWithFilteredResult(_0x5f490e,_0x1bb1f5){return function(_0x5ec7e7){if(_0x5ec7e7){var _0x662033=typeof _0x1bb1f5[_0x110f('0x1b')]===_0x110f('0x1c')&&typeof _0x1bb1f5[_0x110f('0x1d')]===_0x110f('0x1c');var _0x179361=_0x5ec7e7[_0x110f('0x1e')];var _0xe781c3=_0x662033?0x0:_0x1bb1f5[_0x110f('0x1b')];var _0x7dbf3f=_0x662033?_0x5ec7e7[_0x110f('0x1e')]:_0x1bb1f5[_0x110f('0x1b')]+_0x1bb1f5[_0x110f('0x1d')];var _0x441854;if(_0x7dbf3f>=_0x179361){_0x7dbf3f=_0x179361;_0x441854=0xc8;}else{_0x441854=0xce;}_0x5f490e[_0x110f('0x19')](_0x441854);return _0x5f490e[_0x110f('0x1f')](_0x110f('0x20'),_0xe781c3+'-'+_0x7dbf3f+'/'+_0x179361)[_0x110f('0x21')](_0x5ec7e7);}return null;};}function patchUpdates(_0x3720da){return function(_0x3351bd){try{jsonpatch[_0x110f('0x22')](_0x3351bd,_0x3720da,!![]);}catch(_0x2847c1){return BPromise[_0x110f('0x23')](_0x2847c1);}return _0x3351bd[_0x110f('0x24')]();};}function saveUpdates(_0x6aab09,_0x53b6f4){return function(_0x7c365b){if(_0x7c365b){return _0x7c365b[_0x110f('0x25')](_0x6aab09)['then'](function(_0x16527f){return _0x16527f;});}return null;};}function removeEntity(_0x48aa6b,_0x3f9f08){return function(_0x1db5d8){if(_0x1db5d8){return _0x1db5d8[_0x110f('0x26')]()[_0x110f('0x27')](function(){var _0x52d29e=_0x1db5d8[_0x110f('0x28')]({'plain':!![]});var _0x327fbe=_0x110f('0x29');return db['UserProfileResource'][_0x110f('0x26')]({'where':{'type':_0x327fbe,'resourceId':_0x52d29e['id']}})[_0x110f('0x27')](function(){return _0x1db5d8;});})[_0x110f('0x27')](function(){_0x48aa6b[_0x110f('0x19')](0xcc)[_0x110f('0x1a')]();});}};}function handleEntityNotFound(_0x479620,_0x4ba09f){return function(_0x4a2496){if(!_0x4a2496){_0x479620[_0x110f('0x18')](0x194);}return _0x4a2496;};}function handleError(_0x4aa947,_0x3c4a19){_0x3c4a19=_0x3c4a19||0x1f4;return function(_0x3666bf){logger[_0x110f('0x2a')](_0x3666bf[_0x110f('0x2b')]);if(_0x3666bf[_0x110f('0x2c')]){delete _0x3666bf[_0x110f('0x2c')];}_0x4aa947[_0x110f('0x19')](_0x3c4a19)['send'](_0x3666bf);};}exports['index']=function(_0x1ddae0,_0x1bf6c1){var _0x53b8e8={},_0x297901={},_0x1d1993={'count':0x0,'rows':[]};var _0x55d470=_['map'](db[_0x110f('0x2d')]['rawAttributes'],function(_0x1076ac){return{'name':_0x1076ac[_0x110f('0x2e')],'type':_0x1076ac[_0x110f('0x2f')]['key']};});_0x297901[_0x110f('0x30')]=_[_0x110f('0x31')](_0x55d470,_0x110f('0x2c'));_0x297901[_0x110f('0x32')]=_[_0x110f('0x33')](_0x1ddae0[_0x110f('0x32')]);_0x297901[_0x110f('0x34')]=_['intersection'](_0x297901[_0x110f('0x30')],_0x297901[_0x110f('0x32')]);_0x53b8e8[_0x110f('0x35')]=_[_0x110f('0x36')](_0x297901[_0x110f('0x30')],qs[_0x110f('0x37')](_0x1ddae0[_0x110f('0x32')][_0x110f('0x37')]));_0x53b8e8[_0x110f('0x35')]=_0x53b8e8[_0x110f('0x35')][_0x110f('0x38')]?_0x53b8e8[_0x110f('0x35')]:_0x297901[_0x110f('0x30')];if(!_0x1ddae0[_0x110f('0x32')]['hasOwnProperty']('nolimit')){_0x53b8e8['limit']=qs[_0x110f('0x1d')](_0x1ddae0['query'][_0x110f('0x1d')]);_0x53b8e8[_0x110f('0x1b')]=qs['offset'](_0x1ddae0['query'][_0x110f('0x1b')]);}_0x53b8e8[_0x110f('0x39')]=qs['sort'](_0x1ddae0[_0x110f('0x32')][_0x110f('0x3a')]);_0x53b8e8[_0x110f('0x3b')]=qs['filters'](_[_0x110f('0x3c')](_0x1ddae0['query'],_0x297901['filters']),_0x55d470);if(_0x1ddae0['query'][_0x110f('0x3d')]){_0x53b8e8[_0x110f('0x3b')]=_[_0x110f('0x3e')](_0x53b8e8[_0x110f('0x3b')],{'$or':[{'key':{'$like':'%'+_0x1ddae0[_0x110f('0x32')]['filter']+'%'}},{'value':{'$like':'%'+_0x1ddae0[_0x110f('0x32')][_0x110f('0x3d')]+'%'}}]});}_0x53b8e8=_[_0x110f('0x3e')]({},_0x53b8e8,_0x1ddae0[_0x110f('0x3f')]);var _0x26d9f2={'where':_0x53b8e8[_0x110f('0x3b')]};return db[_0x110f('0x2d')][_0x110f('0x1e')](_0x26d9f2)[_0x110f('0x27')](function(_0x1abc77){_0x1d1993[_0x110f('0x1e')]=_0x1abc77;if(_0x1ddae0[_0x110f('0x32')][_0x110f('0x40')]){_0x53b8e8[_0x110f('0x41')]=[{'all':!![]}];}return db[_0x110f('0x2d')][_0x110f('0x42')](_0x53b8e8);})[_0x110f('0x27')](function(_0xdcde71){_0x1d1993[_0x110f('0x43')]=_0xdcde71;return _0x1d1993;})['then'](respondWithFilteredResult(_0x1bf6c1,_0x53b8e8))[_0x110f('0x44')](handleError(_0x1bf6c1,null));};exports[_0x110f('0x45')]=function(_0x1d0cc1,_0xe32cbf){var _0x4e8355={'raw':!![],'where':{'id':_0x1d0cc1['params']['id']}},_0x37e4fa={};_0x37e4fa[_0x110f('0x30')]=_[_0x110f('0x33')](db[_0x110f('0x2d')][_0x110f('0x46')]);_0x37e4fa[_0x110f('0x32')]=_[_0x110f('0x33')](_0x1d0cc1[_0x110f('0x32')]);_0x37e4fa[_0x110f('0x34')]=_[_0x110f('0x36')](_0x37e4fa[_0x110f('0x30')],_0x37e4fa[_0x110f('0x32')]);_0x4e8355['attributes']=_[_0x110f('0x36')](_0x37e4fa['model'],qs[_0x110f('0x37')](_0x1d0cc1[_0x110f('0x32')]['fields']));_0x4e8355[_0x110f('0x35')]=_0x4e8355[_0x110f('0x35')][_0x110f('0x38')]?_0x4e8355[_0x110f('0x35')]:_0x37e4fa['model'];if(_0x1d0cc1[_0x110f('0x32')][_0x110f('0x40')]){_0x4e8355[_0x110f('0x41')]=[{'all':!![]}];}_0x4e8355=_[_0x110f('0x3e')]({},_0x4e8355,_0x1d0cc1[_0x110f('0x3f')]);return db['CannedAnswer'][_0x110f('0x47')](_0x4e8355)['then'](handleEntityNotFound(_0xe32cbf,null))['then'](respondWithResult(_0xe32cbf,null))[_0x110f('0x44')](handleError(_0xe32cbf,null));};exports['update']=function(_0x427e40,_0x1941df){if(_0x427e40[_0x110f('0x48')]['id']){delete _0x427e40['body']['id'];}return db[_0x110f('0x2d')][_0x110f('0x47')]({'where':{'id':_0x427e40['params']['id']}})[_0x110f('0x27')](handleEntityNotFound(_0x1941df,null))[_0x110f('0x27')](saveUpdates(_0x427e40[_0x110f('0x48')],null))['then'](respondWithResult(_0x1941df,null))[_0x110f('0x44')](handleError(_0x1941df,null));};exports[_0x110f('0x26')]=function(_0x26c984,_0x2c70ca){return db[_0x110f('0x2d')][_0x110f('0x47')]({'where':{'id':_0x26c984[_0x110f('0x49')]['id']}})['then'](handleEntityNotFound(_0x2c70ca,null))[_0x110f('0x27')](removeEntity(_0x2c70ca,null))['catch'](handleError(_0x2c70ca,null));};exports[_0x110f('0x4a')]=function(_0x2080c7,_0x3a62bd){var _0x565d36={'key':_0x2080c7[_0x110f('0x48')][_0x110f('0x4b')]};if(_0x2080c7[_0x110f('0x48')][_0x110f('0x4c')]){_0x565d36[_0x110f('0x4c')]=_0x2080c7[_0x110f('0x48')]['MailAccountId'];}else if(_0x2080c7[_0x110f('0x48')][_0x110f('0x4d')]){_0x565d36[_0x110f('0x4d')]=_0x2080c7[_0x110f('0x48')]['SmsAccountId'];}else if(_0x2080c7[_0x110f('0x48')][_0x110f('0x4e')]){_0x565d36[_0x110f('0x4e')]=_0x2080c7['body']['OpenchannelAccountId'];}else if(_0x2080c7[_0x110f('0x48')][_0x110f('0x4f')]){_0x565d36['ChatWebsiteId']=_0x2080c7['body'][_0x110f('0x4f')];}return db[_0x110f('0x2d')]['find']({'where':_0x565d36})['then'](function(_0x205100){if(_0x205100){throw new db[(_0x110f('0x50'))][(_0x110f('0x51'))](_0x110f('0x52'));}return db[_0x110f('0x2d')][_0x110f('0x4a')](_0x2080c7[_0x110f('0x48')]);})[_0x110f('0x27')](function(_0x3156c2){var _0x116065=_0x2080c7['user'][_0x110f('0x28')]({'plain':!![]});if(!_0x116065)throw new Error(_0x110f('0x53'));if(_0x116065[_0x110f('0x54')]===_0x110f('0x55')){var _0x44d50f=_0x3156c2[_0x110f('0x28')]({'plain':!![]});return db[_0x110f('0x56')][_0x110f('0x47')]({'where':{'name':'CannedAnswers','userProfileId':_0x116065[_0x110f('0x57')]},'raw':!![]})[_0x110f('0x27')](function(_0x3476d5){if(_0x3476d5&&_0x3476d5[_0x110f('0x58')]===0x0){return db[_0x110f('0x59')][_0x110f('0x4a')]({'name':_0x44d50f[_0x110f('0x2c')],'resourceId':_0x44d50f['id'],'type':_0x3476d5[_0x110f('0x2c')],'sectionId':_0x3476d5['id']},{})[_0x110f('0x27')](function(){return _0x3156c2;});}else{return _0x3156c2;}})['catch'](function(_0x261fc1){logger[_0x110f('0x2a')](_0x110f('0x5a'),_0x261fc1);throw _0x261fc1;});}return _0x3156c2;})['then'](respondWithResult(_0x3a62bd,0xc9))[_0x110f('0x44')](handleError(_0x3a62bd,null));};
\ No newline at end of file
+var _0xf94e=['model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','show','keys','length','find','catch','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','CannedAnswers','UserProfileResource','end','stack','name','index','fieldName','type','key'];(function(_0x3ee2cd,_0x517ad4){var _0x36d7ff=function(_0x140aab){while(--_0x140aab){_0x3ee2cd['push'](_0x3ee2cd['shift']());}};_0x36d7ff(++_0x517ad4);}(_0xf94e,0x7b));var _0xef94=function(_0x5655e8,_0x1a8839){_0x5655e8=_0x5655e8-0x0;var _0x203ac2=_0xf94e[_0x5655e8];return _0x203ac2;};'use strict';var emlformat=require(_0xef94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef94('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xef94('0x2'));var BPromise=require(_0xef94('0x3'));var Mustache=require('mustache');var util=require(_0xef94('0x4'));var path=require(_0xef94('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xef94('0x6'));var fs=require('fs');var fs_extra=require(_0xef94('0x7'));var _=require(_0xef94('0x8'));var squel=require(_0xef94('0x9'));var crypto=require(_0xef94('0xa'));var jsforce=require(_0xef94('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xef94('0xc'));var querystring=require(_0xef94('0xd'));var Papa=require(_0xef94('0xe'));var Redis=require(_0xef94('0xf'));var authService=require(_0xef94('0x10'));var qs=require(_0xef94('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xef94('0x12'));var logger=require(_0xef94('0x13'))(_0xef94('0x14'));var utils=require(_0xef94('0x15'));var config=require(_0xef94('0x16'));var licenseUtil=require(_0xef94('0x17'));var db=require(_0xef94('0x18'))['db'];function respondWithStatusCode(_0x51007f,_0x1fe0a6){_0x1fe0a6=_0x1fe0a6||0xcc;return function(_0x79744d){if(_0x79744d){return _0x51007f[_0xef94('0x19')](_0x1fe0a6);}return _0x51007f[_0xef94('0x1a')](_0x1fe0a6)['end']();};}function respondWithResult(_0xcba157,_0xdc5805){_0xdc5805=_0xdc5805||0xc8;return function(_0x30e319){if(_0x30e319){return _0xcba157['status'](_0xdc5805)['json'](_0x30e319);}};}function respondWithFilteredResult(_0xf40936,_0x125003){return function(_0x117d79){if(_0x117d79){var _0x3080b5=typeof _0x125003['offset']==='undefined'&&typeof _0x125003[_0xef94('0x1b')]==='undefined';var _0x103bdf=_0x117d79[_0xef94('0x1c')];var _0x182229=_0x3080b5?0x0:_0x125003[_0xef94('0x1d')];var _0xa14367=_0x3080b5?_0x117d79[_0xef94('0x1c')]:_0x125003['offset']+_0x125003[_0xef94('0x1b')];var _0x52eb22;if(_0xa14367>=_0x103bdf){_0xa14367=_0x103bdf;_0x52eb22=0xc8;}else{_0x52eb22=0xce;}_0xf40936[_0xef94('0x1a')](_0x52eb22);return _0xf40936[_0xef94('0x1e')](_0xef94('0x1f'),_0x182229+'-'+_0xa14367+'/'+_0x103bdf)[_0xef94('0x20')](_0x117d79);}return null;};}function patchUpdates(_0xa0205b){return function(_0x44fa2b){try{jsonpatch[_0xef94('0x21')](_0x44fa2b,_0xa0205b,!![]);}catch(_0x4555b1){return BPromise['reject'](_0x4555b1);}return _0x44fa2b[_0xef94('0x22')]();};}function saveUpdates(_0x28f4a3,_0x1d6df8){return function(_0x3fa016){if(_0x3fa016){return _0x3fa016[_0xef94('0x23')](_0x28f4a3)[_0xef94('0x24')](function(_0x3239da){return _0x3239da;});}return null;};}function removeEntity(_0x5146dd,_0x17ff5b){return function(_0x15c586){if(_0x15c586){return _0x15c586[_0xef94('0x25')]()['then'](function(){var _0x1347a3=_0x15c586['get']({'plain':!![]});var _0x313875=_0xef94('0x26');return db[_0xef94('0x27')]['destroy']({'where':{'type':_0x313875,'resourceId':_0x1347a3['id']}})[_0xef94('0x24')](function(){return _0x15c586;});})['then'](function(){_0x5146dd[_0xef94('0x1a')](0xcc)[_0xef94('0x28')]();});}};}function handleEntityNotFound(_0x9efec9,_0x51a36a){return function(_0x4f70b9){if(!_0x4f70b9){_0x9efec9['sendStatus'](0x194);}return _0x4f70b9;};}function handleError(_0x1fdbc6,_0x5cbddb){_0x5cbddb=_0x5cbddb||0x1f4;return function(_0x5ac085){logger['error'](_0x5ac085[_0xef94('0x29')]);if(_0x5ac085[_0xef94('0x2a')]){delete _0x5ac085[_0xef94('0x2a')];}_0x1fdbc6['status'](_0x5cbddb)['send'](_0x5ac085);};}exports[_0xef94('0x2b')]=function(_0x20b298,_0x18c6fa){var _0x157eef={},_0x26e6ba={},_0x169174={'count':0x0,'rows':[]};var _0x6aa9c9=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x9321da){return{'name':_0x9321da[_0xef94('0x2c')],'type':_0x9321da[_0xef94('0x2d')][_0xef94('0x2e')]};});_0x26e6ba[_0xef94('0x2f')]=_[_0xef94('0x30')](_0x6aa9c9,_0xef94('0x2a'));_0x26e6ba[_0xef94('0x31')]=_['keys'](_0x20b298[_0xef94('0x31')]);_0x26e6ba[_0xef94('0x32')]=_[_0xef94('0x33')](_0x26e6ba[_0xef94('0x2f')],_0x26e6ba[_0xef94('0x31')]);_0x157eef[_0xef94('0x34')]=_[_0xef94('0x33')](_0x26e6ba[_0xef94('0x2f')],qs[_0xef94('0x35')](_0x20b298['query'][_0xef94('0x35')]));_0x157eef['attributes']=_0x157eef[_0xef94('0x34')]['length']?_0x157eef[_0xef94('0x34')]:_0x26e6ba[_0xef94('0x2f')];if(!_0x20b298[_0xef94('0x31')][_0xef94('0x36')](_0xef94('0x37'))){_0x157eef[_0xef94('0x1b')]=qs[_0xef94('0x1b')](_0x20b298[_0xef94('0x31')]['limit']);_0x157eef[_0xef94('0x1d')]=qs['offset'](_0x20b298[_0xef94('0x31')]['offset']);}_0x157eef['order']=qs[_0xef94('0x38')](_0x20b298[_0xef94('0x31')][_0xef94('0x38')]);_0x157eef[_0xef94('0x39')]=qs[_0xef94('0x32')](_['pick'](_0x20b298[_0xef94('0x31')],_0x26e6ba['filters']),_0x6aa9c9);if(_0x20b298[_0xef94('0x31')][_0xef94('0x3a')]){_0x157eef[_0xef94('0x39')]=_[_0xef94('0x3b')](_0x157eef['where'],{'$or':[{'key':{'$like':'%'+_0x20b298[_0xef94('0x31')][_0xef94('0x3a')]+'%'}},{'value':{'$like':'%'+_0x20b298[_0xef94('0x31')][_0xef94('0x3a')]+'%'}}]});}_0x157eef=_[_0xef94('0x3b')]({},_0x157eef,_0x20b298[_0xef94('0x3c')]);var _0x11c379={'where':_0x157eef[_0xef94('0x39')]};return db[_0xef94('0x3d')][_0xef94('0x1c')](_0x11c379)[_0xef94('0x24')](function(_0x51dfe1){_0x169174[_0xef94('0x1c')]=_0x51dfe1;if(_0x20b298[_0xef94('0x31')][_0xef94('0x3e')]){_0x157eef[_0xef94('0x3f')]=[{'all':!![]}];}return db['CannedAnswer'][_0xef94('0x40')](_0x157eef);})[_0xef94('0x24')](function(_0x240ac9){_0x169174[_0xef94('0x41')]=_0x240ac9;return _0x169174;})[_0xef94('0x24')](respondWithFilteredResult(_0x18c6fa,_0x157eef))['catch'](handleError(_0x18c6fa,null));};exports[_0xef94('0x42')]=function(_0x552938,_0x19d29e){var _0xa7e7f8={'raw':!![],'where':{'id':_0x552938['params']['id']}},_0x1f498d={};_0x1f498d[_0xef94('0x2f')]=_[_0xef94('0x43')](db[_0xef94('0x3d')]['rawAttributes']);_0x1f498d[_0xef94('0x31')]=_[_0xef94('0x43')](_0x552938[_0xef94('0x31')]);_0x1f498d['filters']=_[_0xef94('0x33')](_0x1f498d[_0xef94('0x2f')],_0x1f498d[_0xef94('0x31')]);_0xa7e7f8['attributes']=_[_0xef94('0x33')](_0x1f498d[_0xef94('0x2f')],qs[_0xef94('0x35')](_0x552938[_0xef94('0x31')][_0xef94('0x35')]));_0xa7e7f8[_0xef94('0x34')]=_0xa7e7f8[_0xef94('0x34')][_0xef94('0x44')]?_0xa7e7f8[_0xef94('0x34')]:_0x1f498d[_0xef94('0x2f')];if(_0x552938[_0xef94('0x31')][_0xef94('0x3e')]){_0xa7e7f8[_0xef94('0x3f')]=[{'all':!![]}];}_0xa7e7f8=_[_0xef94('0x3b')]({},_0xa7e7f8,_0x552938[_0xef94('0x3c')]);return db[_0xef94('0x3d')][_0xef94('0x45')](_0xa7e7f8)[_0xef94('0x24')](handleEntityNotFound(_0x19d29e,null))[_0xef94('0x24')](respondWithResult(_0x19d29e,null))[_0xef94('0x46')](handleError(_0x19d29e,null));};exports[_0xef94('0x23')]=function(_0x137449,_0x22f274){if(_0x137449[_0xef94('0x47')]['id']){delete _0x137449[_0xef94('0x47')]['id'];}return db[_0xef94('0x3d')][_0xef94('0x45')]({'where':{'id':_0x137449[_0xef94('0x48')]['id']}})[_0xef94('0x24')](handleEntityNotFound(_0x22f274,null))['then'](saveUpdates(_0x137449[_0xef94('0x47')],null))[_0xef94('0x24')](respondWithResult(_0x22f274,null))[_0xef94('0x46')](handleError(_0x22f274,null));};exports['destroy']=function(_0x322957,_0x1a000f){return db[_0xef94('0x3d')][_0xef94('0x45')]({'where':{'id':_0x322957['params']['id']}})[_0xef94('0x24')](handleEntityNotFound(_0x1a000f,null))[_0xef94('0x24')](removeEntity(_0x1a000f,null))[_0xef94('0x46')](handleError(_0x1a000f,null));};exports[_0xef94('0x49')]=function(_0x457bec,_0x2e4feb){var _0x45a7af={'key':_0x457bec[_0xef94('0x47')][_0xef94('0x2e')]};if(_0x457bec[_0xef94('0x47')][_0xef94('0x4a')]){_0x45a7af[_0xef94('0x4a')]=_0x457bec[_0xef94('0x47')][_0xef94('0x4a')];}else if(_0x457bec[_0xef94('0x47')]['SmsAccountId']){_0x45a7af[_0xef94('0x4b')]=_0x457bec[_0xef94('0x47')][_0xef94('0x4b')];}else if(_0x457bec['body'][_0xef94('0x4c')]){_0x45a7af['OpenchannelAccountId']=_0x457bec['body'][_0xef94('0x4c')];}else if(_0x457bec[_0xef94('0x47')][_0xef94('0x4d')]){_0x45a7af[_0xef94('0x4d')]=_0x457bec[_0xef94('0x47')][_0xef94('0x4d')];}return db['CannedAnswer']['find']({'where':_0x45a7af})['then'](function(_0xfcb05f){if(_0xfcb05f){throw new db[(_0xef94('0x4e'))][(_0xef94('0x4f'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xef94('0x3d')][_0xef94('0x49')](_0x457bec[_0xef94('0x47')]);})['then'](function(_0x5d03ff){var _0x19b36c=_0x457bec['user'][_0xef94('0x50')]({'plain':!![]});if(!_0x19b36c)throw new Error(_0xef94('0x51'));if(_0x19b36c['role']===_0xef94('0x52')){var _0x242a39=_0x5d03ff[_0xef94('0x50')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'CannedAnswers','userProfileId':_0x19b36c[_0xef94('0x53')]},'raw':!![]})[_0xef94('0x24')](function(_0x2274d1){if(_0x2274d1&&_0x2274d1['autoAssociation']===0x0){return db[_0xef94('0x27')][_0xef94('0x49')]({'name':_0x242a39[_0xef94('0x2a')],'resourceId':_0x242a39['id'],'type':_0x2274d1['name'],'sectionId':_0x2274d1['id']},{})[_0xef94('0x24')](function(){return _0x5d03ff;});}else{return _0x5d03ff;}})[_0xef94('0x46')](function(_0xb73cfb){logger['error'](_0xef94('0x54'),_0xb73cfb);throw _0xb73cfb;});}return _0x5d03ff;})[_0xef94('0x24')](respondWithResult(_0x2e4feb,0xc9))[_0xef94('0x46')](handleError(_0x2e4feb,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 6a27ae0..b02b8d2 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 _0xb3b8=['util','../../config/logger','request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0xaceae2,_0x244666){var _0x1f2aab=function(_0x439090){while(--_0x439090){_0xaceae2['push'](_0xaceae2['shift']());}};_0x1f2aab(++_0x244666);}(_0xb3b8,0x108));var _0x8b3b=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0xb3b8[_0xfa634c];return _0x73e478;};'use strict';var _=require('lodash');var util=require(_0x8b3b('0x0'));var logger=require(_0x8b3b('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8b3b('0x2'));var fs=require('fs');var path=require(_0x8b3b('0x3'));var rimraf=require('rimraf');var config=require(_0x8b3b('0x4'));var attributes=require(_0x8b3b('0x5'));module[_0x8b3b('0x6')]=function(_0x6edd45,_0x3cb6d6){return _0x6edd45['define'](_0x8b3b('0x7'),attributes,{'tableName':_0x8b3b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8b3b('0x9'),'collate':_0x8b3b('0xa')});};
\ No newline at end of file
+var _0x22e7=['../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x22e7,0x9d));var _0x722e=function(_0x4b3151,_0x4784a4){_0x4b3151=_0x4b3151-0x0;var _0x462098=_0x22e7[_0x4b3151];return _0x462098;};'use strict';var _=require(_0x722e('0x0'));var util=require(_0x722e('0x1'));var logger=require(_0x722e('0x2'))(_0x722e('0x3'));var moment=require(_0x722e('0x4'));var BPromise=require('bluebird');var rp=require(_0x722e('0x5'));var fs=require('fs');var path=require(_0x722e('0x6'));var rimraf=require(_0x722e('0x7'));var config=require(_0x722e('0x8'));var attributes=require(_0x722e('0x9'));module[_0x722e('0xa')]=function(_0x4cc195,_0x52542e){return _0x4cc195[_0x722e('0xb')](_0x722e('0xc'),attributes,{'tableName':_0x722e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x722e('0xe')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 47f0e6f..e105bb9 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(_0x550c8e,_0x3539df){var _0x38a23e=function(_0x504aed){while(--_0x504aed){_0x550c8e['push'](_0x550c8e['shift']());}};_0x38a23e(++_0x3539df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x11b902,_0x36b8f6){var _0x1788d5=function(_0xfe2112){while(--_0xfe2112){_0x11b902['push'](_0x11b902['shift']());}};_0x1788d5(++_0x36b8f6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 64aedce..d1c61dc 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 _0x85b7=['destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','create','delete'];(function(_0xb75614,_0x44090e){var _0x4b11a3=function(_0x4fb785){while(--_0x4fb785){_0xb75614['push'](_0xb75614['shift']());}};_0x4b11a3(++_0x44090e);}(_0x85b7,0x132));var _0x785b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x85b7[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x785b('0x0'));var timeout=require(_0x785b('0x1'));var express=require('express');var router=express[_0x785b('0x2')]();var fs_extra=require(_0x785b('0x3'));var auth=require(_0x785b('0x4'));var interaction=require(_0x785b('0x5'));var config=require('../../config/environment');var controller=require(_0x785b('0x6'));router[_0x785b('0x7')]('/',auth[_0x785b('0x8')](),controller[_0x785b('0x9')]);router[_0x785b('0x7')](_0x785b('0xa'),auth[_0x785b('0x8')](),controller['show']);router[_0x785b('0xb')]('/',auth[_0x785b('0x8')](),controller[_0x785b('0xc')]);router['put']('/:id',auth[_0x785b('0x8')](),controller['update']);router[_0x785b('0xd')](_0x785b('0xa'),auth[_0x785b('0x8')](),controller[_0x785b('0xe')]);module[_0x785b('0xf')]=router;
\ No newline at end of file
+var _0x4976=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','multer','util'];(function(_0x49d19d,_0x245cf5){var _0x4ebef1=function(_0xf0a4e6){while(--_0xf0a4e6){_0x49d19d['push'](_0x49d19d['shift']());}};_0x4ebef1(++_0x245cf5);}(_0x4976,0x1be));var _0x6497=function(_0x4dfa9b,_0x4b0127){_0x4dfa9b=_0x4dfa9b-0x0;var _0x5eb93d=_0x4976[_0x4dfa9b];return _0x5eb93d;};'use strict';var multer=require(_0x6497('0x0'));var util=require(_0x6497('0x1'));var path=require('path');var timeout=require(_0x6497('0x2'));var express=require(_0x6497('0x3'));var router=express['Router']();var fs_extra=require(_0x6497('0x4'));var auth=require(_0x6497('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6497('0x6'));var controller=require('./cannedAnswer.controller');router[_0x6497('0x7')]('/',auth[_0x6497('0x8')](),controller['index']);router[_0x6497('0x7')](_0x6497('0x9'),auth['isAuthenticated'](),controller[_0x6497('0xa')]);router[_0x6497('0xb')]('/',auth[_0x6497('0x8')](),controller[_0x6497('0xc')]);router[_0x6497('0xd')](_0x6497('0x9'),auth[_0x6497('0x8')](),controller['update']);router[_0x6497('0xe')](_0x6497('0x9'),auth[_0x6497('0x8')](),controller[_0x6497('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 190515d..8012dc3 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 _0xa6e2=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xa6e2,0x132));var _0x2a6e=function(_0x43efab,_0x13954a){_0x43efab=_0x43efab-0x0;var _0x57d0e9=_0xa6e2[_0x43efab];return _0x57d0e9;};'use strict';var Sequelize=require(_0x2a6e('0x0'));module[_0x2a6e('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x2a6e('0x2')},'clid':{'type':Sequelize[_0x2a6e('0x3')]},'src':{'type':Sequelize[_0x2a6e('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2a6e('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x2a6e('0x3')]},'duration':{'type':Sequelize[_0x2a6e('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2a6e('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2a6e('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x2a6e('0x3')]},'userfield':{'type':Sequelize[_0x2a6e('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x2a6e('0x3')]},'sequence':{'type':Sequelize[_0x2a6e('0x3')]},'peeraccount':{'type':Sequelize[_0x2a6e('0x3')]},'type':{'type':Sequelize[_0x2a6e('0x3')]},'tag':{'type':Sequelize[_0x2a6e('0x3')]}};
\ No newline at end of file
+var _0x867f=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x5d983c,_0x57b322){var _0x45d2f8=function(_0x4fb48d){while(--_0x4fb48d){_0x5d983c['push'](_0x5d983c['shift']());}};_0x45d2f8(++_0x57b322);}(_0x867f,0xe6));var _0xf867=function(_0x6c225b,_0x4de56c){_0x6c225b=_0x6c225b-0x0;var _0x268839=_0x867f[_0x6c225b];return _0x268839;};'use strict';var Sequelize=require(_0xf867('0x0'));module[_0xf867('0x1')]={'calldate':{'type':Sequelize[_0xf867('0x2')],'allowNull':![],'defaultValue':_0xf867('0x3')},'clid':{'type':Sequelize[_0xf867('0x4')]},'src':{'type':Sequelize[_0xf867('0x4')]},'dst':{'type':Sequelize[_0xf867('0x4')]},'dcontext':{'type':Sequelize[_0xf867('0x4')]},'channel':{'type':Sequelize[_0xf867('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xf867('0x4')]},'duration':{'type':Sequelize[_0xf867('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf867('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf867('0x4')]},'amaflags':{'type':Sequelize[_0xf867('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf867('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xf867('0x4')]},'peeraccount':{'type':Sequelize[_0xf867('0x4')]},'type':{'type':Sequelize[_0xf867('0x4')]},'tag':{'type':Sequelize[_0xf867('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 128b6fe..fdacbd8 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 _0x3435=['filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Cdr','count','includeAll','include','findAll','catch','params','rawAttributes','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','stack','send','map','fieldName','type','key','name','query','keys'];(function(_0x459149,_0x5b88ae){var _0x5e2023=function(_0x555304){while(--_0x555304){_0x459149['push'](_0x459149['shift']());}};_0x5e2023(++_0x5b88ae);}(_0x3435,0xfa));var _0x5343=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x3435[_0x11ce46];return _0x368a1e;};'use strict';var emlformat=require(_0x5343('0x0'));var rimraf=require(_0x5343('0x1'));var zipdir=require(_0x5343('0x2'));var jsonpatch=require(_0x5343('0x3'));var rp=require(_0x5343('0x4'));var moment=require(_0x5343('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5343('0x6'));var util=require(_0x5343('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5343('0x8'));var ejs=require(_0x5343('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5343('0xa'));var crypto=require(_0x5343('0xb'));var jsforce=require(_0x5343('0xc'));var deskjs=require(_0x5343('0xd'));var toCsv=require(_0x5343('0x8'));var querystring=require('querystring');var Papa=require(_0x5343('0xe'));var Redis=require('ioredis');var authService=require(_0x5343('0xf'));var qs=require(_0x5343('0x10'));var as=require(_0x5343('0x11'));var hardwareService=require(_0x5343('0x12'));var logger=require(_0x5343('0x13'))('api');var utils=require(_0x5343('0x14'));var config=require(_0x5343('0x15'));var licenseUtil=require(_0x5343('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ddeb7,_0x5f473f){_0x5f473f=_0x5f473f||0xcc;return function(_0x82074d){if(_0x82074d){return _0x2ddeb7[_0x5343('0x17')](_0x5f473f);}return _0x2ddeb7['status'](_0x5f473f)[_0x5343('0x18')]();};}function respondWithResult(_0x4cdfae,_0x13066f){_0x13066f=_0x13066f||0xc8;return function(_0x46c3d7){if(_0x46c3d7){return _0x4cdfae[_0x5343('0x19')](_0x13066f)[_0x5343('0x1a')](_0x46c3d7);}};}function respondWithFilteredResult(_0x4dbff1,_0x446e90){return function(_0x588a96){if(_0x588a96){var _0x1df724=typeof _0x446e90[_0x5343('0x1b')]===_0x5343('0x1c')&&typeof _0x446e90[_0x5343('0x1d')]===_0x5343('0x1c');var _0x4b5852=_0x588a96['count'];var _0x432992=_0x1df724?0x0:_0x446e90[_0x5343('0x1b')];var _0x1f5098=_0x1df724?_0x588a96['count']:_0x446e90[_0x5343('0x1b')]+_0x446e90[_0x5343('0x1d')];var _0x376c35;if(_0x1f5098>=_0x4b5852){_0x1f5098=_0x4b5852;_0x376c35=0xc8;}else{_0x376c35=0xce;}_0x4dbff1[_0x5343('0x19')](_0x376c35);return _0x4dbff1[_0x5343('0x1e')](_0x5343('0x1f'),_0x432992+'-'+_0x1f5098+'/'+_0x4b5852)[_0x5343('0x1a')](_0x588a96);}return null;};}function patchUpdates(_0x40ba38){return function(_0x35d41d){try{jsonpatch['apply'](_0x35d41d,_0x40ba38,!![]);}catch(_0x287304){return BPromise[_0x5343('0x20')](_0x287304);}return _0x35d41d[_0x5343('0x21')]();};}function saveUpdates(_0x42f92d,_0xd95a5b){return function(_0x4e7c0f){if(_0x4e7c0f){return _0x4e7c0f[_0x5343('0x22')](_0x42f92d)[_0x5343('0x23')](function(_0x24c250){return _0x24c250;});}return null;};}function removeEntity(_0x380aae,_0x290ce8){return function(_0x486597){if(_0x486597){return _0x486597[_0x5343('0x24')]()[_0x5343('0x23')](function(){_0x380aae['status'](0xcc)[_0x5343('0x18')]();});}};}function handleEntityNotFound(_0x96bbf6,_0x1ab5eb){return function(_0x5e4344){if(!_0x5e4344){_0x96bbf6['sendStatus'](0x194);}return _0x5e4344;};}function handleError(_0x462cb6,_0x5871de){_0x5871de=_0x5871de||0x1f4;return function(_0x14d05a){logger['error'](_0x14d05a[_0x5343('0x25')]);if(_0x14d05a['name']){delete _0x14d05a['name'];}_0x462cb6[_0x5343('0x19')](_0x5871de)[_0x5343('0x26')](_0x14d05a);};}exports['index']=function(_0x5d597e,_0x1202bb){var _0x5d0853={},_0x2ed8c9={},_0x47d49a={'count':0x0,'rows':[]};var _0x5c689e=_[_0x5343('0x27')](db['Cdr']['rawAttributes'],function(_0x125e4c){return{'name':_0x125e4c[_0x5343('0x28')],'type':_0x125e4c[_0x5343('0x29')][_0x5343('0x2a')]};});_0x2ed8c9['model']=_['map'](_0x5c689e,_0x5343('0x2b'));_0x2ed8c9[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x5d597e[_0x5343('0x2c')]);_0x2ed8c9[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x2ed8c9[_0x5343('0x30')],_0x2ed8c9[_0x5343('0x2c')]);_0x5d0853[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x2ed8c9[_0x5343('0x30')],qs[_0x5343('0x32')](_0x5d597e['query']['fields']));_0x5d0853[_0x5343('0x31')]=_0x5d0853[_0x5343('0x31')]['length']?_0x5d0853[_0x5343('0x31')]:_0x2ed8c9['model'];if(!_0x5d597e[_0x5343('0x2c')][_0x5343('0x33')](_0x5343('0x34'))){_0x5d0853[_0x5343('0x1d')]=qs['limit'](_0x5d597e['query'][_0x5343('0x1d')]);_0x5d0853['offset']=qs[_0x5343('0x1b')](_0x5d597e[_0x5343('0x2c')]['offset']);}_0x5d0853[_0x5343('0x35')]=qs['sort'](_0x5d597e['query'][_0x5343('0x36')]);_0x5d0853[_0x5343('0x37')]=qs[_0x5343('0x2e')](_[_0x5343('0x38')](_0x5d597e['query'],_0x2ed8c9['filters']),_0x5c689e);if(_0x5d597e['query']['filter']){_0x5d0853[_0x5343('0x37')]=_[_0x5343('0x39')](_0x5d0853[_0x5343('0x37')],{'$or':_[_0x5343('0x27')](_0x5c689e,function(_0x3c517a){if(_0x3c517a[_0x5343('0x29')]!==_0x5343('0x3a')){var _0x4d2951={};_0x4d2951[_0x3c517a[_0x5343('0x2b')]]={'$like':'%'+_0x5d597e['query'][_0x5343('0x3b')]+'%'};return _0x4d2951;}})});}_0x5d0853=_[_0x5343('0x39')]({},_0x5d0853,_0x5d597e[_0x5343('0x3c')]);var _0x2f004a={'where':_0x5d0853[_0x5343('0x37')]};return db[_0x5343('0x3d')][_0x5343('0x3e')](_0x2f004a)['then'](function(_0xb93d9){_0x47d49a['count']=_0xb93d9;if(_0x5d597e[_0x5343('0x2c')][_0x5343('0x3f')]){_0x5d0853[_0x5343('0x40')]=[{'all':!![]}];}return db[_0x5343('0x3d')][_0x5343('0x41')](_0x5d0853);})[_0x5343('0x23')](function(_0x2c75bd){_0x47d49a['rows']=_0x2c75bd;return _0x47d49a;})[_0x5343('0x23')](respondWithFilteredResult(_0x1202bb,_0x5d0853))[_0x5343('0x42')](handleError(_0x1202bb,null));};exports['show']=function(_0x41df61,_0x16c880){var _0x4c576d={'raw':!![],'where':{'id':_0x41df61[_0x5343('0x43')]['id']}},_0x53c3c7={};_0x53c3c7[_0x5343('0x30')]=_[_0x5343('0x2d')](db['Cdr'][_0x5343('0x44')]);_0x53c3c7[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x41df61[_0x5343('0x2c')]);_0x53c3c7[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x53c3c7[_0x5343('0x30')],_0x53c3c7['query']);_0x4c576d[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x53c3c7[_0x5343('0x30')],qs[_0x5343('0x32')](_0x41df61[_0x5343('0x2c')][_0x5343('0x32')]));_0x4c576d[_0x5343('0x31')]=_0x4c576d[_0x5343('0x31')][_0x5343('0x45')]?_0x4c576d[_0x5343('0x31')]:_0x53c3c7[_0x5343('0x30')];if(_0x41df61[_0x5343('0x2c')][_0x5343('0x3f')]){_0x4c576d[_0x5343('0x40')]=[{'all':!![]}];}_0x4c576d=_[_0x5343('0x39')]({},_0x4c576d,_0x41df61['options']);return db[_0x5343('0x3d')][_0x5343('0x46')](_0x4c576d)['then'](handleEntityNotFound(_0x16c880,null))[_0x5343('0x23')](respondWithResult(_0x16c880,null))[_0x5343('0x42')](handleError(_0x16c880,null));};exports[_0x5343('0x47')]=function(_0x1da1b7,_0x194316){return db['Cdr'][_0x5343('0x47')](_0x1da1b7['body'],{})['then'](respondWithResult(_0x194316,0xc9))[_0x5343('0x42')](handleError(_0x194316,null));};exports[_0x5343('0x22')]=function(_0x10329c,_0x1cd4ed){if(_0x10329c['body']['id']){delete _0x10329c[_0x5343('0x48')]['id'];}return db[_0x5343('0x3d')][_0x5343('0x46')]({'where':{'id':_0x10329c[_0x5343('0x43')]['id']}})[_0x5343('0x23')](handleEntityNotFound(_0x1cd4ed,null))[_0x5343('0x23')](saveUpdates(_0x10329c[_0x5343('0x48')],null))[_0x5343('0x23')](respondWithResult(_0x1cd4ed,null))[_0x5343('0x42')](handleError(_0x1cd4ed,null));};exports[_0x5343('0x24')]=function(_0x566d71,_0x1cbf7c){return db[_0x5343('0x3d')][_0x5343('0x46')]({'where':{'id':_0x566d71[_0x5343('0x43')]['id']}})[_0x5343('0x23')](handleEntityNotFound(_0x1cbf7c,null))[_0x5343('0x23')](removeEntity(_0x1cbf7c,null))[_0x5343('0x42')](handleError(_0x1cbf7c,null));};exports[_0x5343('0x49')]=function(_0x3b3c64,_0xad51f4){return db['Cdr'][_0x5343('0x49')]()['then'](respondWithResult(_0xad51f4,null))['catch'](handleError(_0xad51f4,null));};
\ No newline at end of file
+var _0x5ad3=['destroy','error','stack','name','index','map','rawAttributes','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','Cdr','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','update','then'];(function(_0x186196,_0x42e3c7){var _0xe69596=function(_0x420392){while(--_0x420392){_0x186196['push'](_0x186196['shift']());}};_0xe69596(++_0x42e3c7);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x1440ce,_0x136aee){_0x1440ce=_0x1440ce-0x0;var _0x389c35=_0x5ad3[_0x1440ce];return _0x389c35;};'use strict';var emlformat=require(_0x35ad('0x0'));var rimraf=require(_0x35ad('0x1'));var zipdir=require(_0x35ad('0x2'));var jsonpatch=require(_0x35ad('0x3'));var rp=require('request-promise');var moment=require(_0x35ad('0x4'));var BPromise=require(_0x35ad('0x5'));var Mustache=require(_0x35ad('0x6'));var util=require(_0x35ad('0x7'));var path=require(_0x35ad('0x8'));var sox=require(_0x35ad('0x9'));var csv=require(_0x35ad('0xa'));var ejs=require(_0x35ad('0xb'));var fs=require('fs');var fs_extra=require(_0x35ad('0xc'));var _=require(_0x35ad('0xd'));var squel=require('squel');var crypto=require(_0x35ad('0xe'));var jsforce=require(_0x35ad('0xf'));var deskjs=require(_0x35ad('0x10'));var toCsv=require('to-csv');var querystring=require(_0x35ad('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x35ad('0x12'));var qs=require(_0x35ad('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35ad('0x14'));var logger=require(_0x35ad('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x35ad('0x16'));var licenseUtil=require(_0x35ad('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c4dd5,_0x33e2ec){_0x33e2ec=_0x33e2ec||0xcc;return function(_0x595fe8){if(_0x595fe8){return _0x3c4dd5['sendStatus'](_0x33e2ec);}return _0x3c4dd5[_0x35ad('0x18')](_0x33e2ec)[_0x35ad('0x19')]();};}function respondWithResult(_0x3cda5e,_0x4b7ad9){_0x4b7ad9=_0x4b7ad9||0xc8;return function(_0x3e2676){if(_0x3e2676){return _0x3cda5e[_0x35ad('0x18')](_0x4b7ad9)['json'](_0x3e2676);}};}function respondWithFilteredResult(_0x1494be,_0x4d5185){return function(_0x4e3cd8){if(_0x4e3cd8){var _0x3a981a=typeof _0x4d5185[_0x35ad('0x1a')]===_0x35ad('0x1b')&&typeof _0x4d5185['limit']===_0x35ad('0x1b');var _0x2f3f27=_0x4e3cd8[_0x35ad('0x1c')];var _0x3158a1=_0x3a981a?0x0:_0x4d5185[_0x35ad('0x1a')];var _0x418416=_0x3a981a?_0x4e3cd8['count']:_0x4d5185[_0x35ad('0x1a')]+_0x4d5185[_0x35ad('0x1d')];var _0x574557;if(_0x418416>=_0x2f3f27){_0x418416=_0x2f3f27;_0x574557=0xc8;}else{_0x574557=0xce;}_0x1494be['status'](_0x574557);return _0x1494be[_0x35ad('0x1e')](_0x35ad('0x1f'),_0x3158a1+'-'+_0x418416+'/'+_0x2f3f27)['json'](_0x4e3cd8);}return null;};}function patchUpdates(_0x21f611){return function(_0x32735e){try{jsonpatch['apply'](_0x32735e,_0x21f611,!![]);}catch(_0x37c03d){return BPromise[_0x35ad('0x20')](_0x37c03d);}return _0x32735e[_0x35ad('0x21')]();};}function saveUpdates(_0x30542c,_0x1be6d2){return function(_0x43a6a8){if(_0x43a6a8){return _0x43a6a8[_0x35ad('0x22')](_0x30542c)[_0x35ad('0x23')](function(_0x2fb296){return _0x2fb296;});}return null;};}function removeEntity(_0xebc6c5,_0x4c5740){return function(_0x1cb9da){if(_0x1cb9da){return _0x1cb9da[_0x35ad('0x24')]()['then'](function(){_0xebc6c5[_0x35ad('0x18')](0xcc)[_0x35ad('0x19')]();});}};}function handleEntityNotFound(_0xa3cb9f,_0xfc80ac){return function(_0x368468){if(!_0x368468){_0xa3cb9f['sendStatus'](0x194);}return _0x368468;};}function handleError(_0x37e9bd,_0x226167){_0x226167=_0x226167||0x1f4;return function(_0x3dc3c4){logger[_0x35ad('0x25')](_0x3dc3c4[_0x35ad('0x26')]);if(_0x3dc3c4[_0x35ad('0x27')]){delete _0x3dc3c4[_0x35ad('0x27')];}_0x37e9bd[_0x35ad('0x18')](_0x226167)['send'](_0x3dc3c4);};}exports[_0x35ad('0x28')]=function(_0x11da54,_0x2f8b3){var _0x34b8b9={},_0x2c82f1={},_0x481803={'count':0x0,'rows':[]};var _0x571ad6=_[_0x35ad('0x29')](db['Cdr'][_0x35ad('0x2a')],function(_0x4ccaea){return{'name':_0x4ccaea['fieldName'],'type':_0x4ccaea['type']['key']};});_0x2c82f1[_0x35ad('0x2b')]=_['map'](_0x571ad6,'name');_0x2c82f1[_0x35ad('0x2c')]=_['keys'](_0x11da54[_0x35ad('0x2c')]);_0x2c82f1['filters']=_[_0x35ad('0x2d')](_0x2c82f1['model'],_0x2c82f1[_0x35ad('0x2c')]);_0x34b8b9['attributes']=_[_0x35ad('0x2d')](_0x2c82f1[_0x35ad('0x2b')],qs[_0x35ad('0x2e')](_0x11da54['query'][_0x35ad('0x2e')]));_0x34b8b9[_0x35ad('0x2f')]=_0x34b8b9[_0x35ad('0x2f')][_0x35ad('0x30')]?_0x34b8b9[_0x35ad('0x2f')]:_0x2c82f1['model'];if(!_0x11da54['query'][_0x35ad('0x31')](_0x35ad('0x32'))){_0x34b8b9[_0x35ad('0x1d')]=qs[_0x35ad('0x1d')](_0x11da54['query'][_0x35ad('0x1d')]);_0x34b8b9[_0x35ad('0x1a')]=qs[_0x35ad('0x1a')](_0x11da54[_0x35ad('0x2c')][_0x35ad('0x1a')]);}_0x34b8b9[_0x35ad('0x33')]=qs['sort'](_0x11da54['query'][_0x35ad('0x34')]);_0x34b8b9[_0x35ad('0x35')]=qs[_0x35ad('0x36')](_[_0x35ad('0x37')](_0x11da54[_0x35ad('0x2c')],_0x2c82f1[_0x35ad('0x36')]),_0x571ad6);if(_0x11da54[_0x35ad('0x2c')][_0x35ad('0x38')]){_0x34b8b9[_0x35ad('0x35')]=_['merge'](_0x34b8b9[_0x35ad('0x35')],{'$or':_['map'](_0x571ad6,function(_0x25e63e){if(_0x25e63e[_0x35ad('0x39')]!==_0x35ad('0x3a')){var _0x38d1c9={};_0x38d1c9[_0x25e63e[_0x35ad('0x27')]]={'$like':'%'+_0x11da54[_0x35ad('0x2c')][_0x35ad('0x38')]+'%'};return _0x38d1c9;}})});}_0x34b8b9=_[_0x35ad('0x3b')]({},_0x34b8b9,_0x11da54[_0x35ad('0x3c')]);var _0x5dd327={'where':_0x34b8b9[_0x35ad('0x35')]};return db[_0x35ad('0x3d')][_0x35ad('0x1c')](_0x5dd327)['then'](function(_0x19d82d){_0x481803[_0x35ad('0x1c')]=_0x19d82d;if(_0x11da54[_0x35ad('0x2c')][_0x35ad('0x3e')]){_0x34b8b9[_0x35ad('0x3f')]=[{'all':!![]}];}return db[_0x35ad('0x3d')][_0x35ad('0x40')](_0x34b8b9);})[_0x35ad('0x23')](function(_0x11de09){_0x481803[_0x35ad('0x41')]=_0x11de09;return _0x481803;})[_0x35ad('0x23')](respondWithFilteredResult(_0x2f8b3,_0x34b8b9))['catch'](handleError(_0x2f8b3,null));};exports[_0x35ad('0x42')]=function(_0x4edc2b,_0x3de722){var _0x3b80c0={'raw':!![],'where':{'id':_0x4edc2b[_0x35ad('0x43')]['id']}},_0x3df623={};_0x3df623[_0x35ad('0x2b')]=_[_0x35ad('0x44')](db[_0x35ad('0x3d')][_0x35ad('0x2a')]);_0x3df623[_0x35ad('0x2c')]=_['keys'](_0x4edc2b[_0x35ad('0x2c')]);_0x3df623[_0x35ad('0x36')]=_[_0x35ad('0x2d')](_0x3df623[_0x35ad('0x2b')],_0x3df623[_0x35ad('0x2c')]);_0x3b80c0['attributes']=_[_0x35ad('0x2d')](_0x3df623[_0x35ad('0x2b')],qs['fields'](_0x4edc2b['query'][_0x35ad('0x2e')]));_0x3b80c0[_0x35ad('0x2f')]=_0x3b80c0[_0x35ad('0x2f')][_0x35ad('0x30')]?_0x3b80c0['attributes']:_0x3df623[_0x35ad('0x2b')];if(_0x4edc2b[_0x35ad('0x2c')][_0x35ad('0x3e')]){_0x3b80c0[_0x35ad('0x3f')]=[{'all':!![]}];}_0x3b80c0=_[_0x35ad('0x3b')]({},_0x3b80c0,_0x4edc2b[_0x35ad('0x3c')]);return db[_0x35ad('0x3d')]['find'](_0x3b80c0)[_0x35ad('0x23')](handleEntityNotFound(_0x3de722,null))[_0x35ad('0x23')](respondWithResult(_0x3de722,null))[_0x35ad('0x45')](handleError(_0x3de722,null));};exports['create']=function(_0x5e3f96,_0x5644c4){return db[_0x35ad('0x3d')][_0x35ad('0x46')](_0x5e3f96[_0x35ad('0x47')],{})[_0x35ad('0x23')](respondWithResult(_0x5644c4,0xc9))['catch'](handleError(_0x5644c4,null));};exports[_0x35ad('0x22')]=function(_0x46c462,_0x3583ca){if(_0x46c462[_0x35ad('0x47')]['id']){delete _0x46c462[_0x35ad('0x47')]['id'];}return db[_0x35ad('0x3d')]['find']({'where':{'id':_0x46c462['params']['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x3583ca,null))[_0x35ad('0x23')](saveUpdates(_0x46c462['body'],null))['then'](respondWithResult(_0x3583ca,null))[_0x35ad('0x45')](handleError(_0x3583ca,null));};exports[_0x35ad('0x24')]=function(_0x196ebd,_0x5c7dbd){return db['Cdr'][_0x35ad('0x48')]({'where':{'id':_0x196ebd[_0x35ad('0x43')]['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x5c7dbd,null))['then'](removeEntity(_0x5c7dbd,null))[_0x35ad('0x45')](handleError(_0x5c7dbd,null));};exports[_0x35ad('0x49')]=function(_0x34061c,_0x467887){return db[_0x35ad('0x3d')][_0x35ad('0x49')]()['then'](respondWithResult(_0x467887,null))[_0x35ad('0x45')](handleError(_0x467887,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 769928e..9b0589b 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x277763,_0x4b683c){var _0x10e5cd=function(_0x3f3bf9){while(--_0x3f3bf9){_0x277763['push'](_0x277763['shift']());}};_0x10e5cd(++_0x4b683c);}(_0x7a54,0x106));var _0x47a5=function(_0x1ed680,_0x4b501e){_0x1ed680=_0x1ed680-0x0;var _0x24187f=_0x7a54[_0x1ed680];return _0x24187f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x450891,_0x1729fb){var _0x3e9a7a=function(_0x2fcaf0){while(--_0x2fcaf0){_0x450891['push'](_0x450891['shift']());}};_0x3e9a7a(++_0x1729fb);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 1e7dbc0..a15c903 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 _0xe9e0=['request','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','Cdr,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x343a14,_0xba64bc){var _0x114335=function(_0x2a2c9f){while(--_0x2a2c9f){_0x343a14['push'](_0x343a14['shift']());}};_0x114335(++_0xba64bc);}(_0xe9e0,0x94));var _0x0e9e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9e0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0e9e('0x0'));var util=require('util');var moment=require(_0x0e9e('0x1'));var BPromise=require(_0x0e9e('0x2'));var rs=require(_0x0e9e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e9e('0x4'))['db'];var utils=require(_0x0e9e('0x5'));var logger=require(_0x0e9e('0x6'))(_0x0e9e('0x7'));var config=require(_0x0e9e('0x8'));var jayson=require(_0x0e9e('0x9'));var client=jayson[_0x0e9e('0xa')][_0x0e9e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x170b98,_0xc74bde,_0x13e861){return new BPromise(function(_0x758eb9,_0x1048da){return client[_0x0e9e('0xc')](_0x170b98,_0x13e861)['then'](function(_0x271bf6){logger['info']('Cdr,\x20%s,\x20%s',_0xc74bde,'request\x20sent');logger[_0x0e9e('0xd')](_0x0e9e('0xe'),_0xc74bde,_0x0e9e('0xf'),JSON['stringify'](_0x271bf6));if(_0x271bf6['error']){if(_0x271bf6[_0x0e9e('0x10')]['code']===0x1f4){logger[_0x0e9e('0x10')](_0x0e9e('0x11'),_0xc74bde,_0x271bf6[_0x0e9e('0x10')][_0x0e9e('0x12')]);return _0x1048da(_0x271bf6[_0x0e9e('0x10')][_0x0e9e('0x12')]);}logger['error'](_0x0e9e('0x11'),_0xc74bde,_0x271bf6[_0x0e9e('0x10')]['message']);return _0x758eb9(_0x271bf6[_0x0e9e('0x10')][_0x0e9e('0x12')]);}else{logger[_0x0e9e('0x13')](_0x0e9e('0x11'),_0xc74bde,_0x0e9e('0xf'));_0x758eb9(_0x271bf6['result']['message']);}})['catch'](function(_0x13ec6b){logger['error'](_0x0e9e('0x11'),_0xc74bde,_0x13ec6b);_0x1048da(_0x13ec6b);});});}
\ No newline at end of file
+var _0xca89=['catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x13190e,_0x4313c8){var _0x55b923=function(_0x4757c8){while(--_0x4757c8){_0x13190e['push'](_0x13190e['shift']());}};_0x55b923(++_0x4313c8);}(_0xca89,0x166));var _0x9ca8=function(_0x25cbba,_0x549cc9){_0x25cbba=_0x25cbba-0x0;var _0x28d81e=_0xca89[_0x25cbba];return _0x28d81e;};'use strict';var _=require(_0x9ca8('0x0'));var util=require(_0x9ca8('0x1'));var moment=require(_0x9ca8('0x2'));var BPromise=require('bluebird');var rs=require(_0x9ca8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ca8('0x4'))['db'];var utils=require(_0x9ca8('0x5'));var logger=require(_0x9ca8('0x6'))('rpc');var config=require(_0x9ca8('0x7'));var jayson=require(_0x9ca8('0x8'));var client=jayson[_0x9ca8('0x9')][_0x9ca8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38a0e2,_0x4d1aec,_0x361e08){return new BPromise(function(_0x5e6b25,_0x519ba5){return client[_0x9ca8('0xb')](_0x38a0e2,_0x361e08)[_0x9ca8('0xc')](function(_0x1b1348){logger['info'](_0x9ca8('0xd'),_0x4d1aec,_0x9ca8('0xe'));logger[_0x9ca8('0xf')](_0x9ca8('0x10'),_0x4d1aec,_0x9ca8('0xe'),JSON['stringify'](_0x1b1348));if(_0x1b1348[_0x9ca8('0x11')]){if(_0x1b1348[_0x9ca8('0x11')]['code']===0x1f4){logger[_0x9ca8('0x11')](_0x9ca8('0xd'),_0x4d1aec,_0x1b1348[_0x9ca8('0x11')][_0x9ca8('0x12')]);return _0x519ba5(_0x1b1348['error'][_0x9ca8('0x12')]);}logger[_0x9ca8('0x11')]('Cdr,\x20%s,\x20%s',_0x4d1aec,_0x1b1348[_0x9ca8('0x11')]['message']);return _0x5e6b25(_0x1b1348['error'][_0x9ca8('0x12')]);}else{logger[_0x9ca8('0x13')]('Cdr,\x20%s,\x20%s',_0x4d1aec,_0x9ca8('0xe'));_0x5e6b25(_0x1b1348['result'][_0x9ca8('0x12')]);}})[_0x9ca8('0x14')](function(_0x430e27){logger['error'](_0x9ca8('0xd'),_0x4d1aec,_0x430e27);_0x519ba5(_0x430e27);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 63fb1d0..6d10ace 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(_0x2e53e1,_0x12aed1){var _0x3a23de=function(_0xd84699){while(--_0xd84699){_0x2e53e1['push'](_0x2e53e1['shift']());}};_0x3a23de(++_0x12aed1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 0387913..1462fb6 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 _0x8913=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x81707f,_0x4c10d0){var _0x311e6c=function(_0xc0b00){while(--_0xc0b00){_0x81707f['push'](_0x81707f['shift']());}};_0x311e6c(++_0x4c10d0);}(_0x8913,0x7f));var _0x3891=function(_0x1605e1,_0x3f4128){_0x1605e1=_0x1605e1-0x0;var _0x543337=_0x8913[_0x1605e1];return _0x543337;};'use strict';var Sequelize=require(_0x3891('0x0'));module['exports']={'priority':{'type':Sequelize[_0x3891('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3891('0x2')],'allowNull':![],'defaultValue':_0x3891('0x3')},'appdata':{'type':Sequelize[_0x3891('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3891('0x2')],'defaultValue':_0x3891('0x5')}};
\ No newline at end of file
+var _0x4417=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x54f6f6,_0x467501){var _0x194d4c=function(_0x803b99){while(--_0x803b99){_0x54f6f6['push'](_0x54f6f6['shift']());}};_0x194d4c(++_0x467501);}(_0x4417,0xd7));var _0x7441=function(_0x207d50,_0x52c08d){_0x207d50=_0x207d50-0x0;var _0x1c47e2=_0x4417[_0x207d50];return _0x1c47e2;};'use strict';var Sequelize=require(_0x7441('0x0'));module[_0x7441('0x1')]={'priority':{'type':Sequelize[_0x7441('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7441('0x3')],'allowNull':![],'defaultValue':_0x7441('0x4')},'appdata':{'type':Sequelize[_0x7441('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7441('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index f1f57a9..0ee3b79 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 _0x1bd1=['then','destroy','name','send','show','params','keys','ChatApplication','query','filters','intersection','model','attributes','fields','length','include','merge','find','update','body','catch','eml-format','rimraf','zip-dir','request-promise','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject'];(function(_0x1346cb,_0xfd2ab3){var _0x4b1f6c=function(_0x2ec719){while(--_0x2ec719){_0x1346cb['push'](_0x1346cb['shift']());}};_0x4b1f6c(++_0xfd2ab3);}(_0x1bd1,0x123));var _0x11bd=function(_0x101e4f,_0x2b5285){_0x101e4f=_0x101e4f-0x0;var _0x418a07=_0x1bd1[_0x101e4f];return _0x418a07;};'use strict';var emlformat=require(_0x11bd('0x0'));var rimraf=require(_0x11bd('0x1'));var zipdir=require(_0x11bd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11bd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x11bd('0x4'));var sox=require(_0x11bd('0x5'));var csv=require(_0x11bd('0x6'));var ejs=require(_0x11bd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11bd('0x8'));var squel=require(_0x11bd('0x9'));var crypto=require(_0x11bd('0xa'));var jsforce=require(_0x11bd('0xb'));var deskjs=require(_0x11bd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x11bd('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x11bd('0xe'));var qs=require(_0x11bd('0xf'));var as=require(_0x11bd('0x10'));var hardwareService=require(_0x11bd('0x11'));var logger=require(_0x11bd('0x12'))(_0x11bd('0x13'));var utils=require(_0x11bd('0x14'));var config=require(_0x11bd('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x11bd('0x16'))['db'];function respondWithStatusCode(_0x1afe14,_0x2ceee2){_0x2ceee2=_0x2ceee2||0xcc;return function(_0x39b6b9){if(_0x39b6b9){return _0x1afe14[_0x11bd('0x17')](_0x2ceee2);}return _0x1afe14[_0x11bd('0x18')](_0x2ceee2)[_0x11bd('0x19')]();};}function respondWithResult(_0x4d6ebe,_0x5e4cc4){_0x5e4cc4=_0x5e4cc4||0xc8;return function(_0x1c832b){if(_0x1c832b){return _0x4d6ebe[_0x11bd('0x18')](_0x5e4cc4)[_0x11bd('0x1a')](_0x1c832b);}};}function respondWithFilteredResult(_0x5ca6bb,_0x384144){return function(_0x5b78cc){if(_0x5b78cc){var _0x59978e=typeof _0x384144[_0x11bd('0x1b')]===_0x11bd('0x1c')&&typeof _0x384144[_0x11bd('0x1d')]===_0x11bd('0x1c');var _0xd04657=_0x5b78cc['count'];var _0x904980=_0x59978e?0x0:_0x384144[_0x11bd('0x1b')];var _0x39de22=_0x59978e?_0x5b78cc[_0x11bd('0x1e')]:_0x384144[_0x11bd('0x1b')]+_0x384144[_0x11bd('0x1d')];var _0xd2ca8a;if(_0x39de22>=_0xd04657){_0x39de22=_0xd04657;_0xd2ca8a=0xc8;}else{_0xd2ca8a=0xce;}_0x5ca6bb[_0x11bd('0x18')](_0xd2ca8a);return _0x5ca6bb['set']('Content-Range',_0x904980+'-'+_0x39de22+'/'+_0xd04657)[_0x11bd('0x1a')](_0x5b78cc);}return null;};}function patchUpdates(_0x232811){return function(_0x19176e){try{jsonpatch[_0x11bd('0x1f')](_0x19176e,_0x232811,!![]);}catch(_0x5d0f2b){return BPromise[_0x11bd('0x20')](_0x5d0f2b);}return _0x19176e['save']();};}function saveUpdates(_0x232f11,_0x104357){return function(_0x1d7984){if(_0x1d7984){return _0x1d7984['update'](_0x232f11)[_0x11bd('0x21')](function(_0x40c7d2){return _0x40c7d2;});}return null;};}function removeEntity(_0x1c0522,_0x27c98c){return function(_0x3343da){if(_0x3343da){return _0x3343da[_0x11bd('0x22')]()[_0x11bd('0x21')](function(){_0x1c0522[_0x11bd('0x18')](0xcc)[_0x11bd('0x19')]();});}};}function handleEntityNotFound(_0x39fbf9,_0x344826){return function(_0x3c6dab){if(!_0x3c6dab){_0x39fbf9['sendStatus'](0x194);}return _0x3c6dab;};}function handleError(_0x255365,_0xfbe811){_0xfbe811=_0xfbe811||0x1f4;return function(_0xa08420){logger['error'](_0xa08420['stack']);if(_0xa08420['name']){delete _0xa08420[_0x11bd('0x23')];}_0x255365[_0x11bd('0x18')](_0xfbe811)[_0x11bd('0x24')](_0xa08420);};}exports[_0x11bd('0x25')]=function(_0x39c2e3,_0x4312b3){var _0x3cc87b={'raw':!![],'where':{'id':_0x39c2e3[_0x11bd('0x26')]['id']}},_0x599f40={};_0x599f40['model']=_[_0x11bd('0x27')](db[_0x11bd('0x28')]['rawAttributes']);_0x599f40[_0x11bd('0x29')]=_[_0x11bd('0x27')](_0x39c2e3[_0x11bd('0x29')]);_0x599f40[_0x11bd('0x2a')]=_[_0x11bd('0x2b')](_0x599f40[_0x11bd('0x2c')],_0x599f40[_0x11bd('0x29')]);_0x3cc87b[_0x11bd('0x2d')]=_['intersection'](_0x599f40[_0x11bd('0x2c')],qs[_0x11bd('0x2e')](_0x39c2e3[_0x11bd('0x29')][_0x11bd('0x2e')]));_0x3cc87b[_0x11bd('0x2d')]=_0x3cc87b[_0x11bd('0x2d')][_0x11bd('0x2f')]?_0x3cc87b[_0x11bd('0x2d')]:_0x599f40[_0x11bd('0x2c')];if(_0x39c2e3[_0x11bd('0x29')]['includeAll']){_0x3cc87b[_0x11bd('0x30')]=[{'all':!![]}];}_0x3cc87b=_[_0x11bd('0x31')]({},_0x3cc87b,_0x39c2e3['options']);return db[_0x11bd('0x28')][_0x11bd('0x32')](_0x3cc87b)[_0x11bd('0x21')](handleEntityNotFound(_0x4312b3,null))[_0x11bd('0x21')](respondWithResult(_0x4312b3,null))['catch'](handleError(_0x4312b3,null));};exports[_0x11bd('0x33')]=function(_0x485915,_0x3dc82f){if(_0x485915[_0x11bd('0x34')]['id']){delete _0x485915[_0x11bd('0x34')]['id'];}return db[_0x11bd('0x28')][_0x11bd('0x32')]({'where':{'id':_0x485915[_0x11bd('0x26')]['id']}})[_0x11bd('0x21')](handleEntityNotFound(_0x3dc82f,null))[_0x11bd('0x21')](saveUpdates(_0x485915[_0x11bd('0x34')],null))[_0x11bd('0x21')](respondWithResult(_0x3dc82f,null))[_0x11bd('0x35')](handleError(_0x3dc82f,null));};exports[_0x11bd('0x22')]=function(_0x12c1f4,_0x234a4b){return db['ChatApplication']['find']({'where':{'id':_0x12c1f4['params']['id']}})[_0x11bd('0x21')](handleEntityNotFound(_0x234a4b,null))[_0x11bd('0x21')](removeEntity(_0x234a4b,null))['catch'](handleError(_0x234a4b,null));};
\ No newline at end of file
+var _0xb458=['Content-Range','apply','reject','save','update','then','destroy','error','stack','params','model','ChatApplication','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0xb458,0xca));var _0x8b45=function(_0x499ae7,_0x11541d){_0x499ae7=_0x499ae7-0x0;var _0xdfdd0f=_0xb458[_0x499ae7];return _0xdfdd0f;};'use strict';var emlformat=require(_0x8b45('0x0'));var rimraf=require(_0x8b45('0x1'));var zipdir=require(_0x8b45('0x2'));var jsonpatch=require(_0x8b45('0x3'));var rp=require('request-promise');var moment=require(_0x8b45('0x4'));var BPromise=require(_0x8b45('0x5'));var Mustache=require(_0x8b45('0x6'));var util=require(_0x8b45('0x7'));var path=require(_0x8b45('0x8'));var sox=require(_0x8b45('0x9'));var csv=require(_0x8b45('0xa'));var ejs=require(_0x8b45('0xb'));var fs=require('fs');var fs_extra=require(_0x8b45('0xc'));var _=require(_0x8b45('0xd'));var squel=require(_0x8b45('0xe'));var crypto=require(_0x8b45('0xf'));var jsforce=require(_0x8b45('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x8b45('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8b45('0x11'));var authService=require(_0x8b45('0x12'));var qs=require(_0x8b45('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b45('0x14'));var logger=require('../../config/logger')(_0x8b45('0x15'));var utils=require(_0x8b45('0x16'));var config=require(_0x8b45('0x17'));var licenseUtil=require(_0x8b45('0x18'));var db=require(_0x8b45('0x19'))['db'];function respondWithStatusCode(_0x54c03c,_0x5559e7){_0x5559e7=_0x5559e7||0xcc;return function(_0x46a6c4){if(_0x46a6c4){return _0x54c03c[_0x8b45('0x1a')](_0x5559e7);}return _0x54c03c[_0x8b45('0x1b')](_0x5559e7)[_0x8b45('0x1c')]();};}function respondWithResult(_0x3b7c99,_0x1fdb2d){_0x1fdb2d=_0x1fdb2d||0xc8;return function(_0x1bd228){if(_0x1bd228){return _0x3b7c99[_0x8b45('0x1b')](_0x1fdb2d)[_0x8b45('0x1d')](_0x1bd228);}};}function respondWithFilteredResult(_0x83c355,_0x300dc9){return function(_0x153495){if(_0x153495){var _0x29180d=typeof _0x300dc9[_0x8b45('0x1e')]===_0x8b45('0x1f')&&typeof _0x300dc9['limit']==='undefined';var _0x777072=_0x153495[_0x8b45('0x20')];var _0xfb84af=_0x29180d?0x0:_0x300dc9[_0x8b45('0x1e')];var _0x39bffe=_0x29180d?_0x153495['count']:_0x300dc9[_0x8b45('0x1e')]+_0x300dc9['limit'];var _0x219c94;if(_0x39bffe>=_0x777072){_0x39bffe=_0x777072;_0x219c94=0xc8;}else{_0x219c94=0xce;}_0x83c355['status'](_0x219c94);return _0x83c355[_0x8b45('0x21')](_0x8b45('0x22'),_0xfb84af+'-'+_0x39bffe+'/'+_0x777072)[_0x8b45('0x1d')](_0x153495);}return null;};}function patchUpdates(_0x51fe21){return function(_0xc924dd){try{jsonpatch[_0x8b45('0x23')](_0xc924dd,_0x51fe21,!![]);}catch(_0x48f46a){return BPromise[_0x8b45('0x24')](_0x48f46a);}return _0xc924dd[_0x8b45('0x25')]();};}function saveUpdates(_0x2319c6,_0x4e57a9){return function(_0xc125c4){if(_0xc125c4){return _0xc125c4[_0x8b45('0x26')](_0x2319c6)[_0x8b45('0x27')](function(_0x557f5b){return _0x557f5b;});}return null;};}function removeEntity(_0x1dc7c2,_0x53205d){return function(_0x5cd08a){if(_0x5cd08a){return _0x5cd08a[_0x8b45('0x28')]()[_0x8b45('0x27')](function(){_0x1dc7c2[_0x8b45('0x1b')](0xcc)[_0x8b45('0x1c')]();});}};}function handleEntityNotFound(_0x40510c,_0x5ce26a){return function(_0x3dc3b8){if(!_0x3dc3b8){_0x40510c[_0x8b45('0x1a')](0x194);}return _0x3dc3b8;};}function handleError(_0x4acd00,_0x4b6465){_0x4b6465=_0x4b6465||0x1f4;return function(_0x5919e2){logger[_0x8b45('0x29')](_0x5919e2[_0x8b45('0x2a')]);if(_0x5919e2['name']){delete _0x5919e2['name'];}_0x4acd00['status'](_0x4b6465)['send'](_0x5919e2);};}exports['show']=function(_0x2b24f3,_0x53a363){var _0x28d540={'raw':!![],'where':{'id':_0x2b24f3[_0x8b45('0x2b')]['id']}},_0x275c07={};_0x275c07[_0x8b45('0x2c')]=_['keys'](db[_0x8b45('0x2d')]['rawAttributes']);_0x275c07['query']=_[_0x8b45('0x2e')](_0x2b24f3[_0x8b45('0x2f')]);_0x275c07[_0x8b45('0x30')]=_[_0x8b45('0x31')](_0x275c07[_0x8b45('0x2c')],_0x275c07[_0x8b45('0x2f')]);_0x28d540[_0x8b45('0x32')]=_[_0x8b45('0x31')](_0x275c07[_0x8b45('0x2c')],qs[_0x8b45('0x33')](_0x2b24f3[_0x8b45('0x2f')][_0x8b45('0x33')]));_0x28d540[_0x8b45('0x32')]=_0x28d540[_0x8b45('0x32')][_0x8b45('0x34')]?_0x28d540[_0x8b45('0x32')]:_0x275c07['model'];if(_0x2b24f3[_0x8b45('0x2f')][_0x8b45('0x35')]){_0x28d540['include']=[{'all':!![]}];}_0x28d540=_[_0x8b45('0x36')]({},_0x28d540,_0x2b24f3[_0x8b45('0x37')]);return db[_0x8b45('0x2d')]['find'](_0x28d540)[_0x8b45('0x27')](handleEntityNotFound(_0x53a363,null))[_0x8b45('0x27')](respondWithResult(_0x53a363,null))['catch'](handleError(_0x53a363,null));};exports[_0x8b45('0x26')]=function(_0x49c138,_0x45e8ec){if(_0x49c138['body']['id']){delete _0x49c138['body']['id'];}return db['ChatApplication'][_0x8b45('0x38')]({'where':{'id':_0x49c138[_0x8b45('0x2b')]['id']}})[_0x8b45('0x27')](handleEntityNotFound(_0x45e8ec,null))[_0x8b45('0x27')](saveUpdates(_0x49c138[_0x8b45('0x39')],null))[_0x8b45('0x27')](respondWithResult(_0x45e8ec,null))['catch'](handleError(_0x45e8ec,null));};exports[_0x8b45('0x28')]=function(_0x24961d,_0x5c4a5d){return db['ChatApplication'][_0x8b45('0x38')]({'where':{'id':_0x24961d[_0x8b45('0x2b')]['id']}})[_0x8b45('0x27')](handleEntityNotFound(_0x5c4a5d,null))[_0x8b45('0x27')](removeEntity(_0x5c4a5d,null))[_0x8b45('0x3a')](handleError(_0x5c4a5d,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 4a048e7..076612b 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 _0x24ab=['chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication'];(function(_0x1488cd,_0x25a893){var _0x63fa13=function(_0x57dd1c){while(--_0x57dd1c){_0x1488cd['push'](_0x1488cd['shift']());}};_0x63fa13(++_0x25a893);}(_0x24ab,0x1c4));var _0xb24a=function(_0x5cd7de,_0x2a5628){_0x5cd7de=_0x5cd7de-0x0;var _0x285943=_0x24ab[_0x5cd7de];return _0x285943;};'use strict';var _=require(_0xb24a('0x0'));var util=require(_0xb24a('0x1'));var logger=require(_0xb24a('0x2'))(_0xb24a('0x3'));var moment=require(_0xb24a('0x4'));var BPromise=require(_0xb24a('0x5'));var rp=require(_0xb24a('0x6'));var fs=require('fs');var path=require(_0xb24a('0x7'));var rimraf=require('rimraf');var config=require(_0xb24a('0x8'));var attributes=require(_0xb24a('0x9'));module[_0xb24a('0xa')]=function(_0x11a6b9,_0x1b3e7c){return _0x11a6b9[_0xb24a('0xb')](_0xb24a('0xc'),attributes,{'tableName':_0xb24a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb24a('0xe')});};
\ No newline at end of file
+var _0xe142=['utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication','chat_applications','utf8mb4'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe142,0xaa));var _0x2e14=function(_0x507d61,_0x2e3981){_0x507d61=_0x507d61-0x0;var _0x3a8c68=_0xe142[_0x507d61];return _0x3a8c68;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2e14('0x0'))('api');var moment=require(_0x2e14('0x1'));var BPromise=require(_0x2e14('0x2'));var rp=require(_0x2e14('0x3'));var fs=require('fs');var path=require(_0x2e14('0x4'));var rimraf=require(_0x2e14('0x5'));var config=require(_0x2e14('0x6'));var attributes=require('./chatApplication.attributes');module[_0x2e14('0x7')]=function(_0x33e99b,_0x1bfd45){return _0x33e99b[_0x2e14('0x8')](_0x2e14('0x9'),attributes,{'tableName':_0x2e14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2e14('0xb'),'collate':_0x2e14('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 049d8e5..50dee12 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 _0xc498=['then','info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x579a2f,_0x2a815a){var _0x5c9e93=function(_0x3e6fc9){while(--_0x3e6fc9){_0x579a2f['push'](_0x579a2f['shift']());}};_0x5c9e93(++_0x2a815a);}(_0xc498,0x96));var _0x8c49=function(_0x3bf7ef,_0x2b0128){_0x3bf7ef=_0x3bf7ef-0x0;var _0x376805=_0xc498[_0x3bf7ef];return _0x376805;};'use strict';var _=require(_0x8c49('0x0'));var util=require(_0x8c49('0x1'));var moment=require(_0x8c49('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c49('0x3'));var db=require(_0x8c49('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c49('0x5'))(_0x8c49('0x6'));var config=require(_0x8c49('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8c49('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bd240,_0x1f1a86,_0x2dd22e){return new BPromise(function(_0x32f376,_0x563efb){return client[_0x8c49('0x9')](_0x3bd240,_0x2dd22e)[_0x8c49('0xa')](function(_0x11de25){logger[_0x8c49('0xb')]('ChatApplication,\x20%s,\x20%s',_0x1f1a86,_0x8c49('0xc'));logger['debug'](_0x8c49('0xd'),_0x1f1a86,_0x8c49('0xc'),JSON[_0x8c49('0xe')](_0x11de25));if(_0x11de25[_0x8c49('0xf')]){if(_0x11de25[_0x8c49('0xf')][_0x8c49('0x10')]===0x1f4){logger[_0x8c49('0xf')](_0x8c49('0x11'),_0x1f1a86,_0x11de25[_0x8c49('0xf')][_0x8c49('0x12')]);return _0x563efb(_0x11de25[_0x8c49('0xf')][_0x8c49('0x12')]);}logger[_0x8c49('0xf')](_0x8c49('0x11'),_0x1f1a86,_0x11de25[_0x8c49('0xf')][_0x8c49('0x12')]);return _0x32f376(_0x11de25[_0x8c49('0xf')][_0x8c49('0x12')]);}else{logger['info'](_0x8c49('0x11'),_0x1f1a86,_0x8c49('0xc'));_0x32f376(_0x11de25['result'][_0x8c49('0x12')]);}})[_0x8c49('0x13')](function(_0x4de2fb){logger['error'](_0x8c49('0x11'),_0x1f1a86,_0x4de2fb);_0x563efb(_0x4de2fb);});});}
\ No newline at end of file
+var _0x19db=['jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x19db,0x15e));var _0xb19d=function(_0x47a854,_0x5871dd){_0x47a854=_0x47a854-0x0;var _0x51a0af=_0x19db[_0x47a854];return _0x51a0af;};'use strict';var _=require(_0xb19d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb19d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb19d('0x2'))['db'];var utils=require(_0xb19d('0x3'));var logger=require(_0xb19d('0x4'))(_0xb19d('0x5'));var config=require(_0xb19d('0x6'));var jayson=require(_0xb19d('0x7'));var client=jayson[_0xb19d('0x8')][_0xb19d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f4c19,_0xa59db7,_0x328b94){return new BPromise(function(_0x61dec0,_0x2d6aa8){return client[_0xb19d('0xa')](_0x2f4c19,_0x328b94)[_0xb19d('0xb')](function(_0x5468d9){logger[_0xb19d('0xc')](_0xb19d('0xd'),_0xa59db7,_0xb19d('0xe'));logger[_0xb19d('0xf')](_0xb19d('0x10'),_0xa59db7,_0xb19d('0xe'),JSON['stringify'](_0x5468d9));if(_0x5468d9[_0xb19d('0x11')]){if(_0x5468d9[_0xb19d('0x11')][_0xb19d('0x12')]===0x1f4){logger[_0xb19d('0x11')](_0xb19d('0xd'),_0xa59db7,_0x5468d9[_0xb19d('0x11')][_0xb19d('0x13')]);return _0x2d6aa8(_0x5468d9[_0xb19d('0x11')][_0xb19d('0x13')]);}logger[_0xb19d('0x11')](_0xb19d('0xd'),_0xa59db7,_0x5468d9['error'][_0xb19d('0x13')]);return _0x61dec0(_0x5468d9[_0xb19d('0x11')]['message']);}else{logger[_0xb19d('0xc')]('ChatApplication,\x20%s,\x20%s',_0xa59db7,_0xb19d('0xe'));_0x61dec0(_0x5468d9['result']['message']);}})[_0xb19d('0x14')](function(_0x282d6c){logger[_0xb19d('0x11')](_0xb19d('0xd'),_0xa59db7,_0x282d6c);_0x2d6aa8(_0x282d6c);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 2489f4f..5044d70 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 _0x16c6=['fs-extra','../../components/auth/service','../../components/interaction/service','/:id','isAuthenticated','show','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x4571c8,_0x179c89){var _0x1e4213=function(_0x11c453){while(--_0x11c453){_0x4571c8['push'](_0x4571c8['shift']());}};_0x1e4213(++_0x179c89);}(_0x16c6,0x1ea));var _0x616c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x16c6[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x616c('0x0'));var util=require(_0x616c('0x1'));var path=require(_0x616c('0x2'));var timeout=require(_0x616c('0x3'));var express=require(_0x616c('0x4'));var router=express[_0x616c('0x5')]();var fs_extra=require(_0x616c('0x6'));var auth=require(_0x616c('0x7'));var interaction=require(_0x616c('0x8'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router['get'](_0x616c('0x9'),auth[_0x616c('0xa')](),controller[_0x616c('0xb')]);router[_0x616c('0xc')]('/:id',auth[_0x616c('0xa')](),controller[_0x616c('0xd')]);router[_0x616c('0xe')](_0x616c('0x9'),auth[_0x616c('0xa')](),controller[_0x616c('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x42ed=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','isAuthenticated','show','put','/:id','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x30c680,_0x295d15){var _0x7da8a0=function(_0x4aaf5c){while(--_0x4aaf5c){_0x30c680['push'](_0x30c680['shift']());}};_0x7da8a0(++_0x295d15);}(_0x42ed,0xec));var _0xd42e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x42ed[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd42e('0x0'));var util=require('util');var path=require(_0xd42e('0x1'));var timeout=require('connect-timeout');var express=require(_0xd42e('0x2'));var router=express[_0xd42e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd42e('0x4'));var interaction=require(_0xd42e('0x5'));var config=require(_0xd42e('0x6'));var controller=require(_0xd42e('0x7'));router['get']('/:id',auth[_0xd42e('0x8')](),controller[_0xd42e('0x9')]);router[_0xd42e('0xa')](_0xd42e('0xb'),auth['isAuthenticated'](),controller[_0xd42e('0xc')]);router[_0xd42e('0xd')](_0xd42e('0xb'),auth[_0xd42e('0x8')](),controller[_0xd42e('0xe')]);module[_0xd42e('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index d27d1c4..8e75257 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 _0x019b=['sequelize','exports'];(function(_0x155672,_0x46e52e){var _0x16dc93=function(_0x5f2a1e){while(--_0x5f2a1e){_0x155672['push'](_0x155672['shift']());}};_0x16dc93(++_0x46e52e);}(_0x019b,0xa6));var _0xb019=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0x019b[_0x53bcc3];return _0x47c959;};'use strict';var Sequelize=require(_0xb019('0x0'));module[_0xb019('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x7008=['exports','STRING','sequelize'];(function(_0x34cee7,_0x5a22ea){var _0x10544e=function(_0x4bcbbe){while(--_0x4bcbbe){_0x34cee7['push'](_0x34cee7['shift']());}};_0x10544e(++_0x5a22ea);}(_0x7008,0x185));var _0x8700=function(_0x5e0c8a,_0x23387d){_0x5e0c8a=_0x5e0c8a-0x0;var _0x568eaa=_0x7008[_0x5e0c8a];return _0x568eaa;};'use strict';var Sequelize=require(_0x8700('0x0'));module[_0x8700('0x1')]={'name':{'type':Sequelize[_0x8700('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8700('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 ff67578..35a796f 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 _0x4ff4=['ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatGroup.socket','offset','undefined','count','limit','status','set','Content-Range','json','apply','save','update','then','end','sendStatus','stack','name','send','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','describe','getUnread','ChatInternalMessage','user','addMembers','findOne','User','getMembers','removeMembers','ids','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv'];(function(_0x44fc50,_0x3b9d3b){var _0x5ccd46=function(_0x564c74){while(--_0x564c74){_0x44fc50['push'](_0x44fc50['shift']());}};_0x5ccd46(++_0x3b9d3b);}(_0x4ff4,0xb1));var _0x44ff=function(_0x482214,_0x2550ff){_0x482214=_0x482214-0x0;var _0x38d0cb=_0x4ff4[_0x482214];return _0x38d0cb;};'use strict';var emlformat=require(_0x44ff('0x0'));var rimraf=require(_0x44ff('0x1'));var zipdir=require(_0x44ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x44ff('0x3'));var moment=require(_0x44ff('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x44ff('0x5'));var path=require(_0x44ff('0x6'));var sox=require(_0x44ff('0x7'));var csv=require(_0x44ff('0x8'));var ejs=require(_0x44ff('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x44ff('0xa'));var squel=require('squel');var crypto=require(_0x44ff('0xb'));var jsforce=require(_0x44ff('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x44ff('0x8'));var querystring=require(_0x44ff('0xd'));var Papa=require(_0x44ff('0xe'));var Redis=require(_0x44ff('0xf'));var authService=require(_0x44ff('0x10'));var qs=require(_0x44ff('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x44ff('0x12'));var logger=require(_0x44ff('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x44ff('0x14'));var licenseUtil=require(_0x44ff('0x15'));var db=require(_0x44ff('0x16'))['db'];config[_0x44ff('0x17')]=_[_0x44ff('0x18')](config[_0x44ff('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44ff('0x17')]));require(_0x44ff('0x19'))['register'](socket);function respondWithStatusCode(_0x4f10d0,_0x22a554){_0x22a554=_0x22a554||0xcc;return function(_0x3c79cb){if(_0x3c79cb){return _0x4f10d0['sendStatus'](_0x22a554);}return _0x4f10d0['status'](_0x22a554)['end']();};}function respondWithResult(_0x21627b,_0x499660){_0x499660=_0x499660||0xc8;return function(_0x80215b){if(_0x80215b){return _0x21627b['status'](_0x499660)['json'](_0x80215b);}};}function respondWithFilteredResult(_0x590655,_0x3a8368){return function(_0x3ddfc0){if(_0x3ddfc0){var _0x5ba75b=typeof _0x3a8368[_0x44ff('0x1a')]===_0x44ff('0x1b')&&typeof _0x3a8368['limit']===_0x44ff('0x1b');var _0x1e9b99=_0x3ddfc0['count'];var _0x3dd0dc=_0x5ba75b?0x0:_0x3a8368[_0x44ff('0x1a')];var _0x59905e=_0x5ba75b?_0x3ddfc0[_0x44ff('0x1c')]:_0x3a8368['offset']+_0x3a8368[_0x44ff('0x1d')];var _0x44f308;if(_0x59905e>=_0x1e9b99){_0x59905e=_0x1e9b99;_0x44f308=0xc8;}else{_0x44f308=0xce;}_0x590655[_0x44ff('0x1e')](_0x44f308);return _0x590655[_0x44ff('0x1f')](_0x44ff('0x20'),_0x3dd0dc+'-'+_0x59905e+'/'+_0x1e9b99)[_0x44ff('0x21')](_0x3ddfc0);}return null;};}function patchUpdates(_0x456ec2){return function(_0x1ed0e5){try{jsonpatch[_0x44ff('0x22')](_0x1ed0e5,_0x456ec2,!![]);}catch(_0x184875){return BPromise['reject'](_0x184875);}return _0x1ed0e5[_0x44ff('0x23')]();};}function saveUpdates(_0x2688f5,_0x59b155){return function(_0x531715){if(_0x531715){return _0x531715[_0x44ff('0x24')](_0x2688f5)['then'](function(_0x116093){return _0x116093;});}return null;};}function removeEntity(_0x43a671,_0x57a507){return function(_0x5ae524){if(_0x5ae524){return _0x5ae524['destroy']()[_0x44ff('0x25')](function(){_0x43a671[_0x44ff('0x1e')](0xcc)[_0x44ff('0x26')]();});}};}function handleEntityNotFound(_0x320d93,_0x6ec7ff){return function(_0x3a1cb2){if(!_0x3a1cb2){_0x320d93[_0x44ff('0x27')](0x194);}return _0x3a1cb2;};}function handleError(_0x108980,_0x37d190){_0x37d190=_0x37d190||0x1f4;return function(_0x4f37e8){logger['error'](_0x4f37e8[_0x44ff('0x28')]);if(_0x4f37e8[_0x44ff('0x29')]){delete _0x4f37e8[_0x44ff('0x29')];}_0x108980[_0x44ff('0x1e')](_0x37d190)[_0x44ff('0x2a')](_0x4f37e8);};}exports['index']=function(_0x231fcd,_0x40102e){var _0x43503e={},_0x5c5f09={},_0x4009ea={'count':0x0,'rows':[]};var _0x2f2437=_[_0x44ff('0x2b')](db[_0x44ff('0x2c')][_0x44ff('0x2d')],function(_0xd6862b){return{'name':_0xd6862b[_0x44ff('0x2e')],'type':_0xd6862b[_0x44ff('0x2f')][_0x44ff('0x30')]};});_0x5c5f09[_0x44ff('0x31')]=_[_0x44ff('0x2b')](_0x2f2437,_0x44ff('0x29'));_0x5c5f09[_0x44ff('0x32')]=_['keys'](_0x231fcd[_0x44ff('0x32')]);_0x5c5f09[_0x44ff('0x33')]=_[_0x44ff('0x34')](_0x5c5f09['model'],_0x5c5f09[_0x44ff('0x32')]);_0x43503e[_0x44ff('0x35')]=_['intersection'](_0x5c5f09[_0x44ff('0x31')],qs[_0x44ff('0x36')](_0x231fcd[_0x44ff('0x32')][_0x44ff('0x36')]));_0x43503e[_0x44ff('0x35')]=_0x43503e[_0x44ff('0x35')][_0x44ff('0x37')]?_0x43503e['attributes']:_0x5c5f09[_0x44ff('0x31')];if(!_0x231fcd[_0x44ff('0x32')][_0x44ff('0x38')](_0x44ff('0x39'))){_0x43503e[_0x44ff('0x1d')]=qs[_0x44ff('0x1d')](_0x231fcd['query'][_0x44ff('0x1d')]);_0x43503e[_0x44ff('0x1a')]=qs[_0x44ff('0x1a')](_0x231fcd[_0x44ff('0x32')]['offset']);}_0x43503e[_0x44ff('0x3a')]=qs[_0x44ff('0x3b')](_0x231fcd[_0x44ff('0x32')][_0x44ff('0x3b')]);_0x43503e[_0x44ff('0x3c')]=qs['filters'](_[_0x44ff('0x3d')](_0x231fcd[_0x44ff('0x32')],_0x5c5f09[_0x44ff('0x33')]),_0x2f2437);if(_0x231fcd[_0x44ff('0x32')][_0x44ff('0x3e')]){_0x43503e[_0x44ff('0x3c')]=_[_0x44ff('0x3f')](_0x43503e[_0x44ff('0x3c')],{'$or':_[_0x44ff('0x2b')](_0x2f2437,function(_0x568c54){if(_0x568c54[_0x44ff('0x2f')]!=='VIRTUAL'){var _0x4b243c={};_0x4b243c[_0x568c54[_0x44ff('0x29')]]={'$like':'%'+_0x231fcd[_0x44ff('0x32')][_0x44ff('0x3e')]+'%'};return _0x4b243c;}})});}_0x43503e=_[_0x44ff('0x3f')]({},_0x43503e,_0x231fcd[_0x44ff('0x40')]);var _0x592bc0={'where':_0x43503e[_0x44ff('0x3c')]};return db['ChatGroup'][_0x44ff('0x1c')](_0x592bc0)['then'](function(_0xb1f7cf){_0x4009ea[_0x44ff('0x1c')]=_0xb1f7cf;if(_0x231fcd[_0x44ff('0x32')][_0x44ff('0x41')]){_0x43503e[_0x44ff('0x42')]=[{'all':!![]}];}return db['ChatGroup'][_0x44ff('0x43')](_0x43503e);})[_0x44ff('0x25')](function(_0x4d675b){_0x4009ea['rows']=_0x4d675b;return _0x4009ea;})[_0x44ff('0x25')](respondWithFilteredResult(_0x40102e,_0x43503e))[_0x44ff('0x44')](handleError(_0x40102e,null));};exports[_0x44ff('0x45')]=function(_0x1e63ad,_0x47ba02){var _0x58c30a={'raw':!![],'where':{'id':_0x1e63ad[_0x44ff('0x46')]['id']}},_0x17cb44={};_0x17cb44['model']=_['keys'](db[_0x44ff('0x2c')]['rawAttributes']);_0x17cb44[_0x44ff('0x32')]=_[_0x44ff('0x47')](_0x1e63ad[_0x44ff('0x32')]);_0x17cb44[_0x44ff('0x33')]=_[_0x44ff('0x34')](_0x17cb44[_0x44ff('0x31')],_0x17cb44[_0x44ff('0x32')]);_0x58c30a[_0x44ff('0x35')]=_[_0x44ff('0x34')](_0x17cb44[_0x44ff('0x31')],qs[_0x44ff('0x36')](_0x1e63ad[_0x44ff('0x32')]['fields']));_0x58c30a[_0x44ff('0x35')]=_0x58c30a[_0x44ff('0x35')]['length']?_0x58c30a[_0x44ff('0x35')]:_0x17cb44[_0x44ff('0x31')];if(_0x1e63ad[_0x44ff('0x32')][_0x44ff('0x41')]){_0x58c30a[_0x44ff('0x42')]=[{'all':!![]}];}_0x58c30a=_[_0x44ff('0x3f')]({},_0x58c30a,_0x1e63ad[_0x44ff('0x40')]);return db['ChatGroup']['find'](_0x58c30a)[_0x44ff('0x25')](handleEntityNotFound(_0x47ba02,null))[_0x44ff('0x25')](respondWithResult(_0x47ba02,null))['catch'](handleError(_0x47ba02,null));};exports[_0x44ff('0x48')]=function(_0x217a91,_0x4ab47b){return db[_0x44ff('0x2c')][_0x44ff('0x48')](_0x217a91['body'],{})['then'](respondWithResult(_0x4ab47b,0xc9))[_0x44ff('0x44')](handleError(_0x4ab47b,null));};exports[_0x44ff('0x24')]=function(_0x32e566,_0x4f2854){if(_0x32e566[_0x44ff('0x49')]['id']){delete _0x32e566[_0x44ff('0x49')]['id'];}return db[_0x44ff('0x2c')][_0x44ff('0x4a')]({'where':{'id':_0x32e566[_0x44ff('0x46')]['id']}})[_0x44ff('0x25')](handleEntityNotFound(_0x4f2854,null))[_0x44ff('0x25')](saveUpdates(_0x32e566[_0x44ff('0x49')],null))[_0x44ff('0x25')](respondWithResult(_0x4f2854,null))[_0x44ff('0x44')](handleError(_0x4f2854,null));};exports[_0x44ff('0x4b')]=function(_0x4839cb,_0x7186ef){return db[_0x44ff('0x2c')][_0x44ff('0x4a')]({'where':{'id':_0x4839cb[_0x44ff('0x46')]['id']}})['then'](handleEntityNotFound(_0x7186ef,null))[_0x44ff('0x25')](removeEntity(_0x7186ef,null))[_0x44ff('0x44')](handleError(_0x7186ef,null));};exports['describe']=function(_0x382d48,_0x19665f){return db['ChatGroup'][_0x44ff('0x4c')]()[_0x44ff('0x25')](respondWithResult(_0x19665f,null))[_0x44ff('0x44')](handleError(_0x19665f,null));};exports[_0x44ff('0x4d')]=function(_0x36f45f,_0x3551f7,_0x1ba7e1){return db[_0x44ff('0x4e')]['count']({'where':{'ChatGroupId':_0x36f45f['params']['id'],'ToId':_0x36f45f[_0x44ff('0x4f')]['id'],'read':![]}})[_0x44ff('0x25')](function(_0x3dc1ae){return{'id':_['toInteger'](_0x36f45f['params']['id']),'count':_0x3dc1ae};})[_0x44ff('0x25')](respondWithResult(_0x3551f7,null))['catch'](handleError(_0x3551f7,null));};exports['addMembers']=function(_0x37550f,_0x3371ec,_0x194d5d){return db[_0x44ff('0x2c')][_0x44ff('0x4a')]({'where':{'id':_0x37550f[_0x44ff('0x46')]['id']}})[_0x44ff('0x25')](handleEntityNotFound(_0x3371ec,null))[_0x44ff('0x25')](function(_0x5525e8){if(_0x5525e8){return _0x5525e8[_0x44ff('0x50')](_0x37550f[_0x44ff('0x49')]['ids'],_['omit'](_0x37550f['body'],['ids','id'])||{});}})[_0x44ff('0x25')](respondWithResult(_0x3371ec,null))[_0x44ff('0x44')](handleError(_0x3371ec,null));};exports['getMembers']=function(_0x181e46,_0x469a5d,_0x467cfd){var _0x5b833d={};var _0x2baa2e={};var _0x5851dc;var _0x49bd8a;return db[_0x44ff('0x2c')][_0x44ff('0x51')]({'where':{'id':_0x181e46[_0x44ff('0x46')]['id']}})['then'](handleEntityNotFound(_0x469a5d,null))[_0x44ff('0x25')](function(_0x3a9122){if(_0x3a9122){_0x5851dc=_0x3a9122;_0x2baa2e[_0x44ff('0x31')]=_[_0x44ff('0x47')](db[_0x44ff('0x52')][_0x44ff('0x2d')]);_0x2baa2e[_0x44ff('0x32')]=_[_0x44ff('0x47')](_0x181e46[_0x44ff('0x32')]);_0x2baa2e[_0x44ff('0x33')]=_[_0x44ff('0x34')](_0x2baa2e[_0x44ff('0x31')],_0x2baa2e['query']);_0x5b833d[_0x44ff('0x35')]=_[_0x44ff('0x34')](_0x2baa2e[_0x44ff('0x31')],qs[_0x44ff('0x36')](_0x181e46[_0x44ff('0x32')]['fields']));_0x5b833d['attributes']=_0x5b833d['attributes'][_0x44ff('0x37')]?_0x5b833d[_0x44ff('0x35')]:_0x2baa2e[_0x44ff('0x31')];_0x5b833d[_0x44ff('0x3a')]=qs['sort'](_0x181e46['query'][_0x44ff('0x3b')]);_0x5b833d[_0x44ff('0x3c')]=qs[_0x44ff('0x33')](_['pick'](_0x181e46[_0x44ff('0x32')],_0x2baa2e[_0x44ff('0x33')]));if(_0x181e46[_0x44ff('0x32')][_0x44ff('0x3e')]){_0x5b833d[_0x44ff('0x3c')]=_[_0x44ff('0x3f')](_0x5b833d['where'],{'$or':_['map'](_0x5b833d[_0x44ff('0x35')],function(_0x4a1a04){var _0x59726b={};_0x59726b[_0x4a1a04]={'$like':'%'+_0x181e46[_0x44ff('0x32')][_0x44ff('0x3e')]+'%'};return _0x59726b;})});}_0x5b833d=_[_0x44ff('0x3f')]({},_0x5b833d,_0x181e46[_0x44ff('0x40')]);return _0x5851dc[_0x44ff('0x53')](_0x5b833d);}})[_0x44ff('0x25')](function(_0x5e96d9){if(_0x5e96d9){_0x49bd8a=_0x5e96d9[_0x44ff('0x37')];if(!_0x181e46[_0x44ff('0x32')][_0x44ff('0x38')](_0x44ff('0x39'))){_0x5b833d[_0x44ff('0x1d')]=qs[_0x44ff('0x1d')](_0x181e46[_0x44ff('0x32')][_0x44ff('0x1d')]);_0x5b833d['offset']=qs['offset'](_0x181e46[_0x44ff('0x32')][_0x44ff('0x1a')]);}return _0x5851dc[_0x44ff('0x53')](_0x5b833d);}})[_0x44ff('0x25')](function(_0x581eb1){if(_0x581eb1){return _0x581eb1?{'count':_0x49bd8a,'rows':_0x581eb1}:null;}})[_0x44ff('0x25')](respondWithResult(_0x469a5d,null))['catch'](handleError(_0x469a5d,null));};exports[_0x44ff('0x54')]=function(_0x215aec,_0x51dc3c,_0x152767){return db['ChatGroup'][_0x44ff('0x4a')]({'where':{'id':_0x215aec[_0x44ff('0x46')]['id']}})[_0x44ff('0x25')](handleEntityNotFound(_0x51dc3c,null))[_0x44ff('0x25')](function(_0x14398e){if(_0x14398e){return _0x14398e[_0x44ff('0x54')](_0x215aec[_0x44ff('0x32')][_0x44ff('0x55')]);}})[_0x44ff('0x25')](respondWithStatusCode(_0x51dc3c,null))[_0x44ff('0x44')](handleError(_0x51dc3c,null));};exports[_0x44ff('0x56')]=function(_0x45bb7f,_0x5d6cfc,_0x1da339){if(_0x45bb7f[_0x44ff('0x49')]['id']){delete _0x45bb7f['body']['id'];}return db[_0x44ff('0x2c')][_0x44ff('0x4a')]({'where':{'id':_0x45bb7f[_0x44ff('0x46')]['id']}})[_0x44ff('0x25')](handleEntityNotFound(_0x5d6cfc,null))[_0x44ff('0x25')](function(_0x3f83b0){if(_0x3f83b0){_0x45bb7f['body'][_0x44ff('0x57')]=_0x3f83b0['id'];return db[_0x44ff('0x4e')][_0x44ff('0x48')](_0x45bb7f['body']);}})[_0x44ff('0x25')](respondWithResult(_0x5d6cfc,null))[_0x44ff('0x44')](handleError(_0x5d6cfc,null));};exports[_0x44ff('0x58')]=function(_0x193b4b,_0x594442,_0x55bf4c){var _0xe4ae2b={};var _0x16c073={};var _0x3ef899;var _0x5939ca;return db[_0x44ff('0x2c')]['findOne']({'where':{'id':_0x193b4b[_0x44ff('0x46')]['id']}})[_0x44ff('0x25')](handleEntityNotFound(_0x594442,null))[_0x44ff('0x25')](function(_0x53742a){if(_0x53742a){_0x3ef899=_0x53742a;_0x16c073[_0x44ff('0x31')]=_['keys'](db[_0x44ff('0x4e')][_0x44ff('0x2d')]);_0x16c073[_0x44ff('0x32')]=_[_0x44ff('0x47')](_0x193b4b['query']);_0x16c073[_0x44ff('0x33')]=_[_0x44ff('0x34')](_0x16c073[_0x44ff('0x31')],_0x16c073[_0x44ff('0x32')]);_0xe4ae2b[_0x44ff('0x35')]=_['intersection'](_0x16c073[_0x44ff('0x31')],qs[_0x44ff('0x36')](_0x193b4b[_0x44ff('0x32')][_0x44ff('0x36')]));_0xe4ae2b[_0x44ff('0x35')]=_0xe4ae2b[_0x44ff('0x35')][_0x44ff('0x37')]?_0xe4ae2b[_0x44ff('0x35')]:_0x16c073[_0x44ff('0x31')];_0xe4ae2b[_0x44ff('0x3a')]=qs[_0x44ff('0x3b')](_0x193b4b[_0x44ff('0x32')]['sort']);_0xe4ae2b[_0x44ff('0x3c')]=qs[_0x44ff('0x33')](_[_0x44ff('0x3d')](_0x193b4b[_0x44ff('0x32')],_0x16c073[_0x44ff('0x33')]));if(_0x193b4b['query'][_0x44ff('0x3e')]){_0xe4ae2b['where']=_[_0x44ff('0x3f')](_0xe4ae2b['where'],{'$or':_[_0x44ff('0x2b')](_0xe4ae2b[_0x44ff('0x35')],function(_0x3eb320){var _0x29e7fd={};_0x29e7fd[_0x3eb320]={'$like':'%'+_0x193b4b['query'][_0x44ff('0x3e')]+'%'};return _0x29e7fd;})});}if(_0x193b4b[_0x44ff('0x32')][_0x44ff('0x59')]){var _0x564e44=_0x193b4b[_0x44ff('0x32')][_0x44ff('0x59')][_0x44ff('0x5a')](',');var _0x35a466={};_0x35a466[_0x564e44[0x0]]={'$gte':moment(_0x564e44[0x1])[_0x44ff('0x5b')](_0x44ff('0x5c'))};_0xe4ae2b['where']=_[_0x44ff('0x3f')](_0xe4ae2b[_0x44ff('0x3c')],_0x35a466);}_0xe4ae2b=_[_0x44ff('0x3f')]({},_0xe4ae2b,_0x193b4b[_0x44ff('0x40')]);return _0x3ef899['getMessages'](_0xe4ae2b);}})[_0x44ff('0x25')](function(_0x2e44ec){if(_0x2e44ec){_0x5939ca=_0x2e44ec[_0x44ff('0x37')];if(!_0x193b4b[_0x44ff('0x32')][_0x44ff('0x38')](_0x44ff('0x39'))){_0xe4ae2b[_0x44ff('0x1d')]=qs[_0x44ff('0x1d')](_0x193b4b[_0x44ff('0x32')][_0x44ff('0x1d')]);_0xe4ae2b[_0x44ff('0x1a')]=qs[_0x44ff('0x1a')](_0x193b4b[_0x44ff('0x32')][_0x44ff('0x1a')]);}return _0x3ef899['getMessages'](_0xe4ae2b);}})['then'](function(_0x116715){if(_0x116715){return _0x116715?{'count':_0x5939ca,'rows':_0x116715}:null;}})[_0x44ff('0x25')](respondWithResult(_0x594442,null))[_0x44ff('0x44')](handleError(_0x594442,null));};
\ No newline at end of file
+var _0x4d1e=['create','update','body','describe','ChatInternalMessage','user','addMembers','ids','findOne','User','getMembers','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','name','send','index','map','ChatGroup','rawAttributes','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','length','include','find','catch'];(function(_0x3bb02b,_0x10dac8){var _0x511672=function(_0xad7efb){while(--_0xad7efb){_0x3bb02b['push'](_0x3bb02b['shift']());}};_0x511672(++_0x10dac8);}(_0x4d1e,0xd5));var _0xe4d1=function(_0x595604,_0x2cc998){_0x595604=_0x595604-0x0;var _0x1466f3=_0x4d1e[_0x595604];return _0x1466f3;};'use strict';var emlformat=require(_0xe4d1('0x0'));var rimraf=require(_0xe4d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe4d1('0x2'));var rp=require(_0xe4d1('0x3'));var moment=require(_0xe4d1('0x4'));var BPromise=require(_0xe4d1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe4d1('0x6'));var sox=require(_0xe4d1('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe4d1('0x8'));var _=require(_0xe4d1('0x9'));var squel=require(_0xe4d1('0xa'));var crypto=require(_0xe4d1('0xb'));var jsforce=require(_0xe4d1('0xc'));var deskjs=require(_0xe4d1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe4d1('0xe'));var Papa=require(_0xe4d1('0xf'));var Redis=require('ioredis');var authService=require(_0xe4d1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe4d1('0x11'));var hardwareService=require(_0xe4d1('0x12'));var logger=require(_0xe4d1('0x13'))(_0xe4d1('0x14'));var utils=require(_0xe4d1('0x15'));var config=require(_0xe4d1('0x16'));var licenseUtil=require(_0xe4d1('0x17'));var db=require(_0xe4d1('0x18'))['db'];config[_0xe4d1('0x19')]=_['defaults'](config[_0xe4d1('0x19')],{'host':_0xe4d1('0x1a'),'port':0x18eb});var socket=require(_0xe4d1('0x1b'))(new Redis(config[_0xe4d1('0x19')]));require(_0xe4d1('0x1c'))[_0xe4d1('0x1d')](socket);function respondWithStatusCode(_0x4b0100,_0x43fe8d){_0x43fe8d=_0x43fe8d||0xcc;return function(_0xa08579){if(_0xa08579){return _0x4b0100[_0xe4d1('0x1e')](_0x43fe8d);}return _0x4b0100[_0xe4d1('0x1f')](_0x43fe8d)[_0xe4d1('0x20')]();};}function respondWithResult(_0x4cdcb7,_0x1ad8fa){_0x1ad8fa=_0x1ad8fa||0xc8;return function(_0x3efafd){if(_0x3efafd){return _0x4cdcb7[_0xe4d1('0x1f')](_0x1ad8fa)[_0xe4d1('0x21')](_0x3efafd);}};}function respondWithFilteredResult(_0x170d02,_0xd820d1){return function(_0x133f12){if(_0x133f12){var _0x242e59=typeof _0xd820d1[_0xe4d1('0x22')]===_0xe4d1('0x23')&&typeof _0xd820d1[_0xe4d1('0x24')]===_0xe4d1('0x23');var _0x276be7=_0x133f12[_0xe4d1('0x25')];var _0x27cfbc=_0x242e59?0x0:_0xd820d1[_0xe4d1('0x22')];var _0x4cb63f=_0x242e59?_0x133f12[_0xe4d1('0x25')]:_0xd820d1['offset']+_0xd820d1[_0xe4d1('0x24')];var _0x334580;if(_0x4cb63f>=_0x276be7){_0x4cb63f=_0x276be7;_0x334580=0xc8;}else{_0x334580=0xce;}_0x170d02[_0xe4d1('0x1f')](_0x334580);return _0x170d02[_0xe4d1('0x26')](_0xe4d1('0x27'),_0x27cfbc+'-'+_0x4cb63f+'/'+_0x276be7)[_0xe4d1('0x21')](_0x133f12);}return null;};}function patchUpdates(_0x54fdc9){return function(_0x5f1d60){try{jsonpatch[_0xe4d1('0x28')](_0x5f1d60,_0x54fdc9,!![]);}catch(_0x151c9c){return BPromise[_0xe4d1('0x29')](_0x151c9c);}return _0x5f1d60[_0xe4d1('0x2a')]();};}function saveUpdates(_0x3bf4fe,_0x45d6d2){return function(_0x58d919){if(_0x58d919){return _0x58d919['update'](_0x3bf4fe)['then'](function(_0x127d15){return _0x127d15;});}return null;};}function removeEntity(_0x1339e1,_0x57fad2){return function(_0x2585e6){if(_0x2585e6){return _0x2585e6[_0xe4d1('0x2b')]()[_0xe4d1('0x2c')](function(){_0x1339e1[_0xe4d1('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cc4b6,_0x1223d6){return function(_0x2cdfde){if(!_0x2cdfde){_0x4cc4b6[_0xe4d1('0x1e')](0x194);}return _0x2cdfde;};}function handleError(_0x482be7,_0x4a9464){_0x4a9464=_0x4a9464||0x1f4;return function(_0x29e3a0){logger['error'](_0x29e3a0['stack']);if(_0x29e3a0[_0xe4d1('0x2d')]){delete _0x29e3a0[_0xe4d1('0x2d')];}_0x482be7[_0xe4d1('0x1f')](_0x4a9464)[_0xe4d1('0x2e')](_0x29e3a0);};}exports[_0xe4d1('0x2f')]=function(_0x3ffe9e,_0x27b68f){var _0x55b40e={},_0xda8b29={},_0x2428c7={'count':0x0,'rows':[]};var _0x5a0dad=_[_0xe4d1('0x30')](db[_0xe4d1('0x31')][_0xe4d1('0x32')],function(_0x582f42){return{'name':_0x582f42['fieldName'],'type':_0x582f42['type'][_0xe4d1('0x33')]};});_0xda8b29[_0xe4d1('0x34')]=_[_0xe4d1('0x30')](_0x5a0dad,_0xe4d1('0x2d'));_0xda8b29[_0xe4d1('0x35')]=_['keys'](_0x3ffe9e['query']);_0xda8b29[_0xe4d1('0x36')]=_[_0xe4d1('0x37')](_0xda8b29[_0xe4d1('0x34')],_0xda8b29[_0xe4d1('0x35')]);_0x55b40e[_0xe4d1('0x38')]=_['intersection'](_0xda8b29['model'],qs['fields'](_0x3ffe9e[_0xe4d1('0x35')][_0xe4d1('0x39')]));_0x55b40e[_0xe4d1('0x38')]=_0x55b40e[_0xe4d1('0x38')]['length']?_0x55b40e[_0xe4d1('0x38')]:_0xda8b29[_0xe4d1('0x34')];if(!_0x3ffe9e['query']['hasOwnProperty'](_0xe4d1('0x3a'))){_0x55b40e[_0xe4d1('0x24')]=qs[_0xe4d1('0x24')](_0x3ffe9e[_0xe4d1('0x35')][_0xe4d1('0x24')]);_0x55b40e['offset']=qs[_0xe4d1('0x22')](_0x3ffe9e[_0xe4d1('0x35')][_0xe4d1('0x22')]);}_0x55b40e[_0xe4d1('0x3b')]=qs[_0xe4d1('0x3c')](_0x3ffe9e[_0xe4d1('0x35')][_0xe4d1('0x3c')]);_0x55b40e[_0xe4d1('0x3d')]=qs['filters'](_[_0xe4d1('0x3e')](_0x3ffe9e['query'],_0xda8b29['filters']),_0x5a0dad);if(_0x3ffe9e['query'][_0xe4d1('0x3f')]){_0x55b40e['where']=_[_0xe4d1('0x40')](_0x55b40e[_0xe4d1('0x3d')],{'$or':_[_0xe4d1('0x30')](_0x5a0dad,function(_0x48fab4){if(_0x48fab4[_0xe4d1('0x41')]!==_0xe4d1('0x42')){var _0x387c17={};_0x387c17[_0x48fab4[_0xe4d1('0x2d')]]={'$like':'%'+_0x3ffe9e[_0xe4d1('0x35')]['filter']+'%'};return _0x387c17;}})});}_0x55b40e=_[_0xe4d1('0x40')]({},_0x55b40e,_0x3ffe9e[_0xe4d1('0x43')]);var _0x56dde1={'where':_0x55b40e[_0xe4d1('0x3d')]};return db['ChatGroup']['count'](_0x56dde1)['then'](function(_0x3dcb11){_0x2428c7['count']=_0x3dcb11;if(_0x3ffe9e[_0xe4d1('0x35')][_0xe4d1('0x44')]){_0x55b40e['include']=[{'all':!![]}];}return db[_0xe4d1('0x31')][_0xe4d1('0x45')](_0x55b40e);})[_0xe4d1('0x2c')](function(_0x1190ee){_0x2428c7[_0xe4d1('0x46')]=_0x1190ee;return _0x2428c7;})[_0xe4d1('0x2c')](respondWithFilteredResult(_0x27b68f,_0x55b40e))['catch'](handleError(_0x27b68f,null));};exports[_0xe4d1('0x47')]=function(_0x3f29e6,_0x3034e5){var _0x1bb394={'raw':!![],'where':{'id':_0x3f29e6[_0xe4d1('0x48')]['id']}},_0xc6c416={};_0xc6c416[_0xe4d1('0x34')]=_[_0xe4d1('0x49')](db[_0xe4d1('0x31')]['rawAttributes']);_0xc6c416['query']=_['keys'](_0x3f29e6[_0xe4d1('0x35')]);_0xc6c416['filters']=_[_0xe4d1('0x37')](_0xc6c416[_0xe4d1('0x34')],_0xc6c416[_0xe4d1('0x35')]);_0x1bb394[_0xe4d1('0x38')]=_[_0xe4d1('0x37')](_0xc6c416[_0xe4d1('0x34')],qs[_0xe4d1('0x39')](_0x3f29e6[_0xe4d1('0x35')][_0xe4d1('0x39')]));_0x1bb394[_0xe4d1('0x38')]=_0x1bb394[_0xe4d1('0x38')][_0xe4d1('0x4a')]?_0x1bb394[_0xe4d1('0x38')]:_0xc6c416[_0xe4d1('0x34')];if(_0x3f29e6[_0xe4d1('0x35')][_0xe4d1('0x44')]){_0x1bb394[_0xe4d1('0x4b')]=[{'all':!![]}];}_0x1bb394=_[_0xe4d1('0x40')]({},_0x1bb394,_0x3f29e6[_0xe4d1('0x43')]);return db['ChatGroup'][_0xe4d1('0x4c')](_0x1bb394)[_0xe4d1('0x2c')](handleEntityNotFound(_0x3034e5,null))[_0xe4d1('0x2c')](respondWithResult(_0x3034e5,null))[_0xe4d1('0x4d')](handleError(_0x3034e5,null));};exports['create']=function(_0x25348e,_0xeb6338){return db[_0xe4d1('0x31')][_0xe4d1('0x4e')](_0x25348e['body'],{})['then'](respondWithResult(_0xeb6338,0xc9))[_0xe4d1('0x4d')](handleError(_0xeb6338,null));};exports[_0xe4d1('0x4f')]=function(_0x5a6ef9,_0x1afb06){if(_0x5a6ef9[_0xe4d1('0x50')]['id']){delete _0x5a6ef9[_0xe4d1('0x50')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x5a6ef9[_0xe4d1('0x48')]['id']}})[_0xe4d1('0x2c')](handleEntityNotFound(_0x1afb06,null))[_0xe4d1('0x2c')](saveUpdates(_0x5a6ef9[_0xe4d1('0x50')],null))[_0xe4d1('0x2c')](respondWithResult(_0x1afb06,null))[_0xe4d1('0x4d')](handleError(_0x1afb06,null));};exports[_0xe4d1('0x2b')]=function(_0x19c181,_0x16d4e1){return db[_0xe4d1('0x31')]['find']({'where':{'id':_0x19c181[_0xe4d1('0x48')]['id']}})['then'](handleEntityNotFound(_0x16d4e1,null))[_0xe4d1('0x2c')](removeEntity(_0x16d4e1,null))[_0xe4d1('0x4d')](handleError(_0x16d4e1,null));};exports[_0xe4d1('0x51')]=function(_0x1fc659,_0x136051){return db[_0xe4d1('0x31')][_0xe4d1('0x51')]()[_0xe4d1('0x2c')](respondWithResult(_0x136051,null))[_0xe4d1('0x4d')](handleError(_0x136051,null));};exports['getUnread']=function(_0x52587b,_0x4dbcbc,_0x4473c5){return db[_0xe4d1('0x52')][_0xe4d1('0x25')]({'where':{'ChatGroupId':_0x52587b[_0xe4d1('0x48')]['id'],'ToId':_0x52587b[_0xe4d1('0x53')]['id'],'read':![]}})['then'](function(_0x2f9a96){return{'id':_['toInteger'](_0x52587b['params']['id']),'count':_0x2f9a96};})['then'](respondWithResult(_0x4dbcbc,null))[_0xe4d1('0x4d')](handleError(_0x4dbcbc,null));};exports[_0xe4d1('0x54')]=function(_0x330d7f,_0xfbf24c,_0x2c16f6){return db[_0xe4d1('0x31')][_0xe4d1('0x4c')]({'where':{'id':_0x330d7f['params']['id']}})[_0xe4d1('0x2c')](handleEntityNotFound(_0xfbf24c,null))[_0xe4d1('0x2c')](function(_0xf8983c){if(_0xf8983c){return _0xf8983c['addMembers'](_0x330d7f[_0xe4d1('0x50')][_0xe4d1('0x55')],_['omit'](_0x330d7f[_0xe4d1('0x50')],[_0xe4d1('0x55'),'id'])||{});}})[_0xe4d1('0x2c')](respondWithResult(_0xfbf24c,null))[_0xe4d1('0x4d')](handleError(_0xfbf24c,null));};exports['getMembers']=function(_0x2ce87c,_0x1043bc,_0x3bf383){var _0xc4114f={};var _0x4013e8={};var _0x3e5e2c;var _0x5faa93;return db[_0xe4d1('0x31')][_0xe4d1('0x56')]({'where':{'id':_0x2ce87c['params']['id']}})['then'](handleEntityNotFound(_0x1043bc,null))[_0xe4d1('0x2c')](function(_0xe30d5a){if(_0xe30d5a){_0x3e5e2c=_0xe30d5a;_0x4013e8[_0xe4d1('0x34')]=_[_0xe4d1('0x49')](db[_0xe4d1('0x57')][_0xe4d1('0x32')]);_0x4013e8[_0xe4d1('0x35')]=_[_0xe4d1('0x49')](_0x2ce87c[_0xe4d1('0x35')]);_0x4013e8[_0xe4d1('0x36')]=_[_0xe4d1('0x37')](_0x4013e8[_0xe4d1('0x34')],_0x4013e8[_0xe4d1('0x35')]);_0xc4114f[_0xe4d1('0x38')]=_[_0xe4d1('0x37')](_0x4013e8[_0xe4d1('0x34')],qs[_0xe4d1('0x39')](_0x2ce87c[_0xe4d1('0x35')][_0xe4d1('0x39')]));_0xc4114f[_0xe4d1('0x38')]=_0xc4114f[_0xe4d1('0x38')][_0xe4d1('0x4a')]?_0xc4114f[_0xe4d1('0x38')]:_0x4013e8['model'];_0xc4114f[_0xe4d1('0x3b')]=qs[_0xe4d1('0x3c')](_0x2ce87c[_0xe4d1('0x35')]['sort']);_0xc4114f[_0xe4d1('0x3d')]=qs[_0xe4d1('0x36')](_[_0xe4d1('0x3e')](_0x2ce87c['query'],_0x4013e8[_0xe4d1('0x36')]));if(_0x2ce87c[_0xe4d1('0x35')][_0xe4d1('0x3f')]){_0xc4114f[_0xe4d1('0x3d')]=_['merge'](_0xc4114f[_0xe4d1('0x3d')],{'$or':_[_0xe4d1('0x30')](_0xc4114f[_0xe4d1('0x38')],function(_0x28f72f){var _0x3e4325={};_0x3e4325[_0x28f72f]={'$like':'%'+_0x2ce87c[_0xe4d1('0x35')][_0xe4d1('0x3f')]+'%'};return _0x3e4325;})});}_0xc4114f=_[_0xe4d1('0x40')]({},_0xc4114f,_0x2ce87c[_0xe4d1('0x43')]);return _0x3e5e2c[_0xe4d1('0x58')](_0xc4114f);}})[_0xe4d1('0x2c')](function(_0x160de3){if(_0x160de3){_0x5faa93=_0x160de3[_0xe4d1('0x4a')];if(!_0x2ce87c[_0xe4d1('0x35')][_0xe4d1('0x59')]('nolimit')){_0xc4114f[_0xe4d1('0x24')]=qs['limit'](_0x2ce87c[_0xe4d1('0x35')][_0xe4d1('0x24')]);_0xc4114f[_0xe4d1('0x22')]=qs[_0xe4d1('0x22')](_0x2ce87c[_0xe4d1('0x35')]['offset']);}return _0x3e5e2c[_0xe4d1('0x58')](_0xc4114f);}})[_0xe4d1('0x2c')](function(_0x6e7ddc){if(_0x6e7ddc){return _0x6e7ddc?{'count':_0x5faa93,'rows':_0x6e7ddc}:null;}})[_0xe4d1('0x2c')](respondWithResult(_0x1043bc,null))[_0xe4d1('0x4d')](handleError(_0x1043bc,null));};exports[_0xe4d1('0x5a')]=function(_0x21bcd0,_0x8cfc33,_0x1544db){return db[_0xe4d1('0x31')][_0xe4d1('0x4c')]({'where':{'id':_0x21bcd0['params']['id']}})[_0xe4d1('0x2c')](handleEntityNotFound(_0x8cfc33,null))[_0xe4d1('0x2c')](function(_0x23ded2){if(_0x23ded2){return _0x23ded2[_0xe4d1('0x5a')](_0x21bcd0[_0xe4d1('0x35')]['ids']);}})[_0xe4d1('0x2c')](respondWithStatusCode(_0x8cfc33,null))[_0xe4d1('0x4d')](handleError(_0x8cfc33,null));};exports[_0xe4d1('0x5b')]=function(_0x1d5a7d,_0x21f45f,_0x3de18f){if(_0x1d5a7d[_0xe4d1('0x50')]['id']){delete _0x1d5a7d[_0xe4d1('0x50')]['id'];}return db['ChatGroup'][_0xe4d1('0x4c')]({'where':{'id':_0x1d5a7d['params']['id']}})[_0xe4d1('0x2c')](handleEntityNotFound(_0x21f45f,null))[_0xe4d1('0x2c')](function(_0x2f676e){if(_0x2f676e){_0x1d5a7d['body'][_0xe4d1('0x5c')]=_0x2f676e['id'];return db[_0xe4d1('0x52')][_0xe4d1('0x4e')](_0x1d5a7d[_0xe4d1('0x50')]);}})[_0xe4d1('0x2c')](respondWithResult(_0x21f45f,null))[_0xe4d1('0x4d')](handleError(_0x21f45f,null));};exports[_0xe4d1('0x5d')]=function(_0x2d1b49,_0xaf3d5,_0x7484ba){var _0x4fbdba={};var _0x7c9706={};var _0x523ca1;var _0x20f955;return db[_0xe4d1('0x31')][_0xe4d1('0x56')]({'where':{'id':_0x2d1b49[_0xe4d1('0x48')]['id']}})['then'](handleEntityNotFound(_0xaf3d5,null))[_0xe4d1('0x2c')](function(_0xf9e316){if(_0xf9e316){_0x523ca1=_0xf9e316;_0x7c9706[_0xe4d1('0x34')]=_[_0xe4d1('0x49')](db[_0xe4d1('0x52')]['rawAttributes']);_0x7c9706['query']=_['keys'](_0x2d1b49[_0xe4d1('0x35')]);_0x7c9706['filters']=_[_0xe4d1('0x37')](_0x7c9706[_0xe4d1('0x34')],_0x7c9706['query']);_0x4fbdba[_0xe4d1('0x38')]=_[_0xe4d1('0x37')](_0x7c9706['model'],qs['fields'](_0x2d1b49[_0xe4d1('0x35')]['fields']));_0x4fbdba[_0xe4d1('0x38')]=_0x4fbdba[_0xe4d1('0x38')]['length']?_0x4fbdba['attributes']:_0x7c9706[_0xe4d1('0x34')];_0x4fbdba['order']=qs['sort'](_0x2d1b49[_0xe4d1('0x35')]['sort']);_0x4fbdba['where']=qs[_0xe4d1('0x36')](_[_0xe4d1('0x3e')](_0x2d1b49['query'],_0x7c9706[_0xe4d1('0x36')]));if(_0x2d1b49[_0xe4d1('0x35')]['filter']){_0x4fbdba[_0xe4d1('0x3d')]=_[_0xe4d1('0x40')](_0x4fbdba['where'],{'$or':_[_0xe4d1('0x30')](_0x4fbdba[_0xe4d1('0x38')],function(_0x4dbca9){var _0x37fa2c={};_0x37fa2c[_0x4dbca9]={'$like':'%'+_0x2d1b49[_0xe4d1('0x35')][_0xe4d1('0x3f')]+'%'};return _0x37fa2c;})});}if(_0x2d1b49[_0xe4d1('0x35')][_0xe4d1('0x5e')]){var _0x36ea2d=_0x2d1b49[_0xe4d1('0x35')]['$gte']['split'](',');var _0x47e745={};_0x47e745[_0x36ea2d[0x0]]={'$gte':moment(_0x36ea2d[0x1])[_0xe4d1('0x5f')](_0xe4d1('0x60'))};_0x4fbdba[_0xe4d1('0x3d')]=_[_0xe4d1('0x40')](_0x4fbdba[_0xe4d1('0x3d')],_0x47e745);}_0x4fbdba=_[_0xe4d1('0x40')]({},_0x4fbdba,_0x2d1b49[_0xe4d1('0x43')]);return _0x523ca1['getMessages'](_0x4fbdba);}})[_0xe4d1('0x2c')](function(_0x1cbdd0){if(_0x1cbdd0){_0x20f955=_0x1cbdd0[_0xe4d1('0x4a')];if(!_0x2d1b49['query'][_0xe4d1('0x59')](_0xe4d1('0x3a'))){_0x4fbdba[_0xe4d1('0x24')]=qs['limit'](_0x2d1b49[_0xe4d1('0x35')][_0xe4d1('0x24')]);_0x4fbdba[_0xe4d1('0x22')]=qs[_0xe4d1('0x22')](_0x2d1b49['query'][_0xe4d1('0x22')]);}return _0x523ca1['getMessages'](_0x4fbdba);}})[_0xe4d1('0x2c')](function(_0x2093ab){if(_0x2093ab){return _0x2093ab?{'count':_0x20f955,'rows':_0x2093ab}:null;}})['then'](respondWithResult(_0xaf3d5,null))[_0xe4d1('0x4d')](handleError(_0xaf3d5,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index fb256f7..e46a145 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 _0xdf55=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x56900e,_0x1cff34){var _0x1a3d71=function(_0x1699f9){while(--_0x1699f9){_0x56900e['push'](_0x56900e['shift']());}};_0x1a3d71(++_0x1cff34);}(_0xdf55,0x83));var _0x5df5=function(_0x17cdd6,_0x94ae6d){_0x17cdd6=_0x17cdd6-0x0;var _0x42970a=_0xdf55[_0x17cdd6];return _0x42970a;};'use strict';var EventEmitter=require(_0x5df5('0x0'));var ChatGroup=require(_0x5df5('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5df5('0x2')](0x0);var events={'afterCreate':_0x5df5('0x3'),'afterUpdate':'update','afterDestroy':_0x5df5('0x4')};function emitEvent(_0x773e15){return function(_0x381a4c,_0x521007,_0x289af4){ChatGroupEvents[_0x5df5('0x5')](_0x773e15+':'+_0x381a4c['id'],_0x381a4c);ChatGroupEvents[_0x5df5('0x5')](_0x773e15,_0x381a4c);_0x289af4(null);};}for(var e in events){if(events[_0x5df5('0x6')](e)){var event=events[e];ChatGroup[_0x5df5('0x7')](e,emitEvent(event));}}module[_0x5df5('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x0ce9=['hook','events','../../mysqldb','ChatGroup','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x5d9538,_0x3ffeb5){var _0x19cf14=function(_0xe0349a){while(--_0xe0349a){_0x5d9538['push'](_0x5d9538['shift']());}};_0x19cf14(++_0x3ffeb5);}(_0x0ce9,0x9a));var _0x90ce=function(_0x1adbd1,_0x130e7c){_0x1adbd1=_0x1adbd1-0x0;var _0x100ca5=_0x0ce9[_0x1adbd1];return _0x100ca5;};'use strict';var EventEmitter=require(_0x90ce('0x0'));var ChatGroup=require(_0x90ce('0x1'))['db'][_0x90ce('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x90ce('0x3')](0x0);var events={'afterCreate':_0x90ce('0x4'),'afterUpdate':'update','afterDestroy':_0x90ce('0x5')};function emitEvent(_0x1e969e){return function(_0x1c18e0,_0x595446,_0x19202a){ChatGroupEvents[_0x90ce('0x6')](_0x1e969e+':'+_0x1c18e0['id'],_0x1c18e0);ChatGroupEvents[_0x90ce('0x6')](_0x1e969e,_0x1c18e0);_0x19202a(null);};}for(var e in events){if(events[_0x90ce('0x7')](e)){var event=events[e];ChatGroup[_0x90ce('0x8')](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 280e702..cd714dd 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 _0xff7d=['api','moment','bluebird','request-promise','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','util'];(function(_0xca0f4f,_0x59bb30){var _0x4c53f6=function(_0x414ca1){while(--_0x414ca1){_0xca0f4f['push'](_0xca0f4f['shift']());}};_0x4c53f6(++_0x59bb30);}(_0xff7d,0x18e));var _0xdff7=function(_0x2cdf33,_0x1e69e6){_0x2cdf33=_0x2cdf33-0x0;var _0x1a83dc=_0xff7d[_0x2cdf33];return _0x1a83dc;};'use strict';var _=require(_0xdff7('0x0'));var util=require(_0xdff7('0x1'));var logger=require('../../config/logger')(_0xdff7('0x2'));var moment=require(_0xdff7('0x3'));var BPromise=require(_0xdff7('0x4'));var rp=require(_0xdff7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdff7('0x6'));module['exports']=function(_0x35c482,_0x409ec7){return _0x35c482[_0xdff7('0x7')](_0xdff7('0x8'),attributes,{'tableName':_0xdff7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2831=['chat_groups','lodash','api','bluebird','request-promise','path','./chatGroup.attributes','define','ChatGroup'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x2831,0xa3));var _0x1283=function(_0x1b353c,_0x493626){_0x1b353c=_0x1b353c-0x0;var _0x3a261f=_0x2831[_0x1b353c];return _0x3a261f;};'use strict';var _=require(_0x1283('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1283('0x1'));var moment=require('moment');var BPromise=require(_0x1283('0x2'));var rp=require(_0x1283('0x3'));var fs=require('fs');var path=require(_0x1283('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1283('0x5'));module['exports']=function(_0x70bbd1,_0x23907d){return _0x70bbd1[_0x1283('0x6')](_0x1283('0x7'),attributes,{'tableName':_0x1283('0x8'),'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 f9ab5b0..f6197d3 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 _0x8388=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x120295,_0x103efe){var _0x13a826=function(_0x5308be){while(--_0x5308be){_0x120295['push'](_0x120295['shift']());}};_0x13a826(++_0x103efe);}(_0x8388,0x18d));var _0x8838=function(_0x4854d6,_0x2f1264){_0x4854d6=_0x4854d6-0x0;var _0x3885c0=_0x8388[_0x4854d6];return _0x3885c0;};'use strict';var _=require(_0x8838('0x0'));var util=require(_0x8838('0x1'));var moment=require(_0x8838('0x2'));var BPromise=require(_0x8838('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8838('0x4'));var db=require(_0x8838('0x5'))['db'];var utils=require(_0x8838('0x6'));var logger=require(_0x8838('0x7'))(_0x8838('0x8'));var config=require('../../config/environment');var jayson=require(_0x8838('0x9'));var client=jayson[_0x8838('0xa')]['http']({'port':0x232a});config[_0x8838('0xb')]=_[_0x8838('0xc')](config[_0x8838('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8838('0xd'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x8838('0xe')](socket);function respondWithRpcPromise(_0x4b5419,_0x4aedc9,_0x336b66){return new BPromise(function(_0x28de3d,_0x1e728e){return client[_0x8838('0xf')](_0x4b5419,_0x336b66)['then'](function(_0xd472af){logger[_0x8838('0x10')](_0x8838('0x11'),_0x4aedc9,_0x8838('0x12'));logger['debug'](_0x8838('0x13'),_0x4aedc9,'request\x20sent',JSON['stringify'](_0xd472af));if(_0xd472af[_0x8838('0x14')]){if(_0xd472af[_0x8838('0x14')][_0x8838('0x15')]===0x1f4){logger[_0x8838('0x14')](_0x8838('0x11'),_0x4aedc9,_0xd472af[_0x8838('0x14')][_0x8838('0x16')]);return _0x1e728e(_0xd472af[_0x8838('0x14')]['message']);}logger[_0x8838('0x14')](_0x8838('0x11'),_0x4aedc9,_0xd472af['error'][_0x8838('0x16')]);return _0x28de3d(_0xd472af[_0x8838('0x14')][_0x8838('0x16')]);}else{logger['info'](_0x8838('0x11'),_0x4aedc9,'request\x20sent');_0x28de3d(_0xd472af[_0x8838('0x17')][_0x8838('0x16')]);}})[_0x8838('0x18')](function(_0x4eb6e2){logger[_0x8838('0x14')](_0x8838('0x11'),_0x4aedc9,_0x4eb6e2);_0x1e728e(_0x4eb6e2);});});}
\ No newline at end of file
+var _0x8e52=['request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0xe7d561,_0x146cef){var _0x4c27f0=function(_0x287ac7){while(--_0x287ac7){_0xe7d561['push'](_0xe7d561['shift']());}};_0x4c27f0(++_0x146cef);}(_0x8e52,0x1c6));var _0x28e5=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0x8e52[_0x1cbcf1];return _0x3a06f0;};'use strict';var _=require('lodash');var util=require(_0x28e5('0x0'));var moment=require(_0x28e5('0x1'));var BPromise=require(_0x28e5('0x2'));var rs=require(_0x28e5('0x3'));var fs=require('fs');var Redis=require(_0x28e5('0x4'));var db=require(_0x28e5('0x5'))['db'];var utils=require(_0x28e5('0x6'));var logger=require(_0x28e5('0x7'))(_0x28e5('0x8'));var config=require(_0x28e5('0x9'));var jayson=require(_0x28e5('0xa'));var client=jayson[_0x28e5('0xb')][_0x28e5('0xc')]({'port':0x232a});config[_0x28e5('0xd')]=_[_0x28e5('0xe')](config['redis'],{'host':_0x28e5('0xf'),'port':0x18eb});var socket=require(_0x28e5('0x10'))(new Redis(config['redis']));require(_0x28e5('0x11'))['register'](socket);function respondWithRpcPromise(_0x43306d,_0xd9be8d,_0x33d9bd){return new BPromise(function(_0x9f21e5,_0x26d60a){return client['request'](_0x43306d,_0x33d9bd)['then'](function(_0x50a50d){logger[_0x28e5('0x12')](_0x28e5('0x13'),_0xd9be8d,'request\x20sent');logger[_0x28e5('0x14')](_0x28e5('0x15'),_0xd9be8d,_0x28e5('0x16'),JSON['stringify'](_0x50a50d));if(_0x50a50d[_0x28e5('0x17')]){if(_0x50a50d['error'][_0x28e5('0x18')]===0x1f4){logger[_0x28e5('0x17')](_0x28e5('0x13'),_0xd9be8d,_0x50a50d[_0x28e5('0x17')][_0x28e5('0x19')]);return _0x26d60a(_0x50a50d[_0x28e5('0x17')][_0x28e5('0x19')]);}logger[_0x28e5('0x17')](_0x28e5('0x13'),_0xd9be8d,_0x50a50d[_0x28e5('0x17')][_0x28e5('0x19')]);return _0x9f21e5(_0x50a50d[_0x28e5('0x17')][_0x28e5('0x19')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0xd9be8d,_0x28e5('0x16'));_0x9f21e5(_0x50a50d[_0x28e5('0x1a')][_0x28e5('0x19')]);}})[_0x28e5('0x1b')](function(_0x151a8b){logger[_0x28e5('0x17')](_0x28e5('0x13'),_0xd9be8d,_0x151a8b);_0x26d60a(_0x151a8b);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index f01add7..c27b9c9 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 _0x1b02=['chatGroup:','./chatGroup.events','update','emit','removeListener','register','length'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1b02,0x151));var _0x21b0=function(_0x10346c,_0x183ce6){_0x10346c=_0x10346c-0x0;var _0x262bd4=_0x1b02[_0x10346c];return _0x262bd4;};'use strict';var ChatGroupEvents=require(_0x21b0('0x0'));var events=['save','remove',_0x21b0('0x1')];function createListener(_0xcdcc4e,_0x1d752e){return function(_0x19fcfb){_0x1d752e[_0x21b0('0x2')](_0xcdcc4e,_0x19fcfb);};}function removeListener(_0x47de39,_0x3497c6){return function(){ChatGroupEvents[_0x21b0('0x3')](_0x47de39,_0x3497c6);};}exports[_0x21b0('0x4')]=function(_0x4b793a){for(var _0x1c78c8=0x0,_0x325bb9=events[_0x21b0('0x5')];_0x1c78c8<_0x325bb9;_0x1c78c8++){var _0x478daf=events[_0x1c78c8];var _0x2d84bd=createListener(_0x21b0('0x6')+_0x478daf,_0x4b793a);ChatGroupEvents['on'](_0x478daf,_0x2d84bd);}};
\ No newline at end of file
+var _0x8fe6=['removeListener','register','./chatGroup.events','save','remove','update','emit'];(function(_0x2e7316,_0x4e251d){var _0x44fe17=function(_0x5db5f0){while(--_0x5db5f0){_0x2e7316['push'](_0x2e7316['shift']());}};_0x44fe17(++_0x4e251d);}(_0x8fe6,0x19f));var _0x68fe=function(_0x110af4,_0x5570be){_0x110af4=_0x110af4-0x0;var _0x409bf6=_0x8fe6[_0x110af4];return _0x409bf6;};'use strict';var ChatGroupEvents=require(_0x68fe('0x0'));var events=[_0x68fe('0x1'),_0x68fe('0x2'),_0x68fe('0x3')];function createListener(_0x339177,_0x2e99f2){return function(_0x72a292){_0x2e99f2[_0x68fe('0x4')](_0x339177,_0x72a292);};}function removeListener(_0x2a549e,_0xdf1490){return function(){ChatGroupEvents[_0x68fe('0x5')](_0x2a549e,_0xdf1490);};}exports[_0x68fe('0x6')]=function(_0x592073){for(var _0x5120ba=0x0,_0x4d814c=events['length'];_0x5120ba<_0x4d814c;_0x5120ba++){var _0x952e5a=events[_0x5120ba];var _0x13daca=createListener('chatGroup:'+_0x952e5a,_0x592073);ChatGroupEvents['on'](_0x952e5a,_0x13daca);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 5d2e154..5a91882 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 _0x19a0=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','update','delete','destroy','removeMembers'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0x19a0,0x156));var _0x019a=function(_0x4387a9,_0x4dee1e){_0x4387a9=_0x4387a9-0x0;var _0x2b228e=_0x19a0[_0x4387a9];return _0x2b228e;};'use strict';var multer=require(_0x019a('0x0'));var util=require('util');var path=require(_0x019a('0x1'));var timeout=require(_0x019a('0x2'));var express=require(_0x019a('0x3'));var router=express[_0x019a('0x4')]();var fs_extra=require(_0x019a('0x5'));var auth=require(_0x019a('0x6'));var interaction=require(_0x019a('0x7'));var config=require(_0x019a('0x8'));var controller=require(_0x019a('0x9'));router[_0x019a('0xa')]('/',auth[_0x019a('0xb')](),controller[_0x019a('0xc')]);router[_0x019a('0xa')](_0x019a('0xd'),auth[_0x019a('0xb')](),controller[_0x019a('0xe')]);router[_0x019a('0xa')](_0x019a('0xf'),auth[_0x019a('0xb')](),controller['show']);router[_0x019a('0xa')](_0x019a('0x10'),auth[_0x019a('0xb')](),controller[_0x019a('0x11')]);router[_0x019a('0xa')](_0x019a('0x12'),auth['isAuthenticated'](),controller[_0x019a('0x13')]);router[_0x019a('0xa')](_0x019a('0x14'),auth[_0x019a('0xb')](),controller[_0x019a('0x15')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x019a('0x16')]('/:id/members',auth['isAuthenticated'](),controller[_0x019a('0x17')]);router[_0x019a('0x16')](_0x019a('0x14'),auth[_0x019a('0xb')](),controller[_0x019a('0x18')]);router[_0x019a('0x19')](_0x019a('0xf'),auth[_0x019a('0xb')](),controller[_0x019a('0x1a')]);router[_0x019a('0x1b')]('/:id',auth[_0x019a('0xb')](),controller[_0x019a('0x1c')]);router[_0x019a('0x1b')](_0x019a('0x12'),auth[_0x019a('0xb')](),controller[_0x019a('0x1d')]);module[_0x019a('0x1e')]=router;
\ No newline at end of file
+var _0xfcae=['/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','/:id','delete','removeMembers','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','getUnread'];(function(_0x260efc,_0x6545d0){var _0x56fc0f=function(_0x36b313){while(--_0x36b313){_0x260efc['push'](_0x260efc['shift']());}};_0x56fc0f(++_0x6545d0);}(_0xfcae,0x143));var _0xefca=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfcae[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0xefca('0x0'));var path=require(_0xefca('0x1'));var timeout=require(_0xefca('0x2'));var express=require(_0xefca('0x3'));var router=express[_0xefca('0x4')]();var fs_extra=require(_0xefca('0x5'));var auth=require(_0xefca('0x6'));var interaction=require(_0xefca('0x7'));var config=require(_0xefca('0x8'));var controller=require('./chatGroup.controller');router[_0xefca('0x9')]('/',auth[_0xefca('0xa')](),controller['index']);router[_0xefca('0x9')](_0xefca('0xb'),auth[_0xefca('0xa')](),controller[_0xefca('0xc')]);router[_0xefca('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xefca('0xd')]);router[_0xefca('0x9')]('/:id/unread',auth[_0xefca('0xa')](),controller[_0xefca('0xe')]);router[_0xefca('0x9')](_0xefca('0xf'),auth[_0xefca('0xa')](),controller[_0xefca('0x10')]);router['get'](_0xefca('0x11'),auth[_0xefca('0xa')](),controller[_0xefca('0x12')]);router[_0xefca('0x13')]('/',auth[_0xefca('0xa')](),controller['create']);router[_0xefca('0x13')](_0xefca('0xf'),auth['isAuthenticated'](),controller[_0xefca('0x14')]);router[_0xefca('0x13')](_0xefca('0x11'),auth[_0xefca('0xa')](),controller[_0xefca('0x15')]);router[_0xefca('0x16')](_0xefca('0x17'),auth['isAuthenticated'](),controller['update']);router[_0xefca('0x18')]('/:id',auth[_0xefca('0xa')](),controller['destroy']);router[_0xefca('0x18')]('/:id/members',auth[_0xefca('0xa')](),controller[_0xefca('0x19')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 0f2ba28..db9ddc3 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 _0xa478=['DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x35c46a,_0x43e9c8){var _0x2febb8=function(_0x3e59ae){while(--_0x3e59ae){_0x35c46a['push'](_0x35c46a['shift']());}};_0x2febb8(++_0x43e9c8);}(_0xa478,0x136));var _0x8a47=function(_0x1af8d3,_0x544d86){_0x1af8d3=_0x1af8d3-0x0;var _0x3a50c5=_0xa478[_0x1af8d3];return _0x3a50c5;};'use strict';var Sequelize=require(_0x8a47('0x0'));module[_0x8a47('0x1')]={'closed':{'type':Sequelize[_0x8a47('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8a47('0x3')]},'ratingType':{'type':Sequelize[_0x8a47('0x4')](_0x8a47('0x5'),_0x8a47('0x6')),'defaultValue':_0x8a47('0x5')},'ratingMessage':{'type':Sequelize[_0x8a47('0x7')]},'pathTranscript':{'type':Sequelize[_0x8a47('0x7')]},'mailTranscript':{'type':Sequelize[_0x8a47('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8a47('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8a47('0x8')]},'thirdDisposition':{'type':Sequelize[_0x8a47('0x8')]},'note':{'type':Sequelize[_0x8a47('0x8')]},'browserName':{'type':Sequelize[_0x8a47('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x8a47('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x8a47('0x8')]},'deviceVendor':{'type':Sequelize[_0x8a47('0x8')]},'deviceType':{'type':Sequelize[_0x8a47('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x8a47('0x8')]},'formData':{'type':Sequelize[_0x8a47('0x7')]('long')},'read1stAt':{'type':Sequelize[_0x8a47('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x8a47('0x4')]('in',_0x8a47('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8a47('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x263f=['out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','TEXT','DATE','STRING','long'];(function(_0x3a1b90,_0x3c0158){var _0xf6de77=function(_0x396533){while(--_0x396533){_0x3a1b90['push'](_0x3a1b90['shift']());}};_0xf6de77(++_0x3c0158);}(_0x263f,0x182));var _0xf263=function(_0x36f194,_0x460f00){_0x36f194=_0x36f194-0x0;var _0x526d83=_0x263f[_0x36f194];return _0x526d83;};'use strict';var Sequelize=require(_0xf263('0x0'));module[_0xf263('0x1')]={'closed':{'type':Sequelize[_0xf263('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf263('0x3')]},'ratingType':{'type':Sequelize[_0xf263('0x4')](_0xf263('0x5'),'thumb'),'defaultValue':_0xf263('0x5')},'ratingMessage':{'type':Sequelize[_0xf263('0x6')]},'pathTranscript':{'type':Sequelize[_0xf263('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf263('0x7')]},'disposition':{'type':Sequelize[_0xf263('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf263('0x8')]},'browserName':{'type':Sequelize[_0xf263('0x8')]},'browserVersion':{'type':Sequelize[_0xf263('0x8')]},'osName':{'type':Sequelize[_0xf263('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xf263('0x8')]},'deviceVendor':{'type':Sequelize[_0xf263('0x8')]},'deviceType':{'type':Sequelize[_0xf263('0x8')]},'referer':{'type':Sequelize[_0xf263('0x6')]},'customerIp':{'type':Sequelize[_0xf263('0x8')]},'formData':{'type':Sequelize[_0xf263('0x6')](_0xf263('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xf263('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf263('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xf263('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xf263('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index c2cb76d..5843527 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 _0x2032=['nolimit','order','sort','pick','field','color','tools_tags','select','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','o.id\x20=\x20i.UserId','chat_websites','chat_messages','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','$gte','parse','where','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','fields','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.lastName','c.email','Contact.phone','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','params','keys','include','options','create','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooMetadata','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooNote','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','close','format','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsite','%s%d','agentAlias','customer','Visitor','website_alias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','getMyMessages','includeAgent','addTags','ids','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','customerIp','customerPort','tail','createReadStream','pipe','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','socket.io-emitter','register','jayson/promise','client','http','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','apply','save','update','destroy','end','name','send','merge','body','contact','agent','Users','map','fullname','TagIds','forEach','Tags','index','ChatInteraction','rawAttributes','type','model','query','filters','attributes','intersection','length','hasOwnProperty'];(function(_0x785a63,_0x5326ec){var _0x44b81e=function(_0x2cf419){while(--_0x2cf419){_0x785a63['push'](_0x785a63['shift']());}};_0x44b81e(++_0x5326ec);}(_0x2032,0xd9));var _0x2203=function(_0x168a04,_0x3dd149){_0x168a04=_0x168a04-0x0;var _0x42a9b9=_0x2032[_0x168a04];return _0x42a9b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x2203('0x14'));var logger=require('../../config/logger')(_0x2203('0x15'));var utils=require('../../config/utils');var config=require(_0x2203('0x16'));var licenseUtil=require(_0x2203('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2203('0x18'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x2203('0x19')](socket);var jayson=require(_0x2203('0x1a'));var client=jayson[_0x2203('0x1b')][_0x2203('0x1c')]({'port':0x232b});var client9004=jayson[_0x2203('0x1b')][_0x2203('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x2c36e6,_0x2c085c,_0xdf9d0b,_0x3053f3){return new BPromise(function(_0x5129fb,_0x280eda){var _0x2ee127=_0x3053f3||client;return _0x2ee127['request'](_0x2c36e6,_0xdf9d0b)[_0x2203('0x1d')](function(_0x8906e1){logger['info'](_0x2203('0x1e'),_0x2c085c,'request\x20sent');logger[_0x2203('0x1f')](_0x2203('0x20'),_0x2c085c,_0x2203('0x21'),JSON[_0x2203('0x22')](_0x8906e1));if(_0x8906e1[_0x2203('0x23')]){if(_0x8906e1[_0x2203('0x23')]['code']===0x1f4){logger[_0x2203('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x2c085c,_0x8906e1['error'][_0x2203('0x24')]);return _0x280eda(_0x8906e1['error'][_0x2203('0x24')]);}logger[_0x2203('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x2c085c,_0x8906e1[_0x2203('0x23')]['message']);return _0x5129fb(_0x8906e1['error'][_0x2203('0x24')]);}else{logger[_0x2203('0x25')](_0x2203('0x1e'),_0x2c085c,_0x2203('0x21'));_0x5129fb(_0x8906e1[_0x2203('0x26')][_0x2203('0x24')]);}})[_0x2203('0x27')](function(_0x250349){logger['error'](_0x2203('0x1e'),_0x2c085c,_0x250349);_0x280eda(_0x250349);});});}function respondWithStatusCode(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0xcc;return function(_0x5f11bf){if(_0x5f11bf){return _0x36b958[_0x2203('0x28')](_0x39a11a);}return _0x36b958[_0x2203('0x29')](_0x39a11a)['end']();};}function respondWithResult(_0xd6e109,_0xd91f5d){_0xd91f5d=_0xd91f5d||0xc8;return function(_0x1c6a77){if(_0x1c6a77){return _0xd6e109[_0x2203('0x29')](_0xd91f5d)[_0x2203('0x2a')](_0x1c6a77);}};}function respondWithFilteredResult(_0x1df508,_0x9c53f){return function(_0x5a95c1){if(_0x5a95c1){var _0x34b8ba=typeof _0x9c53f[_0x2203('0x2b')]===_0x2203('0x2c')&&typeof _0x9c53f[_0x2203('0x2d')]==='undefined';var _0x3a8e23=_0x5a95c1[_0x2203('0x2e')];var _0x287c95=_0x34b8ba?0x0:_0x9c53f[_0x2203('0x2b')];var _0x520602=_0x34b8ba?_0x5a95c1[_0x2203('0x2e')]:_0x9c53f[_0x2203('0x2b')]+_0x9c53f['limit'];var _0x5c0157;if(_0x520602>=_0x3a8e23){_0x520602=_0x3a8e23;_0x5c0157=0xc8;}else{_0x5c0157=0xce;}_0x1df508[_0x2203('0x29')](_0x5c0157);return _0x1df508['set']('Content-Range',_0x287c95+'-'+_0x520602+'/'+_0x3a8e23)[_0x2203('0x2a')](_0x5a95c1);}return null;};}function patchUpdates(_0x464c88){return function(_0x191894){try{jsonpatch[_0x2203('0x2f')](_0x191894,_0x464c88,!![]);}catch(_0xf2801d){return BPromise['reject'](_0xf2801d);}return _0x191894[_0x2203('0x30')]();};}function saveUpdates(_0x2324c0,_0x49caec){return function(_0x2a2ee7){if(_0x2a2ee7){return _0x2a2ee7[_0x2203('0x31')](_0x2324c0)[_0x2203('0x1d')](function(_0x4187b4){return _0x4187b4;});}return null;};}function removeEntity(_0x43fee1,_0x24d138){return function(_0x29da55){if(_0x29da55){return _0x29da55[_0x2203('0x32')]()[_0x2203('0x1d')](function(){_0x43fee1['status'](0xcc)[_0x2203('0x33')]();});}};}function handleEntityNotFound(_0x347d3e,_0x56f9b2){return function(_0x54b90b){if(!_0x54b90b){_0x347d3e[_0x2203('0x28')](0x194);}return _0x54b90b;};}function handleError(_0x5e9841,_0x25cc97){_0x25cc97=_0x25cc97||0x1f4;return function(_0x3b1eeb){logger[_0x2203('0x23')](_0x3b1eeb['stack']);if(_0x3b1eeb['name']){delete _0x3b1eeb[_0x2203('0x34')];}_0x5e9841['status'](_0x25cc97)[_0x2203('0x35')](_0x3b1eeb);};}function getMustacheRender(_0x5cfe5e,_0x11451e){return Mustache['render'](_0x5cfe5e,_[_0x2203('0x36')](_0x11451e[_0x2203('0x37')],{'contact':_0x11451e[_0x2203('0x38')],'message':_0x11451e[_0x2203('0x24')],'agent':_0x11451e[_0x2203('0x39')],'interaction':_0x11451e['interaction'],'account':_0x11451e['account']}))||'';}function getInteractionUsers(_0x4c0e9e,_0x7ea79b){return new BPromise(function(_0x25a2dc,_0x323798){try{if(_0x7ea79b[_0x4c0e9e['id']]){_0x4c0e9e[_0x2203('0x3a')]=_[_0x2203('0x3b')](_0x7ea79b[_0x4c0e9e['id']],function(_0x3b250a){return{'id':_0x3b250a['id'],'fullname':_0x3b250a[_0x2203('0x3c')]};});}}catch(_0x590b4e){_0x323798(_0x590b4e);}_0x25a2dc(_0x4c0e9e);});}function getInteractionTags(_0x175945,_0x1b12c3){return new BPromise(function(_0x108fde,_0x26be74){try{if(_0x175945['TagIds']){_0x175945['Tags']=[];_0x175945[_0x2203('0x3d')]['split'](',')[_0x2203('0x3e')](function(_0x446209){_0x175945[_0x2203('0x3f')]['push'](_0x1b12c3[_0x446209]);});}delete _0x175945['TagIds'];}catch(_0x1e7ebc){_0x26be74(_0x1e7ebc);}_0x108fde(_0x175945);});}function updateChatInteraction(_0x3739f6,_0x368444,_0x1e09f3){return new BPromise(function(_0x372709,_0x1fa734){return getInteractionUsers(_0x3739f6,_0x1e09f3)['then'](function(_0x15d3b6){return getInteractionTags(_0x15d3b6,_0x368444);})[_0x2203('0x1d')](function(_0x3a866c){_0x372709(_0x3a866c);})[_0x2203('0x27')](function(_0x16b452){_0x1fa734(_0x16b452);});});}exports[_0x2203('0x40')]=function(_0x5b4842,_0x23a6e8){var _0x36b8e4={},_0x1e34a0={},_0x595281={'count':0x0,'rows':[]};var _0x2e2ca5=_[_0x2203('0x3b')](db[_0x2203('0x41')][_0x2203('0x42')],function(_0x4c3259){return{'name':_0x4c3259['fieldName'],'type':_0x4c3259[_0x2203('0x43')]['key']};});_0x1e34a0[_0x2203('0x44')]=_[_0x2203('0x3b')](_0x2e2ca5,_0x2203('0x34'));_0x1e34a0[_0x2203('0x45')]=_['keys'](_0x5b4842[_0x2203('0x45')]);_0x1e34a0[_0x2203('0x46')]=_['intersection'](_0x1e34a0[_0x2203('0x44')],_0x1e34a0[_0x2203('0x45')]);_0x36b8e4[_0x2203('0x47')]=_[_0x2203('0x48')](_0x1e34a0['model'],qs['fields'](_0x5b4842[_0x2203('0x45')]['fields']));_0x36b8e4['attributes']=_0x36b8e4[_0x2203('0x47')][_0x2203('0x49')]?_0x36b8e4[_0x2203('0x47')]:_0x1e34a0['model'];if(!_0x5b4842['query'][_0x2203('0x4a')](_0x2203('0x4b'))){_0x36b8e4[_0x2203('0x2d')]=qs[_0x2203('0x2d')](_0x5b4842[_0x2203('0x45')][_0x2203('0x2d')]);_0x36b8e4['offset']=qs[_0x2203('0x2b')](_0x5b4842['query'][_0x2203('0x2b')]);}_0x36b8e4[_0x2203('0x4c')]=qs[_0x2203('0x4d')](_0x5b4842[_0x2203('0x45')]['sort']);_0x36b8e4['where']=qs[_0x2203('0x46')](_[_0x2203('0x4e')](_0x5b4842[_0x2203('0x45')],_0x1e34a0[_0x2203('0x46')]),_0x2e2ca5);var _0x559370=[];var _0x4de47a=squel['select']()[_0x2203('0x4f')]('id')[_0x2203('0x4f')]('name')[_0x2203('0x4f')](_0x2203('0x50'))['from'](_0x2203('0x51'));var _0xb47204=squel[_0x2203('0x52')]()[_0x2203('0x4f')]('u.id')[_0x2203('0x4f')]('u.fullname')[_0x2203('0x4f')](_0x2203('0x53'))['from'](_0x2203('0x54'),'ui')[_0x2203('0x55')](_0x2203('0x56'),'u',_0x2203('0x57'));var _0x3f335a=squel[_0x2203('0x52')]()['from']('chat_interactions','i')[_0x2203('0x55')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x2203('0x55')](_0x2203('0x56'),'o',_0x2203('0x58'))['left_join'](_0x2203('0x59'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0x2203('0x5a'),'me','me.ChatInteractionId\x20=\x20i.id')['left_join']('chat_interaction_has_tags','it',_0x2203('0x5b'))[_0x2203('0x55')](_0x2203('0x51'),'t',_0x2203('0x5c'));var _0x26d3d9=squel[_0x2203('0x5d')]();var _0x2baea2=[];var _0x91f70c=squel[_0x2203('0x5d')]();var _0x216641;if(_0x5b4842[_0x2203('0x45')][_0x2203('0x5e')]){_0x216641=as['parseSearch'](_0x5b4842['query'][_0x2203('0x5e')]);var _0x43d8c0=_0x216641[_0x2203('0x5f')];for(var _0x2446be=0x0;_0x2446be<_0x216641[_0x2203('0x60')][_0x2203('0x49')];_0x2446be++){var _0x4f8b8e=_0x216641['conditions'][_0x2446be];var _0xb49120='i';var _0x34358e=_[_0x2203('0x61')](_0x2e2ca5,[_0x2203('0x34'),_0x4f8b8e[_0x2203('0x4f')]]);if(!_0x34358e){switch(_0x4f8b8e[_0x2203('0x4f')]){case _0x2203('0x62'):if(_0x4f8b8e[_0x2203('0x63')]==0x1){_0x3f335a[_0x2203('0x64')]('`'+_0x4f8b8e[_0x2203('0x4f')]+_0x2203('0x65'));}else{_0x3f335a['having']('`'+_0x4f8b8e[_0x2203('0x4f')]+_0x2203('0x66'));}break;case _0x2203('0x67'):if(_0x4f8b8e[_0x2203('0x68')]===_0x2203('0x69')){if(_0x4f8b8e[_0x2203('0x63')][_0x2203('0x6a')]('\x20')[_0x2203('0x49')]>0x1){_0x26d3d9[_0x43d8c0](_0x2203('0x6b'),qs[_0x2203('0x6c')](_0x4f8b8e[_0x2203('0x63')]),null);}else{var _0x6ea7e8='%'+_0x4f8b8e[_0x2203('0x63')]+'%';_0x26d3d9[_0x43d8c0](_0x2203('0x6d'),_0x6ea7e8,_0x6ea7e8,_0x6ea7e8);}}else{_0x34358e=_[_0x2203('0x61')](_0x2e2ca5,[_0x2203('0x34'),_0x2203('0x6e')]);_0x4f8b8e[_0x2203('0x4f')]=_0x2203('0x6e');_0xf16e1d=as[_0x2203('0x6f')](_0xb49120,_0x34358e['type'],_0x4f8b8e);_0x26d3d9[_0x43d8c0](_0xf16e1d[_0x2203('0x70')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x71')],_0xf16e1d['value'][_0x2203('0x33')]);}break;case _0x2203('0x72'):var _0x1b4f96=_0x4f8b8e[_0x2203('0x63')][_0x2203('0x6a')](',')['map'](function(_0x38b077){return Number(_0x38b077);});_0x1b4f96[_0x2203('0x3e')](function(_0x1c63bf){_0x91f70c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1c63bf+',%');});_0x2baea2=_['union'](_0x2baea2,_0x1b4f96);break;case'User':if(_0x4f8b8e['operator']==='$substring'){_0x26d3d9[_0x43d8c0](_0x2203('0x73'),'%'+_0x4f8b8e[_0x2203('0x63')]+'%',null);}else{_0x34358e=_[_0x2203('0x61')](_0x2e2ca5,[_0x2203('0x34'),_0x2203('0x74')]);_0x4f8b8e[_0x2203('0x4f')]=_0x2203('0x74');_0xf16e1d=as[_0x2203('0x6f')](_0xb49120,_0x34358e['type'],_0x4f8b8e);_0x26d3d9[_0x43d8c0](_0xf16e1d['text'],_0xf16e1d[_0x2203('0x63')][_0x2203('0x71')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x33')]);}break;case _0x2203('0x37'):_0xf16e1d=as[_0x2203('0x6f')]('me',null,_0x4f8b8e);_0x26d3d9[_0x43d8c0](_0xf16e1d[_0x2203('0x70')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x71')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x33')]);break;}}else{var _0xf16e1d=as[_0x2203('0x6f')](_0xb49120,_0x34358e[_0x2203('0x43')],_0x4f8b8e);_0x26d3d9[_0x43d8c0](_0xf16e1d[_0x2203('0x70')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x71')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x33')]);}}}else{var _0x4b2e4f=_(_0x5b4842[_0x2203('0x45')])['keys']()[_0x2203('0x3b')](function(_0x55ecbb){return _[_0x2203('0x75')](_0x2e2ca5,[_0x2203('0x34'),_0x55ecbb])?_0x55ecbb:undefined;})[_0x2203('0x76')]()[_0x2203('0x63')]();if(!_[_0x2203('0x77')](_0x4b2e4f)){_0x4b2e4f[_0x2203('0x3e')](function(_0x3e1583){if(_0x3e1583===_0x2203('0x78')){_0x3f335a['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x2203('0x79')](_0x5b4842[_0x2203('0x45')][_0x3e1583]));}else if(_0x3e1583===_0x2203('0x7a')){var _0x484549=JSON['parse'](_0x5b4842['query'][_0x3e1583])[_0x2203('0x7b')];var _0x2d26ba=JSON[_0x2203('0x7c')](_0x5b4842[_0x2203('0x45')][_0x3e1583])['$lte'];_0x3f335a[_0x2203('0x7d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x484549,_0x2d26ba);}else{if(_0x5b4842[_0x2203('0x45')][_0x3e1583]===_0x2203('0x7e')){_0x3f335a[_0x2203('0x7d')]('i.'+_0x3e1583+_0x2203('0x7f'));}else{_0x3f335a[_0x2203('0x7d')]('i.'+_0x3e1583+'\x20=\x20?',_0x5b4842[_0x2203('0x45')][_0x3e1583]);}}});}if(_0x5b4842[_0x2203('0x45')][_0x2203('0x80')]){if(_0x5b4842['query'][_0x2203('0x80')]==0x1){_0x3f335a[_0x2203('0x64')](_0x2203('0x81'));}else{_0x3f335a[_0x2203('0x64')](_0x2203('0x82'));}}if(_0x5b4842[_0x2203('0x45')][_0x2203('0x83')]){_0x2baea2=_[_0x2203('0x84')](_0x5b4842[_0x2203('0x45')][_0x2203('0x83')])?_0x5b4842[_0x2203('0x45')]['tag']:new Array(_0x5b4842[_0x2203('0x45')][_0x2203('0x83')]);_0x2baea2[_0x2203('0x3e')](function(_0x2da37c){_0x91f70c['or'](_0x2203('0x85'),'%,'+_0x2da37c+',%');});}if(_0x5b4842[_0x2203('0x45')][_0x2203('0x86')]){var _0x2a5a4b=_0x5b4842[_0x2203('0x45')][_0x2203('0x86')][_0x2203('0x87')]('\x5c','\x5c\x5c')[_0x2203('0x87')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x2a5a4b)){_0x26d3d9['or']('i.id\x20LIKE\x20?',_0x2a5a4b+'%');}else{_0x26d3d9['or'](_0x2203('0x88'),qs[_0x2203('0x6c')](_0x2a5a4b))['or'](_0x2203('0x89'),_0x2a5a4b+'%');}}}_0x3f335a[_0x2203('0x7d')](_0x26d3d9);_0x3f335a[_0x2203('0x8a')]('i.id');var _0x16e518={'type':db[_0x2203('0x8b')]['QueryTypes']['SELECT'],'raw':!![]};var _0x4edac6=_0x3f335a['clone']();_0x4edac6['field'](_0x2203('0x8c'));_0x4edac6[_0x2203('0x4f')](_0x2203('0x8d'),'unreadMessages');if(_0x36b8e4['order']){_0x36b8e4['order'][_0x2203('0x3e')](function(_0x1e90c4){var _0x15d061=_0x1e90c4[0x0]===_0x2203('0x8e')?_0x1e90c4[0x0]:'i.'+_0x1e90c4[0x0];_0x3f335a[_0x2203('0x4c')](_0x15d061,_0x1e90c4[0x1]===_0x2203('0x8f')?![]:!![]);});}if(!_[_0x2203('0x77')](_0x2baea2)){_0x3f335a['having'](_0x91f70c);_0x4edac6[_0x2203('0x7d')](_0x2203('0x90'),_0x2baea2);}BPromise[_0x2203('0x91')]()[_0x2203('0x1d')](function(){if(!_0x216641){if(_0x5b4842[_0x2203('0x45')][_0x2203('0x78')])return;_0x4edac6[_0x2203('0x7d')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3f335a[_0x2203('0x7d')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x5b4842['user'][_0x2203('0x92')]!=='agent')return;return _0x5b4842[_0x2203('0x93')][_0x2203('0x94')]({'attributes':['id'],'raw':!![]})['then'](function(_0x29d545){if(_[_0x2203('0x77')](_0x29d545)){_0x4edac6[_0x2203('0x7d')](_0x2203('0x95'));_0x3f335a[_0x2203('0x7d')](_0x2203('0x95'));}else{_0x4edac6['where'](_0x2203('0x96'),_[_0x2203('0x3b')](_0x29d545,'id'));_0x3f335a['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x2203('0x3b')](_0x29d545,'id'));}});})[_0x2203('0x1d')](function(){if(_0x5b4842[_0x2203('0x93')][_0x2203('0x92')]===_0x2203('0x39')&&!_0x216641&&!_0x5b4842[_0x2203('0x45')][_0x2203('0x78')])return[];return db[_0x2203('0x97')][_0x2203('0x45')](_0x4edac6[_0x2203('0x98')](),_0x16e518);})[_0x2203('0x1d')](function(_0x413729){_0x595281[_0x2203('0x2e')]=_0x413729[_0x2203('0x49')];if(_0x595281[_0x2203('0x2e')]===0x0)return[];return db[_0x2203('0x97')]['query'](_0x4de47a['toString'](),_0x16e518)[_0x2203('0x1d')](function(_0x1295a3){_0x559370=_['keyBy'](_0x1295a3,'id');_0x16e518=_[_0x2203('0x36')](_0x16e518,{'model':db[_0x2203('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5b4842['query'][_0x2203('0x99')]){_0x36b8e4[_0x2203('0x47')]['forEach'](function(_0x21f357){_0x3f335a[_0x2203('0x4f')]('i.'+_0x21f357);});}else{_0x3f335a['field'](_0x2203('0x8d'),_0x2203('0x62'));_0x3f335a[_0x2203('0x4f')](_0x2203('0x9a'),'Account.key');_0x3f335a['field'](_0x2203('0x9b'),_0x2203('0x9c'));_0x3f335a[_0x2203('0x4f')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x3f335a[_0x2203('0x4f')](_0x2203('0x9d'));_0x3f335a[_0x2203('0x4f')]('c.firstName','Contact.firstName');_0x3f335a[_0x2203('0x4f')](_0x2203('0x9e'),'Contact.lastName');_0x3f335a[_0x2203('0x4f')](_0x2203('0x9f'),'Contact.email');_0x3f335a[_0x2203('0x4f')]('c.phone',_0x2203('0xa0'));_0x3f335a['field']('c.mobile','Contact.mobile');_0x3f335a[_0x2203('0x4f')](_0x2203('0xa1'),'Contact.fax');_0x3f335a[_0x2203('0x4f')](_0x2203('0xa2'),_0x2203('0xa3'));_0x3f335a['field'](_0x2203('0xa4'),'Owner.internal');_0x3f335a[_0x2203('0x4f')](_0x2203('0xa5'),'TagIds');}if(_0x36b8e4[_0x2203('0x2d')])_0x3f335a[_0x2203('0x2d')](_0x36b8e4['limit']);if(_0x36b8e4[_0x2203('0x2b')])_0x3f335a[_0x2203('0x2b')](_0x36b8e4[_0x2203('0x2b')]);return db[_0x2203('0x97')][_0x2203('0x45')](_0x3f335a['toString'](),_0x16e518);})[_0x2203('0x1d')](function(_0x1b5185){if(_0x1b5185[_0x2203('0x49')]>0x0)_0xb47204[_0x2203('0x7d')](_0x2203('0xa6'),_[_0x2203('0x3b')](_0x1b5185,'id'));return db['sequelize'][_0x2203('0x45')](_0xb47204[_0x2203('0x98')](),_0x16e518)['then'](function(_0x13fc7b){var _0x5e0bff=_[_0x2203('0xa7')](_0x13fc7b,_0x2203('0xa8'));var _0xc611e8=[];_0x1b5185['forEach'](function(_0xab7f0b){_0xc611e8[_0x2203('0xa9')](updateChatInteraction(_0xab7f0b,_0x559370,_0x5e0bff));});return BPromise[_0x2203('0xaa')](_0xc611e8);});});})[_0x2203('0x1d')](function(_0x2c275f){_0x595281[_0x2203('0xab')]=_0x2c275f;return _0x595281;})[_0x2203('0x1d')](respondWithFilteredResult(_0x23a6e8,_0x36b8e4))['catch'](handleError(_0x23a6e8,null));};exports['show']=function(_0x106534,_0x41eb4c){var _0x25996c={'raw':![],'where':{'id':_0x106534[_0x2203('0xac')]['id']}},_0x4e1f55={};_0x4e1f55[_0x2203('0x44')]=_[_0x2203('0xad')](db['ChatInteraction'][_0x2203('0x42')]);_0x4e1f55[_0x2203('0x45')]=_['keys'](_0x106534[_0x2203('0x45')]);_0x4e1f55['filters']=_[_0x2203('0x48')](_0x4e1f55[_0x2203('0x44')],_0x4e1f55['query']);_0x25996c[_0x2203('0x47')]=_[_0x2203('0x48')](_0x4e1f55[_0x2203('0x44')],qs[_0x2203('0x99')](_0x106534[_0x2203('0x45')][_0x2203('0x99')]));_0x25996c[_0x2203('0x47')]=_0x25996c[_0x2203('0x47')][_0x2203('0x49')]?_0x25996c[_0x2203('0x47')]:_0x4e1f55[_0x2203('0x44')];if(_0x106534[_0x2203('0x45')]['includeAll']){_0x25996c[_0x2203('0xae')]=[{'all':!![]}];}_0x25996c=_['merge']({},_0x25996c,_0x106534[_0x2203('0xaf')]);return db[_0x2203('0x41')][_0x2203('0x61')](_0x25996c)[_0x2203('0x1d')](handleEntityNotFound(_0x41eb4c,null))[_0x2203('0x1d')](respondWithResult(_0x41eb4c,null))[_0x2203('0x27')](handleError(_0x41eb4c,null));};exports[_0x2203('0xb0')]=function(_0x8f9f98,_0x36205d){return db[_0x2203('0x41')][_0x2203('0xb0')](_0x8f9f98['body'],{})[_0x2203('0x1d')](respondWithResult(_0x36205d,0xc9))['catch'](handleError(_0x36205d,null));};exports[_0x2203('0x31')]=function(_0x3deb3b,_0x6b8ea4){if(_0x3deb3b['body']['id']){delete _0x3deb3b[_0x2203('0x37')]['id'];}return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x3deb3b[_0x2203('0xac')]['id']}})[_0x2203('0x1d')](handleEntityNotFound(_0x6b8ea4,null))['then'](saveUpdates(_0x3deb3b[_0x2203('0x37')],null))['then'](respondWithResult(_0x6b8ea4,null))[_0x2203('0x27')](handleError(_0x6b8ea4,null));};exports[_0x2203('0x32')]=function(_0x5f5270,_0x376954){return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x5f5270[_0x2203('0xac')]['id']}})['then'](handleEntityNotFound(_0x376954,null))[_0x2203('0x1d')](removeEntity(_0x376954,null))['catch'](handleError(_0x376954,null));};exports['describe']=function(_0x4055eb,_0x95b45a){return db[_0x2203('0x41')][_0x2203('0xb1')]()[_0x2203('0x1d')](respondWithResult(_0x95b45a,null))[_0x2203('0x27')](handleError(_0x95b45a,null));};exports[_0x2203('0xb2')]=function(_0x4b6d6f,_0xb40f2b){var _0x4769ee=_0x4b6d6f[_0x2203('0xac')]['id'];var _0x492179;var _0x4fc1cc;var _0x4d6ece;return db[_0x2203('0x41')][_0x2203('0xb3')]({'where':{'id':_0x4769ee}})[_0x2203('0x1d')](function(_0x2d1ee6){_0x492179=_0x2d1ee6;return db['ChatWebsite'][_0x2203('0xb3')]({'where':{'id':_0x2d1ee6[_0x2203('0x78')]},'attributes':['id',_0x2203('0xb4'),_0x2203('0xb5'),'vidaooTopic','vidaooNote',_0x2203('0xb6')],'raw':!![]});})[_0x2203('0x1d')](function(_0x1ed416){if(_0x1ed416&&_0x1ed416['vidaooApiKey']&&_0x1ed416[_0x2203('0xb5')]){_0x4fc1cc=_0x1ed416;var _0x28bf0a={'interaction':{'id':_0x4769ee},'agent':{'id':_0x4b6d6f[_0x2203('0x93')]['id'],'name':_0x4b6d6f[_0x2203('0x93')][_0x2203('0x34')],'fullname':_0x4b6d6f[_0x2203('0x93')][_0x2203('0x3c')],'email':_0x4b6d6f['user'][_0x2203('0xb7')]},'contact':_0x4b6d6f[_0x2203('0x37')][_0x2203('0x38')],'account':_0x4b6d6f[_0x2203('0x37')][_0x2203('0xb8')]};var _0x4457c9={'rejectUnauthorized':![],'method':_0x2203('0xb9'),'url':_0x2203('0xba'),'headers':{'X-APIKEY':_0x1ed416[_0x2203('0xb4')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4b6d6f['user'][_0x2203('0xb7')]],'buttons':null,'topic':_0x4fc1cc[_0x2203('0xbb')],'note':_[_0x2203('0xbc')](_0x4fc1cc[_0x2203('0xbd')])?null:getMustacheRender(_0x4fc1cc['vidaooNote'],_0x28bf0a),'metadata':null},'redirect':_0x2203('0xbe'),'json':!![]};try{if(!_[_0x2203('0xbc')](_0x4fc1cc[_0x2203('0xb6')])){var _0x19ef05=getMustacheRender(_0x4fc1cc[_0x2203('0xb6')],_0x28bf0a);var _0x3f3062=JSON[_0x2203('0x7c')](_0x19ef05);_0x4457c9[_0x2203('0x37')][_0x2203('0xbf')]=_0x3f3062;}}catch(_0x597e49){throw new db['Sequelize'][(_0x2203('0xc0'))](_0x2203('0xc1'));}return rp(_0x4457c9);}else{throw new db[(_0x2203('0x8b'))][(_0x2203('0xc0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x2203('0x1d')](function(_0x289cde){_0x4d6ece=_0x289cde;if(_0x4d6ece['id']){var _0x5d5e8e={'body':_0x4d6ece[_0x2203('0xc2')],'ChatWebsiteId':_0x4fc1cc['id'],'ChatInteractionId':_0x492179['id'],'direction':_0x2203('0xc3'),'UserId':_0x4b6d6f[_0x2203('0x93')]['id']};return db[_0x2203('0xc4')]['create'](_0x5d5e8e,{});}else{throw new db[(_0x2203('0x8b'))][(_0x2203('0xc0'))](_0x2203('0xc5'));}})['then'](function(){return _0x492179[_0x2203('0xc6')]({'vidaooSessionId':_0x4d6ece['id']});})[_0x2203('0x1d')](respondWithResult(_0xb40f2b,null))[_0x2203('0x27')](handleError(_0xb40f2b,null));};exports['customUpdate']=function(_0x590035,_0x207c86){if(_0x590035[_0x2203('0x37')]['id']){delete _0x590035[_0x2203('0x37')]['id'];}return db[_0x2203('0x41')]['find']({'where':{'id':_0x590035[_0x2203('0xac')]['id']},'include':[{'model':db[_0x2203('0xc7')],'as':_0x2203('0x67')}]})['then'](handleEntityNotFound(_0x207c86,null))['then'](saveUpdates(_0x590035[_0x2203('0x37')],null))[_0x2203('0x1d')](respondWithResult(_0x207c86,null))[_0x2203('0x27')](handleError(_0x207c86,null));};exports[_0x2203('0xc8')]=function(_0x401831,_0x410894,_0x2b0d0b){if(_0x401831[_0x2203('0x37')]['id']){delete _0x401831[_0x2203('0x37')]['id'];}return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x401831['params']['id']}})[_0x2203('0x1d')](function(_0x5edebd){if(!_0x5edebd){logger[_0x2203('0x23')](_0x2203('0xc9'),_0x2203('0xc8'),0x194,_0x2203('0xca'));_0x410894[_0x2203('0x28')](0x194);}else{if(_0x5edebd['UserId']){throw new db[(_0x2203('0x8b'))][(_0x2203('0xc0'))](_0x2203('0xcb'));}}return _0x5edebd;})['then'](function(_0xe9cd8f){if(_0xe9cd8f){return _0xe9cd8f[_0x2203('0x31')]({'closed':_0x401831[_0x2203('0x37')][_0x2203('0xcc')],'disposition':_0x401831['body'][_0x2203('0xcd')]})[_0x2203('0x1d')](function(_0x4508c3){return _0x4508c3;});}})[_0x2203('0x1d')](function(_0x4e3ea8){return respondWithRpcPromise(_0x2203('0xce'),_0x2203('0xc8'),_0x401831['body'],client9004);})[_0x2203('0x1d')](respondWithResult(_0x410894,null))[_0x2203('0x27')](handleError(_0x410894,null));};exports['attachmentUpload']=function(_0x5cb5be,_0x54f1a1,_0x5d21eb){_0x5cb5be[_0x2203('0x37')]['name']=_0x5cb5be[_0x2203('0xcf')]['originalname'];_0x5cb5be['body'][_0x2203('0xd0')]=_0x5cb5be['file'][_0x2203('0xd1')];_0x5cb5be['body'][_0x2203('0x43')]=_0x5cb5be[_0x2203('0xcf')][_0x2203('0xd2')];return db[_0x2203('0xd3')][_0x2203('0xb0')](_0x5cb5be[_0x2203('0x37')])[_0x2203('0x1d')](respondWithResult(_0x54f1a1,0xc9))[_0x2203('0x27')](handleError(_0x54f1a1,null));};exports[_0x2203('0xd4')]=function(_0xabe2eb,_0x453179,_0x359968){return db['ChatInteraction'][_0x2203('0xb3')]({'where':{'id':_0xabe2eb[_0x2203('0xac')]['id']},'raw':!![]})[_0x2203('0x1d')](handleEntityNotFound(_0x453179,null))[_0x2203('0x1d')](function(_0x3d2ba9){if(_0x3d2ba9){if(_0x3d2ba9[_0x2203('0xcc')]){return _0x453179['status'](0x193)[_0x2203('0x2a')]({'status':0x193,'message':_0x2203('0xd5')});}return db[_0x2203('0xd3')][_0x2203('0xb3')]({'where':{'id':_0xabe2eb[_0x2203('0x45')][_0x2203('0xd6')]},'raw':!![]})['then'](handleEntityNotFound(_0x453179,null));}})[_0x2203('0x1d')](function(_0x5a9d4e){if(_0x5a9d4e){var _0x3217a3=_0x5a9d4e['ChatOfflineMessageId']!==null;var _0x219e9d=path[_0x2203('0xd7')](config[_0x2203('0xd8')],_0x2203('0xd9'));if(_0x3217a3){_0x219e9d=path['join'](_0x219e9d,_0x2203('0xda'));}var _0x4598cb=path[_0x2203('0xd7')](_0x219e9d,_0x5a9d4e[_0x2203('0xd0')]);return _0x453179[_0x2203('0xdb')](_0x4598cb);}})[_0x2203('0x27')](handleError(_0x453179,null));};exports[_0x2203('0xdc')]=function(_0x38fb99,_0x5bcf17){var _0x581d9f=null;var _0x5ddb1a=null;var _0x358ab1=null;var _0x5b8c97=null;if(_0x38fb99[_0x2203('0x37')]['id']){delete _0x38fb99[_0x2203('0x37')]['id'];}if(_0x38fb99['body']['mailTranscript']){_0x5b8c97=path[_0x2203('0xd7')](config[_0x2203('0xd8')],'server/files/chat/upload/',util[_0x2203('0xdd')](_0x2203('0xde'),Date[_0x2203('0xdf')]()));_0x38fb99['body'][_0x2203('0xe0')]=_0x5b8c97;}return db['ChatInteraction'][_0x2203('0x61')]({'where':{'id':_0x38fb99['params']['id']},'include':[{'model':db[_0x2203('0xc4')],'as':_0x2203('0xe1'),'include':[{'model':db[_0x2203('0xe2')],'as':_0x2203('0xe2')}]}]})['then'](handleEntityNotFound(_0x5bcf17,null))[_0x2203('0x1d')](saveUpdates(_0x38fb99['body'],null))[_0x2203('0x1d')](function(_0x5f098d){if(_0x5f098d){_0x581d9f=_0x5f098d;return db[_0x2203('0xe3')][_0x2203('0x61')]({'where':{'id':_0x581d9f[_0x2203('0x78')]}});}})[_0x2203('0x1d')](function(_0x5c2159){if(_0x5c2159){_0x358ab1=_0x5c2159;return db[_0x2203('0xc7')][_0x2203('0x61')]({'where':{'id':_0x581d9f[_0x2203('0x6e')]}});}})[_0x2203('0x1d')](function(_0x23daeb){if(_0x23daeb){_0x5ddb1a=_0x23daeb;if(_0x5b8c97){var _0x2ad175=null;for(var _0x3ca475=0x1;_0x3ca475<_0x581d9f[_0x2203('0xe1')][_0x2203('0x49')];++_0x3ca475){_0x2ad175=_0x581d9f[_0x2203('0xe1')][_0x3ca475];var _0x199849=_0x2ad175[_0x2203('0x74')]?util[_0x2203('0xdd')](_0x2203('0xe4'),_0x358ab1[_0x2203('0xe5')],_0x2ad175['UserId']):'System';var _0x4cf298=_0x38fb99[_0x2203('0x37')][_0x2203('0xe6')]||util[_0x2203('0xdd')](_0x2203('0xe4'),_0x2203('0xe7'),_0x2ad175[_0x2203('0x6e')]);switch(_0x358ab1['agentIdentifier']){case _0x2203('0xe8'):_0x199849=_0x2ad175[_0x2203('0x74')]?util['format']('%s%d',_0x358ab1[_0x2203('0xe5')],_0x2ad175['UserId']):_0x2203('0xe9');break;case _0x2203('0xea'):_0x199849=_0x2ad175['UserId']?_0x2ad175[_0x2203('0xe2')][_0x2203('0xeb')]||_0x2ad175['User'][_0x2203('0x3c')]:'System';break;case _0x2203('0xec'):_0x199849=_0x2ad175[_0x2203('0x74')]?_0x2ad175[_0x2203('0xe2')]['fullname']:_0x2203('0xe9');break;default:_0x199849=_0x2ad175[_0x2203('0x74')]?util[_0x2203('0xdd')](_0x2203('0xe4'),_0x358ab1[_0x2203('0xe5')],_0x2ad175['UserId']):_0x2203('0xe9');}var _0x20f50b=util[_0x2203('0xdd')](_0x2203('0xed'),moment(_0x2ad175['createdAt'])[_0x2203('0xdd')](_0x2203('0xee')),_0x2ad175[_0x2203('0xef')]==='in'?_0x4cf298:_0x199849,_0x2ad175[_0x2203('0x37')]);if(!_0x2ad175[_0x2203('0xf0')]){fs['appendFileSync'](_0x5b8c97,_0x20f50b);}}return db[_0x2203('0xf1')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x2203('0xf2')],'as':_0x2203('0xf3'),'raw':!![]}]});}}})[_0x2203('0x1d')](function(_0x16686c){if(_0x16686c&&_0x16686c['Smtp']&&_0x38fb99[_0x2203('0x37')]){var _0x21dfbc={'tls':{'rejectUnauthorized':![]}};if(_0x16686c[_0x2203('0xf3')][_0x2203('0xf4')]){_0x21dfbc[_0x2203('0xf4')]=_0x16686c[_0x2203('0xf3')][_0x2203('0xf4')];}else{_0x21dfbc[_0x2203('0xf5')]=_0x16686c[_0x2203('0xf3')][_0x2203('0xf5')];_0x21dfbc[_0x2203('0xf6')]=_0x16686c[_0x2203('0xf3')][_0x2203('0xf6')];_0x21dfbc[_0x2203('0xf7')]=_0x16686c[_0x2203('0xf3')][_0x2203('0xf7')];}if(_0x16686c['Smtp']['authentication']){_0x21dfbc['auth']={'user':_0x16686c[_0x2203('0xf3')][_0x2203('0x93')],'pass':_0x16686c[_0x2203('0xf3')]['pass']};}return respondWithRpcPromise(_0x2203('0xf8'),_0x2203('0xf9'),{'account':_0x21dfbc,'message':{'from':util[_0x2203('0xdd')](_0x2203('0xfa'),_0x16686c[_0x2203('0x34')],_0x16686c['email']||_0x16686c[_0x2203('0xf3')][_0x2203('0x93')]),'to':_0x38fb99[_0x2203('0x37')][_0x2203('0xfb')],'subject':_0x2203('0xfc'),'text':util['format'](_0x2203('0xfd'),_0x38fb99[_0x2203('0x37')]['mailTranscript']),'attachments':[{'path':_0x5b8c97}]}})['then'](function(){return _0x581d9f;})[_0x2203('0x27')](function(_0xfd2832){console[_0x2203('0x23')](_0xfd2832);});}else{return _0x581d9f;}})[_0x2203('0x1d')](respondWithStatusCode(_0x5bcf17,0xc8))[_0x2203('0x27')](handleError(_0x5bcf17,null));};exports[_0x2203('0xfe')]=function(_0x50d583,_0x5f01c0,_0x30df28){return db[_0x2203('0xc4')][_0x2203('0x61')]({'where':{'id':_0x50d583[_0x2203('0xac')]['id']}})['then'](handleEntityNotFound(_0x5f01c0,null))[_0x2203('0x1d')](function(_0x3fa96f){if(_0x3fa96f){return _0x3fa96f['addMessage'](_0x50d583[_0x2203('0x37')]['ids'],_[_0x2203('0xff')](_0x50d583[_0x2203('0x37')],['ids','id'])||{});}})['then'](respondWithResult(_0x5f01c0,null))[_0x2203('0x27')](handleError(_0x5f01c0,null));};exports[_0x2203('0x100')]=function(_0x4dccbf,_0x2bc31c,_0x5807ef){var _0x45a460={'raw':![],'where':{}};var _0x59eb03={};var _0x2964d7={'count':0x0,'rows':[]};return db[_0x2203('0x41')][_0x2203('0xb3')]({'where':{'id':_0x4dccbf['params']['id']}})[_0x2203('0x1d')](handleEntityNotFound(_0x2bc31c,null))[_0x2203('0x1d')](function(_0x46d93b){if(_0x46d93b){_0x59eb03[_0x2203('0x44')]=_[_0x2203('0xad')](db[_0x2203('0xc4')][_0x2203('0x42')]);_0x59eb03[_0x2203('0x45')]=_[_0x2203('0xad')](_0x4dccbf[_0x2203('0x45')]);_0x59eb03['filters']=_[_0x2203('0x48')](_0x59eb03['model'],_0x59eb03[_0x2203('0x45')]);_0x45a460[_0x2203('0x47')]=_[_0x2203('0x48')](_0x59eb03[_0x2203('0x44')],qs['fields'](_0x4dccbf['query'][_0x2203('0x99')]));_0x45a460['attributes']=_0x45a460[_0x2203('0x47')]['length']?_0x45a460[_0x2203('0x47')]:_0x59eb03['model'];if(!_0x4dccbf['query'][_0x2203('0x4a')](_0x2203('0x4b'))){_0x45a460['limit']=qs[_0x2203('0x2d')](_0x4dccbf[_0x2203('0x45')][_0x2203('0x2d')]);_0x45a460[_0x2203('0x2b')]=qs[_0x2203('0x2b')](_0x4dccbf[_0x2203('0x45')][_0x2203('0x2b')]);}_0x45a460['order']=qs[_0x2203('0x4d')](_0x4dccbf[_0x2203('0x45')][_0x2203('0x4d')]);_0x45a460[_0x2203('0x7d')]=qs[_0x2203('0x46')](_[_0x2203('0x4e')](_0x4dccbf[_0x2203('0x45')],_0x59eb03[_0x2203('0x46')]));_0x45a460[_0x2203('0x7d')][_0x2203('0xa8')]=_0x46d93b['id'];if(_0x4dccbf['query'][_0x2203('0x86')]){_0x45a460[_0x2203('0x7d')]=_[_0x2203('0x36')](_0x45a460[_0x2203('0x7d')],{'$or':_[_0x2203('0x3b')](_0x45a460[_0x2203('0x47')],function(_0x36d988){var _0x36141a={};_0x36141a[_0x36d988]={'$like':'%'+_0x4dccbf[_0x2203('0x45')][_0x2203('0x86')]+'%'};return _0x36141a;})});}if(_0x4dccbf[_0x2203('0x45')][_0x2203('0x7b')]){var _0x2c7cc8=_0x4dccbf['query'][_0x2203('0x7b')][_0x2203('0x6a')](',');var _0x481a3e={};_0x481a3e[_0x2c7cc8[0x0]]={'$gte':moment(_0x2c7cc8[0x1])[_0x2203('0xdd')](_0x2203('0x101'))};_0x45a460[_0x2203('0x7d')]=_[_0x2203('0x36')](_0x45a460[_0x2203('0x7d')],_0x481a3e);}_0x45a460=_[_0x2203('0x36')]({},_0x45a460,_0x4dccbf[_0x2203('0xaf')]);return db[_0x2203('0xc4')][_0x2203('0x2e')]({'where':_0x45a460['where']})[_0x2203('0x1d')](function(_0x2485d3){_0x2964d7[_0x2203('0x2e')]=_0x2485d3;if(_0x4dccbf[_0x2203('0x45')][_0x2203('0x102')]){_0x45a460[_0x2203('0xae')]=[{'all':!![]}];}return db[_0x2203('0xc4')][_0x2203('0x103')](_0x45a460);})['then'](function(_0xc53b76){_0x2964d7['rows']=_0xc53b76;return _0x2964d7;});}})[_0x2203('0x1d')](respondWithFilteredResult(_0x2bc31c,_0x45a460))['catch'](handleError(_0x2bc31c,null));};exports[_0x2203('0x104')]=function(_0x581c4f,_0x3c279b,_0x4031b7){var _0xa9cf5a={'where':{}},_0x135b65={},_0x3c4bc3={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x2203('0xb3')]({'where':{'id':_0x581c4f[_0x2203('0xac')]['id']}})[_0x2203('0x1d')](handleEntityNotFound(_0x3c279b,null))[_0x2203('0x1d')](function(_0x203956){if(_0x203956){_0x135b65[_0x2203('0x44')]=_[_0x2203('0xad')](db[_0x2203('0xc4')]['rawAttributes']);_0x135b65['query']=_['keys'](_0x581c4f[_0x2203('0x45')]);_0x135b65['filters']=_['intersection'](_0x135b65[_0x2203('0x44')],_0x135b65[_0x2203('0x45')]);_0xa9cf5a['attributes']=_['intersection'](_0x135b65[_0x2203('0x44')],qs[_0x2203('0x99')](_0x581c4f[_0x2203('0x45')]['fields']));_0xa9cf5a[_0x2203('0x47')]=_0xa9cf5a[_0x2203('0x47')][_0x2203('0x49')]?_0xa9cf5a[_0x2203('0x47')]:_0x135b65[_0x2203('0x44')];if(!_0x581c4f[_0x2203('0x45')]['hasOwnProperty'](_0x2203('0x4b'))){_0xa9cf5a['limit']=qs[_0x2203('0x2d')](_0x581c4f[_0x2203('0x45')][_0x2203('0x2d')]);_0xa9cf5a[_0x2203('0x2b')]=qs[_0x2203('0x2b')](_0x581c4f[_0x2203('0x45')][_0x2203('0x2b')]);}_0xa9cf5a['order']=qs[_0x2203('0x4d')](_0x581c4f[_0x2203('0x45')]['sort']);_0xa9cf5a[_0x2203('0x7d')]=qs[_0x2203('0x46')](_[_0x2203('0x4e')](_0x581c4f[_0x2203('0x45')],_0x135b65[_0x2203('0x46')]));_0xa9cf5a[_0x2203('0x7d')][_0x2203('0xa8')]=_0x203956['id'];if(_0x581c4f[_0x2203('0x45')][_0x2203('0x86')]){_0xa9cf5a[_0x2203('0x7d')]=_['merge'](_0xa9cf5a[_0x2203('0x7d')],{'$or':_[_0x2203('0x3b')](_0xa9cf5a[_0x2203('0x47')],function(_0x4a6a84){var _0x361282={};_0x361282[_0x4a6a84]={'$like':'%'+_0x581c4f[_0x2203('0x45')][_0x2203('0x86')]+'%'};return _0x361282;})});}_0xa9cf5a[_0x2203('0x7d')][_0x2203('0xf0')]=![];if(_0x581c4f[_0x2203('0x45')]['id']){_0xa9cf5a[_0x2203('0x7d')]['id']={'$gt':_0x581c4f[_0x2203('0x45')]['id']};}_0xa9cf5a=_[_0x2203('0x36')]({},_0xa9cf5a,_0x581c4f[_0x2203('0xaf')]);return db[_0x2203('0xc4')]['count']({'where':_0xa9cf5a[_0x2203('0x7d')]})[_0x2203('0x1d')](function(_0x554450){_0x3c4bc3[_0x2203('0x2e')]=_0x554450;_0xa9cf5a[_0x2203('0xae')]=[];if(_0x581c4f[_0x2203('0x45')][_0x2203('0x105')]){_0xa9cf5a[_0x2203('0xae')][_0x2203('0xa9')]({'model':db[_0x2203('0xe2')],'as':_0x2203('0xe2'),'attributes':['id',_0x2203('0x3c'),'alias']});}if(_0x581c4f[_0x2203('0x45')][_0x2203('0x102')]){_0xa9cf5a['include']=[{'all':!![]}];}return db[_0x2203('0xc4')][_0x2203('0x103')](_0xa9cf5a);})[_0x2203('0x1d')](function(_0x291aef){_0x3c4bc3[_0x2203('0xab')]=_0x291aef;return _0x3c4bc3;});}})[_0x2203('0x1d')](respondWithFilteredResult(_0x3c279b,_0xa9cf5a))[_0x2203('0x27')](handleError(_0x3c279b,null));};exports[_0x2203('0x106')]=function(_0x3e2390,_0x44d30c,_0x46c088){return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x3e2390[_0x2203('0xac')]['id']}})[_0x2203('0x1d')](handleEntityNotFound(_0x44d30c,null))['then'](function(_0x42669a){if(_0x42669a){return _0x42669a['setTags'](_0x3e2390['body'][_0x2203('0x107')],_['omit'](_0x3e2390['body'],['ids','id'])||{})['spread'](function(){return db[_0x2203('0x72')][_0x2203('0x103')]({'attributes':['id',_0x2203('0x34'),_0x2203('0x50')],'where':{'id':_0x3e2390['body'][_0x2203('0x107')]}});})[_0x2203('0x1d')](function(_0x44ff9f){socket['emit']('chatInteractionTags:save',{'id':Number(_0x3e2390[_0x2203('0xac')]['id']),'tags':_0x44ff9f||[]});return{'id':Number(_0x3e2390[_0x2203('0xac')]['id']),'tags':_0x44ff9f||[]};});}})[_0x2203('0x1d')](respondWithResult(_0x44d30c,null))[_0x2203('0x27')](handleError(_0x44d30c,null));};exports[_0x2203('0x108')]=function(_0x2c0df7,_0xdd4efc,_0x2481f5){return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x2c0df7[_0x2203('0xac')]['id']}})['then'](handleEntityNotFound(_0xdd4efc,null))['then'](function(_0x135655){if(_0x135655){return _0x135655[_0x2203('0x108')](_0x2c0df7[_0x2203('0x45')][_0x2203('0x107')]);}})['then'](respondWithStatusCode(_0xdd4efc,null))[_0x2203('0x27')](handleError(_0xdd4efc,null));};exports[_0x2203('0xdb')]=function(_0x4718f4,_0x5b771e){var _0x3dd02d=moment()[_0x2203('0x109')]()[_0x2203('0x98')]();var _0x552a73=path[_0x2203('0xd7')](config['root'],_0x2203('0x10a'),_0x2203('0x10b'),_0x2203('0x10c'));var _0x2111b4=path[_0x2203('0xd7')](config[_0x2203('0xd8')],_0x2203('0x10a'),_0x2203('0x10b'),_0x2203('0x10d'));var _0x20a488=path[_0x2203('0xd7')](_0x552a73,_0x3dd02d);var _0x505c2a=util[_0x2203('0xdd')](_0x2203('0x10e'),_0x4718f4[_0x2203('0xac')]['id'],_0x3dd02d);var _0x44ae18=path[_0x2203('0xd7')](_0x552a73,_0x505c2a);var _0x3fbe4c=[];_0x3fbe4c[_0x2203('0xa9')]({'model':db[_0x2203('0xe2')],'as':_0x2203('0xe2'),'attributes':['id',_0x2203('0x3c')],'raw':!![]});_0x3fbe4c[_0x2203('0xa9')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x2203('0x10f'),_0x2203('0x110')],'raw':!![]});if(_0x4718f4[_0x2203('0x45')][_0x2203('0x10d')]){_0x3fbe4c[_0x2203('0xa9')]({'model':db[_0x2203('0xd3')],'as':_0x2203('0xd3'),'raw':!![]});}var _0x10081d=[{'model':db[_0x2203('0xc4')],'as':_0x2203('0xe1'),'attributes':['id',_0x2203('0x37'),_0x2203('0x7a'),'direction','secret',_0x2203('0x80')],'include':_0x3fbe4c}];_0x10081d['push']({'model':db['ChatWebsite'],'as':_0x2203('0x111'),'attributes':['id','name']});_0x10081d[_0x2203('0xa9')]({'model':db[_0x2203('0xe2')],'as':_0x2203('0x112'),'attributes':['id',_0x2203('0x3c')]});return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x4718f4[_0x2203('0xac')]['id']},'include':_0x10081d})[_0x2203('0x1d')](handleEntityNotFound(_0x5b771e,null))[_0x2203('0x1d')](function(_0x51dbc8){if(_0x51dbc8){var _0xd584ee=_0x51dbc8['get']({'plain':!![]});fs[_0x2203('0x113')](_0x20a488);var _0x1c36d4={'channel':_0x2203('0x114'),'account':_0xd584ee[_0x2203('0x111')][_0x2203('0x34')],'agent':_0xd584ee['Owner']?_0xd584ee[_0x2203('0x112')]['fullname']:_0x2203('0x115'),'createdAt':moment(_0xd584ee['createdAt'])['format'](_0x2203('0x101'))[_0x2203('0x98')](),'closedAt':_0xd584ee[_0x2203('0xcc')]?moment(_0xd584ee[_0x2203('0x116')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x2203('0x98')]():'','disposition':_0xd584ee[_0x2203('0xcd')],'chatInfo':{'browser':_0xd584ee[_0x2203('0x117')],'os':_0xd584ee['osName'],'referer':_0xd584ee['referer'],'customerIp':_0xd584ee[_0x2203('0x118')],'customerPort':_0xd584ee[_0x2203('0x119')]?_0xd584ee[_0x2203('0x119')]:_0x2203('0x115')},'messages':_(_0xd584ee[_0x2203('0xe1')])[_0x2203('0x11a')]()[_0x2203('0x86')]({'secret':![]})[_0x2203('0x3b')](function(_0x2fc5cf){if(_0x2fc5cf[_0x2203('0xd3')]){var _0x2097be=path['join'](_0x2111b4,_0x2fc5cf['Attachment'][_0x2203('0xd0')]);if(fs['existsSync'](_0x2097be)){fs[_0x2203('0x11b')](_0x2097be)[_0x2203('0x11c')](fs['createWriteStream'](path['join'](_0x20a488,_0x2fc5cf[_0x2203('0xd3')][_0x2203('0xd0')])));}}return{'date':moment(_0x2fc5cf[_0x2203('0x7a')])[_0x2203('0xdd')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2203('0x98')](),'sender':_0x2fc5cf[_0x2203('0xef')]==='out'?_0x2fc5cf[_0x2203('0xe2')]?_0x2fc5cf['User'][_0x2203('0x3c')]:'System':_0x2fc5cf[_0x2203('0x67')][_0x2203('0x10f')]+(_0x2fc5cf[_0x2203('0x67')][_0x2203('0x110')]?'\x20'+_0x2fc5cf[_0x2203('0x67')][_0x2203('0x110')]:''),'body':_0x2fc5cf[_0x2203('0xd3')]?_0x2fc5cf['Attachment'][_0x2203('0xd0')]:_0x2fc5cf['body'],'direction':_0x2fc5cf[_0x2203('0xef')]===_0x2203('0xc3')?'A':'C','secret':_0x2fc5cf[_0x2203('0xf0')],'read':_0x2fc5cf[_0x2203('0x80')],'attachment':_0x2fc5cf[_0x2203('0xd3')]};})[_0x2203('0x63')]()};return ejs['renderFile'](path['join'](config[_0x2203('0xd8')],_0x2203('0x10a'),_0x2203('0x11d'),'downloadInteraction.ejs'),{'interaction':_0x1c36d4})[_0x2203('0x1d')](function(_0x15260f){var _0x4419a8=path[_0x2203('0xd7')](_0x20a488,_0x2203('0x11e')+_0xd584ee['id']+'-'+_0x3dd02d+_0x2203('0x11f'));var _0x2af4f6={'path':_0x4419a8,'channel':'Chat','interactionId':_0xd584ee['id']};return pdf[_0x2203('0x120')](_0x15260f,_0x2af4f6);})[_0x2203('0x1d')](function(){return new BPromise(function(_0x3e8221,_0x16ccec){zipdir(_0x20a488,{'saveTo':_0x44ae18},function(_0x7da828,_0x29846d){if(_0x7da828)return _0x16ccec(_0x7da828);return _0x3e8221(_0x29846d);});})[_0x2203('0x1d')](function(){return new BPromise(function(_0x1c3684,_0x11c1db){rimraf(_0x20a488,function(_0x447a00){if(_0x447a00)_0x11c1db(_0x447a00);return _0x1c3684();});});})[_0x2203('0x1d')](function(){return _0x5b771e['download'](_0x44ae18,_0x505c2a,function(_0x2a679c){if(_0x2a679c){console[_0x2203('0x121')](_0x2203('0x122'),_0x2a679c);}else{fs[_0x2203('0x123')](_0x44ae18);}});});});}else{return _0x5b771e[_0x2203('0x28')](0xc8);}})['catch'](handleError(_0x5b771e,null));};
\ No newline at end of file
+var _0xea28=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','sendStatus','stack','name','merge','contact','agent','interaction','account','Users','map','TagIds','Tags','split','forEach','index','ChatInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','u.id','ui.ChatInteractionId','from','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','search','parseSearch','conditions','find','unreadMessages','having','`\x20=\x200','Contact','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','compact','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','params','includeAll','options','create','body','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','now','pathTranscript','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','fullname','[%s]\x20%s:\x20%s\x0a','direction','appendFileSync','MailServerOut','Smtp','service','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','include','findAll','rows','getMyMessages','secret','includeAgent','addTags','setTags','spread','emit','removeTags','files','attachments','transcript-%d-%s.zip','firstName','lastName','Messages','read','Account','Chat','Owner','YYYY-MM-DD\x20HH:mm:ss','browserName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','log','unlinkSync','eml-format','rimraf','zip-dir'];(function(_0x371f3f,_0x132bbc){var _0x20ff76=function(_0xdfc73e){while(--_0xdfc73e){_0x371f3f['push'](_0x371f3f['shift']());}};_0x20ff76(++_0x132bbc);}(_0xea28,0x13a));var _0x8ea2=function(_0x2f76b4,_0x3211ab){_0x2f76b4=_0x2f76b4-0x0;var _0x44ad54=_0xea28[_0x2f76b4];return _0x44ad54;};'use strict';var emlformat=require(_0x8ea2('0x0'));var rimraf=require(_0x8ea2('0x1'));var zipdir=require(_0x8ea2('0x2'));var jsonpatch=require(_0x8ea2('0x3'));var rp=require(_0x8ea2('0x4'));var moment=require(_0x8ea2('0x5'));var BPromise=require(_0x8ea2('0x6'));var Mustache=require(_0x8ea2('0x7'));var util=require('util');var path=require(_0x8ea2('0x8'));var sox=require(_0x8ea2('0x9'));var csv=require(_0x8ea2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ea2('0xb'));var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0xa'));var querystring=require(_0x8ea2('0x11'));var Papa=require(_0x8ea2('0x12'));var Redis=require(_0x8ea2('0x13'));var authService=require(_0x8ea2('0x14'));var qs=require(_0x8ea2('0x15'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x8ea2('0x16'));var logger=require(_0x8ea2('0x17'))(_0x8ea2('0x18'));var utils=require('../../config/utils');var config=require(_0x8ea2('0x19'));var licenseUtil=require(_0x8ea2('0x1a'));var db=require(_0x8ea2('0x1b'))['db'];config[_0x8ea2('0x1c')]=_[_0x8ea2('0x1d')](config['redis'],{'host':_0x8ea2('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8ea2('0x1f'))[_0x8ea2('0x20')](socket);var jayson=require(_0x8ea2('0x21'));var client=jayson[_0x8ea2('0x22')][_0x8ea2('0x23')]({'port':0x232b});var client9004=jayson[_0x8ea2('0x22')][_0x8ea2('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x11f5e8,_0x474873,_0x396aab,_0x2dfa7c){return new BPromise(function(_0x1c1715,_0x3bc774){var _0xaa8abf=_0x2dfa7c||client;return _0xaa8abf[_0x8ea2('0x24')](_0x11f5e8,_0x396aab)[_0x8ea2('0x25')](function(_0x467045){logger[_0x8ea2('0x26')](_0x8ea2('0x27'),_0x474873,_0x8ea2('0x28'));logger[_0x8ea2('0x29')](_0x8ea2('0x2a'),_0x474873,'request\x20sent',JSON['stringify'](_0x467045));if(_0x467045[_0x8ea2('0x2b')]){if(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2c')]===0x1f4){logger['error'](_0x8ea2('0x27'),_0x474873,_0x467045[_0x8ea2('0x2b')]['message']);return _0x3bc774(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);}logger[_0x8ea2('0x2b')](_0x8ea2('0x27'),_0x474873,_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);return _0x1c1715(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);}else{logger[_0x8ea2('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x474873,_0x8ea2('0x28'));_0x1c1715(_0x467045['result'][_0x8ea2('0x2d')]);}})[_0x8ea2('0x2e')](function(_0x29b38f){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x474873,_0x29b38f);_0x3bc774(_0x29b38f);});});}function respondWithStatusCode(_0x2e4da3,_0x4dc7bf){_0x4dc7bf=_0x4dc7bf||0xcc;return function(_0x200a49){if(_0x200a49){return _0x2e4da3['sendStatus'](_0x4dc7bf);}return _0x2e4da3[_0x8ea2('0x2f')](_0x4dc7bf)[_0x8ea2('0x30')]();};}function respondWithResult(_0x21c526,_0x266db8){_0x266db8=_0x266db8||0xc8;return function(_0x4e1b90){if(_0x4e1b90){return _0x21c526['status'](_0x266db8)[_0x8ea2('0x31')](_0x4e1b90);}};}function respondWithFilteredResult(_0x4da5b3,_0x4a9875){return function(_0x287078){if(_0x287078){var _0x24f187=typeof _0x4a9875[_0x8ea2('0x32')]===_0x8ea2('0x33')&&typeof _0x4a9875[_0x8ea2('0x34')]===_0x8ea2('0x33');var _0x316707=_0x287078[_0x8ea2('0x35')];var _0x9c5fac=_0x24f187?0x0:_0x4a9875['offset'];var _0x5b7ff9=_0x24f187?_0x287078[_0x8ea2('0x35')]:_0x4a9875[_0x8ea2('0x32')]+_0x4a9875['limit'];var _0x4a110f;if(_0x5b7ff9>=_0x316707){_0x5b7ff9=_0x316707;_0x4a110f=0xc8;}else{_0x4a110f=0xce;}_0x4da5b3[_0x8ea2('0x2f')](_0x4a110f);return _0x4da5b3['set'](_0x8ea2('0x36'),_0x9c5fac+'-'+_0x5b7ff9+'/'+_0x316707)[_0x8ea2('0x31')](_0x287078);}return null;};}function patchUpdates(_0x53fd06){return function(_0x17b21c){try{jsonpatch[_0x8ea2('0x37')](_0x17b21c,_0x53fd06,!![]);}catch(_0x33abc8){return BPromise['reject'](_0x33abc8);}return _0x17b21c['save']();};}function saveUpdates(_0x49a252,_0x3880c3){return function(_0x233e12){if(_0x233e12){return _0x233e12[_0x8ea2('0x38')](_0x49a252)['then'](function(_0x456487){return _0x456487;});}return null;};}function removeEntity(_0x391b08,_0x3d5bf0){return function(_0x278e5d){if(_0x278e5d){return _0x278e5d[_0x8ea2('0x39')]()[_0x8ea2('0x25')](function(){_0x391b08[_0x8ea2('0x2f')](0xcc)[_0x8ea2('0x30')]();});}};}function handleEntityNotFound(_0x5e9b1f,_0x955ef3){return function(_0x29e3f5){if(!_0x29e3f5){_0x5e9b1f[_0x8ea2('0x3a')](0x194);}return _0x29e3f5;};}function handleError(_0x467d97,_0x4eebc1){_0x4eebc1=_0x4eebc1||0x1f4;return function(_0x2a1f14){logger['error'](_0x2a1f14[_0x8ea2('0x3b')]);if(_0x2a1f14[_0x8ea2('0x3c')]){delete _0x2a1f14[_0x8ea2('0x3c')];}_0x467d97[_0x8ea2('0x2f')](_0x4eebc1)['send'](_0x2a1f14);};}function getMustacheRender(_0x2bed24,_0x531979){return Mustache['render'](_0x2bed24,_[_0x8ea2('0x3d')](_0x531979['body'],{'contact':_0x531979[_0x8ea2('0x3e')],'message':_0x531979[_0x8ea2('0x2d')],'agent':_0x531979[_0x8ea2('0x3f')],'interaction':_0x531979[_0x8ea2('0x40')],'account':_0x531979[_0x8ea2('0x41')]}))||'';}function getInteractionUsers(_0x4ae536,_0x84685d){return new BPromise(function(_0x5c5d2d,_0x12a6c2){try{if(_0x84685d[_0x4ae536['id']]){_0x4ae536[_0x8ea2('0x42')]=_[_0x8ea2('0x43')](_0x84685d[_0x4ae536['id']],function(_0x3995ff){return{'id':_0x3995ff['id'],'fullname':_0x3995ff['fullname']};});}}catch(_0x44e8bc){_0x12a6c2(_0x44e8bc);}_0x5c5d2d(_0x4ae536);});}function getInteractionTags(_0x57a6b8,_0x3f0c78){return new BPromise(function(_0x5ba351,_0x2ee78b){try{if(_0x57a6b8[_0x8ea2('0x44')]){_0x57a6b8[_0x8ea2('0x45')]=[];_0x57a6b8[_0x8ea2('0x44')][_0x8ea2('0x46')](',')[_0x8ea2('0x47')](function(_0x2f4fa8){_0x57a6b8['Tags']['push'](_0x3f0c78[_0x2f4fa8]);});}delete _0x57a6b8[_0x8ea2('0x44')];}catch(_0x53455a){_0x2ee78b(_0x53455a);}_0x5ba351(_0x57a6b8);});}function updateChatInteraction(_0x4b03fa,_0x59e2fa,_0x3cbc09){return new BPromise(function(_0x5d9ba0,_0x40a532){return getInteractionUsers(_0x4b03fa,_0x3cbc09)[_0x8ea2('0x25')](function(_0x39c944){return getInteractionTags(_0x39c944,_0x59e2fa);})[_0x8ea2('0x25')](function(_0x989d9b){_0x5d9ba0(_0x989d9b);})[_0x8ea2('0x2e')](function(_0x3b2219){_0x40a532(_0x3b2219);});});}exports[_0x8ea2('0x48')]=function(_0x5352b9,_0x3afb80){var _0x1ef615={},_0x1db25c={},_0x5cb6ad={'count':0x0,'rows':[]};var _0x2d6bbb=_[_0x8ea2('0x43')](db[_0x8ea2('0x49')][_0x8ea2('0x4a')],function(_0x20992d){return{'name':_0x20992d['fieldName'],'type':_0x20992d[_0x8ea2('0x4b')][_0x8ea2('0x4c')]};});_0x1db25c[_0x8ea2('0x4d')]=_['map'](_0x2d6bbb,_0x8ea2('0x3c'));_0x1db25c[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x5352b9[_0x8ea2('0x4e')]);_0x1db25c[_0x8ea2('0x50')]=_[_0x8ea2('0x51')](_0x1db25c[_0x8ea2('0x4d')],_0x1db25c[_0x8ea2('0x4e')]);_0x1ef615[_0x8ea2('0x52')]=_[_0x8ea2('0x51')](_0x1db25c[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x53')]));_0x1ef615['attributes']=_0x1ef615[_0x8ea2('0x52')][_0x8ea2('0x54')]?_0x1ef615[_0x8ea2('0x52')]:_0x1db25c[_0x8ea2('0x4d')];if(!_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x55')](_0x8ea2('0x56'))){_0x1ef615[_0x8ea2('0x34')]=qs['limit'](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x34')]);_0x1ef615[_0x8ea2('0x32')]=qs['offset'](_0x5352b9['query'][_0x8ea2('0x32')]);}_0x1ef615[_0x8ea2('0x57')]=qs[_0x8ea2('0x58')](_0x5352b9['query'][_0x8ea2('0x58')]);_0x1ef615[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_[_0x8ea2('0x5a')](_0x5352b9[_0x8ea2('0x4e')],_0x1db25c['filters']),_0x2d6bbb);var _0x4afd85=[];var _0x24a22a=squel[_0x8ea2('0x5b')]()[_0x8ea2('0x5c')]('id')['field'](_0x8ea2('0x3c'))[_0x8ea2('0x5c')](_0x8ea2('0x5d'))['from']('tools_tags');var _0x48aebf=squel['select']()['field'](_0x8ea2('0x5e'))[_0x8ea2('0x5c')]('u.fullname')['field'](_0x8ea2('0x5f'))[_0x8ea2('0x60')](_0x8ea2('0x61'),'ui')['left_join'](_0x8ea2('0x62'),'u',_0x8ea2('0x63'));var _0x59e3df=squel[_0x8ea2('0x5b')]()[_0x8ea2('0x60')](_0x8ea2('0x64'),'i')[_0x8ea2('0x65')](_0x8ea2('0x66'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x8ea2('0x67'))[_0x8ea2('0x65')](_0x8ea2('0x68'),'a',_0x8ea2('0x69'))[_0x8ea2('0x65')](_0x8ea2('0x6a'),'me',_0x8ea2('0x6b'))['left_join']('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')[_0x8ea2('0x65')](_0x8ea2('0x6c'),'t',_0x8ea2('0x6d'));var _0x2bbec0=squel['expr']();var _0x11824e=[];var _0x2b8662=squel['expr']();var _0x21485a;if(_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x6e')]){_0x21485a=as[_0x8ea2('0x6f')](_0x5352b9[_0x8ea2('0x4e')]['search']);var _0x479c05=_0x21485a['sqlOperator'];for(var _0x53a62c=0x0;_0x53a62c<_0x21485a[_0x8ea2('0x70')][_0x8ea2('0x54')];_0x53a62c++){var _0x2d8221=_0x21485a[_0x8ea2('0x70')][_0x53a62c];var _0x491d3d='i';var _0x461d32=_[_0x8ea2('0x71')](_0x2d6bbb,[_0x8ea2('0x3c'),_0x2d8221[_0x8ea2('0x5c')]]);if(!_0x461d32){switch(_0x2d8221['field']){case _0x8ea2('0x72'):if(_0x2d8221['value']==0x1){_0x59e3df[_0x8ea2('0x73')]('`'+_0x2d8221['field']+_0x8ea2('0x74'));}else{_0x59e3df[_0x8ea2('0x73')]('`'+_0x2d8221['field']+'`\x20>\x200');}break;case _0x8ea2('0x75'):if(_0x2d8221['operator']===_0x8ea2('0x76')){if(_0x2d8221[_0x8ea2('0x77')][_0x8ea2('0x46')]('\x20')[_0x8ea2('0x54')]>0x1){_0x2bbec0[_0x479c05]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8ea2('0x78')](_0x2d8221[_0x8ea2('0x77')]),null);}else{var _0x39776d='%'+_0x2d8221[_0x8ea2('0x77')]+'%';_0x2bbec0[_0x479c05](_0x8ea2('0x79'),_0x39776d,_0x39776d,_0x39776d);}}else{_0x461d32=_[_0x8ea2('0x71')](_0x2d6bbb,[_0x8ea2('0x3c'),_0x8ea2('0x7a')]);_0x2d8221[_0x8ea2('0x5c')]=_0x8ea2('0x7a');_0x3d55db=as[_0x8ea2('0x7b')](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db['text'],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x30')]);}break;case _0x8ea2('0x7d'):var _0x219f78=_0x2d8221[_0x8ea2('0x77')][_0x8ea2('0x46')](',')[_0x8ea2('0x43')](function(_0xefb7b){return Number(_0xefb7b);});_0x219f78[_0x8ea2('0x47')](function(_0x35cfc5){_0x2b8662['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x35cfc5+',%');});_0x11824e=_[_0x8ea2('0x7e')](_0x11824e,_0x219f78);break;case _0x8ea2('0x7f'):if(_0x2d8221[_0x8ea2('0x80')]===_0x8ea2('0x76')){_0x2bbec0[_0x479c05](_0x8ea2('0x81'),'%'+_0x2d8221['value']+'%',null);}else{_0x461d32=_['find'](_0x2d6bbb,['name',_0x8ea2('0x82')]);_0x2d8221[_0x8ea2('0x5c')]=_0x8ea2('0x82');_0x3d55db=as[_0x8ea2('0x7b')](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db['value'][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')]['end']);}break;case'body':_0x3d55db=as[_0x8ea2('0x7b')]('me',null,_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x30')]);break;}}else{var _0x3d55db=as['buildExpression'](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db['value'][_0x8ea2('0x30')]);}}}else{var _0x356099=_(_0x5352b9[_0x8ea2('0x4e')])['keys']()[_0x8ea2('0x43')](function(_0x5c2d05){return _['some'](_0x2d6bbb,[_0x8ea2('0x3c'),_0x5c2d05])?_0x5c2d05:undefined;})[_0x8ea2('0x84')]()['value']();if(!_['isEmpty'](_0x356099)){_0x356099['forEach'](function(_0x167f15){if(_0x167f15==='ChatWebsiteId'){_0x59e3df['where'](_0x8ea2('0x85'),[][_0x8ea2('0x86')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15]));}else if(_0x167f15===_0x8ea2('0x87')){var _0x1681d8=JSON[_0x8ea2('0x88')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15])[_0x8ea2('0x89')];var _0x14a5de=JSON[_0x8ea2('0x88')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15])[_0x8ea2('0x8a')];_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0x8b'),_0x1681d8,_0x14a5de);}else{if(_0x5352b9['query'][_0x167f15]===_0x8ea2('0x8c')){_0x59e3df[_0x8ea2('0x59')]('i.'+_0x167f15+_0x8ea2('0x8d'));}else{_0x59e3df['where']('i.'+_0x167f15+_0x8ea2('0x8e'),_0x5352b9['query'][_0x167f15]);}}});}if(_0x5352b9[_0x8ea2('0x4e')]['read']){if(_0x5352b9[_0x8ea2('0x4e')]['read']==0x1){_0x59e3df[_0x8ea2('0x73')](_0x8ea2('0x8f'));}else{_0x59e3df['having'](_0x8ea2('0x90'));}}if(_0x5352b9['query'][_0x8ea2('0x91')]){_0x11824e=_[_0x8ea2('0x92')](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x91')])?_0x5352b9[_0x8ea2('0x4e')]['tag']:new Array(_0x5352b9['query'][_0x8ea2('0x91')]);_0x11824e['forEach'](function(_0x410f78){_0x2b8662['or'](_0x8ea2('0x93'),'%,'+_0x410f78+',%');});}if(_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x94')]){var _0x262cef=_0x5352b9[_0x8ea2('0x4e')]['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x8ea2('0x95')](_0x262cef)){_0x2bbec0['or']('i.id\x20LIKE\x20?',_0x262cef+'%');}else{_0x2bbec0['or'](_0x8ea2('0x96'),qs[_0x8ea2('0x78')](_0x262cef))['or'](_0x8ea2('0x97'),_0x262cef+'%');}}}_0x59e3df[_0x8ea2('0x59')](_0x2bbec0);_0x59e3df[_0x8ea2('0x98')](_0x8ea2('0x99'));var _0x4b4d64={'type':db[_0x8ea2('0x9a')][_0x8ea2('0x9b')][_0x8ea2('0x9c')],'raw':!![]};var _0x335a96=_0x59e3df[_0x8ea2('0x9d')]();_0x335a96['field']('i.id');_0x335a96[_0x8ea2('0x5c')](_0x8ea2('0x9e'),_0x8ea2('0x72'));if(_0x1ef615[_0x8ea2('0x57')]){_0x1ef615[_0x8ea2('0x57')][_0x8ea2('0x47')](function(_0x2e0bbe){var _0x9c4960=_0x2e0bbe[0x0]===_0x8ea2('0x9f')?_0x2e0bbe[0x0]:'i.'+_0x2e0bbe[0x0];_0x59e3df[_0x8ea2('0x57')](_0x9c4960,_0x2e0bbe[0x1]===_0x8ea2('0xa0')?![]:!![]);});}if(!_[_0x8ea2('0xa1')](_0x11824e)){_0x59e3df[_0x8ea2('0x73')](_0x2b8662);_0x335a96[_0x8ea2('0x59')](_0x8ea2('0xa2'),_0x11824e);}BPromise[_0x8ea2('0xa3')]()[_0x8ea2('0x25')](function(){if(!_0x21485a){if(_0x5352b9['query']['ChatWebsiteId'])return;_0x335a96[_0x8ea2('0x59')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0xa4'));return;}if(_0x5352b9['user'][_0x8ea2('0xa5')]!=='agent')return;return _0x5352b9[_0x8ea2('0xa6')][_0x8ea2('0xa7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x17dee8){if(_[_0x8ea2('0xa1')](_0x17dee8)){_0x335a96[_0x8ea2('0x59')](_0x8ea2('0xa8'));_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0xa8'));}else{_0x335a96[_0x8ea2('0x59')](_0x8ea2('0x85'),_[_0x8ea2('0x43')](_0x17dee8,'id'));_0x59e3df[_0x8ea2('0x59')]('i.ChatWebsiteId\x20IN\x20?',_[_0x8ea2('0x43')](_0x17dee8,'id'));}});})[_0x8ea2('0x25')](function(){if(_0x5352b9['user'][_0x8ea2('0xa5')]==='agent'&&!_0x21485a&&!_0x5352b9['query']['ChatWebsiteId'])return[];return db[_0x8ea2('0xa9')]['query'](_0x335a96[_0x8ea2('0xaa')](),_0x4b4d64);})[_0x8ea2('0x25')](function(_0x12ed20){_0x5cb6ad[_0x8ea2('0x35')]=_0x12ed20[_0x8ea2('0x54')];if(_0x5cb6ad[_0x8ea2('0x35')]===0x0)return[];return db['sequelize'][_0x8ea2('0x4e')](_0x24a22a['toString'](),_0x4b4d64)[_0x8ea2('0x25')](function(_0x18aa81){_0x4afd85=_[_0x8ea2('0xab')](_0x18aa81,'id');_0x4b4d64=_[_0x8ea2('0x3d')](_0x4b4d64,{'model':db[_0x8ea2('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5352b9['query'][_0x8ea2('0x53')]){_0x1ef615[_0x8ea2('0x52')][_0x8ea2('0x47')](function(_0x2a82b2){_0x59e3df[_0x8ea2('0x5c')]('i.'+_0x2a82b2);});}else{_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0x9e'),_0x8ea2('0x72'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xac'),_0x8ea2('0xad'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xae'),_0x8ea2('0xaf'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb0'),_0x8ea2('0x9f'));_0x59e3df['field'](_0x8ea2('0xb1'));_0x59e3df['field']('c.firstName',_0x8ea2('0xb2'));_0x59e3df[_0x8ea2('0x5c')]('c.lastName',_0x8ea2('0xb3'));_0x59e3df[_0x8ea2('0x5c')]('c.email',_0x8ea2('0xb4'));_0x59e3df[_0x8ea2('0x5c')]('c.phone',_0x8ea2('0xb5'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb6'),_0x8ea2('0xb7'));_0x59e3df[_0x8ea2('0x5c')]('c.fax',_0x8ea2('0xb8'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb9'),_0x8ea2('0xba'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xbb'),_0x8ea2('0xbc'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xbd'),'TagIds');}if(_0x1ef615[_0x8ea2('0x34')])_0x59e3df['limit'](_0x1ef615[_0x8ea2('0x34')]);if(_0x1ef615[_0x8ea2('0x32')])_0x59e3df[_0x8ea2('0x32')](_0x1ef615[_0x8ea2('0x32')]);return db[_0x8ea2('0xa9')]['query'](_0x59e3df[_0x8ea2('0xaa')](),_0x4b4d64);})[_0x8ea2('0x25')](function(_0x4fdd16){if(_0x4fdd16['length']>0x0)_0x48aebf[_0x8ea2('0x59')](_0x8ea2('0xbe'),_['map'](_0x4fdd16,'id'));return db['sequelize'][_0x8ea2('0x4e')](_0x48aebf[_0x8ea2('0xaa')](),_0x4b4d64)['then'](function(_0x2b7e80){var _0x2f6673=_[_0x8ea2('0xbf')](_0x2b7e80,_0x8ea2('0xc0'));var _0xdf4de9=[];_0x4fdd16['forEach'](function(_0x2e3a5d){_0xdf4de9[_0x8ea2('0xc1')](updateChatInteraction(_0x2e3a5d,_0x4afd85,_0x2f6673));});return BPromise[_0x8ea2('0xc2')](_0xdf4de9);});});})[_0x8ea2('0x25')](function(_0x412af1){_0x5cb6ad['rows']=_0x412af1;return _0x5cb6ad;})[_0x8ea2('0x25')](respondWithFilteredResult(_0x3afb80,_0x1ef615))['catch'](handleError(_0x3afb80,null));};exports['show']=function(_0x9468be,_0x17e9fc){var _0x5c95ec={'raw':![],'where':{'id':_0x9468be[_0x8ea2('0xc3')]['id']}},_0x239516={};_0x239516[_0x8ea2('0x4d')]=_[_0x8ea2('0x4f')](db[_0x8ea2('0x49')][_0x8ea2('0x4a')]);_0x239516['query']=_[_0x8ea2('0x4f')](_0x9468be[_0x8ea2('0x4e')]);_0x239516[_0x8ea2('0x50')]=_['intersection'](_0x239516[_0x8ea2('0x4d')],_0x239516[_0x8ea2('0x4e')]);_0x5c95ec[_0x8ea2('0x52')]=_[_0x8ea2('0x51')](_0x239516[_0x8ea2('0x4d')],qs['fields'](_0x9468be[_0x8ea2('0x4e')][_0x8ea2('0x53')]));_0x5c95ec[_0x8ea2('0x52')]=_0x5c95ec[_0x8ea2('0x52')]['length']?_0x5c95ec['attributes']:_0x239516[_0x8ea2('0x4d')];if(_0x9468be['query'][_0x8ea2('0xc4')]){_0x5c95ec['include']=[{'all':!![]}];}_0x5c95ec=_[_0x8ea2('0x3d')]({},_0x5c95ec,_0x9468be[_0x8ea2('0xc5')]);return db[_0x8ea2('0x49')][_0x8ea2('0x71')](_0x5c95ec)[_0x8ea2('0x25')](handleEntityNotFound(_0x17e9fc,null))[_0x8ea2('0x25')](respondWithResult(_0x17e9fc,null))[_0x8ea2('0x2e')](handleError(_0x17e9fc,null));};exports['create']=function(_0x2c5677,_0x224fca){return db[_0x8ea2('0x49')][_0x8ea2('0xc6')](_0x2c5677[_0x8ea2('0xc7')],{})[_0x8ea2('0x25')](respondWithResult(_0x224fca,0xc9))['catch'](handleError(_0x224fca,null));};exports[_0x8ea2('0x38')]=function(_0x463372,_0x76085){if(_0x463372[_0x8ea2('0xc7')]['id']){delete _0x463372['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x463372[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x76085,null))[_0x8ea2('0x25')](saveUpdates(_0x463372['body'],null))[_0x8ea2('0x25')](respondWithResult(_0x76085,null))[_0x8ea2('0x2e')](handleError(_0x76085,null));};exports[_0x8ea2('0x39')]=function(_0x500b47,_0x331019){return db[_0x8ea2('0x49')]['find']({'where':{'id':_0x500b47[_0x8ea2('0xc3')]['id']}})['then'](handleEntityNotFound(_0x331019,null))['then'](removeEntity(_0x331019,null))[_0x8ea2('0x2e')](handleError(_0x331019,null));};exports[_0x8ea2('0xc8')]=function(_0x405020,_0x5c9359){return db[_0x8ea2('0x49')][_0x8ea2('0xc8')]()[_0x8ea2('0x25')](respondWithResult(_0x5c9359,null))[_0x8ea2('0x2e')](handleError(_0x5c9359,null));};exports[_0x8ea2('0xc9')]=function(_0x11c59e,_0x11b02a){var _0x5ab2c4=_0x11c59e[_0x8ea2('0xc3')]['id'];var _0x111f97;var _0xf76d70;var _0x384500;return db[_0x8ea2('0x49')][_0x8ea2('0xca')]({'where':{'id':_0x5ab2c4}})[_0x8ea2('0x25')](function(_0x568581){_0x111f97=_0x568581;return db[_0x8ea2('0xcb')][_0x8ea2('0xca')]({'where':{'id':_0x568581[_0x8ea2('0xcc')]},'attributes':['id',_0x8ea2('0xcd'),_0x8ea2('0xce'),'vidaooTopic',_0x8ea2('0xcf'),_0x8ea2('0xd0')],'raw':!![]});})[_0x8ea2('0x25')](function(_0x1c336e){if(_0x1c336e&&_0x1c336e[_0x8ea2('0xcd')]&&_0x1c336e[_0x8ea2('0xce')]){_0xf76d70=_0x1c336e;var _0x473ae2={'interaction':{'id':_0x5ab2c4},'agent':{'id':_0x11c59e[_0x8ea2('0xa6')]['id'],'name':_0x11c59e[_0x8ea2('0xa6')]['name'],'fullname':_0x11c59e['user']['fullname'],'email':_0x11c59e[_0x8ea2('0xa6')]['email']},'contact':_0x11c59e[_0x8ea2('0xc7')][_0x8ea2('0x3e')],'account':_0x11c59e[_0x8ea2('0xc7')][_0x8ea2('0x41')]};var _0x6c0ccc={'rejectUnauthorized':![],'method':_0x8ea2('0xd1'),'url':_0x8ea2('0xd2'),'headers':{'X-APIKEY':_0x1c336e[_0x8ea2('0xcd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x11c59e[_0x8ea2('0xa6')][_0x8ea2('0xd3')]],'buttons':null,'topic':_0xf76d70['vidaooTopic'],'note':_[_0x8ea2('0xd4')](_0xf76d70[_0x8ea2('0xcf')])?null:getMustacheRender(_0xf76d70[_0x8ea2('0xcf')],_0x473ae2),'metadata':null},'redirect':_0x8ea2('0xd5'),'json':!![]};try{if(!_[_0x8ea2('0xd4')](_0xf76d70[_0x8ea2('0xd0')])){var _0xc6888c=getMustacheRender(_0xf76d70[_0x8ea2('0xd0')],_0x473ae2);var _0x152d46=JSON[_0x8ea2('0x88')](_0xc6888c);_0x6c0ccc[_0x8ea2('0xc7')][_0x8ea2('0xd6')]=_0x152d46;}}catch(_0x465e7f){throw new db[(_0x8ea2('0x9a'))][(_0x8ea2('0xd7'))](_0x8ea2('0xd8'));}return rp(_0x6c0ccc);}else{throw new db[(_0x8ea2('0x9a'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x4b2c0f){_0x384500=_0x4b2c0f;if(_0x384500['id']){var _0x2fcddc={'body':_0x384500[_0x8ea2('0xd9')],'ChatWebsiteId':_0xf76d70['id'],'ChatInteractionId':_0x111f97['id'],'direction':'out','UserId':_0x11c59e[_0x8ea2('0xa6')]['id']};return db[_0x8ea2('0xda')][_0x8ea2('0xc6')](_0x2fcddc,{});}else{throw new db[(_0x8ea2('0x9a'))]['ValidationError'](_0x8ea2('0xdb'));}})['then'](function(){return _0x111f97[_0x8ea2('0xdc')]({'vidaooSessionId':_0x384500['id']});})[_0x8ea2('0x25')](respondWithResult(_0x11b02a,null))[_0x8ea2('0x2e')](handleError(_0x11b02a,null));};exports[_0x8ea2('0xdd')]=function(_0x3b6b03,_0x3292bc){if(_0x3b6b03['body']['id']){delete _0x3b6b03['body']['id'];}return db[_0x8ea2('0x49')][_0x8ea2('0x71')]({'where':{'id':_0x3b6b03['params']['id']},'include':[{'model':db[_0x8ea2('0xde')],'as':'Contact'}]})[_0x8ea2('0x25')](handleEntityNotFound(_0x3292bc,null))[_0x8ea2('0x25')](saveUpdates(_0x3b6b03[_0x8ea2('0xc7')],null))[_0x8ea2('0x25')](respondWithResult(_0x3292bc,null))[_0x8ea2('0x2e')](handleError(_0x3292bc,null));};exports[_0x8ea2('0xdf')]=function(_0x1383b4,_0x4c1b9d,_0x3f3822){if(_0x1383b4[_0x8ea2('0xc7')]['id']){delete _0x1383b4[_0x8ea2('0xc7')]['id'];}return db[_0x8ea2('0x49')][_0x8ea2('0x71')]({'where':{'id':_0x1383b4[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](function(_0x1c974d){if(!_0x1c974d){logger[_0x8ea2('0x2b')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x8ea2('0xdf'),0x194,_0x8ea2('0xe0'));_0x4c1b9d[_0x8ea2('0x3a')](0x194);}else{if(_0x1c974d['UserId']){throw new db[(_0x8ea2('0x9a'))][(_0x8ea2('0xd7'))](_0x8ea2('0xe1'));}}return _0x1c974d;})[_0x8ea2('0x25')](function(_0xe18090){if(_0xe18090){return _0xe18090[_0x8ea2('0x38')]({'closed':_0x1383b4['body']['closed'],'disposition':_0x1383b4[_0x8ea2('0xc7')][_0x8ea2('0xe2')]})[_0x8ea2('0x25')](function(_0x695f4a){return _0x695f4a;});}})[_0x8ea2('0x25')](function(_0x57ff72){return respondWithRpcPromise(_0x8ea2('0xe3'),'abandon',_0x1383b4[_0x8ea2('0xc7')],client9004);})[_0x8ea2('0x25')](respondWithResult(_0x4c1b9d,null))['catch'](handleError(_0x4c1b9d,null));};exports[_0x8ea2('0xe4')]=function(_0x254b51,_0x2c11d2,_0x2aaa88){_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0x3c')]=_0x254b51[_0x8ea2('0xe5')][_0x8ea2('0xe6')];_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0xe7')]=_0x254b51['file'][_0x8ea2('0xe8')];_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0x4b')]=_0x254b51['file'][_0x8ea2('0xe9')];return db['Attachment'][_0x8ea2('0xc6')](_0x254b51[_0x8ea2('0xc7')])[_0x8ea2('0x25')](respondWithResult(_0x2c11d2,0xc9))[_0x8ea2('0x2e')](handleError(_0x2c11d2,null));};exports[_0x8ea2('0xea')]=function(_0x1786ac,_0x7a45a8,_0x3a68e2){return db[_0x8ea2('0x49')]['findOne']({'where':{'id':_0x1786ac[_0x8ea2('0xc3')]['id']},'raw':!![]})[_0x8ea2('0x25')](handleEntityNotFound(_0x7a45a8,null))[_0x8ea2('0x25')](function(_0x8d4abd){if(_0x8d4abd){if(_0x8d4abd[_0x8ea2('0xeb')]){return _0x7a45a8[_0x8ea2('0x2f')](0x193)[_0x8ea2('0x31')]({'status':0x193,'message':_0x8ea2('0xec')});}return db[_0x8ea2('0xed')]['findOne']({'where':{'id':_0x1786ac[_0x8ea2('0x4e')][_0x8ea2('0xee')]},'raw':!![]})[_0x8ea2('0x25')](handleEntityNotFound(_0x7a45a8,null));}})[_0x8ea2('0x25')](function(_0xcbb6b3){if(_0xcbb6b3){var _0x4bdbe0=_0xcbb6b3[_0x8ea2('0xef')]!==null;var _0x44791f=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],_0x8ea2('0xf2'));if(_0x4bdbe0){_0x44791f=path['join'](_0x44791f,_0x8ea2('0xf3'));}var _0x4e7aff=path[_0x8ea2('0xf0')](_0x44791f,_0xcbb6b3[_0x8ea2('0xe7')]);return _0x7a45a8[_0x8ea2('0xf4')](_0x4e7aff);}})['catch'](handleError(_0x7a45a8,null));};exports[_0x8ea2('0xf5')]=function(_0x48a2e2,_0x4e804c){var _0x487bab=null;var _0x1a0966=null;var _0x50087b=null;var _0x196b89=null;if(_0x48a2e2[_0x8ea2('0xc7')]['id']){delete _0x48a2e2[_0x8ea2('0xc7')]['id'];}if(_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf6')]){_0x196b89=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],_0x8ea2('0xf7'),util['format']('transcript-%s.txt',Date[_0x8ea2('0xf8')]()));_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf9')]=_0x196b89;}return db['ChatInteraction']['find']({'where':{'id':_0x48a2e2['params']['id']},'include':[{'model':db[_0x8ea2('0xda')],'as':'Messages','include':[{'model':db['User'],'as':_0x8ea2('0x7f')}]}]})[_0x8ea2('0x25')](handleEntityNotFound(_0x4e804c,null))['then'](saveUpdates(_0x48a2e2['body'],null))[_0x8ea2('0x25')](function(_0x48eac8){if(_0x48eac8){_0x487bab=_0x48eac8;return db['ChatWebsite'][_0x8ea2('0x71')]({'where':{'id':_0x487bab[_0x8ea2('0xcc')]}});}})[_0x8ea2('0x25')](function(_0x54da21){if(_0x54da21){_0x50087b=_0x54da21;return db[_0x8ea2('0xde')][_0x8ea2('0x71')]({'where':{'id':_0x487bab[_0x8ea2('0x7a')]}});}})[_0x8ea2('0x25')](function(_0x3a43d5){if(_0x3a43d5){_0x1a0966=_0x3a43d5;if(_0x196b89){var _0x535b01=null;for(var _0x22e4cd=0x1;_0x22e4cd<_0x487bab['Messages'][_0x8ea2('0x54')];++_0x22e4cd){_0x535b01=_0x487bab['Messages'][_0x22e4cd];var _0x230a70=_0x535b01['UserId']?util['format'](_0x8ea2('0xfa'),_0x50087b[_0x8ea2('0xfb')],_0x535b01[_0x8ea2('0x82')]):_0x8ea2('0xfc');var _0x332670=_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xfd')]||util[_0x8ea2('0xfe')]('%s%d',_0x8ea2('0xff'),_0x535b01[_0x8ea2('0x7a')]);switch(_0x50087b[_0x8ea2('0x100')]){case _0x8ea2('0x101'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?util['format'](_0x8ea2('0xfa'),_0x50087b['agentAlias'],_0x535b01[_0x8ea2('0x82')]):'System';break;case _0x8ea2('0x102'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?_0x535b01[_0x8ea2('0x7f')][_0x8ea2('0x103')]||_0x535b01['User']['fullname']:'System';break;case _0x8ea2('0x104'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?_0x535b01['User'][_0x8ea2('0x105')]:_0x8ea2('0xfc');break;default:_0x230a70=_0x535b01[_0x8ea2('0x82')]?util[_0x8ea2('0xfe')](_0x8ea2('0xfa'),_0x50087b[_0x8ea2('0xfb')],_0x535b01[_0x8ea2('0x82')]):_0x8ea2('0xfc');}var _0x422280=util[_0x8ea2('0xfe')](_0x8ea2('0x106'),moment(_0x535b01[_0x8ea2('0x87')])[_0x8ea2('0xfe')]('MM/DD/YYYY\x20HH:mm:ss'),_0x535b01[_0x8ea2('0x107')]==='in'?_0x332670:_0x230a70,_0x535b01['body']);if(!_0x535b01['secret']){fs[_0x8ea2('0x108')](_0x196b89,_0x422280);}}return db['MailAccount'][_0x8ea2('0xca')]({'where':{'service':!![]},'include':[{'model':db[_0x8ea2('0x109')],'as':_0x8ea2('0x10a'),'raw':!![]}]});}}})[_0x8ea2('0x25')](function(_0xff0fae){if(_0xff0fae&&_0xff0fae['Smtp']&&_0x48a2e2[_0x8ea2('0xc7')]){var _0x3f5688={'tls':{'rejectUnauthorized':![]}};if(_0xff0fae[_0x8ea2('0x10a')]['service']){_0x3f5688['service']=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10b')];}else{_0x3f5688['host']=_0xff0fae[_0x8ea2('0x10a')]['host'];_0x3f5688[_0x8ea2('0x10c')]=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10c')];_0x3f5688[_0x8ea2('0x10d')]=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10d')];}if(_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10e')]){_0x3f5688[_0x8ea2('0x10f')]={'user':_0xff0fae['Smtp']['user'],'pass':_0xff0fae[_0x8ea2('0x10a')]['pass']};}return respondWithRpcPromise(_0x8ea2('0x110'),_0x8ea2('0x111'),{'account':_0x3f5688,'message':{'from':util[_0x8ea2('0xfe')](_0x8ea2('0x112'),_0xff0fae['name'],_0xff0fae[_0x8ea2('0xd3')]||_0xff0fae[_0x8ea2('0x10a')]['user']),'to':_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf6')],'subject':_0x8ea2('0x113'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x48a2e2['body'][_0x8ea2('0xf6')]),'attachments':[{'path':_0x196b89}]}})['then'](function(){return _0x487bab;})[_0x8ea2('0x2e')](function(_0x488acb){console[_0x8ea2('0x2b')](_0x488acb);});}else{return _0x487bab;}})[_0x8ea2('0x25')](respondWithStatusCode(_0x4e804c,0xc8))[_0x8ea2('0x2e')](handleError(_0x4e804c,null));};exports[_0x8ea2('0x114')]=function(_0x54925a,_0x295339,_0x55c23c){return db['ChatMessage']['find']({'where':{'id':_0x54925a[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x295339,null))[_0x8ea2('0x25')](function(_0x48b51d){if(_0x48b51d){return _0x48b51d[_0x8ea2('0x114')](_0x54925a[_0x8ea2('0xc7')][_0x8ea2('0x115')],_[_0x8ea2('0x116')](_0x54925a[_0x8ea2('0xc7')],[_0x8ea2('0x115'),'id'])||{});}})[_0x8ea2('0x25')](respondWithResult(_0x295339,null))[_0x8ea2('0x2e')](handleError(_0x295339,null));};exports[_0x8ea2('0x117')]=function(_0x102d70,_0x2b014d,_0xc35654){var _0x355b91={'raw':![],'where':{}};var _0x1cf414={};var _0x48e543={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x8ea2('0xca')]({'where':{'id':_0x102d70['params']['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x2b014d,null))[_0x8ea2('0x25')](function(_0x3ebbc8){if(_0x3ebbc8){_0x1cf414['model']=_[_0x8ea2('0x4f')](db['ChatMessage']['rawAttributes']);_0x1cf414[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x102d70[_0x8ea2('0x4e')]);_0x1cf414[_0x8ea2('0x50')]=_[_0x8ea2('0x51')](_0x1cf414[_0x8ea2('0x4d')],_0x1cf414[_0x8ea2('0x4e')]);_0x355b91['attributes']=_[_0x8ea2('0x51')](_0x1cf414[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x102d70['query'][_0x8ea2('0x53')]));_0x355b91[_0x8ea2('0x52')]=_0x355b91[_0x8ea2('0x52')]['length']?_0x355b91[_0x8ea2('0x52')]:_0x1cf414[_0x8ea2('0x4d')];if(!_0x102d70[_0x8ea2('0x4e')]['hasOwnProperty']('nolimit')){_0x355b91[_0x8ea2('0x34')]=qs['limit'](_0x102d70[_0x8ea2('0x4e')]['limit']);_0x355b91[_0x8ea2('0x32')]=qs[_0x8ea2('0x32')](_0x102d70[_0x8ea2('0x4e')][_0x8ea2('0x32')]);}_0x355b91[_0x8ea2('0x57')]=qs['sort'](_0x102d70[_0x8ea2('0x4e')][_0x8ea2('0x58')]);_0x355b91[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_[_0x8ea2('0x5a')](_0x102d70[_0x8ea2('0x4e')],_0x1cf414['filters']));_0x355b91['where'][_0x8ea2('0xc0')]=_0x3ebbc8['id'];if(_0x102d70[_0x8ea2('0x4e')]['filter']){_0x355b91[_0x8ea2('0x59')]=_[_0x8ea2('0x3d')](_0x355b91[_0x8ea2('0x59')],{'$or':_[_0x8ea2('0x43')](_0x355b91['attributes'],function(_0x19ea2b){var _0x4450e8={};_0x4450e8[_0x19ea2b]={'$like':'%'+_0x102d70['query'][_0x8ea2('0x94')]+'%'};return _0x4450e8;})});}if(_0x102d70['query'][_0x8ea2('0x89')]){var _0x479b40=_0x102d70['query'][_0x8ea2('0x89')][_0x8ea2('0x46')](',');var _0xbb5964={};_0xbb5964[_0x479b40[0x0]]={'$gte':moment(_0x479b40[0x1])[_0x8ea2('0xfe')]('YYYY-MM-DD\x20HH:mm:ss')};_0x355b91[_0x8ea2('0x59')]=_[_0x8ea2('0x3d')](_0x355b91[_0x8ea2('0x59')],_0xbb5964);}_0x355b91=_['merge']({},_0x355b91,_0x102d70[_0x8ea2('0xc5')]);return db[_0x8ea2('0xda')][_0x8ea2('0x35')]({'where':_0x355b91[_0x8ea2('0x59')]})[_0x8ea2('0x25')](function(_0x46d38e){_0x48e543[_0x8ea2('0x35')]=_0x46d38e;if(_0x102d70['query'][_0x8ea2('0xc4')]){_0x355b91[_0x8ea2('0x118')]=[{'all':!![]}];}return db[_0x8ea2('0xda')][_0x8ea2('0x119')](_0x355b91);})[_0x8ea2('0x25')](function(_0x23f247){_0x48e543[_0x8ea2('0x11a')]=_0x23f247;return _0x48e543;});}})[_0x8ea2('0x25')](respondWithFilteredResult(_0x2b014d,_0x355b91))[_0x8ea2('0x2e')](handleError(_0x2b014d,null));};exports[_0x8ea2('0x11b')]=function(_0x3a37fb,_0x455009,_0x556919){var _0x58a0e5={'where':{}},_0x3be2ce={},_0x56a973={'count':0x0,'rows':[]};return db[_0x8ea2('0x49')][_0x8ea2('0xca')]({'where':{'id':_0x3a37fb[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x455009,null))[_0x8ea2('0x25')](function(_0x515381){if(_0x515381){_0x3be2ce[_0x8ea2('0x4d')]=_[_0x8ea2('0x4f')](db['ChatMessage'][_0x8ea2('0x4a')]);_0x3be2ce[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x3a37fb[_0x8ea2('0x4e')]);_0x3be2ce['filters']=_[_0x8ea2('0x51')](_0x3be2ce[_0x8ea2('0x4d')],_0x3be2ce[_0x8ea2('0x4e')]);_0x58a0e5[_0x8ea2('0x52')]=_['intersection'](_0x3be2ce[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x3a37fb[_0x8ea2('0x4e')]['fields']));_0x58a0e5[_0x8ea2('0x52')]=_0x58a0e5[_0x8ea2('0x52')][_0x8ea2('0x54')]?_0x58a0e5['attributes']:_0x3be2ce['model'];if(!_0x3a37fb[_0x8ea2('0x4e')]['hasOwnProperty'](_0x8ea2('0x56'))){_0x58a0e5[_0x8ea2('0x34')]=qs[_0x8ea2('0x34')](_0x3a37fb[_0x8ea2('0x4e')]['limit']);_0x58a0e5[_0x8ea2('0x32')]=qs['offset'](_0x3a37fb['query']['offset']);}_0x58a0e5['order']=qs[_0x8ea2('0x58')](_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x58')]);_0x58a0e5[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_['pick'](_0x3a37fb['query'],_0x3be2ce[_0x8ea2('0x50')]));_0x58a0e5['where']['ChatInteractionId']=_0x515381['id'];if(_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x94')]){_0x58a0e5[_0x8ea2('0x59')]=_['merge'](_0x58a0e5[_0x8ea2('0x59')],{'$or':_['map'](_0x58a0e5[_0x8ea2('0x52')],function(_0x4041ec){var _0x56178b={};_0x56178b[_0x4041ec]={'$like':'%'+_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x94')]+'%'};return _0x56178b;})});}_0x58a0e5['where'][_0x8ea2('0x11c')]=![];if(_0x3a37fb[_0x8ea2('0x4e')]['id']){_0x58a0e5[_0x8ea2('0x59')]['id']={'$gt':_0x3a37fb[_0x8ea2('0x4e')]['id']};}_0x58a0e5=_[_0x8ea2('0x3d')]({},_0x58a0e5,_0x3a37fb[_0x8ea2('0xc5')]);return db[_0x8ea2('0xda')][_0x8ea2('0x35')]({'where':_0x58a0e5[_0x8ea2('0x59')]})['then'](function(_0xcedece){_0x56a973['count']=_0xcedece;_0x58a0e5[_0x8ea2('0x118')]=[];if(_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x11d')]){_0x58a0e5[_0x8ea2('0x118')][_0x8ea2('0xc1')]({'model':db[_0x8ea2('0x7f')],'as':_0x8ea2('0x7f'),'attributes':['id',_0x8ea2('0x105'),'alias']});}if(_0x3a37fb['query'][_0x8ea2('0xc4')]){_0x58a0e5[_0x8ea2('0x118')]=[{'all':!![]}];}return db[_0x8ea2('0xda')][_0x8ea2('0x119')](_0x58a0e5);})[_0x8ea2('0x25')](function(_0x52bf7c){_0x56a973[_0x8ea2('0x11a')]=_0x52bf7c;return _0x56a973;});}})[_0x8ea2('0x25')](respondWithFilteredResult(_0x455009,_0x58a0e5))['catch'](handleError(_0x455009,null));};exports[_0x8ea2('0x11e')]=function(_0x3be5d0,_0x3ac848,_0x52ce76){return db['ChatInteraction'][_0x8ea2('0x71')]({'where':{'id':_0x3be5d0['params']['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x3ac848,null))[_0x8ea2('0x25')](function(_0x1030c9){if(_0x1030c9){return _0x1030c9[_0x8ea2('0x11f')](_0x3be5d0[_0x8ea2('0xc7')][_0x8ea2('0x115')],_[_0x8ea2('0x116')](_0x3be5d0[_0x8ea2('0xc7')],[_0x8ea2('0x115'),'id'])||{})[_0x8ea2('0x120')](function(){return db[_0x8ea2('0x7d')][_0x8ea2('0x119')]({'attributes':['id',_0x8ea2('0x3c'),_0x8ea2('0x5d')],'where':{'id':_0x3be5d0[_0x8ea2('0xc7')][_0x8ea2('0x115')]}});})[_0x8ea2('0x25')](function(_0x452b94){socket[_0x8ea2('0x121')]('chatInteractionTags:save',{'id':Number(_0x3be5d0['params']['id']),'tags':_0x452b94||[]});return{'id':Number(_0x3be5d0['params']['id']),'tags':_0x452b94||[]};});}})[_0x8ea2('0x25')](respondWithResult(_0x3ac848,null))[_0x8ea2('0x2e')](handleError(_0x3ac848,null));};exports[_0x8ea2('0x122')]=function(_0x9410dd,_0x497671,_0x5e3e8d){return db[_0x8ea2('0x49')]['find']({'where':{'id':_0x9410dd[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x497671,null))[_0x8ea2('0x25')](function(_0x19b042){if(_0x19b042){return _0x19b042[_0x8ea2('0x122')](_0x9410dd[_0x8ea2('0x4e')][_0x8ea2('0x115')]);}})['then'](respondWithStatusCode(_0x497671,null))[_0x8ea2('0x2e')](handleError(_0x497671,null));};exports[_0x8ea2('0xf4')]=function(_0x2dc450,_0x34e1c5){var _0x5b929c=moment()['unix']()[_0x8ea2('0xaa')]();var _0x263123=path[_0x8ea2('0xf0')](config['root'],'server',_0x8ea2('0x123'),'tmp');var _0x40e8e6=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],'server',_0x8ea2('0x123'),_0x8ea2('0x124'));var _0x2dfabc=path[_0x8ea2('0xf0')](_0x263123,_0x5b929c);var _0x515049=util['format'](_0x8ea2('0x125'),_0x2dc450[_0x8ea2('0xc3')]['id'],_0x5b929c);var _0x39000d=path['join'](_0x263123,_0x515049);var _0x3a1752=[];_0x3a1752['push']({'model':db[_0x8ea2('0x7f')],'as':'User','attributes':['id',_0x8ea2('0x105')],'raw':!![]});_0x3a1752['push']({'model':db[_0x8ea2('0xde')],'as':_0x8ea2('0x75'),'attributes':['id',_0x8ea2('0x126'),_0x8ea2('0x127')],'raw':!![]});if(_0x2dc450['query'][_0x8ea2('0x124')]){_0x3a1752[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0xed')],'as':_0x8ea2('0xed'),'raw':!![]});}var _0x5ba508=[{'model':db[_0x8ea2('0xda')],'as':_0x8ea2('0x128'),'attributes':['id',_0x8ea2('0xc7'),_0x8ea2('0x87'),_0x8ea2('0x107'),'secret',_0x8ea2('0x129')],'include':_0x3a1752}];_0x5ba508[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0xcb')],'as':_0x8ea2('0x12a'),'attributes':['id','name']});_0x5ba508[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0x7f')],'as':'Owner','attributes':['id','fullname']});return db['ChatInteraction'][_0x8ea2('0x71')]({'where':{'id':_0x2dc450[_0x8ea2('0xc3')]['id']},'include':_0x5ba508})[_0x8ea2('0x25')](handleEntityNotFound(_0x34e1c5,null))[_0x8ea2('0x25')](function(_0x3c9013){if(_0x3c9013){var _0x103c43=_0x3c9013['get']({'plain':!![]});fs['mkdirSync'](_0x2dfabc);var _0xc099b6={'channel':_0x8ea2('0x12b'),'account':_0x103c43[_0x8ea2('0x12a')]['name'],'agent':_0x103c43['Owner']?_0x103c43[_0x8ea2('0x12c')][_0x8ea2('0x105')]:'N.A.','createdAt':moment(_0x103c43[_0x8ea2('0x87')])['format'](_0x8ea2('0x12d'))[_0x8ea2('0xaa')](),'closedAt':_0x103c43[_0x8ea2('0xeb')]?moment(_0x103c43['closedAt'])[_0x8ea2('0xfe')](_0x8ea2('0x12d'))['toString']():'','disposition':_0x103c43[_0x8ea2('0xe2')],'chatInfo':{'browser':_0x103c43[_0x8ea2('0x12e')],'os':_0x103c43['osName'],'referer':_0x103c43['referer'],'customerIp':_0x103c43[_0x8ea2('0x12f')],'customerPort':_0x103c43[_0x8ea2('0x130')]?_0x103c43[_0x8ea2('0x130')]:'N.A.'},'messages':_(_0x103c43[_0x8ea2('0x128')])[_0x8ea2('0x131')]()[_0x8ea2('0x94')]({'secret':![]})[_0x8ea2('0x43')](function(_0x36799a){if(_0x36799a['Attachment']){var _0x1cc1d9=path['join'](_0x40e8e6,_0x36799a[_0x8ea2('0xed')]['basename']);if(fs[_0x8ea2('0x132')](_0x1cc1d9)){fs[_0x8ea2('0x133')](_0x1cc1d9)[_0x8ea2('0x134')](fs[_0x8ea2('0x135')](path['join'](_0x2dfabc,_0x36799a[_0x8ea2('0xed')][_0x8ea2('0xe7')])));}}return{'date':moment(_0x36799a[_0x8ea2('0x87')])[_0x8ea2('0xfe')](_0x8ea2('0x12d'))[_0x8ea2('0xaa')](),'sender':_0x36799a[_0x8ea2('0x107')]===_0x8ea2('0x136')?_0x36799a[_0x8ea2('0x7f')]?_0x36799a[_0x8ea2('0x7f')][_0x8ea2('0x105')]:'System':_0x36799a[_0x8ea2('0x75')][_0x8ea2('0x126')]+(_0x36799a[_0x8ea2('0x75')]['lastName']?'\x20'+_0x36799a[_0x8ea2('0x75')][_0x8ea2('0x127')]:''),'body':_0x36799a[_0x8ea2('0xed')]?_0x36799a[_0x8ea2('0xed')][_0x8ea2('0xe7')]:_0x36799a[_0x8ea2('0xc7')],'direction':_0x36799a[_0x8ea2('0x107')]===_0x8ea2('0x136')?'A':'C','secret':_0x36799a[_0x8ea2('0x11c')],'read':_0x36799a[_0x8ea2('0x129')],'attachment':_0x36799a['Attachment']};})[_0x8ea2('0x77')]()};return ejs[_0x8ea2('0x137')](path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],'server',_0x8ea2('0x138'),_0x8ea2('0x139')),{'interaction':_0xc099b6})[_0x8ea2('0x25')](function(_0x10d2b3){var _0x12a217=path[_0x8ea2('0xf0')](_0x2dfabc,_0x8ea2('0x13a')+_0x103c43['id']+'-'+_0x5b929c+'.pdf');var _0x44b0dc={'path':_0x12a217,'channel':_0x8ea2('0x12b'),'interactionId':_0x103c43['id']};return pdf['createPdfFromHTML'](_0x10d2b3,_0x44b0dc);})[_0x8ea2('0x25')](function(){return new BPromise(function(_0x27f5e9,_0x19b678){zipdir(_0x2dfabc,{'saveTo':_0x39000d},function(_0x50ebcd,_0x5d6c63){if(_0x50ebcd)return _0x19b678(_0x50ebcd);return _0x27f5e9(_0x5d6c63);});})[_0x8ea2('0x25')](function(){return new BPromise(function(_0x55b3a1,_0x57e228){rimraf(_0x2dfabc,function(_0x3c669b){if(_0x3c669b)_0x57e228(_0x3c669b);return _0x55b3a1();});});})[_0x8ea2('0x25')](function(){return _0x34e1c5['download'](_0x39000d,_0x515049,function(_0x688d21){if(_0x688d21){console[_0x8ea2('0x13b')]('err',_0x688d21);}else{fs[_0x8ea2('0x13c')](_0x39000d);}});});});}else{return _0x34e1c5['sendStatus'](0xc8);}})[_0x8ea2('0x2e')](handleError(_0x34e1c5,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 4dd1daa..fd39c89 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 _0x3e25=['emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x1eff20,_0xa93827){var _0x44ccfe=function(_0x15a7a0){while(--_0x15a7a0){_0x1eff20['push'](_0x1eff20['shift']());}};_0x44ccfe(++_0xa93827);}(_0x3e25,0x1ea));var _0x53e2=function(_0x57027e,_0xaef912){_0x57027e=_0x57027e-0x0;var _0x139fde=_0x3e25[_0x57027e];return _0x139fde;};'use strict';var EventEmitter=require(_0x53e2('0x0'));var ChatInteraction=require(_0x53e2('0x1'))['db'][_0x53e2('0x2')];var ChatMessage=require(_0x53e2('0x1'))['db'][_0x53e2('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x53e2('0x4')](0x0);var events={'afterCreate':_0x53e2('0x5'),'afterUpdate':'update','afterDestroy':_0x53e2('0x6')};function emitEvent(_0x140f6f){return function(_0x3cd8cc,_0x2a60f9,_0xe9a93f){_0x3cd8cc[_0x53e2('0x7')]({'attributes':['id'],'raw':!![]})[_0x53e2('0x8')](function(_0x2ea5d7){_0x3cd8cc[_0x53e2('0x9')](_0x53e2('0xa'),_0x2ea5d7[_0x53e2('0xb')](function(_0x5ab94a){return{'id':_0x5ab94a['id']};}));return ChatMessage[_0x53e2('0xc')]({'where':{'ChatInteractionId':_0x3cd8cc['id'],'direction':'in','read':![]},'raw':!![]});})[_0x53e2('0x8')](function(_0x4f8c08){_0x3cd8cc['setDataValue'](_0x53e2('0xd'),_0x4f8c08['length']);ChatInteractionEvents[_0x53e2('0xe')](_0x140f6f+':'+_0x3cd8cc['id'],_0x3cd8cc);ChatInteractionEvents[_0x53e2('0xe')](_0x140f6f,_0x3cd8cc);_0xe9a93f(null);})[_0x53e2('0xf')](_0xe9a93f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x53e2('0x10')](e,emitEvent(event));}}module[_0x53e2('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x4680=['save','update','remove','then','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x4680,0x1ce));var _0x0468=function(_0x51ff59,_0x23a4f0){_0x51ff59=_0x51ff59-0x0;var _0x36d2e3=_0x4680[_0x51ff59];return _0x36d2e3;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x0468('0x0'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0x0468('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0468('0x2')](0x0);var events={'afterCreate':_0x0468('0x3'),'afterUpdate':_0x0468('0x4'),'afterDestroy':_0x0468('0x5')};function emitEvent(_0x1d2efa){return function(_0x462798,_0x5444bd,_0x2c38df){_0x462798['getUsers']({'attributes':['id'],'raw':!![]})[_0x0468('0x6')](function(_0x2ac0bd){_0x462798[_0x0468('0x7')](_0x0468('0x8'),_0x2ac0bd['map'](function(_0x2d5c7c){return{'id':_0x2d5c7c['id']};}));return ChatMessage[_0x0468('0x9')]({'where':{'ChatInteractionId':_0x462798['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0468('0x6')](function(_0x4151ec){_0x462798[_0x0468('0x7')](_0x0468('0xa'),_0x4151ec[_0x0468('0xb')]);ChatInteractionEvents[_0x0468('0xc')](_0x1d2efa+':'+_0x462798['id'],_0x462798);ChatInteractionEvents[_0x0468('0xc')](_0x1d2efa,_0x462798);_0x2c38df(null);})['catch'](_0x2c38df(null));};}for(var e in events){if(events[_0x0468('0xd')](e)){var event=events[e];ChatInteraction[_0x0468('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 41ea64a..1c6f0bd 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 _0xc400=['api','moment','bluebird','path','rimraf','./chatInteraction.attributes','chat_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','util'];(function(_0x82cdae,_0x2f1e49){var _0x2eb8b2=function(_0x36c931){while(--_0x36c931){_0x82cdae['push'](_0x82cdae['shift']());}};_0x2eb8b2(++_0x2f1e49);}(_0xc400,0x197));var _0x0c40=function(_0x19c889,_0x3eacc2){_0x19c889=_0x19c889-0x0;var _0x1ff28c=_0xc400[_0x19c889];return _0x1ff28c;};'use strict';var _=require('lodash');var util=require(_0x0c40('0x0'));var logger=require('../../config/logger')(_0x0c40('0x1'));var moment=require(_0x0c40('0x2'));var BPromise=require(_0x0c40('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c40('0x4'));var rimraf=require(_0x0c40('0x5'));var config=require('../../config/environment');var attributes=require(_0x0c40('0x6'));module['exports']=function(_0x3788c2,_0x41492){return _0x3788c2['define']('ChatInteraction',attributes,{'tableName':_0x0c40('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x277c40,_0x2b2655,_0x351f49){if(_0x277c40['changed'](_0x0c40('0x8'))){_0x277c40['closedAt']=moment()[_0x0c40('0x9')](_0x0c40('0xa'));}_0x351f49(null,_0x277c40);}},'charset':_0x0c40('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x49e9=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x1c1bd5,_0x2f079c){var _0x3eb95b=function(_0x3b0ee2){while(--_0x3b0ee2){_0x1c1bd5['push'](_0x1c1bd5['shift']());}};_0x3eb95b(++_0x2f079c);}(_0x49e9,0x1b3));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var logger=require(_0x949e('0x2'))(_0x949e('0x3'));var moment=require(_0x949e('0x4'));var BPromise=require('bluebird');var rp=require(_0x949e('0x5'));var fs=require('fs');var path=require(_0x949e('0x6'));var rimraf=require(_0x949e('0x7'));var config=require(_0x949e('0x8'));var attributes=require(_0x949e('0x9'));module[_0x949e('0xa')]=function(_0x290d42,_0x53e85f){return _0x290d42[_0x949e('0xb')]('ChatInteraction',attributes,{'tableName':_0x949e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b53f9,_0x3d69ba,_0x4fb042){if(_0x2b53f9[_0x949e('0xd')](_0x949e('0xe'))){_0x2b53f9[_0x949e('0xf')]=moment()[_0x949e('0x10')](_0x949e('0x11'));}_0x4fb042(null,_0x2b53f9);}},'charset':_0x949e('0x12'),'collate':_0x949e('0x13')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 315ad60..53e1e67 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 _0xbcac=['debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatInteraction','update','body','raw','options','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','where','then','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x505099,_0xb10ee1){var _0x577eba=function(_0x4b36b1){while(--_0x4b36b1){_0x505099['push'](_0x505099['shift']());}};_0x577eba(++_0xb10ee1);}(_0xbcac,0x75));var _0xcbca=function(_0x459a0b,_0x3cb7fe){_0x459a0b=_0x459a0b-0x0;var _0x8baee5=_0xbcac[_0x459a0b];return _0x8baee5;};'use strict';var _=require(_0xcbca('0x0'));var util=require(_0xcbca('0x1'));var moment=require(_0xcbca('0x2'));var BPromise=require(_0xcbca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbca('0x4'));var db=require(_0xcbca('0x5'))['db'];var utils=require(_0xcbca('0x6'));var logger=require(_0xcbca('0x7'))(_0xcbca('0x8'));var config=require(_0xcbca('0x9'));var jayson=require(_0xcbca('0xa'));var client=jayson[_0xcbca('0xb')]['http']({'port':0x232a});config[_0xcbca('0xc')]=_[_0xcbca('0xd')](config['redis'],{'host':_0xcbca('0xe'),'port':0x18eb});var socket=require(_0xcbca('0xf'))(new Redis(config[_0xcbca('0xc')]));require('./chatInteraction.socket')[_0xcbca('0x10')](socket);function respondWithRpcPromise(_0x4714f1,_0x4ab38d,_0x4fe297){return new BPromise(function(_0xf55a03,_0x141fd4){return client[_0xcbca('0x11')](_0x4714f1,_0x4fe297)['then'](function(_0x4a5870){logger[_0xcbca('0x12')](_0xcbca('0x13'),_0x4ab38d,_0xcbca('0x14'));logger[_0xcbca('0x15')](_0xcbca('0x16'),_0x4ab38d,_0xcbca('0x14'),JSON[_0xcbca('0x17')](_0x4a5870));if(_0x4a5870[_0xcbca('0x18')]){if(_0x4a5870[_0xcbca('0x18')][_0xcbca('0x19')]===0x1f4){logger['error'](_0xcbca('0x13'),_0x4ab38d,_0x4a5870[_0xcbca('0x18')][_0xcbca('0x1a')]);return _0x141fd4(_0x4a5870[_0xcbca('0x18')][_0xcbca('0x1a')]);}logger[_0xcbca('0x18')](_0xcbca('0x13'),_0x4ab38d,_0x4a5870[_0xcbca('0x18')][_0xcbca('0x1a')]);return _0xf55a03(_0x4a5870[_0xcbca('0x18')][_0xcbca('0x1a')]);}else{logger[_0xcbca('0x12')](_0xcbca('0x13'),_0x4ab38d,_0xcbca('0x14'));_0xf55a03(_0x4a5870[_0xcbca('0x1b')][_0xcbca('0x1a')]);}})[_0xcbca('0x1c')](function(_0x512c52){logger[_0xcbca('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x4ab38d,_0x512c52);_0x141fd4(_0x512c52);});});}exports['UpdateChatInteraction']=function(_0xd57f8d){var _0x4b270b=this;return new Promise(function(_0x2538ba,_0x40ab19){return db[_0xcbca('0x1d')][_0xcbca('0x1e')](_0xd57f8d[_0xcbca('0x1f')],{'raw':_0xd57f8d['options']?_0xd57f8d['options'][_0xcbca('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd57f8d[_0xcbca('0x21')]?_0xd57f8d[_0xcbca('0x21')]['where']||null:null,'attributes':_0xd57f8d[_0xcbca('0x21')]?_0xd57f8d[_0xcbca('0x21')][_0xcbca('0x22')]||null:null,'limit':_0xd57f8d[_0xcbca('0x21')]?_0xd57f8d[_0xcbca('0x21')][_0xcbca('0x23')]||null:null})['then'](function(_0x1a2f6c){logger[_0xcbca('0x12')](_0xcbca('0x24'),_0xd57f8d);logger[_0xcbca('0x15')](_0xcbca('0x24'),_0xd57f8d,JSON[_0xcbca('0x17')](_0x1a2f6c));_0x2538ba(_0x1a2f6c);})[_0xcbca('0x1c')](function(_0x281209){logger['error']('UpdateChatInteraction',_0x281209['message'],_0xd57f8d);_0x40ab19(_0x4b270b[_0xcbca('0x18')](0x1f4,_0x281209[_0xcbca('0x1a')]));});});};exports[_0xcbca('0x25')]=function(_0x39d142){return new Promise(function(_0x296fc,_0x26a304){return db[_0xcbca('0x1d')][_0xcbca('0x26')]({'where':_0x39d142['options']?_0x39d142[_0xcbca('0x21')][_0xcbca('0x27')]||null:null})[_0xcbca('0x28')](function(_0x293412){if(_0x293412){return _0x293412[_0xcbca('0x29')](_0x39d142[_0xcbca('0x1f')][_0xcbca('0x2a')],_[_0xcbca('0x2b')](_0x39d142[_0xcbca('0x1f')],['ids','id'])||{});}})[_0xcbca('0x2c')](function(_0x6b2caa){logger[_0xcbca('0x12')](_0xcbca('0x2d'),_0x39d142);logger[_0xcbca('0x15')](_0xcbca('0x2d'),_0x39d142,JSON[_0xcbca('0x17')](_0x6b2caa));_0x296fc(_0x6b2caa);})[_0xcbca('0x1c')](function(_0x461ced){logger[_0xcbca('0x18')]('AddTags',_0x461ced[_0xcbca('0x1a')],_0x39d142);_0x26a304(_this[_0xcbca('0x18')](0x1f4,_0x461ced[_0xcbca('0x1a')]));});});};
\ No newline at end of file
+var _0xa774=['then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','UpdateChatInteraction','update','body','raw','options','where','attributes','limit','catch','AddTagsToChatInteraction','ChatInteraction','find','ids','omit','AddTags','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x140e3c,_0x20fe71){var _0x13d287=function(_0x191fc6){while(--_0x191fc6){_0x140e3c['push'](_0x140e3c['shift']());}};_0x13d287(++_0x20fe71);}(_0xa774,0xeb));var _0x4a77=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xa774[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0x4a77('0x0'));var util=require('util');var moment=require(_0x4a77('0x1'));var BPromise=require(_0x4a77('0x2'));var rs=require(_0x4a77('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a77('0x4'))['db'];var utils=require(_0x4a77('0x5'));var logger=require(_0x4a77('0x6'))(_0x4a77('0x7'));var config=require('../../config/environment');var jayson=require(_0x4a77('0x8'));var client=jayson[_0x4a77('0x9')][_0x4a77('0xa')]({'port':0x232a});config[_0x4a77('0xb')]=_[_0x4a77('0xc')](config[_0x4a77('0xb')],{'host':_0x4a77('0xd'),'port':0x18eb});var socket=require(_0x4a77('0xe'))(new Redis(config['redis']));require(_0x4a77('0xf'))[_0x4a77('0x10')](socket);function respondWithRpcPromise(_0x3b5e6c,_0x3d8079,_0xcf7b06){return new BPromise(function(_0x12802a,_0x29623f){return client['request'](_0x3b5e6c,_0xcf7b06)[_0x4a77('0x11')](function(_0x40f826){logger[_0x4a77('0x12')](_0x4a77('0x13'),_0x3d8079,'request\x20sent');logger[_0x4a77('0x14')](_0x4a77('0x15'),_0x3d8079,'request\x20sent',JSON['stringify'](_0x40f826));if(_0x40f826[_0x4a77('0x16')]){if(_0x40f826['error'][_0x4a77('0x17')]===0x1f4){logger[_0x4a77('0x16')](_0x4a77('0x13'),_0x3d8079,_0x40f826[_0x4a77('0x16')][_0x4a77('0x18')]);return _0x29623f(_0x40f826[_0x4a77('0x16')][_0x4a77('0x18')]);}logger[_0x4a77('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x3d8079,_0x40f826['error'][_0x4a77('0x18')]);return _0x12802a(_0x40f826[_0x4a77('0x16')][_0x4a77('0x18')]);}else{logger[_0x4a77('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x3d8079,_0x4a77('0x19'));_0x12802a(_0x40f826['result'][_0x4a77('0x18')]);}})['catch'](function(_0x21cc5e){logger['error'](_0x4a77('0x13'),_0x3d8079,_0x21cc5e);_0x29623f(_0x21cc5e);});});}exports[_0x4a77('0x1a')]=function(_0x4b44bd){var _0x537266=this;return new Promise(function(_0x219872,_0x1d9ea5){return db['ChatInteraction'][_0x4a77('0x1b')](_0x4b44bd[_0x4a77('0x1c')],{'raw':_0x4b44bd['options']?_0x4b44bd['options'][_0x4a77('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b44bd[_0x4a77('0x1e')]?_0x4b44bd[_0x4a77('0x1e')][_0x4a77('0x1f')]||null:null,'attributes':_0x4b44bd[_0x4a77('0x1e')]?_0x4b44bd[_0x4a77('0x1e')][_0x4a77('0x20')]||null:null,'limit':_0x4b44bd[_0x4a77('0x1e')]?_0x4b44bd[_0x4a77('0x1e')][_0x4a77('0x21')]||null:null})[_0x4a77('0x11')](function(_0x1225a4){logger[_0x4a77('0x12')](_0x4a77('0x1a'),_0x4b44bd);logger[_0x4a77('0x14')](_0x4a77('0x1a'),_0x4b44bd,JSON['stringify'](_0x1225a4));_0x219872(_0x1225a4);})[_0x4a77('0x22')](function(_0x58e8e6){logger[_0x4a77('0x16')](_0x4a77('0x1a'),_0x58e8e6[_0x4a77('0x18')],_0x4b44bd);_0x1d9ea5(_0x537266['error'](0x1f4,_0x58e8e6[_0x4a77('0x18')]));});});};exports[_0x4a77('0x23')]=function(_0x3b0c50){return new Promise(function(_0x3029dd,_0x1843b0){return db[_0x4a77('0x24')][_0x4a77('0x25')]({'where':_0x3b0c50[_0x4a77('0x1e')]?_0x3b0c50[_0x4a77('0x1e')][_0x4a77('0x1f')]||null:null})[_0x4a77('0x11')](function(_0x5d4d96){if(_0x5d4d96){return _0x5d4d96['addTags'](_0x3b0c50[_0x4a77('0x1c')][_0x4a77('0x26')],_[_0x4a77('0x27')](_0x3b0c50[_0x4a77('0x1c')],[_0x4a77('0x26'),'id'])||{});}})['spread'](function(_0x1b58a9){logger[_0x4a77('0x12')](_0x4a77('0x28'),_0x3b0c50);logger[_0x4a77('0x14')](_0x4a77('0x28'),_0x3b0c50,JSON[_0x4a77('0x29')](_0x1b58a9));_0x3029dd(_0x1b58a9);})['catch'](function(_0x3f4f68){logger['error'](_0x4a77('0x28'),_0x3f4f68[_0x4a77('0x18')],_0x3b0c50);_0x1843b0(_this['error'](0x1f4,_0x3f4f68[_0x4a77('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index defb8d2..0f47ceb 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 _0x5daf=['removeListener','register','length','chatInteraction:','./chatInteraction.events','save','update'];(function(_0x133fbc,_0x57016e){var _0x321783=function(_0x344152){while(--_0x344152){_0x133fbc['push'](_0x133fbc['shift']());}};_0x321783(++_0x57016e);}(_0x5daf,0x19a));var _0xf5da=function(_0x55b486,_0x273b01){_0x55b486=_0x55b486-0x0;var _0x3cfa54=_0x5daf[_0x55b486];return _0x3cfa54;};'use strict';var ChatInteractionEvents=require(_0xf5da('0x0'));var events=[_0xf5da('0x1'),'remove',_0xf5da('0x2')];function createListener(_0x3d888e,_0xe6dd28){return function(_0x5e818e){_0xe6dd28['emit'](_0x3d888e,_0x5e818e);};}function removeListener(_0x8218db,_0x435a42){return function(){ChatInteractionEvents[_0xf5da('0x3')](_0x8218db,_0x435a42);};}exports[_0xf5da('0x4')]=function(_0x279449){for(var _0x4c1d95=0x0,_0xc9c1c4=events[_0xf5da('0x5')];_0x4c1d95<_0xc9c1c4;_0x4c1d95++){var _0x2238dc=events[_0x4c1d95];var _0x5520c5=createListener(_0xf5da('0x6')+_0x2238dc,_0x279449);ChatInteractionEvents['on'](_0x2238dc,_0x5520c5);}};
\ No newline at end of file
+var _0x8498=['register','chatInteraction:','./chatInteraction.events','remove','removeListener'];(function(_0x29026f,_0xe1eb38){var _0x3cab7a=function(_0x325644){while(--_0x325644){_0x29026f['push'](_0x29026f['shift']());}};_0x3cab7a(++_0xe1eb38);}(_0x8498,0x70));var _0x8849=function(_0x25ea85,_0x5cbaa6){_0x25ea85=_0x25ea85-0x0;var _0x598596=_0x8498[_0x25ea85];return _0x598596;};'use strict';var ChatInteractionEvents=require(_0x8849('0x0'));var events=['save',_0x8849('0x1'),'update'];function createListener(_0x14db60,_0x41a5d2){return function(_0x4954e0){_0x41a5d2['emit'](_0x14db60,_0x4954e0);};}function removeListener(_0x32538c,_0x2556bf){return function(){ChatInteractionEvents[_0x8849('0x2')](_0x32538c,_0x2556bf);};}exports[_0x8849('0x3')]=function(_0x2dacd7){for(var _0x501a6b=0x0,_0x2e3ba5=events['length'];_0x501a6b<_0x2e3ba5;_0x501a6b++){var _0x59a0c4=events[_0x501a6b];var _0x5a5ab9=createListener(_0x8849('0x4')+_0x59a0c4,_0x2dacd7);ChatInteractionEvents['on'](_0x59a0c4,_0x5a5ab9);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 417a35c..c8d6e0f 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 _0x3a92=['/describe','isAuthenticated','describe','/:id','show','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','post','create','/:id/vidaoo','diskStorage','root','server/files/attachments/','format','%s-%s','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','/:id/tags','tracked','addTags','put','chat','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','delete','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index'];(function(_0x2166a3,_0x237c50){var _0x260035=function(_0x2dbfa2){while(--_0x2dbfa2){_0x2166a3['push'](_0x2166a3['shift']());}};_0x260035(++_0x237c50);}(_0x3a92,0xac));var _0x23a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a92[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x23a9('0x0'));var express=require('express');var router=express[_0x23a9('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x23a9('0x2'));var interaction=require(_0x23a9('0x3'));var config=require(_0x23a9('0x4'));var controller=require(_0x23a9('0x5'));router[_0x23a9('0x6')]('/',auth['isAuthenticated'](),controller[_0x23a9('0x7')]);router[_0x23a9('0x6')](_0x23a9('0x8'),auth[_0x23a9('0x9')](),controller[_0x23a9('0xa')]);router[_0x23a9('0x6')](_0x23a9('0xb'),auth['isChatInteractionAuthorized'](),controller[_0x23a9('0xc')]);router[_0x23a9('0x6')]('/:id/attachment_download',auth[_0x23a9('0xd')](),controller[_0x23a9('0xe')]);router[_0x23a9('0x6')]('/:id/messages',auth[_0x23a9('0x9')](),controller[_0x23a9('0xf')]);router['get'](_0x23a9('0x10'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get']('/:id/download',auth[_0x23a9('0x9')](),controller['download']);router[_0x23a9('0x11')]('/',auth[_0x23a9('0x9')](),controller[_0x23a9('0x12')]);router['post'](_0x23a9('0x13'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x23a9('0x14')]({'destination':function(_0x1f0bae,_0x469e9c,_0x52addb){_0x52addb(null,path['join'](config[_0x23a9('0x15')],_0x23a9('0x16')));},'filename':function(_0x3b2314,_0x3cc365,_0x426a2b){_0x426a2b(null,util[_0x23a9('0x17')](_0x23a9('0x18'),Date['now'](),_0x3cc365['originalname'][_0x23a9('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x23a9('0x11')](_0x23a9('0x1a'),upload[_0x23a9('0x1b')](_0x23a9('0x1c')),controller[_0x23a9('0x1d')]);router['post'](_0x23a9('0x1e'),auth[_0x23a9('0xd')](),controller['addMessage']);router[_0x23a9('0x11')](_0x23a9('0x1f'),auth[_0x23a9('0x9')](),interaction[_0x23a9('0x20')]('chat','chatinteraction:addtags'),controller[_0x23a9('0x21')]);router[_0x23a9('0x22')]('/:id',auth[_0x23a9('0x9')](),interaction[_0x23a9('0x20')](_0x23a9('0x23'),_0x23a9('0x24')),controller['update']);router[_0x23a9('0x22')](_0x23a9('0x25'),controller[_0x23a9('0x26')]);router[_0x23a9('0x22')](_0x23a9('0x27'),auth[_0x23a9('0xd')](),controller[_0x23a9('0x28')]);router['put'](_0x23a9('0x29'),controller[_0x23a9('0x2a')]);router['delete'](_0x23a9('0xb'),auth['isAuthenticated'](),interaction[_0x23a9('0x20')](_0x23a9('0x23'),_0x23a9('0x2b')),controller['destroy']);router[_0x23a9('0x2c')](_0x23a9('0x1f'),auth[_0x23a9('0x9')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0x70e8=['chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/close','close','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','post','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','put','chat'];(function(_0x4463f4,_0x2b38f2){var _0x29a8a2=function(_0x5c6c98){while(--_0x5c6c98){_0x4463f4['push'](_0x4463f4['shift']());}};_0x29a8a2(++_0x2b38f2);}(_0x70e8,0x1f0));var _0x870e=function(_0x5f047a,_0x1c61fb){_0x5f047a=_0x5f047a-0x0;var _0x2d2b7e=_0x70e8[_0x5f047a];return _0x2d2b7e;};'use strict';var multer=require(_0x870e('0x0'));var util=require(_0x870e('0x1'));var path=require(_0x870e('0x2'));var timeout=require(_0x870e('0x3'));var express=require('express');var router=express[_0x870e('0x4')]();var fs_extra=require(_0x870e('0x5'));var auth=require(_0x870e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x870e('0x7'));var controller=require(_0x870e('0x8'));router[_0x870e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x870e('0x9')](_0x870e('0xa'),auth[_0x870e('0xb')](),controller[_0x870e('0xc')]);router[_0x870e('0x9')](_0x870e('0xd'),auth[_0x870e('0xe')](),controller[_0x870e('0xf')]);router[_0x870e('0x9')](_0x870e('0x10'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router['get'](_0x870e('0x11'),auth[_0x870e('0xb')](),controller[_0x870e('0x12')]);router[_0x870e('0x9')](_0x870e('0x13'),auth[_0x870e('0xe')](),controller['getMyMessages']);router[_0x870e('0x9')](_0x870e('0x14'),auth[_0x870e('0xb')](),controller[_0x870e('0x15')]);router['post']('/',auth[_0x870e('0xb')](),controller[_0x870e('0x16')]);router['post'](_0x870e('0x17'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x870e('0x18')]({'destination':function(_0x593652,_0x1c096a,_0x56a55a){_0x56a55a(null,path[_0x870e('0x19')](config[_0x870e('0x1a')],_0x870e('0x1b')));},'filename':function(_0x4afd76,_0x5bbf41,_0x30d581){_0x30d581(null,util[_0x870e('0x1c')](_0x870e('0x1d'),Date[_0x870e('0x1e')](),_0x5bbf41[_0x870e('0x1f')][_0x870e('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x870e('0x21')](_0x870e('0x22'),upload[_0x870e('0x23')](_0x870e('0x24')),controller[_0x870e('0x25')]);router['post'](_0x870e('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x870e('0x26')]);router['post'](_0x870e('0x27'),auth[_0x870e('0xb')](),interaction[_0x870e('0x28')]('chat',_0x870e('0x29')),controller['addTags']);router[_0x870e('0x2a')](_0x870e('0xd'),auth[_0x870e('0xb')](),interaction['tracked'](_0x870e('0x2b'),_0x870e('0x2c')),controller[_0x870e('0x2d')]);router[_0x870e('0x2a')](_0x870e('0x2e'),controller[_0x870e('0x2f')]);router[_0x870e('0x2a')]('/:id/abandon',auth[_0x870e('0xe')](),controller['abandon']);router[_0x870e('0x2a')](_0x870e('0x30'),controller[_0x870e('0x31')]);router['delete'](_0x870e('0xd'),auth[_0x870e('0xb')](),interaction[_0x870e('0x28')](_0x870e('0x2b'),_0x870e('0x32')),controller[_0x870e('0x33')]);router['delete'](_0x870e('0x27'),auth[_0x870e('0xb')](),controller[_0x870e('0x34')]);module[_0x870e('0x35')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index ef78738..3c080e9 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 _0x86fb=['exports','TEXT','BOOLEAN','INTEGER','sequelize'];(function(_0x5342ea,_0x2b3389){var _0xa7d610=function(_0x345a32){while(--_0x345a32){_0x5342ea['push'](_0x5342ea['shift']());}};_0xa7d610(++_0x2b3389);}(_0x86fb,0xae));var _0xb86f=function(_0x227c2b,_0x311a03){_0x227c2b=_0x227c2b-0x0;var _0x57c2d5=_0x86fb[_0x227c2b];return _0x57c2d5;};'use strict';var Sequelize=require(_0xb86f('0x0'));module[_0xb86f('0x1')]={'body':{'type':Sequelize[_0xb86f('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb86f('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb86f('0x4')]}};
\ No newline at end of file
+var _0x8924=['medium','INTEGER','sequelize','exports','TEXT'];(function(_0x210316,_0x8169eb){var _0x6aaf33=function(_0x5eea61){while(--_0x5eea61){_0x210316['push'](_0x210316['shift']());}};_0x6aaf33(++_0x8169eb);}(_0x8924,0x66));var _0x4892=function(_0x345a17,_0x3b9d2a){_0x345a17=_0x345a17-0x0;var _0xd0f947=_0x8924[_0x345a17];return _0xd0f947;};'use strict';var Sequelize=require(_0x4892('0x0'));module[_0x4892('0x1')]={'body':{'type':Sequelize[_0x4892('0x2')](_0x4892('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4892('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 94c6974..5228cbd 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 _0x5952=['VoiceQueue','VoiceQueues','get','UserProfileSection','find','Agents','userProfileId','autoAssociation','isEmpty','role','resourceId','push','messages','FromId','read','rimraf','bluebird','util','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','map','ChatInternalMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','update','body','describe','lastMessageAt','createdAt','lastMessage','getUsers','User','agent','admin','user','fullname','userpic','internal','online','allowmessenger','showWebBar','-online'];(function(_0x4a5f7d,_0x310d5e){var _0x5d3052=function(_0x57c9cf){while(--_0x57c9cf){_0x4a5f7d['push'](_0x4a5f7d['shift']());}};_0x5d3052(++_0x310d5e);}(_0x5952,0x77));var _0x2595=function(_0x8320c7,_0x54af56){_0x8320c7=_0x8320c7-0x0;var _0x5f449d=_0x5952[_0x8320c7];return _0x5f449d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2595('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2595('0x1'));var Mustache=require('mustache');var util=require(_0x2595('0x2'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2595('0x3'));var squel=require(_0x2595('0x4'));var crypto=require('crypto');var jsforce=require(_0x2595('0x5'));var deskjs=require(_0x2595('0x6'));var toCsv=require(_0x2595('0x7'));var querystring=require('querystring');var Papa=require(_0x2595('0x8'));var Redis=require('ioredis');var authService=require(_0x2595('0x9'));var qs=require(_0x2595('0xa'));var as=require(_0x2595('0xb'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2595('0xc'))(_0x2595('0xd'));var utils=require(_0x2595('0xe'));var config=require(_0x2595('0xf'));var licenseUtil=require(_0x2595('0x10'));var db=require(_0x2595('0x11'))['db'];config[_0x2595('0x12')]=_[_0x2595('0x13')](config[_0x2595('0x12')],{'host':_0x2595('0x14'),'port':0x18eb});var socket=require(_0x2595('0x15'))(new Redis(config[_0x2595('0x12')]));require('./chatInternalMessage.socket')[_0x2595('0x16')](socket);function respondWithStatusCode(_0x121459,_0x4061d6){_0x4061d6=_0x4061d6||0xcc;return function(_0x3e0b8c){if(_0x3e0b8c){return _0x121459[_0x2595('0x17')](_0x4061d6);}return _0x121459[_0x2595('0x18')](_0x4061d6)[_0x2595('0x19')]();};}function respondWithResult(_0x44664d,_0x110074){_0x110074=_0x110074||0xc8;return function(_0x23ab9d){if(_0x23ab9d){return _0x44664d[_0x2595('0x18')](_0x110074)['json'](_0x23ab9d);}};}function respondWithFilteredResult(_0x4b9086,_0x593a64){return function(_0x67e94f){if(_0x67e94f){var _0x1f418b=typeof _0x593a64[_0x2595('0x1a')]==='undefined'&&typeof _0x593a64[_0x2595('0x1b')]===_0x2595('0x1c');var _0x4fe984=_0x67e94f[_0x2595('0x1d')];var _0x15f6d5=_0x1f418b?0x0:_0x593a64[_0x2595('0x1a')];var _0x16ccad=_0x1f418b?_0x67e94f[_0x2595('0x1d')]:_0x593a64['offset']+_0x593a64[_0x2595('0x1b')];var _0x2a76ba;if(_0x16ccad>=_0x4fe984){_0x16ccad=_0x4fe984;_0x2a76ba=0xc8;}else{_0x2a76ba=0xce;}_0x4b9086[_0x2595('0x18')](_0x2a76ba);return _0x4b9086['set'](_0x2595('0x1e'),_0x15f6d5+'-'+_0x16ccad+'/'+_0x4fe984)[_0x2595('0x1f')](_0x67e94f);}return null;};}function patchUpdates(_0x274b9b){return function(_0x315500){try{jsonpatch[_0x2595('0x20')](_0x315500,_0x274b9b,!![]);}catch(_0x24b275){return BPromise[_0x2595('0x21')](_0x24b275);}return _0x315500[_0x2595('0x22')]();};}function saveUpdates(_0x171c96,_0x593908){return function(_0x325ca6){if(_0x325ca6){return _0x325ca6['update'](_0x171c96)[_0x2595('0x23')](function(_0x5535a7){return _0x5535a7;});}return null;};}function removeEntity(_0x2ea59f,_0x363a9c){return function(_0x5b60ac){if(_0x5b60ac){return _0x5b60ac[_0x2595('0x24')]()[_0x2595('0x23')](function(){_0x2ea59f['status'](0xcc)[_0x2595('0x19')]();});}};}function handleEntityNotFound(_0x4470fc,_0x3efa1d){return function(_0x188704){if(!_0x188704){_0x4470fc[_0x2595('0x17')](0x194);}return _0x188704;};}function handleError(_0x193a43,_0x5ee524){_0x5ee524=_0x5ee524||0x1f4;return function(_0x1eb1c2){logger[_0x2595('0x25')](_0x1eb1c2[_0x2595('0x26')]);if(_0x1eb1c2['name']){delete _0x1eb1c2[_0x2595('0x27')];}_0x193a43[_0x2595('0x18')](_0x5ee524)['send'](_0x1eb1c2);};}exports['index']=function(_0x130a03,_0x52207c){var _0x51248f={},_0x570274={},_0x3a251b={'count':0x0,'rows':[]};var _0x48d549=_[_0x2595('0x28')](db[_0x2595('0x29')][_0x2595('0x2a')],function(_0x374c64){return{'name':_0x374c64['fieldName'],'type':_0x374c64[_0x2595('0x2b')][_0x2595('0x2c')]};});_0x570274[_0x2595('0x2d')]=_['map'](_0x48d549,_0x2595('0x27'));_0x570274[_0x2595('0x2e')]=_[_0x2595('0x2f')](_0x130a03[_0x2595('0x2e')]);_0x570274[_0x2595('0x30')]=_[_0x2595('0x31')](_0x570274[_0x2595('0x2d')],_0x570274[_0x2595('0x2e')]);_0x51248f[_0x2595('0x32')]=_[_0x2595('0x31')](_0x570274['model'],qs[_0x2595('0x33')](_0x130a03[_0x2595('0x2e')][_0x2595('0x33')]));_0x51248f[_0x2595('0x32')]=_0x51248f[_0x2595('0x32')][_0x2595('0x34')]?_0x51248f[_0x2595('0x32')]:_0x570274[_0x2595('0x2d')];if(!_0x130a03[_0x2595('0x2e')][_0x2595('0x35')](_0x2595('0x36'))){_0x51248f[_0x2595('0x1b')]=qs[_0x2595('0x1b')](_0x130a03[_0x2595('0x2e')]['limit']);_0x51248f[_0x2595('0x1a')]=qs[_0x2595('0x1a')](_0x130a03[_0x2595('0x2e')][_0x2595('0x1a')]);}_0x51248f[_0x2595('0x37')]=qs[_0x2595('0x38')](_0x130a03[_0x2595('0x2e')]['sort']);_0x51248f[_0x2595('0x39')]=qs[_0x2595('0x30')](_[_0x2595('0x3a')](_0x130a03['query'],_0x570274[_0x2595('0x30')]),_0x48d549);if(_0x130a03[_0x2595('0x2e')][_0x2595('0x3b')]){_0x51248f['where']=_[_0x2595('0x3c')](_0x51248f[_0x2595('0x39')],{'$or':_[_0x2595('0x28')](_0x48d549,function(_0x40cb8d){if(_0x40cb8d[_0x2595('0x2b')]!==_0x2595('0x3d')){var _0x1f5e56={};_0x1f5e56[_0x40cb8d[_0x2595('0x27')]]={'$like':'%'+_0x130a03['query']['filter']+'%'};return _0x1f5e56;}})});}_0x51248f=_[_0x2595('0x3c')]({},_0x51248f,_0x130a03[_0x2595('0x3e')]);var _0x578269={'where':_0x51248f['where']};return db[_0x2595('0x29')][_0x2595('0x1d')](_0x578269)[_0x2595('0x23')](function(_0x544fe4){_0x3a251b[_0x2595('0x1d')]=_0x544fe4;if(_0x130a03[_0x2595('0x2e')][_0x2595('0x3f')]){_0x51248f[_0x2595('0x40')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x2595('0x41')](_0x51248f);})[_0x2595('0x23')](function(_0x587e2e){_0x3a251b[_0x2595('0x42')]=_0x587e2e;return _0x3a251b;})[_0x2595('0x23')](respondWithFilteredResult(_0x52207c,_0x51248f))[_0x2595('0x43')](handleError(_0x52207c,null));};exports[_0x2595('0x44')]=function(_0x4800a5,_0x485241){var _0x4b9205={'raw':!![],'where':{'id':_0x4800a5[_0x2595('0x45')]['id']}},_0x32537b={};_0x32537b['model']=_[_0x2595('0x2f')](db[_0x2595('0x29')][_0x2595('0x2a')]);_0x32537b[_0x2595('0x2e')]=_[_0x2595('0x2f')](_0x4800a5[_0x2595('0x2e')]);_0x32537b[_0x2595('0x30')]=_[_0x2595('0x31')](_0x32537b[_0x2595('0x2d')],_0x32537b[_0x2595('0x2e')]);_0x4b9205[_0x2595('0x32')]=_[_0x2595('0x31')](_0x32537b[_0x2595('0x2d')],qs[_0x2595('0x33')](_0x4800a5[_0x2595('0x2e')][_0x2595('0x33')]));_0x4b9205[_0x2595('0x32')]=_0x4b9205['attributes']['length']?_0x4b9205[_0x2595('0x32')]:_0x32537b[_0x2595('0x2d')];if(_0x4800a5['query'][_0x2595('0x3f')]){_0x4b9205['include']=[{'all':!![]}];}_0x4b9205=_[_0x2595('0x3c')]({},_0x4b9205,_0x4800a5[_0x2595('0x3e')]);return db[_0x2595('0x29')]['find'](_0x4b9205)['then'](handleEntityNotFound(_0x485241,null))[_0x2595('0x23')](respondWithResult(_0x485241,null))[_0x2595('0x43')](handleError(_0x485241,null));};exports[_0x2595('0x46')]=function(_0x3c7ad2,_0x2b6f50){return db[_0x2595('0x29')]['create'](_0x3c7ad2['body'],{})[_0x2595('0x23')](respondWithResult(_0x2b6f50,0xc9))[_0x2595('0x43')](handleError(_0x2b6f50,null));};exports[_0x2595('0x47')]=function(_0x3684f6,_0x44487b){if(_0x3684f6[_0x2595('0x48')]['id']){delete _0x3684f6[_0x2595('0x48')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x3684f6[_0x2595('0x45')]['id']}})[_0x2595('0x23')](handleEntityNotFound(_0x44487b,null))['then'](saveUpdates(_0x3684f6[_0x2595('0x48')],null))[_0x2595('0x23')](respondWithResult(_0x44487b,null))[_0x2595('0x43')](handleError(_0x44487b,null));};exports[_0x2595('0x24')]=function(_0x5cdbfa,_0x37531b){return db[_0x2595('0x29')]['find']({'where':{'id':_0x5cdbfa[_0x2595('0x45')]['id']}})[_0x2595('0x23')](handleEntityNotFound(_0x37531b,null))['then'](removeEntity(_0x37531b,null))[_0x2595('0x43')](handleError(_0x37531b,null));};exports[_0x2595('0x49')]=function(_0x25f120,_0x2dd90c){return db[_0x2595('0x29')]['describe']()[_0x2595('0x23')](respondWithResult(_0x2dd90c,null))[_0x2595('0x43')](handleError(_0x2dd90c,null));};function wrapUser(_0x20e67e){return function(_0x5a143a){var _0x4fe274=_0x20e67e['get']({'plain':!![]});_0x4fe274['messages']=[];if(_0x5a143a){_0x4fe274[_0x2595('0x4a')]=_0x5a143a[_0x2595('0x4b')];_0x4fe274[_0x2595('0x4c')]=_0x5a143a;}else{_0x4fe274[_0x2595('0x4a')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4fe274['lastMessage']={};}return _0x4fe274;};}exports[_0x2595('0x4d')]=function(_0x1a0193,_0x5413d5,_0x3ff556){var _0x2984cd=[];return db[_0x2595('0x4e')]['findAll']({'where':{'role':[_0x2595('0x4f'),_0x2595('0x50'),_0x2595('0x51')]},'attributes':['id',_0x2595('0x52'),_0x2595('0x27'),'role',_0x2595('0x53'),_0x2595('0x54'),_0x2595('0x55'),'lastLoginAt',_0x2595('0x56'),_0x2595('0x57')],'order':qs[_0x2595('0x38')](_0x2595('0x58')),'include':[{'model':db[_0x2595('0x59')],'as':_0x2595('0x5a'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x2595('0x23')](function(_0x39d4dd){if(_0x39d4dd){var _0x49db1b=_0x1a0193[_0x2595('0x51')][_0x2595('0x5b')]({'plain':!![]});if(!_0x49db1b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49db1b['role']===_0x2595('0x51')){return db[_0x2595('0x5c')][_0x2595('0x5d')]({'where':{'name':_0x2595('0x5e'),'userProfileId':_0x49db1b[_0x2595('0x5f')]},'raw':!![]})[_0x2595('0x23')](function(_0x3c9f19){if(_0x3c9f19){if(_0x3c9f19[_0x2595('0x60')]===0x0){return db['UserProfileResource'][_0x2595('0x41')]({'where':{'sectionId':_0x3c9f19['id']},'raw':!![]})[_0x2595('0x23')](function(_0x2db901){var _0x240281=[];if(_[_0x2595('0x61')](_0x2db901)){_0x240281=_[_0x2595('0x3b')](_0x39d4dd,function(_0x3a3f5){if(_0x3a3f5[_0x2595('0x62')]!==_0x2595('0x4f')){return _0x3a3f5;}});return _0x240281;}else{for(var _0x1c9b04=0x0;_0x1c9b04<_0x39d4dd[_0x2595('0x34')];_0x1c9b04++){var _0x5db8c2=_0x39d4dd[_0x1c9b04];if(_0x5db8c2[_0x2595('0x62')]==='agent'){var _0x559f63=_[_0x2595('0x5d')](_0x2db901,function(_0x120cfe){return _0x120cfe[_0x2595('0x63')]===_0x5db8c2['id'];});if(_0x559f63)_0x240281[_0x2595('0x64')](_0x5db8c2);}else{_0x240281['push'](_0x5db8c2);}}return _0x240281;}});}else{return _0x39d4dd;}}else{var _0x3c4f2c=_[_0x2595('0x3b')](_0x39d4dd,function(_0x6135ec){if(_0x6135ec['role']!==_0x2595('0x4f')){return _0x6135ec;}});return _0x3c4f2c;}});}else{return _0x39d4dd;}}})[_0x2595('0x23')](function(_0x46ffb4){var _0x35746f=[];if(_0x46ffb4){_0x2984cd=_0x46ffb4;for(var _0x6fcead=0x0;_0x6fcead<_0x46ffb4[_0x2595('0x34')];_0x6fcead+=0x1){_0x2984cd[_0x6fcead][_0x2595('0x65')]=[];_0x35746f[_0x2595('0x64')](db[_0x2595('0x29')]['find']({'where':{'FromId':[_0x1a0193[_0x2595('0x51')]['id'],_0x46ffb4[_0x6fcead]['id']],'ToId':[_0x1a0193['user']['id'],_0x46ffb4[_0x6fcead]['id']],'ChatGroupId':null},'attributes':['id',_0x2595('0x4b'),_0x2595('0x66'),'ToId',_0x2595('0x67'),'body'],'order':qs[_0x2595('0x38')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x46ffb4[_0x6fcead])));}return BPromise['all'](_0x35746f);}return[];})[_0x2595('0x23')](function(_0x1a018a){return{'rows':_0x1a018a,'count':_0x1a018a[_0x2595('0x34')]};})[_0x2595('0x23')](respondWithResult(_0x5413d5,null))['catch'](handleError(_0x5413d5,null));};
\ No newline at end of file
+var _0xd029=['allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','read','sort','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','send','index','map','ChatInternalMessage','rawAttributes','fieldName','key','model','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','pick','filter','where','type','VIRTUAL','name','merge','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','createdAt','format','lastMessage','User','admin','user','fullname','role','userpic','internal','online','lastLoginAt'];(function(_0x21c772,_0x186c52){var _0x279fd1=function(_0x5cf561){while(--_0x5cf561){_0x21c772['push'](_0x21c772['shift']());}};_0x279fd1(++_0x186c52);}(_0xd029,0x173));var _0x9d02=function(_0x4e8c41,_0x200665){_0x4e8c41=_0x4e8c41-0x0;var _0x576e62=_0xd029[_0x4e8c41];return _0x576e62;};'use strict';var emlformat=require(_0x9d02('0x0'));var rimraf=require(_0x9d02('0x1'));var zipdir=require(_0x9d02('0x2'));var jsonpatch=require(_0x9d02('0x3'));var rp=require('request-promise');var moment=require(_0x9d02('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9d02('0x5'));var util=require(_0x9d02('0x6'));var path=require(_0x9d02('0x7'));var sox=require('sox');var csv=require(_0x9d02('0x8'));var ejs=require(_0x9d02('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d02('0xa'));var squel=require('squel');var crypto=require(_0x9d02('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9d02('0xc'));var toCsv=require(_0x9d02('0x8'));var querystring=require(_0x9d02('0xd'));var Papa=require('papaparse');var Redis=require(_0x9d02('0xe'));var authService=require(_0x9d02('0xf'));var qs=require(_0x9d02('0x10'));var as=require(_0x9d02('0x11'));var hardwareService=require(_0x9d02('0x12'));var logger=require(_0x9d02('0x13'))(_0x9d02('0x14'));var utils=require(_0x9d02('0x15'));var config=require(_0x9d02('0x16'));var licenseUtil=require(_0x9d02('0x17'));var db=require(_0x9d02('0x18'))['db'];config[_0x9d02('0x19')]=_[_0x9d02('0x1a')](config[_0x9d02('0x19')],{'host':_0x9d02('0x1b'),'port':0x18eb});var socket=require(_0x9d02('0x1c'))(new Redis(config[_0x9d02('0x19')]));require(_0x9d02('0x1d'))['register'](socket);function respondWithStatusCode(_0x337a30,_0xaa6ec0){_0xaa6ec0=_0xaa6ec0||0xcc;return function(_0x13675b){if(_0x13675b){return _0x337a30['sendStatus'](_0xaa6ec0);}return _0x337a30['status'](_0xaa6ec0)['end']();};}function respondWithResult(_0x5c6c61,_0x610bc1){_0x610bc1=_0x610bc1||0xc8;return function(_0x59b3f4){if(_0x59b3f4){return _0x5c6c61[_0x9d02('0x1e')](_0x610bc1)['json'](_0x59b3f4);}};}function respondWithFilteredResult(_0x16eff5,_0xca7182){return function(_0x378d47){if(_0x378d47){var _0x48b5ca=typeof _0xca7182[_0x9d02('0x1f')]===_0x9d02('0x20')&&typeof _0xca7182[_0x9d02('0x21')]===_0x9d02('0x20');var _0x37ac61=_0x378d47['count'];var _0x31975c=_0x48b5ca?0x0:_0xca7182[_0x9d02('0x1f')];var _0x3c9c45=_0x48b5ca?_0x378d47[_0x9d02('0x22')]:_0xca7182[_0x9d02('0x1f')]+_0xca7182['limit'];var _0x525ce3;if(_0x3c9c45>=_0x37ac61){_0x3c9c45=_0x37ac61;_0x525ce3=0xc8;}else{_0x525ce3=0xce;}_0x16eff5[_0x9d02('0x1e')](_0x525ce3);return _0x16eff5[_0x9d02('0x23')](_0x9d02('0x24'),_0x31975c+'-'+_0x3c9c45+'/'+_0x37ac61)[_0x9d02('0x25')](_0x378d47);}return null;};}function patchUpdates(_0x4724c3){return function(_0x4edd77){try{jsonpatch[_0x9d02('0x26')](_0x4edd77,_0x4724c3,!![]);}catch(_0x40e655){return BPromise[_0x9d02('0x27')](_0x40e655);}return _0x4edd77[_0x9d02('0x28')]();};}function saveUpdates(_0x531e59,_0x5a179e){return function(_0x619695){if(_0x619695){return _0x619695[_0x9d02('0x29')](_0x531e59)['then'](function(_0x42a2c9){return _0x42a2c9;});}return null;};}function removeEntity(_0x4c8bff,_0x1cb03e){return function(_0x5844a4){if(_0x5844a4){return _0x5844a4[_0x9d02('0x2a')]()[_0x9d02('0x2b')](function(){_0x4c8bff[_0x9d02('0x1e')](0xcc)[_0x9d02('0x2c')]();});}};}function handleEntityNotFound(_0x588165,_0x43b100){return function(_0x35b314){if(!_0x35b314){_0x588165['sendStatus'](0x194);}return _0x35b314;};}function handleError(_0x1e886e,_0x58de9a){_0x58de9a=_0x58de9a||0x1f4;return function(_0x2821f6){logger[_0x9d02('0x2d')](_0x2821f6[_0x9d02('0x2e')]);if(_0x2821f6['name']){delete _0x2821f6['name'];}_0x1e886e[_0x9d02('0x1e')](_0x58de9a)[_0x9d02('0x2f')](_0x2821f6);};}exports[_0x9d02('0x30')]=function(_0x523f7b,_0x41cc43){var _0x3fcdd4={},_0x1111c6={},_0x2fc19b={'count':0x0,'rows':[]};var _0x575d93=_[_0x9d02('0x31')](db[_0x9d02('0x32')][_0x9d02('0x33')],function(_0x1e8ab0){return{'name':_0x1e8ab0[_0x9d02('0x34')],'type':_0x1e8ab0['type'][_0x9d02('0x35')]};});_0x1111c6[_0x9d02('0x36')]=_[_0x9d02('0x31')](_0x575d93,'name');_0x1111c6['query']=_[_0x9d02('0x37')](_0x523f7b['query']);_0x1111c6[_0x9d02('0x38')]=_['intersection'](_0x1111c6[_0x9d02('0x36')],_0x1111c6[_0x9d02('0x39')]);_0x3fcdd4['attributes']=_[_0x9d02('0x3a')](_0x1111c6['model'],qs[_0x9d02('0x3b')](_0x523f7b['query'][_0x9d02('0x3b')]));_0x3fcdd4[_0x9d02('0x3c')]=_0x3fcdd4[_0x9d02('0x3c')][_0x9d02('0x3d')]?_0x3fcdd4[_0x9d02('0x3c')]:_0x1111c6[_0x9d02('0x36')];if(!_0x523f7b['query'][_0x9d02('0x3e')](_0x9d02('0x3f'))){_0x3fcdd4[_0x9d02('0x21')]=qs[_0x9d02('0x21')](_0x523f7b['query']['limit']);_0x3fcdd4[_0x9d02('0x1f')]=qs['offset'](_0x523f7b['query'][_0x9d02('0x1f')]);}_0x3fcdd4['order']=qs['sort'](_0x523f7b[_0x9d02('0x39')]['sort']);_0x3fcdd4['where']=qs[_0x9d02('0x38')](_[_0x9d02('0x40')](_0x523f7b[_0x9d02('0x39')],_0x1111c6[_0x9d02('0x38')]),_0x575d93);if(_0x523f7b['query'][_0x9d02('0x41')]){_0x3fcdd4['where']=_['merge'](_0x3fcdd4[_0x9d02('0x42')],{'$or':_[_0x9d02('0x31')](_0x575d93,function(_0x32e8b1){if(_0x32e8b1[_0x9d02('0x43')]!==_0x9d02('0x44')){var _0x17ff50={};_0x17ff50[_0x32e8b1[_0x9d02('0x45')]]={'$like':'%'+_0x523f7b[_0x9d02('0x39')][_0x9d02('0x41')]+'%'};return _0x17ff50;}})});}_0x3fcdd4=_[_0x9d02('0x46')]({},_0x3fcdd4,_0x523f7b['options']);var _0x588817={'where':_0x3fcdd4[_0x9d02('0x42')]};return db[_0x9d02('0x32')][_0x9d02('0x22')](_0x588817)[_0x9d02('0x2b')](function(_0x30b7d6){_0x2fc19b[_0x9d02('0x22')]=_0x30b7d6;if(_0x523f7b['query'][_0x9d02('0x47')]){_0x3fcdd4[_0x9d02('0x48')]=[{'all':!![]}];}return db[_0x9d02('0x32')][_0x9d02('0x49')](_0x3fcdd4);})['then'](function(_0x141d42){_0x2fc19b[_0x9d02('0x4a')]=_0x141d42;return _0x2fc19b;})['then'](respondWithFilteredResult(_0x41cc43,_0x3fcdd4))[_0x9d02('0x4b')](handleError(_0x41cc43,null));};exports[_0x9d02('0x4c')]=function(_0x5b8ea9,_0x311777){var _0x5bca7a={'raw':!![],'where':{'id':_0x5b8ea9[_0x9d02('0x4d')]['id']}},_0xe1829f={};_0xe1829f[_0x9d02('0x36')]=_[_0x9d02('0x37')](db['ChatInternalMessage']['rawAttributes']);_0xe1829f[_0x9d02('0x39')]=_['keys'](_0x5b8ea9['query']);_0xe1829f[_0x9d02('0x38')]=_[_0x9d02('0x3a')](_0xe1829f[_0x9d02('0x36')],_0xe1829f[_0x9d02('0x39')]);_0x5bca7a[_0x9d02('0x3c')]=_[_0x9d02('0x3a')](_0xe1829f[_0x9d02('0x36')],qs[_0x9d02('0x3b')](_0x5b8ea9[_0x9d02('0x39')][_0x9d02('0x3b')]));_0x5bca7a[_0x9d02('0x3c')]=_0x5bca7a['attributes'][_0x9d02('0x3d')]?_0x5bca7a['attributes']:_0xe1829f[_0x9d02('0x36')];if(_0x5b8ea9[_0x9d02('0x39')]['includeAll']){_0x5bca7a['include']=[{'all':!![]}];}_0x5bca7a=_[_0x9d02('0x46')]({},_0x5bca7a,_0x5b8ea9['options']);return db[_0x9d02('0x32')][_0x9d02('0x4e')](_0x5bca7a)[_0x9d02('0x2b')](handleEntityNotFound(_0x311777,null))['then'](respondWithResult(_0x311777,null))[_0x9d02('0x4b')](handleError(_0x311777,null));};exports['create']=function(_0x4fc8a1,_0x48daaf){return db[_0x9d02('0x32')][_0x9d02('0x4f')](_0x4fc8a1[_0x9d02('0x50')],{})['then'](respondWithResult(_0x48daaf,0xc9))['catch'](handleError(_0x48daaf,null));};exports[_0x9d02('0x29')]=function(_0x3050c5,_0xe4bc35){if(_0x3050c5['body']['id']){delete _0x3050c5[_0x9d02('0x50')]['id'];}return db[_0x9d02('0x32')][_0x9d02('0x4e')]({'where':{'id':_0x3050c5[_0x9d02('0x4d')]['id']}})[_0x9d02('0x2b')](handleEntityNotFound(_0xe4bc35,null))['then'](saveUpdates(_0x3050c5[_0x9d02('0x50')],null))[_0x9d02('0x2b')](respondWithResult(_0xe4bc35,null))[_0x9d02('0x4b')](handleError(_0xe4bc35,null));};exports[_0x9d02('0x2a')]=function(_0x5f3156,_0x47e910){return db[_0x9d02('0x32')][_0x9d02('0x4e')]({'where':{'id':_0x5f3156[_0x9d02('0x4d')]['id']}})[_0x9d02('0x2b')](handleEntityNotFound(_0x47e910,null))[_0x9d02('0x2b')](removeEntity(_0x47e910,null))[_0x9d02('0x4b')](handleError(_0x47e910,null));};exports[_0x9d02('0x51')]=function(_0x17e17b,_0x10b77a){return db[_0x9d02('0x32')][_0x9d02('0x51')]()[_0x9d02('0x2b')](respondWithResult(_0x10b77a,null))[_0x9d02('0x4b')](handleError(_0x10b77a,null));};function wrapUser(_0x5bd225){return function(_0x54169a){var _0x5e6a6e=_0x5bd225[_0x9d02('0x52')]({'plain':!![]});_0x5e6a6e[_0x9d02('0x53')]=[];if(_0x54169a){_0x5e6a6e[_0x9d02('0x54')]=_0x54169a[_0x9d02('0x55')];_0x5e6a6e['lastMessage']=_0x54169a;}else{_0x5e6a6e[_0x9d02('0x54')]=moment(0x0)[_0x9d02('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e6a6e[_0x9d02('0x57')]={};}return _0x5e6a6e;};}exports['getUsers']=function(_0x3a7aa9,_0x24bb22,_0x51ef85){var _0x4ca2f9=[];return db[_0x9d02('0x58')][_0x9d02('0x49')]({'where':{'role':['agent',_0x9d02('0x59'),_0x9d02('0x5a')]},'attributes':['id',_0x9d02('0x5b'),'name',_0x9d02('0x5c'),_0x9d02('0x5d'),_0x9d02('0x5e'),_0x9d02('0x5f'),_0x9d02('0x60'),_0x9d02('0x61'),_0x9d02('0x62')],'order':qs['sort'](_0x9d02('0x63')),'include':[{'model':db['VoiceQueue'],'as':_0x9d02('0x64'),'attributes':['id',_0x9d02('0x45'),_0x9d02('0x43')],'through':{'attributes':[]}}]})[_0x9d02('0x2b')](function(_0x315784){if(_0x315784){var _0x4701c8=_0x3a7aa9[_0x9d02('0x5a')][_0x9d02('0x52')]({'plain':!![]});if(!_0x4701c8)throw new Error(_0x9d02('0x65'));if(_0x4701c8[_0x9d02('0x5c')]===_0x9d02('0x5a')){return db[_0x9d02('0x66')][_0x9d02('0x4e')]({'where':{'name':_0x9d02('0x67'),'userProfileId':_0x4701c8[_0x9d02('0x68')]},'raw':!![]})[_0x9d02('0x2b')](function(_0x3ad934){if(_0x3ad934){if(_0x3ad934[_0x9d02('0x69')]===0x0){return db[_0x9d02('0x6a')][_0x9d02('0x49')]({'where':{'sectionId':_0x3ad934['id']},'raw':!![]})[_0x9d02('0x2b')](function(_0x2b8762){var _0x433e97=[];if(_[_0x9d02('0x6b')](_0x2b8762)){_0x433e97=_[_0x9d02('0x41')](_0x315784,function(_0x3dcc10){if(_0x3dcc10[_0x9d02('0x5c')]!==_0x9d02('0x6c')){return _0x3dcc10;}});return _0x433e97;}else{for(var _0x2adce6=0x0;_0x2adce6<_0x315784['length'];_0x2adce6++){var _0xa934b3=_0x315784[_0x2adce6];if(_0xa934b3[_0x9d02('0x5c')]==='agent'){var _0x374a93=_[_0x9d02('0x4e')](_0x2b8762,function(_0x45333e){return _0x45333e[_0x9d02('0x6d')]===_0xa934b3['id'];});if(_0x374a93)_0x433e97[_0x9d02('0x6e')](_0xa934b3);}else{_0x433e97[_0x9d02('0x6e')](_0xa934b3);}}return _0x433e97;}});}else{return _0x315784;}}else{var _0x5e6ae6=_[_0x9d02('0x41')](_0x315784,function(_0x2d5423){if(_0x2d5423['role']!=='agent'){return _0x2d5423;}});return _0x5e6ae6;}});}else{return _0x315784;}}})[_0x9d02('0x2b')](function(_0x1fb6f6){var _0x4013b4=[];if(_0x1fb6f6){_0x4ca2f9=_0x1fb6f6;for(var _0x326647=0x0;_0x326647<_0x1fb6f6[_0x9d02('0x3d')];_0x326647+=0x1){_0x4ca2f9[_0x326647][_0x9d02('0x53')]=[];_0x4013b4['push'](db[_0x9d02('0x32')][_0x9d02('0x4e')]({'where':{'FromId':[_0x3a7aa9['user']['id'],_0x1fb6f6[_0x326647]['id']],'ToId':[_0x3a7aa9[_0x9d02('0x5a')]['id'],_0x1fb6f6[_0x326647]['id']],'ChatGroupId':null},'attributes':['id',_0x9d02('0x55'),_0x9d02('0x6f'),_0x9d02('0x70'),_0x9d02('0x71'),_0x9d02('0x50')],'order':qs[_0x9d02('0x72')](_0x9d02('0x73')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x1fb6f6[_0x326647])));}return BPromise[_0x9d02('0x74')](_0x4013b4);}return[];})[_0x9d02('0x2b')](function(_0x45ec12){return{'rows':_0x45ec12,'count':_0x45ec12[_0x9d02('0x3d')]};})[_0x9d02('0x2b')](respondWithResult(_0x24bb22,null))[_0x9d02('0x4b')](handleError(_0x24bb22,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 6d96ba2..4a7f694 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 _0xa713=['setMaxListeners','remove','emit','hasOwnProperty','exports','events'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0xa713,0x7d));var _0x3a71=function(_0x2c2d60,_0x1f7ee9){_0x2c2d60=_0x2c2d60-0x0;var _0x3eee5d=_0xa713[_0x2c2d60];return _0x3eee5d;};'use strict';var EventEmitter=require(_0x3a71('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3a71('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3a71('0x2')};function emitEvent(_0x591309){return function(_0x1f7c3a,_0x5aa74c,_0x3ea5d3){ChatInternalMessageEvents[_0x3a71('0x3')](_0x591309+':'+_0x1f7c3a['id'],_0x1f7c3a);ChatInternalMessageEvents['emit'](_0x591309,_0x1f7c3a);_0x3ea5d3(null);};}for(var e in events){if(events[_0x3a71('0x4')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x3a71('0x5')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x1dd1=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','emit'];(function(_0x559339,_0x1cc49a){var _0x1ba106=function(_0x17c687){while(--_0x17c687){_0x559339['push'](_0x559339['shift']());}};_0x1ba106(++_0x1cc49a);}(_0x1dd1,0x1e2));var _0x11dd=function(_0x340aa5,_0x2d5553){_0x340aa5=_0x340aa5-0x0;var _0x3a5b7f=_0x1dd1[_0x340aa5];return _0x3a5b7f;};'use strict';var EventEmitter=require(_0x11dd('0x0'));var ChatInternalMessage=require(_0x11dd('0x1'))['db'][_0x11dd('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x11dd('0x3')](0x0);var events={'afterCreate':_0x11dd('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3ab8cf){return function(_0x28be68,_0x3fc812,_0x4a048e){ChatInternalMessageEvents[_0x11dd('0x5')](_0x3ab8cf+':'+_0x28be68['id'],_0x28be68);ChatInternalMessageEvents[_0x11dd('0x5')](_0x3ab8cf,_0x28be68);_0x4a048e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x11dd('0x6')](e,emitEvent(event));}}module[_0x11dd('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 79023cc..8ca3eeb 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 _0x41a4=['lodash','util','api','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x52be4c,_0x29b9a0){var _0x7e0c5a=function(_0x476fdf){while(--_0x476fdf){_0x52be4c['push'](_0x52be4c['shift']());}};_0x7e0c5a(++_0x29b9a0);}(_0x41a4,0xc3));var _0x441a=function(_0x5c31f4,_0x446a83){_0x5c31f4=_0x5c31f4-0x0;var _0x2583bf=_0x41a4[_0x5c31f4];return _0x2583bf;};'use strict';var _=require(_0x441a('0x0'));var util=require(_0x441a('0x1'));var logger=require('../../config/logger')(_0x441a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x441a('0x3'));var fs=require('fs');var path=require(_0x441a('0x4'));var rimraf=require(_0x441a('0x5'));var config=require(_0x441a('0x6'));var attributes=require(_0x441a('0x7'));module[_0x441a('0x8')]=function(_0x10b098,_0x1d93c0){return _0x10b098[_0x441a('0x9')](_0x441a('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x441a('0xb'),'collate':_0x441a('0xc')});};
\ No newline at end of file
+var _0x610a=['./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4a9e9f,_0x5c2416){var _0x3c9a08=function(_0x488457){while(--_0x488457){_0x4a9e9f['push'](_0x4a9e9f['shift']());}};_0x3c9a08(++_0x5c2416);}(_0x610a,0x132));var _0xa610=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x610a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa610('0x0'));var util=require(_0xa610('0x1'));var logger=require(_0xa610('0x2'))('api');var moment=require(_0xa610('0x3'));var BPromise=require(_0xa610('0x4'));var rp=require(_0xa610('0x5'));var fs=require('fs');var path=require(_0xa610('0x6'));var rimraf=require(_0xa610('0x7'));var config=require(_0xa610('0x8'));var attributes=require(_0xa610('0x9'));module['exports']=function(_0x23376d,_0x3fa23d){return _0x23376d[_0xa610('0xa')](_0xa610('0xb'),attributes,{'tableName':_0xa610('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa610('0xd'),'collate':_0xa610('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index d1a5400..2536b43 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 _0xfcc5=['client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','request\x20sent','debug','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x149bf3,_0x4d2c41){var _0x4cb558=function(_0xfe4031){while(--_0xfe4031){_0x149bf3['push'](_0x149bf3['shift']());}};_0x4cb558(++_0x4d2c41);}(_0xfcc5,0x79));var _0x5fcc=function(_0x4e5f4d,_0x208481){_0x4e5f4d=_0x4e5f4d-0x0;var _0x48dd5d=_0xfcc5[_0x4e5f4d];return _0x48dd5d;};'use strict';var _=require(_0x5fcc('0x0'));var util=require(_0x5fcc('0x1'));var moment=require(_0x5fcc('0x2'));var BPromise=require(_0x5fcc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5fcc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5fcc('0x5'))(_0x5fcc('0x6'));var config=require(_0x5fcc('0x7'));var jayson=require(_0x5fcc('0x8'));var client=jayson[_0x5fcc('0x9')][_0x5fcc('0xa')]({'port':0x232a});config['redis']=_[_0x5fcc('0xb')](config[_0x5fcc('0xc')],{'host':_0x5fcc('0xd'),'port':0x18eb});var socket=require(_0x5fcc('0xe'))(new Redis(config[_0x5fcc('0xc')]));require(_0x5fcc('0xf'))[_0x5fcc('0x10')](socket);function respondWithRpcPromise(_0x700c81,_0x1e8874,_0x475ee3){return new BPromise(function(_0x2ef2d5,_0x107d4f){return client['request'](_0x700c81,_0x475ee3)[_0x5fcc('0x11')](function(_0x7bc084){logger[_0x5fcc('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x1e8874,_0x5fcc('0x13'));logger[_0x5fcc('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x1e8874,_0x5fcc('0x13'),JSON[_0x5fcc('0x15')](_0x7bc084));if(_0x7bc084['error']){if(_0x7bc084[_0x5fcc('0x16')]['code']===0x1f4){logger['error'](_0x5fcc('0x17'),_0x1e8874,_0x7bc084[_0x5fcc('0x16')][_0x5fcc('0x18')]);return _0x107d4f(_0x7bc084[_0x5fcc('0x16')][_0x5fcc('0x18')]);}logger[_0x5fcc('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x1e8874,_0x7bc084[_0x5fcc('0x16')][_0x5fcc('0x18')]);return _0x2ef2d5(_0x7bc084[_0x5fcc('0x16')][_0x5fcc('0x18')]);}else{logger[_0x5fcc('0x12')](_0x5fcc('0x17'),_0x1e8874,_0x5fcc('0x13'));_0x2ef2d5(_0x7bc084[_0x5fcc('0x19')][_0x5fcc('0x18')]);}})['catch'](function(_0x28f654){logger[_0x5fcc('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x1e8874,_0x28f654);_0x107d4f(_0x28f654);});});}
\ No newline at end of file
+var _0xed98=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x3a2913,_0x3a0498){var _0x5364f1=function(_0x493350){while(--_0x493350){_0x3a2913['push'](_0x3a2913['shift']());}};_0x5364f1(++_0x3a0498);}(_0xed98,0x109));var _0x8ed9=function(_0x4c95f7,_0x56a52d){_0x4c95f7=_0x4c95f7-0x0;var _0x47c107=_0xed98[_0x4c95f7];return _0x47c107;};'use strict';var _=require(_0x8ed9('0x0'));var util=require(_0x8ed9('0x1'));var moment=require(_0x8ed9('0x2'));var BPromise=require(_0x8ed9('0x3'));var rs=require(_0x8ed9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ed9('0x5'))['db'];var utils=require(_0x8ed9('0x6'));var logger=require(_0x8ed9('0x7'))('rpc');var config=require(_0x8ed9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8ed9('0x9')][_0x8ed9('0xa')]({'port':0x232a});config[_0x8ed9('0xb')]=_[_0x8ed9('0xc')](config['redis'],{'host':_0x8ed9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8ed9('0xe'))[_0x8ed9('0xf')](socket);function respondWithRpcPromise(_0x1c84c,_0x35615a,_0x55670a){return new BPromise(function(_0x3425fe,_0x11d595){return client[_0x8ed9('0x10')](_0x1c84c,_0x55670a)[_0x8ed9('0x11')](function(_0x3e9a51){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x35615a,'request\x20sent');logger[_0x8ed9('0x12')](_0x8ed9('0x13'),_0x35615a,_0x8ed9('0x14'),JSON[_0x8ed9('0x15')](_0x3e9a51));if(_0x3e9a51[_0x8ed9('0x16')]){if(_0x3e9a51[_0x8ed9('0x16')][_0x8ed9('0x17')]===0x1f4){logger[_0x8ed9('0x16')](_0x8ed9('0x18'),_0x35615a,_0x3e9a51[_0x8ed9('0x16')][_0x8ed9('0x19')]);return _0x11d595(_0x3e9a51[_0x8ed9('0x16')][_0x8ed9('0x19')]);}logger[_0x8ed9('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x35615a,_0x3e9a51['error'][_0x8ed9('0x19')]);return _0x3425fe(_0x3e9a51[_0x8ed9('0x16')][_0x8ed9('0x19')]);}else{logger[_0x8ed9('0x1a')](_0x8ed9('0x18'),_0x35615a,_0x8ed9('0x14'));_0x3425fe(_0x3e9a51[_0x8ed9('0x1b')][_0x8ed9('0x19')]);}})[_0x8ed9('0x1c')](function(_0x5c7c36){logger[_0x8ed9('0x16')](_0x8ed9('0x18'),_0x35615a,_0x5c7c36);_0x11d595(_0x5c7c36);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index bdd6726..733de78 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 _0xf880=['./chatInternalMessage.events','save','remove','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x19d6b7,_0x49f5ae){var _0x1a2dfc=function(_0x456e0d){while(--_0x456e0d){_0x19d6b7['push'](_0x19d6b7['shift']());}};_0x1a2dfc(++_0x49f5ae);}(_0xf880,0x171));var _0x0f88=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xf880[_0x1a9204];return _0x17ca68;};'use strict';var ChatInternalMessageEvents=require(_0x0f88('0x0'));var events=[_0x0f88('0x1'),_0x0f88('0x2'),_0x0f88('0x3')];function createListener(_0x1d827f,_0x5bc074){return function(_0x1c380f){_0x5bc074[_0x0f88('0x4')](_0x1d827f,_0x1c380f);};}function removeListener(_0x56a0a4,_0x2aaed4){return function(){ChatInternalMessageEvents[_0x0f88('0x5')](_0x56a0a4,_0x2aaed4);};}exports[_0x0f88('0x6')]=function(_0x58964a){for(var _0x1b97ca=0x0,_0x4bf90e=events[_0x0f88('0x7')];_0x1b97ca<_0x4bf90e;_0x1b97ca++){var _0x3eb3f7=events[_0x1b97ca];var _0x1d27b6=createListener(_0x0f88('0x8')+_0x3eb3f7,_0x58964a);ChatInternalMessageEvents['on'](_0x3eb3f7,_0x1d27b6);}};
\ No newline at end of file
+var _0xdef9=['emit','removeListener','register','chatInternalMessage:','save','remove'];(function(_0x2f0ca3,_0x4a2d02){var _0x567a84=function(_0x40b3cf){while(--_0x40b3cf){_0x2f0ca3['push'](_0x2f0ca3['shift']());}};_0x567a84(++_0x4a2d02);}(_0xdef9,0xb8));var _0x9def=function(_0x315d54,_0x333bec){_0x315d54=_0x315d54-0x0;var _0x21c13e=_0xdef9[_0x315d54];return _0x21c13e;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x9def('0x0'),_0x9def('0x1'),'update'];function createListener(_0x228f45,_0x31f7cf){return function(_0x13f037){_0x31f7cf[_0x9def('0x2')](_0x228f45,_0x13f037);};}function removeListener(_0x1c7bb9,_0x1eabea){return function(){ChatInternalMessageEvents[_0x9def('0x3')](_0x1c7bb9,_0x1eabea);};}exports[_0x9def('0x4')]=function(_0x103321){for(var _0x2b395a=0x0,_0x158eec=events['length'];_0x2b395a<_0x158eec;_0x2b395a++){var _0x2a4193=events[_0x2b395a];var _0x6d0da8=createListener(_0x9def('0x5')+_0x2a4193,_0x103321);ChatInternalMessageEvents['on'](_0x2a4193,_0x6d0da8);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 3492bdc..1dc9c1d 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 _0xda0b=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','getUsers','/:id','post','create','put','destroy','multer'];(function(_0x53d6ba,_0xb57bb){var _0x786520=function(_0x51edc1){while(--_0x51edc1){_0x53d6ba['push'](_0x53d6ba['shift']());}};_0x786520(++_0xb57bb);}(_0xda0b,0x18b));var _0xbda0=function(_0x1bf1eb,_0xce9ba){_0x1bf1eb=_0x1bf1eb-0x0;var _0x2d64fc=_0xda0b[_0x1bf1eb];return _0x2d64fc;};'use strict';var multer=require(_0xbda0('0x0'));var util=require(_0xbda0('0x1'));var path=require(_0xbda0('0x2'));var timeout=require(_0xbda0('0x3'));var express=require(_0xbda0('0x4'));var router=express[_0xbda0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbda0('0x6'));var interaction=require(_0xbda0('0x7'));var config=require(_0xbda0('0x8'));var controller=require(_0xbda0('0x9'));router['get']('/',auth[_0xbda0('0xa')](),controller[_0xbda0('0xb')]);router[_0xbda0('0xc')](_0xbda0('0xd'),auth[_0xbda0('0xa')](),controller[_0xbda0('0xe')]);router[_0xbda0('0xc')](_0xbda0('0xf'),auth['isAuthenticated'](),controller[_0xbda0('0x10')]);router[_0xbda0('0xc')](_0xbda0('0x11'),auth[_0xbda0('0xa')](),controller['show']);router[_0xbda0('0x12')]('/',auth[_0xbda0('0xa')](),controller[_0xbda0('0x13')]);router[_0xbda0('0x14')]('/:id',controller['update']);router['delete'](_0xbda0('0x11'),auth['isAuthenticated'](),controller[_0xbda0('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x6662=['/users','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','describe'];(function(_0x2601b4,_0x315e78){var _0x3e3661=function(_0x13b45b){while(--_0x13b45b){_0x2601b4['push'](_0x2601b4['shift']());}};_0x3e3661(++_0x315e78);}(_0x6662,0x10b));var _0x2666=function(_0x4a8ce2,_0x4cd94e){_0x4a8ce2=_0x4a8ce2-0x0;var _0x38c265=_0x6662[_0x4a8ce2];return _0x38c265;};'use strict';var multer=require(_0x2666('0x0'));var util=require(_0x2666('0x1'));var path=require(_0x2666('0x2'));var timeout=require(_0x2666('0x3'));var express=require(_0x2666('0x4'));var router=express[_0x2666('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2666('0x6'));var interaction=require(_0x2666('0x7'));var config=require('../../config/environment');var controller=require(_0x2666('0x8'));router[_0x2666('0x9')]('/',auth[_0x2666('0xa')](),controller[_0x2666('0xb')]);router[_0x2666('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x2666('0xc')]);router[_0x2666('0x9')](_0x2666('0xd'),auth[_0x2666('0xa')](),controller['getUsers']);router[_0x2666('0x9')]('/:id',auth[_0x2666('0xa')](),controller['show']);router['post']('/',auth[_0x2666('0xa')](),controller[_0x2666('0xe')]);router[_0x2666('0xf')]('/:id',controller['update']);router[_0x2666('0x10')](_0x2666('0x11'),auth['isAuthenticated'](),controller[_0x2666('0x12')]);module[_0x2666('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index be69bb3..882d55f 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 _0x4e5c=['TEXT','BOOLEAN','ENUM','STRING','sequelize'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0x4e5c,0x149));var _0xc4e5=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x4e5c[_0x273c39];return _0x46d6b5;};'use strict';var Sequelize=require(_0xc4e5('0x0'));module['exports']={'body':{'type':Sequelize[_0xc4e5('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc4e5('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc4e5('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc4e5('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xc4e5('0x4')]},'providerResponse':{'type':Sequelize[_0xc4e5('0x1')]}};
\ No newline at end of file
+var _0x4639=['ENUM','out','DATE','TEXT','sequelize','medium','BOOLEAN'];(function(_0x5d23be,_0x3b4f3c){var _0x4d60a9=function(_0x57dce7){while(--_0x57dce7){_0x5d23be['push'](_0x5d23be['shift']());}};_0x4d60a9(++_0x3b4f3c);}(_0x4639,0x115));var _0x9463=function(_0x5f5059,_0x469cd8){_0x5f5059=_0x5f5059-0x0;var _0x2245e3=_0x4639[_0x5f5059];return _0x2245e3;};'use strict';var Sequelize=require(_0x9463('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x9463('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x9463('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9463('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9463('0x3')]('in',_0x9463('0x4')),'defaultValue':_0x9463('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9463('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x9463('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index a076fb0..31a55cc 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 _0x1dfb=['Content-Range','json','reject','save','update','destroy','sendStatus','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','keys','model','fields','attributes','query','hasOwnProperty','order','sort','filters','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','intersection','include','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','isNil','interaction','role','null','AcceptMessage','acceptMessage','ContactId','QueryTypes','SELECT','contact','agent','fullname','email','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','ChatInteractionId','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','User','internal','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','./chatMessage.socket','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','end','undefined','limit','count','offset','status'];(function(_0x48e893,_0x26840f){var _0x3301f6=function(_0x432eea){while(--_0x432eea){_0x48e893['push'](_0x48e893['shift']());}};_0x3301f6(++_0x26840f);}(_0x1dfb,0x1d1));var _0xb1df=function(_0x314c62,_0x5ede81){_0x314c62=_0x314c62-0x0;var _0x6371aa=_0x1dfb[_0x314c62];return _0x6371aa;};'use strict';var emlformat=require(_0xb1df('0x0'));var rimraf=require(_0xb1df('0x1'));var zipdir=require(_0xb1df('0x2'));var jsonpatch=require(_0xb1df('0x3'));var rp=require(_0xb1df('0x4'));var moment=require(_0xb1df('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb1df('0x6'));var path=require(_0xb1df('0x7'));var sox=require(_0xb1df('0x8'));var csv=require('to-csv');var ejs=require(_0xb1df('0x9'));var fs=require('fs');var fs_extra=require(_0xb1df('0xa'));var _=require(_0xb1df('0xb'));var squel=require(_0xb1df('0xc'));var crypto=require(_0xb1df('0xd'));var jsforce=require(_0xb1df('0xe'));var deskjs=require(_0xb1df('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb1df('0x10'));var Papa=require(_0xb1df('0x11'));var Redis=require('ioredis');var authService=require(_0xb1df('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb1df('0x13'));var hardwareService=require(_0xb1df('0x14'));var logger=require(_0xb1df('0x15'))(_0xb1df('0x16'));var utils=require(_0xb1df('0x17'));var config=require(_0xb1df('0x18'));var licenseUtil=require(_0xb1df('0x19'));var db=require('../../mysqldb')['db'];config[_0xb1df('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb1df('0x1a')]));require(_0xb1df('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xb1df('0x1c')][_0xb1df('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xb1df('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x489184,_0x1f5d52,_0x5ccac4,_0x4092cf){return new BPromise(function(_0xe61d8b,_0x16b881){var _0x497986=_0x4092cf||client;return _0x497986[_0xb1df('0x1e')](_0x489184,_0x5ccac4)[_0xb1df('0x1f')](function(_0x4622a0){logger[_0xb1df('0x20')](_0xb1df('0x21'),_0x1f5d52,_0xb1df('0x22'));logger[_0xb1df('0x23')](_0xb1df('0x24'),_0x1f5d52,_0xb1df('0x22'),JSON[_0xb1df('0x25')](_0x4622a0));if(_0x4622a0[_0xb1df('0x26')]){if(_0x4622a0['error']['code']===0x1f4){logger[_0xb1df('0x26')](_0xb1df('0x21'),_0x1f5d52,_0x4622a0[_0xb1df('0x26')][_0xb1df('0x27')]);return _0x16b881(_0x4622a0['error'][_0xb1df('0x27')]);}logger[_0xb1df('0x26')](_0xb1df('0x21'),_0x1f5d52,_0x4622a0[_0xb1df('0x26')][_0xb1df('0x27')]);return _0xe61d8b(_0x4622a0[_0xb1df('0x26')][_0xb1df('0x27')]);}else{logger[_0xb1df('0x20')](_0xb1df('0x21'),_0x1f5d52,_0xb1df('0x22'));_0xe61d8b(_0x4622a0['result']['message']);}})[_0xb1df('0x28')](function(_0x242ddc){logger[_0xb1df('0x26')](_0xb1df('0x21'),_0x1f5d52,_0x242ddc);_0x16b881(_0x242ddc);});});}function respondWithStatusCode(_0x40d8c7,_0x4299d5){_0x4299d5=_0x4299d5||0xcc;return function(_0x22f85a){if(_0x22f85a){return _0x40d8c7['sendStatus'](_0x4299d5);}return _0x40d8c7['status'](_0x4299d5)[_0xb1df('0x29')]();};}function respondWithResult(_0x44e6f7,_0x318af6){_0x318af6=_0x318af6||0xc8;return function(_0xa0a291){if(_0xa0a291){return _0x44e6f7['status'](_0x318af6)['json'](_0xa0a291);}};}function respondWithFilteredResult(_0x127b19,_0x195c70){return function(_0x2795a1){if(_0x2795a1){var _0x2c95fc=typeof _0x195c70['offset']===_0xb1df('0x2a')&&typeof _0x195c70[_0xb1df('0x2b')]===_0xb1df('0x2a');var _0x4cd551=_0x2795a1[_0xb1df('0x2c')];var _0x2fa15e=_0x2c95fc?0x0:_0x195c70[_0xb1df('0x2d')];var _0x1a266b=_0x2c95fc?_0x2795a1[_0xb1df('0x2c')]:_0x195c70['offset']+_0x195c70['limit'];var _0x5545ab;if(_0x1a266b>=_0x4cd551){_0x1a266b=_0x4cd551;_0x5545ab=0xc8;}else{_0x5545ab=0xce;}_0x127b19[_0xb1df('0x2e')](_0x5545ab);return _0x127b19['set'](_0xb1df('0x2f'),_0x2fa15e+'-'+_0x1a266b+'/'+_0x4cd551)[_0xb1df('0x30')](_0x2795a1);}return null;};}function patchUpdates(_0x4532ae){return function(_0x1c5fff){try{jsonpatch['apply'](_0x1c5fff,_0x4532ae,!![]);}catch(_0x3260b0){return BPromise[_0xb1df('0x31')](_0x3260b0);}return _0x1c5fff[_0xb1df('0x32')]();};}function saveUpdates(_0x52a485,_0x2d5dcc){return function(_0x554c0d){if(_0x554c0d){return _0x554c0d[_0xb1df('0x33')](_0x52a485)[_0xb1df('0x1f')](function(_0x5c6fe7){return _0x5c6fe7;});}return null;};}function removeEntity(_0x312974,_0x4fb3f8){return function(_0x4eb683){if(_0x4eb683){return _0x4eb683[_0xb1df('0x34')]()['then'](function(){_0x312974[_0xb1df('0x2e')](0xcc)[_0xb1df('0x29')]();});}};}function handleEntityNotFound(_0x415a74,_0x57ee13){return function(_0x4f28c8){if(!_0x4f28c8){_0x415a74[_0xb1df('0x35')](0x194);}return _0x4f28c8;};}function handleError(_0x4ca240,_0x1d6c0a){_0x1d6c0a=_0x1d6c0a||0x1f4;return function(_0x2c3577){logger[_0xb1df('0x26')](_0x2c3577[_0xb1df('0x36')]);if(_0x2c3577[_0xb1df('0x37')]){delete _0x2c3577[_0xb1df('0x37')];}_0x4ca240[_0xb1df('0x2e')](_0x1d6c0a)['send'](_0x2c3577);};}exports[_0xb1df('0x38')]=function(_0x4ef720,_0x510723){var _0x4351a8={},_0x4dbde3={},_0x2a6117={'count':0x0,'rows':[]};var _0x49d740=_[_0xb1df('0x39')](db[_0xb1df('0x3a')][_0xb1df('0x3b')],function(_0x32013b){return{'name':_0x32013b[_0xb1df('0x3c')],'type':_0x32013b[_0xb1df('0x3d')][_0xb1df('0x3e')]};});_0x4dbde3['model']=_['map'](_0x49d740,_0xb1df('0x37'));_0x4dbde3['query']=_[_0xb1df('0x3f')](_0x4ef720['query']);_0x4dbde3['filters']=_['intersection'](_0x4dbde3[_0xb1df('0x40')],_0x4dbde3['query']);_0x4351a8['attributes']=_['intersection'](_0x4dbde3['model'],qs[_0xb1df('0x41')](_0x4ef720['query']['fields']));_0x4351a8[_0xb1df('0x42')]=_0x4351a8[_0xb1df('0x42')]['length']?_0x4351a8[_0xb1df('0x42')]:_0x4dbde3[_0xb1df('0x40')];if(!_0x4ef720[_0xb1df('0x43')][_0xb1df('0x44')]('nolimit')){_0x4351a8['limit']=qs[_0xb1df('0x2b')](_0x4ef720['query'][_0xb1df('0x2b')]);_0x4351a8[_0xb1df('0x2d')]=qs[_0xb1df('0x2d')](_0x4ef720['query']['offset']);}_0x4351a8[_0xb1df('0x45')]=qs[_0xb1df('0x46')](_0x4ef720[_0xb1df('0x43')]['sort']);_0x4351a8['where']=qs[_0xb1df('0x47')](_['pick'](_0x4ef720[_0xb1df('0x43')],_0x4dbde3[_0xb1df('0x47')]),_0x49d740);if(_0x4ef720['query']['filter']){_0x4351a8[_0xb1df('0x48')]=_[_0xb1df('0x49')](_0x4351a8[_0xb1df('0x48')],{'$or':_[_0xb1df('0x39')](_0x49d740,function(_0x214c75){if(_0x214c75['type']!==_0xb1df('0x4a')){var _0x296d72={};_0x296d72[_0x214c75['name']]={'$like':'%'+_0x4ef720[_0xb1df('0x43')][_0xb1df('0x4b')]+'%'};return _0x296d72;}})});}_0x4351a8=_['merge']({},_0x4351a8,_0x4ef720[_0xb1df('0x4c')]);var _0x150ccd={'where':_0x4351a8[_0xb1df('0x48')]};return db['ChatMessage']['count'](_0x150ccd)[_0xb1df('0x1f')](function(_0x170a09){_0x2a6117[_0xb1df('0x2c')]=_0x170a09;if(_0x4ef720['query'][_0xb1df('0x4d')]){_0x4351a8['include']=[{'all':!![]}];}return db['ChatMessage'][_0xb1df('0x4e')](_0x4351a8);})[_0xb1df('0x1f')](function(_0x4552f1){_0x2a6117[_0xb1df('0x4f')]=_0x4552f1;return _0x2a6117;})[_0xb1df('0x1f')](respondWithFilteredResult(_0x510723,_0x4351a8))['catch'](handleError(_0x510723,null));};exports[_0xb1df('0x50')]=function(_0x873b95,_0x46494c){var _0x5d106a={'raw':!![],'where':{'id':_0x873b95[_0xb1df('0x51')]['id']}},_0x1d3ec4={};_0x1d3ec4[_0xb1df('0x40')]=_[_0xb1df('0x3f')](db[_0xb1df('0x3a')][_0xb1df('0x3b')]);_0x1d3ec4[_0xb1df('0x43')]=_[_0xb1df('0x3f')](_0x873b95[_0xb1df('0x43')]);_0x1d3ec4[_0xb1df('0x47')]=_[_0xb1df('0x52')](_0x1d3ec4['model'],_0x1d3ec4[_0xb1df('0x43')]);_0x5d106a['attributes']=_[_0xb1df('0x52')](_0x1d3ec4[_0xb1df('0x40')],qs[_0xb1df('0x41')](_0x873b95[_0xb1df('0x43')][_0xb1df('0x41')]));_0x5d106a[_0xb1df('0x42')]=_0x5d106a[_0xb1df('0x42')]['length']?_0x5d106a[_0xb1df('0x42')]:_0x1d3ec4['model'];if(_0x873b95['query']['includeAll']){_0x5d106a[_0xb1df('0x53')]=[{'all':!![]}];}_0x5d106a=_[_0xb1df('0x49')]({},_0x5d106a,_0x873b95[_0xb1df('0x4c')]);return db[_0xb1df('0x3a')][_0xb1df('0x54')](_0x5d106a)[_0xb1df('0x1f')](handleEntityNotFound(_0x46494c,null))[_0xb1df('0x1f')](respondWithResult(_0x46494c,null))['catch'](handleError(_0x46494c,null));};exports[_0xb1df('0x55')]=function(_0x8baa0a,_0x34c6f8){return db[_0xb1df('0x3a')][_0xb1df('0x55')](_0x8baa0a[_0xb1df('0x56')],{})[_0xb1df('0x1f')](respondWithResult(_0x34c6f8,0xc9))[_0xb1df('0x28')](handleError(_0x34c6f8,null));};exports[_0xb1df('0x33')]=function(_0x2ac461,_0x5a0c71){if(_0x2ac461[_0xb1df('0x56')]['id']){delete _0x2ac461['body']['id'];}return db[_0xb1df('0x3a')]['find']({'where':{'id':_0x2ac461[_0xb1df('0x51')]['id']}})['then'](handleEntityNotFound(_0x5a0c71,null))['then'](saveUpdates(_0x2ac461[_0xb1df('0x56')],null))['then'](respondWithResult(_0x5a0c71,null))[_0xb1df('0x28')](handleError(_0x5a0c71,null));};exports['destroy']=function(_0x469d58,_0x4f93ca){return db[_0xb1df('0x3a')][_0xb1df('0x54')]({'where':{'id':_0x469d58[_0xb1df('0x51')]['id']}})[_0xb1df('0x1f')](handleEntityNotFound(_0x4f93ca,null))[_0xb1df('0x1f')](removeEntity(_0x4f93ca,null))[_0xb1df('0x28')](handleError(_0x4f93ca,null));};exports[_0xb1df('0x57')]=function(_0x4f7b10,_0x2aed60){return db[_0xb1df('0x3a')][_0xb1df('0x57')]()[_0xb1df('0x1f')](respondWithResult(_0x2aed60,null))[_0xb1df('0x28')](handleError(_0x2aed60,null));};var interaction_log=require(_0xb1df('0x15'))(_0xb1df('0x58'));exports[_0xb1df('0x59')]=function(_0x46b9f9,_0x581830,_0x5e8047){var _0x22b6e6={'agent':{},'channel':_0xb1df('0x5a')};if(_0x46b9f9[_0xb1df('0x56')]['id']){delete _0x46b9f9[_0xb1df('0x56')]['id'];}_0x46b9f9[_0xb1df('0x56')][_0xb1df('0x5b')]=!![];_0x46b9f9[_0xb1df('0x56')][_0xb1df('0x5c')]=moment()[_0xb1df('0x5d')](_0xb1df('0x5e'));_0x46b9f9['body'][_0xb1df('0x5f')]=_0x46b9f9[_0xb1df('0x56')][_0xb1df('0x5f')]||_0x46b9f9[_0xb1df('0x60')]['id'];_0x22b6e6['agent']['id']=_0x46b9f9['body'][_0xb1df('0x5f')];return db[_0xb1df('0x3a')][_0xb1df('0x54')]({'where':{'id':_0x46b9f9['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x581830,null))[_0xb1df('0x1f')](saveUpdates(_0x46b9f9[_0xb1df('0x56')],null))[_0xb1df('0x1f')](function(_0x337d7b){if(_0x337d7b){_0x22b6e6[_0xb1df('0x27')]=_0x337d7b[_0xb1df('0x61')]({'plain':!![]});return db[_0xb1df('0x62')][_0xb1df('0x54')]({'where':{'id':_0x337d7b['ChatInteractionId']}});}return null;})[_0xb1df('0x1f')](handleEntityNotFound(_0x581830,null))[_0xb1df('0x1f')](function(_0x1d6de3){if(_0x1d6de3){return _0x1d6de3[_0xb1df('0x33')]({'UserId':_0x46b9f9[_0xb1df('0x56')][_0xb1df('0x5f')],'read1stAt':_[_0xb1df('0x63')](_0x1d6de3['read1stAt'])?moment()[_0xb1df('0x5d')](_0xb1df('0x5e')):undefined});}return null;})['then'](function(_0x4a26b1){if(_0x4a26b1){_0x22b6e6[_0xb1df('0x64')]=_0x4a26b1[_0xb1df('0x61')]({'plain':!![]});interaction_log[_0xb1df('0x20')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x46b9f9[_0xb1df('0x60')]['id'],_0x46b9f9['user'][_0xb1df('0x37')],_0x46b9f9[_0xb1df('0x60')][_0xb1df('0x65')],_0x22b6e6['interaction']['id'],_0x46b9f9[_0xb1df('0x56')]?JSON[_0xb1df('0x25')](_0x46b9f9[_0xb1df('0x56')]):_0xb1df('0x66'));return respondWithRpcPromise(_0xb1df('0x67'),_0xb1df('0x68'),_0x22b6e6);}return null;})[_0xb1df('0x1f')](function(_0x4b81b0){var _0x3b275a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4b81b0['message'][_0xb1df('0x69')];return db['sequelize']['query'](_0x3b275a,{'type':db['Sequelize'][_0xb1df('0x6a')][_0xb1df('0x6b')],'raw':!![]})['then'](function(_0x533dcf){return _0x533dcf;});})[_0xb1df('0x1f')](function(_0x5ecde5){if(_0x5ecde5){_0x22b6e6[_0xb1df('0x27')][_0xb1df('0x6c')]=_0x5ecde5[0x0];if(!_0x46b9f9[_0xb1df('0x56')][_0xb1df('0x5f')])return;return db['User'][_0xb1df('0x54')]({'where':{'id':_0x46b9f9['body'][_0xb1df('0x5f')],'role':_0xb1df('0x6d')},'attributes':['id',_0xb1df('0x37'),_0xb1df('0x6e'),_0xb1df('0x6f'),'internal'],'raw':!![]});}return null;})[_0xb1df('0x1f')](function(_0x206095){if(!_0x206095)return null;_0x22b6e6[_0xb1df('0x27')][_0xb1df('0x6d')]=_0x206095;return _0x22b6e6;})[_0xb1df('0x1f')](function(_0x6bc0a1){if(_0x6bc0a1){if(_0x46b9f9['body']['manual']){_0x22b6e6[_0xb1df('0x27')][_0xb1df('0x70')]=util[_0xb1df('0x5d')](_0xb1df('0x71'),_0x46b9f9[_0xb1df('0x60')][_0xb1df('0x37')]);_0x22b6e6['message']['channel']=_0x22b6e6[_0xb1df('0x72')];_0x22b6e6[_0xb1df('0x27')][_0xb1df('0x73')]=_0x22b6e6[_0xb1df('0x72')];_0x22b6e6['message'][_0xb1df('0x74')]='accept';return respondWithRpcPromise(_0xb1df('0x75'),_0xb1df('0x75'),{'event':_0xb1df('0x76'),'message':_[_0xb1df('0x49')](_0x22b6e6[_0xb1df('0x27')],JSON[_0xb1df('0x77')](_0x22b6e6[_0xb1df('0x64')][_0xb1df('0x78')]))},client9002)['then'](function(){return _0x22b6e6;});}return _0x22b6e6;}return null;})[_0xb1df('0x1f')](respondWithResult(_0x581830,null))[_0xb1df('0x28')](handleError(_0x581830,null));};var interaction_log=require(_0xb1df('0x15'))('chat-interactions');exports[_0xb1df('0x31')]=function(_0x21d4af,_0x402f71,_0x4b86bb){var _0x54366a={'agent':{},'channel':'chat'};if(_0x21d4af[_0xb1df('0x56')]['id']){delete _0x21d4af[_0xb1df('0x56')]['id'];}_0x21d4af['body'][_0xb1df('0x5f')]=_0x21d4af[_0xb1df('0x56')][_0xb1df('0x5f')]||_0x21d4af['user']['id'];_0x54366a[_0xb1df('0x6d')]['id']=_0x21d4af[_0xb1df('0x56')][_0xb1df('0x5f')];return db['ChatMessage'][_0xb1df('0x54')]({'where':{'id':_0x21d4af[_0xb1df('0x51')]['id'],'UserId':null}})[_0xb1df('0x1f')](handleEntityNotFound(_0x402f71,null))['then'](function(_0x15a148){if(_0x15a148){_0x54366a[_0xb1df('0x27')]=_0x15a148[_0xb1df('0x61')]({'plain':!![]});return db[_0xb1df('0x62')][_0xb1df('0x54')]({'where':{'id':_0x15a148[_0xb1df('0x79')]}});}return null;})[_0xb1df('0x1f')](handleEntityNotFound(_0x402f71,null))[_0xb1df('0x1f')](function(_0x453c86){if(_0x453c86){_0x54366a['interaction']=_0x453c86[_0xb1df('0x61')]({'plain':!![]});interaction_log[_0xb1df('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x21d4af[_0xb1df('0x60')]['id'],_0x21d4af[_0xb1df('0x60')]['name'],_0x21d4af['user'][_0xb1df('0x65')],_0x54366a[_0xb1df('0x64')]['id'],_0x21d4af[_0xb1df('0x56')]?JSON[_0xb1df('0x25')](_0x21d4af[_0xb1df('0x56')]):'null');return respondWithRpcPromise('RejectMessage',_0xb1df('0x7a'),_0x54366a);}return null;})[_0xb1df('0x1f')](function(_0x13bc23){var _0x265185=_0xb1df('0x7b')+_0x13bc23['message'][_0xb1df('0x69')];return db[_0xb1df('0x7c')][_0xb1df('0x43')](_0x265185,{'type':db['Sequelize'][_0xb1df('0x6a')][_0xb1df('0x6b')],'raw':!![]})[_0xb1df('0x1f')](function(_0x1e77ee){return _0x1e77ee;});})['then'](function(_0x330b8c){if(_0x330b8c){_0x54366a['message'][_0xb1df('0x6c')]=_0x330b8c[0x0];if(!_0x21d4af[_0xb1df('0x56')][_0xb1df('0x5f')])return;return db[_0xb1df('0x7d')][_0xb1df('0x54')]({'where':{'id':_0x21d4af['body'][_0xb1df('0x5f')],'role':_0xb1df('0x6d')},'attributes':['id',_0xb1df('0x37'),_0xb1df('0x6e'),_0xb1df('0x6f'),_0xb1df('0x7e')],'raw':!![]});}return null;})[_0xb1df('0x1f')](function(_0x1a6ad1){if(!_0x1a6ad1)return null;_0x54366a[_0xb1df('0x27')]['agent']=_0x1a6ad1;return _0x54366a;})['then'](function(_0x192b96){if(_0x192b96){_0x192b96['message']['interface']=util[_0xb1df('0x5d')](_0xb1df('0x71'),_0x21d4af['user'][_0xb1df('0x37')]);_0x192b96[_0xb1df('0x27')][_0xb1df('0x72')]=_0x54366a['channel'];_0x192b96[_0xb1df('0x27')][_0xb1df('0x73')]=_0x54366a['channel'];_0x192b96['message'][_0xb1df('0x74')]=_0xb1df('0x31');respondWithRpcPromise(_0xb1df('0x75'),_0xb1df('0x75'),{'event':_0xb1df('0x7f'),'message':_[_0xb1df('0x49')](_0x54366a[_0xb1df('0x27')],JSON[_0xb1df('0x77')](_0x54366a[_0xb1df('0x64')][_0xb1df('0x78')]))},client9002);return _0x54366a;}return null;})[_0xb1df('0x1f')](respondWithResult(_0x402f71,null))[_0xb1df('0x28')](handleError(_0x402f71,null));};
\ No newline at end of file
+var _0x7a63=['User','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','Content-Range','reject','destroy','then','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','show','includeAll','create','update','body','find','params','describe','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','interaction','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact'];(function(_0x23b421,_0x4b47b8){var _0x21d728=function(_0x56f773){while(--_0x56f773){_0x23b421['push'](_0x23b421['shift']());}};_0x21d728(++_0x4b47b8);}(_0x7a63,0x93));var _0x37a6=function(_0x1be95f,_0x7cce06){_0x1be95f=_0x1be95f-0x0;var _0x2b3116=_0x7a63[_0x1be95f];return _0x2b3116;};'use strict';var emlformat=require(_0x37a6('0x0'));var rimraf=require(_0x37a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x37a6('0x2'));var rp=require(_0x37a6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x37a6('0x4'));var util=require(_0x37a6('0x5'));var path=require(_0x37a6('0x6'));var sox=require(_0x37a6('0x7'));var csv=require(_0x37a6('0x8'));var ejs=require(_0x37a6('0x9'));var fs=require('fs');var fs_extra=require(_0x37a6('0xa'));var _=require(_0x37a6('0xb'));var squel=require(_0x37a6('0xc'));var crypto=require('crypto');var jsforce=require(_0x37a6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x37a6('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x37a6('0xe'));var authService=require(_0x37a6('0xf'));var qs=require(_0x37a6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x37a6('0x11'));var logger=require(_0x37a6('0x12'))(_0x37a6('0x13'));var utils=require(_0x37a6('0x14'));var config=require(_0x37a6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x37a6('0x16'))['db'];config[_0x37a6('0x17')]=_[_0x37a6('0x18')](config[_0x37a6('0x17')],{'host':_0x37a6('0x19'),'port':0x18eb});var socket=require(_0x37a6('0x1a'))(new Redis(config[_0x37a6('0x17')]));require(_0x37a6('0x1b'))[_0x37a6('0x1c')](socket);var jayson=require(_0x37a6('0x1d'));var client=jayson['client'][_0x37a6('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x37a6('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xaa4085,_0xa37f1e,_0x3428b6,_0x5c91b5){return new BPromise(function(_0x48353f,_0x312379){var _0x1e30c0=_0x5c91b5||client;return _0x1e30c0['request'](_0xaa4085,_0x3428b6)['then'](function(_0x4a5374){logger[_0x37a6('0x1f')](_0x37a6('0x20'),_0xa37f1e,'request\x20sent');logger[_0x37a6('0x21')](_0x37a6('0x22'),_0xa37f1e,_0x37a6('0x23'),JSON['stringify'](_0x4a5374));if(_0x4a5374[_0x37a6('0x24')]){if(_0x4a5374[_0x37a6('0x24')][_0x37a6('0x25')]===0x1f4){logger[_0x37a6('0x24')]('ChatMessage,\x20%s,\x20%s',_0xa37f1e,_0x4a5374['error'][_0x37a6('0x26')]);return _0x312379(_0x4a5374[_0x37a6('0x24')]['message']);}logger[_0x37a6('0x24')](_0x37a6('0x20'),_0xa37f1e,_0x4a5374['error'][_0x37a6('0x26')]);return _0x48353f(_0x4a5374[_0x37a6('0x24')][_0x37a6('0x26')]);}else{logger[_0x37a6('0x1f')](_0x37a6('0x20'),_0xa37f1e,_0x37a6('0x23'));_0x48353f(_0x4a5374[_0x37a6('0x27')]['message']);}})[_0x37a6('0x28')](function(_0x5a90c7){logger[_0x37a6('0x24')]('ChatMessage,\x20%s,\x20%s',_0xa37f1e,_0x5a90c7);_0x312379(_0x5a90c7);});});}function respondWithStatusCode(_0x5289e3,_0x5079bd){_0x5079bd=_0x5079bd||0xcc;return function(_0x3337c8){if(_0x3337c8){return _0x5289e3[_0x37a6('0x29')](_0x5079bd);}return _0x5289e3[_0x37a6('0x2a')](_0x5079bd)[_0x37a6('0x2b')]();};}function respondWithResult(_0x262b90,_0xf14d7f){_0xf14d7f=_0xf14d7f||0xc8;return function(_0xfb2cf0){if(_0xfb2cf0){return _0x262b90['status'](_0xf14d7f)[_0x37a6('0x2c')](_0xfb2cf0);}};}function respondWithFilteredResult(_0x137318,_0x94159a){return function(_0x3d4344){if(_0x3d4344){var _0x29a86d=typeof _0x94159a[_0x37a6('0x2d')]==='undefined'&&typeof _0x94159a['limit']===_0x37a6('0x2e');var _0x456c00=_0x3d4344['count'];var _0x554429=_0x29a86d?0x0:_0x94159a[_0x37a6('0x2d')];var _0x1d899d=_0x29a86d?_0x3d4344['count']:_0x94159a[_0x37a6('0x2d')]+_0x94159a[_0x37a6('0x2f')];var _0x237b09;if(_0x1d899d>=_0x456c00){_0x1d899d=_0x456c00;_0x237b09=0xc8;}else{_0x237b09=0xce;}_0x137318['status'](_0x237b09);return _0x137318['set'](_0x37a6('0x30'),_0x554429+'-'+_0x1d899d+'/'+_0x456c00)[_0x37a6('0x2c')](_0x3d4344);}return null;};}function patchUpdates(_0x4b06a8){return function(_0x1f7b66){try{jsonpatch['apply'](_0x1f7b66,_0x4b06a8,!![]);}catch(_0x327bf0){return BPromise[_0x37a6('0x31')](_0x327bf0);}return _0x1f7b66['save']();};}function saveUpdates(_0x23a7ae,_0x75c9be){return function(_0x9efbff){if(_0x9efbff){return _0x9efbff['update'](_0x23a7ae)['then'](function(_0x2be608){return _0x2be608;});}return null;};}function removeEntity(_0x89c230,_0x25ccff){return function(_0x428b7c){if(_0x428b7c){return _0x428b7c[_0x37a6('0x32')]()[_0x37a6('0x33')](function(){_0x89c230[_0x37a6('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a4030,_0x1b5393){return function(_0x3b0f37){if(!_0x3b0f37){_0x1a4030[_0x37a6('0x29')](0x194);}return _0x3b0f37;};}function handleError(_0x423312,_0x3ffa6d){_0x3ffa6d=_0x3ffa6d||0x1f4;return function(_0x35241b){logger[_0x37a6('0x24')](_0x35241b['stack']);if(_0x35241b['name']){delete _0x35241b[_0x37a6('0x34')];}_0x423312[_0x37a6('0x2a')](_0x3ffa6d)[_0x37a6('0x35')](_0x35241b);};}exports[_0x37a6('0x36')]=function(_0x1cfcb7,_0x4cf024){var _0x4a4ad4={},_0x302339={},_0xff5498={'count':0x0,'rows':[]};var _0x551da2=_[_0x37a6('0x37')](db[_0x37a6('0x38')][_0x37a6('0x39')],function(_0x19f869){return{'name':_0x19f869[_0x37a6('0x3a')],'type':_0x19f869[_0x37a6('0x3b')][_0x37a6('0x3c')]};});_0x302339['model']=_[_0x37a6('0x37')](_0x551da2,_0x37a6('0x34'));_0x302339['query']=_[_0x37a6('0x3d')](_0x1cfcb7['query']);_0x302339[_0x37a6('0x3e')]=_[_0x37a6('0x3f')](_0x302339['model'],_0x302339[_0x37a6('0x40')]);_0x4a4ad4[_0x37a6('0x41')]=_['intersection'](_0x302339[_0x37a6('0x42')],qs[_0x37a6('0x43')](_0x1cfcb7[_0x37a6('0x40')][_0x37a6('0x43')]));_0x4a4ad4[_0x37a6('0x41')]=_0x4a4ad4['attributes'][_0x37a6('0x44')]?_0x4a4ad4[_0x37a6('0x41')]:_0x302339[_0x37a6('0x42')];if(!_0x1cfcb7[_0x37a6('0x40')][_0x37a6('0x45')](_0x37a6('0x46'))){_0x4a4ad4[_0x37a6('0x2f')]=qs[_0x37a6('0x2f')](_0x1cfcb7[_0x37a6('0x40')][_0x37a6('0x2f')]);_0x4a4ad4['offset']=qs[_0x37a6('0x2d')](_0x1cfcb7['query'][_0x37a6('0x2d')]);}_0x4a4ad4[_0x37a6('0x47')]=qs['sort'](_0x1cfcb7[_0x37a6('0x40')][_0x37a6('0x48')]);_0x4a4ad4[_0x37a6('0x49')]=qs[_0x37a6('0x3e')](_[_0x37a6('0x4a')](_0x1cfcb7[_0x37a6('0x40')],_0x302339[_0x37a6('0x3e')]),_0x551da2);if(_0x1cfcb7[_0x37a6('0x40')][_0x37a6('0x4b')]){_0x4a4ad4[_0x37a6('0x49')]=_[_0x37a6('0x4c')](_0x4a4ad4[_0x37a6('0x49')],{'$or':_[_0x37a6('0x37')](_0x551da2,function(_0x191124){if(_0x191124[_0x37a6('0x3b')]!==_0x37a6('0x4d')){var _0x3c7735={};_0x3c7735[_0x191124[_0x37a6('0x34')]]={'$like':'%'+_0x1cfcb7[_0x37a6('0x40')]['filter']+'%'};return _0x3c7735;}})});}_0x4a4ad4=_[_0x37a6('0x4c')]({},_0x4a4ad4,_0x1cfcb7[_0x37a6('0x4e')]);var _0x5ddc1d={'where':_0x4a4ad4[_0x37a6('0x49')]};return db[_0x37a6('0x38')][_0x37a6('0x4f')](_0x5ddc1d)[_0x37a6('0x33')](function(_0x5c83bc){_0xff5498[_0x37a6('0x4f')]=_0x5c83bc;if(_0x1cfcb7[_0x37a6('0x40')]['includeAll']){_0x4a4ad4[_0x37a6('0x50')]=[{'all':!![]}];}return db['ChatMessage'][_0x37a6('0x51')](_0x4a4ad4);})[_0x37a6('0x33')](function(_0x4a50a1){_0xff5498[_0x37a6('0x52')]=_0x4a50a1;return _0xff5498;})[_0x37a6('0x33')](respondWithFilteredResult(_0x4cf024,_0x4a4ad4))[_0x37a6('0x28')](handleError(_0x4cf024,null));};exports[_0x37a6('0x53')]=function(_0x551c59,_0x48b2b4){var _0x43011f={'raw':!![],'where':{'id':_0x551c59['params']['id']}},_0x52e013={};_0x52e013[_0x37a6('0x42')]=_['keys'](db[_0x37a6('0x38')][_0x37a6('0x39')]);_0x52e013[_0x37a6('0x40')]=_[_0x37a6('0x3d')](_0x551c59[_0x37a6('0x40')]);_0x52e013[_0x37a6('0x3e')]=_[_0x37a6('0x3f')](_0x52e013[_0x37a6('0x42')],_0x52e013[_0x37a6('0x40')]);_0x43011f[_0x37a6('0x41')]=_[_0x37a6('0x3f')](_0x52e013[_0x37a6('0x42')],qs[_0x37a6('0x43')](_0x551c59['query'][_0x37a6('0x43')]));_0x43011f[_0x37a6('0x41')]=_0x43011f['attributes'][_0x37a6('0x44')]?_0x43011f[_0x37a6('0x41')]:_0x52e013['model'];if(_0x551c59[_0x37a6('0x40')][_0x37a6('0x54')]){_0x43011f[_0x37a6('0x50')]=[{'all':!![]}];}_0x43011f=_[_0x37a6('0x4c')]({},_0x43011f,_0x551c59[_0x37a6('0x4e')]);return db[_0x37a6('0x38')]['find'](_0x43011f)[_0x37a6('0x33')](handleEntityNotFound(_0x48b2b4,null))[_0x37a6('0x33')](respondWithResult(_0x48b2b4,null))[_0x37a6('0x28')](handleError(_0x48b2b4,null));};exports[_0x37a6('0x55')]=function(_0x7ffe6b,_0x1f7af7){return db[_0x37a6('0x38')]['create'](_0x7ffe6b['body'],{})['then'](respondWithResult(_0x1f7af7,0xc9))[_0x37a6('0x28')](handleError(_0x1f7af7,null));};exports[_0x37a6('0x56')]=function(_0x4c3ac3,_0x2c62c9){if(_0x4c3ac3[_0x37a6('0x57')]['id']){delete _0x4c3ac3[_0x37a6('0x57')]['id'];}return db[_0x37a6('0x38')][_0x37a6('0x58')]({'where':{'id':_0x4c3ac3[_0x37a6('0x59')]['id']}})['then'](handleEntityNotFound(_0x2c62c9,null))[_0x37a6('0x33')](saveUpdates(_0x4c3ac3['body'],null))[_0x37a6('0x33')](respondWithResult(_0x2c62c9,null))[_0x37a6('0x28')](handleError(_0x2c62c9,null));};exports[_0x37a6('0x32')]=function(_0x4e4a3b,_0x4a6348){return db[_0x37a6('0x38')][_0x37a6('0x58')]({'where':{'id':_0x4e4a3b['params']['id']}})[_0x37a6('0x33')](handleEntityNotFound(_0x4a6348,null))['then'](removeEntity(_0x4a6348,null))[_0x37a6('0x28')](handleError(_0x4a6348,null));};exports[_0x37a6('0x5a')]=function(_0x436227,_0x263505){return db[_0x37a6('0x38')]['describe']()[_0x37a6('0x33')](respondWithResult(_0x263505,null))[_0x37a6('0x28')](handleError(_0x263505,null));};var interaction_log=require(_0x37a6('0x12'))('chat-interactions');exports[_0x37a6('0x5b')]=function(_0x431fb6,_0x34c1e2,_0x5a1468){var _0x345c17={'agent':{},'channel':_0x37a6('0x5c')};if(_0x431fb6[_0x37a6('0x57')]['id']){delete _0x431fb6[_0x37a6('0x57')]['id'];}_0x431fb6[_0x37a6('0x57')][_0x37a6('0x5d')]=!![];_0x431fb6[_0x37a6('0x57')][_0x37a6('0x5e')]=moment()[_0x37a6('0x5f')](_0x37a6('0x60'));_0x431fb6[_0x37a6('0x57')][_0x37a6('0x61')]=_0x431fb6[_0x37a6('0x57')][_0x37a6('0x61')]||_0x431fb6[_0x37a6('0x62')]['id'];_0x345c17[_0x37a6('0x63')]['id']=_0x431fb6['body'][_0x37a6('0x61')];return db['ChatMessage']['find']({'where':{'id':_0x431fb6['params']['id'],'UserId':null}})[_0x37a6('0x33')](handleEntityNotFound(_0x34c1e2,null))[_0x37a6('0x33')](saveUpdates(_0x431fb6[_0x37a6('0x57')],null))[_0x37a6('0x33')](function(_0x244646){if(_0x244646){_0x345c17[_0x37a6('0x26')]=_0x244646[_0x37a6('0x64')]({'plain':!![]});return db['ChatInteraction'][_0x37a6('0x58')]({'where':{'id':_0x244646[_0x37a6('0x65')]}});}return null;})[_0x37a6('0x33')](handleEntityNotFound(_0x34c1e2,null))['then'](function(_0x2cfd59){if(_0x2cfd59){return _0x2cfd59[_0x37a6('0x56')]({'UserId':_0x431fb6[_0x37a6('0x57')][_0x37a6('0x61')],'read1stAt':_['isNil'](_0x2cfd59['read1stAt'])?moment()[_0x37a6('0x5f')](_0x37a6('0x60')):undefined});}return null;})[_0x37a6('0x33')](function(_0x25fdf1){if(_0x25fdf1){_0x345c17['interaction']=_0x25fdf1['get']({'plain':!![]});interaction_log[_0x37a6('0x1f')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x431fb6[_0x37a6('0x62')]['id'],_0x431fb6[_0x37a6('0x62')][_0x37a6('0x34')],_0x431fb6['user']['role'],_0x345c17[_0x37a6('0x66')]['id'],_0x431fb6[_0x37a6('0x57')]?JSON[_0x37a6('0x67')](_0x431fb6[_0x37a6('0x57')]):_0x37a6('0x68'));return respondWithRpcPromise(_0x37a6('0x69'),_0x37a6('0x6a'),_0x345c17);}return null;})['then'](function(_0x14d088){var _0x342ab5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x14d088[_0x37a6('0x26')][_0x37a6('0x6b')];return db[_0x37a6('0x6c')][_0x37a6('0x40')](_0x342ab5,{'type':db[_0x37a6('0x6d')][_0x37a6('0x6e')][_0x37a6('0x6f')],'raw':!![]})[_0x37a6('0x33')](function(_0x3e5b23){return _0x3e5b23;});})[_0x37a6('0x33')](function(_0x298cd1){if(_0x298cd1){_0x345c17[_0x37a6('0x26')][_0x37a6('0x70')]=_0x298cd1[0x0];if(!_0x431fb6['body']['UserId'])return;return db[_0x37a6('0x71')][_0x37a6('0x58')]({'where':{'id':_0x431fb6['body'][_0x37a6('0x61')],'role':_0x37a6('0x63')},'attributes':['id','name','fullname',_0x37a6('0x72'),_0x37a6('0x73')],'raw':!![]});}return null;})[_0x37a6('0x33')](function(_0x5092d6){if(!_0x5092d6)return null;_0x345c17['message'][_0x37a6('0x63')]=_0x5092d6;return _0x345c17;})[_0x37a6('0x33')](function(_0x195a5d){if(_0x195a5d){if(_0x431fb6['body'][_0x37a6('0x74')]){_0x345c17[_0x37a6('0x26')][_0x37a6('0x75')]=util['format'](_0x37a6('0x76'),_0x431fb6['user'][_0x37a6('0x34')]);_0x345c17[_0x37a6('0x26')]['channel']=_0x345c17['channel'];_0x345c17[_0x37a6('0x26')][_0x37a6('0x77')]=_0x345c17[_0x37a6('0x78')];_0x345c17[_0x37a6('0x26')][_0x37a6('0x79')]='accept';return respondWithRpcPromise(_0x37a6('0x7a'),_0x37a6('0x7a'),{'event':_0x37a6('0x7b'),'message':_[_0x37a6('0x4c')](_0x345c17[_0x37a6('0x26')],JSON['parse'](_0x345c17[_0x37a6('0x66')][_0x37a6('0x7c')]))},client9002)[_0x37a6('0x33')](function(){return _0x345c17;});}return _0x345c17;}return null;})[_0x37a6('0x33')](respondWithResult(_0x34c1e2,null))[_0x37a6('0x28')](handleError(_0x34c1e2,null));};var interaction_log=require(_0x37a6('0x12'))('chat-interactions');exports[_0x37a6('0x31')]=function(_0x112673,_0x3debb2,_0x2f0f03){var _0x38cf19={'agent':{},'channel':_0x37a6('0x5c')};if(_0x112673['body']['id']){delete _0x112673['body']['id'];}_0x112673[_0x37a6('0x57')][_0x37a6('0x61')]=_0x112673[_0x37a6('0x57')][_0x37a6('0x61')]||_0x112673[_0x37a6('0x62')]['id'];_0x38cf19[_0x37a6('0x63')]['id']=_0x112673[_0x37a6('0x57')][_0x37a6('0x61')];return db['ChatMessage']['find']({'where':{'id':_0x112673[_0x37a6('0x59')]['id'],'UserId':null}})[_0x37a6('0x33')](handleEntityNotFound(_0x3debb2,null))[_0x37a6('0x33')](function(_0x38187d){if(_0x38187d){_0x38cf19[_0x37a6('0x26')]=_0x38187d['get']({'plain':!![]});return db[_0x37a6('0x7d')]['find']({'where':{'id':_0x38187d[_0x37a6('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x3debb2,null))[_0x37a6('0x33')](function(_0x19d7ba){if(_0x19d7ba){_0x38cf19[_0x37a6('0x66')]=_0x19d7ba[_0x37a6('0x64')]({'plain':!![]});interaction_log[_0x37a6('0x1f')](_0x37a6('0x7e'),_0x112673['user']['id'],_0x112673[_0x37a6('0x62')][_0x37a6('0x34')],_0x112673[_0x37a6('0x62')][_0x37a6('0x7f')],_0x38cf19[_0x37a6('0x66')]['id'],_0x112673[_0x37a6('0x57')]?JSON[_0x37a6('0x67')](_0x112673[_0x37a6('0x57')]):_0x37a6('0x68'));return respondWithRpcPromise(_0x37a6('0x80'),'rejectMessage',_0x38cf19);}return null;})[_0x37a6('0x33')](function(_0x44c14e){var _0x45eec3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x44c14e[_0x37a6('0x26')][_0x37a6('0x6b')];return db[_0x37a6('0x6c')][_0x37a6('0x40')](_0x45eec3,{'type':db[_0x37a6('0x6d')]['QueryTypes'][_0x37a6('0x6f')],'raw':!![]})[_0x37a6('0x33')](function(_0x46b52a){return _0x46b52a;});})[_0x37a6('0x33')](function(_0x54d277){if(_0x54d277){_0x38cf19['message'][_0x37a6('0x70')]=_0x54d277[0x0];if(!_0x112673['body'][_0x37a6('0x61')])return;return db['User'][_0x37a6('0x58')]({'where':{'id':_0x112673[_0x37a6('0x57')][_0x37a6('0x61')],'role':'agent'},'attributes':['id',_0x37a6('0x34'),'fullname',_0x37a6('0x72'),'internal'],'raw':!![]});}return null;})['then'](function(_0x35020f){if(!_0x35020f)return null;_0x38cf19[_0x37a6('0x26')][_0x37a6('0x63')]=_0x35020f;return _0x38cf19;})[_0x37a6('0x33')](function(_0x56b663){if(_0x56b663){_0x56b663[_0x37a6('0x26')][_0x37a6('0x75')]=util[_0x37a6('0x5f')](_0x37a6('0x76'),_0x112673['user'][_0x37a6('0x34')]);_0x56b663[_0x37a6('0x26')][_0x37a6('0x78')]=_0x38cf19[_0x37a6('0x78')];_0x56b663[_0x37a6('0x26')][_0x37a6('0x77')]=_0x38cf19[_0x37a6('0x78')];_0x56b663[_0x37a6('0x26')][_0x37a6('0x79')]=_0x37a6('0x31');respondWithRpcPromise(_0x37a6('0x7a'),_0x37a6('0x7a'),{'event':_0x37a6('0x81'),'message':_[_0x37a6('0x4c')](_0x38cf19[_0x37a6('0x26')],JSON['parse'](_0x38cf19[_0x37a6('0x66')][_0x37a6('0x7c')]))},client9002);return _0x38cf19;}return null;})[_0x37a6('0x33')](respondWithResult(_0x3debb2,null))[_0x37a6('0x28')](handleError(_0x3debb2,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 3a3ae0a..6a4681a 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 _0x994a=['ChatMessage','setMaxListeners','save','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x579124,_0x2022e0){var _0x2507e5=function(_0x3cf38f){while(--_0x3cf38f){_0x579124['push'](_0x579124['shift']());}};_0x2507e5(++_0x2022e0);}(_0x994a,0x67));var _0xa994=function(_0x466876,_0x135bac){_0x466876=_0x466876-0x0;var _0x3fbf01=_0x994a[_0x466876];return _0x3fbf01;};'use strict';var EventEmitter=require(_0xa994('0x0'));var ChatMessage=require(_0xa994('0x1'))['db'][_0xa994('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa994('0x3')](0x0);var events={'afterCreate':_0xa994('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x48477c){return function(_0x40d070,_0x3b2e06,_0x1438c0){ChatMessageEvents['emit'](_0x48477c+':'+_0x40d070['id'],_0x40d070);ChatMessageEvents['emit'](_0x48477c,_0x40d070);_0x1438c0(null);};}for(var e in events){if(events[_0xa994('0x5')](e)){var event=events[e];ChatMessage[_0xa994('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x0fbd=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','remove','emit'];(function(_0x4e00f3,_0x4e7ccc){var _0x2e3471=function(_0x485126){while(--_0x485126){_0x4e00f3['push'](_0x4e00f3['shift']());}};_0x2e3471(++_0x4e7ccc);}(_0x0fbd,0x133));var _0xd0fb=function(_0x455798,_0xd126ce){_0x455798=_0x455798-0x0;var _0x3afe64=_0x0fbd[_0x455798];return _0x3afe64;};'use strict';var EventEmitter=require(_0xd0fb('0x0'));var ChatMessage=require(_0xd0fb('0x1'))['db'][_0xd0fb('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd0fb('0x3')};function emitEvent(_0x260f84){return function(_0x2dba04,_0x2df9a4,_0x2694bf){ChatMessageEvents[_0xd0fb('0x4')](_0x260f84+':'+_0x2dba04['id'],_0x2dba04);ChatMessageEvents[_0xd0fb('0x4')](_0x260f84,_0x2dba04);_0x2694bf(null);};}for(var e in events){if(events[_0xd0fb('0x5')](e)){var event=events[e];ChatMessage[_0xd0fb('0x6')](e,emitEvent(event));}}module[_0xd0fb('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 99a5d43..d0d603b 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 _0xcc0d=['ChatInteraction','findOne','ChatInteractionId','then','update','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil'];(function(_0x5b3600,_0x5d5543){var _0x2353a1=function(_0x4b921a){while(--_0x4b921a){_0x5b3600['push'](_0x5b3600['shift']());}};_0x2353a1(++_0x5d5543);}(_0xcc0d,0x174));var _0xdcc0=function(_0x4b8111,_0x3a9f74){_0x4b8111=_0x4b8111-0x0;var _0x13a15f=_0xcc0d[_0x4b8111];return _0x13a15f;};'use strict';var _=require(_0xdcc0('0x0'));var util=require(_0xdcc0('0x1'));var logger=require(_0xdcc0('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdcc0('0x3'));var rp=require(_0xdcc0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdcc0('0x5'));var config=require(_0xdcc0('0x6'));var attributes=require(_0xdcc0('0x7'));module['exports']=function(_0x3baa5c,_0x5b6b32){return _0x3baa5c['define'](_0xdcc0('0x8'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xdcc0('0x9'),'fields':[_0xdcc0('0xa')],'type':_0xdcc0('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f4f4f,_0x4d82b5,_0x166e9d){var _0x162aa7=_0x3baa5c[_0xdcc0('0xc')];var _0x1ba3b0=_0x4f4f4f[_0xdcc0('0xd')]({'plain':!![]});if(_0x1ba3b0[_0xdcc0('0xe')][_0xdcc0('0xf')]()==='in'||_0x1ba3b0['direction'][_0xdcc0('0xf')]()==='out'&&!_0x1ba3b0[_0xdcc0('0x10')]&&!_[_0xdcc0('0x11')](_0x1ba3b0['UserId'])){_0x162aa7[_0xdcc0('0x12')][_0xdcc0('0x13')]({'where':{'id':_0x1ba3b0[_0xdcc0('0x14')]}})[_0xdcc0('0x15')](function(_0x25a458){if(_0x25a458){_0x25a458[_0xdcc0('0x16')]({'lastMsgAt':_0x1ba3b0['createdAt'],'lastMsgDirection':_0x1ba3b0['direction'][_0xdcc0('0xf')]()});}})['catch'](function(_0xa1fd7c){console[_0xdcc0('0x17')](_0xa1fd7c);});}_0x166e9d();}},'charset':_0xdcc0('0x18'),'collate':_0xdcc0('0x19')});};
\ No newline at end of file
+var _0xac4e=['FULLTEXT','models','direction','toLowerCase','secret','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xac4e,0x1d9));var _0xeac4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xac4e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xeac4('0x0'));var util=require(_0xeac4('0x1'));var logger=require(_0xeac4('0x2'))(_0xeac4('0x3'));var moment=require(_0xeac4('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeac4('0x5'));var rimraf=require(_0xeac4('0x6'));var config=require(_0xeac4('0x7'));var attributes=require('./chatMessage.attributes');module[_0xeac4('0x8')]=function(_0x233a03,_0x2f0039){return _0x233a03[_0xeac4('0x9')](_0xeac4('0xa'),attributes,{'tableName':_0xeac4('0xb'),'paranoid':![],'indexes':[{'name':_0xeac4('0xc'),'fields':['body'],'type':_0xeac4('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x178e7e,_0x309585,_0x359721){var _0x120dbb=_0x233a03[_0xeac4('0xe')];var _0x3f9035=_0x178e7e['get']({'plain':!![]});if(_0x3f9035[_0xeac4('0xf')][_0xeac4('0x10')]()==='in'||_0x3f9035[_0xeac4('0xf')][_0xeac4('0x10')]()==='out'&&!_0x3f9035[_0xeac4('0x11')]&&!_['isNil'](_0x3f9035[_0xeac4('0x12')])){_0x120dbb[_0xeac4('0x13')][_0xeac4('0x14')]({'where':{'id':_0x3f9035[_0xeac4('0x15')]}})['then'](function(_0x42025d){if(_0x42025d){_0x42025d[_0xeac4('0x16')]({'lastMsgAt':_0x3f9035[_0xeac4('0x17')],'lastMsgDirection':_0x3f9035[_0xeac4('0xf')]['toLowerCase']()});}})[_0xeac4('0x18')](function(_0x566c02){console['error'](_0x566c02);});}_0x359721();}},'charset':_0xeac4('0x19'),'collate':_0xeac4('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index fa02daf..a475817 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 _0xba73=['request\x20sent','stringify','error','message','info','result','catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatMessage.socket','request','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x1abb9b,_0x5040b3){var _0x556e5e=function(_0x7e6f0c){while(--_0x7e6f0c){_0x1abb9b['push'](_0x1abb9b['shift']());}};_0x556e5e(++_0x5040b3);}(_0xba73,0x18c));var _0x3ba7=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xba73[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x3ba7('0x0'));var util=require(_0x3ba7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3ba7('0x2'));var fs=require('fs');var Redis=require(_0x3ba7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ba7('0x4'));var logger=require(_0x3ba7('0x5'))(_0x3ba7('0x6'));var config=require(_0x3ba7('0x7'));var jayson=require(_0x3ba7('0x8'));var client=jayson[_0x3ba7('0x9')][_0x3ba7('0xa')]({'port':0x232a});config['redis']=_[_0x3ba7('0xb')](config[_0x3ba7('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3ba7('0xd'))(new Redis(config[_0x3ba7('0xc')]));require(_0x3ba7('0xe'))['register'](socket);function respondWithRpcPromise(_0x123c0a,_0x2e2fce,_0x25c1a6){return new BPromise(function(_0x42daad,_0x2040dd){return client[_0x3ba7('0xf')](_0x123c0a,_0x25c1a6)[_0x3ba7('0x10')](function(_0x184799){logger['info'](_0x3ba7('0x11'),_0x2e2fce,'request\x20sent');logger[_0x3ba7('0x12')](_0x3ba7('0x13'),_0x2e2fce,_0x3ba7('0x14'),JSON[_0x3ba7('0x15')](_0x184799));if(_0x184799[_0x3ba7('0x16')]){if(_0x184799[_0x3ba7('0x16')]['code']===0x1f4){logger['error'](_0x3ba7('0x11'),_0x2e2fce,_0x184799[_0x3ba7('0x16')]['message']);return _0x2040dd(_0x184799[_0x3ba7('0x16')]['message']);}logger[_0x3ba7('0x16')]('ChatMessage,\x20%s,\x20%s',_0x2e2fce,_0x184799[_0x3ba7('0x16')]['message']);return _0x42daad(_0x184799[_0x3ba7('0x16')][_0x3ba7('0x17')]);}else{logger[_0x3ba7('0x18')](_0x3ba7('0x11'),_0x2e2fce,_0x3ba7('0x14'));_0x42daad(_0x184799[_0x3ba7('0x19')][_0x3ba7('0x17')]);}})[_0x3ba7('0x1a')](function(_0x50c891){logger[_0x3ba7('0x16')](_0x3ba7('0x11'),_0x2e2fce,_0x50c891);_0x2040dd(_0x50c891);});});}exports[_0x3ba7('0x1b')]=function(_0x23e9ab){var _0x10784d=this;return new Promise(function(_0x14ca0b,_0xfe7337){return db[_0x3ba7('0x1c')]['create'](_0x23e9ab[_0x3ba7('0x1d')],{'raw':_0x23e9ab[_0x3ba7('0x1e')]?_0x23e9ab[_0x3ba7('0x1e')][_0x3ba7('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x459d07){logger[_0x3ba7('0x18')](_0x3ba7('0x1b'),_0x23e9ab);logger[_0x3ba7('0x12')](_0x3ba7('0x1b'),_0x23e9ab,JSON[_0x3ba7('0x15')](_0x459d07));_0x14ca0b(_0x459d07);})[_0x3ba7('0x1a')](function(_0x203836){logger[_0x3ba7('0x16')](_0x3ba7('0x1b'),_0x203836['message'],_0x23e9ab);_0xfe7337(_0x10784d['error'](0x1f4,_0x203836['message']));});});};
\ No newline at end of file
+var _0x3738=['options','raw','then','util','moment','../../mysqldb','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','create'];(function(_0x40a14b,_0x5efaf9){var _0x6450fc=function(_0x2e0448){while(--_0x2e0448){_0x40a14b['push'](_0x40a14b['shift']());}};_0x6450fc(++_0x5efaf9);}(_0x3738,0x11b));var _0x8373=function(_0x22cf70,_0x52ded0){_0x22cf70=_0x22cf70-0x0;var _0x5dc166=_0x3738[_0x22cf70];return _0x5dc166;};'use strict';var _=require('lodash');var util=require(_0x8373('0x0'));var moment=require(_0x8373('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8373('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8373('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8373('0x4')][_0x8373('0x5')]({'port':0x232a});config[_0x8373('0x6')]=_[_0x8373('0x7')](config['redis'],{'host':_0x8373('0x8'),'port':0x18eb});var socket=require(_0x8373('0x9'))(new Redis(config['redis']));require(_0x8373('0xa'))[_0x8373('0xb')](socket);function respondWithRpcPromise(_0x30722e,_0x10992c,_0x5e948c){return new BPromise(function(_0x111f27,_0x314b37){return client['request'](_0x30722e,_0x5e948c)['then'](function(_0x16899d){logger[_0x8373('0xc')](_0x8373('0xd'),_0x10992c,_0x8373('0xe'));logger[_0x8373('0xf')](_0x8373('0x10'),_0x10992c,'request\x20sent',JSON[_0x8373('0x11')](_0x16899d));if(_0x16899d[_0x8373('0x12')]){if(_0x16899d[_0x8373('0x12')][_0x8373('0x13')]===0x1f4){logger[_0x8373('0x12')]('ChatMessage,\x20%s,\x20%s',_0x10992c,_0x16899d['error']['message']);return _0x314b37(_0x16899d[_0x8373('0x12')]['message']);}logger[_0x8373('0x12')]('ChatMessage,\x20%s,\x20%s',_0x10992c,_0x16899d['error'][_0x8373('0x14')]);return _0x111f27(_0x16899d[_0x8373('0x12')][_0x8373('0x14')]);}else{logger[_0x8373('0xc')]('ChatMessage,\x20%s,\x20%s',_0x10992c,'request\x20sent');_0x111f27(_0x16899d['result'][_0x8373('0x14')]);}})[_0x8373('0x15')](function(_0xbe0826){logger['error'](_0x8373('0xd'),_0x10992c,_0xbe0826);_0x314b37(_0xbe0826);});});}exports[_0x8373('0x16')]=function(_0x4a4a02){var _0x1b468e=this;return new Promise(function(_0x46403d,_0x4b4f0e){return db[_0x8373('0x17')][_0x8373('0x18')](_0x4a4a02['body'],{'raw':_0x4a4a02[_0x8373('0x19')]?_0x4a4a02[_0x8373('0x19')][_0x8373('0x1a')]===undefined?!![]:![]:!![]})[_0x8373('0x1b')](function(_0x4ce4d1){logger[_0x8373('0xc')](_0x8373('0x16'),_0x4a4a02);logger[_0x8373('0xf')](_0x8373('0x16'),_0x4a4a02,JSON[_0x8373('0x11')](_0x4ce4d1));_0x46403d(_0x4ce4d1);})[_0x8373('0x15')](function(_0x4b4b82){logger[_0x8373('0x12')](_0x8373('0x16'),_0x4b4b82[_0x8373('0x14')],_0x4a4a02);_0x4b4f0e(_0x1b468e['error'](0x1f4,_0x4b4b82[_0x8373('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 1652971..c598f5b 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 _0x6075=['remove','update','emit','register','chatMessage:','save'];(function(_0x2d2623,_0x1aaea0){var _0x28f6c1=function(_0x599d40){while(--_0x599d40){_0x2d2623['push'](_0x2d2623['shift']());}};_0x28f6c1(++_0x1aaea0);}(_0x6075,0x191));var _0x5607=function(_0x9df33f,_0x27e67f){_0x9df33f=_0x9df33f-0x0;var _0x4d712f=_0x6075[_0x9df33f];return _0x4d712f;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5607('0x0'),_0x5607('0x1'),_0x5607('0x2')];function createListener(_0x24427f,_0x2bcf4e){return function(_0x120ba2){_0x2bcf4e[_0x5607('0x3')](_0x24427f,_0x120ba2);};}function removeListener(_0x100852,_0x2a1c03){return function(){ChatMessageEvents['removeListener'](_0x100852,_0x2a1c03);};}exports[_0x5607('0x4')]=function(_0xabf691){for(var _0x14b9f4=0x0,_0x5ab18d=events['length'];_0x14b9f4<_0x5ab18d;_0x14b9f4++){var _0x3dc860=events[_0x14b9f4];var _0x25107d=createListener(_0x5607('0x5')+_0x3dc860,_0xabf691);ChatMessageEvents['on'](_0x3dc860,_0x25107d);}};
\ No newline at end of file
+var _0xa8eb=['length','./chatMessage.events','remove','register'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0xa8eb,0x179));var _0xba8e=function(_0x4d0136,_0x5f2a26){_0x4d0136=_0x4d0136-0x0;var _0x5d9f67=_0xa8eb[_0x4d0136];return _0x5d9f67;};'use strict';var ChatMessageEvents=require(_0xba8e('0x0'));var events=['save',_0xba8e('0x1'),'update'];function createListener(_0xd7f19f,_0x35f485){return function(_0x3b8fee){_0x35f485['emit'](_0xd7f19f,_0x3b8fee);};}function removeListener(_0x353df2,_0x368ce6){return function(){ChatMessageEvents['removeListener'](_0x353df2,_0x368ce6);};}exports[_0xba8e('0x2')]=function(_0x57e345){for(var _0x14c3ac=0x0,_0x52a8ef=events[_0xba8e('0x3')];_0x14c3ac<_0x52a8ef;_0x14c3ac++){var _0x69ccbe=events[_0x14c3ac];var _0x4b1bd6=createListener('chatMessage:'+_0x69ccbe,_0x57e345);ChatMessageEvents['on'](_0x69ccbe,_0x4b1bd6);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 5285db6..1a844b5 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 _0xd8b3=['create','update','put','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','index','get','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create'];(function(_0x505fd1,_0x1571cc){var _0x10881b=function(_0x17872c){while(--_0x17872c){_0x505fd1['push'](_0x505fd1['shift']());}};_0x10881b(++_0x1571cc);}(_0xd8b3,0x117));var _0x3d8b=function(_0x13c174,_0xda25fe){_0x13c174=_0x13c174-0x0;var _0x160654=_0xd8b3[_0x13c174];return _0x160654;};'use strict';var multer=require(_0x3d8b('0x0'));var util=require(_0x3d8b('0x1'));var path=require(_0x3d8b('0x2'));var timeout=require(_0x3d8b('0x3'));var express=require('express');var router=express[_0x3d8b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3d8b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3d8b('0x6'));var controller=require(_0x3d8b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3d8b('0x8')]);router[_0x3d8b('0x9')]('/describe',auth[_0x3d8b('0xa')](),controller[_0x3d8b('0xb')]);router[_0x3d8b('0x9')](_0x3d8b('0xc'),auth[_0x3d8b('0xa')](),controller[_0x3d8b('0xd')]);router[_0x3d8b('0xe')]('/',auth[_0x3d8b('0xa')](),interaction[_0x3d8b('0xf')](_0x3d8b('0x10'),_0x3d8b('0x11')),controller[_0x3d8b('0x12')]);router['put'](_0x3d8b('0xc'),controller[_0x3d8b('0x13')]);router[_0x3d8b('0x14')](_0x3d8b('0x15'),auth[_0x3d8b('0xa')](),controller[_0x3d8b('0x16')]);router[_0x3d8b('0x14')](_0x3d8b('0x17'),auth[_0x3d8b('0xa')](),controller[_0x3d8b('0x18')]);router['delete'](_0x3d8b('0xc'),auth['isAuthenticated'](),controller[_0x3d8b('0x19')]);module[_0x3d8b('0x1a')]=router;
\ No newline at end of file
+var _0x250d=['../../components/interaction/service','../../config/environment','./chatMessage.controller','get','/describe','describe','/:id','isAuthenticated','show','post','tracked','chatmessage:create','create','update','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x250d,0x14a));var _0xd250=function(_0x4a29a9,_0x58cd04){_0x4a29a9=_0x4a29a9-0x0;var _0x386570=_0x250d[_0x4a29a9];return _0x386570;};'use strict';var multer=require(_0xd250('0x0'));var util=require(_0xd250('0x1'));var path=require(_0xd250('0x2'));var timeout=require(_0xd250('0x3'));var express=require('express');var router=express[_0xd250('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd250('0x5'));var interaction=require(_0xd250('0x6'));var config=require(_0xd250('0x7'));var controller=require(_0xd250('0x8'));router[_0xd250('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd250('0x9')](_0xd250('0xa'),auth['isAuthenticated'](),controller[_0xd250('0xb')]);router[_0xd250('0x9')](_0xd250('0xc'),auth[_0xd250('0xd')](),controller[_0xd250('0xe')]);router[_0xd250('0xf')]('/',auth['isAuthenticated'](),interaction[_0xd250('0x10')]('chat',_0xd250('0x11')),controller[_0xd250('0x12')]);router['put'](_0xd250('0xc'),controller[_0xd250('0x13')]);router['put'](_0xd250('0x14'),auth['isAuthenticated'](),controller[_0xd250('0x15')]);router[_0xd250('0x16')](_0xd250('0x17'),auth[_0xd250('0xd')](),controller[_0xd250('0x18')]);router[_0xd250('0x19')]('/:id',auth[_0xd250('0xd')](),controller[_0xd250('0x1a')]);module[_0xd250('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index d8fe981..3d6906e 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 _0x1fee=['TEXT','medium','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fee,0x12e));var _0xe1fe=function(_0x40e6d1,_0x8e4ede){_0x40e6d1=_0x40e6d1-0x0;var _0x5813e7=_0x1fee[_0x40e6d1];return _0x5813e7;};'use strict';var Sequelize=require(_0xe1fe('0x0'));module[_0xe1fe('0x1')]={'body':{'type':Sequelize[_0xe1fe('0x2')](_0xe1fe('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x1c7b=['medium','sequelize','exports'];(function(_0x10fd30,_0x435db3){var _0x5b4632=function(_0x23d2c3){while(--_0x23d2c3){_0x10fd30['push'](_0x10fd30['shift']());}};_0x5b4632(++_0x435db3);}(_0x1c7b,0xd6));var _0xb1c7=function(_0x1a4b92,_0x53283c){_0x1a4b92=_0x1a4b92-0x0;var _0x176366=_0x1c7b[_0x1a4b92];return _0x176366;};'use strict';var Sequelize=require(_0xb1c7('0x0'));module[_0xb1c7('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb1c7('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 1652801..90086bd 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 _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(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x7a54,0x106));var _0x47a5=function(_0x3f8156,_0x170874){_0x3f8156=_0x3f8156-0x0;var _0x313144=_0x7a54[_0x3f8156];return _0x313144;};'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
+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(_0x4bfcf1,_0x3bfae7){var _0x3d29f7=function(_0x441e2a){while(--_0x441e2a){_0x4bfcf1['push'](_0x4bfcf1['shift']());}};_0x3d29f7(++_0x3bfae7);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 7c03d94..60f0ced 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 _0x64d7=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x64d7,0x1b2));var _0x764d=function(_0x284807,_0x4be925){_0x284807=_0x284807-0x0;var _0x50c774=_0x64d7[_0x284807];return _0x50c774;};'use strict';var _=require(_0x764d('0x0'));var util=require(_0x764d('0x1'));var logger=require('../../config/logger')(_0x764d('0x2'));var moment=require(_0x764d('0x3'));var BPromise=require(_0x764d('0x4'));var rp=require(_0x764d('0x5'));var fs=require('fs');var path=require(_0x764d('0x6'));var rimraf=require('rimraf');var config=require(_0x764d('0x7'));var attributes=require(_0x764d('0x8'));module[_0x764d('0x9')]=function(_0x1fe471,_0x21d263){return _0x1fe471[_0x764d('0xa')](_0x764d('0xb'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x764d('0xc'),'collate':_0x764d('0xd')});};
\ No newline at end of file
+var _0x856b=['ChatOfflineMessage','chat_offline_messages','utf8mb4','lodash','util','bluebird','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x856b,0x9f));var _0xb856=function(_0x255a63,_0x2b8f0c){_0x255a63=_0x255a63-0x0;var _0xf6a438=_0x856b[_0x255a63];return _0xf6a438;};'use strict';var _=require(_0xb856('0x0'));var util=require(_0xb856('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb856('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb856('0x3'));var rimraf=require(_0xb856('0x4'));var config=require(_0xb856('0x5'));var attributes=require(_0xb856('0x6'));module[_0xb856('0x7')]=function(_0x193ae2,_0x42ead8){return _0x193ae2[_0xb856('0x8')](_0xb856('0x9'),attributes,{'tableName':_0xb856('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb856('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index fe220bd..ddb5c17 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 _0x5aaa=['message','info','result','lodash','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','debug','request\x20sent','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x4de1b1,_0x18c64c){var _0x639f27=function(_0x635e03){while(--_0x635e03){_0x4de1b1['push'](_0x4de1b1['shift']());}};_0x639f27(++_0x18c64c);}(_0x5aaa,0xff));var _0xa5aa=function(_0x58a3e9,_0x222833){_0x58a3e9=_0x58a3e9-0x0;var _0x4ad233=_0x5aaa[_0x58a3e9];return _0x4ad233;};'use strict';var _=require(_0xa5aa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa5aa('0x1'))['db'];var utils=require(_0xa5aa('0x2'));var logger=require(_0xa5aa('0x3'))('rpc');var config=require(_0xa5aa('0x4'));var jayson=require(_0xa5aa('0x5'));var client=jayson['client'][_0xa5aa('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x143817,_0x43e3bb,_0x2c0b72){return new BPromise(function(_0x5574aa,_0x566435){return client[_0xa5aa('0x7')](_0x143817,_0x2c0b72)[_0xa5aa('0x8')](function(_0x19e12a){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x43e3bb,'request\x20sent');logger[_0xa5aa('0x9')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x43e3bb,_0xa5aa('0xa'),JSON[_0xa5aa('0xb')](_0x19e12a));if(_0x19e12a[_0xa5aa('0xc')]){if(_0x19e12a[_0xa5aa('0xc')][_0xa5aa('0xd')]===0x1f4){logger['error'](_0xa5aa('0xe'),_0x43e3bb,_0x19e12a[_0xa5aa('0xc')][_0xa5aa('0xf')]);return _0x566435(_0x19e12a[_0xa5aa('0xc')]['message']);}logger[_0xa5aa('0xc')](_0xa5aa('0xe'),_0x43e3bb,_0x19e12a[_0xa5aa('0xc')]['message']);return _0x5574aa(_0x19e12a[_0xa5aa('0xc')][_0xa5aa('0xf')]);}else{logger[_0xa5aa('0x10')](_0xa5aa('0xe'),_0x43e3bb,_0xa5aa('0xa'));_0x5574aa(_0x19e12a[_0xa5aa('0x11')][_0xa5aa('0xf')]);}})['catch'](function(_0x219532){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x43e3bb,_0x219532);_0x566435(_0x219532);});});}
\ No newline at end of file
+var _0x9ee6=['catch','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x34c027,_0x123688){var _0x47bff0=function(_0x19c4a9){while(--_0x19c4a9){_0x34c027['push'](_0x34c027['shift']());}};_0x47bff0(++_0x123688);}(_0x9ee6,0x94));var _0x69ee=function(_0x199c03,_0x3254aa){_0x199c03=_0x199c03-0x0;var _0x11a7d4=_0x9ee6[_0x199c03];return _0x11a7d4;};'use strict';var _=require('lodash');var util=require(_0x69ee('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x69ee('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69ee('0x2'))['db'];var utils=require(_0x69ee('0x3'));var logger=require(_0x69ee('0x4'))(_0x69ee('0x5'));var config=require(_0x69ee('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x69ee('0x7')][_0x69ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10919a,_0x389035,_0x2854c4){return new BPromise(function(_0x3b78d8,_0x352d01){return client[_0x69ee('0x9')](_0x10919a,_0x2854c4)[_0x69ee('0xa')](function(_0x3b85e3){logger[_0x69ee('0xb')](_0x69ee('0xc'),_0x389035,_0x69ee('0xd'));logger[_0x69ee('0xe')](_0x69ee('0xf'),_0x389035,'request\x20sent',JSON[_0x69ee('0x10')](_0x3b85e3));if(_0x3b85e3['error']){if(_0x3b85e3[_0x69ee('0x11')][_0x69ee('0x12')]===0x1f4){logger[_0x69ee('0x11')](_0x69ee('0xc'),_0x389035,_0x3b85e3[_0x69ee('0x11')][_0x69ee('0x13')]);return _0x352d01(_0x3b85e3['error'][_0x69ee('0x13')]);}logger[_0x69ee('0x11')](_0x69ee('0xc'),_0x389035,_0x3b85e3['error']['message']);return _0x3b78d8(_0x3b85e3['error'][_0x69ee('0x13')]);}else{logger[_0x69ee('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x389035,_0x69ee('0xd'));_0x3b78d8(_0x3b85e3['result']['message']);}})[_0x69ee('0x14')](function(_0x2685ca){logger[_0x69ee('0x11')](_0x69ee('0xc'),_0x389035,_0x2685ca);_0x352d01(_0x2685ca);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 0684cae..a4e5118 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 _0xd1c7=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','put','update','delete','destroy','exports','multer'];(function(_0x1a87e8,_0x3c5fc8){var _0x27828f=function(_0x25a07a){while(--_0x25a07a){_0x1a87e8['push'](_0x1a87e8['shift']());}};_0x27828f(++_0x3c5fc8);}(_0xd1c7,0x1c7));var _0x7d1c=function(_0xea1bcd,_0x465e08){_0xea1bcd=_0xea1bcd-0x0;var _0xfbe4c6=_0xd1c7[_0xea1bcd];return _0xfbe4c6;};'use strict';var multer=require(_0x7d1c('0x0'));var util=require(_0x7d1c('0x1'));var path=require(_0x7d1c('0x2'));var timeout=require(_0x7d1c('0x3'));var express=require(_0x7d1c('0x4'));var router=express[_0x7d1c('0x5')]();var fs_extra=require(_0x7d1c('0x6'));var auth=require(_0x7d1c('0x7'));var interaction=require(_0x7d1c('0x8'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x7d1c('0x9')]('/',auth[_0x7d1c('0xa')](),controller['index']);router[_0x7d1c('0x9')](_0x7d1c('0xb'),auth[_0x7d1c('0xa')](),controller[_0x7d1c('0xc')]);router[_0x7d1c('0x9')](_0x7d1c('0xd'),auth[_0x7d1c('0xa')](),controller['show']);router['post']('/',auth[_0x7d1c('0xa')](),controller['create']);router[_0x7d1c('0xe')](_0x7d1c('0xd'),auth[_0x7d1c('0xa')](),controller[_0x7d1c('0xf')]);router[_0x7d1c('0x10')]('/:id',auth[_0x7d1c('0xa')](),controller[_0x7d1c('0x11')]);module[_0x7d1c('0x12')]=router;
\ No newline at end of file
+var _0x1200=['post','put','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x2c32de,_0x138844){var _0x1ad47e=function(_0xdcc172){while(--_0xdcc172){_0x2c32de['push'](_0x2c32de['shift']());}};_0x1ad47e(++_0x138844);}(_0x1200,0xca));var _0x0120=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x1200[_0xfa634c];return _0x73e478;};'use strict';var multer=require(_0x0120('0x0'));var util=require(_0x0120('0x1'));var path=require('path');var timeout=require(_0x0120('0x2'));var express=require(_0x0120('0x3'));var router=express[_0x0120('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0120('0x5'));var interaction=require(_0x0120('0x6'));var config=require('../../config/environment');var controller=require(_0x0120('0x7'));router[_0x0120('0x8')]('/',auth[_0x0120('0x9')](),controller[_0x0120('0xa')]);router[_0x0120('0x8')](_0x0120('0xb'),auth[_0x0120('0x9')](),controller['describe']);router[_0x0120('0x8')](_0x0120('0xc'),auth[_0x0120('0x9')](),controller[_0x0120('0xd')]);router[_0x0120('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0120('0xf')](_0x0120('0xc'),auth[_0x0120('0x9')](),controller['update']);router[_0x0120('0x10')]('/:id',auth[_0x0120('0x9')](),controller[_0x0120('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 3e80200..af1db97 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 _0x2242=['ENUM','mouseOver','timeout','STRING','INTEGER','sequelize','exports'];(function(_0x10d0c8,_0x5b0bf5){var _0x1f59f8=function(_0x1a811a){while(--_0x1a811a){_0x10d0c8['push'](_0x10d0c8['shift']());}};_0x1f59f8(++_0x5b0bf5);}(_0x2242,0x8a));var _0x2224=function(_0x5d8e32,_0x26bb8f){_0x5d8e32=_0x5d8e32-0x0;var _0x4cf34b=_0x2242[_0x5d8e32];return _0x4cf34b;};'use strict';var Sequelize=require(_0x2224('0x0'));module[_0x2224('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2224('0x2')](_0x2224('0x3'),_0x2224('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x2224('0x5')]},'timeout':{'type':Sequelize[_0x2224('0x6')]}};
\ No newline at end of file
+var _0x9d66=['mouseOver','sequelize','exports','STRING','ENUM','timeout'];(function(_0x2a651a,_0x306757){var _0x14234f=function(_0x392b5f){while(--_0x392b5f){_0x2a651a['push'](_0x2a651a['shift']());}};_0x14234f(++_0x306757);}(_0x9d66,0xf1));var _0x69d6=function(_0x5a9683,_0x4c09dd){_0x5a9683=_0x5a9683-0x0;var _0x18db7d=_0x9d66[_0x5a9683];return _0x18db7d;};'use strict';var Sequelize=require(_0x69d6('0x0'));module[_0x69d6('0x1')]={'name':{'type':Sequelize[_0x69d6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x69d6('0x3')]('mouseOver',_0x69d6('0x4')),'defaultValue':_0x69d6('0x5')},'selector':{'type':Sequelize[_0x69d6('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 9be043a..bdac9ec 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 _0x302c=['query','intersection','fields','attributes','length','includeAll','include','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','apply','reject','then','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0x302c,0x15c));var _0xc302=function(_0x347cc3,_0x1f05cd){_0x347cc3=_0x347cc3-0x0;var _0x1df0f8=_0x302c[_0x347cc3];return _0x1df0f8;};'use strict';var emlformat=require(_0xc302('0x0'));var rimraf=require(_0xc302('0x1'));var zipdir=require(_0xc302('0x2'));var jsonpatch=require(_0xc302('0x3'));var rp=require(_0xc302('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc302('0x5'));var util=require(_0xc302('0x6'));var path=require(_0xc302('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc302('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc302('0x9'));var squel=require(_0xc302('0xa'));var crypto=require(_0xc302('0xb'));var jsforce=require(_0xc302('0xc'));var deskjs=require(_0xc302('0xd'));var toCsv=require(_0xc302('0xe'));var querystring=require('querystring');var Papa=require(_0xc302('0xf'));var Redis=require(_0xc302('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc302('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xc302('0x12'));var config=require(_0xc302('0x13'));var licenseUtil=require(_0xc302('0x14'));var db=require(_0xc302('0x15'))['db'];function respondWithStatusCode(_0x3cf0f5,_0x25f167){_0x25f167=_0x25f167||0xcc;return function(_0xd3236b){if(_0xd3236b){return _0x3cf0f5[_0xc302('0x16')](_0x25f167);}return _0x3cf0f5[_0xc302('0x17')](_0x25f167)[_0xc302('0x18')]();};}function respondWithResult(_0x5bea5f,_0x4092d6){_0x4092d6=_0x4092d6||0xc8;return function(_0x2f9a3a){if(_0x2f9a3a){return _0x5bea5f['status'](_0x4092d6)[_0xc302('0x19')](_0x2f9a3a);}};}function respondWithFilteredResult(_0x3184d3,_0x271e83){return function(_0x29ce77){if(_0x29ce77){var _0x381759=typeof _0x271e83['offset']===_0xc302('0x1a')&&typeof _0x271e83['limit']===_0xc302('0x1a');var _0x337d22=_0x29ce77['count'];var _0x17093a=_0x381759?0x0:_0x271e83[_0xc302('0x1b')];var _0x34260a=_0x381759?_0x29ce77[_0xc302('0x1c')]:_0x271e83[_0xc302('0x1b')]+_0x271e83[_0xc302('0x1d')];var _0x5eb0e4;if(_0x34260a>=_0x337d22){_0x34260a=_0x337d22;_0x5eb0e4=0xc8;}else{_0x5eb0e4=0xce;}_0x3184d3[_0xc302('0x17')](_0x5eb0e4);return _0x3184d3[_0xc302('0x1e')]('Content-Range',_0x17093a+'-'+_0x34260a+'/'+_0x337d22)[_0xc302('0x19')](_0x29ce77);}return null;};}function patchUpdates(_0x291528){return function(_0x51537c){try{jsonpatch[_0xc302('0x1f')](_0x51537c,_0x291528,!![]);}catch(_0x34c28b){return BPromise[_0xc302('0x20')](_0x34c28b);}return _0x51537c['save']();};}function saveUpdates(_0x3e19fe,_0x3f7a84){return function(_0x27ff4a){if(_0x27ff4a){return _0x27ff4a['update'](_0x3e19fe)[_0xc302('0x21')](function(_0x5c2909){return _0x5c2909;});}return null;};}function removeEntity(_0x1cbe6c,_0x54e224){return function(_0x4a6b73){if(_0x4a6b73){return _0x4a6b73['destroy']()['then'](function(){_0x1cbe6c[_0xc302('0x17')](0xcc)[_0xc302('0x18')]();});}};}function handleEntityNotFound(_0x13b524,_0x5cdcbc){return function(_0x424788){if(!_0x424788){_0x13b524['sendStatus'](0x194);}return _0x424788;};}function handleError(_0x58f09f,_0x52eee2){_0x52eee2=_0x52eee2||0x1f4;return function(_0x5d2efc){logger[_0xc302('0x22')](_0x5d2efc[_0xc302('0x23')]);if(_0x5d2efc[_0xc302('0x24')]){delete _0x5d2efc[_0xc302('0x24')];}_0x58f09f[_0xc302('0x17')](_0x52eee2)[_0xc302('0x25')](_0x5d2efc);};}exports[_0xc302('0x26')]=function(_0x4109bb,_0x121398){var _0xc05f4f={'raw':!![],'where':{'id':_0x4109bb[_0xc302('0x27')]['id']}},_0x3a0dc0={};_0x3a0dc0[_0xc302('0x28')]=_[_0xc302('0x29')](db[_0xc302('0x2a')][_0xc302('0x2b')]);_0x3a0dc0[_0xc302('0x2c')]=_[_0xc302('0x29')](_0x4109bb[_0xc302('0x2c')]);_0x3a0dc0['filters']=_[_0xc302('0x2d')](_0x3a0dc0[_0xc302('0x28')],_0x3a0dc0['query']);_0xc05f4f['attributes']=_[_0xc302('0x2d')](_0x3a0dc0['model'],qs[_0xc302('0x2e')](_0x4109bb[_0xc302('0x2c')]['fields']));_0xc05f4f[_0xc302('0x2f')]=_0xc05f4f['attributes'][_0xc302('0x30')]?_0xc05f4f['attributes']:_0x3a0dc0['model'];if(_0x4109bb[_0xc302('0x2c')][_0xc302('0x31')]){_0xc05f4f[_0xc302('0x32')]=[{'all':!![]}];}_0xc05f4f=_[_0xc302('0x33')]({},_0xc05f4f,_0x4109bb['options']);return db[_0xc302('0x2a')][_0xc302('0x34')](_0xc05f4f)[_0xc302('0x21')](handleEntityNotFound(_0x121398,null))[_0xc302('0x21')](respondWithResult(_0x121398,null))[_0xc302('0x35')](handleError(_0x121398,null));};exports[_0xc302('0x36')]=function(_0x5faceb,_0x3a4ed9){return db[_0xc302('0x2a')][_0xc302('0x36')](_0x5faceb[_0xc302('0x37')],{})[_0xc302('0x21')](respondWithResult(_0x3a4ed9,0xc9))[_0xc302('0x35')](handleError(_0x3a4ed9,null));};exports['update']=function(_0x3914d8,_0x586c85){if(_0x3914d8[_0xc302('0x37')]['id']){delete _0x3914d8[_0xc302('0x37')]['id'];}return db['ChatProactiveAction'][_0xc302('0x34')]({'where':{'id':_0x3914d8[_0xc302('0x27')]['id']}})[_0xc302('0x21')](handleEntityNotFound(_0x586c85,null))[_0xc302('0x21')](saveUpdates(_0x3914d8[_0xc302('0x37')],null))[_0xc302('0x21')](respondWithResult(_0x586c85,null))[_0xc302('0x35')](handleError(_0x586c85,null));};exports['destroy']=function(_0x345396,_0x39fd7b){return db['ChatProactiveAction'][_0xc302('0x34')]({'where':{'id':_0x345396['params']['id']}})['then'](handleEntityNotFound(_0x39fd7b,null))[_0xc302('0x21')](removeEntity(_0x39fd7b,null))['catch'](handleError(_0x39fd7b,null));};
\ No newline at end of file
+var _0x8832=['catch','create','body','params','destroy','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','error','stack','name','show','model','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','then'];(function(_0x4554a1,_0x5bacc4){var _0x38befc=function(_0xc82aad){while(--_0xc82aad){_0x4554a1['push'](_0x4554a1['shift']());}};_0x38befc(++_0x5bacc4);}(_0x8832,0x1f4));var _0x2883=function(_0x23e601,_0x430574){_0x23e601=_0x23e601-0x0;var _0x258be5=_0x8832[_0x23e601];return _0x258be5;};'use strict';var emlformat=require(_0x2883('0x0'));var rimraf=require(_0x2883('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2883('0x2'));var moment=require(_0x2883('0x3'));var BPromise=require(_0x2883('0x4'));var Mustache=require('mustache');var util=require(_0x2883('0x5'));var path=require('path');var sox=require(_0x2883('0x6'));var csv=require(_0x2883('0x7'));var ejs=require(_0x2883('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2883('0x9'));var squel=require('squel');var crypto=require(_0x2883('0xa'));var jsforce=require(_0x2883('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2883('0xc'));var Papa=require(_0x2883('0xd'));var Redis=require(_0x2883('0xe'));var authService=require(_0x2883('0xf'));var qs=require(_0x2883('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2883('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2883('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x342233,_0x3e36e4){_0x3e36e4=_0x3e36e4||0xcc;return function(_0x1e4f8f){if(_0x1e4f8f){return _0x342233[_0x2883('0x13')](_0x3e36e4);}return _0x342233[_0x2883('0x14')](_0x3e36e4)[_0x2883('0x15')]();};}function respondWithResult(_0x4a32d7,_0x4a3a24){_0x4a3a24=_0x4a3a24||0xc8;return function(_0x85a4a5){if(_0x85a4a5){return _0x4a32d7[_0x2883('0x14')](_0x4a3a24)['json'](_0x85a4a5);}};}function respondWithFilteredResult(_0x42a879,_0x41062b){return function(_0x2a7291){if(_0x2a7291){var _0x186a67=typeof _0x41062b[_0x2883('0x16')]===_0x2883('0x17')&&typeof _0x41062b[_0x2883('0x18')]===_0x2883('0x17');var _0x5c9d49=_0x2a7291[_0x2883('0x19')];var _0x3eff46=_0x186a67?0x0:_0x41062b[_0x2883('0x16')];var _0x1dec8a=_0x186a67?_0x2a7291[_0x2883('0x19')]:_0x41062b[_0x2883('0x16')]+_0x41062b[_0x2883('0x18')];var _0x39f20f;if(_0x1dec8a>=_0x5c9d49){_0x1dec8a=_0x5c9d49;_0x39f20f=0xc8;}else{_0x39f20f=0xce;}_0x42a879[_0x2883('0x14')](_0x39f20f);return _0x42a879['set'](_0x2883('0x1a'),_0x3eff46+'-'+_0x1dec8a+'/'+_0x5c9d49)[_0x2883('0x1b')](_0x2a7291);}return null;};}function patchUpdates(_0x350e75){return function(_0x56fa7f){try{jsonpatch[_0x2883('0x1c')](_0x56fa7f,_0x350e75,!![]);}catch(_0x5b2ed0){return BPromise[_0x2883('0x1d')](_0x5b2ed0);}return _0x56fa7f[_0x2883('0x1e')]();};}function saveUpdates(_0x1f083a,_0x5b758a){return function(_0x2a98e9){if(_0x2a98e9){return _0x2a98e9[_0x2883('0x1f')](_0x1f083a)['then'](function(_0x1d9f9c){return _0x1d9f9c;});}return null;};}function removeEntity(_0x4def16,_0x76717b){return function(_0x5556a1){if(_0x5556a1){return _0x5556a1['destroy']()['then'](function(){_0x4def16[_0x2883('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bf27b,_0x3f5fb1){return function(_0x48f046){if(!_0x48f046){_0x4bf27b[_0x2883('0x13')](0x194);}return _0x48f046;};}function handleError(_0x327e4e,_0x3f6268){_0x3f6268=_0x3f6268||0x1f4;return function(_0x15c130){logger[_0x2883('0x20')](_0x15c130[_0x2883('0x21')]);if(_0x15c130['name']){delete _0x15c130[_0x2883('0x22')];}_0x327e4e[_0x2883('0x14')](_0x3f6268)['send'](_0x15c130);};}exports[_0x2883('0x23')]=function(_0x1a2971,_0x2934d6){var _0x405c02={'raw':!![],'where':{'id':_0x1a2971['params']['id']}},_0x52ea29={};_0x52ea29[_0x2883('0x24')]=_['keys'](db[_0x2883('0x25')][_0x2883('0x26')]);_0x52ea29[_0x2883('0x27')]=_['keys'](_0x1a2971[_0x2883('0x27')]);_0x52ea29[_0x2883('0x28')]=_[_0x2883('0x29')](_0x52ea29['model'],_0x52ea29[_0x2883('0x27')]);_0x405c02[_0x2883('0x2a')]=_[_0x2883('0x29')](_0x52ea29['model'],qs[_0x2883('0x2b')](_0x1a2971['query'][_0x2883('0x2b')]));_0x405c02[_0x2883('0x2a')]=_0x405c02[_0x2883('0x2a')][_0x2883('0x2c')]?_0x405c02[_0x2883('0x2a')]:_0x52ea29['model'];if(_0x1a2971[_0x2883('0x27')][_0x2883('0x2d')]){_0x405c02[_0x2883('0x2e')]=[{'all':!![]}];}_0x405c02=_['merge']({},_0x405c02,_0x1a2971[_0x2883('0x2f')]);return db['ChatProactiveAction'][_0x2883('0x30')](_0x405c02)[_0x2883('0x31')](handleEntityNotFound(_0x2934d6,null))[_0x2883('0x31')](respondWithResult(_0x2934d6,null))[_0x2883('0x32')](handleError(_0x2934d6,null));};exports['create']=function(_0x777065,_0x2b4a3c){return db[_0x2883('0x25')][_0x2883('0x33')](_0x777065[_0x2883('0x34')],{})['then'](respondWithResult(_0x2b4a3c,0xc9))[_0x2883('0x32')](handleError(_0x2b4a3c,null));};exports[_0x2883('0x1f')]=function(_0x2c2639,_0xc3a384){if(_0x2c2639[_0x2883('0x34')]['id']){delete _0x2c2639[_0x2883('0x34')]['id'];}return db[_0x2883('0x25')]['find']({'where':{'id':_0x2c2639[_0x2883('0x35')]['id']}})[_0x2883('0x31')](handleEntityNotFound(_0xc3a384,null))[_0x2883('0x31')](saveUpdates(_0x2c2639['body'],null))[_0x2883('0x31')](respondWithResult(_0xc3a384,null))[_0x2883('0x32')](handleError(_0xc3a384,null));};exports[_0x2883('0x36')]=function(_0x3a5881,_0x215b0e){return db[_0x2883('0x25')][_0x2883('0x30')]({'where':{'id':_0x3a5881[_0x2883('0x35')]['id']}})['then'](handleEntityNotFound(_0x215b0e,null))['then'](removeEntity(_0x215b0e,null))[_0x2883('0x32')](handleError(_0x215b0e,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index c9935cc..436d378 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 _0x479e=['define','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./chatProactiveAction.attributes','exports'];(function(_0x343083,_0x12a263){var _0x33daf1=function(_0x28a767){while(--_0x28a767){_0x343083['push'](_0x343083['shift']());}};_0x33daf1(++_0x12a263);}(_0x479e,0x6f));var _0xe479=function(_0x458146,_0x49c906){_0x458146=_0x458146-0x0;var _0x7ff827=_0x479e[_0x458146];return _0x7ff827;};'use strict';var _=require(_0xe479('0x0'));var util=require(_0xe479('0x1'));var logger=require(_0xe479('0x2'))(_0xe479('0x3'));var moment=require(_0xe479('0x4'));var BPromise=require(_0xe479('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe479('0x6'));var config=require('../../config/environment');var attributes=require(_0xe479('0x7'));module[_0xe479('0x8')]=function(_0x4e62d4,_0x519f7d){return _0x4e62d4[_0xe479('0x9')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d3b=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','define','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x1a8631,_0x4e5f40){var _0x4a0535=function(_0x5605c7){while(--_0x5605c7){_0x1a8631['push'](_0x1a8631['shift']());}};_0x4a0535(++_0x4e5f40);}(_0x7d3b,0x127));var _0xb7d3=function(_0x5cd026,_0x5b9aca){_0x5cd026=_0x5cd026-0x0;var _0x570f4f=_0x7d3b[_0x5cd026];return _0x570f4f;};'use strict';var _=require(_0xb7d3('0x0'));var util=require(_0xb7d3('0x1'));var logger=require(_0xb7d3('0x2'))(_0xb7d3('0x3'));var moment=require(_0xb7d3('0x4'));var BPromise=require(_0xb7d3('0x5'));var rp=require(_0xb7d3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb7d3('0x7'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x38dcf2,_0x3420dc){return _0x38dcf2[_0xb7d3('0x8')](_0xb7d3('0x9'),attributes,{'tableName':_0xb7d3('0xa'),'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 d534283..724c0ca 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 _0xfb31=['bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xfb31,0x75));var _0x1fb3=function(_0x59c505,_0x55ce83){_0x59c505=_0x59c505-0x0;var _0x241acc=_0xfb31[_0x59c505];return _0x241acc;};'use strict';var _=require(_0x1fb3('0x0'));var util=require(_0x1fb3('0x1'));var moment=require(_0x1fb3('0x2'));var BPromise=require(_0x1fb3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fb3('0x4'));var db=require(_0x1fb3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1fb3('0x6'));var config=require(_0x1fb3('0x7'));var jayson=require(_0x1fb3('0x8'));var client=jayson[_0x1fb3('0x9')][_0x1fb3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f610d,_0x40c3a5,_0x2e61a7){return new BPromise(function(_0x6aaa34,_0x2a3162){return client[_0x1fb3('0xb')](_0x3f610d,_0x2e61a7)[_0x1fb3('0xc')](function(_0x406563){logger[_0x1fb3('0xd')](_0x1fb3('0xe'),_0x40c3a5,_0x1fb3('0xf'));logger[_0x1fb3('0x10')](_0x1fb3('0x11'),_0x40c3a5,_0x1fb3('0xf'),JSON[_0x1fb3('0x12')](_0x406563));if(_0x406563[_0x1fb3('0x13')]){if(_0x406563['error'][_0x1fb3('0x14')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x40c3a5,_0x406563['error'][_0x1fb3('0x15')]);return _0x2a3162(_0x406563['error']['message']);}logger[_0x1fb3('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x40c3a5,_0x406563[_0x1fb3('0x13')][_0x1fb3('0x15')]);return _0x6aaa34(_0x406563['error'][_0x1fb3('0x15')]);}else{logger[_0x1fb3('0xd')](_0x1fb3('0xe'),_0x40c3a5,_0x1fb3('0xf'));_0x6aaa34(_0x406563[_0x1fb3('0x16')]['message']);}})[_0x1fb3('0x17')](function(_0x24af28){logger[_0x1fb3('0x13')](_0x1fb3('0xe'),_0x40c3a5,_0x24af28);_0x2a3162(_0x24af28);});});}
\ No newline at end of file
+var _0x394d=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','message','ChatProactiveAction,\x20%s,\x20%s','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0xf162f7,_0x5b3dd9){var _0x222778=function(_0x425f55){while(--_0x425f55){_0xf162f7['push'](_0xf162f7['shift']());}};_0x222778(++_0x5b3dd9);}(_0x394d,0xa5));var _0xd394=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x394d[_0x26462c];return _0x509a42;};'use strict';var _=require(_0xd394('0x0'));var util=require(_0xd394('0x1'));var moment=require(_0xd394('0x2'));var BPromise=require('bluebird');var rs=require(_0xd394('0x3'));var fs=require('fs');var Redis=require(_0xd394('0x4'));var db=require(_0xd394('0x5'))['db'];var utils=require(_0xd394('0x6'));var logger=require('../../config/logger')(_0xd394('0x7'));var config=require(_0xd394('0x8'));var jayson=require(_0xd394('0x9'));var client=jayson[_0xd394('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1504aa,_0x5a1ca9,_0x4de358){return new BPromise(function(_0x371449,_0x60fea){return client[_0xd394('0xb')](_0x1504aa,_0x4de358)[_0xd394('0xc')](function(_0x646ab0){logger[_0xd394('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x5a1ca9,_0xd394('0xe'));logger['debug'](_0xd394('0xf'),_0x5a1ca9,_0xd394('0xe'),JSON['stringify'](_0x646ab0));if(_0x646ab0['error']){if(_0x646ab0[_0xd394('0x10')]['code']===0x1f4){logger[_0xd394('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x5a1ca9,_0x646ab0[_0xd394('0x10')][_0xd394('0x11')]);return _0x60fea(_0x646ab0[_0xd394('0x10')]['message']);}logger[_0xd394('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x5a1ca9,_0x646ab0[_0xd394('0x10')][_0xd394('0x11')]);return _0x371449(_0x646ab0[_0xd394('0x10')][_0xd394('0x11')]);}else{logger['info'](_0xd394('0x12'),_0x5a1ca9,_0xd394('0xe'));_0x371449(_0x646ab0[_0xd394('0x13')][_0xd394('0x11')]);}})['catch'](function(_0x1afc62){logger[_0xd394('0x10')](_0xd394('0x12'),_0x5a1ca9,_0x1afc62);_0x60fea(_0x1afc62);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 9d1ff2f..e88e325 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 _0x2d17=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0xbc913a,_0x459db2){var _0x83413b=function(_0x505717){while(--_0x505717){_0xbc913a['push'](_0xbc913a['shift']());}};_0x83413b(++_0x459db2);}(_0x2d17,0x17e));var _0x72d1=function(_0x32963c,_0x45d1c7){_0x32963c=_0x32963c-0x0;var _0x1b7b7e=_0x2d17[_0x32963c];return _0x1b7b7e;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var fs_extra=require(_0x72d1('0x4'));var auth=require(_0x72d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72d1('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x72d1('0x7')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0x9')]);router['post']('/',auth[_0x72d1('0x8')](),controller[_0x72d1('0xa')]);router[_0x72d1('0xb')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0xc')]);router[_0x72d1('0xd')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0xe')]);module[_0x72d1('0xf')]=router;
\ No newline at end of file
+var _0x24ca=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x415b7e,_0x26728a){var _0x896434=function(_0x30b94f){while(--_0x30b94f){_0x415b7e['push'](_0x415b7e['shift']());}};_0x896434(++_0x26728a);}(_0x24ca,0x1bc));var _0xa24c=function(_0x10f68e,_0xf198ea){_0x10f68e=_0x10f68e-0x0;var _0x4c8372=_0x24ca[_0x10f68e];return _0x4c8372;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var fs_extra=require(_0xa24c('0x4'));var auth=require(_0xa24c('0x5'));var interaction=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var controller=require(_0xa24c('0x8'));router[_0xa24c('0x9')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0xc')]);router[_0xa24c('0xd')]('/',auth[_0xa24c('0xb')](),controller['create']);router[_0xa24c('0xe')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller['update']);router[_0xa24c('0xf')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0x10')]);module[_0xa24c('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 4e26e2e..a8c0a92 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 _0xdcbf=['beepall','roundrobin','sequelize','exports','STRING','ENUM'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xdcbf,0x1ca));var _0xfdcb=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xdcbf[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0xfdcb('0x0'));module[_0xfdcb('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfdcb('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfdcb('0x3')]('rrmemory',_0xfdcb('0x4'),_0xfdcb('0x5'))}};
\ No newline at end of file
+var _0x8613=['sequelize','STRING','INTEGER','ENUM','rrmemory'];(function(_0x1393b3,_0xd9aab6){var _0x3e3dca=function(_0x4e8b93){while(--_0x4e8b93){_0x1393b3['push'](_0x1393b3['shift']());}};_0x3e3dca(++_0xd9aab6);}(_0x8613,0x1e0));var _0x3861=function(_0x1b3f91,_0x2d7894){_0x1b3f91=_0x1b3f91-0x0;var _0xcbf3a1=_0x8613[_0x1b3f91];return _0xcbf3a1;};'use strict';var Sequelize=require(_0x3861('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3861('0x1')]},'timeout':{'type':Sequelize[_0x3861('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3861('0x3')](_0x3861('0x4'),'beepall','roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index db61064..e4a7f47 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 _0x99ff=['model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','where','pick','filter','merge','options','include','rows','show','rawAttributes','includeAll','find','create','body','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserChatQueue','nolimit','order','sort','ChatQueueId','findAll','findAndCountAll','UserId','agent','chatPause','updatedAt','%s/%s','SIP','createdAt','getTeams','findOne','Team','addTeams','Agents','online','interface','flatMap','sequelize','findOrCreate','forEach','emit','removeTeams','User','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','addAgents','ids','omit','spread','userChatQueue:save','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','save','update','destroy','get','UserProfileResource','name','send','index','map','ChatQueue','fieldName','type','key'];(function(_0x5617d0,_0x4e7ed9){var _0x506610=function(_0x2a2795){while(--_0x2a2795){_0x5617d0['push'](_0x5617d0['shift']());}};_0x506610(++_0x4e7ed9);}(_0x99ff,0xf6));var _0xf99f=function(_0x12d6cc,_0x155c63){_0x12d6cc=_0x12d6cc-0x0;var _0x4af7d3=_0x99ff[_0x12d6cc];return _0x4af7d3;};'use strict';var emlformat=require(_0xf99f('0x0'));var rimraf=require(_0xf99f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf99f('0x2'));var rp=require('request-promise');var moment=require(_0xf99f('0x3'));var BPromise=require(_0xf99f('0x4'));var Mustache=require('mustache');var util=require(_0xf99f('0x5'));var path=require(_0xf99f('0x6'));var sox=require(_0xf99f('0x7'));var csv=require(_0xf99f('0x8'));var ejs=require(_0xf99f('0x9'));var fs=require('fs');var fs_extra=require(_0xf99f('0xa'));var _=require(_0xf99f('0xb'));var squel=require('squel');var crypto=require(_0xf99f('0xc'));var jsforce=require(_0xf99f('0xd'));var deskjs=require(_0xf99f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf99f('0xf'));var Papa=require(_0xf99f('0x10'));var Redis=require('ioredis');var authService=require(_0xf99f('0x11'));var qs=require(_0xf99f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf99f('0x13'))(_0xf99f('0x14'));var utils=require(_0xf99f('0x15'));var config=require(_0xf99f('0x16'));var licenseUtil=require(_0xf99f('0x17'));var db=require(_0xf99f('0x18'))['db'];config['redis']=_[_0xf99f('0x19')](config[_0xf99f('0x1a')],{'host':_0xf99f('0x1b'),'port':0x18eb});var socket=require(_0xf99f('0x1c'))(new Redis(config[_0xf99f('0x1a')]));require(_0xf99f('0x1d'))[_0xf99f('0x1e')](socket);var jayson=require(_0xf99f('0x1f'));var client=jayson[_0xf99f('0x20')][_0xf99f('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xba4a3f,_0x2a8e98,_0x409a12,_0x45e7ec){return new BPromise(function(_0x3a08bd,_0x4446b5){var _0x4ee553=_0x45e7ec||client;return _0x4ee553[_0xf99f('0x22')](_0xba4a3f,_0x409a12)[_0xf99f('0x23')](function(_0xdcc743){logger[_0xf99f('0x24')]('ChatQueue,\x20%s,\x20%s',_0x2a8e98,_0xf99f('0x25'));logger[_0xf99f('0x26')](_0xf99f('0x27'),_0x2a8e98,'request\x20sent',JSON['stringify'](_0xdcc743));if(_0xdcc743['error']){if(_0xdcc743[_0xf99f('0x28')]['code']===0x1f4){logger[_0xf99f('0x28')](_0xf99f('0x29'),_0x2a8e98,_0xdcc743[_0xf99f('0x28')][_0xf99f('0x2a')]);return _0x4446b5(_0xdcc743[_0xf99f('0x28')]['message']);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x2a8e98,_0xdcc743['error'][_0xf99f('0x2a')]);return _0x3a08bd(_0xdcc743[_0xf99f('0x28')]['message']);}else{logger['info'](_0xf99f('0x29'),_0x2a8e98,_0xf99f('0x25'));_0x3a08bd(_0xdcc743[_0xf99f('0x2b')]['message']);}})[_0xf99f('0x2c')](function(_0x601ed1){logger['error'](_0xf99f('0x29'),_0x2a8e98,_0x601ed1);_0x4446b5(_0x601ed1);});});}function respondWithStatusCode(_0x3b404b,_0x366867){_0x366867=_0x366867||0xcc;return function(_0x5338fc){if(_0x5338fc){return _0x3b404b[_0xf99f('0x2d')](_0x366867);}return _0x3b404b[_0xf99f('0x2e')](_0x366867)[_0xf99f('0x2f')]();};}function respondWithResult(_0xf503d6,_0x14351d){_0x14351d=_0x14351d||0xc8;return function(_0x8b4b76){if(_0x8b4b76){return _0xf503d6[_0xf99f('0x2e')](_0x14351d)['json'](_0x8b4b76);}};}function respondWithFilteredResult(_0x1b8071,_0x2dabfa){return function(_0x16cea8){if(_0x16cea8){var _0x1081b0=typeof _0x2dabfa[_0xf99f('0x30')]==='undefined'&&typeof _0x2dabfa[_0xf99f('0x31')]===_0xf99f('0x32');var _0x25f015=_0x16cea8['count'];var _0x4bd946=_0x1081b0?0x0:_0x2dabfa[_0xf99f('0x30')];var _0x418680=_0x1081b0?_0x16cea8[_0xf99f('0x33')]:_0x2dabfa[_0xf99f('0x30')]+_0x2dabfa[_0xf99f('0x31')];var _0x2bb747;if(_0x418680>=_0x25f015){_0x418680=_0x25f015;_0x2bb747=0xc8;}else{_0x2bb747=0xce;}_0x1b8071[_0xf99f('0x2e')](_0x2bb747);return _0x1b8071[_0xf99f('0x34')]('Content-Range',_0x4bd946+'-'+_0x418680+'/'+_0x25f015)[_0xf99f('0x35')](_0x16cea8);}return null;};}function patchUpdates(_0x48a065){return function(_0x5067ef){try{jsonpatch[_0xf99f('0x36')](_0x5067ef,_0x48a065,!![]);}catch(_0x197575){return BPromise['reject'](_0x197575);}return _0x5067ef[_0xf99f('0x37')]();};}function saveUpdates(_0x287279,_0x28f629){return function(_0x1f6610){if(_0x1f6610){return _0x1f6610[_0xf99f('0x38')](_0x287279)[_0xf99f('0x23')](function(_0x52fc3b){return _0x52fc3b;});}return null;};}function removeEntity(_0x42bbdb,_0x3d5602){return function(_0x525291){if(_0x525291){return _0x525291[_0xf99f('0x39')]()[_0xf99f('0x23')](function(){var _0x13cc65=_0x525291[_0xf99f('0x3a')]({'plain':!![]});var _0xd1583a='ChatQueues';return db[_0xf99f('0x3b')][_0xf99f('0x39')]({'where':{'type':_0xd1583a,'resourceId':_0x13cc65['id']}})[_0xf99f('0x23')](function(){return _0x525291;});})[_0xf99f('0x23')](function(){_0x42bbdb[_0xf99f('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x358fd2,_0x5db0a6){return function(_0x3e361e){if(!_0x3e361e){_0x358fd2['sendStatus'](0x194);}return _0x3e361e;};}function handleError(_0x3a266a,_0x32fdc2){_0x32fdc2=_0x32fdc2||0x1f4;return function(_0x56ec33){logger[_0xf99f('0x28')](_0x56ec33['stack']);if(_0x56ec33[_0xf99f('0x3c')]){delete _0x56ec33[_0xf99f('0x3c')];}_0x3a266a[_0xf99f('0x2e')](_0x32fdc2)[_0xf99f('0x3d')](_0x56ec33);};}exports[_0xf99f('0x3e')]=function(_0x232b4c,_0x448363){var _0x580dc9={},_0x5a952a={},_0x5c3e69={'count':0x0,'rows':[]};var _0x565d83=_[_0xf99f('0x3f')](db[_0xf99f('0x40')]['rawAttributes'],function(_0x7d4e10){return{'name':_0x7d4e10[_0xf99f('0x41')],'type':_0x7d4e10[_0xf99f('0x42')][_0xf99f('0x43')]};});_0x5a952a[_0xf99f('0x44')]=_[_0xf99f('0x3f')](_0x565d83,_0xf99f('0x3c'));_0x5a952a[_0xf99f('0x45')]=_[_0xf99f('0x46')](_0x232b4c[_0xf99f('0x45')]);_0x5a952a[_0xf99f('0x47')]=_['intersection'](_0x5a952a['model'],_0x5a952a[_0xf99f('0x45')]);_0x580dc9[_0xf99f('0x48')]=_[_0xf99f('0x49')](_0x5a952a['model'],qs[_0xf99f('0x4a')](_0x232b4c['query'][_0xf99f('0x4a')]));_0x580dc9[_0xf99f('0x48')]=_0x580dc9[_0xf99f('0x48')][_0xf99f('0x4b')]?_0x580dc9[_0xf99f('0x48')]:_0x5a952a[_0xf99f('0x44')];if(!_0x232b4c[_0xf99f('0x45')][_0xf99f('0x4c')]('nolimit')){_0x580dc9[_0xf99f('0x31')]=qs[_0xf99f('0x31')](_0x232b4c[_0xf99f('0x45')]['limit']);_0x580dc9['offset']=qs['offset'](_0x232b4c['query'][_0xf99f('0x30')]);}_0x580dc9['order']=qs['sort'](_0x232b4c[_0xf99f('0x45')]['sort']);_0x580dc9[_0xf99f('0x4d')]=qs['filters'](_[_0xf99f('0x4e')](_0x232b4c[_0xf99f('0x45')],_0x5a952a[_0xf99f('0x47')]),_0x565d83);if(_0x232b4c[_0xf99f('0x45')][_0xf99f('0x4f')]){_0x580dc9['where']=_['merge'](_0x580dc9[_0xf99f('0x4d')],{'$or':_[_0xf99f('0x3f')](_0x565d83,function(_0x2d3549){if(_0x2d3549[_0xf99f('0x42')]!=='VIRTUAL'){var _0x599f24={};_0x599f24[_0x2d3549[_0xf99f('0x3c')]]={'$like':'%'+_0x232b4c[_0xf99f('0x45')][_0xf99f('0x4f')]+'%'};return _0x599f24;}})});}_0x580dc9=_[_0xf99f('0x50')]({},_0x580dc9,_0x232b4c[_0xf99f('0x51')]);var _0x238d06={'where':_0x580dc9[_0xf99f('0x4d')]};return db[_0xf99f('0x40')][_0xf99f('0x33')](_0x238d06)[_0xf99f('0x23')](function(_0xc36daf){_0x5c3e69['count']=_0xc36daf;if(_0x232b4c[_0xf99f('0x45')]['includeAll']){_0x580dc9[_0xf99f('0x52')]=[{'all':!![]}];}return db[_0xf99f('0x40')]['findAll'](_0x580dc9);})[_0xf99f('0x23')](function(_0x310850){_0x5c3e69[_0xf99f('0x53')]=_0x310850;return _0x5c3e69;})['then'](respondWithFilteredResult(_0x448363,_0x580dc9))[_0xf99f('0x2c')](handleError(_0x448363,null));};exports[_0xf99f('0x54')]=function(_0x3a7fd0,_0x48be37){var _0x1ca25b={'raw':!![],'where':{'id':_0x3a7fd0['params']['id']}},_0x51aee5={};_0x51aee5[_0xf99f('0x44')]=_['keys'](db[_0xf99f('0x40')][_0xf99f('0x55')]);_0x51aee5[_0xf99f('0x45')]=_[_0xf99f('0x46')](_0x3a7fd0[_0xf99f('0x45')]);_0x51aee5[_0xf99f('0x47')]=_['intersection'](_0x51aee5[_0xf99f('0x44')],_0x51aee5[_0xf99f('0x45')]);_0x1ca25b[_0xf99f('0x48')]=_[_0xf99f('0x49')](_0x51aee5['model'],qs[_0xf99f('0x4a')](_0x3a7fd0[_0xf99f('0x45')]['fields']));_0x1ca25b[_0xf99f('0x48')]=_0x1ca25b[_0xf99f('0x48')]['length']?_0x1ca25b[_0xf99f('0x48')]:_0x51aee5[_0xf99f('0x44')];if(_0x3a7fd0[_0xf99f('0x45')][_0xf99f('0x56')]){_0x1ca25b[_0xf99f('0x52')]=[{'all':!![]}];}_0x1ca25b=_[_0xf99f('0x50')]({},_0x1ca25b,_0x3a7fd0[_0xf99f('0x51')]);return db[_0xf99f('0x40')][_0xf99f('0x57')](_0x1ca25b)[_0xf99f('0x23')](handleEntityNotFound(_0x48be37,null))['then'](respondWithResult(_0x48be37,null))['catch'](handleError(_0x48be37,null));};exports[_0xf99f('0x58')]=function(_0x13360a,_0x31e517){return db['ChatQueue']['create'](_0x13360a[_0xf99f('0x59')],{})[_0xf99f('0x23')](function(_0x218424){var _0x45e471=_0x13360a['user'][_0xf99f('0x3a')]({'plain':!![]});if(!_0x45e471)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45e471['role']===_0xf99f('0x5a')){var _0xc5cbcf=_0x218424[_0xf99f('0x3a')]({'plain':!![]});var _0x579ad4=_0xf99f('0x5b');return db[_0xf99f('0x5c')][_0xf99f('0x57')]({'where':{'name':_0x579ad4,'userProfileId':_0x45e471[_0xf99f('0x5d')]},'raw':!![]})[_0xf99f('0x23')](function(_0xf6d305){if(_0xf6d305&&_0xf6d305[_0xf99f('0x5e')]===0x0){return db['UserProfileResource'][_0xf99f('0x58')]({'name':_0xc5cbcf[_0xf99f('0x3c')],'resourceId':_0xc5cbcf['id'],'type':_0xf6d305[_0xf99f('0x3c')],'sectionId':_0xf6d305['id']},{})['then'](function(){return _0x218424;});}else{return _0x218424;}})[_0xf99f('0x2c')](function(_0x4321cd){logger['error'](_0xf99f('0x5f'),_0x4321cd);throw _0x4321cd;});}return _0x218424;})[_0xf99f('0x23')](respondWithResult(_0x31e517,0xc9))[_0xf99f('0x2c')](handleError(_0x31e517,null));};exports[_0xf99f('0x38')]=function(_0x3f668c,_0x3fb6c4){if(_0x3f668c[_0xf99f('0x59')]['id']){delete _0x3f668c[_0xf99f('0x59')]['id'];}return db[_0xf99f('0x40')]['find']({'where':{'id':_0x3f668c[_0xf99f('0x60')]['id']}})[_0xf99f('0x23')](handleEntityNotFound(_0x3fb6c4,null))['then'](saveUpdates(_0x3f668c[_0xf99f('0x59')],null))[_0xf99f('0x23')](respondWithResult(_0x3fb6c4,null))[_0xf99f('0x2c')](handleError(_0x3fb6c4,null));};exports['destroy']=function(_0x196f50,_0x2aad09){return db['ChatQueue'][_0xf99f('0x57')]({'where':{'id':_0x196f50[_0xf99f('0x60')]['id']}})[_0xf99f('0x23')](handleEntityNotFound(_0x2aad09,null))[_0xf99f('0x23')](removeEntity(_0x2aad09,null))[_0xf99f('0x2c')](handleError(_0x2aad09,null));};exports[_0xf99f('0x61')]=function(_0x4238aa,_0x6b0999){return db['ChatQueue'][_0xf99f('0x61')]()[_0xf99f('0x23')](respondWithResult(_0x6b0999,null))['catch'](handleError(_0x6b0999,null));};exports[_0xf99f('0x62')]=function(_0x4f9da8,_0xcd4a4d,_0x320ab6){var _0x5866c3={'raw':!![],'where':{}},_0x4be4d0={},_0x515dc1;return db[_0xf99f('0x40')]['findOne']({'where':{'id':_0x4f9da8[_0xf99f('0x60')]['id']}})[_0xf99f('0x23')](handleEntityNotFound(_0xcd4a4d,null))[_0xf99f('0x23')](function(_0x45f65b){if(_0x45f65b){_0x515dc1=_0x45f65b['get']({'plain':!![]});_0x4be4d0['model']=_['keys'](db[_0xf99f('0x63')][_0xf99f('0x55')]);_0x4be4d0['query']=_[_0xf99f('0x46')](_0x4f9da8[_0xf99f('0x45')]);_0x4be4d0[_0xf99f('0x47')]=_[_0xf99f('0x49')](_0x4be4d0[_0xf99f('0x44')],_0x4be4d0[_0xf99f('0x45')]);_0x5866c3[_0xf99f('0x48')]=_[_0xf99f('0x49')](_0x4be4d0[_0xf99f('0x44')],qs[_0xf99f('0x4a')](_0x4f9da8['query'][_0xf99f('0x4a')]));_0x5866c3[_0xf99f('0x48')]=_0x5866c3[_0xf99f('0x48')][_0xf99f('0x4b')]?_0x5866c3[_0xf99f('0x48')]:_0x4be4d0[_0xf99f('0x44')];if(!_0x4f9da8[_0xf99f('0x45')][_0xf99f('0x4c')](_0xf99f('0x64'))){_0x5866c3['limit']=qs[_0xf99f('0x31')](_0x4f9da8['query'][_0xf99f('0x31')]);_0x5866c3['offset']=qs[_0xf99f('0x30')](_0x4f9da8[_0xf99f('0x45')][_0xf99f('0x30')]);}_0x5866c3[_0xf99f('0x65')]=qs[_0xf99f('0x66')](_0x4f9da8[_0xf99f('0x45')][_0xf99f('0x66')]);_0x5866c3['where']=qs[_0xf99f('0x47')](_['pick'](_0x4f9da8['query'],_0x4be4d0[_0xf99f('0x47')]));_0x5866c3['where'][_0xf99f('0x67')]=_0x45f65b['id'];if(_0x4f9da8[_0xf99f('0x45')][_0xf99f('0x4f')]){_0x5866c3['where']=_[_0xf99f('0x50')](_0x5866c3['where'],{'$or':_['map'](_0x5866c3[_0xf99f('0x48')],function(_0x3472a1){var _0x415ff9={};_0x415ff9[_0x3472a1]={'$like':'%'+_0x4f9da8[_0xf99f('0x45')]['filter']+'%'};return _0x415ff9;})});}_0x5866c3=_[_0xf99f('0x50')]({},_0x5866c3,_0x4f9da8[_0xf99f('0x51')]);return db[_0xf99f('0x63')][_0xf99f('0x68')](_0x5866c3);}})[_0xf99f('0x23')](function(_0x1fa4b2){if(_0x1fa4b2){return db['User'][_0xf99f('0x69')]({'where':{'id':_[_0xf99f('0x3f')](_0x1fa4b2,_0xf99f('0x6a')),'role':_0xf99f('0x6b')},'attributes':['id',_0xf99f('0x3c'),_0xf99f('0x6c'),_0xf99f('0x6d'),'createdAt']});}})[_0xf99f('0x23')](function(_0x46a336){if(_0x46a336){return{'count':_0x46a336[_0xf99f('0x33')],'rows':_[_0xf99f('0x3f')](_0x46a336[_0xf99f('0x53')],function(_0x368a20){return{'membername':_0x368a20[_0xf99f('0x3c')],'UserId':_0x368a20['id'],'queue_name':_0x515dc1['name'],'ChatQueueId':_0x515dc1['id'],'interface':util['format'](_0xf99f('0x6e'),_0xf99f('0x6f'),_0x368a20[_0xf99f('0x3c')]),'penalty':0x0,'paused':_0x368a20[_0xf99f('0x6c')],'createdAt':_0x368a20[_0xf99f('0x70')],'updatedAt':_0x368a20['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xf99f('0x23')](respondWithFilteredResult(_0xcd4a4d,_0x5866c3))[_0xf99f('0x2c')](handleError(_0xcd4a4d,null));};exports[_0xf99f('0x71')]=function(_0x10cf98,_0x5011d1,_0x5321bd){var _0x237c5d={};var _0x390228={};var _0x4434cb;var _0x5a14ea;return db[_0xf99f('0x40')][_0xf99f('0x72')]({'where':{'id':_0x10cf98['params']['id']}})['then'](handleEntityNotFound(_0x5011d1,null))['then'](function(_0x511eb0){if(_0x511eb0){_0x4434cb=_0x511eb0;_0x390228[_0xf99f('0x44')]=_['keys'](db[_0xf99f('0x73')][_0xf99f('0x55')]);_0x390228[_0xf99f('0x45')]=_[_0xf99f('0x46')](_0x10cf98[_0xf99f('0x45')]);_0x390228[_0xf99f('0x47')]=_[_0xf99f('0x49')](_0x390228[_0xf99f('0x44')],_0x390228[_0xf99f('0x45')]);_0x237c5d[_0xf99f('0x48')]=_['intersection'](_0x390228['model'],qs[_0xf99f('0x4a')](_0x10cf98[_0xf99f('0x45')][_0xf99f('0x4a')]));_0x237c5d['attributes']=_0x237c5d[_0xf99f('0x48')][_0xf99f('0x4b')]?_0x237c5d[_0xf99f('0x48')]:_0x390228[_0xf99f('0x44')];_0x237c5d[_0xf99f('0x65')]=qs[_0xf99f('0x66')](_0x10cf98[_0xf99f('0x45')][_0xf99f('0x66')]);_0x237c5d['where']=qs['filters'](_[_0xf99f('0x4e')](_0x10cf98[_0xf99f('0x45')],_0x390228[_0xf99f('0x47')]));if(_0x10cf98[_0xf99f('0x45')]['filter']){_0x237c5d['where']=_[_0xf99f('0x50')](_0x237c5d['where'],{'$or':_[_0xf99f('0x3f')](_0x237c5d[_0xf99f('0x48')],function(_0x4d10f8){var _0x27353f={};_0x27353f[_0x4d10f8]={'$like':'%'+_0x10cf98[_0xf99f('0x45')][_0xf99f('0x4f')]+'%'};return _0x27353f;})});}_0x237c5d=_[_0xf99f('0x50')]({},_0x237c5d,_0x10cf98[_0xf99f('0x51')]);return _0x4434cb[_0xf99f('0x71')](_0x237c5d);}})[_0xf99f('0x23')](function(_0x2055a4){if(_0x2055a4){_0x5a14ea=_0x2055a4[_0xf99f('0x4b')];if(!_0x10cf98['query'][_0xf99f('0x4c')](_0xf99f('0x64'))){_0x237c5d[_0xf99f('0x31')]=qs[_0xf99f('0x31')](_0x10cf98[_0xf99f('0x45')][_0xf99f('0x31')]);_0x237c5d[_0xf99f('0x30')]=qs['offset'](_0x10cf98['query'][_0xf99f('0x30')]);}return _0x4434cb['getTeams'](_0x237c5d);}})[_0xf99f('0x23')](function(_0x49da9b){if(_0x49da9b){return _0x49da9b?{'count':_0x5a14ea,'rows':_0x49da9b}:null;}})[_0xf99f('0x23')](respondWithResult(_0x5011d1,null))[_0xf99f('0x2c')](handleError(_0x5011d1,null));};exports[_0xf99f('0x74')]=function(_0x1d4f7a,_0x213953,_0x49bea1){var _0x26a36d=_0x1d4f7a[_0xf99f('0x59')]['ids'];return db[_0xf99f('0x73')][_0xf99f('0x68')]({'where':{'id':_0x26a36d},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf99f('0x75'),'attributes':['id','name',_0xf99f('0x76'),'voicePause',_0xf99f('0x77')],'raw':!![]}]})[_0xf99f('0x23')](function(_0x4cf5a1){if(_0x4cf5a1){var _0x48ef19=_[_0xf99f('0x78')](_0x4cf5a1,function(_0x1195ee){var _0x3585ad=_0x1195ee['get']({'plain':!![]});return _0x3585ad['Agents'];});return db[_0xf99f('0x40')][_0xf99f('0x57')]({'where':{'id':_0x1d4f7a[_0xf99f('0x60')]['id']}})[_0xf99f('0x23')](function(_0x3ec6b1){return db[_0xf99f('0x79')]['transaction'](function(_0x13caf8){return _0x3ec6b1[_0xf99f('0x74')](_0x26a36d,{'transaction':_0x13caf8})[_0xf99f('0x23')](function(){return BPromise['each'](_0x48ef19,function(_0x5c9f1e){return db[_0xf99f('0x63')][_0xf99f('0x7a')]({'where':{'UserId':_0x5c9f1e['id'],'ChatQueueId':_0x1d4f7a['params']['id']},'transaction':_0x13caf8});});})[_0xf99f('0x23')](function(){_0x48ef19[_0xf99f('0x7b')](function(_0x46a62b){socket[_0xf99f('0x7c')]('userChatQueue:save',{'UserId':_0x46a62b['id'],'ChatQueueId':_0x3ec6b1['id']});});});});});}})['then'](respondWithStatusCode(_0x213953,null))[_0xf99f('0x2c')](handleError(_0x213953,null));};exports[_0xf99f('0x7d')]=function(_0x3da735,_0xe581e4,_0xedf0ba){return db[_0xf99f('0x73')]['findAll']({'where':{'id':_0x3da735[_0xf99f('0x45')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf99f('0x7e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf99f('0x23')](handleEntityNotFound(_0xe581e4,null))[_0xf99f('0x23')](function(_0x5146c8){var _0xd0766d=_[_0xf99f('0x3f')](_0x5146c8,'id');var _0xec2c88=[];var _0xf3e9cd=[];var _0x392450=squel[_0xf99f('0x7f')]();_0x392450[_0xf99f('0x80')](_0xf99f('0x81'))[_0xf99f('0x82')](_0xf99f('0x83'),'tq')[_0xf99f('0x84')](_0xf99f('0x85'),'ut',_0xf99f('0x86'))[_0xf99f('0x4d')](_0xf99f('0x87'),_0x3da735['params']['id']);for(var _0x126ca2=0x0;_0x126ca2<_0x5146c8[_0xf99f('0x4b')];_0x126ca2+=0x1){let _0x2ca933=_0x5146c8[_0x126ca2];for(var _0x164161=0x0;_0x164161<_0x2ca933['Agents'][_0xf99f('0x4b')];_0x164161+=0x1){let _0x4748f3=_0x2ca933[_0xf99f('0x75')][_0x164161];var _0x5808be=_0x392450['clone']();_0x5808be[_0xf99f('0x4d')]('ut.UserId\x20=\x20?',_0x4748f3['id']);_0xf3e9cd[_0xf99f('0x88')](db['sequelize'][_0xf99f('0x45')](_0x5808be[_0xf99f('0x89')](),{'type':db[_0xf99f('0x79')]['QueryTypes'][_0xf99f('0x8a')]})[_0xf99f('0x23')](function(_0x561c86){if(_0x561c86[_0xf99f('0x4b')]===0x1){return _0x4748f3['id'];}else{var _0xfa75c1=_[_0xf99f('0x8b')](_[_0xf99f('0x3f')](_0x561c86,_0xf99f('0x8c')),function(_0x2853c1){return _[_0xf99f('0x8d')](_0xd0766d,_0x2853c1);});if(_0xfa75c1){return _0x4748f3['id'];}}}));}}return BPromise[_0xf99f('0x8e')](_0xf3e9cd)[_0xf99f('0x23')](function(_0x5cc6f9){_0xec2c88=_(_0xec2c88)[_0xf99f('0x8f')](_0x5cc6f9)[_0xf99f('0x90')]()[_0xf99f('0x91')]();return db[_0xf99f('0x40')]['find']({'where':{'id':_0x3da735[_0xf99f('0x60')]['id']}})[_0xf99f('0x23')](function(_0x42d067){return db['sequelize'][_0xf99f('0x92')](function(_0x2ad3f3){return _0x42d067['removeTeams'](_0x3da735[_0xf99f('0x45')]['ids'],{'transaction':_0x2ad3f3})[_0xf99f('0x23')](function(){if(!_[_0xf99f('0x93')](_0xec2c88)){return _0x42d067[_0xf99f('0x94')](_0xec2c88,{'transaction':_0x2ad3f3});}})[_0xf99f('0x23')](function(){_0xec2c88[_0xf99f('0x7b')](function(_0x42a838){socket[_0xf99f('0x7c')]('userChatQueue:remove',{'UserId':_0x42a838,'ChatQueueId':_0x42d067['id']});});});});});});})[_0xf99f('0x23')](respondWithStatusCode(_0xe581e4,null))['catch'](handleError(_0xe581e4,null));};exports[_0xf99f('0x95')]=function(_0x4a1d79,_0x5e44fa,_0x143d35){return db[_0xf99f('0x40')][_0xf99f('0x57')]({'where':{'id':_0x4a1d79[_0xf99f('0x60')]['id']}})['then'](handleEntityNotFound(_0x5e44fa,null))[_0xf99f('0x23')](function(_0x5078ab){if(_0x5078ab){return _0x5078ab[_0xf99f('0x95')](_0x4a1d79['body'][_0xf99f('0x96')],_[_0xf99f('0x97')](_0x4a1d79['body'],[_0xf99f('0x96'),'id'])||{})[_0xf99f('0x98')](function(_0x2b2785){for(var _0x2c5394=0x0;_0x2c5394<_0x4a1d79['body'][_0xf99f('0x96')][_0xf99f('0x4b')];_0x2c5394+=0x1){socket[_0xf99f('0x7c')](_0xf99f('0x99'),{'UserId':Number(_0x4a1d79[_0xf99f('0x59')]['ids'][_0x2c5394]),'ChatQueueId':Number(_0x4a1d79[_0xf99f('0x60')]['id'])});}return _0x2b2785;});}})[_0xf99f('0x23')](respondWithResult(_0x5e44fa,null))[_0xf99f('0x2c')](handleError(_0x5e44fa,null));};exports[_0xf99f('0x94')]=function(_0xa02d70,_0x1a537,_0x1cc9d7){return db['ChatQueue'][_0xf99f('0x57')]({'where':{'id':_0xa02d70[_0xf99f('0x60')]['id']}})[_0xf99f('0x23')](handleEntityNotFound(_0x1a537,null))[_0xf99f('0x23')](function(_0x173b1d){if(_0x173b1d){return _0x173b1d[_0xf99f('0x94')](_0xa02d70[_0xf99f('0x45')]['ids'])[_0xf99f('0x23')](function(){if(_[_0xf99f('0x9a')](_0xa02d70[_0xf99f('0x45')]['ids'])){for(var _0x21bdf4=0x0;_0x21bdf4<_0xa02d70[_0xf99f('0x45')][_0xf99f('0x96')][_0xf99f('0x4b')];_0x21bdf4+=0x1){socket[_0xf99f('0x7c')](_0xf99f('0x9b'),{'UserId':Number(_0xa02d70[_0xf99f('0x45')]['ids'][_0x21bdf4]),'ChatQueueId':Number(_0xa02d70[_0xf99f('0x60')]['id'])});}}else{socket[_0xf99f('0x7c')]('userChatQueue:remove',{'UserId':Number(_0xa02d70[_0xf99f('0x45')][_0xf99f('0x96')]),'ChatQueueId':Number(_0xa02d70[_0xf99f('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x1a537,null))[_0xf99f('0x2c')](handleError(_0x1a537,null));};exports[_0xf99f('0x9c')]=function(_0x5d6c87,_0x2e7970,_0x5783e0){var _0x1b6861={};var _0x16e413={};var _0x56378d;var _0x3f5c19;return db[_0xf99f('0x40')]['findOne']({'where':{'id':_0x5d6c87['params']['id']}})[_0xf99f('0x23')](handleEntityNotFound(_0x2e7970,null))[_0xf99f('0x23')](function(_0x5b9d34){if(_0x5b9d34){_0x56378d=_0x5b9d34;_0x16e413[_0xf99f('0x44')]=_[_0xf99f('0x46')](db['User']['rawAttributes']);_0x16e413[_0xf99f('0x45')]=_[_0xf99f('0x46')](_0x5d6c87[_0xf99f('0x45')]);_0x16e413[_0xf99f('0x47')]=_[_0xf99f('0x49')](_0x16e413[_0xf99f('0x44')],_0x16e413[_0xf99f('0x45')]);_0x1b6861[_0xf99f('0x48')]=_[_0xf99f('0x49')](_0x16e413[_0xf99f('0x44')],qs['fields'](_0x5d6c87[_0xf99f('0x45')][_0xf99f('0x4a')]));_0x1b6861[_0xf99f('0x48')]=_0x1b6861[_0xf99f('0x48')][_0xf99f('0x4b')]?_0x1b6861[_0xf99f('0x48')]:_0x16e413[_0xf99f('0x44')];_0x1b6861[_0xf99f('0x65')]=qs[_0xf99f('0x66')](_0x5d6c87['query'][_0xf99f('0x66')]);_0x1b6861['where']=qs[_0xf99f('0x47')](_[_0xf99f('0x4e')](_0x5d6c87[_0xf99f('0x45')],_0x16e413['filters']));if(_0x5d6c87[_0xf99f('0x45')][_0xf99f('0x4f')]){_0x1b6861['where']=_[_0xf99f('0x50')](_0x1b6861['where'],{'$or':_[_0xf99f('0x3f')](_0x1b6861['attributes'],function(_0x2441eb){var _0x68a935={};_0x68a935[_0x2441eb]={'$like':'%'+_0x5d6c87[_0xf99f('0x45')]['filter']+'%'};return _0x68a935;})});}_0x1b6861=_[_0xf99f('0x50')]({},_0x1b6861,_0x5d6c87['options']);return _0x56378d[_0xf99f('0x9c')](_0x1b6861);}})['then'](function(_0x2def6f){if(_0x2def6f){_0x3f5c19=_0x2def6f[_0xf99f('0x4b')];if(!_0x5d6c87[_0xf99f('0x45')]['hasOwnProperty']('nolimit')){_0x1b6861[_0xf99f('0x31')]=qs['limit'](_0x5d6c87['query'][_0xf99f('0x31')]);_0x1b6861[_0xf99f('0x30')]=qs[_0xf99f('0x30')](_0x5d6c87[_0xf99f('0x45')][_0xf99f('0x30')]);}return _0x56378d[_0xf99f('0x9c')](_0x1b6861);}})[_0xf99f('0x23')](function(_0x578e90){if(_0x578e90){return _0x578e90?{'count':_0x3f5c19,'rows':_0x578e90}:null;}})[_0xf99f('0x23')](respondWithResult(_0x2e7970,null))[_0xf99f('0x2c')](handleError(_0x2e7970,null));};
\ No newline at end of file
+var _0xc5a1=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','status','end','offset','undefined','limit','count','Content-Range','json','reject','update','destroy','get','ChatQueues','UserProfileResource','sendStatus','name','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','ChatQueue','includeAll','include','findAll','rows','catch','show','params','find','create','body','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','hasOwnProperty','ChatQueueId','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','length','ids','Team','User','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x391e31,_0x1a551c){var _0xfeb791=function(_0x26fc67){while(--_0x26fc67){_0x391e31['push'](_0x391e31['shift']());}};_0xfeb791(++_0x1a551c);}(_0xc5a1,0x1c6));var _0x1c5a=function(_0xf62f27,_0x249f1d){_0xf62f27=_0xf62f27-0x0;var _0x4f7985=_0xc5a1[_0xf62f27];return _0x4f7985;};'use strict';var emlformat=require(_0x1c5a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1c5a('0x1'));var jsonpatch=require(_0x1c5a('0x2'));var rp=require('request-promise');var moment=require(_0x1c5a('0x3'));var BPromise=require(_0x1c5a('0x4'));var Mustache=require(_0x1c5a('0x5'));var util=require(_0x1c5a('0x6'));var path=require(_0x1c5a('0x7'));var sox=require(_0x1c5a('0x8'));var csv=require(_0x1c5a('0x9'));var ejs=require(_0x1c5a('0xa'));var fs=require('fs');var fs_extra=require(_0x1c5a('0xb'));var _=require(_0x1c5a('0xc'));var squel=require('squel');var crypto=require(_0x1c5a('0xd'));var jsforce=require(_0x1c5a('0xe'));var deskjs=require(_0x1c5a('0xf'));var toCsv=require(_0x1c5a('0x9'));var querystring=require(_0x1c5a('0x10'));var Papa=require('papaparse');var Redis=require(_0x1c5a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1c5a('0x12'));var as=require(_0x1c5a('0x13'));var hardwareService=require(_0x1c5a('0x14'));var logger=require('../../config/logger')(_0x1c5a('0x15'));var utils=require(_0x1c5a('0x16'));var config=require(_0x1c5a('0x17'));var licenseUtil=require(_0x1c5a('0x18'));var db=require('../../mysqldb')['db'];config[_0x1c5a('0x19')]=_[_0x1c5a('0x1a')](config[_0x1c5a('0x19')],{'host':_0x1c5a('0x1b'),'port':0x18eb});var socket=require(_0x1c5a('0x1c'))(new Redis(config['redis']));require(_0x1c5a('0x1d'))[_0x1c5a('0x1e')](socket);var jayson=require(_0x1c5a('0x1f'));var client=jayson[_0x1c5a('0x20')][_0x1c5a('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x51fed7,_0x395638,_0x47710e,_0x2a7da7){return new BPromise(function(_0x2680e1,_0x1a8b23){var _0x2c5157=_0x2a7da7||client;return _0x2c5157[_0x1c5a('0x22')](_0x51fed7,_0x47710e)[_0x1c5a('0x23')](function(_0x2732e1){logger[_0x1c5a('0x24')]('ChatQueue,\x20%s,\x20%s',_0x395638,_0x1c5a('0x25'));logger[_0x1c5a('0x26')](_0x1c5a('0x27'),_0x395638,_0x1c5a('0x25'),JSON[_0x1c5a('0x28')](_0x2732e1));if(_0x2732e1[_0x1c5a('0x29')]){if(_0x2732e1[_0x1c5a('0x29')][_0x1c5a('0x2a')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x395638,_0x2732e1[_0x1c5a('0x29')][_0x1c5a('0x2b')]);return _0x1a8b23(_0x2732e1[_0x1c5a('0x29')][_0x1c5a('0x2b')]);}logger[_0x1c5a('0x29')](_0x1c5a('0x2c'),_0x395638,_0x2732e1[_0x1c5a('0x29')]['message']);return _0x2680e1(_0x2732e1['error'][_0x1c5a('0x2b')]);}else{logger[_0x1c5a('0x24')]('ChatQueue,\x20%s,\x20%s',_0x395638,'request\x20sent');_0x2680e1(_0x2732e1[_0x1c5a('0x2d')]['message']);}})['catch'](function(_0x43ff34){logger[_0x1c5a('0x29')](_0x1c5a('0x2c'),_0x395638,_0x43ff34);_0x1a8b23(_0x43ff34);});});}function respondWithStatusCode(_0x26686b,_0x4db404){_0x4db404=_0x4db404||0xcc;return function(_0x186672){if(_0x186672){return _0x26686b['sendStatus'](_0x4db404);}return _0x26686b[_0x1c5a('0x2e')](_0x4db404)[_0x1c5a('0x2f')]();};}function respondWithResult(_0x3053d2,_0x2f5cd2){_0x2f5cd2=_0x2f5cd2||0xc8;return function(_0x937f53){if(_0x937f53){return _0x3053d2[_0x1c5a('0x2e')](_0x2f5cd2)['json'](_0x937f53);}};}function respondWithFilteredResult(_0x50950e,_0x5654a5){return function(_0x57c2ac){if(_0x57c2ac){var _0x3c08e5=typeof _0x5654a5[_0x1c5a('0x30')]===_0x1c5a('0x31')&&typeof _0x5654a5[_0x1c5a('0x32')]==='undefined';var _0x1f6e2a=_0x57c2ac[_0x1c5a('0x33')];var _0x270fd0=_0x3c08e5?0x0:_0x5654a5['offset'];var _0x2adfb2=_0x3c08e5?_0x57c2ac['count']:_0x5654a5['offset']+_0x5654a5[_0x1c5a('0x32')];var _0x4938cc;if(_0x2adfb2>=_0x1f6e2a){_0x2adfb2=_0x1f6e2a;_0x4938cc=0xc8;}else{_0x4938cc=0xce;}_0x50950e[_0x1c5a('0x2e')](_0x4938cc);return _0x50950e['set'](_0x1c5a('0x34'),_0x270fd0+'-'+_0x2adfb2+'/'+_0x1f6e2a)[_0x1c5a('0x35')](_0x57c2ac);}return null;};}function patchUpdates(_0x5af217){return function(_0x1d9cec){try{jsonpatch['apply'](_0x1d9cec,_0x5af217,!![]);}catch(_0x4bd149){return BPromise[_0x1c5a('0x36')](_0x4bd149);}return _0x1d9cec['save']();};}function saveUpdates(_0x4f1a4a,_0xf47951){return function(_0x911ebb){if(_0x911ebb){return _0x911ebb[_0x1c5a('0x37')](_0x4f1a4a)[_0x1c5a('0x23')](function(_0x53146f){return _0x53146f;});}return null;};}function removeEntity(_0x44a015,_0x25ab2f){return function(_0x449304){if(_0x449304){return _0x449304[_0x1c5a('0x38')]()[_0x1c5a('0x23')](function(){var _0x14020d=_0x449304[_0x1c5a('0x39')]({'plain':!![]});var _0x22868d=_0x1c5a('0x3a');return db[_0x1c5a('0x3b')][_0x1c5a('0x38')]({'where':{'type':_0x22868d,'resourceId':_0x14020d['id']}})[_0x1c5a('0x23')](function(){return _0x449304;});})[_0x1c5a('0x23')](function(){_0x44a015['status'](0xcc)[_0x1c5a('0x2f')]();});}};}function handleEntityNotFound(_0x395a40,_0x4cbd56){return function(_0x4bb2d0){if(!_0x4bb2d0){_0x395a40[_0x1c5a('0x3c')](0x194);}return _0x4bb2d0;};}function handleError(_0x2af4ce,_0x37b2c2){_0x37b2c2=_0x37b2c2||0x1f4;return function(_0x43b8b2){logger['error'](_0x43b8b2['stack']);if(_0x43b8b2[_0x1c5a('0x3d')]){delete _0x43b8b2['name'];}_0x2af4ce['status'](_0x37b2c2)['send'](_0x43b8b2);};}exports['index']=function(_0x3b55a5,_0x137091){var _0x3df99d={},_0x1e4dc0={},_0x120629={'count':0x0,'rows':[]};var _0x514279=_['map'](db['ChatQueue'][_0x1c5a('0x3e')],function(_0x1bd09c){return{'name':_0x1bd09c['fieldName'],'type':_0x1bd09c[_0x1c5a('0x3f')][_0x1c5a('0x40')]};});_0x1e4dc0[_0x1c5a('0x41')]=_[_0x1c5a('0x42')](_0x514279,'name');_0x1e4dc0[_0x1c5a('0x43')]=_[_0x1c5a('0x44')](_0x3b55a5[_0x1c5a('0x43')]);_0x1e4dc0[_0x1c5a('0x45')]=_[_0x1c5a('0x46')](_0x1e4dc0[_0x1c5a('0x41')],_0x1e4dc0['query']);_0x3df99d[_0x1c5a('0x47')]=_[_0x1c5a('0x46')](_0x1e4dc0[_0x1c5a('0x41')],qs['fields'](_0x3b55a5[_0x1c5a('0x43')][_0x1c5a('0x48')]));_0x3df99d[_0x1c5a('0x47')]=_0x3df99d[_0x1c5a('0x47')]['length']?_0x3df99d['attributes']:_0x1e4dc0[_0x1c5a('0x41')];if(!_0x3b55a5[_0x1c5a('0x43')]['hasOwnProperty'](_0x1c5a('0x49'))){_0x3df99d[_0x1c5a('0x32')]=qs[_0x1c5a('0x32')](_0x3b55a5[_0x1c5a('0x43')][_0x1c5a('0x32')]);_0x3df99d[_0x1c5a('0x30')]=qs[_0x1c5a('0x30')](_0x3b55a5[_0x1c5a('0x43')][_0x1c5a('0x30')]);}_0x3df99d[_0x1c5a('0x4a')]=qs[_0x1c5a('0x4b')](_0x3b55a5['query'][_0x1c5a('0x4b')]);_0x3df99d[_0x1c5a('0x4c')]=qs[_0x1c5a('0x45')](_[_0x1c5a('0x4d')](_0x3b55a5[_0x1c5a('0x43')],_0x1e4dc0[_0x1c5a('0x45')]),_0x514279);if(_0x3b55a5[_0x1c5a('0x43')][_0x1c5a('0x4e')]){_0x3df99d[_0x1c5a('0x4c')]=_['merge'](_0x3df99d['where'],{'$or':_[_0x1c5a('0x42')](_0x514279,function(_0x2142fc){if(_0x2142fc['type']!==_0x1c5a('0x4f')){var _0xe2f28b={};_0xe2f28b[_0x2142fc['name']]={'$like':'%'+_0x3b55a5[_0x1c5a('0x43')][_0x1c5a('0x4e')]+'%'};return _0xe2f28b;}})});}_0x3df99d=_[_0x1c5a('0x50')]({},_0x3df99d,_0x3b55a5[_0x1c5a('0x51')]);var _0x4ab583={'where':_0x3df99d[_0x1c5a('0x4c')]};return db[_0x1c5a('0x52')][_0x1c5a('0x33')](_0x4ab583)['then'](function(_0x3a2567){_0x120629[_0x1c5a('0x33')]=_0x3a2567;if(_0x3b55a5['query'][_0x1c5a('0x53')]){_0x3df99d[_0x1c5a('0x54')]=[{'all':!![]}];}return db['ChatQueue'][_0x1c5a('0x55')](_0x3df99d);})['then'](function(_0x3da43e){_0x120629[_0x1c5a('0x56')]=_0x3da43e;return _0x120629;})[_0x1c5a('0x23')](respondWithFilteredResult(_0x137091,_0x3df99d))[_0x1c5a('0x57')](handleError(_0x137091,null));};exports[_0x1c5a('0x58')]=function(_0x4d5c3e,_0x390f3b){var _0xac44f7={'raw':!![],'where':{'id':_0x4d5c3e[_0x1c5a('0x59')]['id']}},_0x20ae39={};_0x20ae39[_0x1c5a('0x41')]=_[_0x1c5a('0x44')](db[_0x1c5a('0x52')][_0x1c5a('0x3e')]);_0x20ae39[_0x1c5a('0x43')]=_[_0x1c5a('0x44')](_0x4d5c3e[_0x1c5a('0x43')]);_0x20ae39[_0x1c5a('0x45')]=_[_0x1c5a('0x46')](_0x20ae39[_0x1c5a('0x41')],_0x20ae39['query']);_0xac44f7[_0x1c5a('0x47')]=_[_0x1c5a('0x46')](_0x20ae39['model'],qs[_0x1c5a('0x48')](_0x4d5c3e['query'][_0x1c5a('0x48')]));_0xac44f7['attributes']=_0xac44f7['attributes']['length']?_0xac44f7['attributes']:_0x20ae39[_0x1c5a('0x41')];if(_0x4d5c3e['query'][_0x1c5a('0x53')]){_0xac44f7[_0x1c5a('0x54')]=[{'all':!![]}];}_0xac44f7=_[_0x1c5a('0x50')]({},_0xac44f7,_0x4d5c3e[_0x1c5a('0x51')]);return db[_0x1c5a('0x52')][_0x1c5a('0x5a')](_0xac44f7)[_0x1c5a('0x23')](handleEntityNotFound(_0x390f3b,null))[_0x1c5a('0x23')](respondWithResult(_0x390f3b,null))['catch'](handleError(_0x390f3b,null));};exports[_0x1c5a('0x5b')]=function(_0x3c66cb,_0x1b60fa){return db[_0x1c5a('0x52')][_0x1c5a('0x5b')](_0x3c66cb[_0x1c5a('0x5c')],{})['then'](function(_0x48c110){var _0xa3064a=_0x3c66cb['user'][_0x1c5a('0x39')]({'plain':!![]});if(!_0xa3064a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa3064a[_0x1c5a('0x5d')]===_0x1c5a('0x5e')){var _0x197b3a=_0x48c110['get']({'plain':!![]});var _0x439b42=_0x1c5a('0x3a');return db[_0x1c5a('0x5f')][_0x1c5a('0x5a')]({'where':{'name':_0x439b42,'userProfileId':_0xa3064a[_0x1c5a('0x60')]},'raw':!![]})[_0x1c5a('0x23')](function(_0x536b00){if(_0x536b00&&_0x536b00['autoAssociation']===0x0){return db[_0x1c5a('0x3b')][_0x1c5a('0x5b')]({'name':_0x197b3a[_0x1c5a('0x3d')],'resourceId':_0x197b3a['id'],'type':_0x536b00[_0x1c5a('0x3d')],'sectionId':_0x536b00['id']},{})[_0x1c5a('0x23')](function(){return _0x48c110;});}else{return _0x48c110;}})[_0x1c5a('0x57')](function(_0x10f1c3){logger[_0x1c5a('0x29')](_0x1c5a('0x61'),_0x10f1c3);throw _0x10f1c3;});}return _0x48c110;})[_0x1c5a('0x23')](respondWithResult(_0x1b60fa,0xc9))[_0x1c5a('0x57')](handleError(_0x1b60fa,null));};exports['update']=function(_0x2f1c92,_0x46fa90){if(_0x2f1c92[_0x1c5a('0x5c')]['id']){delete _0x2f1c92[_0x1c5a('0x5c')]['id'];}return db[_0x1c5a('0x52')]['find']({'where':{'id':_0x2f1c92[_0x1c5a('0x59')]['id']}})[_0x1c5a('0x23')](handleEntityNotFound(_0x46fa90,null))['then'](saveUpdates(_0x2f1c92[_0x1c5a('0x5c')],null))[_0x1c5a('0x23')](respondWithResult(_0x46fa90,null))[_0x1c5a('0x57')](handleError(_0x46fa90,null));};exports[_0x1c5a('0x38')]=function(_0x5f5094,_0x40f996){return db[_0x1c5a('0x52')][_0x1c5a('0x5a')]({'where':{'id':_0x5f5094[_0x1c5a('0x59')]['id']}})[_0x1c5a('0x23')](handleEntityNotFound(_0x40f996,null))[_0x1c5a('0x23')](removeEntity(_0x40f996,null))[_0x1c5a('0x57')](handleError(_0x40f996,null));};exports[_0x1c5a('0x62')]=function(_0x3f8513,_0x2bd4c2){return db['ChatQueue']['describe']()[_0x1c5a('0x23')](respondWithResult(_0x2bd4c2,null))[_0x1c5a('0x57')](handleError(_0x2bd4c2,null));};exports[_0x1c5a('0x63')]=function(_0x40d321,_0x3aabcc,_0x13df72){var _0x4476f5={'raw':!![],'where':{}},_0x1ace38={},_0x507b8c;return db[_0x1c5a('0x52')]['findOne']({'where':{'id':_0x40d321[_0x1c5a('0x59')]['id']}})['then'](handleEntityNotFound(_0x3aabcc,null))[_0x1c5a('0x23')](function(_0x2ebf35){if(_0x2ebf35){_0x507b8c=_0x2ebf35[_0x1c5a('0x39')]({'plain':!![]});_0x1ace38[_0x1c5a('0x41')]=_[_0x1c5a('0x44')](db[_0x1c5a('0x64')][_0x1c5a('0x3e')]);_0x1ace38[_0x1c5a('0x43')]=_['keys'](_0x40d321[_0x1c5a('0x43')]);_0x1ace38[_0x1c5a('0x45')]=_[_0x1c5a('0x46')](_0x1ace38['model'],_0x1ace38[_0x1c5a('0x43')]);_0x4476f5[_0x1c5a('0x47')]=_[_0x1c5a('0x46')](_0x1ace38['model'],qs['fields'](_0x40d321[_0x1c5a('0x43')]['fields']));_0x4476f5[_0x1c5a('0x47')]=_0x4476f5[_0x1c5a('0x47')]['length']?_0x4476f5['attributes']:_0x1ace38[_0x1c5a('0x41')];if(!_0x40d321['query'][_0x1c5a('0x65')]('nolimit')){_0x4476f5[_0x1c5a('0x32')]=qs[_0x1c5a('0x32')](_0x40d321[_0x1c5a('0x43')][_0x1c5a('0x32')]);_0x4476f5['offset']=qs['offset'](_0x40d321[_0x1c5a('0x43')][_0x1c5a('0x30')]);}_0x4476f5[_0x1c5a('0x4a')]=qs[_0x1c5a('0x4b')](_0x40d321[_0x1c5a('0x43')][_0x1c5a('0x4b')]);_0x4476f5[_0x1c5a('0x4c')]=qs[_0x1c5a('0x45')](_[_0x1c5a('0x4d')](_0x40d321[_0x1c5a('0x43')],_0x1ace38[_0x1c5a('0x45')]));_0x4476f5[_0x1c5a('0x4c')][_0x1c5a('0x66')]=_0x2ebf35['id'];if(_0x40d321[_0x1c5a('0x43')][_0x1c5a('0x4e')]){_0x4476f5[_0x1c5a('0x4c')]=_[_0x1c5a('0x50')](_0x4476f5[_0x1c5a('0x4c')],{'$or':_[_0x1c5a('0x42')](_0x4476f5[_0x1c5a('0x47')],function(_0x5123a4){var _0x5457e8={};_0x5457e8[_0x5123a4]={'$like':'%'+_0x40d321[_0x1c5a('0x43')][_0x1c5a('0x4e')]+'%'};return _0x5457e8;})});}_0x4476f5=_[_0x1c5a('0x50')]({},_0x4476f5,_0x40d321[_0x1c5a('0x51')]);return db['UserChatQueue'][_0x1c5a('0x55')](_0x4476f5);}})[_0x1c5a('0x23')](function(_0x4f360b){if(_0x4f360b){return db['User'][_0x1c5a('0x67')]({'where':{'id':_[_0x1c5a('0x42')](_0x4f360b,'UserId'),'role':_0x1c5a('0x68')},'attributes':['id',_0x1c5a('0x3d'),_0x1c5a('0x69'),_0x1c5a('0x6a'),_0x1c5a('0x6b')]});}})[_0x1c5a('0x23')](function(_0x5eb9bb){if(_0x5eb9bb){return{'count':_0x5eb9bb[_0x1c5a('0x33')],'rows':_[_0x1c5a('0x42')](_0x5eb9bb[_0x1c5a('0x56')],function(_0x222c20){return{'membername':_0x222c20[_0x1c5a('0x3d')],'UserId':_0x222c20['id'],'queue_name':_0x507b8c[_0x1c5a('0x3d')],'ChatQueueId':_0x507b8c['id'],'interface':util[_0x1c5a('0x6c')](_0x1c5a('0x6d'),_0x1c5a('0x6e'),_0x222c20[_0x1c5a('0x3d')]),'penalty':0x0,'paused':_0x222c20[_0x1c5a('0x69')],'createdAt':_0x222c20[_0x1c5a('0x6b')],'updatedAt':_0x222c20['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x1c5a('0x23')](respondWithFilteredResult(_0x3aabcc,_0x4476f5))[_0x1c5a('0x57')](handleError(_0x3aabcc,null));};exports[_0x1c5a('0x6f')]=function(_0x268bd2,_0xfe17c6,_0x16b8b7){var _0x2fc9b8={};var _0x3e7351={};var _0x1c3473;var _0x5c74a0;return db[_0x1c5a('0x52')][_0x1c5a('0x70')]({'where':{'id':_0x268bd2[_0x1c5a('0x59')]['id']}})['then'](handleEntityNotFound(_0xfe17c6,null))[_0x1c5a('0x23')](function(_0x3a592d){if(_0x3a592d){_0x1c3473=_0x3a592d;_0x3e7351['model']=_[_0x1c5a('0x44')](db['Team'][_0x1c5a('0x3e')]);_0x3e7351['query']=_['keys'](_0x268bd2[_0x1c5a('0x43')]);_0x3e7351[_0x1c5a('0x45')]=_[_0x1c5a('0x46')](_0x3e7351[_0x1c5a('0x41')],_0x3e7351[_0x1c5a('0x43')]);_0x2fc9b8[_0x1c5a('0x47')]=_[_0x1c5a('0x46')](_0x3e7351[_0x1c5a('0x41')],qs[_0x1c5a('0x48')](_0x268bd2[_0x1c5a('0x43')][_0x1c5a('0x48')]));_0x2fc9b8['attributes']=_0x2fc9b8[_0x1c5a('0x47')][_0x1c5a('0x71')]?_0x2fc9b8['attributes']:_0x3e7351[_0x1c5a('0x41')];_0x2fc9b8[_0x1c5a('0x4a')]=qs[_0x1c5a('0x4b')](_0x268bd2[_0x1c5a('0x43')][_0x1c5a('0x4b')]);_0x2fc9b8[_0x1c5a('0x4c')]=qs[_0x1c5a('0x45')](_[_0x1c5a('0x4d')](_0x268bd2['query'],_0x3e7351['filters']));if(_0x268bd2[_0x1c5a('0x43')]['filter']){_0x2fc9b8[_0x1c5a('0x4c')]=_[_0x1c5a('0x50')](_0x2fc9b8[_0x1c5a('0x4c')],{'$or':_[_0x1c5a('0x42')](_0x2fc9b8[_0x1c5a('0x47')],function(_0x49874f){var _0x3b685e={};_0x3b685e[_0x49874f]={'$like':'%'+_0x268bd2[_0x1c5a('0x43')]['filter']+'%'};return _0x3b685e;})});}_0x2fc9b8=_[_0x1c5a('0x50')]({},_0x2fc9b8,_0x268bd2['options']);return _0x1c3473['getTeams'](_0x2fc9b8);}})[_0x1c5a('0x23')](function(_0x59f6ca){if(_0x59f6ca){_0x5c74a0=_0x59f6ca['length'];if(!_0x268bd2['query'][_0x1c5a('0x65')](_0x1c5a('0x49'))){_0x2fc9b8[_0x1c5a('0x32')]=qs['limit'](_0x268bd2['query'][_0x1c5a('0x32')]);_0x2fc9b8[_0x1c5a('0x30')]=qs['offset'](_0x268bd2[_0x1c5a('0x43')]['offset']);}return _0x1c3473[_0x1c5a('0x6f')](_0x2fc9b8);}})['then'](function(_0x4925c5){if(_0x4925c5){return _0x4925c5?{'count':_0x5c74a0,'rows':_0x4925c5}:null;}})['then'](respondWithResult(_0xfe17c6,null))[_0x1c5a('0x57')](handleError(_0xfe17c6,null));};exports['addTeams']=function(_0x5c0821,_0x4e0b58,_0x569181){var _0x7f59f4=_0x5c0821['body'][_0x1c5a('0x72')];return db[_0x1c5a('0x73')][_0x1c5a('0x55')]({'where':{'id':_0x7f59f4},'attributes':['id'],'include':[{'model':db[_0x1c5a('0x74')],'as':_0x1c5a('0x75'),'attributes':['id',_0x1c5a('0x3d'),_0x1c5a('0x76'),_0x1c5a('0x77'),'interface'],'raw':!![]}]})[_0x1c5a('0x23')](function(_0x1c328c){if(_0x1c328c){var _0x22b04b=_[_0x1c5a('0x78')](_0x1c328c,function(_0x4557e2){var _0x9d00f9=_0x4557e2['get']({'plain':!![]});return _0x9d00f9[_0x1c5a('0x75')];});return db[_0x1c5a('0x52')]['find']({'where':{'id':_0x5c0821[_0x1c5a('0x59')]['id']}})[_0x1c5a('0x23')](function(_0x176351){return db[_0x1c5a('0x79')][_0x1c5a('0x7a')](function(_0x88c9c1){return _0x176351[_0x1c5a('0x7b')](_0x7f59f4,{'transaction':_0x88c9c1})[_0x1c5a('0x23')](function(){return BPromise[_0x1c5a('0x7c')](_0x22b04b,function(_0xa03520){return db['UserChatQueue'][_0x1c5a('0x7d')]({'where':{'UserId':_0xa03520['id'],'ChatQueueId':_0x5c0821[_0x1c5a('0x59')]['id']},'transaction':_0x88c9c1});});})[_0x1c5a('0x23')](function(){_0x22b04b[_0x1c5a('0x7e')](function(_0x5c2459){socket['emit'](_0x1c5a('0x7f'),{'UserId':_0x5c2459['id'],'ChatQueueId':_0x176351['id']});});});});});}})[_0x1c5a('0x23')](respondWithStatusCode(_0x4e0b58,null))['catch'](handleError(_0x4e0b58,null));};exports[_0x1c5a('0x80')]=function(_0x28b3ad,_0x38fa2d,_0x165c40){return db[_0x1c5a('0x73')][_0x1c5a('0x55')]({'where':{'id':_0x28b3ad['query'][_0x1c5a('0x72')]},'attributes':['id'],'include':[{'model':db[_0x1c5a('0x74')],'as':_0x1c5a('0x75'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x38fa2d,null))[_0x1c5a('0x23')](function(_0x29e2df){var _0x754caf=_[_0x1c5a('0x42')](_0x29e2df,'id');var _0x3aa5e9=[];var _0x132b75=[];var _0x196cb5=squel[_0x1c5a('0x81')]();_0x196cb5[_0x1c5a('0x82')](_0x1c5a('0x83'))['from'](_0x1c5a('0x84'),'tq')[_0x1c5a('0x85')](_0x1c5a('0x86'),'ut',_0x1c5a('0x87'))[_0x1c5a('0x4c')]('ChatQueueId\x20=\x20?',_0x28b3ad[_0x1c5a('0x59')]['id']);for(var _0x9e67e8=0x0;_0x9e67e8<_0x29e2df[_0x1c5a('0x71')];_0x9e67e8+=0x1){let _0x436300=_0x29e2df[_0x9e67e8];for(var _0x2b37b0=0x0;_0x2b37b0<_0x436300['Agents'][_0x1c5a('0x71')];_0x2b37b0+=0x1){let _0x59182d=_0x436300[_0x1c5a('0x75')][_0x2b37b0];var _0x4884d3=_0x196cb5['clone']();_0x4884d3[_0x1c5a('0x4c')]('ut.UserId\x20=\x20?',_0x59182d['id']);_0x132b75[_0x1c5a('0x88')](db[_0x1c5a('0x79')][_0x1c5a('0x43')](_0x4884d3[_0x1c5a('0x89')](),{'type':db['sequelize'][_0x1c5a('0x8a')][_0x1c5a('0x8b')]})['then'](function(_0x1f853f){if(_0x1f853f[_0x1c5a('0x71')]===0x1){return _0x59182d['id'];}else{var _0xbcfaba=_[_0x1c5a('0x8c')](_['map'](_0x1f853f,_0x1c5a('0x8d')),function(_0x3bb80b){return _['includes'](_0x754caf,_0x3bb80b);});if(_0xbcfaba){return _0x59182d['id'];}}}));}}return BPromise[_0x1c5a('0x8e')](_0x132b75)[_0x1c5a('0x23')](function(_0x3abf19){_0x3aa5e9=_(_0x3aa5e9)[_0x1c5a('0x8f')](_0x3abf19)[_0x1c5a('0x90')]()[_0x1c5a('0x91')]();return db[_0x1c5a('0x52')]['find']({'where':{'id':_0x28b3ad['params']['id']}})[_0x1c5a('0x23')](function(_0x1129bf){return db[_0x1c5a('0x79')][_0x1c5a('0x7a')](function(_0x1b9dcc){return _0x1129bf[_0x1c5a('0x80')](_0x28b3ad['query'][_0x1c5a('0x72')],{'transaction':_0x1b9dcc})['then'](function(){if(!_[_0x1c5a('0x92')](_0x3aa5e9)){return _0x1129bf[_0x1c5a('0x93')](_0x3aa5e9,{'transaction':_0x1b9dcc});}})['then'](function(){_0x3aa5e9[_0x1c5a('0x7e')](function(_0x527ff9){socket['emit'](_0x1c5a('0x94'),{'UserId':_0x527ff9,'ChatQueueId':_0x1129bf['id']});});});});});});})[_0x1c5a('0x23')](respondWithStatusCode(_0x38fa2d,null))[_0x1c5a('0x57')](handleError(_0x38fa2d,null));};exports['addAgents']=function(_0x54d81b,_0xca80be,_0x116d13){return db[_0x1c5a('0x52')][_0x1c5a('0x5a')]({'where':{'id':_0x54d81b[_0x1c5a('0x59')]['id']}})['then'](handleEntityNotFound(_0xca80be,null))[_0x1c5a('0x23')](function(_0x3644e9){if(_0x3644e9){return _0x3644e9[_0x1c5a('0x95')](_0x54d81b['body'][_0x1c5a('0x72')],_[_0x1c5a('0x96')](_0x54d81b['body'],['ids','id'])||{})[_0x1c5a('0x97')](function(_0x1e8ef5){for(var _0x3a4b34=0x0;_0x3a4b34<_0x54d81b['body'][_0x1c5a('0x72')][_0x1c5a('0x71')];_0x3a4b34+=0x1){socket[_0x1c5a('0x98')](_0x1c5a('0x7f'),{'UserId':Number(_0x54d81b['body'][_0x1c5a('0x72')][_0x3a4b34]),'ChatQueueId':Number(_0x54d81b[_0x1c5a('0x59')]['id'])});}return _0x1e8ef5;});}})[_0x1c5a('0x23')](respondWithResult(_0xca80be,null))[_0x1c5a('0x57')](handleError(_0xca80be,null));};exports[_0x1c5a('0x93')]=function(_0x2d77d7,_0x4cd905,_0x5eedef){return db['ChatQueue'][_0x1c5a('0x5a')]({'where':{'id':_0x2d77d7['params']['id']}})[_0x1c5a('0x23')](handleEntityNotFound(_0x4cd905,null))[_0x1c5a('0x23')](function(_0x38d285){if(_0x38d285){return _0x38d285[_0x1c5a('0x93')](_0x2d77d7['query'][_0x1c5a('0x72')])[_0x1c5a('0x23')](function(){if(_[_0x1c5a('0x99')](_0x2d77d7[_0x1c5a('0x43')][_0x1c5a('0x72')])){for(var _0x4101e0=0x0;_0x4101e0<_0x2d77d7[_0x1c5a('0x43')][_0x1c5a('0x72')][_0x1c5a('0x71')];_0x4101e0+=0x1){socket[_0x1c5a('0x98')](_0x1c5a('0x94'),{'UserId':Number(_0x2d77d7[_0x1c5a('0x43')]['ids'][_0x4101e0]),'ChatQueueId':Number(_0x2d77d7[_0x1c5a('0x59')]['id'])});}}else{socket[_0x1c5a('0x98')](_0x1c5a('0x94'),{'UserId':Number(_0x2d77d7[_0x1c5a('0x43')][_0x1c5a('0x72')]),'ChatQueueId':Number(_0x2d77d7[_0x1c5a('0x59')]['id'])});}});}})[_0x1c5a('0x23')](respondWithStatusCode(_0x4cd905,null))[_0x1c5a('0x57')](handleError(_0x4cd905,null));};exports['getAgents']=function(_0x203cfd,_0x561839,_0x2549cb){var _0x33fbe9={};var _0x784f64={};var _0x4f8cba;var _0x337bd2;return db['ChatQueue']['findOne']({'where':{'id':_0x203cfd[_0x1c5a('0x59')]['id']}})[_0x1c5a('0x23')](handleEntityNotFound(_0x561839,null))[_0x1c5a('0x23')](function(_0x4e3e92){if(_0x4e3e92){_0x4f8cba=_0x4e3e92;_0x784f64[_0x1c5a('0x41')]=_['keys'](db[_0x1c5a('0x74')][_0x1c5a('0x3e')]);_0x784f64['query']=_[_0x1c5a('0x44')](_0x203cfd[_0x1c5a('0x43')]);_0x784f64[_0x1c5a('0x45')]=_['intersection'](_0x784f64[_0x1c5a('0x41')],_0x784f64[_0x1c5a('0x43')]);_0x33fbe9[_0x1c5a('0x47')]=_[_0x1c5a('0x46')](_0x784f64[_0x1c5a('0x41')],qs[_0x1c5a('0x48')](_0x203cfd['query'][_0x1c5a('0x48')]));_0x33fbe9[_0x1c5a('0x47')]=_0x33fbe9[_0x1c5a('0x47')][_0x1c5a('0x71')]?_0x33fbe9[_0x1c5a('0x47')]:_0x784f64['model'];_0x33fbe9[_0x1c5a('0x4a')]=qs[_0x1c5a('0x4b')](_0x203cfd[_0x1c5a('0x43')][_0x1c5a('0x4b')]);_0x33fbe9[_0x1c5a('0x4c')]=qs[_0x1c5a('0x45')](_[_0x1c5a('0x4d')](_0x203cfd[_0x1c5a('0x43')],_0x784f64[_0x1c5a('0x45')]));if(_0x203cfd[_0x1c5a('0x43')][_0x1c5a('0x4e')]){_0x33fbe9[_0x1c5a('0x4c')]=_[_0x1c5a('0x50')](_0x33fbe9[_0x1c5a('0x4c')],{'$or':_[_0x1c5a('0x42')](_0x33fbe9[_0x1c5a('0x47')],function(_0x39df06){var _0x1f3b86={};_0x1f3b86[_0x39df06]={'$like':'%'+_0x203cfd[_0x1c5a('0x43')][_0x1c5a('0x4e')]+'%'};return _0x1f3b86;})});}_0x33fbe9=_['merge']({},_0x33fbe9,_0x203cfd['options']);return _0x4f8cba[_0x1c5a('0x9a')](_0x33fbe9);}})[_0x1c5a('0x23')](function(_0x2144d3){if(_0x2144d3){_0x337bd2=_0x2144d3[_0x1c5a('0x71')];if(!_0x203cfd[_0x1c5a('0x43')][_0x1c5a('0x65')]('nolimit')){_0x33fbe9[_0x1c5a('0x32')]=qs['limit'](_0x203cfd['query'][_0x1c5a('0x32')]);_0x33fbe9['offset']=qs[_0x1c5a('0x30')](_0x203cfd[_0x1c5a('0x43')][_0x1c5a('0x30')]);}return _0x4f8cba[_0x1c5a('0x9a')](_0x33fbe9);}})['then'](function(_0x2a4e0b){if(_0x2a4e0b){return _0x2a4e0b?{'count':_0x337bd2,'rows':_0x2a4e0b}:null;}})[_0x1c5a('0x23')](respondWithResult(_0x561839,null))['catch'](handleError(_0x561839,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index bc4ea85..cc3fb59 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 _0xe7fb=['../../mysqldb','ChatQueue','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x3f3b97,_0x395d93){var _0xb6ab0c=function(_0x330c5a){while(--_0x330c5a){_0x3f3b97['push'](_0x3f3b97['shift']());}};_0xb6ab0c(++_0x395d93);}(_0xe7fb,0xa1));var _0xbe7f=function(_0x47cc26,_0x211721){_0x47cc26=_0x47cc26-0x0;var _0x3c96d7=_0xe7fb[_0x47cc26];return _0x3c96d7;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xbe7f('0x0'))['db'][_0xbe7f('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbe7f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbe7f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x57d52b){return function(_0x4a0f06,_0x8f7177,_0x2a6a67){ChatQueueEvents['emit'](_0x57d52b+':'+_0x4a0f06['id'],_0x4a0f06);ChatQueueEvents[_0xbe7f('0x4')](_0x57d52b,_0x4a0f06);_0x2a6a67(null);};}for(var e in events){if(events[_0xbe7f('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xbe7f('0x6')]=ChatQueueEvents;
\ No newline at end of file
+var _0x8bb6=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x3d17c2,_0x437283){var _0x6117d=function(_0x3d3382){while(--_0x3d3382){_0x3d17c2['push'](_0x3d17c2['shift']());}};_0x6117d(++_0x437283);}(_0x8bb6,0x16b));var _0x68bb=function(_0x5a001d,_0x591f45){_0x5a001d=_0x5a001d-0x0;var _0x3d0a81=_0x8bb6[_0x5a001d];return _0x3d0a81;};'use strict';var EventEmitter=require(_0x68bb('0x0'));var ChatQueue=require(_0x68bb('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x68bb('0x2')](0x0);var events={'afterCreate':_0x68bb('0x3'),'afterUpdate':_0x68bb('0x4'),'afterDestroy':_0x68bb('0x5')};function emitEvent(_0xa4c45a){return function(_0x4406f5,_0xe77c6e,_0x11a556){ChatQueueEvents[_0x68bb('0x6')](_0xa4c45a+':'+_0x4406f5['id'],_0x4406f5);ChatQueueEvents[_0x68bb('0x6')](_0xa4c45a,_0x4406f5);_0x11a556(null);};}for(var e in events){if(events[_0x68bb('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x68bb('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 541b84b..f5357cb 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 _0x2b66=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','lodash','../../config/logger'];(function(_0xd2cd94,_0x3bf735){var _0x844eaa=function(_0xafb688){while(--_0xafb688){_0xd2cd94['push'](_0xd2cd94['shift']());}};_0x844eaa(++_0x3bf735);}(_0x2b66,0x1ba));var _0x62b6=function(_0x5387c0,_0x1c30ae){_0x5387c0=_0x5387c0-0x0;var _0x29d280=_0x2b66[_0x5387c0];return _0x29d280;};'use strict';var _=require(_0x62b6('0x0'));var util=require('util');var logger=require(_0x62b6('0x1'))(_0x62b6('0x2'));var moment=require(_0x62b6('0x3'));var BPromise=require(_0x62b6('0x4'));var rp=require(_0x62b6('0x5'));var fs=require('fs');var path=require(_0x62b6('0x6'));var rimraf=require(_0x62b6('0x7'));var config=require(_0x62b6('0x8'));var attributes=require('./chatQueue.attributes');module[_0x62b6('0x9')]=function(_0xeb90b,_0x4c4be9){return _0xeb90b[_0x62b6('0xa')](_0x62b6('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x86b3=['exports','ChatQueue','chat_queues','api','moment','bluebird','request-promise','path','../../config/environment','./chatQueue.attributes'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x86b3,0x107));var _0x386b=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x86b3[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x386b('0x0'));var moment=require(_0x386b('0x1'));var BPromise=require(_0x386b('0x2'));var rp=require(_0x386b('0x3'));var fs=require('fs');var path=require(_0x386b('0x4'));var rimraf=require('rimraf');var config=require(_0x386b('0x5'));var attributes=require(_0x386b('0x6'));module[_0x386b('0x7')]=function(_0x277182,_0x4f3435){return _0x277182['define'](_0x386b('0x8'),attributes,{'tableName':_0x386b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index bb79a1f..d47b7d7 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 _0xd959=['ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','ChatQueue','findAll','options','where','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info'];(function(_0x543624,_0x8a8563){var _0x3f9d16=function(_0x469f08){while(--_0x469f08){_0x543624['push'](_0x543624['shift']());}};_0x3f9d16(++_0x8a8563);}(_0xd959,0x1f3));var _0x9d95=function(_0x40e7c3,_0x5ba8f3){_0x40e7c3=_0x40e7c3-0x0;var _0xb24182=_0xd959[_0x40e7c3];return _0xb24182;};'use strict';var _=require(_0x9d95('0x0'));var util=require(_0x9d95('0x1'));var moment=require(_0x9d95('0x2'));var BPromise=require(_0x9d95('0x3'));var rs=require(_0x9d95('0x4'));var fs=require('fs');var Redis=require(_0x9d95('0x5'));var db=require(_0x9d95('0x6'))['db'];var utils=require(_0x9d95('0x7'));var logger=require(_0x9d95('0x8'))('rpc');var config=require(_0x9d95('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9d95('0xa')][_0x9d95('0xb')]({'port':0x232a});config[_0x9d95('0xc')]=_[_0x9d95('0xd')](config['redis'],{'host':_0x9d95('0xe'),'port':0x18eb});var socket=require(_0x9d95('0xf'))(new Redis(config[_0x9d95('0xc')]));require(_0x9d95('0x10'))[_0x9d95('0x11')](socket);function respondWithRpcPromise(_0x376a01,_0xfc9b81,_0x551825){return new BPromise(function(_0x184080,_0x5993b5){return client[_0x9d95('0x12')](_0x376a01,_0x551825)[_0x9d95('0x13')](function(_0x2461d3){logger[_0x9d95('0x14')](_0x9d95('0x15'),_0xfc9b81,_0x9d95('0x16'));logger[_0x9d95('0x17')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0xfc9b81,_0x9d95('0x16'),JSON['stringify'](_0x2461d3));if(_0x2461d3[_0x9d95('0x18')]){if(_0x2461d3[_0x9d95('0x18')]['code']===0x1f4){logger['error'](_0x9d95('0x15'),_0xfc9b81,_0x2461d3['error'][_0x9d95('0x19')]);return _0x5993b5(_0x2461d3[_0x9d95('0x18')][_0x9d95('0x19')]);}logger[_0x9d95('0x18')](_0x9d95('0x15'),_0xfc9b81,_0x2461d3[_0x9d95('0x18')]['message']);return _0x184080(_0x2461d3[_0x9d95('0x18')][_0x9d95('0x19')]);}else{logger[_0x9d95('0x14')]('ChatQueue,\x20%s,\x20%s',_0xfc9b81,_0x9d95('0x16'));_0x184080(_0x2461d3['result'][_0x9d95('0x19')]);}})[_0x9d95('0x1a')](function(_0x4e2740){logger[_0x9d95('0x18')](_0x9d95('0x15'),_0xfc9b81,_0x4e2740);_0x5993b5(_0x4e2740);});});}exports['GetChatQueue']=function(_0x32b662){var _0x375478=this;return new Promise(function(_0x1a0633,_0x16d7de){return db[_0x9d95('0x1b')][_0x9d95('0x1c')]({'raw':_0x32b662[_0x9d95('0x1d')]?_0x32b662[_0x9d95('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x32b662[_0x9d95('0x1d')]?_0x32b662['options'][_0x9d95('0x1e')]||null:null,'attributes':_0x32b662[_0x9d95('0x1d')]?_0x32b662[_0x9d95('0x1d')][_0x9d95('0x1f')]||null:null,'limit':_0x32b662[_0x9d95('0x1d')]?_0x32b662[_0x9d95('0x1d')][_0x9d95('0x20')]||null:null,'include':_0x32b662[_0x9d95('0x1d')]?_0x32b662[_0x9d95('0x1d')][_0x9d95('0x21')]?_[_0x9d95('0x22')](_0x32b662[_0x9d95('0x1d')][_0x9d95('0x21')],function(_0x288575){return{'model':db[_0x288575['model']],'as':_0x288575['as'],'attributes':_0x288575[_0x9d95('0x1f')],'include':_0x288575['include']?_[_0x9d95('0x22')](_0x288575[_0x9d95('0x21')],function(_0xe74415){return{'model':db[_0xe74415[_0x9d95('0x23')]],'as':_0xe74415['as'],'attributes':_0xe74415['attributes'],'include':_0xe74415[_0x9d95('0x21')]?_[_0x9d95('0x22')](_0xe74415[_0x9d95('0x21')],function(_0x1515ba){return{'model':db[_0x1515ba[_0x9d95('0x23')]],'as':_0x1515ba['as'],'attributes':_0x1515ba['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d95('0x13')](function(_0x49c2ca){logger[_0x9d95('0x14')](_0x9d95('0x24'),_0x32b662);logger[_0x9d95('0x17')]('GetChatQueue',_0x32b662,JSON['stringify'](_0x49c2ca));_0x1a0633(_0x49c2ca);})[_0x9d95('0x1a')](function(_0x16f85f){logger[_0x9d95('0x18')](_0x9d95('0x24'),_0x16f85f[_0x9d95('0x19')],_0x32b662);_0x16d7de(_0x375478[_0x9d95('0x18')](0x1f4,_0x16f85f[_0x9d95('0x19')]));});});};exports[_0x9d95('0x25')]=function(_0x54a61e){var _0x29dc9f=this;return new Promise(function(_0x3aeaac,_0x4a5a3){return db[_0x9d95('0x1b')]['find']({'raw':_0x54a61e[_0x9d95('0x1d')]?_0x54a61e['options'][_0x9d95('0x26')]===undefined?!![]:![]:!![],'where':_0x54a61e[_0x9d95('0x1d')]?_0x54a61e[_0x9d95('0x1d')][_0x9d95('0x1e')]||null:null,'attributes':_0x54a61e[_0x9d95('0x1d')]?_0x54a61e[_0x9d95('0x1d')]['attributes']||null:null,'include':_0x54a61e[_0x9d95('0x1d')]?_0x54a61e[_0x9d95('0x1d')][_0x9d95('0x21')]?_[_0x9d95('0x22')](_0x54a61e[_0x9d95('0x1d')][_0x9d95('0x21')],function(_0x21ef0a){return{'model':db[_0x21ef0a[_0x9d95('0x23')]],'as':_0x21ef0a['as'],'attributes':_0x21ef0a[_0x9d95('0x1f')],'include':_0x21ef0a['include']?_[_0x9d95('0x22')](_0x21ef0a[_0x9d95('0x21')],function(_0xa0f19b){return{'model':db[_0xa0f19b[_0x9d95('0x23')]],'as':_0xa0f19b['as'],'attributes':_0xa0f19b[_0x9d95('0x1f')],'include':_0xa0f19b[_0x9d95('0x21')]?_['map'](_0xa0f19b[_0x9d95('0x21')],function(_0x4be3df){return{'model':db[_0x4be3df[_0x9d95('0x23')]],'as':_0x4be3df['as'],'attributes':_0x4be3df[_0x9d95('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9d95('0x13')](function(_0x36a5db){logger[_0x9d95('0x14')](_0x9d95('0x25'),_0x54a61e);logger[_0x9d95('0x17')](_0x9d95('0x25'),_0x54a61e,JSON[_0x9d95('0x27')](_0x36a5db));_0x3aeaac(_0x36a5db);})[_0x9d95('0x1a')](function(_0x194e48){logger[_0x9d95('0x18')](_0x9d95('0x25'),_0x194e48['message'],_0x54a61e);_0x4a5a3(_0x29dc9f['error'](0x1f4,_0x194e48['message']));});});};
\ No newline at end of file
+var _0xa988=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','request','info','ChatQueue,\x20%s,\x20%s','debug','error','message','request\x20sent','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','then','stringify','catch','find','ShowChatQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa988,0x1a7));var _0x8a98=function(_0x5afae5,_0x438692){_0x5afae5=_0x5afae5-0x0;var _0x4d70fe=_0xa988[_0x5afae5];return _0x4d70fe;};'use strict';var _=require(_0x8a98('0x0'));var util=require(_0x8a98('0x1'));var moment=require(_0x8a98('0x2'));var BPromise=require(_0x8a98('0x3'));var rs=require(_0x8a98('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a98('0x5'))['db'];var utils=require(_0x8a98('0x6'));var logger=require(_0x8a98('0x7'))(_0x8a98('0x8'));var config=require(_0x8a98('0x9'));var jayson=require(_0x8a98('0xa'));var client=jayson[_0x8a98('0xb')][_0x8a98('0xc')]({'port':0x232a});config['redis']=_[_0x8a98('0xd')](config[_0x8a98('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x8a98('0xf'))(new Redis(config[_0x8a98('0xe')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1aab5c,_0x26c340,_0x51f11f){return new BPromise(function(_0x3cac53,_0xf73acb){return client[_0x8a98('0x10')](_0x1aab5c,_0x51f11f)['then'](function(_0x450a99){logger[_0x8a98('0x11')](_0x8a98('0x12'),_0x26c340,'request\x20sent');logger[_0x8a98('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x26c340,'request\x20sent',JSON['stringify'](_0x450a99));if(_0x450a99[_0x8a98('0x14')]){if(_0x450a99['error']['code']===0x1f4){logger['error'](_0x8a98('0x12'),_0x26c340,_0x450a99['error'][_0x8a98('0x15')]);return _0xf73acb(_0x450a99[_0x8a98('0x14')][_0x8a98('0x15')]);}logger[_0x8a98('0x14')](_0x8a98('0x12'),_0x26c340,_0x450a99[_0x8a98('0x14')][_0x8a98('0x15')]);return _0x3cac53(_0x450a99[_0x8a98('0x14')]['message']);}else{logger['info'](_0x8a98('0x12'),_0x26c340,_0x8a98('0x16'));_0x3cac53(_0x450a99['result'][_0x8a98('0x15')]);}})['catch'](function(_0x184488){logger[_0x8a98('0x14')](_0x8a98('0x12'),_0x26c340,_0x184488);_0xf73acb(_0x184488);});});}exports[_0x8a98('0x17')]=function(_0x289a2d){var _0x5a610e=this;return new Promise(function(_0x4d6e43,_0x239094){return db[_0x8a98('0x18')][_0x8a98('0x19')]({'raw':_0x289a2d[_0x8a98('0x1a')]?_0x289a2d[_0x8a98('0x1a')][_0x8a98('0x1b')]===undefined?!![]:![]:!![],'where':_0x289a2d[_0x8a98('0x1a')]?_0x289a2d[_0x8a98('0x1a')][_0x8a98('0x1c')]||null:null,'attributes':_0x289a2d[_0x8a98('0x1a')]?_0x289a2d['options'][_0x8a98('0x1d')]||null:null,'limit':_0x289a2d[_0x8a98('0x1a')]?_0x289a2d[_0x8a98('0x1a')][_0x8a98('0x1e')]||null:null,'include':_0x289a2d[_0x8a98('0x1a')]?_0x289a2d['options'][_0x8a98('0x1f')]?_['map'](_0x289a2d['options'][_0x8a98('0x1f')],function(_0x410ae8){return{'model':db[_0x410ae8[_0x8a98('0x20')]],'as':_0x410ae8['as'],'attributes':_0x410ae8[_0x8a98('0x1d')],'include':_0x410ae8[_0x8a98('0x1f')]?_[_0x8a98('0x21')](_0x410ae8['include'],function(_0x204db8){return{'model':db[_0x204db8[_0x8a98('0x20')]],'as':_0x204db8['as'],'attributes':_0x204db8[_0x8a98('0x1d')],'include':_0x204db8['include']?_[_0x8a98('0x21')](_0x204db8[_0x8a98('0x1f')],function(_0x2bfd99){return{'model':db[_0x2bfd99[_0x8a98('0x20')]],'as':_0x2bfd99['as'],'attributes':_0x2bfd99['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a98('0x22')](function(_0x5edd60){logger[_0x8a98('0x11')](_0x8a98('0x17'),_0x289a2d);logger['debug'](_0x8a98('0x17'),_0x289a2d,JSON[_0x8a98('0x23')](_0x5edd60));_0x4d6e43(_0x5edd60);})[_0x8a98('0x24')](function(_0x4d69f9){logger[_0x8a98('0x14')](_0x8a98('0x17'),_0x4d69f9[_0x8a98('0x15')],_0x289a2d);_0x239094(_0x5a610e[_0x8a98('0x14')](0x1f4,_0x4d69f9[_0x8a98('0x15')]));});});};exports['ShowChatQueue']=function(_0x56b35d){var _0x24ea39=this;return new Promise(function(_0x346c61,_0xff31ec){return db[_0x8a98('0x18')][_0x8a98('0x25')]({'raw':_0x56b35d[_0x8a98('0x1a')]?_0x56b35d[_0x8a98('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x56b35d['options']?_0x56b35d[_0x8a98('0x1a')][_0x8a98('0x1c')]||null:null,'attributes':_0x56b35d[_0x8a98('0x1a')]?_0x56b35d[_0x8a98('0x1a')][_0x8a98('0x1d')]||null:null,'include':_0x56b35d[_0x8a98('0x1a')]?_0x56b35d['options'][_0x8a98('0x1f')]?_['map'](_0x56b35d[_0x8a98('0x1a')]['include'],function(_0x75ef3f){return{'model':db[_0x75ef3f[_0x8a98('0x20')]],'as':_0x75ef3f['as'],'attributes':_0x75ef3f[_0x8a98('0x1d')],'include':_0x75ef3f[_0x8a98('0x1f')]?_[_0x8a98('0x21')](_0x75ef3f[_0x8a98('0x1f')],function(_0x21f39c){return{'model':db[_0x21f39c['model']],'as':_0x21f39c['as'],'attributes':_0x21f39c[_0x8a98('0x1d')],'include':_0x21f39c[_0x8a98('0x1f')]?_['map'](_0x21f39c[_0x8a98('0x1f')],function(_0x21a337){return{'model':db[_0x21a337[_0x8a98('0x20')]],'as':_0x21a337['as'],'attributes':_0x21a337[_0x8a98('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8a98('0x22')](function(_0x4c3fa4){logger[_0x8a98('0x11')](_0x8a98('0x26'),_0x56b35d);logger[_0x8a98('0x13')](_0x8a98('0x26'),_0x56b35d,JSON[_0x8a98('0x23')](_0x4c3fa4));_0x346c61(_0x4c3fa4);})[_0x8a98('0x24')](function(_0x58aa42){logger[_0x8a98('0x14')](_0x8a98('0x26'),_0x58aa42[_0x8a98('0x15')],_0x56b35d);_0xff31ec(_0x24ea39[_0x8a98('0x14')](0x1f4,_0x58aa42[_0x8a98('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 9662321..209821e 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 _0x7a2c=['chatQueue:','./chatQueue.events','remove','update','emit','register'];(function(_0x1faf8d,_0x3ff04d){var _0xb3474c=function(_0x7a7870){while(--_0x7a7870){_0x1faf8d['push'](_0x1faf8d['shift']());}};_0xb3474c(++_0x3ff04d);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x35bca7,_0x2cf644){_0x35bca7=_0x35bca7-0x0;var _0x467498=_0x7a2c[_0x35bca7];return _0x467498;};'use strict';var ChatQueueEvents=require(_0xc7a2('0x0'));var events=['save',_0xc7a2('0x1'),_0xc7a2('0x2')];function createListener(_0x409ec5,_0x26fb61){return function(_0x44d702){_0x26fb61[_0xc7a2('0x3')](_0x409ec5,_0x44d702);};}function removeListener(_0x3f2b0d,_0x34cd60){return function(){ChatQueueEvents['removeListener'](_0x3f2b0d,_0x34cd60);};}exports[_0xc7a2('0x4')]=function(_0x1ddbae){for(var _0x5f334e=0x0,_0x481430=events['length'];_0x5f334e<_0x481430;_0x5f334e++){var _0x1dd150=events[_0x5f334e];var _0x3de428=createListener(_0xc7a2('0x5')+_0x1dd150,_0x1ddbae);ChatQueueEvents['on'](_0x1dd150,_0x3de428);}};
\ No newline at end of file
+var _0x4c6d=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update'];(function(_0x57a649,_0x43dc50){var _0x117093=function(_0x2d2255){while(--_0x2d2255){_0x57a649['push'](_0x57a649['shift']());}};_0x117093(++_0x43dc50);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x5505eb,_0xd878dc){_0x5505eb=_0x5505eb-0x0;var _0x4dff66=_0x4c6d[_0x5505eb];return _0x4dff66;};'use strict';var ChatQueueEvents=require(_0xd4c6('0x0'));var events=[_0xd4c6('0x1'),_0xd4c6('0x2'),_0xd4c6('0x3')];function createListener(_0x350cc0,_0x5448bc){return function(_0x209f99){_0x5448bc[_0xd4c6('0x4')](_0x350cc0,_0x209f99);};}function removeListener(_0x306766,_0x4b2d75){return function(){ChatQueueEvents[_0xd4c6('0x5')](_0x306766,_0x4b2d75);};}exports[_0xd4c6('0x6')]=function(_0x56279c){for(var _0x182671=0x0,_0x316314=events[_0xd4c6('0x7')];_0x182671<_0x316314;_0x182671++){var _0x5d4fce=events[_0x182671];var _0x440ee3=createListener(_0xd4c6('0x8')+_0x5d4fce,_0x56279c);ChatQueueEvents['on'](_0x5d4fce,_0x440ee3);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index cb1ac06..e00b01d 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x57ce89,_0x389a7d){var _0x53371b=function(_0x43fdd6){while(--_0x43fdd6){_0x57ce89['push'](_0x57ce89['shift']());}};_0x53371b(++_0x389a7d);}(_0xe14b,0x93));var _0xbe14=function(_0x35e5de,_0x5311b7){_0x35e5de=_0x35e5de-0x0;var _0x665d7d=_0xe14b[_0x35e5de];return _0x665d7d;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x5fc3,0xa8));var _0x35fc=function(_0x7a3247,_0x15cb12){_0x7a3247=_0x7a3247-0x0;var _0x1bfde5=_0x5fc3[_0x7a3247];return _0x1bfde5;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index cd7d899..67eba06 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 _0x49ae=['moment','sequelize','STRING','DATE'];(function(_0x3e7ae3,_0x2ae3b7){var _0x282f67=function(_0x53eb72){while(--_0x53eb72){_0x3e7ae3['push'](_0x3e7ae3['shift']());}};_0x282f67(++_0x2ae3b7);}(_0x49ae,0x140));var _0xe49a=function(_0x27e4c4,_0x25d75a){_0x27e4c4=_0x27e4c4-0x0;var _0x4ab3f5=_0x49ae[_0x27e4c4];return _0x4ab3f5;};'use strict';var moment=require(_0xe49a('0x0'));var Sequelize=require(_0xe49a('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe49a('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe49a('0x3')]},'leaveAt':{'type':Sequelize[_0xe49a('0x3')]},'acceptAt':{'type':Sequelize[_0xe49a('0x3')]},'exitAt':{'type':Sequelize[_0xe49a('0x3')]},'reason':{'type':Sequelize[_0xe49a('0x2')]}};
\ No newline at end of file
+var _0x7730=['moment','exports','STRING','DATE'];(function(_0x38b208,_0x5239c1){var _0x4ea610=function(_0x518195){while(--_0x518195){_0x38b208['push'](_0x38b208['shift']());}};_0x4ea610(++_0x5239c1);}(_0x7730,0x1e8));var _0x0773=function(_0xb47dc0,_0x407032){_0xb47dc0=_0xb47dc0-0x0;var _0x57f0b0=_0x7730[_0xb47dc0];return _0x57f0b0;};'use strict';var moment=require(_0x0773('0x0'));var Sequelize=require('sequelize');module[_0x0773('0x1')]={'uniqueid':{'type':Sequelize[_0x0773('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0773('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x0773('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index b923bec..4984e76 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 _0x8a9a=['length','hasOwnProperty','order','sort','where','filters','filter','merge','map','type','includeAll','include','findAll','rows','params','intersection','options','find','catch','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','then','sendStatus','stack','name','send','index','ChatQueueReport','rawAttributes','model','query','keys','attributes','fields'];(function(_0x1a5d77,_0x3fdc6d){var _0x344595=function(_0x498324){while(--_0x498324){_0x1a5d77['push'](_0x1a5d77['shift']());}};_0x344595(++_0x3fdc6d);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x8a9a[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa8a9('0x0'));var zipdir=require(_0xa8a9('0x1'));var jsonpatch=require(_0xa8a9('0x2'));var rp=require(_0xa8a9('0x3'));var moment=require(_0xa8a9('0x4'));var BPromise=require(_0xa8a9('0x5'));var Mustache=require(_0xa8a9('0x6'));var util=require(_0xa8a9('0x7'));var path=require(_0xa8a9('0x8'));var sox=require(_0xa8a9('0x9'));var csv=require(_0xa8a9('0xa'));var ejs=require(_0xa8a9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa8a9('0xc'));var squel=require('squel');var crypto=require(_0xa8a9('0xd'));var jsforce=require(_0xa8a9('0xe'));var deskjs=require(_0xa8a9('0xf'));var toCsv=require(_0xa8a9('0xa'));var querystring=require(_0xa8a9('0x10'));var Papa=require('papaparse');var Redis=require(_0xa8a9('0x11'));var authService=require(_0xa8a9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa8a9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa8a9('0x14'))(_0xa8a9('0x15'));var utils=require('../../config/utils');var config=require(_0xa8a9('0x16'));var licenseUtil=require(_0xa8a9('0x17'));var db=require(_0xa8a9('0x18'))['db'];function respondWithStatusCode(_0x28d881,_0x35b204){_0x35b204=_0x35b204||0xcc;return function(_0x248774){if(_0x248774){return _0x28d881['sendStatus'](_0x35b204);}return _0x28d881[_0xa8a9('0x19')](_0x35b204)[_0xa8a9('0x1a')]();};}function respondWithResult(_0x24abd1,_0x509bcb){_0x509bcb=_0x509bcb||0xc8;return function(_0x4f35e6){if(_0x4f35e6){return _0x24abd1[_0xa8a9('0x19')](_0x509bcb)[_0xa8a9('0x1b')](_0x4f35e6);}};}function respondWithFilteredResult(_0x2c9f36,_0x4ca16f){return function(_0x2efd94){if(_0x2efd94){var _0x35be8c=typeof _0x4ca16f['offset']==='undefined'&&typeof _0x4ca16f[_0xa8a9('0x1c')]===_0xa8a9('0x1d');var _0x91e6d8=_0x2efd94[_0xa8a9('0x1e')];var _0x46a89d=_0x35be8c?0x0:_0x4ca16f[_0xa8a9('0x1f')];var _0x5cd106=_0x35be8c?_0x2efd94['count']:_0x4ca16f[_0xa8a9('0x1f')]+_0x4ca16f['limit'];var _0x5248fa;if(_0x5cd106>=_0x91e6d8){_0x5cd106=_0x91e6d8;_0x5248fa=0xc8;}else{_0x5248fa=0xce;}_0x2c9f36[_0xa8a9('0x19')](_0x5248fa);return _0x2c9f36[_0xa8a9('0x20')](_0xa8a9('0x21'),_0x46a89d+'-'+_0x5cd106+'/'+_0x91e6d8)[_0xa8a9('0x1b')](_0x2efd94);}return null;};}function patchUpdates(_0x4744f1){return function(_0x3e8629){try{jsonpatch[_0xa8a9('0x22')](_0x3e8629,_0x4744f1,!![]);}catch(_0x3c37f9){return BPromise[_0xa8a9('0x23')](_0x3c37f9);}return _0x3e8629['save']();};}function saveUpdates(_0x102301,_0x481a34){return function(_0x32721b){if(_0x32721b){return _0x32721b['update'](_0x102301)[_0xa8a9('0x24')](function(_0x1229d0){return _0x1229d0;});}return null;};}function removeEntity(_0x540349,_0x58f832){return function(_0x5d3ec8){if(_0x5d3ec8){return _0x5d3ec8['destroy']()[_0xa8a9('0x24')](function(){_0x540349['status'](0xcc)[_0xa8a9('0x1a')]();});}};}function handleEntityNotFound(_0x5276bd,_0x284b55){return function(_0x16abed){if(!_0x16abed){_0x5276bd[_0xa8a9('0x25')](0x194);}return _0x16abed;};}function handleError(_0x46b030,_0x1893de){_0x1893de=_0x1893de||0x1f4;return function(_0x34d84a){logger['error'](_0x34d84a[_0xa8a9('0x26')]);if(_0x34d84a['name']){delete _0x34d84a[_0xa8a9('0x27')];}_0x46b030[_0xa8a9('0x19')](_0x1893de)[_0xa8a9('0x28')](_0x34d84a);};}exports[_0xa8a9('0x29')]=function(_0x21b380,_0x343c80){var _0x4a468f={},_0x24021c={},_0x111651={'count':0x0,'rows':[]};var _0x183878=_['map'](db[_0xa8a9('0x2a')][_0xa8a9('0x2b')],function(_0x4af312){return{'name':_0x4af312['fieldName'],'type':_0x4af312['type']['key']};});_0x24021c[_0xa8a9('0x2c')]=_['map'](_0x183878,_0xa8a9('0x27'));_0x24021c[_0xa8a9('0x2d')]=_[_0xa8a9('0x2e')](_0x21b380[_0xa8a9('0x2d')]);_0x24021c['filters']=_['intersection'](_0x24021c[_0xa8a9('0x2c')],_0x24021c[_0xa8a9('0x2d')]);_0x4a468f[_0xa8a9('0x2f')]=_['intersection'](_0x24021c[_0xa8a9('0x2c')],qs[_0xa8a9('0x30')](_0x21b380[_0xa8a9('0x2d')][_0xa8a9('0x30')]));_0x4a468f[_0xa8a9('0x2f')]=_0x4a468f['attributes'][_0xa8a9('0x31')]?_0x4a468f[_0xa8a9('0x2f')]:_0x24021c[_0xa8a9('0x2c')];if(!_0x21b380['query'][_0xa8a9('0x32')]('nolimit')){_0x4a468f['limit']=qs['limit'](_0x21b380[_0xa8a9('0x2d')]['limit']);_0x4a468f[_0xa8a9('0x1f')]=qs[_0xa8a9('0x1f')](_0x21b380[_0xa8a9('0x2d')]['offset']);}_0x4a468f[_0xa8a9('0x33')]=qs[_0xa8a9('0x34')](_0x21b380['query']['sort']);_0x4a468f[_0xa8a9('0x35')]=qs[_0xa8a9('0x36')](_['pick'](_0x21b380[_0xa8a9('0x2d')],_0x24021c[_0xa8a9('0x36')]),_0x183878);if(_0x21b380['query'][_0xa8a9('0x37')]){_0x4a468f[_0xa8a9('0x35')]=_[_0xa8a9('0x38')](_0x4a468f['where'],{'$or':_[_0xa8a9('0x39')](_0x183878,function(_0x1d6869){if(_0x1d6869[_0xa8a9('0x3a')]!=='VIRTUAL'){var _0x280b9d={};_0x280b9d[_0x1d6869['name']]={'$like':'%'+_0x21b380[_0xa8a9('0x2d')]['filter']+'%'};return _0x280b9d;}})});}_0x4a468f=_[_0xa8a9('0x38')]({},_0x4a468f,_0x21b380['options']);var _0x2c9e79={'where':_0x4a468f[_0xa8a9('0x35')]};return db['ChatQueueReport'][_0xa8a9('0x1e')](_0x2c9e79)['then'](function(_0x44a9be){_0x111651[_0xa8a9('0x1e')]=_0x44a9be;if(_0x21b380[_0xa8a9('0x2d')][_0xa8a9('0x3b')]){_0x4a468f[_0xa8a9('0x3c')]=[{'all':!![]}];}return db[_0xa8a9('0x2a')][_0xa8a9('0x3d')](_0x4a468f);})['then'](function(_0x1e05f6){_0x111651[_0xa8a9('0x3e')]=_0x1e05f6;return _0x111651;})[_0xa8a9('0x24')](respondWithFilteredResult(_0x343c80,_0x4a468f))['catch'](handleError(_0x343c80,null));};exports['show']=function(_0x523878,_0x38b323){var _0x2c55c4={'raw':!![],'where':{'id':_0x523878[_0xa8a9('0x3f')]['id']}},_0x210056={};_0x210056[_0xa8a9('0x2c')]=_[_0xa8a9('0x2e')](db[_0xa8a9('0x2a')][_0xa8a9('0x2b')]);_0x210056['query']=_[_0xa8a9('0x2e')](_0x523878[_0xa8a9('0x2d')]);_0x210056[_0xa8a9('0x36')]=_[_0xa8a9('0x40')](_0x210056[_0xa8a9('0x2c')],_0x210056[_0xa8a9('0x2d')]);_0x2c55c4['attributes']=_[_0xa8a9('0x40')](_0x210056[_0xa8a9('0x2c')],qs[_0xa8a9('0x30')](_0x523878['query'][_0xa8a9('0x30')]));_0x2c55c4[_0xa8a9('0x2f')]=_0x2c55c4[_0xa8a9('0x2f')][_0xa8a9('0x31')]?_0x2c55c4['attributes']:_0x210056[_0xa8a9('0x2c')];if(_0x523878['query'][_0xa8a9('0x3b')]){_0x2c55c4[_0xa8a9('0x3c')]=[{'all':!![]}];}_0x2c55c4=_[_0xa8a9('0x38')]({},_0x2c55c4,_0x523878[_0xa8a9('0x41')]);return db[_0xa8a9('0x2a')][_0xa8a9('0x42')](_0x2c55c4)['then'](handleEntityNotFound(_0x38b323,null))[_0xa8a9('0x24')](respondWithResult(_0x38b323,null))[_0xa8a9('0x43')](handleError(_0x38b323,null));};exports['create']=function(_0x319fd7,_0x5b0b6d){return db[_0xa8a9('0x2a')]['create'](_0x319fd7[_0xa8a9('0x44')],{})[_0xa8a9('0x24')](respondWithResult(_0x5b0b6d,0xc9))[_0xa8a9('0x43')](handleError(_0x5b0b6d,null));};exports[_0xa8a9('0x45')]=function(_0x13455b,_0x3d5d7e){if(_0x13455b[_0xa8a9('0x44')]['id']){delete _0x13455b['body']['id'];}return db[_0xa8a9('0x2a')][_0xa8a9('0x42')]({'where':{'id':_0x13455b['params']['id']}})[_0xa8a9('0x24')](handleEntityNotFound(_0x3d5d7e,null))[_0xa8a9('0x24')](saveUpdates(_0x13455b['body'],null))[_0xa8a9('0x24')](respondWithResult(_0x3d5d7e,null))[_0xa8a9('0x43')](handleError(_0x3d5d7e,null));};exports[_0xa8a9('0x46')]=function(_0x21ebe1,_0x1e0d27){return db['ChatQueueReport'][_0xa8a9('0x42')]({'where':{'id':_0x21ebe1[_0xa8a9('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1e0d27,null))[_0xa8a9('0x24')](removeEntity(_0x1e0d27,null))[_0xa8a9('0x43')](handleError(_0x1e0d27,null));};exports[_0xa8a9('0x47')]=function(_0x43793d,_0x16a654){return db[_0xa8a9('0x2a')][_0xa8a9('0x47')]()[_0xa8a9('0x24')](respondWithResult(_0x16a654,null))[_0xa8a9('0x43')](handleError(_0x16a654,null));};
\ No newline at end of file
+var _0x68b3=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x3f69e7,_0x2253d6){var _0x57d5e9=function(_0x27719c){while(--_0x27719c){_0x3f69e7['push'](_0x3f69e7['shift']());}};_0x57d5e9(++_0x2253d6);}(_0x68b3,0x1d8));var _0x368b=function(_0x8071cf,_0x10e0fb){_0x8071cf=_0x8071cf-0x0;var _0xfc442e=_0x68b3[_0x8071cf];return _0xfc442e;};'use strict';var emlformat=require(_0x368b('0x0'));var rimraf=require(_0x368b('0x1'));var zipdir=require(_0x368b('0x2'));var jsonpatch=require(_0x368b('0x3'));var rp=require(_0x368b('0x4'));var moment=require('moment');var BPromise=require(_0x368b('0x5'));var Mustache=require(_0x368b('0x6'));var util=require(_0x368b('0x7'));var path=require(_0x368b('0x8'));var sox=require('sox');var csv=require(_0x368b('0x9'));var ejs=require(_0x368b('0xa'));var fs=require('fs');var fs_extra=require(_0x368b('0xb'));var _=require(_0x368b('0xc'));var squel=require(_0x368b('0xd'));var crypto=require(_0x368b('0xe'));var jsforce=require(_0x368b('0xf'));var deskjs=require(_0x368b('0x10'));var toCsv=require(_0x368b('0x9'));var querystring=require(_0x368b('0x11'));var Papa=require(_0x368b('0x12'));var Redis=require('ioredis');var authService=require(_0x368b('0x13'));var qs=require(_0x368b('0x14'));var as=require(_0x368b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x368b('0x16'))(_0x368b('0x17'));var utils=require(_0x368b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x368b('0x19'));var db=require(_0x368b('0x1a'))['db'];function respondWithStatusCode(_0x514dc7,_0x109a90){_0x109a90=_0x109a90||0xcc;return function(_0x250697){if(_0x250697){return _0x514dc7[_0x368b('0x1b')](_0x109a90);}return _0x514dc7[_0x368b('0x1c')](_0x109a90)[_0x368b('0x1d')]();};}function respondWithResult(_0x4fffe5,_0x2b326c){_0x2b326c=_0x2b326c||0xc8;return function(_0x40faa0){if(_0x40faa0){return _0x4fffe5['status'](_0x2b326c)[_0x368b('0x1e')](_0x40faa0);}};}function respondWithFilteredResult(_0x2aabb9,_0x30c245){return function(_0x515350){if(_0x515350){var _0x220cd5=typeof _0x30c245[_0x368b('0x1f')]===_0x368b('0x20')&&typeof _0x30c245['limit']===_0x368b('0x20');var _0x1b9e65=_0x515350[_0x368b('0x21')];var _0x540f57=_0x220cd5?0x0:_0x30c245['offset'];var _0x3e2e9f=_0x220cd5?_0x515350[_0x368b('0x21')]:_0x30c245[_0x368b('0x1f')]+_0x30c245[_0x368b('0x22')];var _0x1a4f20;if(_0x3e2e9f>=_0x1b9e65){_0x3e2e9f=_0x1b9e65;_0x1a4f20=0xc8;}else{_0x1a4f20=0xce;}_0x2aabb9['status'](_0x1a4f20);return _0x2aabb9[_0x368b('0x23')](_0x368b('0x24'),_0x540f57+'-'+_0x3e2e9f+'/'+_0x1b9e65)[_0x368b('0x1e')](_0x515350);}return null;};}function patchUpdates(_0x1c927f){return function(_0x23da8f){try{jsonpatch[_0x368b('0x25')](_0x23da8f,_0x1c927f,!![]);}catch(_0x397185){return BPromise[_0x368b('0x26')](_0x397185);}return _0x23da8f['save']();};}function saveUpdates(_0x13e750,_0x2f08d9){return function(_0x18869a){if(_0x18869a){return _0x18869a[_0x368b('0x27')](_0x13e750)[_0x368b('0x28')](function(_0x4c2fca){return _0x4c2fca;});}return null;};}function removeEntity(_0x286641,_0x1ca429){return function(_0x3a22bd){if(_0x3a22bd){return _0x3a22bd[_0x368b('0x29')]()[_0x368b('0x28')](function(){_0x286641[_0x368b('0x1c')](0xcc)[_0x368b('0x1d')]();});}};}function handleEntityNotFound(_0x11ea2d,_0x3123c1){return function(_0x3f7f89){if(!_0x3f7f89){_0x11ea2d[_0x368b('0x1b')](0x194);}return _0x3f7f89;};}function handleError(_0x344d8a,_0xceec4b){_0xceec4b=_0xceec4b||0x1f4;return function(_0x376e61){logger[_0x368b('0x2a')](_0x376e61[_0x368b('0x2b')]);if(_0x376e61[_0x368b('0x2c')]){delete _0x376e61[_0x368b('0x2c')];}_0x344d8a[_0x368b('0x1c')](_0xceec4b)[_0x368b('0x2d')](_0x376e61);};}exports[_0x368b('0x2e')]=function(_0xc12627,_0x107d2f){var _0x3c80b5={},_0x5db0b4={},_0x4af77a={'count':0x0,'rows':[]};var _0x381324=_[_0x368b('0x2f')](db[_0x368b('0x30')][_0x368b('0x31')],function(_0x5d6ebf){return{'name':_0x5d6ebf[_0x368b('0x32')],'type':_0x5d6ebf[_0x368b('0x33')][_0x368b('0x34')]};});_0x5db0b4[_0x368b('0x35')]=_[_0x368b('0x2f')](_0x381324,'name');_0x5db0b4[_0x368b('0x36')]=_[_0x368b('0x37')](_0xc12627[_0x368b('0x36')]);_0x5db0b4[_0x368b('0x38')]=_['intersection'](_0x5db0b4['model'],_0x5db0b4['query']);_0x3c80b5[_0x368b('0x39')]=_[_0x368b('0x3a')](_0x5db0b4[_0x368b('0x35')],qs[_0x368b('0x3b')](_0xc12627[_0x368b('0x36')]['fields']));_0x3c80b5[_0x368b('0x39')]=_0x3c80b5[_0x368b('0x39')]['length']?_0x3c80b5[_0x368b('0x39')]:_0x5db0b4[_0x368b('0x35')];if(!_0xc12627['query'][_0x368b('0x3c')](_0x368b('0x3d'))){_0x3c80b5['limit']=qs[_0x368b('0x22')](_0xc12627['query']['limit']);_0x3c80b5['offset']=qs[_0x368b('0x1f')](_0xc12627[_0x368b('0x36')][_0x368b('0x1f')]);}_0x3c80b5[_0x368b('0x3e')]=qs[_0x368b('0x3f')](_0xc12627[_0x368b('0x36')][_0x368b('0x3f')]);_0x3c80b5[_0x368b('0x40')]=qs[_0x368b('0x38')](_[_0x368b('0x41')](_0xc12627['query'],_0x5db0b4[_0x368b('0x38')]),_0x381324);if(_0xc12627[_0x368b('0x36')]['filter']){_0x3c80b5[_0x368b('0x40')]=_[_0x368b('0x42')](_0x3c80b5[_0x368b('0x40')],{'$or':_[_0x368b('0x2f')](_0x381324,function(_0x248b2b){if(_0x248b2b['type']!==_0x368b('0x43')){var _0x4287c6={};_0x4287c6[_0x248b2b[_0x368b('0x2c')]]={'$like':'%'+_0xc12627[_0x368b('0x36')]['filter']+'%'};return _0x4287c6;}})});}_0x3c80b5=_['merge']({},_0x3c80b5,_0xc12627[_0x368b('0x44')]);var _0x3d00f9={'where':_0x3c80b5[_0x368b('0x40')]};return db[_0x368b('0x30')][_0x368b('0x21')](_0x3d00f9)[_0x368b('0x28')](function(_0x1d990c){_0x4af77a[_0x368b('0x21')]=_0x1d990c;if(_0xc12627[_0x368b('0x36')][_0x368b('0x45')]){_0x3c80b5['include']=[{'all':!![]}];}return db[_0x368b('0x30')][_0x368b('0x46')](_0x3c80b5);})['then'](function(_0x25e713){_0x4af77a[_0x368b('0x47')]=_0x25e713;return _0x4af77a;})[_0x368b('0x28')](respondWithFilteredResult(_0x107d2f,_0x3c80b5))[_0x368b('0x48')](handleError(_0x107d2f,null));};exports['show']=function(_0x490eb6,_0x151711){var _0x4a0275={'raw':!![],'where':{'id':_0x490eb6[_0x368b('0x49')]['id']}},_0x91bb0b={};_0x91bb0b[_0x368b('0x35')]=_['keys'](db[_0x368b('0x30')][_0x368b('0x31')]);_0x91bb0b[_0x368b('0x36')]=_['keys'](_0x490eb6['query']);_0x91bb0b[_0x368b('0x38')]=_[_0x368b('0x3a')](_0x91bb0b['model'],_0x91bb0b[_0x368b('0x36')]);_0x4a0275[_0x368b('0x39')]=_[_0x368b('0x3a')](_0x91bb0b[_0x368b('0x35')],qs[_0x368b('0x3b')](_0x490eb6[_0x368b('0x36')][_0x368b('0x3b')]));_0x4a0275[_0x368b('0x39')]=_0x4a0275[_0x368b('0x39')][_0x368b('0x4a')]?_0x4a0275[_0x368b('0x39')]:_0x91bb0b[_0x368b('0x35')];if(_0x490eb6[_0x368b('0x36')]['includeAll']){_0x4a0275[_0x368b('0x4b')]=[{'all':!![]}];}_0x4a0275=_[_0x368b('0x42')]({},_0x4a0275,_0x490eb6[_0x368b('0x44')]);return db[_0x368b('0x30')][_0x368b('0x4c')](_0x4a0275)['then'](handleEntityNotFound(_0x151711,null))['then'](respondWithResult(_0x151711,null))[_0x368b('0x48')](handleError(_0x151711,null));};exports[_0x368b('0x4d')]=function(_0x1c8755,_0x5a9d70){return db[_0x368b('0x30')][_0x368b('0x4d')](_0x1c8755[_0x368b('0x4e')],{})[_0x368b('0x28')](respondWithResult(_0x5a9d70,0xc9))[_0x368b('0x48')](handleError(_0x5a9d70,null));};exports[_0x368b('0x27')]=function(_0x8f35b,_0x1174fa){if(_0x8f35b[_0x368b('0x4e')]['id']){delete _0x8f35b[_0x368b('0x4e')]['id'];}return db['ChatQueueReport'][_0x368b('0x4c')]({'where':{'id':_0x8f35b['params']['id']}})[_0x368b('0x28')](handleEntityNotFound(_0x1174fa,null))['then'](saveUpdates(_0x8f35b[_0x368b('0x4e')],null))['then'](respondWithResult(_0x1174fa,null))[_0x368b('0x48')](handleError(_0x1174fa,null));};exports[_0x368b('0x29')]=function(_0x3b8a12,_0x458d9a){return db['ChatQueueReport'][_0x368b('0x4c')]({'where':{'id':_0x3b8a12[_0x368b('0x49')]['id']}})[_0x368b('0x28')](handleEntityNotFound(_0x458d9a,null))[_0x368b('0x28')](removeEntity(_0x458d9a,null))[_0x368b('0x48')](handleError(_0x458d9a,null));};exports[_0x368b('0x4f')]=function(_0x3898a8,_0x15078b){return db[_0x368b('0x30')]['describe']()[_0x368b('0x28')](respondWithResult(_0x15078b,null))[_0x368b('0x48')](handleError(_0x15078b,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 322dd48..56497bc 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0xc5d1da,_0x352baf){var _0xd9d348=function(_0x5138b4){while(--_0x5138b4){_0xc5d1da['push'](_0xc5d1da['shift']());}};_0xd9d348(++_0x352baf);}(_0xb7e7,0x121));var _0x7b7e=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xb7e7[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'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(_0x3b023e,_0x1a2005){var _0x56da0f=function(_0x40ad61){while(--_0x40ad61){_0x3b023e['push'](_0x3b023e['shift']());}};_0x56da0f(++_0x1a2005);}(_0x757a,0xde));var _0xa757=function(_0x4efdf6,_0x537f4a){_0x4efdf6=_0x4efdf6-0x0;var _0x160551=_0x757a[_0x4efdf6];return _0x160551;};'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 2958750..74c463e 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 _0x97c1=['util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ChatQueueReport','create','body','options','raw','then','CreateChatQueueReport','debug','UpdateChatQueueReport','update','where','attributes','limit','lodash'];(function(_0x64d376,_0xe4f981){var _0x42d917=function(_0x131286){while(--_0x131286){_0x64d376['push'](_0x64d376['shift']());}};_0x42d917(++_0xe4f981);}(_0x97c1,0xdf));var _0x197c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x97c1[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var moment=require('moment');var BPromise=require(_0x197c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x197c('0x3'))['db'];var utils=require(_0x197c('0x4'));var logger=require(_0x197c('0x5'))(_0x197c('0x6'));var config=require(_0x197c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x197c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x437214,_0x60fab2,_0xfcee35){return new BPromise(function(_0x5cf5cb,_0x5d42c5){return client[_0x197c('0x9')](_0x437214,_0xfcee35)['then'](function(_0x339fab){logger[_0x197c('0xa')](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));logger['debug'](_0x197c('0xd'),_0x60fab2,_0x197c('0xc'),JSON[_0x197c('0xe')](_0x339fab));if(_0x339fab[_0x197c('0xf')]){if(_0x339fab[_0x197c('0xf')]['code']===0x1f4){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5d42c5(_0x339fab['error'][_0x197c('0x10')]);}logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5cf5cb(_0x339fab[_0x197c('0xf')]['message']);}else{logger['info'](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));_0x5cf5cb(_0x339fab[_0x197c('0x11')][_0x197c('0x10')]);}})[_0x197c('0x12')](function(_0x7e302f){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x7e302f);_0x5d42c5(_0x7e302f);});});}exports['CreateChatQueueReport']=function(_0x372311){var _0x47aaa9=this;return new Promise(function(_0x50ac52,_0x1725d9){return db[_0x197c('0x13')][_0x197c('0x14')](_0x372311[_0x197c('0x15')],{'raw':_0x372311['options']?_0x372311[_0x197c('0x16')][_0x197c('0x17')]===undefined?!![]:![]:!![]})[_0x197c('0x18')](function(_0x5c278a){logger[_0x197c('0xa')](_0x197c('0x19'),_0x372311);logger[_0x197c('0x1a')](_0x197c('0x19'),_0x372311,JSON[_0x197c('0xe')](_0x5c278a));_0x50ac52(_0x5c278a);})[_0x197c('0x12')](function(_0x362bbf){logger[_0x197c('0xf')](_0x197c('0x19'),_0x362bbf[_0x197c('0x10')],_0x372311);_0x1725d9(_0x47aaa9[_0x197c('0xf')](0x1f4,_0x362bbf[_0x197c('0x10')]));});});};exports[_0x197c('0x1b')]=function(_0x2a1310){var _0x37b040=this;return new Promise(function(_0x25486a,_0x5f4a02){return db[_0x197c('0x13')][_0x197c('0x1c')](_0x2a1310[_0x197c('0x15')],{'raw':_0x2a1310['options']?_0x2a1310[_0x197c('0x16')][_0x197c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a1310['options']?_0x2a1310['options'][_0x197c('0x1d')]||null:null,'attributes':_0x2a1310['options']?_0x2a1310[_0x197c('0x16')][_0x197c('0x1e')]||null:null,'limit':_0x2a1310[_0x197c('0x16')]?_0x2a1310[_0x197c('0x16')][_0x197c('0x1f')]||null:null})[_0x197c('0x18')](function(_0x2b6154){logger[_0x197c('0xa')](_0x197c('0x1b'),_0x2a1310);logger['debug']('UpdateChatQueueReport',_0x2a1310,JSON['stringify'](_0x2b6154));_0x25486a(_0x2b6154);})['catch'](function(_0x5f7425){logger['error'](_0x197c('0x1b'),_0x5f7425[_0x197c('0x10')],_0x2a1310);_0x5f4a02(_0x37b040['error'](0x1f4,_0x5f7425[_0x197c('0x10')]));});});};
\ No newline at end of file
+var _0x640d=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','where','attributes','limit','then','lodash','util'];(function(_0x142eef,_0x548870){var _0x1af9f3=function(_0x37d21c){while(--_0x37d21c){_0x142eef['push'](_0x142eef['shift']());}};_0x1af9f3(++_0x548870);}(_0x640d,0x130));var _0xd640=function(_0x108749,_0x1c103a){_0x108749=_0x108749-0x0;var _0x5088f0=_0x640d[_0x108749];return _0x5088f0;};'use strict';var _=require(_0xd640('0x0'));var util=require(_0xd640('0x1'));var moment=require(_0xd640('0x2'));var BPromise=require(_0xd640('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd640('0x4'));var db=require(_0xd640('0x5'))['db'];var utils=require(_0xd640('0x6'));var logger=require(_0xd640('0x7'))(_0xd640('0x8'));var config=require(_0xd640('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd640('0xa')][_0xd640('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dfb95,_0x5d003c,_0x4832a2){return new BPromise(function(_0x7e21bd,_0x4fe84e){return client[_0xd640('0xc')](_0x1dfb95,_0x4832a2)['then'](function(_0x3fad7b){logger[_0xd640('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x5d003c,_0xd640('0xe'));logger[_0xd640('0xf')](_0xd640('0x10'),_0x5d003c,'request\x20sent',JSON[_0xd640('0x11')](_0x3fad7b));if(_0x3fad7b['error']){if(_0x3fad7b[_0xd640('0x12')][_0xd640('0x13')]===0x1f4){logger['error'](_0xd640('0x14'),_0x5d003c,_0x3fad7b[_0xd640('0x12')][_0xd640('0x15')]);return _0x4fe84e(_0x3fad7b[_0xd640('0x12')][_0xd640('0x15')]);}logger[_0xd640('0x12')](_0xd640('0x14'),_0x5d003c,_0x3fad7b[_0xd640('0x12')]['message']);return _0x7e21bd(_0x3fad7b[_0xd640('0x12')][_0xd640('0x15')]);}else{logger[_0xd640('0xd')](_0xd640('0x14'),_0x5d003c,'request\x20sent');_0x7e21bd(_0x3fad7b['result'][_0xd640('0x15')]);}})[_0xd640('0x16')](function(_0x237a91){logger[_0xd640('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x5d003c,_0x237a91);_0x4fe84e(_0x237a91);});});}exports[_0xd640('0x17')]=function(_0x5a3a18){var _0x8552f2=this;return new Promise(function(_0x2d11a5,_0x4c2786){return db[_0xd640('0x18')][_0xd640('0x19')](_0x5a3a18[_0xd640('0x1a')],{'raw':_0x5a3a18['options']?_0x5a3a18[_0xd640('0x1b')][_0xd640('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x3ac573){logger[_0xd640('0xd')]('CreateChatQueueReport',_0x5a3a18);logger[_0xd640('0xf')](_0xd640('0x17'),_0x5a3a18,JSON[_0xd640('0x11')](_0x3ac573));_0x2d11a5(_0x3ac573);})['catch'](function(_0x532259){logger['error'](_0xd640('0x17'),_0x532259['message'],_0x5a3a18);_0x4c2786(_0x8552f2['error'](0x1f4,_0x532259['message']));});});};exports[_0xd640('0x1d')]=function(_0x178e98){var _0x13188c=this;return new Promise(function(_0x130483,_0x487c2a){return db[_0xd640('0x18')]['update'](_0x178e98['body'],{'raw':_0x178e98['options']?_0x178e98[_0xd640('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x178e98['options']?_0x178e98[_0xd640('0x1b')][_0xd640('0x1e')]||null:null,'attributes':_0x178e98[_0xd640('0x1b')]?_0x178e98[_0xd640('0x1b')][_0xd640('0x1f')]||null:null,'limit':_0x178e98[_0xd640('0x1b')]?_0x178e98[_0xd640('0x1b')][_0xd640('0x20')]||null:null})[_0xd640('0x21')](function(_0xe56ec3){logger[_0xd640('0xd')](_0xd640('0x1d'),_0x178e98);logger[_0xd640('0xf')](_0xd640('0x1d'),_0x178e98,JSON['stringify'](_0xe56ec3));_0x130483(_0xe56ec3);})[_0xd640('0x16')](function(_0x1820c9){logger[_0xd640('0x12')](_0xd640('0x1d'),_0x1820c9[_0xd640('0x15')],_0x178e98);_0x487c2a(_0x13188c[_0xd640('0x12')](0x1f4,_0x1820c9[_0xd640('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index da63609..6cbf233 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 _0x13ae=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x4bbf8a,_0x2dc0a0){var _0x535b40=function(_0x30ec74){while(--_0x30ec74){_0x4bbf8a['push'](_0x4bbf8a['shift']());}};_0x535b40(++_0x2dc0a0);}(_0x13ae,0x1a0));var _0xe13a=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x13ae[_0x36eaaa];return _0x461349;};'use strict';var multer=require('multer');var util=require(_0xe13a('0x0'));var path=require(_0xe13a('0x1'));var timeout=require(_0xe13a('0x2'));var express=require(_0xe13a('0x3'));var router=express[_0xe13a('0x4')]();var fs_extra=require(_0xe13a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe13a('0x6'));var config=require(_0xe13a('0x7'));var controller=require(_0xe13a('0x8'));router['get']('/',auth[_0xe13a('0x9')](),controller[_0xe13a('0xa')]);router[_0xe13a('0xb')](_0xe13a('0xc'),auth[_0xe13a('0x9')](),controller[_0xe13a('0xd')]);router[_0xe13a('0xb')](_0xe13a('0xe'),auth[_0xe13a('0x9')](),controller['show']);router[_0xe13a('0xf')]('/',auth[_0xe13a('0x9')](),controller[_0xe13a('0x10')]);router[_0xe13a('0x11')](_0xe13a('0xe'),auth[_0xe13a('0x9')](),controller[_0xe13a('0x12')]);router[_0xe13a('0x13')](_0xe13a('0xe'),auth['isAuthenticated'](),controller[_0xe13a('0x14')]);module[_0xe13a('0x15')]=router;
\ No newline at end of file
+var _0xaf8c=['create','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe','show','post'];(function(_0x2d522c,_0x5b0a48){var _0x479989=function(_0x4d1219){while(--_0x4d1219){_0x2d522c['push'](_0x2d522c['shift']());}};_0x479989(++_0x5b0a48);}(_0xaf8c,0x7d));var _0xcaf8=function(_0x1b16a5,_0x44e77b){_0x1b16a5=_0x1b16a5-0x0;var _0x2fa5c4=_0xaf8c[_0x1b16a5];return _0x2fa5c4;};'use strict';var multer=require(_0xcaf8('0x0'));var util=require('util');var path=require(_0xcaf8('0x1'));var timeout=require(_0xcaf8('0x2'));var express=require(_0xcaf8('0x3'));var router=express[_0xcaf8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcaf8('0x5'));var interaction=require(_0xcaf8('0x6'));var config=require(_0xcaf8('0x7'));var controller=require(_0xcaf8('0x8'));router[_0xcaf8('0x9')]('/',auth[_0xcaf8('0xa')](),controller[_0xcaf8('0xb')]);router[_0xcaf8('0x9')]('/describe',auth[_0xcaf8('0xa')](),controller[_0xcaf8('0xc')]);router[_0xcaf8('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xcaf8('0xd')]);router[_0xcaf8('0xe')]('/',auth[_0xcaf8('0xa')](),controller[_0xcaf8('0xf')]);router['put'](_0xcaf8('0x10'),auth[_0xcaf8('0xa')](),controller[_0xcaf8('0x11')]);router[_0xcaf8('0x12')](_0xcaf8('0x10'),auth[_0xcaf8('0xa')](),controller[_0xcaf8('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 128516b..6dc85fc 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_0x9bde,0xe1));var _0xe9bd=function(_0xf4fba3,_0x1ad582){_0xf4fba3=_0xf4fba3-0x0;var _0x562c20=_0x9bde[_0xf4fba3];return _0x562c20;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
+var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x2fa2d6,_0x5d7dc8){var _0x3eb8ab=function(_0x23081f){while(--_0x23081f){_0x2fa2d6['push'](_0x2fa2d6['shift']());}};_0x3eb8ab(++_0x5d7dc8);}(_0x34e8,0x12c));var _0x834e=function(_0x382cac,_0x1b32a1){_0x382cac=_0x382cac-0x0;var _0x1cff24=_0x34e8[_0x382cac];return _0x1cff24;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 1f08cd3..dba22cd 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 _0xadf1=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','keys','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','querystring','papaparse'];(function(_0x5ef628,_0x471f3e){var _0x3dc35a=function(_0x25ccf9){while(--_0x25ccf9){_0x5ef628['push'](_0x5ef628['shift']());}};_0x3dc35a(++_0x471f3e);}(_0xadf1,0x7e));var _0x1adf=function(_0x12b0bb,_0x3108b0){_0x12b0bb=_0x12b0bb-0x0;var _0x45cf73=_0xadf1[_0x12b0bb];return _0x45cf73;};'use strict';var emlformat=require(_0x1adf('0x0'));var rimraf=require(_0x1adf('0x1'));var zipdir=require(_0x1adf('0x2'));var jsonpatch=require(_0x1adf('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1adf('0x4'));var Mustache=require(_0x1adf('0x5'));var util=require(_0x1adf('0x6'));var path=require(_0x1adf('0x7'));var sox=require('sox');var csv=require(_0x1adf('0x8'));var ejs=require(_0x1adf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1adf('0xa'));var crypto=require('crypto');var jsforce=require(_0x1adf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1adf('0x8'));var querystring=require(_0x1adf('0xc'));var Papa=require(_0x1adf('0xd'));var Redis=require('ioredis');var authService=require(_0x1adf('0xe'));var qs=require(_0x1adf('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1adf('0x10'));var logger=require(_0x1adf('0x11'))('api');var utils=require(_0x1adf('0x12'));var config=require(_0x1adf('0x13'));var licenseUtil=require(_0x1adf('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb40a3f,_0x157a11){_0x157a11=_0x157a11||0xcc;return function(_0xc0e180){if(_0xc0e180){return _0xb40a3f[_0x1adf('0x15')](_0x157a11);}return _0xb40a3f[_0x1adf('0x16')](_0x157a11)[_0x1adf('0x17')]();};}function respondWithResult(_0xa24a07,_0x5f574b){_0x5f574b=_0x5f574b||0xc8;return function(_0x548c01){if(_0x548c01){return _0xa24a07['status'](_0x5f574b)[_0x1adf('0x18')](_0x548c01);}};}function respondWithFilteredResult(_0xe52a30,_0x19b3da){return function(_0x71c053){if(_0x71c053){var _0x349295=typeof _0x19b3da[_0x1adf('0x19')]===_0x1adf('0x1a')&&typeof _0x19b3da[_0x1adf('0x1b')]===_0x1adf('0x1a');var _0x2de5ed=_0x71c053[_0x1adf('0x1c')];var _0x133a42=_0x349295?0x0:_0x19b3da['offset'];var _0x59677f=_0x349295?_0x71c053[_0x1adf('0x1c')]:_0x19b3da['offset']+_0x19b3da[_0x1adf('0x1b')];var _0x318d10;if(_0x59677f>=_0x2de5ed){_0x59677f=_0x2de5ed;_0x318d10=0xc8;}else{_0x318d10=0xce;}_0xe52a30[_0x1adf('0x16')](_0x318d10);return _0xe52a30[_0x1adf('0x1d')](_0x1adf('0x1e'),_0x133a42+'-'+_0x59677f+'/'+_0x2de5ed)['json'](_0x71c053);}return null;};}function patchUpdates(_0x37fdef){return function(_0x1d7433){try{jsonpatch['apply'](_0x1d7433,_0x37fdef,!![]);}catch(_0x311504){return BPromise[_0x1adf('0x1f')](_0x311504);}return _0x1d7433['save']();};}function saveUpdates(_0x318994,_0x1b6b04){return function(_0x21b8e2){if(_0x21b8e2){return _0x21b8e2[_0x1adf('0x20')](_0x318994)['then'](function(_0x51cee3){return _0x51cee3;});}return null;};}function removeEntity(_0x5e2e7c,_0x3c934b){return function(_0x506167){if(_0x506167){return _0x506167['destroy']()[_0x1adf('0x21')](function(){_0x5e2e7c[_0x1adf('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e8a1a,_0x541806){return function(_0xb6be63){if(!_0xb6be63){_0x3e8a1a[_0x1adf('0x15')](0x194);}return _0xb6be63;};}function handleError(_0x5e1ab5,_0x2c6d65){_0x2c6d65=_0x2c6d65||0x1f4;return function(_0x51e4b1){logger['error'](_0x51e4b1[_0x1adf('0x22')]);if(_0x51e4b1[_0x1adf('0x23')]){delete _0x51e4b1[_0x1adf('0x23')];}_0x5e1ab5[_0x1adf('0x16')](_0x2c6d65)[_0x1adf('0x24')](_0x51e4b1);};}exports[_0x1adf('0x25')]=function(_0x3869c9,_0x37d3d9){var _0x199415={},_0x1926f9={},_0x15b569={'count':0x0,'rows':[]};var _0x444b31=_[_0x1adf('0x26')](db[_0x1adf('0x27')][_0x1adf('0x28')],function(_0x103e47){return{'name':_0x103e47[_0x1adf('0x29')],'type':_0x103e47[_0x1adf('0x2a')][_0x1adf('0x2b')]};});_0x1926f9[_0x1adf('0x2c')]=_['map'](_0x444b31,_0x1adf('0x23'));_0x1926f9[_0x1adf('0x2d')]=_['keys'](_0x3869c9['query']);_0x1926f9[_0x1adf('0x2e')]=_[_0x1adf('0x2f')](_0x1926f9[_0x1adf('0x2c')],_0x1926f9[_0x1adf('0x2d')]);_0x199415[_0x1adf('0x30')]=_[_0x1adf('0x2f')](_0x1926f9[_0x1adf('0x2c')],qs[_0x1adf('0x31')](_0x3869c9[_0x1adf('0x2d')][_0x1adf('0x31')]));_0x199415[_0x1adf('0x30')]=_0x199415[_0x1adf('0x30')]['length']?_0x199415[_0x1adf('0x30')]:_0x1926f9[_0x1adf('0x2c')];if(!_0x3869c9[_0x1adf('0x2d')][_0x1adf('0x32')](_0x1adf('0x33'))){_0x199415[_0x1adf('0x1b')]=qs[_0x1adf('0x1b')](_0x3869c9[_0x1adf('0x2d')][_0x1adf('0x1b')]);_0x199415[_0x1adf('0x19')]=qs[_0x1adf('0x19')](_0x3869c9['query']['offset']);}_0x199415[_0x1adf('0x34')]=qs['sort'](_0x3869c9['query'][_0x1adf('0x35')]);_0x199415[_0x1adf('0x36')]=qs[_0x1adf('0x2e')](_['pick'](_0x3869c9[_0x1adf('0x2d')],_0x1926f9[_0x1adf('0x2e')]),_0x444b31);if(_0x3869c9['query']['filter']){_0x199415[_0x1adf('0x36')]=_[_0x1adf('0x37')](_0x199415[_0x1adf('0x36')],{'$or':_['map'](_0x444b31,function(_0x207779){if(_0x207779[_0x1adf('0x2a')]!==_0x1adf('0x38')){var _0x369556={};_0x369556[_0x207779[_0x1adf('0x23')]]={'$like':'%'+_0x3869c9[_0x1adf('0x2d')][_0x1adf('0x39')]+'%'};return _0x369556;}})});}_0x199415=_[_0x1adf('0x37')]({},_0x199415,_0x3869c9[_0x1adf('0x3a')]);var _0xe0e40={'where':_0x199415[_0x1adf('0x36')]};return db[_0x1adf('0x27')][_0x1adf('0x1c')](_0xe0e40)['then'](function(_0x5090ed){_0x15b569[_0x1adf('0x1c')]=_0x5090ed;if(_0x3869c9[_0x1adf('0x2d')][_0x1adf('0x3b')]){_0x199415[_0x1adf('0x3c')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x199415);})[_0x1adf('0x21')](function(_0x10d0a8){_0x15b569[_0x1adf('0x3d')]=_0x10d0a8;return _0x15b569;})[_0x1adf('0x21')](respondWithFilteredResult(_0x37d3d9,_0x199415))[_0x1adf('0x3e')](handleError(_0x37d3d9,null));};exports['show']=function(_0xf5032d,_0x278cb3){var _0x14b08a={'raw':!![],'where':{'id':_0xf5032d['params']['id']}},_0x32066e={};_0x32066e[_0x1adf('0x2c')]=_['keys'](db['ChatTransferReport'][_0x1adf('0x28')]);_0x32066e[_0x1adf('0x2d')]=_[_0x1adf('0x3f')](_0xf5032d[_0x1adf('0x2d')]);_0x32066e['filters']=_['intersection'](_0x32066e[_0x1adf('0x2c')],_0x32066e[_0x1adf('0x2d')]);_0x14b08a['attributes']=_[_0x1adf('0x2f')](_0x32066e[_0x1adf('0x2c')],qs[_0x1adf('0x31')](_0xf5032d[_0x1adf('0x2d')][_0x1adf('0x31')]));_0x14b08a[_0x1adf('0x30')]=_0x14b08a[_0x1adf('0x30')]['length']?_0x14b08a[_0x1adf('0x30')]:_0x32066e[_0x1adf('0x2c')];if(_0xf5032d[_0x1adf('0x2d')][_0x1adf('0x3b')]){_0x14b08a[_0x1adf('0x3c')]=[{'all':!![]}];}_0x14b08a=_[_0x1adf('0x37')]({},_0x14b08a,_0xf5032d['options']);return db[_0x1adf('0x27')][_0x1adf('0x40')](_0x14b08a)[_0x1adf('0x21')](handleEntityNotFound(_0x278cb3,null))[_0x1adf('0x21')](respondWithResult(_0x278cb3,null))[_0x1adf('0x3e')](handleError(_0x278cb3,null));};exports[_0x1adf('0x41')]=function(_0x5120c0,_0xa30f0a){return db[_0x1adf('0x27')][_0x1adf('0x41')](_0x5120c0['body'],{})['then'](respondWithResult(_0xa30f0a,0xc9))['catch'](handleError(_0xa30f0a,null));};exports[_0x1adf('0x20')]=function(_0x5850a0,_0x3fe2d9){if(_0x5850a0[_0x1adf('0x42')]['id']){delete _0x5850a0[_0x1adf('0x42')]['id'];}return db[_0x1adf('0x27')][_0x1adf('0x40')]({'where':{'id':_0x5850a0[_0x1adf('0x43')]['id']}})['then'](handleEntityNotFound(_0x3fe2d9,null))[_0x1adf('0x21')](saveUpdates(_0x5850a0[_0x1adf('0x42')],null))[_0x1adf('0x21')](respondWithResult(_0x3fe2d9,null))['catch'](handleError(_0x3fe2d9,null));};exports[_0x1adf('0x44')]=function(_0x398f21,_0x2049f7){return db[_0x1adf('0x27')][_0x1adf('0x40')]({'where':{'id':_0x398f21[_0x1adf('0x43')]['id']}})[_0x1adf('0x21')](handleEntityNotFound(_0x2049f7,null))['then'](removeEntity(_0x2049f7,null))[_0x1adf('0x3e')](handleError(_0x2049f7,null));};exports[_0x1adf('0x45')]=function(_0x4b11e0,_0x357f5b){return db['ChatTransferReport'][_0x1adf('0x45')]()[_0x1adf('0x21')](respondWithResult(_0x357f5b,null))[_0x1adf('0x3e')](handleError(_0x357f5b,null));};
\ No newline at end of file
+var _0x5121=['limit','set','Content-Range','apply','save','update','then','stack','name','send','index','ChatTransferReport','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','map','VIRTUAL','filter','merge','options','include','rows','show','params','keys','catch','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x5121,0x19d));var _0x1512=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x5121[_0x1da04e];return _0xdd8c41;};'use strict';var emlformat=require(_0x1512('0x0'));var rimraf=require(_0x1512('0x1'));var zipdir=require(_0x1512('0x2'));var jsonpatch=require(_0x1512('0x3'));var rp=require(_0x1512('0x4'));var moment=require('moment');var BPromise=require(_0x1512('0x5'));var Mustache=require(_0x1512('0x6'));var util=require('util');var path=require(_0x1512('0x7'));var sox=require('sox');var csv=require(_0x1512('0x8'));var ejs=require(_0x1512('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1512('0xa'));var crypto=require(_0x1512('0xb'));var jsforce=require(_0x1512('0xc'));var deskjs=require(_0x1512('0xd'));var toCsv=require(_0x1512('0x8'));var querystring=require('querystring');var Papa=require(_0x1512('0xe'));var Redis=require(_0x1512('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1512('0x10'));var as=require(_0x1512('0x11'));var hardwareService=require(_0x1512('0x12'));var logger=require(_0x1512('0x13'))(_0x1512('0x14'));var utils=require(_0x1512('0x15'));var config=require(_0x1512('0x16'));var licenseUtil=require(_0x1512('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5554bc,_0x3220e5){_0x3220e5=_0x3220e5||0xcc;return function(_0x4a6ae1){if(_0x4a6ae1){return _0x5554bc[_0x1512('0x18')](_0x3220e5);}return _0x5554bc[_0x1512('0x19')](_0x3220e5)[_0x1512('0x1a')]();};}function respondWithResult(_0x532b26,_0x52ef79){_0x52ef79=_0x52ef79||0xc8;return function(_0x2476fc){if(_0x2476fc){return _0x532b26[_0x1512('0x19')](_0x52ef79)[_0x1512('0x1b')](_0x2476fc);}};}function respondWithFilteredResult(_0x3efd6c,_0x1cdac9){return function(_0x41baf1){if(_0x41baf1){var _0x2e2421=typeof _0x1cdac9['offset']===_0x1512('0x1c')&&typeof _0x1cdac9['limit']==='undefined';var _0x1ad877=_0x41baf1[_0x1512('0x1d')];var _0x2bf1e4=_0x2e2421?0x0:_0x1cdac9['offset'];var _0x1c87b9=_0x2e2421?_0x41baf1[_0x1512('0x1d')]:_0x1cdac9[_0x1512('0x1e')]+_0x1cdac9[_0x1512('0x1f')];var _0x3866a7;if(_0x1c87b9>=_0x1ad877){_0x1c87b9=_0x1ad877;_0x3866a7=0xc8;}else{_0x3866a7=0xce;}_0x3efd6c[_0x1512('0x19')](_0x3866a7);return _0x3efd6c[_0x1512('0x20')](_0x1512('0x21'),_0x2bf1e4+'-'+_0x1c87b9+'/'+_0x1ad877)[_0x1512('0x1b')](_0x41baf1);}return null;};}function patchUpdates(_0x2b4aaf){return function(_0x10a986){try{jsonpatch[_0x1512('0x22')](_0x10a986,_0x2b4aaf,!![]);}catch(_0x3f23df){return BPromise['reject'](_0x3f23df);}return _0x10a986[_0x1512('0x23')]();};}function saveUpdates(_0x5301d8,_0x5e32b9){return function(_0x4ca4c9){if(_0x4ca4c9){return _0x4ca4c9[_0x1512('0x24')](_0x5301d8)[_0x1512('0x25')](function(_0x46e893){return _0x46e893;});}return null;};}function removeEntity(_0x5219bf,_0x36cab7){return function(_0x3d6e77){if(_0x3d6e77){return _0x3d6e77['destroy']()['then'](function(){_0x5219bf[_0x1512('0x19')](0xcc)[_0x1512('0x1a')]();});}};}function handleEntityNotFound(_0x2ea8bc,_0x44375d){return function(_0x4a220d){if(!_0x4a220d){_0x2ea8bc['sendStatus'](0x194);}return _0x4a220d;};}function handleError(_0x408871,_0x8caaee){_0x8caaee=_0x8caaee||0x1f4;return function(_0x43aaa6){logger['error'](_0x43aaa6[_0x1512('0x26')]);if(_0x43aaa6[_0x1512('0x27')]){delete _0x43aaa6['name'];}_0x408871[_0x1512('0x19')](_0x8caaee)[_0x1512('0x28')](_0x43aaa6);};}exports[_0x1512('0x29')]=function(_0x154d2c,_0x314e1e){var _0x1fd602={},_0xa61ff5={},_0x23a67b={'count':0x0,'rows':[]};var _0x2ce902=_['map'](db[_0x1512('0x2a')]['rawAttributes'],function(_0x1e43a9){return{'name':_0x1e43a9[_0x1512('0x2b')],'type':_0x1e43a9[_0x1512('0x2c')][_0x1512('0x2d')]};});_0xa61ff5[_0x1512('0x2e')]=_['map'](_0x2ce902,_0x1512('0x27'));_0xa61ff5[_0x1512('0x2f')]=_['keys'](_0x154d2c['query']);_0xa61ff5['filters']=_[_0x1512('0x30')](_0xa61ff5[_0x1512('0x2e')],_0xa61ff5[_0x1512('0x2f')]);_0x1fd602[_0x1512('0x31')]=_['intersection'](_0xa61ff5[_0x1512('0x2e')],qs[_0x1512('0x32')](_0x154d2c[_0x1512('0x2f')][_0x1512('0x32')]));_0x1fd602['attributes']=_0x1fd602[_0x1512('0x31')][_0x1512('0x33')]?_0x1fd602[_0x1512('0x31')]:_0xa61ff5['model'];if(!_0x154d2c[_0x1512('0x2f')][_0x1512('0x34')]('nolimit')){_0x1fd602['limit']=qs[_0x1512('0x1f')](_0x154d2c[_0x1512('0x2f')][_0x1512('0x1f')]);_0x1fd602['offset']=qs[_0x1512('0x1e')](_0x154d2c[_0x1512('0x2f')][_0x1512('0x1e')]);}_0x1fd602[_0x1512('0x35')]=qs['sort'](_0x154d2c[_0x1512('0x2f')][_0x1512('0x36')]);_0x1fd602[_0x1512('0x37')]=qs[_0x1512('0x38')](_[_0x1512('0x39')](_0x154d2c['query'],_0xa61ff5[_0x1512('0x38')]),_0x2ce902);if(_0x154d2c['query']['filter']){_0x1fd602[_0x1512('0x37')]=_['merge'](_0x1fd602[_0x1512('0x37')],{'$or':_[_0x1512('0x3a')](_0x2ce902,function(_0x88e82e){if(_0x88e82e[_0x1512('0x2c')]!==_0x1512('0x3b')){var _0x79f40f={};_0x79f40f[_0x88e82e[_0x1512('0x27')]]={'$like':'%'+_0x154d2c[_0x1512('0x2f')][_0x1512('0x3c')]+'%'};return _0x79f40f;}})});}_0x1fd602=_[_0x1512('0x3d')]({},_0x1fd602,_0x154d2c[_0x1512('0x3e')]);var _0x50c31c={'where':_0x1fd602[_0x1512('0x37')]};return db['ChatTransferReport'][_0x1512('0x1d')](_0x50c31c)[_0x1512('0x25')](function(_0x16c9d7){_0x23a67b['count']=_0x16c9d7;if(_0x154d2c[_0x1512('0x2f')]['includeAll']){_0x1fd602[_0x1512('0x3f')]=[{'all':!![]}];}return db[_0x1512('0x2a')]['findAll'](_0x1fd602);})[_0x1512('0x25')](function(_0x49d981){_0x23a67b[_0x1512('0x40')]=_0x49d981;return _0x23a67b;})[_0x1512('0x25')](respondWithFilteredResult(_0x314e1e,_0x1fd602))['catch'](handleError(_0x314e1e,null));};exports[_0x1512('0x41')]=function(_0x9ba335,_0x10162e){var _0x4d6356={'raw':!![],'where':{'id':_0x9ba335[_0x1512('0x42')]['id']}},_0x19589b={};_0x19589b['model']=_[_0x1512('0x43')](db[_0x1512('0x2a')]['rawAttributes']);_0x19589b['query']=_['keys'](_0x9ba335[_0x1512('0x2f')]);_0x19589b[_0x1512('0x38')]=_[_0x1512('0x30')](_0x19589b['model'],_0x19589b[_0x1512('0x2f')]);_0x4d6356[_0x1512('0x31')]=_[_0x1512('0x30')](_0x19589b[_0x1512('0x2e')],qs[_0x1512('0x32')](_0x9ba335[_0x1512('0x2f')][_0x1512('0x32')]));_0x4d6356[_0x1512('0x31')]=_0x4d6356[_0x1512('0x31')][_0x1512('0x33')]?_0x4d6356[_0x1512('0x31')]:_0x19589b[_0x1512('0x2e')];if(_0x9ba335[_0x1512('0x2f')]['includeAll']){_0x4d6356[_0x1512('0x3f')]=[{'all':!![]}];}_0x4d6356=_[_0x1512('0x3d')]({},_0x4d6356,_0x9ba335['options']);return db[_0x1512('0x2a')]['find'](_0x4d6356)[_0x1512('0x25')](handleEntityNotFound(_0x10162e,null))[_0x1512('0x25')](respondWithResult(_0x10162e,null))[_0x1512('0x44')](handleError(_0x10162e,null));};exports[_0x1512('0x45')]=function(_0x3aedfb,_0x492f93){return db[_0x1512('0x2a')][_0x1512('0x45')](_0x3aedfb[_0x1512('0x46')],{})[_0x1512('0x25')](respondWithResult(_0x492f93,0xc9))[_0x1512('0x44')](handleError(_0x492f93,null));};exports[_0x1512('0x24')]=function(_0x592c4e,_0x5cf900){if(_0x592c4e[_0x1512('0x46')]['id']){delete _0x592c4e[_0x1512('0x46')]['id'];}return db[_0x1512('0x2a')][_0x1512('0x47')]({'where':{'id':_0x592c4e['params']['id']}})['then'](handleEntityNotFound(_0x5cf900,null))[_0x1512('0x25')](saveUpdates(_0x592c4e[_0x1512('0x46')],null))[_0x1512('0x25')](respondWithResult(_0x5cf900,null))[_0x1512('0x44')](handleError(_0x5cf900,null));};exports[_0x1512('0x48')]=function(_0x435bd0,_0x56c11e){return db[_0x1512('0x2a')][_0x1512('0x47')]({'where':{'id':_0x435bd0[_0x1512('0x42')]['id']}})[_0x1512('0x25')](handleEntityNotFound(_0x56c11e,null))['then'](removeEntity(_0x56c11e,null))[_0x1512('0x44')](handleError(_0x56c11e,null));};exports['describe']=function(_0x3a7c06,_0x23b4dd){return db[_0x1512('0x2a')][_0x1512('0x49')]()[_0x1512('0x25')](respondWithResult(_0x23b4dd,null))['catch'](handleError(_0x23b4dd,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 255c5f7..f247b09 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 _0x3534=['../../config/environment','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x1974b4,_0x6429ed){var _0x48507e=function(_0x150f69){while(--_0x150f69){_0x1974b4['push'](_0x1974b4['shift']());}};_0x48507e(++_0x6429ed);}(_0x3534,0x95));var _0x4353=function(_0x3549ee,_0x244421){_0x3549ee=_0x3549ee-0x0;var _0x122077=_0x3534[_0x3549ee];return _0x122077;};'use strict';var _=require(_0x4353('0x0'));var util=require(_0x4353('0x1'));var logger=require('../../config/logger')(_0x4353('0x2'));var moment=require(_0x4353('0x3'));var BPromise=require(_0x4353('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4353('0x5'));var rimraf=require(_0x4353('0x6'));var config=require(_0x4353('0x7'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x3a92e6,_0x3ea32e){return _0x3a92e6[_0x4353('0x8')](_0x4353('0x9'),attributes,{'tableName':_0x4353('0xa'),'paranoid':![],'indexes':[{'name':_0x4353('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x30ef=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x496d86,_0x2f5c02){var _0x515c72=function(_0x300fb2){while(--_0x300fb2){_0x496d86['push'](_0x496d86['shift']());}};_0x515c72(++_0x2f5c02);}(_0x30ef,0x10a));var _0xf30e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x30ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf30e('0x0'));var util=require(_0xf30e('0x1'));var logger=require(_0xf30e('0x2'))(_0xf30e('0x3'));var moment=require(_0xf30e('0x4'));var BPromise=require(_0xf30e('0x5'));var rp=require(_0xf30e('0x6'));var fs=require('fs');var path=require(_0xf30e('0x7'));var rimraf=require('rimraf');var config=require(_0xf30e('0x8'));var attributes=require('./chatTransferReport.attributes');module[_0xf30e('0x9')]=function(_0x29ec2e,_0x1d5b2b){return _0x29ec2e[_0xf30e('0xa')](_0xf30e('0xb'),attributes,{'tableName':_0xf30e('0xc'),'paranoid':![],'indexes':[{'name':_0xf30e('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index cd769c2..9e93c3a 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 _0x874f=['request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','info','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','ChatTransferReport,\x20%s,\x20%s'];(function(_0x30d1b5,_0x27ffb9){var _0x572855=function(_0x3f8181){while(--_0x3f8181){_0x30d1b5['push'](_0x30d1b5['shift']());}};_0x572855(++_0x27ffb9);}(_0x874f,0xc4));var _0xf874=function(_0x333798,_0x9f6561){_0x333798=_0x333798-0x0;var _0x389f4e=_0x874f[_0x333798];return _0x389f4e;};'use strict';var _=require('lodash');var util=require(_0xf874('0x0'));var moment=require(_0xf874('0x1'));var BPromise=require(_0xf874('0x2'));var rs=require(_0xf874('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf874('0x4'))['db'];var utils=require(_0xf874('0x5'));var logger=require(_0xf874('0x6'))(_0xf874('0x7'));var config=require(_0xf874('0x8'));var jayson=require(_0xf874('0x9'));var client=jayson[_0xf874('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e8d79,_0x402af,_0x3b7e10){return new BPromise(function(_0x5534ab,_0x1728d3){return client['request'](_0x4e8d79,_0x3b7e10)[_0xf874('0xb')](function(_0x22d30b){logger['info'](_0xf874('0xc'),_0x402af,_0xf874('0xd'));logger['debug'](_0xf874('0xe'),_0x402af,'request\x20sent',JSON['stringify'](_0x22d30b));if(_0x22d30b[_0xf874('0xf')]){if(_0x22d30b['error']['code']===0x1f4){logger[_0xf874('0xf')](_0xf874('0xc'),_0x402af,_0x22d30b[_0xf874('0xf')][_0xf874('0x10')]);return _0x1728d3(_0x22d30b['error'][_0xf874('0x10')]);}logger[_0xf874('0xf')](_0xf874('0xc'),_0x402af,_0x22d30b[_0xf874('0xf')][_0xf874('0x10')]);return _0x5534ab(_0x22d30b[_0xf874('0xf')][_0xf874('0x10')]);}else{logger[_0xf874('0x11')](_0xf874('0xc'),_0x402af,_0xf874('0xd'));_0x5534ab(_0x22d30b['result'][_0xf874('0x10')]);}})[_0xf874('0x12')](function(_0x191a4a){logger['error'](_0xf874('0xc'),_0x402af,_0x191a4a);_0x1728d3(_0x191a4a);});});}
\ No newline at end of file
+var _0xca08=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring'];(function(_0x2c5e54,_0x51cb03){var _0x484d8e=function(_0x1cb667){while(--_0x1cb667){_0x2c5e54['push'](_0x2c5e54['shift']());}};_0x484d8e(++_0x51cb03);}(_0xca08,0xc4));var _0x8ca0=function(_0x541f17,_0x8adfd1){_0x541f17=_0x541f17-0x0;var _0x4765f6=_0xca08[_0x541f17];return _0x4765f6;};'use strict';var _=require(_0x8ca0('0x0'));var util=require(_0x8ca0('0x1'));var moment=require('moment');var BPromise=require(_0x8ca0('0x2'));var rs=require(_0x8ca0('0x3'));var fs=require('fs');var Redis=require(_0x8ca0('0x4'));var db=require(_0x8ca0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8ca0('0x6'));var config=require(_0x8ca0('0x7'));var jayson=require(_0x8ca0('0x8'));var client=jayson[_0x8ca0('0x9')][_0x8ca0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cc0f9,_0xd770e7,_0x59eace){return new BPromise(function(_0x456e8d,_0x56e282){return client['request'](_0x3cc0f9,_0x59eace)[_0x8ca0('0xb')](function(_0x188d63){logger[_0x8ca0('0xc')](_0x8ca0('0xd'),_0xd770e7,_0x8ca0('0xe'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xd770e7,_0x8ca0('0xe'),JSON[_0x8ca0('0xf')](_0x188d63));if(_0x188d63['error']){if(_0x188d63[_0x8ca0('0x10')][_0x8ca0('0x11')]===0x1f4){logger[_0x8ca0('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0xd770e7,_0x188d63[_0x8ca0('0x10')]['message']);return _0x56e282(_0x188d63[_0x8ca0('0x10')][_0x8ca0('0x12')]);}logger['error'](_0x8ca0('0xd'),_0xd770e7,_0x188d63[_0x8ca0('0x10')][_0x8ca0('0x12')]);return _0x456e8d(_0x188d63[_0x8ca0('0x10')][_0x8ca0('0x12')]);}else{logger[_0x8ca0('0xc')](_0x8ca0('0xd'),_0xd770e7,'request\x20sent');_0x456e8d(_0x188d63['result'][_0x8ca0('0x12')]);}})[_0x8ca0('0x13')](function(_0x97e9ff){logger[_0x8ca0('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0xd770e7,_0x97e9ff);_0x56e282(_0x97e9ff);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 484275b..c237647 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 _0x705d=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x55bbd7,_0x1042ab){var _0x269df9=function(_0x225bb1){while(--_0x225bb1){_0x55bbd7['push'](_0x55bbd7['shift']());}};_0x269df9(++_0x1042ab);}(_0x705d,0x102));var _0xd705=function(_0x5ebdf5,_0x40118d){_0x5ebdf5=_0x5ebdf5-0x0;var _0x3c1a63=_0x705d[_0x5ebdf5];return _0x3c1a63;};'use strict';var multer=require(_0xd705('0x0'));var util=require(_0xd705('0x1'));var path=require(_0xd705('0x2'));var timeout=require(_0xd705('0x3'));var express=require(_0xd705('0x4'));var router=express[_0xd705('0x5')]();var fs_extra=require(_0xd705('0x6'));var auth=require(_0xd705('0x7'));var interaction=require(_0xd705('0x8'));var config=require('../../config/environment');var controller=require(_0xd705('0x9'));router[_0xd705('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd705('0xb'),auth[_0xd705('0xc')](),controller[_0xd705('0xd')]);router['get'](_0xd705('0xe'),auth[_0xd705('0xc')](),controller[_0xd705('0xf')]);router[_0xd705('0x10')]('/',auth['isAuthenticated'](),controller[_0xd705('0x11')]);router[_0xd705('0x12')](_0xd705('0xe'),auth[_0xd705('0xc')](),controller[_0xd705('0x13')]);router[_0xd705('0x14')](_0xd705('0xe'),auth[_0xd705('0xc')](),controller[_0xd705('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xf2ba=['destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf2ba,0x113));var _0xaf2b=function(_0x3b0f80,_0x1a666a){_0x3b0f80=_0x3b0f80-0x0;var _0x52d4bf=_0xf2ba[_0x3b0f80];return _0x52d4bf;};'use strict';var multer=require('multer');var util=require(_0xaf2b('0x0'));var path=require(_0xaf2b('0x1'));var timeout=require(_0xaf2b('0x2'));var express=require('express');var router=express[_0xaf2b('0x3')]();var fs_extra=require(_0xaf2b('0x4'));var auth=require(_0xaf2b('0x5'));var interaction=require(_0xaf2b('0x6'));var config=require(_0xaf2b('0x7'));var controller=require('./chatTransferReport.controller');router[_0xaf2b('0x8')]('/',auth[_0xaf2b('0x9')](),controller[_0xaf2b('0xa')]);router['get'](_0xaf2b('0xb'),auth[_0xaf2b('0x9')](),controller['describe']);router[_0xaf2b('0x8')](_0xaf2b('0xc'),auth[_0xaf2b('0x9')](),controller[_0xaf2b('0xd')]);router[_0xaf2b('0xe')]('/',auth['isAuthenticated'](),controller[_0xaf2b('0xf')]);router[_0xaf2b('0x10')](_0xaf2b('0xc'),auth[_0xaf2b('0x9')](),controller[_0xaf2b('0x11')]);router[_0xaf2b('0x12')](_0xaf2b('0xc'),auth[_0xaf2b('0x9')](),controller[_0xaf2b('0x13')]);module[_0xaf2b('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 2e28dce..6014693 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 _0x2e7b=['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}}','bottom_right','alternate','#fafafa','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','Agent','#011F6A','#ffffff','BOOLEAN','rounded','We\x20are\x20here!','Chat','Send','INTEGER','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','ENUM','thumb','stringify','input','name','text','email','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e7b,0x6a));var _0xb2e7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2e7b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb2e7('0x0'));var rs=require(_0xb2e7('0x1'));module[_0xb2e7('0x2')]={'name':{'type':Sequelize[_0xb2e7('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xb2e7('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0x4')},'customerAlias':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb2e7('0x3')],'allowNull':![],'defaultValue':_0xb2e7('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb2e7('0x3')],'allowNull':![],'defaultValue':_0xb2e7('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb2e7('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb2e7('0x3')]},'animation':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xb2e7('0x8'),'squared'),'defaultValue':_0xb2e7('0x8')},'header_online':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0x9')},'start_chat_button':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0xa')},'offline_chat_button':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0xb')},'header_offline':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb2e7('0xc')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb2e7('0xd')]},'closingQuestion':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0xe')},'formSubmitFailureMessage':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0xf')},'noteTitle':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0x10')},'placeholderMessage':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0x11')},'closingMessage':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0xb')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xb2e7('0x12')]('star',_0xb2e7('0x13')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xb2e7('0xc')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb2e7('0xd')],'defaultValue':function(){return JSON[_0xb2e7('0x14')]({'items':[{'type':_0xb2e7('0x15'),'variable':null,'config':{'placeholder':_0xb2e7('0x16'),'type':_0xb2e7('0x17'),'required':!![]},'props':{'title':_0xb2e7('0x16'),'helpText':''}},{'type':_0xb2e7('0x15'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xb2e7('0x18'),'type':_0xb2e7('0x18')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xb2e7('0x19'))?JSON[_0xb2e7('0x1a')](this[_0xb2e7('0x1b')](_0xb2e7('0x19'))):{};},'set':function(_0x4b9602){return this[_0xb2e7('0x1c')](_0xb2e7('0x19'),JSON['stringify'](_0x4b9602));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xb2e7('0x14')]({'items':[{'type':_0xb2e7('0x15'),'props':{'title':_0xb2e7('0x18'),'helpText':''},'config':{'required':!![],'placeholder':_0xb2e7('0x18'),'type':_0xb2e7('0x18')},'variable':null},{'type':_0xb2e7('0x1d'),'config':{'placeholder':_0xb2e7('0x1e')},'props':{'title':_0xb2e7('0x1e'),'helpText':_0xb2e7('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0xb2e7('0x1b')](_0xb2e7('0x20'))?JSON[_0xb2e7('0x1a')](this[_0xb2e7('0x1b')](_0xb2e7('0x20'))):{};},'set':function(_0x14eae3){return this[_0xb2e7('0x1c')](_0xb2e7('0x20'),JSON[_0xb2e7('0x14')](_0x14eae3));}},'token':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb2e7('0x3')]},'forwardOffline':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb2e7('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xb2e7('0x21')},'waitingMessage':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0x22')},'offlineMessageSubject':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0x23')},'enableUnmanagedNote':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb2e7('0x24')},'skipUnmanaged':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xb2e7('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xb2e7('0x3')]},'notificationTemplate':{'type':Sequelize[_0xb2e7('0xd')],'defaultValue':function(){return _0xb2e7('0x25');}},'notificationSound':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0x26')},'verticalAlignment':{'type':Sequelize[_0xb2e7('0xc')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':_0xb2e7('0x27')},'defaultTitle':{'type':Sequelize[_0xb2e7('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb2e7('0x3')],'allowNull':![],'defaultValue':_0xb2e7('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb2e7('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb2e7('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xb2e7('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb2e7('0xc')],'comment':_0xb2e7('0x29')},'mandatoryDisposition':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![],'comment':_0xb2e7('0x2a'),'set':function(_0x52cfff){if(!_0x52cfff)this[_0xb2e7('0x1c')](_0xb2e7('0x2b'),null);this['setDataValue'](_0xb2e7('0x2c'),_0x52cfff);}},'vidaooEscalation':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xb2e7('0x3')],'allowNull':![],'defaultValue':_0xb2e7('0x2d')},'vidaooNote':{'type':Sequelize[_0xb2e7('0x3')],'defaultValue':function(){return _0xb2e7('0x2e');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb2e7('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb2e7('0xd')]}};
\ No newline at end of file
+var _0x1db8=['Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','ENUM','star','thumb','TEXT','input','name','text','getDataValue','onlineForm','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','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:','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','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','email','Agent','#011F6A','BOOLEAN','squared','rounded','We\x20are\x20here!','Chat','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note'];(function(_0x5934ee,_0x23fa5f){var _0x10ea14=function(_0x46bbd5){while(--_0x46bbd5){_0x5934ee['push'](_0x5934ee['shift']());}};_0x10ea14(++_0x23fa5f);}(_0x1db8,0x177));var _0x81db=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x1db8[_0x1deb03];return _0x189fe7;};'use strict';var Sequelize=require(_0x81db('0x0'));var rs=require(_0x81db('0x1'));module[_0x81db('0x2')]={'name':{'type':Sequelize[_0x81db('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x4')},'mapKeyOffline':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x4')},'key':{'type':Sequelize[_0x81db('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x5')},'customerAlias':{'type':Sequelize[_0x81db('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x81db('0x3')],'allowNull':![],'defaultValue':_0x81db('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x81db('0x3')],'allowNull':![],'defaultValue':_0x81db('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x81db('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x81db('0x3')]},'animation':{'type':Sequelize[_0x81db('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0x81db('0x8')),'defaultValue':_0x81db('0x9')},'header_online':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x81db('0xb')},'offline_chat_button':{'type':Sequelize[_0x81db('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x81db('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x81db('0xc')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x81db('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x81db('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0x81db('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0xf')},'noteTitle':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x10')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x81db('0x11')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x81db('0x12')},'closingMessageButton':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x13')},'skipMessageButton':{'type':Sequelize[_0x81db('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x81db('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x81db('0x14')](_0x81db('0x15'),_0x81db('0x16')),'defaultValue':_0x81db('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x81db('0xc')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x81db('0x17')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x81db('0x18'),'variable':null,'config':{'placeholder':_0x81db('0x19'),'type':_0x81db('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x81db('0x18'),'props':{'title':_0x81db('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x81db('0x4'),'type':_0x81db('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x81db('0x1b')](_0x81db('0x1c'))?JSON['parse'](this[_0x81db('0x1b')](_0x81db('0x1c'))):{};},'set':function(_0x74fc17){return this[_0x81db('0x1d')](_0x81db('0x1c'),JSON[_0x81db('0x1e')](_0x74fc17));}},'offlineForm':{'type':Sequelize[_0x81db('0x17')],'defaultValue':function(){return JSON[_0x81db('0x1e')]({'items':[{'type':_0x81db('0x18'),'props':{'title':_0x81db('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x81db('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x81db('0x1f')},'props':{'title':_0x81db('0x1f'),'helpText':_0x81db('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x81db('0x1b')](_0x81db('0x21'))?JSON['parse'](this[_0x81db('0x1b')]('offlineForm')):{};},'set':function(_0x32ac13){return this['setDataValue'](_0x81db('0x21'),JSON[_0x81db('0x1e')](_0x32ac13));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x81db('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x81db('0x3')]},'forwardOffline':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x22')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x81db('0x23')},'offlineMessageBody':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x81db('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x81db('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x25')},'sendUnmanaged':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x13')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x81db('0x17')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x81db('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x81db('0x26');}},'notificationSound':{'type':Sequelize[_0x81db('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x81db('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x28')},'verticalAlignment':{'type':Sequelize[_0x81db('0xc')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x81db('0x3')],'defaultValue':_0x81db('0x29')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x81db('0xc')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x81db('0x3')],'allowNull':![],'defaultValue':_0x81db('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x81db('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x81db('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x81db('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x81db('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x81db('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![],'comment':_0x81db('0x2c'),'set':function(_0x264583){if(!_0x264583)this[_0x81db('0x1d')](_0x81db('0x2d'),null);this['setDataValue'](_0x81db('0x2e'),_0x264583);}},'vidaooEscalation':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x81db('0x3')]},'vidaooTopic':{'type':Sequelize[_0x81db('0x3')],'allowNull':![],'defaultValue':_0x81db('0x2f')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x81db('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x81db('0x17')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x81db('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x81db('0x17')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 96f921f..2b0828e 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 _0xcd7e=['unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','MailAccountId','toPairsIn','mapValues','subjectOffline','email','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','User','Owner','fullname','Tag','Tags','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','custom','License','increment','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','replace','alignment','verticalAlignment','color','backgroundColor','addApplications','sequelize','bulkCreate','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachment','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./chatWebsite.socket','register','jayson/promise','client','http','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','filename','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','user-agent-parser','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','orderBy','priority','asc','defaults','from','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s'];(function(_0x3ad129,_0x2d3342){var _0x143c9d=function(_0xaf7c4f){while(--_0xaf7c4f){_0x3ad129['push'](_0x3ad129['shift']());}};_0x143c9d(++_0x2d3342);}(_0xcd7e,0x83));var _0xecd7=function(_0x54c10d,_0x2f2251){_0x54c10d=_0x54c10d-0x0;var _0x1fa703=_0xcd7e[_0x54c10d];return _0x1fa703;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xecd7('0x0'));var jsonpatch=require(_0xecd7('0x1'));var rp=require(_0xecd7('0x2'));var moment=require(_0xecd7('0x3'));var BPromise=require(_0xecd7('0x4'));var Mustache=require(_0xecd7('0x5'));var util=require(_0xecd7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xecd7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xecd7('0x8'));var _=require(_0xecd7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xecd7('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xecd7('0x7'));var querystring=require(_0xecd7('0xb'));var Papa=require(_0xecd7('0xc'));var Redis=require(_0xecd7('0xd'));var authService=require(_0xecd7('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xecd7('0xf'));var hardwareService=require(_0xecd7('0x10'));var logger=require(_0xecd7('0x11'))('api');var utils=require(_0xecd7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xecd7('0x13'));var db=require(_0xecd7('0x14'))['db'];config[_0xecd7('0x15')]=_['defaults'](config[_0xecd7('0x15')],{'host':_0xecd7('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xecd7('0x15')]));require(_0xecd7('0x17'))[_0xecd7('0x18')](socket);var jayson=require(_0xecd7('0x19'));var client=jayson[_0xecd7('0x1a')][_0xecd7('0x1b')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0xecd7('0x1a')][_0xecd7('0x1b')]({'port':0x232b});var client9001=jayson['client'][_0xecd7('0x1b')]({'port':0x2329});function respondWithRpcPromise(_0x4fbfb8,_0x3f0f2a,_0x19bb9e,_0x554c55){return new BPromise(function(_0x38a0b8,_0x332035){var _0x5f4c70=_0x554c55||client;return _0x5f4c70['request'](_0x4fbfb8,_0x19bb9e)[_0xecd7('0x1c')](function(_0x27563f){logger['info'](_0xecd7('0x1d'),_0x3f0f2a,'request\x20sent');logger[_0xecd7('0x1e')](_0xecd7('0x1f'),_0x3f0f2a,_0xecd7('0x20'),JSON[_0xecd7('0x21')](_0x27563f));if(_0x27563f[_0xecd7('0x22')]){if(_0x27563f[_0xecd7('0x22')][_0xecd7('0x23')]===0x1f4){logger[_0xecd7('0x22')](_0xecd7('0x1d'),_0x3f0f2a,_0x27563f[_0xecd7('0x22')]['message']);return _0x332035(_0x27563f[_0xecd7('0x22')][_0xecd7('0x24')]);}logger[_0xecd7('0x22')](_0xecd7('0x1d'),_0x3f0f2a,_0x27563f[_0xecd7('0x22')][_0xecd7('0x24')]);return _0x38a0b8(_0x27563f[_0xecd7('0x22')]['message']);}else{logger['info'](_0xecd7('0x1d'),_0x3f0f2a,_0xecd7('0x20'));_0x38a0b8(_0x27563f[_0xecd7('0x25')][_0xecd7('0x24')]);}})['catch'](function(_0x575115){logger[_0xecd7('0x22')](_0xecd7('0x1d'),_0x3f0f2a,_0x575115);_0x332035(_0x575115);});});}function respondWithStatusCode(_0x5231cc,_0x598a26){_0x598a26=_0x598a26||0xcc;return function(_0x37a531){if(_0x37a531){return _0x5231cc[_0xecd7('0x26')](_0x598a26);}return _0x5231cc[_0xecd7('0x27')](_0x598a26)[_0xecd7('0x28')]();};}function respondWithResult(_0x1ced94,_0xcfd0aa){_0xcfd0aa=_0xcfd0aa||0xc8;return function(_0x9104fb){if(_0x9104fb){return _0x1ced94[_0xecd7('0x27')](_0xcfd0aa)[_0xecd7('0x29')](_0x9104fb);}};}function respondWithFilteredResult(_0x3eaa9a,_0x1ef9fb){return function(_0x2e4582){if(_0x2e4582){var _0x2e28e1=typeof _0x1ef9fb[_0xecd7('0x2a')]==='undefined'&&typeof _0x1ef9fb[_0xecd7('0x2b')]===_0xecd7('0x2c');var _0x102f7b=_0x2e4582['count'];var _0x1a0bc2=_0x2e28e1?0x0:_0x1ef9fb[_0xecd7('0x2a')];var _0x3d19a2=_0x2e28e1?_0x2e4582[_0xecd7('0x2d')]:_0x1ef9fb[_0xecd7('0x2a')]+_0x1ef9fb['limit'];var _0x973802;if(_0x3d19a2>=_0x102f7b){_0x3d19a2=_0x102f7b;_0x973802=0xc8;}else{_0x973802=0xce;}_0x3eaa9a['status'](_0x973802);return _0x3eaa9a[_0xecd7('0x2e')](_0xecd7('0x2f'),_0x1a0bc2+'-'+_0x3d19a2+'/'+_0x102f7b)[_0xecd7('0x29')](_0x2e4582);}return null;};}function patchUpdates(_0x1f0795){return function(_0x2b456c){try{jsonpatch[_0xecd7('0x30')](_0x2b456c,_0x1f0795,!![]);}catch(_0x45da92){return BPromise[_0xecd7('0x31')](_0x45da92);}return _0x2b456c[_0xecd7('0x32')]();};}function saveUpdates(_0x33c985,_0x58f433){return function(_0x1f94a5){if(_0x1f94a5){return _0x1f94a5[_0xecd7('0x33')](_0x33c985)[_0xecd7('0x1c')](function(_0x9f42df){return _0x9f42df;});}return null;};}function removeEntity(_0x5bb352,_0x1ff2c8){return function(_0x330028){if(_0x330028){return _0x330028[_0xecd7('0x34')]()['then'](function(){var _0xb0f823=_0x330028[_0xecd7('0x35')]({'plain':!![]});var _0x1da4c9=_0xecd7('0x36');return db[_0xecd7('0x37')][_0xecd7('0x34')]({'where':{'type':_0x1da4c9,'resourceId':_0xb0f823['id']}})['then'](function(){return _0x330028;});})[_0xecd7('0x1c')](function(){_0x5bb352[_0xecd7('0x27')](0xcc)[_0xecd7('0x28')]();});}};}function handleEntityNotFound(_0x5e9e75,_0x5add50){return function(_0x271249){if(!_0x271249){_0x5e9e75[_0xecd7('0x26')](0x194);}return _0x271249;};}function handleError(_0x2dd507,_0x27183c){_0x27183c=_0x27183c||0x1f4;return function(_0x1e87ea){logger[_0xecd7('0x22')](_0x1e87ea[_0xecd7('0x38')]);if(_0x1e87ea['name']){delete _0x1e87ea[_0xecd7('0x39')];}_0x2dd507[_0xecd7('0x27')](_0x27183c)[_0xecd7('0x3a')](_0x1e87ea);};}exports[_0xecd7('0x3b')]=function(_0x35a243,_0x4698e4){var _0x390012={'include':[{'model':db[_0xecd7('0x3c')],'as':_0xecd7('0x3d')}]},_0x46216a={},_0x20d69f={'count':0x0,'rows':[]};var _0x1bd673=_[_0xecd7('0x3e')](db[_0xecd7('0x3f')][_0xecd7('0x40')],function(_0x5f28f5){return{'name':_0x5f28f5[_0xecd7('0x41')],'type':_0x5f28f5[_0xecd7('0x42')][_0xecd7('0x43')]};});_0x46216a[_0xecd7('0x44')]=_[_0xecd7('0x3e')](_0x1bd673,_0xecd7('0x39'));_0x46216a['query']=_[_0xecd7('0x45')](_0x35a243[_0xecd7('0x46')]);_0x46216a[_0xecd7('0x47')]=_['intersection'](_0x46216a[_0xecd7('0x44')],_0x46216a[_0xecd7('0x46')]);_0x390012[_0xecd7('0x48')]=_['intersection'](_0x46216a[_0xecd7('0x44')],qs[_0xecd7('0x49')](_0x35a243[_0xecd7('0x46')]['fields']));_0x390012[_0xecd7('0x48')]=_0x390012[_0xecd7('0x48')][_0xecd7('0x4a')]?_0x390012['attributes']:_0x46216a[_0xecd7('0x44')];if(!_0x35a243[_0xecd7('0x46')][_0xecd7('0x4b')](_0xecd7('0x4c'))){_0x390012['limit']=qs['limit'](_0x35a243[_0xecd7('0x46')]['limit']);_0x390012[_0xecd7('0x2a')]=qs['offset'](_0x35a243['query'][_0xecd7('0x2a')]);}_0x390012[_0xecd7('0x4d')]=qs[_0xecd7('0x4e')](_0x35a243[_0xecd7('0x46')][_0xecd7('0x4e')]);_0x390012['where']=qs[_0xecd7('0x47')](_[_0xecd7('0x4f')](_0x35a243['query'],_0x46216a['filters']),_0x1bd673);if(_0x35a243[_0xecd7('0x46')][_0xecd7('0x50')]){_0x390012[_0xecd7('0x51')]=_[_0xecd7('0x52')](_0x390012['where'],{'$or':_['map'](_0x1bd673,function(_0x358762){if(_0x358762[_0xecd7('0x42')]!==_0xecd7('0x53')){var _0x1d33a5={};_0x1d33a5[_0x358762[_0xecd7('0x39')]]={'$like':'%'+_0x35a243[_0xecd7('0x46')][_0xecd7('0x50')]+'%'};return _0x1d33a5;}})});}_0x390012=_['merge']({},_0x390012,_0x35a243[_0xecd7('0x54')]);var _0x18b8dd={'where':_0x390012['where']};return db[_0xecd7('0x3f')][_0xecd7('0x2d')](_0x18b8dd)[_0xecd7('0x1c')](function(_0x17516f){_0x20d69f[_0xecd7('0x2d')]=_0x17516f;if(_0x35a243[_0xecd7('0x46')][_0xecd7('0x55')]){_0x390012[_0xecd7('0x56')]=[{'all':!![]}];}return db[_0xecd7('0x3f')][_0xecd7('0x57')](_0x390012);})[_0xecd7('0x1c')](function(_0x5a0009){_0x20d69f[_0xecd7('0x58')]=_0x5a0009;return _0x20d69f;})[_0xecd7('0x1c')](respondWithFilteredResult(_0x4698e4,_0x390012))['catch'](handleError(_0x4698e4,null));};exports[_0xecd7('0x59')]=function(_0x7cc7ae,_0x237b5c){var _0x194b32={'raw':![],'where':{'id':_0x7cc7ae[_0xecd7('0x5a')]['id']},'include':[{'model':db[_0xecd7('0x3c')],'as':'mandatoryDispositionPause'}]},_0x21b034={};_0x21b034[_0xecd7('0x44')]=_[_0xecd7('0x45')](db['ChatWebsite']['rawAttributes']);_0x21b034['query']=_[_0xecd7('0x45')](_0x7cc7ae[_0xecd7('0x46')]);_0x21b034[_0xecd7('0x47')]=_[_0xecd7('0x5b')](_0x21b034[_0xecd7('0x44')],_0x21b034['query']);_0x194b32[_0xecd7('0x48')]=_[_0xecd7('0x5b')](_0x21b034[_0xecd7('0x44')],qs['fields'](_0x7cc7ae[_0xecd7('0x46')][_0xecd7('0x49')]));_0x194b32[_0xecd7('0x48')]=_0x194b32[_0xecd7('0x48')][_0xecd7('0x4a')]?_0x194b32[_0xecd7('0x48')]:_0x21b034['model'];if(_0x7cc7ae['query']['includeAll']){_0x194b32[_0xecd7('0x56')]=[{'all':!![]}];}_0x194b32=_['merge']({},_0x194b32,_0x7cc7ae[_0xecd7('0x54')]);return db[_0xecd7('0x3f')]['find'](_0x194b32)[_0xecd7('0x1c')](handleEntityNotFound(_0x237b5c,null))['then'](respondWithResult(_0x237b5c,null))[_0xecd7('0x5c')](handleError(_0x237b5c,null));};exports[_0xecd7('0x5d')]=function(_0xeb2ddf,_0x1e80e7){return db['ChatWebsite'][_0xecd7('0x5d')](_0xeb2ddf[_0xecd7('0x5e')],{})['then'](function(_0x643d1f){var _0xae2778=_0xeb2ddf[_0xecd7('0x5f')][_0xecd7('0x35')]({'plain':!![]});if(!_0xae2778)throw new Error(_0xecd7('0x60'));if(_0xae2778['role']==='user'){var _0x4312b1=_0x643d1f[_0xecd7('0x35')]({'plain':!![]});var _0x4a39d6=_0xecd7('0x36');return db[_0xecd7('0x61')][_0xecd7('0x62')]({'where':{'name':_0x4a39d6,'userProfileId':_0xae2778[_0xecd7('0x63')]},'raw':!![]})[_0xecd7('0x1c')](function(_0x5664ae){if(_0x5664ae&&_0x5664ae[_0xecd7('0x64')]===0x0){return db[_0xecd7('0x37')][_0xecd7('0x5d')]({'name':_0x4312b1[_0xecd7('0x39')],'resourceId':_0x4312b1['id'],'type':_0x5664ae['name'],'sectionId':_0x5664ae['id']},{})[_0xecd7('0x1c')](function(){return _0x643d1f;});}else{return _0x643d1f;}})[_0xecd7('0x5c')](function(_0x57d106){logger[_0xecd7('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57d106);throw _0x57d106;});}return _0x643d1f;})[_0xecd7('0x1c')](respondWithResult(_0x1e80e7,0xc9))[_0xecd7('0x5c')](handleError(_0x1e80e7,null));};exports['update']=function(_0x4e09ce,_0x53eb12){if(_0x4e09ce[_0xecd7('0x5e')]['id']){delete _0x4e09ce[_0xecd7('0x5e')]['id'];}return db['ChatWebsite'][_0xecd7('0x62')]({'where':{'id':_0x4e09ce[_0xecd7('0x5a')]['id']},'include':[{'model':db[_0xecd7('0x3c')],'as':_0xecd7('0x3d')}]})[_0xecd7('0x1c')](handleEntityNotFound(_0x53eb12,null))['then'](saveUpdates(_0x4e09ce[_0xecd7('0x5e')],null))['then'](respondWithResult(_0x53eb12,null))['catch'](handleError(_0x53eb12,null));};exports['destroy']=function(_0x2c937f,_0x3b9af5){return db['ChatWebsite']['find']({'where':{'id':_0x2c937f['params']['id']}})['then'](handleEntityNotFound(_0x3b9af5,null))[_0xecd7('0x1c')](removeEntity(_0x3b9af5,null))[_0xecd7('0x5c')](handleError(_0x3b9af5,null));};exports[_0xecd7('0x65')]=function(_0x3e2e8f,_0x1d0895){return db[_0xecd7('0x3f')]['describe']()[_0xecd7('0x1c')](respondWithResult(_0x1d0895,null))[_0xecd7('0x5c')](handleError(_0x1d0895,null));};exports[_0xecd7('0x66')]=function(_0xcd63d6,_0x5899f0,_0x47350d){if(_0xcd63d6[_0xecd7('0x5e')]['id']){delete _0xcd63d6['body']['id'];}return db[_0xecd7('0x3f')][_0xecd7('0x62')]({'where':{'id':_0xcd63d6[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x5899f0,null))[_0xecd7('0x1c')](function(_0x31ef81){if(_0x31ef81){_0xcd63d6[_0xecd7('0x5e')][_0xecd7('0x67')]=_0x31ef81['id'];return db['Disposition'][_0xecd7('0x5d')](_0xcd63d6[_0xecd7('0x5e')]);}})[_0xecd7('0x1c')](respondWithResult(_0x5899f0,null))[_0xecd7('0x5c')](handleError(_0x5899f0,null));};exports[_0xecd7('0x68')]=function(_0x5a4e19,_0x30a3c6,_0x4d291d){var _0x1642fe={'raw':![],'where':{}};var _0x1d1510={};var _0x43b844={'count':0x0,'rows':[]};return db[_0xecd7('0x3f')][_0xecd7('0x69')]({'where':{'id':_0x5a4e19[_0xecd7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x30a3c6,null))[_0xecd7('0x1c')](function(_0x52f32b){if(_0x52f32b){_0x1d1510[_0xecd7('0x44')]=_[_0xecd7('0x45')](db[_0xecd7('0x6a')][_0xecd7('0x40')]);_0x1d1510[_0xecd7('0x46')]=_[_0xecd7('0x45')](_0x5a4e19[_0xecd7('0x46')]);_0x1d1510[_0xecd7('0x47')]=_[_0xecd7('0x5b')](_0x1d1510[_0xecd7('0x44')],_0x1d1510[_0xecd7('0x46')]);_0x1642fe['attributes']=_[_0xecd7('0x5b')](_0x1d1510[_0xecd7('0x44')],qs[_0xecd7('0x49')](_0x5a4e19['query'][_0xecd7('0x49')]));_0x1642fe[_0xecd7('0x48')]=_0x1642fe[_0xecd7('0x48')]['length']?_0x1642fe[_0xecd7('0x48')]:_0x1d1510[_0xecd7('0x44')];if(!_0x5a4e19['query'][_0xecd7('0x4b')](_0xecd7('0x4c'))){_0x1642fe[_0xecd7('0x2b')]=qs[_0xecd7('0x2b')](_0x5a4e19['query']['limit']);_0x1642fe[_0xecd7('0x2a')]=qs[_0xecd7('0x2a')](_0x5a4e19[_0xecd7('0x46')][_0xecd7('0x2a')]);}_0x1642fe[_0xecd7('0x4d')]=qs[_0xecd7('0x4e')](_0x5a4e19[_0xecd7('0x46')]['sort']);_0x1642fe[_0xecd7('0x51')]=qs['filters'](_[_0xecd7('0x4f')](_0x5a4e19[_0xecd7('0x46')],_0x1d1510[_0xecd7('0x47')]));_0x1642fe[_0xecd7('0x51')][_0xecd7('0x67')]=_0x52f32b['id'];if(_0x5a4e19['query'][_0xecd7('0x50')]){_0x1642fe[_0xecd7('0x51')]=_['merge'](_0x1642fe[_0xecd7('0x51')],{'$or':_[_0xecd7('0x3e')](_0x1642fe['attributes'],function(_0xc4d57e){var _0x31d945={};_0x31d945[_0xc4d57e]={'$like':'%'+_0x5a4e19[_0xecd7('0x46')]['filter']+'%'};return _0x31d945;})});}_0x1642fe=_[_0xecd7('0x52')]({},_0x1642fe,_0x5a4e19[_0xecd7('0x54')]);return db[_0xecd7('0x6a')]['count']({'where':_0x1642fe[_0xecd7('0x51')]})['then'](function(_0xb12c49){_0x43b844['count']=_0xb12c49;if(_0x5a4e19[_0xecd7('0x46')][_0xecd7('0x55')]){_0x1642fe[_0xecd7('0x56')]=[{'all':!![]}];}return db[_0xecd7('0x6a')][_0xecd7('0x57')](_0x1642fe);})[_0xecd7('0x1c')](function(_0x2b7a9b){_0x43b844[_0xecd7('0x58')]=_0x2b7a9b;return _0x43b844;});}})[_0xecd7('0x1c')](respondWithFilteredResult(_0x30a3c6,_0x1642fe))[_0xecd7('0x5c')](handleError(_0x30a3c6,null));};exports[_0xecd7('0x6b')]=function(_0x2dfe46,_0xf39385,_0x590ffd){return db[_0xecd7('0x3f')][_0xecd7('0x62')]({'where':{'id':_0x2dfe46[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0xf39385,null))[_0xecd7('0x1c')](function(_0x445d76){if(_0x445d76){return _0x445d76['removeDispositions'](_0x2dfe46[_0xecd7('0x46')][_0xecd7('0x6c')]);}})[_0xecd7('0x1c')](respondWithStatusCode(_0xf39385,null))[_0xecd7('0x5c')](handleError(_0xf39385,null));};exports['addAnswer']=function(_0xeeea32,_0x2c8eec,_0x3a0a2c){if(_0xeeea32['body']['id']){delete _0xeeea32['body']['id'];}return db[_0xecd7('0x3f')]['find']({'where':{'id':_0xeeea32[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x2c8eec,null))['then'](function(_0xfaec9){if(_0xfaec9){_0xeeea32[_0xecd7('0x5e')][_0xecd7('0x67')]=_0xfaec9['id'];return db[_0xecd7('0x6d')][_0xecd7('0x5d')](_0xeeea32[_0xecd7('0x5e')]);}})[_0xecd7('0x1c')](respondWithResult(_0x2c8eec,null))[_0xecd7('0x5c')](handleError(_0x2c8eec,null));};exports[_0xecd7('0x6e')]=function(_0x27ba7f,_0x16533b,_0x366b84){var _0x268dee={'raw':![],'where':{}};var _0x17724f={};var _0x4d28ec={'count':0x0,'rows':[]};return db[_0xecd7('0x3f')][_0xecd7('0x69')]({'where':{'id':_0x27ba7f[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x16533b,null))[_0xecd7('0x1c')](function(_0x6c3dcc){if(_0x6c3dcc){_0x17724f['model']=_[_0xecd7('0x45')](db[_0xecd7('0x6d')][_0xecd7('0x40')]);_0x17724f[_0xecd7('0x46')]=_[_0xecd7('0x45')](_0x27ba7f['query']);_0x17724f[_0xecd7('0x47')]=_[_0xecd7('0x5b')](_0x17724f[_0xecd7('0x44')],_0x17724f[_0xecd7('0x46')]);_0x268dee['attributes']=_[_0xecd7('0x5b')](_0x17724f[_0xecd7('0x44')],qs[_0xecd7('0x49')](_0x27ba7f['query']['fields']));_0x268dee['attributes']=_0x268dee[_0xecd7('0x48')][_0xecd7('0x4a')]?_0x268dee[_0xecd7('0x48')]:_0x17724f['model'];if(!_0x27ba7f[_0xecd7('0x46')][_0xecd7('0x4b')](_0xecd7('0x4c'))){_0x268dee[_0xecd7('0x2b')]=qs[_0xecd7('0x2b')](_0x27ba7f[_0xecd7('0x46')]['limit']);_0x268dee['offset']=qs[_0xecd7('0x2a')](_0x27ba7f[_0xecd7('0x46')]['offset']);}_0x268dee[_0xecd7('0x4d')]=qs[_0xecd7('0x4e')](_0x27ba7f['query']['sort']);_0x268dee['where']=qs[_0xecd7('0x47')](_[_0xecd7('0x4f')](_0x27ba7f[_0xecd7('0x46')],_0x17724f[_0xecd7('0x47')]));_0x268dee['where'][_0xecd7('0x67')]=_0x6c3dcc['id'];if(_0x27ba7f[_0xecd7('0x46')][_0xecd7('0x50')]){_0x268dee[_0xecd7('0x51')]=_[_0xecd7('0x52')](_0x268dee[_0xecd7('0x51')],{'$or':_[_0xecd7('0x3e')](_0x268dee[_0xecd7('0x48')],function(_0x19ce8b){var _0xac1951={};_0xac1951[_0x19ce8b]={'$like':'%'+_0x27ba7f['query'][_0xecd7('0x50')]+'%'};return _0xac1951;})});}_0x268dee=_[_0xecd7('0x52')]({},_0x268dee,_0x27ba7f[_0xecd7('0x54')]);return db['CannedAnswer']['count']({'where':_0x268dee['where']})[_0xecd7('0x1c')](function(_0x2315b7){_0x4d28ec[_0xecd7('0x2d')]=_0x2315b7;if(_0x27ba7f[_0xecd7('0x46')][_0xecd7('0x55')]){_0x268dee['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xecd7('0x57')](_0x268dee);})[_0xecd7('0x1c')](function(_0x1d569a){_0x4d28ec[_0xecd7('0x58')]=_0x1d569a;return _0x4d28ec;});}})['then'](respondWithFilteredResult(_0x16533b,_0x268dee))[_0xecd7('0x5c')](handleError(_0x16533b,null));};exports[_0xecd7('0x6f')]=function(_0x34f974,_0x1942e2,_0x1124d7){return db[_0xecd7('0x3f')]['find']({'where':{'id':_0x34f974['params']['id']}})['then'](handleEntityNotFound(_0x1942e2,null))[_0xecd7('0x1c')](function(_0x474842){if(_0x474842){return _0x474842[_0xecd7('0x6f')](_0x34f974[_0xecd7('0x46')][_0xecd7('0x6c')]);}})[_0xecd7('0x1c')](respondWithStatusCode(_0x1942e2,null))[_0xecd7('0x5c')](handleError(_0x1942e2,null));};exports[_0xecd7('0x70')]=function(_0x1f3ea2,_0x464c84,_0x590eeb){_0x1f3ea2[_0xecd7('0x5e')][_0xecd7('0x71')]=_0x1f3ea2['file']['filename'];return db[_0xecd7('0x3f')][_0xecd7('0x62')]({'where':{'id':_0x1f3ea2[_0xecd7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x464c84,null))[_0xecd7('0x1c')](saveUpdates(_0x1f3ea2['body'],null))[_0xecd7('0x1c')](respondWithResult(_0x464c84,null))[_0xecd7('0x5c')](handleError(_0x464c84,null));};exports[_0xecd7('0x72')]=function(_0xa5170e,_0x240667,_0x3bc9d9){_0xa5170e[_0xecd7('0x5e')][_0xecd7('0x73')]=_0xa5170e[_0xecd7('0x74')][_0xecd7('0x75')];return db[_0xecd7('0x3f')][_0xecd7('0x62')]({'where':{'id':_0xa5170e[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x240667,null))[_0xecd7('0x1c')](saveUpdates(_0xa5170e[_0xecd7('0x5e')],null))['then'](respondWithResult(_0x240667,null))['catch'](handleError(_0x240667,null));};exports['addCustomerAvatar']=function(_0x549e1b,_0x561173,_0x6cac42){_0x549e1b[_0xecd7('0x5e')][_0xecd7('0x76')]=_0x549e1b[_0xecd7('0x74')][_0xecd7('0x75')];return db[_0xecd7('0x3f')][_0xecd7('0x62')]({'where':{'id':_0x549e1b['params']['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x561173,null))[_0xecd7('0x1c')](saveUpdates(_0x549e1b[_0xecd7('0x5e')],null))[_0xecd7('0x1c')](respondWithResult(_0x561173,null))['catch'](handleError(_0x561173,null));};exports[_0xecd7('0x77')]=function(_0x2378cc,_0x1f7bd4,_0x3614b3){_0x2378cc[_0xecd7('0x5e')][_0xecd7('0x78')]=_0x2378cc['file']['filename'];return db['ChatWebsite'][_0xecd7('0x62')]({'where':{'id':_0x2378cc[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x1f7bd4,null))[_0xecd7('0x1c')](saveUpdates(_0x2378cc['body'],null))[_0xecd7('0x1c')](respondWithResult(_0x1f7bd4,null))[_0xecd7('0x5c')](handleError(_0x1f7bd4,null));};exports[_0xecd7('0x79')]=function(_0x36f398,_0x36e2d5,_0x4e5eee){var _0x378ba1=path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],_0xecd7('0x7c'));var _0x3368ab={'where':{'id':_0x36f398['params']['id']},'attributes':['id',_0xecd7('0x71')],'raw':!![]};var _0x712590=![];return require(_0xecd7('0x13'))['getLicense']()['then'](function(_0x525cf9){if(_0x525cf9){_0x712590=_0x525cf9['custom'];}})[_0xecd7('0x1c')](function(){return db[_0xecd7('0x3f')][_0xecd7('0x62')](_0x3368ab);})['then'](handleEntityNotFound(_0x36e2d5,null))['then'](function(_0x2d86f0){if(_0x2d86f0){if(!_[_0xecd7('0x7d')](_0x2d86f0[_0xecd7('0x71')])){if(fs[_0xecd7('0x7e')](path['join'](config[_0xecd7('0x7b')],_0xecd7('0x7f'),_0x2d86f0['sitepic']))&&_0x712590){_0x378ba1=path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],_0xecd7('0x7f'),_0x2d86f0[_0xecd7('0x71')]);}}return _0x36e2d5[_0xecd7('0x80')](_0x378ba1);}})[_0xecd7('0x5c')](handleError(_0x36e2d5,null));};exports[_0xecd7('0x81')]=function(_0x5905fe,_0x5295bc,_0x341fa0){var _0x412a6c=path['join'](config[_0xecd7('0x7b')],_0xecd7('0x82'));var _0x3720c5={'where':{'id':_0x5905fe['params']['id']},'attributes':['id',_0xecd7('0x73')],'raw':!![]};return db[_0xecd7('0x3f')]['find'](_0x3720c5)[_0xecd7('0x1c')](handleEntityNotFound(_0x5295bc,null))[_0xecd7('0x1c')](function(_0x58f21e){if(_0x58f21e){if(!_['isNil'](_0x58f21e['agentAvatar'])){if(fs[_0xecd7('0x7e')](path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],_0xecd7('0x83'),_0x58f21e[_0xecd7('0x73')]))){_0x412a6c=path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],_0xecd7('0x83'),_0x58f21e[_0xecd7('0x73')]);}}return _0x5295bc['download'](_0x412a6c);}})[_0xecd7('0x5c')](handleError(_0x5295bc,null));};exports['getCustomerAvatar']=function(_0x3b188e,_0x306cd9,_0xa94494){var _0xc0b3c4=path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],'server/files/images/avatars/customer_avatar.png');var _0x2a3b06={'where':{'id':_0x3b188e[_0xecd7('0x5a')]['id']},'attributes':['id',_0xecd7('0x76'),_0xecd7('0x84')],'raw':!![]};return db[_0xecd7('0x3f')][_0xecd7('0x62')](_0x2a3b06)['then'](handleEntityNotFound(_0x306cd9,null))['then'](function(_0x2116fd){if(_0x2116fd){if(!_['isNil'](_0x2116fd[_0xecd7('0x76')])){if(fs['existsSync'](path[_0xecd7('0x7a')](config['root'],_0xecd7('0x83'),_0x2116fd[_0xecd7('0x76')]))&&_0x2116fd['showCustomerAvatar']){_0xc0b3c4=path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],'server/files/images/avatars/',_0x2116fd[_0xecd7('0x76')]);}}return _0x306cd9[_0xecd7('0x80')](_0xc0b3c4);}})[_0xecd7('0x5c')](handleError(_0x306cd9,null));};exports[_0xecd7('0x85')]=function(_0x3e1f21,_0x5b1962,_0x55ef4e){var _0x52d6b4=path['join'](config[_0xecd7('0x7b')],'server/files/images/avatars/system_avatar.png');var _0x3b2dc0={'where':{'id':_0x3e1f21[_0xecd7('0x5a')]['id']},'attributes':['id',_0xecd7('0x78')],'raw':!![]};return db[_0xecd7('0x3f')][_0xecd7('0x62')](_0x3b2dc0)[_0xecd7('0x1c')](handleEntityNotFound(_0x5b1962,null))[_0xecd7('0x1c')](function(_0x516ae2){if(_0x516ae2){if(!_['isNil'](_0x516ae2[_0xecd7('0x78')])){if(fs['existsSync'](path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],'server/files/images/avatars/',_0x516ae2[_0xecd7('0x78')]))){_0x52d6b4=path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],_0xecd7('0x83'),_0x516ae2['systemAvatar']);}}return _0x5b1962[_0xecd7('0x80')](_0x52d6b4);}})[_0xecd7('0x5c')](handleError(_0x5b1962,null));};exports['notify']=function(_0x3ae8a0,_0x53eed2,_0x230b12){var _0x37b4d8=require(_0xecd7('0x86'));var _0xc1ca66=new _0x37b4d8();var _0x4641d8=_0xc1ca66['setUA'](_0x3ae8a0[_0xecd7('0x87')][_0xecd7('0x88')])[_0xecd7('0x89')]();var _0x7330d0={'body':_0x3ae8a0[_0xecd7('0x5e')],'channel':_0xecd7('0x8a')};var _0x5ab0d0=[];var _0x3f16ec=[];var _0x1f8bfa={};var _0x21a32d=![];return db[_0xecd7('0x8b')][_0xecd7('0x65')]()[_0xecd7('0x1c')](function(_0x50873b){if(!_0x50873b){throw new db[(_0xecd7('0x8c'))][(_0xecd7('0x8d'))]('no\x20available\x20attributes');}_0x5ab0d0=_[_0xecd7('0x8e')](_[_0xecd7('0x45')](_0x50873b),[_0xecd7('0x8f'),'updatedAt']);_0x3f16ec=_['difference'](_['keys'](_0x50873b),[_0xecd7('0x8f'),_0xecd7('0x90'),'CompanyId',_0xecd7('0x91')]);if(_0x3ae8a0[_0xecd7('0x5e')]['id']){delete _0x3ae8a0['body']['id'];}if(_[_0xecd7('0x7d')](_0x3ae8a0['body']['from'])){throw new db[(_0xecd7('0x8c'))][(_0xecd7('0x8d'))](_0xecd7('0x92'));}if(_['isNil'](_0x3ae8a0['body']['body'])||_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0x5e')]===''){throw new db['Sequelize'][(_0xecd7('0x8d'))](_0xecd7('0x93'));}if(_[_0xecd7('0x7d')](_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0x94')])){throw new db[(_0xecd7('0x8c'))][(_0xecd7('0x8d'))](_0xecd7('0x95')+_0x3f16ec);}if(!_[_0xecd7('0x96')](_0x3f16ec,_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0x94')])){throw new db[(_0xecd7('0x8c'))]['ValidationError'](_0xecd7('0x97')+_0x3f16ec);}_0x1f8bfa[_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0x94')]]=_0x3ae8a0['body']['from'];})['then'](function(){return db['ChatWebsite'][_0xecd7('0x62')]({'where':{'id':_0x3ae8a0[_0xecd7('0x5a')]['id']},'include':[{'model':db[_0xecd7('0x98')],'as':_0xecd7('0x99'),'include':[{'model':db[_0xecd7('0x8b')],'as':_0xecd7('0x9a'),'where':_0x1f8bfa,'limit':0x1,'order':[[_0xecd7('0x90'),_0xecd7('0x9b')]]}]},{'model':db[_0xecd7('0x9c')],'as':_0xecd7('0x9d')}]});})['then'](handleEntityNotFound(_0x53eed2,null))[_0xecd7('0x1c')](function(_0x54fb4e){if(_0x54fb4e&&_0x54fb4e[_0xecd7('0x99')]){_0x7330d0[_0xecd7('0x9e')]=_0x54fb4e;_0x7330d0[_0xecd7('0x9f')]=_0x54fb4e[_0xecd7('0x9d')];_0x7330d0['list']=_0x54fb4e[_0xecd7('0x99')];_0x7330d0[_0xecd7('0x9f')]=_[_0xecd7('0xa0')](_0x7330d0[_0xecd7('0x9f')],[_0xecd7('0xa1')],[_0xecd7('0xa2')]);if(_0x7330d0[_0xecd7('0x9e')][_0xecd7('0x9d')]){delete _0x7330d0[_0xecd7('0x9e')]['Applications'];}if(_0x7330d0[_0xecd7('0x9e')][_0xecd7('0x99')]&&_0x7330d0[_0xecd7('0x9e')][_0xecd7('0x99')][_0xecd7('0x9a')]['length']){return _0x7330d0[_0xecd7('0x9e')][_0xecd7('0x99')]['Contacts'][0x0];}var _0x18890f=_[_0xecd7('0xa3')](_0x3ae8a0[_0xecd7('0x5e')],{'firstName':_0x3ae8a0['body'][_0xecd7('0xa4')],'ListId':_0x54fb4e[_0xecd7('0x91')]});_0x18890f[_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0x94')]]=_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xa4')];return db['CmContact']['create'](_0x18890f,{'fields':_0x5ab0d0,'raw':!![]});}})[_0xecd7('0x1c')](handleEntityNotFound(_0x53eed2,null))['then'](function(_0x51e57a){_0x7330d0[_0xecd7('0xa5')]=_0x51e57a;var _0x526526=_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xa6')];if(_0x3ae8a0[_0xecd7('0x87')][_0xecd7('0xa7')]){_0x526526=_0x3ae8a0[_0xecd7('0x87')][_0xecd7('0xa7')];}else if(_0x3ae8a0['headers'][_0xecd7('0xa8')]){_0x526526=_[_0xecd7('0xa9')](_0x3ae8a0['headers'][_0xecd7('0xa8')]['split'](','));}if(_0x51e57a){var _0x2dc708={'ContactId':_0x51e57a['id'],'ChatWebsiteId':_0x3ae8a0['params']['id'],'from':(_0x51e57a[_0xecd7('0xaa')]||'')+'\x20'+(_0x51e57a[_0xecd7('0xab')]||''),'customerIp':_0x526526,'customerPort':_0x3ae8a0[_0xecd7('0x87')][_0xecd7('0xac')]?_0x3ae8a0['headers']['x-real-port']:null,'referer':_0x3ae8a0['body'][_0xecd7('0xad')],'browserName':_0x4641d8[_0xecd7('0xae')][_0xecd7('0x39')]&&_0x4641d8[_0xecd7('0xae')][_0xecd7('0xaf')]?util[_0xecd7('0xb0')](_0xecd7('0xb1'),_0x4641d8['browser'][_0xecd7('0x39')],_0x4641d8[_0xecd7('0xae')][_0xecd7('0xaf')]):_0xecd7('0xb2'),'browserVersion':_0x4641d8[_0xecd7('0xae')]['version']||'unknown','osName':util[_0xecd7('0xb0')](_0xecd7('0xb1'),_0x4641d8['os'][_0xecd7('0x39')],_0x4641d8['os'][_0xecd7('0xaf')]),'osVersion':_0x4641d8['os'][_0xecd7('0xaf')],'deviceModel':_0x4641d8[_0xecd7('0xb3')][_0xecd7('0x44')]&&_0x4641d8[_0xecd7('0xb3')][_0xecd7('0xb4')]?util[_0xecd7('0xb0')](_0xecd7('0xb5'),_0x4641d8['device']['model'],_0x4641d8['device'][_0xecd7('0xb4')],_0x4641d8[_0xecd7('0xb3')][_0xecd7('0x42')]):null,'deviceVendor':_0x4641d8['device'][_0xecd7('0xb4')],'deviceType':_0x4641d8[_0xecd7('0xb3')]['type'],'formData':JSON[_0xecd7('0x21')](_0x3ae8a0[_0xecd7('0x5e')])};var _0x5e6e06={'ChatWebsiteId':_0x3ae8a0[_0xecd7('0x5a')]['id'],'closed':![]};if(_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xb6')]){_0x5e6e06['threadId']=_0x3ae8a0['body'][_0xecd7('0xb6')];return db[_0xecd7('0xb7')][_0xecd7('0x62')]({'where':_0x5e6e06})['then'](function(_0x450f02){if(_0x450f02){return[_0x450f02,![]];}_0x2dc708['threadId']=_0x3ae8a0['body']['threadId'];_0x2dc708['externalUrl']=_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xb8')];return db['ChatInteraction'][_0xecd7('0x5d')](_0x2dc708)[_0xecd7('0x1c')](function(_0x30f58f){return[_0x30f58f,!![]];});});}_0x5e6e06[_0xecd7('0xb9')]=_0x51e57a['id'];if(_0x3ae8a0['body'][_0xecd7('0xba')]&&_0x3ae8a0[_0xecd7('0x5e')]['interaction']['id']){_0x5e6e06['id']=_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xba')]['id'];return db[_0xecd7('0xb7')][_0xecd7('0x62')]({'where':_0x5e6e06})[_0xecd7('0x1c')](function(_0x20f57d){if(_0x20f57d){return[_0x20f57d,![]];}return db[_0xecd7('0xb7')]['create'](_0x2dc708)['then'](function(_0x3c7a26){return[_0x3c7a26,!![]];});});}return db[_0xecd7('0xb7')]['create'](_0x2dc708)['then'](function(_0x38421a){return[_0x38421a,!![]];});}})['spread'](function(_0x2f7612,_0x46a9a7){if(_0x2f7612){_0x21a32d=_0x46a9a7;if(!_0x46a9a7){var _0x47df78={'from':(_0x7330d0[_0xecd7('0xa5')]['firstName']||'')+'\x20'+(_0x7330d0[_0xecd7('0xa5')][_0xecd7('0xab')]||'')};if(_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xb6')]&&_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xbb')]&&_0x3ae8a0['body'][_0xecd7('0xb6')]!=_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xbb')]){_0x47df78['threadId']=_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0xbb')];}return _0x2f7612[_0xecd7('0x33')](_0x47df78);}else{return _0x2f7612;}}})['then'](function(_0x32c356){_0x7330d0['interaction']=_0x32c356[_0xecd7('0x35')]({'plain':!![]});_0x7330d0[_0xecd7('0xba')][_0xecd7('0xbc')]=_0x21a32d;if(_0x7330d0[_0xecd7('0xba')]['created']){if(_0x7330d0[_0xecd7('0x9e')][_0xecd7('0xbd')]){_0x7330d0[_0xecd7('0x9f')][_0xecd7('0xbe')]({'id':0x0,'priority':_0x7330d0[_0xecd7('0x9f')][_0xecd7('0x4a')]+0x1,'app':_0xecd7('0xbf'),'appdata':_0xecd7('0xc0'),'interval':_0xecd7('0xc1')});}}return db[_0xecd7('0xc2')][_0xecd7('0x5d')]({'body':_0x3ae8a0[_0xecd7('0x5e')][_0xecd7('0x5e')],'ChatWebsiteId':_0x3ae8a0[_0xecd7('0x5a')]['id'],'ChatInteractionId':_0x32c356['id'],'direction':'in','ContactId':_0x7330d0['contact']['id'],'AttachmentId':_0x3ae8a0[_0xecd7('0x5e')]['AttachmentId']});})[_0xecd7('0x1c')](function(_0x164024){_0x7330d0[_0xecd7('0x24')]=_0x164024;if(_0x7330d0[_0xecd7('0xba')][_0xecd7('0xc3')]){return db['User'][_0xecd7('0x62')]({'attributes':['id',_0xecd7('0x39')],'where':{'id':_0x7330d0[_0xecd7('0xba')]['UserId']}})['then'](function(_0x2d3da6){if(_0x2d3da6){_0x7330d0['applications'][_0xecd7('0xc4')]({'id':0x0,'priority':0x0,'app':_0xecd7('0xc5'),'appdata':_0x2d3da6[_0xecd7('0x39')]+','+(_0x7330d0[_0xecd7('0x9e')][_0xecd7('0xc6')]||0xa),'interval':_0xecd7('0xc1')});_0x7330d0[_0xecd7('0xc7')]=!![];}return respondWithRpcPromise(_0xecd7('0xc8'),_0xecd7('0xc9'),_0x7330d0);});}return respondWithRpcPromise('Start',_0xecd7('0xc9'),_0x7330d0);})['then'](function(_0x501380){respondWithRpcPromise(_0xecd7('0xca'),_0xecd7('0xca'),{'event':_0xecd7('0xcb'),'message':_0x501380},client9002);return _0x501380;})[_0xecd7('0x1c')](respondWithResult(_0x53eed2,null))[_0xecd7('0x5c')](handleError(_0x53eed2,null));};exports[_0xecd7('0xcc')]=function(_0x1af351,_0xdbf81f,_0x2af219){var _0x25bb3e,_0x28561b,_0x3a737f;var _0x245a7c=[];var _0x3cbcc9=[];var _0x17d766={};var _0x30588d=_0x1af351[_0xecd7('0xcd')]||[];var _0x452fed=[];var _0x3a981b;return db['CmContact'][_0xecd7('0x65')]()[_0xecd7('0x1c')](function(_0x8d7b1b){if(!_0x8d7b1b){throw new db['Sequelize'][(_0xecd7('0x8d'))]('no\x20available\x20attributes');}_0x3cbcc9=_[_0xecd7('0x8e')](_[_0xecd7('0x45')](_0x8d7b1b),[_0xecd7('0x8f'),_0xecd7('0x90')]);_0x245a7c=_[_0xecd7('0x8e')](_[_0xecd7('0x45')](_0x8d7b1b),['createdAt','updatedAt',_0xecd7('0xce'),_0xecd7('0x91')]);if(_0x1af351[_0xecd7('0x5e')]['id']){delete _0x1af351[_0xecd7('0x5e')]['id'];}if(_[_0xecd7('0x7d')](_0x1af351[_0xecd7('0x5e')]['from'])){throw _0xdbf81f[_0xecd7('0x27')](0x1f4)[_0xecd7('0x3a')](new db[(_0xecd7('0x8c'))][(_0xecd7('0x8d'))](_0xecd7('0x92')));}if(_[_0xecd7('0x7d')](_0x1af351[_0xecd7('0x5e')]['body'])||_0x1af351[_0xecd7('0x5e')][_0xecd7('0x5e')]===''){throw _0xdbf81f[_0xecd7('0x27')](0x1f4)[_0xecd7('0x3a')](new db[(_0xecd7('0x8c'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xecd7('0x7d')](_0x1af351[_0xecd7('0x5e')][_0xecd7('0xcf')])){throw _0xdbf81f[_0xecd7('0x27')](0x1f4)['send'](new db[(_0xecd7('0x8c'))]['ValidationError'](_0xecd7('0xd0')+_0x245a7c));}if(!_[_0xecd7('0x96')](_0x245a7c,_0x1af351[_0xecd7('0x5e')][_0xecd7('0xcf')])){throw _0xdbf81f[_0xecd7('0x27')](0x1f4)[_0xecd7('0x3a')](new db[(_0xecd7('0x8c'))][(_0xecd7('0x8d'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x245a7c));}_0x17d766[_0x1af351[_0xecd7('0x5e')][_0xecd7('0xcf')]]=_0x1af351[_0xecd7('0x5e')][_0xecd7('0xa4')];})[_0xecd7('0x1c')](function(){return db[_0xecd7('0x3f')][_0xecd7('0x62')]({'where':{'id':_0x1af351[_0xecd7('0x5a')]['id']},'include':[{'model':db[_0xecd7('0x98')],'as':'List'},{'model':db[_0xecd7('0xd1')],'as':_0xecd7('0xd1')}]});})[_0xecd7('0x1c')](handleEntityNotFound(_0xdbf81f,null))[_0xecd7('0x1c')](function(_0x3894da){if(_0x3894da&&_0x3894da[_0xecd7('0x99')]){_0x28561b=_0x3894da;var _0x31498b=_[_0xecd7('0xa3')](_0x1af351[_0xecd7('0x5e')],{'firstName':_0x1af351[_0xecd7('0x5e')][_0xecd7('0xa4')],'phone':_0x1af351[_0xecd7('0x5e')]['from'],'ListId':_0x3894da[_0xecd7('0x91')]});_0x31498b[_0x1af351[_0xecd7('0x5e')][_0xecd7('0xcf')]]=_0x1af351[_0xecd7('0x5e')][_0xecd7('0xa4')];return db[_0xecd7('0x8b')][_0xecd7('0xd2')]({'where':_0x17d766,'defaults':_0x31498b});}})[_0xecd7('0xd3')](function(_0x2de328){if(_0x2de328){_0x3a737f=_0x2de328;var _0xb49cf9=fs['readFileSync'](path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],_0xecd7('0xd4')),_0xecd7('0xd5'));var _0x510921=ejs[_0xecd7('0xd6')](_0xb49cf9,{'body':_[_0xecd7('0xd7')](_0x1af351[_0xecd7('0x5e')]['body']),'bodyTitle':_0x28561b[_0xecd7('0xd8')]});return db[_0xecd7('0xd9')][_0xecd7('0x5d')]({'body':_0x510921,'ContactId':_0x2de328['id'],'ChatWebsiteId':_0x28561b['id']});}})[_0xecd7('0x1c')](function(_0x4fbb82){_0x3a981b=_0x4fbb82;if(_0x30588d[_0xecd7('0x4a')]){var _0x167bdd=_0x30588d[_0xecd7('0x3e')](function(_0x179ebc){return{'name':_0x179ebc[_0xecd7('0xda')],'basename':_0x179ebc[_0xecd7('0x75')],'type':_0x179ebc[_0xecd7('0xdb')],'ChatOfflineMessageId':_0x4fbb82['id']};});_0x452fed=_0x167bdd[_0xecd7('0x3e')](_0x46e6cf=>{var _0x531829={'filename':_0x46e6cf[_0xecd7('0x39')],'path':path['join'](config[_0xecd7('0x7b')],_0xecd7('0xdc'),'files',_0xecd7('0xdd'),_0xecd7('0xde'),_0x46e6cf[_0xecd7('0xdf')])};return _0x531829;});if(!_0x28561b[_0xecd7('0xe0')]){return db['sequelize'][_0xecd7('0xe1')](function(_0x430dc3){return db['Attachment']['bulkCreate'](_0x167bdd,{'transaction':_0x430dc3});});}}})[_0xecd7('0x1c')](function(){if(_0x3a981b){_0x25bb3e=_0x3a981b;return db[_0xecd7('0xd1')][_0xecd7('0x69')]({'where':{'active':!![]},'include':[{'model':db[_0xecd7('0xe2')],'as':_0xecd7('0xe3'),'raw':!![]}]});}})[_0xecd7('0x1c')](function(_0x7e608d){if(_0x7e608d&&_0x7e608d[_0xecd7('0xe3')]&&_0x28561b[_0xecd7('0xe4')]&&_0x28561b[_0xecd7('0xe5')]){var _0x132492={'tls':{'rejectUnauthorized':![]}};if(_0x7e608d[_0xecd7('0xe3')]['service']){_0x132492[_0xecd7('0xe6')]=_0x7e608d['Smtp'][_0xecd7('0xe6')];}else{_0x132492[_0xecd7('0xe7')]=_0x7e608d['Smtp'][_0xecd7('0xe7')];_0x132492[_0xecd7('0xe8')]=_0x7e608d[_0xecd7('0xe3')][_0xecd7('0xe8')];_0x132492['secure']=_0x7e608d[_0xecd7('0xe3')]['secure'];}if(_0x7e608d[_0xecd7('0xe3')]['authentication']){_0x132492['auth']={'user':_0x7e608d[_0xecd7('0xe3')][_0xecd7('0x5f')],'pass':_0x7e608d[_0xecd7('0xe3')][_0xecd7('0xe9')]};}return respondWithRpcPromise(_0xecd7('0xea'),_0xecd7('0xeb'),{'account':_0x132492,'message':{'from':util[_0xecd7('0xb0')](_0xecd7('0xec'),_0x7e608d[_0xecd7('0x39')],_0x7e608d['email']||_0x7e608d['Smtp'][_0xecd7('0x5f')]),'to':_0x28561b[_0xecd7('0xe5')],'subject':_0x28561b['offlineMessageSubject'],'html':_0x25bb3e['body'],'attachments':_0x452fed}},client9003)['then'](function(){return _0x25bb3e;})[_0xecd7('0x5c')](function(_0x506f17){console['error'](_0x506f17);});}})[_0xecd7('0x1c')](function(){if(_0x28561b&&_0x28561b[_0xecd7('0xe0')]&&_0x28561b[_0xecd7('0xed')]){var _0x1ab96b=[];if(_0x30588d[_0xecd7('0x4a')]){_0x1ab96b=_0x30588d[_0xecd7('0x3e')](function(_0x461b9a){return{'name':_0x461b9a[_0xecd7('0xda')],'basename':_0x461b9a[_0xecd7('0x75')],'type':_0x461b9a[_0xecd7('0xdb')],'ChatOfflineMessageId':_0x3a981b['id']};});}var _0x2224c5;if(!_[_0xecd7('0x7d')](_0x28561b['subjectOffline'])){var _0x5cc43a=_[_0xecd7('0x3e')](_0x1af351[_0xecd7('0x5e')],function(_0x3e0853){return _0x3e0853;});var _0x15f9b1=_[_0xecd7('0xee')](_0x5cc43a)[0x0];var _0x5921e4=_[_0xecd7('0xef')](_0x15f9b1,function(_0x4063fd){return _0x4063fd;});_0x2224c5=_0x5921e4[0x1][_0x28561b[_0xecd7('0xf0')]];}var _0xb97ba6={'from':_0x3a737f[_0xecd7('0xf1')],'firstName':_0x3a737f['firstName'],'lastName':_0x3a737f[_0xecd7('0xab')],'mapKey':_0xecd7('0xf1'),'message':{'from':_0x3a737f['email'],'to':_0x28561b['MailAccount']['email'],'cc':'','subject':_[_0xecd7('0x7d')](_0x2224c5)?_0x28561b['offlineMessageSubject']:_0x2224c5,'messageId':'','sentAt':new Date(),'attach':_0x1ab96b[_0xecd7('0x4a')],'attachments':_0x1ab96b,'originChannel':'Chat','ChatWebsiteId':_0x28561b['id'],'ChatOfflineMessageId':_0x25bb3e['id'],'originTo':_0x28561b[_0xecd7('0xd1')]['email']},'body':_0x25bb3e['body']};var _0x39fdc0={'account':{'id':_0x28561b[_0xecd7('0xed')]},'body':_0xb97ba6,'log':_0xecd7('0xf2')};return respondWithRpcPromise(_0xecd7('0xf2'),'notifyMail',_0x39fdc0,client9001)[_0xecd7('0x1c')](function(){return _0x25bb3e;})[_0xecd7('0x5c')](function(_0x289880){console[_0xecd7('0x22')](_0x289880);});}return;})[_0xecd7('0x1c')](function(){if(_0x25bb3e){return _0x25bb3e;}})[_0xecd7('0x1c')](respondWithResult(_0xdbf81f,null))[_0xecd7('0x5c')](function(_0x44ec2b){console[_0xecd7('0x22')](_0xecd7('0x5c'),_0x44ec2b);for(var _0x2ecd32 of _0x30588d){var _0x593049=path[_0xecd7('0x7a')](config[_0xecd7('0x7b')],_0xecd7('0xdc'),_0xecd7('0xcd'),_0xecd7('0xdd'),_0xecd7('0xde'),_0x2ecd32[_0xecd7('0x75')]);fs_extra[_0xecd7('0xf3')](_0x593049)[_0xecd7('0x5c')](function(_0x52c191){console['error'](_0xecd7('0xf4'),_0x593049,_0x52c191);});}});};exports[_0xecd7('0xf5')]=function(_0x3aeb42,_0x518817,_0x29ebea){return db[_0xecd7('0xb7')]['find']({'where':{'id':_0x3aeb42['params']['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x518817,null))[_0xecd7('0x1c')](function(_0x31cc6d){if(_0x31cc6d){return _0x31cc6d[_0xecd7('0xf5')](_0x3aeb42[_0xecd7('0x5e')]['ids'],_[_0xecd7('0xf6')](_0x3aeb42[_0xecd7('0x5e')],[_0xecd7('0x6c'),'id'])||{});}})[_0xecd7('0x1c')](respondWithResult(_0x518817,null))[_0xecd7('0x5c')](handleError(_0x518817,null));};exports[_0xecd7('0xf7')]=function(_0x500d68,_0x140ad7,_0x286226){var _0x37ca9b={'raw':![],'where':{}};var _0x22bd82={};var _0x5e29d0={'count':0x0,'rows':[]};return db[_0xecd7('0x3f')][_0xecd7('0x69')]({'where':{'id':_0x500d68[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x140ad7,null))['then'](function(_0x2af949){if(_0x2af949){_0x22bd82[_0xecd7('0x44')]=_[_0xecd7('0x45')](db[_0xecd7('0xb7')]['rawAttributes']);_0x22bd82[_0xecd7('0x46')]=_[_0xecd7('0x45')](_0x500d68[_0xecd7('0x46')]);_0x22bd82[_0xecd7('0x47')]=_[_0xecd7('0x5b')](_0x22bd82['model'],_0x22bd82[_0xecd7('0x46')]);_0x37ca9b[_0xecd7('0x48')]=_[_0xecd7('0x5b')](_0x22bd82[_0xecd7('0x44')],qs[_0xecd7('0x49')](_0x500d68[_0xecd7('0x46')][_0xecd7('0x49')]));_0x37ca9b[_0xecd7('0x48')]=_0x37ca9b['attributes']['length']?_0x37ca9b[_0xecd7('0x48')]:_0x22bd82['model'];if(!_0x500d68[_0xecd7('0x46')][_0xecd7('0x4b')](_0xecd7('0x4c'))){_0x37ca9b[_0xecd7('0x2b')]=qs[_0xecd7('0x2b')](_0x500d68['query']['limit']);_0x37ca9b['offset']=qs[_0xecd7('0x2a')](_0x500d68['query']['offset']);}_0x37ca9b[_0xecd7('0x4d')]=qs[_0xecd7('0x4e')](_0x500d68['query'][_0xecd7('0x4e')]);_0x37ca9b[_0xecd7('0x51')]=qs[_0xecd7('0x47')](_[_0xecd7('0x4f')](_0x500d68[_0xecd7('0x46')],_0x22bd82['filters']));_0x37ca9b[_0xecd7('0x51')][_0xecd7('0x67')]=_0x2af949['id'];if(_0x500d68[_0xecd7('0x46')]['filter']){_0x37ca9b[_0xecd7('0x51')]=_[_0xecd7('0x52')](_0x37ca9b[_0xecd7('0x51')],{'$or':_[_0xecd7('0x3e')](_0x37ca9b[_0xecd7('0x48')],function(_0x32b376){var _0x1f4175={};_0x1f4175[_0x32b376]={'$like':'%'+_0x500d68[_0xecd7('0x46')][_0xecd7('0x50')]+'%'};return _0x1f4175;})});}_0x37ca9b=_[_0xecd7('0x52')]({},_0x37ca9b,_0x500d68[_0xecd7('0x54')]);return db[_0xecd7('0xb7')][_0xecd7('0x2d')]({'where':_0x37ca9b['where']})['then'](function(_0x3ffd2b){_0x5e29d0[_0xecd7('0x2d')]=_0x3ffd2b;if(_0x500d68[_0xecd7('0x46')][_0xecd7('0x55')]){_0x37ca9b[_0xecd7('0x56')]=[{'model':db[_0xecd7('0x8b')],'as':'Contact','required':![]},{'model':db[_0xecd7('0xf8')],'as':_0xecd7('0xf9'),'attributes':[_0xecd7('0x39'),_0xecd7('0xfa'),'internal'],'required':![]},{'model':db[_0xecd7('0xfb')],'as':_0xecd7('0xfc'),'attributes':['id','name','color'],'where':_0x500d68[_0xecd7('0x46')][_0xecd7('0xfd')]?{'id':_0x500d68['query']['tag']}:undefined,'required':_0x500d68['query'][_0xecd7('0xfd')]?!![]:![]}];}return db[_0xecd7('0xb7')][_0xecd7('0x57')](_0x37ca9b);})[_0xecd7('0x1c')](function(_0x29ee18){_0x5e29d0[_0xecd7('0x58')]=_0x29ee18;return _0x5e29d0;});}})[_0xecd7('0x1c')](respondWithFilteredResult(_0x140ad7,_0x37ca9b))[_0xecd7('0x5c')](handleError(_0x140ad7,null));};function iftimePromise(_0x2eae70,_0x5becdd){return respondWithRpcPromise(_0xecd7('0xfe'),'getSnippet',{'command':_0x5becdd[_0xecd7('0xff')]?util['format'](_0xecd7('0x100'),_0x2eae70[_0xecd7('0x101')],_0x5becdd['timezone']):util[_0xecd7('0xb0')](_0xecd7('0x102'),_0x2eae70[_0xecd7('0x101')])},client9002)[_0xecd7('0x1c')](function(_0x253523){var _0x41efb4=_0x253523&&_0x253523[_0xecd7('0x103')](_0xecd7('0x104'))>=0x0?!![]:![];logger[_0xecd7('0x105')](_0xecd7('0x106'),_0x5becdd['id'],_0x2eae70['id'],_0x2eae70['interval'],_0x41efb4?_0xecd7('0x107'):_0xecd7('0x108'),_0x5becdd[_0xecd7('0xff')]?_0x5becdd[_0xecd7('0xff')]:_0xecd7('0x109'));return _0x41efb4;})[_0xecd7('0x5c')](function(_0x7a9f19){logger['error'](_0xecd7('0x106'),_0x5becdd['id'],_0x2eae70['id'],_0x2eae70[_0xecd7('0x101')],util[_0xecd7('0x10a')](_0x7a9f19,{'showHidden':![],'depth':null}),_0x5becdd[_0xecd7('0xff')]?_0x5becdd[_0xecd7('0xff')]:_0xecd7('0x109'));return![];});}exports[_0xecd7('0x10b')]=function(_0x3012c8,_0x2f1fe2,_0x4275cf){var _0x46afa3=0x0;var _0x41c98e=0x0;var _0x100696=![];var _0x5a065a;var _0x9d8e82;return db[_0xecd7('0x3f')][_0xecd7('0x62')]({'where':{'id':_0x3012c8['params']['id']},'include':[{'model':db['Interval'],'as':_0xecd7('0x10c'),'include':[{'model':db[_0xecd7('0x10c')],'as':_0xecd7('0x10d'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xecd7('0x1c')](handleEntityNotFound(_0x2f1fe2,null))['then'](function(_0x32d785){if(_0x32d785){_0x5a065a=_0x32d785;return _0x32d785[_0xecd7('0x10e')]({'raw':!![]});}})[_0xecd7('0x1c')](function(_0x195f7a){if(_0x5a065a){if(_0x195f7a){_0x9d8e82=_0x195f7a;}}return require(_0xecd7('0x13'))['getLicense']();})[_0xecd7('0x1c')](function(_0x4cf2ea){if(_0x4cf2ea){_0x41c98e=_0x4cf2ea[_0xecd7('0x10f')];_0x100696=_0x4cf2ea[_0xecd7('0x110')];}})[_0xecd7('0x1c')](function(){return db[_0xecd7('0xb7')][_0xecd7('0x2d')]({'where':{'closed':![]}});})[_0xecd7('0x1c')](function(_0x52a312){_0x46afa3=_0x52a312;if(_0x41c98e&&_0x52a312>_0x41c98e){return db[_0xecd7('0x111')]['findOne']({'where':{'id':0x1}})[_0xecd7('0x1c')](function(_0x2232b0){if(_0x2232b0){_0x2232b0[_0xecd7('0x112')]('chatLicenseExceeded');}});}})[_0xecd7('0x1c')](function(){if(_0x5a065a[_0xecd7('0x10c')]&&_0x5a065a[_0xecd7('0x10c')][_0xecd7('0x10d')]){var _0x4e8e9d=[];for(var _0x3b12b0=0x0;_0x3b12b0<_0x5a065a[_0xecd7('0x10c')]['Intervals'][_0xecd7('0x4a')];_0x3b12b0++){var _0x56f501=_0x5a065a[_0xecd7('0x10c')][_0xecd7('0x10d')][_0x3b12b0][_0xecd7('0x35')]({'plain':!![]});_0x4e8e9d['push'](iftimePromise(_0x56f501,_0x5a065a));}return BPromise[_0xecd7('0x113')](_0x4e8e9d)[_0xecd7('0x1c')](function(_0x5e2d60){return _[_0xecd7('0x114')](_0x5e2d60);});}else{return!![];}})[_0xecd7('0x1c')](function(_0x4693ed){var _0x4ad8bd=fs['readFileSync'](path['join'](config[_0xecd7('0x7b')],_0xecd7('0x115')),'utf8');var _0x525df1={'remote':_0x5a065a[_0xecd7('0x116')],'query':querystring[_0xecd7('0x21')](_['merge'](_0x5a065a[_0xecd7('0x35')]({'plain':!![]}),{'customerIp':_0x3012c8[_0xecd7('0x87')][_0xecd7('0xa8')]||_0x3012c8[_0xecd7('0x87')][_0xecd7('0x117')]||_0x3012c8[_0xecd7('0x118')]['remoteAddress']||_0x3012c8['ip'],'referer':_0x3012c8[_0xecd7('0x87')]['referer'],'openedInteractions':_0x46afa3,'maxInteractions':_0x41c98e,'virtual':_0x100696[_0xecd7('0x10f')],'online':_0x4693ed,'custom':_0x100696}))[_0xecd7('0x119')](/'/g,'\x5c\x27')};_0x2f1fe2[_0xecd7('0x3a')](ejs[_0xecd7('0xd6')](Mustache[_0xecd7('0xd6')](_0x4ad8bd,_0x525df1),{'proactiveActions':_0x9d8e82,'alignment':_0x5a065a[_0xecd7('0x11a')],'verticalAlignment':_0x5a065a[_0xecd7('0x11b')],'div_color':_0x5a065a[_0xecd7('0x11c')],'text_color':_0x5a065a['textColor'],'button_color':_0x5a065a['color_button'],'background_color':_0x5a065a[_0xecd7('0x11d')]}));})[_0xecd7('0x5c')](handleError(_0x2f1fe2,null));};exports[_0xecd7('0x11e')]=function(_0x3e8c7a,_0x18c73b,_0x2d3d62){return db[_0xecd7('0x3f')]['findOne']({'where':{'id':_0x3e8c7a[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x18c73b,null))['then'](function(_0x3f0478){if(_0x3f0478){return db[_0xecd7('0x11f')][_0xecd7('0xe1')](function(_0x353164){return db[_0xecd7('0x9c')]['destroy']({'where':{'ChatWebsiteId':_0x3e8c7a[_0xecd7('0x5a')]['id']},'transaction':_0x353164})[_0xecd7('0x1c')](function(_0x171bc6){var _0x188758=_['map'](_0x3e8c7a[_0xecd7('0x5e')],function(_0x13125a){_0x13125a['ChatWebsiteId']=_0x3e8c7a['params']['id'];return _0x13125a;});return db[_0xecd7('0x9c')][_0xecd7('0x120')](_0x188758,{'transaction':_0x353164});});})[_0xecd7('0x1c')](function(){return db[_0xecd7('0x9c')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x3e8c7a[_0xecd7('0x5a')]['id']},'order':_0xecd7('0xa1')});});}})[_0xecd7('0x1c')](respondWithResult(_0x18c73b,null))[_0xecd7('0x5c')](handleError(_0x18c73b,null));};exports[_0xecd7('0x121')]=function(_0x555825,_0x1c4a19,_0x2b7f1f){var _0x456e11={};var _0x2079b7={};var _0x11a819;var _0x22b436;return db[_0xecd7('0x3f')][_0xecd7('0x69')]({'where':{'id':_0x555825['params']['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x1c4a19,null))[_0xecd7('0x1c')](function(_0x4064af){if(_0x4064af){_0x11a819=_0x4064af;_0x2079b7[_0xecd7('0x44')]=_[_0xecd7('0x45')](db[_0xecd7('0x9c')]['rawAttributes']);_0x2079b7['query']=_[_0xecd7('0x45')](_0x555825['query']);_0x2079b7['filters']=_['intersection'](_0x2079b7[_0xecd7('0x44')],_0x2079b7[_0xecd7('0x46')]);_0x456e11[_0xecd7('0x48')]=_[_0xecd7('0x5b')](_0x2079b7[_0xecd7('0x44')],qs[_0xecd7('0x49')](_0x555825[_0xecd7('0x46')][_0xecd7('0x49')]));_0x456e11[_0xecd7('0x48')]=_0x456e11[_0xecd7('0x48')][_0xecd7('0x4a')]?_0x456e11[_0xecd7('0x48')]:_0x2079b7[_0xecd7('0x44')];_0x456e11['order']=qs[_0xecd7('0x4e')](_0x555825[_0xecd7('0x46')][_0xecd7('0x4e')]);_0x456e11[_0xecd7('0x51')]=qs[_0xecd7('0x47')](_[_0xecd7('0x4f')](_0x555825[_0xecd7('0x46')],_0x2079b7['filters']));if(_0x555825[_0xecd7('0x46')][_0xecd7('0x50')]){_0x456e11['where']=_[_0xecd7('0x52')](_0x456e11[_0xecd7('0x51')],{'$or':_['map'](_0x456e11[_0xecd7('0x48')],function(_0x2f70fc){var _0x49d8d5={};_0x49d8d5[_0x2f70fc]={'$like':'%'+_0x555825[_0xecd7('0x46')][_0xecd7('0x50')]+'%'};return _0x49d8d5;})});}_0x456e11=_['merge']({},_0x456e11,_0x555825[_0xecd7('0x54')]);return _0x11a819[_0xecd7('0x121')](_0x456e11);}})[_0xecd7('0x1c')](function(_0x24d5b1){if(_0x24d5b1){_0x22b436=_0x24d5b1[_0xecd7('0x4a')];if(!_0x555825[_0xecd7('0x46')][_0xecd7('0x4b')](_0xecd7('0x4c'))){_0x456e11[_0xecd7('0x2b')]=qs[_0xecd7('0x2b')](_0x555825[_0xecd7('0x46')]['limit']);_0x456e11[_0xecd7('0x2a')]=qs[_0xecd7('0x2a')](_0x555825['query'][_0xecd7('0x2a')]);}return _0x11a819[_0xecd7('0x121')](_0x456e11);}})[_0xecd7('0x1c')](function(_0x429383){if(_0x429383){return _0x429383?{'count':_0x22b436,'rows':_0x429383}:null;}})['then'](respondWithResult(_0x1c4a19,null))[_0xecd7('0x5c')](handleError(_0x1c4a19,null));};exports[_0xecd7('0x122')]=function(_0x245ba4,_0x51cf27,_0x5bf42d){return db['chatProactiveAction'][_0xecd7('0x62')]({'where':{'id':_0x245ba4[_0xecd7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x51cf27,null))[_0xecd7('0x1c')](function(_0x28a1f3){if(_0x28a1f3){return _0x28a1f3[_0xecd7('0x122')](_0x245ba4[_0xecd7('0x5e')][_0xecd7('0x6c')],_[_0xecd7('0xf6')](_0x245ba4[_0xecd7('0x5e')],[_0xecd7('0x6c'),'id'])||{});}})[_0xecd7('0x1c')](respondWithResult(_0x51cf27,null))[_0xecd7('0x5c')](handleError(_0x51cf27,null));};exports[_0xecd7('0x10e')]=function(_0x314938,_0x2d8f84,_0x2eb688){var _0x123b83={};var _0x2a5038={};var _0x362698;var _0x56881e;return db['ChatWebsite'][_0xecd7('0x69')]({'where':{'id':_0x314938[_0xecd7('0x5a')]['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x2d8f84,null))[_0xecd7('0x1c')](function(_0x5d4f2a){if(_0x5d4f2a){_0x362698=_0x5d4f2a;_0x2a5038[_0xecd7('0x44')]=_[_0xecd7('0x45')](db[_0xecd7('0x123')]['rawAttributes']);_0x2a5038[_0xecd7('0x46')]=_[_0xecd7('0x45')](_0x314938[_0xecd7('0x46')]);_0x2a5038[_0xecd7('0x47')]=_['intersection'](_0x2a5038[_0xecd7('0x44')],_0x2a5038[_0xecd7('0x46')]);_0x123b83[_0xecd7('0x48')]=_[_0xecd7('0x5b')](_0x2a5038[_0xecd7('0x44')],qs['fields'](_0x314938['query']['fields']));_0x123b83[_0xecd7('0x48')]=_0x123b83[_0xecd7('0x48')][_0xecd7('0x4a')]?_0x123b83[_0xecd7('0x48')]:_0x2a5038['model'];_0x123b83['order']=qs[_0xecd7('0x4e')](_0x314938['query']['sort']);_0x123b83['where']=qs[_0xecd7('0x47')](_[_0xecd7('0x4f')](_0x314938[_0xecd7('0x46')],_0x2a5038['filters']));if(_0x314938[_0xecd7('0x46')][_0xecd7('0x50')]){_0x123b83[_0xecd7('0x51')]=_['merge'](_0x123b83[_0xecd7('0x51')],{'$or':_[_0xecd7('0x3e')](_0x123b83[_0xecd7('0x48')],function(_0x2098df){var _0x5d1bb4={};_0x5d1bb4[_0x2098df]={'$like':'%'+_0x314938['query'][_0xecd7('0x50')]+'%'};return _0x5d1bb4;})});}_0x123b83=_[_0xecd7('0x52')]({},_0x123b83,_0x314938[_0xecd7('0x54')]);return _0x362698[_0xecd7('0x10e')](_0x123b83);}})[_0xecd7('0x1c')](function(_0x101ec2){if(_0x101ec2){_0x56881e=_0x101ec2[_0xecd7('0x4a')];if(!_0x314938[_0xecd7('0x46')]['hasOwnProperty']('nolimit')){_0x123b83['limit']=qs[_0xecd7('0x2b')](_0x314938['query'][_0xecd7('0x2b')]);_0x123b83[_0xecd7('0x2a')]=qs[_0xecd7('0x2a')](_0x314938[_0xecd7('0x46')][_0xecd7('0x2a')]);}return _0x362698['getProactiveActions'](_0x123b83);}})[_0xecd7('0x1c')](function(_0x4bbafc){if(_0x4bbafc){return _0x4bbafc?{'count':_0x56881e,'rows':_0x4bbafc}:null;}})[_0xecd7('0x1c')](respondWithResult(_0x2d8f84,null))[_0xecd7('0x5c')](handleError(_0x2d8f84,null));};exports[_0xecd7('0x124')]=function(_0x33176f,_0x38d454,_0x1a38c3){var _0x248528=_0x33176f[_0xecd7('0x46')][_0xecd7('0x125')]===_0xecd7('0x126')?_0xecd7('0x127'):_0xecd7('0x128');return db[_0xecd7('0x3f')]['find']({'attributes':['id',_0x248528],'where':{'id':_0x33176f[_0xecd7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x38d454,null))['then'](function(_0xd10ec4){if(_0xd10ec4){var _0x45309d=_0xd10ec4[_0x248528];var _0xbbd1b5=_0x45309d&&_0x45309d[_0xecd7('0x129')]?_0x45309d[_0xecd7('0x129')]:[];_0x38d454[_0xecd7('0x3a')]({'fromKey':_['isNil'](_0x45309d[_0xecd7('0x12a')])?undefined:_0x45309d[_0xecd7('0x12a')],'count':_0xbbd1b5[_0xecd7('0x4a')],'rows':_0xbbd1b5});}})['catch'](handleError(_0x38d454,null));};exports[_0xecd7('0x12b')]=function(_0x3b0a43,_0x3c0237,_0x8bca5a){var _0x128911={'raw':![],'where':{}};var _0x2d16c6={};var _0x16cd27={'count':0x0,'rows':[]};return db[_0xecd7('0x3f')]['findOne']({'where':{'id':_0x3b0a43[_0xecd7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3c0237,null))[_0xecd7('0x1c')](function(_0x13eaa5){if(_0x13eaa5){_0x2d16c6[_0xecd7('0x44')]=_[_0xecd7('0x45')](db[_0xecd7('0xd9')][_0xecd7('0x40')]);_0x2d16c6['query']=_[_0xecd7('0x45')](_0x3b0a43[_0xecd7('0x46')]);_0x2d16c6[_0xecd7('0x47')]=_[_0xecd7('0x5b')](_0x2d16c6['model'],_0x2d16c6[_0xecd7('0x46')]);_0x128911[_0xecd7('0x48')]=_[_0xecd7('0x5b')](_0x2d16c6[_0xecd7('0x44')],qs[_0xecd7('0x49')](_0x3b0a43[_0xecd7('0x46')]['fields']));_0x128911[_0xecd7('0x48')]=_0x128911[_0xecd7('0x48')][_0xecd7('0x4a')]?_0x128911[_0xecd7('0x48')]:_0x2d16c6[_0xecd7('0x44')];if(!_0x3b0a43[_0xecd7('0x46')][_0xecd7('0x4b')](_0xecd7('0x4c'))){_0x128911[_0xecd7('0x2b')]=qs[_0xecd7('0x2b')](_0x3b0a43[_0xecd7('0x46')][_0xecd7('0x2b')]);_0x128911[_0xecd7('0x2a')]=qs[_0xecd7('0x2a')](_0x3b0a43[_0xecd7('0x46')]['offset']);}_0x128911[_0xecd7('0x4d')]=qs[_0xecd7('0x4e')](_0x3b0a43[_0xecd7('0x46')]['sort']);_0x128911[_0xecd7('0x51')]=qs[_0xecd7('0x47')](_[_0xecd7('0x4f')](_0x3b0a43[_0xecd7('0x46')],_0x2d16c6[_0xecd7('0x47')]));_0x128911[_0xecd7('0x51')][_0xecd7('0x67')]=_0x13eaa5['id'];if(_0x3b0a43[_0xecd7('0x46')][_0xecd7('0x50')]){_0x128911[_0xecd7('0x51')]=_[_0xecd7('0x52')](_0x128911['where'],{'$or':_[_0xecd7('0x3e')](_0x128911[_0xecd7('0x48')],function(_0x4b3efa){var _0x50e1c5={};_0x50e1c5[_0x4b3efa]={'$like':'%'+_0x3b0a43[_0xecd7('0x46')]['filter']+'%'};return _0x50e1c5;})});}_0x128911=_[_0xecd7('0x52')]({},_0x128911,_0x3b0a43[_0xecd7('0x54')]);return db[_0xecd7('0xd9')][_0xecd7('0x2d')]({'where':_0x128911[_0xecd7('0x51')]})[_0xecd7('0x1c')](function(_0x1c14fa){_0x16cd27[_0xecd7('0x2d')]=_0x1c14fa;if(_0x3b0a43[_0xecd7('0x46')][_0xecd7('0x55')]){_0x128911['include']=[{'all':!![]}];}else{_0x128911[_0xecd7('0x56')]=[{'model':db['CmContact'],'as':_0xecd7('0x12c'),'required':![]},{'model':db[_0xecd7('0x12d')],'as':_0xecd7('0x12e'),'required':![]}];}return db[_0xecd7('0xd9')]['findAll'](_0x128911);})[_0xecd7('0x1c')](function(_0x5037eb){_0x16cd27[_0xecd7('0x58')]=_0x5037eb;return _0x16cd27;});}})[_0xecd7('0x1c')](respondWithFilteredResult(_0x3c0237,_0x128911))[_0xecd7('0x5c')](handleError(_0x3c0237,null));};exports[_0xecd7('0x12f')]=function(_0x1815e4,_0x2df28b,_0x5ab2dd){return db[_0xecd7('0x3f')]['find']({'where':{'id':_0x1815e4[_0xecd7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2df28b,null))[_0xecd7('0x1c')](function(_0x59b7ca){if(_0x59b7ca){return _0x59b7ca[_0xecd7('0x12f')](_0x1815e4[_0xecd7('0x5e')]['ids'],_[_0xecd7('0xf6')](_0x1815e4['body'],['ids','id'])||{})[_0xecd7('0xd3')](function(_0x16db81){for(var _0x3eda7e=0x0;_0x3eda7e<_0x1815e4[_0xecd7('0x5e')][_0xecd7('0x6c')][_0xecd7('0x4a')];_0x3eda7e+=0x1){socket[_0xecd7('0x130')]('userChatWebsite:save',{'UserId':Number(_0x1815e4[_0xecd7('0x5e')][_0xecd7('0x6c')][_0x3eda7e]),'ChatWebsiteId':Number(_0x1815e4['params']['id'])});}return _0x16db81;});}})[_0xecd7('0x1c')](respondWithResult(_0x2df28b,null))[_0xecd7('0x5c')](handleError(_0x2df28b,null));};exports[_0xecd7('0x131')]=function(_0x116d02,_0x5b7367,_0x139b7d){return db[_0xecd7('0x3f')][_0xecd7('0x62')]({'where':{'id':_0x116d02['params']['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x5b7367,null))[_0xecd7('0x1c')](function(_0x2bd6fd){if(_0x2bd6fd){return _0x2bd6fd['removeAgents'](_0x116d02[_0xecd7('0x46')][_0xecd7('0x6c')])['then'](function(){if(_[_0xecd7('0x132')](_0x116d02[_0xecd7('0x46')][_0xecd7('0x6c')])){for(var _0x23c08e=0x0;_0x23c08e<_0x116d02[_0xecd7('0x46')][_0xecd7('0x6c')][_0xecd7('0x4a')];_0x23c08e+=0x1){socket[_0xecd7('0x130')](_0xecd7('0x133'),{'UserId':Number(_0x116d02['query']['ids'][_0x23c08e]),'ChatWebsiteId':Number(_0x116d02[_0xecd7('0x5a')]['id'])});}}else{socket[_0xecd7('0x130')]('userChatWebsite:remove',{'UserId':Number(_0x116d02[_0xecd7('0x46')][_0xecd7('0x6c')]),'ChatWebsiteId':Number(_0x116d02['params']['id'])});}});}})[_0xecd7('0x1c')](respondWithStatusCode(_0x5b7367,null))[_0xecd7('0x5c')](handleError(_0x5b7367,null));};exports[_0xecd7('0x134')]=function(_0x176b42,_0x46ea96,_0x262c90){var _0x36924c={};var _0x2b4f98={};var _0x2da166;var _0x5b4257;return db['ChatWebsite'][_0xecd7('0x69')]({'where':{'id':_0x176b42['params']['id']}})[_0xecd7('0x1c')](handleEntityNotFound(_0x46ea96,null))['then'](function(_0x17c600){if(_0x17c600){_0x2da166=_0x17c600;_0x2b4f98[_0xecd7('0x44')]=_['keys'](db[_0xecd7('0xf8')][_0xecd7('0x40')]);_0x2b4f98[_0xecd7('0x46')]=_[_0xecd7('0x45')](_0x176b42[_0xecd7('0x46')]);_0x2b4f98['filters']=_['intersection'](_0x2b4f98[_0xecd7('0x44')],_0x2b4f98[_0xecd7('0x46')]);_0x36924c[_0xecd7('0x48')]=_[_0xecd7('0x5b')](_0x2b4f98['model'],qs['fields'](_0x176b42[_0xecd7('0x46')][_0xecd7('0x49')]));_0x36924c['attributes']=_0x36924c[_0xecd7('0x48')][_0xecd7('0x4a')]?_0x36924c[_0xecd7('0x48')]:_0x2b4f98['model'];_0x36924c[_0xecd7('0x4d')]=qs[_0xecd7('0x4e')](_0x176b42[_0xecd7('0x46')][_0xecd7('0x4e')]);_0x36924c['where']=qs[_0xecd7('0x47')](_[_0xecd7('0x4f')](_0x176b42[_0xecd7('0x46')],_0x2b4f98['filters']));if(_0x176b42[_0xecd7('0x46')][_0xecd7('0x50')]){_0x36924c[_0xecd7('0x51')]=_[_0xecd7('0x52')](_0x36924c[_0xecd7('0x51')],{'$or':_[_0xecd7('0x3e')](_0x36924c[_0xecd7('0x48')],function(_0x5d3e27){var _0x7274e2={};_0x7274e2[_0x5d3e27]={'$like':'%'+_0x176b42['query'][_0xecd7('0x50')]+'%'};return _0x7274e2;})});}_0x36924c=_['merge']({},_0x36924c,_0x176b42[_0xecd7('0x54')]);return _0x2da166['getAgents'](_0x36924c);}})[_0xecd7('0x1c')](function(_0x36cba8){if(_0x36cba8){_0x5b4257=_0x36cba8['length'];if(!_0x176b42[_0xecd7('0x46')][_0xecd7('0x4b')](_0xecd7('0x4c'))){_0x36924c[_0xecd7('0x2b')]=qs[_0xecd7('0x2b')](_0x176b42['query']['limit']);_0x36924c[_0xecd7('0x2a')]=qs[_0xecd7('0x2a')](_0x176b42[_0xecd7('0x46')]['offset']);}return _0x2da166[_0xecd7('0x134')](_0x36924c);}})[_0xecd7('0x1c')](function(_0x4d9e7f){if(_0x4d9e7f){return _0x4d9e7f?{'count':_0x5b4257,'rows':_0x4d9e7f}:null;}})[_0xecd7('0x1c')](respondWithResult(_0x46ea96,null))[_0xecd7('0x5c')](handleError(_0x46ea96,null));};
\ No newline at end of file
+var _0x1135=['CmContact','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','autoclose','push','unmanaged','*,*,*,*','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','createdAt','from\x20is\x20mandatory','send','mapKeyOffline','includes','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','basename','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','License','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','stringify','connection','verticalAlignment','color','textColor','backgroundColor','addApplications','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','keys','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','ChatWebsiteId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','agentAvatar','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','defaults'];(function(_0x1162bb,_0xa141a6){var _0x45b029=function(_0x52b902){while(--_0x52b902){_0x1162bb['push'](_0x1162bb['shift']());}};_0x45b029(++_0xa141a6);}(_0x1135,0x1bf));var _0x5113=function(_0x80daa5,_0x38040f){_0x80daa5=_0x80daa5-0x0;var _0x2d13d1=_0x1135[_0x80daa5];return _0x2d13d1;};'use strict';var emlformat=require(_0x5113('0x0'));var rimraf=require(_0x5113('0x1'));var zipdir=require(_0x5113('0x2'));var jsonpatch=require(_0x5113('0x3'));var rp=require(_0x5113('0x4'));var moment=require('moment');var BPromise=require(_0x5113('0x5'));var Mustache=require(_0x5113('0x6'));var util=require(_0x5113('0x7'));var path=require(_0x5113('0x8'));var sox=require(_0x5113('0x9'));var csv=require(_0x5113('0xa'));var ejs=require(_0x5113('0xb'));var fs=require('fs');var fs_extra=require(_0x5113('0xc'));var _=require(_0x5113('0xd'));var squel=require(_0x5113('0xe'));var crypto=require('crypto');var jsforce=require(_0x5113('0xf'));var deskjs=require(_0x5113('0x10'));var toCsv=require(_0x5113('0xa'));var querystring=require(_0x5113('0x11'));var Papa=require(_0x5113('0x12'));var Redis=require('ioredis');var authService=require(_0x5113('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5113('0x14'));var hardwareService=require(_0x5113('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x5113('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5113('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x5113('0x18')],{'host':_0x5113('0x19'),'port':0x18eb});var socket=require(_0x5113('0x1a'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x5113('0x1b')](socket);var jayson=require(_0x5113('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x5113('0x1d')]['http']({'port':0x232a});var client9003=jayson[_0x5113('0x1d')][_0x5113('0x1e')]({'port':0x232b});var client9001=jayson[_0x5113('0x1d')][_0x5113('0x1e')]({'port':0x2329});function respondWithRpcPromise(_0x1cda47,_0x23d4aa,_0x1f03f2,_0x30d851){return new BPromise(function(_0x2ea49d,_0x253260){var _0x371a9f=_0x30d851||client;return _0x371a9f[_0x5113('0x1f')](_0x1cda47,_0x1f03f2)[_0x5113('0x20')](function(_0x21af06){logger[_0x5113('0x21')](_0x5113('0x22'),_0x23d4aa,_0x5113('0x23'));logger[_0x5113('0x24')](_0x5113('0x25'),_0x23d4aa,_0x5113('0x23'),JSON['stringify'](_0x21af06));if(_0x21af06[_0x5113('0x26')]){if(_0x21af06[_0x5113('0x26')][_0x5113('0x27')]===0x1f4){logger[_0x5113('0x26')](_0x5113('0x22'),_0x23d4aa,_0x21af06[_0x5113('0x26')][_0x5113('0x28')]);return _0x253260(_0x21af06[_0x5113('0x26')][_0x5113('0x28')]);}logger[_0x5113('0x26')](_0x5113('0x22'),_0x23d4aa,_0x21af06['error'][_0x5113('0x28')]);return _0x2ea49d(_0x21af06[_0x5113('0x26')][_0x5113('0x28')]);}else{logger['info'](_0x5113('0x22'),_0x23d4aa,_0x5113('0x23'));_0x2ea49d(_0x21af06[_0x5113('0x29')][_0x5113('0x28')]);}})[_0x5113('0x2a')](function(_0x315212){logger['error'](_0x5113('0x22'),_0x23d4aa,_0x315212);_0x253260(_0x315212);});});}function respondWithStatusCode(_0x4ac1b3,_0x1c896e){_0x1c896e=_0x1c896e||0xcc;return function(_0x343e3e){if(_0x343e3e){return _0x4ac1b3[_0x5113('0x2b')](_0x1c896e);}return _0x4ac1b3['status'](_0x1c896e)[_0x5113('0x2c')]();};}function respondWithResult(_0x4d4a9e,_0x316987){_0x316987=_0x316987||0xc8;return function(_0x31c721){if(_0x31c721){return _0x4d4a9e[_0x5113('0x2d')](_0x316987)[_0x5113('0x2e')](_0x31c721);}};}function respondWithFilteredResult(_0x11722d,_0x8f01c){return function(_0x2598d9){if(_0x2598d9){var _0x3b437f=typeof _0x8f01c[_0x5113('0x2f')]==='undefined'&&typeof _0x8f01c[_0x5113('0x30')]===_0x5113('0x31');var _0x5876d8=_0x2598d9[_0x5113('0x32')];var _0x306de6=_0x3b437f?0x0:_0x8f01c['offset'];var _0x3807ff=_0x3b437f?_0x2598d9[_0x5113('0x32')]:_0x8f01c[_0x5113('0x2f')]+_0x8f01c[_0x5113('0x30')];var _0x30d030;if(_0x3807ff>=_0x5876d8){_0x3807ff=_0x5876d8;_0x30d030=0xc8;}else{_0x30d030=0xce;}_0x11722d['status'](_0x30d030);return _0x11722d[_0x5113('0x33')](_0x5113('0x34'),_0x306de6+'-'+_0x3807ff+'/'+_0x5876d8)[_0x5113('0x2e')](_0x2598d9);}return null;};}function patchUpdates(_0x23302b){return function(_0x3013ba){try{jsonpatch['apply'](_0x3013ba,_0x23302b,!![]);}catch(_0xb98b38){return BPromise[_0x5113('0x35')](_0xb98b38);}return _0x3013ba['save']();};}function saveUpdates(_0x1a66f9,_0x2330f7){return function(_0x5b1084){if(_0x5b1084){return _0x5b1084['update'](_0x1a66f9)[_0x5113('0x20')](function(_0x391bac){return _0x391bac;});}return null;};}function removeEntity(_0x353f70,_0xa35417){return function(_0xd9431f){if(_0xd9431f){return _0xd9431f[_0x5113('0x36')]()[_0x5113('0x20')](function(){var _0x2fd247=_0xd9431f[_0x5113('0x37')]({'plain':!![]});var _0x544e43=_0x5113('0x38');return db[_0x5113('0x39')][_0x5113('0x36')]({'where':{'type':_0x544e43,'resourceId':_0x2fd247['id']}})[_0x5113('0x20')](function(){return _0xd9431f;});})[_0x5113('0x20')](function(){_0x353f70[_0x5113('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2860ea,_0x3c9d79){return function(_0x28e46e){if(!_0x28e46e){_0x2860ea['sendStatus'](0x194);}return _0x28e46e;};}function handleError(_0x472d09,_0x5ebf8e){_0x5ebf8e=_0x5ebf8e||0x1f4;return function(_0x26e365){logger[_0x5113('0x26')](_0x26e365[_0x5113('0x3a')]);if(_0x26e365[_0x5113('0x3b')]){delete _0x26e365[_0x5113('0x3b')];}_0x472d09['status'](_0x5ebf8e)['send'](_0x26e365);};}exports[_0x5113('0x3c')]=function(_0x1c6498,_0x6bdc1d){var _0x423cfa={'include':[{'model':db[_0x5113('0x3d')],'as':_0x5113('0x3e')}]},_0x56f58e={},_0x4e0d52={'count':0x0,'rows':[]};var _0x1c4c26=_['map'](db[_0x5113('0x3f')][_0x5113('0x40')],function(_0xa0861c){return{'name':_0xa0861c[_0x5113('0x41')],'type':_0xa0861c['type'][_0x5113('0x42')]};});_0x56f58e[_0x5113('0x43')]=_[_0x5113('0x44')](_0x1c4c26,_0x5113('0x3b'));_0x56f58e[_0x5113('0x45')]=_['keys'](_0x1c6498[_0x5113('0x45')]);_0x56f58e[_0x5113('0x46')]=_[_0x5113('0x47')](_0x56f58e[_0x5113('0x43')],_0x56f58e['query']);_0x423cfa['attributes']=_[_0x5113('0x47')](_0x56f58e['model'],qs[_0x5113('0x48')](_0x1c6498['query']['fields']));_0x423cfa[_0x5113('0x49')]=_0x423cfa[_0x5113('0x49')][_0x5113('0x4a')]?_0x423cfa[_0x5113('0x49')]:_0x56f58e[_0x5113('0x43')];if(!_0x1c6498[_0x5113('0x45')][_0x5113('0x4b')](_0x5113('0x4c'))){_0x423cfa[_0x5113('0x30')]=qs[_0x5113('0x30')](_0x1c6498[_0x5113('0x45')][_0x5113('0x30')]);_0x423cfa[_0x5113('0x2f')]=qs['offset'](_0x1c6498[_0x5113('0x45')][_0x5113('0x2f')]);}_0x423cfa[_0x5113('0x4d')]=qs['sort'](_0x1c6498[_0x5113('0x45')][_0x5113('0x4e')]);_0x423cfa[_0x5113('0x4f')]=qs[_0x5113('0x46')](_[_0x5113('0x50')](_0x1c6498[_0x5113('0x45')],_0x56f58e[_0x5113('0x46')]),_0x1c4c26);if(_0x1c6498[_0x5113('0x45')]['filter']){_0x423cfa[_0x5113('0x4f')]=_['merge'](_0x423cfa[_0x5113('0x4f')],{'$or':_['map'](_0x1c4c26,function(_0x25ad1f){if(_0x25ad1f[_0x5113('0x51')]!==_0x5113('0x52')){var _0xdb490c={};_0xdb490c[_0x25ad1f[_0x5113('0x3b')]]={'$like':'%'+_0x1c6498[_0x5113('0x45')][_0x5113('0x53')]+'%'};return _0xdb490c;}})});}_0x423cfa=_[_0x5113('0x54')]({},_0x423cfa,_0x1c6498[_0x5113('0x55')]);var _0x3d1060={'where':_0x423cfa[_0x5113('0x4f')]};return db[_0x5113('0x3f')]['count'](_0x3d1060)['then'](function(_0x170e29){_0x4e0d52['count']=_0x170e29;if(_0x1c6498[_0x5113('0x45')][_0x5113('0x56')]){_0x423cfa['include']=[{'all':!![]}];}return db[_0x5113('0x3f')][_0x5113('0x57')](_0x423cfa);})[_0x5113('0x20')](function(_0x54747a){_0x4e0d52[_0x5113('0x58')]=_0x54747a;return _0x4e0d52;})[_0x5113('0x20')](respondWithFilteredResult(_0x6bdc1d,_0x423cfa))[_0x5113('0x2a')](handleError(_0x6bdc1d,null));};exports[_0x5113('0x59')]=function(_0x2b3b34,_0x6181d4){var _0x2cee78={'raw':![],'where':{'id':_0x2b3b34['params']['id']},'include':[{'model':db[_0x5113('0x3d')],'as':_0x5113('0x3e')}]},_0x27f393={};_0x27f393[_0x5113('0x43')]=_[_0x5113('0x5a')](db[_0x5113('0x3f')][_0x5113('0x40')]);_0x27f393[_0x5113('0x45')]=_[_0x5113('0x5a')](_0x2b3b34['query']);_0x27f393['filters']=_[_0x5113('0x47')](_0x27f393[_0x5113('0x43')],_0x27f393['query']);_0x2cee78[_0x5113('0x49')]=_[_0x5113('0x47')](_0x27f393[_0x5113('0x43')],qs[_0x5113('0x48')](_0x2b3b34[_0x5113('0x45')]['fields']));_0x2cee78[_0x5113('0x49')]=_0x2cee78['attributes']['length']?_0x2cee78[_0x5113('0x49')]:_0x27f393['model'];if(_0x2b3b34[_0x5113('0x45')]['includeAll']){_0x2cee78[_0x5113('0x5b')]=[{'all':!![]}];}_0x2cee78=_['merge']({},_0x2cee78,_0x2b3b34[_0x5113('0x55')]);return db[_0x5113('0x3f')][_0x5113('0x5c')](_0x2cee78)[_0x5113('0x20')](handleEntityNotFound(_0x6181d4,null))[_0x5113('0x20')](respondWithResult(_0x6181d4,null))[_0x5113('0x2a')](handleError(_0x6181d4,null));};exports[_0x5113('0x5d')]=function(_0x2699bc,_0xb75e02){return db[_0x5113('0x3f')][_0x5113('0x5d')](_0x2699bc[_0x5113('0x5e')],{})[_0x5113('0x20')](function(_0x262088){var _0x4fab29=_0x2699bc['user'][_0x5113('0x37')]({'plain':!![]});if(!_0x4fab29)throw new Error(_0x5113('0x5f'));if(_0x4fab29[_0x5113('0x60')]===_0x5113('0x61')){var _0x2e265e=_0x262088['get']({'plain':!![]});var _0x5c9b3a='ChatWebsites';return db['UserProfileSection'][_0x5113('0x5c')]({'where':{'name':_0x5c9b3a,'userProfileId':_0x4fab29[_0x5113('0x62')]},'raw':!![]})[_0x5113('0x20')](function(_0x1be017){if(_0x1be017&&_0x1be017[_0x5113('0x63')]===0x0){return db[_0x5113('0x39')]['create']({'name':_0x2e265e[_0x5113('0x3b')],'resourceId':_0x2e265e['id'],'type':_0x1be017[_0x5113('0x3b')],'sectionId':_0x1be017['id']},{})[_0x5113('0x20')](function(){return _0x262088;});}else{return _0x262088;}})[_0x5113('0x2a')](function(_0x2ebc87){logger['error'](_0x5113('0x64'),_0x2ebc87);throw _0x2ebc87;});}return _0x262088;})[_0x5113('0x20')](respondWithResult(_0xb75e02,0xc9))[_0x5113('0x2a')](handleError(_0xb75e02,null));};exports[_0x5113('0x65')]=function(_0x4f3478,_0x28c0fd){if(_0x4f3478[_0x5113('0x5e')]['id']){delete _0x4f3478[_0x5113('0x5e')]['id'];}return db[_0x5113('0x3f')]['find']({'where':{'id':_0x4f3478[_0x5113('0x66')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x5113('0x20')](handleEntityNotFound(_0x28c0fd,null))[_0x5113('0x20')](saveUpdates(_0x4f3478[_0x5113('0x5e')],null))[_0x5113('0x20')](respondWithResult(_0x28c0fd,null))['catch'](handleError(_0x28c0fd,null));};exports[_0x5113('0x36')]=function(_0x51aebd,_0x38a6c9){return db[_0x5113('0x3f')]['find']({'where':{'id':_0x51aebd[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x38a6c9,null))['then'](removeEntity(_0x38a6c9,null))[_0x5113('0x2a')](handleError(_0x38a6c9,null));};exports[_0x5113('0x67')]=function(_0x2c603d,_0x104fc6){return db[_0x5113('0x3f')][_0x5113('0x67')]()[_0x5113('0x20')](respondWithResult(_0x104fc6,null))[_0x5113('0x2a')](handleError(_0x104fc6,null));};exports['addDisposition']=function(_0x42d08c,_0x2ad755,_0x1c655c){if(_0x42d08c['body']['id']){delete _0x42d08c[_0x5113('0x5e')]['id'];}return db[_0x5113('0x3f')]['find']({'where':{'id':_0x42d08c[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x2ad755,null))['then'](function(_0xedcddb){if(_0xedcddb){_0x42d08c[_0x5113('0x5e')][_0x5113('0x68')]=_0xedcddb['id'];return db['Disposition'][_0x5113('0x5d')](_0x42d08c[_0x5113('0x5e')]);}})[_0x5113('0x20')](respondWithResult(_0x2ad755,null))['catch'](handleError(_0x2ad755,null));};exports[_0x5113('0x69')]=function(_0x41ba3d,_0x512c65,_0x46b439){var _0x364d97={'raw':![],'where':{}};var _0x36bf40={};var _0x512512={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5113('0x6a')]({'where':{'id':_0x41ba3d[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x512c65,null))[_0x5113('0x20')](function(_0x221008){if(_0x221008){_0x36bf40[_0x5113('0x43')]=_[_0x5113('0x5a')](db[_0x5113('0x6b')][_0x5113('0x40')]);_0x36bf40[_0x5113('0x45')]=_['keys'](_0x41ba3d[_0x5113('0x45')]);_0x36bf40[_0x5113('0x46')]=_['intersection'](_0x36bf40[_0x5113('0x43')],_0x36bf40['query']);_0x364d97[_0x5113('0x49')]=_[_0x5113('0x47')](_0x36bf40[_0x5113('0x43')],qs[_0x5113('0x48')](_0x41ba3d[_0x5113('0x45')][_0x5113('0x48')]));_0x364d97[_0x5113('0x49')]=_0x364d97[_0x5113('0x49')]['length']?_0x364d97[_0x5113('0x49')]:_0x36bf40[_0x5113('0x43')];if(!_0x41ba3d[_0x5113('0x45')][_0x5113('0x4b')](_0x5113('0x4c'))){_0x364d97[_0x5113('0x30')]=qs[_0x5113('0x30')](_0x41ba3d[_0x5113('0x45')]['limit']);_0x364d97['offset']=qs[_0x5113('0x2f')](_0x41ba3d['query']['offset']);}_0x364d97[_0x5113('0x4d')]=qs[_0x5113('0x4e')](_0x41ba3d[_0x5113('0x45')][_0x5113('0x4e')]);_0x364d97[_0x5113('0x4f')]=qs['filters'](_[_0x5113('0x50')](_0x41ba3d[_0x5113('0x45')],_0x36bf40[_0x5113('0x46')]));_0x364d97[_0x5113('0x4f')][_0x5113('0x68')]=_0x221008['id'];if(_0x41ba3d['query'][_0x5113('0x53')]){_0x364d97[_0x5113('0x4f')]=_[_0x5113('0x54')](_0x364d97['where'],{'$or':_['map'](_0x364d97[_0x5113('0x49')],function(_0x5c06de){var _0x5aeaba={};_0x5aeaba[_0x5c06de]={'$like':'%'+_0x41ba3d['query'][_0x5113('0x53')]+'%'};return _0x5aeaba;})});}_0x364d97=_[_0x5113('0x54')]({},_0x364d97,_0x41ba3d[_0x5113('0x55')]);return db[_0x5113('0x6b')][_0x5113('0x32')]({'where':_0x364d97['where']})['then'](function(_0x37722f){_0x512512[_0x5113('0x32')]=_0x37722f;if(_0x41ba3d['query'][_0x5113('0x56')]){_0x364d97[_0x5113('0x5b')]=[{'all':!![]}];}return db[_0x5113('0x6b')][_0x5113('0x57')](_0x364d97);})[_0x5113('0x20')](function(_0x267166){_0x512512[_0x5113('0x58')]=_0x267166;return _0x512512;});}})[_0x5113('0x20')](respondWithFilteredResult(_0x512c65,_0x364d97))[_0x5113('0x2a')](handleError(_0x512c65,null));};exports[_0x5113('0x6c')]=function(_0x254e48,_0x4fd488,_0x324d33){return db[_0x5113('0x3f')][_0x5113('0x5c')]({'where':{'id':_0x254e48[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x4fd488,null))[_0x5113('0x20')](function(_0x254b8c){if(_0x254b8c){return _0x254b8c[_0x5113('0x6c')](_0x254e48[_0x5113('0x45')][_0x5113('0x6d')]);}})[_0x5113('0x20')](respondWithStatusCode(_0x4fd488,null))[_0x5113('0x2a')](handleError(_0x4fd488,null));};exports[_0x5113('0x6e')]=function(_0x5e696f,_0x318aee,_0x2ee74b){if(_0x5e696f['body']['id']){delete _0x5e696f[_0x5113('0x5e')]['id'];}return db[_0x5113('0x3f')][_0x5113('0x5c')]({'where':{'id':_0x5e696f[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x318aee,null))[_0x5113('0x20')](function(_0xb84742){if(_0xb84742){_0x5e696f['body'][_0x5113('0x68')]=_0xb84742['id'];return db[_0x5113('0x6f')]['create'](_0x5e696f[_0x5113('0x5e')]);}})[_0x5113('0x20')](respondWithResult(_0x318aee,null))[_0x5113('0x2a')](handleError(_0x318aee,null));};exports[_0x5113('0x70')]=function(_0x512be1,_0x172d16,_0x470784){var _0x1e5454={'raw':![],'where':{}};var _0x446972={};var _0x14401e={'count':0x0,'rows':[]};return db[_0x5113('0x3f')][_0x5113('0x6a')]({'where':{'id':_0x512be1[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x172d16,null))['then'](function(_0x4cc013){if(_0x4cc013){_0x446972[_0x5113('0x43')]=_[_0x5113('0x5a')](db[_0x5113('0x6f')][_0x5113('0x40')]);_0x446972[_0x5113('0x45')]=_[_0x5113('0x5a')](_0x512be1[_0x5113('0x45')]);_0x446972['filters']=_[_0x5113('0x47')](_0x446972[_0x5113('0x43')],_0x446972[_0x5113('0x45')]);_0x1e5454[_0x5113('0x49')]=_[_0x5113('0x47')](_0x446972[_0x5113('0x43')],qs[_0x5113('0x48')](_0x512be1[_0x5113('0x45')][_0x5113('0x48')]));_0x1e5454[_0x5113('0x49')]=_0x1e5454[_0x5113('0x49')]['length']?_0x1e5454[_0x5113('0x49')]:_0x446972[_0x5113('0x43')];if(!_0x512be1[_0x5113('0x45')][_0x5113('0x4b')](_0x5113('0x4c'))){_0x1e5454[_0x5113('0x30')]=qs[_0x5113('0x30')](_0x512be1[_0x5113('0x45')][_0x5113('0x30')]);_0x1e5454[_0x5113('0x2f')]=qs[_0x5113('0x2f')](_0x512be1['query']['offset']);}_0x1e5454[_0x5113('0x4d')]=qs[_0x5113('0x4e')](_0x512be1[_0x5113('0x45')][_0x5113('0x4e')]);_0x1e5454[_0x5113('0x4f')]=qs[_0x5113('0x46')](_[_0x5113('0x50')](_0x512be1[_0x5113('0x45')],_0x446972[_0x5113('0x46')]));_0x1e5454[_0x5113('0x4f')][_0x5113('0x68')]=_0x4cc013['id'];if(_0x512be1['query']['filter']){_0x1e5454['where']=_['merge'](_0x1e5454['where'],{'$or':_[_0x5113('0x44')](_0x1e5454['attributes'],function(_0x502db1){var _0x343d74={};_0x343d74[_0x502db1]={'$like':'%'+_0x512be1['query'][_0x5113('0x53')]+'%'};return _0x343d74;})});}_0x1e5454=_[_0x5113('0x54')]({},_0x1e5454,_0x512be1[_0x5113('0x55')]);return db[_0x5113('0x6f')][_0x5113('0x32')]({'where':_0x1e5454['where']})[_0x5113('0x20')](function(_0x7140dd){_0x14401e[_0x5113('0x32')]=_0x7140dd;if(_0x512be1[_0x5113('0x45')][_0x5113('0x56')]){_0x1e5454[_0x5113('0x5b')]=[{'all':!![]}];}return db[_0x5113('0x6f')][_0x5113('0x57')](_0x1e5454);})['then'](function(_0x146ce4){_0x14401e[_0x5113('0x58')]=_0x146ce4;return _0x14401e;});}})[_0x5113('0x20')](respondWithFilteredResult(_0x172d16,_0x1e5454))['catch'](handleError(_0x172d16,null));};exports['removeAnswers']=function(_0x51fb2a,_0x46cf8a,_0x2e8870){return db['ChatWebsite'][_0x5113('0x5c')]({'where':{'id':_0x51fb2a['params']['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x46cf8a,null))['then'](function(_0x3ba46d){if(_0x3ba46d){return _0x3ba46d[_0x5113('0x71')](_0x51fb2a['query']['ids']);}})[_0x5113('0x20')](respondWithStatusCode(_0x46cf8a,null))[_0x5113('0x2a')](handleError(_0x46cf8a,null));};exports[_0x5113('0x72')]=function(_0x55b2d2,_0x252476,_0x580915){_0x55b2d2['body'][_0x5113('0x73')]=_0x55b2d2['file']['filename'];return db['ChatWebsite'][_0x5113('0x5c')]({'where':{'id':_0x55b2d2[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x252476,null))['then'](saveUpdates(_0x55b2d2[_0x5113('0x5e')],null))['then'](respondWithResult(_0x252476,null))[_0x5113('0x2a')](handleError(_0x252476,null));};exports['addAvatar']=function(_0x26d19a,_0x3894a6,_0x36b06d){_0x26d19a[_0x5113('0x5e')][_0x5113('0x74')]=_0x26d19a[_0x5113('0x75')][_0x5113('0x76')];return db[_0x5113('0x3f')][_0x5113('0x5c')]({'where':{'id':_0x26d19a['params']['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x3894a6,null))[_0x5113('0x20')](saveUpdates(_0x26d19a['body'],null))[_0x5113('0x20')](respondWithResult(_0x3894a6,null))[_0x5113('0x2a')](handleError(_0x3894a6,null));};exports[_0x5113('0x77')]=function(_0x217675,_0x9edc6f,_0x1a508d){_0x217675[_0x5113('0x5e')][_0x5113('0x78')]=_0x217675[_0x5113('0x75')]['filename'];return db[_0x5113('0x3f')]['find']({'where':{'id':_0x217675[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x9edc6f,null))['then'](saveUpdates(_0x217675[_0x5113('0x5e')],null))[_0x5113('0x20')](respondWithResult(_0x9edc6f,null))[_0x5113('0x2a')](handleError(_0x9edc6f,null));};exports[_0x5113('0x79')]=function(_0x17abe0,_0x9b214a,_0x42e542){_0x17abe0[_0x5113('0x5e')][_0x5113('0x7a')]=_0x17abe0[_0x5113('0x75')][_0x5113('0x76')];return db[_0x5113('0x3f')]['find']({'where':{'id':_0x17abe0['params']['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x9b214a,null))[_0x5113('0x20')](saveUpdates(_0x17abe0[_0x5113('0x5e')],null))[_0x5113('0x20')](respondWithResult(_0x9b214a,null))[_0x5113('0x2a')](handleError(_0x9b214a,null));};exports[_0x5113('0x7b')]=function(_0x54ee3d,_0x18760e,_0x11e8fa){var _0x1a4d3f=path[_0x5113('0x7c')](config[_0x5113('0x7d')],_0x5113('0x7e'));var _0x22bdba={'where':{'id':_0x54ee3d[_0x5113('0x66')]['id']},'attributes':['id',_0x5113('0x73')],'raw':!![]};var _0x47a54b=![];return require(_0x5113('0x17'))[_0x5113('0x7f')]()[_0x5113('0x20')](function(_0x33650f){if(_0x33650f){_0x47a54b=_0x33650f[_0x5113('0x80')];}})[_0x5113('0x20')](function(){return db[_0x5113('0x3f')][_0x5113('0x5c')](_0x22bdba);})[_0x5113('0x20')](handleEntityNotFound(_0x18760e,null))[_0x5113('0x20')](function(_0x525f56){if(_0x525f56){if(!_[_0x5113('0x81')](_0x525f56[_0x5113('0x73')])){if(fs[_0x5113('0x82')](path['join'](config[_0x5113('0x7d')],_0x5113('0x83'),_0x525f56[_0x5113('0x73')]))&&_0x47a54b){_0x1a4d3f=path[_0x5113('0x7c')](config[_0x5113('0x7d')],_0x5113('0x83'),_0x525f56[_0x5113('0x73')]);}}return _0x18760e[_0x5113('0x84')](_0x1a4d3f);}})[_0x5113('0x2a')](handleError(_0x18760e,null));};exports['getAvatar']=function(_0x3aa146,_0x9c3267,_0x19741d){var _0x411253=path[_0x5113('0x7c')](config[_0x5113('0x7d')],_0x5113('0x85'));var _0x5ed479={'where':{'id':_0x3aa146[_0x5113('0x66')]['id']},'attributes':['id',_0x5113('0x74')],'raw':!![]};return db[_0x5113('0x3f')]['find'](_0x5ed479)[_0x5113('0x20')](handleEntityNotFound(_0x9c3267,null))['then'](function(_0x322ec3){if(_0x322ec3){if(!_['isNil'](_0x322ec3[_0x5113('0x74')])){if(fs[_0x5113('0x82')](path['join'](config[_0x5113('0x7d')],'server/files/images/avatars/',_0x322ec3[_0x5113('0x74')]))){_0x411253=path[_0x5113('0x7c')](config[_0x5113('0x7d')],_0x5113('0x86'),_0x322ec3[_0x5113('0x74')]);}}return _0x9c3267['download'](_0x411253);}})[_0x5113('0x2a')](handleError(_0x9c3267,null));};exports[_0x5113('0x87')]=function(_0xb1a24c,_0x366e0d,_0x194151){var _0x2b97ca=path[_0x5113('0x7c')](config[_0x5113('0x7d')],'server/files/images/avatars/customer_avatar.png');var _0x3a51c4={'where':{'id':_0xb1a24c[_0x5113('0x66')]['id']},'attributes':['id',_0x5113('0x78'),_0x5113('0x88')],'raw':!![]};return db[_0x5113('0x3f')]['find'](_0x3a51c4)['then'](handleEntityNotFound(_0x366e0d,null))[_0x5113('0x20')](function(_0x2a6758){if(_0x2a6758){if(!_[_0x5113('0x81')](_0x2a6758['customerAvatar'])){if(fs[_0x5113('0x82')](path[_0x5113('0x7c')](config['root'],_0x5113('0x86'),_0x2a6758[_0x5113('0x78')]))&&_0x2a6758[_0x5113('0x88')]){_0x2b97ca=path[_0x5113('0x7c')](config[_0x5113('0x7d')],_0x5113('0x86'),_0x2a6758[_0x5113('0x78')]);}}return _0x366e0d['download'](_0x2b97ca);}})['catch'](handleError(_0x366e0d,null));};exports[_0x5113('0x89')]=function(_0x3a5f8e,_0x4de6b6,_0x3e2fa5){var _0x16ae96=path[_0x5113('0x7c')](config['root'],_0x5113('0x8a'));var _0x2ca5ec={'where':{'id':_0x3a5f8e['params']['id']},'attributes':['id',_0x5113('0x7a')],'raw':!![]};return db[_0x5113('0x3f')][_0x5113('0x5c')](_0x2ca5ec)[_0x5113('0x20')](handleEntityNotFound(_0x4de6b6,null))[_0x5113('0x20')](function(_0x32f746){if(_0x32f746){if(!_[_0x5113('0x81')](_0x32f746[_0x5113('0x7a')])){if(fs[_0x5113('0x82')](path[_0x5113('0x7c')](config[_0x5113('0x7d')],'server/files/images/avatars/',_0x32f746[_0x5113('0x7a')]))){_0x16ae96=path[_0x5113('0x7c')](config['root'],'server/files/images/avatars/',_0x32f746[_0x5113('0x7a')]);}}return _0x4de6b6[_0x5113('0x84')](_0x16ae96);}})['catch'](handleError(_0x4de6b6,null));};exports[_0x5113('0x8b')]=function(_0x2057a5,_0x3fd817,_0x4f394b){var _0xbf6c2e=require('user-agent-parser');var _0x20cca5=new _0xbf6c2e();var _0xdd6e96=_0x20cca5[_0x5113('0x8c')](_0x2057a5[_0x5113('0x8d')][_0x5113('0x8e')])['getResult']();var _0x6378c2={'body':_0x2057a5[_0x5113('0x5e')],'channel':_0x5113('0x8f')};var _0x8205a1=[];var _0x1a8a02=[];var _0x4b11a9={};var _0x46b07c=![];return db['CmContact'][_0x5113('0x67')]()[_0x5113('0x20')](function(_0xddacd3){if(!_0xddacd3){throw new db[(_0x5113('0x90'))][(_0x5113('0x91'))](_0x5113('0x92'));}_0x8205a1=_[_0x5113('0x93')](_[_0x5113('0x5a')](_0xddacd3),['createdAt',_0x5113('0x94')]);_0x1a8a02=_[_0x5113('0x93')](_[_0x5113('0x5a')](_0xddacd3),['createdAt',_0x5113('0x94'),_0x5113('0x95'),_0x5113('0x96')]);if(_0x2057a5[_0x5113('0x5e')]['id']){delete _0x2057a5['body']['id'];}if(_['isNil'](_0x2057a5['body'][_0x5113('0x97')])){throw new db[(_0x5113('0x90'))][(_0x5113('0x91'))]('from\x20is\x20mandatory');}if(_[_0x5113('0x81')](_0x2057a5[_0x5113('0x5e')][_0x5113('0x5e')])||_0x2057a5['body'][_0x5113('0x5e')]===''){throw new db[(_0x5113('0x90'))][(_0x5113('0x91'))](_0x5113('0x98'));}if(_[_0x5113('0x81')](_0x2057a5[_0x5113('0x5e')][_0x5113('0x99')])){throw new db[(_0x5113('0x90'))][(_0x5113('0x91'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1a8a02);}if(!_['includes'](_0x1a8a02,_0x2057a5['body'][_0x5113('0x99')])){throw new db[(_0x5113('0x90'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1a8a02);}_0x4b11a9[_0x2057a5[_0x5113('0x5e')]['mapKey']]=_0x2057a5[_0x5113('0x5e')][_0x5113('0x97')];})[_0x5113('0x20')](function(){return db[_0x5113('0x3f')][_0x5113('0x5c')]({'where':{'id':_0x2057a5[_0x5113('0x66')]['id']},'include':[{'model':db[_0x5113('0x9a')],'as':_0x5113('0x9b'),'include':[{'model':db['CmContact'],'as':_0x5113('0x9c'),'where':_0x4b11a9,'limit':0x1,'order':[[_0x5113('0x94'),_0x5113('0x9d')]]}]},{'model':db[_0x5113('0x9e')],'as':_0x5113('0x9f')}]});})['then'](handleEntityNotFound(_0x3fd817,null))[_0x5113('0x20')](function(_0x52e029){if(_0x52e029&&_0x52e029[_0x5113('0x9b')]){_0x6378c2[_0x5113('0xa0')]=_0x52e029;_0x6378c2[_0x5113('0xa1')]=_0x52e029[_0x5113('0x9f')];_0x6378c2[_0x5113('0xa2')]=_0x52e029[_0x5113('0x9b')];_0x6378c2[_0x5113('0xa1')]=_[_0x5113('0xa3')](_0x6378c2[_0x5113('0xa1')],[_0x5113('0xa4')],[_0x5113('0xa5')]);if(_0x6378c2[_0x5113('0xa0')]['Applications']){delete _0x6378c2[_0x5113('0xa0')][_0x5113('0x9f')];}if(_0x6378c2[_0x5113('0xa0')][_0x5113('0x9b')]&&_0x6378c2[_0x5113('0xa0')][_0x5113('0x9b')][_0x5113('0x9c')]['length']){return _0x6378c2[_0x5113('0xa0')][_0x5113('0x9b')][_0x5113('0x9c')][0x0];}var _0x588f67=_[_0x5113('0xa6')](_0x2057a5['body'],{'firstName':_0x2057a5[_0x5113('0x5e')][_0x5113('0x97')],'ListId':_0x52e029[_0x5113('0x96')]});_0x588f67[_0x2057a5['body'][_0x5113('0x99')]]=_0x2057a5[_0x5113('0x5e')][_0x5113('0x97')];return db[_0x5113('0xa7')][_0x5113('0x5d')](_0x588f67,{'fields':_0x8205a1,'raw':!![]});}})[_0x5113('0x20')](handleEntityNotFound(_0x3fd817,null))[_0x5113('0x20')](function(_0x440700){_0x6378c2[_0x5113('0xa8')]=_0x440700;var _0x5e275a=_0x2057a5[_0x5113('0x5e')][_0x5113('0xa9')];if(_0x2057a5[_0x5113('0x8d')]['cf-connecting-ip']){_0x5e275a=_0x2057a5['headers'][_0x5113('0xaa')];}else if(_0x2057a5[_0x5113('0x8d')][_0x5113('0xab')]){_0x5e275a=_['first'](_0x2057a5[_0x5113('0x8d')][_0x5113('0xab')][_0x5113('0xac')](','));}if(_0x440700){var _0x38f342={'ContactId':_0x440700['id'],'ChatWebsiteId':_0x2057a5[_0x5113('0x66')]['id'],'from':(_0x440700[_0x5113('0xad')]||'')+'\x20'+(_0x440700['lastName']||''),'customerIp':_0x5e275a,'customerPort':_0x2057a5[_0x5113('0x8d')][_0x5113('0xae')]?_0x2057a5[_0x5113('0x8d')][_0x5113('0xae')]:null,'referer':_0x2057a5[_0x5113('0x5e')][_0x5113('0xaf')],'browserName':_0xdd6e96['browser'][_0x5113('0x3b')]&&_0xdd6e96[_0x5113('0xb0')][_0x5113('0xb1')]?util[_0x5113('0xb2')](_0x5113('0xb3'),_0xdd6e96[_0x5113('0xb0')][_0x5113('0x3b')],_0xdd6e96[_0x5113('0xb0')][_0x5113('0xb1')]):_0x5113('0xb4'),'browserVersion':_0xdd6e96[_0x5113('0xb0')][_0x5113('0xb1')]||_0x5113('0xb4'),'osName':util[_0x5113('0xb2')](_0x5113('0xb3'),_0xdd6e96['os'][_0x5113('0x3b')],_0xdd6e96['os']['version']),'osVersion':_0xdd6e96['os'][_0x5113('0xb1')],'deviceModel':_0xdd6e96['device'][_0x5113('0x43')]&&_0xdd6e96[_0x5113('0xb5')][_0x5113('0xb6')]?util[_0x5113('0xb2')](_0x5113('0xb7'),_0xdd6e96[_0x5113('0xb5')][_0x5113('0x43')],_0xdd6e96[_0x5113('0xb5')]['vendor'],_0xdd6e96[_0x5113('0xb5')][_0x5113('0x51')]):null,'deviceVendor':_0xdd6e96[_0x5113('0xb5')][_0x5113('0xb6')],'deviceType':_0xdd6e96[_0x5113('0xb5')]['type'],'formData':JSON['stringify'](_0x2057a5['body'])};var _0x1f8a50={'ChatWebsiteId':_0x2057a5['params']['id'],'closed':![]};if(_0x2057a5[_0x5113('0x5e')]['threadId']){_0x1f8a50['threadId']=_0x2057a5['body'][_0x5113('0xb8')];return db[_0x5113('0xb9')][_0x5113('0x5c')]({'where':_0x1f8a50})[_0x5113('0x20')](function(_0x3ef676){if(_0x3ef676){return[_0x3ef676,![]];}_0x38f342[_0x5113('0xb8')]=_0x2057a5['body']['threadId'];_0x38f342[_0x5113('0xba')]=_0x2057a5['body']['externalUrl'];return db[_0x5113('0xb9')][_0x5113('0x5d')](_0x38f342)[_0x5113('0x20')](function(_0x5209c9){return[_0x5209c9,!![]];});});}_0x1f8a50[_0x5113('0xbb')]=_0x440700['id'];if(_0x2057a5[_0x5113('0x5e')][_0x5113('0xbc')]&&_0x2057a5[_0x5113('0x5e')][_0x5113('0xbc')]['id']){_0x1f8a50['id']=_0x2057a5[_0x5113('0x5e')][_0x5113('0xbc')]['id'];return db[_0x5113('0xb9')]['find']({'where':_0x1f8a50})[_0x5113('0x20')](function(_0x1d87e0){if(_0x1d87e0){return[_0x1d87e0,![]];}return db[_0x5113('0xb9')][_0x5113('0x5d')](_0x38f342)[_0x5113('0x20')](function(_0x1ba1a7){return[_0x1ba1a7,!![]];});});}return db[_0x5113('0xb9')][_0x5113('0x5d')](_0x38f342)[_0x5113('0x20')](function(_0x482cdb){return[_0x482cdb,!![]];});}})[_0x5113('0xbd')](function(_0x5934b9,_0x124cbf){if(_0x5934b9){_0x46b07c=_0x124cbf;if(!_0x124cbf){var _0x45a401={'from':(_0x6378c2[_0x5113('0xa8')][_0x5113('0xad')]||'')+'\x20'+(_0x6378c2['contact'][_0x5113('0xbe')]||'')};if(_0x2057a5['body'][_0x5113('0xb8')]&&_0x2057a5[_0x5113('0x5e')][_0x5113('0xbf')]&&_0x2057a5[_0x5113('0x5e')]['threadId']!=_0x2057a5[_0x5113('0x5e')]['messageId']){_0x45a401[_0x5113('0xb8')]=_0x2057a5[_0x5113('0x5e')][_0x5113('0xbf')];}return _0x5934b9[_0x5113('0x65')](_0x45a401);}else{return _0x5934b9;}}})[_0x5113('0x20')](function(_0x17f7db){_0x6378c2[_0x5113('0xbc')]=_0x17f7db[_0x5113('0x37')]({'plain':!![]});_0x6378c2[_0x5113('0xbc')][_0x5113('0xc0')]=_0x46b07c;if(_0x6378c2['interaction'][_0x5113('0xc0')]){if(_0x6378c2['account'][_0x5113('0xc1')]){_0x6378c2['applications'][_0x5113('0xc2')]({'id':0x0,'priority':_0x6378c2['applications']['length']+0x1,'app':'close','appdata':_0x5113('0xc3'),'interval':_0x5113('0xc4')});}}return db['ChatMessage'][_0x5113('0x5d')]({'body':_0x2057a5['body']['body'],'ChatWebsiteId':_0x2057a5[_0x5113('0x66')]['id'],'ChatInteractionId':_0x17f7db['id'],'direction':'in','ContactId':_0x6378c2['contact']['id'],'AttachmentId':_0x2057a5[_0x5113('0x5e')]['AttachmentId']});})[_0x5113('0x20')](function(_0x479cf7){_0x6378c2[_0x5113('0x28')]=_0x479cf7;if(_0x6378c2[_0x5113('0xbc')][_0x5113('0xc5')]){return db[_0x5113('0xc6')][_0x5113('0x5c')]({'attributes':['id',_0x5113('0x3b')],'where':{'id':_0x6378c2['interaction'][_0x5113('0xc5')]}})[_0x5113('0x20')](function(_0x2db30b){if(_0x2db30b){_0x6378c2[_0x5113('0xa1')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5113('0xc7'),'appdata':_0x2db30b[_0x5113('0x3b')]+','+(_0x6378c2[_0x5113('0xa0')][_0x5113('0xc8')]||0xa),'interval':_0x5113('0xc4')});_0x6378c2[_0x5113('0xc9')]=!![];}return respondWithRpcPromise(_0x5113('0xca'),_0x5113('0xcb'),_0x6378c2);});}return respondWithRpcPromise(_0x5113('0xca'),_0x5113('0xcb'),_0x6378c2);})[_0x5113('0x20')](function(_0x36c643){respondWithRpcPromise(_0x5113('0xcc'),_0x5113('0xcc'),{'event':_0x5113('0x8b'),'message':_0x36c643},client9002);return _0x36c643;})['then'](respondWithResult(_0x3fd817,null))[_0x5113('0x2a')](handleError(_0x3fd817,null));};exports[_0x5113('0xcd')]=function(_0x51da31,_0x4820ff,_0x38ceb6){var _0x59f708,_0x253936,_0x9a9b49;var _0x10a8f1=[];var _0x9d5332=[];var _0x53f3ee={};var _0x172afe=_0x51da31[_0x5113('0xce')]||[];var _0x260a56=[];var _0x19ece1;return db['CmContact'][_0x5113('0x67')]()[_0x5113('0x20')](function(_0x428f5c){if(!_0x428f5c){throw new db['Sequelize'][(_0x5113('0x91'))]('no\x20available\x20attributes');}_0x9d5332=_[_0x5113('0x93')](_[_0x5113('0x5a')](_0x428f5c),[_0x5113('0xcf'),'updatedAt']);_0x10a8f1=_[_0x5113('0x93')](_[_0x5113('0x5a')](_0x428f5c),[_0x5113('0xcf'),_0x5113('0x94'),_0x5113('0x95'),_0x5113('0x96')]);if(_0x51da31[_0x5113('0x5e')]['id']){delete _0x51da31['body']['id'];}if(_[_0x5113('0x81')](_0x51da31[_0x5113('0x5e')][_0x5113('0x97')])){throw _0x4820ff['status'](0x1f4)['send'](new db[(_0x5113('0x90'))][(_0x5113('0x91'))](_0x5113('0xd0')));}if(_[_0x5113('0x81')](_0x51da31[_0x5113('0x5e')]['body'])||_0x51da31['body'][_0x5113('0x5e')]===''){throw _0x4820ff['status'](0x1f4)[_0x5113('0xd1')](new db[(_0x5113('0x90'))][(_0x5113('0x91'))](_0x5113('0x98')));}if(_[_0x5113('0x81')](_0x51da31[_0x5113('0x5e')][_0x5113('0xd2')])){throw _0x4820ff['status'](0x1f4)[_0x5113('0xd1')](new db['Sequelize'][(_0x5113('0x91'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x10a8f1));}if(!_[_0x5113('0xd3')](_0x10a8f1,_0x51da31[_0x5113('0x5e')][_0x5113('0xd2')])){throw _0x4820ff[_0x5113('0x2d')](0x1f4)[_0x5113('0xd1')](new db[(_0x5113('0x90'))][(_0x5113('0x91'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x10a8f1));}_0x53f3ee[_0x51da31[_0x5113('0x5e')][_0x5113('0xd2')]]=_0x51da31[_0x5113('0x5e')][_0x5113('0x97')];})[_0x5113('0x20')](function(){return db['ChatWebsite'][_0x5113('0x5c')]({'where':{'id':_0x51da31[_0x5113('0x66')]['id']},'include':[{'model':db[_0x5113('0x9a')],'as':_0x5113('0x9b')},{'model':db[_0x5113('0xd4')],'as':_0x5113('0xd4')}]});})['then'](handleEntityNotFound(_0x4820ff,null))[_0x5113('0x20')](function(_0xf580fd){if(_0xf580fd&&_0xf580fd['List']){_0x253936=_0xf580fd;var _0x131f30=_['defaults'](_0x51da31[_0x5113('0x5e')],{'firstName':_0x51da31[_0x5113('0x5e')]['from'],'phone':_0x51da31[_0x5113('0x5e')][_0x5113('0x97')],'ListId':_0xf580fd[_0x5113('0x96')]});_0x131f30[_0x51da31['body'][_0x5113('0xd2')]]=_0x51da31['body'][_0x5113('0x97')];return db[_0x5113('0xa7')][_0x5113('0xd5')]({'where':_0x53f3ee,'defaults':_0x131f30});}})[_0x5113('0xbd')](function(_0x4698ae){if(_0x4698ae){_0x9a9b49=_0x4698ae;var _0x2c7ee7=fs[_0x5113('0xd6')](path[_0x5113('0x7c')](config[_0x5113('0x7d')],_0x5113('0xd7')),_0x5113('0xd8'));var _0x2d3393=ejs[_0x5113('0xd9')](_0x2c7ee7,{'body':_['toPairs'](_0x51da31[_0x5113('0x5e')][_0x5113('0x5e')]),'bodyTitle':_0x253936[_0x5113('0xda')]});return db[_0x5113('0xdb')]['create']({'body':_0x2d3393,'ContactId':_0x4698ae['id'],'ChatWebsiteId':_0x253936['id']});}})[_0x5113('0x20')](function(_0x411bf1){_0x19ece1=_0x411bf1;if(_0x172afe[_0x5113('0x4a')]){var _0x459838=_0x172afe[_0x5113('0x44')](function(_0x129a0a){return{'name':_0x129a0a['originalname'],'basename':_0x129a0a['filename'],'type':_0x129a0a[_0x5113('0xdc')],'ChatOfflineMessageId':_0x411bf1['id']};});_0x260a56=_0x459838[_0x5113('0x44')](_0x5c22ec=>{var _0x3dce2c={'filename':_0x5c22ec[_0x5113('0x3b')],'path':path[_0x5113('0x7c')](config['root'],_0x5113('0xdd'),_0x5113('0xce'),_0x5113('0xde'),'offline-chat',_0x5c22ec[_0x5113('0xdf')])};return _0x3dce2c;});if(!_0x253936[_0x5113('0xe0')]){return db['sequelize'][_0x5113('0xe1')](function(_0x429ea1){return db[_0x5113('0xe2')][_0x5113('0xe3')](_0x459838,{'transaction':_0x429ea1});});}}})['then'](function(){if(_0x19ece1){_0x59f708=_0x19ece1;return db['MailAccount'][_0x5113('0x6a')]({'where':{'active':!![]},'include':[{'model':db[_0x5113('0xe4')],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x186b77){if(_0x186b77&&_0x186b77[_0x5113('0xe5')]&&_0x253936[_0x5113('0xe6')]&&_0x253936['forwardOfflineAddress']){var _0x3f513d={'tls':{'rejectUnauthorized':![]}};if(_0x186b77[_0x5113('0xe5')][_0x5113('0xe7')]){_0x3f513d[_0x5113('0xe7')]=_0x186b77[_0x5113('0xe5')]['service'];}else{_0x3f513d['host']=_0x186b77[_0x5113('0xe5')][_0x5113('0xe8')];_0x3f513d[_0x5113('0xe9')]=_0x186b77[_0x5113('0xe5')]['port'];_0x3f513d[_0x5113('0xea')]=_0x186b77['Smtp'][_0x5113('0xea')];}if(_0x186b77[_0x5113('0xe5')][_0x5113('0xeb')]){_0x3f513d[_0x5113('0xec')]={'user':_0x186b77[_0x5113('0xe5')]['user'],'pass':_0x186b77[_0x5113('0xe5')][_0x5113('0xed')]};}return respondWithRpcPromise('SendMail',_0x5113('0xee'),{'account':_0x3f513d,'message':{'from':util[_0x5113('0xb2')](_0x5113('0xef'),_0x186b77[_0x5113('0x3b')],_0x186b77[_0x5113('0xf0')]||_0x186b77[_0x5113('0xe5')][_0x5113('0x61')]),'to':_0x253936[_0x5113('0xf1')],'subject':_0x253936[_0x5113('0xf2')],'html':_0x59f708['body'],'attachments':_0x260a56}},client9003)[_0x5113('0x20')](function(){return _0x59f708;})[_0x5113('0x2a')](function(_0x211961){console[_0x5113('0x26')](_0x211961);});}})[_0x5113('0x20')](function(){if(_0x253936&&_0x253936[_0x5113('0xe0')]&&_0x253936[_0x5113('0xf3')]){var _0x11d9ba=[];if(_0x172afe[_0x5113('0x4a')]){_0x11d9ba=_0x172afe[_0x5113('0x44')](function(_0x58c155){return{'name':_0x58c155[_0x5113('0xf4')],'basename':_0x58c155['filename'],'type':_0x58c155[_0x5113('0xdc')],'ChatOfflineMessageId':_0x19ece1['id']};});}var _0xbecd33;if(!_[_0x5113('0x81')](_0x253936[_0x5113('0xf5')])){var _0x315d5d=_[_0x5113('0x44')](_0x51da31[_0x5113('0x5e')],function(_0xd3ac96){return _0xd3ac96;});var _0x5e39aa=_[_0x5113('0xf6')](_0x315d5d)[0x0];var _0x4aa116=_[_0x5113('0xf7')](_0x5e39aa,function(_0x445fe1){return _0x445fe1;});_0xbecd33=_0x4aa116[0x1][_0x253936['subjectOffline']];}var _0x58132d={'from':_0x9a9b49[_0x5113('0xf0')],'firstName':_0x9a9b49['firstName'],'lastName':_0x9a9b49[_0x5113('0xbe')],'mapKey':_0x5113('0xf0'),'message':{'from':_0x9a9b49[_0x5113('0xf0')],'to':_0x253936['MailAccount']['email'],'cc':'','subject':_[_0x5113('0x81')](_0xbecd33)?_0x253936[_0x5113('0xf2')]:_0xbecd33,'messageId':'','sentAt':new Date(),'attach':_0x11d9ba['length'],'attachments':_0x11d9ba,'originChannel':_0x5113('0xf8'),'ChatWebsiteId':_0x253936['id'],'ChatOfflineMessageId':_0x59f708['id'],'originTo':_0x253936[_0x5113('0xd4')][_0x5113('0xf0')]},'body':_0x59f708[_0x5113('0x5e')]};var _0xcb198f={'account':{'id':_0x253936[_0x5113('0xf3')]},'body':_0x58132d,'log':_0x5113('0xf9')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0xcb198f,client9001)['then'](function(){return _0x59f708;})[_0x5113('0x2a')](function(_0x39f71a){console[_0x5113('0x26')](_0x39f71a);});}return;})[_0x5113('0x20')](function(){if(_0x59f708){return _0x59f708;}})[_0x5113('0x20')](respondWithResult(_0x4820ff,null))[_0x5113('0x2a')](function(_0x5701e2){console[_0x5113('0x26')](_0x5113('0x2a'),_0x5701e2);for(var _0x5a92b1 of _0x172afe){var _0x8a5770=path[_0x5113('0x7c')](config[_0x5113('0x7d')],'server','files',_0x5113('0xde'),_0x5113('0xfa'),_0x5a92b1[_0x5113('0x76')]);fs_extra[_0x5113('0xfb')](_0x8a5770)[_0x5113('0x2a')](function(_0x16cae3){console[_0x5113('0x26')](_0x5113('0xfc'),_0x8a5770,_0x16cae3);});}});};exports[_0x5113('0xfd')]=function(_0x2a6833,_0x4378cf,_0x455390){return db[_0x5113('0xb9')][_0x5113('0x5c')]({'where':{'id':_0x2a6833[_0x5113('0x66')]['id']}})['then'](handleEntityNotFound(_0x4378cf,null))[_0x5113('0x20')](function(_0x3533ae){if(_0x3533ae){return _0x3533ae['addInteraction'](_0x2a6833[_0x5113('0x5e')]['ids'],_[_0x5113('0xfe')](_0x2a6833[_0x5113('0x5e')],['ids','id'])||{});}})['then'](respondWithResult(_0x4378cf,null))[_0x5113('0x2a')](handleError(_0x4378cf,null));};exports[_0x5113('0xff')]=function(_0x16f526,_0x2798b5,_0x13b27e){var _0x23143e={'raw':![],'where':{}};var _0x169560={};var _0xfd28b3={'count':0x0,'rows':[]};return db[_0x5113('0x3f')][_0x5113('0x6a')]({'where':{'id':_0x16f526[_0x5113('0x66')]['id']}})['then'](handleEntityNotFound(_0x2798b5,null))[_0x5113('0x20')](function(_0x5793f4){if(_0x5793f4){_0x169560[_0x5113('0x43')]=_[_0x5113('0x5a')](db[_0x5113('0xb9')][_0x5113('0x40')]);_0x169560['query']=_['keys'](_0x16f526[_0x5113('0x45')]);_0x169560['filters']=_[_0x5113('0x47')](_0x169560['model'],_0x169560['query']);_0x23143e[_0x5113('0x49')]=_[_0x5113('0x47')](_0x169560['model'],qs['fields'](_0x16f526[_0x5113('0x45')][_0x5113('0x48')]));_0x23143e[_0x5113('0x49')]=_0x23143e[_0x5113('0x49')][_0x5113('0x4a')]?_0x23143e[_0x5113('0x49')]:_0x169560[_0x5113('0x43')];if(!_0x16f526[_0x5113('0x45')][_0x5113('0x4b')](_0x5113('0x4c'))){_0x23143e['limit']=qs['limit'](_0x16f526[_0x5113('0x45')][_0x5113('0x30')]);_0x23143e[_0x5113('0x2f')]=qs[_0x5113('0x2f')](_0x16f526[_0x5113('0x45')][_0x5113('0x2f')]);}_0x23143e[_0x5113('0x4d')]=qs[_0x5113('0x4e')](_0x16f526[_0x5113('0x45')]['sort']);_0x23143e[_0x5113('0x4f')]=qs[_0x5113('0x46')](_[_0x5113('0x50')](_0x16f526['query'],_0x169560['filters']));_0x23143e[_0x5113('0x4f')][_0x5113('0x68')]=_0x5793f4['id'];if(_0x16f526[_0x5113('0x45')][_0x5113('0x53')]){_0x23143e['where']=_['merge'](_0x23143e[_0x5113('0x4f')],{'$or':_['map'](_0x23143e[_0x5113('0x49')],function(_0xd62124){var _0x30bbc5={};_0x30bbc5[_0xd62124]={'$like':'%'+_0x16f526[_0x5113('0x45')][_0x5113('0x53')]+'%'};return _0x30bbc5;})});}_0x23143e=_[_0x5113('0x54')]({},_0x23143e,_0x16f526[_0x5113('0x55')]);return db[_0x5113('0xb9')][_0x5113('0x32')]({'where':_0x23143e[_0x5113('0x4f')]})[_0x5113('0x20')](function(_0x9263d){_0xfd28b3[_0x5113('0x32')]=_0x9263d;if(_0x16f526[_0x5113('0x45')][_0x5113('0x56')]){_0x23143e['include']=[{'model':db['CmContact'],'as':_0x5113('0x100'),'required':![]},{'model':db['User'],'as':_0x5113('0x101'),'attributes':[_0x5113('0x3b'),_0x5113('0x102'),_0x5113('0x103')],'required':![]},{'model':db[_0x5113('0x104')],'as':'Tags','attributes':['id','name','color'],'where':_0x16f526[_0x5113('0x45')][_0x5113('0x105')]?{'id':_0x16f526[_0x5113('0x45')][_0x5113('0x105')]}:undefined,'required':_0x16f526[_0x5113('0x45')][_0x5113('0x105')]?!![]:![]}];}return db[_0x5113('0xb9')][_0x5113('0x57')](_0x23143e);})[_0x5113('0x20')](function(_0x29a367){_0xfd28b3['rows']=_0x29a367;return _0xfd28b3;});}})[_0x5113('0x20')](respondWithFilteredResult(_0x2798b5,_0x23143e))[_0x5113('0x2a')](handleError(_0x2798b5,null));};function iftimePromise(_0x48a09e,_0x282ecf){return respondWithRpcPromise(_0x5113('0x106'),_0x5113('0x107'),{'command':_0x282ecf[_0x5113('0x108')]?util[_0x5113('0xb2')](_0x5113('0x109'),_0x48a09e[_0x5113('0x10a')],_0x282ecf[_0x5113('0x108')]):util[_0x5113('0xb2')](_0x5113('0x10b'),_0x48a09e['interval'])},client9002)[_0x5113('0x20')](function(_0x961396){var _0x430fe8=_0x961396&&_0x961396[_0x5113('0x10c')](_0x5113('0x10d'))>=0x0?!![]:![];logger[_0x5113('0x21')](_0x5113('0x10e'),_0x282ecf['id'],_0x48a09e['id'],_0x48a09e[_0x5113('0x10a')],_0x430fe8?_0x5113('0x10f'):_0x5113('0x110'),_0x282ecf[_0x5113('0x108')]?_0x282ecf[_0x5113('0x108')]:_0x5113('0x111'));return _0x430fe8;})['catch'](function(_0x2a5971){logger[_0x5113('0x26')](_0x5113('0x10e'),_0x282ecf['id'],_0x48a09e['id'],_0x48a09e[_0x5113('0x10a')],util['inspect'](_0x2a5971,{'showHidden':![],'depth':null}),_0x282ecf[_0x5113('0x108')]?_0x282ecf[_0x5113('0x108')]:_0x5113('0x111'));return![];});}exports[_0x5113('0x107')]=function(_0x12833e,_0x3362c4,_0x964f9){var _0x31b8df=0x0;var _0x2881f7=0x0;var _0x56f460=![];var _0x25b6a5;var _0x3bb182;return db[_0x5113('0x3f')][_0x5113('0x5c')]({'where':{'id':_0x12833e[_0x5113('0x66')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x5113('0x112')],'as':_0x5113('0x113'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3362c4,null))[_0x5113('0x20')](function(_0x1ad718){if(_0x1ad718){_0x25b6a5=_0x1ad718;return _0x1ad718[_0x5113('0x114')]({'raw':!![]});}})[_0x5113('0x20')](function(_0x4dfc96){if(_0x25b6a5){if(_0x4dfc96){_0x3bb182=_0x4dfc96;}}return require(_0x5113('0x17'))[_0x5113('0x7f')]();})[_0x5113('0x20')](function(_0x873844){if(_0x873844){_0x2881f7=_0x873844[_0x5113('0x115')];_0x56f460=_0x873844[_0x5113('0x80')];}})[_0x5113('0x20')](function(){return db[_0x5113('0xb9')][_0x5113('0x32')]({'where':{'closed':![]}});})['then'](function(_0x1bb89d){_0x31b8df=_0x1bb89d;if(_0x2881f7&&_0x1bb89d>_0x2881f7){return db[_0x5113('0x116')][_0x5113('0x6a')]({'where':{'id':0x1}})[_0x5113('0x20')](function(_0x363d68){if(_0x363d68){_0x363d68['increment'](_0x5113('0x117'));}});}})[_0x5113('0x20')](function(){if(_0x25b6a5[_0x5113('0x112')]&&_0x25b6a5[_0x5113('0x112')][_0x5113('0x113')]){var _0x930971=[];for(var _0x4bb103=0x0;_0x4bb103<_0x25b6a5['Interval']['Intervals']['length'];_0x4bb103++){var _0x4bc898=_0x25b6a5[_0x5113('0x112')][_0x5113('0x113')][_0x4bb103][_0x5113('0x37')]({'plain':!![]});_0x930971[_0x5113('0xc2')](iftimePromise(_0x4bc898,_0x25b6a5));}return BPromise[_0x5113('0x118')](_0x930971)[_0x5113('0x20')](function(_0x3f185e){return _[_0x5113('0x119')](_0x3f185e);});}else{return!![];}})[_0x5113('0x20')](function(_0x452497){var _0x5bd475=fs['readFileSync'](path[_0x5113('0x7c')](config['root'],_0x5113('0x11a')),_0x5113('0xd8'));var _0x120e98={'remote':_0x25b6a5['remote'],'query':querystring[_0x5113('0x11b')](_[_0x5113('0x54')](_0x25b6a5['get']({'plain':!![]}),{'customerIp':_0x12833e[_0x5113('0x8d')][_0x5113('0xab')]||_0x12833e[_0x5113('0x8d')]['x-real-ip']||_0x12833e[_0x5113('0x11c')]['remoteAddress']||_0x12833e['ip'],'referer':_0x12833e[_0x5113('0x8d')]['referer'],'openedInteractions':_0x31b8df,'maxInteractions':_0x2881f7,'virtual':_0x56f460[_0x5113('0x115')],'online':_0x452497,'custom':_0x56f460}))['replace'](/'/g,'\x5c\x27')};_0x3362c4[_0x5113('0xd1')](ejs['render'](Mustache['render'](_0x5bd475,_0x120e98),{'proactiveActions':_0x3bb182,'alignment':_0x25b6a5['alignment'],'verticalAlignment':_0x25b6a5[_0x5113('0x11d')],'div_color':_0x25b6a5[_0x5113('0x11e')],'text_color':_0x25b6a5[_0x5113('0x11f')],'button_color':_0x25b6a5['color_button'],'background_color':_0x25b6a5[_0x5113('0x120')]}));})['catch'](handleError(_0x3362c4,null));};exports[_0x5113('0x121')]=function(_0xeeb893,_0x236a94,_0x1aeb45){return db[_0x5113('0x3f')][_0x5113('0x6a')]({'where':{'id':_0xeeb893['params']['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x236a94,null))[_0x5113('0x20')](function(_0x4c8f93){if(_0x4c8f93){return db['sequelize'][_0x5113('0xe1')](function(_0x17185a){return db[_0x5113('0x9e')][_0x5113('0x36')]({'where':{'ChatWebsiteId':_0xeeb893[_0x5113('0x66')]['id']},'transaction':_0x17185a})[_0x5113('0x20')](function(_0x48502f){var _0x468bba=_[_0x5113('0x44')](_0xeeb893[_0x5113('0x5e')],function(_0x138228){_0x138228[_0x5113('0x68')]=_0xeeb893[_0x5113('0x66')]['id'];return _0x138228;});return db[_0x5113('0x9e')][_0x5113('0xe3')](_0x468bba,{'transaction':_0x17185a});});})['then'](function(){return db[_0x5113('0x9e')]['findAndCountAll']({'where':{'ChatWebsiteId':_0xeeb893[_0x5113('0x66')]['id']},'order':_0x5113('0xa4')});});}})['then'](respondWithResult(_0x236a94,null))['catch'](handleError(_0x236a94,null));};exports[_0x5113('0x122')]=function(_0x16f0ca,_0x180c66,_0x2485b0){var _0x55b989={};var _0x514869={};var _0x49189f;var _0x142f68;return db['ChatWebsite'][_0x5113('0x6a')]({'where':{'id':_0x16f0ca[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x180c66,null))[_0x5113('0x20')](function(_0x341ffb){if(_0x341ffb){_0x49189f=_0x341ffb;_0x514869[_0x5113('0x43')]=_[_0x5113('0x5a')](db[_0x5113('0x9e')][_0x5113('0x40')]);_0x514869[_0x5113('0x45')]=_[_0x5113('0x5a')](_0x16f0ca[_0x5113('0x45')]);_0x514869['filters']=_[_0x5113('0x47')](_0x514869['model'],_0x514869['query']);_0x55b989[_0x5113('0x49')]=_[_0x5113('0x47')](_0x514869[_0x5113('0x43')],qs['fields'](_0x16f0ca[_0x5113('0x45')][_0x5113('0x48')]));_0x55b989[_0x5113('0x49')]=_0x55b989['attributes']['length']?_0x55b989[_0x5113('0x49')]:_0x514869[_0x5113('0x43')];_0x55b989[_0x5113('0x4d')]=qs[_0x5113('0x4e')](_0x16f0ca[_0x5113('0x45')][_0x5113('0x4e')]);_0x55b989['where']=qs['filters'](_[_0x5113('0x50')](_0x16f0ca[_0x5113('0x45')],_0x514869[_0x5113('0x46')]));if(_0x16f0ca['query']['filter']){_0x55b989[_0x5113('0x4f')]=_[_0x5113('0x54')](_0x55b989[_0x5113('0x4f')],{'$or':_[_0x5113('0x44')](_0x55b989[_0x5113('0x49')],function(_0x2b9d3f){var _0x2f72f7={};_0x2f72f7[_0x2b9d3f]={'$like':'%'+_0x16f0ca['query']['filter']+'%'};return _0x2f72f7;})});}_0x55b989=_[_0x5113('0x54')]({},_0x55b989,_0x16f0ca[_0x5113('0x55')]);return _0x49189f[_0x5113('0x122')](_0x55b989);}})[_0x5113('0x20')](function(_0x10e34f){if(_0x10e34f){_0x142f68=_0x10e34f[_0x5113('0x4a')];if(!_0x16f0ca['query'][_0x5113('0x4b')](_0x5113('0x4c'))){_0x55b989[_0x5113('0x30')]=qs[_0x5113('0x30')](_0x16f0ca[_0x5113('0x45')]['limit']);_0x55b989[_0x5113('0x2f')]=qs[_0x5113('0x2f')](_0x16f0ca[_0x5113('0x45')][_0x5113('0x2f')]);}return _0x49189f[_0x5113('0x122')](_0x55b989);}})[_0x5113('0x20')](function(_0x14b1a2){if(_0x14b1a2){return _0x14b1a2?{'count':_0x142f68,'rows':_0x14b1a2}:null;}})[_0x5113('0x20')](respondWithResult(_0x180c66,null))[_0x5113('0x2a')](handleError(_0x180c66,null));};exports['addProactiveActions']=function(_0x4f3dba,_0x4202d2,_0x3bb468){return db[_0x5113('0x123')]['find']({'where':{'id':_0x4f3dba[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x4202d2,null))['then'](function(_0x383a07){if(_0x383a07){return _0x383a07[_0x5113('0x124')](_0x4f3dba[_0x5113('0x5e')][_0x5113('0x6d')],_[_0x5113('0xfe')](_0x4f3dba[_0x5113('0x5e')],[_0x5113('0x6d'),'id'])||{});}})[_0x5113('0x20')](respondWithResult(_0x4202d2,null))[_0x5113('0x2a')](handleError(_0x4202d2,null));};exports[_0x5113('0x114')]=function(_0x140d27,_0x2ac9cb,_0x1309cd){var _0x450e54={};var _0x20b184={};var _0x3de14a;var _0x8291af;return db[_0x5113('0x3f')][_0x5113('0x6a')]({'where':{'id':_0x140d27[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x2ac9cb,null))['then'](function(_0x45eb5e){if(_0x45eb5e){_0x3de14a=_0x45eb5e;_0x20b184['model']=_[_0x5113('0x5a')](db[_0x5113('0x125')][_0x5113('0x40')]);_0x20b184[_0x5113('0x45')]=_['keys'](_0x140d27['query']);_0x20b184[_0x5113('0x46')]=_[_0x5113('0x47')](_0x20b184['model'],_0x20b184['query']);_0x450e54[_0x5113('0x49')]=_['intersection'](_0x20b184[_0x5113('0x43')],qs[_0x5113('0x48')](_0x140d27[_0x5113('0x45')][_0x5113('0x48')]));_0x450e54['attributes']=_0x450e54[_0x5113('0x49')][_0x5113('0x4a')]?_0x450e54[_0x5113('0x49')]:_0x20b184[_0x5113('0x43')];_0x450e54[_0x5113('0x4d')]=qs[_0x5113('0x4e')](_0x140d27['query']['sort']);_0x450e54[_0x5113('0x4f')]=qs['filters'](_[_0x5113('0x50')](_0x140d27[_0x5113('0x45')],_0x20b184[_0x5113('0x46')]));if(_0x140d27[_0x5113('0x45')][_0x5113('0x53')]){_0x450e54[_0x5113('0x4f')]=_[_0x5113('0x54')](_0x450e54[_0x5113('0x4f')],{'$or':_[_0x5113('0x44')](_0x450e54['attributes'],function(_0x3566e1){var _0x598298={};_0x598298[_0x3566e1]={'$like':'%'+_0x140d27[_0x5113('0x45')][_0x5113('0x53')]+'%'};return _0x598298;})});}_0x450e54=_[_0x5113('0x54')]({},_0x450e54,_0x140d27['options']);return _0x3de14a[_0x5113('0x114')](_0x450e54);}})[_0x5113('0x20')](function(_0x4fce0a){if(_0x4fce0a){_0x8291af=_0x4fce0a[_0x5113('0x4a')];if(!_0x140d27[_0x5113('0x45')]['hasOwnProperty'](_0x5113('0x4c'))){_0x450e54['limit']=qs[_0x5113('0x30')](_0x140d27['query'][_0x5113('0x30')]);_0x450e54[_0x5113('0x2f')]=qs[_0x5113('0x2f')](_0x140d27[_0x5113('0x45')][_0x5113('0x2f')]);}return _0x3de14a[_0x5113('0x114')](_0x450e54);}})[_0x5113('0x20')](function(_0x2e4be5){if(_0x2e4be5){return _0x2e4be5?{'count':_0x8291af,'rows':_0x2e4be5}:null;}})[_0x5113('0x20')](respondWithResult(_0x2ac9cb,null))[_0x5113('0x2a')](handleError(_0x2ac9cb,null));};exports['getFields']=function(_0x19256c,_0x4c5c4a,_0x8cf91d){var _0x2aea90=_0x19256c[_0x5113('0x45')]['online']===_0x5113('0x126')?'offlineForm':_0x5113('0x127');return db['ChatWebsite'][_0x5113('0x5c')]({'attributes':['id',_0x2aea90],'where':{'id':_0x19256c[_0x5113('0x66')]['id']}})['then'](handleEntityNotFound(_0x4c5c4a,null))[_0x5113('0x20')](function(_0x2dc847){if(_0x2dc847){var _0x17f277=_0x2dc847[_0x2aea90];var _0x22a8b0=_0x17f277&&_0x17f277[_0x5113('0x128')]?_0x17f277['items']:[];_0x4c5c4a[_0x5113('0xd1')]({'fromKey':_['isNil'](_0x17f277[_0x5113('0x129')])?undefined:_0x17f277[_0x5113('0x129')],'count':_0x22a8b0['length'],'rows':_0x22a8b0});}})[_0x5113('0x2a')](handleError(_0x4c5c4a,null));};exports[_0x5113('0x12a')]=function(_0x3de431,_0x422cb9,_0xb5f24c){var _0x15426b={'raw':![],'where':{}};var _0x485f84={};var _0x22e72e={'count':0x0,'rows':[]};return db[_0x5113('0x3f')][_0x5113('0x6a')]({'where':{'id':_0x3de431[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x422cb9,null))[_0x5113('0x20')](function(_0x78166f){if(_0x78166f){_0x485f84[_0x5113('0x43')]=_[_0x5113('0x5a')](db[_0x5113('0xdb')][_0x5113('0x40')]);_0x485f84[_0x5113('0x45')]=_[_0x5113('0x5a')](_0x3de431[_0x5113('0x45')]);_0x485f84[_0x5113('0x46')]=_[_0x5113('0x47')](_0x485f84[_0x5113('0x43')],_0x485f84[_0x5113('0x45')]);_0x15426b[_0x5113('0x49')]=_[_0x5113('0x47')](_0x485f84[_0x5113('0x43')],qs['fields'](_0x3de431[_0x5113('0x45')][_0x5113('0x48')]));_0x15426b[_0x5113('0x49')]=_0x15426b[_0x5113('0x49')]['length']?_0x15426b['attributes']:_0x485f84[_0x5113('0x43')];if(!_0x3de431[_0x5113('0x45')][_0x5113('0x4b')](_0x5113('0x4c'))){_0x15426b[_0x5113('0x30')]=qs['limit'](_0x3de431[_0x5113('0x45')][_0x5113('0x30')]);_0x15426b[_0x5113('0x2f')]=qs[_0x5113('0x2f')](_0x3de431[_0x5113('0x45')][_0x5113('0x2f')]);}_0x15426b[_0x5113('0x4d')]=qs[_0x5113('0x4e')](_0x3de431['query'][_0x5113('0x4e')]);_0x15426b[_0x5113('0x4f')]=qs[_0x5113('0x46')](_[_0x5113('0x50')](_0x3de431['query'],_0x485f84[_0x5113('0x46')]));_0x15426b[_0x5113('0x4f')]['ChatWebsiteId']=_0x78166f['id'];if(_0x3de431[_0x5113('0x45')]['filter']){_0x15426b[_0x5113('0x4f')]=_[_0x5113('0x54')](_0x15426b[_0x5113('0x4f')],{'$or':_[_0x5113('0x44')](_0x15426b[_0x5113('0x49')],function(_0x5c0e9a){var _0x431ff2={};_0x431ff2[_0x5c0e9a]={'$like':'%'+_0x3de431[_0x5113('0x45')]['filter']+'%'};return _0x431ff2;})});}_0x15426b=_['merge']({},_0x15426b,_0x3de431[_0x5113('0x55')]);return db[_0x5113('0xdb')]['count']({'where':_0x15426b[_0x5113('0x4f')]})['then'](function(_0x5414d9){_0x22e72e[_0x5113('0x32')]=_0x5414d9;if(_0x3de431[_0x5113('0x45')]['includeAll']){_0x15426b['include']=[{'all':!![]}];}else{_0x15426b[_0x5113('0x5b')]=[{'model':db[_0x5113('0xa7')],'as':_0x5113('0x100'),'required':![]},{'model':db[_0x5113('0xe2')],'as':_0x5113('0x12b'),'required':![]}];}return db[_0x5113('0xdb')]['findAll'](_0x15426b);})[_0x5113('0x20')](function(_0x593bcb){_0x22e72e['rows']=_0x593bcb;return _0x22e72e;});}})[_0x5113('0x20')](respondWithFilteredResult(_0x422cb9,_0x15426b))[_0x5113('0x2a')](handleError(_0x422cb9,null));};exports[_0x5113('0x12c')]=function(_0x5f1954,_0x25faae,_0x1d359c){return db[_0x5113('0x3f')]['find']({'where':{'id':_0x5f1954[_0x5113('0x66')]['id']}})['then'](handleEntityNotFound(_0x25faae,null))[_0x5113('0x20')](function(_0x23ea5d){if(_0x23ea5d){return _0x23ea5d[_0x5113('0x12c')](_0x5f1954[_0x5113('0x5e')][_0x5113('0x6d')],_[_0x5113('0xfe')](_0x5f1954[_0x5113('0x5e')],[_0x5113('0x6d'),'id'])||{})[_0x5113('0xbd')](function(_0x33cc6c){for(var _0x583e43=0x0;_0x583e43<_0x5f1954[_0x5113('0x5e')][_0x5113('0x6d')][_0x5113('0x4a')];_0x583e43+=0x1){socket[_0x5113('0x12d')](_0x5113('0x12e'),{'UserId':Number(_0x5f1954[_0x5113('0x5e')][_0x5113('0x6d')][_0x583e43]),'ChatWebsiteId':Number(_0x5f1954[_0x5113('0x66')]['id'])});}return _0x33cc6c;});}})[_0x5113('0x20')](respondWithResult(_0x25faae,null))[_0x5113('0x2a')](handleError(_0x25faae,null));};exports[_0x5113('0x12f')]=function(_0x458cf2,_0x3aede0,_0x3cf7c5){return db[_0x5113('0x3f')][_0x5113('0x5c')]({'where':{'id':_0x458cf2['params']['id']}})['then'](handleEntityNotFound(_0x3aede0,null))['then'](function(_0x48a938){if(_0x48a938){return _0x48a938[_0x5113('0x12f')](_0x458cf2[_0x5113('0x45')][_0x5113('0x6d')])[_0x5113('0x20')](function(){if(_[_0x5113('0x130')](_0x458cf2[_0x5113('0x45')][_0x5113('0x6d')])){for(var _0x59ce3f=0x0;_0x59ce3f<_0x458cf2[_0x5113('0x45')][_0x5113('0x6d')][_0x5113('0x4a')];_0x59ce3f+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x458cf2[_0x5113('0x45')][_0x5113('0x6d')][_0x59ce3f]),'ChatWebsiteId':Number(_0x458cf2[_0x5113('0x66')]['id'])});}}else{socket['emit'](_0x5113('0x131'),{'UserId':Number(_0x458cf2[_0x5113('0x45')]['ids']),'ChatWebsiteId':Number(_0x458cf2[_0x5113('0x66')]['id'])});}});}})[_0x5113('0x20')](respondWithStatusCode(_0x3aede0,null))[_0x5113('0x2a')](handleError(_0x3aede0,null));};exports['getAgents']=function(_0x29e794,_0x251e4d,_0x57947c){var _0x57d908={};var _0xe630fe={};var _0x2cbc92;var _0x301a64;return db[_0x5113('0x3f')]['findOne']({'where':{'id':_0x29e794[_0x5113('0x66')]['id']}})[_0x5113('0x20')](handleEntityNotFound(_0x251e4d,null))[_0x5113('0x20')](function(_0x56c9e4){if(_0x56c9e4){_0x2cbc92=_0x56c9e4;_0xe630fe[_0x5113('0x43')]=_[_0x5113('0x5a')](db['User'][_0x5113('0x40')]);_0xe630fe[_0x5113('0x45')]=_[_0x5113('0x5a')](_0x29e794['query']);_0xe630fe['filters']=_['intersection'](_0xe630fe['model'],_0xe630fe['query']);_0x57d908[_0x5113('0x49')]=_[_0x5113('0x47')](_0xe630fe[_0x5113('0x43')],qs[_0x5113('0x48')](_0x29e794[_0x5113('0x45')]['fields']));_0x57d908[_0x5113('0x49')]=_0x57d908['attributes'][_0x5113('0x4a')]?_0x57d908[_0x5113('0x49')]:_0xe630fe[_0x5113('0x43')];_0x57d908[_0x5113('0x4d')]=qs['sort'](_0x29e794['query']['sort']);_0x57d908[_0x5113('0x4f')]=qs['filters'](_['pick'](_0x29e794['query'],_0xe630fe[_0x5113('0x46')]));if(_0x29e794[_0x5113('0x45')][_0x5113('0x53')]){_0x57d908['where']=_[_0x5113('0x54')](_0x57d908[_0x5113('0x4f')],{'$or':_[_0x5113('0x44')](_0x57d908['attributes'],function(_0x4f91e7){var _0x36f3bb={};_0x36f3bb[_0x4f91e7]={'$like':'%'+_0x29e794[_0x5113('0x45')][_0x5113('0x53')]+'%'};return _0x36f3bb;})});}_0x57d908=_['merge']({},_0x57d908,_0x29e794['options']);return _0x2cbc92[_0x5113('0x132')](_0x57d908);}})[_0x5113('0x20')](function(_0x1ddf23){if(_0x1ddf23){_0x301a64=_0x1ddf23[_0x5113('0x4a')];if(!_0x29e794[_0x5113('0x45')][_0x5113('0x4b')](_0x5113('0x4c'))){_0x57d908[_0x5113('0x30')]=qs['limit'](_0x29e794['query']['limit']);_0x57d908[_0x5113('0x2f')]=qs[_0x5113('0x2f')](_0x29e794[_0x5113('0x45')][_0x5113('0x2f')]);}return _0x2cbc92[_0x5113('0x132')](_0x57d908);}})['then'](function(_0x51c9eb){if(_0x51c9eb){return _0x51c9eb?{'count':_0x301a64,'rows':_0x51c9eb}:null;}})[_0x5113('0x20')](respondWithResult(_0x251e4d,null))['catch'](handleError(_0x251e4d,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index d7f72bd..3eaeace 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 _0x5301=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','emit','hook'];(function(_0x1a27f3,_0x1c082d){var _0x3ce222=function(_0x3f93e1){while(--_0x3f93e1){_0x1a27f3['push'](_0x1a27f3['shift']());}};_0x3ce222(++_0x1c082d);}(_0x5301,0x157));var _0x1530=function(_0x1a0f8c,_0xc70292){_0x1a0f8c=_0x1a0f8c-0x0;var _0xb3b223=_0x5301[_0x1a0f8c];return _0xb3b223;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x1530('0x0'))['db'][_0x1530('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1530('0x2')](0x0);var events={'afterCreate':_0x1530('0x3'),'afterUpdate':_0x1530('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1fa680){return function(_0x639c58,_0x134a01,_0xf2bc70){ChatWebsiteEvents['emit'](_0x1fa680+':'+_0x639c58['id'],_0x639c58);ChatWebsiteEvents[_0x1530('0x5')](_0x1fa680,_0x639c58);_0xf2bc70(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x1530('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x8255=['events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x596a97,_0x3ae7cf){var _0x1dfbfc=function(_0x5a2c1e){while(--_0x5a2c1e){_0x596a97['push'](_0x596a97['shift']());}};_0x1dfbfc(++_0x3ae7cf);}(_0x8255,0x176));var _0x5825=function(_0x12306d,_0x40c425){_0x12306d=_0x12306d-0x0;var _0x47de4e=_0x8255[_0x12306d];return _0x47de4e;};'use strict';var EventEmitter=require(_0x5825('0x0'));var ChatWebsite=require(_0x5825('0x1'))['db'][_0x5825('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x5825('0x3')](0x0);var events={'afterCreate':_0x5825('0x4'),'afterUpdate':_0x5825('0x5'),'afterDestroy':_0x5825('0x6')};function emitEvent(_0x4b18ba){return function(_0x4d1534,_0x5f2bc3,_0x29b5f3){ChatWebsiteEvents[_0x5825('0x7')](_0x4b18ba+':'+_0x4d1534['id'],_0x4d1534);ChatWebsiteEvents[_0x5825('0x7')](_0x4b18ba,_0x4d1534);_0x29b5f3(null);};}for(var e in events){if(events[_0x5825('0x8')](e)){var event=events[e];ChatWebsite[_0x5825('0x9')](e,emitEvent(event));}}module[_0x5825('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index dd1820f..3fb64a0 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 _0x4ad1=['rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x52ae56,_0x3b45dd){var _0x5b5405=function(_0x2d8c43){while(--_0x2d8c43){_0x52ae56['push'](_0x52ae56['shift']());}};_0x5b5405(++_0x3b45dd);}(_0x4ad1,0x199));var _0x14ad=function(_0x34605f,_0xa893e6){_0x34605f=_0x34605f-0x0;var _0x18195d=_0x4ad1[_0x34605f];return _0x18195d;};'use strict';var _=require(_0x14ad('0x0'));var util=require(_0x14ad('0x1'));var logger=require(_0x14ad('0x2'))('api');var moment=require(_0x14ad('0x3'));var BPromise=require(_0x14ad('0x4'));var rp=require(_0x14ad('0x5'));var fs=require('fs');var path=require(_0x14ad('0x6'));var rimraf=require(_0x14ad('0x7'));var config=require('../../config/environment');var attributes=require(_0x14ad('0x8'));module[_0x14ad('0x9')]=function(_0x54d7c8,_0x51898d){return _0x54d7c8[_0x14ad('0xa')](_0x14ad('0xb'),attributes,{'tableName':_0x14ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbc21=['ChatWebsite','chat_websites','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define'];(function(_0x9ff997,_0x2b470d){var _0x92abc9=function(_0x309487){while(--_0x309487){_0x9ff997['push'](_0x9ff997['shift']());}};_0x92abc9(++_0x2b470d);}(_0xbc21,0xd2));var _0x1bc2=function(_0x5eb264,_0x37398d){_0x5eb264=_0x5eb264-0x0;var _0x2fd477=_0xbc21[_0x5eb264];return _0x2fd477;};'use strict';var _=require(_0x1bc2('0x0'));var util=require(_0x1bc2('0x1'));var logger=require('../../config/logger')(_0x1bc2('0x2'));var moment=require(_0x1bc2('0x3'));var BPromise=require(_0x1bc2('0x4'));var rp=require(_0x1bc2('0x5'));var fs=require('fs');var path=require(_0x1bc2('0x6'));var rimraf=require(_0x1bc2('0x7'));var config=require('../../config/environment');var attributes=require(_0x1bc2('0x8'));module[_0x1bc2('0x9')]=function(_0x33191a,_0x188ff6){return _0x33191a[_0x1bc2('0xa')](_0x1bc2('0xb'),attributes,{'tableName':_0x1bc2('0xc'),'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 dd75c3f..6b33112 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 _0x030d=['stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x2dd3c0,_0x46bd46){var _0x42ef87=function(_0x3823a5){while(--_0x3823a5){_0x2dd3c0['push'](_0x2dd3c0['shift']());}};_0x42ef87(++_0x46bd46);}(_0x030d,0x1af));var _0xd030=function(_0x32dbcd,_0x463cd2){_0x32dbcd=_0x32dbcd-0x0;var _0x303818=_0x030d[_0x32dbcd];return _0x303818;};'use strict';var _=require(_0xd030('0x0'));var util=require(_0xd030('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd030('0x2'));var fs=require('fs');var Redis=require(_0xd030('0x3'));var db=require(_0xd030('0x4'))['db'];var utils=require(_0xd030('0x5'));var logger=require(_0xd030('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd030('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd030('0x8')],{'host':_0xd030('0x9'),'port':0x18eb});var socket=require(_0xd030('0xa'))(new Redis(config[_0xd030('0x8')]));require(_0xd030('0xb'))[_0xd030('0xc')](socket);function respondWithRpcPromise(_0x546d32,_0x3cafc8,_0x26331a){return new BPromise(function(_0x5c7186,_0x2136c4){return client[_0xd030('0xd')](_0x546d32,_0x26331a)['then'](function(_0x8c5ba6){logger[_0xd030('0xe')](_0xd030('0xf'),_0x3cafc8,_0xd030('0x10'));logger[_0xd030('0x11')](_0xd030('0x12'),_0x3cafc8,_0xd030('0x10'),JSON[_0xd030('0x13')](_0x8c5ba6));if(_0x8c5ba6[_0xd030('0x14')]){if(_0x8c5ba6[_0xd030('0x14')][_0xd030('0x15')]===0x1f4){logger[_0xd030('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x3cafc8,_0x8c5ba6[_0xd030('0x14')][_0xd030('0x16')]);return _0x2136c4(_0x8c5ba6[_0xd030('0x14')][_0xd030('0x16')]);}logger[_0xd030('0x14')](_0xd030('0xf'),_0x3cafc8,_0x8c5ba6[_0xd030('0x14')]['message']);return _0x5c7186(_0x8c5ba6[_0xd030('0x14')][_0xd030('0x16')]);}else{logger[_0xd030('0xe')](_0xd030('0xf'),_0x3cafc8,'request\x20sent');_0x5c7186(_0x8c5ba6[_0xd030('0x17')]['message']);}})[_0xd030('0x18')](function(_0x15785e){logger[_0xd030('0x14')](_0xd030('0xf'),_0x3cafc8,_0x15785e);_0x2136c4(_0x15785e);});});}
\ No newline at end of file
+var _0x9d0e=['http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0xb517fb,_0x1ae8bc){var _0x348a16=function(_0x4afe31){while(--_0x4afe31){_0xb517fb['push'](_0xb517fb['shift']());}};_0x348a16(++_0x1ae8bc);}(_0x9d0e,0x155));var _0xe9d0=function(_0x2c9e0d,_0x32ef56){_0x2c9e0d=_0x2c9e0d-0x0;var _0x5dcb5a=_0x9d0e[_0x2c9e0d];return _0x5dcb5a;};'use strict';var _=require(_0xe9d0('0x0'));var util=require('util');var moment=require(_0xe9d0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe9d0('0x2'));var fs=require('fs');var Redis=require(_0xe9d0('0x3'));var db=require(_0xe9d0('0x4'))['db'];var utils=require(_0xe9d0('0x5'));var logger=require(_0xe9d0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe9d0('0x7'));var client=jayson[_0xe9d0('0x8')][_0xe9d0('0x9')]({'port':0x232a});config[_0xe9d0('0xa')]=_[_0xe9d0('0xb')](config[_0xe9d0('0xa')],{'host':_0xe9d0('0xc'),'port':0x18eb});var socket=require(_0xe9d0('0xd'))(new Redis(config[_0xe9d0('0xa')]));require(_0xe9d0('0xe'))['register'](socket);function respondWithRpcPromise(_0x51f58e,_0x4ddea1,_0x2a66d7){return new BPromise(function(_0x248ecb,_0x4479d7){return client[_0xe9d0('0xf')](_0x51f58e,_0x2a66d7)[_0xe9d0('0x10')](function(_0x1f5147){logger['info'](_0xe9d0('0x11'),_0x4ddea1,'request\x20sent');logger[_0xe9d0('0x12')](_0xe9d0('0x13'),_0x4ddea1,_0xe9d0('0x14'),JSON['stringify'](_0x1f5147));if(_0x1f5147[_0xe9d0('0x15')]){if(_0x1f5147[_0xe9d0('0x15')]['code']===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4ddea1,_0x1f5147['error'][_0xe9d0('0x16')]);return _0x4479d7(_0x1f5147[_0xe9d0('0x15')][_0xe9d0('0x16')]);}logger[_0xe9d0('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x4ddea1,_0x1f5147[_0xe9d0('0x15')][_0xe9d0('0x16')]);return _0x248ecb(_0x1f5147[_0xe9d0('0x15')][_0xe9d0('0x16')]);}else{logger[_0xe9d0('0x17')](_0xe9d0('0x11'),_0x4ddea1,_0xe9d0('0x14'));_0x248ecb(_0x1f5147[_0xe9d0('0x18')][_0xe9d0('0x16')]);}})['catch'](function(_0x3ec895){logger['error'](_0xe9d0('0x11'),_0x4ddea1,_0x3ec895);_0x4479d7(_0x3ec895);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 66d2548..1449d30 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 _0x74db=['./chatWebsite.events','save','remove','update','emit','removeListener','register','length','chatWebsite:'];(function(_0x335eca,_0x23bee1){var _0x4a9e78=function(_0x5ef1ec){while(--_0x5ef1ec){_0x335eca['push'](_0x335eca['shift']());}};_0x4a9e78(++_0x23bee1);}(_0x74db,0xd8));var _0xb74d=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0x74db[_0x4ed4d2];return _0x15ae2e;};'use strict';var ChatWebsiteEvents=require(_0xb74d('0x0'));var events=[_0xb74d('0x1'),_0xb74d('0x2'),_0xb74d('0x3')];function createListener(_0xbad380,_0x478661){return function(_0x1c8b7e){_0x478661[_0xb74d('0x4')](_0xbad380,_0x1c8b7e);};}function removeListener(_0x501388,_0x23cf9e){return function(){ChatWebsiteEvents[_0xb74d('0x5')](_0x501388,_0x23cf9e);};}exports[_0xb74d('0x6')]=function(_0x146b4c){for(var _0x176d6a=0x0,_0x4ccf83=events[_0xb74d('0x7')];_0x176d6a<_0x4ccf83;_0x176d6a++){var _0x370af0=events[_0x176d6a];var _0x583f99=createListener(_0xb74d('0x8')+_0x370af0,_0x146b4c);ChatWebsiteEvents['on'](_0x370af0,_0x583f99);}};
\ No newline at end of file
+var _0x9add=['length','chatWebsite:','save','remove','emit','removeListener'];(function(_0x56d9c0,_0x23cac4){var _0x183ba1=function(_0x21fa23){while(--_0x21fa23){_0x56d9c0['push'](_0x56d9c0['shift']());}};_0x183ba1(++_0x23cac4);}(_0x9add,0x134));var _0xd9ad=function(_0x29653a,_0x1b9e25){_0x29653a=_0x29653a-0x0;var _0x3bfd17=_0x9add[_0x29653a];return _0x3bfd17;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xd9ad('0x0'),_0xd9ad('0x1'),'update'];function createListener(_0x45a58a,_0x242012){return function(_0x599304){_0x242012[_0xd9ad('0x2')](_0x45a58a,_0x599304);};}function removeListener(_0x6abb81,_0x64ce7b){return function(){ChatWebsiteEvents[_0xd9ad('0x3')](_0x6abb81,_0x64ce7b);};}exports['register']=function(_0x348431){for(var _0x462f3d=0x0,_0x1d57f4=events[_0xd9ad('0x4')];_0x462f3d<_0x1d57f4;_0x462f3d++){var _0x35bc6d=events[_0x462f3d];var _0x8d5ffb=createListener(_0xd9ad('0x5')+_0x35bc6d,_0x348431);ChatWebsiteEvents['on'](_0x35bc6d,_0x8d5ffb);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 456bf54..9a1fdec 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 _0x9d99=['addAnswer','diskStorage','join','root','format','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','now','/:id/avatar','addAvatar','addSystemAvatar','/:id/notify','notify','server/files','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','update','destroy','delete','removeAnswers','removeAgents','exports','util','path','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x9d99,0xed));var _0x99d9=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x9d99[_0x5cb1af];return _0x8d7940;};'use strict';var multer=require('multer');var util=require(_0x99d9('0x0'));var path=require(_0x99d9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x99d9('0x2'));var config=require(_0x99d9('0x3'));var controller=require(_0x99d9('0x4'));router[_0x99d9('0x5')]('/',auth[_0x99d9('0x6')](),controller[_0x99d9('0x7')]);router[_0x99d9('0x5')](_0x99d9('0x8'),auth[_0x99d9('0x6')](),controller[_0x99d9('0x9')]);router[_0x99d9('0x5')](_0x99d9('0xa'),auth[_0x99d9('0x6')](),controller[_0x99d9('0xb')]);router[_0x99d9('0x5')](_0x99d9('0xc'),auth['isAuthenticated'](),controller[_0x99d9('0xd')]);router[_0x99d9('0x5')](_0x99d9('0xe'),auth[_0x99d9('0x6')](),controller['getAnswers']);router[_0x99d9('0x5')](_0x99d9('0xf'),controller[_0x99d9('0x10')]);router['get']('/:id/avatar',controller[_0x99d9('0x11')]);router[_0x99d9('0x5')](_0x99d9('0x12'),controller['getCustomerAvatar']);router[_0x99d9('0x5')](_0x99d9('0x13'),controller[_0x99d9('0x14')]);router[_0x99d9('0x5')](_0x99d9('0x15'),auth['isAuthenticated'](),controller[_0x99d9('0x16')]);router[_0x99d9('0x5')](_0x99d9('0x17'),controller[_0x99d9('0x18')]);router[_0x99d9('0x5')](_0x99d9('0x19'),auth[_0x99d9('0x6')](),controller['getApplications']);router[_0x99d9('0x5')]('/:id/proactive_actions',auth[_0x99d9('0x6')](),controller[_0x99d9('0x1a')]);router['get'](_0x99d9('0x1b'),controller['getFields']);router[_0x99d9('0x5')](_0x99d9('0x1c'),auth[_0x99d9('0x6')](),controller[_0x99d9('0x1d')]);router['get'](_0x99d9('0x1e'),auth[_0x99d9('0x6')](),controller[_0x99d9('0x1f')]);router['post']('/',auth[_0x99d9('0x6')](),controller[_0x99d9('0x20')]);router[_0x99d9('0x21')](_0x99d9('0xc'),auth['isAuthenticated'](),controller[_0x99d9('0x22')]);router[_0x99d9('0x21')](_0x99d9('0xe'),auth[_0x99d9('0x6')](),controller[_0x99d9('0x23')]);var upload=multer({'storage':multer[_0x99d9('0x24')]({'destination':function(_0x4c54fe,_0x17246b,_0x42588d){_0x42588d(null,path[_0x99d9('0x25')](config[_0x99d9('0x26')],'server/files/images/logos/'));},'filename':function(_0x1622eb,_0x3867ad,_0x2e04cb){_0x2e04cb(null,util[_0x99d9('0x27')](_0x99d9('0x28'),Date['now'](),_0x3867ad[_0x99d9('0x29')]));}})});router[_0x99d9('0x21')]('/:id/logo',upload[_0x99d9('0x2a')](_0x99d9('0x2b')),controller[_0x99d9('0x2c')]);var upload=multer({'storage':multer[_0x99d9('0x24')]({'destination':function(_0x550071,_0x3e4465,_0x5afb12){_0x5afb12(null,path[_0x99d9('0x25')](config[_0x99d9('0x26')],_0x99d9('0x2d')));},'filename':function(_0x1c4052,_0x5d2922,_0x20117c){_0x20117c(null,util[_0x99d9('0x27')](_0x99d9('0x28'),Date[_0x99d9('0x2e')](),_0x5d2922[_0x99d9('0x29')]));}})});router['post'](_0x99d9('0x2f'),upload[_0x99d9('0x2a')](_0x99d9('0x2b')),controller[_0x99d9('0x30')]);var upload=multer({'storage':multer[_0x99d9('0x24')]({'destination':function(_0x3e9435,_0x5763ed,_0x55782d){_0x55782d(null,path[_0x99d9('0x25')](config['root'],_0x99d9('0x2d')));},'filename':function(_0x5c9608,_0x136d32,_0x5db3c3){_0x5db3c3(null,util['format']('%s-%s',Date['now'](),_0x136d32[_0x99d9('0x29')]));}})});router[_0x99d9('0x21')](_0x99d9('0x12'),upload['single'](_0x99d9('0x2b')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1dd357,_0x364d01,_0x4b4390){_0x4b4390(null,path[_0x99d9('0x25')](config[_0x99d9('0x26')],_0x99d9('0x2d')));},'filename':function(_0x32665e,_0x2404c3,_0x5a9554){_0x5a9554(null,util[_0x99d9('0x27')](_0x99d9('0x28'),Date[_0x99d9('0x2e')](),_0x2404c3['originalname']));}})});router['post']('/:id/system_avatar',upload[_0x99d9('0x2a')](_0x99d9('0x2b')),controller[_0x99d9('0x31')]);router[_0x99d9('0x21')](_0x99d9('0x32'),controller[_0x99d9('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x2934a6,_0x499e21,_0x51001c){const _0x1e7883=path[_0x99d9('0x25')](config[_0x99d9('0x26')],_0x99d9('0x34'),'attachments','offline-chat');fs_extra[_0x99d9('0x35')](_0x1e7883,function(){_0x51001c(null,_0x1e7883);});},'filename':function(_0x3a8093,_0x27adbf,_0x449589){const _0x5849a6=_0x27adbf[_0x99d9('0x29')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x37a7bd=path['extname'](_0x5849a6);const _0x45bbe5=Date['now']()+'-'+_0x5849a6[_0x99d9('0x36')](_0x37a7bd,'')+_0x37a7bd;_0x449589(null,_0x45bbe5);}})});router[_0x99d9('0x21')](_0x99d9('0x37'),offlineUploadMulter[_0x99d9('0x38')](),controller[_0x99d9('0x39')]);router[_0x99d9('0x21')](_0x99d9('0x15'),auth[_0x99d9('0x6')](),controller[_0x99d9('0x3a')]);router[_0x99d9('0x21')]('/:id/applications',auth[_0x99d9('0x6')](),controller[_0x99d9('0x3b')]);router['post']('/:id/proactive_actions',auth[_0x99d9('0x6')](),controller[_0x99d9('0x3c')]);router[_0x99d9('0x21')]('/:id/users',auth[_0x99d9('0x6')](),controller[_0x99d9('0x3d')]);router['put']('/:id',auth[_0x99d9('0x6')](),controller[_0x99d9('0x3e')]);router['delete'](_0x99d9('0xa'),auth[_0x99d9('0x6')](),controller[_0x99d9('0x3f')]);router[_0x99d9('0x40')](_0x99d9('0xc'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x99d9('0x6')](),controller[_0x99d9('0x41')]);router[_0x99d9('0x40')](_0x99d9('0x1e'),auth[_0x99d9('0x6')](),controller[_0x99d9('0x42')]);module[_0x99d9('0x43')]=router;
\ No newline at end of file
+var _0x9ad1=['post','addDisposition','join','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','now','/:id/avatar','addAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create'];(function(_0x38ff1e,_0x3b9385){var _0x3755d4=function(_0x6e6692){while(--_0x6e6692){_0x38ff1e['push'](_0x38ff1e['shift']());}};_0x3755d4(++_0x3b9385);}(_0x9ad1,0x1db));var _0x19ad=function(_0x4bb1a7,_0xfdc55c){_0x4bb1a7=_0x4bb1a7-0x0;var _0x2843f0=_0x9ad1[_0x4bb1a7];return _0x2843f0;};'use strict';var multer=require(_0x19ad('0x0'));var util=require(_0x19ad('0x1'));var path=require(_0x19ad('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x19ad('0x3')]();var fs_extra=require(_0x19ad('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x19ad('0x5'));var config=require(_0x19ad('0x6'));var controller=require(_0x19ad('0x7'));router[_0x19ad('0x8')]('/',auth[_0x19ad('0x9')](),controller[_0x19ad('0xa')]);router[_0x19ad('0x8')](_0x19ad('0xb'),auth[_0x19ad('0x9')](),controller[_0x19ad('0xc')]);router[_0x19ad('0x8')]('/:id',auth[_0x19ad('0x9')](),controller[_0x19ad('0xd')]);router['get'](_0x19ad('0xe'),auth[_0x19ad('0x9')](),controller['getDispositions']);router[_0x19ad('0x8')](_0x19ad('0xf'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x10')]);router[_0x19ad('0x8')](_0x19ad('0x11'),controller[_0x19ad('0x12')]);router[_0x19ad('0x8')]('/:id/avatar',controller['getAvatar']);router[_0x19ad('0x8')](_0x19ad('0x13'),controller[_0x19ad('0x14')]);router[_0x19ad('0x8')](_0x19ad('0x15'),controller[_0x19ad('0x16')]);router[_0x19ad('0x8')](_0x19ad('0x17'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x18')]);router[_0x19ad('0x8')]('/:id/snippet',controller['getSnippet']);router[_0x19ad('0x8')](_0x19ad('0x19'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x1a')]);router[_0x19ad('0x8')](_0x19ad('0x1b'),auth['isAuthenticated'](),controller[_0x19ad('0x1c')]);router[_0x19ad('0x8')](_0x19ad('0x1d'),controller[_0x19ad('0x1e')]);router[_0x19ad('0x8')](_0x19ad('0x1f'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x20')]);router[_0x19ad('0x8')](_0x19ad('0x21'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x22')]);router['post']('/',auth[_0x19ad('0x9')](),controller[_0x19ad('0x23')]);router[_0x19ad('0x24')]('/:id/dispositions',auth[_0x19ad('0x9')](),controller[_0x19ad('0x25')]);router[_0x19ad('0x24')](_0x19ad('0xf'),auth[_0x19ad('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b77c0,_0x17d56f,_0x2e6a4d){_0x2e6a4d(null,path[_0x19ad('0x26')](config[_0x19ad('0x27')],_0x19ad('0x28')));},'filename':function(_0x460228,_0x363fea,_0x4453ff){_0x4453ff(null,util[_0x19ad('0x29')](_0x19ad('0x2a'),Date['now'](),_0x363fea[_0x19ad('0x2b')]));}})});router['post'](_0x19ad('0x11'),upload[_0x19ad('0x2c')](_0x19ad('0x2d')),controller[_0x19ad('0x2e')]);var upload=multer({'storage':multer[_0x19ad('0x2f')]({'destination':function(_0x273ab8,_0x4f8927,_0x51456a){_0x51456a(null,path[_0x19ad('0x26')](config['root'],_0x19ad('0x30')));},'filename':function(_0x3d60be,_0xbcf851,_0x643a6a){_0x643a6a(null,util[_0x19ad('0x29')]('%s-%s',Date[_0x19ad('0x31')](),_0xbcf851['originalname']));}})});router['post'](_0x19ad('0x32'),upload['single'](_0x19ad('0x2d')),controller[_0x19ad('0x33')]);var upload=multer({'storage':multer[_0x19ad('0x2f')]({'destination':function(_0x547024,_0x50c5ba,_0x5a6ef1){_0x5a6ef1(null,path['join'](config[_0x19ad('0x27')],_0x19ad('0x30')));},'filename':function(_0x28ce5a,_0xc2170b,_0x5a86d4){_0x5a86d4(null,util[_0x19ad('0x29')](_0x19ad('0x2a'),Date[_0x19ad('0x31')](),_0xc2170b[_0x19ad('0x2b')]));}})});router[_0x19ad('0x24')](_0x19ad('0x13'),upload['single'](_0x19ad('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2f4f71,_0x19e89a,_0x81eeb6){_0x81eeb6(null,path[_0x19ad('0x26')](config[_0x19ad('0x27')],_0x19ad('0x30')));},'filename':function(_0x25088b,_0x599139,_0x34a58d){_0x34a58d(null,util[_0x19ad('0x29')](_0x19ad('0x2a'),Date['now'](),_0x599139[_0x19ad('0x2b')]));}})});router['post'](_0x19ad('0x15'),upload[_0x19ad('0x2c')](_0x19ad('0x2d')),controller[_0x19ad('0x34')]);router['post'](_0x19ad('0x35'),controller[_0x19ad('0x36')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x2e52a8,_0x232ddb,_0x336caf){const _0x123508=path[_0x19ad('0x26')](config[_0x19ad('0x27')],_0x19ad('0x37'),_0x19ad('0x38'),_0x19ad('0x39'));fs_extra[_0x19ad('0x3a')](_0x123508,function(){_0x336caf(null,_0x123508);});},'filename':function(_0x2fe47c,_0x3e49af,_0x3915ec){const _0x1bcfea=_0x3e49af[_0x19ad('0x2b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x51fcba=path[_0x19ad('0x3b')](_0x1bcfea);const _0x10b38a=Date['now']()+'-'+_0x1bcfea['replace'](_0x51fcba,'')+_0x51fcba;_0x3915ec(null,_0x10b38a);}})});router['post'](_0x19ad('0x3c'),offlineUploadMulter['any'](),controller[_0x19ad('0x3d')]);router[_0x19ad('0x24')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x19ad('0x3e')]);router[_0x19ad('0x24')](_0x19ad('0x19'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x3f')]);router[_0x19ad('0x24')](_0x19ad('0x1b'),auth['isAuthenticated'](),controller[_0x19ad('0x40')]);router[_0x19ad('0x24')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x19ad('0x41')](_0x19ad('0x42'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x43')]);router[_0x19ad('0x44')](_0x19ad('0x42'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x45')]);router['delete'](_0x19ad('0xe'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x46')]);router[_0x19ad('0x44')](_0x19ad('0xf'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x47')]);router[_0x19ad('0x44')]('/:id/users',auth[_0x19ad('0x9')](),controller[_0x19ad('0x48')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index dc99168..78c7a8d 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 _0x644f=['exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x644f,0x177));var _0xf644=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x644f[_0x455c6c];return _0x488242;};'use strict';var Sequelize=require('sequelize');module[_0xf644('0x0')]={'name':{'type':Sequelize[_0xf644('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf644('0x2')](_0xf644('0x3'),_0xf644('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xf644('0x1')]},'data2':{'type':Sequelize[_0xf644('0x1')]}};
\ No newline at end of file
+var _0x31af=['STRING','Google','sequelize','exports'];(function(_0x32d44f,_0x62b8ba){var _0x472622=function(_0x1a1d69){while(--_0x1a1d69){_0x32d44f['push'](_0x32d44f['shift']());}};_0x472622(++_0x62b8ba);}(_0x31af,0xde));var _0xf31a=function(_0x5f44ab,_0x589ad3){_0x5f44ab=_0x5f44ab-0x0;var _0x3056d7=_0x31af[_0x5f44ab];return _0x3056d7;};'use strict';var Sequelize=require(_0xf31a('0x0'));module[_0xf31a('0x1')]={'name':{'type':Sequelize[_0xf31a('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0xf31a('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xf31a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index cc973ed..aac314a 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 _0x5f66=['update','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','CloudProvider','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x45f705,_0x737e72){var _0x34a428=function(_0x4eabb1){while(--_0x4eabb1){_0x45f705['push'](_0x45f705['shift']());}};_0x34a428(++_0x737e72);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['CloudProvider'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};
\ No newline at end of file
+var _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x5f2f,0x73));var _0xf5f2=function(_0x30e092,_0x4c1763){_0x30e092=_0x30e092-0x0;var _0xdd544f=_0x5f2f[_0x30e092];return _0xdd544f;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index d78e049..871ff01 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 _0x806a=['bluebird','rimraf','../../config/environment','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api'];(function(_0x4849f6,_0x104836){var _0x1a3dcd=function(_0x494d3c){while(--_0x494d3c){_0x4849f6['push'](_0x4849f6['shift']());}};_0x1a3dcd(++_0x104836);}(_0x806a,0x1ca));var _0xa806=function(_0x10179b,_0xd79163){_0x10179b=_0x10179b-0x0;var _0x2665b8=_0x806a[_0x10179b];return _0x2665b8;};'use strict';var _=require(_0xa806('0x0'));var util=require(_0xa806('0x1'));var logger=require(_0xa806('0x2'))(_0xa806('0x3'));var moment=require('moment');var BPromise=require(_0xa806('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa806('0x5'));var config=require(_0xa806('0x6'));var attributes=require('./cloudProvider.attributes');module[_0xa806('0x7')]=function(_0x14767d,_0x6e8c7e){return _0x14767d[_0xa806('0x8')](_0xa806('0x9'),attributes,{'tableName':_0xa806('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa368=['request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','moment','bluebird'];(function(_0x4efe30,_0xfaee0){var _0x1e7485=function(_0x2afe82){while(--_0x2afe82){_0x4efe30['push'](_0x4efe30['shift']());}};_0x1e7485(++_0xfaee0);}(_0xa368,0x1c0));var _0x8a36=function(_0x2f799a,_0x3d560a){_0x2f799a=_0x2f799a-0x0;var _0x391da6=_0xa368[_0x2f799a];return _0x391da6;};'use strict';var _=require(_0x8a36('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8a36('0x1'));var BPromise=require(_0x8a36('0x2'));var rp=require(_0x8a36('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a36('0x4'));var config=require(_0x8a36('0x5'));var attributes=require(_0x8a36('0x6'));module[_0x8a36('0x7')]=function(_0x58a566,_0x3b9d29){return _0x58a566[_0x8a36('0x8')](_0x8a36('0x9'),attributes,{'tableName':_0x8a36('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 008377f..10e3c0f 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 _0x9148=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1bcc3c,_0x59f478){var _0x4cdb22=function(_0x1d259b){while(--_0x1d259b){_0x1bcc3c['push'](_0x1bcc3c['shift']());}};_0x4cdb22(++_0x59f478);}(_0x9148,0x10d));var _0x8914=function(_0x58b261,_0x3fbf7f){_0x58b261=_0x58b261-0x0;var _0x1a3c76=_0x9148[_0x58b261];return _0x1a3c76;};'use strict';var _=require(_0x8914('0x0'));var util=require(_0x8914('0x1'));var moment=require(_0x8914('0x2'));var BPromise=require(_0x8914('0x3'));var rs=require(_0x8914('0x4'));var fs=require('fs');var Redis=require(_0x8914('0x5'));var db=require(_0x8914('0x6'))['db'];var utils=require(_0x8914('0x7'));var logger=require(_0x8914('0x8'))(_0x8914('0x9'));var config=require(_0x8914('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8914('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cd146,_0x58e892,_0x1b0445){return new BPromise(function(_0x15aff5,_0x1e2d12){return client[_0x8914('0xc')](_0x1cd146,_0x1b0445)['then'](function(_0x2e7aac){logger[_0x8914('0xd')](_0x8914('0xe'),_0x58e892,_0x8914('0xf'));logger[_0x8914('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x58e892,_0x8914('0xf'),JSON[_0x8914('0x11')](_0x2e7aac));if(_0x2e7aac['error']){if(_0x2e7aac['error'][_0x8914('0x12')]===0x1f4){logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x2e7aac[_0x8914('0x13')][_0x8914('0x14')]);return _0x1e2d12(_0x2e7aac[_0x8914('0x13')]['message']);}logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x2e7aac['error'][_0x8914('0x14')]);return _0x15aff5(_0x2e7aac[_0x8914('0x13')][_0x8914('0x14')]);}else{logger[_0x8914('0xd')](_0x8914('0xe'),_0x58e892,_0x8914('0xf'));_0x15aff5(_0x2e7aac[_0x8914('0x15')][_0x8914('0x14')]);}})[_0x8914('0x16')](function(_0x4ca130){logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x4ca130);_0x1e2d12(_0x4ca130);});});}
\ No newline at end of file
+var _0xb44a=['moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','CloudProvider,\x20%s,\x20%s','debug','stringify','error','code','message','info','catch'];(function(_0x4dd266,_0x1f6227){var _0x3596e0=function(_0x419157){while(--_0x419157){_0x4dd266['push'](_0x4dd266['shift']());}};_0x3596e0(++_0x1f6227);}(_0xb44a,0x1c2));var _0xab44=function(_0x1a0600,_0x41feef){_0x1a0600=_0x1a0600-0x0;var _0x734670=_0xb44a[_0x1a0600];return _0x734670;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab44('0x0'));var BPromise=require('bluebird');var rs=require(_0xab44('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab44('0x2'));var logger=require('../../config/logger')(_0xab44('0x3'));var config=require(_0xab44('0x4'));var jayson=require(_0xab44('0x5'));var client=jayson[_0xab44('0x6')][_0xab44('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3303b1,_0x3ead8d,_0x495825){return new BPromise(function(_0x137a8c,_0x133a6d){return client[_0xab44('0x8')](_0x3303b1,_0x495825)[_0xab44('0x9')](function(_0xa14367){logger['info'](_0xab44('0xa'),_0x3ead8d,'request\x20sent');logger[_0xab44('0xb')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3ead8d,'request\x20sent',JSON[_0xab44('0xc')](_0xa14367));if(_0xa14367[_0xab44('0xd')]){if(_0xa14367[_0xab44('0xd')][_0xab44('0xe')]===0x1f4){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0xa14367['error']['message']);return _0x133a6d(_0xa14367[_0xab44('0xd')]['message']);}logger[_0xab44('0xd')]('CloudProvider,\x20%s,\x20%s',_0x3ead8d,_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);return _0x137a8c(_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);}else{logger[_0xab44('0x10')](_0xab44('0xa'),_0x3ead8d,'request\x20sent');_0x137a8c(_0xa14367['result'][_0xab44('0xf')]);}})[_0xab44('0x11')](function(_0x14fe36){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0x14fe36);_0x133a6d(_0x14fe36);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index f0072ed..41441f7 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 _0xf9b7=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','show','put','/:id','delete'];(function(_0xe902b3,_0x50293d){var _0x42f96e=function(_0x2345f2){while(--_0x2345f2){_0xe902b3['push'](_0xe902b3['shift']());}};_0x42f96e(++_0x50293d);}(_0xf9b7,0x91));var _0x7f9b=function(_0x41ce06,_0x413956){_0x41ce06=_0x41ce06-0x0;var _0x31ac1d=_0xf9b7[_0x41ce06];return _0x31ac1d;};'use strict';var multer=require(_0x7f9b('0x0'));var util=require(_0x7f9b('0x1'));var path=require(_0x7f9b('0x2'));var timeout=require(_0x7f9b('0x3'));var express=require(_0x7f9b('0x4'));var router=express[_0x7f9b('0x5')]();var fs_extra=require(_0x7f9b('0x6'));var auth=require(_0x7f9b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7f9b('0x8'));router['get']('/',auth[_0x7f9b('0x9')](),controller[_0x7f9b('0xa')]);router['get']('/:id',auth[_0x7f9b('0x9')](),controller[_0x7f9b('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7f9b('0xc')](_0x7f9b('0xd'),auth[_0x7f9b('0x9')](),controller['update']);router[_0x7f9b('0xe')](_0x7f9b('0xd'),auth['isAuthenticated'](),controller[_0x7f9b('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xb0d2=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','exports','multer'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb0d2,0x1b4));var _0x2b0d=function(_0x48f72,_0x302a09){_0x48f72=_0x48f72-0x0;var _0x32fc39=_0xb0d2[_0x48f72];return _0x32fc39;};'use strict';var multer=require(_0x2b0d('0x0'));var util=require('util');var path=require(_0x2b0d('0x1'));var timeout=require(_0x2b0d('0x2'));var express=require(_0x2b0d('0x3'));var router=express['Router']();var fs_extra=require(_0x2b0d('0x4'));var auth=require(_0x2b0d('0x5'));var interaction=require(_0x2b0d('0x6'));var config=require(_0x2b0d('0x7'));var controller=require(_0x2b0d('0x8'));router['get']('/',auth[_0x2b0d('0x9')](),controller[_0x2b0d('0xa')]);router[_0x2b0d('0xb')](_0x2b0d('0xc'),auth[_0x2b0d('0x9')](),controller[_0x2b0d('0xd')]);router[_0x2b0d('0xe')]('/',auth[_0x2b0d('0x9')](),controller[_0x2b0d('0xf')]);router[_0x2b0d('0x10')]('/:id',auth[_0x2b0d('0x9')](),controller['update']);router[_0x2b0d('0x11')](_0x2b0d('0xc'),auth[_0x2b0d('0x9')](),controller['destroy']);module[_0x2b0d('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 1af705e..03728ba 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 _0xbbc2=['exports','STRING','sequelize'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0xbbc2,0x14f));var _0x2bbc=function(_0x30502e,_0x51322f){_0x30502e=_0x30502e-0x0;var _0x37ed80=_0xbbc2[_0x30502e];return _0x37ed80;};'use strict';var Sequelize=require(_0x2bbc('0x0'));module[_0x2bbc('0x1')]={'name':{'type':Sequelize[_0x2bbc('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2bbc('0x2')]},'companyId':{'type':Sequelize[_0x2bbc('0x2')]},'website':{'type':Sequelize[_0x2bbc('0x2')]},'phone':{'type':Sequelize[_0x2bbc('0x2')]},'fax':{'type':Sequelize[_0x2bbc('0x2')]},'type':{'type':Sequelize[_0x2bbc('0x2')]},'street':{'type':Sequelize[_0x2bbc('0x2')]},'postalCode':{'type':Sequelize[_0x2bbc('0x2')]},'city':{'type':Sequelize[_0x2bbc('0x2')]},'country':{'type':Sequelize[_0x2bbc('0x2')]},'email':{'type':Sequelize[_0x2bbc('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2bbc('0x2')]},'sStreet':{'type':Sequelize[_0x2bbc('0x2')]},'sPostalCode':{'type':Sequelize[_0x2bbc('0x2')]},'sCity':{'type':Sequelize[_0x2bbc('0x2')]},'sCountry':{'type':Sequelize[_0x2bbc('0x2')]},'description':{'type':Sequelize[_0x2bbc('0x2')]}};
\ No newline at end of file
+var _0xbc17=['exports','name','STRING','sequelize'];(function(_0x184464,_0x85a4df){var _0x45581f=function(_0xd5e755){while(--_0xd5e755){_0x184464['push'](_0x184464['shift']());}};_0x45581f(++_0x85a4df);}(_0xbc17,0x1ab));var _0x7bc1=function(_0x50cc54,_0x54c15f){_0x50cc54=_0x50cc54-0x0;var _0x28ecca=_0xbc17[_0x50cc54];return _0x28ecca;};'use strict';var Sequelize=require(_0x7bc1('0x0'));module[_0x7bc1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7bc1('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7bc1('0x3')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x7bc1('0x3')]},'fax':{'type':Sequelize[_0x7bc1('0x3')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x7bc1('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x7bc1('0x3')]},'country':{'type':Sequelize[_0x7bc1('0x3')]},'email':{'type':Sequelize[_0x7bc1('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x7bc1('0x3')]},'sStreet':{'type':Sequelize[_0x7bc1('0x3')]},'sPostalCode':{'type':Sequelize[_0x7bc1('0x3')]},'sCity':{'type':Sequelize[_0x7bc1('0x3')]},'sCountry':{'type':Sequelize[_0x7bc1('0x3')]},'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 781d66f..46d7d91 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 _0x271f=['moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','UserProfileResource','error','stack','name','send','index','CmCompany','describe','keys','query','intersection','attributes','fields','length','model','nolimit','order','sort','where','pick','filters','map','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','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','update','destroy','addContacts','CmContact','ids','omit','getContacts','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x271f,0x160));var _0xf271=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x271f[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0xf271('0x0'));var rimraf=require(_0xf271('0x1'));var zipdir=require(_0xf271('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf271('0x3'));var moment=require(_0xf271('0x4'));var BPromise=require(_0xf271('0x5'));var Mustache=require(_0xf271('0x6'));var util=require(_0xf271('0x7'));var path=require('path');var sox=require(_0xf271('0x8'));var csv=require(_0xf271('0x9'));var ejs=require(_0xf271('0xa'));var fs=require('fs');var fs_extra=require(_0xf271('0xb'));var _=require('lodash');var squel=require(_0xf271('0xc'));var crypto=require('crypto');var jsforce=require(_0xf271('0xd'));var deskjs=require(_0xf271('0xe'));var toCsv=require(_0xf271('0x9'));var querystring=require(_0xf271('0xf'));var Papa=require(_0xf271('0x10'));var Redis=require('ioredis');var authService=require(_0xf271('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf271('0x12'));var hardwareService=require(_0xf271('0x13'));var logger=require('../../config/logger')(_0xf271('0x14'));var utils=require(_0xf271('0x15'));var config=require(_0xf271('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf271('0x17'))['db'];function respondWithStatusCode(_0xceedf0,_0x1acd66){_0x1acd66=_0x1acd66||0xcc;return function(_0x30dc47){if(_0x30dc47){return _0xceedf0[_0xf271('0x18')](_0x1acd66);}return _0xceedf0[_0xf271('0x19')](_0x1acd66)[_0xf271('0x1a')]();};}function respondWithResult(_0x4fd626,_0x2997ef){_0x2997ef=_0x2997ef||0xc8;return function(_0x31e0e6){if(_0x31e0e6){return _0x4fd626[_0xf271('0x19')](_0x2997ef)[_0xf271('0x1b')](_0x31e0e6);}};}function respondWithFilteredResult(_0x263093,_0x13c250){return function(_0x1b562e){if(_0x1b562e){var _0x581e4f=typeof _0x13c250[_0xf271('0x1c')]===_0xf271('0x1d')&&typeof _0x13c250[_0xf271('0x1e')]===_0xf271('0x1d');var _0x573277=_0x1b562e[_0xf271('0x1f')];var _0x34543f=_0x581e4f?0x0:_0x13c250[_0xf271('0x1c')];var _0x4ced1f=_0x581e4f?_0x1b562e['count']:_0x13c250[_0xf271('0x1c')]+_0x13c250['limit'];var _0x122537;if(_0x4ced1f>=_0x573277){_0x4ced1f=_0x573277;_0x122537=0xc8;}else{_0x122537=0xce;}_0x263093['status'](_0x122537);return _0x263093[_0xf271('0x20')](_0xf271('0x21'),_0x34543f+'-'+_0x4ced1f+'/'+_0x573277)[_0xf271('0x1b')](_0x1b562e);}return null;};}function patchUpdates(_0x5f361a){return function(_0x3ea57b){try{jsonpatch[_0xf271('0x22')](_0x3ea57b,_0x5f361a,!![]);}catch(_0x3bb43a){return BPromise[_0xf271('0x23')](_0x3bb43a);}return _0x3ea57b[_0xf271('0x24')]();};}function saveUpdates(_0x295997,_0x46dc24){return function(_0x3cf9f3){if(_0x3cf9f3){return _0x3cf9f3['update'](_0x295997)[_0xf271('0x25')](function(_0x487b89){return _0x487b89;});}return null;};}function removeEntity(_0x2ea37c,_0x95e89d){return function(_0x92cee2){if(_0x92cee2){return _0x92cee2['destroy']()[_0xf271('0x25')](function(){var _0x1ed6ce=_0x92cee2[_0xf271('0x26')]({'plain':!![]});var _0x70f88c='Companies';return db[_0xf271('0x27')]['destroy']({'where':{'type':_0x70f88c,'resourceId':_0x1ed6ce['id']}})[_0xf271('0x25')](function(){return _0x92cee2;});})[_0xf271('0x25')](function(){_0x2ea37c[_0xf271('0x19')](0xcc)[_0xf271('0x1a')]();});}};}function handleEntityNotFound(_0x106893,_0x5b925d){return function(_0x16f87a){if(!_0x16f87a){_0x106893[_0xf271('0x18')](0x194);}return _0x16f87a;};}function handleError(_0x330c81,_0x31c787){_0x31c787=_0x31c787||0x1f4;return function(_0x24bc67){logger[_0xf271('0x28')](_0x24bc67[_0xf271('0x29')]);if(_0x24bc67['name']){delete _0x24bc67[_0xf271('0x2a')];}_0x330c81['status'](_0x31c787)[_0xf271('0x2b')](_0x24bc67);};}exports[_0xf271('0x2c')]=function(_0x3482dc,_0x4c086d){var _0x5c7997={},_0x1fcda5={},_0x447ab0={'count':0x0,'rows':[]};return db[_0xf271('0x2d')][_0xf271('0x2e')]()['then'](function(_0x18a6b0){_0x1fcda5['model']=_[_0xf271('0x2f')](_0x18a6b0);_0x1fcda5[_0xf271('0x30')]=_['keys'](_0x3482dc[_0xf271('0x30')]);_0x1fcda5['filters']=_[_0xf271('0x31')](_0x1fcda5['model'],_0x1fcda5[_0xf271('0x30')]);_0x5c7997[_0xf271('0x32')]=_[_0xf271('0x31')](_0x1fcda5['model'],qs['fields'](_0x3482dc[_0xf271('0x30')][_0xf271('0x33')]));_0x5c7997[_0xf271('0x32')]=_0x5c7997[_0xf271('0x32')][_0xf271('0x34')]?_0x5c7997[_0xf271('0x32')]:_0x1fcda5[_0xf271('0x35')];if(!_0x3482dc[_0xf271('0x30')]['hasOwnProperty'](_0xf271('0x36'))){_0x5c7997[_0xf271('0x1e')]=qs[_0xf271('0x1e')](_0x3482dc[_0xf271('0x30')][_0xf271('0x1e')]);_0x5c7997[_0xf271('0x1c')]=qs['offset'](_0x3482dc[_0xf271('0x30')][_0xf271('0x1c')]);}_0x5c7997[_0xf271('0x37')]=qs[_0xf271('0x38')](_0x3482dc[_0xf271('0x30')][_0xf271('0x38')]);_0x5c7997[_0xf271('0x39')]=qs['filters'](_[_0xf271('0x3a')](_0x3482dc['query'],_0x1fcda5[_0xf271('0x3b')]),_0x18a6b0);if(_0x3482dc[_0xf271('0x30')]['filter']){_0x5c7997[_0xf271('0x39')]=_['merge'](_0x5c7997[_0xf271('0x39')],{'$or':_[_0xf271('0x3c')](_0x5c7997[_0xf271('0x32')],function(_0xe73cda){var _0x400b44={};_0x400b44[_0xe73cda]={'$like':'%'+_0x3482dc[_0xf271('0x30')]['filter']+'%'};return _0x400b44;})});}_0x5c7997=_[_0xf271('0x3d')]({},_0x5c7997,_0x3482dc[_0xf271('0x3e')]);var _0x45f045={'where':_0x5c7997[_0xf271('0x39')]};return db[_0xf271('0x2d')][_0xf271('0x1f')](_0x45f045)['then'](function(_0x1fbb56){_0x447ab0['count']=_0x1fbb56;if(_0x3482dc['query'][_0xf271('0x3f')]){_0x5c7997[_0xf271('0x40')]=[{'all':!![]}];}return db[_0xf271('0x2d')][_0xf271('0x41')](_0x5c7997);})[_0xf271('0x25')](function(_0x16dcbc){_0x447ab0[_0xf271('0x42')]=_0x16dcbc;return _0x447ab0;})[_0xf271('0x25')](respondWithFilteredResult(_0x4c086d,_0x5c7997))[_0xf271('0x43')](handleError(_0x4c086d,null));})['catch'](handleError(_0x4c086d,null));};exports['show']=function(_0xf308ad,_0x51ef9c){var _0x34e155={'raw':![],'where':{'id':_0xf308ad[_0xf271('0x44')]['id']}},_0x5768df={};_0x5768df['model']=_[_0xf271('0x2f')](db[_0xf271('0x2d')][_0xf271('0x45')]);_0x5768df[_0xf271('0x30')]=_[_0xf271('0x2f')](_0xf308ad[_0xf271('0x30')]);_0x5768df['filters']=_[_0xf271('0x31')](_0x5768df[_0xf271('0x35')],_0x5768df[_0xf271('0x30')]);_0x34e155[_0xf271('0x32')]=_[_0xf271('0x31')](_0x5768df[_0xf271('0x35')],qs[_0xf271('0x33')](_0xf308ad[_0xf271('0x30')][_0xf271('0x33')]));_0x34e155[_0xf271('0x32')]=_0x34e155['attributes'][_0xf271('0x34')]?_0x34e155['attributes']:_0x5768df[_0xf271('0x35')];if(_0xf308ad[_0xf271('0x30')]['includeAll']){_0x34e155[_0xf271('0x40')]=[{'all':!![]}];}_0x34e155=_[_0xf271('0x3d')]({},_0x34e155,_0xf308ad['options']);return db['CmCompany']['find'](_0x34e155)['then'](handleEntityNotFound(_0x51ef9c,null))[_0xf271('0x25')](respondWithResult(_0x51ef9c,null))['catch'](handleError(_0x51ef9c,null));};exports[_0xf271('0x46')]=function(_0x285eca,_0x93a603){return db[_0xf271('0x2d')][_0xf271('0x46')](_0x285eca[_0xf271('0x47')],{})['then'](function(_0x2f6dff){var _0x150f7d=_0x285eca[_0xf271('0x48')][_0xf271('0x26')]({'plain':!![]});if(!_0x150f7d)throw new Error(_0xf271('0x49'));if(_0x150f7d[_0xf271('0x4a')]===_0xf271('0x48')){var _0x2ced27=_0x2f6dff[_0xf271('0x26')]({'plain':!![]});var _0x5195e9=_0xf271('0x4b');return db[_0xf271('0x4c')][_0xf271('0x4d')]({'where':{'name':_0x5195e9,'userProfileId':_0x150f7d[_0xf271('0x4e')]},'raw':!![]})[_0xf271('0x25')](function(_0x5f3db6){if(_0x5f3db6&&_0x5f3db6[_0xf271('0x4f')]===0x0){return db[_0xf271('0x27')][_0xf271('0x46')]({'name':_0x2ced27[_0xf271('0x2a')],'resourceId':_0x2ced27['id'],'type':_0x5f3db6[_0xf271('0x2a')],'sectionId':_0x5f3db6['id']},{})[_0xf271('0x25')](function(){return _0x2f6dff;});}else{return _0x2f6dff;}})[_0xf271('0x43')](function(_0x5a6d2c){logger['error'](_0xf271('0x50'),_0x5a6d2c);throw _0x5a6d2c;});}return _0x2f6dff;})[_0xf271('0x25')](respondWithResult(_0x93a603,0xc9))['catch'](handleError(_0x93a603,null));};exports[_0xf271('0x51')]=function(_0x3ab58d,_0x591191){if(_0x3ab58d[_0xf271('0x47')]['id']){delete _0x3ab58d[_0xf271('0x47')]['id'];}return db['CmCompany'][_0xf271('0x4d')]({'where':{'id':_0x3ab58d[_0xf271('0x44')]['id']}})['then'](handleEntityNotFound(_0x591191,null))[_0xf271('0x25')](saveUpdates(_0x3ab58d[_0xf271('0x47')],null))[_0xf271('0x25')](respondWithResult(_0x591191,null))[_0xf271('0x43')](handleError(_0x591191,null));};exports[_0xf271('0x52')]=function(_0x5d0987,_0x39a970){return db[_0xf271('0x2d')][_0xf271('0x4d')]({'where':{'id':_0x5d0987[_0xf271('0x44')]['id']}})[_0xf271('0x25')](handleEntityNotFound(_0x39a970,null))[_0xf271('0x25')](removeEntity(_0x39a970,null))[_0xf271('0x43')](handleError(_0x39a970,null));};exports[_0xf271('0x2e')]=function(_0x56f885,_0x16a404){return db[_0xf271('0x2d')]['describe']()[_0xf271('0x25')](respondWithResult(_0x16a404,null))['catch'](handleError(_0x16a404,null));};exports[_0xf271('0x53')]=function(_0x4b0fca,_0x26ddee,_0x564b03){return db[_0xf271('0x54')]['find']({'where':{'id':_0x4b0fca[_0xf271('0x44')]['id']}})[_0xf271('0x25')](handleEntityNotFound(_0x26ddee,null))[_0xf271('0x25')](function(_0x178ccd){if(_0x178ccd){return _0x178ccd['addContacts'](_0x4b0fca[_0xf271('0x47')][_0xf271('0x55')],_[_0xf271('0x56')](_0x4b0fca['body'],[_0xf271('0x55'),'id'])||{});}})[_0xf271('0x25')](respondWithResult(_0x26ddee,null))[_0xf271('0x43')](handleError(_0x26ddee,null));};exports[_0xf271('0x57')]=function(_0x58777f,_0x1a0275,_0x1417bd){var _0x2f8968={};var _0x4ebbe0={};var _0x170d9c;var _0x1d184c;return db[_0xf271('0x2d')]['findOne']({'where':{'id':_0x58777f[_0xf271('0x44')]['id']}})[_0xf271('0x25')](handleEntityNotFound(_0x1a0275,null))[_0xf271('0x25')](function(_0x7cc28f){if(_0x7cc28f){_0x170d9c=_0x7cc28f;_0x4ebbe0[_0xf271('0x35')]=_[_0xf271('0x2f')](db[_0xf271('0x54')][_0xf271('0x45')]);_0x4ebbe0[_0xf271('0x30')]=_[_0xf271('0x2f')](_0x58777f['query']);_0x4ebbe0['filters']=_[_0xf271('0x31')](_0x4ebbe0[_0xf271('0x35')],_0x4ebbe0[_0xf271('0x30')]);_0x2f8968[_0xf271('0x32')]=_['intersection'](_0x4ebbe0[_0xf271('0x35')],qs['fields'](_0x58777f['query'][_0xf271('0x33')]));_0x2f8968[_0xf271('0x32')]=_0x2f8968[_0xf271('0x32')][_0xf271('0x34')]?_0x2f8968['attributes']:_0x4ebbe0[_0xf271('0x35')];_0x2f8968[_0xf271('0x37')]=qs['sort'](_0x58777f[_0xf271('0x30')]['sort']);_0x2f8968[_0xf271('0x39')]=qs[_0xf271('0x3b')](_[_0xf271('0x3a')](_0x58777f['query'],_0x4ebbe0[_0xf271('0x3b')]));if(_0x58777f[_0xf271('0x30')]['filter']){_0x2f8968['where']=_['merge'](_0x2f8968[_0xf271('0x39')],{'$or':_[_0xf271('0x3c')](_0x2f8968['attributes'],function(_0x5db15c){var _0x420f87={};_0x420f87[_0x5db15c]={'$like':'%'+_0x58777f['query']['filter']+'%'};return _0x420f87;})});}_0x2f8968=_['merge']({},_0x2f8968,_0x58777f['options']);return _0x170d9c[_0xf271('0x57')](_0x2f8968);}})[_0xf271('0x25')](function(_0x36b3a9){if(_0x36b3a9){_0x1d184c=_0x36b3a9[_0xf271('0x34')];if(!_0x58777f[_0xf271('0x30')][_0xf271('0x58')](_0xf271('0x36'))){_0x2f8968[_0xf271('0x1e')]=qs[_0xf271('0x1e')](_0x58777f[_0xf271('0x30')][_0xf271('0x1e')]);_0x2f8968[_0xf271('0x1c')]=qs[_0xf271('0x1c')](_0x58777f[_0xf271('0x30')][_0xf271('0x1c')]);}return _0x170d9c[_0xf271('0x57')](_0x2f8968);}})[_0xf271('0x25')](function(_0x5e3af0){if(_0x5e3af0){return _0x5e3af0?{'count':_0x1d184c,'rows':_0x5e3af0}:null;}})[_0xf271('0x25')](respondWithResult(_0x1a0275,null))[_0xf271('0x43')](handleError(_0x1a0275,null));};
\ No newline at end of file
+var _0x2734=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','end','error','name','send','index','describe','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','where','pick','filter','map','merge','options','CmCompany','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','getContacts','findOne','sort','hasOwnProperty','eml-format','rimraf','fast-json-patch','moment','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x2734,0xf1));var _0x4273=function(_0x4db055,_0x5d1e2a){_0x4db055=_0x4db055-0x0;var _0x256064=_0x2734[_0x4db055];return _0x256064;};'use strict';var emlformat=require(_0x4273('0x0'));var rimraf=require(_0x4273('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4273('0x2'));var rp=require('request-promise');var moment=require(_0x4273('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4273('0x4'));var path=require('path');var sox=require(_0x4273('0x5'));var csv=require(_0x4273('0x6'));var ejs=require(_0x4273('0x7'));var fs=require('fs');var fs_extra=require(_0x4273('0x8'));var _=require(_0x4273('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4273('0xa'));var deskjs=require(_0x4273('0xb'));var toCsv=require(_0x4273('0x6'));var querystring=require('querystring');var Papa=require(_0x4273('0xc'));var Redis=require(_0x4273('0xd'));var authService=require(_0x4273('0xe'));var qs=require(_0x4273('0xf'));var as=require(_0x4273('0x10'));var hardwareService=require(_0x4273('0x11'));var logger=require(_0x4273('0x12'))(_0x4273('0x13'));var utils=require(_0x4273('0x14'));var config=require(_0x4273('0x15'));var licenseUtil=require(_0x4273('0x16'));var db=require(_0x4273('0x17'))['db'];function respondWithStatusCode(_0x2b8353,_0x14eb78){_0x14eb78=_0x14eb78||0xcc;return function(_0x4a6d12){if(_0x4a6d12){return _0x2b8353[_0x4273('0x18')](_0x14eb78);}return _0x2b8353[_0x4273('0x19')](_0x14eb78)['end']();};}function respondWithResult(_0x516100,_0x1ecd68){_0x1ecd68=_0x1ecd68||0xc8;return function(_0x526166){if(_0x526166){return _0x516100[_0x4273('0x19')](_0x1ecd68)[_0x4273('0x1a')](_0x526166);}};}function respondWithFilteredResult(_0x446ef8,_0x361ebe){return function(_0x26fe5c){if(_0x26fe5c){var _0x44e0b2=typeof _0x361ebe[_0x4273('0x1b')]===_0x4273('0x1c')&&typeof _0x361ebe[_0x4273('0x1d')]===_0x4273('0x1c');var _0x2285ff=_0x26fe5c[_0x4273('0x1e')];var _0x17db8a=_0x44e0b2?0x0:_0x361ebe[_0x4273('0x1b')];var _0x457a4c=_0x44e0b2?_0x26fe5c[_0x4273('0x1e')]:_0x361ebe[_0x4273('0x1b')]+_0x361ebe[_0x4273('0x1d')];var _0x40d5a7;if(_0x457a4c>=_0x2285ff){_0x457a4c=_0x2285ff;_0x40d5a7=0xc8;}else{_0x40d5a7=0xce;}_0x446ef8[_0x4273('0x19')](_0x40d5a7);return _0x446ef8['set'](_0x4273('0x1f'),_0x17db8a+'-'+_0x457a4c+'/'+_0x2285ff)[_0x4273('0x1a')](_0x26fe5c);}return null;};}function patchUpdates(_0x4a3e54){return function(_0x42b68e){try{jsonpatch[_0x4273('0x20')](_0x42b68e,_0x4a3e54,!![]);}catch(_0x3dd823){return BPromise[_0x4273('0x21')](_0x3dd823);}return _0x42b68e[_0x4273('0x22')]();};}function saveUpdates(_0x5108d6,_0xf17728){return function(_0x4f1e78){if(_0x4f1e78){return _0x4f1e78[_0x4273('0x23')](_0x5108d6)[_0x4273('0x24')](function(_0x4b2f7c){return _0x4b2f7c;});}return null;};}function removeEntity(_0x525421,_0x3038a3){return function(_0x5619e5){if(_0x5619e5){return _0x5619e5[_0x4273('0x25')]()[_0x4273('0x24')](function(){var _0x32b672=_0x5619e5[_0x4273('0x26')]({'plain':!![]});var _0x1a2535=_0x4273('0x27');return db[_0x4273('0x28')][_0x4273('0x25')]({'where':{'type':_0x1a2535,'resourceId':_0x32b672['id']}})[_0x4273('0x24')](function(){return _0x5619e5;});})[_0x4273('0x24')](function(){_0x525421[_0x4273('0x19')](0xcc)[_0x4273('0x29')]();});}};}function handleEntityNotFound(_0x58afc6,_0x271b9c){return function(_0x2cc720){if(!_0x2cc720){_0x58afc6[_0x4273('0x18')](0x194);}return _0x2cc720;};}function handleError(_0x3d8e37,_0x763fb1){_0x763fb1=_0x763fb1||0x1f4;return function(_0x49832f){logger[_0x4273('0x2a')](_0x49832f['stack']);if(_0x49832f[_0x4273('0x2b')]){delete _0x49832f['name'];}_0x3d8e37[_0x4273('0x19')](_0x763fb1)[_0x4273('0x2c')](_0x49832f);};}exports[_0x4273('0x2d')]=function(_0x582b22,_0x267f4d){var _0x2ef539={},_0x199f76={},_0x11a3e7={'count':0x0,'rows':[]};return db['CmCompany'][_0x4273('0x2e')]()[_0x4273('0x24')](function(_0x39889e){_0x199f76['model']=_[_0x4273('0x2f')](_0x39889e);_0x199f76[_0x4273('0x30')]=_[_0x4273('0x2f')](_0x582b22[_0x4273('0x30')]);_0x199f76[_0x4273('0x31')]=_[_0x4273('0x32')](_0x199f76[_0x4273('0x33')],_0x199f76[_0x4273('0x30')]);_0x2ef539[_0x4273('0x34')]=_[_0x4273('0x32')](_0x199f76[_0x4273('0x33')],qs['fields'](_0x582b22[_0x4273('0x30')][_0x4273('0x35')]));_0x2ef539[_0x4273('0x34')]=_0x2ef539[_0x4273('0x34')][_0x4273('0x36')]?_0x2ef539[_0x4273('0x34')]:_0x199f76[_0x4273('0x33')];if(!_0x582b22[_0x4273('0x30')]['hasOwnProperty'](_0x4273('0x37'))){_0x2ef539[_0x4273('0x1d')]=qs[_0x4273('0x1d')](_0x582b22[_0x4273('0x30')][_0x4273('0x1d')]);_0x2ef539['offset']=qs['offset'](_0x582b22[_0x4273('0x30')][_0x4273('0x1b')]);}_0x2ef539[_0x4273('0x38')]=qs['sort'](_0x582b22[_0x4273('0x30')]['sort']);_0x2ef539[_0x4273('0x39')]=qs[_0x4273('0x31')](_[_0x4273('0x3a')](_0x582b22[_0x4273('0x30')],_0x199f76['filters']),_0x39889e);if(_0x582b22['query'][_0x4273('0x3b')]){_0x2ef539[_0x4273('0x39')]=_['merge'](_0x2ef539[_0x4273('0x39')],{'$or':_[_0x4273('0x3c')](_0x2ef539[_0x4273('0x34')],function(_0x53312c){var _0x40cd30={};_0x40cd30[_0x53312c]={'$like':'%'+_0x582b22[_0x4273('0x30')]['filter']+'%'};return _0x40cd30;})});}_0x2ef539=_[_0x4273('0x3d')]({},_0x2ef539,_0x582b22[_0x4273('0x3e')]);var _0x3983d1={'where':_0x2ef539['where']};return db[_0x4273('0x3f')]['count'](_0x3983d1)[_0x4273('0x24')](function(_0x320ad9){_0x11a3e7[_0x4273('0x1e')]=_0x320ad9;if(_0x582b22[_0x4273('0x30')][_0x4273('0x40')]){_0x2ef539[_0x4273('0x41')]=[{'all':!![]}];}return db[_0x4273('0x3f')][_0x4273('0x42')](_0x2ef539);})[_0x4273('0x24')](function(_0x19e2b5){_0x11a3e7[_0x4273('0x43')]=_0x19e2b5;return _0x11a3e7;})[_0x4273('0x24')](respondWithFilteredResult(_0x267f4d,_0x2ef539))[_0x4273('0x44')](handleError(_0x267f4d,null));})['catch'](handleError(_0x267f4d,null));};exports[_0x4273('0x45')]=function(_0x13d655,_0x37f75f){var _0x561bd3={'raw':![],'where':{'id':_0x13d655[_0x4273('0x46')]['id']}},_0x48f716={};_0x48f716[_0x4273('0x33')]=_[_0x4273('0x2f')](db[_0x4273('0x3f')][_0x4273('0x47')]);_0x48f716['query']=_[_0x4273('0x2f')](_0x13d655[_0x4273('0x30')]);_0x48f716['filters']=_['intersection'](_0x48f716[_0x4273('0x33')],_0x48f716[_0x4273('0x30')]);_0x561bd3[_0x4273('0x34')]=_[_0x4273('0x32')](_0x48f716[_0x4273('0x33')],qs[_0x4273('0x35')](_0x13d655[_0x4273('0x30')]['fields']));_0x561bd3[_0x4273('0x34')]=_0x561bd3['attributes'][_0x4273('0x36')]?_0x561bd3[_0x4273('0x34')]:_0x48f716[_0x4273('0x33')];if(_0x13d655['query'][_0x4273('0x40')]){_0x561bd3['include']=[{'all':!![]}];}_0x561bd3=_[_0x4273('0x3d')]({},_0x561bd3,_0x13d655['options']);return db[_0x4273('0x3f')][_0x4273('0x48')](_0x561bd3)[_0x4273('0x24')](handleEntityNotFound(_0x37f75f,null))[_0x4273('0x24')](respondWithResult(_0x37f75f,null))[_0x4273('0x44')](handleError(_0x37f75f,null));};exports[_0x4273('0x49')]=function(_0x43ee4b,_0x1492da){return db[_0x4273('0x3f')]['create'](_0x43ee4b['body'],{})['then'](function(_0x3da7c5){var _0x57b3ba=_0x43ee4b[_0x4273('0x4a')][_0x4273('0x26')]({'plain':!![]});if(!_0x57b3ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57b3ba['role']===_0x4273('0x4a')){var _0x17103b=_0x3da7c5[_0x4273('0x26')]({'plain':!![]});var _0x13e4c6=_0x4273('0x27');return db[_0x4273('0x4b')][_0x4273('0x48')]({'where':{'name':_0x13e4c6,'userProfileId':_0x57b3ba['userProfileId']},'raw':!![]})[_0x4273('0x24')](function(_0x4fc291){if(_0x4fc291&&_0x4fc291[_0x4273('0x4c')]===0x0){return db[_0x4273('0x28')][_0x4273('0x49')]({'name':_0x17103b['name'],'resourceId':_0x17103b['id'],'type':_0x4fc291[_0x4273('0x2b')],'sectionId':_0x4fc291['id']},{})[_0x4273('0x24')](function(){return _0x3da7c5;});}else{return _0x3da7c5;}})[_0x4273('0x44')](function(_0x14929b){logger[_0x4273('0x2a')](_0x4273('0x4d'),_0x14929b);throw _0x14929b;});}return _0x3da7c5;})['then'](respondWithResult(_0x1492da,0xc9))[_0x4273('0x44')](handleError(_0x1492da,null));};exports['update']=function(_0x3c7dc2,_0x6f38d3){if(_0x3c7dc2[_0x4273('0x4e')]['id']){delete _0x3c7dc2['body']['id'];}return db['CmCompany'][_0x4273('0x48')]({'where':{'id':_0x3c7dc2[_0x4273('0x46')]['id']}})['then'](handleEntityNotFound(_0x6f38d3,null))[_0x4273('0x24')](saveUpdates(_0x3c7dc2[_0x4273('0x4e')],null))[_0x4273('0x24')](respondWithResult(_0x6f38d3,null))[_0x4273('0x44')](handleError(_0x6f38d3,null));};exports[_0x4273('0x25')]=function(_0x942b3b,_0x44b96d){return db[_0x4273('0x3f')][_0x4273('0x48')]({'where':{'id':_0x942b3b[_0x4273('0x46')]['id']}})[_0x4273('0x24')](handleEntityNotFound(_0x44b96d,null))[_0x4273('0x24')](removeEntity(_0x44b96d,null))['catch'](handleError(_0x44b96d,null));};exports[_0x4273('0x2e')]=function(_0xb987e0,_0x57779d){return db['CmCompany']['describe']()[_0x4273('0x24')](respondWithResult(_0x57779d,null))['catch'](handleError(_0x57779d,null));};exports[_0x4273('0x4f')]=function(_0x51bd98,_0x125855,_0x42e195){return db[_0x4273('0x50')][_0x4273('0x48')]({'where':{'id':_0x51bd98[_0x4273('0x46')]['id']}})[_0x4273('0x24')](handleEntityNotFound(_0x125855,null))[_0x4273('0x24')](function(_0x1677da){if(_0x1677da){return _0x1677da[_0x4273('0x4f')](_0x51bd98['body'][_0x4273('0x51')],_['omit'](_0x51bd98[_0x4273('0x4e')],[_0x4273('0x51'),'id'])||{});}})[_0x4273('0x24')](respondWithResult(_0x125855,null))[_0x4273('0x44')](handleError(_0x125855,null));};exports[_0x4273('0x52')]=function(_0xceaec1,_0x6e9cd2,_0x4d6d8d){var _0x3b2718={};var _0x292552={};var _0x4665aa;var _0xb5803d;return db[_0x4273('0x3f')][_0x4273('0x53')]({'where':{'id':_0xceaec1[_0x4273('0x46')]['id']}})[_0x4273('0x24')](handleEntityNotFound(_0x6e9cd2,null))[_0x4273('0x24')](function(_0x708608){if(_0x708608){_0x4665aa=_0x708608;_0x292552[_0x4273('0x33')]=_[_0x4273('0x2f')](db['CmContact']['rawAttributes']);_0x292552[_0x4273('0x30')]=_[_0x4273('0x2f')](_0xceaec1[_0x4273('0x30')]);_0x292552[_0x4273('0x31')]=_[_0x4273('0x32')](_0x292552[_0x4273('0x33')],_0x292552[_0x4273('0x30')]);_0x3b2718['attributes']=_[_0x4273('0x32')](_0x292552[_0x4273('0x33')],qs[_0x4273('0x35')](_0xceaec1[_0x4273('0x30')][_0x4273('0x35')]));_0x3b2718['attributes']=_0x3b2718['attributes'][_0x4273('0x36')]?_0x3b2718[_0x4273('0x34')]:_0x292552[_0x4273('0x33')];_0x3b2718['order']=qs[_0x4273('0x54')](_0xceaec1[_0x4273('0x30')][_0x4273('0x54')]);_0x3b2718['where']=qs[_0x4273('0x31')](_[_0x4273('0x3a')](_0xceaec1[_0x4273('0x30')],_0x292552[_0x4273('0x31')]));if(_0xceaec1[_0x4273('0x30')][_0x4273('0x3b')]){_0x3b2718[_0x4273('0x39')]=_[_0x4273('0x3d')](_0x3b2718[_0x4273('0x39')],{'$or':_[_0x4273('0x3c')](_0x3b2718[_0x4273('0x34')],function(_0x5dd798){var _0x4debc3={};_0x4debc3[_0x5dd798]={'$like':'%'+_0xceaec1[_0x4273('0x30')][_0x4273('0x3b')]+'%'};return _0x4debc3;})});}_0x3b2718=_['merge']({},_0x3b2718,_0xceaec1[_0x4273('0x3e')]);return _0x4665aa[_0x4273('0x52')](_0x3b2718);}})[_0x4273('0x24')](function(_0xe2e162){if(_0xe2e162){_0xb5803d=_0xe2e162[_0x4273('0x36')];if(!_0xceaec1[_0x4273('0x30')][_0x4273('0x55')](_0x4273('0x37'))){_0x3b2718[_0x4273('0x1d')]=qs[_0x4273('0x1d')](_0xceaec1[_0x4273('0x30')][_0x4273('0x1d')]);_0x3b2718[_0x4273('0x1b')]=qs['offset'](_0xceaec1[_0x4273('0x30')][_0x4273('0x1b')]);}return _0x4665aa['getContacts'](_0x3b2718);}})['then'](function(_0x224839){if(_0x224839){return _0x224839?{'count':_0xb5803d,'rows':_0x224839}:null;}})[_0x4273('0x24')](respondWithResult(_0x6e9cd2,null))['catch'](handleError(_0x6e9cd2,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index b3668c5..5519746 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 _0xe4d1=['cm_companies','lodash','../../config/logger','api','bluebird','request-promise','rimraf','exports','define','CmCompany'];(function(_0x196d3b,_0x271252){var _0x4bb86d=function(_0x1b6766){while(--_0x1b6766){_0x196d3b['push'](_0x196d3b['shift']());}};_0x4bb86d(++_0x271252);}(_0xe4d1,0x6f));var _0x1e4d=function(_0x20902b,_0x10861b){_0x20902b=_0x20902b-0x0;var _0x492823=_0xe4d1[_0x20902b];return _0x492823;};'use strict';var _=require(_0x1e4d('0x0'));var util=require('util');var logger=require(_0x1e4d('0x1'))(_0x1e4d('0x2'));var moment=require('moment');var BPromise=require(_0x1e4d('0x3'));var rp=require(_0x1e4d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e4d('0x5'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x1e4d('0x6')]=function(_0x32d904,_0x3b4947){return _0x32d904[_0x1e4d('0x7')](_0x1e4d('0x8'),attributes,{'tableName':_0x1e4d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x313a=['../../config/environment','exports','define','CmCompany','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3c9bfa,_0x45315f){var _0x3389ee=function(_0x223c98){while(--_0x223c98){_0x3c9bfa['push'](_0x3c9bfa['shift']());}};_0x3389ee(++_0x45315f);}(_0x313a,0x1a8));var _0xa313=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0x313a[_0x5cab28];return _0xa3554d;};'use strict';var _=require(_0xa313('0x0'));var util=require(_0xa313('0x1'));var logger=require(_0xa313('0x2'))(_0xa313('0x3'));var moment=require(_0xa313('0x4'));var BPromise=require('bluebird');var rp=require(_0xa313('0x5'));var fs=require('fs');var path=require(_0xa313('0x6'));var rimraf=require(_0xa313('0x7'));var config=require(_0xa313('0x8'));var attributes=require('./cmCompany.attributes');module[_0xa313('0x9')]=function(_0x2e1b0d,_0x27d23c){return _0x2e1b0d[_0xa313('0xa')](_0xa313('0xb'),attributes,{'tableName':'cm_companies','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 4b22973..bd64330 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 _0x6cef=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring'];(function(_0x50f0b8,_0x326c38){var _0x325121=function(_0x410860){while(--_0x410860){_0x50f0b8['push'](_0x50f0b8['shift']());}};_0x325121(++_0x326c38);}(_0x6cef,0x1f4));var _0xf6ce=function(_0x30ebff,_0x434cc4){_0x30ebff=_0x30ebff-0x0;var _0x421101=_0x6cef[_0x30ebff];return _0x421101;};'use strict';var _=require(_0xf6ce('0x0'));var util=require('util');var moment=require(_0xf6ce('0x1'));var BPromise=require(_0xf6ce('0x2'));var rs=require(_0xf6ce('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf6ce('0x4'));var logger=require(_0xf6ce('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf6ce('0x6'));var client=jayson[_0xf6ce('0x7')][_0xf6ce('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f8811,_0x30a09c,_0x530e4f){return new BPromise(function(_0x2fb1,_0x2258ef){return client[_0xf6ce('0x9')](_0x2f8811,_0x530e4f)[_0xf6ce('0xa')](function(_0x15d242){logger[_0xf6ce('0xb')]('CmCompany,\x20%s,\x20%s',_0x30a09c,'request\x20sent');logger[_0xf6ce('0xc')](_0xf6ce('0xd'),_0x30a09c,_0xf6ce('0xe'),JSON[_0xf6ce('0xf')](_0x15d242));if(_0x15d242[_0xf6ce('0x10')]){if(_0x15d242[_0xf6ce('0x10')][_0xf6ce('0x11')]===0x1f4){logger['error'](_0xf6ce('0x12'),_0x30a09c,_0x15d242[_0xf6ce('0x10')][_0xf6ce('0x13')]);return _0x2258ef(_0x15d242[_0xf6ce('0x10')][_0xf6ce('0x13')]);}logger[_0xf6ce('0x10')]('CmCompany,\x20%s,\x20%s',_0x30a09c,_0x15d242[_0xf6ce('0x10')][_0xf6ce('0x13')]);return _0x2fb1(_0x15d242[_0xf6ce('0x10')][_0xf6ce('0x13')]);}else{logger[_0xf6ce('0xb')](_0xf6ce('0x12'),_0x30a09c,'request\x20sent');_0x2fb1(_0x15d242['result'][_0xf6ce('0x13')]);}})[_0xf6ce('0x14')](function(_0x1f19cf){logger[_0xf6ce('0x10')]('CmCompany,\x20%s,\x20%s',_0x30a09c,_0x1f19cf);_0x2258ef(_0x1f19cf);});});}
\ No newline at end of file
+var _0xc789=['client','http','request','then','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc789,0xde));var _0x9c78=function(_0x4c3b3a,_0x1100c5){_0x4c3b3a=_0x4c3b3a-0x0;var _0x4ab118=_0xc789[_0x4c3b3a];return _0x4ab118;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9c78('0x0'));var BPromise=require(_0x9c78('0x1'));var rs=require(_0x9c78('0x2'));var fs=require('fs');var Redis=require(_0x9c78('0x3'));var db=require(_0x9c78('0x4'))['db'];var utils=require(_0x9c78('0x5'));var logger=require(_0x9c78('0x6'))(_0x9c78('0x7'));var config=require(_0x9c78('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9c78('0x9')][_0x9c78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fb0b4,_0x236e6d,_0x4fdc09){return new BPromise(function(_0x7e8224,_0x52912f){return client[_0x9c78('0xb')](_0x1fb0b4,_0x4fdc09)[_0x9c78('0xc')](function(_0x3f7d97){logger['info']('CmCompany,\x20%s,\x20%s',_0x236e6d,_0x9c78('0xd'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x236e6d,'request\x20sent',JSON[_0x9c78('0xe')](_0x3f7d97));if(_0x3f7d97[_0x9c78('0xf')]){if(_0x3f7d97[_0x9c78('0xf')][_0x9c78('0x10')]===0x1f4){logger[_0x9c78('0xf')](_0x9c78('0x11'),_0x236e6d,_0x3f7d97[_0x9c78('0xf')][_0x9c78('0x12')]);return _0x52912f(_0x3f7d97[_0x9c78('0xf')][_0x9c78('0x12')]);}logger[_0x9c78('0xf')](_0x9c78('0x11'),_0x236e6d,_0x3f7d97[_0x9c78('0xf')][_0x9c78('0x12')]);return _0x7e8224(_0x3f7d97[_0x9c78('0xf')][_0x9c78('0x12')]);}else{logger['info'](_0x9c78('0x11'),_0x236e6d,_0x9c78('0xd'));_0x7e8224(_0x3f7d97[_0x9c78('0x13')]['message']);}})[_0x9c78('0x14')](function(_0xb424b){logger[_0x9c78('0xf')](_0x9c78('0x11'),_0x236e6d,_0xb424b);_0x52912f(_0xb424b);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index d1c979d..5fd9c93 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 _0xb022=['index','/describe','describe','/:id','/:id/contacts','post','put','update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x24a654,_0x2ca441){var _0x458651=function(_0x1ecda1){while(--_0x1ecda1){_0x24a654['push'](_0x24a654['shift']());}};_0x458651(++_0x2ca441);}(_0xb022,0xf4));var _0x2b02=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xb022[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x2b02('0x0'));var util=require(_0x2b02('0x1'));var path=require('path');var timeout=require(_0x2b02('0x2'));var express=require('express');var router=express[_0x2b02('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2b02('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2b02('0x5'));var controller=require('./cmCompany.controller');router[_0x2b02('0x6')]('/',auth[_0x2b02('0x7')](),controller[_0x2b02('0x8')]);router[_0x2b02('0x6')](_0x2b02('0x9'),auth[_0x2b02('0x7')](),controller[_0x2b02('0xa')]);router[_0x2b02('0x6')](_0x2b02('0xb'),auth[_0x2b02('0x7')](),controller['show']);router[_0x2b02('0x6')](_0x2b02('0xc'),auth['isAuthenticated'](),controller['getContacts']);router[_0x2b02('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x2b02('0xc'),auth[_0x2b02('0x7')](),controller['addContacts']);router[_0x2b02('0xe')](_0x2b02('0xb'),auth[_0x2b02('0x7')](),controller[_0x2b02('0xf')]);router[_0x2b02('0x10')](_0x2b02('0xb'),auth[_0x2b02('0x7')](),controller[_0x2b02('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xc2e2=['show','/:id/contacts','getContacts','post','create','put','destroy','exports','util','path','Router','../../config/environment','./cmCompany.controller','isAuthenticated','get','/describe','describe','/:id'];(function(_0x522a1f,_0x5edd41){var _0x34a139=function(_0x4f98e1){while(--_0x4f98e1){_0x522a1f['push'](_0x522a1f['shift']());}};_0x34a139(++_0x5edd41);}(_0xc2e2,0x194));var _0x2c2e=function(_0x24d5fd,_0x59869a){_0x24d5fd=_0x24d5fd-0x0;var _0x4b6b86=_0xc2e2[_0x24d5fd];return _0x4b6b86;};'use strict';var multer=require('multer');var util=require(_0x2c2e('0x0'));var path=require(_0x2c2e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c2e('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2c2e('0x3'));var controller=require(_0x2c2e('0x4'));router['get']('/',auth[_0x2c2e('0x5')](),controller['index']);router[_0x2c2e('0x6')](_0x2c2e('0x7'),auth[_0x2c2e('0x5')](),controller[_0x2c2e('0x8')]);router[_0x2c2e('0x6')](_0x2c2e('0x9'),auth[_0x2c2e('0x5')](),controller[_0x2c2e('0xa')]);router['get'](_0x2c2e('0xb'),auth[_0x2c2e('0x5')](),controller[_0x2c2e('0xc')]);router[_0x2c2e('0xd')]('/',auth[_0x2c2e('0x5')](),controller[_0x2c2e('0xe')]);router[_0x2c2e('0xd')](_0x2c2e('0xb'),auth[_0x2c2e('0x5')](),controller['addContacts']);router[_0x2c2e('0xf')](_0x2c2e('0x9'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2c2e('0x10')]);module[_0x2c2e('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index e789557..e08e788 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 _0x0f00=['STRING','TEXT','INTEGER','UNSIGNED','lodash','exports'];(function(_0x2ffbce,_0x3b242d){var _0xd8005b=function(_0x567e42){while(--_0x567e42){_0x2ffbce['push'](_0x2ffbce['shift']());}};_0xd8005b(++_0x3b242d);}(_0x0f00,0x106));var _0x00f0=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x0f00[_0x2112d4];return _0x434972;};'use strict';var _=require(_0x00f0('0x0'));var Sequelize=require('sequelize');module[_0x00f0('0x1')]={'firstName':{'type':Sequelize[_0x00f0('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x00f0('0x2')]},'postalCode':{'type':Sequelize[_0x00f0('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x00f0('0x2')]},'description':{'type':Sequelize[_0x00f0('0x3')]},'phone':{'type':Sequelize[_0x00f0('0x2')]},'mobile':{'type':Sequelize[_0x00f0('0x2')]},'fax':{'type':Sequelize[_0x00f0('0x2')]},'email':{'type':Sequelize[_0x00f0('0x2')]},'url':{'type':Sequelize[_0x00f0('0x2')]},'facebook':{'type':Sequelize[_0x00f0('0x2')]},'fb_data':{'type':Sequelize[_0x00f0('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x00f0('0x2')]},'viber':{'type':Sequelize[_0x00f0('0x2')]},'line':{'type':Sequelize[_0x00f0('0x2')]},'wechat':{'type':Sequelize[_0x00f0('0x2')]},'telegram':{'type':Sequelize[_0x00f0('0x2')]},'UserId':{'type':Sequelize[_0x00f0('0x4')]},'priority':{'type':Sequelize[_0x00f0('0x4')](0x2)[_0x00f0('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xfa84=['lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x529a0f,_0x328763){var _0x187a88=function(_0x1ea706){while(--_0x1ea706){_0x529a0f['push'](_0x529a0f['shift']());}};_0x187a88(++_0x328763);}(_0xfa84,0x1d8));var _0x4fa8=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xfa84[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x4fa8('0x0'));var Sequelize=require(_0x4fa8('0x1'));module[_0x4fa8('0x2')]={'firstName':{'type':Sequelize[_0x4fa8('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x4fa8('0x3')]},'street':{'type':Sequelize[_0x4fa8('0x3')]},'postalCode':{'type':Sequelize[_0x4fa8('0x3')]},'city':{'type':Sequelize[_0x4fa8('0x3')]},'country':{'type':Sequelize[_0x4fa8('0x3')]},'dateOfBirth':{'type':Sequelize[_0x4fa8('0x3')]},'description':{'type':Sequelize[_0x4fa8('0x4')]},'phone':{'type':Sequelize[_0x4fa8('0x3')]},'mobile':{'type':Sequelize[_0x4fa8('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x4fa8('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x4fa8('0x3')]},'twitter':{'type':Sequelize[_0x4fa8('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x4fa8('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x4fa8('0x3')]},'telegram':{'type':Sequelize[_0x4fa8('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x4fa8('0x5')](0x2)[_0x4fa8('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4fa8('0x7')],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 20ca35e..bce40a7 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 _0x42d6=['create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','Tags','$and','findAll','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','values','phone','findOne','rawAttributes','pick','options','getTags','setTags','ids','ContactId','includeAll','include','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','No\x20phone\x20column\x20specified','firstName','root','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','path','binding','No\x20firstName\x20column\x20specified','child_process','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','duration','note','createdAt','userDisposition','UserId','fullname','findAndCountAll','startCase','Account','closed','closedAt','disposition','thirdDisposition','Owner','browserName','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','flatten','sortBy','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./cmContact.socket','register','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','trimStart','all','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','datetime','castTo','buildExpression','text','start','filter','isNil','Contact','ListId','c.ListId\x20IN\x20?','isArray','tag','replace','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','isEmpty','having','resolve','agent','some','User','user','getLists','c.ListId\x20IS\x20NULL','role','toString','sequelize','merge','c.firstName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','rows','catch','destroy','params','tags','displayName','columnName','alias','custom','type','body','get','mergeWith','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s'];(function(_0x5afd4f,_0x57ecf0){var _0xeb22c9=function(_0x56bbb0){while(--_0x56bbb0){_0x5afd4f['push'](_0x5afd4f['shift']());}};_0xeb22c9(++_0x57ecf0);}(_0x42d6,0x1aa));var _0x642d=function(_0x17d8c8,_0x52a21b){_0x17d8c8=_0x17d8c8-0x0;var _0x3320b5=_0x42d6[_0x17d8c8];return _0x3320b5;};'use strict';var emlformat=require(_0x642d('0x0'));var rimraf=require(_0x642d('0x1'));var zipdir=require(_0x642d('0x2'));var jsonpatch=require(_0x642d('0x3'));var rp=require('request-promise');var moment=require(_0x642d('0x4'));var BPromise=require(_0x642d('0x5'));var Mustache=require(_0x642d('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x642d('0x7'));var ejs=require(_0x642d('0x8'));var fs=require('fs');var fs_extra=require(_0x642d('0x9'));var _=require(_0x642d('0xa'));var squel=require(_0x642d('0xb'));var crypto=require(_0x642d('0xc'));var jsforce=require(_0x642d('0xd'));var deskjs=require(_0x642d('0xe'));var toCsv=require(_0x642d('0x7'));var querystring=require(_0x642d('0xf'));var Papa=require(_0x642d('0x10'));var Redis=require(_0x642d('0x11'));var authService=require(_0x642d('0x12'));var qs=require(_0x642d('0x13'));var as=require(_0x642d('0x14'));var hardwareService=require(_0x642d('0x15'));var logger=require('../../config/logger')(_0x642d('0x16'));var utils=require('../../config/utils');var config=require(_0x642d('0x17'));var licenseUtil=require(_0x642d('0x18'));var db=require(_0x642d('0x19'))['db'];config['redis']=_[_0x642d('0x1a')](config['redis'],{'host':_0x642d('0x1b'),'port':0x18eb});var socket=require(_0x642d('0x1c'))(new Redis(config[_0x642d('0x1d')]));require(_0x642d('0x1e'))[_0x642d('0x1f')](socket);function respondWithStatusCode(_0xcbb7e0,_0x390b06){_0x390b06=_0x390b06||0xcc;return function(_0x909ae7){if(_0x909ae7){return _0xcbb7e0[_0x642d('0x20')](_0x390b06);}return _0xcbb7e0[_0x642d('0x21')](_0x390b06)[_0x642d('0x22')]();};}function respondWithResult(_0x7ad816,_0x2d4900){_0x2d4900=_0x2d4900||0xc8;return function(_0x5ddfb7){if(_0x5ddfb7){return _0x7ad816[_0x642d('0x21')](_0x2d4900)['json'](_0x5ddfb7);}};}function respondWithFilteredResult(_0x8de7db,_0x1f2f70){return function(_0x4fa778){if(_0x4fa778){var _0x5ad548=typeof _0x1f2f70['offset']===_0x642d('0x23')&&typeof _0x1f2f70[_0x642d('0x24')]==='undefined';var _0x55afec=_0x4fa778[_0x642d('0x25')];var _0x10a61f=_0x5ad548?0x0:_0x1f2f70['offset'];var _0x58e22a=_0x5ad548?_0x4fa778[_0x642d('0x25')]:_0x1f2f70[_0x642d('0x26')]+_0x1f2f70[_0x642d('0x24')];var _0x5c76ae;if(_0x58e22a>=_0x55afec){_0x58e22a=_0x55afec;_0x5c76ae=0xc8;}else{_0x5c76ae=0xce;}_0x8de7db[_0x642d('0x21')](_0x5c76ae);return _0x8de7db['set'](_0x642d('0x27'),_0x10a61f+'-'+_0x58e22a+'/'+_0x55afec)[_0x642d('0x28')](_0x4fa778);}return null;};}function patchUpdates(_0x2aecf9){return function(_0x44af82){try{jsonpatch[_0x642d('0x29')](_0x44af82,_0x2aecf9,!![]);}catch(_0x2c183b){return BPromise[_0x642d('0x2a')](_0x2c183b);}return _0x44af82[_0x642d('0x2b')]();};}function saveUpdates(_0x4c3cfe,_0x296912){return function(_0x5d2753){if(_0x5d2753){return _0x5d2753[_0x642d('0x2c')](_0x4c3cfe)['then'](function(_0x40ce3d){return _0x40ce3d;});}return null;};}function removeEntity(_0x8944,_0xbd03f4){return function(_0x300df0){if(_0x300df0){return _0x300df0['destroy']()[_0x642d('0x2d')](function(){_0x8944['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x608cf4,_0x49c469){return function(_0x4f6e8a){if(!_0x4f6e8a){_0x608cf4[_0x642d('0x20')](0x194);}return _0x4f6e8a;};}function handleError(_0x5200f5,_0x9d024e){_0x9d024e=_0x9d024e||0x1f4;return function(_0x3d7cb8){logger[_0x642d('0x2e')](_0x3d7cb8[_0x642d('0x2f')]);if(_0x3d7cb8[_0x642d('0x30')]){delete _0x3d7cb8[_0x642d('0x30')];}_0x5200f5['status'](_0x9d024e)[_0x642d('0x31')](_0x3d7cb8);};}exports[_0x642d('0x32')]=function(_0x5af8b3,_0x4c5f80){var _0x2602db={},_0xe1c93={},_0x55640b={'count':0x0,'rows':[]};return db[_0x642d('0x33')][_0x642d('0x34')]()['then'](function(_0x2c5f43){var _0x4b5002=[];for(var _0x264427=0x0;_0x264427
','Attachments','Title','Data','gmail','imap.gmail.com','yahoo','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path'];(function(_0x224ad9,_0x5d97a7){var _0x532997=function(_0x323951){while(--_0x323951){_0x224ad9['push'](_0x224ad9['shift']());}};_0x532997(++_0x5d97a7);}(_0x9ade,0x8e));var _0xe9ad=function(_0x28b440,_0x1b2b23){_0x28b440=_0x28b440-0x0;var _0x271fdd=_0x9ade[_0x28b440];return _0x271fdd;};'use strict';var _=require(_0xe9ad('0x0'));var moment=require(_0xe9ad('0x1'));var random=require(_0xe9ad('0x2'));var fs=require('fs');var path=require(_0xe9ad('0x3'));var util=require(_0xe9ad('0x4'));var tnef=require(_0xe9ad('0x5'));var logger=require(_0xe9ad('0x6'))(_0xe9ad('0x7'));var config=require(_0xe9ad('0x8'));function getAddress(_0x441278){var _0x5ed31d=_[_0xe9ad('0x9')](_0x441278['value']);return _0x5ed31d&&_0x5ed31d['address']?_0x5ed31d[_0xe9ad('0xa')]:_0xe9ad('0xb')+random[_0xe9ad('0xc')](0x6)+_0xe9ad('0xd');}function getFirstName(_0x359a7c){var _0x1b715a=_[_0xe9ad('0x9')](_0x359a7c[_0xe9ad('0xe')]);if(_0x1b715a&&_0x1b715a[_0xe9ad('0xf')]){if(_0x1b715a[_0xe9ad('0xf')]==_0x1b715a[_0xe9ad('0xa')]){return _0x1b715a['name'][_0xe9ad('0x10')](0x0,_0x1b715a[_0xe9ad('0xf')]['indexOf']('@'));}var _0x418e9d=_0x1b715a[_0xe9ad('0xf')][_0xe9ad('0x11')](/\s+/);return _0x418e9d['length']>0x1?_0x418e9d[_0xe9ad('0x12')](0x0,-0x1)['join']('\x20'):_0x1b715a['name'];}return _0xe9ad('0x13');}function getLastName(_0x2cbf3b){var _0x2296ba=_[_0xe9ad('0x9')](_0x2cbf3b[_0xe9ad('0xe')]);if(_0x2296ba&&_0x2296ba[_0xe9ad('0xf')]){var _0x389f11=_0x2296ba[_0xe9ad('0xf')]['split'](/\s+/);return _0x389f11[_0xe9ad('0x14')]>0x1?_0x389f11[_0xe9ad('0x15')]():'';}return'';}function getMails(_0x37c6a9,_0x2204aa){var _0x364278='';for(var _0x358c47=0x0;_0x358c47<_0x2204aa['value'][_0xe9ad('0x14')];_0x358c47+=0x1){if(_0x2204aa[_0xe9ad('0xe')][_0x358c47][_0xe9ad('0xa')]!==_0x37c6a9){if(!_[_0xe9ad('0x16')](_0x364278)){_0x364278+=',';}_0x364278+=_0x2204aa[_0xe9ad('0xe')][_0x358c47][_0xe9ad('0xf')]||_0x2204aa[_0xe9ad('0xe')][_0x358c47][_0xe9ad('0xa')]||'';_0x364278+='\x20<';_0x364278+=_0x2204aa[_0xe9ad('0xe')][_0x358c47][_0xe9ad('0xa')]?_0x2204aa[_0xe9ad('0xe')][_0x358c47]['address']:_0xe9ad('0xb')+random['generate'](0x6)+_0xe9ad('0xd');_0x364278+='>';}}return _0x364278;}function parseEmail(_0x5435d6,_0x3c1911,_0x5bb308){if(_0x3c1911[_0xe9ad('0x17')]){var _0x37089a=/