From: Andrea Amorese
Date: Tue, 25 Jan 2022 10:21:12 +0000 (+0100)
Subject: Built motion from commit d105db35.|2.5.49
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22card-image.png//%27?a=commitdiff_plain;h=14ae80e02d77263fd12a919bb03de0a8dfae1843;p=motion2.git
Built motion from commit d105db35.|2.5.49
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 4d4630c..f21b277 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-01-25T09:33:30.840Z",
+ "time": "2022-01-25T09:59:05.689Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 48154b8..ebf5fec 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-01-25T09:33:30.840Z",
+ "time": "2022-01-25T09:59:05.689Z",
"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 1eae023..0a899ad 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 _0xe27b=['action','STRING','integration','motionbar','jscripty','browser','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[headers],\x20browser[wsindowHeight]','urlForward[body]','exports','VIRTUAL','getDataValue'];(function(_0x64f829,_0x4770b3){var _0x4d0e50=function(_0x7cfd13){while(--_0x7cfd13){_0x64f829['push'](_0x64f829['shift']());}};_0x4d0e50(++_0x4770b3);}(_0xe27b,0xf9));var _0xbe27=function(_0x543eb7,_0x3c4e68){_0x543eb7=_0x543eb7-0x0;var _0xf2f2b1=_0xe27b[_0x543eb7];return _0xf2f2b1;};'use strict';var Sequelize=require('sequelize');module[_0xbe27('0x0')]={'name':{'type':Sequelize[_0xbe27('0x1')],'get':function(_0x21bfb6){return this[_0xbe27('0x2')](_0xbe27('0x3'));}},'action':{'type':Sequelize[_0xbe27('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xbe27('0x5'),_0xbe27('0x6'),_0xbe27('0x7'),'urlForward',_0xbe27('0x8'),_0xbe27('0x9'),_0xbe27('0xa')]],'msg':_0xbe27('0xb')}},'comment':_0xbe27('0xb')},'data1':{'type':Sequelize[_0xbe27('0x4')](0x1000),'comment':_0xbe27('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xbe27('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xbe27('0xe')},'data4':{'type':Sequelize[_0xbe27('0x4')](0x1000),'comments':_0xbe27('0xf')},'data5':{'type':Sequelize[_0xbe27('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xbe27('0x4')],'comments':_0xbe27('0x10')},'data7':{'type':Sequelize['TEXT'],'comments':_0xbe27('0x11')}};
\ No newline at end of file
+var _0x4783=['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','exports','VIRTUAL','getDataValue','action','STRING','integration','motionbar','jscripty','browser','bot'];(function(_0x5f3736,_0x35393c){var _0x54f265=function(_0x587a2c){while(--_0x587a2c){_0x5f3736['push'](_0x5f3736['shift']());}};_0x54f265(++_0x35393c);}(_0x4783,0xce));var _0x3478=function(_0xd9abf4,_0x2e5f77){_0xd9abf4=_0xd9abf4-0x0;var _0x528afd=_0x4783[_0xd9abf4];return _0x528afd;};'use strict';var Sequelize=require('sequelize');module[_0x3478('0x0')]={'name':{'type':Sequelize[_0x3478('0x1')],'get':function(_0xd0e824){return this[_0x3478('0x2')](_0x3478('0x3'));}},'action':{'type':Sequelize[_0x3478('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x3478('0x5'),_0x3478('0x6'),_0x3478('0x7'),'urlForward',_0x3478('0x8'),_0x3478('0x9'),_0x3478('0xa')]],'msg':_0x3478('0xb')}},'comment':_0x3478('0xb')},'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[_0x3478('0x4')](0x1000),'comment':_0x3478('0xc')},'data3':{'type':Sequelize[_0x3478('0x4')](0x1000),'comment':_0x3478('0xd')},'data4':{'type':Sequelize[_0x3478('0x4')](0x1000),'comments':_0x3478('0xe')},'data5':{'type':Sequelize[_0x3478('0x4')](0x1000),'comments':_0x3478('0xf')},'data6':{'type':Sequelize[_0x3478('0x4')],'comments':_0x3478('0x10')},'data7':{'type':Sequelize[_0x3478('0x11')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index ca50925..e49bd2d 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 _0x95a7=['name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','reject','save','update','then','destroy','error','stack'];(function(_0x58ab22,_0x57a149){var _0x3eeed1=function(_0x1fe798){while(--_0x1fe798){_0x58ab22['push'](_0x58ab22['shift']());}};_0x3eeed1(++_0x57a149);}(_0x95a7,0x1c0));var _0x795a=function(_0x5a8468,_0x18aa66){_0x5a8468=_0x5a8468-0x0;var _0x5548c0=_0x95a7[_0x5a8468];return _0x5548c0;};'use strict';var emlformat=require(_0x795a('0x0'));var rimraf=require(_0x795a('0x1'));var zipdir=require(_0x795a('0x2'));var jsonpatch=require(_0x795a('0x3'));var rp=require(_0x795a('0x4'));var moment=require(_0x795a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x795a('0x6'));var util=require(_0x795a('0x7'));var path=require(_0x795a('0x8'));var sox=require(_0x795a('0x9'));var csv=require(_0x795a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x795a('0xb'));var squel=require('squel');var crypto=require(_0x795a('0xc'));var jsforce=require(_0x795a('0xd'));var deskjs=require(_0x795a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x795a('0xf'));var Papa=require(_0x795a('0x10'));var Redis=require(_0x795a('0x11'));var authService=require(_0x795a('0x12'));var qs=require(_0x795a('0x13'));var as=require(_0x795a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x795a('0x15'))(_0x795a('0x16'));var utils=require(_0x795a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x795a('0x18'));var db=require(_0x795a('0x19'))['db'];function respondWithStatusCode(_0x494d70,_0x36b8cd){_0x36b8cd=_0x36b8cd||0xcc;return function(_0x273e99){if(_0x273e99){return _0x494d70[_0x795a('0x1a')](_0x36b8cd);}return _0x494d70['status'](_0x36b8cd)[_0x795a('0x1b')]();};}function respondWithResult(_0x1e010a,_0x1decf0){_0x1decf0=_0x1decf0||0xc8;return function(_0x439e2d){if(_0x439e2d){return _0x1e010a['status'](_0x1decf0)[_0x795a('0x1c')](_0x439e2d);}};}function respondWithFilteredResult(_0x426bc8,_0x254cfd){return function(_0x1c65ac){if(_0x1c65ac){var _0x266f8a=typeof _0x254cfd[_0x795a('0x1d')]===_0x795a('0x1e')&&typeof _0x254cfd[_0x795a('0x1f')]===_0x795a('0x1e');var _0x49cb82=_0x1c65ac[_0x795a('0x20')];var _0xa9c46e=_0x266f8a?0x0:_0x254cfd[_0x795a('0x1d')];var _0x5924a5=_0x266f8a?_0x1c65ac[_0x795a('0x20')]:_0x254cfd[_0x795a('0x1d')]+_0x254cfd[_0x795a('0x1f')];var _0x2c1686;if(_0x5924a5>=_0x49cb82){_0x5924a5=_0x49cb82;_0x2c1686=0xc8;}else{_0x2c1686=0xce;}_0x426bc8[_0x795a('0x21')](_0x2c1686);return _0x426bc8[_0x795a('0x22')]('Content-Range',_0xa9c46e+'-'+_0x5924a5+'/'+_0x49cb82)[_0x795a('0x1c')](_0x1c65ac);}return null;};}function patchUpdates(_0x21d08c){return function(_0x36dc52){try{jsonpatch['apply'](_0x36dc52,_0x21d08c,!![]);}catch(_0x538d6b){return BPromise[_0x795a('0x23')](_0x538d6b);}return _0x36dc52[_0x795a('0x24')]();};}function saveUpdates(_0x527706,_0x283085){return function(_0x518bbd){if(_0x518bbd){return _0x518bbd[_0x795a('0x25')](_0x527706)[_0x795a('0x26')](function(_0x397f0a){return _0x397f0a;});}return null;};}function removeEntity(_0x1f44a3,_0x107cc4){return function(_0x1f9ca6){if(_0x1f9ca6){return _0x1f9ca6[_0x795a('0x27')]()[_0x795a('0x26')](function(){_0x1f44a3[_0x795a('0x21')](0xcc)[_0x795a('0x1b')]();});}};}function handleEntityNotFound(_0x20ddca,_0x16a04c){return function(_0xaea25d){if(!_0xaea25d){_0x20ddca[_0x795a('0x1a')](0x194);}return _0xaea25d;};}function handleError(_0x322e62,_0x757726){_0x757726=_0x757726||0x1f4;return function(_0x2c2c2d){logger[_0x795a('0x28')](_0x2c2c2d[_0x795a('0x29')]);if(_0x2c2c2d[_0x795a('0x2a')]){delete _0x2c2c2d[_0x795a('0x2a')];}_0x322e62[_0x795a('0x21')](_0x757726)[_0x795a('0x2b')](_0x2c2c2d);};}exports[_0x795a('0x25')]=function(_0x55c22d,_0x574a46){if(_0x55c22d[_0x795a('0x2c')]['id']){delete _0x55c22d[_0x795a('0x2c')]['id'];}return db[_0x795a('0x2d')][_0x795a('0x2e')]({'where':{'id':_0x55c22d[_0x795a('0x2f')]['id']}})['then'](handleEntityNotFound(_0x574a46,null))[_0x795a('0x26')](saveUpdates(_0x55c22d[_0x795a('0x2c')],null))[_0x795a('0x26')](respondWithResult(_0x574a46,null))[_0x795a('0x30')](handleError(_0x574a46,null));};exports[_0x795a('0x27')]=function(_0x4ebf92,_0x24848f){return db[_0x795a('0x2d')][_0x795a('0x2e')]({'where':{'id':_0x4ebf92['params']['id']}})[_0x795a('0x26')](handleEntityNotFound(_0x24848f,null))['then'](removeEntity(_0x24848f,null))[_0x795a('0x30')](handleError(_0x24848f,null));};
\ No newline at end of file
+var _0x0a9f=['reject','save','update','then','destroy','stack','name','send','body','Action','find','params','catch','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','set','Content-Range','apply'];(function(_0x1a49b7,_0x23ebc0){var _0x50c937=function(_0x4e5a00){while(--_0x4e5a00){_0x1a49b7['push'](_0x1a49b7['shift']());}};_0x50c937(++_0x23ebc0);}(_0x0a9f,0xee));var _0xf0a9=function(_0x3d9b8c,_0x1accd9){_0x3d9b8c=_0x3d9b8c-0x0;var _0x5afdbc=_0x0a9f[_0x3d9b8c];return _0x5afdbc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf0a9('0x0'));var zipdir=require(_0xf0a9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf0a9('0x2'));var moment=require('moment');var BPromise=require(_0xf0a9('0x3'));var Mustache=require(_0xf0a9('0x4'));var util=require(_0xf0a9('0x5'));var path=require(_0xf0a9('0x6'));var sox=require(_0xf0a9('0x7'));var csv=require('to-csv');var ejs=require(_0xf0a9('0x8'));var fs=require('fs');var fs_extra=require(_0xf0a9('0x9'));var _=require('lodash');var squel=require(_0xf0a9('0xa'));var crypto=require('crypto');var jsforce=require(_0xf0a9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf0a9('0xc'));var querystring=require('querystring');var Papa=require(_0xf0a9('0xd'));var Redis=require('ioredis');var authService=require(_0xf0a9('0xe'));var qs=require(_0xf0a9('0xf'));var as=require(_0xf0a9('0x10'));var hardwareService=require(_0xf0a9('0x11'));var logger=require('../../config/logger')(_0xf0a9('0x12'));var utils=require(_0xf0a9('0x13'));var config=require(_0xf0a9('0x14'));var licenseUtil=require(_0xf0a9('0x15'));var db=require(_0xf0a9('0x16'))['db'];function respondWithStatusCode(_0x509199,_0x18b9dd){_0x18b9dd=_0x18b9dd||0xcc;return function(_0x3e2769){if(_0x3e2769){return _0x509199[_0xf0a9('0x17')](_0x18b9dd);}return _0x509199[_0xf0a9('0x18')](_0x18b9dd)[_0xf0a9('0x19')]();};}function respondWithResult(_0x3434d2,_0x25a372){_0x25a372=_0x25a372||0xc8;return function(_0x21247a){if(_0x21247a){return _0x3434d2[_0xf0a9('0x18')](_0x25a372)[_0xf0a9('0x1a')](_0x21247a);}};}function respondWithFilteredResult(_0x21bb83,_0x38e7b4){return function(_0x39f784){if(_0x39f784){var _0x1dddbd=typeof _0x38e7b4[_0xf0a9('0x1b')]==='undefined'&&typeof _0x38e7b4['limit']==='undefined';var _0x544a31=_0x39f784[_0xf0a9('0x1c')];var _0x589450=_0x1dddbd?0x0:_0x38e7b4[_0xf0a9('0x1b')];var _0x28c035=_0x1dddbd?_0x39f784['count']:_0x38e7b4[_0xf0a9('0x1b')]+_0x38e7b4['limit'];var _0x8c9e03;if(_0x28c035>=_0x544a31){_0x28c035=_0x544a31;_0x8c9e03=0xc8;}else{_0x8c9e03=0xce;}_0x21bb83['status'](_0x8c9e03);return _0x21bb83[_0xf0a9('0x1d')](_0xf0a9('0x1e'),_0x589450+'-'+_0x28c035+'/'+_0x544a31)[_0xf0a9('0x1a')](_0x39f784);}return null;};}function patchUpdates(_0x21da55){return function(_0x16ef78){try{jsonpatch[_0xf0a9('0x1f')](_0x16ef78,_0x21da55,!![]);}catch(_0x141ad9){return BPromise[_0xf0a9('0x20')](_0x141ad9);}return _0x16ef78[_0xf0a9('0x21')]();};}function saveUpdates(_0x3f01ea,_0x3e3ed5){return function(_0x1f4543){if(_0x1f4543){return _0x1f4543[_0xf0a9('0x22')](_0x3f01ea)[_0xf0a9('0x23')](function(_0x5d716a){return _0x5d716a;});}return null;};}function removeEntity(_0x522a73,_0x3ea695){return function(_0x139654){if(_0x139654){return _0x139654[_0xf0a9('0x24')]()['then'](function(){_0x522a73[_0xf0a9('0x18')](0xcc)[_0xf0a9('0x19')]();});}};}function handleEntityNotFound(_0x1d06e5,_0x1de86a){return function(_0x4a58e6){if(!_0x4a58e6){_0x1d06e5['sendStatus'](0x194);}return _0x4a58e6;};}function handleError(_0x414a9e,_0x50fcee){_0x50fcee=_0x50fcee||0x1f4;return function(_0x5a6f6d){logger['error'](_0x5a6f6d[_0xf0a9('0x25')]);if(_0x5a6f6d[_0xf0a9('0x26')]){delete _0x5a6f6d[_0xf0a9('0x26')];}_0x414a9e[_0xf0a9('0x18')](_0x50fcee)[_0xf0a9('0x27')](_0x5a6f6d);};}exports[_0xf0a9('0x22')]=function(_0xfa291,_0x1e1b4e){if(_0xfa291[_0xf0a9('0x28')]['id']){delete _0xfa291['body']['id'];}return db[_0xf0a9('0x29')][_0xf0a9('0x2a')]({'where':{'id':_0xfa291[_0xf0a9('0x2b')]['id']}})['then'](handleEntityNotFound(_0x1e1b4e,null))[_0xf0a9('0x23')](saveUpdates(_0xfa291[_0xf0a9('0x28')],null))[_0xf0a9('0x23')](respondWithResult(_0x1e1b4e,null))[_0xf0a9('0x2c')](handleError(_0x1e1b4e,null));};exports['destroy']=function(_0x359100,_0x4f72ba){return db[_0xf0a9('0x29')]['find']({'where':{'id':_0x359100[_0xf0a9('0x2b')]['id']}})[_0xf0a9('0x23')](handleEntityNotFound(_0x4f72ba,null))[_0xf0a9('0x23')](removeEntity(_0x4f72ba,null))[_0xf0a9('0x2c')](handleError(_0x4f72ba,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 11f0324..5a7aefa 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 _0x0065=['define','Action','tools_actions','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./action.attributes','exports'];(function(_0x2cb151,_0x18fd98){var _0x518d03=function(_0x29fb4e){while(--_0x29fb4e){_0x2cb151['push'](_0x2cb151['shift']());}};_0x518d03(++_0x18fd98);}(_0x0065,0x7b));var _0x5006=function(_0x5f3378,_0x55b77a){_0x5f3378=_0x5f3378-0x0;var _0x2d8566=_0x0065[_0x5f3378];return _0x2d8566;};'use strict';var _=require('lodash');var util=require(_0x5006('0x0'));var logger=require(_0x5006('0x1'))(_0x5006('0x2'));var moment=require(_0x5006('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5006('0x4'));var rimraf=require(_0x5006('0x5'));var config=require(_0x5006('0x6'));var attributes=require(_0x5006('0x7'));module[_0x5006('0x8')]=function(_0x34d699,_0x30e43f){return _0x34d699[_0x5006('0x9')](_0x5006('0xa'),attributes,{'tableName':_0x5006('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa96d=['api','moment','request-promise','rimraf','./action.attributes','exports','define','Action','tools_actions','lodash','util'];(function(_0x3c42ff,_0x45ee1f){var _0x4c0f6d=function(_0x3ec265){while(--_0x3ec265){_0x3c42ff['push'](_0x3c42ff['shift']());}};_0x4c0f6d(++_0x45ee1f);}(_0xa96d,0xa3));var _0xda96=function(_0x17e75e,_0x24753e){_0x17e75e=_0x17e75e-0x0;var _0x25f451=_0xa96d[_0x17e75e];return _0x25f451;};'use strict';var _=require(_0xda96('0x0'));var util=require(_0xda96('0x1'));var logger=require('../../config/logger')(_0xda96('0x2'));var moment=require(_0xda96('0x3'));var BPromise=require('bluebird');var rp=require(_0xda96('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xda96('0x5'));var config=require('../../config/environment');var attributes=require(_0xda96('0x6'));module[_0xda96('0x7')]=function(_0x28eb71,_0x5f0868){return _0x28eb71[_0xda96('0x8')](_0xda96('0x9'),attributes,{'tableName':_0xda96('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 7df28bc..a2ca7ee 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 _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x455633,_0x3e63ef){var _0x3daa1b=function(_0x14d6d8){while(--_0x14d6d8){_0x455633['push'](_0x455633['shift']());}};_0x3daa1b(++_0x3e63ef);}(_0x5fab,0x177));var _0xb5fa=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0x5fab[_0x46f1a6];return _0x38429a;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
+var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x7217,0x19e));var _0x7721=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x7217[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index f63c339..83fb497 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 _0xec4f=['update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated'];(function(_0x353b95,_0xcded9){var _0x18819b=function(_0x1c6ad1){while(--_0x1c6ad1){_0x353b95['push'](_0x353b95['shift']());}};_0x18819b(++_0xcded9);}(_0xec4f,0x99));var _0xfec4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xec4f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfec4('0x0'));var util=require(_0xfec4('0x1'));var path=require(_0xfec4('0x2'));var timeout=require('connect-timeout');var express=require(_0xfec4('0x3'));var router=express[_0xfec4('0x4')]();var fs_extra=require(_0xfec4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfec4('0x6'));var config=require(_0xfec4('0x7'));var controller=require(_0xfec4('0x8'));router[_0xfec4('0x9')](_0xfec4('0xa'),auth[_0xfec4('0xb')](),controller[_0xfec4('0xc')]);router[_0xfec4('0xd')](_0xfec4('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xfec4('0xe')]=router;
\ No newline at end of file
+var _0x7bf9=['./action.controller','put','/:id','isAuthenticated','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2e249d,_0x41b7e7){var _0x1faa37=function(_0x1422b4){while(--_0x1422b4){_0x2e249d['push'](_0x2e249d['shift']());}};_0x1faa37(++_0x41b7e7);}(_0x7bf9,0xe8));var _0x97bf=function(_0x3272f6,_0x449bee){_0x3272f6=_0x3272f6-0x0;var _0x3fe947=_0x7bf9[_0x3272f6];return _0x3fe947;};'use strict';var multer=require(_0x97bf('0x0'));var util=require(_0x97bf('0x1'));var path=require(_0x97bf('0x2'));var timeout=require('connect-timeout');var express=require(_0x97bf('0x3'));var router=express[_0x97bf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x97bf('0x5'));var interaction=require(_0x97bf('0x6'));var config=require(_0x97bf('0x7'));var controller=require(_0x97bf('0x8'));router[_0x97bf('0x9')](_0x97bf('0xa'),auth[_0x97bf('0xb')](),controller[_0x97bf('0xc')]);router[_0x97bf('0xd')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x97bf('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 4a0e593..60faae0 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 _0xa630=['STRING','TEXT','sequelize','exports'];(function(_0x5453a5,_0x379cc5){var _0x2155cb=function(_0x1e7739){while(--_0x1e7739){_0x5453a5['push'](_0x5453a5['shift']());}};_0x2155cb(++_0x379cc5);}(_0xa630,0xbe));var _0x0a63=function(_0x3897aa,_0x5d2da9){_0x3897aa=_0x3897aa-0x0;var _0x583e7e=_0xa630[_0x3897aa];return _0x583e7e;};'use strict';var Sequelize=require(_0x0a63('0x0'));module[_0x0a63('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x0a63('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x0a63('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x2331fd,_0x13723f){var _0x233162=function(_0x23ad02){while(--_0x23ad02){_0x2331fd['push'](_0x2331fd['shift']());}};_0x233162(++_0x13723f);}(_0xabce,0x103));var _0xeabc=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xabce[_0x334841];return _0x5beb4b;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 1b19ccc..f562d05 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 _0x9e7b=['IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','function','format','replace','groupBy','orderBy','alias','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','AVG(%s)','UNIX_TIMESTAMP(%s)','from','DESC','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','update','then','destroy','UserProfileResource','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','options','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL'];(function(_0x4e7ed8,_0x2b9946){var _0x3b9fa1=function(_0x5cee9b){while(--_0x5cee9b){_0x4e7ed8['push'](_0x4e7ed8['shift']());}};_0x3b9fa1(++_0x2b9946);}(_0x9e7b,0xed));var _0xb9e7=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x9e7b[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xb9e7('0x0'));var rimraf=require(_0xb9e7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb9e7('0x2'));var rp=require(_0xb9e7('0x3'));var moment=require(_0xb9e7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb9e7('0x5'));var util=require(_0xb9e7('0x6'));var path=require(_0xb9e7('0x7'));var sox=require(_0xb9e7('0x8'));var csv=require(_0xb9e7('0x9'));var ejs=require(_0xb9e7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb9e7('0xb'));var squel=require(_0xb9e7('0xc'));var crypto=require(_0xb9e7('0xd'));var jsforce=require(_0xb9e7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb9e7('0x9'));var querystring=require(_0xb9e7('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb9e7('0x10'));var qs=require(_0xb9e7('0x11'));var as=require(_0xb9e7('0x12'));var hardwareService=require(_0xb9e7('0x13'));var logger=require(_0xb9e7('0x14'))('api');var utils=require(_0xb9e7('0x15'));var config=require(_0xb9e7('0x16'));var licenseUtil=require(_0xb9e7('0x17'));var db=require(_0xb9e7('0x18'))['db'];var dbH=require(_0xb9e7('0x18'))['dbH'];function respondWithStatusCode(_0x524db0,_0x48c150){_0x48c150=_0x48c150||0xcc;return function(_0x19e2df){if(_0x19e2df){return _0x524db0[_0xb9e7('0x19')](_0x48c150);}return _0x524db0[_0xb9e7('0x1a')](_0x48c150)[_0xb9e7('0x1b')]();};}function respondWithResult(_0x1ba2ec,_0x4ca423){_0x4ca423=_0x4ca423||0xc8;return function(_0x36b87c){if(_0x36b87c){return _0x1ba2ec[_0xb9e7('0x1a')](_0x4ca423)['json'](_0x36b87c);}};}function respondWithFilteredResult(_0x3a8806,_0x337552){return function(_0x5157af){if(_0x5157af){var _0x32a300=typeof _0x337552[_0xb9e7('0x1c')]===_0xb9e7('0x1d')&&typeof _0x337552['limit']===_0xb9e7('0x1d');var _0x458113=_0x5157af[_0xb9e7('0x1e')];var _0x4f6750=_0x32a300?0x0:_0x337552[_0xb9e7('0x1c')];var _0x338a26=_0x32a300?_0x5157af[_0xb9e7('0x1e')]:_0x337552[_0xb9e7('0x1c')]+_0x337552[_0xb9e7('0x1f')];var _0x4c3290;if(_0x338a26>=_0x458113){_0x338a26=_0x458113;_0x4c3290=0xc8;}else{_0x4c3290=0xce;}_0x3a8806[_0xb9e7('0x1a')](_0x4c3290);return _0x3a8806[_0xb9e7('0x20')](_0xb9e7('0x21'),_0x4f6750+'-'+_0x338a26+'/'+_0x458113)[_0xb9e7('0x22')](_0x5157af);}return null;};}function patchUpdates(_0x537d37){return function(_0x3c20d0){try{jsonpatch[_0xb9e7('0x23')](_0x3c20d0,_0x537d37,!![]);}catch(_0x4042e0){return BPromise['reject'](_0x4042e0);}return _0x3c20d0['save']();};}function saveUpdates(_0x31f4ee,_0x57c827){return function(_0x226bc7){if(_0x226bc7){return _0x226bc7[_0xb9e7('0x24')](_0x31f4ee)[_0xb9e7('0x25')](function(_0x45c0b1){return _0x45c0b1;});}return null;};}function removeEntity(_0x5375d4,_0x91fdeb){return function(_0x139068){if(_0x139068){return _0x139068[_0xb9e7('0x26')]()[_0xb9e7('0x25')](function(){var _0x278b33=_0x139068['get']({'plain':!![]});var _0x555d87='CustomReports';return db[_0xb9e7('0x27')][_0xb9e7('0x26')]({'where':{'type':_0x555d87,'resourceId':_0x278b33['id']}})[_0xb9e7('0x25')](function(){return _0x139068;});})['then'](function(){_0x5375d4['status'](0xcc)[_0xb9e7('0x1b')]();});}};}function handleEntityNotFound(_0x1ab062,_0x444110){return function(_0x32e2ef){if(!_0x32e2ef){_0x1ab062['sendStatus'](0x194);}return _0x32e2ef;};}function handleError(_0x3d8415,_0x488341){_0x488341=_0x488341||0x1f4;return function(_0x3c725e){logger[_0xb9e7('0x28')](_0x3c725e['stack']);if(_0x3c725e[_0xb9e7('0x29')]){delete _0x3c725e[_0xb9e7('0x29')];}_0x3d8415[_0xb9e7('0x1a')](_0x488341)[_0xb9e7('0x2a')](_0x3c725e);};}exports[_0xb9e7('0x2b')]=function(_0x3e0ba3,_0xba6ef5){var _0x1f2f5a={},_0x5ae50e={},_0x4ab457={'count':0x0,'rows':[]};var _0x2d6301=_[_0xb9e7('0x2c')](db[_0xb9e7('0x2d')][_0xb9e7('0x2e')],function(_0x1ffb7d){return{'name':_0x1ffb7d[_0xb9e7('0x2f')],'type':_0x1ffb7d[_0xb9e7('0x30')][_0xb9e7('0x31')]};});_0x5ae50e[_0xb9e7('0x32')]=_['map'](_0x2d6301,_0xb9e7('0x29'));_0x5ae50e[_0xb9e7('0x33')]=_[_0xb9e7('0x34')](_0x3e0ba3[_0xb9e7('0x33')]);_0x5ae50e[_0xb9e7('0x35')]=_[_0xb9e7('0x36')](_0x5ae50e[_0xb9e7('0x32')],_0x5ae50e[_0xb9e7('0x33')]);_0x1f2f5a[_0xb9e7('0x37')]=_[_0xb9e7('0x36')](_0x5ae50e[_0xb9e7('0x32')],qs[_0xb9e7('0x38')](_0x3e0ba3[_0xb9e7('0x33')][_0xb9e7('0x38')]));_0x1f2f5a[_0xb9e7('0x37')]=_0x1f2f5a['attributes'][_0xb9e7('0x39')]?_0x1f2f5a['attributes']:_0x5ae50e[_0xb9e7('0x32')];if(!_0x3e0ba3['query']['hasOwnProperty'](_0xb9e7('0x3a'))){_0x1f2f5a['limit']=qs[_0xb9e7('0x1f')](_0x3e0ba3[_0xb9e7('0x33')][_0xb9e7('0x1f')]);_0x1f2f5a[_0xb9e7('0x1c')]=qs[_0xb9e7('0x1c')](_0x3e0ba3[_0xb9e7('0x33')][_0xb9e7('0x1c')]);}_0x1f2f5a[_0xb9e7('0x3b')]=qs[_0xb9e7('0x3c')](_0x3e0ba3[_0xb9e7('0x33')][_0xb9e7('0x3c')]);_0x1f2f5a[_0xb9e7('0x3d')]=qs[_0xb9e7('0x35')](_[_0xb9e7('0x3e')](_0x3e0ba3[_0xb9e7('0x33')],_0x5ae50e[_0xb9e7('0x35')]),_0x2d6301);if(_0x3e0ba3['query'][_0xb9e7('0x3f')]){_0x1f2f5a[_0xb9e7('0x3d')]=_['merge'](_0x1f2f5a['where'],{'$or':_[_0xb9e7('0x2c')](_0x2d6301,function(_0x319e02){if(_0x319e02['type']!==_0xb9e7('0x40')){var _0x1cbf68={};_0x1cbf68[_0x319e02['name']]={'$like':'%'+_0x3e0ba3[_0xb9e7('0x33')][_0xb9e7('0x3f')]+'%'};return _0x1cbf68;}})});}_0x1f2f5a=_[_0xb9e7('0x41')]({},_0x1f2f5a,_0x3e0ba3['options']);var _0x3348c8={'where':_0x1f2f5a[_0xb9e7('0x3d')]};return db['AnalyticCustomReport'][_0xb9e7('0x1e')](_0x3348c8)[_0xb9e7('0x25')](function(_0x3de092){_0x4ab457[_0xb9e7('0x1e')]=_0x3de092;if(_0x3e0ba3[_0xb9e7('0x33')][_0xb9e7('0x42')]){_0x1f2f5a[_0xb9e7('0x43')]=[{'all':!![]}];}return db[_0xb9e7('0x2d')][_0xb9e7('0x44')](_0x1f2f5a);})['then'](function(_0x466fb6){_0x4ab457[_0xb9e7('0x45')]=_0x466fb6;return _0x4ab457;})[_0xb9e7('0x25')](respondWithFilteredResult(_0xba6ef5,_0x1f2f5a))[_0xb9e7('0x46')](handleError(_0xba6ef5,null));};exports['show']=function(_0x3166d9,_0x508f61){var _0x41ced0={'raw':![],'where':{'id':_0x3166d9[_0xb9e7('0x47')]['id']}},_0x451ec4={};_0x451ec4[_0xb9e7('0x32')]=_[_0xb9e7('0x34')](db[_0xb9e7('0x2d')][_0xb9e7('0x2e')]);_0x451ec4[_0xb9e7('0x33')]=_[_0xb9e7('0x34')](_0x3166d9['query']);_0x451ec4[_0xb9e7('0x35')]=_[_0xb9e7('0x36')](_0x451ec4[_0xb9e7('0x32')],_0x451ec4['query']);_0x41ced0[_0xb9e7('0x37')]=_[_0xb9e7('0x36')](_0x451ec4[_0xb9e7('0x32')],qs[_0xb9e7('0x38')](_0x3166d9[_0xb9e7('0x33')][_0xb9e7('0x38')]));_0x41ced0[_0xb9e7('0x37')]=_0x41ced0[_0xb9e7('0x37')][_0xb9e7('0x39')]?_0x41ced0[_0xb9e7('0x37')]:_0x451ec4[_0xb9e7('0x32')];if(_0x3166d9['query'][_0xb9e7('0x42')]){_0x41ced0[_0xb9e7('0x43')]=[{'all':!![]}];}_0x41ced0=_[_0xb9e7('0x41')]({},_0x41ced0,_0x3166d9[_0xb9e7('0x48')]);return db[_0xb9e7('0x2d')]['find'](_0x41ced0)[_0xb9e7('0x25')](handleEntityNotFound(_0x508f61,null))[_0xb9e7('0x25')](respondWithResult(_0x508f61,null))[_0xb9e7('0x46')](handleError(_0x508f61,null));};exports['create']=function(_0x5452d8,_0x4ceff6){return db[_0xb9e7('0x2d')]['create'](_0x5452d8[_0xb9e7('0x49')],{})['then'](function(_0x50a81f){var _0x2094a8=_0x5452d8[_0xb9e7('0x4a')][_0xb9e7('0x4b')]({'plain':!![]});if(!_0x2094a8)throw new Error(_0xb9e7('0x4c'));if(_0x2094a8[_0xb9e7('0x4d')]===_0xb9e7('0x4a')){var _0x3cedad=_0x50a81f[_0xb9e7('0x4b')]({'plain':!![]});var _0x131a5e='Reports';return db[_0xb9e7('0x4e')]['find']({'where':{'name':_0x131a5e,'userProfileId':_0x2094a8[_0xb9e7('0x4f')]},'raw':!![]})['then'](function(_0x1fc7f7){if(_0x1fc7f7&&_0x1fc7f7[_0xb9e7('0x50')]===0x0){return db['UserProfileResource'][_0xb9e7('0x51')]({'name':_0x3cedad[_0xb9e7('0x29')],'resourceId':_0x3cedad['id'],'type':_0xb9e7('0x52'),'sectionId':_0x1fc7f7['id']},{})[_0xb9e7('0x25')](function(){return _0x50a81f;});}else{return _0x50a81f;}})[_0xb9e7('0x46')](function(_0xc40a45){logger[_0xb9e7('0x28')](_0xb9e7('0x53'),_0xc40a45);throw _0xc40a45;});}return _0x50a81f;})[_0xb9e7('0x25')](respondWithResult(_0x4ceff6,0xc9))[_0xb9e7('0x46')](handleError(_0x4ceff6,null));};exports[_0xb9e7('0x24')]=function(_0x5523e2,_0x47f6b8){if(_0x5523e2[_0xb9e7('0x49')]['id']){delete _0x5523e2[_0xb9e7('0x49')]['id'];}return db[_0xb9e7('0x2d')][_0xb9e7('0x54')]({'where':{'id':_0x5523e2['params']['id']}})['then'](handleEntityNotFound(_0x47f6b8,null))[_0xb9e7('0x25')](saveUpdates(_0x5523e2['body'],null))[_0xb9e7('0x25')](respondWithResult(_0x47f6b8,null))[_0xb9e7('0x46')](handleError(_0x47f6b8,null));};exports[_0xb9e7('0x26')]=function(_0x2e1f1,_0xc56bd9){return db[_0xb9e7('0x2d')]['find']({'where':{'id':_0x2e1f1[_0xb9e7('0x47')]['id']}})['then'](handleEntityNotFound(_0xc56bd9,null))['then'](removeEntity(_0xc56bd9,null))[_0xb9e7('0x46')](handleError(_0xc56bd9,null));};exports['preview']=function(_0x3ca2f6,_0x82b25d){var _0x37caf6=0xa;var _0x9fc4a=[_0xb9e7('0x55'),_0xb9e7('0x56'),'right_join',_0xb9e7('0x57')];var _0x2340c3={'SUM':_0xb9e7('0x58'),'COUNT':_0xb9e7('0x59'),'COUNT DISTINCT':_0xb9e7('0x5a'),'MAX':_0xb9e7('0x5b'),'MIN':_0xb9e7('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb9e7('0x5d'),'GROUP_CONCAT ASC':_0xb9e7('0x5e'),'GROUP_CONCAT DESC':_0xb9e7('0x5f')};var _0x5b5675={'SEC_TO_TIME':_0xb9e7('0x60'),'DATE':_0xb9e7('0x61'),'HOUR':_0xb9e7('0x62'),'ROUND':_0xb9e7('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4868f0=function(_0x4f01b5){return!_['includes']([_0xb9e7('0x64'),_0xb9e7('0x65'),_0xb9e7('0x66'),_0xb9e7('0x67')],_0x4f01b5);};var _0x4c8cb2=function(_0x531d28){if(!_0x531d28||!_0x531d28[_0xb9e7('0x68')][_0xb9e7('0x39')]){return'';}for(var _0x6ef654='(',_0x4eb545=0x0;_0x4eb545<_0x531d28[_0xb9e7('0x68')]['length'];_0x4eb545+=0x1){_0x4eb545>0x0&&(_0x6ef654+='\x20'+_0x531d28[_0xb9e7('0x69')]+'\x20');_0x6ef654+=_0x531d28['rules'][_0x4eb545][_0xb9e7('0x6a')]?_0x4c8cb2(_0x531d28[_0xb9e7('0x68')][_0x4eb545][_0xb9e7('0x6a')]):_0x531d28['rules'][_0x4eb545][_0xb9e7('0x6b')]+'\x20'+_0x531d28[_0xb9e7('0x68')][_0x4eb545][_0xb9e7('0x6c')]+(_0x4868f0(_0x531d28[_0xb9e7('0x68')][_0x4eb545][_0xb9e7('0x6c')])?'\x20'+_0x531d28['rules'][_0x4eb545][_0xb9e7('0x6d')]:'');}return _0x6ef654+')';};var _0x30aa29={'where':{'id':_0x3ca2f6[_0xb9e7('0x47')]['id']}},_0x590ede,_0x2eeffb,_0x56682f,_0x5d77d6,_0x2f1a1a;_0x30aa29=_['merge']({},_0x30aa29,_0x3ca2f6[_0xb9e7('0x48')]);return db[_0xb9e7('0x2d')][_0xb9e7('0x54')](_0x30aa29)[_0xb9e7('0x25')](function(_0x42fbc7){if(_0x42fbc7){_0x590ede=_0x42fbc7;return _0x42fbc7[_0xb9e7('0x6e')]();}return null;})['then'](function(_0x5c9778){if(_0x5c9778){if(!_0x5c9778[_0xb9e7('0x39')]){throw new db[(_0xb9e7('0x6f'))][(_0xb9e7('0x70'))](_0xb9e7('0x71'),0x193);}_0x2eeffb=_0x5c9778;return db[_0xb9e7('0x72')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1f69f3){if(_0x1f69f3){_0x56682f=_['keyBy'](_0x1f69f3,'id');var _0x5e3d0c;var _0x1fb093=squel[_0xb9e7('0x73')]();_0x1fb093['from'](_0x590ede[_0xb9e7('0x74')]);for(var _0x3b9660=0x0;_0x3b9660<_0x2eeffb[_0xb9e7('0x39')];_0x3b9660+=0x1){_0x5e3d0c=_0x2eeffb[_0x3b9660][_0xb9e7('0x75')]?_0x56682f[_0x2eeffb[_0x3b9660]['MetricId']][_0xb9e7('0x76')]:_0x2eeffb[_0x3b9660][_0xb9e7('0x6b')];_0x5e3d0c=_0x2eeffb[_0x3b9660][_0xb9e7('0x77')]?_['replace'](_0x2340c3[_0x2eeffb[_0x3b9660][_0xb9e7('0x77')]],'%s',_0x5e3d0c):_0x5e3d0c;_0x5e3d0c=_0x2eeffb[_0x3b9660][_0xb9e7('0x78')]?_[_0xb9e7('0x79')](_0x5b5675[_0x2eeffb[_0x3b9660][_0xb9e7('0x78')]],'%s',_0x5e3d0c):_0x5e3d0c;if(_0x2eeffb[_0x3b9660][_0xb9e7('0x7a')]){_0x1fb093[_0xb9e7('0x6a')](_0x5e3d0c);}_0x2eeffb[_0x3b9660]['orderBy']&&_0x1fb093[_0xb9e7('0x3b')](_0x5e3d0c,_0x2eeffb[_0x3b9660][_0xb9e7('0x7b')]==='DESC'?![]:!![]);_0x1fb093[_0xb9e7('0x6b')](_0x5e3d0c,_0x2eeffb[_0x3b9660][_0xb9e7('0x7c')]||_0x5e3d0c);}if(_0x590ede[_0xb9e7('0x7d')]){_0x590ede[_0xb9e7('0x7d')]=JSON[_0xb9e7('0x7e')](_0x590ede[_0xb9e7('0x7d')]);for(var _0x110403=0x0;_0x110403<_0x590ede[_0xb9e7('0x7d')][_0xb9e7('0x39')];_0x110403+=0x1){if(_0x590ede[_0xb9e7('0x7d')][_0x110403][_0xb9e7('0x30')]&&_[_0xb9e7('0x7f')](_0x9fc4a,_0x590ede[_0xb9e7('0x7d')][_0x110403]['type'])&&_0x590ede[_0xb9e7('0x7d')][_0x110403][_0xb9e7('0x80')]&&_0x590ede[_0xb9e7('0x7d')][_0x110403][_0xb9e7('0x81')]&&_0x590ede['joins'][_0x110403]['foreignKey']){_0x1fb093[_0x590ede['joins'][_0x110403]['type']](_0x590ede[_0xb9e7('0x7d')][_0x110403]['foreignTable'],null,util[_0xb9e7('0x78')](_0xb9e7('0x82'),_0x590ede[_0xb9e7('0x74')],_0x590ede['joins'][_0x110403]['parentKey'],_0x590ede[_0xb9e7('0x7d')][_0x110403][_0xb9e7('0x81')],_0x590ede['joins'][_0x110403][_0xb9e7('0x83')]));}}}if(_0x590ede[_0xb9e7('0x84')]){_0x590ede['conditions']=JSON[_0xb9e7('0x7e')](_0x590ede[_0xb9e7('0x84')]);_0x1fb093['where'](_0x4c8cb2(_0x590ede[_0xb9e7('0x84')][_0xb9e7('0x6a')]));}_0x2f1a1a=_0x1fb093[_0xb9e7('0x85')]();_0x1fb093['limit'](_0x37caf6);_0x1fb093[_0xb9e7('0x1c')](0x0);logger[_0xb9e7('0x86')](_0xb9e7('0x87'),_0x1fb093['toString']());return dbH[_0xb9e7('0x88')]['query'](_0x1fb093[_0xb9e7('0x89')](),{'type':dbH[_0xb9e7('0x88')][_0xb9e7('0x8a')]['SELECT']});}})[_0xb9e7('0x25')](respondWithResult(_0x82b25d,null))[_0xb9e7('0x46')](handleError(_0x82b25d,null));};function runReport(_0x5d4c90,_0x194a77,_0x4f00f5){var _0x4c4b39=_0x194a77['name'];var _0x4bd5a5=0xa;var _0x53cd82=['join','left_join',_0xb9e7('0x8b'),_0xb9e7('0x57')];var _0x5ac80b={'SUM':_0xb9e7('0x58'),'COUNT':_0xb9e7('0x59'),'COUNT DISTINCT':_0xb9e7('0x5a'),'MAX':_0xb9e7('0x5b'),'MIN':'MIN(%s)','AVG':_0xb9e7('0x8c'),'GROUP_CONCAT':_0xb9e7('0x5d'),'GROUP_CONCAT ASC':_0xb9e7('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x44995d={'SEC_TO_TIME':_0xb9e7('0x60'),'DATE':_0xb9e7('0x61'),'HOUR':_0xb9e7('0x62'),'ROUND':_0xb9e7('0x63'),'UNIX_TIMESTAMP':_0xb9e7('0x8d')};var _0x5be03a=function(_0x5aced7){return!_[_0xb9e7('0x7f')](['IS\x20NULL',_0xb9e7('0x65'),_0xb9e7('0x66'),_0xb9e7('0x67')],_0x5aced7);};var _0x18aafe=function(_0x4ead26){if(!_0x4ead26||!_0x4ead26[_0xb9e7('0x68')]['length']){return'';}for(var _0x48c578='(',_0x2062a2=0x0;_0x2062a2<_0x4ead26['rules'][_0xb9e7('0x39')];_0x2062a2+=0x1){_0x2062a2>0x0&&(_0x48c578+='\x20'+_0x4ead26['operator']+'\x20');_0x48c578+=_0x4ead26[_0xb9e7('0x68')][_0x2062a2]['group']?_0x18aafe(_0x4ead26[_0xb9e7('0x68')][_0x2062a2][_0xb9e7('0x6a')]):_0x4ead26[_0xb9e7('0x68')][_0x2062a2]['field']+'\x20'+_0x4ead26[_0xb9e7('0x68')][_0x2062a2][_0xb9e7('0x6c')]+(_0x5be03a(_0x4ead26[_0xb9e7('0x68')][_0x2062a2][_0xb9e7('0x6c')])?'\x20'+_0x4ead26['rules'][_0x2062a2][_0xb9e7('0x6d')]:'');}return _0x48c578+')';};var _0x27cabc={'where':{'id':_0x5d4c90['id']}},_0x4122b5,_0x248956,_0x5dae41,_0x17ea2d,_0x3c39ae;_0x27cabc=_[_0xb9e7('0x41')]({},_0x27cabc,_0x4f00f5);return db[_0xb9e7('0x2d')][_0xb9e7('0x54')](_0x27cabc)[_0xb9e7('0x25')](function(_0xbb15fa){if(_0xbb15fa){_0x4122b5=_0xbb15fa;return _0xbb15fa['getFields']();}return null;})[_0xb9e7('0x25')](function(_0x173cec){if(_0x173cec){if(!_0x173cec[_0xb9e7('0x39')]){throw new db[(_0xb9e7('0x6f'))][(_0xb9e7('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x248956=_0x173cec;return db[_0xb9e7('0x72')][_0xb9e7('0x44')]({'raw':!![]});}return null;})[_0xb9e7('0x25')](function(_0x3d5cf7){if(_0x3d5cf7){_0x5dae41=_['keyBy'](_0x3d5cf7,'id');var _0x3d3381;var _0x1a9d13=squel[_0xb9e7('0x73')]();_0x1a9d13[_0xb9e7('0x8e')](_0x4122b5[_0xb9e7('0x74')]);for(var _0xc04890=0x0;_0xc04890<_0x248956[_0xb9e7('0x39')];_0xc04890+=0x1){_0x3d3381=_0x248956[_0xc04890][_0xb9e7('0x75')]?_0x5dae41[_0x248956[_0xc04890][_0xb9e7('0x75')]][_0xb9e7('0x76')]:_0x248956[_0xc04890][_0xb9e7('0x6b')];_0x3d3381=_0x248956[_0xc04890]['function']?_[_0xb9e7('0x79')](_0x5ac80b[_0x248956[_0xc04890][_0xb9e7('0x77')]],'%s',_0x3d3381):_0x3d3381;_0x3d3381=_0x248956[_0xc04890][_0xb9e7('0x78')]?_[_0xb9e7('0x79')](_0x44995d[_0x248956[_0xc04890][_0xb9e7('0x78')]],'%s',_0x3d3381):_0x3d3381;if(_0x248956[_0xc04890][_0xb9e7('0x7a')]){_0x1a9d13[_0xb9e7('0x6a')](_0x3d3381);}_0x248956[_0xc04890]['orderBy']&&_0x1a9d13[_0xb9e7('0x3b')](_0x3d3381,_0x248956[_0xc04890][_0xb9e7('0x7b')]===_0xb9e7('0x8f')?![]:!![]);_0x1a9d13[_0xb9e7('0x6b')](_0x3d3381,_0x248956[_0xc04890][_0xb9e7('0x7c')]||_0x3d3381);}if(_0x4122b5['joins']){_0x4122b5[_0xb9e7('0x7d')]=JSON[_0xb9e7('0x7e')](_0x4122b5[_0xb9e7('0x7d')]);for(var _0x4377eb=0x0;_0x4377eb<_0x4122b5['joins']['length'];_0x4377eb+=0x1){if(_0x4122b5[_0xb9e7('0x7d')][_0x4377eb]['type']&&_['includes'](_0x53cd82,_0x4122b5[_0xb9e7('0x7d')][_0x4377eb][_0xb9e7('0x30')])&&_0x4122b5['joins'][_0x4377eb][_0xb9e7('0x80')]&&_0x4122b5['joins'][_0x4377eb]['foreignTable']&&_0x4122b5[_0xb9e7('0x7d')][_0x4377eb][_0xb9e7('0x83')]){_0x1a9d13[_0x4122b5[_0xb9e7('0x7d')][_0x4377eb]['type']](_0x4122b5[_0xb9e7('0x7d')][_0x4377eb][_0xb9e7('0x81')],null,util[_0xb9e7('0x78')](_0xb9e7('0x82'),_0x4122b5[_0xb9e7('0x74')],_0x4122b5['joins'][_0x4377eb][_0xb9e7('0x80')],_0x4122b5[_0xb9e7('0x7d')][_0x4377eb][_0xb9e7('0x81')],_0x4122b5[_0xb9e7('0x7d')][_0x4377eb][_0xb9e7('0x83')]));}}}if(_0x4122b5[_0xb9e7('0x84')]){_0x4122b5[_0xb9e7('0x84')]=JSON[_0xb9e7('0x7e')](_0x4122b5['conditions']);_0x1a9d13[_0xb9e7('0x3d')](_0x18aafe(_0x4122b5[_0xb9e7('0x84')]['group']));}_0x3c39ae=_0x1a9d13[_0xb9e7('0x85')]();_0x1a9d13[_0xb9e7('0x1f')](_0x4bd5a5);_0x1a9d13[_0xb9e7('0x1c')](0x0);return;}})[_0xb9e7('0x25')](function(){if(_0x194a77['output']===_0xb9e7('0x90')){return null;}var _0x26814e=_['merge'](_0x194a77,{'name':_0x194a77[_0xb9e7('0x91')]||_0x194a77[_0xb9e7('0x29')]||_0x4122b5['name'],'basename':_0x4c4b39,'savename':util[_0xb9e7('0x78')](_0xb9e7('0x92'),_0x194a77[_0xb9e7('0x29')]||_0x4122b5[_0xb9e7('0x29')],require(_0xb9e7('0x93'))[_0xb9e7('0x94')](0x4),_0x194a77[_0xb9e7('0x95')]||_0xb9e7('0x96')),'reportId':_0x4122b5['id'],'reportType':_0xb9e7('0x97')});return db[_0xb9e7('0x98')][_0xb9e7('0x51')](_0x26814e,{'raw':!![]});})[_0xb9e7('0x25')](function(_0x22b5ec){if(_0x4122b5[_0xb9e7('0x74')]===_0xb9e7('0x99')){_0x3c39ae[_0xb9e7('0x3d')](_0x4122b5[_0xb9e7('0x74')]+_0xb9e7('0x9a'),_0x194a77['startDate'],_0x194a77[_0xb9e7('0x9b')]);}else{_0x3c39ae[_0xb9e7('0x3d')](_0x4122b5[_0xb9e7('0x74')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x194a77[_0xb9e7('0x9c')],_0x194a77[_0xb9e7('0x9b')]);}if(_0x22b5ec){logger[_0xb9e7('0x9d')](_0xb9e7('0x9e'),_0x3c39ae[_0xb9e7('0x89')]());require(_0xb9e7('0x9f'))[_0xb9e7('0xa0')](path['join'](__dirname,_0xb9e7('0xa1'),_0x22b5ec['output']),[_0x22b5ec['id'],_0x3c39ae[_0xb9e7('0x89')](),path['join'](__dirname,_0xb9e7('0xa2'),_0x22b5ec[_0xb9e7('0xa3')]),_0x4c4b39]);return _0x22b5ec;}else{var _0x413daa=squel['select']();_0x413daa[_0xb9e7('0x8e')]('('+_0x3c39ae['toString']()+')',_0xb9e7('0xa4'));_0x413daa[_0xb9e7('0x6b')](_0xb9e7('0xa5'),_0xb9e7('0x1e'));_0x3c39ae[_0xb9e7('0x1f')](_0x194a77[_0xb9e7('0x1f')]||_0x4bd5a5);_0x3c39ae[_0xb9e7('0x1c')](_0x194a77['offset']||0x0);return dbH[_0xb9e7('0x88')][_0xb9e7('0x33')](_0x413daa[_0xb9e7('0x89')](),{'type':dbH[_0xb9e7('0x88')][_0xb9e7('0x8a')]['SELECT']})[_0xb9e7('0x25')](function(_0x111302){if(!_0x111302[_0xb9e7('0x39')]){_0x17ea2d=0x0;}else{_0x17ea2d=_0x111302[0x0][_0xb9e7('0x1e')]||0x0;}return dbH['sequelize']['query'](_0x3c39ae[_0xb9e7('0x89')](),{'type':dbH[_0xb9e7('0x88')][_0xb9e7('0x8a')][_0xb9e7('0xa6')]});})['then'](function(_0x3a7087){return{'rows':_0x3a7087||[],'count':_0x17ea2d};});}});}exports[_0xb9e7('0xa7')]=function(_0x321fac,_0x5ea24a){return runReport(_0x321fac[_0xb9e7('0x47')],_0x321fac['query'],_0x321fac[_0xb9e7('0x48')])['then'](respondWithResult(_0x5ea24a,null))[_0xb9e7('0x46')](handleError(_0x5ea24a,null));};exports[_0xb9e7('0xa8')]=runReport;exports[_0xb9e7('0x33')]=function(_0x29f1f3,_0x158f6c){var _0xec383=0xa;var _0x1f005c=['join',_0xb9e7('0x56'),'right_join',_0xb9e7('0x57')];var _0x33072f={'SUM':_0xb9e7('0x58'),'COUNT':_0xb9e7('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb9e7('0x5b'),'MIN':_0xb9e7('0x5c'),'AVG':_0xb9e7('0x8c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb9e7('0x5e'),'GROUP_CONCAT DESC':_0xb9e7('0x5f')};var _0x33e984={'SEC_TO_TIME':_0xb9e7('0x60'),'DATE':_0xb9e7('0x61'),'HOUR':_0xb9e7('0x62'),'ROUND':_0xb9e7('0x63'),'UNIX_TIMESTAMP':_0xb9e7('0x8d')};var _0x2b9f6d=function(_0x51d7fd){return!_[_0xb9e7('0x7f')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0xb9e7('0x67')],_0x51d7fd);};var _0x1f1358=function(_0x5e0b6d){if(!_0x5e0b6d||!_0x5e0b6d[_0xb9e7('0x68')][_0xb9e7('0x39')]){return'';}for(var _0x1ff504='(',_0x42ff06=0x0;_0x42ff06<_0x5e0b6d[_0xb9e7('0x68')][_0xb9e7('0x39')];_0x42ff06+=0x1){_0x42ff06>0x0&&(_0x1ff504+='\x20'+_0x5e0b6d[_0xb9e7('0x69')]+'\x20');_0x1ff504+=_0x5e0b6d[_0xb9e7('0x68')][_0x42ff06][_0xb9e7('0x6a')]?_0x1f1358(_0x5e0b6d[_0xb9e7('0x68')][_0x42ff06][_0xb9e7('0x6a')]):_0x5e0b6d[_0xb9e7('0x68')][_0x42ff06][_0xb9e7('0x6b')]+'\x20'+_0x5e0b6d[_0xb9e7('0x68')][_0x42ff06][_0xb9e7('0x6c')]+(_0x2b9f6d(_0x5e0b6d[_0xb9e7('0x68')][_0x42ff06][_0xb9e7('0x6c')])?'\x20'+_0x5e0b6d[_0xb9e7('0x68')][_0x42ff06]['value']:'');}return _0x1ff504+')';};var _0x256d12={'where':{'id':_0x29f1f3['params']['id']}},_0x294070,_0x1fcff0,_0x5664c4,_0x3ec251,_0x42f320;_0x256d12=_['merge']({},_0x256d12,_0x29f1f3['options']);return db[_0xb9e7('0x2d')][_0xb9e7('0x54')](_0x256d12)[_0xb9e7('0x25')](function(_0x182f0e){if(_0x182f0e){_0x294070=_0x182f0e;return _0x182f0e[_0xb9e7('0x6e')]();}return null;})[_0xb9e7('0x25')](function(_0x1d3fe2){if(_0x1d3fe2){if(!_0x1d3fe2['length']){throw new db[(_0xb9e7('0x6f'))][(_0xb9e7('0x70'))](_0xb9e7('0x71'),0x193);}_0x1fcff0=_0x1d3fe2;return db['AnalyticMetric'][_0xb9e7('0x44')]({'raw':!![]});}return null;})[_0xb9e7('0x25')](function(_0x549d46){if(_0x549d46){_0x5664c4=_['keyBy'](_0x549d46,'id');var _0x411866;var _0x4708b3=squel[_0xb9e7('0x73')]();_0x4708b3[_0xb9e7('0x8e')](_0x294070[_0xb9e7('0x74')]);for(var _0x1612f1=0x0;_0x1612f1<_0x1fcff0['length'];_0x1612f1+=0x1){_0x411866=_0x1fcff0[_0x1612f1][_0xb9e7('0x75')]?_0x5664c4[_0x1fcff0[_0x1612f1][_0xb9e7('0x75')]][_0xb9e7('0x76')]:_0x1fcff0[_0x1612f1]['field'];_0x411866=_0x1fcff0[_0x1612f1][_0xb9e7('0x77')]?_[_0xb9e7('0x79')](_0x33072f[_0x1fcff0[_0x1612f1][_0xb9e7('0x77')]],'%s',_0x411866):_0x411866;_0x411866=_0x1fcff0[_0x1612f1][_0xb9e7('0x78')]?_[_0xb9e7('0x79')](_0x33e984[_0x1fcff0[_0x1612f1][_0xb9e7('0x78')]],'%s',_0x411866):_0x411866;if(_0x1fcff0[_0x1612f1][_0xb9e7('0x7a')]){_0x4708b3['group'](_0x411866);}_0x1fcff0[_0x1612f1][_0xb9e7('0x7b')]&&_0x4708b3[_0xb9e7('0x3b')](_0x411866,_0x1fcff0[_0x1612f1]['orderBy']===_0xb9e7('0x8f')?![]:!![]);_0x4708b3[_0xb9e7('0x6b')](_0x411866,_0x1fcff0[_0x1612f1][_0xb9e7('0x7c')]||_0x411866);}if(_0x294070[_0xb9e7('0x7d')]){_0x294070[_0xb9e7('0x7d')]=JSON[_0xb9e7('0x7e')](_0x294070[_0xb9e7('0x7d')]);for(var _0x42ba91=0x0;_0x42ba91<_0x294070[_0xb9e7('0x7d')][_0xb9e7('0x39')];_0x42ba91+=0x1){if(_0x294070[_0xb9e7('0x7d')][_0x42ba91][_0xb9e7('0x30')]&&_[_0xb9e7('0x7f')](_0x1f005c,_0x294070[_0xb9e7('0x7d')][_0x42ba91][_0xb9e7('0x30')])&&_0x294070['joins'][_0x42ba91]['parentKey']&&_0x294070[_0xb9e7('0x7d')][_0x42ba91][_0xb9e7('0x81')]&&_0x294070[_0xb9e7('0x7d')][_0x42ba91]['foreignKey']){_0x4708b3[_0x294070[_0xb9e7('0x7d')][_0x42ba91][_0xb9e7('0x30')]](_0x294070[_0xb9e7('0x7d')][_0x42ba91]['foreignTable'],null,util[_0xb9e7('0x78')](_0xb9e7('0x82'),_0x294070[_0xb9e7('0x74')],_0x294070[_0xb9e7('0x7d')][_0x42ba91]['parentKey'],_0x294070[_0xb9e7('0x7d')][_0x42ba91]['foreignTable'],_0x294070[_0xb9e7('0x7d')][_0x42ba91]['foreignKey']));}}}if(_0x294070['conditions']){_0x294070[_0xb9e7('0x84')]=JSON[_0xb9e7('0x7e')](_0x294070[_0xb9e7('0x84')]);_0x4708b3['where'](_0x1f1358(_0x294070[_0xb9e7('0x84')]['group']));}_0x42f320=_0x4708b3[_0xb9e7('0x85')]();_0x4708b3[_0xb9e7('0x1f')](_0xec383);_0x4708b3[_0xb9e7('0x1c')](0x0);logger[_0xb9e7('0x86')]('Limited\x20Query:',_0x4708b3[_0xb9e7('0x89')]());return dbH[_0xb9e7('0x88')][_0xb9e7('0x33')](_0x4708b3['toString'](),{'type':dbH['sequelize'][_0xb9e7('0x8a')][_0xb9e7('0xa6')]});}})[_0xb9e7('0x25')](function(){return{'sql':_0x42f320[_0xb9e7('0x89')]()};})[_0xb9e7('0x25')](respondWithResult(_0x158f6c,null))[_0xb9e7('0x46')](handleError(_0x158f6c,null));};
\ No newline at end of file
+var _0x7b1a=['IS\x20EMPTY','groupBy','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','dbH','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','get','CustomReports','destroy','sendStatus','stack','name','send','index','map','AnalyticCustomReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','foreignTable','foreignKey','parentKey','conditions','parse','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','left_join','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7b1a,0x166));var _0xa7b1=function(_0x46cd24,_0x2419ca){_0x46cd24=_0x46cd24-0x0;var _0x5623a3=_0x7b1a[_0x46cd24];return _0x5623a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa7b1('0x0'));var zipdir=require(_0xa7b1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa7b1('0x2'));var moment=require(_0xa7b1('0x3'));var BPromise=require(_0xa7b1('0x4'));var Mustache=require(_0xa7b1('0x5'));var util=require('util');var path=require(_0xa7b1('0x6'));var sox=require(_0xa7b1('0x7'));var csv=require(_0xa7b1('0x8'));var ejs=require(_0xa7b1('0x9'));var fs=require('fs');var fs_extra=require(_0xa7b1('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa7b1('0xb'));var jsforce=require(_0xa7b1('0xc'));var deskjs=require(_0xa7b1('0xd'));var toCsv=require(_0xa7b1('0x8'));var querystring=require('querystring');var Papa=require(_0xa7b1('0xe'));var Redis=require(_0xa7b1('0xf'));var authService=require(_0xa7b1('0x10'));var qs=require(_0xa7b1('0x11'));var as=require(_0xa7b1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa7b1('0x13'))(_0xa7b1('0x14'));var utils=require('../../config/utils');var config=require(_0xa7b1('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0xa7b1('0x16'))[_0xa7b1('0x17')];function respondWithStatusCode(_0x64fee7,_0x276704){_0x276704=_0x276704||0xcc;return function(_0x684b3e){if(_0x684b3e){return _0x64fee7['sendStatus'](_0x276704);}return _0x64fee7[_0xa7b1('0x18')](_0x276704)[_0xa7b1('0x19')]();};}function respondWithResult(_0x4f241b,_0xba137f){_0xba137f=_0xba137f||0xc8;return function(_0x15071c){if(_0x15071c){return _0x4f241b[_0xa7b1('0x18')](_0xba137f)['json'](_0x15071c);}};}function respondWithFilteredResult(_0x1e8317,_0x454ff3){return function(_0x450978){if(_0x450978){var _0x145e59=typeof _0x454ff3[_0xa7b1('0x1a')]===_0xa7b1('0x1b')&&typeof _0x454ff3[_0xa7b1('0x1c')]===_0xa7b1('0x1b');var _0x269523=_0x450978[_0xa7b1('0x1d')];var _0xef3b8b=_0x145e59?0x0:_0x454ff3[_0xa7b1('0x1a')];var _0xbaa89c=_0x145e59?_0x450978['count']:_0x454ff3['offset']+_0x454ff3[_0xa7b1('0x1c')];var _0x3b2cd5;if(_0xbaa89c>=_0x269523){_0xbaa89c=_0x269523;_0x3b2cd5=0xc8;}else{_0x3b2cd5=0xce;}_0x1e8317[_0xa7b1('0x18')](_0x3b2cd5);return _0x1e8317[_0xa7b1('0x1e')]('Content-Range',_0xef3b8b+'-'+_0xbaa89c+'/'+_0x269523)[_0xa7b1('0x1f')](_0x450978);}return null;};}function patchUpdates(_0x4a53ba){return function(_0x594649){try{jsonpatch[_0xa7b1('0x20')](_0x594649,_0x4a53ba,!![]);}catch(_0x321535){return BPromise[_0xa7b1('0x21')](_0x321535);}return _0x594649['save']();};}function saveUpdates(_0x934d42,_0x2a9acb){return function(_0x5887f1){if(_0x5887f1){return _0x5887f1[_0xa7b1('0x22')](_0x934d42)[_0xa7b1('0x23')](function(_0x484bcd){return _0x484bcd;});}return null;};}function removeEntity(_0x2ddbc0,_0x54b59c){return function(_0x506873){if(_0x506873){return _0x506873['destroy']()[_0xa7b1('0x23')](function(){var _0xfe4df0=_0x506873[_0xa7b1('0x24')]({'plain':!![]});var _0x5755d1=_0xa7b1('0x25');return db['UserProfileResource'][_0xa7b1('0x26')]({'where':{'type':_0x5755d1,'resourceId':_0xfe4df0['id']}})[_0xa7b1('0x23')](function(){return _0x506873;});})[_0xa7b1('0x23')](function(){_0x2ddbc0[_0xa7b1('0x18')](0xcc)[_0xa7b1('0x19')]();});}};}function handleEntityNotFound(_0xc76372,_0x5d9993){return function(_0x5754ac){if(!_0x5754ac){_0xc76372[_0xa7b1('0x27')](0x194);}return _0x5754ac;};}function handleError(_0x24a151,_0x150735){_0x150735=_0x150735||0x1f4;return function(_0x31cd43){logger['error'](_0x31cd43[_0xa7b1('0x28')]);if(_0x31cd43[_0xa7b1('0x29')]){delete _0x31cd43['name'];}_0x24a151[_0xa7b1('0x18')](_0x150735)[_0xa7b1('0x2a')](_0x31cd43);};}exports[_0xa7b1('0x2b')]=function(_0x5cb24a,_0x204f84){var _0x369db2={},_0x40c3a3={},_0x38f642={'count':0x0,'rows':[]};var _0x5bd5f3=_[_0xa7b1('0x2c')](db[_0xa7b1('0x2d')]['rawAttributes'],function(_0x1aa3f3){return{'name':_0x1aa3f3[_0xa7b1('0x2e')],'type':_0x1aa3f3['type'][_0xa7b1('0x2f')]};});_0x40c3a3[_0xa7b1('0x30')]=_[_0xa7b1('0x2c')](_0x5bd5f3,_0xa7b1('0x29'));_0x40c3a3[_0xa7b1('0x31')]=_[_0xa7b1('0x32')](_0x5cb24a[_0xa7b1('0x31')]);_0x40c3a3[_0xa7b1('0x33')]=_[_0xa7b1('0x34')](_0x40c3a3['model'],_0x40c3a3[_0xa7b1('0x31')]);_0x369db2[_0xa7b1('0x35')]=_[_0xa7b1('0x34')](_0x40c3a3[_0xa7b1('0x30')],qs[_0xa7b1('0x36')](_0x5cb24a[_0xa7b1('0x31')]['fields']));_0x369db2[_0xa7b1('0x35')]=_0x369db2[_0xa7b1('0x35')][_0xa7b1('0x37')]?_0x369db2[_0xa7b1('0x35')]:_0x40c3a3[_0xa7b1('0x30')];if(!_0x5cb24a[_0xa7b1('0x31')]['hasOwnProperty'](_0xa7b1('0x38'))){_0x369db2[_0xa7b1('0x1c')]=qs[_0xa7b1('0x1c')](_0x5cb24a[_0xa7b1('0x31')][_0xa7b1('0x1c')]);_0x369db2[_0xa7b1('0x1a')]=qs[_0xa7b1('0x1a')](_0x5cb24a[_0xa7b1('0x31')][_0xa7b1('0x1a')]);}_0x369db2[_0xa7b1('0x39')]=qs[_0xa7b1('0x3a')](_0x5cb24a[_0xa7b1('0x31')][_0xa7b1('0x3a')]);_0x369db2[_0xa7b1('0x3b')]=qs[_0xa7b1('0x33')](_[_0xa7b1('0x3c')](_0x5cb24a[_0xa7b1('0x31')],_0x40c3a3[_0xa7b1('0x33')]),_0x5bd5f3);if(_0x5cb24a['query'][_0xa7b1('0x3d')]){_0x369db2[_0xa7b1('0x3b')]=_['merge'](_0x369db2['where'],{'$or':_[_0xa7b1('0x2c')](_0x5bd5f3,function(_0x4c16b1){if(_0x4c16b1[_0xa7b1('0x3e')]!==_0xa7b1('0x3f')){var _0x97cec8={};_0x97cec8[_0x4c16b1[_0xa7b1('0x29')]]={'$like':'%'+_0x5cb24a[_0xa7b1('0x31')][_0xa7b1('0x3d')]+'%'};return _0x97cec8;}})});}_0x369db2=_['merge']({},_0x369db2,_0x5cb24a[_0xa7b1('0x40')]);var _0x1becfb={'where':_0x369db2[_0xa7b1('0x3b')]};return db[_0xa7b1('0x2d')]['count'](_0x1becfb)[_0xa7b1('0x23')](function(_0x13e328){_0x38f642['count']=_0x13e328;if(_0x5cb24a[_0xa7b1('0x31')][_0xa7b1('0x41')]){_0x369db2[_0xa7b1('0x42')]=[{'all':!![]}];}return db[_0xa7b1('0x2d')][_0xa7b1('0x43')](_0x369db2);})[_0xa7b1('0x23')](function(_0x5c8c95){_0x38f642[_0xa7b1('0x44')]=_0x5c8c95;return _0x38f642;})[_0xa7b1('0x23')](respondWithFilteredResult(_0x204f84,_0x369db2))['catch'](handleError(_0x204f84,null));};exports[_0xa7b1('0x45')]=function(_0x5246f1,_0x114f52){var _0x465b94={'raw':![],'where':{'id':_0x5246f1['params']['id']}},_0x3c1431={};_0x3c1431[_0xa7b1('0x30')]=_[_0xa7b1('0x32')](db[_0xa7b1('0x2d')][_0xa7b1('0x46')]);_0x3c1431[_0xa7b1('0x31')]=_['keys'](_0x5246f1[_0xa7b1('0x31')]);_0x3c1431[_0xa7b1('0x33')]=_[_0xa7b1('0x34')](_0x3c1431[_0xa7b1('0x30')],_0x3c1431[_0xa7b1('0x31')]);_0x465b94[_0xa7b1('0x35')]=_['intersection'](_0x3c1431[_0xa7b1('0x30')],qs[_0xa7b1('0x36')](_0x5246f1[_0xa7b1('0x31')][_0xa7b1('0x36')]));_0x465b94[_0xa7b1('0x35')]=_0x465b94[_0xa7b1('0x35')][_0xa7b1('0x37')]?_0x465b94[_0xa7b1('0x35')]:_0x3c1431[_0xa7b1('0x30')];if(_0x5246f1['query'][_0xa7b1('0x41')]){_0x465b94[_0xa7b1('0x42')]=[{'all':!![]}];}_0x465b94=_['merge']({},_0x465b94,_0x5246f1['options']);return db[_0xa7b1('0x2d')][_0xa7b1('0x47')](_0x465b94)[_0xa7b1('0x23')](handleEntityNotFound(_0x114f52,null))[_0xa7b1('0x23')](respondWithResult(_0x114f52,null))[_0xa7b1('0x48')](handleError(_0x114f52,null));};exports[_0xa7b1('0x49')]=function(_0x3fd07e,_0x7a9cd4){return db[_0xa7b1('0x2d')][_0xa7b1('0x49')](_0x3fd07e['body'],{})[_0xa7b1('0x23')](function(_0x46beb8){var _0xb95add=_0x3fd07e[_0xa7b1('0x4a')][_0xa7b1('0x24')]({'plain':!![]});if(!_0xb95add)throw new Error(_0xa7b1('0x4b'));if(_0xb95add[_0xa7b1('0x4c')]===_0xa7b1('0x4a')){var _0x42c097=_0x46beb8[_0xa7b1('0x24')]({'plain':!![]});var _0x28188f='Reports';return db[_0xa7b1('0x4d')]['find']({'where':{'name':_0x28188f,'userProfileId':_0xb95add[_0xa7b1('0x4e')]},'raw':!![]})[_0xa7b1('0x23')](function(_0x32d6aa){if(_0x32d6aa&&_0x32d6aa['autoAssociation']===0x0){return db[_0xa7b1('0x4f')]['create']({'name':_0x42c097[_0xa7b1('0x29')],'resourceId':_0x42c097['id'],'type':_0xa7b1('0x25'),'sectionId':_0x32d6aa['id']},{})['then'](function(){return _0x46beb8;});}else{return _0x46beb8;}})[_0xa7b1('0x48')](function(_0x2924a2){logger[_0xa7b1('0x50')](_0xa7b1('0x51'),_0x2924a2);throw _0x2924a2;});}return _0x46beb8;})[_0xa7b1('0x23')](respondWithResult(_0x7a9cd4,0xc9))[_0xa7b1('0x48')](handleError(_0x7a9cd4,null));};exports[_0xa7b1('0x22')]=function(_0x5f26ba,_0x3af4f5){if(_0x5f26ba['body']['id']){delete _0x5f26ba[_0xa7b1('0x52')]['id'];}return db[_0xa7b1('0x2d')][_0xa7b1('0x47')]({'where':{'id':_0x5f26ba[_0xa7b1('0x53')]['id']}})[_0xa7b1('0x23')](handleEntityNotFound(_0x3af4f5,null))['then'](saveUpdates(_0x5f26ba[_0xa7b1('0x52')],null))['then'](respondWithResult(_0x3af4f5,null))[_0xa7b1('0x48')](handleError(_0x3af4f5,null));};exports[_0xa7b1('0x26')]=function(_0x3426db,_0x5874a8){return db[_0xa7b1('0x2d')][_0xa7b1('0x47')]({'where':{'id':_0x3426db[_0xa7b1('0x53')]['id']}})[_0xa7b1('0x23')](handleEntityNotFound(_0x5874a8,null))[_0xa7b1('0x23')](removeEntity(_0x5874a8,null))['catch'](handleError(_0x5874a8,null));};exports[_0xa7b1('0x54')]=function(_0x44513b,_0x28b467){var _0x126f3f=0xa;var _0x95887c=[_0xa7b1('0x55'),'left_join',_0xa7b1('0x56'),_0xa7b1('0x57')];var _0x6cda33={'SUM':_0xa7b1('0x58'),'COUNT':_0xa7b1('0x59'),'COUNT DISTINCT':_0xa7b1('0x5a'),'MAX':_0xa7b1('0x5b'),'MIN':'MIN(%s)','AVG':_0xa7b1('0x5c'),'GROUP_CONCAT':_0xa7b1('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa7b1('0x5e')};var _0x41ca68={'SEC_TO_TIME':_0xa7b1('0x5f'),'DATE':_0xa7b1('0x60'),'HOUR':_0xa7b1('0x61'),'ROUND':_0xa7b1('0x62'),'UNIX_TIMESTAMP':_0xa7b1('0x63')};var _0x3118f9=function(_0x57bcd1){return!_[_0xa7b1('0x64')](['IS\x20NULL',_0xa7b1('0x65'),'IS\x20EMPTY',_0xa7b1('0x66')],_0x57bcd1);};var _0x4590b9=function(_0x3e4853){if(!_0x3e4853||!_0x3e4853[_0xa7b1('0x67')][_0xa7b1('0x37')]){return'';}for(var _0x1b55c8='(',_0x28398d=0x0;_0x28398d<_0x3e4853['rules'][_0xa7b1('0x37')];_0x28398d+=0x1){_0x28398d>0x0&&(_0x1b55c8+='\x20'+_0x3e4853[_0xa7b1('0x68')]+'\x20');_0x1b55c8+=_0x3e4853[_0xa7b1('0x67')][_0x28398d]['group']?_0x4590b9(_0x3e4853[_0xa7b1('0x67')][_0x28398d][_0xa7b1('0x69')]):_0x3e4853[_0xa7b1('0x67')][_0x28398d][_0xa7b1('0x6a')]+'\x20'+_0x3e4853[_0xa7b1('0x67')][_0x28398d][_0xa7b1('0x6b')]+(_0x3118f9(_0x3e4853['rules'][_0x28398d]['condition'])?'\x20'+_0x3e4853[_0xa7b1('0x67')][_0x28398d][_0xa7b1('0x6c')]:'');}return _0x1b55c8+')';};var _0x54594e={'where':{'id':_0x44513b[_0xa7b1('0x53')]['id']}},_0x25bfd7,_0x5b939d,_0x506dc8,_0x2c76a3,_0xe6f017;_0x54594e=_[_0xa7b1('0x6d')]({},_0x54594e,_0x44513b[_0xa7b1('0x40')]);return db['AnalyticCustomReport'][_0xa7b1('0x47')](_0x54594e)['then'](function(_0x5161be){if(_0x5161be){_0x25bfd7=_0x5161be;return _0x5161be[_0xa7b1('0x6e')]();}return null;})['then'](function(_0x1a23b6){if(_0x1a23b6){if(!_0x1a23b6['length']){throw new db[(_0xa7b1('0x6f'))][(_0xa7b1('0x70'))](_0xa7b1('0x71'),0x193);}_0x5b939d=_0x1a23b6;return db[_0xa7b1('0x72')]['findAll']({'raw':!![]});}return null;})[_0xa7b1('0x23')](function(_0x279e08){if(_0x279e08){_0x506dc8=_[_0xa7b1('0x73')](_0x279e08,'id');var _0x4b3398;var _0x5d95a6=squel[_0xa7b1('0x74')]();_0x5d95a6[_0xa7b1('0x75')](_0x25bfd7[_0xa7b1('0x76')]);for(var _0x320d29=0x0;_0x320d29<_0x5b939d[_0xa7b1('0x37')];_0x320d29+=0x1){_0x4b3398=_0x5b939d[_0x320d29][_0xa7b1('0x77')]?_0x506dc8[_0x5b939d[_0x320d29][_0xa7b1('0x77')]][_0xa7b1('0x78')]:_0x5b939d[_0x320d29][_0xa7b1('0x6a')];_0x4b3398=_0x5b939d[_0x320d29][_0xa7b1('0x79')]?_[_0xa7b1('0x7a')](_0x6cda33[_0x5b939d[_0x320d29]['function']],'%s',_0x4b3398):_0x4b3398;_0x4b3398=_0x5b939d[_0x320d29][_0xa7b1('0x7b')]?_[_0xa7b1('0x7a')](_0x41ca68[_0x5b939d[_0x320d29]['format']],'%s',_0x4b3398):_0x4b3398;if(_0x5b939d[_0x320d29]['groupBy']){_0x5d95a6[_0xa7b1('0x69')](_0x4b3398);}_0x5b939d[_0x320d29]['orderBy']&&_0x5d95a6[_0xa7b1('0x39')](_0x4b3398,_0x5b939d[_0x320d29][_0xa7b1('0x7c')]===_0xa7b1('0x7d')?![]:!![]);_0x5d95a6[_0xa7b1('0x6a')](_0x4b3398,_0x5b939d[_0x320d29][_0xa7b1('0x7e')]||_0x4b3398);}if(_0x25bfd7[_0xa7b1('0x7f')]){_0x25bfd7[_0xa7b1('0x7f')]=JSON['parse'](_0x25bfd7['joins']);for(var _0x27d603=0x0;_0x27d603<_0x25bfd7[_0xa7b1('0x7f')]['length'];_0x27d603+=0x1){if(_0x25bfd7[_0xa7b1('0x7f')][_0x27d603][_0xa7b1('0x3e')]&&_[_0xa7b1('0x64')](_0x95887c,_0x25bfd7[_0xa7b1('0x7f')][_0x27d603][_0xa7b1('0x3e')])&&_0x25bfd7['joins'][_0x27d603]['parentKey']&&_0x25bfd7[_0xa7b1('0x7f')][_0x27d603][_0xa7b1('0x80')]&&_0x25bfd7['joins'][_0x27d603][_0xa7b1('0x81')]){_0x5d95a6[_0x25bfd7['joins'][_0x27d603][_0xa7b1('0x3e')]](_0x25bfd7[_0xa7b1('0x7f')][_0x27d603]['foreignTable'],null,util[_0xa7b1('0x7b')]('%s.%s\x20=\x20%s.%s',_0x25bfd7[_0xa7b1('0x76')],_0x25bfd7[_0xa7b1('0x7f')][_0x27d603][_0xa7b1('0x82')],_0x25bfd7[_0xa7b1('0x7f')][_0x27d603][_0xa7b1('0x80')],_0x25bfd7[_0xa7b1('0x7f')][_0x27d603]['foreignKey']));}}}if(_0x25bfd7[_0xa7b1('0x83')]){_0x25bfd7['conditions']=JSON[_0xa7b1('0x84')](_0x25bfd7[_0xa7b1('0x83')]);_0x5d95a6[_0xa7b1('0x3b')](_0x4590b9(_0x25bfd7[_0xa7b1('0x83')][_0xa7b1('0x69')]));}_0xe6f017=_0x5d95a6['clone']();_0x5d95a6[_0xa7b1('0x1c')](_0x126f3f);_0x5d95a6[_0xa7b1('0x1a')](0x0);logger[_0xa7b1('0x85')](_0xa7b1('0x86'),_0x5d95a6['toString']());return dbH[_0xa7b1('0x87')][_0xa7b1('0x31')](_0x5d95a6[_0xa7b1('0x88')](),{'type':dbH[_0xa7b1('0x87')][_0xa7b1('0x89')][_0xa7b1('0x8a')]});}})['then'](respondWithResult(_0x28b467,null))['catch'](handleError(_0x28b467,null));};function runReport(_0x54f767,_0x394327,_0x5a2eea){var _0x359a4e=_0x394327[_0xa7b1('0x29')];var _0x5cef26=0xa;var _0x21d20a=['join',_0xa7b1('0x8b'),_0xa7b1('0x56'),_0xa7b1('0x57')];var _0x3f5ce4={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa7b1('0x5b'),'MIN':_0xa7b1('0x8c'),'AVG':_0xa7b1('0x5c'),'GROUP_CONCAT':_0xa7b1('0x5d'),'GROUP_CONCAT ASC':_0xa7b1('0x8d'),'GROUP_CONCAT DESC':_0xa7b1('0x5e')};var _0xd730e0={'SEC_TO_TIME':_0xa7b1('0x5f'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa7b1('0x63')};var _0x144bc9=function(_0x2c7aff){return!_[_0xa7b1('0x64')]([_0xa7b1('0x8e'),'IS\x20NOT\x20NULL',_0xa7b1('0x8f'),_0xa7b1('0x66')],_0x2c7aff);};var _0x46e582=function(_0xe20752){if(!_0xe20752||!_0xe20752[_0xa7b1('0x67')][_0xa7b1('0x37')]){return'';}for(var _0x1c20eb='(',_0x5d2efc=0x0;_0x5d2efc<_0xe20752[_0xa7b1('0x67')][_0xa7b1('0x37')];_0x5d2efc+=0x1){_0x5d2efc>0x0&&(_0x1c20eb+='\x20'+_0xe20752[_0xa7b1('0x68')]+'\x20');_0x1c20eb+=_0xe20752[_0xa7b1('0x67')][_0x5d2efc][_0xa7b1('0x69')]?_0x46e582(_0xe20752[_0xa7b1('0x67')][_0x5d2efc]['group']):_0xe20752[_0xa7b1('0x67')][_0x5d2efc]['field']+'\x20'+_0xe20752[_0xa7b1('0x67')][_0x5d2efc][_0xa7b1('0x6b')]+(_0x144bc9(_0xe20752[_0xa7b1('0x67')][_0x5d2efc][_0xa7b1('0x6b')])?'\x20'+_0xe20752['rules'][_0x5d2efc]['value']:'');}return _0x1c20eb+')';};var _0x2b9d4d={'where':{'id':_0x54f767['id']}},_0x5578d7,_0x38060e,_0x52da47,_0x2f7d33,_0x51647e;_0x2b9d4d=_['merge']({},_0x2b9d4d,_0x5a2eea);return db[_0xa7b1('0x2d')][_0xa7b1('0x47')](_0x2b9d4d)[_0xa7b1('0x23')](function(_0x5e5980){if(_0x5e5980){_0x5578d7=_0x5e5980;return _0x5e5980[_0xa7b1('0x6e')]();}return null;})['then'](function(_0x37f072){if(_0x37f072){if(!_0x37f072['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xa7b1('0x71'),0x193);}_0x38060e=_0x37f072;return db[_0xa7b1('0x72')][_0xa7b1('0x43')]({'raw':!![]});}return null;})[_0xa7b1('0x23')](function(_0x5a8e29){if(_0x5a8e29){_0x52da47=_[_0xa7b1('0x73')](_0x5a8e29,'id');var _0x12c477;var _0x187468=squel[_0xa7b1('0x74')]();_0x187468['from'](_0x5578d7[_0xa7b1('0x76')]);for(var _0x135825=0x0;_0x135825<_0x38060e[_0xa7b1('0x37')];_0x135825+=0x1){_0x12c477=_0x38060e[_0x135825]['MetricId']?_0x52da47[_0x38060e[_0x135825][_0xa7b1('0x77')]][_0xa7b1('0x78')]:_0x38060e[_0x135825][_0xa7b1('0x6a')];_0x12c477=_0x38060e[_0x135825][_0xa7b1('0x79')]?_[_0xa7b1('0x7a')](_0x3f5ce4[_0x38060e[_0x135825][_0xa7b1('0x79')]],'%s',_0x12c477):_0x12c477;_0x12c477=_0x38060e[_0x135825][_0xa7b1('0x7b')]?_[_0xa7b1('0x7a')](_0xd730e0[_0x38060e[_0x135825][_0xa7b1('0x7b')]],'%s',_0x12c477):_0x12c477;if(_0x38060e[_0x135825][_0xa7b1('0x90')]){_0x187468[_0xa7b1('0x69')](_0x12c477);}_0x38060e[_0x135825]['orderBy']&&_0x187468[_0xa7b1('0x39')](_0x12c477,_0x38060e[_0x135825][_0xa7b1('0x7c')]===_0xa7b1('0x7d')?![]:!![]);_0x187468[_0xa7b1('0x6a')](_0x12c477,_0x38060e[_0x135825][_0xa7b1('0x7e')]||_0x12c477);}if(_0x5578d7[_0xa7b1('0x7f')]){_0x5578d7['joins']=JSON[_0xa7b1('0x84')](_0x5578d7[_0xa7b1('0x7f')]);for(var _0x2b08cc=0x0;_0x2b08cc<_0x5578d7['joins'][_0xa7b1('0x37')];_0x2b08cc+=0x1){if(_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc][_0xa7b1('0x3e')]&&_[_0xa7b1('0x64')](_0x21d20a,_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc][_0xa7b1('0x3e')])&&_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc][_0xa7b1('0x82')]&&_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc]['foreignTable']&&_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc][_0xa7b1('0x81')]){_0x187468[_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc]['type']](_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc][_0xa7b1('0x80')],null,util[_0xa7b1('0x7b')]('%s.%s\x20=\x20%s.%s',_0x5578d7['table'],_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc][_0xa7b1('0x82')],_0x5578d7['joins'][_0x2b08cc][_0xa7b1('0x80')],_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc][_0xa7b1('0x81')]));}}}if(_0x5578d7[_0xa7b1('0x83')]){_0x5578d7[_0xa7b1('0x83')]=JSON[_0xa7b1('0x84')](_0x5578d7[_0xa7b1('0x83')]);_0x187468[_0xa7b1('0x3b')](_0x46e582(_0x5578d7[_0xa7b1('0x83')][_0xa7b1('0x69')]));}_0x51647e=_0x187468[_0xa7b1('0x91')]();_0x187468[_0xa7b1('0x1c')](_0x5cef26);_0x187468[_0xa7b1('0x1a')](0x0);return;}})[_0xa7b1('0x23')](function(){if(_0x394327[_0xa7b1('0x92')]===_0xa7b1('0x93')){return null;}var _0x396dcf=_['merge'](_0x394327,{'name':_0x394327[_0xa7b1('0x94')]||_0x394327['name']||_0x5578d7[_0xa7b1('0x29')],'basename':_0x359a4e,'savename':util[_0xa7b1('0x7b')](_0xa7b1('0x95'),_0x394327[_0xa7b1('0x29')]||_0x5578d7[_0xa7b1('0x29')],require(_0xa7b1('0x96'))[_0xa7b1('0x97')](0x4),_0x394327[_0xa7b1('0x92')]||_0xa7b1('0x98')),'reportId':_0x5578d7['id'],'reportType':_0xa7b1('0x99')});return db[_0xa7b1('0x9a')][_0xa7b1('0x49')](_0x396dcf,{'raw':!![]});})[_0xa7b1('0x23')](function(_0x1a60ec){if(_0x5578d7[_0xa7b1('0x76')]===_0xa7b1('0x9b')){_0x51647e[_0xa7b1('0x3b')](_0x5578d7[_0xa7b1('0x76')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x394327[_0xa7b1('0x9c')],_0x394327[_0xa7b1('0x9d')]);}else{_0x51647e[_0xa7b1('0x3b')](_0x5578d7[_0xa7b1('0x76')]+_0xa7b1('0x9e'),_0x394327[_0xa7b1('0x9c')],_0x394327[_0xa7b1('0x9d')]);}if(_0x1a60ec){logger[_0xa7b1('0x9f')]('Run\x20Query:',_0x51647e[_0xa7b1('0x88')]());require(_0xa7b1('0xa0'))['fork'](path[_0xa7b1('0x55')](__dirname,_0xa7b1('0xa1'),_0x1a60ec[_0xa7b1('0x92')]),[_0x1a60ec['id'],_0x51647e[_0xa7b1('0x88')](),path[_0xa7b1('0x55')](__dirname,_0xa7b1('0xa2'),_0x1a60ec[_0xa7b1('0xa3')]),_0x359a4e]);return _0x1a60ec;}else{var _0x1f3350=squel[_0xa7b1('0x74')]();_0x1f3350[_0xa7b1('0x75')]('('+_0x51647e[_0xa7b1('0x88')]()+')',_0xa7b1('0xa4'));_0x1f3350['field'](_0xa7b1('0xa5'),_0xa7b1('0x1d'));_0x51647e[_0xa7b1('0x1c')](_0x394327[_0xa7b1('0x1c')]||_0x5cef26);_0x51647e[_0xa7b1('0x1a')](_0x394327['offset']||0x0);return dbH[_0xa7b1('0x87')][_0xa7b1('0x31')](_0x1f3350['toString'](),{'type':dbH[_0xa7b1('0x87')][_0xa7b1('0x89')][_0xa7b1('0x8a')]})['then'](function(_0x162e2f){if(!_0x162e2f[_0xa7b1('0x37')]){_0x2f7d33=0x0;}else{_0x2f7d33=_0x162e2f[0x0][_0xa7b1('0x1d')]||0x0;}return dbH[_0xa7b1('0x87')][_0xa7b1('0x31')](_0x51647e[_0xa7b1('0x88')](),{'type':dbH[_0xa7b1('0x87')]['QueryTypes'][_0xa7b1('0x8a')]});})['then'](function(_0xc9ea53){return{'rows':_0xc9ea53||[],'count':_0x2f7d33};});}});}exports['run']=function(_0x523a60,_0x108508){return runReport(_0x523a60[_0xa7b1('0x53')],_0x523a60['query'],_0x523a60[_0xa7b1('0x40')])[_0xa7b1('0x23')](respondWithResult(_0x108508,null))[_0xa7b1('0x48')](handleError(_0x108508,null));};exports[_0xa7b1('0xa6')]=runReport;exports[_0xa7b1('0x31')]=function(_0x4fca20,_0x85486a){var _0x402e8b=0xa;var _0x588c99=[_0xa7b1('0x55'),_0xa7b1('0x8b'),_0xa7b1('0x56'),'cross_join'];var _0x12ab41={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa7b1('0x5b'),'MIN':_0xa7b1('0x8c'),'AVG':_0xa7b1('0x5c'),'GROUP_CONCAT':_0xa7b1('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa7b1('0x5e')};var _0x1da675={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa7b1('0x60'),'HOUR':_0xa7b1('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1a848a=function(_0x49ddc5){return!_[_0xa7b1('0x64')]([_0xa7b1('0x8e'),_0xa7b1('0x65'),_0xa7b1('0x8f'),'IS\x20NOT\x20EMPTY'],_0x49ddc5);};var _0x55a82d=function(_0x4c6f16){if(!_0x4c6f16||!_0x4c6f16[_0xa7b1('0x67')][_0xa7b1('0x37')]){return'';}for(var _0x3c7447='(',_0x1264ad=0x0;_0x1264ad<_0x4c6f16[_0xa7b1('0x67')][_0xa7b1('0x37')];_0x1264ad+=0x1){_0x1264ad>0x0&&(_0x3c7447+='\x20'+_0x4c6f16[_0xa7b1('0x68')]+'\x20');_0x3c7447+=_0x4c6f16['rules'][_0x1264ad][_0xa7b1('0x69')]?_0x55a82d(_0x4c6f16[_0xa7b1('0x67')][_0x1264ad][_0xa7b1('0x69')]):_0x4c6f16[_0xa7b1('0x67')][_0x1264ad]['field']+'\x20'+_0x4c6f16['rules'][_0x1264ad][_0xa7b1('0x6b')]+(_0x1a848a(_0x4c6f16[_0xa7b1('0x67')][_0x1264ad]['condition'])?'\x20'+_0x4c6f16[_0xa7b1('0x67')][_0x1264ad]['value']:'');}return _0x3c7447+')';};var _0x11ed39={'where':{'id':_0x4fca20[_0xa7b1('0x53')]['id']}},_0x1a607d,_0x18782c,_0xfe2b8c,_0x526e0e,_0x55dfbb;_0x11ed39=_[_0xa7b1('0x6d')]({},_0x11ed39,_0x4fca20['options']);return db[_0xa7b1('0x2d')]['find'](_0x11ed39)[_0xa7b1('0x23')](function(_0x3d10c9){if(_0x3d10c9){_0x1a607d=_0x3d10c9;return _0x3d10c9['getFields']();}return null;})[_0xa7b1('0x23')](function(_0x20ef87){if(_0x20ef87){if(!_0x20ef87[_0xa7b1('0x37')]){throw new db[(_0xa7b1('0x6f'))][(_0xa7b1('0x70'))](_0xa7b1('0x71'),0x193);}_0x18782c=_0x20ef87;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xa7b1('0x23')](function(_0x188507){if(_0x188507){_0xfe2b8c=_[_0xa7b1('0x73')](_0x188507,'id');var _0x4feb33;var _0x3c84ad=squel['select']();_0x3c84ad['from'](_0x1a607d[_0xa7b1('0x76')]);for(var _0x408e0b=0x0;_0x408e0b<_0x18782c['length'];_0x408e0b+=0x1){_0x4feb33=_0x18782c[_0x408e0b][_0xa7b1('0x77')]?_0xfe2b8c[_0x18782c[_0x408e0b]['MetricId']][_0xa7b1('0x78')]:_0x18782c[_0x408e0b]['field'];_0x4feb33=_0x18782c[_0x408e0b][_0xa7b1('0x79')]?_[_0xa7b1('0x7a')](_0x12ab41[_0x18782c[_0x408e0b][_0xa7b1('0x79')]],'%s',_0x4feb33):_0x4feb33;_0x4feb33=_0x18782c[_0x408e0b]['format']?_['replace'](_0x1da675[_0x18782c[_0x408e0b][_0xa7b1('0x7b')]],'%s',_0x4feb33):_0x4feb33;if(_0x18782c[_0x408e0b][_0xa7b1('0x90')]){_0x3c84ad[_0xa7b1('0x69')](_0x4feb33);}_0x18782c[_0x408e0b][_0xa7b1('0x7c')]&&_0x3c84ad[_0xa7b1('0x39')](_0x4feb33,_0x18782c[_0x408e0b][_0xa7b1('0x7c')]===_0xa7b1('0x7d')?![]:!![]);_0x3c84ad[_0xa7b1('0x6a')](_0x4feb33,_0x18782c[_0x408e0b][_0xa7b1('0x7e')]||_0x4feb33);}if(_0x1a607d[_0xa7b1('0x7f')]){_0x1a607d[_0xa7b1('0x7f')]=JSON['parse'](_0x1a607d[_0xa7b1('0x7f')]);for(var _0xf8d3c4=0x0;_0xf8d3c4<_0x1a607d[_0xa7b1('0x7f')][_0xa7b1('0x37')];_0xf8d3c4+=0x1){if(_0x1a607d[_0xa7b1('0x7f')][_0xf8d3c4]['type']&&_[_0xa7b1('0x64')](_0x588c99,_0x1a607d['joins'][_0xf8d3c4][_0xa7b1('0x3e')])&&_0x1a607d[_0xa7b1('0x7f')][_0xf8d3c4]['parentKey']&&_0x1a607d[_0xa7b1('0x7f')][_0xf8d3c4]['foreignTable']&&_0x1a607d[_0xa7b1('0x7f')][_0xf8d3c4][_0xa7b1('0x81')]){_0x3c84ad[_0x1a607d[_0xa7b1('0x7f')][_0xf8d3c4][_0xa7b1('0x3e')]](_0x1a607d[_0xa7b1('0x7f')][_0xf8d3c4][_0xa7b1('0x80')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a607d['table'],_0x1a607d[_0xa7b1('0x7f')][_0xf8d3c4][_0xa7b1('0x82')],_0x1a607d[_0xa7b1('0x7f')][_0xf8d3c4][_0xa7b1('0x80')],_0x1a607d['joins'][_0xf8d3c4][_0xa7b1('0x81')]));}}}if(_0x1a607d['conditions']){_0x1a607d[_0xa7b1('0x83')]=JSON['parse'](_0x1a607d['conditions']);_0x3c84ad[_0xa7b1('0x3b')](_0x55a82d(_0x1a607d['conditions'][_0xa7b1('0x69')]));}_0x55dfbb=_0x3c84ad[_0xa7b1('0x91')]();_0x3c84ad[_0xa7b1('0x1c')](_0x402e8b);_0x3c84ad[_0xa7b1('0x1a')](0x0);logger[_0xa7b1('0x85')](_0xa7b1('0x86'),_0x3c84ad[_0xa7b1('0x88')]());return dbH[_0xa7b1('0x87')]['query'](_0x3c84ad[_0xa7b1('0x88')](),{'type':dbH[_0xa7b1('0x87')][_0xa7b1('0x89')]['SELECT']});}})[_0xa7b1('0x23')](function(){return{'sql':_0x55dfbb[_0xa7b1('0x88')]()};})[_0xa7b1('0x23')](respondWithResult(_0x85486a,null))['catch'](handleError(_0x85486a,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 0b0eeea..07a3480 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 _0x7a50=['request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x48d319,_0x39f824){var _0x23503d=function(_0x4d2a19){while(--_0x4d2a19){_0x48d319['push'](_0x48d319['shift']());}};_0x23503d(++_0x39f824);}(_0x7a50,0x1e9));var _0x07a5=function(_0x4e3bcc,_0x485485){_0x4e3bcc=_0x4e3bcc-0x0;var _0x36ae33=_0x7a50[_0x4e3bcc];return _0x36ae33;};'use strict';var _=require(_0x07a5('0x0'));var util=require('util');var logger=require(_0x07a5('0x1'))(_0x07a5('0x2'));var moment=require(_0x07a5('0x3'));var BPromise=require(_0x07a5('0x4'));var rp=require(_0x07a5('0x5'));var fs=require('fs');var path=require(_0x07a5('0x6'));var rimraf=require(_0x07a5('0x7'));var config=require(_0x07a5('0x8'));var attributes=require(_0x07a5('0x9'));module['exports']=function(_0x162132,_0x4070e5){return _0x162132[_0x07a5('0xa')](_0x07a5('0xb'),attributes,{'tableName':_0x07a5('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9865=['rimraf','../../config/environment','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x109333,_0x5ce132){var _0x7eb389=function(_0x55b2fd){while(--_0x55b2fd){_0x109333['push'](_0x109333['shift']());}};_0x7eb389(++_0x5ce132);}(_0x9865,0x119));var _0x5986=function(_0x269c57,_0x3a16cf){_0x269c57=_0x269c57-0x0;var _0x48053b=_0x9865[_0x269c57];return _0x48053b;};'use strict';var _=require(_0x5986('0x0'));var util=require(_0x5986('0x1'));var logger=require(_0x5986('0x2'))(_0x5986('0x3'));var moment=require('moment');var BPromise=require(_0x5986('0x4'));var rp=require(_0x5986('0x5'));var fs=require('fs');var path=require(_0x5986('0x6'));var rimraf=require(_0x5986('0x7'));var config=require(_0x5986('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x5986('0x9')]=function(_0x56a54d,_0x3df583){return _0x56a54d['define'](_0x5986('0xa'),attributes,{'tableName':_0x5986('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 57b44ca..f2af540 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 _0xc265=['request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x373096,_0x4d37aa){var _0x14a6d0=function(_0xb3b614){while(--_0xb3b614){_0x373096['push'](_0x373096['shift']());}};_0x14a6d0(++_0x4d37aa);}(_0xc265,0x15d));var _0x5c26=function(_0x4209b9,_0x454d8f){_0x4209b9=_0x4209b9-0x0;var _0x454f45=_0xc265[_0x4209b9];return _0x454f45;};'use strict';var _=require(_0x5c26('0x0'));var util=require('util');var moment=require(_0x5c26('0x1'));var BPromise=require(_0x5c26('0x2'));var rs=require(_0x5c26('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c26('0x4'))['db'];var utils=require(_0x5c26('0x5'));var logger=require(_0x5c26('0x6'))(_0x5c26('0x7'));var config=require(_0x5c26('0x8'));var jayson=require(_0x5c26('0x9'));var client=jayson['client'][_0x5c26('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43751a,_0x135cb3,_0x4859a8){return new BPromise(function(_0xa265f3,_0x1bb666){return client[_0x5c26('0xb')](_0x43751a,_0x4859a8)[_0x5c26('0xc')](function(_0x18404f){logger[_0x5c26('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x135cb3,_0x5c26('0xe'));logger[_0x5c26('0xf')](_0x5c26('0x10'),_0x135cb3,_0x5c26('0xe'),JSON[_0x5c26('0x11')](_0x18404f));if(_0x18404f[_0x5c26('0x12')]){if(_0x18404f[_0x5c26('0x12')][_0x5c26('0x13')]===0x1f4){logger[_0x5c26('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x135cb3,_0x18404f[_0x5c26('0x12')][_0x5c26('0x14')]);return _0x1bb666(_0x18404f[_0x5c26('0x12')]['message']);}logger[_0x5c26('0x12')](_0x5c26('0x15'),_0x135cb3,_0x18404f[_0x5c26('0x12')][_0x5c26('0x14')]);return _0xa265f3(_0x18404f[_0x5c26('0x12')][_0x5c26('0x14')]);}else{logger['info'](_0x5c26('0x15'),_0x135cb3,'request\x20sent');_0xa265f3(_0x18404f[_0x5c26('0x16')][_0x5c26('0x14')]);}})[_0x5c26('0x17')](function(_0x4d1eb2){logger[_0x5c26('0x12')](_0x5c26('0x15'),_0x135cb3,_0x4d1eb2);_0x1bb666(_0x4d1eb2);});});}
\ No newline at end of file
+var _0x8c5e=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x8c5e,0xb9));var _0xe8c5=function(_0x1baf26,_0x28cc75){_0x1baf26=_0x1baf26-0x0;var _0x275a68=_0x8c5e[_0x1baf26];return _0x275a68;};'use strict';var _=require(_0xe8c5('0x0'));var util=require(_0xe8c5('0x1'));var moment=require(_0xe8c5('0x2'));var BPromise=require(_0xe8c5('0x3'));var rs=require(_0xe8c5('0x4'));var fs=require('fs');var Redis=require(_0xe8c5('0x5'));var db=require(_0xe8c5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe8c5('0x7'))('rpc');var config=require(_0xe8c5('0x8'));var jayson=require(_0xe8c5('0x9'));var client=jayson[_0xe8c5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xad7d4c,_0x299b87,_0x12ca68){return new BPromise(function(_0x209192,_0x4d045f){return client[_0xe8c5('0xb')](_0xad7d4c,_0x12ca68)[_0xe8c5('0xc')](function(_0x1801c6){logger['info'](_0xe8c5('0xd'),_0x299b87,_0xe8c5('0xe'));logger['debug'](_0xe8c5('0xf'),_0x299b87,_0xe8c5('0xe'),JSON[_0xe8c5('0x10')](_0x1801c6));if(_0x1801c6[_0xe8c5('0x11')]){if(_0x1801c6[_0xe8c5('0x11')][_0xe8c5('0x12')]===0x1f4){logger[_0xe8c5('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x299b87,_0x1801c6[_0xe8c5('0x11')]['message']);return _0x4d045f(_0x1801c6[_0xe8c5('0x11')][_0xe8c5('0x13')]);}logger[_0xe8c5('0x11')](_0xe8c5('0xd'),_0x299b87,_0x1801c6[_0xe8c5('0x11')][_0xe8c5('0x13')]);return _0x209192(_0x1801c6[_0xe8c5('0x11')][_0xe8c5('0x13')]);}else{logger['info'](_0xe8c5('0xd'),_0x299b87,_0xe8c5('0xe'));_0x209192(_0x1801c6[_0xe8c5('0x14')][_0xe8c5('0x13')]);}})['catch'](function(_0x263ae6){logger[_0xe8c5('0x11')](_0xe8c5('0xd'),_0x299b87,_0x263ae6);_0x4d045f(_0x263ae6);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 85d70e7..2159bf0 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 _0xbab2=['/:id/run','run','query','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show','preview'];(function(_0x5f5399,_0x4928ca){var _0x5e5647=function(_0x55f02e){while(--_0x55f02e){_0x5f5399['push'](_0x5f5399['shift']());}};_0x5e5647(++_0x4928ca);}(_0xbab2,0x1b9));var _0x2bab=function(_0x4691d7,_0x5aca48){_0x4691d7=_0x4691d7-0x0;var _0x66b0a2=_0xbab2[_0x4691d7];return _0x66b0a2;};'use strict';var multer=require(_0x2bab('0x0'));var util=require('util');var path=require(_0x2bab('0x1'));var timeout=require(_0x2bab('0x2'));var express=require(_0x2bab('0x3'));var router=express[_0x2bab('0x4')]();var fs_extra=require(_0x2bab('0x5'));var auth=require(_0x2bab('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2bab('0x7'));var controller=require(_0x2bab('0x8'));router['get']('/',auth[_0x2bab('0x9')](),controller[_0x2bab('0xa')]);router[_0x2bab('0xb')](_0x2bab('0xc'),auth[_0x2bab('0x9')](),controller[_0x2bab('0xd')]);router['get']('/:id/preview',auth[_0x2bab('0x9')](),controller[_0x2bab('0xe')]);router[_0x2bab('0xb')](_0x2bab('0xf'),auth['isAuthenticated'](),controller[_0x2bab('0x10')]);router[_0x2bab('0xb')]('/:id/query',auth[_0x2bab('0x9')](),controller[_0x2bab('0x11')]);router[_0x2bab('0x12')]('/',auth[_0x2bab('0x9')](),controller['create']);router[_0x2bab('0x13')](_0x2bab('0xc'),auth[_0x2bab('0x9')](),controller[_0x2bab('0x14')]);router[_0x2bab('0x15')]('/:id',auth[_0x2bab('0x9')](),controller[_0x2bab('0x16')]);module[_0x2bab('0x17')]=router;
\ No newline at end of file
+var _0x35a2=['post','create','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id/preview','preview','/:id/run','run','/:id/query','query'];(function(_0x345829,_0x5f4b7d){var _0x43ec1e=function(_0x5a93eb){while(--_0x5a93eb){_0x345829['push'](_0x345829['shift']());}};_0x43ec1e(++_0x5f4b7d);}(_0x35a2,0xdd));var _0x235a=function(_0x21535f,_0xebb00c){_0x21535f=_0x21535f-0x0;var _0x1ca658=_0x35a2[_0x21535f];return _0x1ca658;};'use strict';var multer=require(_0x235a('0x0'));var util=require(_0x235a('0x1'));var path=require(_0x235a('0x2'));var timeout=require(_0x235a('0x3'));var express=require(_0x235a('0x4'));var router=express[_0x235a('0x5')]();var fs_extra=require(_0x235a('0x6'));var auth=require(_0x235a('0x7'));var interaction=require(_0x235a('0x8'));var config=require(_0x235a('0x9'));var controller=require(_0x235a('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x235a('0xb')]('/:id',auth[_0x235a('0xc')](),controller['show']);router['get'](_0x235a('0xd'),auth[_0x235a('0xc')](),controller[_0x235a('0xe')]);router[_0x235a('0xb')](_0x235a('0xf'),auth['isAuthenticated'](),controller[_0x235a('0x10')]);router[_0x235a('0xb')](_0x235a('0x11'),auth[_0x235a('0xc')](),controller[_0x235a('0x12')]);router[_0x235a('0x13')]('/',auth[_0x235a('0xc')](),controller[_0x235a('0x14')]);router['put'](_0x235a('0x15'),auth[_0x235a('0xc')](),controller['update']);router[_0x235a('0x16')](_0x235a('0x15'),auth[_0x235a('0xc')](),controller['destroy']);module[_0x235a('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 33601aa..7616839 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 _0xe14b=['exports','STRING','TEXT','sequelize'];(function(_0xd6bc3e,_0x459702){var _0x34669c=function(_0x3e938f){while(--_0x3e938f){_0xd6bc3e['push'](_0xd6bc3e['shift']());}};_0x34669c(++_0x459702);}(_0xe14b,0x93));var _0xbe14=function(_0x493e1c,_0x150333){_0x493e1c=_0x493e1c-0x0;var _0xce9229=_0xe14b[_0x493e1c];return _0xce9229;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xbe14('0x2')]},'table':{'type':Sequelize[_0xbe14('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbe14('0x3')]}};
\ No newline at end of file
+var _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x4a36d1,_0x136a98){var _0x448b2e=function(_0x4702f5){while(--_0x4702f5){_0x4a36d1['push'](_0x4a36d1['shift']());}};_0x448b2e(++_0x136a98);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x3a04e2,_0x30acc0){_0x3a04e2=_0x3a04e2-0x0;var _0x258fe8=_0x3f8a[_0x3a04e2];return _0x258fe8;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index d5ddf07..a46c6cd 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 _0x46ed=['SEC_TO_TIME(%s)','value','AnalyticMetric','select','DESC','output','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','sequelize','runReport','left_join','COUNT(%s)','MIN(%s)','AVG(%s)','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','QueryTypes','SELECT'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0x46ed,0x168));var _0xd46e=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x46ed[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xf3048c,_0x27dbfb){_0x27dbfb=_0x27dbfb||0xcc;return function(_0x53b309){if(_0x53b309){return _0xf3048c['sendStatus'](_0x27dbfb);}return _0xf3048c[_0xd46e('0x1a')](_0x27dbfb)[_0xd46e('0x1b')]();};}function respondWithResult(_0x1e9aae,_0x3fdf88){_0x3fdf88=_0x3fdf88||0xc8;return function(_0x50c7c3){if(_0x50c7c3){return _0x1e9aae[_0xd46e('0x1a')](_0x3fdf88)[_0xd46e('0x1c')](_0x50c7c3);}};}function respondWithFilteredResult(_0x417402,_0x3d72ce){return function(_0x36a317){if(_0x36a317){var _0x47fa8f=typeof _0x3d72ce[_0xd46e('0x1d')]===_0xd46e('0x1e')&&typeof _0x3d72ce[_0xd46e('0x1f')]==='undefined';var _0x5ddd04=_0x36a317[_0xd46e('0x20')];var _0x1bd574=_0x47fa8f?0x0:_0x3d72ce['offset'];var _0x4fd1f2=_0x47fa8f?_0x36a317[_0xd46e('0x20')]:_0x3d72ce[_0xd46e('0x1d')]+_0x3d72ce[_0xd46e('0x1f')];var _0x2273c5;if(_0x4fd1f2>=_0x5ddd04){_0x4fd1f2=_0x5ddd04;_0x2273c5=0xc8;}else{_0x2273c5=0xce;}_0x417402[_0xd46e('0x1a')](_0x2273c5);return _0x417402[_0xd46e('0x21')](_0xd46e('0x22'),_0x1bd574+'-'+_0x4fd1f2+'/'+_0x5ddd04)[_0xd46e('0x1c')](_0x36a317);}return null;};}function patchUpdates(_0xb4940){return function(_0x3c7e91){try{jsonpatch[_0xd46e('0x23')](_0x3c7e91,_0xb4940,!![]);}catch(_0x5ba94d){return BPromise[_0xd46e('0x24')](_0x5ba94d);}return _0x3c7e91[_0xd46e('0x25')]();};}function saveUpdates(_0x79aa51,_0x45ce0b){return function(_0x128246){if(_0x128246){return _0x128246[_0xd46e('0x26')](_0x79aa51)[_0xd46e('0x27')](function(_0x8a1be){return _0x8a1be;});}return null;};}function removeEntity(_0x62dea5,_0x4cf899){return function(_0x314570){if(_0x314570){return _0x314570['destroy']()['then'](function(){var _0x371054=_0x314570[_0xd46e('0x28')]({'plain':!![]});var _0x21135f=_0xd46e('0x29');return db[_0xd46e('0x2a')][_0xd46e('0x2b')]({'where':{'type':_0x21135f,'resourceId':_0x371054['id']}})[_0xd46e('0x27')](function(){return _0x314570;});})['then'](function(){_0x62dea5[_0xd46e('0x1a')](0xcc)[_0xd46e('0x1b')]();});}};}function handleEntityNotFound(_0xddbce9,_0x17db79){return function(_0x96f15c){if(!_0x96f15c){_0xddbce9[_0xd46e('0x2c')](0x194);}return _0x96f15c;};}function handleError(_0x58aeef,_0x465d54){_0x465d54=_0x465d54||0x1f4;return function(_0x3a1ced){logger[_0xd46e('0x2d')](_0x3a1ced[_0xd46e('0x2e')]);if(_0x3a1ced[_0xd46e('0x2f')]){delete _0x3a1ced[_0xd46e('0x2f')];}_0x58aeef[_0xd46e('0x1a')](_0x465d54)[_0xd46e('0x30')](_0x3a1ced);};}exports[_0xd46e('0x31')]=function(_0x45ea47,_0x2ff785){var _0x504324={},_0x2f4a1b={},_0x5ed8dc={'count':0x0,'rows':[]};var _0x1248ce=_[_0xd46e('0x32')](db[_0xd46e('0x33')][_0xd46e('0x34')],function(_0x5ef248){return{'name':_0x5ef248[_0xd46e('0x35')],'type':_0x5ef248[_0xd46e('0x36')]['key']};});_0x2f4a1b[_0xd46e('0x37')]=_[_0xd46e('0x32')](_0x1248ce,'name');_0x2f4a1b[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x45ea47[_0xd46e('0x38')]);_0x2f4a1b['filters']=_['intersection'](_0x2f4a1b[_0xd46e('0x37')],_0x2f4a1b[_0xd46e('0x38')]);_0x504324[_0xd46e('0x3a')]=_[_0xd46e('0x3b')](_0x2f4a1b[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x504324['attributes']=_0x504324[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x504324[_0xd46e('0x3a')]:_0x2f4a1b[_0xd46e('0x37')];if(!_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3e')](_0xd46e('0x3f'))){_0x504324['limit']=qs[_0xd46e('0x1f')](_0x45ea47[_0xd46e('0x38')]['limit']);_0x504324[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x1d')]);}_0x504324['order']=qs[_0xd46e('0x40')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x40')]);_0x504324[_0xd46e('0x41')]=qs[_0xd46e('0x42')](_[_0xd46e('0x43')](_0x45ea47[_0xd46e('0x38')],_0x2f4a1b[_0xd46e('0x42')]),_0x1248ce);if(_0x45ea47['query'][_0xd46e('0x44')]){_0x504324[_0xd46e('0x41')]=_[_0xd46e('0x45')](_0x504324[_0xd46e('0x41')],{'$or':_[_0xd46e('0x32')](_0x1248ce,function(_0x56f99c){if(_0x56f99c[_0xd46e('0x36')]!=='VIRTUAL'){var _0x55230d={};_0x55230d[_0x56f99c['name']]={'$like':'%'+_0x45ea47['query'][_0xd46e('0x44')]+'%'};return _0x55230d;}})});}_0x504324=_['merge']({},_0x504324,_0x45ea47[_0xd46e('0x46')]);var _0x40720e={'where':_0x504324['where']};return db[_0xd46e('0x33')][_0xd46e('0x20')](_0x40720e)[_0xd46e('0x27')](function(_0x31ba12){_0x5ed8dc[_0xd46e('0x20')]=_0x31ba12;if(_0x45ea47[_0xd46e('0x38')][_0xd46e('0x47')]){_0x504324[_0xd46e('0x48')]=[{'all':!![]}];}return db[_0xd46e('0x33')][_0xd46e('0x49')](_0x504324);})[_0xd46e('0x27')](function(_0x5ea048){_0x5ed8dc['rows']=_0x5ea048;return _0x5ed8dc;})['then'](respondWithFilteredResult(_0x2ff785,_0x504324))[_0xd46e('0x4a')](handleError(_0x2ff785,null));};exports['show']=function(_0x168d35,_0x272f5f){var _0x3fdf67={'raw':!![],'where':{'id':_0x168d35[_0xd46e('0x4b')]['id']}},_0x416505={};_0x416505[_0xd46e('0x37')]=_[_0xd46e('0x39')](db[_0xd46e('0x33')]['rawAttributes']);_0x416505[_0xd46e('0x38')]=_['keys'](_0x168d35[_0xd46e('0x38')]);_0x416505[_0xd46e('0x42')]=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],_0x416505[_0xd46e('0x38')]);_0x3fdf67['attributes']=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x168d35[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x3fdf67['attributes']=_0x3fdf67[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x3fdf67[_0xd46e('0x3a')]:_0x416505[_0xd46e('0x37')];if(_0x168d35[_0xd46e('0x38')]['includeAll']){_0x3fdf67[_0xd46e('0x48')]=[{'all':!![]}];}_0x3fdf67=_[_0xd46e('0x45')]({},_0x3fdf67,_0x168d35[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fdf67)[_0xd46e('0x27')](handleEntityNotFound(_0x272f5f,null))[_0xd46e('0x27')](respondWithResult(_0x272f5f,null))[_0xd46e('0x4a')](handleError(_0x272f5f,null));};exports['create']=function(_0xf9dab,_0x71a8dc){return db[_0xd46e('0x33')][_0xd46e('0x4d')](_0xf9dab[_0xd46e('0x4e')],{})['then'](function(_0x4ae314){var _0x3a94cf=_0xf9dab[_0xd46e('0x4f')][_0xd46e('0x28')]({'plain':!![]});if(!_0x3a94cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a94cf['role']===_0xd46e('0x4f')){var _0x9d8638=_0x4ae314['get']({'plain':!![]});var _0x2eee92=_0xd46e('0x50');return db[_0xd46e('0x51')][_0xd46e('0x4c')]({'where':{'name':_0x2eee92,'userProfileId':_0x3a94cf[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x27')](function(_0x80ed51){if(_0x80ed51&&_0x80ed51[_0xd46e('0x53')]===0x0){return db['UserProfileResource'][_0xd46e('0x4d')]({'name':_0x9d8638[_0xd46e('0x2f')],'resourceId':_0x9d8638['id'],'type':_0xd46e('0x29'),'sectionId':_0x80ed51['id']},{})[_0xd46e('0x27')](function(){return _0x4ae314;});}else{return _0x4ae314;}})['catch'](function(_0x56dd9a){logger[_0xd46e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56dd9a);throw _0x56dd9a;});}return _0x4ae314;})[_0xd46e('0x27')](respondWithResult(_0x71a8dc,0xc9))[_0xd46e('0x4a')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x26')]=function(_0x31f7eb,_0x5a7870){if(_0x31f7eb[_0xd46e('0x4e')]['id']){delete _0x31f7eb['body']['id'];}return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x31f7eb[_0xd46e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7870,null))[_0xd46e('0x27')](saveUpdates(_0x31f7eb[_0xd46e('0x4e')],null))[_0xd46e('0x27')](respondWithResult(_0x5a7870,null))[_0xd46e('0x4a')](handleError(_0x5a7870,null));};exports[_0xd46e('0x2b')]=function(_0x2cc676,_0x2760ef){return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x2cc676[_0xd46e('0x4b')]['id']}})[_0xd46e('0x27')](handleEntityNotFound(_0x2760ef,null))[_0xd46e('0x27')](removeEntity(_0x2760ef,null))[_0xd46e('0x4a')](handleError(_0x2760ef,null));};exports[_0xd46e('0x54')]=function(_0x47a86c,_0x3ec709){var _0x37a22f=0xa;var _0xe0cd61=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0xaf9641={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x481dce={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x2dacb4=function(_0x2f9fcb){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x2f9fcb);};var _0x1aaa99=function(_0x272514){if(!_0x272514||!_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x476f09='(',_0x5067b7=0x0;_0x5067b7<_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')];_0x5067b7+=0x1){_0x5067b7>0x0&&(_0x476f09+='\x20'+_0x272514[_0xd46e('0x68')]+'\x20');_0x476f09+=_0x272514['rules'][_0x5067b7][_0xd46e('0x69')]?_0x1aaa99(_0x272514[_0xd46e('0x67')][_0x5067b7]['group']):_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6a')]+'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['condition']+(_0x2dacb4(_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6b')])?'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['value']:'');}return _0x476f09+')';};var _0xe5f8cd={'where':{'id':_0x47a86c[_0xd46e('0x4b')]['id']}},_0x516e7d,_0x32eed0,_0x148187,_0x35db1b,_0x4f3ba0;_0xe5f8cd=_[_0xd46e('0x45')]({},_0xe5f8cd,_0x47a86c[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0xe5f8cd)[_0xd46e('0x27')](function(_0x16f906){if(_0x16f906){_0x516e7d=_0x16f906;return _0x16f906[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0x3e55a3){if(_0x3e55a3){if(!_0x3e55a3[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))](_0xd46e('0x6f'),0x193);}_0x32eed0=_0x3e55a3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3e0ed5){if(_0x3e0ed5){_0x148187=_[_0xd46e('0x70')](_0x3e0ed5,'id');var _0x2fff69;var _0x249938=squel['select']();_0x249938[_0xd46e('0x71')](_0x516e7d[_0xd46e('0x72')]);for(var _0xfb4073=0x0;_0xfb4073<_0x32eed0[_0xd46e('0x3d')];_0xfb4073+=0x1){_0x2fff69=_0x32eed0[_0xfb4073]['MetricId']?_0x148187[_0x32eed0[_0xfb4073][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x32eed0[_0xfb4073]['field'];_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0xaf9641[_0x32eed0[_0xfb4073]['function']],'%s',_0x2fff69):_0x2fff69;_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x481dce[_0x32eed0[_0xfb4073]['format']],'%s',_0x2fff69):_0x2fff69;if(_0x32eed0[_0xfb4073][_0xd46e('0x78')]){_0x249938['group'](_0x2fff69);}_0x32eed0[_0xfb4073][_0xd46e('0x79')]&&_0x249938[_0xd46e('0x7a')](_0x2fff69,_0x32eed0[_0xfb4073]['orderBy']==='DESC'?![]:!![]);_0x249938[_0xd46e('0x6a')](_0x2fff69,_0x32eed0[_0xfb4073][_0xd46e('0x7b')]||_0x2fff69);}if(_0x516e7d[_0xd46e('0x7c')]){_0x516e7d[_0xd46e('0x7c')]=JSON['parse'](_0x516e7d[_0xd46e('0x7c')]);for(var _0x372509=0x0;_0x372509<_0x516e7d['joins'][_0xd46e('0x3d')];_0x372509+=0x1){if(_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0xe0cd61,_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')])&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7d')]&&_0x516e7d[_0xd46e('0x7c')][_0x372509]['foreignTable']&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7e')]){_0x249938[_0x516e7d['joins'][_0x372509][_0xd46e('0x36')]](_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0x516e7d[_0xd46e('0x72')],_0x516e7d['joins'][_0x372509]['parentKey'],_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],_0x516e7d['joins'][_0x372509]['foreignKey']));}}}if(_0x516e7d['conditions']){_0x516e7d[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x516e7d[_0xd46e('0x81')]);_0x249938['where'](_0x1aaa99(_0x516e7d[_0xd46e('0x81')][_0xd46e('0x69')]));}_0x4f3ba0=_0x249938[_0xd46e('0x83')]();_0x249938['limit'](_0x37a22f);_0x249938['offset'](0x0);logger['debug']('Limited\x20Query:',_0x249938[_0xd46e('0x84')]());return dbH['sequelize'][_0xd46e('0x38')](_0x249938['toString'](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](respondWithResult(_0x3ec709,null))[_0xd46e('0x4a')](handleError(_0x3ec709,null));};function runReport(_0xf16d87,_0x99872a,_0x57a7cc){var _0x586024=_0x99872a[_0xd46e('0x2f')];var _0x383919=0xa;var _0x114f2c=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0x4ca21f={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x5ef4cc={'SEC_TO_TIME':_0xd46e('0x87'),'DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x88460a=function(_0x3a3744){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x3a3744);};var _0x3c476d=function(_0x1b2a6d){if(!_0x1b2a6d||!_0x1b2a6d[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x441f73='(',_0x1d2738=0x0;_0x1d2738<_0x1b2a6d['rules'][_0xd46e('0x3d')];_0x1d2738+=0x1){_0x1d2738>0x0&&(_0x441f73+='\x20'+_0x1b2a6d['operator']+'\x20');_0x441f73+=_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x69')]?_0x3c476d(_0x1b2a6d['rules'][_0x1d2738][_0xd46e('0x69')]):_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6a')]+'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')]+(_0x88460a(_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')])?'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x88')]:'');}return _0x441f73+')';};var _0x3fa34d={'where':{'id':_0xf16d87['id']}},_0xc098c9,_0x5f5ba7,_0x493df5,_0x18e140,_0x459a0c;_0x3fa34d=_[_0xd46e('0x45')]({},_0x3fa34d,_0x57a7cc);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fa34d)[_0xd46e('0x27')](function(_0x5b554e){if(_0x5b554e){_0xc098c9=_0x5b554e;return _0x5b554e[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0xa254f5){if(_0xa254f5){if(!_0xa254f5[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5f5ba7=_0xa254f5;return db[_0xd46e('0x89')][_0xd46e('0x49')]({'raw':!![]});}return null;})['then'](function(_0x3c8d68){if(_0x3c8d68){_0x493df5=_[_0xd46e('0x70')](_0x3c8d68,'id');var _0x9e222d;var _0x3da17e=squel[_0xd46e('0x8a')]();_0x3da17e[_0xd46e('0x71')](_0xc098c9[_0xd46e('0x72')]);for(var _0x282f71=0x0;_0x282f71<_0x5f5ba7[_0xd46e('0x3d')];_0x282f71+=0x1){_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x73')]?_0x493df5[_0x5f5ba7[_0x282f71][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x5f5ba7[_0x282f71][_0xd46e('0x6a')];_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x75')]?_['replace'](_0x4ca21f[_0x5f5ba7[_0x282f71]['function']],'%s',_0x9e222d):_0x9e222d;_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x5ef4cc[_0x5f5ba7[_0x282f71][_0xd46e('0x77')]],'%s',_0x9e222d):_0x9e222d;if(_0x5f5ba7[_0x282f71][_0xd46e('0x78')]){_0x3da17e[_0xd46e('0x69')](_0x9e222d);}_0x5f5ba7[_0x282f71][_0xd46e('0x79')]&&_0x3da17e['order'](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x3da17e[_0xd46e('0x6a')](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x7b')]||_0x9e222d);}if(_0xc098c9['joins']){_0xc098c9[_0xd46e('0x7c')]=JSON[_0xd46e('0x82')](_0xc098c9['joins']);for(var _0xdf967c=0x0;_0xdf967c<_0xc098c9['joins']['length'];_0xdf967c+=0x1){if(_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x114f2c,_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['type'])&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7d')]&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7f')]&&_0xc098c9['joins'][_0xdf967c]['foreignKey']){_0x3da17e[_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]](_0xc098c9['joins'][_0xdf967c]['foreignTable'],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0xc098c9[_0xd46e('0x72')],_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['parentKey'],_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x7f')],_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7e')]));}}}if(_0xc098c9[_0xd46e('0x81')]){_0xc098c9[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0xc098c9[_0xd46e('0x81')]);_0x3da17e[_0xd46e('0x41')](_0x3c476d(_0xc098c9['conditions'][_0xd46e('0x69')]));}_0x459a0c=_0x3da17e[_0xd46e('0x83')]();_0x3da17e['limit'](_0x383919);_0x3da17e['offset'](0x0);return;}})[_0xd46e('0x27')](function(){if(_0x99872a[_0xd46e('0x8c')]==='web'){return null;}var _0x5e637d=_[_0xd46e('0x45')](_0x99872a,{'name':_0x99872a[_0xd46e('0x8d')]||_0x99872a['name']||_0xc098c9[_0xd46e('0x2f')],'basename':_0x586024,'savename':util[_0xd46e('0x77')](_0xd46e('0x8e'),_0x99872a[_0xd46e('0x2f')]||_0xc098c9[_0xd46e('0x2f')],require(_0xd46e('0x8f'))['generate'](0x4),_0x99872a[_0xd46e('0x8c')]||_0xd46e('0x90')),'reportId':_0xc098c9['id'],'reportType':_0xd46e('0x91')});return db[_0xd46e('0x92')][_0xd46e('0x4d')](_0x5e637d,{'raw':!![]});})[_0xd46e('0x27')](function(_0x3311a6){if(_0xc098c9[_0xd46e('0x72')]===_0xd46e('0x93')){_0x459a0c[_0xd46e('0x41')](_0xc098c9[_0xd46e('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x99872a[_0xd46e('0x94')],_0x99872a['endDate']);}else{_0x459a0c['where'](_0xc098c9[_0xd46e('0x72')]+_0xd46e('0x95'),_0x99872a[_0xd46e('0x94')],_0x99872a[_0xd46e('0x96')]);}if(_0x3311a6){logger[_0xd46e('0x97')](_0xd46e('0x98'),_0x459a0c[_0xd46e('0x84')]());require(_0xd46e('0x99'))['fork'](path[_0xd46e('0x55')](__dirname,'../../components/export/',_0x3311a6[_0xd46e('0x8c')]),[_0x3311a6['id'],_0x459a0c[_0xd46e('0x84')](),path[_0xd46e('0x55')](__dirname,_0xd46e('0x9a'),_0x3311a6[_0xd46e('0x9b')]),_0x586024]);return _0x3311a6;}else{var _0x399918=squel[_0xd46e('0x8a')]();_0x399918[_0xd46e('0x71')]('('+_0x459a0c['toString']()+')',_0xd46e('0x9c'));_0x399918[_0xd46e('0x6a')](_0xd46e('0x9d'),'count');_0x459a0c[_0xd46e('0x1f')](_0x99872a[_0xd46e('0x1f')]||_0x383919);_0x459a0c[_0xd46e('0x1d')](_0x99872a['offset']||0x0);return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x399918[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]})['then'](function(_0x4967ff){if(!_0x4967ff[_0xd46e('0x3d')]){_0x18e140=0x0;}else{_0x18e140=_0x4967ff[0x0][_0xd46e('0x20')]||0x0;}return dbH['sequelize'][_0xd46e('0x38')](_0x459a0c[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]});})[_0xd46e('0x27')](function(_0x4bb76b){return{'rows':_0x4bb76b||[],'count':_0x18e140};});}});}exports['run']=function(_0x204a9f,_0x52ca5a){return runReport(_0x204a9f[_0xd46e('0x4b')],_0x204a9f[_0xd46e('0x38')],_0x204a9f['options'])[_0xd46e('0x27')](respondWithResult(_0x52ca5a,null))[_0xd46e('0x4a')](handleError(_0x52ca5a,null));};exports[_0xd46e('0x9f')]=runReport;exports[_0xd46e('0x38')]=function(_0x786ae,_0x537c73){var _0x1610bd=0xa;var _0x20cc4c=[_0xd46e('0x55'),_0xd46e('0xa0'),_0xd46e('0x56'),_0xd46e('0x57')];var _0x368742={'SUM':_0xd46e('0x58'),'COUNT':_0xd46e('0xa1'),'COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':_0xd46e('0xa2'),'AVG':_0xd46e('0xa3'),'GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x285cf8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc87da2=function(_0x195f02){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),'IS\x20NOT\x20NULL',_0xd46e('0x65'),_0xd46e('0x66')],_0x195f02);};var _0x44322f=function(_0x49959f){if(!_0x49959f||!_0x49959f['rules'][_0xd46e('0x3d')]){return'';}for(var _0x2094e5='(',_0x85aac1=0x0;_0x85aac1<_0x49959f[_0xd46e('0x67')][_0xd46e('0x3d')];_0x85aac1+=0x1){_0x85aac1>0x0&&(_0x2094e5+='\x20'+_0x49959f[_0xd46e('0x68')]+'\x20');_0x2094e5+=_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]?_0x44322f(_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]):_0x49959f['rules'][_0x85aac1][_0xd46e('0x6a')]+'\x20'+_0x49959f['rules'][_0x85aac1]['condition']+(_0xc87da2(_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x6b')])?'\x20'+_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x88')]:'');}return _0x2094e5+')';};var _0x101a29={'where':{'id':_0x786ae[_0xd46e('0x4b')]['id']}},_0x3a44da,_0x417068,_0x52e73e,_0x206077,_0xe729b6;_0x101a29=_[_0xd46e('0x45')]({},_0x101a29,_0x786ae[_0xd46e('0x46')]);return db['AnalyticDefaultReport'][_0xd46e('0x4c')](_0x101a29)[_0xd46e('0x27')](function(_0x1d08bb){if(_0x1d08bb){_0x3a44da=_0x1d08bb;return _0x1d08bb['getFields']();}return null;})[_0xd46e('0x27')](function(_0x8c6ed1){if(_0x8c6ed1){if(!_0x8c6ed1['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xd46e('0x6f'),0x193);}_0x417068=_0x8c6ed1;return db[_0xd46e('0x89')]['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3a13f8){if(_0x3a13f8){_0x52e73e=_['keyBy'](_0x3a13f8,'id');var _0x5a8661;var _0x157fb0=squel[_0xd46e('0x8a')]();_0x157fb0[_0xd46e('0x71')](_0x3a44da[_0xd46e('0x72')]);for(var _0x50750f=0x0;_0x50750f<_0x417068['length'];_0x50750f+=0x1){_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x73')]?_0x52e73e[_0x417068[_0x50750f][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x417068[_0x50750f][_0xd46e('0x6a')];_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0x368742[_0x417068[_0x50750f][_0xd46e('0x75')]],'%s',_0x5a8661):_0x5a8661;_0x5a8661=_0x417068[_0x50750f]['format']?_[_0xd46e('0x76')](_0x285cf8[_0x417068[_0x50750f][_0xd46e('0x77')]],'%s',_0x5a8661):_0x5a8661;if(_0x417068[_0x50750f]['groupBy']){_0x157fb0[_0xd46e('0x69')](_0x5a8661);}_0x417068[_0x50750f][_0xd46e('0x79')]&&_0x157fb0[_0xd46e('0x7a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x157fb0[_0xd46e('0x6a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x7b')]||_0x5a8661);}if(_0x3a44da[_0xd46e('0x7c')]){_0x3a44da['joins']=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x7c')]);for(var _0x3c819b=0x0;_0x3c819b<_0x3a44da[_0xd46e('0x7c')][_0xd46e('0x3d')];_0x3c819b+=0x1){if(_0x3a44da['joins'][_0x3c819b][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x20cc4c,_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')])&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7d')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']){_0x157fb0[_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')]](_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3a44da[_0xd46e('0x72')],_0x3a44da['joins'][_0x3c819b][_0xd46e('0x7d')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']));}}}if(_0x3a44da[_0xd46e('0x81')]){_0x3a44da[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x81')]);_0x157fb0[_0xd46e('0x41')](_0x44322f(_0x3a44da[_0xd46e('0x81')][_0xd46e('0x69')]));}_0xe729b6=_0x157fb0[_0xd46e('0x83')]();_0x157fb0[_0xd46e('0x1f')](_0x1610bd);_0x157fb0['offset'](0x0);logger['debug'](_0xd46e('0xa4'),_0x157fb0['toString']());return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x157fb0[_0xd46e('0x84')](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](function(){return{'sql':_0xe729b6['toString']()};})['then'](respondWithResult(_0x537c73,null))[_0xd46e('0x4a')](handleError(_0x537c73,null));};
\ No newline at end of file
+var _0x5fab=['debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','from','function','order','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','params','runReport','AVG(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','query','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone'];(function(_0x57b318,_0x6a293b){var _0x422950=function(_0x550d71){while(--_0x550d71){_0x57b318['push'](_0x57b318['shift']());}};_0x422950(++_0x6a293b);}(_0x5fab,0x177));var _0xb5fa=function(_0x2ac992,_0x37c877){_0x2ac992=_0x2ac992-0x0;var _0x223c9d=_0x5fab[_0x2ac992];return _0x223c9d;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];var dbH=require('../../mysqldb')[_0xb5fa('0x1a')];function respondWithStatusCode(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xcc;return function(_0x116849){if(_0x116849){return _0x3dad4d['sendStatus'](_0x56e8b0);}return _0x3dad4d[_0xb5fa('0x1b')](_0x56e8b0)[_0xb5fa('0x1c')]();};}function respondWithResult(_0x40c914,_0xca8d82){_0xca8d82=_0xca8d82||0xc8;return function(_0x8e9d1c){if(_0x8e9d1c){return _0x40c914['status'](_0xca8d82)['json'](_0x8e9d1c);}};}function respondWithFilteredResult(_0x38e964,_0x587043){return function(_0x31f252){if(_0x31f252){var _0x27c8f7=typeof _0x587043['offset']==='undefined'&&typeof _0x587043[_0xb5fa('0x1d')]===_0xb5fa('0x1e');var _0x32e9e5=_0x31f252[_0xb5fa('0x1f')];var _0x324ba5=_0x27c8f7?0x0:_0x587043[_0xb5fa('0x20')];var _0x3b0f69=_0x27c8f7?_0x31f252[_0xb5fa('0x1f')]:_0x587043[_0xb5fa('0x20')]+_0x587043[_0xb5fa('0x1d')];var _0x3c8d53;if(_0x3b0f69>=_0x32e9e5){_0x3b0f69=_0x32e9e5;_0x3c8d53=0xc8;}else{_0x3c8d53=0xce;}_0x38e964[_0xb5fa('0x1b')](_0x3c8d53);return _0x38e964['set'](_0xb5fa('0x21'),_0x324ba5+'-'+_0x3b0f69+'/'+_0x32e9e5)['json'](_0x31f252);}return null;};}function patchUpdates(_0x37ae06){return function(_0x4a6c04){try{jsonpatch[_0xb5fa('0x22')](_0x4a6c04,_0x37ae06,!![]);}catch(_0x43c09f){return BPromise['reject'](_0x43c09f);}return _0x4a6c04[_0xb5fa('0x23')]();};}function saveUpdates(_0x3a2ab9,_0x283a56){return function(_0x47f71a){if(_0x47f71a){return _0x47f71a[_0xb5fa('0x24')](_0x3a2ab9)[_0xb5fa('0x25')](function(_0x444237){return _0x444237;});}return null;};}function removeEntity(_0x542348,_0x224ec8){return function(_0x5d55f7){if(_0x5d55f7){return _0x5d55f7[_0xb5fa('0x26')]()[_0xb5fa('0x25')](function(){var _0x11053a=_0x5d55f7[_0xb5fa('0x27')]({'plain':!![]});var _0x2dbd22=_0xb5fa('0x28');return db[_0xb5fa('0x29')][_0xb5fa('0x26')]({'where':{'type':_0x2dbd22,'resourceId':_0x11053a['id']}})['then'](function(){return _0x5d55f7;});})['then'](function(){_0x542348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a350,_0x460b54){return function(_0x12c0d4){if(!_0x12c0d4){_0x28a350[_0xb5fa('0x2a')](0x194);}return _0x12c0d4;};}function handleError(_0x534884,_0x3506a4){_0x3506a4=_0x3506a4||0x1f4;return function(_0x358549){logger[_0xb5fa('0x2b')](_0x358549[_0xb5fa('0x2c')]);if(_0x358549[_0xb5fa('0x2d')]){delete _0x358549[_0xb5fa('0x2d')];}_0x534884[_0xb5fa('0x1b')](_0x3506a4)[_0xb5fa('0x2e')](_0x358549);};}exports[_0xb5fa('0x2f')]=function(_0xed02e,_0x116773){var _0x5a0152={},_0x3fd1fb={},_0x21fc7e={'count':0x0,'rows':[]};var _0x319c48=_[_0xb5fa('0x30')](db[_0xb5fa('0x31')][_0xb5fa('0x32')],function(_0x25fc7c){return{'name':_0x25fc7c['fieldName'],'type':_0x25fc7c[_0xb5fa('0x33')]['key']};});_0x3fd1fb['model']=_['map'](_0x319c48,_0xb5fa('0x2d'));_0x3fd1fb['query']=_[_0xb5fa('0x34')](_0xed02e['query']);_0x3fd1fb['filters']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],_0x3fd1fb['query']);_0x5a0152['attributes']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0xed02e['query'][_0xb5fa('0x37')]));_0x5a0152[_0xb5fa('0x38')]=_0x5a0152['attributes'][_0xb5fa('0x39')]?_0x5a0152[_0xb5fa('0x38')]:_0x3fd1fb[_0xb5fa('0x36')];if(!_0xed02e['query'][_0xb5fa('0x3a')](_0xb5fa('0x3b'))){_0x5a0152[_0xb5fa('0x1d')]=qs['limit'](_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x1d')]);_0x5a0152[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0xed02e['query']['offset']);}_0x5a0152['order']=qs['sort'](_0xed02e['query']['sort']);_0x5a0152[_0xb5fa('0x3d')]=qs['filters'](_[_0xb5fa('0x3e')](_0xed02e[_0xb5fa('0x3c')],_0x3fd1fb[_0xb5fa('0x3f')]),_0x319c48);if(_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]){_0x5a0152[_0xb5fa('0x3d')]=_['merge'](_0x5a0152['where'],{'$or':_['map'](_0x319c48,function(_0x534b38){if(_0x534b38['type']!==_0xb5fa('0x41')){var _0x5addd5={};_0x5addd5[_0x534b38['name']]={'$like':'%'+_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]+'%'};return _0x5addd5;}})});}_0x5a0152=_[_0xb5fa('0x42')]({},_0x5a0152,_0xed02e[_0xb5fa('0x43')]);var _0x5bc93f={'where':_0x5a0152[_0xb5fa('0x3d')]};return db[_0xb5fa('0x31')][_0xb5fa('0x1f')](_0x5bc93f)[_0xb5fa('0x25')](function(_0x402a68){_0x21fc7e['count']=_0x402a68;if(_0xed02e[_0xb5fa('0x3c')]['includeAll']){_0x5a0152[_0xb5fa('0x44')]=[{'all':!![]}];}return db[_0xb5fa('0x31')][_0xb5fa('0x45')](_0x5a0152);})[_0xb5fa('0x25')](function(_0x1c706b){_0x21fc7e[_0xb5fa('0x46')]=_0x1c706b;return _0x21fc7e;})[_0xb5fa('0x25')](respondWithFilteredResult(_0x116773,_0x5a0152))[_0xb5fa('0x47')](handleError(_0x116773,null));};exports['show']=function(_0x1c3c2c,_0xc03e44){var _0x59ae64={'raw':!![],'where':{'id':_0x1c3c2c['params']['id']}},_0x293c19={};_0x293c19[_0xb5fa('0x36')]=_[_0xb5fa('0x34')](db['AnalyticDefaultReport']['rawAttributes']);_0x293c19[_0xb5fa('0x3c')]=_[_0xb5fa('0x34')](_0x1c3c2c[_0xb5fa('0x3c')]);_0x293c19[_0xb5fa('0x3f')]=_[_0xb5fa('0x35')](_0x293c19[_0xb5fa('0x36')],_0x293c19[_0xb5fa('0x3c')]);_0x59ae64[_0xb5fa('0x38')]=_['intersection'](_0x293c19[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0x1c3c2c['query'][_0xb5fa('0x37')]));_0x59ae64[_0xb5fa('0x38')]=_0x59ae64[_0xb5fa('0x38')][_0xb5fa('0x39')]?_0x59ae64[_0xb5fa('0x38')]:_0x293c19[_0xb5fa('0x36')];if(_0x1c3c2c[_0xb5fa('0x3c')][_0xb5fa('0x48')]){_0x59ae64[_0xb5fa('0x44')]=[{'all':!![]}];}_0x59ae64=_[_0xb5fa('0x42')]({},_0x59ae64,_0x1c3c2c[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x59ae64)[_0xb5fa('0x25')](handleEntityNotFound(_0xc03e44,null))[_0xb5fa('0x25')](respondWithResult(_0xc03e44,null))[_0xb5fa('0x47')](handleError(_0xc03e44,null));};exports['create']=function(_0x56dceb,_0x46194d){return db['AnalyticDefaultReport'][_0xb5fa('0x4a')](_0x56dceb[_0xb5fa('0x4b')],{})['then'](function(_0x4ef1d0){var _0x2931a7=_0x56dceb[_0xb5fa('0x4c')][_0xb5fa('0x27')]({'plain':!![]});if(!_0x2931a7)throw new Error(_0xb5fa('0x4d'));if(_0x2931a7[_0xb5fa('0x4e')]==='user'){var _0x27a651=_0x4ef1d0['get']({'plain':!![]});var _0x251d36=_0xb5fa('0x4f');return db[_0xb5fa('0x50')]['find']({'where':{'name':_0x251d36,'userProfileId':_0x2931a7[_0xb5fa('0x51')]},'raw':!![]})[_0xb5fa('0x25')](function(_0x4dea87){if(_0x4dea87&&_0x4dea87['autoAssociation']===0x0){return db[_0xb5fa('0x29')][_0xb5fa('0x4a')]({'name':_0x27a651[_0xb5fa('0x2d')],'resourceId':_0x27a651['id'],'type':_0xb5fa('0x28'),'sectionId':_0x4dea87['id']},{})[_0xb5fa('0x25')](function(){return _0x4ef1d0;});}else{return _0x4ef1d0;}})[_0xb5fa('0x47')](function(_0x31c91f){logger[_0xb5fa('0x2b')](_0xb5fa('0x52'),_0x31c91f);throw _0x31c91f;});}return _0x4ef1d0;})[_0xb5fa('0x25')](respondWithResult(_0x46194d,0xc9))[_0xb5fa('0x47')](handleError(_0x46194d,null));};exports[_0xb5fa('0x24')]=function(_0x3ccfd1,_0x2799e7){if(_0x3ccfd1[_0xb5fa('0x4b')]['id']){delete _0x3ccfd1[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x3ccfd1['params']['id']}})[_0xb5fa('0x25')](handleEntityNotFound(_0x2799e7,null))[_0xb5fa('0x25')](saveUpdates(_0x3ccfd1[_0xb5fa('0x4b')],null))[_0xb5fa('0x25')](respondWithResult(_0x2799e7,null))[_0xb5fa('0x47')](handleError(_0x2799e7,null));};exports[_0xb5fa('0x26')]=function(_0x4224cf,_0x24117e){return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x4224cf['params']['id']}})['then'](handleEntityNotFound(_0x24117e,null))[_0xb5fa('0x25')](removeEntity(_0x24117e,null))[_0xb5fa('0x47')](handleError(_0x24117e,null));};exports[_0xb5fa('0x53')]=function(_0x5caf84,_0x441c41){var _0x367f7a=0xa;var _0x1572fb=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x4f82f0={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x2b9a45={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0x1c24e3=function(_0xfb88cc){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0xfb88cc);};var _0x41cce9=function(_0x23fb01){if(!_0x23fb01||!_0x23fb01[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x421a93='(',_0x36fc0f=0x0;_0x36fc0f<_0x23fb01['rules'][_0xb5fa('0x39')];_0x36fc0f+=0x1){_0x36fc0f>0x0&&(_0x421a93+='\x20'+_0x23fb01[_0xb5fa('0x6a')]+'\x20');_0x421a93+=_0x23fb01[_0xb5fa('0x69')][_0x36fc0f]['group']?_0x41cce9(_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6b')]):_0x23fb01['rules'][_0x36fc0f][_0xb5fa('0x6c')]+'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6d')]+(_0x1c24e3(_0x23fb01['rules'][_0x36fc0f]['condition'])?'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6e')]:'');}return _0x421a93+')';};var _0x432f04={'where':{'id':_0x5caf84['params']['id']}},_0x57d8b7,_0x597206,_0x30d53b,_0x199555,_0x12b0a2;_0x432f04=_['merge']({},_0x432f04,_0x5caf84['options']);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x432f04)[_0xb5fa('0x25')](function(_0x4ce1bd){if(_0x4ce1bd){_0x57d8b7=_0x4ce1bd;return _0x4ce1bd[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x13ef3a){if(_0x13ef3a){if(!_0x13ef3a[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x597206=_0x13ef3a;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x3a1db9){if(_0x3a1db9){_0x30d53b=_[_0xb5fa('0x74')](_0x3a1db9,'id');var _0xecdff3;var _0x38faa6=squel[_0xb5fa('0x75')]();_0x38faa6['from'](_0x57d8b7[_0xb5fa('0x76')]);for(var _0x5a6f74=0x0;_0x5a6f74<_0x597206[_0xb5fa('0x39')];_0x5a6f74+=0x1){_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x77')]?_0x30d53b[_0x597206[_0x5a6f74][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x597206[_0x5a6f74][_0xb5fa('0x6c')];_0xecdff3=_0x597206[_0x5a6f74]['function']?_[_0xb5fa('0x79')](_0x4f82f0[_0x597206[_0x5a6f74]['function']],'%s',_0xecdff3):_0xecdff3;_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x2b9a45[_0x597206[_0x5a6f74][_0xb5fa('0x7a')]],'%s',_0xecdff3):_0xecdff3;if(_0x597206[_0x5a6f74][_0xb5fa('0x7b')]){_0x38faa6['group'](_0xecdff3);}_0x597206[_0x5a6f74]['orderBy']&&_0x38faa6['order'](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x38faa6[_0xb5fa('0x6c')](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7e')]||_0xecdff3);}if(_0x57d8b7[_0xb5fa('0x7f')]){_0x57d8b7[_0xb5fa('0x7f')]=JSON['parse'](_0x57d8b7[_0xb5fa('0x7f')]);for(var _0x5c08e1=0x0;_0x5c08e1<_0x57d8b7['joins'][_0xb5fa('0x39')];_0x5c08e1+=0x1){if(_0x57d8b7['joins'][_0x5c08e1]['type']&&_['includes'](_0x1572fb,_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type'])&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')]&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['foreignTable']&&_0x57d8b7['joins'][_0x5c08e1][_0xb5fa('0x81')]){_0x38faa6[_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type']](_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x57d8b7['table'],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x81')]));}}}if(_0x57d8b7[_0xb5fa('0x84')]){_0x57d8b7['conditions']=JSON[_0xb5fa('0x85')](_0x57d8b7['conditions']);_0x38faa6[_0xb5fa('0x3d')](_0x41cce9(_0x57d8b7[_0xb5fa('0x84')]['group']));}_0x12b0a2=_0x38faa6[_0xb5fa('0x86')]();_0x38faa6[_0xb5fa('0x1d')](_0x367f7a);_0x38faa6[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x38faa6[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x38faa6['toString'](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](respondWithResult(_0x441c41,null))['catch'](handleError(_0x441c41,null));};function runReport(_0x593386,_0x47d72b,_0x5557a3){var _0x1c60bd=_0x47d72b[_0xb5fa('0x2d')];var _0xff504d=0xa;var _0x188e66=['join','left_join',_0xb5fa('0x56'),'cross_join'];var _0x32eebd={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':'MAX(%s)','MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6852={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0xa7fd3b=function(_0x42e210){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0x42e210);};var _0x86dfe9=function(_0x53c7b5){if(!_0x53c7b5||!_0x53c7b5['rules'][_0xb5fa('0x39')]){return'';}for(var _0x52384b='(',_0x1cb113=0x0;_0x1cb113<_0x53c7b5[_0xb5fa('0x69')]['length'];_0x1cb113+=0x1){_0x1cb113>0x0&&(_0x52384b+='\x20'+_0x53c7b5[_0xb5fa('0x6a')]+'\x20');_0x52384b+=_0x53c7b5[_0xb5fa('0x69')][_0x1cb113]['group']?_0x86dfe9(_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6b')]):_0x53c7b5['rules'][_0x1cb113][_0xb5fa('0x6c')]+'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6d')]+(_0xa7fd3b(_0x53c7b5['rules'][_0x1cb113]['condition'])?'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6e')]:'');}return _0x52384b+')';};var _0x3b5e1d={'where':{'id':_0x593386['id']}},_0x3d18a9,_0x397830,_0x234d9d,_0x10222c,_0x1eec65;_0x3b5e1d=_[_0xb5fa('0x42')]({},_0x3b5e1d,_0x5557a3);return db[_0xb5fa('0x31')]['find'](_0x3b5e1d)['then'](function(_0x3c5563){if(_0x3c5563){_0x3d18a9=_0x3c5563;return _0x3c5563[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x18498d){if(_0x18498d){if(!_0x18498d['length']){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x397830=_0x18498d;return db['AnalyticMetric'][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x109dd9){if(_0x109dd9){_0x234d9d=_[_0xb5fa('0x74')](_0x109dd9,'id');var _0x5ba2e7;var _0x1175da=squel[_0xb5fa('0x75')]();_0x1175da[_0xb5fa('0x8e')](_0x3d18a9[_0xb5fa('0x76')]);for(var _0x19717a=0x0;_0x19717a<_0x397830[_0xb5fa('0x39')];_0x19717a+=0x1){_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x77')]?_0x234d9d[_0x397830[_0x19717a][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x397830[_0x19717a][_0xb5fa('0x6c')];_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x32eebd[_0x397830[_0x19717a][_0xb5fa('0x8f')]],'%s',_0x5ba2e7):_0x5ba2e7;_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x5e6852[_0x397830[_0x19717a]['format']],'%s',_0x5ba2e7):_0x5ba2e7;if(_0x397830[_0x19717a][_0xb5fa('0x7b')]){_0x1175da[_0xb5fa('0x6b')](_0x5ba2e7);}_0x397830[_0x19717a][_0xb5fa('0x7c')]&&_0x1175da[_0xb5fa('0x90')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x1175da[_0xb5fa('0x6c')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7e')]||_0x5ba2e7);}if(_0x3d18a9['joins']){_0x3d18a9['joins']=JSON[_0xb5fa('0x85')](_0x3d18a9['joins']);for(var _0x5d0ca8=0x0;_0x5d0ca8<_0x3d18a9[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x5d0ca8+=0x1){if(_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['type']&&_[_0xb5fa('0x64')](_0x188e66,_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')])&&_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x80')]&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable']&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x81')]){_0x1175da[_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')]](_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3d18a9[_0xb5fa('0x76')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x80')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable'],_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x81')]));}}}if(_0x3d18a9[_0xb5fa('0x84')]){_0x3d18a9[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3d18a9['conditions']);_0x1175da['where'](_0x86dfe9(_0x3d18a9['conditions']['group']));}_0x1eec65=_0x1175da[_0xb5fa('0x86')]();_0x1175da[_0xb5fa('0x1d')](_0xff504d);_0x1175da[_0xb5fa('0x20')](0x0);return;}})[_0xb5fa('0x25')](function(){if(_0x47d72b[_0xb5fa('0x91')]===_0xb5fa('0x92')){return null;}var _0x3c36a8=_[_0xb5fa('0x42')](_0x47d72b,{'name':_0x47d72b[_0xb5fa('0x93')]||_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9[_0xb5fa('0x2d')],'basename':_0x1c60bd,'savename':util['format'](_0xb5fa('0x94'),_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9['name'],require(_0xb5fa('0x95'))[_0xb5fa('0x96')](0x4),_0x47d72b['output']||_0xb5fa('0x97')),'reportId':_0x3d18a9['id'],'reportType':_0xb5fa('0x98')});return db[_0xb5fa('0x99')][_0xb5fa('0x4a')](_0x3c36a8,{'raw':!![]});})[_0xb5fa('0x25')](function(_0x2b449a){if(_0x3d18a9[_0xb5fa('0x76')]===_0xb5fa('0x9a')){_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9['table']+_0xb5fa('0x9b'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}else{_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9[_0xb5fa('0x76')]+_0xb5fa('0x9e'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}if(_0x2b449a){logger['info'](_0xb5fa('0x9f'),_0x1eec65['toString']());require(_0xb5fa('0xa0'))[_0xb5fa('0xa1')](path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa2'),_0x2b449a[_0xb5fa('0x91')]),[_0x2b449a['id'],_0x1eec65[_0xb5fa('0x89')](),path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa3'),_0x2b449a[_0xb5fa('0xa4')]),_0x1c60bd]);return _0x2b449a;}else{var _0x4bb9b4=squel['select']();_0x4bb9b4[_0xb5fa('0x8e')]('('+_0x1eec65[_0xb5fa('0x89')]()+')',_0xb5fa('0xa5'));_0x4bb9b4[_0xb5fa('0x6c')]('COUNT(*)',_0xb5fa('0x1f'));_0x1eec65['limit'](_0x47d72b[_0xb5fa('0x1d')]||_0xff504d);_0x1eec65[_0xb5fa('0x20')](_0x47d72b['offset']||0x0);return dbH[_0xb5fa('0x8a')]['query'](_0x4bb9b4[_0xb5fa('0x89')](),{'type':dbH['sequelize'][_0xb5fa('0x8b')][_0xb5fa('0x8c')]})[_0xb5fa('0x25')](function(_0x70e4ae){if(!_0x70e4ae[_0xb5fa('0x39')]){_0x10222c=0x0;}else{_0x10222c=_0x70e4ae[0x0][_0xb5fa('0x1f')]||0x0;}return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x1eec65[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')]['SELECT']});})[_0xb5fa('0x25')](function(_0x284b34){return{'rows':_0x284b34||[],'count':_0x10222c};});}});}exports[_0xb5fa('0xa6')]=function(_0x497931,_0x2145d8){return runReport(_0x497931[_0xb5fa('0xa7')],_0x497931[_0xb5fa('0x3c')],_0x497931[_0xb5fa('0x43')])[_0xb5fa('0x25')](respondWithResult(_0x2145d8,null))[_0xb5fa('0x47')](handleError(_0x2145d8,null));};exports[_0xb5fa('0xa8')]=runReport;exports[_0xb5fa('0x3c')]=function(_0x59fd75,_0x245ee1){var _0x5c1e1f=0xa;var _0x3ba723=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x105c0f={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':_0xb5fa('0xa9'),'GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x41e086={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd34c31=function(_0x2e614e){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb5fa('0x67'),_0xb5fa('0x68')],_0x2e614e);};var _0x1aae82=function(_0x474bb){if(!_0x474bb||!_0x474bb[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x17ae50='(',_0x51c9ba=0x0;_0x51c9ba<_0x474bb['rules']['length'];_0x51c9ba+=0x1){_0x51c9ba>0x0&&(_0x17ae50+='\x20'+_0x474bb[_0xb5fa('0x6a')]+'\x20');_0x17ae50+=_0x474bb['rules'][_0x51c9ba]['group']?_0x1aae82(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['group']):_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6c')]+'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6d')]+(_0xd34c31(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['condition'])?'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6e')]:'');}return _0x17ae50+')';};var _0x2fe715={'where':{'id':_0x59fd75[_0xb5fa('0xa7')]['id']}},_0x3c5ac4,_0x23b70f,_0x488818,_0x15b228,_0x42fd84;_0x2fe715=_[_0xb5fa('0x42')]({},_0x2fe715,_0x59fd75[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')]['find'](_0x2fe715)[_0xb5fa('0x25')](function(_0x390043){if(_0x390043){_0x3c5ac4=_0x390043;return _0x390043[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x32c191){if(_0x32c191){if(!_0x32c191[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x23b70f=_0x32c191;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x1d307c){if(_0x1d307c){_0x488818=_[_0xb5fa('0x74')](_0x1d307c,'id');var _0x3347eb;var _0x349e0b=squel[_0xb5fa('0x75')]();_0x349e0b[_0xb5fa('0x8e')](_0x3c5ac4[_0xb5fa('0x76')]);for(var _0x2b1c3f=0x0;_0x2b1c3f<_0x23b70f[_0xb5fa('0x39')];_0x2b1c3f+=0x1){_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x77')]?_0x488818[_0x23b70f[_0x2b1c3f]['MetricId']]['metric']:_0x23b70f[_0x2b1c3f][_0xb5fa('0x6c')];_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x105c0f[_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]],'%s',_0x3347eb):_0x3347eb;_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x41e086[_0x23b70f[_0x2b1c3f]['format']],'%s',_0x3347eb):_0x3347eb;if(_0x23b70f[_0x2b1c3f]['groupBy']){_0x349e0b['group'](_0x3347eb);}_0x23b70f[_0x2b1c3f][_0xb5fa('0x7c')]&&_0x349e0b[_0xb5fa('0x90')](_0x3347eb,_0x23b70f[_0x2b1c3f]['orderBy']===_0xb5fa('0x7d')?![]:!![]);_0x349e0b[_0xb5fa('0x6c')](_0x3347eb,_0x23b70f[_0x2b1c3f]['alias']||_0x3347eb);}if(_0x3c5ac4[_0xb5fa('0x7f')]){_0x3c5ac4[_0xb5fa('0x7f')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x7f')]);for(var _0x10dbdf=0x0;_0x10dbdf<_0x3c5ac4[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x10dbdf+=0x1){if(_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['type']&&_[_0xb5fa('0x64')](_0x3ba723,_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x33')])&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')]&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable']&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x81')]){_0x349e0b[_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x33')]](_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x3c5ac4[_0xb5fa('0x76')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable'],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignKey']));}}}if(_0x3c5ac4[_0xb5fa('0x84')]){_0x3c5ac4[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x84')]);_0x349e0b[_0xb5fa('0x3d')](_0x1aae82(_0x3c5ac4[_0xb5fa('0x84')][_0xb5fa('0x6b')]));}_0x42fd84=_0x349e0b['clone']();_0x349e0b['limit'](_0x5c1e1f);_0x349e0b[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x349e0b[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x349e0b[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')]['QueryTypes'][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](function(){return{'sql':_0x42fd84[_0xb5fa('0x89')]()};})[_0xb5fa('0x25')](respondWithResult(_0x245ee1,null))[_0xb5fa('0x47')](handleError(_0x245ee1,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index ae65e46..5568f20 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 _0x9f36=['./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f36,0x1f3));var _0x69f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9f36[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x69f3('0x0'));var util=require('util');var logger=require(_0x69f3('0x1'))(_0x69f3('0x2'));var moment=require('moment');var BPromise=require(_0x69f3('0x3'));var rp=require(_0x69f3('0x4'));var fs=require('fs');var path=require(_0x69f3('0x5'));var rimraf=require(_0x69f3('0x6'));var config=require(_0x69f3('0x7'));var attributes=require(_0x69f3('0x8'));module[_0x69f3('0x9')]=function(_0x372b53,_0x355d75){return _0x372b53[_0x69f3('0xa')](_0x69f3('0xb'),attributes,{'tableName':_0x69f3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc33d=['path','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','moment','request-promise'];(function(_0x4b6830,_0x2bf6fb){var _0x239e4a=function(_0x364735){while(--_0x364735){_0x4b6830['push'](_0x4b6830['shift']());}};_0x239e4a(++_0x2bf6fb);}(_0xc33d,0xcc));var _0xdc33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc33d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdc33('0x0'));var util=require('util');var logger=require(_0xdc33('0x1'))(_0xdc33('0x2'));var moment=require(_0xdc33('0x3'));var BPromise=require('bluebird');var rp=require(_0xdc33('0x4'));var fs=require('fs');var path=require(_0xdc33('0x5'));var rimraf=require('rimraf');var config=require(_0xdc33('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0xdc33('0x7')]=function(_0x24c1c7,_0x5de3da){return _0x24c1c7[_0xdc33('0x8')](_0xdc33('0x9'),attributes,{'tableName':_0xdc33('0xa'),'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 d217c0a..cd3b5a8 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 _0xc78d=['../../config/logger','rpc','jayson/promise','client','http','request','then','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','ioredis','../../config/utils'];(function(_0x1a166c,_0x596de5){var _0x15c41f=function(_0x120f6){while(--_0x120f6){_0x1a166c['push'](_0x1a166c['shift']());}};_0x15c41f(++_0x596de5);}(_0xc78d,0x1df));var _0xdc78=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc78d[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xdc78('0x0'));var util=require(_0xdc78('0x1'));var moment=require('moment');var BPromise=require(_0xdc78('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc78('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc78('0x4'));var logger=require(_0xdc78('0x5'))(_0xdc78('0x6'));var config=require('../../config/environment');var jayson=require(_0xdc78('0x7'));var client=jayson[_0xdc78('0x8')][_0xdc78('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4159c8,_0x392fb4,_0x269aea){return new BPromise(function(_0x5ec5de,_0x3cc7f6){return client[_0xdc78('0xa')](_0x4159c8,_0x269aea)[_0xdc78('0xb')](function(_0x5408a1){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x392fb4,'request\x20sent');logger[_0xdc78('0xc')](_0xdc78('0xd'),_0x392fb4,_0xdc78('0xe'),JSON[_0xdc78('0xf')](_0x5408a1));if(_0x5408a1[_0xdc78('0x10')]){if(_0x5408a1[_0xdc78('0x10')][_0xdc78('0x11')]===0x1f4){logger[_0xdc78('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x392fb4,_0x5408a1[_0xdc78('0x10')][_0xdc78('0x12')]);return _0x3cc7f6(_0x5408a1[_0xdc78('0x10')][_0xdc78('0x12')]);}logger[_0xdc78('0x10')](_0xdc78('0x13'),_0x392fb4,_0x5408a1[_0xdc78('0x10')][_0xdc78('0x12')]);return _0x5ec5de(_0x5408a1[_0xdc78('0x10')][_0xdc78('0x12')]);}else{logger['info'](_0xdc78('0x13'),_0x392fb4,_0xdc78('0xe'));_0x5ec5de(_0x5408a1[_0xdc78('0x14')][_0xdc78('0x12')]);}})[_0xdc78('0x15')](function(_0x2ad82e){logger[_0xdc78('0x10')](_0xdc78('0x13'),_0x392fb4,_0x2ad82e);_0x3cc7f6(_0x2ad82e);});});}
\ No newline at end of file
+var _0x222b=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash'];(function(_0xa65c05,_0x3cd2cf){var _0x476c4a=function(_0x291b73){while(--_0x291b73){_0xa65c05['push'](_0xa65c05['shift']());}};_0x476c4a(++_0x3cd2cf);}(_0x222b,0xfc));var _0xb222=function(_0x2332e1,_0x433415){_0x2332e1=_0x2332e1-0x0;var _0x2c3bda=_0x222b[_0x2332e1];return _0x2c3bda;};'use strict';var _=require(_0xb222('0x0'));var util=require(_0xb222('0x1'));var moment=require('moment');var BPromise=require(_0xb222('0x2'));var rs=require(_0xb222('0x3'));var fs=require('fs');var Redis=require(_0xb222('0x4'));var db=require(_0xb222('0x5'))['db'];var utils=require(_0xb222('0x6'));var logger=require(_0xb222('0x7'))(_0xb222('0x8'));var config=require(_0xb222('0x9'));var jayson=require(_0xb222('0xa'));var client=jayson[_0xb222('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x329639,_0x4989a0,_0x5c4d59){return new BPromise(function(_0x470918,_0x42264b){return client['request'](_0x329639,_0x5c4d59)[_0xb222('0xc')](function(_0x1af154){logger['info'](_0xb222('0xd'),_0x4989a0,_0xb222('0xe'));logger[_0xb222('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4989a0,_0xb222('0xe'),JSON[_0xb222('0x10')](_0x1af154));if(_0x1af154[_0xb222('0x11')]){if(_0x1af154[_0xb222('0x11')][_0xb222('0x12')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4989a0,_0x1af154[_0xb222('0x11')][_0xb222('0x13')]);return _0x42264b(_0x1af154[_0xb222('0x11')][_0xb222('0x13')]);}logger['error'](_0xb222('0xd'),_0x4989a0,_0x1af154[_0xb222('0x11')][_0xb222('0x13')]);return _0x470918(_0x1af154[_0xb222('0x11')][_0xb222('0x13')]);}else{logger[_0xb222('0x14')](_0xb222('0xd'),_0x4989a0,'request\x20sent');_0x470918(_0x1af154[_0xb222('0x15')][_0xb222('0x13')]);}})[_0xb222('0x16')](function(_0x475b07){logger[_0xb222('0x11')](_0xb222('0xd'),_0x4989a0,_0x475b07);_0x42264b(_0x475b07);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 914d79d..646ec0a 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 _0x7374=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','/:id/run','run','/:id/query','query','put','update','destroy','exports','path','connect-timeout','express'];(function(_0x4a636e,_0x464b51){var _0x27ab69=function(_0x5349a6){while(--_0x5349a6){_0x4a636e['push'](_0x4a636e['shift']());}};_0x27ab69(++_0x464b51);}(_0x7374,0x138));var _0x4737=function(_0xdf8a14,_0x4bed7f){_0xdf8a14=_0xdf8a14-0x0;var _0x1caf7c=_0x7374[_0xdf8a14];return _0x1caf7c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4737('0x0'));var timeout=require(_0x4737('0x1'));var express=require(_0x4737('0x2'));var router=express[_0x4737('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4737('0x4'));var interaction=require(_0x4737('0x5'));var config=require(_0x4737('0x6'));var controller=require(_0x4737('0x7'));router[_0x4737('0x8')]('/',auth[_0x4737('0x9')](),controller[_0x4737('0xa')]);router[_0x4737('0x8')]('/:id',auth[_0x4737('0x9')](),controller[_0x4737('0xb')]);router[_0x4737('0x8')](_0x4737('0xc'),auth[_0x4737('0x9')](),controller['preview']);router['get'](_0x4737('0xd'),auth['isAuthenticated'](),controller[_0x4737('0xe')]);router['get'](_0x4737('0xf'),auth[_0x4737('0x9')](),controller[_0x4737('0x10')]);router['post']('/',auth[_0x4737('0x9')](),controller['create']);router[_0x4737('0x11')]('/:id',auth[_0x4737('0x9')](),controller[_0x4737('0x12')]);router['delete']('/:id',auth[_0x4737('0x9')](),controller[_0x4737('0x13')]);module[_0x4737('0x14')]=router;
\ No newline at end of file
+var _0x5a59=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','delete','destroy','exports','multer','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a59,0xb6));var _0x95a5=function(_0x13ee72,_0x5f0bb6){_0x13ee72=_0x13ee72-0x0;var _0x5d3d3d=_0x5a59[_0x13ee72];return _0x5d3d3d;};'use strict';var multer=require(_0x95a5('0x0'));var util=require('util');var path=require(_0x95a5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x95a5('0x2')]();var fs_extra=require(_0x95a5('0x3'));var auth=require(_0x95a5('0x4'));var interaction=require(_0x95a5('0x5'));var config=require(_0x95a5('0x6'));var controller=require(_0x95a5('0x7'));router[_0x95a5('0x8')]('/',auth[_0x95a5('0x9')](),controller['index']);router[_0x95a5('0x8')](_0x95a5('0xa'),auth[_0x95a5('0x9')](),controller[_0x95a5('0xb')]);router[_0x95a5('0x8')](_0x95a5('0xc'),auth[_0x95a5('0x9')](),controller[_0x95a5('0xd')]);router[_0x95a5('0x8')](_0x95a5('0xe'),auth[_0x95a5('0x9')](),controller['run']);router[_0x95a5('0x8')](_0x95a5('0xf'),auth[_0x95a5('0x9')](),controller[_0x95a5('0x10')]);router[_0x95a5('0x11')]('/',auth['isAuthenticated'](),controller[_0x95a5('0x12')]);router[_0x95a5('0x13')](_0x95a5('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x95a5('0x14')](_0x95a5('0xa'),auth[_0x95a5('0x9')](),controller[_0x95a5('0x15')]);module[_0x95a5('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index c040137..3048998 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 _0x1d89=['xlsx','DATE','Loading','ENUM','manual','UNSIGNED','exports','STRING','csv'];(function(_0x267ea6,_0x2f3421){var _0x404120=function(_0x3bbc76){while(--_0x3bbc76){_0x267ea6['push'](_0x267ea6['shift']());}};_0x404120(++_0x2f3421);}(_0x1d89,0x7b));var _0x91d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d89[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x91d8('0x0')]={'name':{'type':Sequelize[_0x91d8('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x91d8('0x2'),'pdf',_0x91d8('0x3')),'allowNull':![],'defaultValue':_0x91d8('0x2')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x91d8('0x4')]},'endDate':{'type':Sequelize[_0x91d8('0x4')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x91d8('0x5')},'type':{'type':Sequelize[_0x91d8('0x6')](_0x91d8('0x7'),'scheduled'),'allowNull':![],'defaultValue':_0x91d8('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x91d8('0x8')]},'reportType':{'type':Sequelize[_0x91d8('0x1')]}};
\ No newline at end of file
+var _0xbef2=['ENUM','csv','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING'];(function(_0x280a6b,_0x3fcc0f){var _0x54f242=function(_0x3975d3){while(--_0x3975d3){_0x280a6b['push'](_0x280a6b['shift']());}};_0x54f242(++_0x3fcc0f);}(_0xbef2,0xa5));var _0x2bef=function(_0x536d72,_0x21e536){_0x536d72=_0x536d72-0x0;var _0x1df130=_0xbef2[_0x536d72];return _0x1df130;};'use strict';var Sequelize=require(_0x2bef('0x0'));var moment=require('moment');module[_0x2bef('0x1')]={'name':{'type':Sequelize[_0x2bef('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2bef('0x3')](_0x2bef('0x4'),'pdf',_0x2bef('0x5')),'allowNull':![],'defaultValue':_0x2bef('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x2bef('0x6')]},'endDate':{'type':Sequelize[_0x2bef('0x6')]},'status':{'type':Sequelize[_0x2bef('0x2')],'defaultValue':_0x2bef('0x7')},'type':{'type':Sequelize[_0x2bef('0x3')](_0x2bef('0x8'),_0x2bef('0x9')),'allowNull':![],'defaultValue':_0x2bef('0x8')},'reportId':{'type':Sequelize[_0x2bef('0xa')](0xb)[_0x2bef('0xb')]},'reportType':{'type':Sequelize[_0x2bef('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 7412847..3cb9a72 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 _0xdc62=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','ExtractedReports','error','stack','name','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x25b642,_0x4b8b4a){var _0x5b03cf=function(_0x3c3216){while(--_0x3c3216){_0x25b642['push'](_0x25b642['shift']());}};_0x5b03cf(++_0x4b8b4a);}(_0xdc62,0x10e));var _0x2dc6=function(_0xdb545c,_0x3b2826){_0xdb545c=_0xdb545c-0x0;var _0x617e9c=_0xdc62[_0xdb545c];return _0x617e9c;};'use strict';var emlformat=require(_0x2dc6('0x0'));var rimraf=require(_0x2dc6('0x1'));var zipdir=require(_0x2dc6('0x2'));var jsonpatch=require(_0x2dc6('0x3'));var rp=require('request-promise');var moment=require(_0x2dc6('0x4'));var BPromise=require(_0x2dc6('0x5'));var Mustache=require(_0x2dc6('0x6'));var util=require('util');var path=require(_0x2dc6('0x7'));var sox=require(_0x2dc6('0x8'));var csv=require('to-csv');var ejs=require(_0x2dc6('0x9'));var fs=require('fs');var fs_extra=require(_0x2dc6('0xa'));var _=require(_0x2dc6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2dc6('0xc'));var toCsv=require(_0x2dc6('0xd'));var querystring=require(_0x2dc6('0xe'));var Papa=require('papaparse');var Redis=require(_0x2dc6('0xf'));var authService=require(_0x2dc6('0x10'));var qs=require(_0x2dc6('0x11'));var as=require(_0x2dc6('0x12'));var hardwareService=require(_0x2dc6('0x13'));var logger=require(_0x2dc6('0x14'))('api');var utils=require(_0x2dc6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2dc6('0x16'));var db=require(_0x2dc6('0x17'))['db'];function respondWithStatusCode(_0x5960d6,_0xaf2481){_0xaf2481=_0xaf2481||0xcc;return function(_0x211b6a){if(_0x211b6a){return _0x5960d6[_0x2dc6('0x18')](_0xaf2481);}return _0x5960d6[_0x2dc6('0x19')](_0xaf2481)[_0x2dc6('0x1a')]();};}function respondWithResult(_0x365420,_0x5ca4a6){_0x5ca4a6=_0x5ca4a6||0xc8;return function(_0x4c1708){if(_0x4c1708){return _0x365420['status'](_0x5ca4a6)['json'](_0x4c1708);}};}function respondWithFilteredResult(_0x4a76de,_0x31ccf3){return function(_0x57d5df){if(_0x57d5df){var _0x183831=typeof _0x31ccf3[_0x2dc6('0x1b')]===_0x2dc6('0x1c')&&typeof _0x31ccf3[_0x2dc6('0x1d')]===_0x2dc6('0x1c');var _0x327c26=_0x57d5df[_0x2dc6('0x1e')];var _0x17ea44=_0x183831?0x0:_0x31ccf3[_0x2dc6('0x1b')];var _0x2e5f4b=_0x183831?_0x57d5df[_0x2dc6('0x1e')]:_0x31ccf3[_0x2dc6('0x1b')]+_0x31ccf3[_0x2dc6('0x1d')];var _0x115f07;if(_0x2e5f4b>=_0x327c26){_0x2e5f4b=_0x327c26;_0x115f07=0xc8;}else{_0x115f07=0xce;}_0x4a76de[_0x2dc6('0x19')](_0x115f07);return _0x4a76de[_0x2dc6('0x1f')](_0x2dc6('0x20'),_0x17ea44+'-'+_0x2e5f4b+'/'+_0x327c26)[_0x2dc6('0x21')](_0x57d5df);}return null;};}function patchUpdates(_0x4f017f){return function(_0x1114ac){try{jsonpatch[_0x2dc6('0x22')](_0x1114ac,_0x4f017f,!![]);}catch(_0xb12101){return BPromise[_0x2dc6('0x23')](_0xb12101);}return _0x1114ac[_0x2dc6('0x24')]();};}function saveUpdates(_0x4290a8,_0x42ff60){return function(_0x4b6550){if(_0x4b6550){return _0x4b6550[_0x2dc6('0x25')](_0x4290a8)['then'](function(_0x2bb3e2){return _0x2bb3e2;});}return null;};}function removeEntity(_0x37cb9e,_0x1562e2){return function(_0x2f73cf){if(_0x2f73cf){return _0x2f73cf[_0x2dc6('0x26')]()[_0x2dc6('0x27')](function(){var _0x26938b=_0x2f73cf[_0x2dc6('0x28')]({'plain':!![]});var _0x3f6cca=_0x2dc6('0x29');return db['UserProfileResource'][_0x2dc6('0x26')]({'where':{'type':_0x3f6cca,'resourceId':_0x26938b['id']}})[_0x2dc6('0x27')](function(){return _0x2f73cf;});})[_0x2dc6('0x27')](function(){_0x37cb9e['status'](0xcc)[_0x2dc6('0x1a')]();});}};}function handleEntityNotFound(_0x5993c6,_0x7eaa){return function(_0x5d7a3a){if(!_0x5d7a3a){_0x5993c6[_0x2dc6('0x18')](0x194);}return _0x5d7a3a;};}function handleError(_0x301794,_0x21a245){_0x21a245=_0x21a245||0x1f4;return function(_0x33031b){logger[_0x2dc6('0x2a')](_0x33031b[_0x2dc6('0x2b')]);if(_0x33031b[_0x2dc6('0x2c')]){delete _0x33031b[_0x2dc6('0x2c')];}_0x301794[_0x2dc6('0x19')](_0x21a245)['send'](_0x33031b);};}exports[_0x2dc6('0x2d')]=function(_0x3613ac,_0x1197e5){var _0x5b76d7={},_0x387eb7={},_0x7cd405={'count':0x0,'rows':[]};var _0x56ff71=_[_0x2dc6('0x2e')](db['AnalyticExtractedReport'][_0x2dc6('0x2f')],function(_0x13b8bf){return{'name':_0x13b8bf['fieldName'],'type':_0x13b8bf[_0x2dc6('0x30')][_0x2dc6('0x31')]};});_0x387eb7['model']=_[_0x2dc6('0x2e')](_0x56ff71,_0x2dc6('0x2c'));_0x387eb7[_0x2dc6('0x32')]=_[_0x2dc6('0x33')](_0x3613ac[_0x2dc6('0x32')]);_0x387eb7[_0x2dc6('0x34')]=_[_0x2dc6('0x35')](_0x387eb7[_0x2dc6('0x36')],_0x387eb7[_0x2dc6('0x32')]);_0x5b76d7['attributes']=_[_0x2dc6('0x35')](_0x387eb7[_0x2dc6('0x36')],qs[_0x2dc6('0x37')](_0x3613ac['query'][_0x2dc6('0x37')]));_0x5b76d7[_0x2dc6('0x38')]=_0x5b76d7[_0x2dc6('0x38')]['length']?_0x5b76d7[_0x2dc6('0x38')]:_0x387eb7[_0x2dc6('0x36')];if(!_0x3613ac[_0x2dc6('0x32')][_0x2dc6('0x39')](_0x2dc6('0x3a'))){_0x5b76d7[_0x2dc6('0x1d')]=qs[_0x2dc6('0x1d')](_0x3613ac[_0x2dc6('0x32')]['limit']);_0x5b76d7[_0x2dc6('0x1b')]=qs['offset'](_0x3613ac[_0x2dc6('0x32')][_0x2dc6('0x1b')]);}_0x5b76d7[_0x2dc6('0x3b')]=qs[_0x2dc6('0x3c')](_0x3613ac[_0x2dc6('0x32')][_0x2dc6('0x3c')]);_0x5b76d7[_0x2dc6('0x3d')]=qs[_0x2dc6('0x34')](_[_0x2dc6('0x3e')](_0x3613ac[_0x2dc6('0x32')],_0x387eb7['filters']),_0x56ff71);if(_0x3613ac[_0x2dc6('0x32')][_0x2dc6('0x3f')]){_0x5b76d7[_0x2dc6('0x3d')]=_[_0x2dc6('0x40')](_0x5b76d7[_0x2dc6('0x3d')],{'$or':_['map'](_0x56ff71,function(_0x16b44d){if(_0x16b44d[_0x2dc6('0x30')]!==_0x2dc6('0x41')){var _0x238e4d={};_0x238e4d[_0x16b44d[_0x2dc6('0x2c')]]={'$like':'%'+_0x3613ac[_0x2dc6('0x32')][_0x2dc6('0x3f')]+'%'};return _0x238e4d;}})});}_0x5b76d7=_[_0x2dc6('0x40')]({},_0x5b76d7,_0x3613ac[_0x2dc6('0x42')]);var _0x409ac6={'where':_0x5b76d7[_0x2dc6('0x3d')]};return db[_0x2dc6('0x43')]['count'](_0x409ac6)[_0x2dc6('0x27')](function(_0x550792){_0x7cd405[_0x2dc6('0x1e')]=_0x550792;if(_0x3613ac[_0x2dc6('0x32')][_0x2dc6('0x44')]){_0x5b76d7[_0x2dc6('0x45')]=[{'all':!![]}];}return db[_0x2dc6('0x43')][_0x2dc6('0x46')](_0x5b76d7);})[_0x2dc6('0x27')](function(_0x38941c){_0x7cd405[_0x2dc6('0x47')]=_0x38941c;return _0x7cd405;})[_0x2dc6('0x27')](respondWithFilteredResult(_0x1197e5,_0x5b76d7))[_0x2dc6('0x48')](handleError(_0x1197e5,null));};exports['show']=function(_0x1ab9e1,_0x3b4779){var _0x29f039={'raw':!![],'where':{'id':_0x1ab9e1[_0x2dc6('0x49')]['id']}},_0x48b410={};_0x48b410['model']=_[_0x2dc6('0x33')](db['AnalyticExtractedReport'][_0x2dc6('0x2f')]);_0x48b410[_0x2dc6('0x32')]=_['keys'](_0x1ab9e1[_0x2dc6('0x32')]);_0x48b410[_0x2dc6('0x34')]=_[_0x2dc6('0x35')](_0x48b410[_0x2dc6('0x36')],_0x48b410[_0x2dc6('0x32')]);_0x29f039[_0x2dc6('0x38')]=_[_0x2dc6('0x35')](_0x48b410[_0x2dc6('0x36')],qs['fields'](_0x1ab9e1[_0x2dc6('0x32')][_0x2dc6('0x37')]));_0x29f039[_0x2dc6('0x38')]=_0x29f039[_0x2dc6('0x38')][_0x2dc6('0x4a')]?_0x29f039[_0x2dc6('0x38')]:_0x48b410['model'];if(_0x1ab9e1[_0x2dc6('0x32')]['includeAll']){_0x29f039[_0x2dc6('0x45')]=[{'all':!![]}];}_0x29f039=_[_0x2dc6('0x40')]({},_0x29f039,_0x1ab9e1['options']);return db['AnalyticExtractedReport']['find'](_0x29f039)[_0x2dc6('0x27')](handleEntityNotFound(_0x3b4779,null))[_0x2dc6('0x27')](respondWithResult(_0x3b4779,null))[_0x2dc6('0x48')](handleError(_0x3b4779,null));};exports[_0x2dc6('0x4b')]=function(_0x39d801,_0x533ec6){return db[_0x2dc6('0x43')]['create'](_0x39d801[_0x2dc6('0x4c')],{})[_0x2dc6('0x27')](function(_0x2b6121){var _0xb7f6c7=_0x39d801[_0x2dc6('0x4d')][_0x2dc6('0x28')]({'plain':!![]});if(!_0xb7f6c7)throw new Error(_0x2dc6('0x4e'));if(_0xb7f6c7['role']===_0x2dc6('0x4d')){var _0x439832=_0x2b6121[_0x2dc6('0x28')]({'plain':!![]});var _0x24ee92='ExtractedReports';return db['UserProfileSection'][_0x2dc6('0x4f')]({'where':{'name':_0x24ee92,'userProfileId':_0xb7f6c7[_0x2dc6('0x50')]},'raw':!![]})[_0x2dc6('0x27')](function(_0x4e53c8){if(_0x4e53c8&&_0x4e53c8[_0x2dc6('0x51')]===0x0){return db['UserProfileResource'][_0x2dc6('0x4b')]({'name':_0x439832['name'],'resourceId':_0x439832['id'],'type':_0x4e53c8[_0x2dc6('0x2c')],'sectionId':_0x4e53c8['id']},{})[_0x2dc6('0x27')](function(){return _0x2b6121;});}else{return _0x2b6121;}})[_0x2dc6('0x48')](function(_0x50b0d1){logger[_0x2dc6('0x2a')](_0x2dc6('0x52'),_0x50b0d1);throw _0x50b0d1;});}return _0x2b6121;})['then'](respondWithResult(_0x533ec6,0xc9))[_0x2dc6('0x48')](handleError(_0x533ec6,null));};exports['update']=function(_0xd84e5a,_0x54f7e6){if(_0xd84e5a[_0x2dc6('0x4c')]['id']){delete _0xd84e5a['body']['id'];}return db[_0x2dc6('0x43')][_0x2dc6('0x4f')]({'where':{'id':_0xd84e5a[_0x2dc6('0x49')]['id']}})[_0x2dc6('0x27')](handleEntityNotFound(_0x54f7e6,null))[_0x2dc6('0x27')](saveUpdates(_0xd84e5a[_0x2dc6('0x4c')],null))[_0x2dc6('0x27')](respondWithResult(_0x54f7e6,null))['catch'](handleError(_0x54f7e6,null));};exports[_0x2dc6('0x26')]=function(_0x2f915a,_0x106b0b){return db['AnalyticExtractedReport'][_0x2dc6('0x4f')]({'where':{'id':_0x2f915a[_0x2dc6('0x49')]['id']}})['then'](handleEntityNotFound(_0x106b0b,null))[_0x2dc6('0x27')](removeEntity(_0x106b0b,null))[_0x2dc6('0x48')](handleError(_0x106b0b,null));};exports[_0x2dc6('0x53')]=function(_0x391bc6,_0x39509e,_0x206d49){return db[_0x2dc6('0x43')][_0x2dc6('0x4f')]({'where':{'id':_0x391bc6[_0x2dc6('0x49')]['id']},'attributes':['name',_0x2dc6('0x54'),_0x2dc6('0x55'),_0x2dc6('0x56')],'raw':!![]})[_0x2dc6('0x27')](handleEntityNotFound(_0x39509e,null))[_0x2dc6('0x27')](function(_0x5432ad){if(_0x5432ad){if(!fs[_0x2dc6('0x57')](path[_0x2dc6('0x58')](config[_0x2dc6('0x59')],_0x2dc6('0x5a'),_0x5432ad[_0x2dc6('0x55')]))){throw new db[(_0x2dc6('0x5b'))][(_0x2dc6('0x5c'))](_0x2dc6('0x5d'));}if(_0x391bc6[_0x2dc6('0x32')][_0x2dc6('0x5e')]){return _0x39509e[_0x2dc6('0x18')](0xc8);}return _0x39509e['download'](path['join'](config[_0x2dc6('0x59')],_0x2dc6('0x5a'),_0x5432ad[_0x2dc6('0x55')]),util[_0x2dc6('0x5f')](_0x2dc6('0x60'),_0x5432ad['basename']||_0x5432ad[_0x2dc6('0x2c')],_0x5432ad[_0x2dc6('0x56')][_0x2dc6('0x61')]()));}})['catch'](handleError(_0x39509e,null));};
\ No newline at end of file
+var _0x4a81=['fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','length','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','format','%s.%s','basename','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','ExtractedReports','UserProfileResource','end','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes'];(function(_0x2301b4,_0x2ef5b0){var _0x12da2b=function(_0xee491e){while(--_0xee491e){_0x2301b4['push'](_0x2301b4['shift']());}};_0x12da2b(++_0x2ef5b0);}(_0x4a81,0x1b6));var _0x14a8=function(_0x1d2db6,_0x122a80){_0x1d2db6=_0x1d2db6-0x0;var _0x56c5cf=_0x4a81[_0x1d2db6];return _0x56c5cf;};'use strict';var emlformat=require(_0x14a8('0x0'));var rimraf=require(_0x14a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x14a8('0x2'));var rp=require(_0x14a8('0x3'));var moment=require('moment');var BPromise=require(_0x14a8('0x4'));var Mustache=require(_0x14a8('0x5'));var util=require(_0x14a8('0x6'));var path=require(_0x14a8('0x7'));var sox=require(_0x14a8('0x8'));var csv=require('to-csv');var ejs=require(_0x14a8('0x9'));var fs=require('fs');var fs_extra=require(_0x14a8('0xa'));var _=require(_0x14a8('0xb'));var squel=require('squel');var crypto=require(_0x14a8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x14a8('0xd'));var toCsv=require(_0x14a8('0xe'));var querystring=require(_0x14a8('0xf'));var Papa=require(_0x14a8('0x10'));var Redis=require(_0x14a8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x14a8('0x12'));var as=require(_0x14a8('0x13'));var hardwareService=require(_0x14a8('0x14'));var logger=require(_0x14a8('0x15'))(_0x14a8('0x16'));var utils=require(_0x14a8('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x426d8b,_0x26de95){_0x26de95=_0x26de95||0xcc;return function(_0x3c63d8){if(_0x3c63d8){return _0x426d8b[_0x14a8('0x18')](_0x26de95);}return _0x426d8b[_0x14a8('0x19')](_0x26de95)['end']();};}function respondWithResult(_0x1fe8b5,_0x594e02){_0x594e02=_0x594e02||0xc8;return function(_0x4b2b4e){if(_0x4b2b4e){return _0x1fe8b5[_0x14a8('0x19')](_0x594e02)[_0x14a8('0x1a')](_0x4b2b4e);}};}function respondWithFilteredResult(_0xbaffcc,_0x38865c){return function(_0x3272c1){if(_0x3272c1){var _0x38874f=typeof _0x38865c['offset']===_0x14a8('0x1b')&&typeof _0x38865c['limit']===_0x14a8('0x1b');var _0x9bf079=_0x3272c1[_0x14a8('0x1c')];var _0x42b17c=_0x38874f?0x0:_0x38865c[_0x14a8('0x1d')];var _0x40b227=_0x38874f?_0x3272c1[_0x14a8('0x1c')]:_0x38865c[_0x14a8('0x1d')]+_0x38865c['limit'];var _0x252043;if(_0x40b227>=_0x9bf079){_0x40b227=_0x9bf079;_0x252043=0xc8;}else{_0x252043=0xce;}_0xbaffcc[_0x14a8('0x19')](_0x252043);return _0xbaffcc[_0x14a8('0x1e')](_0x14a8('0x1f'),_0x42b17c+'-'+_0x40b227+'/'+_0x9bf079)['json'](_0x3272c1);}return null;};}function patchUpdates(_0x52a282){return function(_0x458683){try{jsonpatch[_0x14a8('0x20')](_0x458683,_0x52a282,!![]);}catch(_0x5b4156){return BPromise[_0x14a8('0x21')](_0x5b4156);}return _0x458683[_0x14a8('0x22')]();};}function saveUpdates(_0x470b92,_0x16ce61){return function(_0x43c7cf){if(_0x43c7cf){return _0x43c7cf[_0x14a8('0x23')](_0x470b92)['then'](function(_0xa0954){return _0xa0954;});}return null;};}function removeEntity(_0x4ca6e9,_0x1a5969){return function(_0x30de37){if(_0x30de37){return _0x30de37[_0x14a8('0x24')]()[_0x14a8('0x25')](function(){var _0x20275e=_0x30de37[_0x14a8('0x26')]({'plain':!![]});var _0x1e2b64=_0x14a8('0x27');return db[_0x14a8('0x28')][_0x14a8('0x24')]({'where':{'type':_0x1e2b64,'resourceId':_0x20275e['id']}})[_0x14a8('0x25')](function(){return _0x30de37;});})[_0x14a8('0x25')](function(){_0x4ca6e9[_0x14a8('0x19')](0xcc)[_0x14a8('0x29')]();});}};}function handleEntityNotFound(_0x2a4799,_0x23fea3){return function(_0x1e8d91){if(!_0x1e8d91){_0x2a4799['sendStatus'](0x194);}return _0x1e8d91;};}function handleError(_0x2c2931,_0x38b2e5){_0x38b2e5=_0x38b2e5||0x1f4;return function(_0x3072b8){logger['error'](_0x3072b8[_0x14a8('0x2a')]);if(_0x3072b8['name']){delete _0x3072b8[_0x14a8('0x2b')];}_0x2c2931['status'](_0x38b2e5)[_0x14a8('0x2c')](_0x3072b8);};}exports[_0x14a8('0x2d')]=function(_0x5339e3,_0x4e70c9){var _0x195f82={},_0x14fdf3={},_0x4a5a58={'count':0x0,'rows':[]};var _0x5bedb2=_[_0x14a8('0x2e')](db[_0x14a8('0x2f')][_0x14a8('0x30')],function(_0x5e7c3b){return{'name':_0x5e7c3b[_0x14a8('0x31')],'type':_0x5e7c3b[_0x14a8('0x32')]['key']};});_0x14fdf3[_0x14a8('0x33')]=_['map'](_0x5bedb2,_0x14a8('0x2b'));_0x14fdf3[_0x14a8('0x34')]=_[_0x14a8('0x35')](_0x5339e3['query']);_0x14fdf3[_0x14a8('0x36')]=_[_0x14a8('0x37')](_0x14fdf3[_0x14a8('0x33')],_0x14fdf3[_0x14a8('0x34')]);_0x195f82[_0x14a8('0x38')]=_['intersection'](_0x14fdf3[_0x14a8('0x33')],qs[_0x14a8('0x39')](_0x5339e3['query'][_0x14a8('0x39')]));_0x195f82[_0x14a8('0x38')]=_0x195f82[_0x14a8('0x38')]['length']?_0x195f82[_0x14a8('0x38')]:_0x14fdf3[_0x14a8('0x33')];if(!_0x5339e3[_0x14a8('0x34')][_0x14a8('0x3a')](_0x14a8('0x3b'))){_0x195f82[_0x14a8('0x3c')]=qs[_0x14a8('0x3c')](_0x5339e3[_0x14a8('0x34')]['limit']);_0x195f82['offset']=qs[_0x14a8('0x1d')](_0x5339e3[_0x14a8('0x34')][_0x14a8('0x1d')]);}_0x195f82[_0x14a8('0x3d')]=qs[_0x14a8('0x3e')](_0x5339e3[_0x14a8('0x34')][_0x14a8('0x3e')]);_0x195f82['where']=qs[_0x14a8('0x36')](_['pick'](_0x5339e3['query'],_0x14fdf3['filters']),_0x5bedb2);if(_0x5339e3[_0x14a8('0x34')]['filter']){_0x195f82[_0x14a8('0x3f')]=_[_0x14a8('0x40')](_0x195f82[_0x14a8('0x3f')],{'$or':_[_0x14a8('0x2e')](_0x5bedb2,function(_0x727302){if(_0x727302[_0x14a8('0x32')]!==_0x14a8('0x41')){var _0xb45ee5={};_0xb45ee5[_0x727302[_0x14a8('0x2b')]]={'$like':'%'+_0x5339e3[_0x14a8('0x34')][_0x14a8('0x42')]+'%'};return _0xb45ee5;}})});}_0x195f82=_[_0x14a8('0x40')]({},_0x195f82,_0x5339e3[_0x14a8('0x43')]);var _0x501f70={'where':_0x195f82['where']};return db['AnalyticExtractedReport'][_0x14a8('0x1c')](_0x501f70)[_0x14a8('0x25')](function(_0x2c28d6){_0x4a5a58[_0x14a8('0x1c')]=_0x2c28d6;if(_0x5339e3[_0x14a8('0x34')]['includeAll']){_0x195f82[_0x14a8('0x44')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x14a8('0x45')](_0x195f82);})[_0x14a8('0x25')](function(_0x15122d){_0x4a5a58[_0x14a8('0x46')]=_0x15122d;return _0x4a5a58;})[_0x14a8('0x25')](respondWithFilteredResult(_0x4e70c9,_0x195f82))['catch'](handleError(_0x4e70c9,null));};exports[_0x14a8('0x47')]=function(_0x29b11d,_0x3c384e){var _0x28ed6e={'raw':!![],'where':{'id':_0x29b11d[_0x14a8('0x48')]['id']}},_0x1d49ca={};_0x1d49ca[_0x14a8('0x33')]=_['keys'](db[_0x14a8('0x2f')][_0x14a8('0x30')]);_0x1d49ca[_0x14a8('0x34')]=_[_0x14a8('0x35')](_0x29b11d[_0x14a8('0x34')]);_0x1d49ca[_0x14a8('0x36')]=_[_0x14a8('0x37')](_0x1d49ca['model'],_0x1d49ca[_0x14a8('0x34')]);_0x28ed6e[_0x14a8('0x38')]=_[_0x14a8('0x37')](_0x1d49ca[_0x14a8('0x33')],qs[_0x14a8('0x39')](_0x29b11d[_0x14a8('0x34')][_0x14a8('0x39')]));_0x28ed6e[_0x14a8('0x38')]=_0x28ed6e[_0x14a8('0x38')][_0x14a8('0x49')]?_0x28ed6e[_0x14a8('0x38')]:_0x1d49ca['model'];if(_0x29b11d[_0x14a8('0x34')][_0x14a8('0x4a')]){_0x28ed6e[_0x14a8('0x44')]=[{'all':!![]}];}_0x28ed6e=_[_0x14a8('0x40')]({},_0x28ed6e,_0x29b11d[_0x14a8('0x43')]);return db['AnalyticExtractedReport'][_0x14a8('0x4b')](_0x28ed6e)[_0x14a8('0x25')](handleEntityNotFound(_0x3c384e,null))[_0x14a8('0x25')](respondWithResult(_0x3c384e,null))[_0x14a8('0x4c')](handleError(_0x3c384e,null));};exports[_0x14a8('0x4d')]=function(_0x57c88d,_0x4086b6){return db['AnalyticExtractedReport']['create'](_0x57c88d[_0x14a8('0x4e')],{})['then'](function(_0x57e4bb){var _0x36b5c2=_0x57c88d['user'][_0x14a8('0x26')]({'plain':!![]});if(!_0x36b5c2)throw new Error(_0x14a8('0x4f'));if(_0x36b5c2[_0x14a8('0x50')]===_0x14a8('0x51')){var _0x50d80d=_0x57e4bb['get']({'plain':!![]});var _0x4ef635=_0x14a8('0x27');return db[_0x14a8('0x52')][_0x14a8('0x4b')]({'where':{'name':_0x4ef635,'userProfileId':_0x36b5c2[_0x14a8('0x53')]},'raw':!![]})['then'](function(_0x645536){if(_0x645536&&_0x645536[_0x14a8('0x54')]===0x0){return db[_0x14a8('0x28')][_0x14a8('0x4d')]({'name':_0x50d80d['name'],'resourceId':_0x50d80d['id'],'type':_0x645536['name'],'sectionId':_0x645536['id']},{})[_0x14a8('0x25')](function(){return _0x57e4bb;});}else{return _0x57e4bb;}})['catch'](function(_0x306a21){logger[_0x14a8('0x55')](_0x14a8('0x56'),_0x306a21);throw _0x306a21;});}return _0x57e4bb;})[_0x14a8('0x25')](respondWithResult(_0x4086b6,0xc9))[_0x14a8('0x4c')](handleError(_0x4086b6,null));};exports['update']=function(_0x57b348,_0x597a25){if(_0x57b348[_0x14a8('0x4e')]['id']){delete _0x57b348[_0x14a8('0x4e')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x57b348[_0x14a8('0x48')]['id']}})[_0x14a8('0x25')](handleEntityNotFound(_0x597a25,null))['then'](saveUpdates(_0x57b348[_0x14a8('0x4e')],null))[_0x14a8('0x25')](respondWithResult(_0x597a25,null))[_0x14a8('0x4c')](handleError(_0x597a25,null));};exports[_0x14a8('0x24')]=function(_0x5e0033,_0x99eb09){return db[_0x14a8('0x2f')][_0x14a8('0x4b')]({'where':{'id':_0x5e0033[_0x14a8('0x48')]['id']}})[_0x14a8('0x25')](handleEntityNotFound(_0x99eb09,null))[_0x14a8('0x25')](removeEntity(_0x99eb09,null))['catch'](handleError(_0x99eb09,null));};exports[_0x14a8('0x57')]=function(_0x39ab3,_0x3ea510,_0x20583b){return db[_0x14a8('0x2f')][_0x14a8('0x4b')]({'where':{'id':_0x39ab3[_0x14a8('0x48')]['id']},'attributes':['name','basename',_0x14a8('0x58'),_0x14a8('0x59')],'raw':!![]})[_0x14a8('0x25')](handleEntityNotFound(_0x3ea510,null))['then'](function(_0x226b15){if(_0x226b15){if(!fs[_0x14a8('0x5a')](path[_0x14a8('0x5b')](config[_0x14a8('0x5c')],_0x14a8('0x5d'),_0x226b15['savename']))){throw new db[(_0x14a8('0x5e'))]['ValidationError'](_0x14a8('0x5f'));}if(_0x39ab3[_0x14a8('0x34')]['exists']){return _0x3ea510['sendStatus'](0xc8);}return _0x3ea510[_0x14a8('0x57')](path[_0x14a8('0x5b')](config[_0x14a8('0x5c')],_0x14a8('0x5d'),_0x226b15[_0x14a8('0x58')]),util[_0x14a8('0x60')](_0x14a8('0x61'),_0x226b15[_0x14a8('0x62')]||_0x226b15[_0x14a8('0x2b')],_0x226b15[_0x14a8('0x59')]['toLowerCase']()));}})[_0x14a8('0x4c')](handleError(_0x3ea510,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index a9cc9d7..32d55bf 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 _0xc778=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','lodash'];(function(_0x3d13f9,_0x1ecb29){var _0x31de36=function(_0x7ca6fa){while(--_0x7ca6fa){_0x3d13f9['push'](_0x3d13f9['shift']());}};_0x31de36(++_0x1ecb29);}(_0xc778,0x154));var _0x8c77=function(_0x1a92a8,_0x2a87fc){_0x1a92a8=_0x1a92a8-0x0;var _0x364edd=_0xc778[_0x1a92a8];return _0x364edd;};'use strict';var _=require(_0x8c77('0x0'));var util=require(_0x8c77('0x1'));var logger=require(_0x8c77('0x2'))(_0x8c77('0x3'));var moment=require('moment');var BPromise=require(_0x8c77('0x4'));var rp=require(_0x8c77('0x5'));var fs=require('fs');var path=require(_0x8c77('0x6'));var rimraf=require(_0x8c77('0x7'));var config=require(_0x8c77('0x8'));var attributes=require(_0x8c77('0x9'));module['exports']=function(_0x102b7b,_0x6cc34){return _0x102b7b[_0x8c77('0xa')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xff16=['moment','bluebird','request-promise','../../config/environment','define','analytics_extracted_reports','lodash','util','../../config/logger'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0xff16,0x84));var _0x6ff1=function(_0xf6aae8,_0x671881){_0xf6aae8=_0xf6aae8-0x0;var _0xc27a8e=_0xff16[_0xf6aae8];return _0xc27a8e;};'use strict';var _=require(_0x6ff1('0x0'));var util=require(_0x6ff1('0x1'));var logger=require(_0x6ff1('0x2'))('api');var moment=require(_0x6ff1('0x3'));var BPromise=require(_0x6ff1('0x4'));var rp=require(_0x6ff1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6ff1('0x6'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x57b799,_0x34c857){return _0x57b799[_0x6ff1('0x7')]('AnalyticExtractedReport',attributes,{'tableName':_0x6ff1('0x8'),'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 8a3d4e6..b25c144 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 _0x32f4=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result'];(function(_0x3c1332,_0x2aa3e7){var _0x46134b=function(_0x3cc6c5){while(--_0x3cc6c5){_0x3c1332['push'](_0x3c1332['shift']());}};_0x46134b(++_0x2aa3e7);}(_0x32f4,0x168));var _0x432f=function(_0x1b4ed8,_0x2d8f2e){_0x1b4ed8=_0x1b4ed8-0x0;var _0x588fc5=_0x32f4[_0x1b4ed8];return _0x588fc5;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));var BPromise=require(_0x432f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x432f('0x4'));var db=require(_0x432f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x432f('0x6'))(_0x432f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x432f('0x8')][_0x432f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13bb6b,_0x4446d1,_0x2fc386){return new BPromise(function(_0x28bebc,_0x3855d7){return client[_0x432f('0xa')](_0x13bb6b,_0x2fc386)['then'](function(_0x359de0){logger['info'](_0x432f('0xb'),_0x4446d1,_0x432f('0xc'));logger[_0x432f('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x4446d1,'request\x20sent',JSON[_0x432f('0xe')](_0x359de0));if(_0x359de0[_0x432f('0xf')]){if(_0x359de0['error'][_0x432f('0x10')]===0x1f4){logger[_0x432f('0xf')](_0x432f('0xb'),_0x4446d1,_0x359de0[_0x432f('0xf')][_0x432f('0x11')]);return _0x3855d7(_0x359de0[_0x432f('0xf')]['message']);}logger['error'](_0x432f('0xb'),_0x4446d1,_0x359de0[_0x432f('0xf')][_0x432f('0x11')]);return _0x28bebc(_0x359de0[_0x432f('0xf')][_0x432f('0x11')]);}else{logger[_0x432f('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4446d1,_0x432f('0xc'));_0x28bebc(_0x359de0[_0x432f('0x13')][_0x432f('0x11')]);}})['catch'](function(_0x22eba3){logger['error'](_0x432f('0xb'),_0x4446d1,_0x22eba3);_0x3855d7(_0x22eba3);});});}
\ No newline at end of file
+var _0xe6fa=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3bf194,_0x342216){var _0x105954=function(_0x40732d){while(--_0x40732d){_0x3bf194['push'](_0x3bf194['shift']());}};_0x105954(++_0x342216);}(_0xe6fa,0x154));var _0xae6f=function(_0x3bf1e0,_0x1580be){_0x3bf1e0=_0x3bf1e0-0x0;var _0x5a9ded=_0xe6fa[_0x3bf1e0];return _0x5a9ded;};'use strict';var _=require(_0xae6f('0x0'));var util=require(_0xae6f('0x1'));var moment=require('moment');var BPromise=require(_0xae6f('0x2'));var rs=require(_0xae6f('0x3'));var fs=require('fs');var Redis=require(_0xae6f('0x4'));var db=require(_0xae6f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xae6f('0x6'))(_0xae6f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae6f('0x8')][_0xae6f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16d124,_0x555526,_0x23c5cb){return new BPromise(function(_0x324df9,_0x1ec178){return client[_0xae6f('0xa')](_0x16d124,_0x23c5cb)[_0xae6f('0xb')](function(_0xd163b9){logger[_0xae6f('0xc')](_0xae6f('0xd'),_0x555526,_0xae6f('0xe'));logger['debug'](_0xae6f('0xf'),_0x555526,_0xae6f('0xe'),JSON[_0xae6f('0x10')](_0xd163b9));if(_0xd163b9[_0xae6f('0x11')]){if(_0xd163b9[_0xae6f('0x11')][_0xae6f('0x12')]===0x1f4){logger[_0xae6f('0x11')](_0xae6f('0xd'),_0x555526,_0xd163b9[_0xae6f('0x11')][_0xae6f('0x13')]);return _0x1ec178(_0xd163b9[_0xae6f('0x11')][_0xae6f('0x13')]);}logger[_0xae6f('0x11')](_0xae6f('0xd'),_0x555526,_0xd163b9[_0xae6f('0x11')][_0xae6f('0x13')]);return _0x324df9(_0xd163b9['error'][_0xae6f('0x13')]);}else{logger['info'](_0xae6f('0xd'),_0x555526,'request\x20sent');_0x324df9(_0xd163b9['result'][_0xae6f('0x13')]);}})['catch'](function(_0x262cdd){logger[_0xae6f('0x11')](_0xae6f('0xd'),_0x555526,_0x262cdd);_0x1ec178(_0x262cdd);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index ef666ae..274f916 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 _0x6da8=['index','get','/:id','show','download','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3ab848,_0x176c4e){var _0x5d89d3=function(_0x8ebdc4){while(--_0x8ebdc4){_0x3ab848['push'](_0x3ab848['shift']());}};_0x5d89d3(++_0x176c4e);}(_0x6da8,0x161));var _0x86da=function(_0x568cd1,_0xbc6010){_0x568cd1=_0x568cd1-0x0;var _0x1d9654=_0x6da8[_0x568cd1];return _0x1d9654;};'use strict';var multer=require(_0x86da('0x0'));var util=require('util');var path=require(_0x86da('0x1'));var timeout=require('connect-timeout');var express=require(_0x86da('0x2'));var router=express[_0x86da('0x3')]();var fs_extra=require(_0x86da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x86da('0x5'));var config=require(_0x86da('0x6'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x86da('0x7')]);router[_0x86da('0x8')](_0x86da('0x9'),auth['isAuthenticated'](),controller[_0x86da('0xa')]);router[_0x86da('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x86da('0xb')]);router[_0x86da('0xc')]('/',auth[_0x86da('0xd')](),controller[_0x86da('0xe')]);router[_0x86da('0xf')](_0x86da('0x9'),auth[_0x86da('0xd')](),controller[_0x86da('0x10')]);router[_0x86da('0x11')](_0x86da('0x9'),auth[_0x86da('0xd')](),controller[_0x86da('0x12')]);module[_0x86da('0x13')]=router;
\ No newline at end of file
+var _0xc2dd=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','/:id','show','get','/:id/download','download','post','create','put','update','delete','destroy'];(function(_0x3d6f21,_0x757536){var _0x1e1421=function(_0x83f673){while(--_0x83f673){_0x3d6f21['push'](_0x3d6f21['shift']());}};_0x1e1421(++_0x757536);}(_0xc2dd,0xea));var _0xdc2d=function(_0x3cef1d,_0x43d39e){_0x3cef1d=_0x3cef1d-0x0;var _0x5b8d25=_0xc2dd[_0x3cef1d];return _0x5b8d25;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdc2d('0x0'));var timeout=require(_0xdc2d('0x1'));var express=require(_0xdc2d('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdc2d('0x3'));var interaction=require(_0xdc2d('0x4'));var config=require('../../config/environment');var controller=require(_0xdc2d('0x5'));router['get']('/',auth[_0xdc2d('0x6')](),controller['index']);router['get'](_0xdc2d('0x7'),auth[_0xdc2d('0x6')](),controller[_0xdc2d('0x8')]);router[_0xdc2d('0x9')](_0xdc2d('0xa'),auth[_0xdc2d('0x6')](),controller[_0xdc2d('0xb')]);router[_0xdc2d('0xc')]('/',auth[_0xdc2d('0x6')](),controller[_0xdc2d('0xd')]);router[_0xdc2d('0xe')](_0xdc2d('0x7'),auth[_0xdc2d('0x6')](),controller[_0xdc2d('0xf')]);router[_0xdc2d('0x10')](_0xdc2d('0x7'),auth['isAuthenticated'](),controller[_0xdc2d('0x11')]);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 7b08dd4..3caa0b8 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 _0x5c0e=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x77a3cc,_0x2b8152){var _0x4068f0=function(_0x2d39d2){while(--_0x2d39d2){_0x77a3cc['push'](_0x77a3cc['shift']());}};_0x4068f0(++_0x2b8152);}(_0x5c0e,0xaf));var _0xe5c0=function(_0x2c944e,_0x26f659){_0x2c944e=_0x2c944e-0x0;var _0x2cc529=_0x5c0e[_0x2c944e];return _0x2cc529;};'use strict';var Sequelize=require(_0xe5c0('0x0'));module[_0xe5c0('0x1')]={'field':{'type':Sequelize[_0xe5c0('0x2')]},'alias':{'type':Sequelize[_0xe5c0('0x3')]},'function':{'type':Sequelize[_0xe5c0('0x3')]},'format':{'type':Sequelize[_0xe5c0('0x3')]},'groupBy':{'type':Sequelize[_0xe5c0('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x0ee6=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x30cc80,_0xf1b9f){var _0x478d83=function(_0x391bd7){while(--_0x391bd7){_0x30cc80['push'](_0x30cc80['shift']());}};_0x478d83(++_0xf1b9f);}(_0x0ee6,0x6e));var _0x60ee=function(_0x57e08f,_0x275d98){_0x57e08f=_0x57e08f-0x0;var _0x43e004=_0x0ee6[_0x57e08f];return _0x43e004;};'use strict';var Sequelize=require(_0x60ee('0x0'));module[_0x60ee('0x1')]={'field':{'type':Sequelize[_0x60ee('0x2')]},'alias':{'type':Sequelize[_0x60ee('0x3')]},'function':{'type':Sequelize[_0x60ee('0x3')]},'format':{'type':Sequelize[_0x60ee('0x3')]},'groupBy':{'type':Sequelize[_0x60ee('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'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 5a68798..230848f 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 _0xfbba=['query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','AnalyticFieldReport','include','catch','show','keys','includeAll','create','body','bulkCreate','find','addFields','findOne','params','sequelize','CustomReportId','findAll','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x5dc250,_0x4bb4e8){var _0x583f06=function(_0xbb7c75){while(--_0xbb7c75){_0x5dc250['push'](_0x5dc250['shift']());}};_0x583f06(++_0x4bb4e8);}(_0xfbba,0x67));var _0xafbb=function(_0x5cb1c0,_0x195495){_0x5cb1c0=_0x5cb1c0-0x0;var _0x55b4f1=_0xfbba[_0x5cb1c0];return _0x55b4f1;};'use strict';var emlformat=require(_0xafbb('0x0'));var rimraf=require(_0xafbb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xafbb('0x2'));var BPromise=require(_0xafbb('0x3'));var Mustache=require(_0xafbb('0x4'));var util=require(_0xafbb('0x5'));var path=require(_0xafbb('0x6'));var sox=require(_0xafbb('0x7'));var csv=require(_0xafbb('0x8'));var ejs=require(_0xafbb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xafbb('0xa'));var squel=require('squel');var crypto=require(_0xafbb('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xafbb('0x8'));var querystring=require(_0xafbb('0xc'));var Papa=require(_0xafbb('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xafbb('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xafbb('0xf'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xafbb('0x10'))['db'];function respondWithStatusCode(_0x1c18f2,_0x4095e8){_0x4095e8=_0x4095e8||0xcc;return function(_0x5e166a){if(_0x5e166a){return _0x1c18f2[_0xafbb('0x11')](_0x4095e8);}return _0x1c18f2[_0xafbb('0x12')](_0x4095e8)[_0xafbb('0x13')]();};}function respondWithResult(_0x54d421,_0x383a1e){_0x383a1e=_0x383a1e||0xc8;return function(_0x7b99eb){if(_0x7b99eb){return _0x54d421[_0xafbb('0x12')](_0x383a1e)[_0xafbb('0x14')](_0x7b99eb);}};}function respondWithFilteredResult(_0x4ce765,_0x55a1fd){return function(_0x492188){if(_0x492188){var _0x1d0ce4=typeof _0x55a1fd[_0xafbb('0x15')]===_0xafbb('0x16')&&typeof _0x55a1fd[_0xafbb('0x17')]===_0xafbb('0x16');var _0x41c36a=_0x492188[_0xafbb('0x18')];var _0x5e5813=_0x1d0ce4?0x0:_0x55a1fd[_0xafbb('0x15')];var _0x54d243=_0x1d0ce4?_0x492188[_0xafbb('0x18')]:_0x55a1fd[_0xafbb('0x15')]+_0x55a1fd[_0xafbb('0x17')];var _0x47d7e3;if(_0x54d243>=_0x41c36a){_0x54d243=_0x41c36a;_0x47d7e3=0xc8;}else{_0x47d7e3=0xce;}_0x4ce765[_0xafbb('0x12')](_0x47d7e3);return _0x4ce765[_0xafbb('0x19')](_0xafbb('0x1a'),_0x5e5813+'-'+_0x54d243+'/'+_0x41c36a)[_0xafbb('0x14')](_0x492188);}return null;};}function patchUpdates(_0xa49159){return function(_0x3dbbb7){try{jsonpatch['apply'](_0x3dbbb7,_0xa49159,!![]);}catch(_0x43ef58){return BPromise['reject'](_0x43ef58);}return _0x3dbbb7['save']();};}function saveUpdates(_0x36c8e4,_0x4a2db5){return function(_0x5480f3){if(_0x5480f3){return _0x5480f3[_0xafbb('0x1b')](_0x36c8e4)['then'](function(_0x1e635f){return _0x1e635f;});}return null;};}function removeEntity(_0x15eeac,_0x39e037){return function(_0x391a7f){if(_0x391a7f){return _0x391a7f[_0xafbb('0x1c')]()[_0xafbb('0x1d')](function(){_0x15eeac[_0xafbb('0x12')](0xcc)[_0xafbb('0x13')]();});}};}function handleEntityNotFound(_0x2a1ea3,_0x387f3f){return function(_0x4ee6bd){if(!_0x4ee6bd){_0x2a1ea3['sendStatus'](0x194);}return _0x4ee6bd;};}function handleError(_0x5bd8d8,_0x195eea){_0x195eea=_0x195eea||0x1f4;return function(_0x1675a9){logger[_0xafbb('0x1e')](_0x1675a9[_0xafbb('0x1f')]);if(_0x1675a9[_0xafbb('0x20')]){delete _0x1675a9[_0xafbb('0x20')];}_0x5bd8d8[_0xafbb('0x12')](_0x195eea)[_0xafbb('0x21')](_0x1675a9);};}exports[_0xafbb('0x22')]=function(_0xfe9779,_0x311df8){var _0x344edd={},_0x27169e={},_0x197189={'count':0x0,'rows':[]};var _0x34c687=_[_0xafbb('0x23')](db['AnalyticFieldReport'][_0xafbb('0x24')],function(_0x3be21c){return{'name':_0x3be21c[_0xafbb('0x25')],'type':_0x3be21c[_0xafbb('0x26')][_0xafbb('0x27')]};});_0x27169e[_0xafbb('0x28')]=_[_0xafbb('0x23')](_0x34c687,'name');_0x27169e[_0xafbb('0x29')]=_['keys'](_0xfe9779['query']);_0x27169e['filters']=_[_0xafbb('0x2a')](_0x27169e['model'],_0x27169e[_0xafbb('0x29')]);_0x344edd[_0xafbb('0x2b')]=_['intersection'](_0x27169e['model'],qs[_0xafbb('0x2c')](_0xfe9779[_0xafbb('0x29')][_0xafbb('0x2c')]));_0x344edd[_0xafbb('0x2b')]=_0x344edd[_0xafbb('0x2b')][_0xafbb('0x2d')]?_0x344edd[_0xafbb('0x2b')]:_0x27169e[_0xafbb('0x28')];if(!_0xfe9779[_0xafbb('0x29')][_0xafbb('0x2e')](_0xafbb('0x2f'))){_0x344edd[_0xafbb('0x17')]=qs['limit'](_0xfe9779[_0xafbb('0x29')][_0xafbb('0x17')]);_0x344edd[_0xafbb('0x15')]=qs['offset'](_0xfe9779[_0xafbb('0x29')]['offset']);}_0x344edd[_0xafbb('0x30')]=qs[_0xafbb('0x31')](_0xfe9779[_0xafbb('0x29')][_0xafbb('0x31')]);_0x344edd[_0xafbb('0x32')]=qs[_0xafbb('0x33')](_['pick'](_0xfe9779[_0xafbb('0x29')],_0x27169e[_0xafbb('0x33')]),_0x34c687);if(_0xfe9779[_0xafbb('0x29')][_0xafbb('0x34')]){_0x344edd['where']=_[_0xafbb('0x35')](_0x344edd['where'],{'$or':_[_0xafbb('0x23')](_0x34c687,function(_0x4e0fc6){if(_0x4e0fc6[_0xafbb('0x26')]!==_0xafbb('0x36')){var _0x130ba1={};_0x130ba1[_0x4e0fc6[_0xafbb('0x20')]]={'$like':'%'+_0xfe9779[_0xafbb('0x29')]['filter']+'%'};return _0x130ba1;}})});}_0x344edd=_[_0xafbb('0x35')]({},_0x344edd,_0xfe9779[_0xafbb('0x37')]);var _0x1e0c11={'where':_0x344edd[_0xafbb('0x32')]};return db[_0xafbb('0x38')][_0xafbb('0x18')](_0x1e0c11)[_0xafbb('0x1d')](function(_0x208811){_0x197189[_0xafbb('0x18')]=_0x208811;if(_0xfe9779[_0xafbb('0x29')]['includeAll']){_0x344edd[_0xafbb('0x39')]=[{'all':!![]}];}return db[_0xafbb('0x38')]['findAll'](_0x344edd);})[_0xafbb('0x1d')](function(_0x585ff1){_0x197189['rows']=_0x585ff1;return _0x197189;})[_0xafbb('0x1d')](respondWithFilteredResult(_0x311df8,_0x344edd))[_0xafbb('0x3a')](handleError(_0x311df8,null));};exports[_0xafbb('0x3b')]=function(_0x719559,_0x1300cf){var _0x317f72={'raw':![],'where':{'id':_0x719559['params']['id']}},_0x24f5d3={};_0x24f5d3[_0xafbb('0x28')]=_[_0xafbb('0x3c')](db[_0xafbb('0x38')][_0xafbb('0x24')]);_0x24f5d3[_0xafbb('0x29')]=_[_0xafbb('0x3c')](_0x719559[_0xafbb('0x29')]);_0x24f5d3['filters']=_['intersection'](_0x24f5d3[_0xafbb('0x28')],_0x24f5d3['query']);_0x317f72['attributes']=_[_0xafbb('0x2a')](_0x24f5d3['model'],qs[_0xafbb('0x2c')](_0x719559[_0xafbb('0x29')]['fields']));_0x317f72['attributes']=_0x317f72[_0xafbb('0x2b')]['length']?_0x317f72['attributes']:_0x24f5d3[_0xafbb('0x28')];if(_0x719559[_0xafbb('0x29')][_0xafbb('0x3d')]){_0x317f72[_0xafbb('0x39')]=[{'all':!![]}];}_0x317f72=_['merge']({},_0x317f72,_0x719559[_0xafbb('0x37')]);return db['AnalyticFieldReport']['find'](_0x317f72)[_0xafbb('0x1d')](handleEntityNotFound(_0x1300cf,null))[_0xafbb('0x1d')](respondWithResult(_0x1300cf,null))['catch'](handleError(_0x1300cf,null));};exports[_0xafbb('0x3e')]=function(_0x4a4471,_0x492f1a){return db[_0xafbb('0x38')][_0xafbb('0x3e')](_0x4a4471[_0xafbb('0x3f')],{})[_0xafbb('0x1d')](respondWithResult(_0x492f1a,0xc9))[_0xafbb('0x3a')](handleError(_0x492f1a,null));};exports[_0xafbb('0x40')]=function(_0x5acf43,_0x5ba020){return db['AnalyticFieldReport'][_0xafbb('0x40')](_0x5acf43[_0xafbb('0x3f')],{'raw':![],'individualHooks':!![]})[_0xafbb('0x1d')](respondWithResult(_0x5ba020,0xc9))[_0xafbb('0x3a')](handleError(_0x5ba020,null));};exports[_0xafbb('0x1b')]=function(_0xbe2079,_0x4d0641){if(_0xbe2079[_0xafbb('0x3f')]['id']){delete _0xbe2079[_0xafbb('0x3f')]['id'];}return db[_0xafbb('0x38')]['find']({'where':{'id':_0xbe2079['params']['id']}})[_0xafbb('0x1d')](handleEntityNotFound(_0x4d0641,null))[_0xafbb('0x1d')](saveUpdates(_0xbe2079[_0xafbb('0x3f')],null))[_0xafbb('0x1d')](respondWithResult(_0x4d0641,null))[_0xafbb('0x3a')](handleError(_0x4d0641,null));};exports[_0xafbb('0x1c')]=function(_0x47493e,_0x34d05a){return db['AnalyticFieldReport'][_0xafbb('0x41')]({'where':{'id':_0x47493e['params']['id']}})[_0xafbb('0x1d')](handleEntityNotFound(_0x34d05a,null))[_0xafbb('0x1d')](removeEntity(_0x34d05a,null))['catch'](handleError(_0x34d05a,null));};exports['bulkDestroy']=function(_0x26c62e,_0x193d11){return db[_0xafbb('0x38')][_0xafbb('0x1c')]({'where':{'id':_0x26c62e['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0xafbb('0x1d')](respondWithResult(_0x193d11,0xcc))['catch'](handleError(_0x193d11,null));};exports[_0xafbb('0x42')]=function(_0x175ffd,_0x1847b4,_0x5642e8){return db['AnalyticCustomReport'][_0xafbb('0x43')]({'where':{'id':_0x175ffd[_0xafbb('0x44')]['id']}})[_0xafbb('0x1d')](handleEntityNotFound(_0x1847b4,null))[_0xafbb('0x1d')](function(_0x521fdb){if(_0x521fdb){return db[_0xafbb('0x45')]['transaction'](function(_0x4afe34){return db[_0xafbb('0x38')]['destroy']({'where':{'CustomReportId':_0x175ffd[_0xafbb('0x44')]['id']},'transaction':_0x4afe34})[_0xafbb('0x1d')](function(_0x255597){var _0x297720=_['map'](_0x175ffd[_0xafbb('0x3f')],function(_0x1e66e9){delete _0x1e66e9['id'];_0x1e66e9[_0xafbb('0x46')]=_0x175ffd[_0xafbb('0x44')]['id'];return _0x1e66e9;});return db[_0xafbb('0x38')]['bulkCreate'](_0x297720,{'transaction':_0x4afe34});});})[_0xafbb('0x1d')](function(){return db[_0xafbb('0x38')][_0xafbb('0x47')]({'where':{'CustomReportId':_0x175ffd[_0xafbb('0x44')]['id']}});});}})[_0xafbb('0x1d')](respondWithResult(_0x1847b4,null))[_0xafbb('0x3a')](handleError(_0x1847b4,null));};
\ No newline at end of file
+var _0xd088=['pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','bulkCreate','find','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xd088,0x160));var _0x8d08=function(_0x25d4eb,_0xaeebee){_0x25d4eb=_0x25d4eb-0x0;var _0x130fa1=_0xd088[_0x25d4eb];return _0x130fa1;};'use strict';var emlformat=require(_0x8d08('0x0'));var rimraf=require(_0x8d08('0x1'));var zipdir=require(_0x8d08('0x2'));var jsonpatch=require(_0x8d08('0x3'));var rp=require(_0x8d08('0x4'));var moment=require('moment');var BPromise=require(_0x8d08('0x5'));var Mustache=require('mustache');var util=require(_0x8d08('0x6'));var path=require('path');var sox=require(_0x8d08('0x7'));var csv=require(_0x8d08('0x8'));var ejs=require(_0x8d08('0x9'));var fs=require('fs');var fs_extra=require(_0x8d08('0xa'));var _=require('lodash');var squel=require(_0x8d08('0xb'));var crypto=require(_0x8d08('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8d08('0x8'));var querystring=require(_0x8d08('0xd'));var Papa=require(_0x8d08('0xe'));var Redis=require('ioredis');var authService=require(_0x8d08('0xf'));var qs=require(_0x8d08('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d08('0x11'));var logger=require(_0x8d08('0x12'))('api');var utils=require(_0x8d08('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8d08('0x14'));var db=require(_0x8d08('0x15'))['db'];function respondWithStatusCode(_0x4ae45a,_0x58ff03){_0x58ff03=_0x58ff03||0xcc;return function(_0x4caee0){if(_0x4caee0){return _0x4ae45a[_0x8d08('0x16')](_0x58ff03);}return _0x4ae45a[_0x8d08('0x17')](_0x58ff03)[_0x8d08('0x18')]();};}function respondWithResult(_0x1267b2,_0x111973){_0x111973=_0x111973||0xc8;return function(_0x242828){if(_0x242828){return _0x1267b2[_0x8d08('0x17')](_0x111973)[_0x8d08('0x19')](_0x242828);}};}function respondWithFilteredResult(_0x26c765,_0x47bafb){return function(_0x635def){if(_0x635def){var _0x57da0a=typeof _0x47bafb[_0x8d08('0x1a')]===_0x8d08('0x1b')&&typeof _0x47bafb[_0x8d08('0x1c')]===_0x8d08('0x1b');var _0xb41fdc=_0x635def['count'];var _0x2f302e=_0x57da0a?0x0:_0x47bafb[_0x8d08('0x1a')];var _0x2262b0=_0x57da0a?_0x635def[_0x8d08('0x1d')]:_0x47bafb[_0x8d08('0x1a')]+_0x47bafb['limit'];var _0xa97325;if(_0x2262b0>=_0xb41fdc){_0x2262b0=_0xb41fdc;_0xa97325=0xc8;}else{_0xa97325=0xce;}_0x26c765[_0x8d08('0x17')](_0xa97325);return _0x26c765[_0x8d08('0x1e')]('Content-Range',_0x2f302e+'-'+_0x2262b0+'/'+_0xb41fdc)['json'](_0x635def);}return null;};}function patchUpdates(_0x2f2e2d){return function(_0x27b310){try{jsonpatch[_0x8d08('0x1f')](_0x27b310,_0x2f2e2d,!![]);}catch(_0x25909d){return BPromise[_0x8d08('0x20')](_0x25909d);}return _0x27b310[_0x8d08('0x21')]();};}function saveUpdates(_0x36a531,_0x3d0468){return function(_0x4fc35e){if(_0x4fc35e){return _0x4fc35e[_0x8d08('0x22')](_0x36a531)[_0x8d08('0x23')](function(_0x15c3d7){return _0x15c3d7;});}return null;};}function removeEntity(_0x34708a,_0x3e18ce){return function(_0x105c87){if(_0x105c87){return _0x105c87['destroy']()['then'](function(){_0x34708a[_0x8d08('0x17')](0xcc)[_0x8d08('0x18')]();});}};}function handleEntityNotFound(_0x189b1a,_0x60c2ff){return function(_0x267e13){if(!_0x267e13){_0x189b1a[_0x8d08('0x16')](0x194);}return _0x267e13;};}function handleError(_0x289b83,_0x4ea363){_0x4ea363=_0x4ea363||0x1f4;return function(_0x5bdc00){logger[_0x8d08('0x24')](_0x5bdc00[_0x8d08('0x25')]);if(_0x5bdc00[_0x8d08('0x26')]){delete _0x5bdc00['name'];}_0x289b83[_0x8d08('0x17')](_0x4ea363)['send'](_0x5bdc00);};}exports[_0x8d08('0x27')]=function(_0x1b889e,_0x54c223){var _0x35c9d1={},_0x3da13c={},_0x1fc124={'count':0x0,'rows':[]};var _0x3948f0=_[_0x8d08('0x28')](db[_0x8d08('0x29')][_0x8d08('0x2a')],function(_0x229e1b){return{'name':_0x229e1b[_0x8d08('0x2b')],'type':_0x229e1b[_0x8d08('0x2c')][_0x8d08('0x2d')]};});_0x3da13c['model']=_[_0x8d08('0x28')](_0x3948f0,_0x8d08('0x26'));_0x3da13c['query']=_[_0x8d08('0x2e')](_0x1b889e[_0x8d08('0x2f')]);_0x3da13c[_0x8d08('0x30')]=_[_0x8d08('0x31')](_0x3da13c[_0x8d08('0x32')],_0x3da13c[_0x8d08('0x2f')]);_0x35c9d1[_0x8d08('0x33')]=_['intersection'](_0x3da13c[_0x8d08('0x32')],qs[_0x8d08('0x34')](_0x1b889e[_0x8d08('0x2f')][_0x8d08('0x34')]));_0x35c9d1['attributes']=_0x35c9d1[_0x8d08('0x33')][_0x8d08('0x35')]?_0x35c9d1['attributes']:_0x3da13c[_0x8d08('0x32')];if(!_0x1b889e[_0x8d08('0x2f')][_0x8d08('0x36')]('nolimit')){_0x35c9d1['limit']=qs['limit'](_0x1b889e[_0x8d08('0x2f')]['limit']);_0x35c9d1['offset']=qs[_0x8d08('0x1a')](_0x1b889e[_0x8d08('0x2f')][_0x8d08('0x1a')]);}_0x35c9d1[_0x8d08('0x37')]=qs[_0x8d08('0x38')](_0x1b889e[_0x8d08('0x2f')][_0x8d08('0x38')]);_0x35c9d1[_0x8d08('0x39')]=qs[_0x8d08('0x30')](_[_0x8d08('0x3a')](_0x1b889e[_0x8d08('0x2f')],_0x3da13c[_0x8d08('0x30')]),_0x3948f0);if(_0x1b889e['query']['filter']){_0x35c9d1[_0x8d08('0x39')]=_[_0x8d08('0x3b')](_0x35c9d1[_0x8d08('0x39')],{'$or':_[_0x8d08('0x28')](_0x3948f0,function(_0x55bbcb){if(_0x55bbcb[_0x8d08('0x2c')]!==_0x8d08('0x3c')){var _0x3ef918={};_0x3ef918[_0x55bbcb[_0x8d08('0x26')]]={'$like':'%'+_0x1b889e['query'][_0x8d08('0x3d')]+'%'};return _0x3ef918;}})});}_0x35c9d1=_['merge']({},_0x35c9d1,_0x1b889e[_0x8d08('0x3e')]);var _0x35e1c5={'where':_0x35c9d1[_0x8d08('0x39')]};return db['AnalyticFieldReport'][_0x8d08('0x1d')](_0x35e1c5)[_0x8d08('0x23')](function(_0x320d65){_0x1fc124[_0x8d08('0x1d')]=_0x320d65;if(_0x1b889e['query'][_0x8d08('0x3f')]){_0x35c9d1[_0x8d08('0x40')]=[{'all':!![]}];}return db[_0x8d08('0x29')][_0x8d08('0x41')](_0x35c9d1);})[_0x8d08('0x23')](function(_0x92a21c){_0x1fc124[_0x8d08('0x42')]=_0x92a21c;return _0x1fc124;})['then'](respondWithFilteredResult(_0x54c223,_0x35c9d1))[_0x8d08('0x43')](handleError(_0x54c223,null));};exports[_0x8d08('0x44')]=function(_0x3720e8,_0x263884){var _0x3fe79b={'raw':![],'where':{'id':_0x3720e8[_0x8d08('0x45')]['id']}},_0x1bda65={};_0x1bda65[_0x8d08('0x32')]=_[_0x8d08('0x2e')](db[_0x8d08('0x29')][_0x8d08('0x2a')]);_0x1bda65[_0x8d08('0x2f')]=_[_0x8d08('0x2e')](_0x3720e8[_0x8d08('0x2f')]);_0x1bda65[_0x8d08('0x30')]=_[_0x8d08('0x31')](_0x1bda65['model'],_0x1bda65[_0x8d08('0x2f')]);_0x3fe79b[_0x8d08('0x33')]=_[_0x8d08('0x31')](_0x1bda65[_0x8d08('0x32')],qs[_0x8d08('0x34')](_0x3720e8[_0x8d08('0x2f')]['fields']));_0x3fe79b['attributes']=_0x3fe79b['attributes'][_0x8d08('0x35')]?_0x3fe79b[_0x8d08('0x33')]:_0x1bda65['model'];if(_0x3720e8[_0x8d08('0x2f')][_0x8d08('0x3f')]){_0x3fe79b[_0x8d08('0x40')]=[{'all':!![]}];}_0x3fe79b=_['merge']({},_0x3fe79b,_0x3720e8[_0x8d08('0x3e')]);return db['AnalyticFieldReport']['find'](_0x3fe79b)[_0x8d08('0x23')](handleEntityNotFound(_0x263884,null))['then'](respondWithResult(_0x263884,null))['catch'](handleError(_0x263884,null));};exports[_0x8d08('0x46')]=function(_0x4ec950,_0x5b694a){return db['AnalyticFieldReport'][_0x8d08('0x46')](_0x4ec950[_0x8d08('0x47')],{})[_0x8d08('0x23')](respondWithResult(_0x5b694a,0xc9))['catch'](handleError(_0x5b694a,null));};exports[_0x8d08('0x48')]=function(_0x2e00a5,_0x4c3eb8){return db[_0x8d08('0x29')][_0x8d08('0x48')](_0x2e00a5[_0x8d08('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4c3eb8,0xc9))[_0x8d08('0x43')](handleError(_0x4c3eb8,null));};exports[_0x8d08('0x22')]=function(_0x31f81a,_0x10ebe3){if(_0x31f81a[_0x8d08('0x47')]['id']){delete _0x31f81a[_0x8d08('0x47')]['id'];}return db[_0x8d08('0x29')][_0x8d08('0x49')]({'where':{'id':_0x31f81a[_0x8d08('0x45')]['id']}})[_0x8d08('0x23')](handleEntityNotFound(_0x10ebe3,null))[_0x8d08('0x23')](saveUpdates(_0x31f81a[_0x8d08('0x47')],null))['then'](respondWithResult(_0x10ebe3,null))[_0x8d08('0x43')](handleError(_0x10ebe3,null));};exports[_0x8d08('0x4a')]=function(_0x153e34,_0x120e8a){return db[_0x8d08('0x29')][_0x8d08('0x49')]({'where':{'id':_0x153e34[_0x8d08('0x45')]['id']}})[_0x8d08('0x23')](handleEntityNotFound(_0x120e8a,null))[_0x8d08('0x23')](removeEntity(_0x120e8a,null))[_0x8d08('0x43')](handleError(_0x120e8a,null));};exports[_0x8d08('0x4b')]=function(_0x3e1484,_0x16df7b){return db['AnalyticFieldReport'][_0x8d08('0x4a')]({'where':{'id':_0x3e1484['query'][_0x8d08('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x8d08('0x23')](respondWithResult(_0x16df7b,0xcc))[_0x8d08('0x43')](handleError(_0x16df7b,null));};exports[_0x8d08('0x4d')]=function(_0x19152d,_0xd1629e,_0x18e922){return db[_0x8d08('0x4e')]['findOne']({'where':{'id':_0x19152d[_0x8d08('0x45')]['id']}})[_0x8d08('0x23')](handleEntityNotFound(_0xd1629e,null))['then'](function(_0xd1c8f9){if(_0xd1c8f9){return db[_0x8d08('0x4f')][_0x8d08('0x50')](function(_0x416bb9){return db['AnalyticFieldReport'][_0x8d08('0x4a')]({'where':{'CustomReportId':_0x19152d['params']['id']},'transaction':_0x416bb9})[_0x8d08('0x23')](function(_0x18a94b){var _0x240db8=_['map'](_0x19152d[_0x8d08('0x47')],function(_0x345b46){delete _0x345b46['id'];_0x345b46[_0x8d08('0x51')]=_0x19152d['params']['id'];return _0x345b46;});return db['AnalyticFieldReport'][_0x8d08('0x48')](_0x240db8,{'transaction':_0x416bb9});});})['then'](function(){return db['AnalyticFieldReport'][_0x8d08('0x41')]({'where':{'CustomReportId':_0x19152d[_0x8d08('0x45')]['id']}});});}})[_0x8d08('0x23')](respondWithResult(_0xd1629e,null))[_0x8d08('0x43')](handleError(_0xd1629e,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 3c54157..46d870a 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 _0x1bd9=['../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3b0dd0,_0x3fec24){var _0x3b4dc2=function(_0x12c0f1){while(--_0x12c0f1){_0x3b0dd0['push'](_0x3b0dd0['shift']());}};_0x3b4dc2(++_0x3fec24);}(_0x1bd9,0x190));var _0x91bd=function(_0x30dba0,_0x4a8823){_0x30dba0=_0x30dba0-0x0;var _0x59ad96=_0x1bd9[_0x30dba0];return _0x59ad96;};'use strict';var _=require(_0x91bd('0x0'));var util=require(_0x91bd('0x1'));var logger=require(_0x91bd('0x2'))(_0x91bd('0x3'));var moment=require(_0x91bd('0x4'));var BPromise=require(_0x91bd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91bd('0x6'));var rimraf=require(_0x91bd('0x7'));var config=require(_0x91bd('0x8'));var attributes=require(_0x91bd('0x9'));module['exports']=function(_0x49e2ba,_0x44d43f){return _0x49e2ba[_0x91bd('0xa')](_0x91bd('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x40f1=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x327fb0,_0x387a15){var _0x13b762=function(_0x24d37a){while(--_0x24d37a){_0x327fb0['push'](_0x327fb0['shift']());}};_0x13b762(++_0x387a15);}(_0x40f1,0x1c4));var _0x140f=function(_0x6889c0,_0x1d2088){_0x6889c0=_0x6889c0-0x0;var _0x241175=_0x40f1[_0x6889c0];return _0x241175;};'use strict';var _=require(_0x140f('0x0'));var util=require(_0x140f('0x1'));var logger=require(_0x140f('0x2'))(_0x140f('0x3'));var moment=require(_0x140f('0x4'));var BPromise=require('bluebird');var rp=require(_0x140f('0x5'));var fs=require('fs');var path=require(_0x140f('0x6'));var rimraf=require(_0x140f('0x7'));var config=require(_0x140f('0x8'));var attributes=require(_0x140f('0x9'));module[_0x140f('0xa')]=function(_0x5a9772,_0x197585){return _0x5a9772[_0x140f('0xb')](_0x140f('0xc'),attributes,{'tableName':_0x140f('0xd'),'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 6ada6fb..53f68a2 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 _0x694a=['http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x5c34d9,_0x45050f){var _0x507a57=function(_0xcb2a29){while(--_0xcb2a29){_0x5c34d9['push'](_0x5c34d9['shift']());}};_0x507a57(++_0x45050f);}(_0x694a,0x1c2));var _0xa694=function(_0x598be5,_0x5745b8){_0x598be5=_0x598be5-0x0;var _0x12672a=_0x694a[_0x598be5];return _0x12672a;};'use strict';var _=require(_0xa694('0x0'));var util=require(_0xa694('0x1'));var moment=require(_0xa694('0x2'));var BPromise=require(_0xa694('0x3'));var rs=require(_0xa694('0x4'));var fs=require('fs');var Redis=require(_0xa694('0x5'));var db=require(_0xa694('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa694('0x7'));var config=require(_0xa694('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa694('0x9')][_0xa694('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x324843,_0x17b0d7,_0x1e219c){return new BPromise(function(_0x10b047,_0xdc17e2){return client[_0xa694('0xb')](_0x324843,_0x1e219c)[_0xa694('0xc')](function(_0x13c5d5){logger[_0xa694('0xd')](_0xa694('0xe'),_0x17b0d7,_0xa694('0xf'));logger['debug'](_0xa694('0x10'),_0x17b0d7,_0xa694('0xf'),JSON[_0xa694('0x11')](_0x13c5d5));if(_0x13c5d5['error']){if(_0x13c5d5[_0xa694('0x12')][_0xa694('0x13')]===0x1f4){logger['error'](_0xa694('0xe'),_0x17b0d7,_0x13c5d5['error'][_0xa694('0x14')]);return _0xdc17e2(_0x13c5d5[_0xa694('0x12')]['message']);}logger[_0xa694('0x12')](_0xa694('0xe'),_0x17b0d7,_0x13c5d5['error'][_0xa694('0x14')]);return _0x10b047(_0x13c5d5['error'][_0xa694('0x14')]);}else{logger[_0xa694('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x17b0d7,_0xa694('0xf'));_0x10b047(_0x13c5d5[_0xa694('0x15')][_0xa694('0x14')]);}})[_0xa694('0x16')](function(_0x16c891){logger[_0xa694('0x12')](_0xa694('0xe'),_0x17b0d7,_0x16c891);_0xdc17e2(_0x16c891);});});}
\ No newline at end of file
+var _0x33a7=['jayson/promise','client','http','info','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','lodash','util','randomstring','../../mysqldb','rpc','../../config/environment'];(function(_0x113c43,_0x171537){var _0x25a1ac=function(_0x5544b2){while(--_0x5544b2){_0x113c43['push'](_0x113c43['shift']());}};_0x25a1ac(++_0x171537);}(_0x33a7,0x162));var _0x733a=function(_0x1ab313,_0x12bccc){_0x1ab313=_0x1ab313-0x0;var _0x2d73f4=_0x33a7[_0x1ab313];return _0x2d73f4;};'use strict';var _=require(_0x733a('0x0'));var util=require(_0x733a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x733a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x733a('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x733a('0x4'));var config=require(_0x733a('0x5'));var jayson=require(_0x733a('0x6'));var client=jayson[_0x733a('0x7')][_0x733a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42ea39,_0x197587,_0x2ffd59){return new BPromise(function(_0x30ecdc,_0x3bfe5f){return client['request'](_0x42ea39,_0x2ffd59)['then'](function(_0x5472b9){logger[_0x733a('0x9')]('AnalyticFieldReport,\x20%s,\x20%s',_0x197587,_0x733a('0xa'));logger['debug'](_0x733a('0xb'),_0x197587,_0x733a('0xa'),JSON[_0x733a('0xc')](_0x5472b9));if(_0x5472b9[_0x733a('0xd')]){if(_0x5472b9['error'][_0x733a('0xe')]===0x1f4){logger['error'](_0x733a('0xf'),_0x197587,_0x5472b9[_0x733a('0xd')][_0x733a('0x10')]);return _0x3bfe5f(_0x5472b9[_0x733a('0xd')][_0x733a('0x10')]);}logger[_0x733a('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x197587,_0x5472b9[_0x733a('0xd')]['message']);return _0x30ecdc(_0x5472b9[_0x733a('0xd')][_0x733a('0x10')]);}else{logger[_0x733a('0x9')](_0x733a('0xf'),_0x197587,'request\x20sent');_0x30ecdc(_0x5472b9[_0x733a('0x11')][_0x733a('0x10')]);}})['catch'](function(_0x65c413){logger['error'](_0x733a('0xf'),_0x197587,_0x65c413);_0x3bfe5f(_0x65c413);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index ed9db57..a65aeb3 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(_0x4ecdad,_0x25101e){var _0x187dab=function(_0x27bd8a){while(--_0x27bd8a){_0x4ecdad['push'](_0x4ecdad['shift']());}};_0x187dab(++_0x25101e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x55f0a3,_0x3b326d){var _0x1c87cb=function(_0x7cd297){while(--_0x7cd297){_0x55f0a3['push'](_0x55f0a3['shift']());}};_0x1c87cb(++_0x3b326d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 8b28a9e..1451c32 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 _0x180d=['TEXT','exports','STRING','name'];(function(_0x5a458b,_0x2711c5){var _0x3d9d69=function(_0x4cc470){while(--_0x4cc470){_0x5a458b['push'](_0x5a458b['shift']());}};_0x3d9d69(++_0x2711c5);}(_0x180d,0xf9));var _0xd180=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x180d[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require('sequelize');module[_0xd180('0x0')]={'name':{'type':Sequelize[_0xd180('0x1')],'allowNull':![],'unique':_0xd180('0x2')},'table':{'type':Sequelize[_0xd180('0x1')]},'metric':{'type':Sequelize[_0xd180('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xfc4c=['STRING','TEXT','sequelize','exports'];(function(_0x29a522,_0x4b440b){var _0x196807=function(_0x56eb39){while(--_0x56eb39){_0x29a522['push'](_0x29a522['shift']());}};_0x196807(++_0x4b440b);}(_0xfc4c,0xca));var _0xcfc4=function(_0x3712ba,_0xad3b36){_0x3712ba=_0x3712ba-0x0;var _0x149dcc=_0xfc4c[_0x3712ba];return _0x149dcc;};'use strict';var Sequelize=require(_0xcfc4('0x0'));module[_0xcfc4('0x1')]={'name':{'type':Sequelize[_0xcfc4('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xcfc4('0x2')]},'metric':{'type':Sequelize[_0xcfc4('0x3')]},'description':{'type':Sequelize[_0xcfc4('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 6d10d2f..23914d4 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 _0x7da7=['model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','options','where','AnalyticMetric','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x7da7,0x10d));var _0x77da=function(_0x589aee,_0x140a03){_0x589aee=_0x589aee-0x0;var _0x2f5ed4=_0x7da7[_0x589aee];return _0x2f5ed4;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x23')]({'plain':!![]});var _0x2d009f=_0x77da('0x24');return db[_0x77da('0x25')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x21')](function(){return _0x270318;});})[_0x77da('0x21')](function(){_0x27b6c7[_0x77da('0x18')](0xcc)[_0x77da('0x26')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x17')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x18')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=_[_0x77da('0x2a')](db['AnalyticMetric'][_0x77da('0x2b')],function(_0x228851){return{'name':_0x228851[_0x77da('0x2c')],'type':_0x228851[_0x77da('0x2d')][_0x77da('0x2e')]};});_0x356bfb[_0x77da('0x2f')]=_[_0x77da('0x2a')](_0x1e7853,_0x77da('0x27'));_0x356bfb['query']=_['keys'](_0x4eeb99[_0x77da('0x30')]);_0x356bfb[_0x77da('0x31')]=_['intersection'](_0x356bfb[_0x77da('0x2f')],_0x356bfb[_0x77da('0x30')]);_0x26f5a0[_0x77da('0x32')]=_[_0x77da('0x33')](_0x356bfb[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x4eeb99[_0x77da('0x30')]['fields']));_0x26f5a0[_0x77da('0x32')]=_0x26f5a0['attributes']['length']?_0x26f5a0['attributes']:_0x356bfb[_0x77da('0x2f')];if(!_0x4eeb99['query'][_0x77da('0x35')](_0x77da('0x36'))){_0x26f5a0[_0x77da('0x1c')]=qs[_0x77da('0x1c')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x1c')]);_0x26f5a0[_0x77da('0x19')]=qs['offset'](_0x4eeb99[_0x77da('0x30')][_0x77da('0x19')]);}_0x26f5a0[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x38')]);_0x26f5a0['where']=qs[_0x77da('0x31')](_[_0x77da('0x39')](_0x4eeb99[_0x77da('0x30')],_0x356bfb['filters']),_0x1e7853);if(_0x4eeb99[_0x77da('0x30')]['filter']){_0x26f5a0['where']=_['merge'](_0x26f5a0['where'],{'$or':_[_0x77da('0x2a')](_0x1e7853,function(_0x1adba5){if(_0x1adba5[_0x77da('0x2d')]!=='VIRTUAL'){var _0x21d337={};_0x21d337[_0x1adba5['name']]={'$like':'%'+_0x4eeb99[_0x77da('0x30')]['filter']+'%'};return _0x21d337;}})});}_0x26f5a0=_[_0x77da('0x3a')]({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x290667={'where':_0x26f5a0[_0x77da('0x3c')]};return db[_0x77da('0x3d')]['count'](_0x290667)[_0x77da('0x21')](function(_0x1f48bd){_0x1d381b[_0x77da('0x1b')]=_0x1f48bd;if(_0x4eeb99[_0x77da('0x30')][_0x77da('0x3e')]){_0x26f5a0[_0x77da('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x77da('0x40')](_0x26f5a0);})[_0x77da('0x21')](function(_0x21de41){_0x1d381b[_0x77da('0x41')]=_0x21de41;return _0x1d381b;})[_0x77da('0x21')](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x42')](handleError(_0x350b4e,null));};exports['show']=function(_0x10957b,_0x5abcd9){var _0x1ae806={'raw':!![],'where':{'id':_0x10957b[_0x77da('0x43')]['id']}},_0x373fb2={};_0x373fb2['model']=_[_0x77da('0x44')](db[_0x77da('0x3d')][_0x77da('0x2b')]);_0x373fb2[_0x77da('0x30')]=_[_0x77da('0x44')](_0x10957b[_0x77da('0x30')]);_0x373fb2[_0x77da('0x31')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],_0x373fb2['query']);_0x1ae806[_0x77da('0x32')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x10957b[_0x77da('0x30')][_0x77da('0x34')]));_0x1ae806['attributes']=_0x1ae806['attributes'][_0x77da('0x45')]?_0x1ae806[_0x77da('0x32')]:_0x373fb2[_0x77da('0x2f')];if(_0x10957b[_0x77da('0x30')][_0x77da('0x3e')]){_0x1ae806[_0x77da('0x3f')]=[{'all':!![]}];}_0x1ae806=_['merge']({},_0x1ae806,_0x10957b[_0x77da('0x3b')]);return db[_0x77da('0x3d')][_0x77da('0x46')](_0x1ae806)[_0x77da('0x21')](handleEntityNotFound(_0x5abcd9,null))['then'](respondWithResult(_0x5abcd9,null))[_0x77da('0x42')](handleError(_0x5abcd9,null));};exports['create']=function(_0x518fd5,_0x36263b){return db[_0x77da('0x3d')][_0x77da('0x47')](_0x518fd5[_0x77da('0x48')],{})['then'](function(_0x16bf4b){var _0x1e36ee=_0x518fd5['user'][_0x77da('0x23')]({'plain':!![]});if(!_0x1e36ee)throw new Error(_0x77da('0x49'));if(_0x1e36ee['role']===_0x77da('0x4a')){var _0x3aaf5b=_0x16bf4b[_0x77da('0x23')]({'plain':!![]});var _0xef2496=_0x77da('0x24');return db[_0x77da('0x4b')][_0x77da('0x46')]({'where':{'name':_0xef2496,'userProfileId':_0x1e36ee[_0x77da('0x4c')]},'raw':!![]})[_0x77da('0x21')](function(_0x3a34a8){if(_0x3a34a8&&_0x3a34a8['autoAssociation']===0x0){return db[_0x77da('0x25')]['create']({'name':_0x3aaf5b[_0x77da('0x27')],'resourceId':_0x3aaf5b['id'],'type':_0x3a34a8[_0x77da('0x27')],'sectionId':_0x3a34a8['id']},{})[_0x77da('0x21')](function(){return _0x16bf4b;});}else{return _0x16bf4b;}})[_0x77da('0x42')](function(_0x374179){logger[_0x77da('0x4d')](_0x77da('0x4e'),_0x374179);throw _0x374179;});}return _0x16bf4b;})['then'](respondWithResult(_0x36263b,0xc9))[_0x77da('0x42')](handleError(_0x36263b,null));};exports[_0x77da('0x20')]=function(_0x1a7115,_0x353be9){if(_0x1a7115['body']['id']){delete _0x1a7115[_0x77da('0x48')]['id'];}return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x1a7115['params']['id']}})['then'](handleEntityNotFound(_0x353be9,null))[_0x77da('0x21')](saveUpdates(_0x1a7115[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x353be9,null))[_0x77da('0x42')](handleError(_0x353be9,null));};exports[_0x77da('0x22')]=function(_0x528a32,_0x50437b){return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x528a32['params']['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x50437b,null))[_0x77da('0x21')](removeEntity(_0x50437b,null))[_0x77da('0x42')](handleError(_0x50437b,null));};
\ No newline at end of file
+var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x144f18,_0x39c0ae){var _0x49ef67=function(_0x44b1a4){while(--_0x44b1a4){_0x144f18['push'](_0x144f18['shift']());}};_0x49ef67(++_0x39c0ae);}(_0x008c,0x188));var _0xc008=function(_0x568496,_0x565afd){_0x568496=_0x568496-0x0;var _0x26c5c1=_0x008c[_0x568496];return _0x26c5c1;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 539237f..10fdbae 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 _0x6f7b=['moment','bluebird','request-promise','path','../../config/environment','exports','define','analytics_metrics','util','../../config/logger','api'];(function(_0x58a4ac,_0x26f3e7){var _0x435e2d=function(_0x1a5660){while(--_0x1a5660){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x435e2d(++_0x26f3e7);}(_0x6f7b,0x168));var _0xb6f7=function(_0x39ebb0,_0x2bb363){_0x39ebb0=_0x39ebb0-0x0;var _0x4f5b83=_0x6f7b[_0x39ebb0];return _0x4f5b83;};'use strict';var _=require('lodash');var util=require(_0xb6f7('0x0'));var logger=require(_0xb6f7('0x1'))(_0xb6f7('0x2'));var moment=require(_0xb6f7('0x3'));var BPromise=require(_0xb6f7('0x4'));var rp=require(_0xb6f7('0x5'));var fs=require('fs');var path=require(_0xb6f7('0x6'));var rimraf=require('rimraf');var config=require(_0xb6f7('0x7'));var attributes=require('./analyticMetric.attributes');module[_0xb6f7('0x8')]=function(_0x25cec3,_0x59b2d9){return _0x25cec3[_0xb6f7('0x9')]('AnalyticMetric',attributes,{'tableName':_0xb6f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c9a=['define','AnalyticMetric','analytics_metrics','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x365dbe,_0x4d3979){var _0xaa71bb=function(_0x4a0951){while(--_0x4a0951){_0x365dbe['push'](_0x365dbe['shift']());}};_0xaa71bb(++_0x4d3979);}(_0x1c9a,0x1a7));var _0xa1c9=function(_0xf98ccf,_0x5b3b82){_0xf98ccf=_0xf98ccf-0x0;var _0xdd41b4=_0x1c9a[_0xf98ccf];return _0xdd41b4;};'use strict';var _=require(_0xa1c9('0x0'));var util=require(_0xa1c9('0x1'));var logger=require('../../config/logger')(_0xa1c9('0x2'));var moment=require(_0xa1c9('0x3'));var BPromise=require(_0xa1c9('0x4'));var rp=require(_0xa1c9('0x5'));var fs=require('fs');var path=require(_0xa1c9('0x6'));var rimraf=require('rimraf');var config=require(_0xa1c9('0x7'));var attributes=require('./analyticMetric.attributes');module[_0xa1c9('0x8')]=function(_0xdd22bf,_0x237862){return _0xdd22bf[_0xa1c9('0x9')](_0xa1c9('0xa'),attributes,{'tableName':_0xa1c9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 45105cb..321af44 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 _0xd349=['error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x2f77dc,_0x461263){var _0x1806c8=function(_0x436039){while(--_0x436039){_0x2f77dc['push'](_0x2f77dc['shift']());}};_0x1806c8(++_0x461263);}(_0xd349,0xcc));var _0x9d34=function(_0x167e93,_0x3c0ac8){_0x167e93=_0x167e93-0x0;var _0x4e16ff=_0xd349[_0x167e93];return _0x4e16ff;};'use strict';var _=require(_0x9d34('0x0'));var util=require(_0x9d34('0x1'));var moment=require(_0x9d34('0x2'));var BPromise=require('bluebird');var rs=require(_0x9d34('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d34('0x4'))['db'];var utils=require(_0x9d34('0x5'));var logger=require(_0x9d34('0x6'))('rpc');var config=require(_0x9d34('0x7'));var jayson=require(_0x9d34('0x8'));var client=jayson['client'][_0x9d34('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x235216,_0x322799,_0x5526e9){return new BPromise(function(_0x51228f,_0x1ca1d2){return client[_0x9d34('0xa')](_0x235216,_0x5526e9)[_0x9d34('0xb')](function(_0x4d1a35){logger[_0x9d34('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x322799,_0x9d34('0xd'));logger[_0x9d34('0xe')](_0x9d34('0xf'),_0x322799,'request\x20sent',JSON['stringify'](_0x4d1a35));if(_0x4d1a35[_0x9d34('0x10')]){if(_0x4d1a35[_0x9d34('0x10')][_0x9d34('0x11')]===0x1f4){logger[_0x9d34('0x10')](_0x9d34('0x12'),_0x322799,_0x4d1a35['error'][_0x9d34('0x13')]);return _0x1ca1d2(_0x4d1a35[_0x9d34('0x10')][_0x9d34('0x13')]);}logger[_0x9d34('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x322799,_0x4d1a35[_0x9d34('0x10')][_0x9d34('0x13')]);return _0x51228f(_0x4d1a35[_0x9d34('0x10')][_0x9d34('0x13')]);}else{logger[_0x9d34('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x322799,_0x9d34('0xd'));_0x51228f(_0x4d1a35[_0x9d34('0x14')][_0x9d34('0x13')]);}})[_0x9d34('0x15')](function(_0xf8d9d5){logger[_0x9d34('0x10')](_0x9d34('0x12'),_0x322799,_0xf8d9d5);_0x1ca1d2(_0xf8d9d5);});});}
\ No newline at end of file
+var _0xdd5b=['randomstring','ioredis','../../config/utils','jayson/promise','client','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','bluebird'];(function(_0x3e32a8,_0x255953){var _0x2997b0=function(_0x2d564a){while(--_0x2d564a){_0x3e32a8['push'](_0x3e32a8['shift']());}};_0x2997b0(++_0x255953);}(_0xdd5b,0x174));var _0xbdd5=function(_0x530c78,_0x3e9345){_0x530c78=_0x530c78-0x0;var _0x155f17=_0xdd5b[_0x530c78];return _0x155f17;};'use strict';var _=require(_0xbdd5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbdd5('0x1'));var rs=require(_0xbdd5('0x2'));var fs=require('fs');var Redis=require(_0xbdd5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbdd5('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xbdd5('0x5'));var client=jayson[_0xbdd5('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a43f9,_0x59912f,_0x554c2d){return new BPromise(function(_0x4b0767,_0x1ec6f4){return client['request'](_0x2a43f9,_0x554c2d)[_0xbdd5('0x7')](function(_0x918acc){logger[_0xbdd5('0x8')](_0xbdd5('0x9'),_0x59912f,_0xbdd5('0xa'));logger[_0xbdd5('0xb')](_0xbdd5('0xc'),_0x59912f,_0xbdd5('0xa'),JSON['stringify'](_0x918acc));if(_0x918acc[_0xbdd5('0xd')]){if(_0x918acc[_0xbdd5('0xd')][_0xbdd5('0xe')]===0x1f4){logger[_0xbdd5('0xd')](_0xbdd5('0x9'),_0x59912f,_0x918acc['error'][_0xbdd5('0xf')]);return _0x1ec6f4(_0x918acc[_0xbdd5('0xd')]['message']);}logger[_0xbdd5('0xd')](_0xbdd5('0x9'),_0x59912f,_0x918acc['error']['message']);return _0x4b0767(_0x918acc[_0xbdd5('0xd')][_0xbdd5('0xf')]);}else{logger[_0xbdd5('0x8')](_0xbdd5('0x9'),_0x59912f,_0xbdd5('0xa'));_0x4b0767(_0x918acc['result'][_0xbdd5('0xf')]);}})[_0xbdd5('0x10')](function(_0x137df8){logger[_0xbdd5('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x59912f,_0x137df8);_0x1ec6f4(_0x137df8);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index a92e8b5..23ac396 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 _0x7250=['index','/:id','isAuthenticated','post','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller'];(function(_0x89795,_0xb3a518){var _0x54f6ad=function(_0xcb239e){while(--_0xcb239e){_0x89795['push'](_0x89795['shift']());}};_0x54f6ad(++_0xb3a518);}(_0x7250,0x1b1));var _0x0725=function(_0xf4175f,_0x4104b3){_0xf4175f=_0xf4175f-0x0;var _0x5c67ce=_0x7250[_0xf4175f];return _0x5c67ce;};'use strict';var multer=require(_0x0725('0x0'));var util=require(_0x0725('0x1'));var path=require('path');var timeout=require(_0x0725('0x2'));var express=require(_0x0725('0x3'));var router=express[_0x0725('0x4')]();var fs_extra=require(_0x0725('0x5'));var auth=require(_0x0725('0x6'));var interaction=require(_0x0725('0x7'));var config=require('../../config/environment');var controller=require(_0x0725('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0725('0x9')]);router['get'](_0x0725('0xa'),auth[_0x0725('0xb')](),controller['show']);router[_0x0725('0xc')]('/',auth[_0x0725('0xb')](),controller[_0x0725('0xd')]);router[_0x0725('0xe')](_0x0725('0xa'),auth[_0x0725('0xb')](),controller[_0x0725('0xf')]);router['delete'](_0x0725('0xa'),auth[_0x0725('0xb')](),controller[_0x0725('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xb1d3=['./analyticMetric.controller','get','isAuthenticated','/:id','show','post','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3616e6,_0x2cb828){var _0x9de004=function(_0x548b53){while(--_0x548b53){_0x3616e6['push'](_0x3616e6['shift']());}};_0x9de004(++_0x2cb828);}(_0xb1d3,0xe8));var _0x3b1d=function(_0x2e5b20,_0x3dc933){_0x2e5b20=_0x2e5b20-0x0;var _0x459287=_0xb1d3[_0x2e5b20];return _0x459287;};'use strict';var multer=require(_0x3b1d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3b1d('0x1'));var router=express[_0x3b1d('0x2')]();var fs_extra=require(_0x3b1d('0x3'));var auth=require(_0x3b1d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3b1d('0x5'));var controller=require(_0x3b1d('0x6'));router[_0x3b1d('0x7')]('/',auth[_0x3b1d('0x8')](),controller['index']);router['get'](_0x3b1d('0x9'),auth[_0x3b1d('0x8')](),controller[_0x3b1d('0xa')]);router[_0x3b1d('0xb')]('/',auth[_0x3b1d('0x8')](),controller['create']);router['put'](_0x3b1d('0x9'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x3b1d('0x8')](),controller[_0x3b1d('0xc')]);module[_0x3b1d('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index a2930df..f73a5dc 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 _0xdb4b=['exports'];(function(_0x15ca1a,_0x30fc82){var _0x507626=function(_0x14c9bc){while(--_0x14c9bc){_0x15ca1a['push'](_0x15ca1a['shift']());}};_0x507626(++_0x30fc82);}(_0xdb4b,0xd7));var _0xbdb4=function(_0x148bd2,_0x3338c6){_0x148bd2=_0x148bd2-0x0;var _0x38c56f=_0xdb4b[_0x148bd2];return _0x38c56f;};'use strict';var Sequelize=require('sequelize');module[_0xbdb4('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x3dc0=['exports','TEXT','sequelize'];(function(_0x550606,_0x477571){var _0xd825d1=function(_0x1b2e0e){while(--_0x1b2e0e){_0x550606['push'](_0x550606['shift']());}};_0xd825d1(++_0x477571);}(_0x3dc0,0x104));var _0x03dc=function(_0x4fe167,_0x2bc589){_0x4fe167=_0x4fe167-0x0;var _0x57ec01=_0x3dc0[_0x4fe167];return _0x57ec01;};'use strict';var Sequelize=require(_0x03dc('0x0'));module[_0x03dc('0x1')]={'tree':{'type':Sequelize[_0x03dc('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 3f117aa..47bd41d 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 _0x3f60=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','keys','rawAttributes','catch','create','body','find','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','AnalyticTreeReport','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x36b515,_0xdc3dc3){var _0x55679d=function(_0x5b78c2){while(--_0x5b78c2){_0x36b515['push'](_0x36b515['shift']());}};_0x55679d(++_0xdc3dc3);}(_0x3f60,0x1ce));var _0x03f6=function(_0x4fc80b,_0xfe1b3d){_0x4fc80b=_0x4fc80b-0x0;var _0x119dba=_0x3f60[_0x4fc80b];return _0x119dba;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x03f6('0x0'));var jsonpatch=require(_0x03f6('0x1'));var rp=require('request-promise');var moment=require(_0x03f6('0x2'));var BPromise=require(_0x03f6('0x3'));var Mustache=require(_0x03f6('0x4'));var util=require(_0x03f6('0x5'));var path=require('path');var sox=require(_0x03f6('0x6'));var csv=require(_0x03f6('0x7'));var ejs=require(_0x03f6('0x8'));var fs=require('fs');var fs_extra=require(_0x03f6('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x03f6('0xa'));var deskjs=require(_0x03f6('0xb'));var toCsv=require(_0x03f6('0x7'));var querystring=require(_0x03f6('0xc'));var Papa=require(_0x03f6('0xd'));var Redis=require(_0x03f6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x03f6('0xf'));var as=require(_0x03f6('0x10'));var hardwareService=require(_0x03f6('0x11'));var logger=require(_0x03f6('0x12'))('api');var utils=require(_0x03f6('0x13'));var config=require(_0x03f6('0x14'));var licenseUtil=require(_0x03f6('0x15'));var db=require(_0x03f6('0x16'))['db'];function respondWithStatusCode(_0x222d28,_0x531078){_0x531078=_0x531078||0xcc;return function(_0x211512){if(_0x211512){return _0x222d28[_0x03f6('0x17')](_0x531078);}return _0x222d28[_0x03f6('0x18')](_0x531078)[_0x03f6('0x19')]();};}function respondWithResult(_0x184e50,_0x35cfcf){_0x35cfcf=_0x35cfcf||0xc8;return function(_0x2148d6){if(_0x2148d6){return _0x184e50[_0x03f6('0x18')](_0x35cfcf)[_0x03f6('0x1a')](_0x2148d6);}};}function respondWithFilteredResult(_0x3c54c8,_0x38f19f){return function(_0x2c36f5){if(_0x2c36f5){var _0x2e6e45=typeof _0x38f19f['offset']===_0x03f6('0x1b')&&typeof _0x38f19f['limit']===_0x03f6('0x1b');var _0x1e62a3=_0x2c36f5[_0x03f6('0x1c')];var _0x151d13=_0x2e6e45?0x0:_0x38f19f[_0x03f6('0x1d')];var _0x1d8749=_0x2e6e45?_0x2c36f5[_0x03f6('0x1c')]:_0x38f19f[_0x03f6('0x1d')]+_0x38f19f[_0x03f6('0x1e')];var _0x5565c6;if(_0x1d8749>=_0x1e62a3){_0x1d8749=_0x1e62a3;_0x5565c6=0xc8;}else{_0x5565c6=0xce;}_0x3c54c8['status'](_0x5565c6);return _0x3c54c8[_0x03f6('0x1f')](_0x03f6('0x20'),_0x151d13+'-'+_0x1d8749+'/'+_0x1e62a3)[_0x03f6('0x1a')](_0x2c36f5);}return null;};}function patchUpdates(_0x781ba8){return function(_0x31dd8b){try{jsonpatch[_0x03f6('0x21')](_0x31dd8b,_0x781ba8,!![]);}catch(_0x10dfe7){return BPromise[_0x03f6('0x22')](_0x10dfe7);}return _0x31dd8b[_0x03f6('0x23')]();};}function saveUpdates(_0x4ee6a5,_0x4c6a28){return function(_0x3defea){if(_0x3defea){return _0x3defea[_0x03f6('0x24')](_0x4ee6a5)[_0x03f6('0x25')](function(_0x286c56){return _0x286c56;});}return null;};}function removeEntity(_0x3539f9,_0x4d1207){return function(_0x1614d8){if(_0x1614d8){return _0x1614d8[_0x03f6('0x26')]()[_0x03f6('0x25')](function(){_0x3539f9[_0x03f6('0x18')](0xcc)[_0x03f6('0x19')]();});}};}function handleEntityNotFound(_0x4fbb84,_0x316bb0){return function(_0x1e340a){if(!_0x1e340a){_0x4fbb84['sendStatus'](0x194);}return _0x1e340a;};}function handleError(_0x3d1c6a,_0x5178d5){_0x5178d5=_0x5178d5||0x1f4;return function(_0x316c38){logger[_0x03f6('0x27')](_0x316c38['stack']);if(_0x316c38['name']){delete _0x316c38[_0x03f6('0x28')];}_0x3d1c6a['status'](_0x5178d5)[_0x03f6('0x29')](_0x316c38);};}exports[_0x03f6('0x2a')]=function(_0x501522,_0x3964ee){var _0x301257={},_0x33620a={},_0x48e5ec={'count':0x0,'rows':[]};var _0x44acce=_[_0x03f6('0x2b')](db[_0x03f6('0x2c')]['rawAttributes'],function(_0x3490e1){return{'name':_0x3490e1[_0x03f6('0x2d')],'type':_0x3490e1[_0x03f6('0x2e')]['key']};});_0x33620a['model']=_[_0x03f6('0x2b')](_0x44acce,_0x03f6('0x28'));_0x33620a['query']=_['keys'](_0x501522[_0x03f6('0x2f')]);_0x33620a[_0x03f6('0x30')]=_[_0x03f6('0x31')](_0x33620a[_0x03f6('0x32')],_0x33620a[_0x03f6('0x2f')]);_0x301257['attributes']=_['intersection'](_0x33620a['model'],qs['fields'](_0x501522[_0x03f6('0x2f')][_0x03f6('0x33')]));_0x301257[_0x03f6('0x34')]=_0x301257[_0x03f6('0x34')][_0x03f6('0x35')]?_0x301257['attributes']:_0x33620a[_0x03f6('0x32')];if(!_0x501522[_0x03f6('0x2f')][_0x03f6('0x36')](_0x03f6('0x37'))){_0x301257[_0x03f6('0x1e')]=qs[_0x03f6('0x1e')](_0x501522[_0x03f6('0x2f')][_0x03f6('0x1e')]);_0x301257['offset']=qs[_0x03f6('0x1d')](_0x501522['query']['offset']);}_0x301257[_0x03f6('0x38')]=qs[_0x03f6('0x39')](_0x501522[_0x03f6('0x2f')][_0x03f6('0x39')]);_0x301257[_0x03f6('0x3a')]=qs[_0x03f6('0x30')](_[_0x03f6('0x3b')](_0x501522[_0x03f6('0x2f')],_0x33620a[_0x03f6('0x30')]),_0x44acce);if(_0x501522['query'][_0x03f6('0x3c')]){_0x301257['where']=_[_0x03f6('0x3d')](_0x301257[_0x03f6('0x3a')],{'$or':_[_0x03f6('0x2b')](_0x44acce,function(_0x16a8c7){if(_0x16a8c7[_0x03f6('0x2e')]!==_0x03f6('0x3e')){var _0x3b6caa={};_0x3b6caa[_0x16a8c7['name']]={'$like':'%'+_0x501522[_0x03f6('0x2f')][_0x03f6('0x3c')]+'%'};return _0x3b6caa;}})});}_0x301257=_[_0x03f6('0x3d')]({},_0x301257,_0x501522[_0x03f6('0x3f')]);var _0x4a91d1={'where':_0x301257[_0x03f6('0x3a')]};return db[_0x03f6('0x2c')][_0x03f6('0x1c')](_0x4a91d1)[_0x03f6('0x25')](function(_0x2c5442){_0x48e5ec['count']=_0x2c5442;if(_0x501522[_0x03f6('0x2f')][_0x03f6('0x40')]){_0x301257[_0x03f6('0x41')]=[{'all':!![]}];}return db[_0x03f6('0x2c')][_0x03f6('0x42')](_0x301257);})[_0x03f6('0x25')](function(_0x1e73fe){_0x48e5ec['rows']=_0x1e73fe;return _0x48e5ec;})['then'](respondWithFilteredResult(_0x3964ee,_0x301257))['catch'](handleError(_0x3964ee,null));};exports['show']=function(_0xc5fd39,_0x2438fb){var _0x48dc4e={'raw':!![],'where':{'id':_0xc5fd39[_0x03f6('0x43')]['id']}},_0x3012dd={};_0x3012dd['model']=_[_0x03f6('0x44')](db['AnalyticTreeReport'][_0x03f6('0x45')]);_0x3012dd['query']=_[_0x03f6('0x44')](_0xc5fd39[_0x03f6('0x2f')]);_0x3012dd['filters']=_[_0x03f6('0x31')](_0x3012dd[_0x03f6('0x32')],_0x3012dd[_0x03f6('0x2f')]);_0x48dc4e['attributes']=_[_0x03f6('0x31')](_0x3012dd['model'],qs[_0x03f6('0x33')](_0xc5fd39[_0x03f6('0x2f')][_0x03f6('0x33')]));_0x48dc4e[_0x03f6('0x34')]=_0x48dc4e[_0x03f6('0x34')]['length']?_0x48dc4e[_0x03f6('0x34')]:_0x3012dd[_0x03f6('0x32')];if(_0xc5fd39[_0x03f6('0x2f')]['includeAll']){_0x48dc4e[_0x03f6('0x41')]=[{'all':!![]}];}_0x48dc4e=_['merge']({},_0x48dc4e,_0xc5fd39[_0x03f6('0x3f')]);return db[_0x03f6('0x2c')]['find'](_0x48dc4e)[_0x03f6('0x25')](handleEntityNotFound(_0x2438fb,null))[_0x03f6('0x25')](respondWithResult(_0x2438fb,null))[_0x03f6('0x46')](handleError(_0x2438fb,null));};exports['create']=function(_0x5295ac,_0x15922c){return db[_0x03f6('0x2c')][_0x03f6('0x47')](_0x5295ac[_0x03f6('0x48')],{})[_0x03f6('0x25')](respondWithResult(_0x15922c,0xc9))['catch'](handleError(_0x15922c,null));};exports[_0x03f6('0x24')]=function(_0x10bfaf,_0x5e583e){if(_0x10bfaf[_0x03f6('0x48')]['id']){delete _0x10bfaf[_0x03f6('0x48')]['id'];}return db[_0x03f6('0x2c')]['find']({'where':{'id':_0x10bfaf['params']['id']}})['then'](handleEntityNotFound(_0x5e583e,null))[_0x03f6('0x25')](saveUpdates(_0x10bfaf[_0x03f6('0x48')],null))[_0x03f6('0x25')](respondWithResult(_0x5e583e,null))[_0x03f6('0x46')](handleError(_0x5e583e,null));};exports[_0x03f6('0x26')]=function(_0x25c680,_0x5f4218){return db[_0x03f6('0x2c')][_0x03f6('0x49')]({'where':{'id':_0x25c680[_0x03f6('0x43')]['id']}})[_0x03f6('0x25')](handleEntityNotFound(_0x5f4218,null))['then'](removeEntity(_0x5f4218,null))[_0x03f6('0x46')](handleError(_0x5f4218,null));};
\ No newline at end of file
+var _0x8eba=['fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','save','update','then','destroy','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','create','body','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv'];(function(_0x47828e,_0x2ee73e){var _0x6d642c=function(_0x1a7cb2){while(--_0x1a7cb2){_0x47828e['push'](_0x47828e['shift']());}};_0x6d642c(++_0x2ee73e);}(_0x8eba,0x173));var _0xa8eb=function(_0x5976f8,_0x1265b7){_0x5976f8=_0x5976f8-0x0;var _0x179715=_0x8eba[_0x5976f8];return _0x179715;};'use strict';var emlformat=require(_0xa8eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa8eb('0x1'));var jsonpatch=require(_0xa8eb('0x2'));var rp=require(_0xa8eb('0x3'));var moment=require(_0xa8eb('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa8eb('0x5'));var path=require(_0xa8eb('0x6'));var sox=require(_0xa8eb('0x7'));var csv=require(_0xa8eb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa8eb('0x9'));var _=require(_0xa8eb('0xa'));var squel=require(_0xa8eb('0xb'));var crypto=require(_0xa8eb('0xc'));var jsforce=require(_0xa8eb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa8eb('0x8'));var querystring=require(_0xa8eb('0xe'));var Papa=require(_0xa8eb('0xf'));var Redis=require(_0xa8eb('0x10'));var authService=require(_0xa8eb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa8eb('0x12'));var hardwareService=require(_0xa8eb('0x13'));var logger=require(_0xa8eb('0x14'))(_0xa8eb('0x15'));var utils=require(_0xa8eb('0x16'));var config=require(_0xa8eb('0x17'));var licenseUtil=require(_0xa8eb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28431c,_0x3996dc){_0x3996dc=_0x3996dc||0xcc;return function(_0x26c5b6){if(_0x26c5b6){return _0x28431c[_0xa8eb('0x19')](_0x3996dc);}return _0x28431c[_0xa8eb('0x1a')](_0x3996dc)[_0xa8eb('0x1b')]();};}function respondWithResult(_0x46b5ae,_0x50970b){_0x50970b=_0x50970b||0xc8;return function(_0x28f917){if(_0x28f917){return _0x46b5ae['status'](_0x50970b)['json'](_0x28f917);}};}function respondWithFilteredResult(_0x38b717,_0x136a94){return function(_0x5bbc11){if(_0x5bbc11){var _0x23b53d=typeof _0x136a94[_0xa8eb('0x1c')]==='undefined'&&typeof _0x136a94[_0xa8eb('0x1d')]===_0xa8eb('0x1e');var _0x15580d=_0x5bbc11[_0xa8eb('0x1f')];var _0x1e1184=_0x23b53d?0x0:_0x136a94[_0xa8eb('0x1c')];var _0x20cbd0=_0x23b53d?_0x5bbc11[_0xa8eb('0x1f')]:_0x136a94[_0xa8eb('0x1c')]+_0x136a94[_0xa8eb('0x1d')];var _0x2a388d;if(_0x20cbd0>=_0x15580d){_0x20cbd0=_0x15580d;_0x2a388d=0xc8;}else{_0x2a388d=0xce;}_0x38b717['status'](_0x2a388d);return _0x38b717['set'](_0xa8eb('0x20'),_0x1e1184+'-'+_0x20cbd0+'/'+_0x15580d)[_0xa8eb('0x21')](_0x5bbc11);}return null;};}function patchUpdates(_0x3033b4){return function(_0x424d1a){try{jsonpatch[_0xa8eb('0x22')](_0x424d1a,_0x3033b4,!![]);}catch(_0x35084d){return BPromise['reject'](_0x35084d);}return _0x424d1a[_0xa8eb('0x23')]();};}function saveUpdates(_0x3934d5,_0x2e0bf3){return function(_0x48d37a){if(_0x48d37a){return _0x48d37a[_0xa8eb('0x24')](_0x3934d5)[_0xa8eb('0x25')](function(_0x32aa54){return _0x32aa54;});}return null;};}function removeEntity(_0x230ce1,_0x28aa0f){return function(_0x1a1cb3){if(_0x1a1cb3){return _0x1a1cb3[_0xa8eb('0x26')]()[_0xa8eb('0x25')](function(){_0x230ce1[_0xa8eb('0x1a')](0xcc)[_0xa8eb('0x1b')]();});}};}function handleEntityNotFound(_0x104baf,_0x1fefbc){return function(_0x2a160a){if(!_0x2a160a){_0x104baf[_0xa8eb('0x19')](0x194);}return _0x2a160a;};}function handleError(_0x3f9c3c,_0x566b12){_0x566b12=_0x566b12||0x1f4;return function(_0x46dbcd){logger[_0xa8eb('0x27')](_0x46dbcd[_0xa8eb('0x28')]);if(_0x46dbcd[_0xa8eb('0x29')]){delete _0x46dbcd['name'];}_0x3f9c3c['status'](_0x566b12)['send'](_0x46dbcd);};}exports[_0xa8eb('0x2a')]=function(_0x54319d,_0x4344d3){var _0x2302f7={},_0x1d0853={},_0x27cc25={'count':0x0,'rows':[]};var _0x27a1b0=_[_0xa8eb('0x2b')](db[_0xa8eb('0x2c')][_0xa8eb('0x2d')],function(_0x522684){return{'name':_0x522684[_0xa8eb('0x2e')],'type':_0x522684[_0xa8eb('0x2f')][_0xa8eb('0x30')]};});_0x1d0853[_0xa8eb('0x31')]=_['map'](_0x27a1b0,_0xa8eb('0x29'));_0x1d0853[_0xa8eb('0x32')]=_[_0xa8eb('0x33')](_0x54319d[_0xa8eb('0x32')]);_0x1d0853[_0xa8eb('0x34')]=_[_0xa8eb('0x35')](_0x1d0853[_0xa8eb('0x31')],_0x1d0853[_0xa8eb('0x32')]);_0x2302f7[_0xa8eb('0x36')]=_[_0xa8eb('0x35')](_0x1d0853[_0xa8eb('0x31')],qs[_0xa8eb('0x37')](_0x54319d[_0xa8eb('0x32')][_0xa8eb('0x37')]));_0x2302f7[_0xa8eb('0x36')]=_0x2302f7[_0xa8eb('0x36')]['length']?_0x2302f7[_0xa8eb('0x36')]:_0x1d0853[_0xa8eb('0x31')];if(!_0x54319d[_0xa8eb('0x32')][_0xa8eb('0x38')](_0xa8eb('0x39'))){_0x2302f7['limit']=qs['limit'](_0x54319d[_0xa8eb('0x32')][_0xa8eb('0x1d')]);_0x2302f7['offset']=qs[_0xa8eb('0x1c')](_0x54319d[_0xa8eb('0x32')][_0xa8eb('0x1c')]);}_0x2302f7[_0xa8eb('0x3a')]=qs['sort'](_0x54319d[_0xa8eb('0x32')][_0xa8eb('0x3b')]);_0x2302f7[_0xa8eb('0x3c')]=qs[_0xa8eb('0x34')](_['pick'](_0x54319d[_0xa8eb('0x32')],_0x1d0853[_0xa8eb('0x34')]),_0x27a1b0);if(_0x54319d[_0xa8eb('0x32')][_0xa8eb('0x3d')]){_0x2302f7[_0xa8eb('0x3c')]=_[_0xa8eb('0x3e')](_0x2302f7[_0xa8eb('0x3c')],{'$or':_['map'](_0x27a1b0,function(_0xc72997){if(_0xc72997[_0xa8eb('0x2f')]!==_0xa8eb('0x3f')){var _0x33e208={};_0x33e208[_0xc72997[_0xa8eb('0x29')]]={'$like':'%'+_0x54319d[_0xa8eb('0x32')][_0xa8eb('0x3d')]+'%'};return _0x33e208;}})});}_0x2302f7=_[_0xa8eb('0x3e')]({},_0x2302f7,_0x54319d['options']);var _0x1090b4={'where':_0x2302f7[_0xa8eb('0x3c')]};return db['AnalyticTreeReport'][_0xa8eb('0x1f')](_0x1090b4)['then'](function(_0x53c87b){_0x27cc25[_0xa8eb('0x1f')]=_0x53c87b;if(_0x54319d[_0xa8eb('0x32')][_0xa8eb('0x40')]){_0x2302f7[_0xa8eb('0x41')]=[{'all':!![]}];}return db[_0xa8eb('0x2c')][_0xa8eb('0x42')](_0x2302f7);})[_0xa8eb('0x25')](function(_0x14f0a3){_0x27cc25[_0xa8eb('0x43')]=_0x14f0a3;return _0x27cc25;})[_0xa8eb('0x25')](respondWithFilteredResult(_0x4344d3,_0x2302f7))[_0xa8eb('0x44')](handleError(_0x4344d3,null));};exports[_0xa8eb('0x45')]=function(_0x22a7ac,_0x3b3b7c){var _0x51d8fa={'raw':!![],'where':{'id':_0x22a7ac['params']['id']}},_0x3b3688={};_0x3b3688[_0xa8eb('0x31')]=_['keys'](db['AnalyticTreeReport'][_0xa8eb('0x2d')]);_0x3b3688[_0xa8eb('0x32')]=_['keys'](_0x22a7ac[_0xa8eb('0x32')]);_0x3b3688[_0xa8eb('0x34')]=_[_0xa8eb('0x35')](_0x3b3688[_0xa8eb('0x31')],_0x3b3688[_0xa8eb('0x32')]);_0x51d8fa[_0xa8eb('0x36')]=_['intersection'](_0x3b3688['model'],qs[_0xa8eb('0x37')](_0x22a7ac[_0xa8eb('0x32')][_0xa8eb('0x37')]));_0x51d8fa[_0xa8eb('0x36')]=_0x51d8fa['attributes'][_0xa8eb('0x46')]?_0x51d8fa[_0xa8eb('0x36')]:_0x3b3688[_0xa8eb('0x31')];if(_0x22a7ac['query'][_0xa8eb('0x40')]){_0x51d8fa[_0xa8eb('0x41')]=[{'all':!![]}];}_0x51d8fa=_[_0xa8eb('0x3e')]({},_0x51d8fa,_0x22a7ac[_0xa8eb('0x47')]);return db[_0xa8eb('0x2c')]['find'](_0x51d8fa)[_0xa8eb('0x25')](handleEntityNotFound(_0x3b3b7c,null))[_0xa8eb('0x25')](respondWithResult(_0x3b3b7c,null))[_0xa8eb('0x44')](handleError(_0x3b3b7c,null));};exports[_0xa8eb('0x48')]=function(_0x338425,_0x3699ff){return db[_0xa8eb('0x2c')][_0xa8eb('0x48')](_0x338425[_0xa8eb('0x49')],{})[_0xa8eb('0x25')](respondWithResult(_0x3699ff,0xc9))[_0xa8eb('0x44')](handleError(_0x3699ff,null));};exports[_0xa8eb('0x24')]=function(_0x80847f,_0x484878){if(_0x80847f['body']['id']){delete _0x80847f[_0xa8eb('0x49')]['id'];}return db[_0xa8eb('0x2c')][_0xa8eb('0x4a')]({'where':{'id':_0x80847f[_0xa8eb('0x4b')]['id']}})[_0xa8eb('0x25')](handleEntityNotFound(_0x484878,null))[_0xa8eb('0x25')](saveUpdates(_0x80847f[_0xa8eb('0x49')],null))[_0xa8eb('0x25')](respondWithResult(_0x484878,null))[_0xa8eb('0x44')](handleError(_0x484878,null));};exports[_0xa8eb('0x26')]=function(_0x1bdbb5,_0x179232){return db[_0xa8eb('0x2c')][_0xa8eb('0x4a')]({'where':{'id':_0x1bdbb5[_0xa8eb('0x4b')]['id']}})[_0xa8eb('0x25')](handleEntityNotFound(_0x179232,null))[_0xa8eb('0x25')](removeEntity(_0x179232,null))[_0xa8eb('0x44')](handleError(_0x179232,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index e995242..58d29d6 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 _0x434f=['./analyticTreeReport.attributes','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment','path','rimraf'];(function(_0x54d5d6,_0x122359){var _0x295fdd=function(_0x524368){while(--_0x524368){_0x54d5d6['push'](_0x54d5d6['shift']());}};_0x295fdd(++_0x122359);}(_0x434f,0x1d7));var _0xf434=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x434f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf434('0x0'));var util=require('util');var logger=require(_0xf434('0x1'))(_0xf434('0x2'));var moment=require(_0xf434('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf434('0x4'));var rimraf=require(_0xf434('0x5'));var config=require('../../config/environment');var attributes=require(_0xf434('0x6'));module['exports']=function(_0x126b27,_0x2a4ea5){return _0x126b27['define'](_0xf434('0x7'),attributes,{'tableName':_0xf434('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfec6=['util','request-promise','path','rimraf','../../config/environment','define','analytics_report_trees','lodash'];(function(_0x2fa1c6,_0x4a5b8d){var _0x5f3257=function(_0x195b53){while(--_0x195b53){_0x2fa1c6['push'](_0x2fa1c6['shift']());}};_0x5f3257(++_0x4a5b8d);}(_0xfec6,0x1a7));var _0x6fec=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xfec6[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x6fec('0x0'));var util=require(_0x6fec('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6fec('0x2'));var fs=require('fs');var path=require(_0x6fec('0x3'));var rimraf=require(_0x6fec('0x4'));var config=require(_0x6fec('0x5'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x5985d3,_0x3409f5){return _0x5985d3[_0x6fec('0x6')]('AnalyticTreeReport',attributes,{'tableName':_0x6fec('0x7'),'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 22be2a0..86bf38a 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2c5a16,_0x446382){var _0x2899e2=function(_0x336fc1){while(--_0x336fc1){_0x2c5a16['push'](_0x2c5a16['shift']());}};_0x2899e2(++_0x446382);}(_0x1261,0x144));var _0x1126=function(_0x3a23d3,_0x4088d8){_0x3a23d3=_0x3a23d3-0x0;var _0x10803b=_0x1261[_0x3a23d3];return _0x10803b;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0xadb5,0xad));var _0x5adb=function(_0x5051dc,_0x37ac45){_0x5051dc=_0x5051dc-0x0;var _0x4b06cf=_0xadb5[_0x5051dc];return _0x4b06cf;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 2adbce1..7c54e03 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 _0x87a4=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','post','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x9307ea,_0x38968a){var _0x295554=function(_0x342dcf){while(--_0x342dcf){_0x9307ea['push'](_0x9307ea['shift']());}};_0x295554(++_0x38968a);}(_0x87a4,0x79));var _0x487a=function(_0x228cbd,_0x25035c){_0x228cbd=_0x228cbd-0x0;var _0x3e83dc=_0x87a4[_0x228cbd];return _0x3e83dc;};'use strict';var multer=require('multer');var util=require(_0x487a('0x0'));var path=require(_0x487a('0x1'));var timeout=require(_0x487a('0x2'));var express=require(_0x487a('0x3'));var router=express[_0x487a('0x4')]();var fs_extra=require(_0x487a('0x5'));var auth=require(_0x487a('0x6'));var interaction=require(_0x487a('0x7'));var config=require(_0x487a('0x8'));var controller=require(_0x487a('0x9'));router[_0x487a('0xa')]('/',auth[_0x487a('0xb')](),controller['index']);router[_0x487a('0xa')]('/:id',auth[_0x487a('0xb')](),controller['show']);router[_0x487a('0xc')]('/',auth[_0x487a('0xb')](),controller['create']);router[_0x487a('0xd')](_0x487a('0xe'),auth['isAuthenticated'](),controller[_0x487a('0xf')]);router[_0x487a('0x10')](_0x487a('0xe'),auth[_0x487a('0xb')](),controller['destroy']);module[_0x487a('0x11')]=router;
\ No newline at end of file
+var _0x1dfd=['get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x38caad,_0x1c732e){var _0x3e3dba=function(_0x48ce69){while(--_0x48ce69){_0x38caad['push'](_0x38caad['shift']());}};_0x3e3dba(++_0x1c732e);}(_0x1dfd,0xe7));var _0xd1df=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1dfd[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require(_0xd1df('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd1df('0x1'));var router=express[_0xd1df('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd1df('0x3'));var interaction=require(_0xd1df('0x4'));var config=require(_0xd1df('0x5'));var controller=require(_0xd1df('0x6'));router[_0xd1df('0x7')]('/',auth[_0xd1df('0x8')](),controller[_0xd1df('0x9')]);router[_0xd1df('0x7')](_0xd1df('0xa'),auth[_0xd1df('0x8')](),controller[_0xd1df('0xb')]);router[_0xd1df('0xc')]('/',auth[_0xd1df('0x8')](),controller['create']);router[_0xd1df('0xd')](_0xd1df('0xa'),auth[_0xd1df('0x8')](),controller[_0xd1df('0xe')]);router[_0xd1df('0xf')](_0xd1df('0xa'),auth[_0xd1df('0x8')](),controller[_0xd1df('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 9794a89..72e836b 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 _0xbed7=['STRING','sequelize','exports'];(function(_0x36bb32,_0x1cd320){var _0x140e42=function(_0x348e04){while(--_0x348e04){_0x36bb32['push'](_0x36bb32['shift']());}};_0x140e42(++_0x1cd320);}(_0xbed7,0x14b));var _0x7bed=function(_0x36d3a1,_0x3c1a69){_0x36d3a1=_0x36d3a1-0x0;var _0x506ade=_0xbed7[_0x36d3a1];return _0x506ade;};'use strict';var Sequelize=require(_0x7bed('0x0'));module[_0x7bed('0x1')]={'name':{'type':Sequelize[_0x7bed('0x2')]},'basename':{'type':Sequelize[_0x7bed('0x2')]},'type':{'type':Sequelize[_0x7bed('0x2')]}};
\ No newline at end of file
+var _0xb458=['STRING','sequelize','exports'];(function(_0x32f8a2,_0x49c502){var _0x258cca=function(_0x1040e4){while(--_0x1040e4){_0x32f8a2['push'](_0x32f8a2['shift']());}};_0x258cca(++_0x49c502);}(_0xb458,0x103));var _0x8b45=function(_0x1f5048,_0x35594a){_0x1f5048=_0x1f5048-0x0;var _0x4f17fd=_0xb458[_0x1f5048];return _0x4f17fd;};'use strict';var Sequelize=require(_0x8b45('0x0'));module[_0x8b45('0x1')]={'name':{'type':Sequelize[_0x8b45('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 54c4636..c76cbeb 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 _0x5f85=['status','end','json','offset','limit','undefined','count','set','save','update','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','type','key','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','model','keys','find','clone','omit','updatedAt','body','create','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x5f85,0x96));var _0x55f8=function(_0x17ff9f,_0x39bc4d){_0x17ff9f=_0x17ff9f-0x0;var _0xc76826=_0x5f85[_0x17ff9f];return _0xc76826;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x55f8('0x0'));var zipdir=require(_0x55f8('0x1'));var jsonpatch=require(_0x55f8('0x2'));var rp=require('request-promise');var moment=require(_0x55f8('0x3'));var BPromise=require(_0x55f8('0x4'));var Mustache=require('mustache');var util=require(_0x55f8('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x55f8('0x6'));var ejs=require(_0x55f8('0x7'));var fs=require('fs');var fs_extra=require(_0x55f8('0x8'));var _=require(_0x55f8('0x9'));var squel=require(_0x55f8('0xa'));var crypto=require(_0x55f8('0xb'));var jsforce=require(_0x55f8('0xc'));var deskjs=require(_0x55f8('0xd'));var toCsv=require(_0x55f8('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x55f8('0xe'));var authService=require(_0x55f8('0xf'));var qs=require(_0x55f8('0x10'));var as=require(_0x55f8('0x11'));var hardwareService=require(_0x55f8('0x12'));var logger=require(_0x55f8('0x13'))(_0x55f8('0x14'));var utils=require(_0x55f8('0x15'));var config=require(_0x55f8('0x16'));var licenseUtil=require(_0x55f8('0x17'));var db=require(_0x55f8('0x18'))['db'];function respondWithStatusCode(_0x332bc9,_0x1733af){_0x1733af=_0x1733af||0xcc;return function(_0x1a8fb8){if(_0x1a8fb8){return _0x332bc9[_0x55f8('0x19')](_0x1733af);}return _0x332bc9[_0x55f8('0x1a')](_0x1733af)[_0x55f8('0x1b')]();};}function respondWithResult(_0x1b4ab7,_0x762bb4){_0x762bb4=_0x762bb4||0xc8;return function(_0x391231){if(_0x391231){return _0x1b4ab7[_0x55f8('0x1a')](_0x762bb4)[_0x55f8('0x1c')](_0x391231);}};}function respondWithFilteredResult(_0x415b13,_0x5173aa){return function(_0x1a2a19){if(_0x1a2a19){var _0x54b943=typeof _0x5173aa[_0x55f8('0x1d')]==='undefined'&&typeof _0x5173aa[_0x55f8('0x1e')]===_0x55f8('0x1f');var _0x288a6d=_0x1a2a19[_0x55f8('0x20')];var _0x490710=_0x54b943?0x0:_0x5173aa[_0x55f8('0x1d')];var _0x1e10fc=_0x54b943?_0x1a2a19['count']:_0x5173aa[_0x55f8('0x1d')]+_0x5173aa[_0x55f8('0x1e')];var _0x2164f8;if(_0x1e10fc>=_0x288a6d){_0x1e10fc=_0x288a6d;_0x2164f8=0xc8;}else{_0x2164f8=0xce;}_0x415b13[_0x55f8('0x1a')](_0x2164f8);return _0x415b13[_0x55f8('0x21')]('Content-Range',_0x490710+'-'+_0x1e10fc+'/'+_0x288a6d)[_0x55f8('0x1c')](_0x1a2a19);}return null;};}function patchUpdates(_0x52cbee){return function(_0x5a3bb9){try{jsonpatch['apply'](_0x5a3bb9,_0x52cbee,!![]);}catch(_0x2731c5){return BPromise['reject'](_0x2731c5);}return _0x5a3bb9[_0x55f8('0x22')]();};}function saveUpdates(_0x35aa51,_0x455bea){return function(_0x45ac20){if(_0x45ac20){return _0x45ac20[_0x55f8('0x23')](_0x35aa51)[_0x55f8('0x24')](function(_0xf6eb2f){return _0xf6eb2f;});}return null;};}function removeEntity(_0x5dd147,_0x50561c){return function(_0x596a49){if(_0x596a49){return _0x596a49[_0x55f8('0x25')]()[_0x55f8('0x24')](function(){_0x5dd147['status'](0xcc)[_0x55f8('0x1b')]();});}};}function handleEntityNotFound(_0x242ca1,_0xee16f){return function(_0x19f269){if(!_0x19f269){_0x242ca1[_0x55f8('0x19')](0x194);}return _0x19f269;};}function handleError(_0x19ee19,_0x4be19e){_0x4be19e=_0x4be19e||0x1f4;return function(_0x474b55){logger[_0x55f8('0x26')](_0x474b55[_0x55f8('0x27')]);if(_0x474b55[_0x55f8('0x28')]){delete _0x474b55['name'];}_0x19ee19[_0x55f8('0x1a')](_0x4be19e)['send'](_0x474b55);};}exports[_0x55f8('0x29')]=function(_0x42e4c2,_0x481079){var _0x58895a={},_0x36bcd5={},_0x140d61={'count':0x0,'rows':[]};var _0x5b0c8d=_[_0x55f8('0x2a')](db[_0x55f8('0x2b')][_0x55f8('0x2c')],function(_0x541fbf){return{'name':_0x541fbf['fieldName'],'type':_0x541fbf[_0x55f8('0x2d')][_0x55f8('0x2e')]};});_0x36bcd5['model']=_['map'](_0x5b0c8d,_0x55f8('0x28'));_0x36bcd5[_0x55f8('0x2f')]=_['keys'](_0x42e4c2[_0x55f8('0x2f')]);_0x36bcd5[_0x55f8('0x30')]=_[_0x55f8('0x31')](_0x36bcd5['model'],_0x36bcd5[_0x55f8('0x2f')]);_0x58895a[_0x55f8('0x32')]=_['intersection'](_0x36bcd5['model'],qs['fields'](_0x42e4c2['query'][_0x55f8('0x33')]));_0x58895a[_0x55f8('0x32')]=_0x58895a[_0x55f8('0x32')][_0x55f8('0x34')]?_0x58895a[_0x55f8('0x32')]:_0x36bcd5['model'];if(!_0x42e4c2[_0x55f8('0x2f')][_0x55f8('0x35')](_0x55f8('0x36'))){_0x58895a['limit']=qs[_0x55f8('0x1e')](_0x42e4c2[_0x55f8('0x2f')][_0x55f8('0x1e')]);_0x58895a[_0x55f8('0x1d')]=qs[_0x55f8('0x1d')](_0x42e4c2[_0x55f8('0x2f')][_0x55f8('0x1d')]);}_0x58895a['order']=qs[_0x55f8('0x37')](_0x42e4c2[_0x55f8('0x2f')][_0x55f8('0x37')]);_0x58895a[_0x55f8('0x38')]=qs[_0x55f8('0x30')](_['pick'](_0x42e4c2[_0x55f8('0x2f')],_0x36bcd5[_0x55f8('0x30')]),_0x5b0c8d);if(_0x42e4c2[_0x55f8('0x2f')][_0x55f8('0x39')]){_0x58895a['where']=_[_0x55f8('0x3a')](_0x58895a['where'],{'$or':_[_0x55f8('0x2a')](_0x5b0c8d,function(_0x30319d){if(_0x30319d[_0x55f8('0x2d')]!==_0x55f8('0x3b')){var _0x40b490={};_0x40b490[_0x30319d[_0x55f8('0x28')]]={'$like':'%'+_0x42e4c2[_0x55f8('0x2f')][_0x55f8('0x39')]+'%'};return _0x40b490;}})});}_0x58895a=_[_0x55f8('0x3a')]({},_0x58895a,_0x42e4c2[_0x55f8('0x3c')]);var _0x545293={'where':_0x58895a[_0x55f8('0x38')]};return db[_0x55f8('0x2b')]['count'](_0x545293)[_0x55f8('0x24')](function(_0x190c1e){_0x140d61[_0x55f8('0x20')]=_0x190c1e;if(_0x42e4c2['query'][_0x55f8('0x3d')]){_0x58895a[_0x55f8('0x3e')]=[{'all':!![]}];}return db[_0x55f8('0x2b')][_0x55f8('0x3f')](_0x58895a);})[_0x55f8('0x24')](function(_0x1d1fb0){_0x140d61[_0x55f8('0x40')]=_0x1d1fb0;return _0x140d61;})[_0x55f8('0x24')](respondWithFilteredResult(_0x481079,_0x58895a))[_0x55f8('0x41')](handleError(_0x481079,null));};exports[_0x55f8('0x42')]=function(_0x2b3e1d,_0x1303fd){var _0xc88fd0={'raw':!![],'where':{'id':_0x2b3e1d[_0x55f8('0x43')]['id']}},_0x22d65e={};_0x22d65e[_0x55f8('0x44')]=_[_0x55f8('0x45')](db['Attachment'][_0x55f8('0x2c')]);_0x22d65e[_0x55f8('0x2f')]=_['keys'](_0x2b3e1d[_0x55f8('0x2f')]);_0x22d65e[_0x55f8('0x30')]=_['intersection'](_0x22d65e[_0x55f8('0x44')],_0x22d65e[_0x55f8('0x2f')]);_0xc88fd0[_0x55f8('0x32')]=_['intersection'](_0x22d65e[_0x55f8('0x44')],qs['fields'](_0x2b3e1d['query'][_0x55f8('0x33')]));_0xc88fd0[_0x55f8('0x32')]=_0xc88fd0[_0x55f8('0x32')][_0x55f8('0x34')]?_0xc88fd0[_0x55f8('0x32')]:_0x22d65e[_0x55f8('0x44')];if(_0x2b3e1d[_0x55f8('0x2f')]['includeAll']){_0xc88fd0[_0x55f8('0x3e')]=[{'all':!![]}];}_0xc88fd0=_['merge']({},_0xc88fd0,_0x2b3e1d[_0x55f8('0x3c')]);return db[_0x55f8('0x2b')][_0x55f8('0x46')](_0xc88fd0)[_0x55f8('0x24')](handleEntityNotFound(_0x1303fd,null))['then'](respondWithResult(_0x1303fd,null))[_0x55f8('0x41')](handleError(_0x1303fd,null));};exports[_0x55f8('0x47')]=function(_0x9cd5bc,_0x57a6f4){var _0x285d12={'where':{'id':_0x9cd5bc[_0x55f8('0x43')]['id']}},_0x4e0497={};_0x4e0497[_0x55f8('0x44')]=_[_0x55f8('0x45')](db[_0x55f8('0x2b')]['rawAttributes']);_0x285d12[_0x55f8('0x32')]=_[_0x55f8('0x31')](_0x4e0497['model'],qs[_0x55f8('0x33')](_0x9cd5bc[_0x55f8('0x2f')][_0x55f8('0x33')]));_0x285d12[_0x55f8('0x32')]=_0x285d12[_0x55f8('0x32')][_0x55f8('0x34')]?_0x285d12[_0x55f8('0x32')]:_0x4e0497['model'];if(_0x9cd5bc[_0x55f8('0x2f')][_0x55f8('0x3d')]){_0x285d12[_0x55f8('0x3e')]=[{'all':!![]}];}_0x285d12=_['merge']({},_0x285d12,_0x9cd5bc[_0x55f8('0x3c')]);return db[_0x55f8('0x2b')][_0x55f8('0x46')](_0x285d12)[_0x55f8('0x24')](handleEntityNotFound(_0x57a6f4,null))['then'](function(_0x391e92){if(_0x391e92){var _0xa1169d=_0x391e92['get']({'plain':!![]});_0xa1169d=qs[_0x55f8('0x48')](_0xa1169d,['id','createdAt',_0x55f8('0x49')]);_0x9cd5bc[_0x55f8('0x4a')]=_[_0x55f8('0x48')](_0x9cd5bc[_0x55f8('0x4a')],['id','createdAt',_0x55f8('0x49')]);return db[_0x55f8('0x2b')][_0x55f8('0x4b')](_[_0x55f8('0x3a')](_0xa1169d,_0x9cd5bc['body']),{'include':_0x9cd5bc[_0x55f8('0x2f')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x55f8('0x24')](respondWithResult(_0x57a6f4,0xc9))['catch'](handleError(_0x57a6f4,null));};exports[_0x55f8('0x23')]=function(_0xa97c90,_0x474b06){if(_0xa97c90[_0x55f8('0x4a')]['id']){delete _0xa97c90[_0x55f8('0x4a')]['id'];}return db[_0x55f8('0x2b')][_0x55f8('0x46')]({'where':{'id':_0xa97c90[_0x55f8('0x43')]['id']}})[_0x55f8('0x24')](handleEntityNotFound(_0x474b06,null))[_0x55f8('0x24')](saveUpdates(_0xa97c90['body'],null))[_0x55f8('0x24')](respondWithResult(_0x474b06,null))[_0x55f8('0x41')](handleError(_0x474b06,null));};exports[_0x55f8('0x25')]=function(_0x52d478,_0x36742b){return db['Attachment']['find']({'where':{'id':_0x52d478[_0x55f8('0x43')]['id']}})[_0x55f8('0x24')](handleEntityNotFound(_0x36742b,null))[_0x55f8('0x24')](removeEntity(_0x36742b,null))[_0x55f8('0x41')](handleError(_0x36742b,null));};exports[_0x55f8('0x4b')]=function(_0x530843,_0x4c0f2c,_0x4b3108){_0x530843[_0x55f8('0x4a')][_0x55f8('0x28')]=_0x530843['file'][_0x55f8('0x4c')];_0x530843['body'][_0x55f8('0x4d')]=_0x530843[_0x55f8('0x4e')][_0x55f8('0x4f')];_0x530843[_0x55f8('0x4a')]['type']=_0x530843[_0x55f8('0x4e')][_0x55f8('0x50')];return db[_0x55f8('0x2b')]['create'](_0x530843[_0x55f8('0x4a')])['then'](respondWithResult(_0x4c0f2c,0xc9))[_0x55f8('0x41')](handleError(_0x4c0f2c,null));};exports[_0x55f8('0x51')]=function(_0x372b24,_0xac3cf8,_0xb484fe){return db['Attachment'][_0x55f8('0x52')]({'where':{'id':_0x372b24[_0x55f8('0x43')]['id']},'raw':!![]})[_0x55f8('0x24')](handleEntityNotFound(_0xac3cf8,null))[_0x55f8('0x24')](function(_0x82cfd8){if(_0x82cfd8){var _0x28dabf=_0x82cfd8[_0x55f8('0x53')]!==null;var _0x5bc4e7=path[_0x55f8('0x54')](config[_0x55f8('0x55')],_0x55f8('0x56'));if(_0x28dabf){_0x5bc4e7=path[_0x55f8('0x54')](_0x5bc4e7,_0x55f8('0x57'));}var _0x28ee82=path[_0x55f8('0x54')](_0x5bc4e7,_0x82cfd8['basename']);return _0xac3cf8['download'](_0x28ee82);}})[_0x55f8('0x41')](handleError(_0xac3cf8,null));};
\ No newline at end of file
+var _0x7710=['basename','filename','type','findOne','join','root','server/files/attachments/','download','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','offset','undefined','count','Content-Range','json','apply','update','then','destroy','sendStatus','name','map','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','Attachment','includeAll','include','findAll','rows','show','params','rawAttributes','find','get','omit','body','create','catch','file','originalname'];(function(_0x271026,_0x40c532){var _0x6366a1=function(_0x5c770b){while(--_0x5c770b){_0x271026['push'](_0x271026['shift']());}};_0x6366a1(++_0x40c532);}(_0x7710,0x1dc));var _0x0771=function(_0x2debdf,_0x14c17){_0x2debdf=_0x2debdf-0x0;var _0xdee766=_0x7710[_0x2debdf];return _0xdee766;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0771('0x0'));var zipdir=require(_0x0771('0x1'));var jsonpatch=require(_0x0771('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0771('0x3'));var Mustache=require(_0x0771('0x4'));var util=require(_0x0771('0x5'));var path=require(_0x0771('0x6'));var sox=require(_0x0771('0x7'));var csv=require('to-csv');var ejs=require(_0x0771('0x8'));var fs=require('fs');var fs_extra=require(_0x0771('0x9'));var _=require(_0x0771('0xa'));var squel=require(_0x0771('0xb'));var crypto=require('crypto');var jsforce=require(_0x0771('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0771('0xd'));var querystring=require(_0x0771('0xe'));var Papa=require(_0x0771('0xf'));var Redis=require('ioredis');var authService=require(_0x0771('0x10'));var qs=require(_0x0771('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0771('0x12'));var logger=require('../../config/logger')(_0x0771('0x13'));var utils=require(_0x0771('0x14'));var config=require(_0x0771('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x122ca6,_0x526737){_0x526737=_0x526737||0xcc;return function(_0xd34bb){if(_0xd34bb){return _0x122ca6['sendStatus'](_0x526737);}return _0x122ca6[_0x0771('0x16')](_0x526737)[_0x0771('0x17')]();};}function respondWithResult(_0x17733b,_0x233ed0){_0x233ed0=_0x233ed0||0xc8;return function(_0x4d453a){if(_0x4d453a){return _0x17733b['status'](_0x233ed0)['json'](_0x4d453a);}};}function respondWithFilteredResult(_0x20175c,_0x492205){return function(_0x4409bd){if(_0x4409bd){var _0x5461d2=typeof _0x492205[_0x0771('0x18')]==='undefined'&&typeof _0x492205['limit']===_0x0771('0x19');var _0x577aea=_0x4409bd[_0x0771('0x1a')];var _0x44a7ad=_0x5461d2?0x0:_0x492205[_0x0771('0x18')];var _0x1e27cb=_0x5461d2?_0x4409bd[_0x0771('0x1a')]:_0x492205[_0x0771('0x18')]+_0x492205['limit'];var _0x58ac2c;if(_0x1e27cb>=_0x577aea){_0x1e27cb=_0x577aea;_0x58ac2c=0xc8;}else{_0x58ac2c=0xce;}_0x20175c[_0x0771('0x16')](_0x58ac2c);return _0x20175c['set'](_0x0771('0x1b'),_0x44a7ad+'-'+_0x1e27cb+'/'+_0x577aea)[_0x0771('0x1c')](_0x4409bd);}return null;};}function patchUpdates(_0x3dd467){return function(_0x18f2a1){try{jsonpatch[_0x0771('0x1d')](_0x18f2a1,_0x3dd467,!![]);}catch(_0x1526e3){return BPromise['reject'](_0x1526e3);}return _0x18f2a1['save']();};}function saveUpdates(_0x2b8a24,_0x48aeb9){return function(_0x36ec1a){if(_0x36ec1a){return _0x36ec1a[_0x0771('0x1e')](_0x2b8a24)[_0x0771('0x1f')](function(_0x51e6f8){return _0x51e6f8;});}return null;};}function removeEntity(_0x1afead,_0x54869d){return function(_0x34b4fe){if(_0x34b4fe){return _0x34b4fe[_0x0771('0x20')]()[_0x0771('0x1f')](function(){_0x1afead[_0x0771('0x16')](0xcc)[_0x0771('0x17')]();});}};}function handleEntityNotFound(_0x30e6e4,_0x48a29d){return function(_0x3c802a){if(!_0x3c802a){_0x30e6e4[_0x0771('0x21')](0x194);}return _0x3c802a;};}function handleError(_0x412697,_0x4fbb8e){_0x4fbb8e=_0x4fbb8e||0x1f4;return function(_0x5ed17c){logger['error'](_0x5ed17c['stack']);if(_0x5ed17c['name']){delete _0x5ed17c[_0x0771('0x22')];}_0x412697[_0x0771('0x16')](_0x4fbb8e)['send'](_0x5ed17c);};}exports['index']=function(_0x55618d,_0x381cdf){var _0x500b9c={},_0x22c768={},_0x323ada={'count':0x0,'rows':[]};var _0x3fd35c=_[_0x0771('0x23')](db['Attachment']['rawAttributes'],function(_0xf61b71){return{'name':_0xf61b71['fieldName'],'type':_0xf61b71['type'][_0x0771('0x24')]};});_0x22c768[_0x0771('0x25')]=_['map'](_0x3fd35c,_0x0771('0x22'));_0x22c768['query']=_[_0x0771('0x26')](_0x55618d[_0x0771('0x27')]);_0x22c768['filters']=_[_0x0771('0x28')](_0x22c768['model'],_0x22c768[_0x0771('0x27')]);_0x500b9c[_0x0771('0x29')]=_[_0x0771('0x28')](_0x22c768[_0x0771('0x25')],qs[_0x0771('0x2a')](_0x55618d[_0x0771('0x27')]['fields']));_0x500b9c[_0x0771('0x29')]=_0x500b9c['attributes'][_0x0771('0x2b')]?_0x500b9c[_0x0771('0x29')]:_0x22c768['model'];if(!_0x55618d[_0x0771('0x27')][_0x0771('0x2c')](_0x0771('0x2d'))){_0x500b9c[_0x0771('0x2e')]=qs['limit'](_0x55618d[_0x0771('0x27')][_0x0771('0x2e')]);_0x500b9c[_0x0771('0x18')]=qs[_0x0771('0x18')](_0x55618d['query'][_0x0771('0x18')]);}_0x500b9c[_0x0771('0x2f')]=qs[_0x0771('0x30')](_0x55618d[_0x0771('0x27')][_0x0771('0x30')]);_0x500b9c[_0x0771('0x31')]=qs[_0x0771('0x32')](_['pick'](_0x55618d[_0x0771('0x27')],_0x22c768['filters']),_0x3fd35c);if(_0x55618d['query']['filter']){_0x500b9c[_0x0771('0x31')]=_[_0x0771('0x33')](_0x500b9c['where'],{'$or':_[_0x0771('0x23')](_0x3fd35c,function(_0x2767e0){if(_0x2767e0['type']!==_0x0771('0x34')){var _0x1b013c={};_0x1b013c[_0x2767e0[_0x0771('0x22')]]={'$like':'%'+_0x55618d[_0x0771('0x27')]['filter']+'%'};return _0x1b013c;}})});}_0x500b9c=_[_0x0771('0x33')]({},_0x500b9c,_0x55618d[_0x0771('0x35')]);var _0x594865={'where':_0x500b9c[_0x0771('0x31')]};return db[_0x0771('0x36')]['count'](_0x594865)['then'](function(_0x8e6587){_0x323ada[_0x0771('0x1a')]=_0x8e6587;if(_0x55618d[_0x0771('0x27')][_0x0771('0x37')]){_0x500b9c[_0x0771('0x38')]=[{'all':!![]}];}return db[_0x0771('0x36')][_0x0771('0x39')](_0x500b9c);})[_0x0771('0x1f')](function(_0x1eda42){_0x323ada[_0x0771('0x3a')]=_0x1eda42;return _0x323ada;})[_0x0771('0x1f')](respondWithFilteredResult(_0x381cdf,_0x500b9c))['catch'](handleError(_0x381cdf,null));};exports[_0x0771('0x3b')]=function(_0x6e4a1a,_0x567fa5){var _0x4b7ea1={'raw':!![],'where':{'id':_0x6e4a1a[_0x0771('0x3c')]['id']}},_0x392f69={};_0x392f69[_0x0771('0x25')]=_['keys'](db[_0x0771('0x36')][_0x0771('0x3d')]);_0x392f69[_0x0771('0x27')]=_['keys'](_0x6e4a1a['query']);_0x392f69[_0x0771('0x32')]=_[_0x0771('0x28')](_0x392f69[_0x0771('0x25')],_0x392f69['query']);_0x4b7ea1[_0x0771('0x29')]=_[_0x0771('0x28')](_0x392f69[_0x0771('0x25')],qs[_0x0771('0x2a')](_0x6e4a1a['query'][_0x0771('0x2a')]));_0x4b7ea1['attributes']=_0x4b7ea1[_0x0771('0x29')][_0x0771('0x2b')]?_0x4b7ea1[_0x0771('0x29')]:_0x392f69['model'];if(_0x6e4a1a[_0x0771('0x27')][_0x0771('0x37')]){_0x4b7ea1['include']=[{'all':!![]}];}_0x4b7ea1=_[_0x0771('0x33')]({},_0x4b7ea1,_0x6e4a1a[_0x0771('0x35')]);return db['Attachment']['find'](_0x4b7ea1)['then'](handleEntityNotFound(_0x567fa5,null))[_0x0771('0x1f')](respondWithResult(_0x567fa5,null))['catch'](handleError(_0x567fa5,null));};exports['clone']=function(_0x37b83e,_0x34e394){var _0x486296={'where':{'id':_0x37b83e[_0x0771('0x3c')]['id']}},_0x292ea5={};_0x292ea5[_0x0771('0x25')]=_[_0x0771('0x26')](db[_0x0771('0x36')]['rawAttributes']);_0x486296[_0x0771('0x29')]=_[_0x0771('0x28')](_0x292ea5[_0x0771('0x25')],qs[_0x0771('0x2a')](_0x37b83e['query'][_0x0771('0x2a')]));_0x486296['attributes']=_0x486296[_0x0771('0x29')][_0x0771('0x2b')]?_0x486296['attributes']:_0x292ea5[_0x0771('0x25')];if(_0x37b83e['query'][_0x0771('0x37')]){_0x486296['include']=[{'all':!![]}];}_0x486296=_[_0x0771('0x33')]({},_0x486296,_0x37b83e[_0x0771('0x35')]);return db['Attachment'][_0x0771('0x3e')](_0x486296)[_0x0771('0x1f')](handleEntityNotFound(_0x34e394,null))[_0x0771('0x1f')](function(_0x575cea){if(_0x575cea){var _0x2fea89=_0x575cea[_0x0771('0x3f')]({'plain':!![]});_0x2fea89=qs[_0x0771('0x40')](_0x2fea89,['id','createdAt','updatedAt']);_0x37b83e[_0x0771('0x41')]=_[_0x0771('0x40')](_0x37b83e[_0x0771('0x41')],['id','createdAt','updatedAt']);return db[_0x0771('0x36')][_0x0771('0x42')](_[_0x0771('0x33')](_0x2fea89,_0x37b83e[_0x0771('0x41')]),{'include':_0x37b83e[_0x0771('0x27')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x0771('0x1f')](respondWithResult(_0x34e394,0xc9))['catch'](handleError(_0x34e394,null));};exports[_0x0771('0x1e')]=function(_0x523fa9,_0x3d0822){if(_0x523fa9['body']['id']){delete _0x523fa9[_0x0771('0x41')]['id'];}return db['Attachment'][_0x0771('0x3e')]({'where':{'id':_0x523fa9[_0x0771('0x3c')]['id']}})[_0x0771('0x1f')](handleEntityNotFound(_0x3d0822,null))[_0x0771('0x1f')](saveUpdates(_0x523fa9['body'],null))[_0x0771('0x1f')](respondWithResult(_0x3d0822,null))[_0x0771('0x43')](handleError(_0x3d0822,null));};exports[_0x0771('0x20')]=function(_0x17492b,_0x21fa8b){return db[_0x0771('0x36')]['find']({'where':{'id':_0x17492b[_0x0771('0x3c')]['id']}})[_0x0771('0x1f')](handleEntityNotFound(_0x21fa8b,null))[_0x0771('0x1f')](removeEntity(_0x21fa8b,null))['catch'](handleError(_0x21fa8b,null));};exports['create']=function(_0x28e096,_0x12a98f,_0x476906){_0x28e096['body'][_0x0771('0x22')]=_0x28e096[_0x0771('0x44')][_0x0771('0x45')];_0x28e096[_0x0771('0x41')][_0x0771('0x46')]=_0x28e096['file'][_0x0771('0x47')];_0x28e096[_0x0771('0x41')][_0x0771('0x48')]=_0x28e096[_0x0771('0x44')]['mimetype'];return db['Attachment']['create'](_0x28e096['body'])[_0x0771('0x1f')](respondWithResult(_0x12a98f,0xc9))[_0x0771('0x43')](handleError(_0x12a98f,null));};exports['download']=function(_0x3504cc,_0x49f31b,_0xdab3a8){return db['Attachment'][_0x0771('0x49')]({'where':{'id':_0x3504cc['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x49f31b,null))[_0x0771('0x1f')](function(_0x13d2bc){if(_0x13d2bc){var _0x1cace6=_0x13d2bc['ChatOfflineMessageId']!==null;var _0x106627=path[_0x0771('0x4a')](config[_0x0771('0x4b')],_0x0771('0x4c'));if(_0x1cace6){_0x106627=path[_0x0771('0x4a')](_0x106627,'offline-chat/');}var _0x1afc69=path['join'](_0x106627,_0x13d2bc['basename']);return _0x49f31b[_0x0771('0x4d')](_0x1afc69);}})['catch'](handleError(_0x49f31b,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index bd2108d..45cbe1a 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 _0x0d63=['path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x520730,_0x79aaf4){var _0x1403c6=function(_0x575551){while(--_0x575551){_0x520730['push'](_0x520730['shift']());}};_0x1403c6(++_0x79aaf4);}(_0x0d63,0x18e));var _0x30d6=function(_0x485038,_0x3e26e8){_0x485038=_0x485038-0x0;var _0xa87ace=_0x0d63[_0x485038];return _0xa87ace;};'use strict';var _=require(_0x30d6('0x0'));var util=require(_0x30d6('0x1'));var logger=require(_0x30d6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x30d6('0x3'));var rp=require(_0x30d6('0x4'));var fs=require('fs');var path=require(_0x30d6('0x5'));var rimraf=require(_0x30d6('0x6'));var config=require(_0x30d6('0x7'));var attributes=require(_0x30d6('0x8'));module[_0x30d6('0x9')]=function(_0x5eb9f5,_0x13c49c){return _0x5eb9f5[_0x30d6('0xa')](_0x30d6('0xb'),attributes,{'tableName':_0x30d6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe335=['bluebird','request-promise','path','rimraf','define','Attachment','attachments','moment'];(function(_0x1a9bdf,_0x43130a){var _0x61a042=function(_0x13fdf5){while(--_0x13fdf5){_0x1a9bdf['push'](_0x1a9bdf['shift']());}};_0x61a042(++_0x43130a);}(_0xe335,0x1bf));var _0x5e33=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xe335[_0x46698a];return _0x356db0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5e33('0x0'));var BPromise=require(_0x5e33('0x1'));var rp=require(_0x5e33('0x2'));var fs=require('fs');var path=require(_0x5e33('0x3'));var rimraf=require(_0x5e33('0x4'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module['exports']=function(_0x2f5bf2,_0x48bbba){return _0x2f5bf2[_0x5e33('0x5')](_0x5e33('0x6'),attributes,{'tableName':_0x5e33('0x7'),'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 5527d8e..dabe13f 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 _0x0506=['catch','CreateAttachment','Attachment','raw','then','lodash','util','moment','../../config/utils','rpc','client','http','request','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0x0506,0x1d1));var _0x6050=function(_0x4355f5,_0x3dfdfb){_0x4355f5=_0x4355f5-0x0;var _0x436ada=_0x0506[_0x4355f5];return _0x436ada;};'use strict';var _=require(_0x6050('0x0'));var util=require(_0x6050('0x1'));var moment=require(_0x6050('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(_0x6050('0x3'));var logger=require('../../config/logger')(_0x6050('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6050('0x5')][_0x6050('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2a3644,_0x1a89fb,_0x3512ba){return new BPromise(function(_0xf64de5,_0x4068d3){return client[_0x6050('0x7')](_0x2a3644,_0x3512ba)['then'](function(_0x312217){logger['info'](_0x6050('0x8'),_0x1a89fb,_0x6050('0x9'));logger[_0x6050('0xa')](_0x6050('0xb'),_0x1a89fb,_0x6050('0x9'),JSON[_0x6050('0xc')](_0x312217));if(_0x312217[_0x6050('0xd')]){if(_0x312217[_0x6050('0xd')][_0x6050('0xe')]===0x1f4){logger[_0x6050('0xd')]('Attachment,\x20%s,\x20%s',_0x1a89fb,_0x312217[_0x6050('0xd')]['message']);return _0x4068d3(_0x312217[_0x6050('0xd')][_0x6050('0xf')]);}logger[_0x6050('0xd')](_0x6050('0x8'),_0x1a89fb,_0x312217['error'][_0x6050('0xf')]);return _0xf64de5(_0x312217['error'][_0x6050('0xf')]);}else{logger[_0x6050('0x10')](_0x6050('0x8'),_0x1a89fb,_0x6050('0x9'));_0xf64de5(_0x312217[_0x6050('0x11')][_0x6050('0xf')]);}})[_0x6050('0x12')](function(_0x388de4){logger[_0x6050('0xd')](_0x6050('0x8'),_0x1a89fb,_0x388de4);_0x4068d3(_0x388de4);});});}exports[_0x6050('0x13')]=function(_0x347899){var _0x47f33f=this;return new Promise(function(_0x1dd507,_0x3e1ef6){return db[_0x6050('0x14')]['create'](_0x347899['body'],{'raw':_0x347899['options']?_0x347899['options'][_0x6050('0x15')]===undefined?!![]:![]:!![]})[_0x6050('0x16')](function(_0x4c0270){logger[_0x6050('0x10')](_0x6050('0x13'),_0x347899);logger[_0x6050('0xa')](_0x6050('0x13'),_0x347899,JSON[_0x6050('0xc')](_0x4c0270));_0x1dd507(_0x4c0270);})[_0x6050('0x12')](function(_0x50d6f6){logger[_0x6050('0xd')](_0x6050('0x13'),_0x50d6f6[_0x6050('0xf')],_0x347899);_0x3e1ef6(_0x47f33f[_0x6050('0xd')](0x1f4,_0x50d6f6[_0x6050('0xf')]));});});};
\ No newline at end of file
+var _0xe600=['code','message','catch','Attachment','create','options','raw','CreateAttachment','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x499873,_0x52cb2f){var _0x4ff4e7=function(_0x19c89d){while(--_0x19c89d){_0x499873['push'](_0x499873['shift']());}};_0x4ff4e7(++_0x52cb2f);}(_0xe600,0x159));var _0x0e60=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe600[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x0e60('0x0'));var moment=require('moment');var BPromise=require(_0x0e60('0x1'));var rs=require(_0x0e60('0x2'));var fs=require('fs');var Redis=require(_0x0e60('0x3'));var db=require(_0x0e60('0x4'))['db'];var utils=require(_0x0e60('0x5'));var logger=require(_0x0e60('0x6'))(_0x0e60('0x7'));var config=require(_0x0e60('0x8'));var jayson=require(_0x0e60('0x9'));var client=jayson[_0x0e60('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d7563,_0x497a61,_0x6727dd){return new BPromise(function(_0x30eaed,_0x5ba123){return client[_0x0e60('0xb')](_0x1d7563,_0x6727dd)[_0x0e60('0xc')](function(_0x238537){logger[_0x0e60('0xd')](_0x0e60('0xe'),_0x497a61,_0x0e60('0xf'));logger['debug'](_0x0e60('0x10'),_0x497a61,_0x0e60('0xf'),JSON[_0x0e60('0x11')](_0x238537));if(_0x238537[_0x0e60('0x12')]){if(_0x238537[_0x0e60('0x12')][_0x0e60('0x13')]===0x1f4){logger[_0x0e60('0x12')](_0x0e60('0xe'),_0x497a61,_0x238537['error'][_0x0e60('0x14')]);return _0x5ba123(_0x238537[_0x0e60('0x12')][_0x0e60('0x14')]);}logger[_0x0e60('0x12')](_0x0e60('0xe'),_0x497a61,_0x238537[_0x0e60('0x12')]['message']);return _0x30eaed(_0x238537[_0x0e60('0x12')]['message']);}else{logger[_0x0e60('0xd')](_0x0e60('0xe'),_0x497a61,_0x0e60('0xf'));_0x30eaed(_0x238537['result'][_0x0e60('0x14')]);}})[_0x0e60('0x15')](function(_0xdb7760){logger[_0x0e60('0x12')](_0x0e60('0xe'),_0x497a61,_0xdb7760);_0x5ba123(_0xdb7760);});});}exports['CreateAttachment']=function(_0x992490){var _0x43a103=this;return new Promise(function(_0x599c1d,_0x17ab47){return db[_0x0e60('0x16')][_0x0e60('0x17')](_0x992490['body'],{'raw':_0x992490[_0x0e60('0x18')]?_0x992490['options'][_0x0e60('0x19')]===undefined?!![]:![]:!![]})[_0x0e60('0xc')](function(_0xb9f037){logger[_0x0e60('0xd')](_0x0e60('0x1a'),_0x992490);logger[_0x0e60('0x1b')](_0x0e60('0x1a'),_0x992490,JSON[_0x0e60('0x11')](_0xb9f037));_0x599c1d(_0xb9f037);})[_0x0e60('0x15')](function(_0x10f875){logger[_0x0e60('0x12')](_0x0e60('0x1a'),_0x10f875[_0x0e60('0x14')],_0x992490);_0x17ab47(_0x43a103[_0x0e60('0x12')](0x1f4,_0x10f875[_0x0e60('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 7ef70ce..cd51358 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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
+var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0x170c0a,_0x5a6bbb){_0x170c0a=_0x170c0a-0x0;var _0x4658ee=_0xdb28[_0x170c0a];return _0x4658ee;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index f667a2b..1929bd0 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8f88=['status','send','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','User','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','activedirectory','url','domain','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','blockedAt','admin','user','agent','disabled','blocked','add','minutes','clearBlockUser','getLicense','catch'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x8f88,0x1a7));var _0x88f8=function(_0x59e91d,_0x3b3636){_0x59e91d=_0x59e91d-0x0;var _0x4e67b3=_0x8f88[_0x59e91d];return _0x4e67b3;};'use strict';var passport=require(_0x88f8('0x0'));var LocalStrategy=require(_0x88f8('0x1'))[_0x88f8('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x88f8('0x3'));var BPromise=require(_0x88f8('0x4'));var util=require(_0x88f8('0x5'));var db=require(_0x88f8('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x88f8('0x7'));var config=require(_0x88f8('0x8'));var logger=require(_0x88f8('0x9'))('api');function isActiveDirectoryConfigured(_0x5af030){var _0x292498=![];if(typeof _0x5af030[_0x88f8('0xa')]!=='undefined'){_0x292498=_0x5af030[_0x88f8('0xa')]['baseDN']&&_0x5af030[_0x88f8('0xa')][_0x88f8('0xb')]&&_0x5af030['activedirectory'][_0x88f8('0xc')];}return _0x292498;}function adAuthenticate(_0x1343fc,_0x4c19d2,_0x495026){return new BPromise(function(_0x3186b1,_0x36f24f){try{var _0x5acc06=new ActiveDirectory(_0x1343fc);_0x5acc06[_0x88f8('0xd')](_0x4c19d2,_0x495026,function(_0x3a20d1,_0x9c81f6){if(_0x3a20d1){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x4c19d2,util['inspect'](_0x3a20d1,{'showHidden':![],'depth':null}));_0x36f24f(_0x88f8('0xe'));}else if(!_0x9c81f6){logger[_0x88f8('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x4c19d2);_0x36f24f(_0x88f8('0xe'));}else{_0x3186b1(_0x9c81f6);}});}catch(_0xe34911){_0x36f24f(_0xe34911);}});}function ActiveDirectoryAuthenticate(_0xb6e02c,_0x499308,_0x4f8266,_0x1c71d7){var _0x4dbbe2,_0xb3cd00;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x88f8('0x10'),_0x499308);return _0x1c71d7(null,![],{'message':_0x88f8('0xe')});}return db[_0x88f8('0x11')][_0x88f8('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x88f8('0x13')],'raw':!![]})[_0x88f8('0x14')](function(_0x67845){_0x4dbbe2=_0x67845;if(!_0x4dbbe2[_0x88f8('0x15')]){logger[_0x88f8('0xf')](_0x88f8('0x16'),_0x499308);throw new Error(_0x88f8('0xe'));}return _0xb6e02c[_0x88f8('0x12')]({'logging':!![],'attributes':['id',_0x88f8('0x17'),'password',_0x88f8('0x18'),_0x88f8('0x19'),'disabled','blocked',_0x88f8('0x1a'),'online'],'where':{'name':_0x499308,'role':{'$or':[_0x88f8('0x1b'),_0x88f8('0x1c'),_0x88f8('0x1d')]},'adSsoEnabled':!![]}});})[_0x88f8('0x14')](function(_0x390211){if(!_0x390211||_0x390211&&_0x390211[_0x88f8('0x17')]!==_0x499308){throw new Error(_0x88f8('0xe'));}_0xb3cd00=_0x390211;var _0x55bd6e=_0xb3cd00[_0x88f8('0x17')]+'@'+config[_0x88f8('0xa')][_0x88f8('0xc')];return adAuthenticate(config[_0x88f8('0xa')],_0x55bd6e,_0x4f8266);})['then'](function(_0x1c1ffe){if(_0xb3cd00[_0x88f8('0x1e')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x4dbbe2[_0x88f8('0x13')]>0x0){if(_0xb3cd00[_0x88f8('0x1f')]){if(moment(_0xb3cd00[_0x88f8('0x1a')])[_0x88f8('0x20')](_0x4dbbe2[_0x88f8('0x13')],_0x88f8('0x21'))>moment()){throw new Error(_0x88f8('0xe'));}return utils[_0x88f8('0x22')](_0xb3cd00,0x0,![],null)['then'](function(){return utils[_0x88f8('0x23')](_0xb3cd00);})['then'](function(){return _0x1c71d7(null,_0xb3cd00);});}else{return utils[_0x88f8('0x23')](_0xb3cd00)[_0x88f8('0x14')](function(){return _0x1c71d7(null,_0xb3cd00);});}}else{return utils['getLicense'](_0xb3cd00)['then'](function(){return _0x1c71d7(null,_0xb3cd00);});}})[_0x88f8('0x24')](function(_0x4af684){return _0x1c71d7(null,![],_0x4af684);});}function handleError(_0x416c95,_0x41d01d,_0x48d618){return _0x416c95[_0x88f8('0x25')](_0x41d01d||0x1f4)[_0x88f8('0x26')]({'message':_0x48d618?_0x48d618['message']||_0x48d618:''});}exports['login']=function(_0x1b204a,_0x373e17,_0x4deb3a){passport['authenticate'](_0x88f8('0x27'),function(_0x36a4f3,_0x5a083b,_0x195129){var _0x4bdd8f=_0x36a4f3||_0x195129;if(_0x4bdd8f){return handleError(_0x373e17,0x191,_0x4bdd8f);}if(!_0x5a083b){return handleError(_0x373e17,0x194,{'message':_0x88f8('0x28')});}else{var _0x4a7c45={'payload':{'id':_0x5a083b['id'],'role':_0x5a083b['role']},'options':{'expiresIn':0x15180}};return authService[_0x88f8('0x29')](_0x4a7c45)[_0x88f8('0x14')](function(_0x378a03){_0x373e17[_0x88f8('0x2a')]({'id':_0x5a083b['id'],'token':_0x378a03,'statusCall':'','isAlreadyLogged':_0x5a083b[_0x88f8('0x2b')]});});}})(_0x1b204a,_0x373e17,_0x4deb3a);};passport[_0x88f8('0x2c')]('ad-login',new LocalStrategy({'usernameField':_0x88f8('0x17'),'passwordField':'password'},function(_0x401ea6,_0x46919d,_0x5cc00d){return ActiveDirectoryAuthenticate(db[_0x88f8('0x2d')],_0x401ea6,_0x46919d,_0x5cc00d);}));
\ No newline at end of file
+var _0x0b6d=['error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','admin','agent','then','add','minutes','clearBlockUser','getLicense','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','baseDN','url','domain','authenticate'];(function(_0x9769c7,_0x58082a){var _0x2b769e=function(_0x4fc9b9){while(--_0x4fc9b9){_0x9769c7['push'](_0x9769c7['shift']());}};_0x2b769e(++_0x58082a);}(_0x0b6d,0x85));var _0xd0b6=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x0b6d[_0x45bf86];return _0x1f02b7;};'use strict';var passport=require(_0xd0b6('0x0'));var LocalStrategy=require(_0xd0b6('0x1'))[_0xd0b6('0x2')];var moment=require(_0xd0b6('0x3'));var ActiveDirectory=require(_0xd0b6('0x4'));var BPromise=require(_0xd0b6('0x5'));var util=require(_0xd0b6('0x6'));var db=require(_0xd0b6('0x7'))['db'];var authService=require(_0xd0b6('0x8'));var utils=require(_0xd0b6('0x9'));var config=require(_0xd0b6('0xa'));var logger=require('../../config/logger')(_0xd0b6('0xb'));function isActiveDirectoryConfigured(_0x597b97){var _0x447d5f=![];if(typeof _0x597b97[_0xd0b6('0xc')]!=='undefined'){_0x447d5f=_0x597b97['activedirectory'][_0xd0b6('0xd')]&&_0x597b97[_0xd0b6('0xc')][_0xd0b6('0xe')]&&_0x597b97['activedirectory'][_0xd0b6('0xf')];}return _0x447d5f;}function adAuthenticate(_0x1a2d52,_0x4849f2,_0x5ac927){return new BPromise(function(_0x95636e,_0x26fc82){try{var _0x167c00=new ActiveDirectory(_0x1a2d52);_0x167c00[_0xd0b6('0x10')](_0x4849f2,_0x5ac927,function(_0x393452,_0x15e167){if(_0x393452){logger[_0xd0b6('0x11')]('Error\x20authenticate\x20%s:\x20%s',_0x4849f2,util[_0xd0b6('0x12')](_0x393452,{'showHidden':![],'depth':null}));_0x26fc82(_0xd0b6('0x13'));}else if(!_0x15e167){logger['error'](_0xd0b6('0x14'),_0x4849f2);_0x26fc82(_0xd0b6('0x13'));}else{_0x95636e(_0x15e167);}});}catch(_0x2dda8d){_0x26fc82(_0x2dda8d);}});}function ActiveDirectoryAuthenticate(_0x50de6c,_0x2aded5,_0x4eeb7e,_0x4debab){var _0x4a7554,_0x3da1a3;if(!isActiveDirectoryConfigured(config)){logger[_0xd0b6('0x11')](_0xd0b6('0x15'),_0x2aded5);return _0x4debab(null,![],{'message':_0xd0b6('0x13')});}return db[_0xd0b6('0x16')][_0xd0b6('0x17')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xd0b6('0x18')],'raw':!![]})['then'](function(_0x5587cb){_0x4a7554=_0x5587cb;if(!_0x4a7554[_0xd0b6('0x19')]){logger['error'](_0xd0b6('0x1a'),_0x2aded5);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x50de6c[_0xd0b6('0x17')]({'logging':!![],'attributes':['id',_0xd0b6('0x1b'),_0xd0b6('0x1c'),_0xd0b6('0x1d'),_0xd0b6('0x1e'),_0xd0b6('0x1f'),_0xd0b6('0x20'),_0xd0b6('0x21'),_0xd0b6('0x22')],'where':{'name':_0x2aded5,'role':{'$or':[_0xd0b6('0x23'),'user',_0xd0b6('0x24')]},'adSsoEnabled':!![]}});})[_0xd0b6('0x25')](function(_0x3b58e8){if(!_0x3b58e8||_0x3b58e8&&_0x3b58e8['name']!==_0x2aded5){throw new Error(_0xd0b6('0x13'));}_0x3da1a3=_0x3b58e8;var _0x53d41d=_0x3da1a3['name']+'@'+config[_0xd0b6('0xc')]['domain'];return adAuthenticate(config[_0xd0b6('0xc')],_0x53d41d,_0x4eeb7e);})['then'](function(_0x5d747e){if(_0x3da1a3['disabled']){throw new Error(_0xd0b6('0x13'));}if(_0x4a7554[_0xd0b6('0x18')]>0x0){if(_0x3da1a3['blocked']){if(moment(_0x3da1a3['blockedAt'])[_0xd0b6('0x26')](_0x4a7554[_0xd0b6('0x18')],_0xd0b6('0x27'))>moment()){throw new Error(_0xd0b6('0x13'));}return utils[_0xd0b6('0x28')](_0x3da1a3,0x0,![],null)['then'](function(){return utils[_0xd0b6('0x29')](_0x3da1a3);})[_0xd0b6('0x25')](function(){return _0x4debab(null,_0x3da1a3);});}else{return utils[_0xd0b6('0x29')](_0x3da1a3)[_0xd0b6('0x25')](function(){return _0x4debab(null,_0x3da1a3);});}}else{return utils[_0xd0b6('0x29')](_0x3da1a3)['then'](function(){return _0x4debab(null,_0x3da1a3);});}})['catch'](function(_0x261364){return _0x4debab(null,![],_0x261364);});}function handleError(_0xa30bfc,_0x55dc59,_0x390229){return _0xa30bfc[_0xd0b6('0x2a')](_0x55dc59||0x1f4)[_0xd0b6('0x2b')]({'message':_0x390229?_0x390229['message']||_0x390229:''});}exports[_0xd0b6('0x2c')]=function(_0x372d62,_0x2de3ff,_0x3c3102){passport[_0xd0b6('0x10')]('ad-login',function(_0x562e35,_0x20df32,_0x54029b){var _0x5ef76a=_0x562e35||_0x54029b;if(_0x5ef76a){return handleError(_0x2de3ff,0x191,_0x5ef76a);}if(!_0x20df32){return handleError(_0x2de3ff,0x194,{'message':_0xd0b6('0x2d')});}else{var _0x35a1e4={'payload':{'id':_0x20df32['id'],'role':_0x20df32[_0xd0b6('0x1e')]},'options':{'expiresIn':0x15180}};return authService[_0xd0b6('0x2e')](_0x35a1e4)[_0xd0b6('0x25')](function(_0x423b06){_0x2de3ff[_0xd0b6('0x2f')]({'id':_0x20df32['id'],'token':_0x423b06,'statusCall':'','isAlreadyLogged':_0x20df32['online']});});}})(_0x372d62,_0x2de3ff,_0x3c3102);};passport[_0xd0b6('0x30')]('ad-login',new LocalStrategy({'usernameField':_0xd0b6('0x1b'),'passwordField':'password'},function(_0x1d1029,_0x1c3935,_0x5bada3){return ActiveDirectoryAuthenticate(db[_0xd0b6('0x31')],_0x1d1029,_0x1c3935,_0x5bada3);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 9ba2cb3..4953318 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x43e3=['post','exports','express','Router','./authActiveDirectory.controller'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x43e3,0x89));var _0x343e=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0x43e3[_0x7275e9];return _0x17b99d;};'use strict';var express=require(_0x343e('0x0'));var router=express[_0x343e('0x1')]();var controller=require(_0x343e('0x2'));router[_0x343e('0x3')]('/',controller['login']);module[_0x343e('0x4')]=router;
\ No newline at end of file
+var _0x5c04=['exports','Router','./authActiveDirectory.controller','login'];(function(_0x1c2f24,_0x197a9f){var _0x466fc0=function(_0x3eabf7){while(--_0x3eabf7){_0x1c2f24['push'](_0x1c2f24['shift']());}};_0x466fc0(++_0x197a9f);}(_0x5c04,0x1dd));var _0x45c0=function(_0x5e9206,_0x6f1c7c){_0x5e9206=_0x5e9206-0x0;var _0xbb83d5=_0x5c04[_0x5e9206];return _0xbb83d5;};'use strict';var express=require('express');var router=express[_0x45c0('0x0')]();var controller=require(_0x45c0('0x1'));router['post']('/',controller[_0x45c0('0x2')]);module[_0x45c0('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index cbc6a0d..1b90e75 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x188744,_0x19da54){var _0xaec2da=function(_0x335216){while(--_0x335216){_0x188744['push'](_0x188744['shift']());}};_0xaec2da(++_0x19da54);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x340598,_0x14454a){var _0x57d248=function(_0xcb2a04){while(--_0xcb2a04){_0x340598['push'](_0x340598['shift']());}};_0x57d248(++_0x14454a);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 51c65d9..cbf6941 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 _0x3a4a=['get','login','/callback','callback','setTokenCookie','exports','express','passport','../user/user.controller.js','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a4a,0x92));var _0xa3a4=function(_0x3a441a,_0x43eb56){_0x3a441a=_0x3a441a-0x0;var _0x3128a2=_0x3a4a[_0x3a441a];return _0x3128a2;};'use strict';var express=require(_0xa3a4('0x0'));var passport=require(_0xa3a4('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xa3a4('0x2'));var authService=require(_0xa3a4('0x3'));router[_0xa3a4('0x4')]('/',controller[_0xa3a4('0x5')]);router[_0xa3a4('0x4')](_0xa3a4('0x6'),controller[_0xa3a4('0x7')],authService['isMiddleware'],userController[_0xa3a4('0x5')],authService[_0xa3a4('0x8')]);module[_0xa3a4('0x9')]=router;
\ No newline at end of file
+var _0xb821=['/callback','callback','isMiddleware','setTokenCookie','exports','passport','Router','../../components/auth/service','get'];(function(_0x28fe02,_0x1e6530){var _0x2aa7d7=function(_0x33e833){while(--_0x33e833){_0x28fe02['push'](_0x28fe02['shift']());}};_0x2aa7d7(++_0x1e6530);}(_0xb821,0xa7));var _0x1b82=function(_0x1a5c94,_0x16f4aa){_0x1a5c94=_0x1a5c94-0x0;var _0x589128=_0xb821[_0x1a5c94];return _0x589128;};'use strict';var express=require('express');var passport=require(_0x1b82('0x0'));var router=express[_0x1b82('0x1')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x1b82('0x2'));router['get']('/',controller['login']);router[_0x1b82('0x3')](_0x1b82('0x4'),controller[_0x1b82('0x5')],authService[_0x1b82('0x6')],userController['login'],authService[_0x1b82('0x7')]);module[_0x1b82('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 9bd26eb..74cd11c 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 _0x4fd4=['role','blocked','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','disabled','add','getLicense','catch','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','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://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','params','token','securePassword','enforcePasswordHistory','validatePasswordHistory','passwordHistoryLimit','resetPasswordExpires','save','use','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4fd4,0xd6));var _0x44fd=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4fd4[_0x1facfa];return _0x9ec701;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x44fd('0x0'))[_0x44fd('0x1')];var jayson=require(_0x44fd('0x2'));var _=require(_0x44fd('0x3'));var rs=require(_0x44fd('0x4'));var moment=require('moment');var db=require(_0x44fd('0x5'))['db'];var authService=require(_0x44fd('0x6'));var utils=require(_0x44fd('0x7'));var client=jayson[_0x44fd('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x526b42,_0x2d6285,_0x93e6d7,_0x570a87){var _0x47710e,_0x396436;return db[_0x44fd('0x9')][_0x44fd('0xa')]({'where':{'id':0x1},'attributes':[_0x44fd('0xb'),_0x44fd('0xc')],'raw':!![]})[_0x44fd('0xd')](function(_0x1324cb){_0x47710e=_0x1324cb;return _0x526b42[_0x44fd('0xa')]({'attributes':['id',_0x44fd('0xe'),_0x44fd('0xf'),_0x44fd('0x10'),_0x44fd('0x11'),'disabled',_0x44fd('0x12'),_0x44fd('0x13'),_0x44fd('0x14')],'where':{'name':_0x2d6285,'role':{'$or':[_0x44fd('0x15'),_0x44fd('0x16'),'agent']}}});})['then'](function(_0xdf9acb){if(!_0xdf9acb||_0xdf9acb&&_0xdf9acb[_0x44fd('0xe')]!==_0x2d6285){throw new Error(_0x44fd('0x17'));}else{_0x396436=_0xdf9acb;return _0x396436;}})[_0x44fd('0xd')](function(){_0x396436[_0x44fd('0x18')](_0x93e6d7,function(_0x58cfa8,_0xa6ae7c){var _0x1019c5=_0x396436['loginAttempts']+0x1;if(_0x58cfa8){return _0x570a87(_0x58cfa8);}else if(!_0xa6ae7c){if(_0x396436['disabled']){return _0x570a87(null,![],{'message':_0x44fd('0x17')});}else if(_0x47710e[_0x44fd('0xb')]>0x0){if(_0x396436['blocked']){if(_0x47710e[_0x44fd('0xc')]>0x0){if(moment(_0x396436[_0x44fd('0x13')])['add'](_0x47710e[_0x44fd('0xc')],_0x44fd('0x19'))>moment()){return _0x570a87(null,![],{'message':_0x44fd('0x17')});}else{return utils[_0x44fd('0x1a')](_0x396436,_0x1019c5,![],null)[_0x44fd('0xd')](function(){return _0x570a87(null,![],{'message':_0x44fd('0x17')});});}}else{return _0x570a87(null,![],{'message':_0x44fd('0x17')});}}else{if(_0x1019c5>=_0x47710e[_0x44fd('0xb')]){return utils[_0x44fd('0x1a')](_0x396436,0x0,!![],moment())[_0x44fd('0xd')](function(){return _0x570a87(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x44fd('0x1a')](_0x396436,_0x1019c5,![],null)['then'](function(){return _0x570a87(null,![],{'message':_0x44fd('0x17')});});}}}else{return _0x570a87(null,![],{'message':_0x44fd('0x17')});}}else{if(_0x396436[_0x44fd('0x1b')]){return _0x570a87(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x47710e['allowedLoginAttempts']>0x0){if(_0x396436[_0x44fd('0x12')]){if(_0x47710e[_0x44fd('0xc')]>0x0){if(moment(_0x396436['blockedAt'])[_0x44fd('0x1c')](_0x47710e['blockDuration'],_0x44fd('0x19'))>moment()){return _0x570a87(null,![],{'message':_0x44fd('0x17')});}else{return utils['clearBlockUser'](_0x396436,0x0,![],null)[_0x44fd('0xd')](function(){return utils[_0x44fd('0x1d')](_0x396436);})['then'](function(){return _0x570a87(null,_0x396436);});}}else{return _0x570a87(null,![],{'message':_0x44fd('0x17')});}}else{return utils[_0x44fd('0x1a')](_0x396436,0x0,![],null)[_0x44fd('0xd')](function(){return utils[_0x44fd('0x1d')](_0x396436);})[_0x44fd('0xd')](function(){return _0x570a87(null,_0x396436);})[_0x44fd('0x1e')](function(_0x2acafb){return _0x570a87(null,![],_0x2acafb);});}}else{if(_0x396436[_0x44fd('0x12')]){return _0x570a87(null,![],{'message':_0x44fd('0x17')});}else{return utils[_0x44fd('0x1d')](_0x396436)[_0x44fd('0xd')](function(){return _0x570a87(null,_0x396436);});}}}});})[_0x44fd('0x1e')](function(_0x11a3a8){return _0x570a87(null,![],_0x11a3a8);});}function sendServiceMail(_0x27bd79){return db['MailAccount'][_0x44fd('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x44fd('0xe'),_0x44fd('0x20')],'include':[{'model':db[_0x44fd('0x21')],'as':'Smtp','include':[{'model':db[_0x44fd('0x22')],'as':_0x44fd('0x22')}]}]})['then'](function(_0xe9c517){if(!_0xe9c517){throw new Error(_0x44fd('0x23'));}var _0x31d8b8=_0xe9c517[_0x44fd('0x24')]();var _0x443764={'account':_0x31d8b8,'message':_['merge']({'from':util[_0x44fd('0x25')](_0x44fd('0x26'),_0xe9c517[_0x44fd('0xe')],_0xe9c517[_0x44fd('0x20')]||_0xe9c517[_0x44fd('0x27')][_0x44fd('0x16')])},_0x27bd79)};return client[_0x44fd('0x28')](_0x44fd('0x29'),_0x443764);})[_0x44fd('0xd')](function(_0x287f71){if(_0x287f71[_0x44fd('0x2a')]){throw new Error(util[_0x44fd('0x25')](_0x44fd('0x2b'),_0x287f71['error'][_0x44fd('0x2c')]||JSON['stringify'](_0x287f71['error'])));}return!![];});}function handleError(_0x2e38b2,_0x1f428c,_0x36e995){return _0x2e38b2[_0x44fd('0x2d')](_0x1f428c||0x1f4)[_0x44fd('0x2e')]({'message':_0x36e995?_0x36e995[_0x44fd('0x2c')]||_0x36e995:''});}exports[_0x44fd('0x2f')]=function(_0x370565,_0x2d3dbf,_0x5bea59){passport['authenticate'](_0x44fd('0x30'),function(_0xc6c5f0,_0x374a91,_0x556427){var _0xd494d2=_0xc6c5f0||_0x556427;if(_0xd494d2){return handleError(_0x2d3dbf,0x191,_0xd494d2);}if(!_0x374a91){return handleError(_0x2d3dbf,0x194,{'message':_0x44fd('0x31')});}else{var _0x391197={'payload':{'id':_0x374a91['id'],'role':_0x374a91[_0x44fd('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x44fd('0x32')](_0x391197)[_0x44fd('0xd')](function(_0x5cb369){_0x2d3dbf['json']({'id':_0x374a91['id'],'token':_0x5cb369,'statusCall':'','isAlreadyLogged':_0x374a91[_0x44fd('0x33')]});});}})(_0x370565,_0x2d3dbf,_0x5bea59);};exports[_0x44fd('0x34')]=function(_0x124a55,_0x14058e){if(!_0x124a55[_0x44fd('0x35')][_0x44fd('0x20')]){return handleError(_0x14058e,0x1f4,{'message':_0x44fd('0x36')});}var _0x27403f=rs[_0x44fd('0x37')]();_0x124a55[_0x44fd('0x35')][_0x44fd('0x20')]=_0x124a55[_0x44fd('0x35')][_0x44fd('0x20')][_0x44fd('0x38')]()[_0x44fd('0x39')]();var _0x4bd3e7;return db[_0x44fd('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0x44fd('0xb'),_0x44fd('0xc')],'raw':!![]})['then'](function(_0x3b6dad){_0x4bd3e7=_0x3b6dad;return db[_0x44fd('0x3a')][_0x44fd('0x1f')]({'where':{'email':_0x124a55[_0x44fd('0x35')][_0x44fd('0x20')]}});})[_0x44fd('0xd')](function(_0x3237d6){if(!_0x3237d6){throw new Error(_0x44fd('0x3b'));}if(_0x3237d6['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x3237d6[_0x44fd('0x12')]){if(moment(_0x3237d6[_0x44fd('0x13')])[_0x44fd('0x1c')](_0x4bd3e7[_0x44fd('0xc')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x3237d6[_0x44fd('0x12')]=![];_0x3237d6[_0x44fd('0x13')]=null;}}_0x3237d6[_0x44fd('0x3c')]=_0x27403f;_0x3237d6['resetPasswordExpires']=Date[_0x44fd('0x3d')]()+0x36ee80;return _0x3237d6['save']();})[_0x44fd('0xd')](function(){return sendServiceMail({'to':_0x124a55[_0x44fd('0x35')]['email'],'subject':_0x44fd('0x3e'),'text':_0x44fd('0x3f')+_0x44fd('0x40')+_0x44fd('0x41')+_0x124a55['headers']['host']+_0x44fd('0x42')+_0x27403f+'\x0a\x0a'+_0x44fd('0x43')});})['then'](function(){_0x14058e['status'](0xc8)[_0x44fd('0x2e')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x362140){return handleError(_0x14058e,0x1f4,_0x362140);});};exports['reset']=function(_0x29e6d4,_0x5ebcdb){return db['User'][_0x44fd('0x1f')]({'where':{'resetPasswordToken':_0x29e6d4[_0x44fd('0x44')][_0x44fd('0x45')],'resetPasswordExpires':{'$gt':Date[_0x44fd('0x3d')]()}}})[_0x44fd('0xd')](function(_0x48aa3d){if(!_0x48aa3d){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x44fd('0xa')]({'attributes':['id',_0x44fd('0x46'),_0x44fd('0x47'),'passwordHistoryLimit']})[_0x44fd('0xd')](function(_0x3cda0c){if(_0x3cda0c[_0x44fd('0x46')])authService['validatePasswordPattern'](_0x29e6d4[_0x44fd('0x35')][_0x44fd('0xf')]);if(!_0x3cda0c['enforcePasswordHistory']||!_0x48aa3d['previousPasswords'])return _0x48aa3d;authService[_0x44fd('0x48')](_0x29e6d4['body'][_0x44fd('0xf')],_0x48aa3d['previousPasswords'],_0x3cda0c[_0x44fd('0x49')]);return _0x48aa3d;})['then'](function(){_0x48aa3d[_0x44fd('0xf')]=_0x29e6d4[_0x44fd('0x35')][_0x44fd('0xf')];_0x48aa3d[_0x44fd('0x3c')]=null;_0x48aa3d[_0x44fd('0x4a')]=null;return _0x48aa3d[_0x44fd('0x4b')]();});})[_0x44fd('0xd')](function(){_0x5ebcdb[_0x44fd('0x2d')](0xc8)[_0x44fd('0x2e')]({'message':'Password\x20reset!'});})[_0x44fd('0x1e')](function(_0x55dcd0){return handleError(_0x5ebcdb,0x1f4,_0x55dcd0);});};passport[_0x44fd('0x4c')](_0x44fd('0x30'),new LocalStrategy({'usernameField':_0x44fd('0xe'),'passwordField':_0x44fd('0xf')},function(_0x3f3d02,_0x3f54c2,_0x4100a5){return localAuthenticate(db['User'],_0x3f3d02,_0x3f54c2,_0x4100a5);}));
\ No newline at end of file
+var _0xd1dc=['request','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','generate','body','trim','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','blockedAt','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','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','passwordHistoryLimit','securePassword','validatePasswordPattern','validatePasswordHistory','previousPasswords','save','Password\x20reset!','use','util','passport-local','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','blockDuration','then','password','salt','role','disabled','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','name','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>'];(function(_0x4d521e,_0x58ba39){var _0x3beb42=function(_0x1a7bd2){while(--_0x1a7bd2){_0x4d521e['push'](_0x4d521e['shift']());}};_0x3beb42(++_0x58ba39);}(_0xd1dc,0x17e));var _0xcd1d=function(_0x3b0e76,_0x239221){_0x3b0e76=_0x3b0e76-0x0;var _0x1e4af4=_0xd1dc[_0x3b0e76];return _0x1e4af4;};'use strict';var util=require(_0xcd1d('0x0'));var passport=require('passport');var LocalStrategy=require(_0xcd1d('0x1'))['Strategy'];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0xcd1d('0x2'));var moment=require(_0xcd1d('0x3'));var db=require(_0xcd1d('0x4'))['db'];var authService=require(_0xcd1d('0x5'));var utils=require(_0xcd1d('0x6'));var client=jayson[_0xcd1d('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x43e7e7,_0x4b69e3,_0x22fc6e,_0x2683e9){var _0x3ffd2c,_0x58d659;return db[_0xcd1d('0x8')][_0xcd1d('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xcd1d('0xa')],'raw':!![]})[_0xcd1d('0xb')](function(_0x1aed66){_0x3ffd2c=_0x1aed66;return _0x43e7e7[_0xcd1d('0x9')]({'attributes':['id','name',_0xcd1d('0xc'),_0xcd1d('0xd'),_0xcd1d('0xe'),_0xcd1d('0xf'),_0xcd1d('0x10'),'blockedAt',_0xcd1d('0x11')],'where':{'name':_0x4b69e3,'role':{'$or':[_0xcd1d('0x12'),_0xcd1d('0x13'),_0xcd1d('0x14')]}}});})[_0xcd1d('0xb')](function(_0x45e378){if(!_0x45e378||_0x45e378&&_0x45e378['name']!==_0x4b69e3){throw new Error(_0xcd1d('0x15'));}else{_0x58d659=_0x45e378;return _0x58d659;}})['then'](function(){_0x58d659['authenticate'](_0x22fc6e,function(_0x59c566,_0x22f85e){var _0x543590=_0x58d659[_0xcd1d('0x11')]+0x1;if(_0x59c566){return _0x2683e9(_0x59c566);}else if(!_0x22f85e){if(_0x58d659[_0xcd1d('0xf')]){return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});}else if(_0x3ffd2c[_0xcd1d('0x16')]>0x0){if(_0x58d659[_0xcd1d('0x10')]){if(_0x3ffd2c[_0xcd1d('0xa')]>0x0){if(moment(_0x58d659['blockedAt'])[_0xcd1d('0x17')](_0x3ffd2c[_0xcd1d('0xa')],_0xcd1d('0x18'))>moment()){return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});}else{return utils[_0xcd1d('0x19')](_0x58d659,_0x543590,![],null)[_0xcd1d('0xb')](function(){return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});});}}else{return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});}}else{if(_0x543590>=_0x3ffd2c[_0xcd1d('0x16')]){return utils[_0xcd1d('0x19')](_0x58d659,0x0,!![],moment())['then'](function(){return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});});}else{return utils[_0xcd1d('0x19')](_0x58d659,_0x543590,![],null)[_0xcd1d('0xb')](function(){return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});});}}}else{return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});}}else{if(_0x58d659['disabled']){return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});}else if(_0x3ffd2c[_0xcd1d('0x16')]>0x0){if(_0x58d659[_0xcd1d('0x10')]){if(_0x3ffd2c[_0xcd1d('0xa')]>0x0){if(moment(_0x58d659['blockedAt'])['add'](_0x3ffd2c[_0xcd1d('0xa')],_0xcd1d('0x18'))>moment()){return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});}else{return utils[_0xcd1d('0x19')](_0x58d659,0x0,![],null)[_0xcd1d('0xb')](function(){return utils[_0xcd1d('0x1a')](_0x58d659);})[_0xcd1d('0xb')](function(){return _0x2683e9(null,_0x58d659);});}}else{return _0x2683e9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xcd1d('0x19')](_0x58d659,0x0,![],null)[_0xcd1d('0xb')](function(){return utils[_0xcd1d('0x1a')](_0x58d659);})[_0xcd1d('0xb')](function(){return _0x2683e9(null,_0x58d659);})[_0xcd1d('0x1b')](function(_0xd0dd37){return _0x2683e9(null,![],_0xd0dd37);});}}else{if(_0x58d659['blocked']){return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});}else{return utils[_0xcd1d('0x1a')](_0x58d659)['then'](function(){return _0x2683e9(null,_0x58d659);});}}}});})[_0xcd1d('0x1b')](function(_0xd695db){return _0x2683e9(null,![],_0xd695db);});}function sendServiceMail(_0x199148){return db[_0xcd1d('0x1c')]['find']({'where':{'service':!![]},'attributes':['id',_0xcd1d('0x1d'),_0xcd1d('0x1e')],'include':[{'model':db[_0xcd1d('0x1f')],'as':_0xcd1d('0x20'),'include':[{'model':db[_0xcd1d('0x21')],'as':'CloudProvider'}]}]})[_0xcd1d('0xb')](function(_0x29e062){if(!_0x29e062){throw new Error(_0xcd1d('0x22'));}var _0x160a56=_0x29e062[_0xcd1d('0x23')]();var _0x537776={'account':_0x160a56,'message':_[_0xcd1d('0x24')]({'from':util['format'](_0xcd1d('0x25'),_0x29e062['name'],_0x29e062['email']||_0x29e062[_0xcd1d('0x20')][_0xcd1d('0x13')])},_0x199148)};return client[_0xcd1d('0x26')]('SendMail',_0x537776);})[_0xcd1d('0xb')](function(_0x225da2){if(_0x225da2['error']){throw new Error(util[_0xcd1d('0x27')](_0xcd1d('0x28'),_0x225da2[_0xcd1d('0x29')][_0xcd1d('0x2a')]||JSON[_0xcd1d('0x2b')](_0x225da2[_0xcd1d('0x29')])));}return!![];});}function handleError(_0x33979a,_0x3b449a,_0x3da181){return _0x33979a[_0xcd1d('0x2c')](_0x3b449a||0x1f4)[_0xcd1d('0x2d')]({'message':_0x3da181?_0x3da181[_0xcd1d('0x2a')]||_0x3da181:''});}exports[_0xcd1d('0x2e')]=function(_0x2a9213,_0x3bcdfe,_0x58b872){passport[_0xcd1d('0x2f')](_0xcd1d('0x30'),function(_0x5e7ffe,_0x39763b,_0x2f3f32){var _0x2f531a=_0x5e7ffe||_0x2f3f32;if(_0x2f531a){return handleError(_0x3bcdfe,0x191,_0x2f531a);}if(!_0x39763b){return handleError(_0x3bcdfe,0x194,{'message':_0xcd1d('0x31')});}else{var _0x5bfcdc={'payload':{'id':_0x39763b['id'],'role':_0x39763b[_0xcd1d('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0xcd1d('0x32')](_0x5bfcdc)[_0xcd1d('0xb')](function(_0x94a685){_0x3bcdfe[_0xcd1d('0x33')]({'id':_0x39763b['id'],'token':_0x94a685,'statusCall':'','isAlreadyLogged':_0x39763b[_0xcd1d('0x34')]});});}})(_0x2a9213,_0x3bcdfe,_0x58b872);};exports[_0xcd1d('0x35')]=function(_0x645dab,_0x5be6b7){if(!_0x645dab['body'][_0xcd1d('0x1e')]){return handleError(_0x5be6b7,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x5142e9=rs[_0xcd1d('0x36')]();_0x645dab[_0xcd1d('0x37')]['email']=_0x645dab['body'][_0xcd1d('0x1e')][_0xcd1d('0x38')]()['toLowerCase']();var _0x408147;return db['Setting'][_0xcd1d('0x9')]({'where':{'id':0x1},'attributes':[_0xcd1d('0x16'),_0xcd1d('0xa')],'raw':!![]})[_0xcd1d('0xb')](function(_0xd71255){_0x408147=_0xd71255;return db['User'][_0xcd1d('0x39')]({'where':{'email':_0x645dab[_0xcd1d('0x37')][_0xcd1d('0x1e')]}});})[_0xcd1d('0xb')](function(_0x447870){if(!_0x447870){throw new Error(_0xcd1d('0x3a'));}if(_0x447870[_0xcd1d('0xf')]){throw new Error(_0xcd1d('0x3b'));}if(_0x447870[_0xcd1d('0x10')]){if(moment(_0x447870[_0xcd1d('0x3c')])[_0xcd1d('0x17')](_0x408147['blockDuration'],_0xcd1d('0x18'))>moment()){throw new Error(_0xcd1d('0x3d'));}else{_0x447870[_0xcd1d('0x10')]=![];_0x447870[_0xcd1d('0x3c')]=null;}}_0x447870[_0xcd1d('0x3e')]=_0x5142e9;_0x447870[_0xcd1d('0x3f')]=Date[_0xcd1d('0x40')]()+0x36ee80;return _0x447870['save']();})[_0xcd1d('0xb')](function(){return sendServiceMail({'to':_0x645dab['body'][_0xcd1d('0x1e')],'subject':_0xcd1d('0x41'),'text':_0xcd1d('0x42')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xcd1d('0x43')+_0x645dab[_0xcd1d('0x44')][_0xcd1d('0x45')]+'/reset/'+_0x5142e9+'\x0a\x0a'+_0xcd1d('0x46')});})['then'](function(){_0x5be6b7[_0xcd1d('0x2c')](0xc8)['send']({'message':_0xcd1d('0x47')});})[_0xcd1d('0x1b')](function(_0x384bad){return handleError(_0x5be6b7,0x1f4,_0x384bad);});};exports['reset']=function(_0x43e711,_0x17d7fe){return db[_0xcd1d('0x48')][_0xcd1d('0x39')]({'where':{'resetPasswordToken':_0x43e711[_0xcd1d('0x49')][_0xcd1d('0x4a')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xcd1d('0xb')](function(_0x4cffde){if(!_0x4cffde){throw new Error(_0xcd1d('0x4b'));}return db['Setting'][_0xcd1d('0x9')]({'attributes':['id','securePassword','enforcePasswordHistory',_0xcd1d('0x4c')]})[_0xcd1d('0xb')](function(_0x4a96e6){if(_0x4a96e6[_0xcd1d('0x4d')])authService[_0xcd1d('0x4e')](_0x43e711[_0xcd1d('0x37')][_0xcd1d('0xc')]);if(!_0x4a96e6['enforcePasswordHistory']||!_0x4cffde['previousPasswords'])return _0x4cffde;authService[_0xcd1d('0x4f')](_0x43e711[_0xcd1d('0x37')][_0xcd1d('0xc')],_0x4cffde[_0xcd1d('0x50')],_0x4a96e6[_0xcd1d('0x4c')]);return _0x4cffde;})[_0xcd1d('0xb')](function(){_0x4cffde[_0xcd1d('0xc')]=_0x43e711['body'][_0xcd1d('0xc')];_0x4cffde[_0xcd1d('0x3e')]=null;_0x4cffde[_0xcd1d('0x3f')]=null;return _0x4cffde[_0xcd1d('0x51')]();});})[_0xcd1d('0xb')](function(){_0x17d7fe[_0xcd1d('0x2c')](0xc8)[_0xcd1d('0x2d')]({'message':_0xcd1d('0x52')});})[_0xcd1d('0x1b')](function(_0x422dd1){return handleError(_0x17d7fe,0x1f4,_0x422dd1);});};passport[_0xcd1d('0x53')](_0xcd1d('0x30'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x2d7fcb,_0x5147db,_0x5bd109){return localAuthenticate(db[_0xcd1d('0x48')],_0x2d7fcb,_0x5147db,_0x5bd109);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index b39d5e6..b16499e 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 _0x506f=['post','login','forgot','/reset/:token','reset','exports','express','Router'];(function(_0x1f1b1b,_0x79ec60){var _0x10f917=function(_0x2a3eb1){while(--_0x2a3eb1){_0x1f1b1b['push'](_0x1f1b1b['shift']());}};_0x10f917(++_0x79ec60);}(_0x506f,0x1b6));var _0xf506=function(_0xda616d,_0x39fad5){_0xda616d=_0xda616d-0x0;var _0x2c5c84=_0x506f[_0xda616d];return _0x2c5c84;};'use strict';var express=require(_0xf506('0x0'));var router=express[_0xf506('0x1')]();var controller=require('./authLocal.controller');router[_0xf506('0x2')]('/',controller[_0xf506('0x3')]);router[_0xf506('0x2')]('/forgot',controller[_0xf506('0x4')]);router[_0xf506('0x2')](_0xf506('0x5'),controller[_0xf506('0x6')]);module[_0xf506('0x7')]=router;
\ No newline at end of file
+var _0x92f3=['post','/forgot','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','login'];(function(_0x375337,_0x39cd14){var _0x46a420=function(_0x5cc043){while(--_0x5cc043){_0x375337['push'](_0x375337['shift']());}};_0x46a420(++_0x39cd14);}(_0x92f3,0x1aa));var _0x392f=function(_0x5b81f0,_0x2bb875){_0x5b81f0=_0x5b81f0-0x0;var _0xe01fef=_0x92f3[_0x5b81f0];return _0xe01fef;};'use strict';var express=require(_0x392f('0x0'));var router=express[_0x392f('0x1')]();var controller=require(_0x392f('0x2'));router['post']('/',controller[_0x392f('0x3')]);router[_0x392f('0x4')](_0x392f('0x5'),controller[_0x392f('0x6')]);router['post'](_0x392f('0x7'),controller[_0x392f('0x8')]);module[_0x392f('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index ecee5e1..298c9f0 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 _0x975a=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x1ddfb4,_0x406f96){var _0x59aef5=function(_0x438c5d){while(--_0x438c5d){_0x1ddfb4['push'](_0x1ddfb4['shift']());}};_0x59aef5(++_0x406f96);}(_0x975a,0xb3));var _0xa975=function(_0x4a0e88,_0x39a674){_0x4a0e88=_0x4a0e88-0x0;var _0x41ffc4=_0x975a[_0x4a0e88];return _0x41ffc4;};'use strict';var Sequelize=require(_0xa975('0x0'));module[_0xa975('0x1')]={'name':{'type':Sequelize[_0xa975('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xa975('0x2')]},'description':{'type':Sequelize[_0xa975('0x2')]},'status':{'type':Sequelize[_0xa975('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xa975('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x5060=['exports','STRING','INTEGER','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5060,0x127));var _0x0506=function(_0x2cd657,_0x7943f6){_0x2cd657=_0x2cd657-0x0;var _0x5e1ac6=_0x5060[_0x2cd657];return _0x5e1ac6;};'use strict';var Sequelize=require(_0x0506('0x0'));module[_0x0506('0x1')]={'name':{'type':Sequelize[_0x0506('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0506('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0506('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index b2e22e1..d4533a7 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 _0x0309=['squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','map','Automation','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','rawAttributes','find','catch','create','body','params','addConditions','Condition','ids','getConditions','findOne','order','omit','getActions','zip-dir','moment','mustache','util','path','to-csv','fs-extra'];(function(_0x37b729,_0x8f10af){var _0x40cd25=function(_0x24154b){while(--_0x24154b){_0x37b729['push'](_0x37b729['shift']());}};_0x40cd25(++_0x8f10af);}(_0x0309,0xd4));var _0x9030=function(_0x4468d8,_0x5a0c1e){_0x4468d8=_0x4468d8-0x0;var _0x58b62a=_0x0309[_0x4468d8];return _0x58b62a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9030('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9030('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x9030('0x2'));var util=require(_0x9030('0x3'));var path=require(_0x9030('0x4'));var sox=require('sox');var csv=require(_0x9030('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9030('0x6'));var _=require('lodash');var squel=require(_0x9030('0x7'));var crypto=require(_0x9030('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9030('0x9'));var Papa=require('papaparse');var Redis=require(_0x9030('0xa'));var authService=require('../../components/auth/service');var qs=require(_0x9030('0xb'));var as=require(_0x9030('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9030('0xd'))('api');var utils=require(_0x9030('0xe'));var config=require(_0x9030('0xf'));var licenseUtil=require(_0x9030('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x364bdc,_0x1ceed0){_0x1ceed0=_0x1ceed0||0xcc;return function(_0x3a59c6){if(_0x3a59c6){return _0x364bdc[_0x9030('0x11')](_0x1ceed0);}return _0x364bdc['status'](_0x1ceed0)[_0x9030('0x12')]();};}function respondWithResult(_0x2b8c4a,_0x3db8e5){_0x3db8e5=_0x3db8e5||0xc8;return function(_0x5a3ad0){if(_0x5a3ad0){return _0x2b8c4a[_0x9030('0x13')](_0x3db8e5)['json'](_0x5a3ad0);}};}function respondWithFilteredResult(_0x203c05,_0x3dc0c0){return function(_0x58c4e4){if(_0x58c4e4){var _0x3cdc52=typeof _0x3dc0c0[_0x9030('0x14')]===_0x9030('0x15')&&typeof _0x3dc0c0['limit']===_0x9030('0x15');var _0x2351d3=_0x58c4e4[_0x9030('0x16')];var _0x4b87f6=_0x3cdc52?0x0:_0x3dc0c0[_0x9030('0x14')];var _0x1267c1=_0x3cdc52?_0x58c4e4[_0x9030('0x16')]:_0x3dc0c0[_0x9030('0x14')]+_0x3dc0c0[_0x9030('0x17')];var _0x4c74cb;if(_0x1267c1>=_0x2351d3){_0x1267c1=_0x2351d3;_0x4c74cb=0xc8;}else{_0x4c74cb=0xce;}_0x203c05[_0x9030('0x13')](_0x4c74cb);return _0x203c05['set'](_0x9030('0x18'),_0x4b87f6+'-'+_0x1267c1+'/'+_0x2351d3)[_0x9030('0x19')](_0x58c4e4);}return null;};}function patchUpdates(_0x460fc0){return function(_0x26586e){try{jsonpatch[_0x9030('0x1a')](_0x26586e,_0x460fc0,!![]);}catch(_0x590922){return BPromise[_0x9030('0x1b')](_0x590922);}return _0x26586e[_0x9030('0x1c')]();};}function saveUpdates(_0x38404b,_0x39ff5a){return function(_0x33b7c9){if(_0x33b7c9){return _0x33b7c9[_0x9030('0x1d')](_0x38404b)[_0x9030('0x1e')](function(_0x3acbc7){return _0x3acbc7;});}return null;};}function removeEntity(_0x41b525,_0x25b628){return function(_0x3e7b87){if(_0x3e7b87){return _0x3e7b87[_0x9030('0x1f')]()[_0x9030('0x1e')](function(){_0x41b525['status'](0xcc)[_0x9030('0x12')]();});}};}function handleEntityNotFound(_0x3253ce,_0x42e783){return function(_0x1855f6){if(!_0x1855f6){_0x3253ce[_0x9030('0x11')](0x194);}return _0x1855f6;};}function handleError(_0x1fb3fa,_0x489cc7){_0x489cc7=_0x489cc7||0x1f4;return function(_0x366bb2){logger[_0x9030('0x20')](_0x366bb2['stack']);if(_0x366bb2['name']){delete _0x366bb2[_0x9030('0x21')];}_0x1fb3fa[_0x9030('0x13')](_0x489cc7)[_0x9030('0x22')](_0x366bb2);};}exports['index']=function(_0x24c2d9,_0x4dc0c9){var _0x432070={},_0x2e3c9d={},_0x45a227={'count':0x0,'rows':[]};var _0x5b415b=_[_0x9030('0x23')](db[_0x9030('0x24')]['rawAttributes'],function(_0x2225be){return{'name':_0x2225be['fieldName'],'type':_0x2225be['type']['key']};});_0x2e3c9d['model']=_[_0x9030('0x23')](_0x5b415b,_0x9030('0x21'));_0x2e3c9d[_0x9030('0x25')]=_[_0x9030('0x26')](_0x24c2d9[_0x9030('0x25')]);_0x2e3c9d[_0x9030('0x27')]=_[_0x9030('0x28')](_0x2e3c9d[_0x9030('0x29')],_0x2e3c9d['query']);_0x432070[_0x9030('0x2a')]=_['intersection'](_0x2e3c9d[_0x9030('0x29')],qs[_0x9030('0x2b')](_0x24c2d9[_0x9030('0x25')]['fields']));_0x432070[_0x9030('0x2a')]=_0x432070['attributes'][_0x9030('0x2c')]?_0x432070['attributes']:_0x2e3c9d[_0x9030('0x29')];if(!_0x24c2d9[_0x9030('0x25')][_0x9030('0x2d')](_0x9030('0x2e'))){_0x432070[_0x9030('0x17')]=qs[_0x9030('0x17')](_0x24c2d9[_0x9030('0x25')]['limit']);_0x432070['offset']=qs['offset'](_0x24c2d9['query'][_0x9030('0x14')]);}_0x432070['order']=qs[_0x9030('0x2f')](_0x24c2d9['query']['sort']);_0x432070[_0x9030('0x30')]=qs[_0x9030('0x27')](_[_0x9030('0x31')](_0x24c2d9[_0x9030('0x25')],_0x2e3c9d[_0x9030('0x27')]),_0x5b415b);if(_0x24c2d9[_0x9030('0x25')][_0x9030('0x32')]){_0x432070[_0x9030('0x30')]=_['merge'](_0x432070[_0x9030('0x30')],{'$or':_[_0x9030('0x23')](_0x5b415b,function(_0x519d5e){if(_0x519d5e[_0x9030('0x33')]!==_0x9030('0x34')){var _0x3beda2={};_0x3beda2[_0x519d5e[_0x9030('0x21')]]={'$like':'%'+_0x24c2d9[_0x9030('0x25')][_0x9030('0x32')]+'%'};return _0x3beda2;}})});}_0x432070=_[_0x9030('0x35')]({},_0x432070,_0x24c2d9[_0x9030('0x36')]);var _0x2bd5bd={'where':_0x432070[_0x9030('0x30')]};return db[_0x9030('0x24')][_0x9030('0x16')](_0x2bd5bd)[_0x9030('0x1e')](function(_0x29a632){_0x45a227[_0x9030('0x16')]=_0x29a632;if(_0x24c2d9[_0x9030('0x25')][_0x9030('0x37')]){_0x432070[_0x9030('0x38')]=[{'all':!![]}];}return db[_0x9030('0x24')][_0x9030('0x39')](_0x432070);})[_0x9030('0x1e')](function(_0x3f9c30){_0x45a227[_0x9030('0x3a')]=_0x3f9c30;return _0x45a227;})['then'](respondWithFilteredResult(_0x4dc0c9,_0x432070))['catch'](handleError(_0x4dc0c9,null));};exports['show']=function(_0x7e8114,_0x200d25){var _0x58ced8={'raw':![],'where':{'id':_0x7e8114['params']['id']}},_0x22e44d={};_0x22e44d[_0x9030('0x29')]=_[_0x9030('0x26')](db['Automation'][_0x9030('0x3b')]);_0x22e44d[_0x9030('0x25')]=_['keys'](_0x7e8114['query']);_0x22e44d[_0x9030('0x27')]=_['intersection'](_0x22e44d[_0x9030('0x29')],_0x22e44d[_0x9030('0x25')]);_0x58ced8[_0x9030('0x2a')]=_[_0x9030('0x28')](_0x22e44d['model'],qs[_0x9030('0x2b')](_0x7e8114[_0x9030('0x25')][_0x9030('0x2b')]));_0x58ced8[_0x9030('0x2a')]=_0x58ced8[_0x9030('0x2a')][_0x9030('0x2c')]?_0x58ced8[_0x9030('0x2a')]:_0x22e44d[_0x9030('0x29')];if(_0x7e8114['query'][_0x9030('0x37')]){_0x58ced8[_0x9030('0x38')]=[{'all':!![]}];}_0x58ced8=_[_0x9030('0x35')]({},_0x58ced8,_0x7e8114[_0x9030('0x36')]);return db[_0x9030('0x24')][_0x9030('0x3c')](_0x58ced8)[_0x9030('0x1e')](handleEntityNotFound(_0x200d25,null))['then'](respondWithResult(_0x200d25,null))[_0x9030('0x3d')](handleError(_0x200d25,null));};exports[_0x9030('0x3e')]=function(_0x5590ed,_0x4e08b4){return db[_0x9030('0x24')][_0x9030('0x3e')](_0x5590ed[_0x9030('0x3f')],{})[_0x9030('0x1e')](respondWithResult(_0x4e08b4,0xc9))[_0x9030('0x3d')](handleError(_0x4e08b4,null));};exports[_0x9030('0x1d')]=function(_0x1b01f7,_0x1592f4){if(_0x1b01f7[_0x9030('0x3f')]['id']){delete _0x1b01f7['body']['id'];}return db[_0x9030('0x24')][_0x9030('0x3c')]({'where':{'id':_0x1b01f7['params']['id']}})[_0x9030('0x1e')](handleEntityNotFound(_0x1592f4,null))[_0x9030('0x1e')](saveUpdates(_0x1b01f7[_0x9030('0x3f')],null))[_0x9030('0x1e')](respondWithResult(_0x1592f4,null))[_0x9030('0x3d')](handleError(_0x1592f4,null));};exports['destroy']=function(_0x55c4fe,_0x122295){return db[_0x9030('0x24')]['find']({'where':{'id':_0x55c4fe[_0x9030('0x40')]['id']}})[_0x9030('0x1e')](handleEntityNotFound(_0x122295,null))[_0x9030('0x1e')](removeEntity(_0x122295,null))['catch'](handleError(_0x122295,null));};exports[_0x9030('0x41')]=function(_0x8b5571,_0x5d133a,_0x41b570){return db[_0x9030('0x42')][_0x9030('0x3c')]({'where':{'id':_0x8b5571[_0x9030('0x40')]['id']}})[_0x9030('0x1e')](handleEntityNotFound(_0x5d133a,null))['then'](function(_0x4111d3){if(_0x4111d3){return _0x4111d3[_0x9030('0x41')](_0x8b5571[_0x9030('0x3f')]['ids'],_['omit'](_0x8b5571[_0x9030('0x3f')],[_0x9030('0x43'),'id'])||{});}})[_0x9030('0x1e')](respondWithResult(_0x5d133a,null))[_0x9030('0x3d')](handleError(_0x5d133a,null));};exports[_0x9030('0x44')]=function(_0x4e6e3,_0xf3adf,_0x10c715){var _0x182088={};var _0x83f947={};var _0x12b68d;var _0x568b4b;return db[_0x9030('0x24')][_0x9030('0x45')]({'where':{'id':_0x4e6e3[_0x9030('0x40')]['id']}})[_0x9030('0x1e')](handleEntityNotFound(_0xf3adf,null))[_0x9030('0x1e')](function(_0x1bdb93){if(_0x1bdb93){_0x12b68d=_0x1bdb93;_0x83f947[_0x9030('0x29')]=_[_0x9030('0x26')](db[_0x9030('0x42')][_0x9030('0x3b')]);_0x83f947[_0x9030('0x25')]=_[_0x9030('0x26')](_0x4e6e3[_0x9030('0x25')]);_0x83f947[_0x9030('0x27')]=_[_0x9030('0x28')](_0x83f947[_0x9030('0x29')],_0x83f947['query']);_0x182088[_0x9030('0x2a')]=_[_0x9030('0x28')](_0x83f947[_0x9030('0x29')],qs[_0x9030('0x2b')](_0x4e6e3[_0x9030('0x25')][_0x9030('0x2b')]));_0x182088[_0x9030('0x2a')]=_0x182088[_0x9030('0x2a')][_0x9030('0x2c')]?_0x182088[_0x9030('0x2a')]:_0x83f947[_0x9030('0x29')];_0x182088[_0x9030('0x46')]=qs[_0x9030('0x2f')](_0x4e6e3['query'][_0x9030('0x2f')]);_0x182088['where']=qs[_0x9030('0x27')](_[_0x9030('0x31')](_0x4e6e3[_0x9030('0x25')],_0x83f947[_0x9030('0x27')]));if(_0x4e6e3[_0x9030('0x25')][_0x9030('0x32')]){_0x182088['where']=_[_0x9030('0x35')](_0x182088['where'],{'$or':_['map'](_0x182088['attributes'],function(_0x290b20){var _0x53ee6f={};_0x53ee6f[_0x290b20]={'$like':'%'+_0x4e6e3[_0x9030('0x25')]['filter']+'%'};return _0x53ee6f;})});}_0x182088=_[_0x9030('0x35')]({},_0x182088,_0x4e6e3['options']);return _0x12b68d[_0x9030('0x44')](_0x182088);}})[_0x9030('0x1e')](function(_0x183795){if(_0x183795){_0x568b4b=_0x183795[_0x9030('0x2c')];if(!_0x4e6e3[_0x9030('0x25')][_0x9030('0x2d')](_0x9030('0x2e'))){_0x182088['limit']=qs[_0x9030('0x17')](_0x4e6e3[_0x9030('0x25')]['limit']);_0x182088[_0x9030('0x14')]=qs[_0x9030('0x14')](_0x4e6e3[_0x9030('0x25')][_0x9030('0x14')]);}return _0x12b68d['getConditions'](_0x182088);}})[_0x9030('0x1e')](function(_0x5b5ff2){if(_0x5b5ff2){return _0x5b5ff2?{'count':_0x568b4b,'rows':_0x5b5ff2}:null;}})[_0x9030('0x1e')](respondWithResult(_0xf3adf,null))[_0x9030('0x3d')](handleError(_0xf3adf,null));};exports['addActions']=function(_0x4c85fa,_0x1b37d6,_0x1f2652){return db['Action'][_0x9030('0x3c')]({'where':{'id':_0x4c85fa[_0x9030('0x40')]['id']}})['then'](handleEntityNotFound(_0x1b37d6,null))[_0x9030('0x1e')](function(_0x4abcbc){if(_0x4abcbc){return _0x4abcbc['addActions'](_0x4c85fa['body'][_0x9030('0x43')],_[_0x9030('0x47')](_0x4c85fa[_0x9030('0x3f')],[_0x9030('0x43'),'id'])||{});}})[_0x9030('0x1e')](respondWithResult(_0x1b37d6,null))[_0x9030('0x3d')](handleError(_0x1b37d6,null));};exports['getActions']=function(_0x4cf942,_0x1f1393,_0x301e82){var _0x6da487={};var _0xd7efc5={};var _0x42bb3e;var _0x5480e2;return db['Automation']['findOne']({'where':{'id':_0x4cf942[_0x9030('0x40')]['id']}})['then'](handleEntityNotFound(_0x1f1393,null))[_0x9030('0x1e')](function(_0x3f87ee){if(_0x3f87ee){_0x42bb3e=_0x3f87ee;_0xd7efc5[_0x9030('0x29')]=_[_0x9030('0x26')](db['Action'][_0x9030('0x3b')]);_0xd7efc5[_0x9030('0x25')]=_[_0x9030('0x26')](_0x4cf942[_0x9030('0x25')]);_0xd7efc5[_0x9030('0x27')]=_['intersection'](_0xd7efc5[_0x9030('0x29')],_0xd7efc5[_0x9030('0x25')]);_0x6da487[_0x9030('0x2a')]=_['intersection'](_0xd7efc5[_0x9030('0x29')],qs[_0x9030('0x2b')](_0x4cf942[_0x9030('0x25')][_0x9030('0x2b')]));_0x6da487['attributes']=_0x6da487[_0x9030('0x2a')][_0x9030('0x2c')]?_0x6da487[_0x9030('0x2a')]:_0xd7efc5[_0x9030('0x29')];_0x6da487[_0x9030('0x46')]=qs['sort'](_0x4cf942['query'][_0x9030('0x2f')]);_0x6da487[_0x9030('0x30')]=qs['filters'](_[_0x9030('0x31')](_0x4cf942[_0x9030('0x25')],_0xd7efc5[_0x9030('0x27')]));if(_0x4cf942['query'][_0x9030('0x32')]){_0x6da487['where']=_[_0x9030('0x35')](_0x6da487[_0x9030('0x30')],{'$or':_[_0x9030('0x23')](_0x6da487[_0x9030('0x2a')],function(_0x2b7385){var _0x2bf01b={};_0x2bf01b[_0x2b7385]={'$like':'%'+_0x4cf942[_0x9030('0x25')][_0x9030('0x32')]+'%'};return _0x2bf01b;})});}_0x6da487=_['merge']({},_0x6da487,_0x4cf942['options']);return _0x42bb3e[_0x9030('0x48')](_0x6da487);}})['then'](function(_0x21d0c1){if(_0x21d0c1){_0x5480e2=_0x21d0c1[_0x9030('0x2c')];if(!_0x4cf942[_0x9030('0x25')][_0x9030('0x2d')]('nolimit')){_0x6da487[_0x9030('0x17')]=qs['limit'](_0x4cf942[_0x9030('0x25')][_0x9030('0x17')]);_0x6da487[_0x9030('0x14')]=qs[_0x9030('0x14')](_0x4cf942[_0x9030('0x25')]['offset']);}return _0x42bb3e[_0x9030('0x48')](_0x6da487);}})[_0x9030('0x1e')](function(_0x17453f){if(_0x17453f){return _0x17453f?{'count':_0x5480e2,'rows':_0x17453f}:null;}})[_0x9030('0x1e')](respondWithResult(_0x1f1393,null))[_0x9030('0x3d')](handleError(_0x1f1393,null));};
\ No newline at end of file
+var _0x67c5=['offset','undefined','limit','count','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Automation','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','Condition','addConditions','ids','omit','findOne','length','getConditions','addActions','Action','getActions','pick','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x7bfa1b,_0xf2a59c){var _0x2126b2=function(_0x4ac0d6){while(--_0x4ac0d6){_0x7bfa1b['push'](_0x7bfa1b['shift']());}};_0x2126b2(++_0xf2a59c);}(_0x67c5,0x17a));var _0x567c=function(_0x346210,_0x58972f){_0x346210=_0x346210-0x0;var _0x8d7670=_0x67c5[_0x346210];return _0x8d7670;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x567c('0x0'));var zipdir=require(_0x567c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x567c('0x2'));var BPromise=require(_0x567c('0x3'));var Mustache=require(_0x567c('0x4'));var util=require('util');var path=require('path');var sox=require(_0x567c('0x5'));var csv=require(_0x567c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x567c('0x7'));var _=require(_0x567c('0x8'));var squel=require(_0x567c('0x9'));var crypto=require(_0x567c('0xa'));var jsforce=require(_0x567c('0xb'));var deskjs=require(_0x567c('0xc'));var toCsv=require(_0x567c('0x6'));var querystring=require(_0x567c('0xd'));var Papa=require(_0x567c('0xe'));var Redis=require(_0x567c('0xf'));var authService=require(_0x567c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x567c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x567c('0x12'));var utils=require(_0x567c('0x13'));var config=require(_0x567c('0x14'));var licenseUtil=require(_0x567c('0x15'));var db=require(_0x567c('0x16'))['db'];function respondWithStatusCode(_0x3920bd,_0x292cfc){_0x292cfc=_0x292cfc||0xcc;return function(_0x535c28){if(_0x535c28){return _0x3920bd[_0x567c('0x17')](_0x292cfc);}return _0x3920bd[_0x567c('0x18')](_0x292cfc)[_0x567c('0x19')]();};}function respondWithResult(_0x16d328,_0x1aa58b){_0x1aa58b=_0x1aa58b||0xc8;return function(_0x83d558){if(_0x83d558){return _0x16d328['status'](_0x1aa58b)[_0x567c('0x1a')](_0x83d558);}};}function respondWithFilteredResult(_0x3717e5,_0x3073c3){return function(_0x5cc041){if(_0x5cc041){var _0x57b437=typeof _0x3073c3[_0x567c('0x1b')]===_0x567c('0x1c')&&typeof _0x3073c3[_0x567c('0x1d')]===_0x567c('0x1c');var _0x57c193=_0x5cc041[_0x567c('0x1e')];var _0x443fbd=_0x57b437?0x0:_0x3073c3[_0x567c('0x1b')];var _0x541121=_0x57b437?_0x5cc041[_0x567c('0x1e')]:_0x3073c3[_0x567c('0x1b')]+_0x3073c3[_0x567c('0x1d')];var _0xaeca4d;if(_0x541121>=_0x57c193){_0x541121=_0x57c193;_0xaeca4d=0xc8;}else{_0xaeca4d=0xce;}_0x3717e5[_0x567c('0x18')](_0xaeca4d);return _0x3717e5['set']('Content-Range',_0x443fbd+'-'+_0x541121+'/'+_0x57c193)[_0x567c('0x1a')](_0x5cc041);}return null;};}function patchUpdates(_0x59086e){return function(_0x44148c){try{jsonpatch['apply'](_0x44148c,_0x59086e,!![]);}catch(_0x3fa28f){return BPromise[_0x567c('0x1f')](_0x3fa28f);}return _0x44148c[_0x567c('0x20')]();};}function saveUpdates(_0x1e1c3b,_0x530719){return function(_0x6b47f1){if(_0x6b47f1){return _0x6b47f1['update'](_0x1e1c3b)[_0x567c('0x21')](function(_0x511aab){return _0x511aab;});}return null;};}function removeEntity(_0x110aea,_0x40f57c){return function(_0x3c0ccc){if(_0x3c0ccc){return _0x3c0ccc[_0x567c('0x22')]()[_0x567c('0x21')](function(){_0x110aea[_0x567c('0x18')](0xcc)[_0x567c('0x19')]();});}};}function handleEntityNotFound(_0x235e33,_0x2066aa){return function(_0x4dd87b){if(!_0x4dd87b){_0x235e33[_0x567c('0x17')](0x194);}return _0x4dd87b;};}function handleError(_0x4fb8d5,_0x3d02d4){_0x3d02d4=_0x3d02d4||0x1f4;return function(_0x313847){logger['error'](_0x313847[_0x567c('0x23')]);if(_0x313847[_0x567c('0x24')]){delete _0x313847['name'];}_0x4fb8d5[_0x567c('0x18')](_0x3d02d4)[_0x567c('0x25')](_0x313847);};}exports[_0x567c('0x26')]=function(_0x1f493a,_0x1f9327){var _0x3122d4={},_0x5a18c6={},_0x15784a={'count':0x0,'rows':[]};var _0xf874e8=_[_0x567c('0x27')](db['Automation'][_0x567c('0x28')],function(_0x342e96){return{'name':_0x342e96['fieldName'],'type':_0x342e96[_0x567c('0x29')]['key']};});_0x5a18c6['model']=_['map'](_0xf874e8,'name');_0x5a18c6[_0x567c('0x2a')]=_[_0x567c('0x2b')](_0x1f493a[_0x567c('0x2a')]);_0x5a18c6[_0x567c('0x2c')]=_[_0x567c('0x2d')](_0x5a18c6[_0x567c('0x2e')],_0x5a18c6['query']);_0x3122d4[_0x567c('0x2f')]=_[_0x567c('0x2d')](_0x5a18c6['model'],qs[_0x567c('0x30')](_0x1f493a[_0x567c('0x2a')][_0x567c('0x30')]));_0x3122d4[_0x567c('0x2f')]=_0x3122d4[_0x567c('0x2f')]['length']?_0x3122d4[_0x567c('0x2f')]:_0x5a18c6[_0x567c('0x2e')];if(!_0x1f493a[_0x567c('0x2a')][_0x567c('0x31')](_0x567c('0x32'))){_0x3122d4['limit']=qs['limit'](_0x1f493a['query'][_0x567c('0x1d')]);_0x3122d4[_0x567c('0x1b')]=qs['offset'](_0x1f493a[_0x567c('0x2a')][_0x567c('0x1b')]);}_0x3122d4[_0x567c('0x33')]=qs[_0x567c('0x34')](_0x1f493a[_0x567c('0x2a')][_0x567c('0x34')]);_0x3122d4[_0x567c('0x35')]=qs[_0x567c('0x2c')](_['pick'](_0x1f493a[_0x567c('0x2a')],_0x5a18c6['filters']),_0xf874e8);if(_0x1f493a['query'][_0x567c('0x36')]){_0x3122d4[_0x567c('0x35')]=_[_0x567c('0x37')](_0x3122d4[_0x567c('0x35')],{'$or':_[_0x567c('0x27')](_0xf874e8,function(_0x165cdb){if(_0x165cdb[_0x567c('0x29')]!==_0x567c('0x38')){var _0x49c288={};_0x49c288[_0x165cdb[_0x567c('0x24')]]={'$like':'%'+_0x1f493a['query'][_0x567c('0x36')]+'%'};return _0x49c288;}})});}_0x3122d4=_[_0x567c('0x37')]({},_0x3122d4,_0x1f493a[_0x567c('0x39')]);var _0x354c80={'where':_0x3122d4[_0x567c('0x35')]};return db[_0x567c('0x3a')][_0x567c('0x1e')](_0x354c80)[_0x567c('0x21')](function(_0x7c64fb){_0x15784a[_0x567c('0x1e')]=_0x7c64fb;if(_0x1f493a[_0x567c('0x2a')][_0x567c('0x3b')]){_0x3122d4['include']=[{'all':!![]}];}return db[_0x567c('0x3a')][_0x567c('0x3c')](_0x3122d4);})[_0x567c('0x21')](function(_0x293163){_0x15784a[_0x567c('0x3d')]=_0x293163;return _0x15784a;})[_0x567c('0x21')](respondWithFilteredResult(_0x1f9327,_0x3122d4))[_0x567c('0x3e')](handleError(_0x1f9327,null));};exports[_0x567c('0x3f')]=function(_0x614051,_0x788ce9){var _0x397ea6={'raw':![],'where':{'id':_0x614051[_0x567c('0x40')]['id']}},_0x52a896={};_0x52a896['model']=_[_0x567c('0x2b')](db[_0x567c('0x3a')]['rawAttributes']);_0x52a896['query']=_[_0x567c('0x2b')](_0x614051[_0x567c('0x2a')]);_0x52a896[_0x567c('0x2c')]=_[_0x567c('0x2d')](_0x52a896['model'],_0x52a896[_0x567c('0x2a')]);_0x397ea6['attributes']=_[_0x567c('0x2d')](_0x52a896[_0x567c('0x2e')],qs[_0x567c('0x30')](_0x614051[_0x567c('0x2a')]['fields']));_0x397ea6[_0x567c('0x2f')]=_0x397ea6[_0x567c('0x2f')]['length']?_0x397ea6['attributes']:_0x52a896[_0x567c('0x2e')];if(_0x614051[_0x567c('0x2a')]['includeAll']){_0x397ea6[_0x567c('0x41')]=[{'all':!![]}];}_0x397ea6=_[_0x567c('0x37')]({},_0x397ea6,_0x614051['options']);return db['Automation'][_0x567c('0x42')](_0x397ea6)[_0x567c('0x21')](handleEntityNotFound(_0x788ce9,null))['then'](respondWithResult(_0x788ce9,null))[_0x567c('0x3e')](handleError(_0x788ce9,null));};exports['create']=function(_0xc3269a,_0x588cbc){return db[_0x567c('0x3a')][_0x567c('0x43')](_0xc3269a[_0x567c('0x44')],{})[_0x567c('0x21')](respondWithResult(_0x588cbc,0xc9))['catch'](handleError(_0x588cbc,null));};exports[_0x567c('0x45')]=function(_0x4267c1,_0x21feb1){if(_0x4267c1['body']['id']){delete _0x4267c1[_0x567c('0x44')]['id'];}return db[_0x567c('0x3a')]['find']({'where':{'id':_0x4267c1[_0x567c('0x40')]['id']}})[_0x567c('0x21')](handleEntityNotFound(_0x21feb1,null))[_0x567c('0x21')](saveUpdates(_0x4267c1[_0x567c('0x44')],null))[_0x567c('0x21')](respondWithResult(_0x21feb1,null))['catch'](handleError(_0x21feb1,null));};exports[_0x567c('0x22')]=function(_0x4a1830,_0x39932c){return db[_0x567c('0x3a')]['find']({'where':{'id':_0x4a1830[_0x567c('0x40')]['id']}})[_0x567c('0x21')](handleEntityNotFound(_0x39932c,null))[_0x567c('0x21')](removeEntity(_0x39932c,null))[_0x567c('0x3e')](handleError(_0x39932c,null));};exports['addConditions']=function(_0x5afbbf,_0x472d13,_0x32b8ef){return db[_0x567c('0x46')][_0x567c('0x42')]({'where':{'id':_0x5afbbf['params']['id']}})['then'](handleEntityNotFound(_0x472d13,null))[_0x567c('0x21')](function(_0x25f273){if(_0x25f273){return _0x25f273[_0x567c('0x47')](_0x5afbbf[_0x567c('0x44')][_0x567c('0x48')],_[_0x567c('0x49')](_0x5afbbf[_0x567c('0x44')],[_0x567c('0x48'),'id'])||{});}})[_0x567c('0x21')](respondWithResult(_0x472d13,null))['catch'](handleError(_0x472d13,null));};exports['getConditions']=function(_0x11fc73,_0x512d58,_0x762ed6){var _0x493a11={};var _0x1c057d={};var _0x31c388;var _0x47233a;return db[_0x567c('0x3a')][_0x567c('0x4a')]({'where':{'id':_0x11fc73['params']['id']}})['then'](handleEntityNotFound(_0x512d58,null))[_0x567c('0x21')](function(_0x29b939){if(_0x29b939){_0x31c388=_0x29b939;_0x1c057d[_0x567c('0x2e')]=_[_0x567c('0x2b')](db[_0x567c('0x46')][_0x567c('0x28')]);_0x1c057d[_0x567c('0x2a')]=_[_0x567c('0x2b')](_0x11fc73[_0x567c('0x2a')]);_0x1c057d['filters']=_[_0x567c('0x2d')](_0x1c057d[_0x567c('0x2e')],_0x1c057d['query']);_0x493a11[_0x567c('0x2f')]=_['intersection'](_0x1c057d[_0x567c('0x2e')],qs[_0x567c('0x30')](_0x11fc73[_0x567c('0x2a')][_0x567c('0x30')]));_0x493a11['attributes']=_0x493a11['attributes'][_0x567c('0x4b')]?_0x493a11[_0x567c('0x2f')]:_0x1c057d['model'];_0x493a11[_0x567c('0x33')]=qs['sort'](_0x11fc73[_0x567c('0x2a')][_0x567c('0x34')]);_0x493a11[_0x567c('0x35')]=qs[_0x567c('0x2c')](_['pick'](_0x11fc73[_0x567c('0x2a')],_0x1c057d[_0x567c('0x2c')]));if(_0x11fc73[_0x567c('0x2a')][_0x567c('0x36')]){_0x493a11['where']=_['merge'](_0x493a11[_0x567c('0x35')],{'$or':_[_0x567c('0x27')](_0x493a11[_0x567c('0x2f')],function(_0x19634f){var _0x503aea={};_0x503aea[_0x19634f]={'$like':'%'+_0x11fc73[_0x567c('0x2a')]['filter']+'%'};return _0x503aea;})});}_0x493a11=_[_0x567c('0x37')]({},_0x493a11,_0x11fc73[_0x567c('0x39')]);return _0x31c388[_0x567c('0x4c')](_0x493a11);}})[_0x567c('0x21')](function(_0x5c4c1f){if(_0x5c4c1f){_0x47233a=_0x5c4c1f[_0x567c('0x4b')];if(!_0x11fc73[_0x567c('0x2a')][_0x567c('0x31')](_0x567c('0x32'))){_0x493a11[_0x567c('0x1d')]=qs[_0x567c('0x1d')](_0x11fc73[_0x567c('0x2a')][_0x567c('0x1d')]);_0x493a11[_0x567c('0x1b')]=qs[_0x567c('0x1b')](_0x11fc73[_0x567c('0x2a')][_0x567c('0x1b')]);}return _0x31c388['getConditions'](_0x493a11);}})['then'](function(_0x4f9a3b){if(_0x4f9a3b){return _0x4f9a3b?{'count':_0x47233a,'rows':_0x4f9a3b}:null;}})[_0x567c('0x21')](respondWithResult(_0x512d58,null))[_0x567c('0x3e')](handleError(_0x512d58,null));};exports[_0x567c('0x4d')]=function(_0x30f366,_0x83c4f4,_0x255830){return db[_0x567c('0x4e')][_0x567c('0x42')]({'where':{'id':_0x30f366[_0x567c('0x40')]['id']}})[_0x567c('0x21')](handleEntityNotFound(_0x83c4f4,null))[_0x567c('0x21')](function(_0x21ebb0){if(_0x21ebb0){return _0x21ebb0['addActions'](_0x30f366['body'][_0x567c('0x48')],_[_0x567c('0x49')](_0x30f366[_0x567c('0x44')],[_0x567c('0x48'),'id'])||{});}})[_0x567c('0x21')](respondWithResult(_0x83c4f4,null))[_0x567c('0x3e')](handleError(_0x83c4f4,null));};exports[_0x567c('0x4f')]=function(_0x557ce6,_0x434004,_0x53e8ce){var _0x83c3f2={};var _0x1cede7={};var _0x5ccf69;var _0x4674eb;return db[_0x567c('0x3a')][_0x567c('0x4a')]({'where':{'id':_0x557ce6[_0x567c('0x40')]['id']}})['then'](handleEntityNotFound(_0x434004,null))[_0x567c('0x21')](function(_0x2e83f9){if(_0x2e83f9){_0x5ccf69=_0x2e83f9;_0x1cede7[_0x567c('0x2e')]=_[_0x567c('0x2b')](db[_0x567c('0x4e')][_0x567c('0x28')]);_0x1cede7[_0x567c('0x2a')]=_[_0x567c('0x2b')](_0x557ce6['query']);_0x1cede7[_0x567c('0x2c')]=_[_0x567c('0x2d')](_0x1cede7[_0x567c('0x2e')],_0x1cede7[_0x567c('0x2a')]);_0x83c3f2[_0x567c('0x2f')]=_['intersection'](_0x1cede7[_0x567c('0x2e')],qs['fields'](_0x557ce6[_0x567c('0x2a')][_0x567c('0x30')]));_0x83c3f2[_0x567c('0x2f')]=_0x83c3f2[_0x567c('0x2f')][_0x567c('0x4b')]?_0x83c3f2['attributes']:_0x1cede7[_0x567c('0x2e')];_0x83c3f2[_0x567c('0x33')]=qs['sort'](_0x557ce6[_0x567c('0x2a')][_0x567c('0x34')]);_0x83c3f2[_0x567c('0x35')]=qs[_0x567c('0x2c')](_[_0x567c('0x50')](_0x557ce6[_0x567c('0x2a')],_0x1cede7[_0x567c('0x2c')]));if(_0x557ce6[_0x567c('0x2a')]['filter']){_0x83c3f2['where']=_['merge'](_0x83c3f2[_0x567c('0x35')],{'$or':_[_0x567c('0x27')](_0x83c3f2['attributes'],function(_0x210745){var _0x144f53={};_0x144f53[_0x210745]={'$like':'%'+_0x557ce6[_0x567c('0x2a')]['filter']+'%'};return _0x144f53;})});}_0x83c3f2=_[_0x567c('0x37')]({},_0x83c3f2,_0x557ce6[_0x567c('0x39')]);return _0x5ccf69[_0x567c('0x4f')](_0x83c3f2);}})[_0x567c('0x21')](function(_0x865bf6){if(_0x865bf6){_0x4674eb=_0x865bf6[_0x567c('0x4b')];if(!_0x557ce6[_0x567c('0x2a')]['hasOwnProperty'](_0x567c('0x32'))){_0x83c3f2['limit']=qs[_0x567c('0x1d')](_0x557ce6['query'][_0x567c('0x1d')]);_0x83c3f2[_0x567c('0x1b')]=qs[_0x567c('0x1b')](_0x557ce6[_0x567c('0x2a')][_0x567c('0x1b')]);}return _0x5ccf69['getActions'](_0x83c3f2);}})[_0x567c('0x21')](function(_0x22f103){if(_0x22f103){return _0x22f103?{'count':_0x4674eb,'rows':_0x22f103}:null;}})[_0x567c('0x21')](respondWithResult(_0x434004,null))[_0x567c('0x3e')](handleError(_0x434004,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 6d828d2..cbc46a9 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 _0xd49b=['moment','bluebird','rimraf','../../config/environment','exports','define','Automation','lodash','util','../../config/logger','api'];(function(_0x3562ab,_0x3e2f44){var _0xc137c8=function(_0x58cf20){while(--_0x58cf20){_0x3562ab['push'](_0x3562ab['shift']());}};_0xc137c8(++_0x3e2f44);}(_0xd49b,0x1bf));var _0xbd49=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xd49b[_0x543084];return _0x306a57;};'use strict';var _=require(_0xbd49('0x0'));var util=require(_0xbd49('0x1'));var logger=require(_0xbd49('0x2'))(_0xbd49('0x3'));var moment=require(_0xbd49('0x4'));var BPromise=require(_0xbd49('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbd49('0x6'));var config=require(_0xbd49('0x7'));var attributes=require('./automation.attributes');module[_0xbd49('0x8')]=function(_0x5c3498,_0x5bd4af){return _0x5c3498[_0xbd49('0x9')](_0xbd49('0xa'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf758=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','Automation','tools_automations','lodash','util'];(function(_0x5ebf85,_0x598413){var _0x5b175a=function(_0x3b213a){while(--_0x3b213a){_0x5ebf85['push'](_0x5ebf85['shift']());}};_0x5b175a(++_0x598413);}(_0xf758,0x16a));var _0x8f75=function(_0x1bef07,_0x2a4e64){_0x1bef07=_0x1bef07-0x0;var _0x29edf6=_0xf758[_0x1bef07];return _0x29edf6;};'use strict';var _=require(_0x8f75('0x0'));var util=require(_0x8f75('0x1'));var logger=require(_0x8f75('0x2'))(_0x8f75('0x3'));var moment=require(_0x8f75('0x4'));var BPromise=require(_0x8f75('0x5'));var rp=require(_0x8f75('0x6'));var fs=require('fs');var path=require(_0x8f75('0x7'));var rimraf=require('rimraf');var config=require(_0x8f75('0x8'));var attributes=require('./automation.attributes');module[_0x8f75('0x9')]=function(_0x37f4a3,_0x54bc88){return _0x37f4a3[_0x8f75('0xa')](_0x8f75('0xb'),attributes,{'tableName':_0x8f75('0xc'),'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 486a300..69cf6c4 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 _0x2ebd=['../../config/logger','rpc','../../config/environment','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x559528,_0x455857){var _0x567e33=function(_0xbc0b9f){while(--_0xbc0b9f){_0x559528['push'](_0x559528['shift']());}};_0x567e33(++_0x455857);}(_0x2ebd,0x1c8));var _0xd2eb=function(_0x43faac,_0x3196b3){_0x43faac=_0x43faac-0x0;var _0x56d174=_0x2ebd[_0x43faac];return _0x56d174;};'use strict';var _=require(_0xd2eb('0x0'));var util=require(_0xd2eb('0x1'));var moment=require(_0xd2eb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2eb('0x3'));var db=require(_0xd2eb('0x4'))['db'];var utils=require(_0xd2eb('0x5'));var logger=require(_0xd2eb('0x6'))(_0xd2eb('0x7'));var config=require(_0xd2eb('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd2eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2754dd,_0x496362,_0xcd242c){return new BPromise(function(_0x230113,_0x47f93e){return client[_0xd2eb('0xa')](_0x2754dd,_0xcd242c)[_0xd2eb('0xb')](function(_0x5eca80){logger['info'](_0xd2eb('0xc'),_0x496362,_0xd2eb('0xd'));logger[_0xd2eb('0xe')](_0xd2eb('0xf'),_0x496362,_0xd2eb('0xd'),JSON[_0xd2eb('0x10')](_0x5eca80));if(_0x5eca80[_0xd2eb('0x11')]){if(_0x5eca80[_0xd2eb('0x11')][_0xd2eb('0x12')]===0x1f4){logger[_0xd2eb('0x11')](_0xd2eb('0xc'),_0x496362,_0x5eca80[_0xd2eb('0x11')]['message']);return _0x47f93e(_0x5eca80[_0xd2eb('0x11')]['message']);}logger[_0xd2eb('0x11')](_0xd2eb('0xc'),_0x496362,_0x5eca80['error'][_0xd2eb('0x13')]);return _0x230113(_0x5eca80[_0xd2eb('0x11')]['message']);}else{logger[_0xd2eb('0x14')](_0xd2eb('0xc'),_0x496362,_0xd2eb('0xd'));_0x230113(_0x5eca80['result']['message']);}})[_0xd2eb('0x15')](function(_0x5086ab){logger['error'](_0xd2eb('0xc'),_0x496362,_0x5086ab);_0x47f93e(_0x5086ab);});});}
\ No newline at end of file
+var _0x8b35=['code','Automation,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x5968df,_0xd6d0b9){var _0x522007=function(_0x435e5e){while(--_0x435e5e){_0x5968df['push'](_0x5968df['shift']());}};_0x522007(++_0xd6d0b9);}(_0x8b35,0x17a));var _0x58b3=function(_0x1b2282,_0x466aa0){_0x1b2282=_0x1b2282-0x0;var _0x161391=_0x8b35[_0x1b2282];return _0x161391;};'use strict';var _=require(_0x58b3('0x0'));var util=require(_0x58b3('0x1'));var moment=require(_0x58b3('0x2'));var BPromise=require(_0x58b3('0x3'));var rs=require(_0x58b3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58b3('0x5'))['db'];var utils=require(_0x58b3('0x6'));var logger=require(_0x58b3('0x7'))(_0x58b3('0x8'));var config=require(_0x58b3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x58b3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35d044,_0x5ec362,_0x503b78){return new BPromise(function(_0x126232,_0x46fda3){return client[_0x58b3('0xb')](_0x35d044,_0x503b78)[_0x58b3('0xc')](function(_0x446e8d){logger[_0x58b3('0xd')]('Automation,\x20%s,\x20%s',_0x5ec362,_0x58b3('0xe'));logger[_0x58b3('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x5ec362,_0x58b3('0xe'),JSON[_0x58b3('0x10')](_0x446e8d));if(_0x446e8d[_0x58b3('0x11')]){if(_0x446e8d['error'][_0x58b3('0x12')]===0x1f4){logger['error'](_0x58b3('0x13'),_0x5ec362,_0x446e8d[_0x58b3('0x11')][_0x58b3('0x14')]);return _0x46fda3(_0x446e8d[_0x58b3('0x11')][_0x58b3('0x14')]);}logger[_0x58b3('0x11')](_0x58b3('0x13'),_0x5ec362,_0x446e8d['error'][_0x58b3('0x14')]);return _0x126232(_0x446e8d[_0x58b3('0x11')]['message']);}else{logger[_0x58b3('0xd')](_0x58b3('0x13'),_0x5ec362,'request\x20sent');_0x126232(_0x446e8d['result'][_0x58b3('0x14')]);}})[_0x58b3('0x15')](function(_0x38f6a7){logger[_0x58b3('0x11')]('Automation,\x20%s,\x20%s',_0x5ec362,_0x38f6a7);_0x46fda3(_0x38f6a7);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 9296f5f..38fb333 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 _0x3378=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','/:id/conditions','getConditions','/:id/actions','post','create','addConditions','addActions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3378,0xc2));var _0x8337=function(_0x53e3fa,_0x50c5f2){_0x53e3fa=_0x53e3fa-0x0;var _0xe8584a=_0x3378[_0x53e3fa];return _0xe8584a;};'use strict';var multer=require(_0x8337('0x0'));var util=require(_0x8337('0x1'));var path=require(_0x8337('0x2'));var timeout=require(_0x8337('0x3'));var express=require(_0x8337('0x4'));var router=express[_0x8337('0x5')]();var fs_extra=require(_0x8337('0x6'));var auth=require(_0x8337('0x7'));var interaction=require(_0x8337('0x8'));var config=require(_0x8337('0x9'));var controller=require(_0x8337('0xa'));router[_0x8337('0xb')]('/',auth[_0x8337('0xc')](),controller[_0x8337('0xd')]);router[_0x8337('0xb')](_0x8337('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x8337('0xf'),auth['isAuthenticated'](),controller[_0x8337('0x10')]);router['get'](_0x8337('0x11'),auth[_0x8337('0xc')](),controller['getActions']);router[_0x8337('0x12')]('/',auth[_0x8337('0xc')](),controller[_0x8337('0x13')]);router[_0x8337('0x12')](_0x8337('0xf'),auth[_0x8337('0xc')](),controller[_0x8337('0x14')]);router[_0x8337('0x12')](_0x8337('0x11'),auth[_0x8337('0xc')](),controller[_0x8337('0x15')]);router[_0x8337('0x16')](_0x8337('0xe'),auth[_0x8337('0xc')](),controller[_0x8337('0x17')]);router[_0x8337('0x18')]('/:id',auth[_0x8337('0xc')](),controller[_0x8337('0x19')]);module[_0x8337('0x1a')]=router;
\ No newline at end of file
+var _0xff3c=['./automation.controller','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addConditions','addActions','put','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x20960d,_0x240fcb){var _0x180201=function(_0xe7927d){while(--_0xe7927d){_0x20960d['push'](_0x20960d['shift']());}};_0x180201(++_0x240fcb);}(_0xff3c,0x179));var _0xcff3=function(_0x22dbbf,_0xec067a){_0x22dbbf=_0x22dbbf-0x0;var _0x5174fb=_0xff3c[_0x22dbbf];return _0x5174fb;};'use strict';var multer=require(_0xcff3('0x0'));var util=require(_0xcff3('0x1'));var path=require('path');var timeout=require(_0xcff3('0x2'));var express=require(_0xcff3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcff3('0x4'));var interaction=require(_0xcff3('0x5'));var config=require(_0xcff3('0x6'));var controller=require(_0xcff3('0x7'));router[_0xcff3('0x8')]('/',auth[_0xcff3('0x9')](),controller['index']);router['get'](_0xcff3('0xa'),auth['isAuthenticated'](),controller[_0xcff3('0xb')]);router['get'](_0xcff3('0xc'),auth[_0xcff3('0x9')](),controller[_0xcff3('0xd')]);router[_0xcff3('0x8')](_0xcff3('0xe'),auth[_0xcff3('0x9')](),controller[_0xcff3('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcff3('0x10')]);router[_0xcff3('0x11')](_0xcff3('0xc'),auth[_0xcff3('0x9')](),controller[_0xcff3('0x12')]);router[_0xcff3('0x11')](_0xcff3('0xe'),auth[_0xcff3('0x9')](),controller[_0xcff3('0x13')]);router[_0xcff3('0x14')](_0xcff3('0xa'),auth[_0xcff3('0x9')](),controller[_0xcff3('0x15')]);router[_0xcff3('0x16')](_0xcff3('0xa'),auth[_0xcff3('0x9')](),controller['destroy']);module[_0xcff3('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 1f677a6..3537aec 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 _0xd40c=['always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','#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)'];(function(_0x455171,_0x3837ff){var _0x510287=function(_0x32cbcd){while(--_0x32cbcd){_0x455171['push'](_0x455171['shift']());}};_0x510287(++_0x3837ff);}(_0xd40c,0x1a7));var _0xcd40=function(_0x5b1437,_0x24aeee){_0x5b1437=_0x5b1437-0x0;var _0x5844bd=_0xd40c[_0x5b1437];return _0x5844bd;};'use strict';var Sequelize=require(_0xcd40('0x0'));module[_0xcd40('0x1')]={'name':{'type':Sequelize[_0xcd40('0x2')],'unique':_0xcd40('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xcd40('0x4')](_0xcd40('0x5')),'allowNull':![],'defaultValue':_0xcd40('0x5')},'description':{'type':Sequelize[_0xcd40('0x2')]},'active':{'type':Sequelize[_0xcd40('0x6')],'defaultValue':0x0,'comment':_0xcd40('0x7')},'limitCalls':{'type':Sequelize[_0xcd40('0x8')](0x4)[_0xcd40('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xcd40('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xcd40('0x8')](0x3)[_0xcd40('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xcd40('0x8')](0x3)[_0xcd40('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcd40('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xcd40('0x8')](0x5)[_0xcd40('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcd40('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xcd40('0x8')](0x3)[_0xcd40('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcd40('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xcd40('0x8')](0x5)[_0xcd40('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcd40('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xcd40('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xcd40('0x8')](0x5)[_0xcd40('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcd40('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xcd40('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xcd40('0x10')},'dialTimezone':{'type':Sequelize[_0xcd40('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xcd40('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xcd40('0x4')](_0xcd40('0x11'),_0xcd40('0x12'),_0xcd40('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xcd40('0x6')],'defaultValue':0x0,'comment':_0xcd40('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xcd40('0x8')](0x9)[_0xcd40('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xcd40('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xcd40('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xcd40('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xcd40('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xcd40('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xcd40('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xcd40('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xcd40('0x8')](0x9)[_0xcd40('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xcd40('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xcd40('0x8')](0x9)[_0xcd40('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xcd40('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xcd40('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xcd40('0x8')](0x9)[_0xcd40('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xcd40('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xcd40('0x4')](_0xcd40('0x1b'),_0xcd40('0x1c')),'defaultValue':_0xcd40('0x1b')},'dialPrefix':{'type':Sequelize[_0xcd40('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xcd40('0x8')](0x3)[_0xcd40('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xcd40('0x1d')},'dialCutDigit':{'type':Sequelize[_0xcd40('0x8')](0x3)[_0xcd40('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xcd40('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xcd40('0x8')](0x3)[_0xcd40('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcd40('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xcd40('0x8')](0x5)[_0xcd40('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcd40('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xcd40('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcd40('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xcd40('0x8')](0x5)[_0xcd40('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcd40('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xcd40('0x8')](0x3)[_0xcd40('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcd40('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xcd40('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcd40('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0xcd40('0x8')](0x3)[_0xcd40('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcd40('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xcd40('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcd40('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xcd40('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcd40('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xcd40('0x8')](0x5)[_0xcd40('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x0e31=['DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','#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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC'];(function(_0x5b2ca3,_0x364ad7){var _0x3f20e1=function(_0x524850){while(--_0x524850){_0x5b2ca3['push'](_0x5b2ca3['shift']());}};_0x3f20e1(++_0x364ad7);}(_0x0e31,0xab));var _0x10e3=function(_0xc02915,_0x48be3e){_0xc02915=_0xc02915-0x0;var _0x366bb0=_0x0e31[_0xc02915];return _0x366bb0;};'use strict';var Sequelize=require(_0x10e3('0x0'));module[_0x10e3('0x1')]={'name':{'type':Sequelize[_0x10e3('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x10e3('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x10e3('0x4')},'description':{'type':Sequelize[_0x10e3('0x2')]},'active':{'type':Sequelize[_0x10e3('0x5')],'defaultValue':0x0,'comment':_0x10e3('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x10e3('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x10e3('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x10e3('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x10e3('0x8')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x10e3('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)[_0x10e3('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x10e3('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x10e3('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)[_0x10e3('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x10e3('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x10e3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x10e3('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x10e3('0x8')](0x5)[_0x10e3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x10e3('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)[_0x10e3('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x10e3('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x10e3('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x10e3('0x11'),_0x10e3('0x12'),_0x10e3('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x10e3('0x5')],'defaultValue':0x0,'comment':_0x10e3('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x10e3('0x8')](0x9)[_0x10e3('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x10e3('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x10e3('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x10e3('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x10e3('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x10e3('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x10e3('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x10e3('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x10e3('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x10e3('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x10e3('0x8')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x10e3('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x10e3('0x8')](0x5)[_0x10e3('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x10e3('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x10e3('0x8')](0x9)[_0x10e3('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x10e3('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x10e3('0x3')]('DESC',_0x10e3('0x1c')),'defaultValue':_0x10e3('0x1d')},'dialPrefix':{'type':Sequelize[_0x10e3('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x10e3('0x8')](0x3)[_0x10e3('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x10e3('0x1e')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)[_0x10e3('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x10e3('0x8')](0x5)[_0x10e3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x10e3('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)[_0x10e3('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x10e3('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x10e3('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x10e3('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x10e3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x10e3('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x10e3('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x10e3('0x8')](0x5)[_0x10e3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x10e3('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)[_0x10e3('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x10e3('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x10e3('0x8')](0x5)[_0x10e3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x10e3('0x27')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 724da3a..7b485bc 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 _0xe1f3=['model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','findAll','rows','catch','show','params','rawAttributes','includeAll','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','pick','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','updatedAt','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','fromQuery','cm_contacts','deletedAt\x20IS\x20NULL','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','count','set','json','save','update','then','destroy','get','IvrCampaigns','error','stack','name','send','map','Campaign','type','key'];(function(_0xb301d4,_0x27ed18){var _0x3b5bde=function(_0x1fbc5f){while(--_0x1fbc5f){_0xb301d4['push'](_0xb301d4['shift']());}};_0x3b5bde(++_0x27ed18);}(_0xe1f3,0x161));var _0x3e1f=function(_0x3956b7,_0x3f972f){_0x3956b7=_0x3956b7-0x0;var _0x24da6f=_0xe1f3[_0x3956b7];return _0x24da6f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3e1f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3e1f('0x1'));var BPromise=require(_0x3e1f('0x2'));var Mustache=require(_0x3e1f('0x3'));var util=require('util');var path=require(_0x3e1f('0x4'));var sox=require(_0x3e1f('0x5'));var csv=require(_0x3e1f('0x6'));var ejs=require(_0x3e1f('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3e1f('0x8'));var squel=require(_0x3e1f('0x9'));var crypto=require(_0x3e1f('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3e1f('0x6'));var querystring=require(_0x3e1f('0xb'));var Papa=require(_0x3e1f('0xc'));var Redis=require(_0x3e1f('0xd'));var authService=require(_0x3e1f('0xe'));var qs=require(_0x3e1f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e1f('0x10'));var logger=require(_0x3e1f('0x11'))(_0x3e1f('0x12'));var utils=require('../../config/utils');var config=require(_0x3e1f('0x13'));var licenseUtil=require(_0x3e1f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15c684,_0xa2cc69){_0xa2cc69=_0xa2cc69||0xcc;return function(_0x4fed0d){if(_0x4fed0d){return _0x15c684[_0x3e1f('0x15')](_0xa2cc69);}return _0x15c684['status'](_0xa2cc69)[_0x3e1f('0x16')]();};}function respondWithResult(_0x1e08b6,_0x2ca37c){_0x2ca37c=_0x2ca37c||0xc8;return function(_0x35a497){if(_0x35a497){return _0x1e08b6[_0x3e1f('0x17')](_0x2ca37c)['json'](_0x35a497);}};}function respondWithFilteredResult(_0x27fb72,_0x1494be){return function(_0x52ffc0){if(_0x52ffc0){var _0x132ad3=typeof _0x1494be[_0x3e1f('0x18')]===_0x3e1f('0x19')&&typeof _0x1494be['limit']===_0x3e1f('0x19');var _0x3dc011=_0x52ffc0[_0x3e1f('0x1a')];var _0x27baf8=_0x132ad3?0x0:_0x1494be[_0x3e1f('0x18')];var _0x46ff81=_0x132ad3?_0x52ffc0[_0x3e1f('0x1a')]:_0x1494be[_0x3e1f('0x18')]+_0x1494be['limit'];var _0x3b21c3;if(_0x46ff81>=_0x3dc011){_0x46ff81=_0x3dc011;_0x3b21c3=0xc8;}else{_0x3b21c3=0xce;}_0x27fb72[_0x3e1f('0x17')](_0x3b21c3);return _0x27fb72[_0x3e1f('0x1b')]('Content-Range',_0x27baf8+'-'+_0x46ff81+'/'+_0x3dc011)[_0x3e1f('0x1c')](_0x52ffc0);}return null;};}function patchUpdates(_0x4d8586){return function(_0xd302e4){try{jsonpatch['apply'](_0xd302e4,_0x4d8586,!![]);}catch(_0x2ec4d3){return BPromise['reject'](_0x2ec4d3);}return _0xd302e4[_0x3e1f('0x1d')]();};}function saveUpdates(_0x225526,_0x342880){return function(_0x2a862e){if(_0x2a862e){return _0x2a862e[_0x3e1f('0x1e')](_0x225526)[_0x3e1f('0x1f')](function(_0x2baaf5){return _0x2baaf5;});}return null;};}function removeEntity(_0x3cb75c,_0x183592){return function(_0x23bb7a){if(_0x23bb7a){return _0x23bb7a[_0x3e1f('0x20')]()[_0x3e1f('0x1f')](function(){var _0x2f240f=_0x23bb7a[_0x3e1f('0x21')]({'plain':!![]});var _0x2a3a75=_0x3e1f('0x22');return db['UserProfileResource'][_0x3e1f('0x20')]({'where':{'type':_0x2a3a75,'resourceId':_0x2f240f['id']}})[_0x3e1f('0x1f')](function(){return _0x23bb7a;});})[_0x3e1f('0x1f')](function(){_0x3cb75c[_0x3e1f('0x17')](0xcc)[_0x3e1f('0x16')]();});}};}function handleEntityNotFound(_0x7259fc,_0x4dedff){return function(_0xcc036e){if(!_0xcc036e){_0x7259fc[_0x3e1f('0x15')](0x194);}return _0xcc036e;};}function handleError(_0x5f2e19,_0x480e41){_0x480e41=_0x480e41||0x1f4;return function(_0x34e948){logger[_0x3e1f('0x23')](_0x34e948[_0x3e1f('0x24')]);if(_0x34e948['name']){delete _0x34e948[_0x3e1f('0x25')];}_0x5f2e19['status'](_0x480e41)[_0x3e1f('0x26')](_0x34e948);};}exports['index']=function(_0x731694,_0x42a47c){var _0x315ef3={},_0x241190={},_0x116b7e={'count':0x0,'rows':[]};var _0x2d83ae=_[_0x3e1f('0x27')](db[_0x3e1f('0x28')]['rawAttributes'],function(_0x188e9c){return{'name':_0x188e9c['fieldName'],'type':_0x188e9c[_0x3e1f('0x29')][_0x3e1f('0x2a')]};});_0x241190[_0x3e1f('0x2b')]=_['map'](_0x2d83ae,'name');_0x241190[_0x3e1f('0x2c')]=_[_0x3e1f('0x2d')](_0x731694[_0x3e1f('0x2c')]);_0x241190[_0x3e1f('0x2e')]=_[_0x3e1f('0x2f')](_0x241190[_0x3e1f('0x2b')],_0x241190[_0x3e1f('0x2c')]);_0x315ef3['attributes']=_['intersection'](_0x241190[_0x3e1f('0x2b')],qs[_0x3e1f('0x30')](_0x731694['query'][_0x3e1f('0x30')]));_0x315ef3['attributes']=_0x315ef3['attributes'][_0x3e1f('0x31')]?_0x315ef3[_0x3e1f('0x32')]:_0x241190['model'];if(!_0x731694[_0x3e1f('0x2c')][_0x3e1f('0x33')](_0x3e1f('0x34'))){_0x315ef3[_0x3e1f('0x35')]=qs[_0x3e1f('0x35')](_0x731694['query'][_0x3e1f('0x35')]);_0x315ef3[_0x3e1f('0x18')]=qs[_0x3e1f('0x18')](_0x731694['query']['offset']);}_0x315ef3[_0x3e1f('0x36')]=qs[_0x3e1f('0x37')](_0x731694['query'][_0x3e1f('0x37')]);_0x315ef3[_0x3e1f('0x38')]=qs[_0x3e1f('0x2e')](_['pick'](_0x731694[_0x3e1f('0x2c')],_0x241190[_0x3e1f('0x2e')]),_0x2d83ae);if(_0x731694[_0x3e1f('0x2c')]['filter']){_0x315ef3[_0x3e1f('0x38')]=_[_0x3e1f('0x39')](_0x315ef3[_0x3e1f('0x38')],{'$or':_['map'](_0x2d83ae,function(_0x200181){if(_0x200181[_0x3e1f('0x29')]!==_0x3e1f('0x3a')){var _0x36eed6={};_0x36eed6[_0x200181[_0x3e1f('0x25')]]={'$like':'%'+_0x731694[_0x3e1f('0x2c')][_0x3e1f('0x3b')]+'%'};return _0x36eed6;}})});}_0x315ef3=_['merge']({},_0x315ef3,_0x731694['options']);var _0x532690={'where':_0x315ef3[_0x3e1f('0x38')]};return db['Campaign'][_0x3e1f('0x1a')](_0x532690)['then'](function(_0xbaad9f){_0x116b7e[_0x3e1f('0x1a')]=_0xbaad9f;if(_0x731694['query']['includeAll']){_0x315ef3['include']=[{'all':!![]}];}return db[_0x3e1f('0x28')][_0x3e1f('0x3c')](_0x315ef3);})[_0x3e1f('0x1f')](function(_0x749722){_0x116b7e[_0x3e1f('0x3d')]=_0x749722;return _0x116b7e;})[_0x3e1f('0x1f')](respondWithFilteredResult(_0x42a47c,_0x315ef3))[_0x3e1f('0x3e')](handleError(_0x42a47c,null));};exports[_0x3e1f('0x3f')]=function(_0x39578c,_0x464d42){var _0x12e0c2={'raw':![],'where':{'id':_0x39578c[_0x3e1f('0x40')]['id']}},_0x62b7fb={};_0x62b7fb[_0x3e1f('0x2b')]=_[_0x3e1f('0x2d')](db['Campaign'][_0x3e1f('0x41')]);_0x62b7fb[_0x3e1f('0x2c')]=_[_0x3e1f('0x2d')](_0x39578c[_0x3e1f('0x2c')]);_0x62b7fb[_0x3e1f('0x2e')]=_[_0x3e1f('0x2f')](_0x62b7fb[_0x3e1f('0x2b')],_0x62b7fb[_0x3e1f('0x2c')]);_0x12e0c2[_0x3e1f('0x32')]=_[_0x3e1f('0x2f')](_0x62b7fb[_0x3e1f('0x2b')],qs['fields'](_0x39578c[_0x3e1f('0x2c')][_0x3e1f('0x30')]));_0x12e0c2[_0x3e1f('0x32')]=_0x12e0c2[_0x3e1f('0x32')]['length']?_0x12e0c2[_0x3e1f('0x32')]:_0x62b7fb['model'];if(_0x39578c['query'][_0x3e1f('0x42')]){_0x12e0c2[_0x3e1f('0x43')]=[{'all':!![]}];}_0x12e0c2=_[_0x3e1f('0x39')]({},_0x12e0c2,_0x39578c[_0x3e1f('0x44')]);return db[_0x3e1f('0x28')][_0x3e1f('0x45')](_0x12e0c2)[_0x3e1f('0x1f')](handleEntityNotFound(_0x464d42,null))['then'](respondWithResult(_0x464d42,null))[_0x3e1f('0x3e')](handleError(_0x464d42,null));};exports['create']=function(_0x56b204,_0xa717be){return db[_0x3e1f('0x28')][_0x3e1f('0x46')](_0x56b204[_0x3e1f('0x47')],{})[_0x3e1f('0x1f')](function(_0x4f900d){var _0x23088f=_0x56b204[_0x3e1f('0x48')][_0x3e1f('0x21')]({'plain':!![]});if(!_0x23088f)throw new Error(_0x3e1f('0x49'));if(_0x23088f[_0x3e1f('0x4a')]===_0x3e1f('0x48')){var _0x505b13=_0x4f900d[_0x3e1f('0x21')]({'plain':!![]});var _0x4905f0='IvrCampaigns';return db[_0x3e1f('0x4b')][_0x3e1f('0x45')]({'where':{'name':_0x4905f0,'userProfileId':_0x23088f[_0x3e1f('0x4c')]},'raw':!![]})['then'](function(_0x1fa5af){if(_0x1fa5af&&_0x1fa5af[_0x3e1f('0x4d')]===0x0){return db[_0x3e1f('0x4e')]['create']({'name':_0x505b13[_0x3e1f('0x25')],'resourceId':_0x505b13['id'],'type':_0x1fa5af['name'],'sectionId':_0x1fa5af['id']},{})['then'](function(){return _0x4f900d;});}else{return _0x4f900d;}})[_0x3e1f('0x3e')](function(_0x5ec918){logger[_0x3e1f('0x23')](_0x3e1f('0x4f'),_0x5ec918);throw _0x5ec918;});}return _0x4f900d;})[_0x3e1f('0x1f')](respondWithResult(_0xa717be,0xc9))[_0x3e1f('0x3e')](handleError(_0xa717be,null));};exports[_0x3e1f('0x50')]=function(_0x284175,_0xa06367){var _0x7cff8c={'where':{'id':_0x284175['params']['id']}},_0x4b98c4={};_0x4b98c4['model']=_[_0x3e1f('0x2d')](db[_0x3e1f('0x28')]['rawAttributes']);_0x7cff8c[_0x3e1f('0x32')]=_[_0x3e1f('0x2f')](_0x4b98c4[_0x3e1f('0x2b')],qs[_0x3e1f('0x30')](_0x284175['query'][_0x3e1f('0x30')]));_0x7cff8c[_0x3e1f('0x32')]=_0x7cff8c[_0x3e1f('0x32')][_0x3e1f('0x31')]?_0x7cff8c['attributes']:_0x4b98c4[_0x3e1f('0x2b')];if(_0x284175[_0x3e1f('0x2c')][_0x3e1f('0x42')]){_0x7cff8c[_0x3e1f('0x43')]=[{'all':!![]}];}_0x7cff8c=_[_0x3e1f('0x39')]({},_0x7cff8c,_0x284175[_0x3e1f('0x44')]);return db[_0x3e1f('0x28')][_0x3e1f('0x45')](_0x7cff8c)[_0x3e1f('0x1f')](handleEntityNotFound(_0xa06367,null))[_0x3e1f('0x1f')](function(_0x33f755){if(_0x33f755){var _0x259048=_0x33f755[_0x3e1f('0x21')]({'plain':!![]});_0x259048=qs[_0x3e1f('0x51')](_0x259048,['id',_0x3e1f('0x52'),'updatedAt']);_0x284175['body']=_[_0x3e1f('0x51')](_0x284175['body'],['id',_0x3e1f('0x52'),'updatedAt']);return db[_0x3e1f('0x28')][_0x3e1f('0x46')](_[_0x3e1f('0x39')](_0x259048,_0x284175[_0x3e1f('0x47')]),{'include':_0x284175[_0x3e1f('0x2c')]['includeAll']?[{'all':!![]}]:undefined})[_0x3e1f('0x1f')](function(_0x4686c2){var _0xb4a235=_0x284175[_0x3e1f('0x48')][_0x3e1f('0x21')]({'plain':!![]});if(!_0xb4a235)throw new Error(_0x3e1f('0x49'));if(_0xb4a235['role']===_0x3e1f('0x48')){var _0x418537=_0x4686c2['get']({'plain':!![]});var _0x2260a6=_0x3e1f('0x22');return db[_0x3e1f('0x4b')]['find']({'where':{'name':_0x2260a6,'userProfileId':_0xb4a235[_0x3e1f('0x4c')]},'raw':!![]})[_0x3e1f('0x1f')](function(_0x3c9890){if(_0x3c9890&&_0x3c9890[_0x3e1f('0x4d')]===0x0){return db[_0x3e1f('0x4e')][_0x3e1f('0x46')]({'name':_0x418537[_0x3e1f('0x25')],'resourceId':_0x418537['id'],'type':_0x3c9890['name'],'sectionId':_0x3c9890['id']},{})[_0x3e1f('0x1f')](function(){return _0x4686c2;});}else{return _0x4686c2;}})[_0x3e1f('0x3e')](function(_0x446a89){logger[_0x3e1f('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x446a89);throw _0x446a89;});}return _0x4686c2;});}})[_0x3e1f('0x1f')](respondWithResult(_0xa06367,0xc9))['catch'](handleError(_0xa06367,null));};exports[_0x3e1f('0x1e')]=function(_0x3afd1f,_0x4fce85){if(_0x3afd1f[_0x3e1f('0x47')]['id']){delete _0x3afd1f[_0x3e1f('0x47')]['id'];}return db[_0x3e1f('0x28')][_0x3e1f('0x45')]({'where':{'id':_0x3afd1f['params']['id']}})['then'](handleEntityNotFound(_0x4fce85,null))[_0x3e1f('0x1f')](saveUpdates(_0x3afd1f['body'],null))[_0x3e1f('0x1f')](respondWithResult(_0x4fce85,null))[_0x3e1f('0x3e')](handleError(_0x4fce85,null));};exports[_0x3e1f('0x20')]=function(_0xb1bdbe,_0x41e4e8){return db[_0x3e1f('0x28')][_0x3e1f('0x45')]({'where':{'id':_0xb1bdbe[_0x3e1f('0x40')]['id']}})[_0x3e1f('0x1f')](handleEntityNotFound(_0x41e4e8,null))[_0x3e1f('0x1f')](removeEntity(_0x41e4e8,null))[_0x3e1f('0x3e')](handleError(_0x41e4e8,null));};exports[_0x3e1f('0x53')]=function(_0xd4ac02,_0x3d1f2d,_0x255cae){var _0x129484={'raw':!![],'where':{}};var _0x55afbb={};var _0x428d79={'count':0x0,'rows':[]};return db[_0x3e1f('0x28')][_0x3e1f('0x54')]({'where':{'id':_0xd4ac02['params']['id']}})[_0x3e1f('0x1f')](handleEntityNotFound(_0x3d1f2d,null))[_0x3e1f('0x1f')](function(_0x21d79f){if(_0x21d79f){_0x55afbb[_0x3e1f('0x2b')]=_[_0x3e1f('0x2d')](db[_0x3e1f('0x55')][_0x3e1f('0x41')]);_0x55afbb['query']=_[_0x3e1f('0x2d')](_0xd4ac02[_0x3e1f('0x2c')]);_0x55afbb[_0x3e1f('0x2e')]=_[_0x3e1f('0x2f')](_0x55afbb[_0x3e1f('0x2b')],_0x55afbb[_0x3e1f('0x2c')]);_0x129484[_0x3e1f('0x32')]=_[_0x3e1f('0x2f')](_0x55afbb[_0x3e1f('0x2b')],qs[_0x3e1f('0x30')](_0xd4ac02[_0x3e1f('0x2c')][_0x3e1f('0x30')]));_0x129484[_0x3e1f('0x32')]=_0x129484[_0x3e1f('0x32')]['length']?_0x129484[_0x3e1f('0x32')]:_0x55afbb[_0x3e1f('0x2b')];if(!_0xd4ac02['query'][_0x3e1f('0x33')](_0x3e1f('0x34'))){_0x129484[_0x3e1f('0x35')]=qs[_0x3e1f('0x35')](_0xd4ac02['query'][_0x3e1f('0x35')]);_0x129484[_0x3e1f('0x18')]=qs['offset'](_0xd4ac02[_0x3e1f('0x2c')][_0x3e1f('0x18')]);}_0x129484[_0x3e1f('0x36')]=qs['sort'](_0xd4ac02[_0x3e1f('0x2c')]['sort']);_0x129484['where']=qs[_0x3e1f('0x2e')](_['pick'](_0xd4ac02[_0x3e1f('0x2c')],_0x55afbb[_0x3e1f('0x2e')]));_0x129484[_0x3e1f('0x38')][_0x3e1f('0x56')]=_0x21d79f['id'];if(_0xd4ac02[_0x3e1f('0x2c')]['filter']){_0x129484[_0x3e1f('0x38')]=_[_0x3e1f('0x39')](_0x129484[_0x3e1f('0x38')],{'$or':_[_0x3e1f('0x27')](_0x129484[_0x3e1f('0x32')],function(_0x117d16){var _0x19d0e3={};_0x19d0e3[_0x117d16]={'$like':'%'+_0xd4ac02[_0x3e1f('0x2c')][_0x3e1f('0x3b')]+'%'};return _0x19d0e3;})});}_0x129484=_[_0x3e1f('0x39')]({},_0x129484,_0xd4ac02[_0x3e1f('0x44')]);return db['CmHopper'][_0x3e1f('0x1a')]({'where':_0x129484[_0x3e1f('0x38')]})['then'](function(_0x1e14c9){_0x428d79[_0x3e1f('0x1a')]=_0x1e14c9;if(_0xd4ac02['query']['includeAll']){_0x129484[_0x3e1f('0x43')]=[{'all':!![]}];}return db[_0x3e1f('0x55')][_0x3e1f('0x3c')](_0x129484);})[_0x3e1f('0x1f')](function(_0x5bf4a7){_0x428d79[_0x3e1f('0x3d')]=_0x5bf4a7;return _0x428d79;});}})['then'](respondWithFilteredResult(_0x3d1f2d,_0x129484))[_0x3e1f('0x3e')](handleError(_0x3d1f2d,null));};exports[_0x3e1f('0x57')]=function(_0x457fd9,_0x4285c6,_0x29e84c){var _0x27dbab={'raw':!![],'where':{}};var _0x210f7c={};var _0x358f8a={'count':0x0,'rows':[]};return db[_0x3e1f('0x28')][_0x3e1f('0x54')]({'where':{'id':_0x457fd9[_0x3e1f('0x40')]['id']}})[_0x3e1f('0x1f')](handleEntityNotFound(_0x4285c6,null))['then'](function(_0x3aaf14){if(_0x3aaf14){_0x210f7c[_0x3e1f('0x2b')]=_[_0x3e1f('0x2d')](db[_0x3e1f('0x58')][_0x3e1f('0x41')]);_0x210f7c[_0x3e1f('0x2c')]=_[_0x3e1f('0x2d')](_0x457fd9[_0x3e1f('0x2c')]);_0x210f7c['filters']=_['intersection'](_0x210f7c['model'],_0x210f7c[_0x3e1f('0x2c')]);_0x27dbab['attributes']=_[_0x3e1f('0x2f')](_0x210f7c[_0x3e1f('0x2b')],qs['fields'](_0x457fd9[_0x3e1f('0x2c')][_0x3e1f('0x30')]));_0x27dbab[_0x3e1f('0x32')]=_0x27dbab[_0x3e1f('0x32')][_0x3e1f('0x31')]?_0x27dbab[_0x3e1f('0x32')]:_0x210f7c[_0x3e1f('0x2b')];if(!_0x457fd9[_0x3e1f('0x2c')]['hasOwnProperty'](_0x3e1f('0x34'))){_0x27dbab['limit']=qs[_0x3e1f('0x35')](_0x457fd9[_0x3e1f('0x2c')][_0x3e1f('0x35')]);_0x27dbab[_0x3e1f('0x18')]=qs[_0x3e1f('0x18')](_0x457fd9['query'][_0x3e1f('0x18')]);}_0x27dbab[_0x3e1f('0x36')]=qs[_0x3e1f('0x37')](_0x457fd9[_0x3e1f('0x2c')][_0x3e1f('0x37')]);_0x27dbab['where']=qs['filters'](_[_0x3e1f('0x59')](_0x457fd9['query'],_0x210f7c['filters']));_0x27dbab[_0x3e1f('0x38')][_0x3e1f('0x56')]=_0x3aaf14['id'];if(_0x457fd9[_0x3e1f('0x2c')][_0x3e1f('0x3b')]){_0x27dbab[_0x3e1f('0x38')]=_[_0x3e1f('0x39')](_0x27dbab[_0x3e1f('0x38')],{'$or':_[_0x3e1f('0x27')](_0x27dbab['attributes'],function(_0x430512){var _0x3eda37={};_0x3eda37[_0x430512]={'$like':'%'+_0x457fd9[_0x3e1f('0x2c')]['filter']+'%'};return _0x3eda37;})});}_0x27dbab=_[_0x3e1f('0x39')]({},_0x27dbab,_0x457fd9[_0x3e1f('0x44')]);return db[_0x3e1f('0x58')][_0x3e1f('0x1a')]({'where':_0x27dbab[_0x3e1f('0x38')]})['then'](function(_0x50aa17){_0x358f8a[_0x3e1f('0x1a')]=_0x50aa17;if(_0x457fd9[_0x3e1f('0x2c')][_0x3e1f('0x42')]){_0x27dbab[_0x3e1f('0x43')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3e1f('0x3c')](_0x27dbab);})[_0x3e1f('0x1f')](function(_0xf7f10c){_0x358f8a[_0x3e1f('0x3d')]=_0xf7f10c;return _0x358f8a;});}})['then'](respondWithFilteredResult(_0x4285c6,_0x27dbab))[_0x3e1f('0x3e')](handleError(_0x4285c6,null));};exports[_0x3e1f('0x5a')]=function(_0x2516b6,_0x25a28d,_0x137630){var _0x350295={'raw':!![],'where':{}};var _0x49f081={};var _0x40534b={'count':0x0,'rows':[]};return db[_0x3e1f('0x28')][_0x3e1f('0x54')]({'where':{'id':_0x2516b6['params']['id']}})[_0x3e1f('0x1f')](handleEntityNotFound(_0x25a28d,null))['then'](function(_0x115067){if(_0x115067){_0x49f081['model']=_['keys'](db[_0x3e1f('0x5b')][_0x3e1f('0x41')]);_0x49f081[_0x3e1f('0x2c')]=_[_0x3e1f('0x2d')](_0x2516b6[_0x3e1f('0x2c')]);_0x49f081['filters']=_[_0x3e1f('0x2f')](_0x49f081[_0x3e1f('0x2b')],_0x49f081[_0x3e1f('0x2c')]);_0x350295[_0x3e1f('0x32')]=_[_0x3e1f('0x2f')](_0x49f081[_0x3e1f('0x2b')],qs[_0x3e1f('0x30')](_0x2516b6['query'][_0x3e1f('0x30')]));_0x350295[_0x3e1f('0x32')]=_0x350295[_0x3e1f('0x32')][_0x3e1f('0x31')]?_0x350295[_0x3e1f('0x32')]:_0x49f081[_0x3e1f('0x2b')];if(!_0x2516b6[_0x3e1f('0x2c')][_0x3e1f('0x33')]('nolimit')){_0x350295[_0x3e1f('0x35')]=qs[_0x3e1f('0x35')](_0x2516b6[_0x3e1f('0x2c')][_0x3e1f('0x35')]);_0x350295[_0x3e1f('0x18')]=qs['offset'](_0x2516b6[_0x3e1f('0x2c')][_0x3e1f('0x18')]);}_0x350295[_0x3e1f('0x36')]=qs[_0x3e1f('0x37')](_0x2516b6[_0x3e1f('0x2c')][_0x3e1f('0x37')]);_0x350295[_0x3e1f('0x38')]=qs[_0x3e1f('0x2e')](_['pick'](_0x2516b6[_0x3e1f('0x2c')],_0x49f081[_0x3e1f('0x2e')]));_0x350295[_0x3e1f('0x38')][_0x3e1f('0x56')]=_0x115067['id'];if(_0x2516b6[_0x3e1f('0x2c')][_0x3e1f('0x3b')]){_0x350295[_0x3e1f('0x38')]=_[_0x3e1f('0x39')](_0x350295[_0x3e1f('0x38')],{'$or':_['map'](_0x350295[_0x3e1f('0x32')],function(_0x1648c3){var _0x5ee86b={};_0x5ee86b[_0x1648c3]={'$like':'%'+_0x2516b6[_0x3e1f('0x2c')][_0x3e1f('0x3b')]+'%'};return _0x5ee86b;})});}_0x350295=_[_0x3e1f('0x39')]({},_0x350295,_0x2516b6[_0x3e1f('0x44')]);return db[_0x3e1f('0x5b')][_0x3e1f('0x1a')]({'where':_0x350295[_0x3e1f('0x38')]})[_0x3e1f('0x1f')](function(_0x28a999){_0x40534b[_0x3e1f('0x1a')]=_0x28a999;if(_0x2516b6[_0x3e1f('0x2c')][_0x3e1f('0x42')]){_0x350295['include']=[{'all':!![]}];}return db[_0x3e1f('0x5b')][_0x3e1f('0x3c')](_0x350295);})[_0x3e1f('0x1f')](function(_0x5d511a){_0x40534b[_0x3e1f('0x3d')]=_0x5d511a;return _0x40534b;});}})[_0x3e1f('0x1f')](respondWithFilteredResult(_0x25a28d,_0x350295))[_0x3e1f('0x3e')](handleError(_0x25a28d,null));};exports[_0x3e1f('0x5c')]=function(_0x34978d,_0x1483dd,_0x37f522){var _0x5db846={'raw':!![],'where':{}};var _0xf9661f={};var _0xe215ee={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x34978d[_0x3e1f('0x40')]['id']}})[_0x3e1f('0x1f')](handleEntityNotFound(_0x1483dd,null))[_0x3e1f('0x1f')](function(_0x116b46){if(_0x116b46){_0xf9661f[_0x3e1f('0x2b')]=_[_0x3e1f('0x2d')](db['CmHopperBlack']['rawAttributes']);_0xf9661f[_0x3e1f('0x2c')]=_[_0x3e1f('0x2d')](_0x34978d[_0x3e1f('0x2c')]);_0xf9661f[_0x3e1f('0x2e')]=_[_0x3e1f('0x2f')](_0xf9661f[_0x3e1f('0x2b')],_0xf9661f[_0x3e1f('0x2c')]);_0x5db846[_0x3e1f('0x32')]=_[_0x3e1f('0x2f')](_0xf9661f[_0x3e1f('0x2b')],qs[_0x3e1f('0x30')](_0x34978d[_0x3e1f('0x2c')][_0x3e1f('0x30')]));_0x5db846[_0x3e1f('0x32')]=_0x5db846['attributes'][_0x3e1f('0x31')]?_0x5db846[_0x3e1f('0x32')]:_0xf9661f[_0x3e1f('0x2b')];if(!_0x34978d[_0x3e1f('0x2c')][_0x3e1f('0x33')]('nolimit')){_0x5db846['limit']=qs[_0x3e1f('0x35')](_0x34978d['query'][_0x3e1f('0x35')]);_0x5db846[_0x3e1f('0x18')]=qs[_0x3e1f('0x18')](_0x34978d[_0x3e1f('0x2c')][_0x3e1f('0x18')]);}_0x5db846[_0x3e1f('0x36')]=qs[_0x3e1f('0x37')](_0x34978d['query']['sort']);_0x5db846[_0x3e1f('0x38')]=qs[_0x3e1f('0x2e')](_['pick'](_0x34978d[_0x3e1f('0x2c')],_0xf9661f[_0x3e1f('0x2e')]));_0x5db846[_0x3e1f('0x38')][_0x3e1f('0x56')]=_0x116b46['id'];if(_0x34978d[_0x3e1f('0x2c')][_0x3e1f('0x3b')]){_0x5db846[_0x3e1f('0x38')]=_[_0x3e1f('0x39')](_0x5db846[_0x3e1f('0x38')],{'$or':_[_0x3e1f('0x27')](_0x5db846['attributes'],function(_0x49a283){var _0x35a625={};_0x35a625[_0x49a283]={'$like':'%'+_0x34978d[_0x3e1f('0x2c')][_0x3e1f('0x3b')]+'%'};return _0x35a625;})});}_0x5db846=_[_0x3e1f('0x39')]({},_0x5db846,_0x34978d[_0x3e1f('0x44')]);return db[_0x3e1f('0x5d')][_0x3e1f('0x1a')]({'where':_0x5db846[_0x3e1f('0x38')]})['then'](function(_0x1b9757){_0xe215ee['count']=_0x1b9757;if(_0x34978d[_0x3e1f('0x2c')][_0x3e1f('0x42')]){_0x5db846[_0x3e1f('0x43')]=[{'all':!![]}];}return db[_0x3e1f('0x5d')][_0x3e1f('0x3c')](_0x5db846);})[_0x3e1f('0x1f')](function(_0x597252){_0xe215ee[_0x3e1f('0x3d')]=_0x597252;return _0xe215ee;});}})[_0x3e1f('0x1f')](respondWithFilteredResult(_0x1483dd,_0x5db846))[_0x3e1f('0x3e')](handleError(_0x1483dd,null));};exports[_0x3e1f('0x5e')]=function(_0x16b86f,_0x107bfb,_0xebd18a){var _0x5d509b={};var _0x3fb0f6={};var _0x53537a;var _0x37aa0e;return db['Campaign'][_0x3e1f('0x54')]({'where':{'id':_0x16b86f[_0x3e1f('0x40')]['id']}})['then'](handleEntityNotFound(_0x107bfb,null))[_0x3e1f('0x1f')](function(_0x3e0c9e){if(_0x3e0c9e){_0x53537a=_0x3e0c9e;_0x3fb0f6[_0x3e1f('0x2b')]=_[_0x3e1f('0x2d')](db['CmList'][_0x3e1f('0x41')]);_0x3fb0f6[_0x3e1f('0x2c')]=_['keys'](_0x16b86f[_0x3e1f('0x2c')]);_0x3fb0f6['filters']=_[_0x3e1f('0x2f')](_0x3fb0f6[_0x3e1f('0x2b')],_0x3fb0f6[_0x3e1f('0x2c')]);_0x5d509b[_0x3e1f('0x32')]=_[_0x3e1f('0x2f')](_0x3fb0f6['model'],qs['fields'](_0x16b86f['query'][_0x3e1f('0x30')]));_0x5d509b[_0x3e1f('0x32')]=_0x5d509b['attributes'][_0x3e1f('0x31')]?_0x5d509b[_0x3e1f('0x32')]:_0x3fb0f6[_0x3e1f('0x2b')];_0x5d509b['order']=qs['sort'](_0x16b86f[_0x3e1f('0x2c')]['sort']);_0x5d509b[_0x3e1f('0x38')]=qs[_0x3e1f('0x2e')](_[_0x3e1f('0x59')](_0x16b86f[_0x3e1f('0x2c')],_0x3fb0f6[_0x3e1f('0x2e')]));if(_0x16b86f[_0x3e1f('0x2c')][_0x3e1f('0x3b')]){_0x5d509b[_0x3e1f('0x38')]=_[_0x3e1f('0x39')](_0x5d509b['where'],{'$or':_[_0x3e1f('0x27')](_0x5d509b['attributes'],function(_0x2bd177){var _0x10b56e={};_0x10b56e[_0x2bd177]={'$like':'%'+_0x16b86f[_0x3e1f('0x2c')][_0x3e1f('0x3b')]+'%'};return _0x10b56e;})});}_0x5d509b=_['merge']({},_0x5d509b,_0x16b86f[_0x3e1f('0x44')]);return _0x53537a[_0x3e1f('0x5e')](_0x5d509b);}})[_0x3e1f('0x1f')](function(_0x9a1937){if(_0x9a1937){_0x37aa0e=_0x9a1937[_0x3e1f('0x31')];if(!_0x16b86f['query'][_0x3e1f('0x33')](_0x3e1f('0x34'))){_0x5d509b[_0x3e1f('0x35')]=qs['limit'](_0x16b86f[_0x3e1f('0x2c')][_0x3e1f('0x35')]);_0x5d509b[_0x3e1f('0x18')]=qs['offset'](_0x16b86f[_0x3e1f('0x2c')][_0x3e1f('0x18')]);}return _0x53537a[_0x3e1f('0x5e')](_0x5d509b);}})[_0x3e1f('0x1f')](function(_0x1e991c){if(_0x1e991c){return _0x1e991c?{'count':_0x37aa0e,'rows':_0x1e991c}:null;}})[_0x3e1f('0x1f')](respondWithResult(_0x107bfb,null))[_0x3e1f('0x3e')](handleError(_0x107bfb,null));};exports[_0x3e1f('0x5f')]=function(_0x5662bb,_0x8f4f7e,_0x2f5516){var _0x555124,_0xd4a736;return db[_0x3e1f('0x28')][_0x3e1f('0x45')]({'where':{'id':_0x5662bb[_0x3e1f('0x40')]['id']}})['then'](handleEntityNotFound(_0x8f4f7e,null))[_0x3e1f('0x1f')](function(_0x27fd8a){if(_0x27fd8a){_0xd4a736=_0x27fd8a;return _0x27fd8a[_0x3e1f('0x5f')](_0x5662bb[_0x3e1f('0x47')][_0x3e1f('0x60')],_[_0x3e1f('0x51')](_0x5662bb[_0x3e1f('0x47')],['ids','id'])||{});}return null;})[_0x3e1f('0x61')](function(_0x50426a){var _0x9bd022;_0x555124=_0x50426a||[];var _0x409bd9=[];if(_0x50426a){for(var _0x2e26cf=0x0;_0x2e26cf<_0x50426a[_0x3e1f('0x31')];_0x2e26cf+=0x1){var _0x23b0e6=_0x50426a[_0x2e26cf][_0x3e1f('0x21')]({'plain':!![]});_0xd4a736[_0x3e1f('0x62')]=_0x5662bb[_0x3e1f('0x47')][_0x3e1f('0x62')]?_0x5662bb[_0x3e1f('0x47')][_0x3e1f('0x62')]:_0xd4a736[_0x3e1f('0x62')];switch(_0xd4a736[_0x3e1f('0x62')]){case _0x3e1f('0x63'):_0x9bd022=squel[_0x3e1f('0x64')]()[_0x3e1f('0x65')]('cm_hopper')['fromQuery']([_0x3e1f('0x66'),_0x3e1f('0x67'),_0x3e1f('0x68'),_0x3e1f('0x69'),_0x3e1f('0x56'),_0x3e1f('0x52'),'updatedAt'],squel[_0x3e1f('0x6a')]()[_0x3e1f('0x6b')](_0x3e1f('0x66'),'phone')['field'](_0x3e1f('0x6c'),_0x3e1f('0x67'))[_0x3e1f('0x6b')]('id',_0x3e1f('0x68'))[_0x3e1f('0x6b')](_0x23b0e6[_0x3e1f('0x6d')][_0x3e1f('0x6e')](),_0x3e1f('0x69'))[_0x3e1f('0x6b')](_0x5662bb['params']['id'][_0x3e1f('0x6e')](),_0x3e1f('0x56'))[_0x3e1f('0x6b')](_0x3e1f('0x6c'),_0x3e1f('0x52'))[_0x3e1f('0x6b')]('NOW()',_0x3e1f('0x6f'))[_0x3e1f('0x70')]('cm_contacts')[_0x3e1f('0x38')]('deletedAt\x20IS\x20NULL')['where'](_0x3e1f('0x71'),_0x23b0e6[_0x3e1f('0x6d')][_0x3e1f('0x6e')]())[_0x3e1f('0x38')](_0x3e1f('0x72'))[_0x3e1f('0x38')](_0x3e1f('0x73'),squel[_0x3e1f('0x6a')]()[_0x3e1f('0x6b')]('COALESCE(calleridnum,\x27\x27)')[_0x3e1f('0x70')](_0x3e1f('0x74'))[_0x3e1f('0x38')](_0x3e1f('0x75'),_0x5662bb[_0x3e1f('0x40')]['id'][_0x3e1f('0x6e')]()))[_0x3e1f('0x38')](_0x3e1f('0x73'),squel[_0x3e1f('0x6a')]()['field'](_0x3e1f('0x76'))[_0x3e1f('0x70')](_0x3e1f('0x77'))[_0x3e1f('0x38')]('CampaignId\x20=\x20?',_0x5662bb[_0x3e1f('0x40')]['id'][_0x3e1f('0x6e')]())))[_0x3e1f('0x6e')]();break;case _0x3e1f('0x78'):_0x9bd022=squel[_0x3e1f('0x64')]()[_0x3e1f('0x65')](_0x3e1f('0x77'))[_0x3e1f('0x79')]([_0x3e1f('0x66'),_0x3e1f('0x67'),'ContactId',_0x3e1f('0x69'),_0x3e1f('0x56'),_0x3e1f('0x52'),_0x3e1f('0x6f')],squel[_0x3e1f('0x6a')]()[_0x3e1f('0x6b')](_0x3e1f('0x66'),_0x3e1f('0x66'))[_0x3e1f('0x6b')]('NOW()','scheduledAt')[_0x3e1f('0x6b')]('id','ContactId')['field'](_0x23b0e6[_0x3e1f('0x6d')]['toString'](),_0x3e1f('0x69'))[_0x3e1f('0x6b')](_0x5662bb[_0x3e1f('0x40')]['id'][_0x3e1f('0x6e')](),_0x3e1f('0x56'))[_0x3e1f('0x6b')]('NOW()',_0x3e1f('0x52'))[_0x3e1f('0x6b')](_0x3e1f('0x6c'),_0x3e1f('0x6f'))['from'](_0x3e1f('0x7a'))[_0x3e1f('0x38')](_0x3e1f('0x7b'))['where']('ListId\x20=\x20?',_0x23b0e6[_0x3e1f('0x6d')][_0x3e1f('0x6e')]())[_0x3e1f('0x38')]('phone\x20IS\x20NOT\x20NULL')[_0x3e1f('0x38')](_0x3e1f('0x73'),squel['select']()['field'](_0x3e1f('0x76'))[_0x3e1f('0x70')](_0x3e1f('0x77'))[_0x3e1f('0x38')](_0x3e1f('0x75'),_0x5662bb[_0x3e1f('0x40')]['id'][_0x3e1f('0x6e')]())))[_0x3e1f('0x6e')]();break;default:_0x9bd022=squel[_0x3e1f('0x64')]()['into'](_0x3e1f('0x77'))[_0x3e1f('0x79')]([_0x3e1f('0x66'),_0x3e1f('0x67'),_0x3e1f('0x68'),_0x3e1f('0x69'),'CampaignId',_0x3e1f('0x52'),'updatedAt'],squel[_0x3e1f('0x6a')]()[_0x3e1f('0x6b')]('phone',_0x3e1f('0x66'))[_0x3e1f('0x6b')](_0x3e1f('0x6c'),_0x3e1f('0x67'))['field']('id',_0x3e1f('0x68'))[_0x3e1f('0x6b')](_0x23b0e6[_0x3e1f('0x6d')]['toString'](),_0x3e1f('0x69'))[_0x3e1f('0x6b')](_0x5662bb[_0x3e1f('0x40')]['id'][_0x3e1f('0x6e')](),'CampaignId')[_0x3e1f('0x6b')](_0x3e1f('0x6c'),_0x3e1f('0x52'))['field'](_0x3e1f('0x6c'),'updatedAt')[_0x3e1f('0x70')](_0x3e1f('0x7a'))[_0x3e1f('0x38')]('deletedAt\x20IS\x20NULL')[_0x3e1f('0x38')](_0x3e1f('0x71'),_0x23b0e6['CmListId'][_0x3e1f('0x6e')]())[_0x3e1f('0x38')](_0x3e1f('0x72')))[_0x3e1f('0x6e')]();}_0x409bd9[_0x3e1f('0x7c')](db['sequelize'][_0x3e1f('0x2c')](_0x9bd022));}return BPromise[_0x3e1f('0x7d')](_0x409bd9);}})['then'](function(){return _0x555124;})[_0x3e1f('0x1f')](respondWithResult(_0x8f4f7e,null))[_0x3e1f('0x3e')](handleError(_0x8f4f7e,null));};exports[_0x3e1f('0x7e')]=function(_0x135ebb,_0x500e41,_0x1030ba){return db['Campaign'][_0x3e1f('0x45')]({'where':{'id':_0x135ebb[_0x3e1f('0x40')]['id']}})[_0x3e1f('0x1f')](handleEntityNotFound(_0x500e41,null))[_0x3e1f('0x1f')](function(_0x4a63f6){if(_0x4a63f6){return _0x4a63f6[_0x3e1f('0x7e')](_0x135ebb[_0x3e1f('0x2c')][_0x3e1f('0x60')]);}})[_0x3e1f('0x1f')](function(_0x4b0f4a){if(_0x4b0f4a){return db[_0x3e1f('0x55')][_0x3e1f('0x20')]({'where':{'ListId':_0x135ebb[_0x3e1f('0x2c')][_0x3e1f('0x60')],'CampaignId':_0x135ebb[_0x3e1f('0x40')]['id']}})[_0x3e1f('0x1f')](function(){return _0x4b0f4a;});}})['then'](respondWithStatusCode(_0x500e41,null))[_0x3e1f('0x3e')](handleError(_0x500e41,null));};exports[_0x3e1f('0x7f')]=function(_0x347a03,_0x25c8b1,_0x1a7e7d){var _0x17e53d={};var _0x3707c0={};var _0x1cf8db;var _0x4abe33;return db[_0x3e1f('0x28')][_0x3e1f('0x54')]({'where':{'id':_0x347a03[_0x3e1f('0x40')]['id']}})['then'](handleEntityNotFound(_0x25c8b1,null))[_0x3e1f('0x1f')](function(_0xfc7666){if(_0xfc7666){_0x1cf8db=_0xfc7666;_0x3707c0[_0x3e1f('0x2b')]=_[_0x3e1f('0x2d')](db['CmList'][_0x3e1f('0x41')]);_0x3707c0[_0x3e1f('0x2c')]=_[_0x3e1f('0x2d')](_0x347a03[_0x3e1f('0x2c')]);_0x3707c0['filters']=_[_0x3e1f('0x2f')](_0x3707c0['model'],_0x3707c0[_0x3e1f('0x2c')]);_0x17e53d['attributes']=_[_0x3e1f('0x2f')](_0x3707c0[_0x3e1f('0x2b')],qs[_0x3e1f('0x30')](_0x347a03['query']['fields']));_0x17e53d[_0x3e1f('0x32')]=_0x17e53d[_0x3e1f('0x32')]['length']?_0x17e53d['attributes']:_0x3707c0[_0x3e1f('0x2b')];_0x17e53d[_0x3e1f('0x36')]=qs['sort'](_0x347a03['query'][_0x3e1f('0x37')]);_0x17e53d[_0x3e1f('0x38')]=qs[_0x3e1f('0x2e')](_[_0x3e1f('0x59')](_0x347a03[_0x3e1f('0x2c')],_0x3707c0[_0x3e1f('0x2e')]));if(_0x347a03[_0x3e1f('0x2c')][_0x3e1f('0x3b')]){_0x17e53d[_0x3e1f('0x38')]=_[_0x3e1f('0x39')](_0x17e53d[_0x3e1f('0x38')],{'$or':_[_0x3e1f('0x27')](_0x17e53d[_0x3e1f('0x32')],function(_0x46eb80){var _0x4933e1={};_0x4933e1[_0x46eb80]={'$like':'%'+_0x347a03[_0x3e1f('0x2c')][_0x3e1f('0x3b')]+'%'};return _0x4933e1;})});}_0x17e53d=_[_0x3e1f('0x39')]({},_0x17e53d,_0x347a03['options']);return _0x1cf8db[_0x3e1f('0x7f')](_0x17e53d);}})[_0x3e1f('0x1f')](function(_0x3c6bb6){if(_0x3c6bb6){_0x4abe33=_0x3c6bb6['length'];if(!_0x347a03[_0x3e1f('0x2c')]['hasOwnProperty'](_0x3e1f('0x34'))){_0x17e53d[_0x3e1f('0x35')]=qs[_0x3e1f('0x35')](_0x347a03['query']['limit']);_0x17e53d['offset']=qs[_0x3e1f('0x18')](_0x347a03['query'][_0x3e1f('0x18')]);}return _0x1cf8db[_0x3e1f('0x7f')](_0x17e53d);}})[_0x3e1f('0x1f')](function(_0xdd4f88){if(_0xdd4f88){return _0xdd4f88?{'count':_0x4abe33,'rows':_0xdd4f88}:null;}})[_0x3e1f('0x1f')](respondWithResult(_0x25c8b1,null))[_0x3e1f('0x3e')](handleError(_0x25c8b1,null));};exports[_0x3e1f('0x80')]=function(_0xe69b65,_0x120cf6,_0x4aa83e){var _0x31607f,_0x63f8e9;return db['Campaign']['find']({'where':{'id':_0xe69b65[_0x3e1f('0x40')]['id']}})[_0x3e1f('0x1f')](handleEntityNotFound(_0x120cf6,null))[_0x3e1f('0x1f')](function(_0x19f6ab){if(_0x19f6ab){_0x63f8e9=_0x19f6ab;return _0x19f6ab[_0x3e1f('0x80')](_0xe69b65[_0x3e1f('0x47')][_0x3e1f('0x60')],_[_0x3e1f('0x51')](_0xe69b65[_0x3e1f('0x47')],[_0x3e1f('0x60'),'id'])||{});}return null;})[_0x3e1f('0x61')](function(_0x2a3d00){var _0x116cde;_0x31607f=_0x2a3d00||[];var _0x2b75a6=[];if(_0x2a3d00){for(var _0x416d19=0x0;_0x416d19<_0x2a3d00[_0x3e1f('0x31')];_0x416d19+=0x1){var _0x2e2778=_0x2a3d00[_0x416d19][_0x3e1f('0x21')]({'plain':!![]});_0x116cde=squel[_0x3e1f('0x64')]()[_0x3e1f('0x65')](_0x3e1f('0x81'))['fromQuery'](['phone','ContactId',_0x3e1f('0x69'),_0x3e1f('0x56'),_0x3e1f('0x52'),_0x3e1f('0x6f')],squel[_0x3e1f('0x6a')]()[_0x3e1f('0x6b')](_0x3e1f('0x66'),'phone')[_0x3e1f('0x6b')]('id','ContactId')['field'](_0x2e2778[_0x3e1f('0x6d')][_0x3e1f('0x6e')](),_0x3e1f('0x69'))[_0x3e1f('0x6b')](_0xe69b65[_0x3e1f('0x40')]['id'][_0x3e1f('0x6e')](),_0x3e1f('0x56'))[_0x3e1f('0x6b')](_0x3e1f('0x6c'),_0x3e1f('0x52'))[_0x3e1f('0x6b')](_0x3e1f('0x6c'),_0x3e1f('0x6f'))[_0x3e1f('0x70')](_0x3e1f('0x7a'))[_0x3e1f('0x38')](_0x3e1f('0x7b'))[_0x3e1f('0x38')](_0x3e1f('0x71'),_0x2e2778['CmListId'][_0x3e1f('0x6e')]())['where'](_0x3e1f('0x72')))[_0x3e1f('0x6e')]();_0x2b75a6[_0x3e1f('0x7c')](db[_0x3e1f('0x82')]['query'](_0x116cde));}return BPromise['all'](_0x2b75a6);}})['then'](function(){return _0x31607f;})[_0x3e1f('0x1f')](respondWithResult(_0x120cf6,null))['catch'](handleError(_0x120cf6,null));};exports[_0x3e1f('0x83')]=function(_0x3fa9f5,_0x40f092,_0x533824){return db['Campaign'][_0x3e1f('0x45')]({'where':{'id':_0x3fa9f5[_0x3e1f('0x40')]['id']}})[_0x3e1f('0x1f')](handleEntityNotFound(_0x40f092,null))[_0x3e1f('0x1f')](function(_0x5269f4){if(_0x5269f4){return _0x5269f4['removeBlackLists'](_0x3fa9f5[_0x3e1f('0x2c')][_0x3e1f('0x60')]);}})[_0x3e1f('0x1f')](function(_0x11f946){if(_0x11f946){return db[_0x3e1f('0x5d')]['destroy']({'where':{'ListId':_0x3fa9f5[_0x3e1f('0x2c')]['ids'],'CampaignId':_0x3fa9f5[_0x3e1f('0x40')]['id']}})[_0x3e1f('0x1f')](function(){return _0x11f946;});}})[_0x3e1f('0x1f')](respondWithStatusCode(_0x40f092,null))[_0x3e1f('0x3e')](handleError(_0x40f092,null));};
\ No newline at end of file
+var _0x60d6=['sort','where','pick','filters','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','role','IvrCampaigns','getHoppers','findOne','CmHopper','CampaignId','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','omit','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','select','phone','NOW()','field','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','from','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','ContactId','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0xcda2bd,_0x3468e4){var _0x22231c=function(_0x2de648){while(--_0x2de648){_0xcda2bd['push'](_0xcda2bd['shift']());}};_0x22231c(++_0x3468e4);}(_0x60d6,0x15a));var _0x660d=function(_0x47f29d,_0x44cc72){_0x47f29d=_0x47f29d-0x0;var _0x240ae5=_0x60d6[_0x47f29d];return _0x240ae5;};'use strict';var emlformat=require(_0x660d('0x0'));var rimraf=require(_0x660d('0x1'));var zipdir=require(_0x660d('0x2'));var jsonpatch=require(_0x660d('0x3'));var rp=require(_0x660d('0x4'));var moment=require(_0x660d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x660d('0x6'));var path=require(_0x660d('0x7'));var sox=require(_0x660d('0x8'));var csv=require(_0x660d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x660d('0xa'));var _=require(_0x660d('0xb'));var squel=require(_0x660d('0xc'));var crypto=require(_0x660d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x660d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x660d('0xf'));var Papa=require('papaparse');var Redis=require(_0x660d('0x10'));var authService=require(_0x660d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x660d('0x12'));var hardwareService=require(_0x660d('0x13'));var logger=require(_0x660d('0x14'))(_0x660d('0x15'));var utils=require('../../config/utils');var config=require(_0x660d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x660d('0x17'))['db'];function respondWithStatusCode(_0x15b29e,_0x5f0021){_0x5f0021=_0x5f0021||0xcc;return function(_0x1ed416){if(_0x1ed416){return _0x15b29e[_0x660d('0x18')](_0x5f0021);}return _0x15b29e[_0x660d('0x19')](_0x5f0021)['end']();};}function respondWithResult(_0x4f6fa2,_0x56d1bb){_0x56d1bb=_0x56d1bb||0xc8;return function(_0x55253a){if(_0x55253a){return _0x4f6fa2[_0x660d('0x19')](_0x56d1bb)[_0x660d('0x1a')](_0x55253a);}};}function respondWithFilteredResult(_0x4291d1,_0x30e64b){return function(_0x15ad66){if(_0x15ad66){var _0x43e510=typeof _0x30e64b['offset']===_0x660d('0x1b')&&typeof _0x30e64b[_0x660d('0x1c')]===_0x660d('0x1b');var _0xe4a490=_0x15ad66[_0x660d('0x1d')];var _0x3c61d2=_0x43e510?0x0:_0x30e64b[_0x660d('0x1e')];var _0x3c17ec=_0x43e510?_0x15ad66['count']:_0x30e64b[_0x660d('0x1e')]+_0x30e64b[_0x660d('0x1c')];var _0x4963a7;if(_0x3c17ec>=_0xe4a490){_0x3c17ec=_0xe4a490;_0x4963a7=0xc8;}else{_0x4963a7=0xce;}_0x4291d1[_0x660d('0x19')](_0x4963a7);return _0x4291d1[_0x660d('0x1f')](_0x660d('0x20'),_0x3c61d2+'-'+_0x3c17ec+'/'+_0xe4a490)[_0x660d('0x1a')](_0x15ad66);}return null;};}function patchUpdates(_0x728c9c){return function(_0x50b11d){try{jsonpatch[_0x660d('0x21')](_0x50b11d,_0x728c9c,!![]);}catch(_0x49be76){return BPromise[_0x660d('0x22')](_0x49be76);}return _0x50b11d['save']();};}function saveUpdates(_0x208001,_0x25b2bb){return function(_0x332bbf){if(_0x332bbf){return _0x332bbf[_0x660d('0x23')](_0x208001)[_0x660d('0x24')](function(_0x2884b1){return _0x2884b1;});}return null;};}function removeEntity(_0x1a1d1d,_0x4ff61b){return function(_0xce8929){if(_0xce8929){return _0xce8929[_0x660d('0x25')]()['then'](function(){var _0xfbb51c=_0xce8929[_0x660d('0x26')]({'plain':!![]});var _0x1af633='IvrCampaigns';return db[_0x660d('0x27')][_0x660d('0x25')]({'where':{'type':_0x1af633,'resourceId':_0xfbb51c['id']}})[_0x660d('0x24')](function(){return _0xce8929;});})[_0x660d('0x24')](function(){_0x1a1d1d[_0x660d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48b2ef,_0x12df73){return function(_0x2a7a15){if(!_0x2a7a15){_0x48b2ef[_0x660d('0x18')](0x194);}return _0x2a7a15;};}function handleError(_0x4c7540,_0x379b2a){_0x379b2a=_0x379b2a||0x1f4;return function(_0x1964a8){logger[_0x660d('0x28')](_0x1964a8[_0x660d('0x29')]);if(_0x1964a8['name']){delete _0x1964a8[_0x660d('0x2a')];}_0x4c7540[_0x660d('0x19')](_0x379b2a)[_0x660d('0x2b')](_0x1964a8);};}exports['index']=function(_0x1fe8ff,_0x4f1377){var _0x5b0df3={},_0x300044={},_0x427b9d={'count':0x0,'rows':[]};var _0x5075d4=_[_0x660d('0x2c')](db['Campaign'][_0x660d('0x2d')],function(_0x36cdbc){return{'name':_0x36cdbc[_0x660d('0x2e')],'type':_0x36cdbc[_0x660d('0x2f')][_0x660d('0x30')]};});_0x300044['model']=_[_0x660d('0x2c')](_0x5075d4,'name');_0x300044[_0x660d('0x31')]=_[_0x660d('0x32')](_0x1fe8ff['query']);_0x300044['filters']=_[_0x660d('0x33')](_0x300044[_0x660d('0x34')],_0x300044[_0x660d('0x31')]);_0x5b0df3[_0x660d('0x35')]=_[_0x660d('0x33')](_0x300044[_0x660d('0x34')],qs['fields'](_0x1fe8ff[_0x660d('0x31')][_0x660d('0x36')]));_0x5b0df3['attributes']=_0x5b0df3['attributes'][_0x660d('0x37')]?_0x5b0df3['attributes']:_0x300044[_0x660d('0x34')];if(!_0x1fe8ff[_0x660d('0x31')][_0x660d('0x38')](_0x660d('0x39'))){_0x5b0df3[_0x660d('0x1c')]=qs[_0x660d('0x1c')](_0x1fe8ff[_0x660d('0x31')][_0x660d('0x1c')]);_0x5b0df3[_0x660d('0x1e')]=qs[_0x660d('0x1e')](_0x1fe8ff[_0x660d('0x31')][_0x660d('0x1e')]);}_0x5b0df3[_0x660d('0x3a')]=qs[_0x660d('0x3b')](_0x1fe8ff[_0x660d('0x31')][_0x660d('0x3b')]);_0x5b0df3[_0x660d('0x3c')]=qs['filters'](_[_0x660d('0x3d')](_0x1fe8ff[_0x660d('0x31')],_0x300044[_0x660d('0x3e')]),_0x5075d4);if(_0x1fe8ff[_0x660d('0x31')][_0x660d('0x3f')]){_0x5b0df3[_0x660d('0x3c')]=_[_0x660d('0x40')](_0x5b0df3['where'],{'$or':_[_0x660d('0x2c')](_0x5075d4,function(_0x42e807){if(_0x42e807[_0x660d('0x2f')]!==_0x660d('0x41')){var _0x4c8e45={};_0x4c8e45[_0x42e807['name']]={'$like':'%'+_0x1fe8ff[_0x660d('0x31')][_0x660d('0x3f')]+'%'};return _0x4c8e45;}})});}_0x5b0df3=_[_0x660d('0x40')]({},_0x5b0df3,_0x1fe8ff[_0x660d('0x42')]);var _0x4c59a8={'where':_0x5b0df3[_0x660d('0x3c')]};return db[_0x660d('0x43')][_0x660d('0x1d')](_0x4c59a8)[_0x660d('0x24')](function(_0x4d4362){_0x427b9d[_0x660d('0x1d')]=_0x4d4362;if(_0x1fe8ff[_0x660d('0x31')][_0x660d('0x44')]){_0x5b0df3[_0x660d('0x45')]=[{'all':!![]}];}return db[_0x660d('0x43')][_0x660d('0x46')](_0x5b0df3);})[_0x660d('0x24')](function(_0x13053c){_0x427b9d['rows']=_0x13053c;return _0x427b9d;})[_0x660d('0x24')](respondWithFilteredResult(_0x4f1377,_0x5b0df3))[_0x660d('0x47')](handleError(_0x4f1377,null));};exports[_0x660d('0x48')]=function(_0x5e4707,_0x16dfad){var _0x21736a={'raw':![],'where':{'id':_0x5e4707['params']['id']}},_0xd230ff={};_0xd230ff[_0x660d('0x34')]=_['keys'](db[_0x660d('0x43')][_0x660d('0x2d')]);_0xd230ff['query']=_[_0x660d('0x32')](_0x5e4707[_0x660d('0x31')]);_0xd230ff[_0x660d('0x3e')]=_[_0x660d('0x33')](_0xd230ff[_0x660d('0x34')],_0xd230ff[_0x660d('0x31')]);_0x21736a[_0x660d('0x35')]=_[_0x660d('0x33')](_0xd230ff[_0x660d('0x34')],qs['fields'](_0x5e4707[_0x660d('0x31')][_0x660d('0x36')]));_0x21736a[_0x660d('0x35')]=_0x21736a[_0x660d('0x35')][_0x660d('0x37')]?_0x21736a[_0x660d('0x35')]:_0xd230ff[_0x660d('0x34')];if(_0x5e4707['query'][_0x660d('0x44')]){_0x21736a[_0x660d('0x45')]=[{'all':!![]}];}_0x21736a=_[_0x660d('0x40')]({},_0x21736a,_0x5e4707[_0x660d('0x42')]);return db[_0x660d('0x43')][_0x660d('0x49')](_0x21736a)[_0x660d('0x24')](handleEntityNotFound(_0x16dfad,null))['then'](respondWithResult(_0x16dfad,null))['catch'](handleError(_0x16dfad,null));};exports[_0x660d('0x4a')]=function(_0x4b53a6,_0x2a5d77){return db[_0x660d('0x43')][_0x660d('0x4a')](_0x4b53a6[_0x660d('0x4b')],{})[_0x660d('0x24')](function(_0x6bda16){var _0x2b3019=_0x4b53a6[_0x660d('0x4c')]['get']({'plain':!![]});if(!_0x2b3019)throw new Error(_0x660d('0x4d'));if(_0x2b3019['role']===_0x660d('0x4c')){var _0xd636b2=_0x6bda16[_0x660d('0x26')]({'plain':!![]});var _0x5f03c2='IvrCampaigns';return db[_0x660d('0x4e')][_0x660d('0x49')]({'where':{'name':_0x5f03c2,'userProfileId':_0x2b3019[_0x660d('0x4f')]},'raw':!![]})[_0x660d('0x24')](function(_0x3cd6be){if(_0x3cd6be&&_0x3cd6be[_0x660d('0x50')]===0x0){return db[_0x660d('0x27')]['create']({'name':_0xd636b2[_0x660d('0x2a')],'resourceId':_0xd636b2['id'],'type':_0x3cd6be[_0x660d('0x2a')],'sectionId':_0x3cd6be['id']},{})[_0x660d('0x24')](function(){return _0x6bda16;});}else{return _0x6bda16;}})[_0x660d('0x47')](function(_0x398c66){logger[_0x660d('0x28')](_0x660d('0x51'),_0x398c66);throw _0x398c66;});}return _0x6bda16;})[_0x660d('0x24')](respondWithResult(_0x2a5d77,0xc9))[_0x660d('0x47')](handleError(_0x2a5d77,null));};exports[_0x660d('0x52')]=function(_0x2642f3,_0x1aa685){var _0x4dc3d4={'where':{'id':_0x2642f3[_0x660d('0x53')]['id']}},_0x244823={};_0x244823[_0x660d('0x34')]=_[_0x660d('0x32')](db[_0x660d('0x43')][_0x660d('0x2d')]);_0x4dc3d4['attributes']=_[_0x660d('0x33')](_0x244823[_0x660d('0x34')],qs[_0x660d('0x36')](_0x2642f3['query'][_0x660d('0x36')]));_0x4dc3d4[_0x660d('0x35')]=_0x4dc3d4[_0x660d('0x35')][_0x660d('0x37')]?_0x4dc3d4[_0x660d('0x35')]:_0x244823['model'];if(_0x2642f3[_0x660d('0x31')]['includeAll']){_0x4dc3d4[_0x660d('0x45')]=[{'all':!![]}];}_0x4dc3d4=_['merge']({},_0x4dc3d4,_0x2642f3[_0x660d('0x42')]);return db[_0x660d('0x43')][_0x660d('0x49')](_0x4dc3d4)['then'](handleEntityNotFound(_0x1aa685,null))[_0x660d('0x24')](function(_0x40c2f7){if(_0x40c2f7){var _0x40e0da=_0x40c2f7['get']({'plain':!![]});_0x40e0da=qs['omit'](_0x40e0da,['id',_0x660d('0x54'),_0x660d('0x55')]);_0x2642f3[_0x660d('0x4b')]=_['omit'](_0x2642f3[_0x660d('0x4b')],['id','createdAt','updatedAt']);return db[_0x660d('0x43')][_0x660d('0x4a')](_[_0x660d('0x40')](_0x40e0da,_0x2642f3['body']),{'include':_0x2642f3[_0x660d('0x31')][_0x660d('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x3d36d4){var _0x514b73=_0x2642f3[_0x660d('0x4c')][_0x660d('0x26')]({'plain':!![]});if(!_0x514b73)throw new Error(_0x660d('0x4d'));if(_0x514b73[_0x660d('0x56')]===_0x660d('0x4c')){var _0x24fbe3=_0x3d36d4[_0x660d('0x26')]({'plain':!![]});var _0x50610c=_0x660d('0x57');return db[_0x660d('0x4e')][_0x660d('0x49')]({'where':{'name':_0x50610c,'userProfileId':_0x514b73[_0x660d('0x4f')]},'raw':!![]})[_0x660d('0x24')](function(_0x666f1e){if(_0x666f1e&&_0x666f1e[_0x660d('0x50')]===0x0){return db[_0x660d('0x27')][_0x660d('0x4a')]({'name':_0x24fbe3[_0x660d('0x2a')],'resourceId':_0x24fbe3['id'],'type':_0x666f1e[_0x660d('0x2a')],'sectionId':_0x666f1e['id']},{})[_0x660d('0x24')](function(){return _0x3d36d4;});}else{return _0x3d36d4;}})[_0x660d('0x47')](function(_0x11e5a2){logger[_0x660d('0x28')](_0x660d('0x51'),_0x11e5a2);throw _0x11e5a2;});}return _0x3d36d4;});}})[_0x660d('0x24')](respondWithResult(_0x1aa685,0xc9))[_0x660d('0x47')](handleError(_0x1aa685,null));};exports[_0x660d('0x23')]=function(_0x18542c,_0x5be3fd){if(_0x18542c[_0x660d('0x4b')]['id']){delete _0x18542c['body']['id'];}return db[_0x660d('0x43')][_0x660d('0x49')]({'where':{'id':_0x18542c[_0x660d('0x53')]['id']}})[_0x660d('0x24')](handleEntityNotFound(_0x5be3fd,null))[_0x660d('0x24')](saveUpdates(_0x18542c[_0x660d('0x4b')],null))[_0x660d('0x24')](respondWithResult(_0x5be3fd,null))[_0x660d('0x47')](handleError(_0x5be3fd,null));};exports[_0x660d('0x25')]=function(_0x3b0b4c,_0x48050d){return db[_0x660d('0x43')][_0x660d('0x49')]({'where':{'id':_0x3b0b4c['params']['id']}})[_0x660d('0x24')](handleEntityNotFound(_0x48050d,null))['then'](removeEntity(_0x48050d,null))[_0x660d('0x47')](handleError(_0x48050d,null));};exports[_0x660d('0x58')]=function(_0x5c5d1c,_0x1a76ab,_0xc22635){var _0x2e0f3b={'raw':!![],'where':{}};var _0x5f01cc={};var _0x5e06f0={'count':0x0,'rows':[]};return db[_0x660d('0x43')][_0x660d('0x59')]({'where':{'id':_0x5c5d1c[_0x660d('0x53')]['id']}})['then'](handleEntityNotFound(_0x1a76ab,null))[_0x660d('0x24')](function(_0x3743c2){if(_0x3743c2){_0x5f01cc['model']=_[_0x660d('0x32')](db[_0x660d('0x5a')][_0x660d('0x2d')]);_0x5f01cc['query']=_[_0x660d('0x32')](_0x5c5d1c[_0x660d('0x31')]);_0x5f01cc[_0x660d('0x3e')]=_[_0x660d('0x33')](_0x5f01cc[_0x660d('0x34')],_0x5f01cc['query']);_0x2e0f3b[_0x660d('0x35')]=_[_0x660d('0x33')](_0x5f01cc[_0x660d('0x34')],qs[_0x660d('0x36')](_0x5c5d1c[_0x660d('0x31')][_0x660d('0x36')]));_0x2e0f3b[_0x660d('0x35')]=_0x2e0f3b[_0x660d('0x35')][_0x660d('0x37')]?_0x2e0f3b[_0x660d('0x35')]:_0x5f01cc[_0x660d('0x34')];if(!_0x5c5d1c[_0x660d('0x31')][_0x660d('0x38')](_0x660d('0x39'))){_0x2e0f3b[_0x660d('0x1c')]=qs['limit'](_0x5c5d1c[_0x660d('0x31')][_0x660d('0x1c')]);_0x2e0f3b[_0x660d('0x1e')]=qs[_0x660d('0x1e')](_0x5c5d1c[_0x660d('0x31')][_0x660d('0x1e')]);}_0x2e0f3b[_0x660d('0x3a')]=qs[_0x660d('0x3b')](_0x5c5d1c[_0x660d('0x31')][_0x660d('0x3b')]);_0x2e0f3b[_0x660d('0x3c')]=qs['filters'](_[_0x660d('0x3d')](_0x5c5d1c[_0x660d('0x31')],_0x5f01cc[_0x660d('0x3e')]));_0x2e0f3b['where'][_0x660d('0x5b')]=_0x3743c2['id'];if(_0x5c5d1c['query'][_0x660d('0x3f')]){_0x2e0f3b[_0x660d('0x3c')]=_[_0x660d('0x40')](_0x2e0f3b[_0x660d('0x3c')],{'$or':_[_0x660d('0x2c')](_0x2e0f3b['attributes'],function(_0x3fea98){var _0x1d345a={};_0x1d345a[_0x3fea98]={'$like':'%'+_0x5c5d1c[_0x660d('0x31')][_0x660d('0x3f')]+'%'};return _0x1d345a;})});}_0x2e0f3b=_[_0x660d('0x40')]({},_0x2e0f3b,_0x5c5d1c['options']);return db[_0x660d('0x5a')][_0x660d('0x1d')]({'where':_0x2e0f3b[_0x660d('0x3c')]})[_0x660d('0x24')](function(_0x1e0186){_0x5e06f0['count']=_0x1e0186;if(_0x5c5d1c[_0x660d('0x31')][_0x660d('0x44')]){_0x2e0f3b[_0x660d('0x45')]=[{'all':!![]}];}return db[_0x660d('0x5a')][_0x660d('0x46')](_0x2e0f3b);})[_0x660d('0x24')](function(_0x3ccc72){_0x5e06f0[_0x660d('0x5c')]=_0x3ccc72;return _0x5e06f0;});}})[_0x660d('0x24')](respondWithFilteredResult(_0x1a76ab,_0x2e0f3b))[_0x660d('0x47')](handleError(_0x1a76ab,null));};exports['getHopperHistories']=function(_0x1a72a5,_0x24e5e0,_0x2c0f4a){var _0x35a253={'raw':!![],'where':{}};var _0x213f1b={};var _0x2f1035={'count':0x0,'rows':[]};return db[_0x660d('0x43')][_0x660d('0x59')]({'where':{'id':_0x1a72a5[_0x660d('0x53')]['id']}})['then'](handleEntityNotFound(_0x24e5e0,null))[_0x660d('0x24')](function(_0x5f57db){if(_0x5f57db){_0x213f1b[_0x660d('0x34')]=_['keys'](db[_0x660d('0x5d')]['rawAttributes']);_0x213f1b[_0x660d('0x31')]=_[_0x660d('0x32')](_0x1a72a5[_0x660d('0x31')]);_0x213f1b[_0x660d('0x3e')]=_['intersection'](_0x213f1b[_0x660d('0x34')],_0x213f1b[_0x660d('0x31')]);_0x35a253[_0x660d('0x35')]=_[_0x660d('0x33')](_0x213f1b['model'],qs[_0x660d('0x36')](_0x1a72a5[_0x660d('0x31')][_0x660d('0x36')]));_0x35a253[_0x660d('0x35')]=_0x35a253[_0x660d('0x35')][_0x660d('0x37')]?_0x35a253['attributes']:_0x213f1b[_0x660d('0x34')];if(!_0x1a72a5[_0x660d('0x31')][_0x660d('0x38')](_0x660d('0x39'))){_0x35a253['limit']=qs['limit'](_0x1a72a5[_0x660d('0x31')]['limit']);_0x35a253['offset']=qs[_0x660d('0x1e')](_0x1a72a5['query'][_0x660d('0x1e')]);}_0x35a253[_0x660d('0x3a')]=qs[_0x660d('0x3b')](_0x1a72a5[_0x660d('0x31')]['sort']);_0x35a253[_0x660d('0x3c')]=qs[_0x660d('0x3e')](_[_0x660d('0x3d')](_0x1a72a5['query'],_0x213f1b[_0x660d('0x3e')]));_0x35a253[_0x660d('0x3c')][_0x660d('0x5b')]=_0x5f57db['id'];if(_0x1a72a5[_0x660d('0x31')][_0x660d('0x3f')]){_0x35a253[_0x660d('0x3c')]=_[_0x660d('0x40')](_0x35a253[_0x660d('0x3c')],{'$or':_[_0x660d('0x2c')](_0x35a253['attributes'],function(_0xeb84d5){var _0x509910={};_0x509910[_0xeb84d5]={'$like':'%'+_0x1a72a5[_0x660d('0x31')][_0x660d('0x3f')]+'%'};return _0x509910;})});}_0x35a253=_[_0x660d('0x40')]({},_0x35a253,_0x1a72a5[_0x660d('0x42')]);return db[_0x660d('0x5d')][_0x660d('0x1d')]({'where':_0x35a253['where']})[_0x660d('0x24')](function(_0x3e0833){_0x2f1035['count']=_0x3e0833;if(_0x1a72a5['query']['includeAll']){_0x35a253['include']=[{'all':!![]}];}return db[_0x660d('0x5d')]['findAll'](_0x35a253);})[_0x660d('0x24')](function(_0x267b83){_0x2f1035[_0x660d('0x5c')]=_0x267b83;return _0x2f1035;});}})[_0x660d('0x24')](respondWithFilteredResult(_0x24e5e0,_0x35a253))['catch'](handleError(_0x24e5e0,null));};exports[_0x660d('0x5e')]=function(_0x566a0d,_0x52aa18,_0x1dd1d9){var _0x4b9cee={'raw':!![],'where':{}};var _0x287a41={};var _0x180fe1={'count':0x0,'rows':[]};return db[_0x660d('0x43')][_0x660d('0x59')]({'where':{'id':_0x566a0d['params']['id']}})[_0x660d('0x24')](handleEntityNotFound(_0x52aa18,null))['then'](function(_0x1ba95d){if(_0x1ba95d){_0x287a41[_0x660d('0x34')]=_[_0x660d('0x32')](db[_0x660d('0x5f')][_0x660d('0x2d')]);_0x287a41[_0x660d('0x31')]=_[_0x660d('0x32')](_0x566a0d['query']);_0x287a41[_0x660d('0x3e')]=_[_0x660d('0x33')](_0x287a41[_0x660d('0x34')],_0x287a41[_0x660d('0x31')]);_0x4b9cee[_0x660d('0x35')]=_[_0x660d('0x33')](_0x287a41[_0x660d('0x34')],qs[_0x660d('0x36')](_0x566a0d[_0x660d('0x31')][_0x660d('0x36')]));_0x4b9cee[_0x660d('0x35')]=_0x4b9cee[_0x660d('0x35')]['length']?_0x4b9cee[_0x660d('0x35')]:_0x287a41[_0x660d('0x34')];if(!_0x566a0d['query'][_0x660d('0x38')]('nolimit')){_0x4b9cee[_0x660d('0x1c')]=qs['limit'](_0x566a0d[_0x660d('0x31')][_0x660d('0x1c')]);_0x4b9cee[_0x660d('0x1e')]=qs['offset'](_0x566a0d[_0x660d('0x31')]['offset']);}_0x4b9cee[_0x660d('0x3a')]=qs[_0x660d('0x3b')](_0x566a0d[_0x660d('0x31')]['sort']);_0x4b9cee['where']=qs['filters'](_['pick'](_0x566a0d[_0x660d('0x31')],_0x287a41[_0x660d('0x3e')]));_0x4b9cee['where']['CampaignId']=_0x1ba95d['id'];if(_0x566a0d[_0x660d('0x31')]['filter']){_0x4b9cee[_0x660d('0x3c')]=_[_0x660d('0x40')](_0x4b9cee[_0x660d('0x3c')],{'$or':_[_0x660d('0x2c')](_0x4b9cee[_0x660d('0x35')],function(_0x1284be){var _0x372e35={};_0x372e35[_0x1284be]={'$like':'%'+_0x566a0d['query'][_0x660d('0x3f')]+'%'};return _0x372e35;})});}_0x4b9cee=_['merge']({},_0x4b9cee,_0x566a0d[_0x660d('0x42')]);return db[_0x660d('0x5f')][_0x660d('0x1d')]({'where':_0x4b9cee[_0x660d('0x3c')]})[_0x660d('0x24')](function(_0x130dd9){_0x180fe1['count']=_0x130dd9;if(_0x566a0d['query']['includeAll']){_0x4b9cee[_0x660d('0x45')]=[{'all':!![]}];}return db[_0x660d('0x5f')][_0x660d('0x46')](_0x4b9cee);})[_0x660d('0x24')](function(_0x43bebe){_0x180fe1[_0x660d('0x5c')]=_0x43bebe;return _0x180fe1;});}})['then'](respondWithFilteredResult(_0x52aa18,_0x4b9cee))['catch'](handleError(_0x52aa18,null));};exports[_0x660d('0x60')]=function(_0x1f151b,_0x3636c7,_0x3b8f4c){var _0x32e244={'raw':!![],'where':{}};var _0x2991a4={};var _0x2eccc4={'count':0x0,'rows':[]};return db[_0x660d('0x43')][_0x660d('0x59')]({'where':{'id':_0x1f151b[_0x660d('0x53')]['id']}})[_0x660d('0x24')](handleEntityNotFound(_0x3636c7,null))[_0x660d('0x24')](function(_0x546a72){if(_0x546a72){_0x2991a4['model']=_[_0x660d('0x32')](db[_0x660d('0x61')][_0x660d('0x2d')]);_0x2991a4[_0x660d('0x31')]=_[_0x660d('0x32')](_0x1f151b['query']);_0x2991a4[_0x660d('0x3e')]=_[_0x660d('0x33')](_0x2991a4[_0x660d('0x34')],_0x2991a4['query']);_0x32e244['attributes']=_['intersection'](_0x2991a4[_0x660d('0x34')],qs[_0x660d('0x36')](_0x1f151b[_0x660d('0x31')]['fields']));_0x32e244[_0x660d('0x35')]=_0x32e244[_0x660d('0x35')][_0x660d('0x37')]?_0x32e244[_0x660d('0x35')]:_0x2991a4[_0x660d('0x34')];if(!_0x1f151b[_0x660d('0x31')][_0x660d('0x38')]('nolimit')){_0x32e244[_0x660d('0x1c')]=qs[_0x660d('0x1c')](_0x1f151b[_0x660d('0x31')][_0x660d('0x1c')]);_0x32e244[_0x660d('0x1e')]=qs[_0x660d('0x1e')](_0x1f151b[_0x660d('0x31')][_0x660d('0x1e')]);}_0x32e244['order']=qs['sort'](_0x1f151b['query'][_0x660d('0x3b')]);_0x32e244['where']=qs[_0x660d('0x3e')](_['pick'](_0x1f151b[_0x660d('0x31')],_0x2991a4[_0x660d('0x3e')]));_0x32e244[_0x660d('0x3c')][_0x660d('0x5b')]=_0x546a72['id'];if(_0x1f151b[_0x660d('0x31')][_0x660d('0x3f')]){_0x32e244['where']=_[_0x660d('0x40')](_0x32e244[_0x660d('0x3c')],{'$or':_[_0x660d('0x2c')](_0x32e244[_0x660d('0x35')],function(_0x26ee5f){var _0x202216={};_0x202216[_0x26ee5f]={'$like':'%'+_0x1f151b[_0x660d('0x31')][_0x660d('0x3f')]+'%'};return _0x202216;})});}_0x32e244=_[_0x660d('0x40')]({},_0x32e244,_0x1f151b[_0x660d('0x42')]);return db[_0x660d('0x61')][_0x660d('0x1d')]({'where':_0x32e244['where']})[_0x660d('0x24')](function(_0x2571a7){_0x2eccc4[_0x660d('0x1d')]=_0x2571a7;if(_0x1f151b[_0x660d('0x31')][_0x660d('0x44')]){_0x32e244[_0x660d('0x45')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x660d('0x46')](_0x32e244);})[_0x660d('0x24')](function(_0x1e0ca4){_0x2eccc4[_0x660d('0x5c')]=_0x1e0ca4;return _0x2eccc4;});}})[_0x660d('0x24')](respondWithFilteredResult(_0x3636c7,_0x32e244))[_0x660d('0x47')](handleError(_0x3636c7,null));};exports[_0x660d('0x62')]=function(_0x25743a,_0x3b7e16,_0x4b65a5){var _0x4a99de={};var _0x15307f={};var _0x3c6912;var _0x400d48;return db[_0x660d('0x43')][_0x660d('0x59')]({'where':{'id':_0x25743a[_0x660d('0x53')]['id']}})[_0x660d('0x24')](handleEntityNotFound(_0x3b7e16,null))[_0x660d('0x24')](function(_0x59fdfa){if(_0x59fdfa){_0x3c6912=_0x59fdfa;_0x15307f[_0x660d('0x34')]=_[_0x660d('0x32')](db[_0x660d('0x63')]['rawAttributes']);_0x15307f['query']=_[_0x660d('0x32')](_0x25743a[_0x660d('0x31')]);_0x15307f[_0x660d('0x3e')]=_[_0x660d('0x33')](_0x15307f['model'],_0x15307f[_0x660d('0x31')]);_0x4a99de[_0x660d('0x35')]=_[_0x660d('0x33')](_0x15307f[_0x660d('0x34')],qs['fields'](_0x25743a[_0x660d('0x31')][_0x660d('0x36')]));_0x4a99de[_0x660d('0x35')]=_0x4a99de['attributes'][_0x660d('0x37')]?_0x4a99de[_0x660d('0x35')]:_0x15307f['model'];_0x4a99de['order']=qs[_0x660d('0x3b')](_0x25743a[_0x660d('0x31')]['sort']);_0x4a99de[_0x660d('0x3c')]=qs[_0x660d('0x3e')](_['pick'](_0x25743a[_0x660d('0x31')],_0x15307f[_0x660d('0x3e')]));if(_0x25743a[_0x660d('0x31')][_0x660d('0x3f')]){_0x4a99de[_0x660d('0x3c')]=_[_0x660d('0x40')](_0x4a99de[_0x660d('0x3c')],{'$or':_['map'](_0x4a99de[_0x660d('0x35')],function(_0x3a3247){var _0x427780={};_0x427780[_0x3a3247]={'$like':'%'+_0x25743a[_0x660d('0x31')][_0x660d('0x3f')]+'%'};return _0x427780;})});}_0x4a99de=_[_0x660d('0x40')]({},_0x4a99de,_0x25743a[_0x660d('0x42')]);return _0x3c6912[_0x660d('0x62')](_0x4a99de);}})[_0x660d('0x24')](function(_0x753063){if(_0x753063){_0x400d48=_0x753063['length'];if(!_0x25743a[_0x660d('0x31')][_0x660d('0x38')]('nolimit')){_0x4a99de[_0x660d('0x1c')]=qs['limit'](_0x25743a['query'][_0x660d('0x1c')]);_0x4a99de[_0x660d('0x1e')]=qs[_0x660d('0x1e')](_0x25743a['query'][_0x660d('0x1e')]);}return _0x3c6912[_0x660d('0x62')](_0x4a99de);}})['then'](function(_0x55a5c8){if(_0x55a5c8){return _0x55a5c8?{'count':_0x400d48,'rows':_0x55a5c8}:null;}})[_0x660d('0x24')](respondWithResult(_0x3b7e16,null))[_0x660d('0x47')](handleError(_0x3b7e16,null));};exports['addLists']=function(_0x45a297,_0xa5a3f9,_0x4ea987){var _0x3ceeb2,_0x211df8;return db['Campaign']['find']({'where':{'id':_0x45a297[_0x660d('0x53')]['id']}})[_0x660d('0x24')](handleEntityNotFound(_0xa5a3f9,null))[_0x660d('0x24')](function(_0x2b25bc){if(_0x2b25bc){_0x211df8=_0x2b25bc;return _0x2b25bc[_0x660d('0x64')](_0x45a297[_0x660d('0x4b')][_0x660d('0x65')],_[_0x660d('0x66')](_0x45a297[_0x660d('0x4b')],['ids','id'])||{});}return null;})[_0x660d('0x67')](function(_0x359ce7){var _0x129fb9;_0x3ceeb2=_0x359ce7||[];var _0xeda1f1=[];if(_0x359ce7){for(var _0x5d1596=0x0;_0x5d1596<_0x359ce7[_0x660d('0x37')];_0x5d1596+=0x1){var _0x500e27=_0x359ce7[_0x5d1596][_0x660d('0x26')]({'plain':!![]});_0x211df8[_0x660d('0x68')]=_0x45a297[_0x660d('0x4b')]['dialCheckDuplicateType']?_0x45a297[_0x660d('0x4b')]['dialCheckDuplicateType']:_0x211df8[_0x660d('0x68')];switch(_0x211df8['dialCheckDuplicateType']){case _0x660d('0x69'):_0x129fb9=squel[_0x660d('0x6a')]()[_0x660d('0x6b')](_0x660d('0x6c'))[_0x660d('0x6d')](['phone',_0x660d('0x6e'),'ContactId',_0x660d('0x6f'),'CampaignId',_0x660d('0x54'),'updatedAt'],squel[_0x660d('0x70')]()['field'](_0x660d('0x71'),_0x660d('0x71'))['field'](_0x660d('0x72'),'scheduledAt')[_0x660d('0x73')]('id','ContactId')['field'](_0x500e27[_0x660d('0x74')]['toString'](),_0x660d('0x6f'))[_0x660d('0x73')](_0x45a297[_0x660d('0x53')]['id'][_0x660d('0x75')](),_0x660d('0x5b'))[_0x660d('0x73')](_0x660d('0x72'),_0x660d('0x54'))[_0x660d('0x73')](_0x660d('0x72'),'updatedAt')['from'](_0x660d('0x76'))[_0x660d('0x3c')](_0x660d('0x77'))[_0x660d('0x3c')](_0x660d('0x78'),_0x500e27[_0x660d('0x74')][_0x660d('0x75')]())[_0x660d('0x3c')](_0x660d('0x79'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x660d('0x70')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x660d('0x7a')](_0x660d('0x7b'))[_0x660d('0x3c')](_0x660d('0x7c'),_0x45a297[_0x660d('0x53')]['id'][_0x660d('0x75')]()))['where'](_0x660d('0x7d'),squel[_0x660d('0x70')]()[_0x660d('0x73')](_0x660d('0x7e'))[_0x660d('0x7a')](_0x660d('0x6c'))[_0x660d('0x3c')](_0x660d('0x7c'),_0x45a297['params']['id'][_0x660d('0x75')]())))[_0x660d('0x75')]();break;case'onlyIfOpen':_0x129fb9=squel[_0x660d('0x6a')]()['into']('cm_hopper')[_0x660d('0x6d')]([_0x660d('0x71'),_0x660d('0x6e'),_0x660d('0x7f'),_0x660d('0x6f'),'CampaignId','createdAt',_0x660d('0x55')],squel[_0x660d('0x70')]()[_0x660d('0x73')](_0x660d('0x71'),_0x660d('0x71'))[_0x660d('0x73')]('NOW()',_0x660d('0x6e'))['field']('id',_0x660d('0x7f'))[_0x660d('0x73')](_0x500e27[_0x660d('0x74')]['toString'](),_0x660d('0x6f'))['field'](_0x45a297['params']['id']['toString'](),_0x660d('0x5b'))[_0x660d('0x73')](_0x660d('0x72'),_0x660d('0x54'))[_0x660d('0x73')](_0x660d('0x72'),'updatedAt')[_0x660d('0x7a')](_0x660d('0x76'))[_0x660d('0x3c')](_0x660d('0x77'))[_0x660d('0x3c')](_0x660d('0x78'),_0x500e27[_0x660d('0x74')][_0x660d('0x75')]())[_0x660d('0x3c')](_0x660d('0x79'))[_0x660d('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x660d('0x70')]()[_0x660d('0x73')](_0x660d('0x7e'))['from'](_0x660d('0x6c'))[_0x660d('0x3c')](_0x660d('0x7c'),_0x45a297[_0x660d('0x53')]['id'][_0x660d('0x75')]())))[_0x660d('0x75')]();break;default:_0x129fb9=squel[_0x660d('0x6a')]()['into']('cm_hopper')[_0x660d('0x6d')]([_0x660d('0x71'),_0x660d('0x6e'),'ContactId',_0x660d('0x6f'),_0x660d('0x5b'),_0x660d('0x54'),'updatedAt'],squel[_0x660d('0x70')]()['field'](_0x660d('0x71'),_0x660d('0x71'))[_0x660d('0x73')](_0x660d('0x72'),_0x660d('0x6e'))['field']('id',_0x660d('0x7f'))[_0x660d('0x73')](_0x500e27[_0x660d('0x74')]['toString'](),_0x660d('0x6f'))[_0x660d('0x73')](_0x45a297[_0x660d('0x53')]['id'][_0x660d('0x75')](),_0x660d('0x5b'))[_0x660d('0x73')](_0x660d('0x72'),_0x660d('0x54'))['field'](_0x660d('0x72'),_0x660d('0x55'))[_0x660d('0x7a')](_0x660d('0x76'))[_0x660d('0x3c')]('deletedAt\x20IS\x20NULL')[_0x660d('0x3c')](_0x660d('0x78'),_0x500e27[_0x660d('0x74')][_0x660d('0x75')]())['where'](_0x660d('0x79')))['toString']();}_0xeda1f1[_0x660d('0x80')](db['sequelize'][_0x660d('0x31')](_0x129fb9));}return BPromise[_0x660d('0x81')](_0xeda1f1);}})[_0x660d('0x24')](function(){return _0x3ceeb2;})[_0x660d('0x24')](respondWithResult(_0xa5a3f9,null))[_0x660d('0x47')](handleError(_0xa5a3f9,null));};exports[_0x660d('0x82')]=function(_0x381ba3,_0x172dab,_0x3cd39f){return db[_0x660d('0x43')][_0x660d('0x49')]({'where':{'id':_0x381ba3['params']['id']}})['then'](handleEntityNotFound(_0x172dab,null))[_0x660d('0x24')](function(_0x1f6136){if(_0x1f6136){return _0x1f6136[_0x660d('0x82')](_0x381ba3['query'][_0x660d('0x65')]);}})['then'](function(_0xea1627){if(_0xea1627){return db[_0x660d('0x5a')][_0x660d('0x25')]({'where':{'ListId':_0x381ba3[_0x660d('0x31')][_0x660d('0x65')],'CampaignId':_0x381ba3[_0x660d('0x53')]['id']}})[_0x660d('0x24')](function(){return _0xea1627;});}})[_0x660d('0x24')](respondWithStatusCode(_0x172dab,null))['catch'](handleError(_0x172dab,null));};exports[_0x660d('0x83')]=function(_0x2bb133,_0x2559a0,_0x5d649e){var _0x109c08={};var _0x5519ec={};var _0x966bc9;var _0x427050;return db[_0x660d('0x43')][_0x660d('0x59')]({'where':{'id':_0x2bb133[_0x660d('0x53')]['id']}})[_0x660d('0x24')](handleEntityNotFound(_0x2559a0,null))['then'](function(_0x228ae3){if(_0x228ae3){_0x966bc9=_0x228ae3;_0x5519ec['model']=_[_0x660d('0x32')](db['CmList']['rawAttributes']);_0x5519ec['query']=_[_0x660d('0x32')](_0x2bb133[_0x660d('0x31')]);_0x5519ec['filters']=_['intersection'](_0x5519ec[_0x660d('0x34')],_0x5519ec[_0x660d('0x31')]);_0x109c08[_0x660d('0x35')]=_['intersection'](_0x5519ec[_0x660d('0x34')],qs[_0x660d('0x36')](_0x2bb133[_0x660d('0x31')][_0x660d('0x36')]));_0x109c08['attributes']=_0x109c08[_0x660d('0x35')][_0x660d('0x37')]?_0x109c08[_0x660d('0x35')]:_0x5519ec['model'];_0x109c08[_0x660d('0x3a')]=qs['sort'](_0x2bb133[_0x660d('0x31')][_0x660d('0x3b')]);_0x109c08[_0x660d('0x3c')]=qs['filters'](_[_0x660d('0x3d')](_0x2bb133['query'],_0x5519ec[_0x660d('0x3e')]));if(_0x2bb133['query'][_0x660d('0x3f')]){_0x109c08[_0x660d('0x3c')]=_[_0x660d('0x40')](_0x109c08[_0x660d('0x3c')],{'$or':_[_0x660d('0x2c')](_0x109c08[_0x660d('0x35')],function(_0x1d4970){var _0x2160d7={};_0x2160d7[_0x1d4970]={'$like':'%'+_0x2bb133[_0x660d('0x31')][_0x660d('0x3f')]+'%'};return _0x2160d7;})});}_0x109c08=_[_0x660d('0x40')]({},_0x109c08,_0x2bb133[_0x660d('0x42')]);return _0x966bc9['getBlackLists'](_0x109c08);}})[_0x660d('0x24')](function(_0xa6d668){if(_0xa6d668){_0x427050=_0xa6d668[_0x660d('0x37')];if(!_0x2bb133[_0x660d('0x31')]['hasOwnProperty'](_0x660d('0x39'))){_0x109c08[_0x660d('0x1c')]=qs[_0x660d('0x1c')](_0x2bb133['query']['limit']);_0x109c08[_0x660d('0x1e')]=qs['offset'](_0x2bb133[_0x660d('0x31')][_0x660d('0x1e')]);}return _0x966bc9['getBlackLists'](_0x109c08);}})[_0x660d('0x24')](function(_0x4bed0){if(_0x4bed0){return _0x4bed0?{'count':_0x427050,'rows':_0x4bed0}:null;}})[_0x660d('0x24')](respondWithResult(_0x2559a0,null))[_0x660d('0x47')](handleError(_0x2559a0,null));};exports[_0x660d('0x84')]=function(_0x5f1e00,_0x14aac2,_0x3d9f0d){var _0x532c8c,_0x5dd291;return db[_0x660d('0x43')][_0x660d('0x49')]({'where':{'id':_0x5f1e00[_0x660d('0x53')]['id']}})[_0x660d('0x24')](handleEntityNotFound(_0x14aac2,null))[_0x660d('0x24')](function(_0x5d50cc){if(_0x5d50cc){_0x5dd291=_0x5d50cc;return _0x5d50cc[_0x660d('0x84')](_0x5f1e00[_0x660d('0x4b')][_0x660d('0x65')],_['omit'](_0x5f1e00[_0x660d('0x4b')],[_0x660d('0x65'),'id'])||{});}return null;})[_0x660d('0x67')](function(_0x10288e){var _0x149bb9;_0x532c8c=_0x10288e||[];var _0x1cda67=[];if(_0x10288e){for(var _0xbcff1d=0x0;_0xbcff1d<_0x10288e[_0x660d('0x37')];_0xbcff1d+=0x1){var _0x25c45f=_0x10288e[_0xbcff1d][_0x660d('0x26')]({'plain':!![]});_0x149bb9=squel[_0x660d('0x6a')]()[_0x660d('0x6b')](_0x660d('0x85'))[_0x660d('0x6d')]([_0x660d('0x71'),_0x660d('0x7f'),_0x660d('0x6f'),_0x660d('0x5b'),_0x660d('0x54'),_0x660d('0x55')],squel['select']()[_0x660d('0x73')](_0x660d('0x71'),_0x660d('0x71'))[_0x660d('0x73')]('id',_0x660d('0x7f'))[_0x660d('0x73')](_0x25c45f[_0x660d('0x74')][_0x660d('0x75')](),_0x660d('0x6f'))[_0x660d('0x73')](_0x5f1e00['params']['id'][_0x660d('0x75')](),_0x660d('0x5b'))['field']('NOW()',_0x660d('0x54'))[_0x660d('0x73')](_0x660d('0x72'),'updatedAt')[_0x660d('0x7a')]('cm_contacts')[_0x660d('0x3c')]('deletedAt\x20IS\x20NULL')[_0x660d('0x3c')](_0x660d('0x78'),_0x25c45f[_0x660d('0x74')][_0x660d('0x75')]())[_0x660d('0x3c')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x1cda67[_0x660d('0x80')](db[_0x660d('0x86')][_0x660d('0x31')](_0x149bb9));}return BPromise[_0x660d('0x81')](_0x1cda67);}})['then'](function(){return _0x532c8c;})['then'](respondWithResult(_0x14aac2,null))[_0x660d('0x47')](handleError(_0x14aac2,null));};exports['removeBlackLists']=function(_0x3e5607,_0x12c882,_0x50c6dc){return db[_0x660d('0x43')][_0x660d('0x49')]({'where':{'id':_0x3e5607[_0x660d('0x53')]['id']}})[_0x660d('0x24')](handleEntityNotFound(_0x12c882,null))[_0x660d('0x24')](function(_0x179e6e){if(_0x179e6e){return _0x179e6e['removeBlackLists'](_0x3e5607[_0x660d('0x31')][_0x660d('0x65')]);}})['then'](function(_0x23cccf){if(_0x23cccf){return db[_0x660d('0x61')][_0x660d('0x25')]({'where':{'ListId':_0x3e5607[_0x660d('0x31')][_0x660d('0x65')],'CampaignId':_0x3e5607[_0x660d('0x53')]['id']}})[_0x660d('0x24')](function(){return _0x23cccf;});}})[_0x660d('0x24')](respondWithStatusCode(_0x12c882,null))[_0x660d('0x47')](handleError(_0x12c882,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 37c6cc1..d7391b5 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x73c130,_0x5f532f){var _0x3bd9b4=function(_0x56cac8){while(--_0x56cac8){_0x73c130['push'](_0x73c130['shift']());}};_0x3bd9b4(++_0x5f532f);}(_0x7a54,0x106));var _0x47a5=function(_0x5f3245,_0x3e151c){_0x5f3245=_0x5f3245-0x0;var _0x34e5e3=_0x7a54[_0x5f3245];return _0x34e5e3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4bfaae,_0x163b72){var _0x305f09=function(_0x34105b){while(--_0x34105b){_0x4bfaae['push'](_0x4bfaae['shift']());}};_0x305f09(++_0x163b72);}(_0x7a54,0x106));var _0x47a5=function(_0x1b4e4f,_0x43b5a9){_0x1b4e4f=_0x1b4e4f-0x0;var _0x4b67dd=_0x7a54[_0x1b4e4f];return _0x4b67dd;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 96a5a48..90595a9 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 _0x40ca=['catch','GetCampaign','Campaign','findAll','options','raw','limit','include','map','model','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x34882f,_0x601a99){var _0x455929=function(_0x463c7c){while(--_0x463c7c){_0x34882f['push'](_0x34882f['shift']());}};_0x455929(++_0x601a99);}(_0x40ca,0x1a1));var _0xa40c=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x40ca[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xa40c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa40c('0x1'));var rs=require(_0xa40c('0x2'));var fs=require('fs');var Redis=require(_0xa40c('0x3'));var db=require(_0xa40c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa40c('0x5'))('rpc');var config=require(_0xa40c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa40c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xee3296,_0xc55713,_0x6fadf3){return new BPromise(function(_0x444497,_0x438c5d){return client['request'](_0xee3296,_0x6fadf3)[_0xa40c('0x8')](function(_0x29d5f5){logger[_0xa40c('0x9')](_0xa40c('0xa'),_0xc55713,_0xa40c('0xb'));logger[_0xa40c('0xc')](_0xa40c('0xd'),_0xc55713,_0xa40c('0xb'),JSON[_0xa40c('0xe')](_0x29d5f5));if(_0x29d5f5[_0xa40c('0xf')]){if(_0x29d5f5['error'][_0xa40c('0x10')]===0x1f4){logger['error'](_0xa40c('0xa'),_0xc55713,_0x29d5f5[_0xa40c('0xf')][_0xa40c('0x11')]);return _0x438c5d(_0x29d5f5[_0xa40c('0xf')][_0xa40c('0x11')]);}logger['error'](_0xa40c('0xa'),_0xc55713,_0x29d5f5[_0xa40c('0xf')]['message']);return _0x444497(_0x29d5f5[_0xa40c('0xf')]['message']);}else{logger[_0xa40c('0x9')](_0xa40c('0xa'),_0xc55713,_0xa40c('0xb'));_0x444497(_0x29d5f5['result']['message']);}})[_0xa40c('0x12')](function(_0x13c73a){logger[_0xa40c('0xf')](_0xa40c('0xa'),_0xc55713,_0x13c73a);_0x438c5d(_0x13c73a);});});}exports[_0xa40c('0x13')]=function(_0x1cd357){var _0x224e78=this;return new Promise(function(_0x2b6df4,_0x41c2bb){return db[_0xa40c('0x14')][_0xa40c('0x15')]({'raw':_0x1cd357[_0xa40c('0x16')]?_0x1cd357['options'][_0xa40c('0x17')]===undefined?!![]:![]:!![],'where':_0x1cd357[_0xa40c('0x16')]?_0x1cd357['options']['where']||null:null,'attributes':_0x1cd357[_0xa40c('0x16')]?_0x1cd357[_0xa40c('0x16')]['attributes']||null:null,'limit':_0x1cd357['options']?_0x1cd357[_0xa40c('0x16')][_0xa40c('0x18')]||null:null,'include':_0x1cd357[_0xa40c('0x16')]?_0x1cd357[_0xa40c('0x16')][_0xa40c('0x19')]?_[_0xa40c('0x1a')](_0x1cd357[_0xa40c('0x16')][_0xa40c('0x19')],function(_0x11f17f){return{'model':db[_0x11f17f[_0xa40c('0x1b')]],'as':_0x11f17f['as'],'attributes':_0x11f17f['attributes'],'include':_0x11f17f['include']?_[_0xa40c('0x1a')](_0x11f17f[_0xa40c('0x19')],function(_0x503b52){return{'model':db[_0x503b52[_0xa40c('0x1b')]],'as':_0x503b52['as'],'attributes':_0x503b52[_0xa40c('0x1c')],'include':_0x503b52[_0xa40c('0x19')]?_['map'](_0x503b52['include'],function(_0x383928){return{'model':db[_0x383928[_0xa40c('0x1b')]],'as':_0x383928['as'],'attributes':_0x383928[_0xa40c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa40c('0x8')](function(_0x4dd589){logger[_0xa40c('0x9')](_0xa40c('0x13'),_0x1cd357);logger['debug'](_0xa40c('0x13'),_0x1cd357,JSON[_0xa40c('0xe')](_0x4dd589));_0x2b6df4(_0x4dd589);})[_0xa40c('0x12')](function(_0x29e1cd){logger[_0xa40c('0xf')](_0xa40c('0x13'),_0x29e1cd['message'],_0x1cd357);_0x41c2bb(_0x224e78[_0xa40c('0xf')](0x1f4,_0x29e1cd[_0xa40c('0x11')]));});});};
\ No newline at end of file
+var _0xe57e=['catch','GetCampaign','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Campaign','findAll','options','raw','where','limit','include','map','model','attributes'];(function(_0x553646,_0x469ebf){var _0x3776fc=function(_0x538cb0){while(--_0x538cb0){_0x553646['push'](_0x553646['shift']());}};_0x3776fc(++_0x469ebf);}(_0xe57e,0xf2));var _0xee57=function(_0xb60cbf,_0x5c21e0){_0xb60cbf=_0xb60cbf-0x0;var _0x1f4aa3=_0xe57e[_0xb60cbf];return _0x1f4aa3;};'use strict';var _=require(_0xee57('0x0'));var util=require('util');var moment=require(_0xee57('0x1'));var BPromise=require(_0xee57('0x2'));var rs=require(_0xee57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xee57('0x4'));var logger=require('../../config/logger')(_0xee57('0x5'));var config=require(_0xee57('0x6'));var jayson=require(_0xee57('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x408fef,_0x319905,_0x1ad277){return new BPromise(function(_0x342a62,_0x237efe){return client[_0xee57('0x8')](_0x408fef,_0x1ad277)[_0xee57('0x9')](function(_0x51db0c){logger['info'](_0xee57('0xa'),_0x319905,_0xee57('0xb'));logger[_0xee57('0xc')](_0xee57('0xd'),_0x319905,_0xee57('0xb'),JSON[_0xee57('0xe')](_0x51db0c));if(_0x51db0c[_0xee57('0xf')]){if(_0x51db0c['error']['code']===0x1f4){logger[_0xee57('0xf')](_0xee57('0xa'),_0x319905,_0x51db0c[_0xee57('0xf')][_0xee57('0x10')]);return _0x237efe(_0x51db0c[_0xee57('0xf')]['message']);}logger[_0xee57('0xf')]('Campaign,\x20%s,\x20%s',_0x319905,_0x51db0c[_0xee57('0xf')]['message']);return _0x342a62(_0x51db0c[_0xee57('0xf')]['message']);}else{logger['info'](_0xee57('0xa'),_0x319905,_0xee57('0xb'));_0x342a62(_0x51db0c[_0xee57('0x11')][_0xee57('0x10')]);}})['catch'](function(_0x40d08f){logger[_0xee57('0xf')]('Campaign,\x20%s,\x20%s',_0x319905,_0x40d08f);_0x237efe(_0x40d08f);});});}exports['GetCampaign']=function(_0x49656a){var _0x41e018=this;return new Promise(function(_0x558acc,_0x9a6461){return db[_0xee57('0x12')][_0xee57('0x13')]({'raw':_0x49656a[_0xee57('0x14')]?_0x49656a[_0xee57('0x14')][_0xee57('0x15')]===undefined?!![]:![]:!![],'where':_0x49656a['options']?_0x49656a[_0xee57('0x14')][_0xee57('0x16')]||null:null,'attributes':_0x49656a[_0xee57('0x14')]?_0x49656a['options']['attributes']||null:null,'limit':_0x49656a[_0xee57('0x14')]?_0x49656a['options'][_0xee57('0x17')]||null:null,'include':_0x49656a[_0xee57('0x14')]?_0x49656a['options'][_0xee57('0x18')]?_[_0xee57('0x19')](_0x49656a[_0xee57('0x14')][_0xee57('0x18')],function(_0x54a70b){return{'model':db[_0x54a70b[_0xee57('0x1a')]],'as':_0x54a70b['as'],'attributes':_0x54a70b[_0xee57('0x1b')],'include':_0x54a70b[_0xee57('0x18')]?_[_0xee57('0x19')](_0x54a70b[_0xee57('0x18')],function(_0x52d2f9){return{'model':db[_0x52d2f9[_0xee57('0x1a')]],'as':_0x52d2f9['as'],'attributes':_0x52d2f9[_0xee57('0x1b')],'include':_0x52d2f9['include']?_[_0xee57('0x19')](_0x52d2f9['include'],function(_0x5505c2){return{'model':db[_0x5505c2[_0xee57('0x1a')]],'as':_0x5505c2['as'],'attributes':_0x5505c2[_0xee57('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xee57('0x9')](function(_0x2cb540){logger['info']('GetCampaign',_0x49656a);logger[_0xee57('0xc')]('GetCampaign',_0x49656a,JSON[_0xee57('0xe')](_0x2cb540));_0x558acc(_0x2cb540);})[_0xee57('0x1c')](function(_0x1c7079){logger[_0xee57('0xf')](_0xee57('0x1d'),_0x1c7079['message'],_0x49656a);_0x9a6461(_0x41e018[_0xee57('0xf')](0x1f4,_0x1c7079[_0xee57('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index c65f6e3..1db82bb 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 _0x20da=['delete','destroy','removeLists','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','put','/:id','update'];(function(_0x34f01a,_0x77dfb5){var _0x44a8e5=function(_0xaabc19){while(--_0xaabc19){_0x34f01a['push'](_0x34f01a['shift']());}};_0x44a8e5(++_0x77dfb5);}(_0x20da,0x1d2));var _0xa20d=function(_0x22354a,_0x4de3e8){_0x22354a=_0x22354a-0x0;var _0x1b8d28=_0x20da[_0x22354a];return _0x1b8d28;};'use strict';var multer=require(_0xa20d('0x0'));var util=require(_0xa20d('0x1'));var path=require(_0xa20d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa20d('0x3')]();var fs_extra=require(_0xa20d('0x4'));var auth=require(_0xa20d('0x5'));var interaction=require(_0xa20d('0x6'));var config=require(_0xa20d('0x7'));var controller=require(_0xa20d('0x8'));router[_0xa20d('0x9')]('/',auth[_0xa20d('0xa')](),controller['index']);router[_0xa20d('0x9')]('/:id',auth[_0xa20d('0xa')](),controller[_0xa20d('0xb')]);router[_0xa20d('0x9')](_0xa20d('0xc'),auth[_0xa20d('0xa')](),controller[_0xa20d('0xd')]);router[_0xa20d('0x9')](_0xa20d('0xe'),auth[_0xa20d('0xa')](),controller['getHopperHistories']);router[_0xa20d('0x9')]('/:id/hopper_finals',auth[_0xa20d('0xa')](),controller[_0xa20d('0xf')]);router[_0xa20d('0x9')](_0xa20d('0x10'),auth[_0xa20d('0xa')](),controller[_0xa20d('0x11')]);router[_0xa20d('0x9')](_0xa20d('0x12'),auth[_0xa20d('0xa')](),controller['getLists']);router[_0xa20d('0x9')](_0xa20d('0x13'),auth['isAuthenticated'](),controller[_0xa20d('0x14')]);router[_0xa20d('0x15')]('/',auth[_0xa20d('0xa')](),controller['create']);router['post'](_0xa20d('0x16'),auth[_0xa20d('0xa')](),controller[_0xa20d('0x17')]);router[_0xa20d('0x15')]('/:id/lists',auth[_0xa20d('0xa')](),controller[_0xa20d('0x18')]);router[_0xa20d('0x15')](_0xa20d('0x13'),auth[_0xa20d('0xa')](),controller[_0xa20d('0x19')]);router[_0xa20d('0x1a')](_0xa20d('0x1b'),auth[_0xa20d('0xa')](),controller[_0xa20d('0x1c')]);router[_0xa20d('0x1d')]('/:id',auth[_0xa20d('0xa')](),controller[_0xa20d('0x1e')]);router[_0xa20d('0x1d')](_0xa20d('0x12'),auth[_0xa20d('0xa')](),controller[_0xa20d('0x1f')]);router['delete'](_0xa20d('0x13'),auth[_0xa20d('0xa')](),controller['removeBlackLists']);module[_0xa20d('0x20')]=router;
\ No newline at end of file
+var _0x55c0=['show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getBlackLists','post','create','/:id/clone','clone','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id'];(function(_0x4798b0,_0x1570df){var _0x174a07=function(_0x7a72b5){while(--_0x7a72b5){_0x4798b0['push'](_0x4798b0['shift']());}};_0x174a07(++_0x1570df);}(_0x55c0,0x140));var _0x055c=function(_0x53ad5f,_0x165793){_0x53ad5f=_0x53ad5f-0x0;var _0x61e1da=_0x55c0[_0x53ad5f];return _0x61e1da;};'use strict';var multer=require(_0x055c('0x0'));var util=require('util');var path=require(_0x055c('0x1'));var timeout=require(_0x055c('0x2'));var express=require(_0x055c('0x3'));var router=express['Router']();var fs_extra=require(_0x055c('0x4'));var auth=require(_0x055c('0x5'));var interaction=require(_0x055c('0x6'));var config=require(_0x055c('0x7'));var controller=require(_0x055c('0x8'));router[_0x055c('0x9')]('/',auth[_0x055c('0xa')](),controller[_0x055c('0xb')]);router[_0x055c('0x9')](_0x055c('0xc'),auth[_0x055c('0xa')](),controller[_0x055c('0xd')]);router[_0x055c('0x9')](_0x055c('0xe'),auth[_0x055c('0xa')](),controller[_0x055c('0xf')]);router[_0x055c('0x9')](_0x055c('0x10'),auth[_0x055c('0xa')](),controller[_0x055c('0x11')]);router['get'](_0x055c('0x12'),auth[_0x055c('0xa')](),controller[_0x055c('0x13')]);router[_0x055c('0x9')](_0x055c('0x14'),auth[_0x055c('0xa')](),controller[_0x055c('0x15')]);router[_0x055c('0x9')](_0x055c('0x16'),auth[_0x055c('0xa')](),controller['getLists']);router[_0x055c('0x9')]('/:id/blacklists',auth[_0x055c('0xa')](),controller[_0x055c('0x17')]);router[_0x055c('0x18')]('/',auth[_0x055c('0xa')](),controller[_0x055c('0x19')]);router[_0x055c('0x18')](_0x055c('0x1a'),auth['isAuthenticated'](),controller[_0x055c('0x1b')]);router[_0x055c('0x18')](_0x055c('0x16'),auth[_0x055c('0xa')](),controller['addLists']);router[_0x055c('0x18')](_0x055c('0x1c'),auth['isAuthenticated'](),controller[_0x055c('0x1d')]);router[_0x055c('0x1e')](_0x055c('0xc'),auth[_0x055c('0xa')](),controller[_0x055c('0x1f')]);router[_0x055c('0x20')](_0x055c('0xc'),auth[_0x055c('0xa')](),controller[_0x055c('0x21')]);router[_0x055c('0x20')](_0x055c('0x16'),auth[_0x055c('0xa')](),controller[_0x055c('0x22')]);router[_0x055c('0x20')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x055c('0x23')]);module[_0x055c('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 6992fea..6e4e0b0 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 _0x7cee=['STRING','VIRTUAL','key','sequelize'];(function(_0xfcf5f4,_0x414890){var _0x2aea1c=function(_0xe57313){while(--_0xe57313){_0xfcf5f4['push'](_0xfcf5f4['shift']());}};_0x2aea1c(++_0x414890);}(_0x7cee,0xbb));var _0xe7ce=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x7cee[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0xe7ce('0x0'));module['exports']={'key':{'type':Sequelize[_0xe7ce('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xe7ce('0x1')]},'name':{'type':Sequelize[_0xe7ce('0x2')],'get':function(){return this['getDataValue'](_0xe7ce('0x3'));}}};
\ No newline at end of file
+var _0x1b27=['key','sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0xce7822,_0x5d4996){var _0x1a24a7=function(_0x44b84f){while(--_0x44b84f){_0xce7822['push'](_0xce7822['shift']());}};_0x1a24a7(++_0x5d4996);}(_0x1b27,0x1d6));var _0x71b2=function(_0x2be841,_0xca59e6){_0x2be841=_0x2be841-0x0;var _0x20488d=_0x1b27[_0x2be841];return _0x20488d;};'use strict';var Sequelize=require(_0x71b2('0x0'));module[_0x71b2('0x1')]={'key':{'type':Sequelize[_0x71b2('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x71b2('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x71b2('0x2')]},'name':{'type':Sequelize[_0x71b2('0x4')],'get':function(){return this[_0x71b2('0x5')](_0x71b2('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 9137b0a..40461e8 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 _0x4e1a=['update','destroy','get','CannedAnswers','UserProfileResource','then','stack','name','index','map','CannedAnswer','fieldName','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','merge','filter','options','rows','catch','show','params','rawAttributes','includeAll','include','body','find','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','apply','reject','save'];(function(_0x3f14eb,_0x1ffbbe){var _0x33eebd=function(_0x2d3fc9){while(--_0x2d3fc9){_0x3f14eb['push'](_0x3f14eb['shift']());}};_0x33eebd(++_0x1ffbbe);}(_0x4e1a,0xda));var _0xa4e1=function(_0x48081c,_0x45eb00){_0x48081c=_0x48081c-0x0;var _0xab729d=_0x4e1a[_0x48081c];return _0xab729d;};'use strict';var emlformat=require(_0xa4e1('0x0'));var rimraf=require(_0xa4e1('0x1'));var zipdir=require(_0xa4e1('0x2'));var jsonpatch=require(_0xa4e1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa4e1('0x4'));var util=require(_0xa4e1('0x5'));var path=require(_0xa4e1('0x6'));var sox=require(_0xa4e1('0x7'));var csv=require(_0xa4e1('0x8'));var ejs=require(_0xa4e1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa4e1('0xa'));var crypto=require('crypto');var jsforce=require(_0xa4e1('0xb'));var deskjs=require(_0xa4e1('0xc'));var toCsv=require(_0xa4e1('0x8'));var querystring=require(_0xa4e1('0xd'));var Papa=require('papaparse');var Redis=require(_0xa4e1('0xe'));var authService=require(_0xa4e1('0xf'));var qs=require(_0xa4e1('0x10'));var as=require(_0xa4e1('0x11'));var hardwareService=require(_0xa4e1('0x12'));var logger=require(_0xa4e1('0x13'))(_0xa4e1('0x14'));var utils=require(_0xa4e1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa4e1('0x16'));var db=require(_0xa4e1('0x17'))['db'];function respondWithStatusCode(_0x3958f1,_0x45769d){_0x45769d=_0x45769d||0xcc;return function(_0x197b88){if(_0x197b88){return _0x3958f1[_0xa4e1('0x18')](_0x45769d);}return _0x3958f1['status'](_0x45769d)[_0xa4e1('0x19')]();};}function respondWithResult(_0xbbc048,_0x5d7825){_0x5d7825=_0x5d7825||0xc8;return function(_0x3c7446){if(_0x3c7446){return _0xbbc048[_0xa4e1('0x1a')](_0x5d7825)[_0xa4e1('0x1b')](_0x3c7446);}};}function respondWithFilteredResult(_0x16ed99,_0x26f922){return function(_0x4b0917){if(_0x4b0917){var _0x33cdb6=typeof _0x26f922[_0xa4e1('0x1c')]==='undefined'&&typeof _0x26f922['limit']===_0xa4e1('0x1d');var _0x28d2c9=_0x4b0917[_0xa4e1('0x1e')];var _0x225e10=_0x33cdb6?0x0:_0x26f922['offset'];var _0x1b98f4=_0x33cdb6?_0x4b0917[_0xa4e1('0x1e')]:_0x26f922[_0xa4e1('0x1c')]+_0x26f922['limit'];var _0x408f55;if(_0x1b98f4>=_0x28d2c9){_0x1b98f4=_0x28d2c9;_0x408f55=0xc8;}else{_0x408f55=0xce;}_0x16ed99['status'](_0x408f55);return _0x16ed99['set']('Content-Range',_0x225e10+'-'+_0x1b98f4+'/'+_0x28d2c9)['json'](_0x4b0917);}return null;};}function patchUpdates(_0x19276d){return function(_0x31aab2){try{jsonpatch[_0xa4e1('0x1f')](_0x31aab2,_0x19276d,!![]);}catch(_0xcbe74){return BPromise[_0xa4e1('0x20')](_0xcbe74);}return _0x31aab2[_0xa4e1('0x21')]();};}function saveUpdates(_0x1a173b,_0x176381){return function(_0x184103){if(_0x184103){return _0x184103[_0xa4e1('0x22')](_0x1a173b)['then'](function(_0x5b883a){return _0x5b883a;});}return null;};}function removeEntity(_0x1aa183,_0x260da6){return function(_0x158eda){if(_0x158eda){return _0x158eda[_0xa4e1('0x23')]()['then'](function(){var _0x1751ed=_0x158eda[_0xa4e1('0x24')]({'plain':!![]});var _0x328745=_0xa4e1('0x25');return db[_0xa4e1('0x26')][_0xa4e1('0x23')]({'where':{'type':_0x328745,'resourceId':_0x1751ed['id']}})['then'](function(){return _0x158eda;});})[_0xa4e1('0x27')](function(){_0x1aa183[_0xa4e1('0x1a')](0xcc)[_0xa4e1('0x19')]();});}};}function handleEntityNotFound(_0x24de73,_0x743571){return function(_0x585362){if(!_0x585362){_0x24de73[_0xa4e1('0x18')](0x194);}return _0x585362;};}function handleError(_0x59c892,_0x504c42){_0x504c42=_0x504c42||0x1f4;return function(_0x3bfb82){logger['error'](_0x3bfb82[_0xa4e1('0x28')]);if(_0x3bfb82['name']){delete _0x3bfb82[_0xa4e1('0x29')];}_0x59c892[_0xa4e1('0x1a')](_0x504c42)['send'](_0x3bfb82);};}exports[_0xa4e1('0x2a')]=function(_0x172b2b,_0x3eb8fe){var _0x4b7586={},_0x2cbfcf={},_0x2ce35f={'count':0x0,'rows':[]};var _0x1ae962=_[_0xa4e1('0x2b')](db[_0xa4e1('0x2c')]['rawAttributes'],function(_0x170be4){return{'name':_0x170be4[_0xa4e1('0x2d')],'type':_0x170be4['type']['key']};});_0x2cbfcf['model']=_[_0xa4e1('0x2b')](_0x1ae962,_0xa4e1('0x29'));_0x2cbfcf['query']=_[_0xa4e1('0x2e')](_0x172b2b[_0xa4e1('0x2f')]);_0x2cbfcf[_0xa4e1('0x30')]=_['intersection'](_0x2cbfcf[_0xa4e1('0x31')],_0x2cbfcf['query']);_0x4b7586['attributes']=_[_0xa4e1('0x32')](_0x2cbfcf[_0xa4e1('0x31')],qs[_0xa4e1('0x33')](_0x172b2b[_0xa4e1('0x2f')]['fields']));_0x4b7586[_0xa4e1('0x34')]=_0x4b7586[_0xa4e1('0x34')][_0xa4e1('0x35')]?_0x4b7586[_0xa4e1('0x34')]:_0x2cbfcf[_0xa4e1('0x31')];if(!_0x172b2b[_0xa4e1('0x2f')][_0xa4e1('0x36')]('nolimit')){_0x4b7586[_0xa4e1('0x37')]=qs[_0xa4e1('0x37')](_0x172b2b[_0xa4e1('0x2f')]['limit']);_0x4b7586['offset']=qs[_0xa4e1('0x1c')](_0x172b2b[_0xa4e1('0x2f')][_0xa4e1('0x1c')]);}_0x4b7586[_0xa4e1('0x38')]=qs[_0xa4e1('0x39')](_0x172b2b[_0xa4e1('0x2f')][_0xa4e1('0x39')]);_0x4b7586[_0xa4e1('0x3a')]=qs[_0xa4e1('0x30')](_['pick'](_0x172b2b[_0xa4e1('0x2f')],_0x2cbfcf[_0xa4e1('0x30')]),_0x1ae962);if(_0x172b2b[_0xa4e1('0x2f')]['filter']){_0x4b7586[_0xa4e1('0x3a')]=_[_0xa4e1('0x3b')](_0x4b7586[_0xa4e1('0x3a')],{'$or':[{'key':{'$like':'%'+_0x172b2b['query'][_0xa4e1('0x3c')]+'%'}},{'value':{'$like':'%'+_0x172b2b['query'][_0xa4e1('0x3c')]+'%'}}]});}_0x4b7586=_[_0xa4e1('0x3b')]({},_0x4b7586,_0x172b2b[_0xa4e1('0x3d')]);var _0x140a6f={'where':_0x4b7586[_0xa4e1('0x3a')]};return db[_0xa4e1('0x2c')][_0xa4e1('0x1e')](_0x140a6f)['then'](function(_0x446aae){_0x2ce35f[_0xa4e1('0x1e')]=_0x446aae;if(_0x172b2b[_0xa4e1('0x2f')]['includeAll']){_0x4b7586['include']=[{'all':!![]}];}return db[_0xa4e1('0x2c')]['findAll'](_0x4b7586);})[_0xa4e1('0x27')](function(_0x5a9edb){_0x2ce35f[_0xa4e1('0x3e')]=_0x5a9edb;return _0x2ce35f;})[_0xa4e1('0x27')](respondWithFilteredResult(_0x3eb8fe,_0x4b7586))[_0xa4e1('0x3f')](handleError(_0x3eb8fe,null));};exports[_0xa4e1('0x40')]=function(_0x308005,_0x467a75){var _0x1736a8={'raw':!![],'where':{'id':_0x308005[_0xa4e1('0x41')]['id']}},_0x2a4076={};_0x2a4076[_0xa4e1('0x31')]=_[_0xa4e1('0x2e')](db[_0xa4e1('0x2c')][_0xa4e1('0x42')]);_0x2a4076[_0xa4e1('0x2f')]=_[_0xa4e1('0x2e')](_0x308005[_0xa4e1('0x2f')]);_0x2a4076['filters']=_['intersection'](_0x2a4076['model'],_0x2a4076['query']);_0x1736a8[_0xa4e1('0x34')]=_[_0xa4e1('0x32')](_0x2a4076['model'],qs[_0xa4e1('0x33')](_0x308005[_0xa4e1('0x2f')][_0xa4e1('0x33')]));_0x1736a8['attributes']=_0x1736a8[_0xa4e1('0x34')]['length']?_0x1736a8['attributes']:_0x2a4076[_0xa4e1('0x31')];if(_0x308005[_0xa4e1('0x2f')][_0xa4e1('0x43')]){_0x1736a8[_0xa4e1('0x44')]=[{'all':!![]}];}_0x1736a8=_[_0xa4e1('0x3b')]({},_0x1736a8,_0x308005['options']);return db[_0xa4e1('0x2c')]['find'](_0x1736a8)[_0xa4e1('0x27')](handleEntityNotFound(_0x467a75,null))[_0xa4e1('0x27')](respondWithResult(_0x467a75,null))[_0xa4e1('0x3f')](handleError(_0x467a75,null));};exports[_0xa4e1('0x22')]=function(_0x2bc49e,_0x56742b){if(_0x2bc49e[_0xa4e1('0x45')]['id']){delete _0x2bc49e['body']['id'];}return db[_0xa4e1('0x2c')][_0xa4e1('0x46')]({'where':{'id':_0x2bc49e[_0xa4e1('0x41')]['id']}})[_0xa4e1('0x27')](handleEntityNotFound(_0x56742b,null))['then'](saveUpdates(_0x2bc49e[_0xa4e1('0x45')],null))[_0xa4e1('0x27')](respondWithResult(_0x56742b,null))[_0xa4e1('0x3f')](handleError(_0x56742b,null));};exports[_0xa4e1('0x23')]=function(_0x1d2c3d,_0x499524){return db[_0xa4e1('0x2c')]['find']({'where':{'id':_0x1d2c3d['params']['id']}})[_0xa4e1('0x27')](handleEntityNotFound(_0x499524,null))['then'](removeEntity(_0x499524,null))[_0xa4e1('0x3f')](handleError(_0x499524,null));};exports[_0xa4e1('0x47')]=function(_0x292e9e,_0x425761){var _0xab82a8={'key':_0x292e9e[_0xa4e1('0x45')][_0xa4e1('0x48')]};if(_0x292e9e['body'][_0xa4e1('0x49')]){_0xab82a8[_0xa4e1('0x49')]=_0x292e9e[_0xa4e1('0x45')]['MailAccountId'];}else if(_0x292e9e[_0xa4e1('0x45')][_0xa4e1('0x4a')]){_0xab82a8[_0xa4e1('0x4a')]=_0x292e9e['body'][_0xa4e1('0x4a')];}else if(_0x292e9e['body'][_0xa4e1('0x4b')]){_0xab82a8[_0xa4e1('0x4b')]=_0x292e9e[_0xa4e1('0x45')][_0xa4e1('0x4b')];}else if(_0x292e9e[_0xa4e1('0x45')][_0xa4e1('0x4c')]){_0xab82a8[_0xa4e1('0x4c')]=_0x292e9e[_0xa4e1('0x45')]['ChatWebsiteId'];}return db[_0xa4e1('0x2c')][_0xa4e1('0x46')]({'where':_0xab82a8})['then'](function(_0x165110){if(_0x165110){throw new db['Sequelize']['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xa4e1('0x2c')][_0xa4e1('0x47')](_0x292e9e[_0xa4e1('0x45')]);})[_0xa4e1('0x27')](function(_0x5c11f2){var _0x52e869=_0x292e9e[_0xa4e1('0x4d')][_0xa4e1('0x24')]({'plain':!![]});if(!_0x52e869)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52e869[_0xa4e1('0x4e')]===_0xa4e1('0x4d')){var _0x16b472=_0x5c11f2[_0xa4e1('0x24')]({'plain':!![]});return db[_0xa4e1('0x4f')][_0xa4e1('0x46')]({'where':{'name':_0xa4e1('0x25'),'userProfileId':_0x52e869[_0xa4e1('0x50')]},'raw':!![]})[_0xa4e1('0x27')](function(_0x2e63cd){if(_0x2e63cd&&_0x2e63cd[_0xa4e1('0x51')]===0x0){return db['UserProfileResource'][_0xa4e1('0x47')]({'name':_0x16b472[_0xa4e1('0x29')],'resourceId':_0x16b472['id'],'type':_0x2e63cd[_0xa4e1('0x29')],'sectionId':_0x2e63cd['id']},{})[_0xa4e1('0x27')](function(){return _0x5c11f2;});}else{return _0x5c11f2;}})[_0xa4e1('0x3f')](function(_0x35b60b){logger[_0xa4e1('0x52')](_0xa4e1('0x53'),_0x35b60b);throw _0x35b60b;});}return _0x5c11f2;})[_0xa4e1('0x27')](respondWithResult(_0x425761,0xc9))['catch'](handleError(_0x425761,null));};
\ No newline at end of file
+var _0x1fa4=['sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','get','CannedAnswers','UserProfileResource','destroy','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','where','filter','merge','include','rows','catch','show','keys','length','includeAll','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','autoAssociation','error','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','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'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1fa4,0x19a));var _0x41fa=function(_0x395b50,_0x4e00d1){_0x395b50=_0x395b50-0x0;var _0x3b8e48=_0x1fa4[_0x395b50];return _0x3b8e48;};'use strict';var emlformat=require(_0x41fa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x41fa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x41fa('0x2'));var moment=require('moment');var BPromise=require(_0x41fa('0x3'));var Mustache=require(_0x41fa('0x4'));var util=require('util');var path=require(_0x41fa('0x5'));var sox=require(_0x41fa('0x6'));var csv=require(_0x41fa('0x7'));var ejs=require(_0x41fa('0x8'));var fs=require('fs');var fs_extra=require(_0x41fa('0x9'));var _=require(_0x41fa('0xa'));var squel=require(_0x41fa('0xb'));var crypto=require(_0x41fa('0xc'));var jsforce=require(_0x41fa('0xd'));var deskjs=require(_0x41fa('0xe'));var toCsv=require(_0x41fa('0x7'));var querystring=require(_0x41fa('0xf'));var Papa=require(_0x41fa('0x10'));var Redis=require('ioredis');var authService=require(_0x41fa('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x41fa('0x12'));var hardwareService=require(_0x41fa('0x13'));var logger=require(_0x41fa('0x14'))(_0x41fa('0x15'));var utils=require(_0x41fa('0x16'));var config=require(_0x41fa('0x17'));var licenseUtil=require(_0x41fa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f4fb4,_0x5eaa65){_0x5eaa65=_0x5eaa65||0xcc;return function(_0x3466d3){if(_0x3466d3){return _0x3f4fb4[_0x41fa('0x19')](_0x5eaa65);}return _0x3f4fb4['status'](_0x5eaa65)[_0x41fa('0x1a')]();};}function respondWithResult(_0x2016e2,_0x4cbd16){_0x4cbd16=_0x4cbd16||0xc8;return function(_0x233b4b){if(_0x233b4b){return _0x2016e2['status'](_0x4cbd16)['json'](_0x233b4b);}};}function respondWithFilteredResult(_0x1aa38f,_0x4aea08){return function(_0x5b09db){if(_0x5b09db){var _0x34e0d5=typeof _0x4aea08[_0x41fa('0x1b')]===_0x41fa('0x1c')&&typeof _0x4aea08[_0x41fa('0x1d')]===_0x41fa('0x1c');var _0x310bc6=_0x5b09db[_0x41fa('0x1e')];var _0x1c888d=_0x34e0d5?0x0:_0x4aea08[_0x41fa('0x1b')];var _0x3ff97a=_0x34e0d5?_0x5b09db[_0x41fa('0x1e')]:_0x4aea08[_0x41fa('0x1b')]+_0x4aea08['limit'];var _0x4dc165;if(_0x3ff97a>=_0x310bc6){_0x3ff97a=_0x310bc6;_0x4dc165=0xc8;}else{_0x4dc165=0xce;}_0x1aa38f[_0x41fa('0x1f')](_0x4dc165);return _0x1aa38f[_0x41fa('0x20')](_0x41fa('0x21'),_0x1c888d+'-'+_0x3ff97a+'/'+_0x310bc6)['json'](_0x5b09db);}return null;};}function patchUpdates(_0x2b054c){return function(_0x1cba48){try{jsonpatch[_0x41fa('0x22')](_0x1cba48,_0x2b054c,!![]);}catch(_0x489926){return BPromise[_0x41fa('0x23')](_0x489926);}return _0x1cba48['save']();};}function saveUpdates(_0x2d7aaf,_0x580550){return function(_0x320b04){if(_0x320b04){return _0x320b04[_0x41fa('0x24')](_0x2d7aaf)['then'](function(_0x1727f9){return _0x1727f9;});}return null;};}function removeEntity(_0x4b06e6,_0x478304){return function(_0x3c6995){if(_0x3c6995){return _0x3c6995['destroy']()[_0x41fa('0x25')](function(){var _0xab281a=_0x3c6995[_0x41fa('0x26')]({'plain':!![]});var _0x369571=_0x41fa('0x27');return db[_0x41fa('0x28')][_0x41fa('0x29')]({'where':{'type':_0x369571,'resourceId':_0xab281a['id']}})['then'](function(){return _0x3c6995;});})[_0x41fa('0x25')](function(){_0x4b06e6[_0x41fa('0x1f')](0xcc)[_0x41fa('0x1a')]();});}};}function handleEntityNotFound(_0x4e42cb,_0x11913a){return function(_0x2914d7){if(!_0x2914d7){_0x4e42cb[_0x41fa('0x19')](0x194);}return _0x2914d7;};}function handleError(_0x52240d,_0x49bc79){_0x49bc79=_0x49bc79||0x1f4;return function(_0x4fa4c8){logger['error'](_0x4fa4c8[_0x41fa('0x2a')]);if(_0x4fa4c8[_0x41fa('0x2b')]){delete _0x4fa4c8[_0x41fa('0x2b')];}_0x52240d[_0x41fa('0x1f')](_0x49bc79)[_0x41fa('0x2c')](_0x4fa4c8);};}exports['index']=function(_0x124709,_0xd468c1){var _0x1f5566={},_0x383099={},_0x2061cc={'count':0x0,'rows':[]};var _0x5a9c0b=_[_0x41fa('0x2d')](db[_0x41fa('0x2e')][_0x41fa('0x2f')],function(_0x1e34f5){return{'name':_0x1e34f5[_0x41fa('0x30')],'type':_0x1e34f5[_0x41fa('0x31')][_0x41fa('0x32')]};});_0x383099[_0x41fa('0x33')]=_['map'](_0x5a9c0b,_0x41fa('0x2b'));_0x383099[_0x41fa('0x34')]=_['keys'](_0x124709[_0x41fa('0x34')]);_0x383099[_0x41fa('0x35')]=_[_0x41fa('0x36')](_0x383099['model'],_0x383099[_0x41fa('0x34')]);_0x1f5566[_0x41fa('0x37')]=_['intersection'](_0x383099[_0x41fa('0x33')],qs[_0x41fa('0x38')](_0x124709[_0x41fa('0x34')]['fields']));_0x1f5566[_0x41fa('0x37')]=_0x1f5566['attributes']['length']?_0x1f5566[_0x41fa('0x37')]:_0x383099[_0x41fa('0x33')];if(!_0x124709[_0x41fa('0x34')][_0x41fa('0x39')]('nolimit')){_0x1f5566['limit']=qs[_0x41fa('0x1d')](_0x124709[_0x41fa('0x34')][_0x41fa('0x1d')]);_0x1f5566[_0x41fa('0x1b')]=qs['offset'](_0x124709['query'][_0x41fa('0x1b')]);}_0x1f5566[_0x41fa('0x3a')]=qs[_0x41fa('0x3b')](_0x124709[_0x41fa('0x34')][_0x41fa('0x3b')]);_0x1f5566['where']=qs['filters'](_[_0x41fa('0x3c')](_0x124709['query'],_0x383099['filters']),_0x5a9c0b);if(_0x124709[_0x41fa('0x34')]['filter']){_0x1f5566['where']=_['merge'](_0x1f5566[_0x41fa('0x3d')],{'$or':[{'key':{'$like':'%'+_0x124709[_0x41fa('0x34')][_0x41fa('0x3e')]+'%'}},{'value':{'$like':'%'+_0x124709[_0x41fa('0x34')][_0x41fa('0x3e')]+'%'}}]});}_0x1f5566=_[_0x41fa('0x3f')]({},_0x1f5566,_0x124709['options']);var _0x3a85bc={'where':_0x1f5566[_0x41fa('0x3d')]};return db[_0x41fa('0x2e')][_0x41fa('0x1e')](_0x3a85bc)[_0x41fa('0x25')](function(_0x13dfd4){_0x2061cc[_0x41fa('0x1e')]=_0x13dfd4;if(_0x124709['query']['includeAll']){_0x1f5566[_0x41fa('0x40')]=[{'all':!![]}];}return db[_0x41fa('0x2e')]['findAll'](_0x1f5566);})[_0x41fa('0x25')](function(_0x4323a4){_0x2061cc[_0x41fa('0x41')]=_0x4323a4;return _0x2061cc;})['then'](respondWithFilteredResult(_0xd468c1,_0x1f5566))[_0x41fa('0x42')](handleError(_0xd468c1,null));};exports[_0x41fa('0x43')]=function(_0x3ed884,_0x1dd2ff){var _0x40100a={'raw':!![],'where':{'id':_0x3ed884['params']['id']}},_0x5ce64={};_0x5ce64['model']=_['keys'](db[_0x41fa('0x2e')][_0x41fa('0x2f')]);_0x5ce64['query']=_[_0x41fa('0x44')](_0x3ed884[_0x41fa('0x34')]);_0x5ce64[_0x41fa('0x35')]=_[_0x41fa('0x36')](_0x5ce64[_0x41fa('0x33')],_0x5ce64[_0x41fa('0x34')]);_0x40100a['attributes']=_[_0x41fa('0x36')](_0x5ce64[_0x41fa('0x33')],qs[_0x41fa('0x38')](_0x3ed884[_0x41fa('0x34')]['fields']));_0x40100a[_0x41fa('0x37')]=_0x40100a[_0x41fa('0x37')][_0x41fa('0x45')]?_0x40100a[_0x41fa('0x37')]:_0x5ce64[_0x41fa('0x33')];if(_0x3ed884[_0x41fa('0x34')][_0x41fa('0x46')]){_0x40100a[_0x41fa('0x40')]=[{'all':!![]}];}_0x40100a=_[_0x41fa('0x3f')]({},_0x40100a,_0x3ed884['options']);return db[_0x41fa('0x2e')][_0x41fa('0x47')](_0x40100a)['then'](handleEntityNotFound(_0x1dd2ff,null))['then'](respondWithResult(_0x1dd2ff,null))[_0x41fa('0x42')](handleError(_0x1dd2ff,null));};exports[_0x41fa('0x24')]=function(_0x55de8d,_0x51c522){if(_0x55de8d[_0x41fa('0x48')]['id']){delete _0x55de8d[_0x41fa('0x48')]['id'];}return db['CannedAnswer'][_0x41fa('0x47')]({'where':{'id':_0x55de8d[_0x41fa('0x49')]['id']}})[_0x41fa('0x25')](handleEntityNotFound(_0x51c522,null))['then'](saveUpdates(_0x55de8d[_0x41fa('0x48')],null))['then'](respondWithResult(_0x51c522,null))['catch'](handleError(_0x51c522,null));};exports[_0x41fa('0x29')]=function(_0x15d24e,_0x3fb80d){return db[_0x41fa('0x2e')][_0x41fa('0x47')]({'where':{'id':_0x15d24e[_0x41fa('0x49')]['id']}})['then'](handleEntityNotFound(_0x3fb80d,null))['then'](removeEntity(_0x3fb80d,null))['catch'](handleError(_0x3fb80d,null));};exports[_0x41fa('0x4a')]=function(_0x274ed2,_0x2a0b95){var _0x2cef07={'key':_0x274ed2[_0x41fa('0x48')][_0x41fa('0x32')]};if(_0x274ed2['body']['MailAccountId']){_0x2cef07[_0x41fa('0x4b')]=_0x274ed2[_0x41fa('0x48')]['MailAccountId'];}else if(_0x274ed2['body'][_0x41fa('0x4c')]){_0x2cef07['SmsAccountId']=_0x274ed2[_0x41fa('0x48')][_0x41fa('0x4c')];}else if(_0x274ed2[_0x41fa('0x48')]['OpenchannelAccountId']){_0x2cef07[_0x41fa('0x4d')]=_0x274ed2[_0x41fa('0x48')][_0x41fa('0x4d')];}else if(_0x274ed2[_0x41fa('0x48')][_0x41fa('0x4e')]){_0x2cef07[_0x41fa('0x4e')]=_0x274ed2['body'][_0x41fa('0x4e')];}return db[_0x41fa('0x2e')][_0x41fa('0x47')]({'where':_0x2cef07})[_0x41fa('0x25')](function(_0x50d12c){if(_0x50d12c){throw new db[(_0x41fa('0x4f'))][(_0x41fa('0x50'))](_0x41fa('0x51'));}return db['CannedAnswer'][_0x41fa('0x4a')](_0x274ed2[_0x41fa('0x48')]);})[_0x41fa('0x25')](function(_0x8906e9){var _0x3c5388=_0x274ed2[_0x41fa('0x52')][_0x41fa('0x26')]({'plain':!![]});if(!_0x3c5388)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c5388[_0x41fa('0x53')]===_0x41fa('0x52')){var _0x35f857=_0x8906e9[_0x41fa('0x26')]({'plain':!![]});return db[_0x41fa('0x54')][_0x41fa('0x47')]({'where':{'name':_0x41fa('0x27'),'userProfileId':_0x3c5388['userProfileId']},'raw':!![]})[_0x41fa('0x25')](function(_0x12887b){if(_0x12887b&&_0x12887b[_0x41fa('0x55')]===0x0){return db['UserProfileResource'][_0x41fa('0x4a')]({'name':_0x35f857[_0x41fa('0x2b')],'resourceId':_0x35f857['id'],'type':_0x12887b[_0x41fa('0x2b')],'sectionId':_0x12887b['id']},{})[_0x41fa('0x25')](function(){return _0x8906e9;});}else{return _0x8906e9;}})[_0x41fa('0x42')](function(_0xec699c){logger[_0x41fa('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xec699c);throw _0xec699c;});}return _0x8906e9;})[_0x41fa('0x25')](respondWithResult(_0x2a0b95,0xc9))['catch'](handleError(_0x2a0b95,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 7efaf5a..f003b30 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 _0x021c=['path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','lodash','util','../../config/logger','moment','request-promise'];(function(_0x13c5e6,_0x53520a){var _0x17fce7=function(_0x398e5a){while(--_0x398e5a){_0x13c5e6['push'](_0x13c5e6['shift']());}};_0x17fce7(++_0x53520a);}(_0x021c,0x16f));var _0xc021=function(_0x2f1ab5,_0x2966be){_0x2f1ab5=_0x2f1ab5-0x0;var _0x5c7e72=_0x021c[_0x2f1ab5];return _0x5c7e72;};'use strict';var _=require(_0xc021('0x0'));var util=require(_0xc021('0x1'));var logger=require(_0xc021('0x2'))('api');var moment=require(_0xc021('0x3'));var BPromise=require('bluebird');var rp=require(_0xc021('0x4'));var fs=require('fs');var path=require(_0xc021('0x5'));var rimraf=require(_0xc021('0x6'));var config=require(_0xc021('0x7'));var attributes=require(_0xc021('0x8'));module[_0xc021('0x9')]=function(_0x182174,_0x470672){return _0x182174['define'](_0xc021('0xa'),attributes,{'tableName':_0xc021('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xfac4=['moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x2b0a9e,_0x4fd2bd){var _0x188644=function(_0x5de8ff){while(--_0x5de8ff){_0x2b0a9e['push'](_0x2b0a9e['shift']());}};_0x188644(++_0x4fd2bd);}(_0xfac4,0x8e));var _0x4fac=function(_0x34fa02,_0x39ae8e){_0x34fa02=_0x34fa02-0x0;var _0x5df5be=_0xfac4[_0x34fa02];return _0x5df5be;};'use strict';var _=require(_0x4fac('0x0'));var util=require('util');var logger=require(_0x4fac('0x1'))('api');var moment=require(_0x4fac('0x2'));var BPromise=require(_0x4fac('0x3'));var rp=require(_0x4fac('0x4'));var fs=require('fs');var path=require(_0x4fac('0x5'));var rimraf=require(_0x4fac('0x6'));var config=require('../../config/environment');var attributes=require(_0x4fac('0x7'));module['exports']=function(_0x3ee32b,_0x19ca05){return _0x3ee32b[_0x4fac('0x8')]('CannedAnswer',attributes,{'tableName':_0x4fac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4fac('0xa'),'collate':_0x4fac('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 8b5a8e1..b4742a9 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(_0xd8808f,_0x192d2d){var _0x3b68fc=function(_0x1ea46a){while(--_0x1ea46a){_0xd8808f['push'](_0xd8808f['shift']());}};_0x3b68fc(++_0x192d2d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x4b6d20,_0x2a74ea){var _0x328d76=function(_0x26ab5a){while(--_0x26ab5a){_0x4b6d20['push'](_0x4b6d20['shift']());}};_0x328d76(++_0x2a74ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 032ff9f..2b1b273 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 _0x5ada=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x45a030,_0x4b6fb3){var _0x1d8ead=function(_0x4f00ac){while(--_0x4f00ac){_0x45a030['push'](_0x45a030['shift']());}};_0x1d8ead(++_0x4b6fb3);}(_0x5ada,0xcc));var _0xa5ad=function(_0x3adec3,_0x32c463){_0x3adec3=_0x3adec3-0x0;var _0xc01b43=_0x5ada[_0x3adec3];return _0xc01b43;};'use strict';var multer=require(_0xa5ad('0x0'));var util=require('util');var path=require(_0xa5ad('0x1'));var timeout=require(_0xa5ad('0x2'));var express=require(_0xa5ad('0x3'));var router=express[_0xa5ad('0x4')]();var fs_extra=require(_0xa5ad('0x5'));var auth=require(_0xa5ad('0x6'));var interaction=require(_0xa5ad('0x7'));var config=require('../../config/environment');var controller=require(_0xa5ad('0x8'));router[_0xa5ad('0x9')]('/',auth[_0xa5ad('0xa')](),controller[_0xa5ad('0xb')]);router[_0xa5ad('0x9')](_0xa5ad('0xc'),auth[_0xa5ad('0xa')](),controller[_0xa5ad('0xd')]);router[_0xa5ad('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa5ad('0xf')](_0xa5ad('0xc'),auth[_0xa5ad('0xa')](),controller[_0xa5ad('0x10')]);router[_0xa5ad('0x11')](_0xa5ad('0xc'),auth[_0xa5ad('0xa')](),controller[_0xa5ad('0x12')]);module[_0xa5ad('0x13')]=router;
\ No newline at end of file
+var _0x5ecf=['/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get'];(function(_0x568fd1,_0x48ba5d){var _0x1f0a37=function(_0xc56b5){while(--_0xc56b5){_0x568fd1['push'](_0x568fd1['shift']());}};_0x1f0a37(++_0x48ba5d);}(_0x5ecf,0xa0));var _0xf5ec=function(_0xcbb362,_0x25298d){_0xcbb362=_0xcbb362-0x0;var _0x40b347=_0x5ecf[_0xcbb362];return _0x40b347;};'use strict';var multer=require(_0xf5ec('0x0'));var util=require(_0xf5ec('0x1'));var path=require(_0xf5ec('0x2'));var timeout=require(_0xf5ec('0x3'));var express=require(_0xf5ec('0x4'));var router=express[_0xf5ec('0x5')]();var fs_extra=require(_0xf5ec('0x6'));var auth=require(_0xf5ec('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf5ec('0x8'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xf5ec('0x9')](),controller['index']);router[_0xf5ec('0xa')](_0xf5ec('0xb'),auth[_0xf5ec('0x9')](),controller[_0xf5ec('0xc')]);router[_0xf5ec('0xd')]('/',auth[_0xf5ec('0x9')](),controller['create']);router[_0xf5ec('0xe')](_0xf5ec('0xb'),auth['isAuthenticated'](),controller[_0xf5ec('0xf')]);router[_0xf5ec('0x10')](_0xf5ec('0xb'),auth[_0xf5ec('0x9')](),controller[_0xf5ec('0x11')]);module[_0xf5ec('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 122cd6f..a935076 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 _0xb010=['1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x44fad0,_0x43d8f8){var _0x442625=function(_0x5e9041){while(--_0x5e9041){_0x44fad0['push'](_0x44fad0['shift']());}};_0x442625(++_0x43d8f8);}(_0xb010,0x8b));var _0x0b01=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xb010[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require('sequelize');module[_0x0b01('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x0b01('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x0b01('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x0b01('0x2')]},'channel':{'type':Sequelize[_0x0b01('0x2')]},'dstchannel':{'type':Sequelize[_0x0b01('0x2')]},'lastapp':{'type':Sequelize[_0x0b01('0x2')]},'lastdata':{'type':Sequelize[_0x0b01('0x2')]},'duration':{'type':Sequelize[_0x0b01('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0b01('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0b01('0x2')]},'amaflags':{'type':Sequelize[_0x0b01('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0b01('0x2')]},'userfield':{'type':Sequelize[_0x0b01('0x2')]},'uniqueid':{'type':Sequelize[_0x0b01('0x2')]},'linkedid':{'type':Sequelize[_0x0b01('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x0b01('0x2')]},'type':{'type':Sequelize[_0x0b01('0x2')]},'tag':{'type':Sequelize[_0x0b01('0x2')]}};
\ No newline at end of file
+var _0xbfa6=['sequelize','exports','STRING','INTEGER'];(function(_0x4ec13d,_0x358a8f){var _0x3c3fa7=function(_0x2615f6){while(--_0x2615f6){_0x4ec13d['push'](_0x4ec13d['shift']());}};_0x3c3fa7(++_0x358a8f);}(_0xbfa6,0x1d0));var _0x6bfa=function(_0x481604,_0x276ff8){_0x481604=_0x481604-0x0;var _0x1ca4ed=_0xbfa6[_0x481604];return _0x1ca4ed;};'use strict';var Sequelize=require(_0x6bfa('0x0'));module[_0x6bfa('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x6bfa('0x2')]},'dst':{'type':Sequelize[_0x6bfa('0x2')]},'dcontext':{'type':Sequelize[_0x6bfa('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x6bfa('0x2')]},'lastapp':{'type':Sequelize[_0x6bfa('0x2')]},'lastdata':{'type':Sequelize[_0x6bfa('0x2')]},'duration':{'type':Sequelize[_0x6bfa('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6bfa('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6bfa('0x2')]},'amaflags':{'type':Sequelize[_0x6bfa('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x6bfa('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x6bfa('0x2')]},'sequence':{'type':Sequelize[_0x6bfa('0x2')]},'peeraccount':{'type':Sequelize[_0x6bfa('0x2')]},'type':{'type':Sequelize[_0x6bfa('0x2')]},'tag':{'type':Sequelize[_0x6bfa('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 5111473..fdca4a1 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 _0x5162=['undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','intersection','find','create','body','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5162,0x103));var _0x2516=function(_0x1bf6b7,_0x12519b){_0x1bf6b7=_0x1bf6b7-0x0;var _0x5e2768=_0x5162[_0x1bf6b7];return _0x5e2768;};'use strict';var emlformat=require(_0x2516('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2516('0x1'));var BPromise=require(_0x2516('0x2'));var Mustache=require(_0x2516('0x3'));var util=require(_0x2516('0x4'));var path=require(_0x2516('0x5'));var sox=require(_0x2516('0x6'));var csv=require(_0x2516('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2516('0x8'));var crypto=require(_0x2516('0x9'));var jsforce=require(_0x2516('0xa'));var deskjs=require(_0x2516('0xb'));var toCsv=require(_0x2516('0x7'));var querystring=require(_0x2516('0xc'));var Papa=require(_0x2516('0xd'));var Redis=require('ioredis');var authService=require(_0x2516('0xe'));var qs=require(_0x2516('0xf'));var as=require(_0x2516('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2516('0x11'));var licenseUtil=require(_0x2516('0x12'));var db=require(_0x2516('0x13'))['db'];function respondWithStatusCode(_0x3ef6ff,_0x56c69c){_0x56c69c=_0x56c69c||0xcc;return function(_0x33496b){if(_0x33496b){return _0x3ef6ff[_0x2516('0x14')](_0x56c69c);}return _0x3ef6ff[_0x2516('0x15')](_0x56c69c)[_0x2516('0x16')]();};}function respondWithResult(_0x42c771,_0x558d20){_0x558d20=_0x558d20||0xc8;return function(_0x3e5e0f){if(_0x3e5e0f){return _0x42c771[_0x2516('0x15')](_0x558d20)[_0x2516('0x17')](_0x3e5e0f);}};}function respondWithFilteredResult(_0x181a28,_0x2637e8){return function(_0x2ec31f){if(_0x2ec31f){var _0x19aacb=typeof _0x2637e8[_0x2516('0x18')]===_0x2516('0x19')&&typeof _0x2637e8['limit']===_0x2516('0x19');var _0x1ced29=_0x2ec31f[_0x2516('0x1a')];var _0x564d05=_0x19aacb?0x0:_0x2637e8[_0x2516('0x18')];var _0x5e96c7=_0x19aacb?_0x2ec31f['count']:_0x2637e8[_0x2516('0x18')]+_0x2637e8[_0x2516('0x1b')];var _0x151168;if(_0x5e96c7>=_0x1ced29){_0x5e96c7=_0x1ced29;_0x151168=0xc8;}else{_0x151168=0xce;}_0x181a28[_0x2516('0x15')](_0x151168);return _0x181a28[_0x2516('0x1c')](_0x2516('0x1d'),_0x564d05+'-'+_0x5e96c7+'/'+_0x1ced29)[_0x2516('0x17')](_0x2ec31f);}return null;};}function patchUpdates(_0x113616){return function(_0x248c5a){try{jsonpatch[_0x2516('0x1e')](_0x248c5a,_0x113616,!![]);}catch(_0x39ba5b){return BPromise[_0x2516('0x1f')](_0x39ba5b);}return _0x248c5a[_0x2516('0x20')]();};}function saveUpdates(_0x4fb7d9,_0x559a3e){return function(_0x12db4d){if(_0x12db4d){return _0x12db4d[_0x2516('0x21')](_0x4fb7d9)[_0x2516('0x22')](function(_0x2d5b1b){return _0x2d5b1b;});}return null;};}function removeEntity(_0x3ffb6d,_0x32de7a){return function(_0x3d906d){if(_0x3d906d){return _0x3d906d[_0x2516('0x23')]()['then'](function(){_0x3ffb6d[_0x2516('0x15')](0xcc)[_0x2516('0x16')]();});}};}function handleEntityNotFound(_0x774b60,_0x434d54){return function(_0x47f4fb){if(!_0x47f4fb){_0x774b60[_0x2516('0x14')](0x194);}return _0x47f4fb;};}function handleError(_0x30eeb9,_0x1f722c){_0x1f722c=_0x1f722c||0x1f4;return function(_0x3d728a){logger[_0x2516('0x24')](_0x3d728a['stack']);if(_0x3d728a[_0x2516('0x25')]){delete _0x3d728a[_0x2516('0x25')];}_0x30eeb9[_0x2516('0x15')](_0x1f722c)[_0x2516('0x26')](_0x3d728a);};}exports[_0x2516('0x27')]=function(_0x285e67,_0x556f01){var _0x136893={},_0x20dc9f={},_0x493a3e={'count':0x0,'rows':[]};var _0x19d90d=_[_0x2516('0x28')](db[_0x2516('0x29')][_0x2516('0x2a')],function(_0x539704){return{'name':_0x539704[_0x2516('0x2b')],'type':_0x539704[_0x2516('0x2c')][_0x2516('0x2d')]};});_0x20dc9f[_0x2516('0x2e')]=_[_0x2516('0x28')](_0x19d90d,_0x2516('0x25'));_0x20dc9f[_0x2516('0x2f')]=_[_0x2516('0x30')](_0x285e67[_0x2516('0x2f')]);_0x20dc9f[_0x2516('0x31')]=_['intersection'](_0x20dc9f[_0x2516('0x2e')],_0x20dc9f['query']);_0x136893[_0x2516('0x32')]=_['intersection'](_0x20dc9f[_0x2516('0x2e')],qs['fields'](_0x285e67[_0x2516('0x2f')][_0x2516('0x33')]));_0x136893[_0x2516('0x32')]=_0x136893[_0x2516('0x32')][_0x2516('0x34')]?_0x136893[_0x2516('0x32')]:_0x20dc9f[_0x2516('0x2e')];if(!_0x285e67[_0x2516('0x2f')][_0x2516('0x35')]('nolimit')){_0x136893[_0x2516('0x1b')]=qs[_0x2516('0x1b')](_0x285e67[_0x2516('0x2f')][_0x2516('0x1b')]);_0x136893['offset']=qs['offset'](_0x285e67[_0x2516('0x2f')][_0x2516('0x18')]);}_0x136893[_0x2516('0x36')]=qs[_0x2516('0x37')](_0x285e67[_0x2516('0x2f')][_0x2516('0x37')]);_0x136893[_0x2516('0x38')]=qs[_0x2516('0x31')](_[_0x2516('0x39')](_0x285e67[_0x2516('0x2f')],_0x20dc9f['filters']),_0x19d90d);if(_0x285e67['query'][_0x2516('0x3a')]){_0x136893[_0x2516('0x38')]=_['merge'](_0x136893['where'],{'$or':_[_0x2516('0x28')](_0x19d90d,function(_0x3b310f){if(_0x3b310f['type']!==_0x2516('0x3b')){var _0x52ef6b={};_0x52ef6b[_0x3b310f[_0x2516('0x25')]]={'$like':'%'+_0x285e67[_0x2516('0x2f')]['filter']+'%'};return _0x52ef6b;}})});}_0x136893=_[_0x2516('0x3c')]({},_0x136893,_0x285e67[_0x2516('0x3d')]);var _0x155cf7={'where':_0x136893[_0x2516('0x38')]};return db[_0x2516('0x29')][_0x2516('0x1a')](_0x155cf7)[_0x2516('0x22')](function(_0x2371a8){_0x493a3e[_0x2516('0x1a')]=_0x2371a8;if(_0x285e67[_0x2516('0x2f')][_0x2516('0x3e')]){_0x136893[_0x2516('0x3f')]=[{'all':!![]}];}return db[_0x2516('0x29')]['findAll'](_0x136893);})[_0x2516('0x22')](function(_0x1bc0e){_0x493a3e['rows']=_0x1bc0e;return _0x493a3e;})[_0x2516('0x22')](respondWithFilteredResult(_0x556f01,_0x136893))[_0x2516('0x40')](handleError(_0x556f01,null));};exports[_0x2516('0x41')]=function(_0x1afefb,_0x421c58){var _0x582cb6={'raw':!![],'where':{'id':_0x1afefb[_0x2516('0x42')]['id']}},_0x1a8d2d={};_0x1a8d2d[_0x2516('0x2e')]=_[_0x2516('0x30')](db[_0x2516('0x29')][_0x2516('0x2a')]);_0x1a8d2d['query']=_[_0x2516('0x30')](_0x1afefb[_0x2516('0x2f')]);_0x1a8d2d[_0x2516('0x31')]=_[_0x2516('0x43')](_0x1a8d2d[_0x2516('0x2e')],_0x1a8d2d[_0x2516('0x2f')]);_0x582cb6[_0x2516('0x32')]=_['intersection'](_0x1a8d2d[_0x2516('0x2e')],qs['fields'](_0x1afefb[_0x2516('0x2f')]['fields']));_0x582cb6[_0x2516('0x32')]=_0x582cb6[_0x2516('0x32')][_0x2516('0x34')]?_0x582cb6['attributes']:_0x1a8d2d['model'];if(_0x1afefb[_0x2516('0x2f')][_0x2516('0x3e')]){_0x582cb6['include']=[{'all':!![]}];}_0x582cb6=_['merge']({},_0x582cb6,_0x1afefb[_0x2516('0x3d')]);return db[_0x2516('0x29')][_0x2516('0x44')](_0x582cb6)['then'](handleEntityNotFound(_0x421c58,null))[_0x2516('0x22')](respondWithResult(_0x421c58,null))['catch'](handleError(_0x421c58,null));};exports[_0x2516('0x45')]=function(_0x39fd32,_0x318128){return db[_0x2516('0x29')]['create'](_0x39fd32[_0x2516('0x46')],{})[_0x2516('0x22')](respondWithResult(_0x318128,0xc9))[_0x2516('0x40')](handleError(_0x318128,null));};exports[_0x2516('0x21')]=function(_0x43874c,_0x482883){if(_0x43874c[_0x2516('0x46')]['id']){delete _0x43874c[_0x2516('0x46')]['id'];}return db[_0x2516('0x29')][_0x2516('0x44')]({'where':{'id':_0x43874c['params']['id']}})[_0x2516('0x22')](handleEntityNotFound(_0x482883,null))[_0x2516('0x22')](saveUpdates(_0x43874c[_0x2516('0x46')],null))[_0x2516('0x22')](respondWithResult(_0x482883,null))[_0x2516('0x40')](handleError(_0x482883,null));};exports['destroy']=function(_0x1c4be3,_0x1aa854){return db[_0x2516('0x29')][_0x2516('0x44')]({'where':{'id':_0x1c4be3[_0x2516('0x42')]['id']}})[_0x2516('0x22')](handleEntityNotFound(_0x1aa854,null))['then'](removeEntity(_0x1aa854,null))['catch'](handleError(_0x1aa854,null));};exports['describe']=function(_0x323590,_0x4f7eb4){return db['Cdr']['describe']()[_0x2516('0x22')](respondWithResult(_0x4f7eb4,null))[_0x2516('0x40')](handleError(_0x4f7eb4,null));};
\ No newline at end of file
+var _0xdd0c=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','then','includeAll','findAll','rows','catch','show','length','include','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x45f42e,_0x417bb){var _0x5704b6=function(_0x4d1621){while(--_0x4d1621){_0x45f42e['push'](_0x45f42e['shift']());}};_0x5704b6(++_0x417bb);}(_0xdd0c,0x165));var _0xcdd0=function(_0x4a3185,_0x44080f){_0x4a3185=_0x4a3185-0x0;var _0x300bd6=_0xdd0c[_0x4a3185];return _0x300bd6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdd0('0x0'));var zipdir=require(_0xcdd0('0x1'));var jsonpatch=require(_0xcdd0('0x2'));var rp=require('request-promise');var moment=require(_0xcdd0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcdd0('0x4'));var util=require(_0xcdd0('0x5'));var path=require(_0xcdd0('0x6'));var sox=require(_0xcdd0('0x7'));var csv=require(_0xcdd0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcdd0('0x9'));var _=require(_0xcdd0('0xa'));var squel=require(_0xcdd0('0xb'));var crypto=require(_0xcdd0('0xc'));var jsforce=require(_0xcdd0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcdd0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcdd0('0xe'));var authService=require(_0xcdd0('0xf'));var qs=require(_0xcdd0('0x10'));var as=require(_0xcdd0('0x11'));var hardwareService=require(_0xcdd0('0x12'));var logger=require(_0xcdd0('0x13'))(_0xcdd0('0x14'));var utils=require(_0xcdd0('0x15'));var config=require(_0xcdd0('0x16'));var licenseUtil=require(_0xcdd0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a1ff6,_0x356501){_0x356501=_0x356501||0xcc;return function(_0x14c775){if(_0x14c775){return _0x4a1ff6['sendStatus'](_0x356501);}return _0x4a1ff6[_0xcdd0('0x18')](_0x356501)[_0xcdd0('0x19')]();};}function respondWithResult(_0x4f4aa4,_0x1fc89a){_0x1fc89a=_0x1fc89a||0xc8;return function(_0x1d5bff){if(_0x1d5bff){return _0x4f4aa4[_0xcdd0('0x18')](_0x1fc89a)[_0xcdd0('0x1a')](_0x1d5bff);}};}function respondWithFilteredResult(_0xc1c3d5,_0x52aef5){return function(_0x5b5c06){if(_0x5b5c06){var _0x189f54=typeof _0x52aef5[_0xcdd0('0x1b')]===_0xcdd0('0x1c')&&typeof _0x52aef5[_0xcdd0('0x1d')]===_0xcdd0('0x1c');var _0x3b07a1=_0x5b5c06[_0xcdd0('0x1e')];var _0x2c199f=_0x189f54?0x0:_0x52aef5[_0xcdd0('0x1b')];var _0x14d55b=_0x189f54?_0x5b5c06['count']:_0x52aef5[_0xcdd0('0x1b')]+_0x52aef5[_0xcdd0('0x1d')];var _0x5060fa;if(_0x14d55b>=_0x3b07a1){_0x14d55b=_0x3b07a1;_0x5060fa=0xc8;}else{_0x5060fa=0xce;}_0xc1c3d5['status'](_0x5060fa);return _0xc1c3d5[_0xcdd0('0x1f')](_0xcdd0('0x20'),_0x2c199f+'-'+_0x14d55b+'/'+_0x3b07a1)['json'](_0x5b5c06);}return null;};}function patchUpdates(_0x12128e){return function(_0x4f7325){try{jsonpatch['apply'](_0x4f7325,_0x12128e,!![]);}catch(_0x4d038f){return BPromise[_0xcdd0('0x21')](_0x4d038f);}return _0x4f7325[_0xcdd0('0x22')]();};}function saveUpdates(_0x4afcfa,_0x2ab7e4){return function(_0x31a3e6){if(_0x31a3e6){return _0x31a3e6[_0xcdd0('0x23')](_0x4afcfa)['then'](function(_0x9d4727){return _0x9d4727;});}return null;};}function removeEntity(_0x7be0ac,_0x509e9c){return function(_0x3c81b1){if(_0x3c81b1){return _0x3c81b1[_0xcdd0('0x24')]()['then'](function(){_0x7be0ac[_0xcdd0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3797c2,_0x64b52){return function(_0x476018){if(!_0x476018){_0x3797c2['sendStatus'](0x194);}return _0x476018;};}function handleError(_0x22fd47,_0x10cba2){_0x10cba2=_0x10cba2||0x1f4;return function(_0x5e5cc){logger[_0xcdd0('0x25')](_0x5e5cc[_0xcdd0('0x26')]);if(_0x5e5cc[_0xcdd0('0x27')]){delete _0x5e5cc[_0xcdd0('0x27')];}_0x22fd47[_0xcdd0('0x18')](_0x10cba2)[_0xcdd0('0x28')](_0x5e5cc);};}exports[_0xcdd0('0x29')]=function(_0x4074e0,_0x49cfe0){var _0x28084c={},_0xd6d64f={},_0x1bbe37={'count':0x0,'rows':[]};var _0x5b8635=_[_0xcdd0('0x2a')](db[_0xcdd0('0x2b')][_0xcdd0('0x2c')],function(_0x477d1a){return{'name':_0x477d1a[_0xcdd0('0x2d')],'type':_0x477d1a['type'][_0xcdd0('0x2e')]};});_0xd6d64f[_0xcdd0('0x2f')]=_[_0xcdd0('0x2a')](_0x5b8635,'name');_0xd6d64f['query']=_[_0xcdd0('0x30')](_0x4074e0[_0xcdd0('0x31')]);_0xd6d64f[_0xcdd0('0x32')]=_['intersection'](_0xd6d64f[_0xcdd0('0x2f')],_0xd6d64f[_0xcdd0('0x31')]);_0x28084c['attributes']=_[_0xcdd0('0x33')](_0xd6d64f[_0xcdd0('0x2f')],qs[_0xcdd0('0x34')](_0x4074e0[_0xcdd0('0x31')]['fields']));_0x28084c[_0xcdd0('0x35')]=_0x28084c[_0xcdd0('0x35')]['length']?_0x28084c[_0xcdd0('0x35')]:_0xd6d64f[_0xcdd0('0x2f')];if(!_0x4074e0[_0xcdd0('0x31')][_0xcdd0('0x36')]('nolimit')){_0x28084c[_0xcdd0('0x1d')]=qs[_0xcdd0('0x1d')](_0x4074e0[_0xcdd0('0x31')][_0xcdd0('0x1d')]);_0x28084c[_0xcdd0('0x1b')]=qs['offset'](_0x4074e0[_0xcdd0('0x31')]['offset']);}_0x28084c['order']=qs['sort'](_0x4074e0[_0xcdd0('0x31')][_0xcdd0('0x37')]);_0x28084c[_0xcdd0('0x38')]=qs[_0xcdd0('0x32')](_[_0xcdd0('0x39')](_0x4074e0[_0xcdd0('0x31')],_0xd6d64f[_0xcdd0('0x32')]),_0x5b8635);if(_0x4074e0['query'][_0xcdd0('0x3a')]){_0x28084c[_0xcdd0('0x38')]=_[_0xcdd0('0x3b')](_0x28084c[_0xcdd0('0x38')],{'$or':_['map'](_0x5b8635,function(_0x4934a5){if(_0x4934a5[_0xcdd0('0x3c')]!==_0xcdd0('0x3d')){var _0x47a5f5={};_0x47a5f5[_0x4934a5[_0xcdd0('0x27')]]={'$like':'%'+_0x4074e0[_0xcdd0('0x31')]['filter']+'%'};return _0x47a5f5;}})});}_0x28084c=_[_0xcdd0('0x3b')]({},_0x28084c,_0x4074e0['options']);var _0x41ce22={'where':_0x28084c['where']};return db[_0xcdd0('0x2b')][_0xcdd0('0x1e')](_0x41ce22)[_0xcdd0('0x3e')](function(_0x271f47){_0x1bbe37['count']=_0x271f47;if(_0x4074e0[_0xcdd0('0x31')][_0xcdd0('0x3f')]){_0x28084c['include']=[{'all':!![]}];}return db[_0xcdd0('0x2b')][_0xcdd0('0x40')](_0x28084c);})[_0xcdd0('0x3e')](function(_0x27ce74){_0x1bbe37[_0xcdd0('0x41')]=_0x27ce74;return _0x1bbe37;})[_0xcdd0('0x3e')](respondWithFilteredResult(_0x49cfe0,_0x28084c))[_0xcdd0('0x42')](handleError(_0x49cfe0,null));};exports[_0xcdd0('0x43')]=function(_0x375e89,_0xce8a50){var _0x5f0c94={'raw':!![],'where':{'id':_0x375e89['params']['id']}},_0x2718b3={};_0x2718b3['model']=_[_0xcdd0('0x30')](db['Cdr'][_0xcdd0('0x2c')]);_0x2718b3[_0xcdd0('0x31')]=_[_0xcdd0('0x30')](_0x375e89[_0xcdd0('0x31')]);_0x2718b3[_0xcdd0('0x32')]=_['intersection'](_0x2718b3[_0xcdd0('0x2f')],_0x2718b3['query']);_0x5f0c94['attributes']=_[_0xcdd0('0x33')](_0x2718b3[_0xcdd0('0x2f')],qs['fields'](_0x375e89['query']['fields']));_0x5f0c94[_0xcdd0('0x35')]=_0x5f0c94[_0xcdd0('0x35')][_0xcdd0('0x44')]?_0x5f0c94['attributes']:_0x2718b3[_0xcdd0('0x2f')];if(_0x375e89[_0xcdd0('0x31')][_0xcdd0('0x3f')]){_0x5f0c94[_0xcdd0('0x45')]=[{'all':!![]}];}_0x5f0c94=_[_0xcdd0('0x3b')]({},_0x5f0c94,_0x375e89['options']);return db[_0xcdd0('0x2b')]['find'](_0x5f0c94)[_0xcdd0('0x3e')](handleEntityNotFound(_0xce8a50,null))[_0xcdd0('0x3e')](respondWithResult(_0xce8a50,null))[_0xcdd0('0x42')](handleError(_0xce8a50,null));};exports[_0xcdd0('0x46')]=function(_0x265cfb,_0x2fc567){return db[_0xcdd0('0x2b')][_0xcdd0('0x46')](_0x265cfb[_0xcdd0('0x47')],{})[_0xcdd0('0x3e')](respondWithResult(_0x2fc567,0xc9))[_0xcdd0('0x42')](handleError(_0x2fc567,null));};exports[_0xcdd0('0x23')]=function(_0x3afae8,_0x6c2cb8){if(_0x3afae8[_0xcdd0('0x47')]['id']){delete _0x3afae8['body']['id'];}return db[_0xcdd0('0x2b')][_0xcdd0('0x48')]({'where':{'id':_0x3afae8[_0xcdd0('0x49')]['id']}})[_0xcdd0('0x3e')](handleEntityNotFound(_0x6c2cb8,null))[_0xcdd0('0x3e')](saveUpdates(_0x3afae8[_0xcdd0('0x47')],null))[_0xcdd0('0x3e')](respondWithResult(_0x6c2cb8,null))[_0xcdd0('0x42')](handleError(_0x6c2cb8,null));};exports[_0xcdd0('0x24')]=function(_0x214cdd,_0x36156c){return db[_0xcdd0('0x2b')][_0xcdd0('0x48')]({'where':{'id':_0x214cdd[_0xcdd0('0x49')]['id']}})['then'](handleEntityNotFound(_0x36156c,null))[_0xcdd0('0x3e')](removeEntity(_0x36156c,null))[_0xcdd0('0x42')](handleError(_0x36156c,null));};exports[_0xcdd0('0x4a')]=function(_0xc7370e,_0x46c578){return db[_0xcdd0('0x2b')][_0xcdd0('0x4a')]()['then'](respondWithResult(_0x46c578,null))[_0xcdd0('0x42')](handleError(_0x46c578,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 78a5e3a..2d9464b 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5be375,_0x5ca360){var _0x308ae9=function(_0xf9f634){while(--_0xf9f634){_0x5be375['push'](_0x5be375['shift']());}};_0x308ae9(++_0x5ca360);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0xa6de94,_0x571d3e){var _0x5bc7ee=function(_0x21ad06){while(--_0x21ad06){_0xa6de94['push'](_0xa6de94['shift']());}};_0x5bc7ee(++_0x571d3e);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 a7db0f5..b60e0ce 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 _0xc2df=['Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x5041b2,_0x19b4f8){var _0x48c4c3=function(_0x55b330){while(--_0x55b330){_0x5041b2['push'](_0x5041b2['shift']());}};_0x48c4c3(++_0x19b4f8);}(_0xc2df,0x11b));var _0xfc2d=function(_0x42d3db,_0x183178){_0x42d3db=_0x42d3db-0x0;var _0x2a4835=_0xc2df[_0x42d3db];return _0x2a4835;};'use strict';var _=require(_0xfc2d('0x0'));var util=require(_0xfc2d('0x1'));var moment=require(_0xfc2d('0x2'));var BPromise=require('bluebird');var rs=require(_0xfc2d('0x3'));var fs=require('fs');var Redis=require(_0xfc2d('0x4'));var db=require(_0xfc2d('0x5'))['db'];var utils=require(_0xfc2d('0x6'));var logger=require(_0xfc2d('0x7'))(_0xfc2d('0x8'));var config=require(_0xfc2d('0x9'));var jayson=require(_0xfc2d('0xa'));var client=jayson[_0xfc2d('0xb')][_0xfc2d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e5c0d,_0x5ac684,_0x26bdcc){return new BPromise(function(_0x579342,_0x22b483){return client[_0xfc2d('0xd')](_0x1e5c0d,_0x26bdcc)[_0xfc2d('0xe')](function(_0x55df73){logger[_0xfc2d('0xf')]('Cdr,\x20%s,\x20%s',_0x5ac684,_0xfc2d('0x10'));logger['debug'](_0xfc2d('0x11'),_0x5ac684,_0xfc2d('0x10'),JSON[_0xfc2d('0x12')](_0x55df73));if(_0x55df73[_0xfc2d('0x13')]){if(_0x55df73[_0xfc2d('0x13')][_0xfc2d('0x14')]===0x1f4){logger['error'](_0xfc2d('0x15'),_0x5ac684,_0x55df73[_0xfc2d('0x13')][_0xfc2d('0x16')]);return _0x22b483(_0x55df73[_0xfc2d('0x13')][_0xfc2d('0x16')]);}logger[_0xfc2d('0x13')](_0xfc2d('0x15'),_0x5ac684,_0x55df73[_0xfc2d('0x13')][_0xfc2d('0x16')]);return _0x579342(_0x55df73['error'][_0xfc2d('0x16')]);}else{logger[_0xfc2d('0xf')](_0xfc2d('0x15'),_0x5ac684,'request\x20sent');_0x579342(_0x55df73[_0xfc2d('0x17')][_0xfc2d('0x16')]);}})[_0xfc2d('0x18')](function(_0x3806f2){logger[_0xfc2d('0x13')](_0xfc2d('0x15'),_0x5ac684,_0x3806f2);_0x22b483(_0x3806f2);});});}
\ No newline at end of file
+var _0x0c3f=['debug','error','message','info','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','Cdr,\x20%s,\x20%s','request\x20sent'];(function(_0x20b53d,_0x49b4fe){var _0x1b7bcb=function(_0x44e674){while(--_0x44e674){_0x20b53d['push'](_0x20b53d['shift']());}};_0x1b7bcb(++_0x49b4fe);}(_0x0c3f,0x1a2));var _0xf0c3=function(_0x57afdd,_0x47b14e){_0x57afdd=_0x57afdd-0x0;var _0x166f98=_0x0c3f[_0x57afdd];return _0x166f98;};'use strict';var _=require(_0xf0c3('0x0'));var util=require(_0xf0c3('0x1'));var moment=require(_0xf0c3('0x2'));var BPromise=require(_0xf0c3('0x3'));var rs=require(_0xf0c3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf0c3('0x5'));var logger=require(_0xf0c3('0x6'))('rpc');var config=require(_0xf0c3('0x7'));var jayson=require(_0xf0c3('0x8'));var client=jayson[_0xf0c3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c0d0c,_0x4190c5,_0x5ad3c4){return new BPromise(function(_0x558e5c,_0x6b7a79){return client[_0xf0c3('0xa')](_0x3c0d0c,_0x5ad3c4)[_0xf0c3('0xb')](function(_0x590dc1){logger['info'](_0xf0c3('0xc'),_0x4190c5,_0xf0c3('0xd'));logger[_0xf0c3('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x4190c5,_0xf0c3('0xd'),JSON['stringify'](_0x590dc1));if(_0x590dc1[_0xf0c3('0xf')]){if(_0x590dc1[_0xf0c3('0xf')]['code']===0x1f4){logger['error'](_0xf0c3('0xc'),_0x4190c5,_0x590dc1[_0xf0c3('0xf')][_0xf0c3('0x10')]);return _0x6b7a79(_0x590dc1[_0xf0c3('0xf')][_0xf0c3('0x10')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x4190c5,_0x590dc1[_0xf0c3('0xf')][_0xf0c3('0x10')]);return _0x558e5c(_0x590dc1[_0xf0c3('0xf')][_0xf0c3('0x10')]);}else{logger[_0xf0c3('0x11')]('Cdr,\x20%s,\x20%s',_0x4190c5,_0xf0c3('0xd'));_0x558e5c(_0x590dc1['result'][_0xf0c3('0x10')]);}})['catch'](function(_0x4a9bf1){logger['error'](_0xf0c3('0xc'),_0x4190c5,_0x4a9bf1);_0x6b7a79(_0x4a9bf1);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 5e1e565..fe47a65 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x48eecb,_0x4cc6cd){var _0x21caa9=function(_0x529e7c){while(--_0x529e7c){_0x48eecb['push'](_0x48eecb['shift']());}};_0x21caa9(++_0x4cc6cd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2ccf59,_0x196b84){var _0x3c4cb2=function(_0x22d8d7){while(--_0x22d8d7){_0x2ccf59['push'](_0x2ccf59['shift']());}};_0x3c4cb2(++_0x196b84);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 7c7a731..618cd01 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 _0xa890=['*,*,*,*','sequelize','noop','TEXT','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa890,0x1c8));var _0x0a89=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xa890[_0x53abe5];return _0xc1c37e;};'use strict';var Sequelize=require(_0x0a89('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a89('0x1')},'appdata':{'type':Sequelize[_0x0a89('0x2')]()},'description':{'type':Sequelize[_0x0a89('0x3')]},'interval':{'type':Sequelize[_0x0a89('0x3')],'defaultValue':_0x0a89('0x4')}};
\ No newline at end of file
+var _0x0e4d=['INTEGER','noop','TEXT','STRING','exports'];(function(_0x817cd3,_0x1677ff){var _0x54bc18=function(_0x4ef823){while(--_0x4ef823){_0x817cd3['push'](_0x817cd3['shift']());}};_0x54bc18(++_0x1677ff);}(_0x0e4d,0x13a));var _0xd0e4=function(_0x1a1a8a,_0x124ba2){_0x1a1a8a=_0x1a1a8a-0x0;var _0x2cdc17=_0x0e4d[_0x1a1a8a];return _0x2cdc17;};'use strict';var Sequelize=require('sequelize');module[_0xd0e4('0x0')]={'priority':{'type':Sequelize[_0xd0e4('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd0e4('0x2')},'appdata':{'type':Sequelize[_0xd0e4('0x3')]()},'description':{'type':Sequelize[_0xd0e4('0x4')]},'interval':{'type':Sequelize[_0xd0e4('0x4')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index ffd44d2..067a842 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 _0x5f6a=['show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','find','update','body','catch','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','sendStatus','name','send'];(function(_0x494554,_0x3ee8c6){var _0x285e8d=function(_0x73ea91){while(--_0x73ea91){_0x494554['push'](_0x494554['shift']());}};_0x285e8d(++_0x3ee8c6);}(_0x5f6a,0xc4));var _0xa5f6=function(_0x12e831,_0x19cdd1){_0x12e831=_0x12e831-0x0;var _0x451385=_0x5f6a[_0x12e831];return _0x451385;};'use strict';var emlformat=require(_0xa5f6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa5f6('0x1'));var rp=require(_0xa5f6('0x2'));var moment=require(_0xa5f6('0x3'));var BPromise=require(_0xa5f6('0x4'));var Mustache=require('mustache');var util=require(_0xa5f6('0x5'));var path=require(_0xa5f6('0x6'));var sox=require(_0xa5f6('0x7'));var csv=require(_0xa5f6('0x8'));var ejs=require(_0xa5f6('0x9'));var fs=require('fs');var fs_extra=require(_0xa5f6('0xa'));var _=require(_0xa5f6('0xb'));var squel=require(_0xa5f6('0xc'));var crypto=require(_0xa5f6('0xd'));var jsforce=require(_0xa5f6('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa5f6('0xf'));var Redis=require(_0xa5f6('0x10'));var authService=require(_0xa5f6('0x11'));var qs=require(_0xa5f6('0x12'));var as=require(_0xa5f6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5f6('0x14'))(_0xa5f6('0x15'));var utils=require('../../config/utils');var config=require(_0xa5f6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa5f6('0x17'))['db'];function respondWithStatusCode(_0x483f66,_0x13c988){_0x13c988=_0x13c988||0xcc;return function(_0xc8eb34){if(_0xc8eb34){return _0x483f66['sendStatus'](_0x13c988);}return _0x483f66[_0xa5f6('0x18')](_0x13c988)[_0xa5f6('0x19')]();};}function respondWithResult(_0x2919fd,_0xd8faf3){_0xd8faf3=_0xd8faf3||0xc8;return function(_0x5c507e){if(_0x5c507e){return _0x2919fd[_0xa5f6('0x18')](_0xd8faf3)[_0xa5f6('0x1a')](_0x5c507e);}};}function respondWithFilteredResult(_0x17f7f7,_0x5dc17b){return function(_0x3b4780){if(_0x3b4780){var _0x3b2b23=typeof _0x5dc17b[_0xa5f6('0x1b')]===_0xa5f6('0x1c')&&typeof _0x5dc17b[_0xa5f6('0x1d')]==='undefined';var _0x2cc215=_0x3b4780[_0xa5f6('0x1e')];var _0x4ee2cc=_0x3b2b23?0x0:_0x5dc17b[_0xa5f6('0x1b')];var _0x20f35d=_0x3b2b23?_0x3b4780[_0xa5f6('0x1e')]:_0x5dc17b['offset']+_0x5dc17b['limit'];var _0x57a416;if(_0x20f35d>=_0x2cc215){_0x20f35d=_0x2cc215;_0x57a416=0xc8;}else{_0x57a416=0xce;}_0x17f7f7[_0xa5f6('0x18')](_0x57a416);return _0x17f7f7['set'](_0xa5f6('0x1f'),_0x4ee2cc+'-'+_0x20f35d+'/'+_0x2cc215)[_0xa5f6('0x1a')](_0x3b4780);}return null;};}function patchUpdates(_0x29f8fb){return function(_0x5b2a48){try{jsonpatch[_0xa5f6('0x20')](_0x5b2a48,_0x29f8fb,!![]);}catch(_0x55f457){return BPromise[_0xa5f6('0x21')](_0x55f457);}return _0x5b2a48[_0xa5f6('0x22')]();};}function saveUpdates(_0x30caba,_0x471628){return function(_0x37ff20){if(_0x37ff20){return _0x37ff20['update'](_0x30caba)['then'](function(_0x41b66b){return _0x41b66b;});}return null;};}function removeEntity(_0x49e609,_0x4441cc){return function(_0x50e9ba){if(_0x50e9ba){return _0x50e9ba[_0xa5f6('0x23')]()[_0xa5f6('0x24')](function(){_0x49e609[_0xa5f6('0x18')](0xcc)[_0xa5f6('0x19')]();});}};}function handleEntityNotFound(_0x3ef9fb,_0x220992){return function(_0x7613c4){if(!_0x7613c4){_0x3ef9fb[_0xa5f6('0x25')](0x194);}return _0x7613c4;};}function handleError(_0x1c08d3,_0x1ded63){_0x1ded63=_0x1ded63||0x1f4;return function(_0x1e02d9){logger['error'](_0x1e02d9['stack']);if(_0x1e02d9[_0xa5f6('0x26')]){delete _0x1e02d9[_0xa5f6('0x26')];}_0x1c08d3[_0xa5f6('0x18')](_0x1ded63)[_0xa5f6('0x27')](_0x1e02d9);};}exports[_0xa5f6('0x28')]=function(_0x8cab41,_0x5ac06e){var _0x273192={'raw':!![],'where':{'id':_0x8cab41[_0xa5f6('0x29')]['id']}},_0x43fe1d={};_0x43fe1d[_0xa5f6('0x2a')]=_[_0xa5f6('0x2b')](db[_0xa5f6('0x2c')][_0xa5f6('0x2d')]);_0x43fe1d[_0xa5f6('0x2e')]=_['keys'](_0x8cab41[_0xa5f6('0x2e')]);_0x43fe1d[_0xa5f6('0x2f')]=_[_0xa5f6('0x30')](_0x43fe1d[_0xa5f6('0x2a')],_0x43fe1d[_0xa5f6('0x2e')]);_0x273192['attributes']=_[_0xa5f6('0x30')](_0x43fe1d[_0xa5f6('0x2a')],qs[_0xa5f6('0x31')](_0x8cab41['query'][_0xa5f6('0x31')]));_0x273192[_0xa5f6('0x32')]=_0x273192[_0xa5f6('0x32')][_0xa5f6('0x33')]?_0x273192[_0xa5f6('0x32')]:_0x43fe1d['model'];if(_0x8cab41[_0xa5f6('0x2e')][_0xa5f6('0x34')]){_0x273192[_0xa5f6('0x35')]=[{'all':!![]}];}_0x273192=_[_0xa5f6('0x36')]({},_0x273192,_0x8cab41['options']);return db[_0xa5f6('0x2c')][_0xa5f6('0x37')](_0x273192)[_0xa5f6('0x24')](handleEntityNotFound(_0x5ac06e,null))[_0xa5f6('0x24')](respondWithResult(_0x5ac06e,null))['catch'](handleError(_0x5ac06e,null));};exports[_0xa5f6('0x38')]=function(_0x42bba2,_0x3ff708){if(_0x42bba2[_0xa5f6('0x39')]['id']){delete _0x42bba2[_0xa5f6('0x39')]['id'];}return db[_0xa5f6('0x2c')]['find']({'where':{'id':_0x42bba2[_0xa5f6('0x29')]['id']}})['then'](handleEntityNotFound(_0x3ff708,null))[_0xa5f6('0x24')](saveUpdates(_0x42bba2['body'],null))['then'](respondWithResult(_0x3ff708,null))[_0xa5f6('0x3a')](handleError(_0x3ff708,null));};exports['destroy']=function(_0x115a73,_0x357dee){return db['ChatApplication'][_0xa5f6('0x37')]({'where':{'id':_0x115a73['params']['id']}})['then'](handleEntityNotFound(_0x357dee,null))['then'](removeEntity(_0x357dee,null))[_0xa5f6('0x3a')](handleError(_0x357dee,null));};
\ No newline at end of file
+var _0xb627=['../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','json','apply','save','then','error','stack','name','send','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','options','find','catch','body','destroy','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4f9585,_0x45af7a){var _0xdd5908=function(_0x235256){while(--_0x235256){_0x4f9585['push'](_0x4f9585['shift']());}};_0xdd5908(++_0x45af7a);}(_0xb627,0x144));var _0x7b62=function(_0x3c6e06,_0x59be65){_0x3c6e06=_0x3c6e06-0x0;var _0x4f6ffc=_0xb627[_0x3c6e06];return _0x4f6ffc;};'use strict';var emlformat=require(_0x7b62('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7b62('0x1'));var rp=require('request-promise');var moment=require(_0x7b62('0x2'));var BPromise=require(_0x7b62('0x3'));var Mustache=require(_0x7b62('0x4'));var util=require(_0x7b62('0x5'));var path=require(_0x7b62('0x6'));var sox=require(_0x7b62('0x7'));var csv=require(_0x7b62('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b62('0x9'));var _=require('lodash');var squel=require(_0x7b62('0xa'));var crypto=require(_0x7b62('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b62('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7b62('0xd'));var Papa=require(_0x7b62('0xe'));var Redis=require(_0x7b62('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7b62('0x10'));var as=require(_0x7b62('0x11'));var hardwareService=require(_0x7b62('0x12'));var logger=require(_0x7b62('0x13'))(_0x7b62('0x14'));var utils=require(_0x7b62('0x15'));var config=require(_0x7b62('0x16'));var licenseUtil=require(_0x7b62('0x17'));var db=require(_0x7b62('0x18'))['db'];function respondWithStatusCode(_0x243110,_0x2559c2){_0x2559c2=_0x2559c2||0xcc;return function(_0x2faaed){if(_0x2faaed){return _0x243110[_0x7b62('0x19')](_0x2559c2);}return _0x243110['status'](_0x2559c2)[_0x7b62('0x1a')]();};}function respondWithResult(_0x4e9b07,_0xf53c12){_0xf53c12=_0xf53c12||0xc8;return function(_0x509d9f){if(_0x509d9f){return _0x4e9b07[_0x7b62('0x1b')](_0xf53c12)['json'](_0x509d9f);}};}function respondWithFilteredResult(_0x51c48a,_0x38fed5){return function(_0x4a0cdc){if(_0x4a0cdc){var _0x3f9afa=typeof _0x38fed5[_0x7b62('0x1c')]===_0x7b62('0x1d')&&typeof _0x38fed5['limit']===_0x7b62('0x1d');var _0x54cf81=_0x4a0cdc[_0x7b62('0x1e')];var _0x207f32=_0x3f9afa?0x0:_0x38fed5['offset'];var _0x10c323=_0x3f9afa?_0x4a0cdc['count']:_0x38fed5[_0x7b62('0x1c')]+_0x38fed5[_0x7b62('0x1f')];var _0x3cfbed;if(_0x10c323>=_0x54cf81){_0x10c323=_0x54cf81;_0x3cfbed=0xc8;}else{_0x3cfbed=0xce;}_0x51c48a[_0x7b62('0x1b')](_0x3cfbed);return _0x51c48a[_0x7b62('0x20')]('Content-Range',_0x207f32+'-'+_0x10c323+'/'+_0x54cf81)[_0x7b62('0x21')](_0x4a0cdc);}return null;};}function patchUpdates(_0x229819){return function(_0x429cbb){try{jsonpatch[_0x7b62('0x22')](_0x429cbb,_0x229819,!![]);}catch(_0x5990fd){return BPromise['reject'](_0x5990fd);}return _0x429cbb[_0x7b62('0x23')]();};}function saveUpdates(_0x2b0a21,_0x136b61){return function(_0x4c9c51){if(_0x4c9c51){return _0x4c9c51['update'](_0x2b0a21)[_0x7b62('0x24')](function(_0x1e76e0){return _0x1e76e0;});}return null;};}function removeEntity(_0x185457,_0x499f95){return function(_0x498677){if(_0x498677){return _0x498677['destroy']()[_0x7b62('0x24')](function(){_0x185457[_0x7b62('0x1b')](0xcc)[_0x7b62('0x1a')]();});}};}function handleEntityNotFound(_0x3dbee8,_0x590089){return function(_0x5144d1){if(!_0x5144d1){_0x3dbee8[_0x7b62('0x19')](0x194);}return _0x5144d1;};}function handleError(_0x9ac74f,_0x4dea41){_0x4dea41=_0x4dea41||0x1f4;return function(_0x490d68){logger[_0x7b62('0x25')](_0x490d68[_0x7b62('0x26')]);if(_0x490d68[_0x7b62('0x27')]){delete _0x490d68[_0x7b62('0x27')];}_0x9ac74f[_0x7b62('0x1b')](_0x4dea41)[_0x7b62('0x28')](_0x490d68);};}exports['show']=function(_0x1d009d,_0x1428c4){var _0x5a20fb={'raw':!![],'where':{'id':_0x1d009d[_0x7b62('0x29')]['id']}},_0x2b4981={};_0x2b4981['model']=_[_0x7b62('0x2a')](db[_0x7b62('0x2b')][_0x7b62('0x2c')]);_0x2b4981['query']=_[_0x7b62('0x2a')](_0x1d009d[_0x7b62('0x2d')]);_0x2b4981[_0x7b62('0x2e')]=_[_0x7b62('0x2f')](_0x2b4981[_0x7b62('0x30')],_0x2b4981[_0x7b62('0x2d')]);_0x5a20fb[_0x7b62('0x31')]=_[_0x7b62('0x2f')](_0x2b4981[_0x7b62('0x30')],qs[_0x7b62('0x32')](_0x1d009d[_0x7b62('0x2d')][_0x7b62('0x32')]));_0x5a20fb[_0x7b62('0x31')]=_0x5a20fb['attributes'][_0x7b62('0x33')]?_0x5a20fb[_0x7b62('0x31')]:_0x2b4981[_0x7b62('0x30')];if(_0x1d009d[_0x7b62('0x2d')][_0x7b62('0x34')]){_0x5a20fb['include']=[{'all':!![]}];}_0x5a20fb=_['merge']({},_0x5a20fb,_0x1d009d[_0x7b62('0x35')]);return db[_0x7b62('0x2b')][_0x7b62('0x36')](_0x5a20fb)['then'](handleEntityNotFound(_0x1428c4,null))[_0x7b62('0x24')](respondWithResult(_0x1428c4,null))[_0x7b62('0x37')](handleError(_0x1428c4,null));};exports['update']=function(_0x17f6b0,_0x312dfa){if(_0x17f6b0[_0x7b62('0x38')]['id']){delete _0x17f6b0['body']['id'];}return db[_0x7b62('0x2b')][_0x7b62('0x36')]({'where':{'id':_0x17f6b0['params']['id']}})[_0x7b62('0x24')](handleEntityNotFound(_0x312dfa,null))[_0x7b62('0x24')](saveUpdates(_0x17f6b0[_0x7b62('0x38')],null))['then'](respondWithResult(_0x312dfa,null))[_0x7b62('0x37')](handleError(_0x312dfa,null));};exports[_0x7b62('0x39')]=function(_0x45bf81,_0xc7d59f){return db[_0x7b62('0x2b')][_0x7b62('0x36')]({'where':{'id':_0x45bf81[_0x7b62('0x29')]['id']}})[_0x7b62('0x24')](handleEntityNotFound(_0xc7d59f,null))[_0x7b62('0x24')](removeEntity(_0xc7d59f,null))[_0x7b62('0x37')](handleError(_0xc7d59f,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index d197227..4e0968c 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 _0xe6b0=['request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd161,_0x4ddb4f){var _0x1a32f=function(_0x3a3596){while(--_0x3a3596){_0x3dd161['push'](_0x3dd161['shift']());}};_0x1a32f(++_0x4ddb4f);}(_0xe6b0,0x15a));var _0x0e6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe6b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0e6b('0x0'));var util=require(_0x0e6b('0x1'));var logger=require(_0x0e6b('0x2'))(_0x0e6b('0x3'));var moment=require(_0x0e6b('0x4'));var BPromise=require(_0x0e6b('0x5'));var rp=require(_0x0e6b('0x6'));var fs=require('fs');var path=require(_0x0e6b('0x7'));var rimraf=require(_0x0e6b('0x8'));var config=require(_0x0e6b('0x9'));var attributes=require('./chatApplication.attributes');module[_0x0e6b('0xa')]=function(_0x5618da,_0x78f8a0){return _0x5618da[_0x0e6b('0xb')](_0x0e6b('0xc'),attributes,{'tableName':_0x0e6b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0e6b('0xe'),'collate':_0x0e6b('0xf')});};
\ No newline at end of file
+var _0x7c5d=['../../config/environment','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x3fb166,_0x4eb985){var _0x5e91be=function(_0x53f4d9){while(--_0x53f4d9){_0x3fb166['push'](_0x3fb166['shift']());}};_0x5e91be(++_0x4eb985);}(_0x7c5d,0x1aa));var _0xd7c5=function(_0x122dce,_0x20bb1e){_0x122dce=_0x122dce-0x0;var _0x706f85=_0x7c5d[_0x122dce];return _0x706f85;};'use strict';var _=require(_0xd7c5('0x0'));var util=require('util');var logger=require(_0xd7c5('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd7c5('0x2'));var rp=require(_0xd7c5('0x3'));var fs=require('fs');var path=require(_0xd7c5('0x4'));var rimraf=require(_0xd7c5('0x5'));var config=require(_0xd7c5('0x6'));var attributes=require('./chatApplication.attributes');module[_0xd7c5('0x7')]=function(_0x27b31b,_0x2bbadb){return _0x27b31b[_0xd7c5('0x8')]('ChatApplication',attributes,{'tableName':_0xd7c5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd7c5('0xa'),'collate':_0xd7c5('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 09849d3..ce4495c 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 _0x1e47=['util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x1bd1a7,_0x5025c4){var _0x33a9cc=function(_0x1c5a80){while(--_0x1c5a80){_0x1bd1a7['push'](_0x1bd1a7['shift']());}};_0x33a9cc(++_0x5025c4);}(_0x1e47,0x126));var _0x71e4=function(_0xdd3215,_0xf7dacc){_0xdd3215=_0xdd3215-0x0;var _0x475da7=_0x1e47[_0xdd3215];return _0x475da7;};'use strict';var _=require('lodash');var util=require(_0x71e4('0x0'));var moment=require('moment');var BPromise=require(_0x71e4('0x1'));var rs=require(_0x71e4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x71e4('0x3'));var logger=require(_0x71e4('0x4'))(_0x71e4('0x5'));var config=require(_0x71e4('0x6'));var jayson=require(_0x71e4('0x7'));var client=jayson[_0x71e4('0x8')][_0x71e4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27c3f8,_0x168dba,_0x4866d6){return new BPromise(function(_0x278c74,_0x1519fe){return client['request'](_0x27c3f8,_0x4866d6)[_0x71e4('0xa')](function(_0xe67ff4){logger[_0x71e4('0xb')](_0x71e4('0xc'),_0x168dba,'request\x20sent');logger[_0x71e4('0xd')](_0x71e4('0xe'),_0x168dba,_0x71e4('0xf'),JSON['stringify'](_0xe67ff4));if(_0xe67ff4[_0x71e4('0x10')]){if(_0xe67ff4['error'][_0x71e4('0x11')]===0x1f4){logger['error'](_0x71e4('0xc'),_0x168dba,_0xe67ff4['error'][_0x71e4('0x12')]);return _0x1519fe(_0xe67ff4['error'][_0x71e4('0x12')]);}logger[_0x71e4('0x10')]('ChatApplication,\x20%s,\x20%s',_0x168dba,_0xe67ff4['error'][_0x71e4('0x12')]);return _0x278c74(_0xe67ff4['error'][_0x71e4('0x12')]);}else{logger[_0x71e4('0xb')]('ChatApplication,\x20%s,\x20%s',_0x168dba,'request\x20sent');_0x278c74(_0xe67ff4[_0x71e4('0x13')][_0x71e4('0x12')]);}})[_0x71e4('0x14')](function(_0x2e6f1d){logger['error']('ChatApplication,\x20%s,\x20%s',_0x168dba,_0x2e6f1d);_0x1519fe(_0x2e6f1d);});});}
\ No newline at end of file
+var _0xd58c=['stringify','error','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','then','info','ChatApplication,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd58c,0x114));var _0xcd58=function(_0xe27a7b,_0x40d243){_0xe27a7b=_0xe27a7b-0x0;var _0x4f6b7a=_0xd58c[_0xe27a7b];return _0x4f6b7a;};'use strict';var _=require(_0xcd58('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcd58('0x1'));var rs=require(_0xcd58('0x2'));var fs=require('fs');var Redis=require(_0xcd58('0x3'));var db=require(_0xcd58('0x4'))['db'];var utils=require(_0xcd58('0x5'));var logger=require(_0xcd58('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcd58('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x136904,_0x37ef21,_0x34bad5){return new BPromise(function(_0xc2c24,_0x2f4c8e){return client['request'](_0x136904,_0x34bad5)[_0xcd58('0x8')](function(_0x5cb42a){logger[_0xcd58('0x9')](_0xcd58('0xa'),_0x37ef21,'request\x20sent');logger[_0xcd58('0xb')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x37ef21,_0xcd58('0xc'),JSON[_0xcd58('0xd')](_0x5cb42a));if(_0x5cb42a[_0xcd58('0xe')]){if(_0x5cb42a[_0xcd58('0xe')]['code']===0x1f4){logger['error'](_0xcd58('0xa'),_0x37ef21,_0x5cb42a[_0xcd58('0xe')][_0xcd58('0xf')]);return _0x2f4c8e(_0x5cb42a['error'][_0xcd58('0xf')]);}logger[_0xcd58('0xe')](_0xcd58('0xa'),_0x37ef21,_0x5cb42a['error'][_0xcd58('0xf')]);return _0xc2c24(_0x5cb42a[_0xcd58('0xe')][_0xcd58('0xf')]);}else{logger[_0xcd58('0x9')](_0xcd58('0xa'),_0x37ef21,'request\x20sent');_0xc2c24(_0x5cb42a['result'][_0xcd58('0xf')]);}})[_0xcd58('0x10')](function(_0x23cf84){logger['error'](_0xcd58('0xa'),_0x37ef21,_0x23cf84);_0x2f4c8e(_0x23cf84);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 1d99a61..40da6b5 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 _0x4a25=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','put','update','destroy','exports','multer'];(function(_0x446eb9,_0x47a77e){var _0x38e599=function(_0x3d5353){while(--_0x3d5353){_0x446eb9['push'](_0x446eb9['shift']());}};_0x38e599(++_0x47a77e);}(_0x4a25,0xe0));var _0x54a2=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x4a25[_0x346737];return _0x1ade2e;};'use strict';var multer=require(_0x54a2('0x0'));var util=require(_0x54a2('0x1'));var path=require('path');var timeout=require(_0x54a2('0x2'));var express=require(_0x54a2('0x3'));var router=express[_0x54a2('0x4')]();var fs_extra=require(_0x54a2('0x5'));var auth=require(_0x54a2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x54a2('0x7'));var controller=require('./chatApplication.controller');router[_0x54a2('0x8')](_0x54a2('0x9'),auth[_0x54a2('0xa')](),controller['show']);router[_0x54a2('0xb')](_0x54a2('0x9'),auth[_0x54a2('0xa')](),controller[_0x54a2('0xc')]);router['delete'](_0x54a2('0x9'),auth[_0x54a2('0xa')](),controller[_0x54a2('0xd')]);module[_0x54a2('0xe')]=router;
\ No newline at end of file
+var _0xf997=['../../config/environment','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf997,0x117));var _0x7f99=function(_0x330001,_0x1b04bf){_0x330001=_0x330001-0x0;var _0x2b71d4=_0xf997[_0x330001];return _0x2b71d4;};'use strict';var multer=require(_0x7f99('0x0'));var util=require(_0x7f99('0x1'));var path=require(_0x7f99('0x2'));var timeout=require(_0x7f99('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7f99('0x4'));var interaction=require(_0x7f99('0x5'));var config=require(_0x7f99('0x6'));var controller=require('./chatApplication.controller');router[_0x7f99('0x7')](_0x7f99('0x8'),auth[_0x7f99('0x9')](),controller[_0x7f99('0xa')]);router[_0x7f99('0xb')](_0x7f99('0x8'),auth[_0x7f99('0x9')](),controller[_0x7f99('0xc')]);router['delete'](_0x7f99('0x8'),auth[_0x7f99('0x9')](),controller[_0x7f99('0xd')]);module[_0x7f99('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 64f5a8f..618316f 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 _0xef27=['sequelize','exports','STRING'];(function(_0x2dc8f5,_0x29b1bd){var _0x20f3ed=function(_0x3bf1e3){while(--_0x3bf1e3){_0x2dc8f5['push'](_0x2dc8f5['shift']());}};_0x20f3ed(++_0x29b1bd);}(_0xef27,0x1c2));var _0x7ef2=function(_0x3e224b,_0x4c3a28){_0x3e224b=_0x3e224b-0x0;var _0x450c1b=_0xef27[_0x3e224b];return _0x450c1b;};'use strict';var Sequelize=require(_0x7ef2('0x0'));module[_0x7ef2('0x1')]={'name':{'type':Sequelize[_0x7ef2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7ef2('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x6334=['exports','STRING','BOOLEAN'];(function(_0x4ae880,_0x391adf){var _0x549a8b=function(_0x558dcd){while(--_0x558dcd){_0x4ae880['push'](_0x4ae880['shift']());}};_0x549a8b(++_0x391adf);}(_0x6334,0x168));var _0x4633=function(_0x2a8860,_0x2da926){_0x2a8860=_0x2a8860-0x0;var _0x2f47a4=_0x6334[_0x2a8860];return _0x2f47a4;};'use strict';var Sequelize=require('sequelize');module[_0x4633('0x0')]={'name':{'type':Sequelize[_0x4633('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4633('0x1')]},'write':{'type':Sequelize[_0x4633('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 4b736ef..46ca1fc 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 _0xcfe4=['rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','merge','options','count','include','findAll','rows','show','catch','body','find','params','describe','getUnread','user','addMembers','ids','omit','getMembers','findOne','User','filter','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','limit','undefined','offset','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','send','map','ChatGroup'];(function(_0x3f0bf7,_0xc0a7d){var _0x33c757=function(_0x3b2fc5){while(--_0x3b2fc5){_0x3f0bf7['push'](_0x3f0bf7['shift']());}};_0x33c757(++_0xc0a7d);}(_0xcfe4,0x96));var _0x4cfe=function(_0x35518f,_0x1383c4){_0x35518f=_0x35518f-0x0;var _0x17ca62=_0xcfe4[_0x35518f];return _0x17ca62;};'use strict';var emlformat=require(_0x4cfe('0x0'));var rimraf=require(_0x4cfe('0x1'));var zipdir=require(_0x4cfe('0x2'));var jsonpatch=require(_0x4cfe('0x3'));var rp=require(_0x4cfe('0x4'));var moment=require(_0x4cfe('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4cfe('0x6'));var util=require('util');var path=require(_0x4cfe('0x7'));var sox=require(_0x4cfe('0x8'));var csv=require('to-csv');var ejs=require(_0x4cfe('0x9'));var fs=require('fs');var fs_extra=require(_0x4cfe('0xa'));var _=require(_0x4cfe('0xb'));var squel=require(_0x4cfe('0xc'));var crypto=require(_0x4cfe('0xd'));var jsforce=require(_0x4cfe('0xe'));var deskjs=require(_0x4cfe('0xf'));var toCsv=require(_0x4cfe('0x10'));var querystring=require(_0x4cfe('0x11'));var Papa=require(_0x4cfe('0x12'));var Redis=require('ioredis');var authService=require(_0x4cfe('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4cfe('0x14'));var hardwareService=require(_0x4cfe('0x15'));var logger=require(_0x4cfe('0x16'))(_0x4cfe('0x17'));var utils=require(_0x4cfe('0x18'));var config=require(_0x4cfe('0x19'));var licenseUtil=require(_0x4cfe('0x1a'));var db=require(_0x4cfe('0x1b'))['db'];config[_0x4cfe('0x1c')]=_[_0x4cfe('0x1d')](config[_0x4cfe('0x1c')],{'host':_0x4cfe('0x1e'),'port':0x18eb});var socket=require(_0x4cfe('0x1f'))(new Redis(config[_0x4cfe('0x1c')]));require(_0x4cfe('0x20'))[_0x4cfe('0x21')](socket);function respondWithStatusCode(_0x1be8b2,_0x226d21){_0x226d21=_0x226d21||0xcc;return function(_0x114351){if(_0x114351){return _0x1be8b2[_0x4cfe('0x22')](_0x226d21);}return _0x1be8b2[_0x4cfe('0x23')](_0x226d21)['end']();};}function respondWithResult(_0x47ae3a,_0x5b63df){_0x5b63df=_0x5b63df||0xc8;return function(_0x1f1e5e){if(_0x1f1e5e){return _0x47ae3a[_0x4cfe('0x23')](_0x5b63df)[_0x4cfe('0x24')](_0x1f1e5e);}};}function respondWithFilteredResult(_0x40a4bc,_0x4be533){return function(_0x341bba){if(_0x341bba){var _0x4b2dfe=typeof _0x4be533['offset']==='undefined'&&typeof _0x4be533[_0x4cfe('0x25')]===_0x4cfe('0x26');var _0x3e4639=_0x341bba['count'];var _0x10786f=_0x4b2dfe?0x0:_0x4be533[_0x4cfe('0x27')];var _0x2640a6=_0x4b2dfe?_0x341bba['count']:_0x4be533['offset']+_0x4be533[_0x4cfe('0x25')];var _0x306565;if(_0x2640a6>=_0x3e4639){_0x2640a6=_0x3e4639;_0x306565=0xc8;}else{_0x306565=0xce;}_0x40a4bc[_0x4cfe('0x23')](_0x306565);return _0x40a4bc[_0x4cfe('0x28')](_0x4cfe('0x29'),_0x10786f+'-'+_0x2640a6+'/'+_0x3e4639)[_0x4cfe('0x24')](_0x341bba);}return null;};}function patchUpdates(_0x433dd2){return function(_0x4ffd00){try{jsonpatch['apply'](_0x4ffd00,_0x433dd2,!![]);}catch(_0x2def51){return BPromise[_0x4cfe('0x2a')](_0x2def51);}return _0x4ffd00[_0x4cfe('0x2b')]();};}function saveUpdates(_0x186134,_0x2c6aa8){return function(_0x333a65){if(_0x333a65){return _0x333a65[_0x4cfe('0x2c')](_0x186134)['then'](function(_0x104f16){return _0x104f16;});}return null;};}function removeEntity(_0x3c15fe,_0x1166dc){return function(_0x28796e){if(_0x28796e){return _0x28796e[_0x4cfe('0x2d')]()[_0x4cfe('0x2e')](function(){_0x3c15fe['status'](0xcc)[_0x4cfe('0x2f')]();});}};}function handleEntityNotFound(_0x2f7f5d,_0x590aa7){return function(_0x55c9a9){if(!_0x55c9a9){_0x2f7f5d[_0x4cfe('0x22')](0x194);}return _0x55c9a9;};}function handleError(_0x3789cf,_0x3ba29d){_0x3ba29d=_0x3ba29d||0x1f4;return function(_0x312c5c){logger[_0x4cfe('0x30')](_0x312c5c[_0x4cfe('0x31')]);if(_0x312c5c['name']){delete _0x312c5c[_0x4cfe('0x32')];}_0x3789cf[_0x4cfe('0x23')](_0x3ba29d)[_0x4cfe('0x33')](_0x312c5c);};}exports['index']=function(_0x12be6b,_0x225a3b){var _0x1c9ed5={},_0xa00d75={},_0xdbc73={'count':0x0,'rows':[]};var _0x372a04=_[_0x4cfe('0x34')](db[_0x4cfe('0x35')][_0x4cfe('0x36')],function(_0x4a2264){return{'name':_0x4a2264['fieldName'],'type':_0x4a2264[_0x4cfe('0x37')][_0x4cfe('0x38')]};});_0xa00d75[_0x4cfe('0x39')]=_[_0x4cfe('0x34')](_0x372a04,_0x4cfe('0x32'));_0xa00d75[_0x4cfe('0x3a')]=_[_0x4cfe('0x3b')](_0x12be6b[_0x4cfe('0x3a')]);_0xa00d75[_0x4cfe('0x3c')]=_['intersection'](_0xa00d75[_0x4cfe('0x39')],_0xa00d75[_0x4cfe('0x3a')]);_0x1c9ed5['attributes']=_[_0x4cfe('0x3d')](_0xa00d75[_0x4cfe('0x39')],qs[_0x4cfe('0x3e')](_0x12be6b[_0x4cfe('0x3a')]['fields']));_0x1c9ed5[_0x4cfe('0x3f')]=_0x1c9ed5[_0x4cfe('0x3f')][_0x4cfe('0x40')]?_0x1c9ed5[_0x4cfe('0x3f')]:_0xa00d75[_0x4cfe('0x39')];if(!_0x12be6b[_0x4cfe('0x3a')]['hasOwnProperty'](_0x4cfe('0x41'))){_0x1c9ed5['limit']=qs[_0x4cfe('0x25')](_0x12be6b[_0x4cfe('0x3a')]['limit']);_0x1c9ed5[_0x4cfe('0x27')]=qs[_0x4cfe('0x27')](_0x12be6b[_0x4cfe('0x3a')][_0x4cfe('0x27')]);}_0x1c9ed5[_0x4cfe('0x42')]=qs[_0x4cfe('0x43')](_0x12be6b['query'][_0x4cfe('0x43')]);_0x1c9ed5[_0x4cfe('0x44')]=qs[_0x4cfe('0x3c')](_[_0x4cfe('0x45')](_0x12be6b[_0x4cfe('0x3a')],_0xa00d75[_0x4cfe('0x3c')]),_0x372a04);if(_0x12be6b[_0x4cfe('0x3a')]['filter']){_0x1c9ed5[_0x4cfe('0x44')]=_['merge'](_0x1c9ed5[_0x4cfe('0x44')],{'$or':_['map'](_0x372a04,function(_0x367c0c){if(_0x367c0c[_0x4cfe('0x37')]!==_0x4cfe('0x46')){var _0x3f180e={};_0x3f180e[_0x367c0c[_0x4cfe('0x32')]]={'$like':'%'+_0x12be6b[_0x4cfe('0x3a')]['filter']+'%'};return _0x3f180e;}})});}_0x1c9ed5=_[_0x4cfe('0x47')]({},_0x1c9ed5,_0x12be6b[_0x4cfe('0x48')]);var _0x1417ed={'where':_0x1c9ed5['where']};return db[_0x4cfe('0x35')]['count'](_0x1417ed)[_0x4cfe('0x2e')](function(_0x2b139f){_0xdbc73[_0x4cfe('0x49')]=_0x2b139f;if(_0x12be6b[_0x4cfe('0x3a')]['includeAll']){_0x1c9ed5[_0x4cfe('0x4a')]=[{'all':!![]}];}return db[_0x4cfe('0x35')][_0x4cfe('0x4b')](_0x1c9ed5);})[_0x4cfe('0x2e')](function(_0x479a92){_0xdbc73[_0x4cfe('0x4c')]=_0x479a92;return _0xdbc73;})['then'](respondWithFilteredResult(_0x225a3b,_0x1c9ed5))['catch'](handleError(_0x225a3b,null));};exports[_0x4cfe('0x4d')]=function(_0x4122dc,_0x21fe05){var _0x640929={'raw':!![],'where':{'id':_0x4122dc['params']['id']}},_0x1885da={};_0x1885da['model']=_[_0x4cfe('0x3b')](db[_0x4cfe('0x35')][_0x4cfe('0x36')]);_0x1885da[_0x4cfe('0x3a')]=_[_0x4cfe('0x3b')](_0x4122dc['query']);_0x1885da[_0x4cfe('0x3c')]=_[_0x4cfe('0x3d')](_0x1885da[_0x4cfe('0x39')],_0x1885da[_0x4cfe('0x3a')]);_0x640929[_0x4cfe('0x3f')]=_[_0x4cfe('0x3d')](_0x1885da[_0x4cfe('0x39')],qs[_0x4cfe('0x3e')](_0x4122dc[_0x4cfe('0x3a')][_0x4cfe('0x3e')]));_0x640929[_0x4cfe('0x3f')]=_0x640929[_0x4cfe('0x3f')][_0x4cfe('0x40')]?_0x640929[_0x4cfe('0x3f')]:_0x1885da['model'];if(_0x4122dc['query']['includeAll']){_0x640929['include']=[{'all':!![]}];}_0x640929=_[_0x4cfe('0x47')]({},_0x640929,_0x4122dc['options']);return db[_0x4cfe('0x35')]['find'](_0x640929)['then'](handleEntityNotFound(_0x21fe05,null))[_0x4cfe('0x2e')](respondWithResult(_0x21fe05,null))[_0x4cfe('0x4e')](handleError(_0x21fe05,null));};exports['create']=function(_0x9e189e,_0x3a4ec4){return db['ChatGroup']['create'](_0x9e189e['body'],{})['then'](respondWithResult(_0x3a4ec4,0xc9))[_0x4cfe('0x4e')](handleError(_0x3a4ec4,null));};exports[_0x4cfe('0x2c')]=function(_0x1658be,_0x4ce627){if(_0x1658be['body']['id']){delete _0x1658be[_0x4cfe('0x4f')]['id'];}return db[_0x4cfe('0x35')][_0x4cfe('0x50')]({'where':{'id':_0x1658be['params']['id']}})[_0x4cfe('0x2e')](handleEntityNotFound(_0x4ce627,null))[_0x4cfe('0x2e')](saveUpdates(_0x1658be['body'],null))[_0x4cfe('0x2e')](respondWithResult(_0x4ce627,null))[_0x4cfe('0x4e')](handleError(_0x4ce627,null));};exports['destroy']=function(_0x4a8d72,_0x232260){return db['ChatGroup'][_0x4cfe('0x50')]({'where':{'id':_0x4a8d72[_0x4cfe('0x51')]['id']}})[_0x4cfe('0x2e')](handleEntityNotFound(_0x232260,null))[_0x4cfe('0x2e')](removeEntity(_0x232260,null))['catch'](handleError(_0x232260,null));};exports[_0x4cfe('0x52')]=function(_0x1c2fbf,_0x4d10dc){return db[_0x4cfe('0x35')][_0x4cfe('0x52')]()[_0x4cfe('0x2e')](respondWithResult(_0x4d10dc,null))[_0x4cfe('0x4e')](handleError(_0x4d10dc,null));};exports[_0x4cfe('0x53')]=function(_0x25bdc5,_0x464ff7,_0x35f661){return db['ChatInternalMessage'][_0x4cfe('0x49')]({'where':{'ChatGroupId':_0x25bdc5['params']['id'],'ToId':_0x25bdc5[_0x4cfe('0x54')]['id'],'read':![]}})[_0x4cfe('0x2e')](function(_0x33edb0){return{'id':_['toInteger'](_0x25bdc5[_0x4cfe('0x51')]['id']),'count':_0x33edb0};})['then'](respondWithResult(_0x464ff7,null))[_0x4cfe('0x4e')](handleError(_0x464ff7,null));};exports[_0x4cfe('0x55')]=function(_0x29cfbf,_0x15f01d,_0x530e9a){return db[_0x4cfe('0x35')][_0x4cfe('0x50')]({'where':{'id':_0x29cfbf[_0x4cfe('0x51')]['id']}})[_0x4cfe('0x2e')](handleEntityNotFound(_0x15f01d,null))[_0x4cfe('0x2e')](function(_0x5a1351){if(_0x5a1351){return _0x5a1351[_0x4cfe('0x55')](_0x29cfbf[_0x4cfe('0x4f')][_0x4cfe('0x56')],_[_0x4cfe('0x57')](_0x29cfbf[_0x4cfe('0x4f')],[_0x4cfe('0x56'),'id'])||{});}})[_0x4cfe('0x2e')](respondWithResult(_0x15f01d,null))[_0x4cfe('0x4e')](handleError(_0x15f01d,null));};exports[_0x4cfe('0x58')]=function(_0x14a349,_0x2a51fd,_0x4df24b){var _0x205f6c={};var _0xfdecd3={};var _0x2d546f;var _0x155066;return db[_0x4cfe('0x35')][_0x4cfe('0x59')]({'where':{'id':_0x14a349[_0x4cfe('0x51')]['id']}})[_0x4cfe('0x2e')](handleEntityNotFound(_0x2a51fd,null))['then'](function(_0x2c754c){if(_0x2c754c){_0x2d546f=_0x2c754c;_0xfdecd3[_0x4cfe('0x39')]=_[_0x4cfe('0x3b')](db[_0x4cfe('0x5a')][_0x4cfe('0x36')]);_0xfdecd3[_0x4cfe('0x3a')]=_[_0x4cfe('0x3b')](_0x14a349['query']);_0xfdecd3[_0x4cfe('0x3c')]=_[_0x4cfe('0x3d')](_0xfdecd3['model'],_0xfdecd3[_0x4cfe('0x3a')]);_0x205f6c[_0x4cfe('0x3f')]=_[_0x4cfe('0x3d')](_0xfdecd3[_0x4cfe('0x39')],qs[_0x4cfe('0x3e')](_0x14a349[_0x4cfe('0x3a')][_0x4cfe('0x3e')]));_0x205f6c[_0x4cfe('0x3f')]=_0x205f6c[_0x4cfe('0x3f')][_0x4cfe('0x40')]?_0x205f6c[_0x4cfe('0x3f')]:_0xfdecd3[_0x4cfe('0x39')];_0x205f6c[_0x4cfe('0x42')]=qs['sort'](_0x14a349[_0x4cfe('0x3a')]['sort']);_0x205f6c['where']=qs[_0x4cfe('0x3c')](_[_0x4cfe('0x45')](_0x14a349[_0x4cfe('0x3a')],_0xfdecd3['filters']));if(_0x14a349['query'][_0x4cfe('0x5b')]){_0x205f6c[_0x4cfe('0x44')]=_[_0x4cfe('0x47')](_0x205f6c[_0x4cfe('0x44')],{'$or':_['map'](_0x205f6c['attributes'],function(_0x177e97){var _0x2f5a7c={};_0x2f5a7c[_0x177e97]={'$like':'%'+_0x14a349[_0x4cfe('0x3a')][_0x4cfe('0x5b')]+'%'};return _0x2f5a7c;})});}_0x205f6c=_[_0x4cfe('0x47')]({},_0x205f6c,_0x14a349[_0x4cfe('0x48')]);return _0x2d546f[_0x4cfe('0x58')](_0x205f6c);}})[_0x4cfe('0x2e')](function(_0x216e2e){if(_0x216e2e){_0x155066=_0x216e2e[_0x4cfe('0x40')];if(!_0x14a349[_0x4cfe('0x3a')][_0x4cfe('0x5c')](_0x4cfe('0x41'))){_0x205f6c['limit']=qs[_0x4cfe('0x25')](_0x14a349['query']['limit']);_0x205f6c[_0x4cfe('0x27')]=qs['offset'](_0x14a349[_0x4cfe('0x3a')][_0x4cfe('0x27')]);}return _0x2d546f[_0x4cfe('0x58')](_0x205f6c);}})['then'](function(_0x485ad4){if(_0x485ad4){return _0x485ad4?{'count':_0x155066,'rows':_0x485ad4}:null;}})['then'](respondWithResult(_0x2a51fd,null))[_0x4cfe('0x4e')](handleError(_0x2a51fd,null));};exports[_0x4cfe('0x5d')]=function(_0x10aeda,_0x50a85d,_0x390b05){return db[_0x4cfe('0x35')]['find']({'where':{'id':_0x10aeda[_0x4cfe('0x51')]['id']}})[_0x4cfe('0x2e')](handleEntityNotFound(_0x50a85d,null))[_0x4cfe('0x2e')](function(_0x32b6eb){if(_0x32b6eb){return _0x32b6eb['removeMembers'](_0x10aeda[_0x4cfe('0x3a')][_0x4cfe('0x56')]);}})[_0x4cfe('0x2e')](respondWithStatusCode(_0x50a85d,null))[_0x4cfe('0x4e')](handleError(_0x50a85d,null));};exports[_0x4cfe('0x5e')]=function(_0x5675b7,_0x3066ed,_0x28a6f7){if(_0x5675b7[_0x4cfe('0x4f')]['id']){delete _0x5675b7[_0x4cfe('0x4f')]['id'];}return db[_0x4cfe('0x35')][_0x4cfe('0x50')]({'where':{'id':_0x5675b7[_0x4cfe('0x51')]['id']}})[_0x4cfe('0x2e')](handleEntityNotFound(_0x3066ed,null))['then'](function(_0x586cfc){if(_0x586cfc){_0x5675b7[_0x4cfe('0x4f')][_0x4cfe('0x5f')]=_0x586cfc['id'];return db['ChatInternalMessage']['create'](_0x5675b7[_0x4cfe('0x4f')]);}})['then'](respondWithResult(_0x3066ed,null))[_0x4cfe('0x4e')](handleError(_0x3066ed,null));};exports[_0x4cfe('0x60')]=function(_0x2d4396,_0x19863e,_0x34d88b){var _0x52f8ff={};var _0x1a1728={};var _0x4c6fe7;var _0x1f8682;return db[_0x4cfe('0x35')][_0x4cfe('0x59')]({'where':{'id':_0x2d4396['params']['id']}})[_0x4cfe('0x2e')](handleEntityNotFound(_0x19863e,null))[_0x4cfe('0x2e')](function(_0x5a51d4){if(_0x5a51d4){_0x4c6fe7=_0x5a51d4;_0x1a1728[_0x4cfe('0x39')]=_[_0x4cfe('0x3b')](db[_0x4cfe('0x61')][_0x4cfe('0x36')]);_0x1a1728[_0x4cfe('0x3a')]=_['keys'](_0x2d4396[_0x4cfe('0x3a')]);_0x1a1728['filters']=_[_0x4cfe('0x3d')](_0x1a1728[_0x4cfe('0x39')],_0x1a1728[_0x4cfe('0x3a')]);_0x52f8ff['attributes']=_[_0x4cfe('0x3d')](_0x1a1728[_0x4cfe('0x39')],qs[_0x4cfe('0x3e')](_0x2d4396[_0x4cfe('0x3a')][_0x4cfe('0x3e')]));_0x52f8ff[_0x4cfe('0x3f')]=_0x52f8ff[_0x4cfe('0x3f')][_0x4cfe('0x40')]?_0x52f8ff['attributes']:_0x1a1728[_0x4cfe('0x39')];_0x52f8ff[_0x4cfe('0x42')]=qs[_0x4cfe('0x43')](_0x2d4396[_0x4cfe('0x3a')][_0x4cfe('0x43')]);_0x52f8ff['where']=qs['filters'](_[_0x4cfe('0x45')](_0x2d4396[_0x4cfe('0x3a')],_0x1a1728[_0x4cfe('0x3c')]));if(_0x2d4396[_0x4cfe('0x3a')][_0x4cfe('0x5b')]){_0x52f8ff[_0x4cfe('0x44')]=_[_0x4cfe('0x47')](_0x52f8ff[_0x4cfe('0x44')],{'$or':_[_0x4cfe('0x34')](_0x52f8ff['attributes'],function(_0x5955aa){var _0x1687dd={};_0x1687dd[_0x5955aa]={'$like':'%'+_0x2d4396[_0x4cfe('0x3a')][_0x4cfe('0x5b')]+'%'};return _0x1687dd;})});}if(_0x2d4396[_0x4cfe('0x3a')][_0x4cfe('0x62')]){var _0x4e6373=_0x2d4396[_0x4cfe('0x3a')]['$gte'][_0x4cfe('0x63')](',');var _0x348a9a={};_0x348a9a[_0x4e6373[0x0]]={'$gte':moment(_0x4e6373[0x1])[_0x4cfe('0x64')](_0x4cfe('0x65'))};_0x52f8ff[_0x4cfe('0x44')]=_[_0x4cfe('0x47')](_0x52f8ff[_0x4cfe('0x44')],_0x348a9a);}_0x52f8ff=_[_0x4cfe('0x47')]({},_0x52f8ff,_0x2d4396['options']);return _0x4c6fe7[_0x4cfe('0x60')](_0x52f8ff);}})[_0x4cfe('0x2e')](function(_0x53cfb8){if(_0x53cfb8){_0x1f8682=_0x53cfb8[_0x4cfe('0x40')];if(!_0x2d4396[_0x4cfe('0x3a')][_0x4cfe('0x5c')]('nolimit')){_0x52f8ff[_0x4cfe('0x25')]=qs[_0x4cfe('0x25')](_0x2d4396[_0x4cfe('0x3a')][_0x4cfe('0x25')]);_0x52f8ff[_0x4cfe('0x27')]=qs[_0x4cfe('0x27')](_0x2d4396['query'][_0x4cfe('0x27')]);}return _0x4c6fe7[_0x4cfe('0x60')](_0x52f8ff);}})[_0x4cfe('0x2e')](function(_0x316a90){if(_0x316a90){return _0x316a90?{'count':_0x1f8682,'rows':_0x316a90}:null;}})['then'](respondWithResult(_0x19863e,null))[_0x4cfe('0x4e')](handleError(_0x19863e,null));};
\ No newline at end of file
+var _0xea63=['attributes','model','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','type','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','removeMembers','ChatGroupId','order','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','status','end','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','key','query','keys','filters','intersection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea63,0xeb));var _0x3ea6=function(_0x2f4286,_0x5c6273){_0x2f4286=_0x2f4286-0x0;var _0x18f85a=_0xea63[_0x2f4286];return _0x18f85a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ea6('0x0'));var zipdir=require(_0x3ea6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ea6('0x2'));var moment=require(_0x3ea6('0x3'));var BPromise=require(_0x3ea6('0x4'));var Mustache=require(_0x3ea6('0x5'));var util=require('util');var path=require(_0x3ea6('0x6'));var sox=require('sox');var csv=require(_0x3ea6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ea6('0x8'));var _=require(_0x3ea6('0x9'));var squel=require(_0x3ea6('0xa'));var crypto=require(_0x3ea6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3ea6('0xc'));var toCsv=require(_0x3ea6('0x7'));var querystring=require(_0x3ea6('0xd'));var Papa=require(_0x3ea6('0xe'));var Redis=require(_0x3ea6('0xf'));var authService=require(_0x3ea6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3ea6('0x11'));var hardwareService=require(_0x3ea6('0x12'));var logger=require(_0x3ea6('0x13'))(_0x3ea6('0x14'));var utils=require(_0x3ea6('0x15'));var config=require(_0x3ea6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3ea6('0x17'))['db'];config['redis']=_[_0x3ea6('0x18')](config[_0x3ea6('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x3ea6('0x1a'))(new Redis(config[_0x3ea6('0x19')]));require('./chatGroup.socket')[_0x3ea6('0x1b')](socket);function respondWithStatusCode(_0x4042b8,_0x21fb0c){_0x21fb0c=_0x21fb0c||0xcc;return function(_0x51bea3){if(_0x51bea3){return _0x4042b8[_0x3ea6('0x1c')](_0x21fb0c);}return _0x4042b8['status'](_0x21fb0c)['end']();};}function respondWithResult(_0x5b6f3d,_0x3e8525){_0x3e8525=_0x3e8525||0xc8;return function(_0x443734){if(_0x443734){return _0x5b6f3d['status'](_0x3e8525)[_0x3ea6('0x1d')](_0x443734);}};}function respondWithFilteredResult(_0x2020b0,_0x2df405){return function(_0x4dd5e5){if(_0x4dd5e5){var _0xa0b555=typeof _0x2df405[_0x3ea6('0x1e')]==='undefined'&&typeof _0x2df405[_0x3ea6('0x1f')]===_0x3ea6('0x20');var _0x5644d6=_0x4dd5e5[_0x3ea6('0x21')];var _0xef5aaa=_0xa0b555?0x0:_0x2df405['offset'];var _0x4fa749=_0xa0b555?_0x4dd5e5[_0x3ea6('0x21')]:_0x2df405[_0x3ea6('0x1e')]+_0x2df405[_0x3ea6('0x1f')];var _0x2e0851;if(_0x4fa749>=_0x5644d6){_0x4fa749=_0x5644d6;_0x2e0851=0xc8;}else{_0x2e0851=0xce;}_0x2020b0['status'](_0x2e0851);return _0x2020b0[_0x3ea6('0x22')](_0x3ea6('0x23'),_0xef5aaa+'-'+_0x4fa749+'/'+_0x5644d6)[_0x3ea6('0x1d')](_0x4dd5e5);}return null;};}function patchUpdates(_0x14f298){return function(_0x29af10){try{jsonpatch[_0x3ea6('0x24')](_0x29af10,_0x14f298,!![]);}catch(_0x5abafb){return BPromise[_0x3ea6('0x25')](_0x5abafb);}return _0x29af10[_0x3ea6('0x26')]();};}function saveUpdates(_0x24a8c3,_0x31fb24){return function(_0x578b61){if(_0x578b61){return _0x578b61[_0x3ea6('0x27')](_0x24a8c3)[_0x3ea6('0x28')](function(_0x5dc08b){return _0x5dc08b;});}return null;};}function removeEntity(_0xc1b64a,_0x5c4136){return function(_0x5b243c){if(_0x5b243c){return _0x5b243c['destroy']()[_0x3ea6('0x28')](function(){_0xc1b64a[_0x3ea6('0x29')](0xcc)[_0x3ea6('0x2a')]();});}};}function handleEntityNotFound(_0x1f9da5,_0x9c562){return function(_0x5b8eea){if(!_0x5b8eea){_0x1f9da5['sendStatus'](0x194);}return _0x5b8eea;};}function handleError(_0x4e64f9,_0x483006){_0x483006=_0x483006||0x1f4;return function(_0x3422ab){logger[_0x3ea6('0x2b')](_0x3422ab[_0x3ea6('0x2c')]);if(_0x3422ab['name']){delete _0x3422ab[_0x3ea6('0x2d')];}_0x4e64f9[_0x3ea6('0x29')](_0x483006)['send'](_0x3422ab);};}exports[_0x3ea6('0x2e')]=function(_0x296289,_0x2045b5){var _0x295261={},_0x52f912={},_0x2ed079={'count':0x0,'rows':[]};var _0x16f99f=_[_0x3ea6('0x2f')](db[_0x3ea6('0x30')][_0x3ea6('0x31')],function(_0x23883a){return{'name':_0x23883a[_0x3ea6('0x32')],'type':_0x23883a['type'][_0x3ea6('0x33')]};});_0x52f912['model']=_[_0x3ea6('0x2f')](_0x16f99f,_0x3ea6('0x2d'));_0x52f912[_0x3ea6('0x34')]=_[_0x3ea6('0x35')](_0x296289['query']);_0x52f912[_0x3ea6('0x36')]=_[_0x3ea6('0x37')](_0x52f912['model'],_0x52f912[_0x3ea6('0x34')]);_0x295261[_0x3ea6('0x38')]=_[_0x3ea6('0x37')](_0x52f912[_0x3ea6('0x39')],qs[_0x3ea6('0x3a')](_0x296289[_0x3ea6('0x34')][_0x3ea6('0x3a')]));_0x295261['attributes']=_0x295261[_0x3ea6('0x38')][_0x3ea6('0x3b')]?_0x295261['attributes']:_0x52f912[_0x3ea6('0x39')];if(!_0x296289[_0x3ea6('0x34')][_0x3ea6('0x3c')](_0x3ea6('0x3d'))){_0x295261[_0x3ea6('0x1f')]=qs['limit'](_0x296289[_0x3ea6('0x34')][_0x3ea6('0x1f')]);_0x295261[_0x3ea6('0x1e')]=qs[_0x3ea6('0x1e')](_0x296289[_0x3ea6('0x34')][_0x3ea6('0x1e')]);}_0x295261['order']=qs['sort'](_0x296289['query'][_0x3ea6('0x3e')]);_0x295261['where']=qs[_0x3ea6('0x36')](_[_0x3ea6('0x3f')](_0x296289[_0x3ea6('0x34')],_0x52f912[_0x3ea6('0x36')]),_0x16f99f);if(_0x296289[_0x3ea6('0x34')]['filter']){_0x295261[_0x3ea6('0x40')]=_[_0x3ea6('0x41')](_0x295261[_0x3ea6('0x40')],{'$or':_[_0x3ea6('0x2f')](_0x16f99f,function(_0x12d9c2){if(_0x12d9c2[_0x3ea6('0x42')]!=='VIRTUAL'){var _0x3a00e9={};_0x3a00e9[_0x12d9c2[_0x3ea6('0x2d')]]={'$like':'%'+_0x296289[_0x3ea6('0x34')][_0x3ea6('0x43')]+'%'};return _0x3a00e9;}})});}_0x295261=_[_0x3ea6('0x41')]({},_0x295261,_0x296289['options']);var _0xcfff5b={'where':_0x295261[_0x3ea6('0x40')]};return db['ChatGroup'][_0x3ea6('0x21')](_0xcfff5b)[_0x3ea6('0x28')](function(_0x4c5c3d){_0x2ed079['count']=_0x4c5c3d;if(_0x296289['query'][_0x3ea6('0x44')]){_0x295261[_0x3ea6('0x45')]=[{'all':!![]}];}return db[_0x3ea6('0x30')][_0x3ea6('0x46')](_0x295261);})[_0x3ea6('0x28')](function(_0x476bba){_0x2ed079[_0x3ea6('0x47')]=_0x476bba;return _0x2ed079;})[_0x3ea6('0x28')](respondWithFilteredResult(_0x2045b5,_0x295261))[_0x3ea6('0x48')](handleError(_0x2045b5,null));};exports[_0x3ea6('0x49')]=function(_0x4cc24d,_0x100b2c){var _0x27bc53={'raw':!![],'where':{'id':_0x4cc24d[_0x3ea6('0x4a')]['id']}},_0x46c88b={};_0x46c88b['model']=_[_0x3ea6('0x35')](db[_0x3ea6('0x30')][_0x3ea6('0x31')]);_0x46c88b[_0x3ea6('0x34')]=_[_0x3ea6('0x35')](_0x4cc24d['query']);_0x46c88b[_0x3ea6('0x36')]=_[_0x3ea6('0x37')](_0x46c88b['model'],_0x46c88b[_0x3ea6('0x34')]);_0x27bc53[_0x3ea6('0x38')]=_[_0x3ea6('0x37')](_0x46c88b['model'],qs['fields'](_0x4cc24d[_0x3ea6('0x34')][_0x3ea6('0x3a')]));_0x27bc53[_0x3ea6('0x38')]=_0x27bc53['attributes'][_0x3ea6('0x3b')]?_0x27bc53['attributes']:_0x46c88b[_0x3ea6('0x39')];if(_0x4cc24d[_0x3ea6('0x34')][_0x3ea6('0x44')]){_0x27bc53[_0x3ea6('0x45')]=[{'all':!![]}];}_0x27bc53=_[_0x3ea6('0x41')]({},_0x27bc53,_0x4cc24d[_0x3ea6('0x4b')]);return db['ChatGroup'][_0x3ea6('0x4c')](_0x27bc53)[_0x3ea6('0x28')](handleEntityNotFound(_0x100b2c,null))['then'](respondWithResult(_0x100b2c,null))[_0x3ea6('0x48')](handleError(_0x100b2c,null));};exports[_0x3ea6('0x4d')]=function(_0x50a39a,_0x5cac51){return db[_0x3ea6('0x30')][_0x3ea6('0x4d')](_0x50a39a['body'],{})[_0x3ea6('0x28')](respondWithResult(_0x5cac51,0xc9))[_0x3ea6('0x48')](handleError(_0x5cac51,null));};exports[_0x3ea6('0x27')]=function(_0x28b150,_0x520c01){if(_0x28b150[_0x3ea6('0x4e')]['id']){delete _0x28b150[_0x3ea6('0x4e')]['id'];}return db[_0x3ea6('0x30')]['find']({'where':{'id':_0x28b150[_0x3ea6('0x4a')]['id']}})[_0x3ea6('0x28')](handleEntityNotFound(_0x520c01,null))[_0x3ea6('0x28')](saveUpdates(_0x28b150['body'],null))[_0x3ea6('0x28')](respondWithResult(_0x520c01,null))[_0x3ea6('0x48')](handleError(_0x520c01,null));};exports[_0x3ea6('0x4f')]=function(_0x1d9a52,_0x454771){return db['ChatGroup']['find']({'where':{'id':_0x1d9a52[_0x3ea6('0x4a')]['id']}})[_0x3ea6('0x28')](handleEntityNotFound(_0x454771,null))[_0x3ea6('0x28')](removeEntity(_0x454771,null))['catch'](handleError(_0x454771,null));};exports['describe']=function(_0x4a97b3,_0x1b6639){return db['ChatGroup']['describe']()[_0x3ea6('0x28')](respondWithResult(_0x1b6639,null))[_0x3ea6('0x48')](handleError(_0x1b6639,null));};exports[_0x3ea6('0x50')]=function(_0x513d1b,_0x5d14bf,_0x2d8c01){return db[_0x3ea6('0x51')][_0x3ea6('0x21')]({'where':{'ChatGroupId':_0x513d1b['params']['id'],'ToId':_0x513d1b[_0x3ea6('0x52')]['id'],'read':![]}})[_0x3ea6('0x28')](function(_0x5227b3){return{'id':_[_0x3ea6('0x53')](_0x513d1b[_0x3ea6('0x4a')]['id']),'count':_0x5227b3};})[_0x3ea6('0x28')](respondWithResult(_0x5d14bf,null))['catch'](handleError(_0x5d14bf,null));};exports[_0x3ea6('0x54')]=function(_0x4efbc3,_0x205b5d,_0x469884){return db['ChatGroup'][_0x3ea6('0x4c')]({'where':{'id':_0x4efbc3[_0x3ea6('0x4a')]['id']}})[_0x3ea6('0x28')](handleEntityNotFound(_0x205b5d,null))['then'](function(_0x5c7e5d){if(_0x5c7e5d){return _0x5c7e5d[_0x3ea6('0x54')](_0x4efbc3[_0x3ea6('0x4e')][_0x3ea6('0x55')],_[_0x3ea6('0x56')](_0x4efbc3[_0x3ea6('0x4e')],[_0x3ea6('0x55'),'id'])||{});}})[_0x3ea6('0x28')](respondWithResult(_0x205b5d,null))['catch'](handleError(_0x205b5d,null));};exports[_0x3ea6('0x57')]=function(_0x2d10aa,_0x4a45dc,_0x27e477){var _0x5f2c56={};var _0x433dfa={};var _0x14944e;var _0x10ed8e;return db[_0x3ea6('0x30')][_0x3ea6('0x58')]({'where':{'id':_0x2d10aa[_0x3ea6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4a45dc,null))[_0x3ea6('0x28')](function(_0x35d382){if(_0x35d382){_0x14944e=_0x35d382;_0x433dfa['model']=_[_0x3ea6('0x35')](db['User'][_0x3ea6('0x31')]);_0x433dfa['query']=_[_0x3ea6('0x35')](_0x2d10aa['query']);_0x433dfa['filters']=_[_0x3ea6('0x37')](_0x433dfa[_0x3ea6('0x39')],_0x433dfa[_0x3ea6('0x34')]);_0x5f2c56[_0x3ea6('0x38')]=_['intersection'](_0x433dfa[_0x3ea6('0x39')],qs[_0x3ea6('0x3a')](_0x2d10aa[_0x3ea6('0x34')]['fields']));_0x5f2c56['attributes']=_0x5f2c56[_0x3ea6('0x38')][_0x3ea6('0x3b')]?_0x5f2c56['attributes']:_0x433dfa['model'];_0x5f2c56['order']=qs[_0x3ea6('0x3e')](_0x2d10aa[_0x3ea6('0x34')][_0x3ea6('0x3e')]);_0x5f2c56[_0x3ea6('0x40')]=qs[_0x3ea6('0x36')](_['pick'](_0x2d10aa[_0x3ea6('0x34')],_0x433dfa[_0x3ea6('0x36')]));if(_0x2d10aa['query']['filter']){_0x5f2c56['where']=_['merge'](_0x5f2c56[_0x3ea6('0x40')],{'$or':_[_0x3ea6('0x2f')](_0x5f2c56[_0x3ea6('0x38')],function(_0x42a0ed){var _0x2db951={};_0x2db951[_0x42a0ed]={'$like':'%'+_0x2d10aa[_0x3ea6('0x34')][_0x3ea6('0x43')]+'%'};return _0x2db951;})});}_0x5f2c56=_['merge']({},_0x5f2c56,_0x2d10aa['options']);return _0x14944e['getMembers'](_0x5f2c56);}})[_0x3ea6('0x28')](function(_0x5626d1){if(_0x5626d1){_0x10ed8e=_0x5626d1[_0x3ea6('0x3b')];if(!_0x2d10aa['query'][_0x3ea6('0x3c')](_0x3ea6('0x3d'))){_0x5f2c56[_0x3ea6('0x1f')]=qs[_0x3ea6('0x1f')](_0x2d10aa[_0x3ea6('0x34')][_0x3ea6('0x1f')]);_0x5f2c56[_0x3ea6('0x1e')]=qs[_0x3ea6('0x1e')](_0x2d10aa[_0x3ea6('0x34')][_0x3ea6('0x1e')]);}return _0x14944e[_0x3ea6('0x57')](_0x5f2c56);}})[_0x3ea6('0x28')](function(_0x5ae7db){if(_0x5ae7db){return _0x5ae7db?{'count':_0x10ed8e,'rows':_0x5ae7db}:null;}})[_0x3ea6('0x28')](respondWithResult(_0x4a45dc,null))['catch'](handleError(_0x4a45dc,null));};exports[_0x3ea6('0x59')]=function(_0x30a861,_0x4db212,_0x4b5fd5){return db[_0x3ea6('0x30')][_0x3ea6('0x4c')]({'where':{'id':_0x30a861[_0x3ea6('0x4a')]['id']}})[_0x3ea6('0x28')](handleEntityNotFound(_0x4db212,null))['then'](function(_0x14d056){if(_0x14d056){return _0x14d056[_0x3ea6('0x59')](_0x30a861[_0x3ea6('0x34')][_0x3ea6('0x55')]);}})['then'](respondWithStatusCode(_0x4db212,null))[_0x3ea6('0x48')](handleError(_0x4db212,null));};exports['addMessage']=function(_0x449dd0,_0x1933e7,_0x35b153){if(_0x449dd0[_0x3ea6('0x4e')]['id']){delete _0x449dd0[_0x3ea6('0x4e')]['id'];}return db[_0x3ea6('0x30')][_0x3ea6('0x4c')]({'where':{'id':_0x449dd0['params']['id']}})['then'](handleEntityNotFound(_0x1933e7,null))['then'](function(_0x1ac508){if(_0x1ac508){_0x449dd0[_0x3ea6('0x4e')][_0x3ea6('0x5a')]=_0x1ac508['id'];return db[_0x3ea6('0x51')]['create'](_0x449dd0[_0x3ea6('0x4e')]);}})[_0x3ea6('0x28')](respondWithResult(_0x1933e7,null))[_0x3ea6('0x48')](handleError(_0x1933e7,null));};exports['getMessages']=function(_0x39b8a9,_0x234c04,_0x356300){var _0x55e17e={};var _0x6ef1c3={};var _0xa53c4a;var _0x55292d;return db[_0x3ea6('0x30')][_0x3ea6('0x58')]({'where':{'id':_0x39b8a9[_0x3ea6('0x4a')]['id']}})[_0x3ea6('0x28')](handleEntityNotFound(_0x234c04,null))[_0x3ea6('0x28')](function(_0x18884d){if(_0x18884d){_0xa53c4a=_0x18884d;_0x6ef1c3[_0x3ea6('0x39')]=_['keys'](db[_0x3ea6('0x51')][_0x3ea6('0x31')]);_0x6ef1c3['query']=_[_0x3ea6('0x35')](_0x39b8a9['query']);_0x6ef1c3['filters']=_['intersection'](_0x6ef1c3['model'],_0x6ef1c3[_0x3ea6('0x34')]);_0x55e17e[_0x3ea6('0x38')]=_[_0x3ea6('0x37')](_0x6ef1c3[_0x3ea6('0x39')],qs[_0x3ea6('0x3a')](_0x39b8a9['query']['fields']));_0x55e17e[_0x3ea6('0x38')]=_0x55e17e[_0x3ea6('0x38')]['length']?_0x55e17e[_0x3ea6('0x38')]:_0x6ef1c3[_0x3ea6('0x39')];_0x55e17e[_0x3ea6('0x5b')]=qs[_0x3ea6('0x3e')](_0x39b8a9[_0x3ea6('0x34')][_0x3ea6('0x3e')]);_0x55e17e[_0x3ea6('0x40')]=qs[_0x3ea6('0x36')](_['pick'](_0x39b8a9[_0x3ea6('0x34')],_0x6ef1c3[_0x3ea6('0x36')]));if(_0x39b8a9[_0x3ea6('0x34')][_0x3ea6('0x43')]){_0x55e17e[_0x3ea6('0x40')]=_[_0x3ea6('0x41')](_0x55e17e[_0x3ea6('0x40')],{'$or':_[_0x3ea6('0x2f')](_0x55e17e[_0x3ea6('0x38')],function(_0x5b1da9){var _0x5693e1={};_0x5693e1[_0x5b1da9]={'$like':'%'+_0x39b8a9['query'][_0x3ea6('0x43')]+'%'};return _0x5693e1;})});}if(_0x39b8a9[_0x3ea6('0x34')][_0x3ea6('0x5c')]){var _0x35d3e5=_0x39b8a9[_0x3ea6('0x34')][_0x3ea6('0x5c')][_0x3ea6('0x5d')](',');var _0x5bafda={};_0x5bafda[_0x35d3e5[0x0]]={'$gte':moment(_0x35d3e5[0x1])[_0x3ea6('0x5e')](_0x3ea6('0x5f'))};_0x55e17e[_0x3ea6('0x40')]=_[_0x3ea6('0x41')](_0x55e17e['where'],_0x5bafda);}_0x55e17e=_[_0x3ea6('0x41')]({},_0x55e17e,_0x39b8a9['options']);return _0xa53c4a['getMessages'](_0x55e17e);}})[_0x3ea6('0x28')](function(_0x1f1112){if(_0x1f1112){_0x55292d=_0x1f1112[_0x3ea6('0x3b')];if(!_0x39b8a9[_0x3ea6('0x34')][_0x3ea6('0x3c')](_0x3ea6('0x3d'))){_0x55e17e[_0x3ea6('0x1f')]=qs[_0x3ea6('0x1f')](_0x39b8a9[_0x3ea6('0x34')]['limit']);_0x55e17e[_0x3ea6('0x1e')]=qs[_0x3ea6('0x1e')](_0x39b8a9[_0x3ea6('0x34')][_0x3ea6('0x1e')]);}return _0xa53c4a[_0x3ea6('0x60')](_0x55e17e);}})[_0x3ea6('0x28')](function(_0x14ed90){if(_0x14ed90){return _0x14ed90?{'count':_0x55292d,'rows':_0x14ed90}:null;}})[_0x3ea6('0x28')](respondWithResult(_0x234c04,null))[_0x3ea6('0x48')](handleError(_0x234c04,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 7fc8004..7e71e17 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 _0x4996=['emit','hasOwnProperty','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove'];(function(_0x6d3fc7,_0x2328e7){var _0x465ee3=function(_0x5d579d){while(--_0x5d579d){_0x6d3fc7['push'](_0x6d3fc7['shift']());}};_0x465ee3(++_0x2328e7);}(_0x4996,0x173));var _0x6499=function(_0x3108d9,_0xf08d6){_0x3108d9=_0x3108d9-0x0;var _0x1455e6=_0x4996[_0x3108d9];return _0x1455e6;};'use strict';var EventEmitter=require(_0x6499('0x0'));var ChatGroup=require(_0x6499('0x1'))['db'][_0x6499('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6499('0x3')](0x0);var events={'afterCreate':_0x6499('0x4'),'afterUpdate':_0x6499('0x5'),'afterDestroy':_0x6499('0x6')};function emitEvent(_0xac13c0){return function(_0xcfb677,_0x5d7b12,_0x1b95a0){ChatGroupEvents[_0x6499('0x7')](_0xac13c0+':'+_0xcfb677['id'],_0xcfb677);ChatGroupEvents[_0x6499('0x7')](_0xac13c0,_0xcfb677);_0x1b95a0(null);};}for(var e in events){if(events[_0x6499('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x8512=['events','../../mysqldb','ChatGroup','save','update','emit','hasOwnProperty','hook'];(function(_0x24c963,_0x5f32a4){var _0x32a0eb=function(_0x3fd2eb){while(--_0x3fd2eb){_0x24c963['push'](_0x24c963['shift']());}};_0x32a0eb(++_0x5f32a4);}(_0x8512,0x170));var _0x2851=function(_0x528757,_0x41b8d5){_0x528757=_0x528757-0x0;var _0x271b81=_0x8512[_0x528757];return _0x271b81;};'use strict';var EventEmitter=require(_0x2851('0x0'));var ChatGroup=require(_0x2851('0x1'))['db'][_0x2851('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2851('0x3'),'afterUpdate':_0x2851('0x4'),'afterDestroy':'remove'};function emitEvent(_0xecd26){return function(_0x2f969c,_0x350f92,_0x5060a5){ChatGroupEvents[_0x2851('0x5')](_0xecd26+':'+_0x2f969c['id'],_0x2f969c);ChatGroupEvents[_0x2851('0x5')](_0xecd26,_0x2f969c);_0x5060a5(null);};}for(var e in events){if(events[_0x2851('0x6')](e)){var event=events[e];ChatGroup[_0x2851('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 776ca47..b0d53dc 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 _0xedb3=['define','ChatGroup','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports'];(function(_0xbacfad,_0x52a356){var _0x32c2f9=function(_0x4fabec){while(--_0x4fabec){_0xbacfad['push'](_0xbacfad['shift']());}};_0x32c2f9(++_0x52a356);}(_0xedb3,0x10a));var _0x3edb=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xedb3[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x3edb('0x0'));var util=require(_0x3edb('0x1'));var logger=require('../../config/logger')(_0x3edb('0x2'));var moment=require(_0x3edb('0x3'));var BPromise=require('bluebird');var rp=require(_0x3edb('0x4'));var fs=require('fs');var path=require(_0x3edb('0x5'));var rimraf=require(_0x3edb('0x6'));var config=require(_0x3edb('0x7'));var attributes=require(_0x3edb('0x8'));module[_0x3edb('0x9')]=function(_0x22bfb5,_0x3722ab){return _0x22bfb5[_0x3edb('0xa')](_0x3edb('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfcd7=['lodash','util','../../config/logger','api','bluebird','request-promise','path','./chatGroup.attributes','define','chat_groups'];(function(_0x40bc01,_0x22a9a9){var _0x42365b=function(_0x2d3d88){while(--_0x2d3d88){_0x40bc01['push'](_0x40bc01['shift']());}};_0x42365b(++_0x22a9a9);}(_0xfcd7,0x186));var _0x7fcd=function(_0x18f3c0,_0x3f2cce){_0x18f3c0=_0x18f3c0-0x0;var _0x16fe8e=_0xfcd7[_0x18f3c0];return _0x16fe8e;};'use strict';var _=require(_0x7fcd('0x0'));var util=require(_0x7fcd('0x1'));var logger=require(_0x7fcd('0x2'))(_0x7fcd('0x3'));var moment=require('moment');var BPromise=require(_0x7fcd('0x4'));var rp=require(_0x7fcd('0x5'));var fs=require('fs');var path=require(_0x7fcd('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7fcd('0x7'));module['exports']=function(_0x43b217,_0xbcc119){return _0x43b217[_0x7fcd('0x8')]('ChatGroup',attributes,{'tableName':_0x7fcd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 4f6fef6..b536627 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 _0x946e=['request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatGroup.socket','request','then','ChatGroup,\x20%s,\x20%s'];(function(_0x4da382,_0x4cfc5d){var _0x10073f=function(_0x32dc45){while(--_0x32dc45){_0x4da382['push'](_0x4da382['shift']());}};_0x10073f(++_0x4cfc5d);}(_0x946e,0x1d0));var _0xe946=function(_0x1e63cc,_0x4c191c){_0x1e63cc=_0x1e63cc-0x0;var _0x33d198=_0x946e[_0x1e63cc];return _0x33d198;};'use strict';var _=require(_0xe946('0x0'));var util=require('util');var moment=require(_0xe946('0x1'));var BPromise=require('bluebird');var rs=require(_0xe946('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe946('0x3'));var logger=require(_0xe946('0x4'))(_0xe946('0x5'));var config=require(_0xe946('0x6'));var jayson=require(_0xe946('0x7'));var client=jayson['client'][_0xe946('0x8')]({'port':0x232a});config[_0xe946('0x9')]=_[_0xe946('0xa')](config['redis'],{'host':_0xe946('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe946('0x9')]));require(_0xe946('0xc'))['register'](socket);function respondWithRpcPromise(_0x47e7a1,_0x49e9fc,_0x286140){return new BPromise(function(_0x49b412,_0x5679f6){return client[_0xe946('0xd')](_0x47e7a1,_0x286140)[_0xe946('0xe')](function(_0x56d82e){logger['info'](_0xe946('0xf'),_0x49e9fc,_0xe946('0x10'));logger['debug'](_0xe946('0x11'),_0x49e9fc,_0xe946('0x10'),JSON[_0xe946('0x12')](_0x56d82e));if(_0x56d82e[_0xe946('0x13')]){if(_0x56d82e[_0xe946('0x13')][_0xe946('0x14')]===0x1f4){logger[_0xe946('0x13')]('ChatGroup,\x20%s,\x20%s',_0x49e9fc,_0x56d82e['error'][_0xe946('0x15')]);return _0x5679f6(_0x56d82e[_0xe946('0x13')][_0xe946('0x15')]);}logger['error'](_0xe946('0xf'),_0x49e9fc,_0x56d82e[_0xe946('0x13')][_0xe946('0x15')]);return _0x49b412(_0x56d82e['error'][_0xe946('0x15')]);}else{logger[_0xe946('0x16')](_0xe946('0xf'),_0x49e9fc,'request\x20sent');_0x49b412(_0x56d82e[_0xe946('0x17')][_0xe946('0x15')]);}})['catch'](function(_0x2b2b66){logger['error'](_0xe946('0xf'),_0x49e9fc,_0x2b2b66);_0x5679f6(_0x2b2b66);});});}
\ No newline at end of file
+var _0xff2a=['stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xff2a,0x93));var _0xaff2=function(_0x4574b0,_0x3bd754){_0x4574b0=_0x4574b0-0x0;var _0x3d720c=_0xff2a[_0x4574b0];return _0x3d720c;};'use strict';var _=require('lodash');var util=require(_0xaff2('0x0'));var moment=require(_0xaff2('0x1'));var BPromise=require('bluebird');var rs=require(_0xaff2('0x2'));var fs=require('fs');var Redis=require(_0xaff2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaff2('0x4'));var logger=require('../../config/logger')(_0xaff2('0x5'));var config=require(_0xaff2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xaff2('0x7')][_0xaff2('0x8')]({'port':0x232a});config[_0xaff2('0x9')]=_[_0xaff2('0xa')](config[_0xaff2('0x9')],{'host':_0xaff2('0xb'),'port':0x18eb});var socket=require(_0xaff2('0xc'))(new Redis(config[_0xaff2('0x9')]));require(_0xaff2('0xd'))[_0xaff2('0xe')](socket);function respondWithRpcPromise(_0x5f2c47,_0x463233,_0x558f67){return new BPromise(function(_0x4e031d,_0x184f5b){return client[_0xaff2('0xf')](_0x5f2c47,_0x558f67)[_0xaff2('0x10')](function(_0x26de0d){logger[_0xaff2('0x11')]('ChatGroup,\x20%s,\x20%s',_0x463233,_0xaff2('0x12'));logger[_0xaff2('0x13')](_0xaff2('0x14'),_0x463233,'request\x20sent',JSON[_0xaff2('0x15')](_0x26de0d));if(_0x26de0d[_0xaff2('0x16')]){if(_0x26de0d['error'][_0xaff2('0x17')]===0x1f4){logger['error'](_0xaff2('0x18'),_0x463233,_0x26de0d['error']['message']);return _0x184f5b(_0x26de0d[_0xaff2('0x16')]['message']);}logger[_0xaff2('0x16')](_0xaff2('0x18'),_0x463233,_0x26de0d[_0xaff2('0x16')][_0xaff2('0x19')]);return _0x4e031d(_0x26de0d[_0xaff2('0x16')]['message']);}else{logger[_0xaff2('0x11')](_0xaff2('0x18'),_0x463233,_0xaff2('0x12'));_0x4e031d(_0x26de0d[_0xaff2('0x1a')][_0xaff2('0x19')]);}})[_0xaff2('0x1b')](function(_0x227720){logger['error'](_0xaff2('0x18'),_0x463233,_0x227720);_0x184f5b(_0x227720);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index a97a370..2b16a60 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 _0x3ef7=['register','length','chatGroup:','./chatGroup.events','emit','removeListener'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x3ef7,0x7b));var _0x73ef=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3ef7[_0x2dafbe];return _0x58a45a;};'use strict';var ChatGroupEvents=require(_0x73ef('0x0'));var events=['save','remove','update'];function createListener(_0x359baa,_0x5852cc){return function(_0x35e57a){_0x5852cc[_0x73ef('0x1')](_0x359baa,_0x35e57a);};}function removeListener(_0x567c1d,_0x53f37d){return function(){ChatGroupEvents[_0x73ef('0x2')](_0x567c1d,_0x53f37d);};}exports[_0x73ef('0x3')]=function(_0x187099){for(var _0x1943ef=0x0,_0x497e9c=events[_0x73ef('0x4')];_0x1943ef<_0x497e9c;_0x1943ef++){var _0x401c87=events[_0x1943ef];var _0xffdc06=createListener(_0x73ef('0x5')+_0x401c87,_0x187099);ChatGroupEvents['on'](_0x401c87,_0xffdc06);}};
\ No newline at end of file
+var _0x9da1=['length','save','remove','removeListener','register'];(function(_0x538316,_0x246ded){var _0x18f8be=function(_0x5dca6f){while(--_0x5dca6f){_0x538316['push'](_0x538316['shift']());}};_0x18f8be(++_0x246ded);}(_0x9da1,0x114));var _0x19da=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0x9da1[_0x1f7201];return _0x289fd2;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x19da('0x0'),_0x19da('0x1'),'update'];function createListener(_0x1ded67,_0x104ba9){return function(_0x4189dd){_0x104ba9['emit'](_0x1ded67,_0x4189dd);};}function removeListener(_0x121b9a,_0x5c5f1f){return function(){ChatGroupEvents[_0x19da('0x2')](_0x121b9a,_0x5c5f1f);};}exports[_0x19da('0x3')]=function(_0x3f80f0){for(var _0x432d77=0x0,_0x220940=events[_0x19da('0x4')];_0x432d77<_0x220940;_0x432d77++){var _0x535d65=events[_0x432d77];var _0x2bda7e=createListener('chatGroup:'+_0x535d65,_0x3f80f0);ChatGroupEvents['on'](_0x535d65,_0x2bda7e);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index cae441d..221eed7 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 _0x85af=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','/:id','update','delete','removeMembers','exports'];(function(_0x50e202,_0x268014){var _0x4a4993=function(_0x30f76f){while(--_0x30f76f){_0x50e202['push'](_0x50e202['shift']());}};_0x4a4993(++_0x268014);}(_0x85af,0x118));var _0xf85a=function(_0x4a7413,_0xd659){_0x4a7413=_0x4a7413-0x0;var _0x52a476=_0x85af[_0x4a7413];return _0x52a476;};'use strict';var multer=require('multer');var util=require(_0xf85a('0x0'));var path=require(_0xf85a('0x1'));var timeout=require('connect-timeout');var express=require(_0xf85a('0x2'));var router=express['Router']();var fs_extra=require(_0xf85a('0x3'));var auth=require(_0xf85a('0x4'));var interaction=require(_0xf85a('0x5'));var config=require(_0xf85a('0x6'));var controller=require(_0xf85a('0x7'));router[_0xf85a('0x8')]('/',auth[_0xf85a('0x9')](),controller[_0xf85a('0xa')]);router[_0xf85a('0x8')](_0xf85a('0xb'),auth[_0xf85a('0x9')](),controller[_0xf85a('0xc')]);router[_0xf85a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf85a('0xd')]);router['get']('/:id/unread',auth['isAuthenticated'](),controller[_0xf85a('0xe')]);router[_0xf85a('0x8')](_0xf85a('0xf'),auth[_0xf85a('0x9')](),controller[_0xf85a('0x10')]);router['get'](_0xf85a('0x11'),auth[_0xf85a('0x9')](),controller[_0xf85a('0x12')]);router[_0xf85a('0x13')]('/',auth[_0xf85a('0x9')](),controller['create']);router['post']('/:id/members',auth[_0xf85a('0x9')](),controller[_0xf85a('0x14')]);router['post'](_0xf85a('0x11'),auth['isAuthenticated'](),controller[_0xf85a('0x15')]);router[_0xf85a('0x16')](_0xf85a('0x17'),auth[_0xf85a('0x9')](),controller[_0xf85a('0x18')]);router[_0xf85a('0x19')]('/:id',auth[_0xf85a('0x9')](),controller['destroy']);router[_0xf85a('0x19')](_0xf85a('0xf'),auth['isAuthenticated'](),controller[_0xf85a('0x1a')]);module[_0xf85a('0x1b')]=router;
\ No newline at end of file
+var _0xe870=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer'];(function(_0x254643,_0x1b1ac4){var _0x59edff=function(_0x51d519){while(--_0x51d519){_0x254643['push'](_0x254643['shift']());}};_0x59edff(++_0x1b1ac4);}(_0xe870,0x1b2));var _0x0e87=function(_0x2861f0,_0x1b28d7){_0x2861f0=_0x2861f0-0x0;var _0x506155=_0xe870[_0x2861f0];return _0x506155;};'use strict';var multer=require(_0x0e87('0x0'));var util=require(_0x0e87('0x1'));var path=require(_0x0e87('0x2'));var timeout=require(_0x0e87('0x3'));var express=require(_0x0e87('0x4'));var router=express[_0x0e87('0x5')]();var fs_extra=require(_0x0e87('0x6'));var auth=require(_0x0e87('0x7'));var interaction=require(_0x0e87('0x8'));var config=require('../../config/environment');var controller=require(_0x0e87('0x9'));router['get']('/',auth[_0x0e87('0xa')](),controller['index']);router[_0x0e87('0xb')](_0x0e87('0xc'),auth[_0x0e87('0xa')](),controller[_0x0e87('0xd')]);router['get'](_0x0e87('0xe'),auth[_0x0e87('0xa')](),controller[_0x0e87('0xf')]);router[_0x0e87('0xb')](_0x0e87('0x10'),auth[_0x0e87('0xa')](),controller[_0x0e87('0x11')]);router[_0x0e87('0xb')](_0x0e87('0x12'),auth[_0x0e87('0xa')](),controller['getMembers']);router['get'](_0x0e87('0x13'),auth['isAuthenticated'](),controller[_0x0e87('0x14')]);router[_0x0e87('0x15')]('/',auth[_0x0e87('0xa')](),controller['create']);router[_0x0e87('0x15')](_0x0e87('0x12'),auth[_0x0e87('0xa')](),controller[_0x0e87('0x16')]);router[_0x0e87('0x15')](_0x0e87('0x13'),auth[_0x0e87('0xa')](),controller[_0x0e87('0x17')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0e87('0x18')]);router[_0x0e87('0x19')](_0x0e87('0xe'),auth['isAuthenticated'](),controller[_0x0e87('0x1a')]);router[_0x0e87('0x19')]('/:id/members',auth[_0x0e87('0xa')](),controller[_0x0e87('0x1b')]);module[_0x0e87('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index ecf5c18..6a1f478 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 _0x80cd=['star','thumb','TEXT','STRING','DATE','long','out','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x1635b7,_0x2c2138){var _0x5a20a6=function(_0x5406c8){while(--_0x5406c8){_0x1635b7['push'](_0x1635b7['shift']());}};_0x5a20a6(++_0x2c2138);}(_0x80cd,0x146));var _0xd80c=function(_0x30cc1a,_0x162bbc){_0x30cc1a=_0x30cc1a-0x0;var _0xb3f18f=_0x80cd[_0x30cc1a];return _0xb3f18f;};'use strict';var Sequelize=require('sequelize');module[_0xd80c('0x0')]={'closed':{'type':Sequelize[_0xd80c('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd80c('0x2')]},'ratingType':{'type':Sequelize[_0xd80c('0x3')](_0xd80c('0x4'),_0xd80c('0x5')),'defaultValue':_0xd80c('0x4')},'ratingMessage':{'type':Sequelize[_0xd80c('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xd80c('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd80c('0x8')]},'disposition':{'type':Sequelize[_0xd80c('0x7')]},'secondDisposition':{'type':Sequelize[_0xd80c('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd80c('0x7')]},'browserName':{'type':Sequelize[_0xd80c('0x7')]},'browserVersion':{'type':Sequelize[_0xd80c('0x7')]},'osName':{'type':Sequelize[_0xd80c('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xd80c('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xd80c('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd80c('0x6')](_0xd80c('0x9'))},'read1stAt':{'type':Sequelize[_0xd80c('0x8')]},'lastMsgAt':{'type':Sequelize[_0xd80c('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xd80c('0x3')]('in',_0xd80c('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd80c('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xd80c('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xd80c('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x06ef=['DATE','STRING','ENUM','out','BOOLEAN','star','TEXT'];(function(_0x1d5ba8,_0x412a52){var _0x1022a2=function(_0x187f11){while(--_0x187f11){_0x1d5ba8['push'](_0x1d5ba8['shift']());}};_0x1022a2(++_0x412a52);}(_0x06ef,0x185));var _0xf06e=function(_0x267372,_0xe20a61){_0x267372=_0x267372-0x0;var _0x37eeba=_0x06ef[_0x267372];return _0x37eeba;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xf06e('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM']('star','thumb'),'defaultValue':_0xf06e('0x1')},'ratingMessage':{'type':Sequelize[_0xf06e('0x2')]},'pathTranscript':{'type':Sequelize[_0xf06e('0x2')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf06e('0x3')]},'disposition':{'type':Sequelize[_0xf06e('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xf06e('0x4')]},'osVersion':{'type':Sequelize[_0xf06e('0x4')]},'deviceModel':{'type':Sequelize[_0xf06e('0x4')]},'deviceVendor':{'type':Sequelize[_0xf06e('0x4')]},'deviceType':{'type':Sequelize[_0xf06e('0x4')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xf06e('0x4')]},'formData':{'type':Sequelize[_0xf06e('0x2')]('long')},'read1stAt':{'type':Sequelize[_0xf06e('0x3')]},'lastMsgAt':{'type':Sequelize[_0xf06e('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xf06e('0x5')]('in',_0xf06e('0x6')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf06e('0x4')]},'customerPort':{'type':Sequelize[_0xf06e('0x4')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xf06e('0x0')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 5a46644..cece8a8 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 _0x9a19=['request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','sendStatus','end','status','json','limit','undefined','count','offset','set','update','destroy','stack','name','send','render','merge','body','contact','agent','Users','map','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','abandoned','total','closed','UserId','disposition','unmanaged','index','ChatInteraction','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','length','find','value','having','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','buildExpression','start','some','compact','isEmpty','ChatWebsiteId','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','role','sequelize','toString','a.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','c.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','groupBy','ChatInteractionId','all','rows','params','includeAll','create','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','ValidationError','Sequelize','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','AbandonInteraction','attachmentUpload','originalname','basename','file','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','Messages','agentAlias','System','customer','%s%d','Visitor','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','rawAttributes','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','getMyMessages','secret','includeAgent','alias','addTags','setTags','Tag','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','get','mkdirSync','Chat','Owner','closedAt','referer','customerIp','customerPort','N.A.','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http'];(function(_0x2eb485,_0x151f1c){var _0x41e119=function(_0x12e481){while(--_0x12e481){_0x2eb485['push'](_0x2eb485['shift']());}};_0x41e119(++_0x151f1c);}(_0x9a19,0x114));var _0x99a1=function(_0x3a0ebd,_0x47f368){_0x3a0ebd=_0x3a0ebd-0x0;var _0x51a660=_0x9a19[_0x3a0ebd];return _0x51a660;};'use strict';var rimraf=require(_0x99a1('0x0'));var zipdir=require(_0x99a1('0x1'));var rp=require(_0x99a1('0x2'));var moment=require('moment');var BPromise=require(_0x99a1('0x3'));var Mustache=require(_0x99a1('0x4'));var util=require(_0x99a1('0x5'));var path=require(_0x99a1('0x6'));var ejs=require(_0x99a1('0x7'));var fs=require('fs');var _=require(_0x99a1('0x8'));var squel=require(_0x99a1('0x9'));var Redis=require(_0x99a1('0xa'));var qs=require(_0x99a1('0xb'));var as=require(_0x99a1('0xc'));var pdf=require(_0x99a1('0xd'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x99a1('0xe'))['db'];config[_0x99a1('0xf')]=_['defaults'](config['redis'],{'host':_0x99a1('0x10'),'port':0x18eb});var socket=require(_0x99a1('0x11'))(new Redis(config[_0x99a1('0xf')]));require(_0x99a1('0x12'))[_0x99a1('0x13')](socket);var jayson=require('jayson/promise');var client=jayson[_0x99a1('0x14')][_0x99a1('0x15')]({'port':0x232b});var client9004=jayson[_0x99a1('0x14')][_0x99a1('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x2c68dd,_0x1bc7aa,_0x2ff655,_0x532f56){return new BPromise(function(_0xf713b9,_0x40c19c){var _0x3a865c=_0x532f56||client;return _0x3a865c[_0x99a1('0x16')](_0x2c68dd,_0x2ff655)[_0x99a1('0x17')](function(_0x3c9ef4){logger[_0x99a1('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x1bc7aa,_0x99a1('0x19'));logger[_0x99a1('0x1a')](_0x99a1('0x1b'),_0x1bc7aa,_0x99a1('0x19'),JSON[_0x99a1('0x1c')](_0x3c9ef4));if(_0x3c9ef4[_0x99a1('0x1d')]){if(_0x3c9ef4[_0x99a1('0x1d')]['code']===0x1f4){logger['error'](_0x99a1('0x1e'),_0x1bc7aa,_0x3c9ef4[_0x99a1('0x1d')][_0x99a1('0x1f')]);return _0x40c19c(_0x3c9ef4[_0x99a1('0x1d')][_0x99a1('0x1f')]);}logger[_0x99a1('0x1d')](_0x99a1('0x1e'),_0x1bc7aa,_0x3c9ef4[_0x99a1('0x1d')][_0x99a1('0x1f')]);return _0xf713b9(_0x3c9ef4[_0x99a1('0x1d')][_0x99a1('0x1f')]);}else{logger['info'](_0x99a1('0x1e'),_0x1bc7aa,_0x99a1('0x19'));_0xf713b9(_0x3c9ef4['result'][_0x99a1('0x1f')]);}})['catch'](function(_0x458ed3){logger[_0x99a1('0x1d')](_0x99a1('0x1e'),_0x1bc7aa,_0x458ed3);_0x40c19c(_0x458ed3);});});}function respondWithStatusCode(_0x2d3b82,_0x5a88c6){_0x5a88c6=_0x5a88c6||0xcc;return function(_0x3eab51){if(_0x3eab51){return _0x2d3b82[_0x99a1('0x20')](_0x5a88c6);}return _0x2d3b82['status'](_0x5a88c6)[_0x99a1('0x21')]();};}function respondWithResult(_0x5b5dfa,_0x1f9800){_0x1f9800=_0x1f9800||0xc8;return function(_0x1e5cc6){if(_0x1e5cc6){return _0x5b5dfa[_0x99a1('0x22')](_0x1f9800)[_0x99a1('0x23')](_0x1e5cc6);}};}function respondWithFilteredResult(_0x3c813,_0x491341){return function(_0x4fe7f7){if(_0x4fe7f7){var _0x114b38=typeof _0x491341['offset']==='undefined'&&typeof _0x491341[_0x99a1('0x24')]===_0x99a1('0x25');var _0xa6799b=_0x4fe7f7[_0x99a1('0x26')];var _0x25d560=_0x114b38?0x0:_0x491341[_0x99a1('0x27')];var _0x183037=_0x114b38?_0x4fe7f7['count']:_0x491341[_0x99a1('0x27')]+_0x491341['limit'];var _0x255197;if(_0x183037>=_0xa6799b){_0x183037=_0xa6799b;_0x255197=0xc8;}else{_0x255197=0xce;}_0x3c813[_0x99a1('0x22')](_0x255197);return _0x3c813[_0x99a1('0x28')]('Content-Range',_0x25d560+'-'+_0x183037+'/'+_0xa6799b)[_0x99a1('0x23')](_0x4fe7f7);}return null;};}function saveUpdates(_0x2ab46b){return function(_0x5718b9){if(_0x5718b9){return _0x5718b9[_0x99a1('0x29')](_0x2ab46b)[_0x99a1('0x17')](function(_0x36aa34){return _0x36aa34;});}return null;};}function removeEntity(_0x303d1e){return function(_0x2a5b8c){if(_0x2a5b8c){return _0x2a5b8c[_0x99a1('0x2a')]()[_0x99a1('0x17')](function(){_0x303d1e[_0x99a1('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4960e4){return function(_0x3fa342){if(!_0x3fa342){_0x4960e4['sendStatus'](0x194);}return _0x3fa342;};}function handleError(_0x38e383,_0x400581){_0x400581=_0x400581||0x1f4;return function(_0x5b1a79){logger[_0x99a1('0x1d')](_0x5b1a79[_0x99a1('0x2b')]);if(_0x5b1a79[_0x99a1('0x2c')]){delete _0x5b1a79[_0x99a1('0x2c')];}_0x38e383[_0x99a1('0x22')](_0x400581)[_0x99a1('0x2d')](_0x5b1a79);};}function getMustacheRender(_0x3081cd,_0x38bb91){return Mustache[_0x99a1('0x2e')](_0x3081cd,_[_0x99a1('0x2f')](_0x38bb91[_0x99a1('0x30')],{'contact':_0x38bb91[_0x99a1('0x31')],'message':_0x38bb91[_0x99a1('0x1f')],'agent':_0x38bb91[_0x99a1('0x32')],'interaction':_0x38bb91['interaction'],'account':_0x38bb91['account']}))||'';}function getInteractionUsers(_0x46e3f2,_0x5424eb){return new BPromise(function(_0x416a36,_0x4131e0){try{if(_0x5424eb[_0x46e3f2['id']]){_0x46e3f2[_0x99a1('0x33')]=_[_0x99a1('0x34')](_0x5424eb[_0x46e3f2['id']],function(_0x318dab){return{'id':_0x318dab['id'],'fullname':_0x318dab['fullname']};});}}catch(_0x355f9d){_0x4131e0(_0x355f9d);}_0x416a36(_0x46e3f2);});}function getInteractionTags(_0x506613,_0x551d85){return new BPromise(function(_0x26ce0e,_0x2d328c){try{if(_0x506613[_0x99a1('0x35')]){_0x506613[_0x99a1('0x36')]=[];_0x506613[_0x99a1('0x35')][_0x99a1('0x37')](',')[_0x99a1('0x38')](function(_0x2f8135){_0x506613[_0x99a1('0x36')][_0x99a1('0x39')](_0x551d85[_0x2f8135]);});}delete _0x506613[_0x99a1('0x35')];}catch(_0x152969){_0x2d328c(_0x152969);}_0x26ce0e(_0x506613);});}function updateChatInteraction(_0x1f224c,_0x5018e9,_0x5553e4){return new BPromise(function(_0x485969,_0x29e884){return getInteractionUsers(_0x1f224c,_0x5553e4)[_0x99a1('0x17')](function(_0x1d3f85){return getInteractionTags(_0x1d3f85,_0x5018e9);})[_0x99a1('0x17')](function(_0x40613a){return getStateInteraction(_0x40613a);})['then'](function(_0x157d0c){_0x485969(_0x157d0c);})[_0x99a1('0x3a')](function(_0x32ee4c){_0x29e884(_0x32ee4c);});});}function getStateInteraction(_0x51efe5){return new BPromise(function(_0x49be37){_0x51efe5[_0x99a1('0x3b')]=0x0;_0x51efe5[_0x99a1('0x3c')]=0x0;_0x51efe5[_0x99a1('0x3d')]=0x0;_0x51efe5['unmanaged']=0x0;_0x51efe5[_0x99a1('0x3e')]=0x0;_0x51efe5[_0x99a1('0x3f')]=0x0;if(!_0x51efe5[_0x99a1('0x40')]&&!_0x51efe5[_0x99a1('0x41')]){_0x51efe5[_0x99a1('0x3b')]+=0x1;}if(!_0x51efe5[_0x99a1('0x40')]&&_0x51efe5[_0x99a1('0x41')]){_0x51efe5[_0x99a1('0x3c')]+=0x1;if(_0x51efe5[_0x99a1('0x3b')]){_0x51efe5[_0x99a1('0x3b')]-=0x1;}}if(_0x51efe5['closed']&&_0x51efe5[_0x99a1('0x42')]===_0x99a1('0x3e')){_0x51efe5[_0x99a1('0x3e')]+=0x1;if(_0x51efe5['waiting']){_0x51efe5[_0x99a1('0x3b')]-=0x1;}}else if(_0x51efe5['closed']&&!_0x51efe5[_0x99a1('0x41')]&&_0x51efe5[_0x99a1('0x42')]){_0x51efe5[_0x99a1('0x43')]+=0x1;if(_0x51efe5[_0x99a1('0x3b')]){_0x51efe5[_0x99a1('0x3b')]-=0x1;}}else if(_0x51efe5[_0x99a1('0x40')]&&_0x51efe5['UserId']){_0x51efe5[_0x99a1('0x3d')]+=0x1;if(_0x51efe5['talking']){_0x51efe5[_0x99a1('0x3c')]-=0x1;}}_0x51efe5[_0x99a1('0x3f')]+=0x1;_0x49be37(_0x51efe5);});}exports[_0x99a1('0x44')]=function(_0x278e22,_0x3a0b44){var _0x67992={},_0x31db25={},_0x3861b6={'count':0x0,'rows':[]};var _0x61c259=_[_0x99a1('0x34')](db[_0x99a1('0x45')]['rawAttributes'],function(_0x3c1f55){return{'name':_0x3c1f55[_0x99a1('0x46')],'type':_0x3c1f55['type'][_0x99a1('0x47')]};});_0x31db25[_0x99a1('0x48')]=_[_0x99a1('0x34')](_0x61c259,_0x99a1('0x2c'));_0x31db25[_0x99a1('0x49')]=_[_0x99a1('0x4a')](_0x278e22[_0x99a1('0x49')]);_0x31db25['filters']=_[_0x99a1('0x4b')](_0x31db25['model'],_0x31db25[_0x99a1('0x49')]);_0x67992[_0x99a1('0x4c')]=_['intersection'](_0x31db25['model'],qs[_0x99a1('0x4d')](_0x278e22[_0x99a1('0x49')][_0x99a1('0x4d')]));_0x67992[_0x99a1('0x4c')]=_0x67992[_0x99a1('0x4c')]['length']?_0x67992['attributes']:_0x31db25['model'];if(!_0x278e22[_0x99a1('0x49')][_0x99a1('0x4e')](_0x99a1('0x4f'))){_0x67992[_0x99a1('0x24')]=qs[_0x99a1('0x24')](_0x278e22[_0x99a1('0x49')][_0x99a1('0x24')]);_0x67992['offset']=qs[_0x99a1('0x27')](_0x278e22[_0x99a1('0x49')][_0x99a1('0x27')]);}_0x67992['order']=qs[_0x99a1('0x50')](_0x278e22['query']['sort']);_0x67992[_0x99a1('0x51')]=qs[_0x99a1('0x52')](_[_0x99a1('0x53')](_0x278e22[_0x99a1('0x49')],_0x31db25[_0x99a1('0x52')]),_0x61c259);var _0xf8208a=[];var _0x240d2e=squel[_0x99a1('0x54')]()[_0x99a1('0x55')]('id')['field'](_0x99a1('0x2c'))['field'](_0x99a1('0x56'))[_0x99a1('0x57')]('tools_tags');var _0x2cc320=squel[_0x99a1('0x54')]()[_0x99a1('0x55')](_0x99a1('0x58'))[_0x99a1('0x55')](_0x99a1('0x59'))[_0x99a1('0x55')](_0x99a1('0x5a'))[_0x99a1('0x57')](_0x99a1('0x5b'),'ui')[_0x99a1('0x5c')](_0x99a1('0x5d'),'u','u.id\x20=\x20ui.UserId');var _0x4f64b7=squel[_0x99a1('0x54')]()[_0x99a1('0x57')](_0x99a1('0x5e'),'i')[_0x99a1('0x5c')](_0x99a1('0x5f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x99a1('0x5c')](_0x99a1('0x5d'),'o','o.id\x20=\x20i.UserId')[_0x99a1('0x5c')](_0x99a1('0x60'),'a',_0x99a1('0x61'))[_0x99a1('0x5c')](_0x99a1('0x62'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x99a1('0x5c')](_0x99a1('0x63'),'it',_0x99a1('0x64'))[_0x99a1('0x5c')](_0x99a1('0x65'),'t',_0x99a1('0x66'));var _0x59260e=squel[_0x99a1('0x67')]();var _0x1e65fa=[];var _0x5d67c1=squel[_0x99a1('0x67')]();var _0x2b228e;if(_0x278e22[_0x99a1('0x49')][_0x99a1('0x68')]){_0x2b228e=as[_0x99a1('0x69')](_0x278e22['query'][_0x99a1('0x68')]);var _0x5d250a=_0x2b228e['sqlOperator'];for(var _0x5cbf98=0x0;_0x5cbf98<_0x2b228e[_0x99a1('0x6a')][_0x99a1('0x6b')];_0x5cbf98++){var _0x548952=_0x2b228e['conditions'][_0x5cbf98];var _0x2c605f='i';var _0x49f8fa=_[_0x99a1('0x6c')](_0x61c259,[_0x99a1('0x2c'),_0x548952[_0x99a1('0x55')]]);if(!_0x49f8fa){switch(_0x548952[_0x99a1('0x55')]){case'unreadMessages':if(_0x548952[_0x99a1('0x6d')]==0x1){_0x4f64b7[_0x99a1('0x6e')]('`'+_0x548952[_0x99a1('0x55')]+'`\x20=\x200');}else{_0x4f64b7[_0x99a1('0x6e')]('`'+_0x548952['field']+_0x99a1('0x6f'));}break;case _0x99a1('0x70'):if(_0x548952[_0x99a1('0x71')]===_0x99a1('0x72')){if(_0x548952[_0x99a1('0x6d')]['split']('\x20')['length']>0x1){_0x59260e[_0x5d250a]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x99a1('0x73')](_0x548952[_0x99a1('0x6d')]),null);}else{var _0x4ad713='%'+_0x548952['value']+'%';_0x59260e[_0x5d250a](_0x99a1('0x74'),_0x4ad713,_0x4ad713,_0x4ad713);}}else{_0x49f8fa=_[_0x99a1('0x6c')](_0x61c259,[_0x99a1('0x2c'),'ContactId']);_0x548952['field']=_0x99a1('0x75');_0x19e306=as['buildExpression'](_0x2c605f,_0x49f8fa[_0x99a1('0x76')],_0x548952);_0x59260e[_0x5d250a](_0x19e306[_0x99a1('0x77')],_0x19e306[_0x99a1('0x6d')]['start'],_0x19e306[_0x99a1('0x6d')][_0x99a1('0x21')]);}break;case'Tag':var _0x4c14ed=_0x548952[_0x99a1('0x6d')]['split'](',')[_0x99a1('0x34')](function(_0x3a5f6a){return Number(_0x3a5f6a);});_0x4c14ed[_0x99a1('0x38')](function(_0x57817e){_0x5d67c1['or'](_0x99a1('0x78'),'%,'+_0x57817e+',%');});_0x1e65fa=_[_0x99a1('0x79')](_0x1e65fa,_0x4c14ed);break;case _0x99a1('0x7a'):if(_0x548952[_0x99a1('0x71')]===_0x99a1('0x72')){_0x59260e[_0x5d250a]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x548952['value']+'%',null);}else{_0x49f8fa=_[_0x99a1('0x6c')](_0x61c259,[_0x99a1('0x2c'),_0x99a1('0x41')]);_0x548952[_0x99a1('0x55')]='UserId';_0x19e306=as[_0x99a1('0x7b')](_0x2c605f,_0x49f8fa['type'],_0x548952);_0x59260e[_0x5d250a](_0x19e306['text'],_0x19e306[_0x99a1('0x6d')][_0x99a1('0x7c')],_0x19e306[_0x99a1('0x6d')]['end']);}break;case _0x99a1('0x30'):_0x19e306=as[_0x99a1('0x7b')]('me',null,_0x548952);_0x59260e[_0x5d250a](_0x19e306[_0x99a1('0x77')],_0x19e306[_0x99a1('0x6d')][_0x99a1('0x7c')],_0x19e306['value'][_0x99a1('0x21')]);break;}}else{var _0x19e306=as[_0x99a1('0x7b')](_0x2c605f,_0x49f8fa[_0x99a1('0x76')],_0x548952);_0x59260e[_0x5d250a](_0x19e306[_0x99a1('0x77')],_0x19e306[_0x99a1('0x6d')]['start'],_0x19e306[_0x99a1('0x6d')][_0x99a1('0x21')]);}}}else{var _0x2421bc=_(_0x278e22[_0x99a1('0x49')])[_0x99a1('0x4a')]()['map'](function(_0x18843d){return _[_0x99a1('0x7d')](_0x61c259,[_0x99a1('0x2c'),_0x18843d])?_0x18843d:undefined;})[_0x99a1('0x7e')]()[_0x99a1('0x6d')]();if(!_[_0x99a1('0x7f')](_0x2421bc)){_0x2421bc['forEach'](function(_0xaa953e){if(_0xaa953e===_0x99a1('0x80')){_0x4f64b7['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x99a1('0x81')](_0x278e22[_0x99a1('0x49')][_0xaa953e]));}else if(_0xaa953e==='createdAt'){var _0x2f2b17=JSON[_0x99a1('0x82')](_0x278e22[_0x99a1('0x49')][_0xaa953e])[_0x99a1('0x83')];var _0x43156f=JSON[_0x99a1('0x82')](_0x278e22[_0x99a1('0x49')][_0xaa953e])[_0x99a1('0x84')];_0x4f64b7[_0x99a1('0x51')](_0x99a1('0x85'),_0x2f2b17,_0x43156f);}else{if(_0x278e22[_0x99a1('0x49')][_0xaa953e]===_0x99a1('0x86')){_0x4f64b7[_0x99a1('0x51')]('i.'+_0xaa953e+'\x20IS\x20NULL');}else{_0x4f64b7[_0x99a1('0x51')]('i.'+_0xaa953e+'\x20=\x20?',_0x278e22['query'][_0xaa953e]);}}});}if(_0x278e22[_0x99a1('0x49')][_0x99a1('0x87')]){if(_0x278e22[_0x99a1('0x49')][_0x99a1('0x87')]==0x1){_0x4f64b7[_0x99a1('0x6e')](_0x99a1('0x88'));}else{_0x4f64b7[_0x99a1('0x6e')](_0x99a1('0x89'));}}if(_0x278e22[_0x99a1('0x49')]['tag']){_0x1e65fa=_[_0x99a1('0x8a')](_0x278e22[_0x99a1('0x49')][_0x99a1('0x8b')])?_0x278e22[_0x99a1('0x49')][_0x99a1('0x8b')]:new Array(_0x278e22[_0x99a1('0x49')][_0x99a1('0x8b')]);_0x1e65fa[_0x99a1('0x38')](function(_0x4f9ed2){_0x5d67c1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4f9ed2+',%');});}if(_0x278e22['query'][_0x99a1('0x8c')]){var _0x353f25=_0x278e22['query'][_0x99a1('0x8c')][_0x99a1('0x8d')]('\x5c','\x5c\x5c')[_0x99a1('0x8d')](/'/g,'\x27\x27');if(qs[_0x99a1('0x8e')](_0x353f25)){_0x59260e['or']('i.id\x20LIKE\x20?',_0x353f25+'%');}else{_0x59260e['or'](_0x99a1('0x8f'),qs[_0x99a1('0x73')](_0x353f25))['or'](_0x99a1('0x90'),_0x353f25+'%');}}}_0x4f64b7[_0x99a1('0x51')](_0x59260e);_0x4f64b7['group'](_0x99a1('0x91'));var _0x4e80d9={'type':db['Sequelize']['QueryTypes'][_0x99a1('0x92')],'raw':!![]};var _0x47e2fd=_0x4f64b7[_0x99a1('0x93')]();_0x47e2fd[_0x99a1('0x55')](_0x99a1('0x91'));_0x47e2fd[_0x99a1('0x55')](_0x99a1('0x94'),_0x99a1('0x95'));if(_0x67992[_0x99a1('0x96')]){_0x67992['order']['forEach'](function(_0x42e229){var _0x14cd7d=_0x42e229[0x0]===_0x99a1('0x97')?_0x42e229[0x0]:'i.'+_0x42e229[0x0];_0x4f64b7['order'](_0x14cd7d,_0x42e229[0x1]===_0x99a1('0x98')?![]:!![]);});}if(!_[_0x99a1('0x7f')](_0x1e65fa)){_0x4f64b7[_0x99a1('0x6e')](_0x5d67c1);_0x47e2fd['where'](_0x99a1('0x99'),_0x1e65fa);}BPromise[_0x99a1('0x9a')]()[_0x99a1('0x17')](function(){if(!_0x2b228e){if(_0x278e22['query']['ChatWebsiteId'])return;_0x47e2fd[_0x99a1('0x51')](_0x99a1('0x9b'));_0x4f64b7[_0x99a1('0x51')](_0x99a1('0x9b'));return;}if(_0x278e22[_0x99a1('0x9c')]['role']!==_0x99a1('0x32'))return;return _0x278e22['user'][_0x99a1('0x9d')]({'attributes':['id'],'raw':!![]})[_0x99a1('0x17')](function(_0x5b7cdf){if(_[_0x99a1('0x7f')](_0x5b7cdf)){_0x47e2fd[_0x99a1('0x51')](_0x99a1('0x9e'));_0x4f64b7['where'](_0x99a1('0x9e'));}else{_0x47e2fd[_0x99a1('0x51')](_0x99a1('0x9f'),_[_0x99a1('0x34')](_0x5b7cdf,'id'));_0x4f64b7[_0x99a1('0x51')]('i.ChatWebsiteId\x20IN\x20?',_[_0x99a1('0x34')](_0x5b7cdf,'id'));}});})['then'](function(){if(_0x278e22[_0x99a1('0x9c')][_0x99a1('0xa0')]==='agent'&&!_0x2b228e&&!_0x278e22[_0x99a1('0x49')]['ChatWebsiteId'])return[];return db[_0x99a1('0xa1')][_0x99a1('0x49')](_0x47e2fd[_0x99a1('0xa2')](),_0x4e80d9);})[_0x99a1('0x17')](function(_0x188b9e){_0x3861b6[_0x99a1('0x26')]=_0x188b9e['length'];if(_0x3861b6[_0x99a1('0x26')]===0x0)return[];return db[_0x99a1('0xa1')]['query'](_0x240d2e[_0x99a1('0xa2')](),_0x4e80d9)[_0x99a1('0x17')](function(_0x1d905e){_0xf8208a=_['keyBy'](_0x1d905e,'id');_0x4e80d9=_[_0x99a1('0x2f')](_0x4e80d9,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x278e22[_0x99a1('0x49')][_0x99a1('0x4d')]){_0x67992[_0x99a1('0x4c')][_0x99a1('0x38')](function(_0x409bc3){_0x4f64b7['field']('i.'+_0x409bc3);});}else{_0x4f64b7[_0x99a1('0x55')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x4f64b7[_0x99a1('0x55')](_0x99a1('0xa3'),'Account.key');_0x4f64b7[_0x99a1('0x55')](_0x99a1('0xa4'),_0x99a1('0xa5'));_0x4f64b7['field'](_0x99a1('0xa6'),_0x99a1('0x97'));_0x4f64b7[_0x99a1('0x55')]('i.*');_0x4f64b7[_0x99a1('0x55')](_0x99a1('0xa7'),'Contact.firstName');_0x4f64b7[_0x99a1('0x55')](_0x99a1('0xa8'),'Contact.lastName');_0x4f64b7['field'](_0x99a1('0xa9'),_0x99a1('0xaa'));_0x4f64b7[_0x99a1('0x55')]('c.phone',_0x99a1('0xab'));_0x4f64b7[_0x99a1('0x55')](_0x99a1('0xac'),_0x99a1('0xad'));_0x4f64b7[_0x99a1('0x55')](_0x99a1('0xae'),'Contact.fax');_0x4f64b7['field']('o.fullname',_0x99a1('0xaf'));_0x4f64b7[_0x99a1('0x55')](_0x99a1('0xb0'),_0x99a1('0xb1'));_0x4f64b7[_0x99a1('0x55')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x99a1('0x35'));}if(_0x67992[_0x99a1('0x24')])_0x4f64b7['limit'](_0x67992['limit']);if(_0x67992[_0x99a1('0x27')])_0x4f64b7[_0x99a1('0x27')](_0x67992[_0x99a1('0x27')]);return db['sequelize'][_0x99a1('0x49')](_0x4f64b7['toString'](),_0x4e80d9);})[_0x99a1('0x17')](function(_0x50bd70){if(_0x50bd70[_0x99a1('0x6b')]>0x0)_0x2cc320[_0x99a1('0x51')]('ui.ChatInteractionId\x20IN\x20?',_[_0x99a1('0x34')](_0x50bd70,'id'));return db[_0x99a1('0xa1')]['query'](_0x2cc320[_0x99a1('0xa2')](),_0x4e80d9)[_0x99a1('0x17')](function(_0xa40c63){var _0x2fdee5=_[_0x99a1('0xb2')](_0xa40c63,_0x99a1('0xb3'));var _0x44bd17=[];_0x50bd70['forEach'](function(_0x5bc396){_0x44bd17[_0x99a1('0x39')](updateChatInteraction(_0x5bc396,_0xf8208a,_0x2fdee5));});return BPromise[_0x99a1('0xb4')](_0x44bd17);});});})['then'](function(_0x48303a){_0x3861b6[_0x99a1('0xb5')]=_0x48303a;return _0x3861b6;})['then'](respondWithFilteredResult(_0x3a0b44,_0x67992))['catch'](handleError(_0x3a0b44,null));};exports['show']=function(_0x319ccb,_0x5be52b){var _0x445b69={'raw':![],'where':{'id':_0x319ccb[_0x99a1('0xb6')]['id']}},_0x40ca30={};_0x40ca30[_0x99a1('0x48')]=_[_0x99a1('0x4a')](db[_0x99a1('0x45')]['rawAttributes']);_0x40ca30[_0x99a1('0x49')]=_[_0x99a1('0x4a')](_0x319ccb[_0x99a1('0x49')]);_0x40ca30[_0x99a1('0x52')]=_[_0x99a1('0x4b')](_0x40ca30['model'],_0x40ca30[_0x99a1('0x49')]);_0x445b69[_0x99a1('0x4c')]=_[_0x99a1('0x4b')](_0x40ca30[_0x99a1('0x48')],qs[_0x99a1('0x4d')](_0x319ccb[_0x99a1('0x49')][_0x99a1('0x4d')]));_0x445b69[_0x99a1('0x4c')]=_0x445b69['attributes'][_0x99a1('0x6b')]?_0x445b69[_0x99a1('0x4c')]:_0x40ca30[_0x99a1('0x48')];if(_0x319ccb[_0x99a1('0x49')][_0x99a1('0xb7')]){_0x445b69['include']=[{'all':!![]}];}_0x445b69=_[_0x99a1('0x2f')]({},_0x445b69,_0x319ccb['options']);return db[_0x99a1('0x45')][_0x99a1('0x6c')](_0x445b69)[_0x99a1('0x17')](handleEntityNotFound(_0x5be52b,null))[_0x99a1('0x17')](respondWithResult(_0x5be52b,null))['catch'](handleError(_0x5be52b,null));};exports[_0x99a1('0xb8')]=function(_0x28fb61,_0x3f029e){return db['ChatInteraction'][_0x99a1('0xb8')](_0x28fb61[_0x99a1('0x30')],{})[_0x99a1('0x17')](respondWithResult(_0x3f029e,0xc9))[_0x99a1('0x3a')](handleError(_0x3f029e,null));};exports[_0x99a1('0x29')]=function(_0x2a5d6f,_0x41e5f6){if(_0x2a5d6f[_0x99a1('0x30')]['id']){delete _0x2a5d6f[_0x99a1('0x30')]['id'];}return db[_0x99a1('0x45')][_0x99a1('0x6c')]({'where':{'id':_0x2a5d6f['params']['id']}})[_0x99a1('0x17')](handleEntityNotFound(_0x41e5f6,null))['then'](saveUpdates(_0x2a5d6f[_0x99a1('0x30')],null))[_0x99a1('0x17')](respondWithResult(_0x41e5f6,null))[_0x99a1('0x3a')](handleError(_0x41e5f6,null));};exports['destroy']=function(_0x1813c7,_0x60c710){return db['ChatInteraction'][_0x99a1('0x6c')]({'where':{'id':_0x1813c7['params']['id']}})[_0x99a1('0x17')](handleEntityNotFound(_0x60c710,null))[_0x99a1('0x17')](removeEntity(_0x60c710,null))[_0x99a1('0x3a')](handleError(_0x60c710,null));};exports[_0x99a1('0xb9')]=function(_0x61013d,_0x53416a){return db[_0x99a1('0x45')][_0x99a1('0xb9')]()['then'](respondWithResult(_0x53416a,null))[_0x99a1('0x3a')](handleError(_0x53416a,null));};exports['createVidaooSession']=function(_0x4d0c1f,_0x7e84d6){var _0x109a1b=_0x4d0c1f[_0x99a1('0xb6')]['id'];var _0x2ed167;var _0x12a2d9;var _0x122c45;return db[_0x99a1('0x45')][_0x99a1('0xba')]({'where':{'id':_0x109a1b}})[_0x99a1('0x17')](function(_0x42b7b3){_0x2ed167=_0x42b7b3;return db[_0x99a1('0xbb')][_0x99a1('0xba')]({'where':{'id':_0x42b7b3['ChatWebsiteId']},'attributes':['id',_0x99a1('0xbc'),_0x99a1('0xbd'),_0x99a1('0xbe'),_0x99a1('0xbf'),_0x99a1('0xc0')],'raw':!![]});})[_0x99a1('0x17')](function(_0x55dfd5){if(_0x55dfd5&&_0x55dfd5[_0x99a1('0xbc')]&&_0x55dfd5[_0x99a1('0xbd')]){_0x12a2d9=_0x55dfd5;var _0x240af8={'interaction':{'id':_0x109a1b},'agent':{'id':_0x4d0c1f[_0x99a1('0x9c')]['id'],'name':_0x4d0c1f['user']['name'],'fullname':_0x4d0c1f[_0x99a1('0x9c')][_0x99a1('0xc1')],'email':_0x4d0c1f[_0x99a1('0x9c')][_0x99a1('0xc2')]},'contact':_0x4d0c1f[_0x99a1('0x30')][_0x99a1('0x31')],'account':_0x4d0c1f[_0x99a1('0x30')][_0x99a1('0xc3')]};var _0x171f69={'rejectUnauthorized':![],'method':_0x99a1('0xc4'),'url':_0x99a1('0xc5'),'headers':{'X-APIKEY':_0x55dfd5[_0x99a1('0xbc')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4d0c1f[_0x99a1('0x9c')][_0x99a1('0xc2')]],'buttons':null,'topic':_0x12a2d9[_0x99a1('0xbe')],'note':_[_0x99a1('0xc6')](_0x12a2d9['vidaooNote'])?null:getMustacheRender(_0x12a2d9[_0x99a1('0xbf')],_0x240af8),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x99a1('0xc6')](_0x12a2d9[_0x99a1('0xc0')])){var _0x5db133=getMustacheRender(_0x12a2d9['vidaooMetadata'],_0x240af8);var _0x4dec67=JSON[_0x99a1('0x82')](_0x5db133);_0x171f69['body'][_0x99a1('0xc7')]=_0x4dec67;}}catch(_0x4c7e31){throw new db['Sequelize'][(_0x99a1('0xc8'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x171f69);}else{throw new db[(_0x99a1('0xc9'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x99a1('0x17')](function(_0xce4e39){_0x122c45=_0xce4e39;if(_0x122c45['id']){var _0x5060b3={'body':_0x122c45[_0x99a1('0xca')],'ChatWebsiteId':_0x12a2d9['id'],'ChatInteractionId':_0x2ed167['id'],'direction':_0x99a1('0xcb'),'UserId':_0x4d0c1f[_0x99a1('0x9c')]['id']};return db[_0x99a1('0xcc')][_0x99a1('0xb8')](_0x5060b3,{});}else{throw new db['Sequelize']['ValidationError'](_0x99a1('0xcd'));}})[_0x99a1('0x17')](function(){return _0x2ed167[_0x99a1('0xce')]({'vidaooSessionId':_0x122c45['id']});})[_0x99a1('0x17')](respondWithResult(_0x7e84d6,null))[_0x99a1('0x3a')](handleError(_0x7e84d6,null));};exports['customUpdate']=function(_0x557d9c,_0x46d0d3){if(_0x557d9c[_0x99a1('0x30')]['id']){delete _0x557d9c[_0x99a1('0x30')]['id'];}return db[_0x99a1('0x45')][_0x99a1('0x6c')]({'where':{'id':_0x557d9c[_0x99a1('0xb6')]['id']},'include':[{'model':db[_0x99a1('0xcf')],'as':_0x99a1('0x70')}]})[_0x99a1('0x17')](handleEntityNotFound(_0x46d0d3,null))[_0x99a1('0x17')](saveUpdates(_0x557d9c[_0x99a1('0x30')],null))[_0x99a1('0x17')](respondWithResult(_0x46d0d3,null))[_0x99a1('0x3a')](handleError(_0x46d0d3,null));};exports[_0x99a1('0xd0')]=function(_0x236f79,_0x49debb){if(_0x236f79[_0x99a1('0x30')]['id']){delete _0x236f79[_0x99a1('0x30')]['id'];}return db[_0x99a1('0x45')][_0x99a1('0x6c')]({'where':{'id':_0x236f79[_0x99a1('0xb6')]['id']}})[_0x99a1('0x17')](function(_0x3acb34){if(!_0x3acb34){logger[_0x99a1('0x1d')](_0x99a1('0xd1'),_0x99a1('0xd0'),0x194,_0x99a1('0xd2'));_0x49debb['sendStatus'](0x194);}else{if(_0x3acb34['UserId']){throw new db[(_0x99a1('0xc9'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x3acb34;})['then'](function(_0x793d63){if(_0x793d63){return _0x793d63[_0x99a1('0x29')]({'closed':_0x236f79[_0x99a1('0x30')][_0x99a1('0x40')],'disposition':_0x236f79[_0x99a1('0x30')][_0x99a1('0x42')]})[_0x99a1('0x17')](function(_0x41a990){return _0x41a990;});}})[_0x99a1('0x17')](function(){return respondWithRpcPromise(_0x99a1('0xd3'),_0x99a1('0xd0'),_0x236f79[_0x99a1('0x30')],client9004);})[_0x99a1('0x17')](respondWithResult(_0x49debb,null))[_0x99a1('0x3a')](handleError(_0x49debb,null));};exports[_0x99a1('0xd4')]=function(_0x316d8b,_0x4eaf77){_0x316d8b[_0x99a1('0x30')][_0x99a1('0x2c')]=_0x316d8b['file'][_0x99a1('0xd5')];_0x316d8b[_0x99a1('0x30')][_0x99a1('0xd6')]=_0x316d8b[_0x99a1('0xd7')]['filename'];_0x316d8b[_0x99a1('0x30')]['type']=_0x316d8b['file']['mimetype'];return db['Attachment'][_0x99a1('0xb8')](_0x316d8b[_0x99a1('0x30')])['then'](respondWithResult(_0x4eaf77,0xc9))['catch'](handleError(_0x4eaf77,null));};exports['attachmentDownload']=function(_0x2d8190,_0x4f736b){return db['ChatInteraction'][_0x99a1('0xba')]({'where':{'id':_0x2d8190[_0x99a1('0xb6')]['id']},'raw':!![]})[_0x99a1('0x17')](handleEntityNotFound(_0x4f736b,null))[_0x99a1('0x17')](function(_0x191f1a){if(_0x191f1a){if(_0x191f1a[_0x99a1('0x40')]){return _0x4f736b[_0x99a1('0x22')](0x193)[_0x99a1('0x23')]({'status':0x193,'message':_0x99a1('0xd8')});}return db[_0x99a1('0xd9')]['findOne']({'where':{'id':_0x2d8190[_0x99a1('0x49')][_0x99a1('0xda')]},'raw':!![]})['then'](handleEntityNotFound(_0x4f736b,null));}})[_0x99a1('0x17')](function(_0xf172b3){if(_0xf172b3){var _0x22757d=_0xf172b3[_0x99a1('0xdb')]!==null;var _0x13d3f2=path[_0x99a1('0xdc')](config[_0x99a1('0xdd')],'server/files/attachments/');if(_0x22757d){_0x13d3f2=path[_0x99a1('0xdc')](_0x13d3f2,_0x99a1('0xde'));}var _0x5b9b02=path[_0x99a1('0xdc')](_0x13d3f2,_0xf172b3['basename']);return _0x4f736b[_0x99a1('0xdf')](_0x5b9b02);}})[_0x99a1('0x3a')](handleError(_0x4f736b,null));};exports[_0x99a1('0xe0')]=function(_0x37577e,_0x1ca0cc){var _0x27a06a=null;var _0x2e1a93=null;var _0x5e1ab8=null;if(_0x37577e[_0x99a1('0x30')]['id']){delete _0x37577e['body']['id'];}if(_0x37577e[_0x99a1('0x30')][_0x99a1('0xe1')]){_0x5e1ab8=path['join'](config[_0x99a1('0xdd')],_0x99a1('0xe2'),util[_0x99a1('0xe3')]('transcript-%s.txt',Date['now']()));_0x37577e[_0x99a1('0x30')]['pathTranscript']=_0x5e1ab8;}return db[_0x99a1('0x45')][_0x99a1('0x6c')]({'where':{'id':_0x37577e[_0x99a1('0xb6')]['id']},'include':[{'model':db[_0x99a1('0xcc')],'as':_0x99a1('0xe4'),'include':[{'model':db[_0x99a1('0x7a')],'as':_0x99a1('0x7a')}]}]})[_0x99a1('0x17')](handleEntityNotFound(_0x1ca0cc,null))[_0x99a1('0x17')](saveUpdates(_0x37577e['body'],null))['then'](function(_0x5c1175){if(_0x5c1175){_0x27a06a=_0x5c1175;return db[_0x99a1('0xbb')][_0x99a1('0x6c')]({'where':{'id':_0x27a06a[_0x99a1('0x80')]}});}})[_0x99a1('0x17')](function(_0x9f3ffb){if(_0x9f3ffb){_0x2e1a93=_0x9f3ffb;return db[_0x99a1('0xcf')][_0x99a1('0x6c')]({'where':{'id':_0x27a06a[_0x99a1('0x75')]}});}})[_0x99a1('0x17')](function(_0x529733){if(_0x529733){if(_0x5e1ab8){var _0x4611a7=null;for(var _0xfd2f49=0x1;_0xfd2f49<_0x27a06a['Messages'][_0x99a1('0x6b')];++_0xfd2f49){_0x4611a7=_0x27a06a[_0x99a1('0xe4')][_0xfd2f49];var _0x10bd69=_0x4611a7[_0x99a1('0x41')]?util[_0x99a1('0xe3')]('%s%d',_0x2e1a93[_0x99a1('0xe5')],_0x4611a7[_0x99a1('0x41')]):_0x99a1('0xe6');var _0xa0ab8=_0x37577e[_0x99a1('0x30')][_0x99a1('0xe7')]||util[_0x99a1('0xe3')](_0x99a1('0xe8'),_0x99a1('0xe9'),_0x4611a7[_0x99a1('0x75')]);switch(_0x2e1a93['agentIdentifier']){case _0x99a1('0xea'):_0x10bd69=_0x4611a7[_0x99a1('0x41')]?util[_0x99a1('0xe3')](_0x99a1('0xe8'),_0x2e1a93[_0x99a1('0xe5')],_0x4611a7[_0x99a1('0x41')]):_0x99a1('0xe6');break;case _0x99a1('0xeb'):_0x10bd69=_0x4611a7['UserId']?_0x4611a7[_0x99a1('0x7a')]['alias']||_0x4611a7[_0x99a1('0x7a')]['fullname']:_0x99a1('0xe6');break;case _0x99a1('0xec'):_0x10bd69=_0x4611a7['UserId']?_0x4611a7[_0x99a1('0x7a')][_0x99a1('0xc1')]:_0x99a1('0xe6');break;default:_0x10bd69=_0x4611a7[_0x99a1('0x41')]?util[_0x99a1('0xe3')](_0x99a1('0xe8'),_0x2e1a93['agentAlias'],_0x4611a7[_0x99a1('0x41')]):_0x99a1('0xe6');}var _0x425462=util['format'](_0x99a1('0xed'),moment(_0x4611a7[_0x99a1('0xee')])['format'](_0x99a1('0xef')),_0x4611a7[_0x99a1('0xf0')]==='in'?_0xa0ab8:_0x10bd69,_0x4611a7['body']);if(!_0x4611a7['secret']){fs[_0x99a1('0xf1')](_0x5e1ab8,_0x425462);}}return db[_0x99a1('0xf2')][_0x99a1('0xba')]({'where':{'service':!![]},'include':[{'model':db[_0x99a1('0xf3')],'as':_0x99a1('0xf4'),'raw':!![],'include':[{'model':db[_0x99a1('0xf5')],'as':_0x99a1('0xf5'),'raw':!![]}]}]});}}})['then'](function(_0x342612){if(!_0x342612||!_0x342612[_0x99a1('0xf4')]||!_0x37577e[_0x99a1('0x30')])return _0x27a06a;var _0x5b07bb=_0x342612[_0x99a1('0xf6')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5b07bb,'message':{'from':util[_0x99a1('0xe3')](_0x99a1('0xf7'),_0x342612['name'],_0x342612[_0x99a1('0xc2')]||_0x342612['Smtp'][_0x99a1('0x9c')]),'to':_0x37577e['body']['mailTranscript'],'subject':'Mail\x20Transcript','text':util['format'](_0x99a1('0xf8'),_0x37577e[_0x99a1('0x30')]['mailTranscript']),'attachments':[{'path':_0x5e1ab8}]}})['then'](function(){return _0x27a06a;})[_0x99a1('0x3a')](function(_0x5a35ef){logger[_0x99a1('0x1d')](_0x5a35ef);});})[_0x99a1('0x17')](respondWithStatusCode(_0x1ca0cc,0xc8))[_0x99a1('0x3a')](handleError(_0x1ca0cc,null));};exports['addMessage']=function(_0x548c0a,_0x58ae99){return db[_0x99a1('0xcc')][_0x99a1('0x6c')]({'where':{'id':_0x548c0a[_0x99a1('0xb6')]['id']}})[_0x99a1('0x17')](handleEntityNotFound(_0x58ae99,null))[_0x99a1('0x17')](function(_0x182baf){if(_0x182baf){return _0x182baf[_0x99a1('0xf9')](_0x548c0a[_0x99a1('0x30')][_0x99a1('0xfa')],_[_0x99a1('0xfb')](_0x548c0a[_0x99a1('0x30')],['ids','id'])||{});}})[_0x99a1('0x17')](respondWithResult(_0x58ae99,null))['catch'](handleError(_0x58ae99,null));};exports[_0x99a1('0xfc')]=function(_0x251df4,_0x513bfa){var _0x5e163e={'raw':![],'where':{}};var _0x4bc43d={};var _0x11ec42={'count':0x0,'rows':[]};return db[_0x99a1('0x45')]['findOne']({'where':{'id':_0x251df4['params']['id']}})['then'](handleEntityNotFound(_0x513bfa,null))[_0x99a1('0x17')](function(_0x211b44){if(_0x211b44){_0x4bc43d['model']=_[_0x99a1('0x4a')](db[_0x99a1('0xcc')][_0x99a1('0xfd')]);_0x4bc43d[_0x99a1('0x49')]=_[_0x99a1('0x4a')](_0x251df4[_0x99a1('0x49')]);_0x4bc43d[_0x99a1('0x52')]=_[_0x99a1('0x4b')](_0x4bc43d[_0x99a1('0x48')],_0x4bc43d['query']);_0x5e163e[_0x99a1('0x4c')]=_[_0x99a1('0x4b')](_0x4bc43d[_0x99a1('0x48')],qs[_0x99a1('0x4d')](_0x251df4[_0x99a1('0x49')][_0x99a1('0x4d')]));_0x5e163e[_0x99a1('0x4c')]=_0x5e163e[_0x99a1('0x4c')][_0x99a1('0x6b')]?_0x5e163e[_0x99a1('0x4c')]:_0x4bc43d['model'];if(!_0x251df4[_0x99a1('0x49')]['hasOwnProperty'](_0x99a1('0x4f'))){_0x5e163e[_0x99a1('0x24')]=qs[_0x99a1('0x24')](_0x251df4[_0x99a1('0x49')][_0x99a1('0x24')]);_0x5e163e[_0x99a1('0x27')]=qs['offset'](_0x251df4[_0x99a1('0x49')]['offset']);}_0x5e163e[_0x99a1('0x96')]=qs[_0x99a1('0x50')](_0x251df4[_0x99a1('0x49')][_0x99a1('0x50')]);_0x5e163e[_0x99a1('0x51')]=qs[_0x99a1('0x52')](_['pick'](_0x251df4[_0x99a1('0x49')],_0x4bc43d[_0x99a1('0x52')]));_0x5e163e[_0x99a1('0x51')][_0x99a1('0xb3')]=_0x211b44['id'];if(_0x251df4[_0x99a1('0x49')][_0x99a1('0x8c')]){_0x5e163e[_0x99a1('0x51')]=_['merge'](_0x5e163e[_0x99a1('0x51')],{'$or':_['map'](_0x5e163e[_0x99a1('0x4c')],function(_0xbe9500){var _0x37bbb2={};_0x37bbb2[_0xbe9500]={'$like':'%'+_0x251df4[_0x99a1('0x49')]['filter']+'%'};return _0x37bbb2;})});}if(_0x251df4[_0x99a1('0x49')]['$gte']){var _0x14ec6e=_0x251df4[_0x99a1('0x49')]['$gte'][_0x99a1('0x37')](',');var _0x722681={};_0x722681[_0x14ec6e[0x0]]={'$gte':moment(_0x14ec6e[0x1])[_0x99a1('0xe3')](_0x99a1('0xfe'))};_0x5e163e[_0x99a1('0x51')]=_[_0x99a1('0x2f')](_0x5e163e[_0x99a1('0x51')],_0x722681);}_0x5e163e=_[_0x99a1('0x2f')]({},_0x5e163e,_0x251df4[_0x99a1('0xff')]);return db[_0x99a1('0xcc')][_0x99a1('0x26')]({'where':_0x5e163e[_0x99a1('0x51')]})['then'](function(_0x526a82){_0x11ec42[_0x99a1('0x26')]=_0x526a82;if(_0x251df4[_0x99a1('0x49')]['includeAll']){_0x5e163e[_0x99a1('0x100')]=[{'all':!![]}];}return db[_0x99a1('0xcc')][_0x99a1('0x101')](_0x5e163e);})[_0x99a1('0x17')](function(_0x53ccd5){_0x11ec42[_0x99a1('0xb5')]=_0x53ccd5;return _0x11ec42;});}})['then'](respondWithFilteredResult(_0x513bfa,_0x5e163e))[_0x99a1('0x3a')](handleError(_0x513bfa,null));};exports[_0x99a1('0x102')]=function(_0x1c0ab2,_0x220eaa){var _0xe8d71a={'where':{}},_0x5bf8c7={},_0xd05ea={'count':0x0,'rows':[]};return db[_0x99a1('0x45')][_0x99a1('0xba')]({'where':{'id':_0x1c0ab2[_0x99a1('0xb6')]['id']}})[_0x99a1('0x17')](handleEntityNotFound(_0x220eaa,null))['then'](function(_0x2f0c0f){if(_0x2f0c0f){_0x5bf8c7[_0x99a1('0x48')]=_[_0x99a1('0x4a')](db[_0x99a1('0xcc')]['rawAttributes']);_0x5bf8c7['query']=_[_0x99a1('0x4a')](_0x1c0ab2[_0x99a1('0x49')]);_0x5bf8c7[_0x99a1('0x52')]=_[_0x99a1('0x4b')](_0x5bf8c7[_0x99a1('0x48')],_0x5bf8c7[_0x99a1('0x49')]);_0xe8d71a[_0x99a1('0x4c')]=_[_0x99a1('0x4b')](_0x5bf8c7['model'],qs[_0x99a1('0x4d')](_0x1c0ab2[_0x99a1('0x49')][_0x99a1('0x4d')]));_0xe8d71a[_0x99a1('0x4c')]=_0xe8d71a[_0x99a1('0x4c')][_0x99a1('0x6b')]?_0xe8d71a[_0x99a1('0x4c')]:_0x5bf8c7['model'];if(!_0x1c0ab2[_0x99a1('0x49')][_0x99a1('0x4e')](_0x99a1('0x4f'))){_0xe8d71a['limit']=qs[_0x99a1('0x24')](_0x1c0ab2[_0x99a1('0x49')]['limit']);_0xe8d71a[_0x99a1('0x27')]=qs[_0x99a1('0x27')](_0x1c0ab2['query'][_0x99a1('0x27')]);}_0xe8d71a['order']=qs[_0x99a1('0x50')](_0x1c0ab2[_0x99a1('0x49')][_0x99a1('0x50')]);_0xe8d71a['where']=qs['filters'](_[_0x99a1('0x53')](_0x1c0ab2[_0x99a1('0x49')],_0x5bf8c7[_0x99a1('0x52')]));_0xe8d71a[_0x99a1('0x51')][_0x99a1('0xb3')]=_0x2f0c0f['id'];if(_0x1c0ab2['query']['filter']){_0xe8d71a[_0x99a1('0x51')]=_[_0x99a1('0x2f')](_0xe8d71a[_0x99a1('0x51')],{'$or':_[_0x99a1('0x34')](_0xe8d71a[_0x99a1('0x4c')],function(_0x534762){var _0x5e8678={};_0x5e8678[_0x534762]={'$like':'%'+_0x1c0ab2[_0x99a1('0x49')][_0x99a1('0x8c')]+'%'};return _0x5e8678;})});}_0xe8d71a[_0x99a1('0x51')][_0x99a1('0x103')]=![];if(_0x1c0ab2['query']['id']){_0xe8d71a[_0x99a1('0x51')]['id']={'$gt':_0x1c0ab2['query']['id']};}_0xe8d71a=_[_0x99a1('0x2f')]({},_0xe8d71a,_0x1c0ab2[_0x99a1('0xff')]);return db['ChatMessage'][_0x99a1('0x26')]({'where':_0xe8d71a['where']})['then'](function(_0x2722d0){_0xd05ea[_0x99a1('0x26')]=_0x2722d0;_0xe8d71a[_0x99a1('0x100')]=[];if(_0x1c0ab2['query'][_0x99a1('0x104')]){_0xe8d71a[_0x99a1('0x100')][_0x99a1('0x39')]({'model':db[_0x99a1('0x7a')],'as':_0x99a1('0x7a'),'attributes':['id','fullname',_0x99a1('0x105')]});}if(_0x1c0ab2[_0x99a1('0x49')][_0x99a1('0xb7')]){_0xe8d71a[_0x99a1('0x100')]=[{'all':!![]}];}return db['ChatMessage'][_0x99a1('0x101')](_0xe8d71a);})[_0x99a1('0x17')](function(_0x1becf9){_0xd05ea[_0x99a1('0xb5')]=_0x1becf9;return _0xd05ea;});}})['then'](respondWithFilteredResult(_0x220eaa,_0xe8d71a))[_0x99a1('0x3a')](handleError(_0x220eaa,null));};exports[_0x99a1('0x106')]=function(_0x1f1d29,_0x5c4dc0){return db['ChatInteraction'][_0x99a1('0x6c')]({'where':{'id':_0x1f1d29[_0x99a1('0xb6')]['id']}})['then'](handleEntityNotFound(_0x5c4dc0,null))[_0x99a1('0x17')](function(_0x5fc729){if(_0x5fc729){return _0x5fc729[_0x99a1('0x107')](_0x1f1d29[_0x99a1('0x30')][_0x99a1('0xfa')],_[_0x99a1('0xfb')](_0x1f1d29[_0x99a1('0x30')],[_0x99a1('0xfa'),'id'])||{})['spread'](function(){return db[_0x99a1('0x108')][_0x99a1('0x101')]({'attributes':['id',_0x99a1('0x2c'),_0x99a1('0x56')],'where':{'id':_0x1f1d29['body'][_0x99a1('0xfa')]}});})[_0x99a1('0x17')](function(_0x485f57){socket[_0x99a1('0x109')](_0x99a1('0x10a'),{'id':Number(_0x1f1d29[_0x99a1('0xb6')]['id']),'tags':_0x485f57||[]});return{'id':Number(_0x1f1d29[_0x99a1('0xb6')]['id']),'tags':_0x485f57||[]};});}})[_0x99a1('0x17')](respondWithResult(_0x5c4dc0,null))[_0x99a1('0x3a')](handleError(_0x5c4dc0,null));};exports[_0x99a1('0x10b')]=function(_0x1557fc,_0xec4124){return db[_0x99a1('0x45')][_0x99a1('0x6c')]({'where':{'id':_0x1557fc[_0x99a1('0xb6')]['id']}})['then'](handleEntityNotFound(_0xec4124,null))[_0x99a1('0x17')](function(_0x1f2219){if(_0x1f2219){return _0x1f2219[_0x99a1('0x10b')](_0x1557fc[_0x99a1('0x49')][_0x99a1('0xfa')]);}})[_0x99a1('0x17')](respondWithStatusCode(_0xec4124,null))[_0x99a1('0x3a')](handleError(_0xec4124,null));};exports['download']=function(_0x1a6043,_0x5adb5f){var _0x434c1d=moment()[_0x99a1('0x10c')]()[_0x99a1('0xa2')]();var _0x4d9679=path[_0x99a1('0xdc')](config['root'],_0x99a1('0x10d'),_0x99a1('0x10e'),_0x99a1('0x10f'));var _0x152893=path[_0x99a1('0xdc')](config['root'],_0x99a1('0x10d'),'files',_0x99a1('0x110'));var _0x1d09e6=path[_0x99a1('0xdc')](_0x4d9679,_0x434c1d);var _0x539dc6=util['format'](_0x99a1('0x111'),_0x1a6043[_0x99a1('0xb6')]['id'],_0x434c1d);var _0x4dc89f=path['join'](_0x4d9679,_0x539dc6);var _0x26e00f=[];_0x26e00f['push']({'model':db[_0x99a1('0x7a')],'as':_0x99a1('0x7a'),'attributes':['id','fullname'],'raw':!![]});_0x26e00f[_0x99a1('0x39')]({'model':db['CmContact'],'as':_0x99a1('0x70'),'attributes':['id',_0x99a1('0x112'),_0x99a1('0x113')],'raw':!![]});if(_0x1a6043[_0x99a1('0x49')]['attachments']){_0x26e00f[_0x99a1('0x39')]({'model':db[_0x99a1('0xd9')],'as':_0x99a1('0xd9'),'raw':!![]});}var _0x1e7243=[{'model':db[_0x99a1('0xcc')],'as':'Messages','attributes':['id',_0x99a1('0x30'),_0x99a1('0xee'),_0x99a1('0xf0'),_0x99a1('0x103'),_0x99a1('0x87')],'include':_0x26e00f}];_0x1e7243[_0x99a1('0x39')]({'model':db[_0x99a1('0xbb')],'as':_0x99a1('0x114'),'attributes':['id','name']});_0x1e7243[_0x99a1('0x39')]({'model':db[_0x99a1('0x7a')],'as':'Owner','attributes':['id',_0x99a1('0xc1')]});return db['ChatInteraction'][_0x99a1('0x6c')]({'where':{'id':_0x1a6043[_0x99a1('0xb6')]['id']},'include':_0x1e7243})[_0x99a1('0x17')](handleEntityNotFound(_0x5adb5f,null))[_0x99a1('0x17')](function(_0x1bfc03){if(_0x1bfc03){var _0x25b1e9=_0x1bfc03[_0x99a1('0x115')]({'plain':!![]});fs[_0x99a1('0x116')](_0x1d09e6);var _0x395721={'channel':_0x99a1('0x117'),'account':_0x25b1e9['Account'][_0x99a1('0x2c')],'agent':_0x25b1e9[_0x99a1('0x118')]?_0x25b1e9['Owner'][_0x99a1('0xc1')]:'N.A.','createdAt':moment(_0x25b1e9[_0x99a1('0xee')])[_0x99a1('0xe3')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x25b1e9[_0x99a1('0x40')]?moment(_0x25b1e9[_0x99a1('0x119')])[_0x99a1('0xe3')](_0x99a1('0xfe'))[_0x99a1('0xa2')]():'','disposition':_0x25b1e9[_0x99a1('0x42')],'chatInfo':{'browser':_0x25b1e9['browserName'],'os':_0x25b1e9['osName'],'referer':_0x25b1e9[_0x99a1('0x11a')],'customerIp':_0x25b1e9[_0x99a1('0x11b')],'customerPort':_0x25b1e9['customerPort']?_0x25b1e9[_0x99a1('0x11c')]:_0x99a1('0x11d')},'messages':_(_0x25b1e9['Messages'])['tail']()['filter']({'secret':![]})[_0x99a1('0x34')](function(_0x1f14b7){if(_0x1f14b7[_0x99a1('0xd9')]){var _0x546c9a=path['join'](_0x152893,_0x1f14b7['Attachment']['basename']);if(fs[_0x99a1('0x11e')](_0x546c9a)){fs[_0x99a1('0x11f')](_0x546c9a)[_0x99a1('0x120')](fs[_0x99a1('0x121')](path[_0x99a1('0xdc')](_0x1d09e6,_0x1f14b7[_0x99a1('0xd9')][_0x99a1('0xd6')])));}}return{'date':moment(_0x1f14b7[_0x99a1('0xee')])['format'](_0x99a1('0xfe'))[_0x99a1('0xa2')](),'sender':_0x1f14b7[_0x99a1('0xf0')]===_0x99a1('0xcb')?_0x1f14b7[_0x99a1('0x7a')]?_0x1f14b7[_0x99a1('0x7a')][_0x99a1('0xc1')]:_0x99a1('0xe6'):_0x1f14b7[_0x99a1('0x70')][_0x99a1('0x112')]+(_0x1f14b7['Contact']['lastName']?'\x20'+_0x1f14b7[_0x99a1('0x70')][_0x99a1('0x113')]:''),'body':_0x1f14b7['Attachment']?_0x1f14b7[_0x99a1('0xd9')][_0x99a1('0xd6')]:_0x1f14b7[_0x99a1('0x30')],'direction':_0x1f14b7['direction']==='out'?'A':'C','secret':_0x1f14b7['secret'],'read':_0x1f14b7['read'],'attachment':_0x1f14b7['Attachment']};})['value']()};return ejs[_0x99a1('0x122')](path[_0x99a1('0xdc')](config['root'],'server',_0x99a1('0x123'),_0x99a1('0x124')),{'interaction':_0x395721})[_0x99a1('0x17')](function(_0x10349e){var _0x2daada=path[_0x99a1('0xdc')](_0x1d09e6,_0x99a1('0x125')+_0x25b1e9['id']+'-'+_0x434c1d+_0x99a1('0x126'));var _0x526638={'path':_0x2daada,'channel':_0x99a1('0x117'),'interactionId':_0x25b1e9['id']};return pdf[_0x99a1('0x127')](_0x10349e,_0x526638);})['then'](function(){return new Promise(function(_0x3aaf56,_0x11e9e7){zipdir(_0x1d09e6,{'saveTo':_0x4dc89f},function(_0x277d49,_0xbf6ea6){if(_0x277d49)return _0x11e9e7(_0x277d49);return _0x3aaf56(_0xbf6ea6);});})['then'](function(){return new BPromise(function(_0x5d9ecd,_0x21b4fe){rimraf(_0x1d09e6,function(_0x1d78c6){if(_0x1d78c6)_0x21b4fe(_0x1d78c6);return _0x5d9ecd();});});})['then'](function(){return _0x5adb5f[_0x99a1('0xdf')](_0x4dc89f,_0x539dc6,function(_0x38f02f){if(_0x38f02f){logger[_0x99a1('0x1d')](_0x99a1('0x128'),_0x38f02f);}else{fs[_0x99a1('0x129')](_0x4dc89f);}});});});}else{return _0x5adb5f[_0x99a1('0x20')](0xc8);}})[_0x99a1('0x3a')](handleError(_0x5adb5f,null));};
\ No newline at end of file
+var _0x2dae=['getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','Tag','forEach','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','clone','i.id','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','ChatInteraction','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.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','push','all','rows','show','params','includeAll','create','describe','findOne','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','vidaooNote','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','ChatWebsite','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','hasOwnProperty','$gte','YYYY-MM-DD\x20HH:mm:ss','include','findAll','options','includeAgent','alias','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','download','unix','server','files','transcript-%d-%s.zip','firstName','lastName','attachments','direction','Owner','get','mkdirSync','Chat','N.A.','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','.pdf','err','rimraf','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ChatInteraction,\x20%s,\x20%s','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','destroy','stack','name','send','render','merge','body','contact','interaction','account','Users','fullname','TagIds','Tags','split','catch','waiting','talking','answered','unmanaged','total','closed','UserId','disposition','abandoned','index','map','rawAttributes','fieldName','key','keys','query','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','search','parseSearch','conditions','find','unreadMessages','having','`\x20=\x200','Contact','$substring'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2dae,0xc3));var _0xe2da=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0x2dae[_0x4695ba];return _0x524b7d;};'use strict';var rimraf=require(_0xe2da('0x0'));var zipdir=require('zip-dir');var rp=require(_0xe2da('0x1'));var moment=require(_0xe2da('0x2'));var BPromise=require(_0xe2da('0x3'));var Mustache=require(_0xe2da('0x4'));var util=require(_0xe2da('0x5'));var path=require('path');var ejs=require(_0xe2da('0x6'));var fs=require('fs');var _=require(_0xe2da('0x7'));var squel=require(_0xe2da('0x8'));var Redis=require(_0xe2da('0x9'));var qs=require('../../components/parsers/qs');var as=require(_0xe2da('0xa'));var pdf=require(_0xe2da('0xb'));var logger=require(_0xe2da('0xc'))(_0xe2da('0xd'));var config=require(_0xe2da('0xe'));var db=require(_0xe2da('0xf'))['db'];config[_0xe2da('0x10')]=_[_0xe2da('0x11')](config[_0xe2da('0x10')],{'host':'localhost','port':0x18eb});var socket=require(_0xe2da('0x12'))(new Redis(config[_0xe2da('0x10')]));require(_0xe2da('0x13'))[_0xe2da('0x14')](socket);var jayson=require(_0xe2da('0x15'));var client=jayson[_0xe2da('0x16')][_0xe2da('0x17')]({'port':0x232b});var client9004=jayson[_0xe2da('0x16')]['http']({'port':0x232c});function respondWithRpcPromise(_0xb98909,_0x5200b1,_0x4377c6,_0x245ad7){return new BPromise(function(_0x37064e,_0x411b9f){var _0xfab73e=_0x245ad7||client;return _0xfab73e[_0xe2da('0x18')](_0xb98909,_0x4377c6)[_0xe2da('0x19')](function(_0x48584b){logger[_0xe2da('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5200b1,'request\x20sent');logger[_0xe2da('0x1b')](_0xe2da('0x1c'),_0x5200b1,_0xe2da('0x1d'),JSON['stringify'](_0x48584b));if(_0x48584b[_0xe2da('0x1e')]){if(_0x48584b[_0xe2da('0x1e')][_0xe2da('0x1f')]===0x1f4){logger[_0xe2da('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x5200b1,_0x48584b[_0xe2da('0x1e')][_0xe2da('0x20')]);return _0x411b9f(_0x48584b[_0xe2da('0x1e')][_0xe2da('0x20')]);}logger[_0xe2da('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x5200b1,_0x48584b[_0xe2da('0x1e')][_0xe2da('0x20')]);return _0x37064e(_0x48584b['error'][_0xe2da('0x20')]);}else{logger[_0xe2da('0x1a')](_0xe2da('0x21'),_0x5200b1,_0xe2da('0x1d'));_0x37064e(_0x48584b[_0xe2da('0x22')][_0xe2da('0x20')]);}})['catch'](function(_0x467cd6){logger['error'](_0xe2da('0x21'),_0x5200b1,_0x467cd6);_0x411b9f(_0x467cd6);});});}function respondWithStatusCode(_0x191d38,_0x395af6){_0x395af6=_0x395af6||0xcc;return function(_0x28f1d3){if(_0x28f1d3){return _0x191d38[_0xe2da('0x23')](_0x395af6);}return _0x191d38[_0xe2da('0x24')](_0x395af6)[_0xe2da('0x25')]();};}function respondWithResult(_0x221e98,_0x5a08d6){_0x5a08d6=_0x5a08d6||0xc8;return function(_0x1c901e){if(_0x1c901e){return _0x221e98[_0xe2da('0x24')](_0x5a08d6)[_0xe2da('0x26')](_0x1c901e);}};}function respondWithFilteredResult(_0x14704d,_0x3778dc){return function(_0x230fb8){if(_0x230fb8){var _0x124d93=typeof _0x3778dc['offset']===_0xe2da('0x27')&&typeof _0x3778dc[_0xe2da('0x28')]===_0xe2da('0x27');var _0x38ee5e=_0x230fb8[_0xe2da('0x29')];var _0x2b6c9e=_0x124d93?0x0:_0x3778dc[_0xe2da('0x2a')];var _0x39f60e=_0x124d93?_0x230fb8['count']:_0x3778dc['offset']+_0x3778dc['limit'];var _0x3c4845;if(_0x39f60e>=_0x38ee5e){_0x39f60e=_0x38ee5e;_0x3c4845=0xc8;}else{_0x3c4845=0xce;}_0x14704d[_0xe2da('0x24')](_0x3c4845);return _0x14704d[_0xe2da('0x2b')](_0xe2da('0x2c'),_0x2b6c9e+'-'+_0x39f60e+'/'+_0x38ee5e)['json'](_0x230fb8);}return null;};}function saveUpdates(_0x490794){return function(_0x356ab4){if(_0x356ab4){return _0x356ab4[_0xe2da('0x2d')](_0x490794)[_0xe2da('0x19')](function(_0x39f983){return _0x39f983;});}return null;};}function removeEntity(_0x7ab5ee){return function(_0x15df33){if(_0x15df33){return _0x15df33[_0xe2da('0x2e')]()[_0xe2da('0x19')](function(){_0x7ab5ee[_0xe2da('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x576959){return function(_0x672767){if(!_0x672767){_0x576959[_0xe2da('0x23')](0x194);}return _0x672767;};}function handleError(_0x2cb457,_0x34f5fe){_0x34f5fe=_0x34f5fe||0x1f4;return function(_0x195537){logger[_0xe2da('0x1e')](_0x195537[_0xe2da('0x2f')]);if(_0x195537[_0xe2da('0x30')]){delete _0x195537[_0xe2da('0x30')];}_0x2cb457[_0xe2da('0x24')](_0x34f5fe)[_0xe2da('0x31')](_0x195537);};}function getMustacheRender(_0x2386b8,_0x4ef546){return Mustache[_0xe2da('0x32')](_0x2386b8,_[_0xe2da('0x33')](_0x4ef546[_0xe2da('0x34')],{'contact':_0x4ef546[_0xe2da('0x35')],'message':_0x4ef546[_0xe2da('0x20')],'agent':_0x4ef546['agent'],'interaction':_0x4ef546[_0xe2da('0x36')],'account':_0x4ef546[_0xe2da('0x37')]}))||'';}function getInteractionUsers(_0x39dae5,_0x5e1f39){return new BPromise(function(_0x6d8f39,_0x10b8f5){try{if(_0x5e1f39[_0x39dae5['id']]){_0x39dae5[_0xe2da('0x38')]=_['map'](_0x5e1f39[_0x39dae5['id']],function(_0x4d0963){return{'id':_0x4d0963['id'],'fullname':_0x4d0963[_0xe2da('0x39')]};});}}catch(_0x1f4a5a){_0x10b8f5(_0x1f4a5a);}_0x6d8f39(_0x39dae5);});}function getInteractionTags(_0x4d6e6c,_0x2e7324){return new BPromise(function(_0x15df09,_0x3aefe2){try{if(_0x4d6e6c[_0xe2da('0x3a')]){_0x4d6e6c[_0xe2da('0x3b')]=[];_0x4d6e6c['TagIds'][_0xe2da('0x3c')](',')['forEach'](function(_0x59489e){_0x4d6e6c[_0xe2da('0x3b')]['push'](_0x2e7324[_0x59489e]);});}delete _0x4d6e6c[_0xe2da('0x3a')];}catch(_0x27435b){_0x3aefe2(_0x27435b);}_0x15df09(_0x4d6e6c);});}function updateChatInteraction(_0x54d8a3,_0x365968,_0x3ef0e8){return new BPromise(function(_0x538f1f,_0x4e14a6){return getInteractionUsers(_0x54d8a3,_0x3ef0e8)['then'](function(_0x2d9c0a){return getInteractionTags(_0x2d9c0a,_0x365968);})[_0xe2da('0x19')](function(_0x26ba99){return getStateInteraction(_0x26ba99);})[_0xe2da('0x19')](function(_0x3419c3){_0x538f1f(_0x3419c3);})[_0xe2da('0x3d')](function(_0x14c30f){_0x4e14a6(_0x14c30f);});});}function getStateInteraction(_0x4d4e90){return new BPromise(function(_0x3d1fd){_0x4d4e90[_0xe2da('0x3e')]=0x0;_0x4d4e90[_0xe2da('0x3f')]=0x0;_0x4d4e90[_0xe2da('0x40')]=0x0;_0x4d4e90[_0xe2da('0x41')]=0x0;_0x4d4e90['abandoned']=0x0;_0x4d4e90[_0xe2da('0x42')]=0x0;if(!_0x4d4e90[_0xe2da('0x43')]&&!_0x4d4e90[_0xe2da('0x44')]){_0x4d4e90['waiting']+=0x1;}if(!_0x4d4e90[_0xe2da('0x43')]&&_0x4d4e90[_0xe2da('0x44')]){_0x4d4e90[_0xe2da('0x3f')]+=0x1;if(_0x4d4e90[_0xe2da('0x3e')]){_0x4d4e90[_0xe2da('0x3e')]-=0x1;}}if(_0x4d4e90[_0xe2da('0x43')]&&_0x4d4e90[_0xe2da('0x45')]===_0xe2da('0x46')){_0x4d4e90['abandoned']+=0x1;if(_0x4d4e90[_0xe2da('0x3e')]){_0x4d4e90[_0xe2da('0x3e')]-=0x1;}}else if(_0x4d4e90[_0xe2da('0x43')]&&!_0x4d4e90[_0xe2da('0x44')]&&_0x4d4e90[_0xe2da('0x45')]){_0x4d4e90['unmanaged']+=0x1;if(_0x4d4e90[_0xe2da('0x3e')]){_0x4d4e90[_0xe2da('0x3e')]-=0x1;}}else if(_0x4d4e90[_0xe2da('0x43')]&&_0x4d4e90[_0xe2da('0x44')]){_0x4d4e90[_0xe2da('0x40')]+=0x1;if(_0x4d4e90[_0xe2da('0x3f')]){_0x4d4e90[_0xe2da('0x3f')]-=0x1;}}_0x4d4e90['total']+=0x1;_0x3d1fd(_0x4d4e90);});}exports[_0xe2da('0x47')]=function(_0x4f9ba9,_0x1db1d8){var _0x54b3ad={},_0x366527={},_0x4b569e={'count':0x0,'rows':[]};var _0x2dd7dc=_[_0xe2da('0x48')](db['ChatInteraction'][_0xe2da('0x49')],function(_0x369dea){return{'name':_0x369dea[_0xe2da('0x4a')],'type':_0x369dea['type'][_0xe2da('0x4b')]};});_0x366527['model']=_['map'](_0x2dd7dc,_0xe2da('0x30'));_0x366527['query']=_[_0xe2da('0x4c')](_0x4f9ba9[_0xe2da('0x4d')]);_0x366527['filters']=_[_0xe2da('0x4e')](_0x366527[_0xe2da('0x4f')],_0x366527['query']);_0x54b3ad['attributes']=_[_0xe2da('0x4e')](_0x366527['model'],qs[_0xe2da('0x50')](_0x4f9ba9[_0xe2da('0x4d')][_0xe2da('0x50')]));_0x54b3ad[_0xe2da('0x51')]=_0x54b3ad[_0xe2da('0x51')][_0xe2da('0x52')]?_0x54b3ad[_0xe2da('0x51')]:_0x366527[_0xe2da('0x4f')];if(!_0x4f9ba9[_0xe2da('0x4d')]['hasOwnProperty'](_0xe2da('0x53'))){_0x54b3ad[_0xe2da('0x28')]=qs[_0xe2da('0x28')](_0x4f9ba9['query'][_0xe2da('0x28')]);_0x54b3ad[_0xe2da('0x2a')]=qs[_0xe2da('0x2a')](_0x4f9ba9[_0xe2da('0x4d')][_0xe2da('0x2a')]);}_0x54b3ad[_0xe2da('0x54')]=qs[_0xe2da('0x55')](_0x4f9ba9['query']['sort']);_0x54b3ad[_0xe2da('0x56')]=qs[_0xe2da('0x57')](_[_0xe2da('0x58')](_0x4f9ba9['query'],_0x366527['filters']),_0x2dd7dc);var _0x41d2ca=[];var _0x4a8dc9=squel[_0xe2da('0x59')]()[_0xe2da('0x5a')]('id')[_0xe2da('0x5a')](_0xe2da('0x30'))[_0xe2da('0x5a')](_0xe2da('0x5b'))[_0xe2da('0x5c')](_0xe2da('0x5d'));var _0x21a19e=squel['select']()[_0xe2da('0x5a')](_0xe2da('0x5e'))[_0xe2da('0x5a')](_0xe2da('0x5f'))['field'](_0xe2da('0x60'))[_0xe2da('0x5c')](_0xe2da('0x61'),'ui')['left_join'](_0xe2da('0x62'),'u',_0xe2da('0x63'));var _0x3e6e98=squel[_0xe2da('0x59')]()[_0xe2da('0x5c')](_0xe2da('0x64'),'i')[_0xe2da('0x65')](_0xe2da('0x66'),'c',_0xe2da('0x67'))[_0xe2da('0x65')](_0xe2da('0x62'),'o',_0xe2da('0x68'))['left_join'](_0xe2da('0x69'),'a',_0xe2da('0x6a'))[_0xe2da('0x65')](_0xe2da('0x6b'),'me',_0xe2da('0x6c'))[_0xe2da('0x65')](_0xe2da('0x6d'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xe2da('0x65')]('tools_tags','t',_0xe2da('0x6e'));var _0x18ff95=squel['expr']();var _0x4e6c52=[];var _0x19fd83=squel['expr']();var _0x48e2b1;if(_0x4f9ba9['query'][_0xe2da('0x6f')]){_0x48e2b1=as[_0xe2da('0x70')](_0x4f9ba9[_0xe2da('0x4d')]['search']);var _0x5610db=_0x48e2b1['sqlOperator'];for(var _0x3ef7c7=0x0;_0x3ef7c7<_0x48e2b1[_0xe2da('0x71')][_0xe2da('0x52')];_0x3ef7c7++){var _0x3bd86e=_0x48e2b1['conditions'][_0x3ef7c7];var _0x383c82='i';var _0x2593ac=_[_0xe2da('0x72')](_0x2dd7dc,[_0xe2da('0x30'),_0x3bd86e[_0xe2da('0x5a')]]);if(!_0x2593ac){switch(_0x3bd86e[_0xe2da('0x5a')]){case _0xe2da('0x73'):if(_0x3bd86e['value']==0x1){_0x3e6e98[_0xe2da('0x74')]('`'+_0x3bd86e[_0xe2da('0x5a')]+_0xe2da('0x75'));}else{_0x3e6e98[_0xe2da('0x74')]('`'+_0x3bd86e[_0xe2da('0x5a')]+'`\x20>\x200');}break;case _0xe2da('0x76'):if(_0x3bd86e['operator']===_0xe2da('0x77')){if(_0x3bd86e['value'][_0xe2da('0x3c')]('\x20')['length']>0x1){_0x18ff95[_0x5610db]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe2da('0x78')](_0x3bd86e[_0xe2da('0x79')]),null);}else{var _0x2cff55='%'+_0x3bd86e[_0xe2da('0x79')]+'%';_0x18ff95[_0x5610db](_0xe2da('0x7a'),_0x2cff55,_0x2cff55,_0x2cff55);}}else{_0x2593ac=_[_0xe2da('0x72')](_0x2dd7dc,[_0xe2da('0x30'),_0xe2da('0x7b')]);_0x3bd86e[_0xe2da('0x5a')]=_0xe2da('0x7b');_0x3dedaa=as['buildExpression'](_0x383c82,_0x2593ac[_0xe2da('0x7c')],_0x3bd86e);_0x18ff95[_0x5610db](_0x3dedaa[_0xe2da('0x7d')],_0x3dedaa[_0xe2da('0x79')][_0xe2da('0x7e')],_0x3dedaa['value'][_0xe2da('0x25')]);}break;case _0xe2da('0x7f'):var _0x36ed64=_0x3bd86e[_0xe2da('0x79')]['split'](',')[_0xe2da('0x48')](function(_0x57bf38){return Number(_0x57bf38);});_0x36ed64[_0xe2da('0x80')](function(_0x3c2294){_0x19fd83['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3c2294+',%');});_0x4e6c52=_[_0xe2da('0x81')](_0x4e6c52,_0x36ed64);break;case _0xe2da('0x82'):if(_0x3bd86e[_0xe2da('0x83')]===_0xe2da('0x77')){_0x18ff95[_0x5610db](_0xe2da('0x84'),'%'+_0x3bd86e['value']+'%',null);}else{_0x2593ac=_[_0xe2da('0x72')](_0x2dd7dc,['name','UserId']);_0x3bd86e['field']='UserId';_0x3dedaa=as[_0xe2da('0x85')](_0x383c82,_0x2593ac[_0xe2da('0x7c')],_0x3bd86e);_0x18ff95[_0x5610db](_0x3dedaa[_0xe2da('0x7d')],_0x3dedaa[_0xe2da('0x79')][_0xe2da('0x7e')],_0x3dedaa[_0xe2da('0x79')][_0xe2da('0x25')]);}break;case _0xe2da('0x34'):_0x3dedaa=as[_0xe2da('0x85')]('me',null,_0x3bd86e);_0x18ff95[_0x5610db](_0x3dedaa['text'],_0x3dedaa[_0xe2da('0x79')][_0xe2da('0x7e')],_0x3dedaa[_0xe2da('0x79')][_0xe2da('0x25')]);break;}}else{var _0x3dedaa=as[_0xe2da('0x85')](_0x383c82,_0x2593ac[_0xe2da('0x7c')],_0x3bd86e);_0x18ff95[_0x5610db](_0x3dedaa[_0xe2da('0x7d')],_0x3dedaa[_0xe2da('0x79')][_0xe2da('0x7e')],_0x3dedaa['value'][_0xe2da('0x25')]);}}}else{var _0x24637a=_(_0x4f9ba9[_0xe2da('0x4d')])[_0xe2da('0x4c')]()[_0xe2da('0x48')](function(_0x167b14){return _[_0xe2da('0x86')](_0x2dd7dc,[_0xe2da('0x30'),_0x167b14])?_0x167b14:undefined;})[_0xe2da('0x87')]()[_0xe2da('0x79')]();if(!_[_0xe2da('0x88')](_0x24637a)){_0x24637a[_0xe2da('0x80')](function(_0x4c3e20){if(_0x4c3e20===_0xe2da('0x89')){_0x3e6e98['where'](_0xe2da('0x8a'),[][_0xe2da('0x8b')](_0x4f9ba9[_0xe2da('0x4d')][_0x4c3e20]));}else if(_0x4c3e20===_0xe2da('0x8c')){var _0x44984b=JSON[_0xe2da('0x8d')](_0x4f9ba9[_0xe2da('0x4d')][_0x4c3e20])['$gte'];var _0x2a365a=JSON[_0xe2da('0x8d')](_0x4f9ba9[_0xe2da('0x4d')][_0x4c3e20])[_0xe2da('0x8e')];_0x3e6e98[_0xe2da('0x56')](_0xe2da('0x8f'),_0x44984b,_0x2a365a);}else{if(_0x4f9ba9['query'][_0x4c3e20]===_0xe2da('0x90')){_0x3e6e98[_0xe2da('0x56')]('i.'+_0x4c3e20+_0xe2da('0x91'));}else{_0x3e6e98[_0xe2da('0x56')]('i.'+_0x4c3e20+_0xe2da('0x92'),_0x4f9ba9[_0xe2da('0x4d')][_0x4c3e20]);}}});}if(_0x4f9ba9[_0xe2da('0x4d')]['read']){if(_0x4f9ba9[_0xe2da('0x4d')][_0xe2da('0x93')]==0x1){_0x3e6e98[_0xe2da('0x74')](_0xe2da('0x94'));}else{_0x3e6e98[_0xe2da('0x74')](_0xe2da('0x95'));}}if(_0x4f9ba9['query'][_0xe2da('0x96')]){_0x4e6c52=_['isArray'](_0x4f9ba9['query'][_0xe2da('0x96')])?_0x4f9ba9[_0xe2da('0x4d')][_0xe2da('0x96')]:new Array(_0x4f9ba9['query'][_0xe2da('0x96')]);_0x4e6c52[_0xe2da('0x80')](function(_0x20bf30){_0x19fd83['or'](_0xe2da('0x97'),'%,'+_0x20bf30+',%');});}if(_0x4f9ba9['query'][_0xe2da('0x98')]){var _0x4e2325=_0x4f9ba9['query'][_0xe2da('0x98')][_0xe2da('0x99')]('\x5c','\x5c\x5c')[_0xe2da('0x99')](/'/g,'\x27\x27');if(qs[_0xe2da('0x9a')](_0x4e2325)){_0x18ff95['or'](_0xe2da('0x9b'),_0x4e2325+'%');}else{_0x18ff95['or'](_0xe2da('0x9c'),qs['getFullTextValue'](_0x4e2325))['or'](_0xe2da('0x9d'),_0x4e2325+'%');}}}_0x3e6e98[_0xe2da('0x56')](_0x18ff95);_0x3e6e98[_0xe2da('0x9e')]('i.id');var _0x3a4104={'type':db[_0xe2da('0x9f')][_0xe2da('0xa0')]['SELECT'],'raw':!![]};var _0x21ac55=_0x3e6e98[_0xe2da('0xa1')]();_0x21ac55[_0xe2da('0x5a')](_0xe2da('0xa2'));_0x21ac55[_0xe2da('0x5a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe2da('0x73'));if(_0x54b3ad[_0xe2da('0x54')]){_0x54b3ad[_0xe2da('0x54')][_0xe2da('0x80')](function(_0xfecbd){var _0x3f6082=_0xfecbd[0x0]===_0xe2da('0xa3')?_0xfecbd[0x0]:'i.'+_0xfecbd[0x0];_0x3e6e98[_0xe2da('0x54')](_0x3f6082,_0xfecbd[0x1]===_0xe2da('0xa4')?![]:!![]);});}if(!_['isEmpty'](_0x4e6c52)){_0x3e6e98[_0xe2da('0x74')](_0x19fd83);_0x21ac55[_0xe2da('0x56')]('t.id\x20IN\x20?',_0x4e6c52);}BPromise[_0xe2da('0xa5')]()['then'](function(){if(!_0x48e2b1){if(_0x4f9ba9['query']['ChatWebsiteId'])return;_0x21ac55[_0xe2da('0x56')](_0xe2da('0xa6'));_0x3e6e98['where'](_0xe2da('0xa6'));return;}if(_0x4f9ba9['user'][_0xe2da('0xa7')]!==_0xe2da('0xa8'))return;return _0x4f9ba9[_0xe2da('0xa9')][_0xe2da('0xaa')]({'attributes':['id'],'raw':!![]})[_0xe2da('0x19')](function(_0x2dd0d9){if(_[_0xe2da('0x88')](_0x2dd0d9)){_0x21ac55['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x3e6e98[_0xe2da('0x56')](_0xe2da('0xab'));}else{_0x21ac55[_0xe2da('0x56')](_0xe2da('0x8a'),_['map'](_0x2dd0d9,'id'));_0x3e6e98[_0xe2da('0x56')]('i.ChatWebsiteId\x20IN\x20?',_[_0xe2da('0x48')](_0x2dd0d9,'id'));}});})[_0xe2da('0x19')](function(){if(_0x4f9ba9[_0xe2da('0xa9')][_0xe2da('0xa7')]===_0xe2da('0xa8')&&!_0x48e2b1&&!_0x4f9ba9[_0xe2da('0x4d')]['ChatWebsiteId'])return[];return db[_0xe2da('0xac')][_0xe2da('0x4d')](_0x21ac55[_0xe2da('0xad')](),_0x3a4104);})[_0xe2da('0x19')](function(_0x3c3385){_0x4b569e[_0xe2da('0x29')]=_0x3c3385[_0xe2da('0x52')];if(_0x4b569e[_0xe2da('0x29')]===0x0)return[];return db['sequelize'][_0xe2da('0x4d')](_0x4a8dc9['toString'](),_0x3a4104)[_0xe2da('0x19')](function(_0x3f42f2){_0x41d2ca=_['keyBy'](_0x3f42f2,'id');_0x3a4104=_['merge'](_0x3a4104,{'model':db[_0xe2da('0xae')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4f9ba9['query'][_0xe2da('0x50')]){_0x54b3ad[_0xe2da('0x51')][_0xe2da('0x80')](function(_0x5054e6){_0x3e6e98[_0xe2da('0x5a')]('i.'+_0x5054e6);});}else{_0x3e6e98['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe2da('0x73'));_0x3e6e98[_0xe2da('0x5a')]('a.key',_0xe2da('0xaf'));_0x3e6e98['field'](_0xe2da('0xb0'),_0xe2da('0xb1'));_0x3e6e98[_0xe2da('0x5a')](_0xe2da('0xb2'),_0xe2da('0xa3'));_0x3e6e98['field'](_0xe2da('0xb3'));_0x3e6e98[_0xe2da('0x5a')](_0xe2da('0xb4'),'Contact.firstName');_0x3e6e98[_0xe2da('0x5a')](_0xe2da('0xb5'),_0xe2da('0xb6'));_0x3e6e98[_0xe2da('0x5a')](_0xe2da('0xb7'),_0xe2da('0xb8'));_0x3e6e98[_0xe2da('0x5a')](_0xe2da('0xb9'),'Contact.phone');_0x3e6e98['field'](_0xe2da('0xba'),'Contact.mobile');_0x3e6e98[_0xe2da('0x5a')](_0xe2da('0xbb'),_0xe2da('0xbc'));_0x3e6e98[_0xe2da('0x5a')](_0xe2da('0xbd'),_0xe2da('0xbe'));_0x3e6e98[_0xe2da('0x5a')]('o.internal',_0xe2da('0xbf'));_0x3e6e98['field'](_0xe2da('0xc0'),'TagIds');}if(_0x54b3ad['limit'])_0x3e6e98[_0xe2da('0x28')](_0x54b3ad[_0xe2da('0x28')]);if(_0x54b3ad[_0xe2da('0x2a')])_0x3e6e98[_0xe2da('0x2a')](_0x54b3ad[_0xe2da('0x2a')]);return db[_0xe2da('0xac')][_0xe2da('0x4d')](_0x3e6e98['toString'](),_0x3a4104);})[_0xe2da('0x19')](function(_0x2566c3){if(_0x2566c3[_0xe2da('0x52')]>0x0)_0x21a19e['where'](_0xe2da('0xc1'),_['map'](_0x2566c3,'id'));return db['sequelize'][_0xe2da('0x4d')](_0x21a19e[_0xe2da('0xad')](),_0x3a4104)['then'](function(_0x51a4f5){var _0x123fe5=_['groupBy'](_0x51a4f5,_0xe2da('0xc2'));var _0x2da9ab=[];_0x2566c3[_0xe2da('0x80')](function(_0x2b7b18){_0x2da9ab[_0xe2da('0xc3')](updateChatInteraction(_0x2b7b18,_0x41d2ca,_0x123fe5));});return BPromise[_0xe2da('0xc4')](_0x2da9ab);});});})['then'](function(_0x29a89d){_0x4b569e[_0xe2da('0xc5')]=_0x29a89d;return _0x4b569e;})[_0xe2da('0x19')](respondWithFilteredResult(_0x1db1d8,_0x54b3ad))[_0xe2da('0x3d')](handleError(_0x1db1d8,null));};exports[_0xe2da('0xc6')]=function(_0x436ab4,_0x5ed5e0){var _0x2b023d={'raw':![],'where':{'id':_0x436ab4[_0xe2da('0xc7')]['id']}},_0x30eadd={};_0x30eadd['model']=_[_0xe2da('0x4c')](db[_0xe2da('0xae')][_0xe2da('0x49')]);_0x30eadd[_0xe2da('0x4d')]=_[_0xe2da('0x4c')](_0x436ab4[_0xe2da('0x4d')]);_0x30eadd['filters']=_['intersection'](_0x30eadd[_0xe2da('0x4f')],_0x30eadd[_0xe2da('0x4d')]);_0x2b023d['attributes']=_['intersection'](_0x30eadd[_0xe2da('0x4f')],qs['fields'](_0x436ab4[_0xe2da('0x4d')][_0xe2da('0x50')]));_0x2b023d['attributes']=_0x2b023d[_0xe2da('0x51')][_0xe2da('0x52')]?_0x2b023d[_0xe2da('0x51')]:_0x30eadd[_0xe2da('0x4f')];if(_0x436ab4[_0xe2da('0x4d')][_0xe2da('0xc8')]){_0x2b023d['include']=[{'all':!![]}];}_0x2b023d=_[_0xe2da('0x33')]({},_0x2b023d,_0x436ab4['options']);return db[_0xe2da('0xae')][_0xe2da('0x72')](_0x2b023d)[_0xe2da('0x19')](handleEntityNotFound(_0x5ed5e0,null))['then'](respondWithResult(_0x5ed5e0,null))[_0xe2da('0x3d')](handleError(_0x5ed5e0,null));};exports['create']=function(_0x45b82f,_0x53499c){return db['ChatInteraction'][_0xe2da('0xc9')](_0x45b82f['body'],{})[_0xe2da('0x19')](respondWithResult(_0x53499c,0xc9))[_0xe2da('0x3d')](handleError(_0x53499c,null));};exports[_0xe2da('0x2d')]=function(_0x2e4c5e,_0x242092){if(_0x2e4c5e[_0xe2da('0x34')]['id']){delete _0x2e4c5e[_0xe2da('0x34')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x2e4c5e[_0xe2da('0xc7')]['id']}})[_0xe2da('0x19')](handleEntityNotFound(_0x242092,null))[_0xe2da('0x19')](saveUpdates(_0x2e4c5e[_0xe2da('0x34')],null))[_0xe2da('0x19')](respondWithResult(_0x242092,null))[_0xe2da('0x3d')](handleError(_0x242092,null));};exports['destroy']=function(_0x4bba1e,_0x446fe1){return db[_0xe2da('0xae')][_0xe2da('0x72')]({'where':{'id':_0x4bba1e['params']['id']}})[_0xe2da('0x19')](handleEntityNotFound(_0x446fe1,null))[_0xe2da('0x19')](removeEntity(_0x446fe1,null))[_0xe2da('0x3d')](handleError(_0x446fe1,null));};exports[_0xe2da('0xca')]=function(_0x53e7d8,_0x32d697){return db['ChatInteraction']['describe']()[_0xe2da('0x19')](respondWithResult(_0x32d697,null))['catch'](handleError(_0x32d697,null));};exports['createVidaooSession']=function(_0xb7c12,_0x7a762c){var _0x378852=_0xb7c12[_0xe2da('0xc7')]['id'];var _0x4be1fe;var _0x1d71c6;var _0x4a4756;return db['ChatInteraction']['findOne']({'where':{'id':_0x378852}})[_0xe2da('0x19')](function(_0x2597d9){_0x4be1fe=_0x2597d9;return db['ChatWebsite'][_0xe2da('0xcb')]({'where':{'id':_0x2597d9[_0xe2da('0x89')]},'attributes':['id','vidaooApiKey',_0xe2da('0xcc'),_0xe2da('0xcd'),'vidaooNote',_0xe2da('0xce')],'raw':!![]});})['then'](function(_0x154dc2){if(_0x154dc2&&_0x154dc2[_0xe2da('0xcf')]&&_0x154dc2['vidaooEscalation']){_0x1d71c6=_0x154dc2;var _0x50ff2c={'interaction':{'id':_0x378852},'agent':{'id':_0xb7c12[_0xe2da('0xa9')]['id'],'name':_0xb7c12[_0xe2da('0xa9')][_0xe2da('0x30')],'fullname':_0xb7c12['user']['fullname'],'email':_0xb7c12['user']['email']},'contact':_0xb7c12[_0xe2da('0x34')][_0xe2da('0x35')],'account':_0xb7c12[_0xe2da('0x34')][_0xe2da('0x37')]};var _0x959f4e={'rejectUnauthorized':![],'method':_0xe2da('0xd0'),'url':_0xe2da('0xd1'),'headers':{'X-APIKEY':_0x154dc2[_0xe2da('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xb7c12[_0xe2da('0xa9')][_0xe2da('0xd2')]],'buttons':null,'topic':_0x1d71c6[_0xe2da('0xcd')],'note':_[_0xe2da('0xd3')](_0x1d71c6['vidaooNote'])?null:getMustacheRender(_0x1d71c6[_0xe2da('0xd4')],_0x50ff2c),'metadata':null},'redirect':_0xe2da('0xd5'),'json':!![]};try{if(!_['isNull'](_0x1d71c6[_0xe2da('0xce')])){var _0x38cf52=getMustacheRender(_0x1d71c6[_0xe2da('0xce')],_0x50ff2c);var _0x16b8c4=JSON['parse'](_0x38cf52);_0x959f4e[_0xe2da('0x34')][_0xe2da('0xd6')]=_0x16b8c4;}}catch(_0x17060b){throw new db[(_0xe2da('0x9f'))][(_0xe2da('0xd7'))](_0xe2da('0xd8'));}return rp(_0x959f4e);}else{throw new db[(_0xe2da('0x9f'))][(_0xe2da('0xd7'))](_0xe2da('0xd9'));}})[_0xe2da('0x19')](function(_0x3f8a80){_0x4a4756=_0x3f8a80;if(_0x4a4756['id']){var _0x3063eb={'body':_0x4a4756['join_url'],'ChatWebsiteId':_0x1d71c6['id'],'ChatInteractionId':_0x4be1fe['id'],'direction':_0xe2da('0xda'),'UserId':_0xb7c12[_0xe2da('0xa9')]['id']};return db[_0xe2da('0xdb')]['create'](_0x3063eb,{});}else{throw new db[(_0xe2da('0x9f'))][(_0xe2da('0xd7'))](_0xe2da('0xdc'));}})[_0xe2da('0x19')](function(){return _0x4be1fe[_0xe2da('0xdd')]({'vidaooSessionId':_0x4a4756['id']});})[_0xe2da('0x19')](respondWithResult(_0x7a762c,null))['catch'](handleError(_0x7a762c,null));};exports[_0xe2da('0xde')]=function(_0x1b8217,_0x540e77){if(_0x1b8217[_0xe2da('0x34')]['id']){delete _0x1b8217[_0xe2da('0x34')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x1b8217[_0xe2da('0xc7')]['id']},'include':[{'model':db[_0xe2da('0xdf')],'as':'Contact'}]})[_0xe2da('0x19')](handleEntityNotFound(_0x540e77,null))[_0xe2da('0x19')](saveUpdates(_0x1b8217[_0xe2da('0x34')],null))[_0xe2da('0x19')](respondWithResult(_0x540e77,null))[_0xe2da('0x3d')](handleError(_0x540e77,null));};exports['abandon']=function(_0x3320d4,_0x341a0a){if(_0x3320d4['body']['id']){delete _0x3320d4['body']['id'];}return db['ChatInteraction'][_0xe2da('0x72')]({'where':{'id':_0x3320d4['params']['id']}})['then'](function(_0x4f81b4){if(!_0x4f81b4){logger[_0xe2da('0x1e')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xe2da('0xe0'),0x194,_0xe2da('0xe1'));_0x341a0a[_0xe2da('0x23')](0x194);}else{if(_0x4f81b4[_0xe2da('0x44')]){throw new db['Sequelize'][(_0xe2da('0xd7'))](_0xe2da('0xe2'));}}return _0x4f81b4;})[_0xe2da('0x19')](function(_0x253125){if(_0x253125){return _0x253125[_0xe2da('0x2d')]({'closed':_0x3320d4[_0xe2da('0x34')][_0xe2da('0x43')],'disposition':_0x3320d4[_0xe2da('0x34')][_0xe2da('0x45')]})[_0xe2da('0x19')](function(_0x147996){return _0x147996;});}})[_0xe2da('0x19')](function(){return respondWithRpcPromise(_0xe2da('0xe3'),_0xe2da('0xe0'),_0x3320d4['body'],client9004);})[_0xe2da('0x19')](respondWithResult(_0x341a0a,null))['catch'](handleError(_0x341a0a,null));};exports[_0xe2da('0xe4')]=function(_0x410935,_0x20a584){_0x410935['body'][_0xe2da('0x30')]=_0x410935[_0xe2da('0xe5')][_0xe2da('0xe6')];_0x410935[_0xe2da('0x34')][_0xe2da('0xe7')]=_0x410935[_0xe2da('0xe5')]['filename'];_0x410935[_0xe2da('0x34')][_0xe2da('0x7c')]=_0x410935[_0xe2da('0xe5')][_0xe2da('0xe8')];return db[_0xe2da('0xe9')][_0xe2da('0xc9')](_0x410935['body'])[_0xe2da('0x19')](respondWithResult(_0x20a584,0xc9))[_0xe2da('0x3d')](handleError(_0x20a584,null));};exports[_0xe2da('0xea')]=function(_0x5f5cb2,_0x18a7ba){return db['ChatInteraction'][_0xe2da('0xcb')]({'where':{'id':_0x5f5cb2[_0xe2da('0xc7')]['id']},'raw':!![]})[_0xe2da('0x19')](handleEntityNotFound(_0x18a7ba,null))[_0xe2da('0x19')](function(_0x299ffd){if(_0x299ffd){if(_0x299ffd['closed']){return _0x18a7ba[_0xe2da('0x24')](0x193)[_0xe2da('0x26')]({'status':0x193,'message':_0xe2da('0xeb')});}return db[_0xe2da('0xe9')]['findOne']({'where':{'id':_0x5f5cb2[_0xe2da('0x4d')][_0xe2da('0xec')]},'raw':!![]})['then'](handleEntityNotFound(_0x18a7ba,null));}})[_0xe2da('0x19')](function(_0x38270e){if(_0x38270e){var _0x3ea40b=_0x38270e[_0xe2da('0xed')]!==null;var _0x19d561=path[_0xe2da('0xee')](config['root'],_0xe2da('0xef'));if(_0x3ea40b){_0x19d561=path[_0xe2da('0xee')](_0x19d561,'offline-chat/');}var _0x598211=path['join'](_0x19d561,_0x38270e['basename']);return _0x18a7ba['download'](_0x598211);}})[_0xe2da('0x3d')](handleError(_0x18a7ba,null));};exports[_0xe2da('0xf0')]=function(_0x48e43e,_0x20ddc5){var _0x1508c=null;var _0x3ca50e=null;var _0x2b1e1e=null;if(_0x48e43e[_0xe2da('0x34')]['id']){delete _0x48e43e[_0xe2da('0x34')]['id'];}if(_0x48e43e[_0xe2da('0x34')][_0xe2da('0xf1')]){_0x2b1e1e=path[_0xe2da('0xee')](config[_0xe2da('0xf2')],_0xe2da('0xf3'),util[_0xe2da('0xf4')](_0xe2da('0xf5'),Date[_0xe2da('0xf6')]()));_0x48e43e[_0xe2da('0x34')]['pathTranscript']=_0x2b1e1e;}return db['ChatInteraction'][_0xe2da('0x72')]({'where':{'id':_0x48e43e[_0xe2da('0xc7')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xe2da('0xf7'),'include':[{'model':db['User'],'as':_0xe2da('0x82')}]}]})[_0xe2da('0x19')](handleEntityNotFound(_0x20ddc5,null))[_0xe2da('0x19')](saveUpdates(_0x48e43e[_0xe2da('0x34')],null))['then'](function(_0x331445){if(_0x331445){_0x1508c=_0x331445;return db[_0xe2da('0xf8')][_0xe2da('0x72')]({'where':{'id':_0x1508c[_0xe2da('0x89')]}});}})[_0xe2da('0x19')](function(_0x39ac90){if(_0x39ac90){_0x3ca50e=_0x39ac90;return db[_0xe2da('0xdf')][_0xe2da('0x72')]({'where':{'id':_0x1508c[_0xe2da('0x7b')]}});}})[_0xe2da('0x19')](function(_0x159cca){if(_0x159cca){if(_0x2b1e1e){var _0x849448=null;for(var _0x24a33f=0x1;_0x24a33f<_0x1508c['Messages']['length'];++_0x24a33f){_0x849448=_0x1508c[_0xe2da('0xf7')][_0x24a33f];var _0x2e846e=_0x849448['UserId']?util[_0xe2da('0xf4')](_0xe2da('0xf9'),_0x3ca50e[_0xe2da('0xfa')],_0x849448[_0xe2da('0x44')]):_0xe2da('0xfb');var _0x5309ea=_0x48e43e[_0xe2da('0x34')][_0xe2da('0xfc')]||util[_0xe2da('0xf4')](_0xe2da('0xf9'),_0xe2da('0xfd'),_0x849448[_0xe2da('0x7b')]);switch(_0x3ca50e[_0xe2da('0xfe')]){case _0xe2da('0xff'):_0x2e846e=_0x849448['UserId']?util['format'](_0xe2da('0xf9'),_0x3ca50e[_0xe2da('0xfa')],_0x849448[_0xe2da('0x44')]):_0xe2da('0xfb');break;case'agent_alias':_0x2e846e=_0x849448[_0xe2da('0x44')]?_0x849448[_0xe2da('0x82')]['alias']||_0x849448[_0xe2da('0x82')][_0xe2da('0x39')]:_0xe2da('0xfb');break;case _0xe2da('0x100'):_0x2e846e=_0x849448[_0xe2da('0x44')]?_0x849448['User'][_0xe2da('0x39')]:_0xe2da('0xfb');break;default:_0x2e846e=_0x849448[_0xe2da('0x44')]?util[_0xe2da('0xf4')]('%s%d',_0x3ca50e[_0xe2da('0xfa')],_0x849448[_0xe2da('0x44')]):_0xe2da('0xfb');}var _0x4c010d=util['format'](_0xe2da('0x101'),moment(_0x849448[_0xe2da('0x8c')])[_0xe2da('0xf4')](_0xe2da('0x102')),_0x849448['direction']==='in'?_0x5309ea:_0x2e846e,_0x849448[_0xe2da('0x34')]);if(!_0x849448[_0xe2da('0x103')]){fs[_0xe2da('0x104')](_0x2b1e1e,_0x4c010d);}}return db[_0xe2da('0x105')][_0xe2da('0xcb')]({'where':{'service':!![]},'include':[{'model':db[_0xe2da('0x106')],'as':_0xe2da('0x107'),'raw':!![],'include':[{'model':db[_0xe2da('0x108')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xe2da('0x19')](function(_0xfafbe0){if(!_0xfafbe0||!_0xfafbe0[_0xe2da('0x107')]||!_0x48e43e[_0xe2da('0x34')])return _0x1508c;var _0x5038b0=_0xfafbe0[_0xe2da('0x109')]();return respondWithRpcPromise(_0xe2da('0x10a'),_0xe2da('0x10b'),{'account':_0x5038b0,'message':{'from':util[_0xe2da('0xf4')](_0xe2da('0x10c'),_0xfafbe0[_0xe2da('0x30')],_0xfafbe0[_0xe2da('0xd2')]||_0xfafbe0[_0xe2da('0x107')][_0xe2da('0xa9')]),'to':_0x48e43e[_0xe2da('0x34')]['mailTranscript'],'subject':_0xe2da('0x10d'),'text':util[_0xe2da('0xf4')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x48e43e[_0xe2da('0x34')][_0xe2da('0xf1')]),'attachments':[{'path':_0x2b1e1e}]}})[_0xe2da('0x19')](function(){return _0x1508c;})[_0xe2da('0x3d')](function(_0x26a5ab){logger[_0xe2da('0x1e')](_0x26a5ab);});})[_0xe2da('0x19')](respondWithStatusCode(_0x20ddc5,0xc8))[_0xe2da('0x3d')](handleError(_0x20ddc5,null));};exports[_0xe2da('0x10e')]=function(_0x295354,_0x144667){return db[_0xe2da('0xdb')][_0xe2da('0x72')]({'where':{'id':_0x295354[_0xe2da('0xc7')]['id']}})[_0xe2da('0x19')](handleEntityNotFound(_0x144667,null))[_0xe2da('0x19')](function(_0x22c905){if(_0x22c905){return _0x22c905[_0xe2da('0x10e')](_0x295354[_0xe2da('0x34')][_0xe2da('0x10f')],_[_0xe2da('0x110')](_0x295354[_0xe2da('0x34')],[_0xe2da('0x10f'),'id'])||{});}})[_0xe2da('0x19')](respondWithResult(_0x144667,null))[_0xe2da('0x3d')](handleError(_0x144667,null));};exports['getMessages']=function(_0xd174a8,_0x13f188){var _0x319b30={'raw':![],'where':{}};var _0x485e7b={};var _0x40be16={'count':0x0,'rows':[]};return db[_0xe2da('0xae')][_0xe2da('0xcb')]({'where':{'id':_0xd174a8[_0xe2da('0xc7')]['id']}})[_0xe2da('0x19')](handleEntityNotFound(_0x13f188,null))[_0xe2da('0x19')](function(_0x309243){if(_0x309243){_0x485e7b[_0xe2da('0x4f')]=_['keys'](db[_0xe2da('0xdb')]['rawAttributes']);_0x485e7b['query']=_[_0xe2da('0x4c')](_0xd174a8['query']);_0x485e7b[_0xe2da('0x57')]=_[_0xe2da('0x4e')](_0x485e7b[_0xe2da('0x4f')],_0x485e7b[_0xe2da('0x4d')]);_0x319b30['attributes']=_['intersection'](_0x485e7b[_0xe2da('0x4f')],qs[_0xe2da('0x50')](_0xd174a8[_0xe2da('0x4d')][_0xe2da('0x50')]));_0x319b30[_0xe2da('0x51')]=_0x319b30[_0xe2da('0x51')][_0xe2da('0x52')]?_0x319b30[_0xe2da('0x51')]:_0x485e7b[_0xe2da('0x4f')];if(!_0xd174a8[_0xe2da('0x4d')][_0xe2da('0x111')](_0xe2da('0x53'))){_0x319b30[_0xe2da('0x28')]=qs['limit'](_0xd174a8[_0xe2da('0x4d')][_0xe2da('0x28')]);_0x319b30[_0xe2da('0x2a')]=qs[_0xe2da('0x2a')](_0xd174a8[_0xe2da('0x4d')][_0xe2da('0x2a')]);}_0x319b30[_0xe2da('0x54')]=qs[_0xe2da('0x55')](_0xd174a8[_0xe2da('0x4d')][_0xe2da('0x55')]);_0x319b30[_0xe2da('0x56')]=qs[_0xe2da('0x57')](_[_0xe2da('0x58')](_0xd174a8['query'],_0x485e7b['filters']));_0x319b30[_0xe2da('0x56')][_0xe2da('0xc2')]=_0x309243['id'];if(_0xd174a8[_0xe2da('0x4d')]['filter']){_0x319b30['where']=_[_0xe2da('0x33')](_0x319b30['where'],{'$or':_[_0xe2da('0x48')](_0x319b30['attributes'],function(_0xda7a4){var _0x3f0e98={};_0x3f0e98[_0xda7a4]={'$like':'%'+_0xd174a8[_0xe2da('0x4d')][_0xe2da('0x98')]+'%'};return _0x3f0e98;})});}if(_0xd174a8[_0xe2da('0x4d')][_0xe2da('0x112')]){var _0x3a3066=_0xd174a8[_0xe2da('0x4d')][_0xe2da('0x112')]['split'](',');var _0x1c0df3={};_0x1c0df3[_0x3a3066[0x0]]={'$gte':moment(_0x3a3066[0x1])[_0xe2da('0xf4')](_0xe2da('0x113'))};_0x319b30[_0xe2da('0x56')]=_[_0xe2da('0x33')](_0x319b30['where'],_0x1c0df3);}_0x319b30=_['merge']({},_0x319b30,_0xd174a8['options']);return db[_0xe2da('0xdb')][_0xe2da('0x29')]({'where':_0x319b30[_0xe2da('0x56')]})['then'](function(_0x871c9b){_0x40be16[_0xe2da('0x29')]=_0x871c9b;if(_0xd174a8[_0xe2da('0x4d')][_0xe2da('0xc8')]){_0x319b30[_0xe2da('0x114')]=[{'all':!![]}];}return db[_0xe2da('0xdb')][_0xe2da('0x115')](_0x319b30);})[_0xe2da('0x19')](function(_0x2d41a9){_0x40be16[_0xe2da('0xc5')]=_0x2d41a9;return _0x40be16;});}})[_0xe2da('0x19')](respondWithFilteredResult(_0x13f188,_0x319b30))[_0xe2da('0x3d')](handleError(_0x13f188,null));};exports['getMyMessages']=function(_0x1b3408,_0x25993d){var _0x48315c={'where':{}},_0x13eeb1={},_0x46c3e0={'count':0x0,'rows':[]};return db[_0xe2da('0xae')][_0xe2da('0xcb')]({'where':{'id':_0x1b3408[_0xe2da('0xc7')]['id']}})[_0xe2da('0x19')](handleEntityNotFound(_0x25993d,null))[_0xe2da('0x19')](function(_0x2edfc3){if(_0x2edfc3){_0x13eeb1['model']=_[_0xe2da('0x4c')](db['ChatMessage'][_0xe2da('0x49')]);_0x13eeb1['query']=_['keys'](_0x1b3408['query']);_0x13eeb1[_0xe2da('0x57')]=_[_0xe2da('0x4e')](_0x13eeb1[_0xe2da('0x4f')],_0x13eeb1['query']);_0x48315c[_0xe2da('0x51')]=_[_0xe2da('0x4e')](_0x13eeb1[_0xe2da('0x4f')],qs[_0xe2da('0x50')](_0x1b3408[_0xe2da('0x4d')][_0xe2da('0x50')]));_0x48315c[_0xe2da('0x51')]=_0x48315c[_0xe2da('0x51')]['length']?_0x48315c[_0xe2da('0x51')]:_0x13eeb1[_0xe2da('0x4f')];if(!_0x1b3408[_0xe2da('0x4d')]['hasOwnProperty'](_0xe2da('0x53'))){_0x48315c[_0xe2da('0x28')]=qs[_0xe2da('0x28')](_0x1b3408['query'][_0xe2da('0x28')]);_0x48315c[_0xe2da('0x2a')]=qs[_0xe2da('0x2a')](_0x1b3408[_0xe2da('0x4d')]['offset']);}_0x48315c[_0xe2da('0x54')]=qs[_0xe2da('0x55')](_0x1b3408[_0xe2da('0x4d')]['sort']);_0x48315c['where']=qs['filters'](_[_0xe2da('0x58')](_0x1b3408[_0xe2da('0x4d')],_0x13eeb1[_0xe2da('0x57')]));_0x48315c[_0xe2da('0x56')][_0xe2da('0xc2')]=_0x2edfc3['id'];if(_0x1b3408[_0xe2da('0x4d')][_0xe2da('0x98')]){_0x48315c[_0xe2da('0x56')]=_[_0xe2da('0x33')](_0x48315c['where'],{'$or':_[_0xe2da('0x48')](_0x48315c[_0xe2da('0x51')],function(_0x440d8b){var _0x5e5de2={};_0x5e5de2[_0x440d8b]={'$like':'%'+_0x1b3408[_0xe2da('0x4d')][_0xe2da('0x98')]+'%'};return _0x5e5de2;})});}_0x48315c['where'][_0xe2da('0x103')]=![];if(_0x1b3408['query']['id']){_0x48315c[_0xe2da('0x56')]['id']={'$gt':_0x1b3408[_0xe2da('0x4d')]['id']};}_0x48315c=_[_0xe2da('0x33')]({},_0x48315c,_0x1b3408[_0xe2da('0x116')]);return db['ChatMessage'][_0xe2da('0x29')]({'where':_0x48315c[_0xe2da('0x56')]})[_0xe2da('0x19')](function(_0x195c9e){_0x46c3e0['count']=_0x195c9e;_0x48315c[_0xe2da('0x114')]=[];if(_0x1b3408[_0xe2da('0x4d')][_0xe2da('0x117')]){_0x48315c['include'][_0xe2da('0xc3')]({'model':db[_0xe2da('0x82')],'as':_0xe2da('0x82'),'attributes':['id','fullname',_0xe2da('0x118')]});}if(_0x1b3408[_0xe2da('0x4d')][_0xe2da('0xc8')]){_0x48315c[_0xe2da('0x114')]=[{'all':!![]}];}return db['ChatMessage'][_0xe2da('0x115')](_0x48315c);})[_0xe2da('0x19')](function(_0x7be107){_0x46c3e0['rows']=_0x7be107;return _0x46c3e0;});}})[_0xe2da('0x19')](respondWithFilteredResult(_0x25993d,_0x48315c))[_0xe2da('0x3d')](handleError(_0x25993d,null));};exports[_0xe2da('0x119')]=function(_0x12b618,_0x47e982){return db[_0xe2da('0xae')][_0xe2da('0x72')]({'where':{'id':_0x12b618[_0xe2da('0xc7')]['id']}})[_0xe2da('0x19')](handleEntityNotFound(_0x47e982,null))['then'](function(_0x54b7d2){if(_0x54b7d2){return _0x54b7d2[_0xe2da('0x11a')](_0x12b618['body'][_0xe2da('0x10f')],_[_0xe2da('0x110')](_0x12b618[_0xe2da('0x34')],[_0xe2da('0x10f'),'id'])||{})[_0xe2da('0x11b')](function(){return db[_0xe2da('0x7f')][_0xe2da('0x115')]({'attributes':['id','name',_0xe2da('0x5b')],'where':{'id':_0x12b618[_0xe2da('0x34')][_0xe2da('0x10f')]}});})[_0xe2da('0x19')](function(_0x1deb3a){socket[_0xe2da('0x11c')](_0xe2da('0x11d'),{'id':Number(_0x12b618[_0xe2da('0xc7')]['id']),'tags':_0x1deb3a||[]});return{'id':Number(_0x12b618[_0xe2da('0xc7')]['id']),'tags':_0x1deb3a||[]};});}})[_0xe2da('0x19')](respondWithResult(_0x47e982,null))[_0xe2da('0x3d')](handleError(_0x47e982,null));};exports[_0xe2da('0x11e')]=function(_0x5297f8,_0x44dde7){return db[_0xe2da('0xae')][_0xe2da('0x72')]({'where':{'id':_0x5297f8[_0xe2da('0xc7')]['id']}})[_0xe2da('0x19')](handleEntityNotFound(_0x44dde7,null))[_0xe2da('0x19')](function(_0x416530){if(_0x416530){return _0x416530['removeTags'](_0x5297f8[_0xe2da('0x4d')][_0xe2da('0x10f')]);}})[_0xe2da('0x19')](respondWithStatusCode(_0x44dde7,null))[_0xe2da('0x3d')](handleError(_0x44dde7,null));};exports[_0xe2da('0x11f')]=function(_0x472778,_0x31c8db){var _0x1db030=moment()[_0xe2da('0x120')]()[_0xe2da('0xad')]();var _0x4f660a=path['join'](config['root'],_0xe2da('0x121'),'files','tmp');var _0x33d1f0=path[_0xe2da('0xee')](config[_0xe2da('0xf2')],'server',_0xe2da('0x122'),'attachments');var _0x37538b=path['join'](_0x4f660a,_0x1db030);var _0x49d7fc=util['format'](_0xe2da('0x123'),_0x472778[_0xe2da('0xc7')]['id'],_0x1db030);var _0x5333e2=path[_0xe2da('0xee')](_0x4f660a,_0x49d7fc);var _0x1a8770=[];_0x1a8770['push']({'model':db['User'],'as':'User','attributes':['id',_0xe2da('0x39')],'raw':!![]});_0x1a8770[_0xe2da('0xc3')]({'model':db[_0xe2da('0xdf')],'as':_0xe2da('0x76'),'attributes':['id',_0xe2da('0x124'),_0xe2da('0x125')],'raw':!![]});if(_0x472778['query'][_0xe2da('0x126')]){_0x1a8770[_0xe2da('0xc3')]({'model':db[_0xe2da('0xe9')],'as':_0xe2da('0xe9'),'raw':!![]});}var _0x518beb=[{'model':db[_0xe2da('0xdb')],'as':_0xe2da('0xf7'),'attributes':['id',_0xe2da('0x34'),_0xe2da('0x8c'),_0xe2da('0x127'),_0xe2da('0x103'),_0xe2da('0x93')],'include':_0x1a8770}];_0x518beb[_0xe2da('0xc3')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0xe2da('0x30')]});_0x518beb['push']({'model':db['User'],'as':_0xe2da('0x128'),'attributes':['id','fullname']});return db['ChatInteraction'][_0xe2da('0x72')]({'where':{'id':_0x472778[_0xe2da('0xc7')]['id']},'include':_0x518beb})[_0xe2da('0x19')](handleEntityNotFound(_0x31c8db,null))['then'](function(_0x5de19e){if(_0x5de19e){var _0x36d61e=_0x5de19e[_0xe2da('0x129')]({'plain':!![]});fs[_0xe2da('0x12a')](_0x37538b);var _0x52b0a={'channel':_0xe2da('0x12b'),'account':_0x36d61e['Account']['name'],'agent':_0x36d61e['Owner']?_0x36d61e['Owner']['fullname']:_0xe2da('0x12c'),'createdAt':moment(_0x36d61e[_0xe2da('0x8c')])[_0xe2da('0xf4')](_0xe2da('0x113'))['toString'](),'closedAt':_0x36d61e['closed']?moment(_0x36d61e['closedAt'])[_0xe2da('0xf4')](_0xe2da('0x113'))['toString']():'','disposition':_0x36d61e[_0xe2da('0x45')],'chatInfo':{'browser':_0x36d61e[_0xe2da('0x12d')],'os':_0x36d61e[_0xe2da('0x12e')],'referer':_0x36d61e[_0xe2da('0x12f')],'customerIp':_0x36d61e[_0xe2da('0x130')],'customerPort':_0x36d61e['customerPort']?_0x36d61e[_0xe2da('0x131')]:'N.A.'},'messages':_(_0x36d61e[_0xe2da('0xf7')])[_0xe2da('0x132')]()[_0xe2da('0x98')]({'secret':![]})['map'](function(_0x34a1ff){if(_0x34a1ff['Attachment']){var _0x3e17b9=path[_0xe2da('0xee')](_0x33d1f0,_0x34a1ff[_0xe2da('0xe9')]['basename']);if(fs[_0xe2da('0x133')](_0x3e17b9)){fs[_0xe2da('0x134')](_0x3e17b9)['pipe'](fs[_0xe2da('0x135')](path[_0xe2da('0xee')](_0x37538b,_0x34a1ff[_0xe2da('0xe9')][_0xe2da('0xe7')])));}}return{'date':moment(_0x34a1ff[_0xe2da('0x8c')])[_0xe2da('0xf4')](_0xe2da('0x113'))[_0xe2da('0xad')](),'sender':_0x34a1ff[_0xe2da('0x127')]===_0xe2da('0xda')?_0x34a1ff[_0xe2da('0x82')]?_0x34a1ff['User'][_0xe2da('0x39')]:'System':_0x34a1ff[_0xe2da('0x76')][_0xe2da('0x124')]+(_0x34a1ff[_0xe2da('0x76')]['lastName']?'\x20'+_0x34a1ff['Contact'][_0xe2da('0x125')]:''),'body':_0x34a1ff[_0xe2da('0xe9')]?_0x34a1ff[_0xe2da('0xe9')][_0xe2da('0xe7')]:_0x34a1ff[_0xe2da('0x34')],'direction':_0x34a1ff[_0xe2da('0x127')]===_0xe2da('0xda')?'A':'C','secret':_0x34a1ff[_0xe2da('0x103')],'read':_0x34a1ff[_0xe2da('0x93')],'attachment':_0x34a1ff[_0xe2da('0xe9')]};})[_0xe2da('0x79')]()};return ejs[_0xe2da('0x136')](path[_0xe2da('0xee')](config[_0xe2da('0xf2')],_0xe2da('0x121'),'views',_0xe2da('0x137')),{'interaction':_0x52b0a})[_0xe2da('0x19')](function(_0x447193){var _0x1afd65=path['join'](_0x37538b,_0xe2da('0x138')+_0x36d61e['id']+'-'+_0x1db030+_0xe2da('0x139'));var _0x1db719={'path':_0x1afd65,'channel':_0xe2da('0x12b'),'interactionId':_0x36d61e['id']};return pdf['createPdfFromHTML'](_0x447193,_0x1db719);})[_0xe2da('0x19')](function(){return new Promise(function(_0x5a5c30,_0x3f5d44){zipdir(_0x37538b,{'saveTo':_0x5333e2},function(_0x282be8,_0x40096e){if(_0x282be8)return _0x3f5d44(_0x282be8);return _0x5a5c30(_0x40096e);});})['then'](function(){return new BPromise(function(_0x35240f,_0x309726){rimraf(_0x37538b,function(_0x5a6db5){if(_0x5a6db5)_0x309726(_0x5a6db5);return _0x35240f();});});})['then'](function(){return _0x31c8db['download'](_0x5333e2,_0x49d7fc,function(_0x3cb46b){if(_0x3cb46b){logger['error'](_0xe2da('0x13a'),_0x3cb46b);}else{fs['unlinkSync'](_0x5333e2);}});});});}else{return _0x31c8db['sendStatus'](0xc8);}})[_0xe2da('0x3d')](handleError(_0x31c8db,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 1a8bc1c..c93bb63 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 _0x3381=['remove','getUsers','then','Users','map','findAll','catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3381,0x1da));var _0x1338=function(_0x3ab53f,_0x41de09){_0x3ab53f=_0x3ab53f-0x0;var _0xd1589a=_0x3381[_0x3ab53f];return _0xd1589a;};'use strict';var EventEmitter=require(_0x1338('0x0'));var ChatInteraction=require(_0x1338('0x1'))['db'][_0x1338('0x2')];var ChatMessage=require(_0x1338('0x1'))['db'][_0x1338('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x1338('0x4')](0x0);var events={'afterCreate':_0x1338('0x5'),'afterUpdate':'update','afterDestroy':_0x1338('0x6')};function emitEvent(_0x362f55){return function(_0x3f9d50,_0x4c9321,_0x1eb2c9){_0x3f9d50[_0x1338('0x7')]({'attributes':['id'],'raw':!![]})[_0x1338('0x8')](function(_0x32e3e8){_0x3f9d50['setDataValue'](_0x1338('0x9'),_0x32e3e8[_0x1338('0xa')](function(_0x2513d5){return{'id':_0x2513d5['id']};}));return ChatMessage[_0x1338('0xb')]({'where':{'ChatInteractionId':_0x3f9d50['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1338('0x8')](function(_0x901730){_0x3f9d50['setDataValue']('unreadMessages',_0x901730['length']);ChatInteractionEvents['emit'](_0x362f55+':'+_0x3f9d50['id'],_0x3f9d50);ChatInteractionEvents['emit'](_0x362f55,_0x3f9d50);_0x1eb2c9(null);})[_0x1338('0xc')](_0x1eb2c9(null));};}for(var e in events){if(events[_0x1338('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x1338('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x7795=['unreadMessages','length','emit','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll'];(function(_0x34cbbb,_0x144152){var _0x21f083=function(_0x4d1fed){while(--_0x4d1fed){_0x34cbbb['push'](_0x34cbbb['shift']());}};_0x21f083(++_0x144152);}(_0x7795,0x16d));var _0x5779=function(_0x4b8309,_0x141405){_0x4b8309=_0x4b8309-0x0;var _0x103ac8=_0x7795[_0x4b8309];return _0x103ac8;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x5779('0x0'))['db'][_0x5779('0x1')];var ChatMessage=require(_0x5779('0x0'))['db'][_0x5779('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5779('0x3')](0x0);var events={'afterCreate':_0x5779('0x4'),'afterUpdate':_0x5779('0x5'),'afterDestroy':_0x5779('0x6')};function emitEvent(_0x2eb3f6){return function(_0xf217a8,_0x5d4156,_0xfd8a88){_0xf217a8[_0x5779('0x7')]({'attributes':['id'],'raw':!![]})[_0x5779('0x8')](function(_0x599096){_0xf217a8[_0x5779('0x9')](_0x5779('0xa'),_0x599096[_0x5779('0xb')](function(_0xefcdec){return{'id':_0xefcdec['id']};}));return ChatMessage[_0x5779('0xc')]({'where':{'ChatInteractionId':_0xf217a8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5779('0x8')](function(_0x407427){_0xf217a8[_0x5779('0x9')](_0x5779('0xd'),_0x407427[_0x5779('0xe')]);ChatInteractionEvents[_0x5779('0xf')](_0x2eb3f6+':'+_0xf217a8['id'],_0xf217a8);ChatInteractionEvents['emit'](_0x2eb3f6,_0xf217a8);_0xfd8a88(null);})['catch'](_0xfd8a88(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x5779('0x10')](e,emitEvent(event));}}module[_0x5779('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index c576905..130bb94 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 _0xe5a9=['ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define'];(function(_0x7440e0,_0x42d9b8){var _0x33ee99=function(_0x3edb33){while(--_0x3edb33){_0x7440e0['push'](_0x7440e0['shift']());}};_0x33ee99(++_0x42d9b8);}(_0xe5a9,0x1e9));var _0x9e5a=function(_0x3d145d,_0x3aa561){_0x3d145d=_0x3d145d-0x0;var _0x200285=_0xe5a9[_0x3d145d];return _0x200285;};'use strict';var _=require(_0x9e5a('0x0'));var util=require(_0x9e5a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9e5a('0x2'));var BPromise=require(_0x9e5a('0x3'));var rp=require(_0x9e5a('0x4'));var fs=require('fs');var path=require(_0x9e5a('0x5'));var rimraf=require(_0x9e5a('0x6'));var config=require(_0x9e5a('0x7'));var attributes=require(_0x9e5a('0x8'));module[_0x9e5a('0x9')]=function(_0x7126d5,_0xddec76){return _0x7126d5[_0x9e5a('0xa')](_0x9e5a('0xb'),attributes,{'tableName':_0x9e5a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x549a25,_0x6c4993,_0x2a62e7){if(_0x549a25[_0x9e5a('0xd')](_0x9e5a('0xe'))){_0x549a25[_0x9e5a('0xf')]=moment()[_0x9e5a('0x10')](_0x9e5a('0x11'));}_0x2a62e7(null,_0x549a25);}},'charset':_0x9e5a('0x12'),'collate':_0x9e5a('0x13')});};
\ No newline at end of file
+var _0x524a=['../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util'];(function(_0x300448,_0x4d2e9a){var _0x1036de=function(_0x149910){while(--_0x149910){_0x300448['push'](_0x300448['shift']());}};_0x1036de(++_0x4d2e9a);}(_0x524a,0xb2));var _0xa524=function(_0x140c90,_0x3a368e){_0x140c90=_0x140c90-0x0;var _0x5c4794=_0x524a[_0x140c90];return _0x5c4794;};'use strict';var _=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var logger=require(_0xa524('0x2'))(_0xa524('0x3'));var moment=require(_0xa524('0x4'));var BPromise=require('bluebird');var rp=require(_0xa524('0x5'));var fs=require('fs');var path=require(_0xa524('0x6'));var rimraf=require('rimraf');var config=require(_0xa524('0x7'));var attributes=require('./chatInteraction.attributes');module[_0xa524('0x8')]=function(_0xd5b41a,_0x43bf44){return _0xd5b41a[_0xa524('0x9')](_0xa524('0xa'),attributes,{'tableName':_0xa524('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4a6fbb,_0x3d0d17,_0x1306a2){if(_0x4a6fbb[_0xa524('0xc')](_0xa524('0xd'))){_0x4a6fbb[_0xa524('0xe')]=moment()[_0xa524('0xf')](_0xa524('0x10'));}_0x1306a2(null,_0x4a6fbb);}},'charset':_0xa524('0x11'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index c5b621f..62f3f17 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 _0xf056=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','defaults','redis','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','where','attributes','limit','debug','AddTagsToChatInteraction','find','ids','omit','AddTags','lodash','util'];(function(_0x22d1ef,_0x4a5152){var _0x47c5a3=function(_0x9a2c48){while(--_0x9a2c48){_0x22d1ef['push'](_0x22d1ef['shift']());}};_0x47c5a3(++_0x4a5152);}(_0xf056,0x17a));var _0x6f05=function(_0x3c1fbf,_0x1f6454){_0x3c1fbf=_0x3c1fbf-0x0;var _0x2ddbdd=_0xf056[_0x3c1fbf];return _0x2ddbdd;};'use strict';var _=require(_0x6f05('0x0'));var util=require(_0x6f05('0x1'));var moment=require(_0x6f05('0x2'));var BPromise=require(_0x6f05('0x3'));var rs=require(_0x6f05('0x4'));var fs=require('fs');var Redis=require(_0x6f05('0x5'));var db=require(_0x6f05('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6f05('0x7'))(_0x6f05('0x8'));var config=require('../../config/environment');var jayson=require(_0x6f05('0x9'));var client=jayson[_0x6f05('0xa')]['http']({'port':0x232a});config['redis']=_[_0x6f05('0xb')](config[_0x6f05('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6f05('0xc')]));require(_0x6f05('0xd'))[_0x6f05('0xe')](socket);function respondWithRpcPromise(_0x38580c,_0x2cc0c1,_0x7c0cc4){return new BPromise(function(_0x3fa943,_0x56f246){return client['request'](_0x38580c,_0x7c0cc4)[_0x6f05('0xf')](function(_0x14a3e8){logger[_0x6f05('0x10')](_0x6f05('0x11'),_0x2cc0c1,_0x6f05('0x12'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2cc0c1,_0x6f05('0x12'),JSON[_0x6f05('0x13')](_0x14a3e8));if(_0x14a3e8['error']){if(_0x14a3e8[_0x6f05('0x14')][_0x6f05('0x15')]===0x1f4){logger[_0x6f05('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2cc0c1,_0x14a3e8['error']['message']);return _0x56f246(_0x14a3e8[_0x6f05('0x14')][_0x6f05('0x16')]);}logger['error'](_0x6f05('0x11'),_0x2cc0c1,_0x14a3e8[_0x6f05('0x14')]['message']);return _0x3fa943(_0x14a3e8[_0x6f05('0x14')]['message']);}else{logger[_0x6f05('0x10')](_0x6f05('0x11'),_0x2cc0c1,_0x6f05('0x12'));_0x3fa943(_0x14a3e8[_0x6f05('0x17')][_0x6f05('0x16')]);}})[_0x6f05('0x18')](function(_0x53fcea){logger[_0x6f05('0x14')](_0x6f05('0x11'),_0x2cc0c1,_0x53fcea);_0x56f246(_0x53fcea);});});}exports[_0x6f05('0x19')]=function(_0x58082a){var _0x232e54=this;return new Promise(function(_0xab1bef,_0x392c65){return db[_0x6f05('0x1a')]['update'](_0x58082a[_0x6f05('0x1b')],{'raw':_0x58082a[_0x6f05('0x1c')]?_0x58082a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58082a['options']?_0x58082a[_0x6f05('0x1c')][_0x6f05('0x1d')]||null:null,'attributes':_0x58082a[_0x6f05('0x1c')]?_0x58082a[_0x6f05('0x1c')][_0x6f05('0x1e')]||null:null,'limit':_0x58082a[_0x6f05('0x1c')]?_0x58082a[_0x6f05('0x1c')][_0x6f05('0x1f')]||null:null})[_0x6f05('0xf')](function(_0x3e3039){logger[_0x6f05('0x10')](_0x6f05('0x19'),_0x58082a);logger[_0x6f05('0x20')](_0x6f05('0x19'),_0x58082a,JSON['stringify'](_0x3e3039));_0xab1bef(_0x3e3039);})['catch'](function(_0x5b2d7e){logger['error'](_0x6f05('0x19'),_0x5b2d7e[_0x6f05('0x16')],_0x58082a);_0x392c65(_0x232e54[_0x6f05('0x14')](0x1f4,_0x5b2d7e[_0x6f05('0x16')]));});});};exports[_0x6f05('0x21')]=function(_0xf7bf2a){return new Promise(function(_0x36c7d8,_0x336371){return db[_0x6f05('0x1a')][_0x6f05('0x22')]({'where':_0xf7bf2a[_0x6f05('0x1c')]?_0xf7bf2a[_0x6f05('0x1c')]['where']||null:null})['then'](function(_0x74a4e3){if(_0x74a4e3){return _0x74a4e3['addTags'](_0xf7bf2a[_0x6f05('0x1b')][_0x6f05('0x23')],_[_0x6f05('0x24')](_0xf7bf2a[_0x6f05('0x1b')],[_0x6f05('0x23'),'id'])||{});}})['spread'](function(_0x37fa33){logger[_0x6f05('0x10')](_0x6f05('0x25'),_0xf7bf2a);logger[_0x6f05('0x20')]('AddTags',_0xf7bf2a,JSON[_0x6f05('0x13')](_0x37fa33));_0x36c7d8(_0x37fa33);})['catch'](function(_0x649b8){logger[_0x6f05('0x14')]('AddTags',_0x649b8['message'],_0xf7bf2a);_0x336371(_this['error'](0x1f4,_0x649b8['message']));});});};
\ No newline at end of file
+var _0x14cb=['request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','ChatInteraction','update','options','raw','where','attributes','UpdateChatInteraction','stringify','AddTagsToChatInteraction','find','body','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis'];(function(_0x174480,_0x508a33){var _0x685484=function(_0x16bada){while(--_0x16bada){_0x174480['push'](_0x174480['shift']());}};_0x685484(++_0x508a33);}(_0x14cb,0x140));var _0xb14c=function(_0x404d7e,_0x1583e4){_0x404d7e=_0x404d7e-0x0;var _0x3c1421=_0x14cb[_0x404d7e];return _0x3c1421;};'use strict';var _=require('lodash');var util=require(_0xb14c('0x0'));var moment=require(_0xb14c('0x1'));var BPromise=require(_0xb14c('0x2'));var rs=require(_0xb14c('0x3'));var fs=require('fs');var Redis=require(_0xb14c('0x4'));var db=require(_0xb14c('0x5'))['db'];var utils=require(_0xb14c('0x6'));var logger=require(_0xb14c('0x7'))('rpc');var config=require(_0xb14c('0x8'));var jayson=require(_0xb14c('0x9'));var client=jayson[_0xb14c('0xa')][_0xb14c('0xb')]({'port':0x232a});config['redis']=_[_0xb14c('0xc')](config['redis'],{'host':_0xb14c('0xd'),'port':0x18eb});var socket=require(_0xb14c('0xe'))(new Redis(config[_0xb14c('0xf')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x30cfe5,_0x5deed6,_0x173c0e){return new BPromise(function(_0x418310,_0x55a79e){return client[_0xb14c('0x10')](_0x30cfe5,_0x173c0e)[_0xb14c('0x11')](function(_0x4739e9){logger[_0xb14c('0x12')](_0xb14c('0x13'),_0x5deed6,_0xb14c('0x14'));logger[_0xb14c('0x15')](_0xb14c('0x16'),_0x5deed6,'request\x20sent',JSON['stringify'](_0x4739e9));if(_0x4739e9[_0xb14c('0x17')]){if(_0x4739e9[_0xb14c('0x17')]['code']===0x1f4){logger['error'](_0xb14c('0x13'),_0x5deed6,_0x4739e9[_0xb14c('0x17')][_0xb14c('0x18')]);return _0x55a79e(_0x4739e9[_0xb14c('0x17')][_0xb14c('0x18')]);}logger['error'](_0xb14c('0x13'),_0x5deed6,_0x4739e9['error'][_0xb14c('0x18')]);return _0x418310(_0x4739e9[_0xb14c('0x17')][_0xb14c('0x18')]);}else{logger[_0xb14c('0x12')](_0xb14c('0x13'),_0x5deed6,_0xb14c('0x14'));_0x418310(_0x4739e9[_0xb14c('0x19')][_0xb14c('0x18')]);}})[_0xb14c('0x1a')](function(_0x19ca29){logger[_0xb14c('0x17')](_0xb14c('0x13'),_0x5deed6,_0x19ca29);_0x55a79e(_0x19ca29);});});}exports['UpdateChatInteraction']=function(_0x817cd3){var _0x5ad3dd=this;return new Promise(function(_0x34b671,_0xe3b4cf){return db[_0xb14c('0x1b')][_0xb14c('0x1c')](_0x817cd3['body'],{'raw':_0x817cd3[_0xb14c('0x1d')]?_0x817cd3[_0xb14c('0x1d')][_0xb14c('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x817cd3[_0xb14c('0x1d')]?_0x817cd3[_0xb14c('0x1d')][_0xb14c('0x1f')]||null:null,'attributes':_0x817cd3[_0xb14c('0x1d')]?_0x817cd3[_0xb14c('0x1d')][_0xb14c('0x20')]||null:null,'limit':_0x817cd3[_0xb14c('0x1d')]?_0x817cd3['options']['limit']||null:null})[_0xb14c('0x11')](function(_0x331577){logger['info'](_0xb14c('0x21'),_0x817cd3);logger[_0xb14c('0x15')]('UpdateChatInteraction',_0x817cd3,JSON[_0xb14c('0x22')](_0x331577));_0x34b671(_0x331577);})[_0xb14c('0x1a')](function(_0x3da190){logger[_0xb14c('0x17')](_0xb14c('0x21'),_0x3da190['message'],_0x817cd3);_0xe3b4cf(_0x5ad3dd[_0xb14c('0x17')](0x1f4,_0x3da190[_0xb14c('0x18')]));});});};exports[_0xb14c('0x23')]=function(_0x2e96da){return new Promise(function(_0x3ad41d,_0x534223){return db[_0xb14c('0x1b')][_0xb14c('0x24')]({'where':_0x2e96da[_0xb14c('0x1d')]?_0x2e96da[_0xb14c('0x1d')][_0xb14c('0x1f')]||null:null})[_0xb14c('0x11')](function(_0x5d06f2){if(_0x5d06f2){return _0x5d06f2['addTags'](_0x2e96da[_0xb14c('0x25')][_0xb14c('0x26')],_[_0xb14c('0x27')](_0x2e96da['body'],[_0xb14c('0x26'),'id'])||{});}})[_0xb14c('0x28')](function(_0x868c5f){logger['info']('AddTags',_0x2e96da);logger[_0xb14c('0x15')](_0xb14c('0x29'),_0x2e96da,JSON[_0xb14c('0x22')](_0x868c5f));_0x3ad41d(_0x868c5f);})['catch'](function(_0x5244b0){logger[_0xb14c('0x17')]('AddTags',_0x5244b0[_0xb14c('0x18')],_0x2e96da);_0x534223(_this[_0xb14c('0x17')](0x1f4,_0x5244b0[_0xb14c('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index c7a8723..836ee1f 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 _0xe425=['./chatInteraction.events','save','remove','update','emit','register','length','chatInteraction:'];(function(_0x5b1f6,_0x5b0bc2){var _0x434da1=function(_0x1ff24e){while(--_0x1ff24e){_0x5b1f6['push'](_0x5b1f6['shift']());}};_0x434da1(++_0x5b0bc2);}(_0xe425,0x1b0));var _0x5e42=function(_0x34bbe3,_0x28d122){_0x34bbe3=_0x34bbe3-0x0;var _0x4301aa=_0xe425[_0x34bbe3];return _0x4301aa;};'use strict';var ChatInteractionEvents=require(_0x5e42('0x0'));var events=[_0x5e42('0x1'),_0x5e42('0x2'),_0x5e42('0x3')];function createListener(_0x57d420,_0x4f79f3){return function(_0x41d787){_0x4f79f3[_0x5e42('0x4')](_0x57d420,_0x41d787);};}function removeListener(_0x3a38dc,_0x11208b){return function(){ChatInteractionEvents['removeListener'](_0x3a38dc,_0x11208b);};}exports[_0x5e42('0x5')]=function(_0x211600){for(var _0x2eea7e=0x0,_0x525a1f=events[_0x5e42('0x6')];_0x2eea7e<_0x525a1f;_0x2eea7e++){var _0x3c5bc4=events[_0x2eea7e];var _0x31baa7=createListener(_0x5e42('0x7')+_0x3c5bc4,_0x211600);ChatInteractionEvents['on'](_0x3c5bc4,_0x31baa7);}};
\ No newline at end of file
+var _0xea19=['save','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x40540f,_0x4431e2){var _0xaea6e7=function(_0x2ae71f){while(--_0x2ae71f){_0x40540f['push'](_0x40540f['shift']());}};_0xaea6e7(++_0x4431e2);}(_0xea19,0x14f));var _0x9ea1=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0xea19[_0x55821d];return _0x58ea8a;};'use strict';var ChatInteractionEvents=require(_0x9ea1('0x0'));var events=[_0x9ea1('0x1'),'remove',_0x9ea1('0x2')];function createListener(_0x2f2bd2,_0x5d8ead){return function(_0x42af8d){_0x5d8ead[_0x9ea1('0x3')](_0x2f2bd2,_0x42af8d);};}function removeListener(_0x47e034,_0x209f06){return function(){ChatInteractionEvents[_0x9ea1('0x4')](_0x47e034,_0x209f06);};}exports[_0x9ea1('0x5')]=function(_0x6ad0f3){for(var _0x106732=0x0,_0xa438dd=events[_0x9ea1('0x6')];_0x106732<_0xa438dd;_0x106732++){var _0x4b31ed=events[_0x106732];var _0x3a573d=createListener(_0x9ea1('0x7')+_0x4b31ed,_0x6ad0f3);ChatInteractionEvents['on'](_0x4b31ed,_0x3a573d);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 2208997..4b5adcd 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 _0x528e=['replace','/:id/attachment_upload','single','attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','addTags','update','put','/:id/custom_update','customUpdate','/:id/close','close','chatinteraction:destroy','destroy','/:id/tags','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','root','format','%s-%s','originalname'];(function(_0x4f4fe1,_0x1fd810){var _0x299347=function(_0x420215){while(--_0x420215){_0x4f4fe1['push'](_0x4f4fe1['shift']());}};_0x299347(++_0x1fd810);}(_0x528e,0x72));var _0xe528=function(_0x471cfe,_0x5115a7){_0x471cfe=_0x471cfe-0x0;var _0x99534a=_0x528e[_0x471cfe];return _0x99534a;};'use strict';var multer=require(_0xe528('0x0'));var util=require('util');var path=require(_0xe528('0x1'));var timeout=require(_0xe528('0x2'));var express=require('express');var router=express[_0xe528('0x3')]();var fs_extra=require(_0xe528('0x4'));var auth=require(_0xe528('0x5'));var interaction=require(_0xe528('0x6'));var config=require('../../config/environment');var controller=require(_0xe528('0x7'));router[_0xe528('0x8')]('/',auth[_0xe528('0x9')](),controller['index']);router[_0xe528('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xe528('0xa')]);router[_0xe528('0x8')](_0xe528('0xb'),auth[_0xe528('0xc')](),controller[_0xe528('0xd')]);router[_0xe528('0x8')](_0xe528('0xe'),auth[_0xe528('0xc')](),controller[_0xe528('0xf')]);router['get']('/:id/messages',auth[_0xe528('0x9')](),controller[_0xe528('0x10')]);router[_0xe528('0x8')](_0xe528('0x11'),auth[_0xe528('0xc')](),controller[_0xe528('0x12')]);router[_0xe528('0x8')](_0xe528('0x13'),auth[_0xe528('0x9')](),controller[_0xe528('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe528('0x15')]);router[_0xe528('0x16')]('/:id/vidaoo',auth[_0xe528('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3a40dd,_0x253f52,_0x2fcfa0){_0x2fcfa0(null,path['join'](config[_0xe528('0x17')],'server/files/attachments/'));},'filename':function(_0x14c224,_0x208379,_0x246a9a){_0x246a9a(null,util[_0xe528('0x18')](_0xe528('0x19'),Date['now'](),_0x208379[_0xe528('0x1a')][_0xe528('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xe528('0x1c'),upload[_0xe528('0x1d')]('file'),controller[_0xe528('0x1e')]);router[_0xe528('0x16')](_0xe528('0x1f'),auth[_0xe528('0xc')](),controller[_0xe528('0x20')]);router[_0xe528('0x16')]('/:id/tags',auth[_0xe528('0x9')](),interaction[_0xe528('0x21')](_0xe528('0x22'),_0xe528('0x23')),controller[_0xe528('0x24')]);router['put'](_0xe528('0xb'),auth['isAuthenticated'](),interaction[_0xe528('0x21')](_0xe528('0x22'),'chatinteraction:update'),controller[_0xe528('0x25')]);router[_0xe528('0x26')](_0xe528('0x27'),controller[_0xe528('0x28')]);router[_0xe528('0x26')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xe528('0x26')](_0xe528('0x29'),controller[_0xe528('0x2a')]);router['delete'](_0xe528('0xb'),auth[_0xe528('0x9')](),interaction[_0xe528('0x21')](_0xe528('0x22'),_0xe528('0x2b')),controller[_0xe528('0x2c')]);router['delete'](_0xe528('0x2d'),auth['isAuthenticated'](),controller['removeTags']);module[_0xe528('0x2e')]=router;
\ No newline at end of file
+var _0xa5b1=['create','createVidaooSession','join','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','chatinteraction:addtags','addTags','/:id','tracked','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','chat','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','/describe','isAuthenticated','isChatInteractionAuthorized','/:id/messages','getMessages','getMyMessages','download','post'];(function(_0x379893,_0x1c7161){var _0x39cd43=function(_0x48af76){while(--_0x48af76){_0x379893['push'](_0x379893['shift']());}};_0x39cd43(++_0x1c7161);}(_0xa5b1,0x176));var _0x1a5b=function(_0x3bf1e0,_0x1580be){_0x3bf1e0=_0x3bf1e0-0x0;var _0x5a9ded=_0xa5b1[_0x3bf1e0];return _0x5a9ded;};'use strict';var multer=require(_0x1a5b('0x0'));var util=require(_0x1a5b('0x1'));var path=require(_0x1a5b('0x2'));var timeout=require('connect-timeout');var express=require(_0x1a5b('0x3'));var router=express[_0x1a5b('0x4')]();var fs_extra=require(_0x1a5b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1a5b('0x6'));var config=require(_0x1a5b('0x7'));var controller=require(_0x1a5b('0x8'));router[_0x1a5b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1a5b('0x9')](_0x1a5b('0xa'),auth[_0x1a5b('0xb')](),controller['describe']);router[_0x1a5b('0x9')]('/:id',auth[_0x1a5b('0xc')](),controller['show']);router[_0x1a5b('0x9')]('/:id/attachment_download',auth[_0x1a5b('0xc')](),controller['attachmentDownload']);router[_0x1a5b('0x9')](_0x1a5b('0xd'),auth[_0x1a5b('0xb')](),controller[_0x1a5b('0xe')]);router[_0x1a5b('0x9')]('/:id/my_messages',auth[_0x1a5b('0xc')](),controller[_0x1a5b('0xf')]);router[_0x1a5b('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x1a5b('0x10')]);router[_0x1a5b('0x11')]('/',auth['isAuthenticated'](),controller[_0x1a5b('0x12')]);router['post']('/:id/vidaoo',auth[_0x1a5b('0xb')](),controller[_0x1a5b('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x457e94,_0x242d66,_0x3a0db3){_0x3a0db3(null,path[_0x1a5b('0x14')](config['root'],_0x1a5b('0x15')));},'filename':function(_0xa33fb,_0x1a1473,_0x589edb){_0x589edb(null,util[_0x1a5b('0x16')](_0x1a5b('0x17'),Date[_0x1a5b('0x18')](),_0x1a1473[_0x1a5b('0x19')][_0x1a5b('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1a5b('0x11')]('/:id/attachment_upload',upload[_0x1a5b('0x1b')](_0x1a5b('0x1c')),controller[_0x1a5b('0x1d')]);router[_0x1a5b('0x11')](_0x1a5b('0xd'),auth[_0x1a5b('0xc')](),controller[_0x1a5b('0x1e')]);router[_0x1a5b('0x11')](_0x1a5b('0x1f'),auth[_0x1a5b('0xb')](),interaction['tracked']('chat',_0x1a5b('0x20')),controller[_0x1a5b('0x21')]);router['put'](_0x1a5b('0x22'),auth[_0x1a5b('0xb')](),interaction[_0x1a5b('0x23')]('chat',_0x1a5b('0x24')),controller[_0x1a5b('0x25')]);router[_0x1a5b('0x26')](_0x1a5b('0x27'),controller[_0x1a5b('0x28')]);router[_0x1a5b('0x26')](_0x1a5b('0x29'),auth[_0x1a5b('0xc')](),controller['abandon']);router['put'](_0x1a5b('0x2a'),controller[_0x1a5b('0x2b')]);router['delete'](_0x1a5b('0x22'),auth[_0x1a5b('0xb')](),interaction[_0x1a5b('0x23')](_0x1a5b('0x2c'),_0x1a5b('0x2d')),controller[_0x1a5b('0x2e')]);router['delete'](_0x1a5b('0x1f'),auth[_0x1a5b('0xb')](),controller[_0x1a5b('0x2f')]);module[_0x1a5b('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 363d377..7a3ff4e 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 _0x745f=['INTEGER','sequelize','exports','TEXT','BOOLEAN'];(function(_0x2bda87,_0x5c8ada){var _0x477e42=function(_0x5af1b9){while(--_0x5af1b9){_0x2bda87['push'](_0x2bda87['shift']());}};_0x477e42(++_0x5c8ada);}(_0x745f,0x14b));var _0xf745=function(_0x295143,_0x105ade){_0x295143=_0x295143-0x0;var _0x7982e4=_0x745f[_0x295143];return _0x7982e4;};'use strict';var Sequelize=require(_0xf745('0x0'));module[_0xf745('0x1')]={'body':{'type':Sequelize[_0xf745('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf745('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf745('0x4')]}};
\ No newline at end of file
+var _0x1553=['BOOLEAN','INTEGER','sequelize','TEXT','medium'];(function(_0x54537,_0x4d6705){var _0x27600f=function(_0x28cf0c){while(--_0x28cf0c){_0x54537['push'](_0x54537['shift']());}};_0x27600f(++_0x4d6705);}(_0x1553,0xa2));var _0x3155=function(_0x49cee9,_0x28e9de){_0x49cee9=_0x49cee9-0x0;var _0x5c896d=_0x1553[_0x49cee9];return _0x5c896d;};'use strict';var Sequelize=require(_0x3155('0x0'));module['exports']={'body':{'type':Sequelize[_0x3155('0x1')](_0x3155('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3155('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x3155('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index e061b4a..8c8b7c3 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 _0x0295=['merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','fullname','internal','online','allowmessenger','showWebBar','VoiceQueues','role','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','push','ToId','read','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','save','then','stack','name','index','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter'];(function(_0x562071,_0x57a342){var _0x45db81=function(_0x3be628){while(--_0x3be628){_0x562071['push'](_0x562071['shift']());}};_0x45db81(++_0x57a342);}(_0x0295,0xf3));var _0x5029=function(_0x3f7d24,_0x3ce1d5){_0x3f7d24=_0x3f7d24-0x0;var _0x143f6e=_0x0295[_0x3f7d24];return _0x143f6e;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5029('0x1'));var jsonpatch=require(_0x5029('0x2'));var rp=require(_0x5029('0x3'));var moment=require(_0x5029('0x4'));var BPromise=require(_0x5029('0x5'));var Mustache=require(_0x5029('0x6'));var util=require('util');var path=require(_0x5029('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5029('0x8'));var _=require(_0x5029('0x9'));var squel=require(_0x5029('0xa'));var crypto=require('crypto');var jsforce=require(_0x5029('0xb'));var deskjs=require(_0x5029('0xc'));var toCsv=require(_0x5029('0xd'));var querystring=require('querystring');var Papa=require(_0x5029('0xe'));var Redis=require('ioredis');var authService=require(_0x5029('0xf'));var qs=require(_0x5029('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5029('0x11'));var logger=require('../../config/logger')(_0x5029('0x12'));var utils=require('../../config/utils');var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];config['redis']=_[_0x5029('0x15')](config[_0x5029('0x16')],{'host':_0x5029('0x17'),'port':0x18eb});var socket=require(_0x5029('0x18'))(new Redis(config[_0x5029('0x16')]));require(_0x5029('0x19'))['register'](socket);function respondWithStatusCode(_0x1af477,_0xdd9b5e){_0xdd9b5e=_0xdd9b5e||0xcc;return function(_0x2b61c3){if(_0x2b61c3){return _0x1af477['sendStatus'](_0xdd9b5e);}return _0x1af477['status'](_0xdd9b5e)[_0x5029('0x1a')]();};}function respondWithResult(_0x6cccdd,_0x5e216f){_0x5e216f=_0x5e216f||0xc8;return function(_0x3e5ee4){if(_0x3e5ee4){return _0x6cccdd['status'](_0x5e216f)[_0x5029('0x1b')](_0x3e5ee4);}};}function respondWithFilteredResult(_0x38ab73,_0x4f9a10){return function(_0x44fc27){if(_0x44fc27){var _0x461630=typeof _0x4f9a10[_0x5029('0x1c')]==='undefined'&&typeof _0x4f9a10[_0x5029('0x1d')]===_0x5029('0x1e');var _0x39e533=_0x44fc27[_0x5029('0x1f')];var _0x2d1d8f=_0x461630?0x0:_0x4f9a10[_0x5029('0x1c')];var _0x5bcfa2=_0x461630?_0x44fc27['count']:_0x4f9a10[_0x5029('0x1c')]+_0x4f9a10[_0x5029('0x1d')];var _0x20eba4;if(_0x5bcfa2>=_0x39e533){_0x5bcfa2=_0x39e533;_0x20eba4=0xc8;}else{_0x20eba4=0xce;}_0x38ab73[_0x5029('0x20')](_0x20eba4);return _0x38ab73[_0x5029('0x21')](_0x5029('0x22'),_0x2d1d8f+'-'+_0x5bcfa2+'/'+_0x39e533)['json'](_0x44fc27);}return null;};}function patchUpdates(_0x40aecd){return function(_0x4c956e){try{jsonpatch[_0x5029('0x23')](_0x4c956e,_0x40aecd,!![]);}catch(_0x190637){return BPromise['reject'](_0x190637);}return _0x4c956e[_0x5029('0x24')]();};}function saveUpdates(_0x50a8e1,_0x402e40){return function(_0x182c36){if(_0x182c36){return _0x182c36['update'](_0x50a8e1)[_0x5029('0x25')](function(_0xfd990){return _0xfd990;});}return null;};}function removeEntity(_0x57ca01,_0x55e0e7){return function(_0x3da8a3){if(_0x3da8a3){return _0x3da8a3['destroy']()[_0x5029('0x25')](function(){_0x57ca01[_0x5029('0x20')](0xcc)[_0x5029('0x1a')]();});}};}function handleEntityNotFound(_0xcc5bb5,_0x47d3c9){return function(_0xb8ed87){if(!_0xb8ed87){_0xcc5bb5['sendStatus'](0x194);}return _0xb8ed87;};}function handleError(_0x4118fd,_0x523f50){_0x523f50=_0x523f50||0x1f4;return function(_0x3fb2df){logger['error'](_0x3fb2df[_0x5029('0x26')]);if(_0x3fb2df[_0x5029('0x27')]){delete _0x3fb2df[_0x5029('0x27')];}_0x4118fd[_0x5029('0x20')](_0x523f50)['send'](_0x3fb2df);};}exports[_0x5029('0x28')]=function(_0x401abf,_0x1a3fa6){var _0x4f1a7e={},_0x4974c6={},_0x4f9d9b={'count':0x0,'rows':[]};var _0x7782a3=_['map'](db['ChatInternalMessage']['rawAttributes'],function(_0x58847){return{'name':_0x58847['fieldName'],'type':_0x58847[_0x5029('0x29')][_0x5029('0x2a')]};});_0x4974c6[_0x5029('0x2b')]=_[_0x5029('0x2c')](_0x7782a3,_0x5029('0x27'));_0x4974c6[_0x5029('0x2d')]=_[_0x5029('0x2e')](_0x401abf['query']);_0x4974c6[_0x5029('0x2f')]=_['intersection'](_0x4974c6[_0x5029('0x2b')],_0x4974c6['query']);_0x4f1a7e[_0x5029('0x30')]=_[_0x5029('0x31')](_0x4974c6['model'],qs[_0x5029('0x32')](_0x401abf[_0x5029('0x2d')][_0x5029('0x32')]));_0x4f1a7e['attributes']=_0x4f1a7e[_0x5029('0x30')][_0x5029('0x33')]?_0x4f1a7e[_0x5029('0x30')]:_0x4974c6[_0x5029('0x2b')];if(!_0x401abf[_0x5029('0x2d')]['hasOwnProperty']('nolimit')){_0x4f1a7e[_0x5029('0x1d')]=qs['limit'](_0x401abf[_0x5029('0x2d')][_0x5029('0x1d')]);_0x4f1a7e['offset']=qs[_0x5029('0x1c')](_0x401abf[_0x5029('0x2d')]['offset']);}_0x4f1a7e[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x401abf[_0x5029('0x2d')][_0x5029('0x35')]);_0x4f1a7e[_0x5029('0x36')]=qs['filters'](_[_0x5029('0x37')](_0x401abf['query'],_0x4974c6[_0x5029('0x2f')]),_0x7782a3);if(_0x401abf[_0x5029('0x2d')][_0x5029('0x38')]){_0x4f1a7e[_0x5029('0x36')]=_[_0x5029('0x39')](_0x4f1a7e['where'],{'$or':_[_0x5029('0x2c')](_0x7782a3,function(_0xfb21b6){if(_0xfb21b6[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x586102={};_0x586102[_0xfb21b6['name']]={'$like':'%'+_0x401abf[_0x5029('0x2d')][_0x5029('0x38')]+'%'};return _0x586102;}})});}_0x4f1a7e=_[_0x5029('0x39')]({},_0x4f1a7e,_0x401abf[_0x5029('0x3b')]);var _0x5d1752={'where':_0x4f1a7e['where']};return db[_0x5029('0x3c')][_0x5029('0x1f')](_0x5d1752)['then'](function(_0x543108){_0x4f9d9b['count']=_0x543108;if(_0x401abf[_0x5029('0x2d')][_0x5029('0x3d')]){_0x4f1a7e[_0x5029('0x3e')]=[{'all':!![]}];}return db[_0x5029('0x3c')][_0x5029('0x3f')](_0x4f1a7e);})['then'](function(_0x22f17f){_0x4f9d9b[_0x5029('0x40')]=_0x22f17f;return _0x4f9d9b;})[_0x5029('0x25')](respondWithFilteredResult(_0x1a3fa6,_0x4f1a7e))[_0x5029('0x41')](handleError(_0x1a3fa6,null));};exports[_0x5029('0x42')]=function(_0x5d775e,_0x17ae11){var _0x18abe9={'raw':!![],'where':{'id':_0x5d775e[_0x5029('0x43')]['id']}},_0x14227c={};_0x14227c[_0x5029('0x2b')]=_[_0x5029('0x2e')](db[_0x5029('0x3c')]['rawAttributes']);_0x14227c[_0x5029('0x2d')]=_[_0x5029('0x2e')](_0x5d775e[_0x5029('0x2d')]);_0x14227c[_0x5029('0x2f')]=_['intersection'](_0x14227c['model'],_0x14227c['query']);_0x18abe9[_0x5029('0x30')]=_['intersection'](_0x14227c[_0x5029('0x2b')],qs[_0x5029('0x32')](_0x5d775e['query'][_0x5029('0x32')]));_0x18abe9[_0x5029('0x30')]=_0x18abe9[_0x5029('0x30')][_0x5029('0x33')]?_0x18abe9[_0x5029('0x30')]:_0x14227c[_0x5029('0x2b')];if(_0x5d775e[_0x5029('0x2d')][_0x5029('0x3d')]){_0x18abe9[_0x5029('0x3e')]=[{'all':!![]}];}_0x18abe9=_[_0x5029('0x39')]({},_0x18abe9,_0x5d775e[_0x5029('0x3b')]);return db['ChatInternalMessage'][_0x5029('0x44')](_0x18abe9)['then'](handleEntityNotFound(_0x17ae11,null))[_0x5029('0x25')](respondWithResult(_0x17ae11,null))['catch'](handleError(_0x17ae11,null));};exports[_0x5029('0x45')]=function(_0x3f8817,_0x23cc03){return db[_0x5029('0x3c')][_0x5029('0x45')](_0x3f8817[_0x5029('0x46')],{})['then'](respondWithResult(_0x23cc03,0xc9))[_0x5029('0x41')](handleError(_0x23cc03,null));};exports[_0x5029('0x47')]=function(_0x41e691,_0x1380ba){if(_0x41e691['body']['id']){delete _0x41e691[_0x5029('0x46')]['id'];}return db[_0x5029('0x3c')]['find']({'where':{'id':_0x41e691[_0x5029('0x43')]['id']}})[_0x5029('0x25')](handleEntityNotFound(_0x1380ba,null))[_0x5029('0x25')](saveUpdates(_0x41e691['body'],null))[_0x5029('0x25')](respondWithResult(_0x1380ba,null))[_0x5029('0x41')](handleError(_0x1380ba,null));};exports[_0x5029('0x48')]=function(_0x422935,_0x539a3f){return db[_0x5029('0x3c')][_0x5029('0x44')]({'where':{'id':_0x422935[_0x5029('0x43')]['id']}})[_0x5029('0x25')](handleEntityNotFound(_0x539a3f,null))[_0x5029('0x25')](removeEntity(_0x539a3f,null))[_0x5029('0x41')](handleError(_0x539a3f,null));};exports[_0x5029('0x49')]=function(_0x352e2b,_0x2aeadf){return db[_0x5029('0x3c')][_0x5029('0x49')]()['then'](respondWithResult(_0x2aeadf,null))[_0x5029('0x41')](handleError(_0x2aeadf,null));};function wrapUser(_0xbfe3a6){return function(_0x236cf5){var _0x2b851d=_0xbfe3a6[_0x5029('0x4a')]({'plain':!![]});_0x2b851d[_0x5029('0x4b')]=[];if(_0x236cf5){_0x2b851d[_0x5029('0x4c')]=_0x236cf5[_0x5029('0x4d')];_0x2b851d[_0x5029('0x4e')]=_0x236cf5;}else{_0x2b851d['lastMessageAt']=moment(0x0)[_0x5029('0x4f')](_0x5029('0x50'));_0x2b851d[_0x5029('0x4e')]={};}return _0x2b851d;};}exports[_0x5029('0x51')]=function(_0x3105d6,_0x3825a8,_0x5244ac){var _0x116ad5=[];return db['User'][_0x5029('0x3f')]({'where':{'role':[_0x5029('0x52'),_0x5029('0x53'),_0x5029('0x54')]},'attributes':['id',_0x5029('0x55'),'name','role','userpic',_0x5029('0x56'),_0x5029('0x57'),'lastLoginAt',_0x5029('0x58'),_0x5029('0x59')],'order':qs[_0x5029('0x35')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x5029('0x5a'),'attributes':['id',_0x5029('0x27'),_0x5029('0x29')],'through':{'attributes':[]}}]})[_0x5029('0x25')](function(_0x553bc7){if(_0x553bc7){var _0x2d8612=_0x3105d6['user'][_0x5029('0x4a')]({'plain':!![]});if(!_0x2d8612)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d8612[_0x5029('0x5b')]===_0x5029('0x54')){return db[_0x5029('0x5c')]['find']({'where':{'name':_0x5029('0x5d'),'userProfileId':_0x2d8612['userProfileId']},'raw':!![]})[_0x5029('0x25')](function(_0xb4e528){if(_0xb4e528){if(_0xb4e528[_0x5029('0x5e')]===0x0){return db[_0x5029('0x5f')][_0x5029('0x3f')]({'where':{'sectionId':_0xb4e528['id']},'raw':!![]})[_0x5029('0x25')](function(_0x289575){var _0xcf4abe=[];if(_[_0x5029('0x60')](_0x289575)){_0xcf4abe=_['filter'](_0x553bc7,function(_0x17dd7d){if(_0x17dd7d['role']!==_0x5029('0x52')){return _0x17dd7d;}});return _0xcf4abe;}else{for(var _0x53d88a=0x0;_0x53d88a<_0x553bc7[_0x5029('0x33')];_0x53d88a++){var _0x1f705b=_0x553bc7[_0x53d88a];if(_0x1f705b[_0x5029('0x5b')]===_0x5029('0x52')){var _0x207d1a=_[_0x5029('0x44')](_0x289575,function(_0x18801a){return _0x18801a['resourceId']===_0x1f705b['id'];});if(_0x207d1a)_0xcf4abe[_0x5029('0x61')](_0x1f705b);}else{_0xcf4abe[_0x5029('0x61')](_0x1f705b);}}return _0xcf4abe;}});}else{return _0x553bc7;}}else{var _0x5c29f4=_[_0x5029('0x38')](_0x553bc7,function(_0x5a9277){if(_0x5a9277[_0x5029('0x5b')]!==_0x5029('0x52')){return _0x5a9277;}});return _0x5c29f4;}});}else{return _0x553bc7;}}})[_0x5029('0x25')](function(_0x7e315c){var _0x1b275b=[];if(_0x7e315c){_0x116ad5=_0x7e315c;for(var _0x57a07f=0x0;_0x57a07f<_0x7e315c[_0x5029('0x33')];_0x57a07f+=0x1){_0x116ad5[_0x57a07f][_0x5029('0x4b')]=[];_0x1b275b['push'](db['ChatInternalMessage'][_0x5029('0x44')]({'where':{'FromId':[_0x3105d6[_0x5029('0x54')]['id'],_0x7e315c[_0x57a07f]['id']],'ToId':[_0x3105d6['user']['id'],_0x7e315c[_0x57a07f]['id']],'ChatGroupId':null},'attributes':['id',_0x5029('0x4d'),'FromId',_0x5029('0x62'),_0x5029('0x63'),_0x5029('0x46')],'order':qs[_0x5029('0x35')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5029('0x25')](wrapUser(_0x7e315c[_0x57a07f])));}return BPromise['all'](_0x1b275b);}return[];})[_0x5029('0x25')](function(_0x2cec96){return{'rows':_0x2cec96,'count':_0x2cec96[_0x5029('0x33')]};})[_0x5029('0x25')](respondWithResult(_0x3825a8,null))[_0x5029('0x41')](handleError(_0x3825a8,null));};
\ No newline at end of file
+var _0x0cb0=['ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','end','name','index','map','ChatInternalMessage','rawAttributes','type','key','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','rows','catch','show','params','fields','create','body','find','describe','get','lastMessageAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','admin','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','isEmpty','agent','push','messages','createdAt','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv'];(function(_0x52d354,_0x101f54){var _0x20c877=function(_0x380116){while(--_0x380116){_0x52d354['push'](_0x52d354['shift']());}};_0x20c877(++_0x101f54);}(_0x0cb0,0x1a6));var _0x00cb=function(_0x22fdbb,_0x49e68d){_0x22fdbb=_0x22fdbb-0x0;var _0x3b8ce7=_0x0cb0[_0x22fdbb];return _0x3b8ce7;};'use strict';var emlformat=require(_0x00cb('0x0'));var rimraf=require(_0x00cb('0x1'));var zipdir=require(_0x00cb('0x2'));var jsonpatch=require(_0x00cb('0x3'));var rp=require(_0x00cb('0x4'));var moment=require(_0x00cb('0x5'));var BPromise=require(_0x00cb('0x6'));var Mustache=require('mustache');var util=require(_0x00cb('0x7'));var path=require(_0x00cb('0x8'));var sox=require('sox');var csv=require(_0x00cb('0x9'));var ejs=require(_0x00cb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x00cb('0xb'));var squel=require('squel');var crypto=require(_0x00cb('0xc'));var jsforce=require(_0x00cb('0xd'));var deskjs=require(_0x00cb('0xe'));var toCsv=require(_0x00cb('0x9'));var querystring=require(_0x00cb('0xf'));var Papa=require(_0x00cb('0x10'));var Redis=require(_0x00cb('0x11'));var authService=require(_0x00cb('0x12'));var qs=require(_0x00cb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x00cb('0x14'));var logger=require(_0x00cb('0x15'))(_0x00cb('0x16'));var utils=require(_0x00cb('0x17'));var config=require(_0x00cb('0x18'));var licenseUtil=require(_0x00cb('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x00cb('0x1a')],{'host':_0x00cb('0x1b'),'port':0x18eb});var socket=require(_0x00cb('0x1c'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x00cb('0x1d')](socket);function respondWithStatusCode(_0x5d6b1e,_0x48232b){_0x48232b=_0x48232b||0xcc;return function(_0x177f7a){if(_0x177f7a){return _0x5d6b1e[_0x00cb('0x1e')](_0x48232b);}return _0x5d6b1e[_0x00cb('0x1f')](_0x48232b)['end']();};}function respondWithResult(_0x129ada,_0xdba23e){_0xdba23e=_0xdba23e||0xc8;return function(_0x57cc80){if(_0x57cc80){return _0x129ada[_0x00cb('0x1f')](_0xdba23e)[_0x00cb('0x20')](_0x57cc80);}};}function respondWithFilteredResult(_0x36a849,_0x27ec4d){return function(_0x95fcaa){if(_0x95fcaa){var _0x5ba118=typeof _0x27ec4d['offset']===_0x00cb('0x21')&&typeof _0x27ec4d[_0x00cb('0x22')]===_0x00cb('0x21');var _0x14919a=_0x95fcaa[_0x00cb('0x23')];var _0x160655=_0x5ba118?0x0:_0x27ec4d[_0x00cb('0x24')];var _0x3dc68c=_0x5ba118?_0x95fcaa['count']:_0x27ec4d[_0x00cb('0x24')]+_0x27ec4d[_0x00cb('0x22')];var _0x5aa39c;if(_0x3dc68c>=_0x14919a){_0x3dc68c=_0x14919a;_0x5aa39c=0xc8;}else{_0x5aa39c=0xce;}_0x36a849[_0x00cb('0x1f')](_0x5aa39c);return _0x36a849['set'](_0x00cb('0x25'),_0x160655+'-'+_0x3dc68c+'/'+_0x14919a)[_0x00cb('0x20')](_0x95fcaa);}return null;};}function patchUpdates(_0x444914){return function(_0x11fb57){try{jsonpatch[_0x00cb('0x26')](_0x11fb57,_0x444914,!![]);}catch(_0x35c357){return BPromise[_0x00cb('0x27')](_0x35c357);}return _0x11fb57['save']();};}function saveUpdates(_0x2eaf80,_0x135572){return function(_0x27f75d){if(_0x27f75d){return _0x27f75d[_0x00cb('0x28')](_0x2eaf80)[_0x00cb('0x29')](function(_0x4adc41){return _0x4adc41;});}return null;};}function removeEntity(_0x405f73,_0xa6295a){return function(_0x433afb){if(_0x433afb){return _0x433afb[_0x00cb('0x2a')]()['then'](function(){_0x405f73[_0x00cb('0x1f')](0xcc)[_0x00cb('0x2b')]();});}};}function handleEntityNotFound(_0x2427b0,_0x58370d){return function(_0x383ef8){if(!_0x383ef8){_0x2427b0[_0x00cb('0x1e')](0x194);}return _0x383ef8;};}function handleError(_0x3e572d,_0x7f3f9b){_0x7f3f9b=_0x7f3f9b||0x1f4;return function(_0x3cd34e){logger['error'](_0x3cd34e['stack']);if(_0x3cd34e[_0x00cb('0x2c')]){delete _0x3cd34e['name'];}_0x3e572d['status'](_0x7f3f9b)['send'](_0x3cd34e);};}exports[_0x00cb('0x2d')]=function(_0x621048,_0x2dd2be){var _0x10ef45={},_0x4fffd2={},_0x266355={'count':0x0,'rows':[]};var _0x282daa=_[_0x00cb('0x2e')](db[_0x00cb('0x2f')][_0x00cb('0x30')],function(_0x4387bd){return{'name':_0x4387bd['fieldName'],'type':_0x4387bd[_0x00cb('0x31')][_0x00cb('0x32')]};});_0x4fffd2['model']=_[_0x00cb('0x2e')](_0x282daa,'name');_0x4fffd2[_0x00cb('0x33')]=_[_0x00cb('0x34')](_0x621048['query']);_0x4fffd2['filters']=_[_0x00cb('0x35')](_0x4fffd2[_0x00cb('0x36')],_0x4fffd2[_0x00cb('0x33')]);_0x10ef45['attributes']=_[_0x00cb('0x35')](_0x4fffd2[_0x00cb('0x36')],qs['fields'](_0x621048[_0x00cb('0x33')]['fields']));_0x10ef45[_0x00cb('0x37')]=_0x10ef45[_0x00cb('0x37')][_0x00cb('0x38')]?_0x10ef45[_0x00cb('0x37')]:_0x4fffd2[_0x00cb('0x36')];if(!_0x621048[_0x00cb('0x33')][_0x00cb('0x39')](_0x00cb('0x3a'))){_0x10ef45[_0x00cb('0x22')]=qs[_0x00cb('0x22')](_0x621048['query'][_0x00cb('0x22')]);_0x10ef45[_0x00cb('0x24')]=qs['offset'](_0x621048[_0x00cb('0x33')][_0x00cb('0x24')]);}_0x10ef45[_0x00cb('0x3b')]=qs['sort'](_0x621048[_0x00cb('0x33')][_0x00cb('0x3c')]);_0x10ef45[_0x00cb('0x3d')]=qs[_0x00cb('0x3e')](_['pick'](_0x621048[_0x00cb('0x33')],_0x4fffd2['filters']),_0x282daa);if(_0x621048[_0x00cb('0x33')][_0x00cb('0x3f')]){_0x10ef45[_0x00cb('0x3d')]=_[_0x00cb('0x40')](_0x10ef45[_0x00cb('0x3d')],{'$or':_[_0x00cb('0x2e')](_0x282daa,function(_0x23e5e7){if(_0x23e5e7[_0x00cb('0x31')]!=='VIRTUAL'){var _0x1381eb={};_0x1381eb[_0x23e5e7['name']]={'$like':'%'+_0x621048[_0x00cb('0x33')][_0x00cb('0x3f')]+'%'};return _0x1381eb;}})});}_0x10ef45=_[_0x00cb('0x40')]({},_0x10ef45,_0x621048[_0x00cb('0x41')]);var _0x3b600c={'where':_0x10ef45[_0x00cb('0x3d')]};return db[_0x00cb('0x2f')][_0x00cb('0x23')](_0x3b600c)['then'](function(_0x331859){_0x266355[_0x00cb('0x23')]=_0x331859;if(_0x621048[_0x00cb('0x33')][_0x00cb('0x42')]){_0x10ef45[_0x00cb('0x43')]=[{'all':!![]}];}return db[_0x00cb('0x2f')]['findAll'](_0x10ef45);})[_0x00cb('0x29')](function(_0x5eda34){_0x266355[_0x00cb('0x44')]=_0x5eda34;return _0x266355;})[_0x00cb('0x29')](respondWithFilteredResult(_0x2dd2be,_0x10ef45))[_0x00cb('0x45')](handleError(_0x2dd2be,null));};exports[_0x00cb('0x46')]=function(_0x4d6607,_0x1307cc){var _0xe44066={'raw':!![],'where':{'id':_0x4d6607[_0x00cb('0x47')]['id']}},_0x59b331={};_0x59b331['model']=_[_0x00cb('0x34')](db[_0x00cb('0x2f')]['rawAttributes']);_0x59b331[_0x00cb('0x33')]=_[_0x00cb('0x34')](_0x4d6607[_0x00cb('0x33')]);_0x59b331[_0x00cb('0x3e')]=_[_0x00cb('0x35')](_0x59b331[_0x00cb('0x36')],_0x59b331[_0x00cb('0x33')]);_0xe44066[_0x00cb('0x37')]=_[_0x00cb('0x35')](_0x59b331['model'],qs['fields'](_0x4d6607['query'][_0x00cb('0x48')]));_0xe44066[_0x00cb('0x37')]=_0xe44066[_0x00cb('0x37')][_0x00cb('0x38')]?_0xe44066[_0x00cb('0x37')]:_0x59b331[_0x00cb('0x36')];if(_0x4d6607['query'][_0x00cb('0x42')]){_0xe44066[_0x00cb('0x43')]=[{'all':!![]}];}_0xe44066=_[_0x00cb('0x40')]({},_0xe44066,_0x4d6607['options']);return db[_0x00cb('0x2f')]['find'](_0xe44066)[_0x00cb('0x29')](handleEntityNotFound(_0x1307cc,null))['then'](respondWithResult(_0x1307cc,null))['catch'](handleError(_0x1307cc,null));};exports['create']=function(_0x589859,_0x4c8052){return db[_0x00cb('0x2f')][_0x00cb('0x49')](_0x589859[_0x00cb('0x4a')],{})[_0x00cb('0x29')](respondWithResult(_0x4c8052,0xc9))[_0x00cb('0x45')](handleError(_0x4c8052,null));};exports[_0x00cb('0x28')]=function(_0x1c49b2,_0x2f84b5){if(_0x1c49b2['body']['id']){delete _0x1c49b2[_0x00cb('0x4a')]['id'];}return db['ChatInternalMessage'][_0x00cb('0x4b')]({'where':{'id':_0x1c49b2[_0x00cb('0x47')]['id']}})[_0x00cb('0x29')](handleEntityNotFound(_0x2f84b5,null))[_0x00cb('0x29')](saveUpdates(_0x1c49b2[_0x00cb('0x4a')],null))[_0x00cb('0x29')](respondWithResult(_0x2f84b5,null))['catch'](handleError(_0x2f84b5,null));};exports[_0x00cb('0x2a')]=function(_0xff4164,_0x1ce8bc){return db[_0x00cb('0x2f')][_0x00cb('0x4b')]({'where':{'id':_0xff4164['params']['id']}})['then'](handleEntityNotFound(_0x1ce8bc,null))[_0x00cb('0x29')](removeEntity(_0x1ce8bc,null))[_0x00cb('0x45')](handleError(_0x1ce8bc,null));};exports[_0x00cb('0x4c')]=function(_0x3a41d2,_0x270850){return db[_0x00cb('0x2f')]['describe']()['then'](respondWithResult(_0x270850,null))[_0x00cb('0x45')](handleError(_0x270850,null));};function wrapUser(_0xb7bbea){return function(_0x2d6bb8){var _0x35da45=_0xb7bbea[_0x00cb('0x4d')]({'plain':!![]});_0x35da45['messages']=[];if(_0x2d6bb8){_0x35da45[_0x00cb('0x4e')]=_0x2d6bb8['createdAt'];_0x35da45[_0x00cb('0x4f')]=_0x2d6bb8;}else{_0x35da45[_0x00cb('0x4e')]=moment(0x0)['format'](_0x00cb('0x50'));_0x35da45[_0x00cb('0x4f')]={};}return _0x35da45;};}exports[_0x00cb('0x51')]=function(_0x15b193,_0x422a0d,_0x173bed){var _0x3a6539=[];return db[_0x00cb('0x52')][_0x00cb('0x53')]({'where':{'role':['agent',_0x00cb('0x54'),'user']},'attributes':['id',_0x00cb('0x55'),_0x00cb('0x2c'),_0x00cb('0x56'),_0x00cb('0x57'),_0x00cb('0x58'),'online',_0x00cb('0x59'),_0x00cb('0x5a'),_0x00cb('0x5b')],'order':qs['sort'](_0x00cb('0x5c')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0x00cb('0x2c'),_0x00cb('0x31')],'through':{'attributes':[]}}]})[_0x00cb('0x29')](function(_0x15efdf){if(_0x15efdf){var _0x1d464a=_0x15b193[_0x00cb('0x5d')]['get']({'plain':!![]});if(!_0x1d464a)throw new Error(_0x00cb('0x5e'));if(_0x1d464a[_0x00cb('0x56')]===_0x00cb('0x5d')){return db[_0x00cb('0x5f')][_0x00cb('0x4b')]({'where':{'name':'Agents','userProfileId':_0x1d464a[_0x00cb('0x60')]},'raw':!![]})[_0x00cb('0x29')](function(_0x54e3f9){if(_0x54e3f9){if(_0x54e3f9['autoAssociation']===0x0){return db[_0x00cb('0x61')]['findAll']({'where':{'sectionId':_0x54e3f9['id']},'raw':!![]})[_0x00cb('0x29')](function(_0x37be40){var _0x41efdb=[];if(_[_0x00cb('0x62')](_0x37be40)){_0x41efdb=_['filter'](_0x15efdf,function(_0x4e2463){if(_0x4e2463[_0x00cb('0x56')]!==_0x00cb('0x63')){return _0x4e2463;}});return _0x41efdb;}else{for(var _0x1c5887=0x0;_0x1c5887<_0x15efdf[_0x00cb('0x38')];_0x1c5887++){var _0x30fd7e=_0x15efdf[_0x1c5887];if(_0x30fd7e[_0x00cb('0x56')]===_0x00cb('0x63')){var _0x27bceb=_[_0x00cb('0x4b')](_0x37be40,function(_0x3e917e){return _0x3e917e['resourceId']===_0x30fd7e['id'];});if(_0x27bceb)_0x41efdb[_0x00cb('0x64')](_0x30fd7e);}else{_0x41efdb[_0x00cb('0x64')](_0x30fd7e);}}return _0x41efdb;}});}else{return _0x15efdf;}}else{var _0x9082bd=_[_0x00cb('0x3f')](_0x15efdf,function(_0x5f53ad){if(_0x5f53ad[_0x00cb('0x56')]!==_0x00cb('0x63')){return _0x5f53ad;}});return _0x9082bd;}});}else{return _0x15efdf;}}})[_0x00cb('0x29')](function(_0x34d8ad){var _0x2735bf=[];if(_0x34d8ad){_0x3a6539=_0x34d8ad;for(var _0xea1538=0x0;_0xea1538<_0x34d8ad['length'];_0xea1538+=0x1){_0x3a6539[_0xea1538][_0x00cb('0x65')]=[];_0x2735bf[_0x00cb('0x64')](db[_0x00cb('0x2f')]['find']({'where':{'FromId':[_0x15b193[_0x00cb('0x5d')]['id'],_0x34d8ad[_0xea1538]['id']],'ToId':[_0x15b193[_0x00cb('0x5d')]['id'],_0x34d8ad[_0xea1538]['id']],'ChatGroupId':null},'attributes':['id',_0x00cb('0x66'),_0x00cb('0x67'),_0x00cb('0x68'),_0x00cb('0x69'),_0x00cb('0x4a')],'order':qs[_0x00cb('0x3c')](_0x00cb('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x00cb('0x29')](wrapUser(_0x34d8ad[_0xea1538])));}return BPromise[_0x00cb('0x6b')](_0x2735bf);}return[];})['then'](function(_0x1dc48d){return{'rows':_0x1dc48d,'count':_0x1dc48d['length']};})[_0x00cb('0x29')](respondWithResult(_0x422a0d,null))[_0x00cb('0x45')](handleError(_0x422a0d,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 0210001..0252461 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 _0x0ddf=['exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save','hook'];(function(_0x5b13c3,_0x378e0a){var _0x3d6780=function(_0x6327a6){while(--_0x6327a6){_0x5b13c3['push'](_0x5b13c3['shift']());}};_0x3d6780(++_0x378e0a);}(_0x0ddf,0x187));var _0xf0dd=function(_0x3684f2,_0x494636){_0x3684f2=_0x3684f2-0x0;var _0x3bf1f4=_0x0ddf[_0x3684f2];return _0x3bf1f4;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xf0dd('0x0'))['db'][_0xf0dd('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf0dd('0x2')](0x0);var events={'afterCreate':_0xf0dd('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x56bc8d){return function(_0x26caad,_0x2d23e6,_0x3c1f54){ChatInternalMessageEvents['emit'](_0x56bc8d+':'+_0x26caad['id'],_0x26caad);ChatInternalMessageEvents['emit'](_0x56bc8d,_0x26caad);_0x3c1f54(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xf0dd('0x4')](e,emitEvent(event));}}module[_0xf0dd('0x5')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x2eeb=['emit','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x54b406,_0x53fd7c){var _0x4f851a=function(_0x29bb56){while(--_0x29bb56){_0x54b406['push'](_0x54b406['shift']());}};_0x4f851a(++_0x53fd7c);}(_0x2eeb,0x80));var _0xb2ee=function(_0x2ad508,_0x42888b){_0x2ad508=_0x2ad508-0x0;var _0xb4307c=_0x2eeb[_0x2ad508];return _0xb4307c;};'use strict';var EventEmitter=require(_0xb2ee('0x0'));var ChatInternalMessage=require(_0xb2ee('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb2ee('0x2')](0x0);var events={'afterCreate':_0xb2ee('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x290fb0){return function(_0x102d46,_0x301517,_0x2c095a){ChatInternalMessageEvents[_0xb2ee('0x4')](_0x290fb0+':'+_0x102d46['id'],_0x102d46);ChatInternalMessageEvents[_0xb2ee('0x4')](_0x290fb0,_0x102d46);_0x2c095a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xb2ee('0x5')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 1160bcc..b1a35d6 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 _0x6b53=['define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatInternalMessage.attributes'];(function(_0x377cce,_0x3b4f48){var _0x256bc9=function(_0x45d5ce){while(--_0x45d5ce){_0x377cce['push'](_0x377cce['shift']());}};_0x256bc9(++_0x3b4f48);}(_0x6b53,0x65));var _0x36b5=function(_0x362d4c,_0x4be707){_0x362d4c=_0x362d4c-0x0;var _0x222cde=_0x6b53[_0x362d4c];return _0x222cde;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x36b5('0x0'))(_0x36b5('0x1'));var moment=require(_0x36b5('0x2'));var BPromise=require(_0x36b5('0x3'));var rp=require(_0x36b5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x36b5('0x5'));var config=require('../../config/environment');var attributes=require(_0x36b5('0x6'));module['exports']=function(_0x4435ed,_0xf88e46){return _0x4435ed[_0x36b5('0x7')](_0x36b5('0x8'),attributes,{'tableName':_0x36b5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x36b5('0xa'),'collate':_0x36b5('0xb')});};
\ No newline at end of file
+var _0x42fd=['exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x49cb7c,_0x45f0f5){var _0x539621=function(_0x16d2ab){while(--_0x16d2ab){_0x49cb7c['push'](_0x49cb7c['shift']());}};_0x539621(++_0x45f0f5);}(_0x42fd,0x1cc));var _0xd42f=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x42fd[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0xd42f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd42f('0x1'));var BPromise=require(_0xd42f('0x2'));var rp=require(_0xd42f('0x3'));var fs=require('fs');var path=require(_0xd42f('0x4'));var rimraf=require(_0xd42f('0x5'));var config=require(_0xd42f('0x6'));var attributes=require(_0xd42f('0x7'));module[_0xd42f('0x8')]=function(_0x6811ff,_0xb900b9){return _0x6811ff[_0xd42f('0x9')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd42f('0xa'),'collate':_0xd42f('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 240510e..043ec24 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 _0x8d19=['info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','register','then'];(function(_0xd1e289,_0x43f420){var _0x3ac7ca=function(_0x27ed51){while(--_0x27ed51){_0xd1e289['push'](_0xd1e289['shift']());}};_0x3ac7ca(++_0x43f420);}(_0x8d19,0xd1));var _0x98d1=function(_0x1d83db,_0x89d115){_0x1d83db=_0x1d83db-0x0;var _0x2dc1d1=_0x8d19[_0x1d83db];return _0x2dc1d1;};'use strict';var _=require(_0x98d1('0x0'));var util=require(_0x98d1('0x1'));var moment=require(_0x98d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x98d1('0x3'));var fs=require('fs');var Redis=require(_0x98d1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x98d1('0x5'));var logger=require(_0x98d1('0x6'))(_0x98d1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x98d1('0x8')][_0x98d1('0x9')]({'port':0x232a});config[_0x98d1('0xa')]=_[_0x98d1('0xb')](config[_0x98d1('0xa')],{'host':_0x98d1('0xc'),'port':0x18eb});var socket=require(_0x98d1('0xd'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x98d1('0xe')](socket);function respondWithRpcPromise(_0x14a3f3,_0x2ec928,_0x4585fb){return new BPromise(function(_0x1e7642,_0x147d79){return client['request'](_0x14a3f3,_0x4585fb)[_0x98d1('0xf')](function(_0x99bb2e){logger[_0x98d1('0x10')](_0x98d1('0x11'),_0x2ec928,_0x98d1('0x12'));logger[_0x98d1('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x2ec928,_0x98d1('0x12'),JSON['stringify'](_0x99bb2e));if(_0x99bb2e[_0x98d1('0x14')]){if(_0x99bb2e['error'][_0x98d1('0x15')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x2ec928,_0x99bb2e[_0x98d1('0x14')]['message']);return _0x147d79(_0x99bb2e[_0x98d1('0x14')][_0x98d1('0x16')]);}logger[_0x98d1('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x2ec928,_0x99bb2e[_0x98d1('0x14')][_0x98d1('0x16')]);return _0x1e7642(_0x99bb2e[_0x98d1('0x14')]['message']);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x2ec928,'request\x20sent');_0x1e7642(_0x99bb2e[_0x98d1('0x17')][_0x98d1('0x16')]);}})[_0x98d1('0x18')](function(_0x5306d6){logger['error'](_0x98d1('0x11'),_0x2ec928,_0x5306d6);_0x147d79(_0x5306d6);});});}
\ No newline at end of file
+var _0xd89f=['code','ChatInternalMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','register','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xd89f,0x13e));var _0xfd89=function(_0x3c6cb5,_0x4858d1){_0x3c6cb5=_0x3c6cb5-0x0;var _0x5e95a1=_0xd89f[_0x3c6cb5];return _0x5e95a1;};'use strict';var _=require(_0xfd89('0x0'));var util=require(_0xfd89('0x1'));var moment=require('moment');var BPromise=require(_0xfd89('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfd89('0x3'));var logger=require(_0xfd89('0x4'))(_0xfd89('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfd89('0x6')][_0xfd89('0x7')]({'port':0x232a});config[_0xfd89('0x8')]=_[_0xfd89('0x9')](config[_0xfd89('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xfd89('0xa'))(new Redis(config[_0xfd89('0x8')]));require('./chatInternalMessage.socket')[_0xfd89('0xb')](socket);function respondWithRpcPromise(_0x5dd24e,_0x595fab,_0x1e87cd){return new BPromise(function(_0x50c139,_0x302a91){return client['request'](_0x5dd24e,_0x1e87cd)[_0xfd89('0xc')](function(_0x58078b){logger[_0xfd89('0xd')]('ChatInternalMessage,\x20%s,\x20%s',_0x595fab,'request\x20sent');logger[_0xfd89('0xe')](_0xfd89('0xf'),_0x595fab,'request\x20sent',JSON[_0xfd89('0x10')](_0x58078b));if(_0x58078b[_0xfd89('0x11')]){if(_0x58078b[_0xfd89('0x11')][_0xfd89('0x12')]===0x1f4){logger[_0xfd89('0x11')](_0xfd89('0x13'),_0x595fab,_0x58078b['error'][_0xfd89('0x14')]);return _0x302a91(_0x58078b['error'][_0xfd89('0x14')]);}logger[_0xfd89('0x11')](_0xfd89('0x13'),_0x595fab,_0x58078b[_0xfd89('0x11')][_0xfd89('0x14')]);return _0x50c139(_0x58078b[_0xfd89('0x11')]['message']);}else{logger[_0xfd89('0xd')](_0xfd89('0x13'),_0x595fab,_0xfd89('0x15'));_0x50c139(_0x58078b[_0xfd89('0x16')][_0xfd89('0x14')]);}})[_0xfd89('0x17')](function(_0x110325){logger[_0xfd89('0x11')](_0xfd89('0x13'),_0x595fab,_0x110325);_0x302a91(_0x110325);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 15c41b7..7f1483c 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 _0x93ba=['save','remove','update','emit','removeListener','length','chatInternalMessage:'];(function(_0x302329,_0xd2e98b){var _0x2bd241=function(_0x3b38da){while(--_0x3b38da){_0x302329['push'](_0x302329['shift']());}};_0x2bd241(++_0xd2e98b);}(_0x93ba,0x150));var _0xa93b=function(_0x2cbeb7,_0x142a65){_0x2cbeb7=_0x2cbeb7-0x0;var _0x58e27e=_0x93ba[_0x2cbeb7];return _0x58e27e;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xa93b('0x0'),_0xa93b('0x1'),_0xa93b('0x2')];function createListener(_0x2bcd47,_0x57e1cc){return function(_0x5c990a){_0x57e1cc[_0xa93b('0x3')](_0x2bcd47,_0x5c990a);};}function removeListener(_0x27ae39,_0xfa8815){return function(){ChatInternalMessageEvents[_0xa93b('0x4')](_0x27ae39,_0xfa8815);};}exports['register']=function(_0x113d39){for(var _0x56abab=0x0,_0x11a861=events[_0xa93b('0x5')];_0x56abab<_0x11a861;_0x56abab++){var _0x73f7d3=events[_0x56abab];var _0x932026=createListener(_0xa93b('0x6')+_0x73f7d3,_0x113d39);ChatInternalMessageEvents['on'](_0x73f7d3,_0x932026);}};
\ No newline at end of file
+var _0xe790=['save','remove','update','emit','removeListener','length','./chatInternalMessage.events'];(function(_0x282334,_0x13eecb){var _0x576027=function(_0x200cc0){while(--_0x200cc0){_0x282334['push'](_0x282334['shift']());}};_0x576027(++_0x13eecb);}(_0xe790,0x1bf));var _0x0e79=function(_0x3a8f8e,_0x17bda5){_0x3a8f8e=_0x3a8f8e-0x0;var _0x4ad19d=_0xe790[_0x3a8f8e];return _0x4ad19d;};'use strict';var ChatInternalMessageEvents=require(_0x0e79('0x0'));var events=[_0x0e79('0x1'),_0x0e79('0x2'),_0x0e79('0x3')];function createListener(_0x4c3b71,_0xc4b4b3){return function(_0x156e03){_0xc4b4b3[_0x0e79('0x4')](_0x4c3b71,_0x156e03);};}function removeListener(_0x4d533e,_0x29b7a0){return function(){ChatInternalMessageEvents[_0x0e79('0x5')](_0x4d533e,_0x29b7a0);};}exports['register']=function(_0x40a2a5){for(var _0x36a59c=0x0,_0x2cb621=events[_0x0e79('0x6')];_0x36a59c<_0x2cb621;_0x36a59c++){var _0x3cc74a=events[_0x36a59c];var _0x5c1894=createListener('chatInternalMessage:'+_0x3cc74a,_0x40a2a5);ChatInternalMessageEvents['on'](_0x3cc74a,_0x5c1894);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 3b1164b..4d6ee7b 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 _0x6351=['./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','getUsers','/:id','show','create','delete','destroy','multer','path','connect-timeout','express','../../config/environment'];(function(_0xf01aec,_0x3392df){var _0x456ffc=function(_0x55294f){while(--_0x55294f){_0xf01aec['push'](_0xf01aec['shift']());}};_0x456ffc(++_0x3392df);}(_0x6351,0x1b5));var _0x1635=function(_0x193461,_0x42ce71){_0x193461=_0x193461-0x0;var _0x4c237c=_0x6351[_0x193461];return _0x4c237c;};'use strict';var multer=require(_0x1635('0x0'));var util=require('util');var path=require(_0x1635('0x1'));var timeout=require(_0x1635('0x2'));var express=require(_0x1635('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1635('0x4'));var controller=require(_0x1635('0x5'));router['get']('/',auth[_0x1635('0x6')](),controller[_0x1635('0x7')]);router[_0x1635('0x8')](_0x1635('0x9'),auth[_0x1635('0x6')](),controller[_0x1635('0xa')]);router[_0x1635('0x8')]('/users',auth['isAuthenticated'](),controller[_0x1635('0xb')]);router[_0x1635('0x8')](_0x1635('0xc'),auth['isAuthenticated'](),controller[_0x1635('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1635('0xe')]);router['put']('/:id',controller['update']);router[_0x1635('0xf')](_0x1635('0xc'),auth[_0x1635('0x6')](),controller[_0x1635('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x7257=['show','post','update','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','describe','get','/users','getUsers','/:id'];(function(_0x1e2939,_0x1f1ddc){var _0x1a1028=function(_0x28220a){while(--_0x28220a){_0x1e2939['push'](_0x1e2939['shift']());}};_0x1a1028(++_0x1f1ddc);}(_0x7257,0xb8));var _0x7725=function(_0x59e821,_0x86c723){_0x59e821=_0x59e821-0x0;var _0x5333f6=_0x7257[_0x59e821];return _0x5333f6;};'use strict';var multer=require(_0x7725('0x0'));var util=require(_0x7725('0x1'));var path=require(_0x7725('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7725('0x3')]();var fs_extra=require(_0x7725('0x4'));var auth=require(_0x7725('0x5'));var interaction=require(_0x7725('0x6'));var config=require(_0x7725('0x7'));var controller=require(_0x7725('0x8'));router['get']('/',auth[_0x7725('0x9')](),controller[_0x7725('0xa')]);router['get']('/describe',auth[_0x7725('0x9')](),controller[_0x7725('0xb')]);router[_0x7725('0xc')](_0x7725('0xd'),auth[_0x7725('0x9')](),controller[_0x7725('0xe')]);router[_0x7725('0xc')](_0x7725('0xf'),auth['isAuthenticated'](),controller[_0x7725('0x10')]);router[_0x7725('0x11')]('/',auth[_0x7725('0x9')](),controller['create']);router['put'](_0x7725('0xf'),controller[_0x7725('0x12')]);router['delete'](_0x7725('0xf'),auth[_0x7725('0x9')](),controller['destroy']);module[_0x7725('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 e4907bc..21d4710 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 _0x93e6=['BOOLEAN','out','DATE','TEXT','sequelize','medium'];(function(_0x15c1bc,_0x3db506){var _0x326b17=function(_0x4abaa9){while(--_0x4abaa9){_0x15c1bc['push'](_0x15c1bc['shift']());}};_0x326b17(++_0x3db506);}(_0x93e6,0x11e));var _0x693e=function(_0x48e4f2,_0x1b4b48){_0x48e4f2=_0x48e4f2-0x0;var _0x5de8eb=_0x93e6[_0x48e4f2];return _0x5de8eb;};'use strict';var Sequelize=require(_0x693e('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x693e('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x693e('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x693e('0x3')),'defaultValue':_0x693e('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x693e('0x4')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x693e('0x5')]}};
\ No newline at end of file
+var _0xfa28=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0xfa28,0x1c6));var _0x8fa2=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0xfa28[_0x47b15f];return _0x55bf25;};'use strict';var Sequelize=require(_0x8fa2('0x0'));module[_0x8fa2('0x1')]={'body':{'type':Sequelize[_0x8fa2('0x2')](_0x8fa2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8fa2('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8fa2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8fa2('0x5')]('in',_0x8fa2('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8fa2('0x7')]},'providerName':{'type':Sequelize[_0x8fa2('0x8')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 4a9d1d7..6d7ce8d 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 _0x5005=['SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','sequelize','QueryTypes','interface','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','end','name','send','index','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','ChatMessage','then','includeAll','include','rows','show','params','options','find','create','body','catch','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteractionId','format','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','contact','User','agent','fullname','internal','manual'];(function(_0x11e762,_0x3f7103){var _0x24c967=function(_0x4a3cf0){while(--_0x4a3cf0){_0x11e762['push'](_0x11e762['shift']());}};_0x24c967(++_0x3f7103);}(_0x5005,0x90));var _0x5500=function(_0x8abd64,_0x539570){_0x8abd64=_0x8abd64-0x0;var _0xd2511e=_0x5005[_0x8abd64];return _0xd2511e;};'use strict';var emlformat=require(_0x5500('0x0'));var rimraf=require(_0x5500('0x1'));var zipdir=require(_0x5500('0x2'));var jsonpatch=require(_0x5500('0x3'));var rp=require(_0x5500('0x4'));var moment=require(_0x5500('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5500('0x6'));var path=require(_0x5500('0x7'));var sox=require('sox');var csv=require(_0x5500('0x8'));var ejs=require(_0x5500('0x9'));var fs=require('fs');var fs_extra=require(_0x5500('0xa'));var _=require(_0x5500('0xb'));var squel=require('squel');var crypto=require(_0x5500('0xc'));var jsforce=require(_0x5500('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5500('0x8'));var querystring=require(_0x5500('0xe'));var Papa=require(_0x5500('0xf'));var Redis=require('ioredis');var authService=require(_0x5500('0x10'));var qs=require(_0x5500('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5500('0x12'));var logger=require(_0x5500('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5500('0x14'));var db=require(_0x5500('0x15'))['db'];config[_0x5500('0x16')]=_[_0x5500('0x17')](config[_0x5500('0x16')],{'host':_0x5500('0x18'),'port':0x18eb});var socket=require(_0x5500('0x19'))(new Redis(config['redis']));require(_0x5500('0x1a'))['register'](socket);var jayson=require(_0x5500('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x5500('0x1c')][_0x5500('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3dc3a6,_0x2fa301,_0xf1fff4,_0x133a02){return new BPromise(function(_0x5e6a86,_0x24b7d8){var _0x44472f=_0x133a02||client;return _0x44472f['request'](_0x3dc3a6,_0xf1fff4)['then'](function(_0x22e2c1){logger[_0x5500('0x1e')](_0x5500('0x1f'),_0x2fa301,_0x5500('0x20'));logger[_0x5500('0x21')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2fa301,_0x5500('0x20'),JSON[_0x5500('0x22')](_0x22e2c1));if(_0x22e2c1['error']){if(_0x22e2c1['error'][_0x5500('0x23')]===0x1f4){logger[_0x5500('0x24')]('ChatMessage,\x20%s,\x20%s',_0x2fa301,_0x22e2c1[_0x5500('0x24')][_0x5500('0x25')]);return _0x24b7d8(_0x22e2c1['error'][_0x5500('0x25')]);}logger[_0x5500('0x24')](_0x5500('0x1f'),_0x2fa301,_0x22e2c1[_0x5500('0x24')]['message']);return _0x5e6a86(_0x22e2c1[_0x5500('0x24')][_0x5500('0x25')]);}else{logger[_0x5500('0x1e')](_0x5500('0x1f'),_0x2fa301,_0x5500('0x20'));_0x5e6a86(_0x22e2c1[_0x5500('0x26')][_0x5500('0x25')]);}})['catch'](function(_0x9f063){logger[_0x5500('0x24')](_0x5500('0x1f'),_0x2fa301,_0x9f063);_0x24b7d8(_0x9f063);});});}function respondWithStatusCode(_0x66e7e4,_0x50f50b){_0x50f50b=_0x50f50b||0xcc;return function(_0x36b7bb){if(_0x36b7bb){return _0x66e7e4[_0x5500('0x27')](_0x50f50b);}return _0x66e7e4[_0x5500('0x28')](_0x50f50b)['end']();};}function respondWithResult(_0x24fe49,_0x37ae16){_0x37ae16=_0x37ae16||0xc8;return function(_0x3f999e){if(_0x3f999e){return _0x24fe49[_0x5500('0x28')](_0x37ae16)[_0x5500('0x29')](_0x3f999e);}};}function respondWithFilteredResult(_0x3626d0,_0xf6b5c4){return function(_0x579eff){if(_0x579eff){var _0x28df29=typeof _0xf6b5c4[_0x5500('0x2a')]===_0x5500('0x2b')&&typeof _0xf6b5c4[_0x5500('0x2c')]===_0x5500('0x2b');var _0x5d413e=_0x579eff[_0x5500('0x2d')];var _0x27843b=_0x28df29?0x0:_0xf6b5c4[_0x5500('0x2a')];var _0x28942e=_0x28df29?_0x579eff['count']:_0xf6b5c4[_0x5500('0x2a')]+_0xf6b5c4['limit'];var _0x10f83a;if(_0x28942e>=_0x5d413e){_0x28942e=_0x5d413e;_0x10f83a=0xc8;}else{_0x10f83a=0xce;}_0x3626d0[_0x5500('0x28')](_0x10f83a);return _0x3626d0[_0x5500('0x2e')](_0x5500('0x2f'),_0x27843b+'-'+_0x28942e+'/'+_0x5d413e)[_0x5500('0x29')](_0x579eff);}return null;};}function patchUpdates(_0x5e9e62){return function(_0x24dbab){try{jsonpatch[_0x5500('0x30')](_0x24dbab,_0x5e9e62,!![]);}catch(_0x33894a){return BPromise['reject'](_0x33894a);}return _0x24dbab[_0x5500('0x31')]();};}function saveUpdates(_0x347e44,_0x5248c2){return function(_0x46c189){if(_0x46c189){return _0x46c189[_0x5500('0x32')](_0x347e44)['then'](function(_0x42d23c){return _0x42d23c;});}return null;};}function removeEntity(_0x914bbf,_0x1437cf){return function(_0x57318f){if(_0x57318f){return _0x57318f[_0x5500('0x33')]()['then'](function(){_0x914bbf['status'](0xcc)[_0x5500('0x34')]();});}};}function handleEntityNotFound(_0x2a02d3,_0x19d549){return function(_0x542107){if(!_0x542107){_0x2a02d3['sendStatus'](0x194);}return _0x542107;};}function handleError(_0x224431,_0x4338da){_0x4338da=_0x4338da||0x1f4;return function(_0x49d70e){logger[_0x5500('0x24')](_0x49d70e['stack']);if(_0x49d70e[_0x5500('0x35')]){delete _0x49d70e[_0x5500('0x35')];}_0x224431['status'](_0x4338da)[_0x5500('0x36')](_0x49d70e);};}exports[_0x5500('0x37')]=function(_0x52a7ab,_0x26bb81){var _0x706a51={},_0x1c05a4={},_0x50a00d={'count':0x0,'rows':[]};var _0x4854bf=_['map'](db['ChatMessage'][_0x5500('0x38')],function(_0x4234db){return{'name':_0x4234db[_0x5500('0x39')],'type':_0x4234db[_0x5500('0x3a')][_0x5500('0x3b')]};});_0x1c05a4[_0x5500('0x3c')]=_['map'](_0x4854bf,_0x5500('0x35'));_0x1c05a4['query']=_[_0x5500('0x3d')](_0x52a7ab['query']);_0x1c05a4[_0x5500('0x3e')]=_[_0x5500('0x3f')](_0x1c05a4[_0x5500('0x3c')],_0x1c05a4['query']);_0x706a51[_0x5500('0x40')]=_[_0x5500('0x3f')](_0x1c05a4[_0x5500('0x3c')],qs[_0x5500('0x41')](_0x52a7ab[_0x5500('0x42')][_0x5500('0x41')]));_0x706a51[_0x5500('0x40')]=_0x706a51['attributes'][_0x5500('0x43')]?_0x706a51[_0x5500('0x40')]:_0x1c05a4['model'];if(!_0x52a7ab[_0x5500('0x42')][_0x5500('0x44')](_0x5500('0x45'))){_0x706a51[_0x5500('0x2c')]=qs[_0x5500('0x2c')](_0x52a7ab[_0x5500('0x42')][_0x5500('0x2c')]);_0x706a51[_0x5500('0x2a')]=qs[_0x5500('0x2a')](_0x52a7ab['query'][_0x5500('0x2a')]);}_0x706a51['order']=qs['sort'](_0x52a7ab[_0x5500('0x42')][_0x5500('0x46')]);_0x706a51[_0x5500('0x47')]=qs['filters'](_[_0x5500('0x48')](_0x52a7ab[_0x5500('0x42')],_0x1c05a4[_0x5500('0x3e')]),_0x4854bf);if(_0x52a7ab[_0x5500('0x42')][_0x5500('0x49')]){_0x706a51[_0x5500('0x47')]=_[_0x5500('0x4a')](_0x706a51[_0x5500('0x47')],{'$or':_[_0x5500('0x4b')](_0x4854bf,function(_0x3f767d){if(_0x3f767d[_0x5500('0x3a')]!=='VIRTUAL'){var _0x514aad={};_0x514aad[_0x3f767d[_0x5500('0x35')]]={'$like':'%'+_0x52a7ab[_0x5500('0x42')][_0x5500('0x49')]+'%'};return _0x514aad;}})});}_0x706a51=_[_0x5500('0x4a')]({},_0x706a51,_0x52a7ab['options']);var _0x3d29cb={'where':_0x706a51[_0x5500('0x47')]};return db[_0x5500('0x4c')][_0x5500('0x2d')](_0x3d29cb)[_0x5500('0x4d')](function(_0x372324){_0x50a00d[_0x5500('0x2d')]=_0x372324;if(_0x52a7ab[_0x5500('0x42')][_0x5500('0x4e')]){_0x706a51[_0x5500('0x4f')]=[{'all':!![]}];}return db[_0x5500('0x4c')]['findAll'](_0x706a51);})['then'](function(_0x4b707d){_0x50a00d[_0x5500('0x50')]=_0x4b707d;return _0x50a00d;})[_0x5500('0x4d')](respondWithFilteredResult(_0x26bb81,_0x706a51))['catch'](handleError(_0x26bb81,null));};exports[_0x5500('0x51')]=function(_0x50c10b,_0x2a2e43){var _0x5cf3df={'raw':!![],'where':{'id':_0x50c10b[_0x5500('0x52')]['id']}},_0x5f4479={};_0x5f4479['model']=_[_0x5500('0x3d')](db[_0x5500('0x4c')][_0x5500('0x38')]);_0x5f4479[_0x5500('0x42')]=_[_0x5500('0x3d')](_0x50c10b[_0x5500('0x42')]);_0x5f4479[_0x5500('0x3e')]=_[_0x5500('0x3f')](_0x5f4479['model'],_0x5f4479['query']);_0x5cf3df['attributes']=_[_0x5500('0x3f')](_0x5f4479[_0x5500('0x3c')],qs[_0x5500('0x41')](_0x50c10b[_0x5500('0x42')]['fields']));_0x5cf3df[_0x5500('0x40')]=_0x5cf3df[_0x5500('0x40')][_0x5500('0x43')]?_0x5cf3df[_0x5500('0x40')]:_0x5f4479['model'];if(_0x50c10b['query'][_0x5500('0x4e')]){_0x5cf3df[_0x5500('0x4f')]=[{'all':!![]}];}_0x5cf3df=_[_0x5500('0x4a')]({},_0x5cf3df,_0x50c10b[_0x5500('0x53')]);return db['ChatMessage'][_0x5500('0x54')](_0x5cf3df)[_0x5500('0x4d')](handleEntityNotFound(_0x2a2e43,null))[_0x5500('0x4d')](respondWithResult(_0x2a2e43,null))['catch'](handleError(_0x2a2e43,null));};exports[_0x5500('0x55')]=function(_0x52e61d,_0x5aa092){return db[_0x5500('0x4c')][_0x5500('0x55')](_0x52e61d[_0x5500('0x56')],{})[_0x5500('0x4d')](respondWithResult(_0x5aa092,0xc9))[_0x5500('0x57')](handleError(_0x5aa092,null));};exports[_0x5500('0x32')]=function(_0x57a3bd,_0x220da2){if(_0x57a3bd['body']['id']){delete _0x57a3bd['body']['id'];}return db[_0x5500('0x4c')][_0x5500('0x54')]({'where':{'id':_0x57a3bd[_0x5500('0x52')]['id']}})[_0x5500('0x4d')](handleEntityNotFound(_0x220da2,null))[_0x5500('0x4d')](saveUpdates(_0x57a3bd[_0x5500('0x56')],null))[_0x5500('0x4d')](respondWithResult(_0x220da2,null))[_0x5500('0x57')](handleError(_0x220da2,null));};exports['destroy']=function(_0x41de8a,_0x445d57){return db[_0x5500('0x4c')][_0x5500('0x54')]({'where':{'id':_0x41de8a[_0x5500('0x52')]['id']}})[_0x5500('0x4d')](handleEntityNotFound(_0x445d57,null))[_0x5500('0x4d')](removeEntity(_0x445d57,null))[_0x5500('0x57')](handleError(_0x445d57,null));};exports[_0x5500('0x58')]=function(_0x49070a,_0x4b04f9){return db[_0x5500('0x4c')][_0x5500('0x58')]()['then'](respondWithResult(_0x4b04f9,null))[_0x5500('0x57')](handleError(_0x4b04f9,null));};var interaction_log=require(_0x5500('0x13'))(_0x5500('0x59'));exports[_0x5500('0x5a')]=function(_0x5f1ae9,_0x2d5283,_0x35ff63){var _0x2640aa={'agent':{},'channel':_0x5500('0x5b')};if(_0x5f1ae9[_0x5500('0x56')]['id']){delete _0x5f1ae9['body']['id'];}_0x5f1ae9[_0x5500('0x56')][_0x5500('0x5c')]=!![];_0x5f1ae9['body'][_0x5500('0x5d')]=moment()['format'](_0x5500('0x5e'));_0x5f1ae9['body']['UserId']=_0x5f1ae9[_0x5500('0x56')][_0x5500('0x5f')]||_0x5f1ae9[_0x5500('0x60')]['id'];_0x2640aa['agent']['id']=_0x5f1ae9['body'][_0x5500('0x5f')];return db[_0x5500('0x4c')][_0x5500('0x54')]({'where':{'id':_0x5f1ae9[_0x5500('0x52')]['id'],'UserId':null}})[_0x5500('0x4d')](handleEntityNotFound(_0x2d5283,null))[_0x5500('0x4d')](saveUpdates(_0x5f1ae9[_0x5500('0x56')],null))['then'](function(_0x282b8e){if(_0x282b8e){_0x2640aa[_0x5500('0x25')]=_0x282b8e[_0x5500('0x61')]({'plain':!![]});return db['ChatInteraction'][_0x5500('0x54')]({'where':{'id':_0x282b8e[_0x5500('0x62')]}});}return null;})[_0x5500('0x4d')](handleEntityNotFound(_0x2d5283,null))[_0x5500('0x4d')](function(_0x4599dc){if(_0x4599dc){return _0x4599dc[_0x5500('0x32')]({'UserId':_0x5f1ae9[_0x5500('0x56')]['UserId'],'read1stAt':_['isNil'](_0x4599dc['read1stAt'])?moment()[_0x5500('0x63')](_0x5500('0x5e')):undefined});}return null;})[_0x5500('0x4d')](function(_0x22e701){if(_0x22e701){_0x2640aa['interaction']=_0x22e701['get']({'plain':!![]});interaction_log[_0x5500('0x1e')](_0x5500('0x64'),_0x5f1ae9['user']['id'],_0x5f1ae9[_0x5500('0x60')][_0x5500('0x35')],_0x5f1ae9[_0x5500('0x60')][_0x5500('0x65')],_0x2640aa[_0x5500('0x66')]['id'],_0x5f1ae9[_0x5500('0x56')]?JSON[_0x5500('0x22')](_0x5f1ae9[_0x5500('0x56')]):_0x5500('0x67'));return respondWithRpcPromise('AcceptMessage',_0x5500('0x68'),_0x2640aa);}return null;})[_0x5500('0x4d')](function(_0x531322){var _0x12aca1=_0x5500('0x69')+_0x531322[_0x5500('0x25')]['ContactId'];return db['sequelize']['query'](_0x12aca1,{'type':db[_0x5500('0x6a')]['QueryTypes'][_0x5500('0x6b')],'raw':!![]})[_0x5500('0x4d')](function(_0x4d3f90){return _0x4d3f90;});})[_0x5500('0x4d')](function(_0x4e9ee5){if(_0x4e9ee5){_0x2640aa[_0x5500('0x25')][_0x5500('0x6c')]=_0x4e9ee5[0x0];if(!_0x5f1ae9['body'][_0x5500('0x5f')])return;return db[_0x5500('0x6d')][_0x5500('0x54')]({'where':{'id':_0x5f1ae9[_0x5500('0x56')]['UserId'],'role':_0x5500('0x6e')},'attributes':['id',_0x5500('0x35'),_0x5500('0x6f'),'email',_0x5500('0x70')],'raw':!![]});}return null;})[_0x5500('0x4d')](function(_0x3c1989){if(!_0x3c1989)return null;_0x2640aa[_0x5500('0x25')][_0x5500('0x6e')]=_0x3c1989;return _0x2640aa;})['then'](function(_0xa41f48){if(_0xa41f48){if(_0x5f1ae9['body'][_0x5500('0x71')]){_0x2640aa['message']['interface']=util['format'](_0x5500('0x72'),_0x5f1ae9[_0x5500('0x60')][_0x5500('0x35')]);_0x2640aa['message'][_0x5500('0x73')]=_0x2640aa['channel'];_0x2640aa['message'][_0x5500('0x74')]=_0x2640aa['channel'];_0x2640aa[_0x5500('0x25')][_0x5500('0x75')]=_0x5500('0x5a');return respondWithRpcPromise('EventManager',_0x5500('0x76'),{'event':_0x5500('0x77'),'message':_[_0x5500('0x4a')](_0x2640aa[_0x5500('0x25')],JSON[_0x5500('0x78')](_0x2640aa[_0x5500('0x66')]['formData']))},client9002)[_0x5500('0x4d')](function(){return _0x2640aa;});}return _0x2640aa;}return null;})[_0x5500('0x4d')](respondWithResult(_0x2d5283,null))[_0x5500('0x57')](handleError(_0x2d5283,null));};var interaction_log=require('../../config/logger')(_0x5500('0x59'));exports[_0x5500('0x79')]=function(_0x2e85e0,_0x267a69,_0x4b60c1){var _0x12c3cd={'agent':{},'channel':_0x5500('0x5b')};if(_0x2e85e0[_0x5500('0x56')]['id']){delete _0x2e85e0['body']['id'];}_0x2e85e0['body'][_0x5500('0x5f')]=_0x2e85e0[_0x5500('0x56')][_0x5500('0x5f')]||_0x2e85e0[_0x5500('0x60')]['id'];_0x12c3cd[_0x5500('0x6e')]['id']=_0x2e85e0['body']['UserId'];return db[_0x5500('0x4c')][_0x5500('0x54')]({'where':{'id':_0x2e85e0[_0x5500('0x52')]['id'],'UserId':null}})[_0x5500('0x4d')](handleEntityNotFound(_0x267a69,null))['then'](function(_0x4c4e1f){if(_0x4c4e1f){_0x12c3cd['message']=_0x4c4e1f[_0x5500('0x61')]({'plain':!![]});return db['ChatInteraction'][_0x5500('0x54')]({'where':{'id':_0x4c4e1f[_0x5500('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x267a69,null))[_0x5500('0x4d')](function(_0x5a07da){if(_0x5a07da){_0x12c3cd[_0x5500('0x66')]=_0x5a07da[_0x5500('0x61')]({'plain':!![]});interaction_log[_0x5500('0x1e')](_0x5500('0x7a'),_0x2e85e0['user']['id'],_0x2e85e0[_0x5500('0x60')][_0x5500('0x35')],_0x2e85e0[_0x5500('0x60')][_0x5500('0x65')],_0x12c3cd['interaction']['id'],_0x2e85e0['body']?JSON[_0x5500('0x22')](_0x2e85e0[_0x5500('0x56')]):_0x5500('0x67'));return respondWithRpcPromise(_0x5500('0x7b'),'rejectMessage',_0x12c3cd);}return null;})[_0x5500('0x4d')](function(_0x15ea66){var _0x19d83d=_0x5500('0x69')+_0x15ea66[_0x5500('0x25')][_0x5500('0x7c')];return db[_0x5500('0x7d')][_0x5500('0x42')](_0x19d83d,{'type':db[_0x5500('0x6a')][_0x5500('0x7e')][_0x5500('0x6b')],'raw':!![]})[_0x5500('0x4d')](function(_0x3f5a10){return _0x3f5a10;});})[_0x5500('0x4d')](function(_0x44cd49){if(_0x44cd49){_0x12c3cd['message'][_0x5500('0x6c')]=_0x44cd49[0x0];if(!_0x2e85e0[_0x5500('0x56')]['UserId'])return;return db[_0x5500('0x6d')][_0x5500('0x54')]({'where':{'id':_0x2e85e0[_0x5500('0x56')][_0x5500('0x5f')],'role':'agent'},'attributes':['id',_0x5500('0x35'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x5500('0x4d')](function(_0x20298e){if(!_0x20298e)return null;_0x12c3cd['message'][_0x5500('0x6e')]=_0x20298e;return _0x12c3cd;})['then'](function(_0x194ab9){if(_0x194ab9){_0x194ab9[_0x5500('0x25')][_0x5500('0x7f')]=util[_0x5500('0x63')](_0x5500('0x72'),_0x2e85e0[_0x5500('0x60')]['name']);_0x194ab9[_0x5500('0x25')][_0x5500('0x73')]=_0x12c3cd['channel'];_0x194ab9[_0x5500('0x25')][_0x5500('0x74')]=_0x12c3cd[_0x5500('0x73')];_0x194ab9['message'][_0x5500('0x75')]=_0x5500('0x79');respondWithRpcPromise(_0x5500('0x76'),'EventManager',{'event':'rejectmessage','message':_['merge'](_0x12c3cd[_0x5500('0x25')],JSON['parse'](_0x12c3cd['interaction'][_0x5500('0x80')]))},client9002);return _0x12c3cd;}return null;})[_0x5500('0x4d')](respondWithResult(_0x267a69,null))[_0x5500('0x57')](handleError(_0x267a69,null));};
\ No newline at end of file
+var _0x8b38=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','show','params','rawAttributes','keys','include','find','create','body','destroy','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','agent','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','contact','User','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatMessage.socket','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','update','stack','name','send','map','ChatMessage','fieldName','type','model','query','filters','intersection','attributes','fields','length'];(function(_0x18f396,_0x174d17){var _0x3ba532=function(_0x2bc92f){while(--_0x2bc92f){_0x18f396['push'](_0x18f396['shift']());}};_0x3ba532(++_0x174d17);}(_0x8b38,0xca));var _0x88b3=function(_0x214d54,_0x133c72){_0x214d54=_0x214d54-0x0;var _0x44ca46=_0x8b38[_0x214d54];return _0x44ca46;};'use strict';var emlformat=require(_0x88b3('0x0'));var rimraf=require(_0x88b3('0x1'));var zipdir=require(_0x88b3('0x2'));var jsonpatch=require(_0x88b3('0x3'));var rp=require(_0x88b3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x88b3('0x5'));var util=require(_0x88b3('0x6'));var path=require(_0x88b3('0x7'));var sox=require(_0x88b3('0x8'));var csv=require(_0x88b3('0x9'));var ejs=require(_0x88b3('0xa'));var fs=require('fs');var fs_extra=require(_0x88b3('0xb'));var _=require('lodash');var squel=require(_0x88b3('0xc'));var crypto=require(_0x88b3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x88b3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x88b3('0xf'));var Papa=require('papaparse');var Redis=require(_0x88b3('0x10'));var authService=require(_0x88b3('0x11'));var qs=require(_0x88b3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x88b3('0x13'));var logger=require(_0x88b3('0x14'))(_0x88b3('0x15'));var utils=require(_0x88b3('0x16'));var config=require(_0x88b3('0x17'));var licenseUtil=require(_0x88b3('0x18'));var db=require(_0x88b3('0x19'))['db'];config['redis']=_['defaults'](config[_0x88b3('0x1a')],{'host':_0x88b3('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x88b3('0x1a')]));require(_0x88b3('0x1c'))['register'](socket);var jayson=require(_0x88b3('0x1d'));var client=jayson[_0x88b3('0x1e')][_0x88b3('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x88b3('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xce5ce7,_0x2685ae,_0x34bef9,_0x498cfe){return new BPromise(function(_0x417576,_0x4d02a3){var _0x4cd92c=_0x498cfe||client;return _0x4cd92c[_0x88b3('0x20')](_0xce5ce7,_0x34bef9)[_0x88b3('0x21')](function(_0xda6d82){logger['info'](_0x88b3('0x22'),_0x2685ae,_0x88b3('0x23'));logger[_0x88b3('0x24')](_0x88b3('0x25'),_0x2685ae,_0x88b3('0x23'),JSON[_0x88b3('0x26')](_0xda6d82));if(_0xda6d82[_0x88b3('0x27')]){if(_0xda6d82[_0x88b3('0x27')][_0x88b3('0x28')]===0x1f4){logger[_0x88b3('0x27')](_0x88b3('0x22'),_0x2685ae,_0xda6d82['error'][_0x88b3('0x29')]);return _0x4d02a3(_0xda6d82['error'][_0x88b3('0x29')]);}logger[_0x88b3('0x27')](_0x88b3('0x22'),_0x2685ae,_0xda6d82[_0x88b3('0x27')][_0x88b3('0x29')]);return _0x417576(_0xda6d82[_0x88b3('0x27')][_0x88b3('0x29')]);}else{logger[_0x88b3('0x2a')](_0x88b3('0x22'),_0x2685ae,_0x88b3('0x23'));_0x417576(_0xda6d82[_0x88b3('0x2b')]['message']);}})[_0x88b3('0x2c')](function(_0x5cd07d){logger[_0x88b3('0x27')](_0x88b3('0x22'),_0x2685ae,_0x5cd07d);_0x4d02a3(_0x5cd07d);});});}function respondWithStatusCode(_0xdefa14,_0x57e96){_0x57e96=_0x57e96||0xcc;return function(_0x396a23){if(_0x396a23){return _0xdefa14[_0x88b3('0x2d')](_0x57e96);}return _0xdefa14[_0x88b3('0x2e')](_0x57e96)[_0x88b3('0x2f')]();};}function respondWithResult(_0x30f1e5,_0x59ecb2){_0x59ecb2=_0x59ecb2||0xc8;return function(_0x2624d9){if(_0x2624d9){return _0x30f1e5[_0x88b3('0x2e')](_0x59ecb2)[_0x88b3('0x30')](_0x2624d9);}};}function respondWithFilteredResult(_0x5647c7,_0x556a01){return function(_0x2af0ae){if(_0x2af0ae){var _0x1cfec6=typeof _0x556a01[_0x88b3('0x31')]===_0x88b3('0x32')&&typeof _0x556a01['limit']===_0x88b3('0x32');var _0x133799=_0x2af0ae['count'];var _0x1fc173=_0x1cfec6?0x0:_0x556a01[_0x88b3('0x31')];var _0xd62528=_0x1cfec6?_0x2af0ae['count']:_0x556a01[_0x88b3('0x31')]+_0x556a01[_0x88b3('0x33')];var _0x556dd0;if(_0xd62528>=_0x133799){_0xd62528=_0x133799;_0x556dd0=0xc8;}else{_0x556dd0=0xce;}_0x5647c7['status'](_0x556dd0);return _0x5647c7[_0x88b3('0x34')](_0x88b3('0x35'),_0x1fc173+'-'+_0xd62528+'/'+_0x133799)[_0x88b3('0x30')](_0x2af0ae);}return null;};}function patchUpdates(_0x192fef){return function(_0x4f38d8){try{jsonpatch['apply'](_0x4f38d8,_0x192fef,!![]);}catch(_0x1a1a7e){return BPromise[_0x88b3('0x36')](_0x1a1a7e);}return _0x4f38d8['save']();};}function saveUpdates(_0x29ab4a,_0x56633b){return function(_0x48eaf1){if(_0x48eaf1){return _0x48eaf1[_0x88b3('0x37')](_0x29ab4a)['then'](function(_0xa7cb4){return _0xa7cb4;});}return null;};}function removeEntity(_0x9c5ae6,_0x4919fb){return function(_0xc64e25){if(_0xc64e25){return _0xc64e25['destroy']()['then'](function(){_0x9c5ae6[_0x88b3('0x2e')](0xcc)[_0x88b3('0x2f')]();});}};}function handleEntityNotFound(_0x2a1436,_0x3cd072){return function(_0x595626){if(!_0x595626){_0x2a1436[_0x88b3('0x2d')](0x194);}return _0x595626;};}function handleError(_0x3fa3db,_0x57980c){_0x57980c=_0x57980c||0x1f4;return function(_0x4d1c79){logger[_0x88b3('0x27')](_0x4d1c79[_0x88b3('0x38')]);if(_0x4d1c79[_0x88b3('0x39')]){delete _0x4d1c79[_0x88b3('0x39')];}_0x3fa3db['status'](_0x57980c)[_0x88b3('0x3a')](_0x4d1c79);};}exports['index']=function(_0x94576c,_0x2056e4){var _0x46057e={},_0x5f9a03={},_0xf9afab={'count':0x0,'rows':[]};var _0x497110=_[_0x88b3('0x3b')](db[_0x88b3('0x3c')]['rawAttributes'],function(_0x249641){return{'name':_0x249641[_0x88b3('0x3d')],'type':_0x249641[_0x88b3('0x3e')]['key']};});_0x5f9a03[_0x88b3('0x3f')]=_['map'](_0x497110,_0x88b3('0x39'));_0x5f9a03[_0x88b3('0x40')]=_['keys'](_0x94576c[_0x88b3('0x40')]);_0x5f9a03[_0x88b3('0x41')]=_[_0x88b3('0x42')](_0x5f9a03['model'],_0x5f9a03[_0x88b3('0x40')]);_0x46057e[_0x88b3('0x43')]=_[_0x88b3('0x42')](_0x5f9a03['model'],qs[_0x88b3('0x44')](_0x94576c[_0x88b3('0x40')][_0x88b3('0x44')]));_0x46057e[_0x88b3('0x43')]=_0x46057e[_0x88b3('0x43')][_0x88b3('0x45')]?_0x46057e[_0x88b3('0x43')]:_0x5f9a03[_0x88b3('0x3f')];if(!_0x94576c['query'][_0x88b3('0x46')](_0x88b3('0x47'))){_0x46057e[_0x88b3('0x33')]=qs[_0x88b3('0x33')](_0x94576c[_0x88b3('0x40')]['limit']);_0x46057e[_0x88b3('0x31')]=qs[_0x88b3('0x31')](_0x94576c[_0x88b3('0x40')][_0x88b3('0x31')]);}_0x46057e[_0x88b3('0x48')]=qs[_0x88b3('0x49')](_0x94576c[_0x88b3('0x40')][_0x88b3('0x49')]);_0x46057e[_0x88b3('0x4a')]=qs[_0x88b3('0x41')](_[_0x88b3('0x4b')](_0x94576c[_0x88b3('0x40')],_0x5f9a03[_0x88b3('0x41')]),_0x497110);if(_0x94576c[_0x88b3('0x40')][_0x88b3('0x4c')]){_0x46057e[_0x88b3('0x4a')]=_[_0x88b3('0x4d')](_0x46057e[_0x88b3('0x4a')],{'$or':_[_0x88b3('0x3b')](_0x497110,function(_0x3c1b8f){if(_0x3c1b8f['type']!==_0x88b3('0x4e')){var _0x2b87e9={};_0x2b87e9[_0x3c1b8f[_0x88b3('0x39')]]={'$like':'%'+_0x94576c[_0x88b3('0x40')][_0x88b3('0x4c')]+'%'};return _0x2b87e9;}})});}_0x46057e=_[_0x88b3('0x4d')]({},_0x46057e,_0x94576c[_0x88b3('0x4f')]);var _0x19b5bd={'where':_0x46057e['where']};return db[_0x88b3('0x3c')][_0x88b3('0x50')](_0x19b5bd)[_0x88b3('0x21')](function(_0x53f5df){_0xf9afab['count']=_0x53f5df;if(_0x94576c[_0x88b3('0x40')][_0x88b3('0x51')]){_0x46057e['include']=[{'all':!![]}];}return db[_0x88b3('0x3c')][_0x88b3('0x52')](_0x46057e);})['then'](function(_0x238890){_0xf9afab[_0x88b3('0x53')]=_0x238890;return _0xf9afab;})['then'](respondWithFilteredResult(_0x2056e4,_0x46057e))['catch'](handleError(_0x2056e4,null));};exports[_0x88b3('0x54')]=function(_0x3cebff,_0x1824db){var _0x24a510={'raw':!![],'where':{'id':_0x3cebff[_0x88b3('0x55')]['id']}},_0x25b0ee={};_0x25b0ee['model']=_['keys'](db[_0x88b3('0x3c')][_0x88b3('0x56')]);_0x25b0ee[_0x88b3('0x40')]=_[_0x88b3('0x57')](_0x3cebff[_0x88b3('0x40')]);_0x25b0ee[_0x88b3('0x41')]=_[_0x88b3('0x42')](_0x25b0ee[_0x88b3('0x3f')],_0x25b0ee[_0x88b3('0x40')]);_0x24a510[_0x88b3('0x43')]=_[_0x88b3('0x42')](_0x25b0ee[_0x88b3('0x3f')],qs[_0x88b3('0x44')](_0x3cebff[_0x88b3('0x40')][_0x88b3('0x44')]));_0x24a510[_0x88b3('0x43')]=_0x24a510[_0x88b3('0x43')][_0x88b3('0x45')]?_0x24a510[_0x88b3('0x43')]:_0x25b0ee[_0x88b3('0x3f')];if(_0x3cebff[_0x88b3('0x40')][_0x88b3('0x51')]){_0x24a510[_0x88b3('0x58')]=[{'all':!![]}];}_0x24a510=_[_0x88b3('0x4d')]({},_0x24a510,_0x3cebff[_0x88b3('0x4f')]);return db[_0x88b3('0x3c')][_0x88b3('0x59')](_0x24a510)['then'](handleEntityNotFound(_0x1824db,null))[_0x88b3('0x21')](respondWithResult(_0x1824db,null))['catch'](handleError(_0x1824db,null));};exports['create']=function(_0x43430f,_0x5cb715){return db[_0x88b3('0x3c')][_0x88b3('0x5a')](_0x43430f[_0x88b3('0x5b')],{})[_0x88b3('0x21')](respondWithResult(_0x5cb715,0xc9))[_0x88b3('0x2c')](handleError(_0x5cb715,null));};exports[_0x88b3('0x37')]=function(_0x39c8f9,_0x20d511){if(_0x39c8f9[_0x88b3('0x5b')]['id']){delete _0x39c8f9[_0x88b3('0x5b')]['id'];}return db[_0x88b3('0x3c')]['find']({'where':{'id':_0x39c8f9['params']['id']}})[_0x88b3('0x21')](handleEntityNotFound(_0x20d511,null))[_0x88b3('0x21')](saveUpdates(_0x39c8f9['body'],null))[_0x88b3('0x21')](respondWithResult(_0x20d511,null))['catch'](handleError(_0x20d511,null));};exports[_0x88b3('0x5c')]=function(_0xc48612,_0x5148fa){return db[_0x88b3('0x3c')][_0x88b3('0x59')]({'where':{'id':_0xc48612[_0x88b3('0x55')]['id']}})[_0x88b3('0x21')](handleEntityNotFound(_0x5148fa,null))[_0x88b3('0x21')](removeEntity(_0x5148fa,null))['catch'](handleError(_0x5148fa,null));};exports[_0x88b3('0x5d')]=function(_0x43ac0a,_0xf22058){return db[_0x88b3('0x3c')][_0x88b3('0x5d')]()['then'](respondWithResult(_0xf22058,null))[_0x88b3('0x2c')](handleError(_0xf22058,null));};var interaction_log=require(_0x88b3('0x14'))(_0x88b3('0x5e'));exports['accept']=function(_0x33c431,_0x6a5695,_0x1dda35){var _0x4742f9={'agent':{},'channel':_0x88b3('0x5f')};if(_0x33c431['body']['id']){delete _0x33c431['body']['id'];}_0x33c431[_0x88b3('0x5b')][_0x88b3('0x60')]=!![];_0x33c431[_0x88b3('0x5b')][_0x88b3('0x61')]=moment()[_0x88b3('0x62')](_0x88b3('0x63'));_0x33c431['body']['UserId']=_0x33c431[_0x88b3('0x5b')][_0x88b3('0x64')]||_0x33c431[_0x88b3('0x65')]['id'];_0x4742f9['agent']['id']=_0x33c431[_0x88b3('0x5b')][_0x88b3('0x64')];return db[_0x88b3('0x3c')][_0x88b3('0x59')]({'where':{'id':_0x33c431['params']['id'],'UserId':null}})[_0x88b3('0x21')](handleEntityNotFound(_0x6a5695,null))[_0x88b3('0x21')](saveUpdates(_0x33c431[_0x88b3('0x5b')],null))[_0x88b3('0x21')](function(_0x2df276){if(_0x2df276){_0x4742f9[_0x88b3('0x29')]=_0x2df276[_0x88b3('0x66')]({'plain':!![]});return db[_0x88b3('0x67')][_0x88b3('0x59')]({'where':{'id':_0x2df276[_0x88b3('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x6a5695,null))[_0x88b3('0x21')](function(_0x19a4d8){if(_0x19a4d8){return _0x19a4d8[_0x88b3('0x37')]({'UserId':_0x33c431[_0x88b3('0x5b')][_0x88b3('0x64')],'read1stAt':_[_0x88b3('0x69')](_0x19a4d8[_0x88b3('0x6a')])?moment()['format'](_0x88b3('0x63')):undefined});}return null;})[_0x88b3('0x21')](function(_0x242e8c){if(_0x242e8c){_0x4742f9['interaction']=_0x242e8c[_0x88b3('0x66')]({'plain':!![]});interaction_log[_0x88b3('0x2a')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x33c431[_0x88b3('0x65')]['id'],_0x33c431[_0x88b3('0x65')]['name'],_0x33c431[_0x88b3('0x65')]['role'],_0x4742f9[_0x88b3('0x6b')]['id'],_0x33c431[_0x88b3('0x5b')]?JSON[_0x88b3('0x26')](_0x33c431['body']):_0x88b3('0x6c'));return respondWithRpcPromise(_0x88b3('0x6d'),_0x88b3('0x6e'),_0x4742f9);}return null;})[_0x88b3('0x21')](function(_0x1f6cea){var _0x6ca5e4=_0x88b3('0x6f')+_0x1f6cea[_0x88b3('0x29')][_0x88b3('0x70')];return db[_0x88b3('0x71')][_0x88b3('0x40')](_0x6ca5e4,{'type':db[_0x88b3('0x72')][_0x88b3('0x73')][_0x88b3('0x74')],'raw':!![]})[_0x88b3('0x21')](function(_0x3b46ed){return _0x3b46ed;});})[_0x88b3('0x21')](function(_0x251223){if(_0x251223){_0x4742f9[_0x88b3('0x29')]['contact']=_0x251223[0x0];if(!_0x33c431[_0x88b3('0x5b')]['UserId'])return;return db['User'][_0x88b3('0x59')]({'where':{'id':_0x33c431[_0x88b3('0x5b')]['UserId'],'role':'agent'},'attributes':['id',_0x88b3('0x39'),_0x88b3('0x75'),_0x88b3('0x76'),_0x88b3('0x77')],'raw':!![]});}return null;})[_0x88b3('0x21')](function(_0x154014){if(!_0x154014)return null;_0x4742f9[_0x88b3('0x29')][_0x88b3('0x78')]=_0x154014;return _0x4742f9;})[_0x88b3('0x21')](function(_0xd55b11){if(_0xd55b11){if(_0x33c431[_0x88b3('0x5b')][_0x88b3('0x79')]){_0x4742f9[_0x88b3('0x29')][_0x88b3('0x7a')]=util[_0x88b3('0x62')](_0x88b3('0x7b'),_0x33c431[_0x88b3('0x65')]['name']);_0x4742f9[_0x88b3('0x29')][_0x88b3('0x7c')]=_0x4742f9[_0x88b3('0x7c')];_0x4742f9[_0x88b3('0x29')][_0x88b3('0x7d')]=_0x4742f9[_0x88b3('0x7c')];_0x4742f9[_0x88b3('0x29')][_0x88b3('0x7e')]=_0x88b3('0x7f');return respondWithRpcPromise(_0x88b3('0x80'),'EventManager',{'event':_0x88b3('0x81'),'message':_[_0x88b3('0x4d')](_0x4742f9[_0x88b3('0x29')],JSON['parse'](_0x4742f9[_0x88b3('0x6b')][_0x88b3('0x82')]))},client9002)[_0x88b3('0x21')](function(){return _0x4742f9;});}return _0x4742f9;}return null;})[_0x88b3('0x21')](respondWithResult(_0x6a5695,null))[_0x88b3('0x2c')](handleError(_0x6a5695,null));};var interaction_log=require(_0x88b3('0x14'))(_0x88b3('0x5e'));exports['reject']=function(_0x39a9cd,_0x28400d,_0x5efbfe){var _0x1651e8={'agent':{},'channel':'chat'};if(_0x39a9cd['body']['id']){delete _0x39a9cd[_0x88b3('0x5b')]['id'];}_0x39a9cd[_0x88b3('0x5b')][_0x88b3('0x64')]=_0x39a9cd[_0x88b3('0x5b')][_0x88b3('0x64')]||_0x39a9cd[_0x88b3('0x65')]['id'];_0x1651e8[_0x88b3('0x78')]['id']=_0x39a9cd['body']['UserId'];return db[_0x88b3('0x3c')]['find']({'where':{'id':_0x39a9cd['params']['id'],'UserId':null}})[_0x88b3('0x21')](handleEntityNotFound(_0x28400d,null))[_0x88b3('0x21')](function(_0x510b2f){if(_0x510b2f){_0x1651e8[_0x88b3('0x29')]=_0x510b2f[_0x88b3('0x66')]({'plain':!![]});return db[_0x88b3('0x67')][_0x88b3('0x59')]({'where':{'id':_0x510b2f[_0x88b3('0x68')]}});}return null;})[_0x88b3('0x21')](handleEntityNotFound(_0x28400d,null))['then'](function(_0x20db2c){if(_0x20db2c){_0x1651e8[_0x88b3('0x6b')]=_0x20db2c[_0x88b3('0x66')]({'plain':!![]});interaction_log['info'](_0x88b3('0x83'),_0x39a9cd[_0x88b3('0x65')]['id'],_0x39a9cd[_0x88b3('0x65')][_0x88b3('0x39')],_0x39a9cd['user']['role'],_0x1651e8['interaction']['id'],_0x39a9cd[_0x88b3('0x5b')]?JSON['stringify'](_0x39a9cd[_0x88b3('0x5b')]):'null');return respondWithRpcPromise(_0x88b3('0x84'),'rejectMessage',_0x1651e8);}return null;})['then'](function(_0x398dee){var _0x527f7f=_0x88b3('0x6f')+_0x398dee[_0x88b3('0x29')][_0x88b3('0x70')];return db[_0x88b3('0x71')][_0x88b3('0x40')](_0x527f7f,{'type':db[_0x88b3('0x72')][_0x88b3('0x73')]['SELECT'],'raw':!![]})[_0x88b3('0x21')](function(_0x34e406){return _0x34e406;});})[_0x88b3('0x21')](function(_0x470972){if(_0x470972){_0x1651e8[_0x88b3('0x29')][_0x88b3('0x85')]=_0x470972[0x0];if(!_0x39a9cd[_0x88b3('0x5b')][_0x88b3('0x64')])return;return db[_0x88b3('0x86')]['find']({'where':{'id':_0x39a9cd[_0x88b3('0x5b')]['UserId'],'role':_0x88b3('0x78')},'attributes':['id',_0x88b3('0x39'),_0x88b3('0x75'),_0x88b3('0x76'),_0x88b3('0x77')],'raw':!![]});}return null;})['then'](function(_0x24eb07){if(!_0x24eb07)return null;_0x1651e8[_0x88b3('0x29')][_0x88b3('0x78')]=_0x24eb07;return _0x1651e8;})[_0x88b3('0x21')](function(_0x1de9d5){if(_0x1de9d5){_0x1de9d5[_0x88b3('0x29')][_0x88b3('0x7a')]=util[_0x88b3('0x62')](_0x88b3('0x7b'),_0x39a9cd['user'][_0x88b3('0x39')]);_0x1de9d5['message'][_0x88b3('0x7c')]=_0x1651e8[_0x88b3('0x7c')];_0x1de9d5['message']['motionChannel']=_0x1651e8[_0x88b3('0x7c')];_0x1de9d5[_0x88b3('0x29')][_0x88b3('0x7e')]=_0x88b3('0x36');respondWithRpcPromise('EventManager',_0x88b3('0x80'),{'event':'rejectmessage','message':_[_0x88b3('0x4d')](_0x1651e8['message'],JSON[_0x88b3('0x87')](_0x1651e8[_0x88b3('0x6b')]['formData']))},client9002);return _0x1651e8;}return null;})[_0x88b3('0x21')](respondWithResult(_0x28400d,null))[_0x88b3('0x2c')](handleError(_0x28400d,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 2db91e2..a0b7396 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 _0x3623=['emit','hook','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x4fcd55,_0x9948ad){var _0x4200a3=function(_0x5520d9){while(--_0x5520d9){_0x4fcd55['push'](_0x4fcd55['shift']());}};_0x4200a3(++_0x9948ad);}(_0x3623,0x183));var _0x3362=function(_0x211576,_0xcc41af){_0x211576=_0x211576-0x0;var _0x3ce235=_0x3623[_0x211576];return _0x3ce235;};'use strict';var EventEmitter=require(_0x3362('0x0'));var ChatMessage=require(_0x3362('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3362('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3362('0x3'),'afterDestroy':_0x3362('0x4')};function emitEvent(_0x29e028){return function(_0x45fcd4,_0x1cfc24,_0x348b1c){ChatMessageEvents[_0x3362('0x5')](_0x29e028+':'+_0x45fcd4['id'],_0x45fcd4);ChatMessageEvents[_0x3362('0x5')](_0x29e028,_0x45fcd4);_0x348b1c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x3362('0x6')](e,emitEvent(event));}}module[_0x3362('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0xe771=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x1a64f5,_0x3fcdf5){var _0x2519b5=function(_0x4f113a){while(--_0x4f113a){_0x1a64f5['push'](_0x1a64f5['shift']());}};_0x2519b5(++_0x3fcdf5);}(_0xe771,0x18f));var _0x1e77=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xe771[_0x39096d];return _0x13da4f;};'use strict';var EventEmitter=require(_0x1e77('0x0'));var ChatMessage=require(_0x1e77('0x1'))['db'][_0x1e77('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1e77('0x3')](0x0);var events={'afterCreate':_0x1e77('0x4'),'afterUpdate':_0x1e77('0x5'),'afterDestroy':_0x1e77('0x6')};function emitEvent(_0x18dc94){return function(_0x44487c,_0x3afc60,_0x1f6b2b){ChatMessageEvents[_0x1e77('0x7')](_0x18dc94+':'+_0x44487c['id'],_0x44487c);ChatMessageEvents[_0x1e77('0x7')](_0x18dc94,_0x44487c);_0x1f6b2b(null);};}for(var e in events){if(events[_0x1e77('0x8')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x1e77('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 17651e3..475ede7 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 _0x954e=['bluebird','../../config/environment','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','util','../../config/logger','moment'];(function(_0x4c3e5a,_0x4e4ad5){var _0x4236dd=function(_0x4f7dc7){while(--_0x4f7dc7){_0x4c3e5a['push'](_0x4c3e5a['shift']());}};_0x4236dd(++_0x4e4ad5);}(_0x954e,0x15c));var _0xe954=function(_0x19df8e,_0xc8482){_0x19df8e=_0x19df8e-0x0;var _0x378598=_0x954e[_0x19df8e];return _0x378598;};'use strict';var _=require('lodash');var util=require(_0xe954('0x0'));var logger=require(_0xe954('0x1'))('api');var moment=require(_0xe954('0x2'));var BPromise=require(_0xe954('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe954('0x4'));var attributes=require('./chatMessage.attributes');module[_0xe954('0x5')]=function(_0x33ccb8,_0x41f52b){return _0x33ccb8[_0xe954('0x6')](_0xe954('0x7'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xe954('0x8'),'fields':[_0xe954('0x9')],'type':_0xe954('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7e63c1,_0x478dab,_0x55a116){var _0x57eb8e=_0x33ccb8[_0xe954('0xb')];var _0x444709=_0x7e63c1[_0xe954('0xc')]({'plain':!![]});if(_0x444709[_0xe954('0xd')][_0xe954('0xe')]()==='in'||_0x444709[_0xe954('0xd')]['toLowerCase']()===_0xe954('0xf')&&!_0x444709['secret']&&!_[_0xe954('0x10')](_0x444709[_0xe954('0x11')])){_0x57eb8e[_0xe954('0x12')][_0xe954('0x13')]({'where':{'id':_0x444709[_0xe954('0x14')]}})[_0xe954('0x15')](function(_0x374904){if(_0x374904){_0x374904[_0xe954('0x16')]({'lastMsgAt':_0x444709[_0xe954('0x17')],'lastMsgDirection':_0x444709['direction']['toLowerCase']()});}})[_0xe954('0x18')](function(_0x48d605){console[_0xe954('0x19')](_0x48d605);});}_0x55a116();}},'charset':_0xe954('0x1a'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x75a4=['exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','rimraf','./chatMessage.attributes'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x75a4,0x180));var _0x475a=function(_0x31d20e,_0x42105f){_0x31d20e=_0x31d20e-0x0;var _0x5927b1=_0x75a4[_0x31d20e];return _0x5927b1;};'use strict';var _=require(_0x475a('0x0'));var util=require(_0x475a('0x1'));var logger=require(_0x475a('0x2'))('api');var moment=require(_0x475a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x475a('0x4'));var config=require('../../config/environment');var attributes=require(_0x475a('0x5'));module[_0x475a('0x6')]=function(_0x3bb4e9,_0x202d52){return _0x3bb4e9[_0x475a('0x7')](_0x475a('0x8'),attributes,{'tableName':_0x475a('0x9'),'paranoid':![],'indexes':[{'name':_0x475a('0xa'),'fields':[_0x475a('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4dd621,_0xecea11,_0x119dea){var _0x27d12d=_0x3bb4e9[_0x475a('0xc')];var _0x25451f=_0x4dd621[_0x475a('0xd')]({'plain':!![]});if(_0x25451f[_0x475a('0xe')][_0x475a('0xf')]()==='in'||_0x25451f['direction'][_0x475a('0xf')]()===_0x475a('0x10')&&!_0x25451f[_0x475a('0x11')]&&!_[_0x475a('0x12')](_0x25451f[_0x475a('0x13')])){_0x27d12d[_0x475a('0x14')][_0x475a('0x15')]({'where':{'id':_0x25451f[_0x475a('0x16')]}})[_0x475a('0x17')](function(_0x5490c6){if(_0x5490c6){_0x5490c6[_0x475a('0x18')]({'lastMsgAt':_0x25451f[_0x475a('0x19')],'lastMsgDirection':_0x25451f[_0x475a('0xe')][_0x475a('0xf')]()});}})[_0x475a('0x1a')](function(_0x38d7d6){console[_0x475a('0x1b')](_0x38d7d6);});}_0x119dea();}},'charset':_0x475a('0x1c'),'collate':_0x475a('0x1d')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 064b21b..dbaacab 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 _0x45cb=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','moment','ioredis'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x45cb,0x126));var _0xb45c=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x45cb[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xb45c('0x0'));var util=require('util');var moment=require(_0xb45c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb45c('0x2'));var db=require(_0xb45c('0x3'))['db'];var utils=require(_0xb45c('0x4'));var logger=require(_0xb45c('0x5'))(_0xb45c('0x6'));var config=require(_0xb45c('0x7'));var jayson=require(_0xb45c('0x8'));var client=jayson[_0xb45c('0x9')][_0xb45c('0xa')]({'port':0x232a});config[_0xb45c('0xb')]=_[_0xb45c('0xc')](config['redis'],{'host':_0xb45c('0xd'),'port':0x18eb});var socket=require(_0xb45c('0xe'))(new Redis(config[_0xb45c('0xb')]));require(_0xb45c('0xf'))[_0xb45c('0x10')](socket);function respondWithRpcPromise(_0x851f10,_0x585b7e,_0x31e4ad){return new BPromise(function(_0x139362,_0x3a2cf6){return client[_0xb45c('0x11')](_0x851f10,_0x31e4ad)[_0xb45c('0x12')](function(_0x49122f){logger['info'](_0xb45c('0x13'),_0x585b7e,_0xb45c('0x14'));logger[_0xb45c('0x15')](_0xb45c('0x16'),_0x585b7e,_0xb45c('0x14'),JSON['stringify'](_0x49122f));if(_0x49122f[_0xb45c('0x17')]){if(_0x49122f[_0xb45c('0x17')][_0xb45c('0x18')]===0x1f4){logger[_0xb45c('0x17')]('ChatMessage,\x20%s,\x20%s',_0x585b7e,_0x49122f[_0xb45c('0x17')][_0xb45c('0x19')]);return _0x3a2cf6(_0x49122f['error']['message']);}logger[_0xb45c('0x17')](_0xb45c('0x13'),_0x585b7e,_0x49122f['error'][_0xb45c('0x19')]);return _0x139362(_0x49122f[_0xb45c('0x17')]['message']);}else{logger[_0xb45c('0x1a')](_0xb45c('0x13'),_0x585b7e,'request\x20sent');_0x139362(_0x49122f['result']['message']);}})[_0xb45c('0x1b')](function(_0x49a5aa){logger[_0xb45c('0x17')](_0xb45c('0x13'),_0x585b7e,_0x49a5aa);_0x3a2cf6(_0x49a5aa);});});}exports[_0xb45c('0x1c')]=function(_0xa39e87){var _0x1a08fc=this;return new Promise(function(_0x55d7a3,_0x3390fc){return db[_0xb45c('0x1d')]['create'](_0xa39e87[_0xb45c('0x1e')],{'raw':_0xa39e87[_0xb45c('0x1f')]?_0xa39e87['options'][_0xb45c('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0xaadef8){logger[_0xb45c('0x1a')](_0xb45c('0x1c'),_0xa39e87);logger['debug'](_0xb45c('0x1c'),_0xa39e87,JSON['stringify'](_0xaadef8));_0x55d7a3(_0xaadef8);})[_0xb45c('0x1b')](function(_0x17d777){logger['error'](_0xb45c('0x1c'),_0x17d777['message'],_0xa39e87);_0x3390fc(_0x1a08fc[_0xb45c('0x17')](0x1f4,_0x17d777[_0xb45c('0x19')]));});});};
\ No newline at end of file
+var _0x238f=['ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','ChatMessage','body','options','raw','CreateChatMessage','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x238f,0xad));var _0xf238=function(_0x405b82,_0x340642){_0x405b82=_0x405b82-0x0;var _0x5a8c8f=_0x238f[_0x405b82];return _0x5a8c8f;};'use strict';var _=require('lodash');var util=require(_0xf238('0x0'));var moment=require(_0xf238('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf238('0x2'));var db=require(_0xf238('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf238('0x4'))(_0xf238('0x5'));var config=require(_0xf238('0x6'));var jayson=require(_0xf238('0x7'));var client=jayson[_0xf238('0x8')][_0xf238('0x9')]({'port':0x232a});config[_0xf238('0xa')]=_[_0xf238('0xb')](config[_0xf238('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf238('0xc'))(new Redis(config[_0xf238('0xa')]));require('./chatMessage.socket')[_0xf238('0xd')](socket);function respondWithRpcPromise(_0x57b078,_0x1ff7c8,_0x1db8a9){return new BPromise(function(_0x33a1b6,_0x4e1c21){return client[_0xf238('0xe')](_0x57b078,_0x1db8a9)[_0xf238('0xf')](function(_0x21092d){logger[_0xf238('0x10')](_0xf238('0x11'),_0x1ff7c8,'request\x20sent');logger[_0xf238('0x12')](_0xf238('0x13'),_0x1ff7c8,'request\x20sent',JSON[_0xf238('0x14')](_0x21092d));if(_0x21092d[_0xf238('0x15')]){if(_0x21092d[_0xf238('0x15')][_0xf238('0x16')]===0x1f4){logger['error'](_0xf238('0x11'),_0x1ff7c8,_0x21092d[_0xf238('0x15')]['message']);return _0x4e1c21(_0x21092d[_0xf238('0x15')][_0xf238('0x17')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x1ff7c8,_0x21092d['error'][_0xf238('0x17')]);return _0x33a1b6(_0x21092d[_0xf238('0x15')][_0xf238('0x17')]);}else{logger[_0xf238('0x10')](_0xf238('0x11'),_0x1ff7c8,_0xf238('0x18'));_0x33a1b6(_0x21092d[_0xf238('0x19')][_0xf238('0x17')]);}})[_0xf238('0x1a')](function(_0x5413ed){logger[_0xf238('0x15')](_0xf238('0x11'),_0x1ff7c8,_0x5413ed);_0x4e1c21(_0x5413ed);});});}exports['CreateChatMessage']=function(_0x1020e8){var _0x52a48b=this;return new Promise(function(_0x27a7c9,_0x224992){return db[_0xf238('0x1b')]['create'](_0x1020e8[_0xf238('0x1c')],{'raw':_0x1020e8[_0xf238('0x1d')]?_0x1020e8[_0xf238('0x1d')][_0xf238('0x1e')]===undefined?!![]:![]:!![]})[_0xf238('0xf')](function(_0x64476e){logger[_0xf238('0x10')](_0xf238('0x1f'),_0x1020e8);logger[_0xf238('0x12')](_0xf238('0x1f'),_0x1020e8,JSON[_0xf238('0x14')](_0x64476e));_0x27a7c9(_0x64476e);})[_0xf238('0x1a')](function(_0x68a9bf){logger[_0xf238('0x15')](_0xf238('0x1f'),_0x68a9bf[_0xf238('0x17')],_0x1020e8);_0x224992(_0x52a48b[_0xf238('0x15')](0x1f4,_0x68a9bf[_0xf238('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 45f0944..01d0edd 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 _0x2e65=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x2300f2,_0x315c5f){var _0x6bd508=function(_0x2fa0f6){while(--_0x2fa0f6){_0x2300f2['push'](_0x2300f2['shift']());}};_0x6bd508(++_0x315c5f);}(_0x2e65,0x193));var _0x52e6=function(_0x1fdb40,_0x51351c){_0x1fdb40=_0x1fdb40-0x0;var _0x281f93=_0x2e65[_0x1fdb40];return _0x281f93;};'use strict';var ChatMessageEvents=require(_0x52e6('0x0'));var events=[_0x52e6('0x1'),_0x52e6('0x2'),_0x52e6('0x3')];function createListener(_0xd7e693,_0x23aa21){return function(_0x1ab739){_0x23aa21[_0x52e6('0x4')](_0xd7e693,_0x1ab739);};}function removeListener(_0x47912f,_0x383919){return function(){ChatMessageEvents[_0x52e6('0x5')](_0x47912f,_0x383919);};}exports[_0x52e6('0x6')]=function(_0xe67caa){for(var _0x1cf6d2=0x0,_0x116651=events[_0x52e6('0x7')];_0x1cf6d2<_0x116651;_0x1cf6d2++){var _0x1401a3=events[_0x1cf6d2];var _0x27f270=createListener(_0x52e6('0x8')+_0x1401a3,_0xe67caa);ChatMessageEvents['on'](_0x1401a3,_0x27f270);}};
\ No newline at end of file
+var _0x10af=['./chatMessage.events','remove','update','emit','register','length','chatMessage:'];(function(_0x39ded7,_0x42cb9d){var _0x529869=function(_0x1f03f6){while(--_0x1f03f6){_0x39ded7['push'](_0x39ded7['shift']());}};_0x529869(++_0x42cb9d);}(_0x10af,0xfc));var _0xf10a=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x10af[_0x243b59];return _0x3e1676;};'use strict';var ChatMessageEvents=require(_0xf10a('0x0'));var events=['save',_0xf10a('0x1'),_0xf10a('0x2')];function createListener(_0x1e42f5,_0x211890){return function(_0x453e1a){_0x211890[_0xf10a('0x3')](_0x1e42f5,_0x453e1a);};}function removeListener(_0xbffc71,_0x13b338){return function(){ChatMessageEvents['removeListener'](_0xbffc71,_0x13b338);};}exports[_0xf10a('0x4')]=function(_0xf86ea1){for(var _0x5c9a4c=0x0,_0x4cd7e4=events[_0xf10a('0x5')];_0x5c9a4c<_0x4cd7e4;_0x5c9a4c++){var _0x1563fb=events[_0x5c9a4c];var _0x2ade36=createListener(_0xf10a('0x6')+_0x1563fb,_0xf86ea1);ChatMessageEvents['on'](_0x1563fb,_0x2ade36);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 94236dd..a14ef20 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 _0x2d05=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','index','get','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x223c0d,_0x3ec04d){var _0x207827=function(_0x39d240){while(--_0x39d240){_0x223c0d['push'](_0x223c0d['shift']());}};_0x207827(++_0x3ec04d);}(_0x2d05,0x186));var _0x52d0=function(_0x4f4d5e,_0x3dcd7){_0x4f4d5e=_0x4f4d5e-0x0;var _0x21d7b9=_0x2d05[_0x4f4d5e];return _0x21d7b9;};'use strict';var multer=require(_0x52d0('0x0'));var util=require(_0x52d0('0x1'));var path=require(_0x52d0('0x2'));var timeout=require(_0x52d0('0x3'));var express=require('express');var router=express[_0x52d0('0x4')]();var fs_extra=require(_0x52d0('0x5'));var auth=require(_0x52d0('0x6'));var interaction=require(_0x52d0('0x7'));var config=require(_0x52d0('0x8'));var controller=require(_0x52d0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x52d0('0xa')]);router[_0x52d0('0xb')]('/describe',auth[_0x52d0('0xc')](),controller[_0x52d0('0xd')]);router[_0x52d0('0xb')](_0x52d0('0xe'),auth['isAuthenticated'](),controller[_0x52d0('0xf')]);router[_0x52d0('0x10')]('/',auth['isAuthenticated'](),interaction[_0x52d0('0x11')](_0x52d0('0x12'),_0x52d0('0x13')),controller[_0x52d0('0x14')]);router['put'](_0x52d0('0xe'),controller[_0x52d0('0x15')]);router[_0x52d0('0x16')](_0x52d0('0x17'),auth['isAuthenticated'](),controller[_0x52d0('0x18')]);router[_0x52d0('0x16')](_0x52d0('0x19'),auth['isAuthenticated'](),controller[_0x52d0('0x1a')]);router[_0x52d0('0x1b')]('/:id',auth[_0x52d0('0xc')](),controller[_0x52d0('0x1c')]);module[_0x52d0('0x1d')]=router;
\ No newline at end of file
+var _0xe934=['put','accept','/:id/reject','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','chatmessage:create','create'];(function(_0x55d8e9,_0x5eec54){var _0x287545=function(_0x56eab4){while(--_0x56eab4){_0x55d8e9['push'](_0x55d8e9['shift']());}};_0x287545(++_0x5eec54);}(_0xe934,0x1bc));var _0x4e93=function(_0x568ec8,_0x1e0f23){_0x568ec8=_0x568ec8-0x0;var _0x52b2be=_0xe934[_0x568ec8];return _0x52b2be;};'use strict';var multer=require('multer');var util=require(_0x4e93('0x0'));var path=require(_0x4e93('0x1'));var timeout=require('connect-timeout');var express=require(_0x4e93('0x2'));var router=express[_0x4e93('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4e93('0x4'));var interaction=require(_0x4e93('0x5'));var config=require(_0x4e93('0x6'));var controller=require(_0x4e93('0x7'));router[_0x4e93('0x8')]('/',auth[_0x4e93('0x9')](),controller[_0x4e93('0xa')]);router[_0x4e93('0x8')](_0x4e93('0xb'),auth[_0x4e93('0x9')](),controller[_0x4e93('0xc')]);router[_0x4e93('0x8')](_0x4e93('0xd'),auth[_0x4e93('0x9')](),controller[_0x4e93('0xe')]);router['post']('/',auth[_0x4e93('0x9')](),interaction[_0x4e93('0xf')]('chat',_0x4e93('0x10')),controller[_0x4e93('0x11')]);router[_0x4e93('0x12')]('/:id',controller['update']);router[_0x4e93('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x4e93('0x13')]);router['put'](_0x4e93('0x14'),auth[_0x4e93('0x9')](),controller['reject']);router['delete'](_0x4e93('0xd'),auth[_0x4e93('0x9')](),controller[_0x4e93('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 80d36aa..0e195db 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['medium','TEXT','exports'];(function(_0x260720,_0x473422){var _0x58cc96=function(_0x18b0b5){while(--_0x18b0b5){_0x260720['push'](_0x260720['shift']());}};_0x58cc96(++_0x473422);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x4a0ef2,_0x19d6c6){var _0x1e9023=function(_0x2de05d){while(--_0x2de05d){_0x4a0ef2['push'](_0x4a0ef2['shift']());}};_0x1e9023(++_0x19d6c6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5c6527,_0x34c61e){_0x5c6527=_0x5c6527-0x0;var _0x2c7d4e=_0x5f2f[_0x5c6527];return _0x2c7d4e;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index c96a84e..981da3a 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(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x7a54,0x106));var _0x47a5=function(_0x588e95,_0x5c225d){_0x588e95=_0x588e95-0x0;var _0x5327cd=_0x7a54[_0x588e95];return _0x5327cd;};'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 _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7a54,0x106));var _0x47a5=function(_0x18afda,_0x294660){_0x18afda=_0x18afda-0x0;var _0x48a103=_0x7a54[_0x18afda];return _0x48a103;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 95bff3e..5314c3f 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9719=['exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x2095ed,_0x156cfb){var _0x22dbb0=function(_0x385055){while(--_0x385055){_0x2095ed['push'](_0x2095ed['shift']());}};_0x22dbb0(++_0x156cfb);}(_0x9719,0x79));var _0x9971=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9719[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x9971('0x0'));var ChatOfflineMessage=require(_0x9971('0x1'))['db'][_0x9971('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9971('0x3')](0x0);var events={'afterCreate':_0x9971('0x4'),'afterUpdate':'update','afterDestroy':_0x9971('0x5')};function emitEvent(_0x3938e1){return function(_0x1f10e3,_0x4d4f79,_0x1eebc0){ChatOfflineMessageEvents[_0x9971('0x6')](_0x3938e1+':'+_0x1f10e3['id'],_0x1f10e3);ChatOfflineMessageEvents[_0x9971('0x6')](_0x3938e1,_0x1f10e3);_0x1eebc0(null);};}for(var e in events){if(events[_0x9971('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x9971('0x8')](e,emitEvent(event));}}module[_0x9971('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x4684=['exports','events','../../mysqldb','save','update','emit','hasOwnProperty','hook'];(function(_0x55380a,_0x536668){var _0x333037=function(_0x1ab290){while(--_0x1ab290){_0x55380a['push'](_0x55380a['shift']());}};_0x333037(++_0x536668);}(_0x4684,0xb9));var _0x4468=function(_0x431ae1,_0x385f06){_0x431ae1=_0x431ae1-0x0;var _0x27fcbd=_0x4684[_0x431ae1];return _0x27fcbd;};'use strict';var EventEmitter=require(_0x4468('0x0'));var ChatOfflineMessage=require(_0x4468('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4468('0x2'),'afterUpdate':_0x4468('0x3'),'afterDestroy':'remove'};function emitEvent(_0x578d72){return function(_0x44d366,_0x2cb512,_0x8aec49){ChatOfflineMessageEvents[_0x4468('0x4')](_0x578d72+':'+_0x44d366['id'],_0x44d366);ChatOfflineMessageEvents[_0x4468('0x4')](_0x578d72,_0x44d366);_0x8aec49(null);};}for(var e in events){if(events[_0x4468('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x4468('0x6')](e,emitEvent(event));}}module[_0x4468('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 753a2cd..6873257 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 _0xa2da=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','chat_offline_messages'];(function(_0x2d2bd3,_0x4318b4){var _0x166f63=function(_0x478faf){while(--_0x478faf){_0x2d2bd3['push'](_0x2d2bd3['shift']());}};_0x166f63(++_0x4318b4);}(_0xa2da,0xce));var _0xaa2d=function(_0x459a0a,_0x25c46f){_0x459a0a=_0x459a0a-0x0;var _0x4ab46c=_0xa2da[_0x459a0a];return _0x4ab46c;};'use strict';var attributes=require(_0xaa2d('0x0'));module[_0xaa2d('0x1')]=function(_0x1f0a8a){return _0x1f0a8a[_0xaa2d('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0xaa2d('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaa2d('0x4'),'collate':_0xaa2d('0x5')});};
\ No newline at end of file
+var _0x0a0c=['exports','define','ChatOfflineMessage','chat_offline_messages','./chatOfflineMessage.attributes'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x0a0c,0x16c));var _0xc0a0=function(_0x58c860,_0xf53229){_0x58c860=_0x58c860-0x0;var _0x1f5e64=_0x0a0c[_0x58c860];return _0x1f5e64;};'use strict';var attributes=require(_0xc0a0('0x0'));module[_0xc0a0('0x1')]=function(_0x1a0597){return _0x1a0597[_0xc0a0('0x2')](_0xc0a0('0x3'),attributes,{'tableName':_0xc0a0('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 9289524..ef708b9 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 _0x1258=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x38f63c,_0x12d79d){var _0x5e8503=function(_0x4c8c70){while(--_0x4c8c70){_0x38f63c['push'](_0x38f63c['shift']());}};_0x5e8503(++_0x12d79d);}(_0x1258,0x1ca));var _0x8125=function(_0x4c2330,_0x27e150){_0x4c2330=_0x4c2330-0x0;var _0x3b17fc=_0x1258[_0x4c2330];return _0x3b17fc;};'use strict';var _=require(_0x8125('0x0'));var util=require('util');var moment=require(_0x8125('0x1'));var BPromise=require(_0x8125('0x2'));var rs=require(_0x8125('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8125('0x4'))['db'];var utils=require(_0x8125('0x5'));var logger=require('../../config/logger')(_0x8125('0x6'));var config=require(_0x8125('0x7'));var jayson=require(_0x8125('0x8'));var client=jayson[_0x8125('0x9')][_0x8125('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c191b,_0x1619cc,_0x2db704){return new BPromise(function(_0x1743cb,_0x29a686){return client[_0x8125('0xb')](_0x3c191b,_0x2db704)['then'](function(_0x5a41ed){logger[_0x8125('0xc')](_0x8125('0xd'),_0x1619cc,_0x8125('0xe'));logger[_0x8125('0xf')](_0x8125('0x10'),_0x1619cc,_0x8125('0xe'),JSON[_0x8125('0x11')](_0x5a41ed));if(_0x5a41ed[_0x8125('0x12')]){if(_0x5a41ed['error'][_0x8125('0x13')]===0x1f4){logger[_0x8125('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1619cc,_0x5a41ed['error'][_0x8125('0x14')]);return _0x29a686(_0x5a41ed[_0x8125('0x12')][_0x8125('0x14')]);}logger[_0x8125('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1619cc,_0x5a41ed['error']['message']);return _0x1743cb(_0x5a41ed['error'][_0x8125('0x14')]);}else{logger[_0x8125('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1619cc,_0x8125('0xe'));_0x1743cb(_0x5a41ed[_0x8125('0x15')][_0x8125('0x14')]);}})[_0x8125('0x16')](function(_0x17aabf){logger[_0x8125('0x12')](_0x8125('0xd'),_0x1619cc,_0x17aabf);_0x29a686(_0x17aabf);});});}
\ No newline at end of file
+var _0xe68b=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x131488,_0x5b106e){var _0x519196=function(_0x4c9d22){while(--_0x4c9d22){_0x131488['push'](_0x131488['shift']());}};_0x519196(++_0x5b106e);}(_0xe68b,0x6d));var _0xbe68=function(_0x2e0efe,_0xde101b){_0x2e0efe=_0x2e0efe-0x0;var _0x119d9a=_0xe68b[_0x2e0efe];return _0x119d9a;};'use strict';var _=require(_0xbe68('0x0'));var util=require(_0xbe68('0x1'));var moment=require(_0xbe68('0x2'));var BPromise=require(_0xbe68('0x3'));var rs=require(_0xbe68('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe68('0x6'))(_0xbe68('0x7'));var config=require('../../config/environment');var jayson=require(_0xbe68('0x8'));var client=jayson[_0xbe68('0x9')][_0xbe68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x486b73,_0x40860b,_0x242c8f){return new BPromise(function(_0x4a6a09,_0x2c8100){return client[_0xbe68('0xb')](_0x486b73,_0x242c8f)[_0xbe68('0xc')](function(_0x4e903f){logger[_0xbe68('0xd')](_0xbe68('0xe'),_0x40860b,'request\x20sent');logger[_0xbe68('0xf')](_0xbe68('0x10'),_0x40860b,'request\x20sent',JSON['stringify'](_0x4e903f));if(_0x4e903f[_0xbe68('0x11')]){if(_0x4e903f[_0xbe68('0x11')][_0xbe68('0x12')]===0x1f4){logger[_0xbe68('0x11')](_0xbe68('0xe'),_0x40860b,_0x4e903f[_0xbe68('0x11')][_0xbe68('0x13')]);return _0x2c8100(_0x4e903f[_0xbe68('0x11')]['message']);}logger[_0xbe68('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x40860b,_0x4e903f[_0xbe68('0x11')][_0xbe68('0x13')]);return _0x4a6a09(_0x4e903f[_0xbe68('0x11')][_0xbe68('0x13')]);}else{logger[_0xbe68('0xd')](_0xbe68('0xe'),_0x40860b,'request\x20sent');_0x4a6a09(_0x4e903f[_0xbe68('0x14')]['message']);}})[_0xbe68('0x15')](function(_0x2792e1){logger[_0xbe68('0x11')](_0xbe68('0xe'),_0x40860b,_0x2792e1);_0x2c8100(_0x2792e1);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 6d1e1ba..1469e37 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 _0xb735=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id','post','create','put','delete','destroy','multer','util'];(function(_0x2347d5,_0x4a0895){var _0x5a878f=function(_0x58ae16){while(--_0x58ae16){_0x2347d5['push'](_0x2347d5['shift']());}};_0x5a878f(++_0x4a0895);}(_0xb735,0x130));var _0x5b73=function(_0x39cad6,_0x1edf41){_0x39cad6=_0x39cad6-0x0;var _0x5a82f2=_0xb735[_0x39cad6];return _0x5a82f2;};'use strict';var multer=require(_0x5b73('0x0'));var util=require(_0x5b73('0x1'));var path=require('path');var timeout=require(_0x5b73('0x2'));var express=require('express');var router=express[_0x5b73('0x3')]();var fs_extra=require(_0x5b73('0x4'));var auth=require(_0x5b73('0x5'));var interaction=require(_0x5b73('0x6'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x5b73('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5b73('0x7')](_0x5b73('0x8'),auth[_0x5b73('0x9')](),controller[_0x5b73('0xa')]);router['get'](_0x5b73('0xb'),auth[_0x5b73('0x9')](),controller['show']);router[_0x5b73('0xc')]('/',auth[_0x5b73('0x9')](),controller[_0x5b73('0xd')]);router[_0x5b73('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5b73('0xf')](_0x5b73('0xb'),auth[_0x5b73('0x9')](),controller[_0x5b73('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x3934=['util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','describe','/:id','isAuthenticated','post','create','update','delete','exports','multer'];(function(_0x5d3217,_0x137c0c){var _0x5ee3f8=function(_0x13a553){while(--_0x13a553){_0x5d3217['push'](_0x5d3217['shift']());}};_0x5ee3f8(++_0x137c0c);}(_0x3934,0x1af));var _0x4393=function(_0x263169,_0x5382fe){_0x263169=_0x263169-0x0;var _0x477ebe=_0x3934[_0x263169];return _0x477ebe;};'use strict';var multer=require(_0x4393('0x0'));var util=require(_0x4393('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4393('0x2'));var router=express[_0x4393('0x3')]();var fs_extra=require(_0x4393('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4393('0x5'));var config=require(_0x4393('0x6'));var controller=require(_0x4393('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4393('0x8')](_0x4393('0x9'),auth['isAuthenticated'](),controller[_0x4393('0xa')]);router[_0x4393('0x8')](_0x4393('0xb'),auth[_0x4393('0xc')](),controller['show']);router[_0x4393('0xd')]('/',auth[_0x4393('0xc')](),controller[_0x4393('0xe')]);router['put'](_0x4393('0xb'),auth[_0x4393('0xc')](),controller[_0x4393('0xf')]);router[_0x4393('0x10')]('/:id',auth[_0x4393('0xc')](),controller['destroy']);module[_0x4393('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index b88b225..c8336e5 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 _0xa036=['exports','mouseOver','timeout','STRING','INTEGER','sequelize'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xa036,0x11f));var _0x6a03=function(_0x36f27a,_0x572bf9){_0x36f27a=_0x36f27a-0x0;var _0x139ffa=_0xa036[_0x36f27a];return _0x139ffa;};'use strict';var Sequelize=require(_0x6a03('0x0'));module[_0x6a03('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6a03('0x2'),_0x6a03('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x6a03('0x4')]},'timeout':{'type':Sequelize[_0x6a03('0x5')]}};
\ No newline at end of file
+var _0x2375=['timeout','INTEGER','sequelize','STRING','ENUM','mouseOver'];(function(_0x5da27f,_0x504b76){var _0x54a3fb=function(_0x3b65a8){while(--_0x3b65a8){_0x5da27f['push'](_0x5da27f['shift']());}};_0x54a3fb(++_0x504b76);}(_0x2375,0xc2));var _0x5237=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x2375[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x5237('0x0'));module['exports']={'name':{'type':Sequelize[_0x5237('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5237('0x2')](_0x5237('0x3'),_0x5237('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x5237('0x1')]},'timeout':{'type':Sequelize[_0x5237('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 06dbc12..39e7b4d 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 _0xc4a1=['then','sendStatus','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','includeAll','include','merge','options','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy'];(function(_0x16e0f5,_0x4ec0f3){var _0x4839d5=function(_0x296b8f){while(--_0x296b8f){_0x16e0f5['push'](_0x16e0f5['shift']());}};_0x4839d5(++_0x4ec0f3);}(_0xc4a1,0x1ef));var _0x1c4a=function(_0x14d968,_0x2b3912){_0x14d968=_0x14d968-0x0;var _0x3c58c=_0xc4a1[_0x14d968];return _0x3c58c;};'use strict';var emlformat=require(_0x1c4a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1c4a('0x1'));var jsonpatch=require(_0x1c4a('0x2'));var rp=require(_0x1c4a('0x3'));var moment=require('moment');var BPromise=require(_0x1c4a('0x4'));var Mustache=require(_0x1c4a('0x5'));var util=require(_0x1c4a('0x6'));var path=require(_0x1c4a('0x7'));var sox=require(_0x1c4a('0x8'));var csv=require(_0x1c4a('0x9'));var ejs=require(_0x1c4a('0xa'));var fs=require('fs');var fs_extra=require(_0x1c4a('0xb'));var _=require(_0x1c4a('0xc'));var squel=require(_0x1c4a('0xd'));var crypto=require(_0x1c4a('0xe'));var jsforce=require(_0x1c4a('0xf'));var deskjs=require(_0x1c4a('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1c4a('0x11'));var Papa=require(_0x1c4a('0x12'));var Redis=require('ioredis');var authService=require(_0x1c4a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1c4a('0x14'));var logger=require(_0x1c4a('0x15'))('api');var utils=require(_0x1c4a('0x16'));var config=require(_0x1c4a('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3aa5f4,_0x30a115){_0x30a115=_0x30a115||0xcc;return function(_0x582ef1){if(_0x582ef1){return _0x3aa5f4['sendStatus'](_0x30a115);}return _0x3aa5f4[_0x1c4a('0x18')](_0x30a115)[_0x1c4a('0x19')]();};}function respondWithResult(_0x343ec9,_0xc3013d){_0xc3013d=_0xc3013d||0xc8;return function(_0x472344){if(_0x472344){return _0x343ec9[_0x1c4a('0x18')](_0xc3013d)[_0x1c4a('0x1a')](_0x472344);}};}function respondWithFilteredResult(_0xa6e823,_0x2867d4){return function(_0x22b2f6){if(_0x22b2f6){var _0x48c1af=typeof _0x2867d4[_0x1c4a('0x1b')]===_0x1c4a('0x1c')&&typeof _0x2867d4[_0x1c4a('0x1d')]===_0x1c4a('0x1c');var _0x4e7781=_0x22b2f6['count'];var _0x460dbb=_0x48c1af?0x0:_0x2867d4[_0x1c4a('0x1b')];var _0x1f59da=_0x48c1af?_0x22b2f6[_0x1c4a('0x1e')]:_0x2867d4['offset']+_0x2867d4[_0x1c4a('0x1d')];var _0x25252c;if(_0x1f59da>=_0x4e7781){_0x1f59da=_0x4e7781;_0x25252c=0xc8;}else{_0x25252c=0xce;}_0xa6e823['status'](_0x25252c);return _0xa6e823[_0x1c4a('0x1f')](_0x1c4a('0x20'),_0x460dbb+'-'+_0x1f59da+'/'+_0x4e7781)[_0x1c4a('0x1a')](_0x22b2f6);}return null;};}function patchUpdates(_0x5324a9){return function(_0x49a905){try{jsonpatch[_0x1c4a('0x21')](_0x49a905,_0x5324a9,!![]);}catch(_0x119a48){return BPromise['reject'](_0x119a48);}return _0x49a905['save']();};}function saveUpdates(_0x9843ce,_0x473ef3){return function(_0x70cc04){if(_0x70cc04){return _0x70cc04[_0x1c4a('0x22')](_0x9843ce)['then'](function(_0x31bf76){return _0x31bf76;});}return null;};}function removeEntity(_0x41d351,_0x3f8542){return function(_0x18f5b0){if(_0x18f5b0){return _0x18f5b0[_0x1c4a('0x23')]()[_0x1c4a('0x24')](function(){_0x41d351[_0x1c4a('0x18')](0xcc)[_0x1c4a('0x19')]();});}};}function handleEntityNotFound(_0x84fcaf,_0x1a5c34){return function(_0xd10444){if(!_0xd10444){_0x84fcaf[_0x1c4a('0x25')](0x194);}return _0xd10444;};}function handleError(_0x56dd0e,_0x2a3545){_0x2a3545=_0x2a3545||0x1f4;return function(_0x41ffbc){logger[_0x1c4a('0x26')](_0x41ffbc[_0x1c4a('0x27')]);if(_0x41ffbc[_0x1c4a('0x28')]){delete _0x41ffbc[_0x1c4a('0x28')];}_0x56dd0e[_0x1c4a('0x18')](_0x2a3545)[_0x1c4a('0x29')](_0x41ffbc);};}exports[_0x1c4a('0x2a')]=function(_0x3ef241,_0x45ecdb){var _0x9ab900={'raw':!![],'where':{'id':_0x3ef241[_0x1c4a('0x2b')]['id']}},_0x1ebeee={};_0x1ebeee[_0x1c4a('0x2c')]=_[_0x1c4a('0x2d')](db[_0x1c4a('0x2e')][_0x1c4a('0x2f')]);_0x1ebeee[_0x1c4a('0x30')]=_['keys'](_0x3ef241[_0x1c4a('0x30')]);_0x1ebeee['filters']=_[_0x1c4a('0x31')](_0x1ebeee[_0x1c4a('0x2c')],_0x1ebeee[_0x1c4a('0x30')]);_0x9ab900['attributes']=_[_0x1c4a('0x31')](_0x1ebeee['model'],qs[_0x1c4a('0x32')](_0x3ef241[_0x1c4a('0x30')][_0x1c4a('0x32')]));_0x9ab900[_0x1c4a('0x33')]=_0x9ab900[_0x1c4a('0x33')]['length']?_0x9ab900['attributes']:_0x1ebeee[_0x1c4a('0x2c')];if(_0x3ef241['query'][_0x1c4a('0x34')]){_0x9ab900[_0x1c4a('0x35')]=[{'all':!![]}];}_0x9ab900=_[_0x1c4a('0x36')]({},_0x9ab900,_0x3ef241[_0x1c4a('0x37')]);return db['ChatProactiveAction']['find'](_0x9ab900)[_0x1c4a('0x24')](handleEntityNotFound(_0x45ecdb,null))[_0x1c4a('0x24')](respondWithResult(_0x45ecdb,null))[_0x1c4a('0x38')](handleError(_0x45ecdb,null));};exports[_0x1c4a('0x39')]=function(_0x2640e0,_0x5d2da2){return db[_0x1c4a('0x2e')][_0x1c4a('0x39')](_0x2640e0['body'],{})[_0x1c4a('0x24')](respondWithResult(_0x5d2da2,0xc9))[_0x1c4a('0x38')](handleError(_0x5d2da2,null));};exports['update']=function(_0x54409c,_0x596f60){if(_0x54409c[_0x1c4a('0x3a')]['id']){delete _0x54409c[_0x1c4a('0x3a')]['id'];}return db[_0x1c4a('0x2e')]['find']({'where':{'id':_0x54409c[_0x1c4a('0x2b')]['id']}})[_0x1c4a('0x24')](handleEntityNotFound(_0x596f60,null))[_0x1c4a('0x24')](saveUpdates(_0x54409c[_0x1c4a('0x3a')],null))[_0x1c4a('0x24')](respondWithResult(_0x596f60,null))[_0x1c4a('0x38')](handleError(_0x596f60,null));};exports['destroy']=function(_0x4adcf0,_0x91c284){return db[_0x1c4a('0x2e')]['find']({'where':{'id':_0x4adcf0[_0x1c4a('0x2b')]['id']}})[_0x1c4a('0x24')](handleEntityNotFound(_0x91c284,null))[_0x1c4a('0x24')](removeEntity(_0x91c284,null))['catch'](handleError(_0x91c284,null));};
\ No newline at end of file
+var _0x0d64=['options','ChatProactiveAction','catch','create','body','update','find','params','destroy','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','then','error','stack','send','show','keys','query','intersection','model','attributes','fields','length','merge'];(function(_0x5126a7,_0x29026a){var _0x5bce5a=function(_0x41892c){while(--_0x41892c){_0x5126a7['push'](_0x5126a7['shift']());}};_0x5bce5a(++_0x29026a);}(_0x0d64,0x77));var _0x40d6=function(_0x2a9c27,_0x43433e){_0x2a9c27=_0x2a9c27-0x0;var _0x3f6be1=_0x0d64[_0x2a9c27];return _0x3f6be1;};'use strict';var emlformat=require(_0x40d6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x40d6('0x1'));var jsonpatch=require(_0x40d6('0x2'));var rp=require('request-promise');var moment=require(_0x40d6('0x3'));var BPromise=require(_0x40d6('0x4'));var Mustache=require('mustache');var util=require(_0x40d6('0x5'));var path=require(_0x40d6('0x6'));var sox=require(_0x40d6('0x7'));var csv=require(_0x40d6('0x8'));var ejs=require(_0x40d6('0x9'));var fs=require('fs');var fs_extra=require(_0x40d6('0xa'));var _=require(_0x40d6('0xb'));var squel=require(_0x40d6('0xc'));var crypto=require(_0x40d6('0xd'));var jsforce=require(_0x40d6('0xe'));var deskjs=require(_0x40d6('0xf'));var toCsv=require(_0x40d6('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x40d6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x40d6('0x11'));var as=require(_0x40d6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x40d6('0x13'))('api');var utils=require(_0x40d6('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a4067,_0x233ab5){_0x233ab5=_0x233ab5||0xcc;return function(_0x3dd4af){if(_0x3dd4af){return _0x1a4067[_0x40d6('0x15')](_0x233ab5);}return _0x1a4067['status'](_0x233ab5)[_0x40d6('0x16')]();};}function respondWithResult(_0x42537a,_0x44ae12){_0x44ae12=_0x44ae12||0xc8;return function(_0x18ccf7){if(_0x18ccf7){return _0x42537a['status'](_0x44ae12)[_0x40d6('0x17')](_0x18ccf7);}};}function respondWithFilteredResult(_0x29392b,_0x3eeab2){return function(_0x3db4c3){if(_0x3db4c3){var _0x300a26=typeof _0x3eeab2[_0x40d6('0x18')]===_0x40d6('0x19')&&typeof _0x3eeab2[_0x40d6('0x1a')]===_0x40d6('0x19');var _0x5866e9=_0x3db4c3[_0x40d6('0x1b')];var _0xbe088d=_0x300a26?0x0:_0x3eeab2['offset'];var _0x1118ee=_0x300a26?_0x3db4c3[_0x40d6('0x1b')]:_0x3eeab2[_0x40d6('0x18')]+_0x3eeab2[_0x40d6('0x1a')];var _0x41a0f3;if(_0x1118ee>=_0x5866e9){_0x1118ee=_0x5866e9;_0x41a0f3=0xc8;}else{_0x41a0f3=0xce;}_0x29392b[_0x40d6('0x1c')](_0x41a0f3);return _0x29392b['set'](_0x40d6('0x1d'),_0xbe088d+'-'+_0x1118ee+'/'+_0x5866e9)['json'](_0x3db4c3);}return null;};}function patchUpdates(_0x38ae04){return function(_0x39e53d){try{jsonpatch[_0x40d6('0x1e')](_0x39e53d,_0x38ae04,!![]);}catch(_0x2f8d02){return BPromise[_0x40d6('0x1f')](_0x2f8d02);}return _0x39e53d[_0x40d6('0x20')]();};}function saveUpdates(_0x48312b,_0x1f29b8){return function(_0x3dfbab){if(_0x3dfbab){return _0x3dfbab['update'](_0x48312b)['then'](function(_0x4fa4f2){return _0x4fa4f2;});}return null;};}function removeEntity(_0x45125d,_0x302def){return function(_0x3357ba){if(_0x3357ba){return _0x3357ba['destroy']()[_0x40d6('0x21')](function(){_0x45125d[_0x40d6('0x1c')](0xcc)[_0x40d6('0x16')]();});}};}function handleEntityNotFound(_0x2b7da1,_0x408265){return function(_0x5020eb){if(!_0x5020eb){_0x2b7da1[_0x40d6('0x15')](0x194);}return _0x5020eb;};}function handleError(_0x2ddc43,_0x298abd){_0x298abd=_0x298abd||0x1f4;return function(_0x127d40){logger[_0x40d6('0x22')](_0x127d40[_0x40d6('0x23')]);if(_0x127d40['name']){delete _0x127d40['name'];}_0x2ddc43[_0x40d6('0x1c')](_0x298abd)[_0x40d6('0x24')](_0x127d40);};}exports[_0x40d6('0x25')]=function(_0x33fcdd,_0x21fec7){var _0x8ff273={'raw':!![],'where':{'id':_0x33fcdd['params']['id']}},_0x11566a={};_0x11566a['model']=_[_0x40d6('0x26')](db['ChatProactiveAction']['rawAttributes']);_0x11566a[_0x40d6('0x27')]=_[_0x40d6('0x26')](_0x33fcdd['query']);_0x11566a['filters']=_[_0x40d6('0x28')](_0x11566a[_0x40d6('0x29')],_0x11566a[_0x40d6('0x27')]);_0x8ff273[_0x40d6('0x2a')]=_['intersection'](_0x11566a[_0x40d6('0x29')],qs[_0x40d6('0x2b')](_0x33fcdd[_0x40d6('0x27')][_0x40d6('0x2b')]));_0x8ff273['attributes']=_0x8ff273[_0x40d6('0x2a')][_0x40d6('0x2c')]?_0x8ff273[_0x40d6('0x2a')]:_0x11566a[_0x40d6('0x29')];if(_0x33fcdd[_0x40d6('0x27')]['includeAll']){_0x8ff273['include']=[{'all':!![]}];}_0x8ff273=_[_0x40d6('0x2d')]({},_0x8ff273,_0x33fcdd[_0x40d6('0x2e')]);return db[_0x40d6('0x2f')]['find'](_0x8ff273)[_0x40d6('0x21')](handleEntityNotFound(_0x21fec7,null))[_0x40d6('0x21')](respondWithResult(_0x21fec7,null))[_0x40d6('0x30')](handleError(_0x21fec7,null));};exports[_0x40d6('0x31')]=function(_0x433e70,_0x3966de){return db['ChatProactiveAction'][_0x40d6('0x31')](_0x433e70[_0x40d6('0x32')],{})[_0x40d6('0x21')](respondWithResult(_0x3966de,0xc9))[_0x40d6('0x30')](handleError(_0x3966de,null));};exports[_0x40d6('0x33')]=function(_0x16d0db,_0x534494){if(_0x16d0db[_0x40d6('0x32')]['id']){delete _0x16d0db[_0x40d6('0x32')]['id'];}return db[_0x40d6('0x2f')][_0x40d6('0x34')]({'where':{'id':_0x16d0db[_0x40d6('0x35')]['id']}})[_0x40d6('0x21')](handleEntityNotFound(_0x534494,null))[_0x40d6('0x21')](saveUpdates(_0x16d0db[_0x40d6('0x32')],null))[_0x40d6('0x21')](respondWithResult(_0x534494,null))[_0x40d6('0x30')](handleError(_0x534494,null));};exports[_0x40d6('0x36')]=function(_0x3afa26,_0x20a578){return db[_0x40d6('0x2f')]['find']({'where':{'id':_0x3afa26['params']['id']}})[_0x40d6('0x21')](handleEntityNotFound(_0x20a578,null))[_0x40d6('0x21')](removeEntity(_0x20a578,null))['catch'](handleError(_0x20a578,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 6b9e575..961c001 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 _0xe8bb=['api','moment','bluebird','../../config/environment','./chatProactiveAction.attributes','define','chat_proactive_actions','lodash','../../config/logger'];(function(_0x5af37f,_0x31be9c){var _0x39608f=function(_0x466950){while(--_0x466950){_0x5af37f['push'](_0x5af37f['shift']());}};_0x39608f(++_0x31be9c);}(_0xe8bb,0x1a5));var _0xbe8b=function(_0x5f3b9c,_0x416312){_0x5f3b9c=_0x5f3b9c-0x0;var _0x86064b=_0xe8bb[_0x5f3b9c];return _0x86064b;};'use strict';var _=require(_0xbe8b('0x0'));var util=require('util');var logger=require(_0xbe8b('0x1'))(_0xbe8b('0x2'));var moment=require(_0xbe8b('0x3'));var BPromise=require(_0xbe8b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbe8b('0x5'));var attributes=require(_0xbe8b('0x6'));module['exports']=function(_0x25b9ab,_0x4ff61f){return _0x25b9ab[_0xbe8b('0x7')]('ChatProactiveAction',attributes,{'tableName':_0xbe8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5eb9=['path','rimraf','./chatProactiveAction.attributes','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5eb9,0x1d9));var _0x95eb=function(_0x32a884,_0x183853){_0x32a884=_0x32a884-0x0;var _0x242f9b=_0x5eb9[_0x32a884];return _0x242f9b;};'use strict';var _=require(_0x95eb('0x0'));var util=require(_0x95eb('0x1'));var logger=require(_0x95eb('0x2'))(_0x95eb('0x3'));var moment=require(_0x95eb('0x4'));var BPromise=require(_0x95eb('0x5'));var rp=require(_0x95eb('0x6'));var fs=require('fs');var path=require(_0x95eb('0x7'));var rimraf=require(_0x95eb('0x8'));var config=require('../../config/environment');var attributes=require(_0x95eb('0x9'));module['exports']=function(_0xe94d0e,_0x35f9fd){return _0xe94d0e['define'](_0x95eb('0xa'),attributes,{'tableName':_0x95eb('0xb'),'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 1d78ab5..a7d8959 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 _0xceee=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x2c9a9d,_0x409e2c){var _0x3701b4=function(_0x4eabcc){while(--_0x4eabcc){_0x2c9a9d['push'](_0x2c9a9d['shift']());}};_0x3701b4(++_0x409e2c);}(_0xceee,0x187));var _0xecee=function(_0x5ba658,_0x50c8d4){_0x5ba658=_0x5ba658-0x0;var _0x1a8b7c=_0xceee[_0x5ba658];return _0x1a8b7c;};'use strict';var _=require(_0xecee('0x0'));var util=require('util');var moment=require(_0xecee('0x1'));var BPromise=require('bluebird');var rs=require(_0xecee('0x2'));var fs=require('fs');var Redis=require(_0xecee('0x3'));var db=require(_0xecee('0x4'))['db'];var utils=require(_0xecee('0x5'));var logger=require(_0xecee('0x6'))(_0xecee('0x7'));var config=require(_0xecee('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xecee('0x9')][_0xecee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bde25,_0x38518f,_0x12ad63){return new BPromise(function(_0x5c3cac,_0x4bee46){return client[_0xecee('0xb')](_0x1bde25,_0x12ad63)[_0xecee('0xc')](function(_0x3f538c){logger['info'](_0xecee('0xd'),_0x38518f,_0xecee('0xe'));logger[_0xecee('0xf')](_0xecee('0x10'),_0x38518f,_0xecee('0xe'),JSON['stringify'](_0x3f538c));if(_0x3f538c[_0xecee('0x11')]){if(_0x3f538c[_0xecee('0x11')][_0xecee('0x12')]===0x1f4){logger[_0xecee('0x11')](_0xecee('0xd'),_0x38518f,_0x3f538c[_0xecee('0x11')][_0xecee('0x13')]);return _0x4bee46(_0x3f538c[_0xecee('0x11')]['message']);}logger[_0xecee('0x11')](_0xecee('0xd'),_0x38518f,_0x3f538c[_0xecee('0x11')][_0xecee('0x13')]);return _0x5c3cac(_0x3f538c['error'][_0xecee('0x13')]);}else{logger[_0xecee('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x38518f,_0xecee('0xe'));_0x5c3cac(_0x3f538c[_0xecee('0x15')][_0xecee('0x13')]);}})[_0xecee('0x16')](function(_0x28964f){logger[_0xecee('0x11')](_0xecee('0xd'),_0x38518f,_0x28964f);_0x4bee46(_0x28964f);});});}
\ No newline at end of file
+var _0x10a9=['ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','lodash','util','moment','bluebird','randomstring'];(function(_0xff4297,_0x24cd88){var _0x19b089=function(_0x16a080){while(--_0x16a080){_0xff4297['push'](_0xff4297['shift']());}};_0x19b089(++_0x24cd88);}(_0x10a9,0x18a));var _0x910a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x10a9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x910a('0x0'));var util=require(_0x910a('0x1'));var moment=require(_0x910a('0x2'));var BPromise=require(_0x910a('0x3'));var rs=require(_0x910a('0x4'));var fs=require('fs');var Redis=require(_0x910a('0x5'));var db=require(_0x910a('0x6'))['db'];var utils=require(_0x910a('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x910a('0x8'));var client=jayson[_0x910a('0x9')][_0x910a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48af21,_0x4f35d7,_0x3297c9){return new BPromise(function(_0x26885d,_0x4fdd33){return client[_0x910a('0xb')](_0x48af21,_0x3297c9)[_0x910a('0xc')](function(_0x4d4f05){logger['info'](_0x910a('0xd'),_0x4f35d7,'request\x20sent');logger['debug'](_0x910a('0xe'),_0x4f35d7,'request\x20sent',JSON[_0x910a('0xf')](_0x4d4f05));if(_0x4d4f05[_0x910a('0x10')]){if(_0x4d4f05[_0x910a('0x10')][_0x910a('0x11')]===0x1f4){logger[_0x910a('0x10')](_0x910a('0xd'),_0x4f35d7,_0x4d4f05[_0x910a('0x10')]['message']);return _0x4fdd33(_0x4d4f05[_0x910a('0x10')][_0x910a('0x12')]);}logger['error'](_0x910a('0xd'),_0x4f35d7,_0x4d4f05[_0x910a('0x10')][_0x910a('0x12')]);return _0x26885d(_0x4d4f05[_0x910a('0x10')][_0x910a('0x12')]);}else{logger[_0x910a('0x13')](_0x910a('0xd'),_0x4f35d7,_0x910a('0x14'));_0x26885d(_0x4d4f05['result'][_0x910a('0x12')]);}})['catch'](function(_0x28e136){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4f35d7,_0x28e136);_0x4fdd33(_0x28e136);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 3e40e11..f230426 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 _0x038b=['isAuthenticated','/:id','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','show','post'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x038b,0x114));var _0xb038=function(_0x16625b,_0x50f090){_0x16625b=_0x16625b-0x0;var _0x572b54=_0x038b[_0x16625b];return _0x572b54;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb038('0x4'));var interaction=require(_0xb038('0x5'));var config=require('../../config/environment');var controller=require(_0xb038('0x6'));router[_0xb038('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xb038('0x8')]);router[_0xb038('0x9')]('/',auth[_0xb038('0xa')](),controller['create']);router['put'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['update']);router['delete'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['destroy']);module[_0xb038('0xc')]=router;
\ No newline at end of file
+var _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x2eb2,0x19f));var _0x22eb=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2eb2[_0x397e5f];return _0x5302b8;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index c67b09a..e79b4aa 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 _0x2664=['STRING','name','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x22ad52,_0x36cecb){var _0x4f71e0=function(_0x539691){while(--_0x539691){_0x22ad52['push'](_0x22ad52['shift']());}};_0x4f71e0(++_0x36cecb);}(_0x2664,0x1ce));var _0x4266=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2664[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x4266('0x0'));module[_0x4266('0x1')]={'name':{'type':Sequelize[_0x4266('0x2')],'unique':_0x4266('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4266('0x2')]},'timeout':{'type':Sequelize[_0x4266('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x4266('0x5'),_0x4266('0x6'),_0x4266('0x7'))}};
\ No newline at end of file
+var _0x5fe6=['STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x6125d8,_0x2db9b4){var _0x1274a3=function(_0x48d1a1){while(--_0x48d1a1){_0x6125d8['push'](_0x6125d8['shift']());}};_0x1274a3(++_0x2db9b4);}(_0x5fe6,0xd7));var _0x65fe=function(_0x17ab75,_0x55bb93){_0x17ab75=_0x17ab75-0x0;var _0x366116=_0x5fe6[_0x17ab75];return _0x366116;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x65fe('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x65fe('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x65fe('0x1')](_0x65fe('0x2'),_0x65fe('0x3'),_0x65fe('0x4'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 76dcbb0..0e4548a 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 _0x0ef3=['QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','userChatQueue:save','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','ChatQueues','UserProfileResource','destroy','stack','name','send','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','map','merge','options','ChatQueue','include','findAll','rows','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserChatQueue','hasOwnProperty','order','ChatQueueId','User','findAndCountAll','agent','chatPause','format','%s/%s','createdAt','updatedAt','getTeams','findOne','Team','addTeams','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','select','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString'];(function(_0x3c5a06,_0x355fa7){var _0x18c88e=function(_0x30f09c){while(--_0x30f09c){_0x3c5a06['push'](_0x3c5a06['shift']());}};_0x18c88e(++_0x355fa7);}(_0x0ef3,0x1e8));var _0x30ef=function(_0x3303c0,_0x1eaa43){_0x3303c0=_0x3303c0-0x0;var _0x454848=_0x0ef3[_0x3303c0];return _0x454848;};'use strict';var emlformat=require(_0x30ef('0x0'));var rimraf=require(_0x30ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x30ef('0x2'));var rp=require(_0x30ef('0x3'));var moment=require(_0x30ef('0x4'));var BPromise=require(_0x30ef('0x5'));var Mustache=require(_0x30ef('0x6'));var util=require(_0x30ef('0x7'));var path=require(_0x30ef('0x8'));var sox=require(_0x30ef('0x9'));var csv=require('to-csv');var ejs=require(_0x30ef('0xa'));var fs=require('fs');var fs_extra=require(_0x30ef('0xb'));var _=require(_0x30ef('0xc'));var squel=require(_0x30ef('0xd'));var crypto=require(_0x30ef('0xe'));var jsforce=require(_0x30ef('0xf'));var deskjs=require(_0x30ef('0x10'));var toCsv=require(_0x30ef('0x11'));var querystring=require(_0x30ef('0x12'));var Papa=require(_0x30ef('0x13'));var Redis=require(_0x30ef('0x14'));var authService=require(_0x30ef('0x15'));var qs=require(_0x30ef('0x16'));var as=require(_0x30ef('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x30ef('0x18'))(_0x30ef('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x30ef('0x1a'));var db=require(_0x30ef('0x1b'))['db'];config[_0x30ef('0x1c')]=_[_0x30ef('0x1d')](config[_0x30ef('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x30ef('0x1e'))(new Redis(config[_0x30ef('0x1c')]));require('./chatQueue.socket')[_0x30ef('0x1f')](socket);var jayson=require(_0x30ef('0x20'));var client=jayson[_0x30ef('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bdae3,_0x5b4c77,_0x2a6c6e,_0x18326c){return new BPromise(function(_0xfc0bc0,_0x101cb7){var _0x237ecc=_0x18326c||client;return _0x237ecc[_0x30ef('0x22')](_0x2bdae3,_0x2a6c6e)[_0x30ef('0x23')](function(_0x21862f){logger[_0x30ef('0x24')]('ChatQueue,\x20%s,\x20%s',_0x5b4c77,_0x30ef('0x25'));logger[_0x30ef('0x26')](_0x30ef('0x27'),_0x5b4c77,_0x30ef('0x25'),JSON[_0x30ef('0x28')](_0x21862f));if(_0x21862f[_0x30ef('0x29')]){if(_0x21862f[_0x30ef('0x29')][_0x30ef('0x2a')]===0x1f4){logger[_0x30ef('0x29')](_0x30ef('0x2b'),_0x5b4c77,_0x21862f[_0x30ef('0x29')]['message']);return _0x101cb7(_0x21862f[_0x30ef('0x29')][_0x30ef('0x2c')]);}logger['error'](_0x30ef('0x2b'),_0x5b4c77,_0x21862f['error'][_0x30ef('0x2c')]);return _0xfc0bc0(_0x21862f[_0x30ef('0x29')]['message']);}else{logger[_0x30ef('0x24')](_0x30ef('0x2b'),_0x5b4c77,_0x30ef('0x25'));_0xfc0bc0(_0x21862f[_0x30ef('0x2d')][_0x30ef('0x2c')]);}})['catch'](function(_0x5e56bc){logger[_0x30ef('0x29')](_0x30ef('0x2b'),_0x5b4c77,_0x5e56bc);_0x101cb7(_0x5e56bc);});});}function respondWithStatusCode(_0x49b526,_0x54deb3){_0x54deb3=_0x54deb3||0xcc;return function(_0x4f657d){if(_0x4f657d){return _0x49b526[_0x30ef('0x2e')](_0x54deb3);}return _0x49b526['status'](_0x54deb3)[_0x30ef('0x2f')]();};}function respondWithResult(_0x5dee10,_0x1df303){_0x1df303=_0x1df303||0xc8;return function(_0x26729e){if(_0x26729e){return _0x5dee10[_0x30ef('0x30')](_0x1df303)[_0x30ef('0x31')](_0x26729e);}};}function respondWithFilteredResult(_0xdbe8d4,_0x182ffc){return function(_0x253384){if(_0x253384){var _0x5a7701=typeof _0x182ffc[_0x30ef('0x32')]===_0x30ef('0x33')&&typeof _0x182ffc[_0x30ef('0x34')]===_0x30ef('0x33');var _0xc7dbb8=_0x253384['count'];var _0x2e56ab=_0x5a7701?0x0:_0x182ffc[_0x30ef('0x32')];var _0x319ddd=_0x5a7701?_0x253384[_0x30ef('0x35')]:_0x182ffc['offset']+_0x182ffc[_0x30ef('0x34')];var _0xec23de;if(_0x319ddd>=_0xc7dbb8){_0x319ddd=_0xc7dbb8;_0xec23de=0xc8;}else{_0xec23de=0xce;}_0xdbe8d4[_0x30ef('0x30')](_0xec23de);return _0xdbe8d4[_0x30ef('0x36')](_0x30ef('0x37'),_0x2e56ab+'-'+_0x319ddd+'/'+_0xc7dbb8)['json'](_0x253384);}return null;};}function patchUpdates(_0x52637f){return function(_0x40719d){try{jsonpatch[_0x30ef('0x38')](_0x40719d,_0x52637f,!![]);}catch(_0x43de27){return BPromise[_0x30ef('0x39')](_0x43de27);}return _0x40719d[_0x30ef('0x3a')]();};}function saveUpdates(_0x5819d9,_0x3a2a45){return function(_0x2c2df9){if(_0x2c2df9){return _0x2c2df9[_0x30ef('0x3b')](_0x5819d9)[_0x30ef('0x23')](function(_0xeb61a8){return _0xeb61a8;});}return null;};}function removeEntity(_0x264b68,_0x3ae774){return function(_0x31f288){if(_0x31f288){return _0x31f288['destroy']()['then'](function(){var _0x431a78=_0x31f288[_0x30ef('0x3c')]({'plain':!![]});var _0x5de575=_0x30ef('0x3d');return db[_0x30ef('0x3e')][_0x30ef('0x3f')]({'where':{'type':_0x5de575,'resourceId':_0x431a78['id']}})[_0x30ef('0x23')](function(){return _0x31f288;});})[_0x30ef('0x23')](function(){_0x264b68[_0x30ef('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fa5b6,_0x2af474){return function(_0x30572a){if(!_0x30572a){_0x1fa5b6[_0x30ef('0x2e')](0x194);}return _0x30572a;};}function handleError(_0x57345d,_0x3c01fb){_0x3c01fb=_0x3c01fb||0x1f4;return function(_0x5c638f){logger['error'](_0x5c638f[_0x30ef('0x40')]);if(_0x5c638f[_0x30ef('0x41')]){delete _0x5c638f[_0x30ef('0x41')];}_0x57345d[_0x30ef('0x30')](_0x3c01fb)[_0x30ef('0x42')](_0x5c638f);};}exports['index']=function(_0xfb3fbe,_0x388507){var _0x376740={},_0x50d031={},_0x5ecedd={'count':0x0,'rows':[]};var _0x566a81=_['map'](db['ChatQueue'][_0x30ef('0x43')],function(_0x5da016){return{'name':_0x5da016[_0x30ef('0x44')],'type':_0x5da016[_0x30ef('0x45')][_0x30ef('0x46')]};});_0x50d031[_0x30ef('0x47')]=_['map'](_0x566a81,_0x30ef('0x41'));_0x50d031['query']=_[_0x30ef('0x48')](_0xfb3fbe[_0x30ef('0x49')]);_0x50d031[_0x30ef('0x4a')]=_[_0x30ef('0x4b')](_0x50d031[_0x30ef('0x47')],_0x50d031[_0x30ef('0x49')]);_0x376740[_0x30ef('0x4c')]=_[_0x30ef('0x4b')](_0x50d031[_0x30ef('0x47')],qs['fields'](_0xfb3fbe[_0x30ef('0x49')][_0x30ef('0x4d')]));_0x376740[_0x30ef('0x4c')]=_0x376740[_0x30ef('0x4c')][_0x30ef('0x4e')]?_0x376740[_0x30ef('0x4c')]:_0x50d031['model'];if(!_0xfb3fbe['query']['hasOwnProperty'](_0x30ef('0x4f'))){_0x376740[_0x30ef('0x34')]=qs['limit'](_0xfb3fbe[_0x30ef('0x49')][_0x30ef('0x34')]);_0x376740[_0x30ef('0x32')]=qs[_0x30ef('0x32')](_0xfb3fbe[_0x30ef('0x49')]['offset']);}_0x376740['order']=qs['sort'](_0xfb3fbe['query'][_0x30ef('0x50')]);_0x376740[_0x30ef('0x51')]=qs[_0x30ef('0x4a')](_[_0x30ef('0x52')](_0xfb3fbe[_0x30ef('0x49')],_0x50d031['filters']),_0x566a81);if(_0xfb3fbe[_0x30ef('0x49')][_0x30ef('0x53')]){_0x376740[_0x30ef('0x51')]=_['merge'](_0x376740[_0x30ef('0x51')],{'$or':_[_0x30ef('0x54')](_0x566a81,function(_0x5bbe55){if(_0x5bbe55[_0x30ef('0x45')]!=='VIRTUAL'){var _0x427cb3={};_0x427cb3[_0x5bbe55['name']]={'$like':'%'+_0xfb3fbe[_0x30ef('0x49')][_0x30ef('0x53')]+'%'};return _0x427cb3;}})});}_0x376740=_[_0x30ef('0x55')]({},_0x376740,_0xfb3fbe[_0x30ef('0x56')]);var _0x2693b5={'where':_0x376740[_0x30ef('0x51')]};return db[_0x30ef('0x57')]['count'](_0x2693b5)[_0x30ef('0x23')](function(_0x35d5d2){_0x5ecedd[_0x30ef('0x35')]=_0x35d5d2;if(_0xfb3fbe['query']['includeAll']){_0x376740[_0x30ef('0x58')]=[{'all':!![]}];}return db[_0x30ef('0x57')][_0x30ef('0x59')](_0x376740);})['then'](function(_0x464d7f){_0x5ecedd[_0x30ef('0x5a')]=_0x464d7f;return _0x5ecedd;})[_0x30ef('0x23')](respondWithFilteredResult(_0x388507,_0x376740))['catch'](handleError(_0x388507,null));};exports['show']=function(_0x45baec,_0x57f3b0){var _0x5323a8={'raw':!![],'where':{'id':_0x45baec[_0x30ef('0x5b')]['id']}},_0x3fcb85={};_0x3fcb85['model']=_['keys'](db['ChatQueue'][_0x30ef('0x43')]);_0x3fcb85[_0x30ef('0x49')]=_['keys'](_0x45baec[_0x30ef('0x49')]);_0x3fcb85[_0x30ef('0x4a')]=_[_0x30ef('0x4b')](_0x3fcb85[_0x30ef('0x47')],_0x3fcb85[_0x30ef('0x49')]);_0x5323a8['attributes']=_['intersection'](_0x3fcb85[_0x30ef('0x47')],qs['fields'](_0x45baec[_0x30ef('0x49')][_0x30ef('0x4d')]));_0x5323a8[_0x30ef('0x4c')]=_0x5323a8[_0x30ef('0x4c')][_0x30ef('0x4e')]?_0x5323a8[_0x30ef('0x4c')]:_0x3fcb85['model'];if(_0x45baec[_0x30ef('0x49')][_0x30ef('0x5c')]){_0x5323a8['include']=[{'all':!![]}];}_0x5323a8=_[_0x30ef('0x55')]({},_0x5323a8,_0x45baec['options']);return db['ChatQueue'][_0x30ef('0x5d')](_0x5323a8)['then'](handleEntityNotFound(_0x57f3b0,null))[_0x30ef('0x23')](respondWithResult(_0x57f3b0,null))['catch'](handleError(_0x57f3b0,null));};exports[_0x30ef('0x5e')]=function(_0x8b0bd3,_0x3bd445){return db[_0x30ef('0x57')]['create'](_0x8b0bd3[_0x30ef('0x5f')],{})[_0x30ef('0x23')](function(_0x27592e){var _0x14ce8b=_0x8b0bd3['user']['get']({'plain':!![]});if(!_0x14ce8b)throw new Error(_0x30ef('0x60'));if(_0x14ce8b['role']==='user'){var _0x2cbc2f=_0x27592e['get']({'plain':!![]});var _0x547d7b='ChatQueues';return db['UserProfileSection']['find']({'where':{'name':_0x547d7b,'userProfileId':_0x14ce8b[_0x30ef('0x61')]},'raw':!![]})[_0x30ef('0x23')](function(_0x12883b){if(_0x12883b&&_0x12883b[_0x30ef('0x62')]===0x0){return db[_0x30ef('0x3e')][_0x30ef('0x5e')]({'name':_0x2cbc2f[_0x30ef('0x41')],'resourceId':_0x2cbc2f['id'],'type':_0x12883b[_0x30ef('0x41')],'sectionId':_0x12883b['id']},{})[_0x30ef('0x23')](function(){return _0x27592e;});}else{return _0x27592e;}})[_0x30ef('0x63')](function(_0x2b5b29){logger['error'](_0x30ef('0x64'),_0x2b5b29);throw _0x2b5b29;});}return _0x27592e;})['then'](respondWithResult(_0x3bd445,0xc9))[_0x30ef('0x63')](handleError(_0x3bd445,null));};exports['update']=function(_0x5d2b2a,_0x30f615){if(_0x5d2b2a[_0x30ef('0x5f')]['id']){delete _0x5d2b2a[_0x30ef('0x5f')]['id'];}return db['ChatQueue'][_0x30ef('0x5d')]({'where':{'id':_0x5d2b2a[_0x30ef('0x5b')]['id']}})[_0x30ef('0x23')](handleEntityNotFound(_0x30f615,null))[_0x30ef('0x23')](saveUpdates(_0x5d2b2a['body'],null))[_0x30ef('0x23')](respondWithResult(_0x30f615,null))['catch'](handleError(_0x30f615,null));};exports[_0x30ef('0x3f')]=function(_0x27163b,_0x648731){return db[_0x30ef('0x57')][_0x30ef('0x5d')]({'where':{'id':_0x27163b[_0x30ef('0x5b')]['id']}})[_0x30ef('0x23')](handleEntityNotFound(_0x648731,null))['then'](removeEntity(_0x648731,null))[_0x30ef('0x63')](handleError(_0x648731,null));};exports[_0x30ef('0x65')]=function(_0x4d20ec,_0x17891e){return db['ChatQueue'][_0x30ef('0x65')]()['then'](respondWithResult(_0x17891e,null))[_0x30ef('0x63')](handleError(_0x17891e,null));};exports['getMembers']=function(_0x3ca9c2,_0x45f1bb,_0x19f367){var _0x2e18fa={'raw':!![],'where':{}},_0x6534dc={},_0x3efd2c;return db[_0x30ef('0x57')]['findOne']({'where':{'id':_0x3ca9c2[_0x30ef('0x5b')]['id']}})[_0x30ef('0x23')](handleEntityNotFound(_0x45f1bb,null))[_0x30ef('0x23')](function(_0x255f3c){if(_0x255f3c){_0x3efd2c=_0x255f3c[_0x30ef('0x3c')]({'plain':!![]});_0x6534dc[_0x30ef('0x47')]=_[_0x30ef('0x48')](db[_0x30ef('0x66')][_0x30ef('0x43')]);_0x6534dc[_0x30ef('0x49')]=_['keys'](_0x3ca9c2[_0x30ef('0x49')]);_0x6534dc[_0x30ef('0x4a')]=_[_0x30ef('0x4b')](_0x6534dc['model'],_0x6534dc[_0x30ef('0x49')]);_0x2e18fa[_0x30ef('0x4c')]=_['intersection'](_0x6534dc[_0x30ef('0x47')],qs['fields'](_0x3ca9c2[_0x30ef('0x49')][_0x30ef('0x4d')]));_0x2e18fa[_0x30ef('0x4c')]=_0x2e18fa[_0x30ef('0x4c')]['length']?_0x2e18fa[_0x30ef('0x4c')]:_0x6534dc['model'];if(!_0x3ca9c2[_0x30ef('0x49')][_0x30ef('0x67')](_0x30ef('0x4f'))){_0x2e18fa['limit']=qs[_0x30ef('0x34')](_0x3ca9c2[_0x30ef('0x49')]['limit']);_0x2e18fa[_0x30ef('0x32')]=qs[_0x30ef('0x32')](_0x3ca9c2[_0x30ef('0x49')][_0x30ef('0x32')]);}_0x2e18fa[_0x30ef('0x68')]=qs['sort'](_0x3ca9c2['query'][_0x30ef('0x50')]);_0x2e18fa['where']=qs[_0x30ef('0x4a')](_[_0x30ef('0x52')](_0x3ca9c2[_0x30ef('0x49')],_0x6534dc[_0x30ef('0x4a')]));_0x2e18fa[_0x30ef('0x51')][_0x30ef('0x69')]=_0x255f3c['id'];if(_0x3ca9c2[_0x30ef('0x49')][_0x30ef('0x53')]){_0x2e18fa['where']=_[_0x30ef('0x55')](_0x2e18fa[_0x30ef('0x51')],{'$or':_[_0x30ef('0x54')](_0x2e18fa[_0x30ef('0x4c')],function(_0x25295a){var _0xabb99b={};_0xabb99b[_0x25295a]={'$like':'%'+_0x3ca9c2[_0x30ef('0x49')][_0x30ef('0x53')]+'%'};return _0xabb99b;})});}_0x2e18fa=_[_0x30ef('0x55')]({},_0x2e18fa,_0x3ca9c2['options']);return db[_0x30ef('0x66')][_0x30ef('0x59')](_0x2e18fa);}})[_0x30ef('0x23')](function(_0x419d9f){if(_0x419d9f){return db[_0x30ef('0x6a')][_0x30ef('0x6b')]({'where':{'id':_[_0x30ef('0x54')](_0x419d9f,'UserId'),'role':_0x30ef('0x6c')},'attributes':['id',_0x30ef('0x41'),_0x30ef('0x6d'),'updatedAt','createdAt']});}})[_0x30ef('0x23')](function(_0x3ecc7f){if(_0x3ecc7f){return{'count':_0x3ecc7f['count'],'rows':_['map'](_0x3ecc7f['rows'],function(_0x58dc47){return{'membername':_0x58dc47[_0x30ef('0x41')],'UserId':_0x58dc47['id'],'queue_name':_0x3efd2c['name'],'ChatQueueId':_0x3efd2c['id'],'interface':util[_0x30ef('0x6e')](_0x30ef('0x6f'),'SIP',_0x58dc47[_0x30ef('0x41')]),'penalty':0x0,'paused':_0x58dc47[_0x30ef('0x6d')],'createdAt':_0x58dc47[_0x30ef('0x70')],'updatedAt':_0x58dc47[_0x30ef('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x30ef('0x23')](respondWithFilteredResult(_0x45f1bb,_0x2e18fa))[_0x30ef('0x63')](handleError(_0x45f1bb,null));};exports[_0x30ef('0x72')]=function(_0x14bdf6,_0x4a2a7b,_0x4cbcd7){var _0x1b1385={};var _0x3c5dda={};var _0x5147f9;var _0x356eb5;return db[_0x30ef('0x57')][_0x30ef('0x73')]({'where':{'id':_0x14bdf6[_0x30ef('0x5b')]['id']}})[_0x30ef('0x23')](handleEntityNotFound(_0x4a2a7b,null))['then'](function(_0x4de621){if(_0x4de621){_0x5147f9=_0x4de621;_0x3c5dda[_0x30ef('0x47')]=_[_0x30ef('0x48')](db[_0x30ef('0x74')]['rawAttributes']);_0x3c5dda[_0x30ef('0x49')]=_[_0x30ef('0x48')](_0x14bdf6[_0x30ef('0x49')]);_0x3c5dda[_0x30ef('0x4a')]=_[_0x30ef('0x4b')](_0x3c5dda[_0x30ef('0x47')],_0x3c5dda['query']);_0x1b1385[_0x30ef('0x4c')]=_[_0x30ef('0x4b')](_0x3c5dda[_0x30ef('0x47')],qs[_0x30ef('0x4d')](_0x14bdf6[_0x30ef('0x49')][_0x30ef('0x4d')]));_0x1b1385[_0x30ef('0x4c')]=_0x1b1385[_0x30ef('0x4c')][_0x30ef('0x4e')]?_0x1b1385[_0x30ef('0x4c')]:_0x3c5dda[_0x30ef('0x47')];_0x1b1385[_0x30ef('0x68')]=qs[_0x30ef('0x50')](_0x14bdf6[_0x30ef('0x49')][_0x30ef('0x50')]);_0x1b1385[_0x30ef('0x51')]=qs[_0x30ef('0x4a')](_[_0x30ef('0x52')](_0x14bdf6['query'],_0x3c5dda[_0x30ef('0x4a')]));if(_0x14bdf6[_0x30ef('0x49')][_0x30ef('0x53')]){_0x1b1385[_0x30ef('0x51')]=_[_0x30ef('0x55')](_0x1b1385[_0x30ef('0x51')],{'$or':_[_0x30ef('0x54')](_0x1b1385[_0x30ef('0x4c')],function(_0xb9a8c9){var _0x28d21a={};_0x28d21a[_0xb9a8c9]={'$like':'%'+_0x14bdf6['query'][_0x30ef('0x53')]+'%'};return _0x28d21a;})});}_0x1b1385=_[_0x30ef('0x55')]({},_0x1b1385,_0x14bdf6['options']);return _0x5147f9[_0x30ef('0x72')](_0x1b1385);}})[_0x30ef('0x23')](function(_0x391bfa){if(_0x391bfa){_0x356eb5=_0x391bfa['length'];if(!_0x14bdf6['query']['hasOwnProperty']('nolimit')){_0x1b1385[_0x30ef('0x34')]=qs[_0x30ef('0x34')](_0x14bdf6[_0x30ef('0x49')][_0x30ef('0x34')]);_0x1b1385[_0x30ef('0x32')]=qs[_0x30ef('0x32')](_0x14bdf6['query'][_0x30ef('0x32')]);}return _0x5147f9[_0x30ef('0x72')](_0x1b1385);}})[_0x30ef('0x23')](function(_0x2d2405){if(_0x2d2405){return _0x2d2405?{'count':_0x356eb5,'rows':_0x2d2405}:null;}})['then'](respondWithResult(_0x4a2a7b,null))[_0x30ef('0x63')](handleError(_0x4a2a7b,null));};exports[_0x30ef('0x75')]=function(_0xe06ed2,_0x3d644b,_0x27d5ad){var _0x29b461=_0xe06ed2[_0x30ef('0x5f')]['ids'];return db[_0x30ef('0x74')]['findAll']({'where':{'id':_0x29b461},'attributes':['id'],'include':[{'model':db[_0x30ef('0x6a')],'as':'Agents','attributes':['id','name',_0x30ef('0x76'),_0x30ef('0x77'),'interface'],'raw':!![]}]})[_0x30ef('0x23')](function(_0x282c55){if(_0x282c55){var _0x496ac8=_[_0x30ef('0x78')](_0x282c55,function(_0xd7f10b){var _0x203213=_0xd7f10b['get']({'plain':!![]});return _0x203213[_0x30ef('0x79')];});return db[_0x30ef('0x57')][_0x30ef('0x5d')]({'where':{'id':_0xe06ed2['params']['id']}})['then'](function(_0x38850c){return db[_0x30ef('0x7a')][_0x30ef('0x7b')](function(_0x245df7){return _0x38850c[_0x30ef('0x75')](_0x29b461,{'transaction':_0x245df7})[_0x30ef('0x23')](function(){return BPromise[_0x30ef('0x7c')](_0x496ac8,function(_0x201afc){return db[_0x30ef('0x66')][_0x30ef('0x7d')]({'where':{'UserId':_0x201afc['id'],'ChatQueueId':_0xe06ed2[_0x30ef('0x5b')]['id']},'transaction':_0x245df7});});})[_0x30ef('0x23')](function(){_0x496ac8[_0x30ef('0x7e')](function(_0x25f9bf){socket[_0x30ef('0x7f')]('userChatQueue:save',{'UserId':_0x25f9bf['id'],'ChatQueueId':_0x38850c['id']});});});});});}})['then'](respondWithStatusCode(_0x3d644b,null))[_0x30ef('0x63')](handleError(_0x3d644b,null));};exports[_0x30ef('0x80')]=function(_0x13a966,_0x10b727,_0xf2e362){return db[_0x30ef('0x74')][_0x30ef('0x59')]({'where':{'id':_0x13a966[_0x30ef('0x49')][_0x30ef('0x81')]},'attributes':['id'],'include':[{'model':db[_0x30ef('0x6a')],'as':_0x30ef('0x79'),'attributes':['id'],'raw':!![]}]})[_0x30ef('0x23')](handleEntityNotFound(_0x10b727,null))[_0x30ef('0x23')](function(_0x69efda){var _0x430012=_[_0x30ef('0x54')](_0x69efda,'id');var _0x41f79d=[];var _0x5c1e24=[];var _0x26af99=squel[_0x30ef('0x82')]();_0x26af99['field'](_0x30ef('0x83'))[_0x30ef('0x84')](_0x30ef('0x85'),'tq')[_0x30ef('0x86')]('user_has_teams','ut',_0x30ef('0x87'))['where'](_0x30ef('0x88'),_0x13a966[_0x30ef('0x5b')]['id']);for(var _0x53f68d=0x0;_0x53f68d<_0x69efda['length'];_0x53f68d+=0x1){let _0x575368=_0x69efda[_0x53f68d];for(var _0x57597b=0x0;_0x57597b<_0x575368[_0x30ef('0x79')]['length'];_0x57597b+=0x1){let _0x37fabd=_0x575368[_0x30ef('0x79')][_0x57597b];var _0x1f0b3a=_0x26af99[_0x30ef('0x89')]();_0x1f0b3a[_0x30ef('0x51')]('ut.UserId\x20=\x20?',_0x37fabd['id']);_0x5c1e24[_0x30ef('0x8a')](db[_0x30ef('0x7a')][_0x30ef('0x49')](_0x1f0b3a[_0x30ef('0x8b')](),{'type':db[_0x30ef('0x7a')][_0x30ef('0x8c')][_0x30ef('0x8d')]})[_0x30ef('0x23')](function(_0x4d5064){if(_0x4d5064[_0x30ef('0x4e')]===0x1){return _0x37fabd['id'];}else{var _0x4326cb=_[_0x30ef('0x8e')](_[_0x30ef('0x54')](_0x4d5064,_0x30ef('0x8f')),function(_0x3e701d){return _[_0x30ef('0x90')](_0x430012,_0x3e701d);});if(_0x4326cb){return _0x37fabd['id'];}}}));}}return BPromise[_0x30ef('0x91')](_0x5c1e24)['then'](function(_0x448d81){_0x41f79d=_(_0x41f79d)[_0x30ef('0x92')](_0x448d81)[_0x30ef('0x93')]()[_0x30ef('0x94')]();return db[_0x30ef('0x57')][_0x30ef('0x5d')]({'where':{'id':_0x13a966[_0x30ef('0x5b')]['id']}})['then'](function(_0x38ea8d){return db[_0x30ef('0x7a')][_0x30ef('0x7b')](function(_0x4cb2ee){return _0x38ea8d[_0x30ef('0x80')](_0x13a966[_0x30ef('0x49')]['ids'],{'transaction':_0x4cb2ee})[_0x30ef('0x23')](function(){if(!_[_0x30ef('0x95')](_0x41f79d)){return _0x38ea8d[_0x30ef('0x96')](_0x41f79d,{'transaction':_0x4cb2ee});}})[_0x30ef('0x23')](function(){_0x41f79d[_0x30ef('0x7e')](function(_0x5cff57){socket[_0x30ef('0x7f')](_0x30ef('0x97'),{'UserId':_0x5cff57,'ChatQueueId':_0x38ea8d['id']});});});});});});})[_0x30ef('0x23')](respondWithStatusCode(_0x10b727,null))[_0x30ef('0x63')](handleError(_0x10b727,null));};exports[_0x30ef('0x98')]=function(_0x68f8ea,_0xf25c2d,_0x31a20b){return db[_0x30ef('0x57')][_0x30ef('0x5d')]({'where':{'id':_0x68f8ea[_0x30ef('0x5b')]['id']}})['then'](handleEntityNotFound(_0xf25c2d,null))[_0x30ef('0x23')](function(_0x54cbfc){if(_0x54cbfc){return _0x54cbfc['addAgents'](_0x68f8ea[_0x30ef('0x5f')]['ids'],_[_0x30ef('0x99')](_0x68f8ea[_0x30ef('0x5f')],[_0x30ef('0x81'),'id'])||{})['spread'](function(_0x38f946){for(var _0x2379f4=0x0;_0x2379f4<_0x68f8ea[_0x30ef('0x5f')][_0x30ef('0x81')][_0x30ef('0x4e')];_0x2379f4+=0x1){socket[_0x30ef('0x7f')](_0x30ef('0x9a'),{'UserId':Number(_0x68f8ea[_0x30ef('0x5f')][_0x30ef('0x81')][_0x2379f4]),'ChatQueueId':Number(_0x68f8ea[_0x30ef('0x5b')]['id'])});}return _0x38f946;});}})['then'](respondWithResult(_0xf25c2d,null))['catch'](handleError(_0xf25c2d,null));};exports[_0x30ef('0x96')]=function(_0x1516d9,_0x210bc8,_0xef1962){return db[_0x30ef('0x57')][_0x30ef('0x5d')]({'where':{'id':_0x1516d9[_0x30ef('0x5b')]['id']}})[_0x30ef('0x23')](handleEntityNotFound(_0x210bc8,null))[_0x30ef('0x23')](function(_0x4a94e1){if(_0x4a94e1){return _0x4a94e1[_0x30ef('0x96')](_0x1516d9['query'][_0x30ef('0x81')])[_0x30ef('0x23')](function(){if(_[_0x30ef('0x9b')](_0x1516d9['query'][_0x30ef('0x81')])){for(var _0x4ea436=0x0;_0x4ea436<_0x1516d9[_0x30ef('0x49')][_0x30ef('0x81')][_0x30ef('0x4e')];_0x4ea436+=0x1){socket['emit'](_0x30ef('0x97'),{'UserId':Number(_0x1516d9[_0x30ef('0x49')][_0x30ef('0x81')][_0x4ea436]),'ChatQueueId':Number(_0x1516d9[_0x30ef('0x5b')]['id'])});}}else{socket['emit'](_0x30ef('0x97'),{'UserId':Number(_0x1516d9['query']['ids']),'ChatQueueId':Number(_0x1516d9['params']['id'])});}});}})[_0x30ef('0x23')](respondWithStatusCode(_0x210bc8,null))[_0x30ef('0x63')](handleError(_0x210bc8,null));};exports[_0x30ef('0x9c')]=function(_0x5957e8,_0x5159f0,_0x2b1aec){var _0xfb3beb={};var _0x406cd5={};var _0x2ef1a2;var _0x5231eb;return db['ChatQueue'][_0x30ef('0x73')]({'where':{'id':_0x5957e8[_0x30ef('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5159f0,null))[_0x30ef('0x23')](function(_0x11505a){if(_0x11505a){_0x2ef1a2=_0x11505a;_0x406cd5[_0x30ef('0x47')]=_[_0x30ef('0x48')](db['User'][_0x30ef('0x43')]);_0x406cd5[_0x30ef('0x49')]=_[_0x30ef('0x48')](_0x5957e8[_0x30ef('0x49')]);_0x406cd5['filters']=_[_0x30ef('0x4b')](_0x406cd5['model'],_0x406cd5[_0x30ef('0x49')]);_0xfb3beb[_0x30ef('0x4c')]=_[_0x30ef('0x4b')](_0x406cd5[_0x30ef('0x47')],qs[_0x30ef('0x4d')](_0x5957e8[_0x30ef('0x49')][_0x30ef('0x4d')]));_0xfb3beb['attributes']=_0xfb3beb[_0x30ef('0x4c')][_0x30ef('0x4e')]?_0xfb3beb[_0x30ef('0x4c')]:_0x406cd5[_0x30ef('0x47')];_0xfb3beb[_0x30ef('0x68')]=qs[_0x30ef('0x50')](_0x5957e8[_0x30ef('0x49')][_0x30ef('0x50')]);_0xfb3beb['where']=qs[_0x30ef('0x4a')](_[_0x30ef('0x52')](_0x5957e8[_0x30ef('0x49')],_0x406cd5[_0x30ef('0x4a')]));if(_0x5957e8[_0x30ef('0x49')][_0x30ef('0x53')]){_0xfb3beb['where']=_[_0x30ef('0x55')](_0xfb3beb['where'],{'$or':_[_0x30ef('0x54')](_0xfb3beb[_0x30ef('0x4c')],function(_0x172ea0){var _0x45b452={};_0x45b452[_0x172ea0]={'$like':'%'+_0x5957e8[_0x30ef('0x49')]['filter']+'%'};return _0x45b452;})});}_0xfb3beb=_[_0x30ef('0x55')]({},_0xfb3beb,_0x5957e8[_0x30ef('0x56')]);return _0x2ef1a2['getAgents'](_0xfb3beb);}})['then'](function(_0x32673b){if(_0x32673b){_0x5231eb=_0x32673b[_0x30ef('0x4e')];if(!_0x5957e8[_0x30ef('0x49')][_0x30ef('0x67')](_0x30ef('0x4f'))){_0xfb3beb[_0x30ef('0x34')]=qs['limit'](_0x5957e8[_0x30ef('0x49')][_0x30ef('0x34')]);_0xfb3beb[_0x30ef('0x32')]=qs[_0x30ef('0x32')](_0x5957e8['query'][_0x30ef('0x32')]);}return _0x2ef1a2[_0x30ef('0x9c')](_0xfb3beb);}})[_0x30ef('0x23')](function(_0x465235){if(_0x465235){return _0x465235?{'count':_0x5231eb,'rows':_0x465235}:null;}})[_0x30ef('0x23')](respondWithResult(_0x5159f0,null))[_0x30ef('0x63')](handleError(_0x5159f0,null));};
\ No newline at end of file
+var _0x8f43=['type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','UserChatQueue','order','ChatQueueId','findAndCountAll','UserId','agent','updatedAt','createdAt','getTeams','findOne','Team','nolimit','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','destroy','get','ChatQueues','end','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName'];(function(_0x49a5e0,_0x5ec0d5){var _0x3f6f10=function(_0xa2112e){while(--_0xa2112e){_0x49a5e0['push'](_0x49a5e0['shift']());}};_0x3f6f10(++_0x5ec0d5);}(_0x8f43,0x18b));var _0x38f4=function(_0x5e971e,_0x162d2d){_0x5e971e=_0x5e971e-0x0;var _0x2bddbe=_0x8f43[_0x5e971e];return _0x2bddbe;};'use strict';var emlformat=require(_0x38f4('0x0'));var rimraf=require(_0x38f4('0x1'));var zipdir=require(_0x38f4('0x2'));var jsonpatch=require(_0x38f4('0x3'));var rp=require(_0x38f4('0x4'));var moment=require(_0x38f4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x38f4('0x6'));var path=require(_0x38f4('0x7'));var sox=require(_0x38f4('0x8'));var csv=require(_0x38f4('0x9'));var ejs=require(_0x38f4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x38f4('0xb'));var squel=require(_0x38f4('0xc'));var crypto=require('crypto');var jsforce=require(_0x38f4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x38f4('0x9'));var querystring=require(_0x38f4('0xe'));var Papa=require(_0x38f4('0xf'));var Redis=require(_0x38f4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x38f4('0x11'));var as=require(_0x38f4('0x12'));var hardwareService=require(_0x38f4('0x13'));var logger=require('../../config/logger')(_0x38f4('0x14'));var utils=require(_0x38f4('0x15'));var config=require(_0x38f4('0x16'));var licenseUtil=require(_0x38f4('0x17'));var db=require(_0x38f4('0x18'))['db'];config[_0x38f4('0x19')]=_[_0x38f4('0x1a')](config[_0x38f4('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x38f4('0x1b'))(new Redis(config['redis']));require(_0x38f4('0x1c'))[_0x38f4('0x1d')](socket);var jayson=require(_0x38f4('0x1e'));var client=jayson[_0x38f4('0x1f')][_0x38f4('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x117979,_0x23f5c1,_0x5d1d2e,_0x39544b){return new BPromise(function(_0x476ca8,_0x39a4b4){var _0x1bdfd8=_0x39544b||client;return _0x1bdfd8[_0x38f4('0x21')](_0x117979,_0x5d1d2e)[_0x38f4('0x22')](function(_0x1f495a){logger['info'](_0x38f4('0x23'),_0x23f5c1,_0x38f4('0x24'));logger[_0x38f4('0x25')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x23f5c1,'request\x20sent',JSON[_0x38f4('0x26')](_0x1f495a));if(_0x1f495a[_0x38f4('0x27')]){if(_0x1f495a[_0x38f4('0x27')][_0x38f4('0x28')]===0x1f4){logger[_0x38f4('0x27')](_0x38f4('0x23'),_0x23f5c1,_0x1f495a[_0x38f4('0x27')][_0x38f4('0x29')]);return _0x39a4b4(_0x1f495a['error'][_0x38f4('0x29')]);}logger[_0x38f4('0x27')](_0x38f4('0x23'),_0x23f5c1,_0x1f495a['error'][_0x38f4('0x29')]);return _0x476ca8(_0x1f495a[_0x38f4('0x27')][_0x38f4('0x29')]);}else{logger[_0x38f4('0x2a')](_0x38f4('0x23'),_0x23f5c1,_0x38f4('0x24'));_0x476ca8(_0x1f495a[_0x38f4('0x2b')]['message']);}})['catch'](function(_0x376010){logger[_0x38f4('0x27')]('ChatQueue,\x20%s,\x20%s',_0x23f5c1,_0x376010);_0x39a4b4(_0x376010);});});}function respondWithStatusCode(_0x4853a9,_0x5572bd){_0x5572bd=_0x5572bd||0xcc;return function(_0xd3bc5f){if(_0xd3bc5f){return _0x4853a9['sendStatus'](_0x5572bd);}return _0x4853a9['status'](_0x5572bd)['end']();};}function respondWithResult(_0x1fb63f,_0x4a88e1){_0x4a88e1=_0x4a88e1||0xc8;return function(_0x6cd127){if(_0x6cd127){return _0x1fb63f['status'](_0x4a88e1)[_0x38f4('0x2c')](_0x6cd127);}};}function respondWithFilteredResult(_0x36bb84,_0x32c106){return function(_0x326b0a){if(_0x326b0a){var _0x1022f3=typeof _0x32c106[_0x38f4('0x2d')]===_0x38f4('0x2e')&&typeof _0x32c106[_0x38f4('0x2f')]==='undefined';var _0x504664=_0x326b0a['count'];var _0x10f957=_0x1022f3?0x0:_0x32c106['offset'];var _0x47df2b=_0x1022f3?_0x326b0a[_0x38f4('0x30')]:_0x32c106[_0x38f4('0x2d')]+_0x32c106['limit'];var _0x1adc17;if(_0x47df2b>=_0x504664){_0x47df2b=_0x504664;_0x1adc17=0xc8;}else{_0x1adc17=0xce;}_0x36bb84[_0x38f4('0x31')](_0x1adc17);return _0x36bb84[_0x38f4('0x32')](_0x38f4('0x33'),_0x10f957+'-'+_0x47df2b+'/'+_0x504664)[_0x38f4('0x2c')](_0x326b0a);}return null;};}function patchUpdates(_0x2130d5){return function(_0x161b52){try{jsonpatch[_0x38f4('0x34')](_0x161b52,_0x2130d5,!![]);}catch(_0x4edf3d){return BPromise['reject'](_0x4edf3d);}return _0x161b52[_0x38f4('0x35')]();};}function saveUpdates(_0x7e3987,_0x59312b){return function(_0x421aca){if(_0x421aca){return _0x421aca[_0x38f4('0x36')](_0x7e3987)[_0x38f4('0x22')](function(_0x350c31){return _0x350c31;});}return null;};}function removeEntity(_0x425ac5,_0x7fa244){return function(_0x2fcb86){if(_0x2fcb86){return _0x2fcb86[_0x38f4('0x37')]()[_0x38f4('0x22')](function(){var _0x301901=_0x2fcb86[_0x38f4('0x38')]({'plain':!![]});var _0x193c46=_0x38f4('0x39');return db['UserProfileResource'][_0x38f4('0x37')]({'where':{'type':_0x193c46,'resourceId':_0x301901['id']}})[_0x38f4('0x22')](function(){return _0x2fcb86;});})[_0x38f4('0x22')](function(){_0x425ac5['status'](0xcc)[_0x38f4('0x3a')]();});}};}function handleEntityNotFound(_0x1b161d,_0x65ea9a){return function(_0x10d3a4){if(!_0x10d3a4){_0x1b161d['sendStatus'](0x194);}return _0x10d3a4;};}function handleError(_0x25669a,_0xd60edf){_0xd60edf=_0xd60edf||0x1f4;return function(_0x16844d){logger[_0x38f4('0x27')](_0x16844d[_0x38f4('0x3b')]);if(_0x16844d[_0x38f4('0x3c')]){delete _0x16844d[_0x38f4('0x3c')];}_0x25669a[_0x38f4('0x31')](_0xd60edf)[_0x38f4('0x3d')](_0x16844d);};}exports[_0x38f4('0x3e')]=function(_0xb4c27a,_0x1d4af7){var _0x5383c8={},_0x2504f5={},_0x432073={'count':0x0,'rows':[]};var _0x54b709=_[_0x38f4('0x3f')](db[_0x38f4('0x40')][_0x38f4('0x41')],function(_0x3b28b6){return{'name':_0x3b28b6[_0x38f4('0x42')],'type':_0x3b28b6[_0x38f4('0x43')]['key']};});_0x2504f5['model']=_['map'](_0x54b709,'name');_0x2504f5[_0x38f4('0x44')]=_[_0x38f4('0x45')](_0xb4c27a[_0x38f4('0x44')]);_0x2504f5[_0x38f4('0x46')]=_[_0x38f4('0x47')](_0x2504f5[_0x38f4('0x48')],_0x2504f5[_0x38f4('0x44')]);_0x5383c8[_0x38f4('0x49')]=_[_0x38f4('0x47')](_0x2504f5[_0x38f4('0x48')],qs[_0x38f4('0x4a')](_0xb4c27a[_0x38f4('0x44')][_0x38f4('0x4a')]));_0x5383c8[_0x38f4('0x49')]=_0x5383c8[_0x38f4('0x49')][_0x38f4('0x4b')]?_0x5383c8['attributes']:_0x2504f5[_0x38f4('0x48')];if(!_0xb4c27a['query'][_0x38f4('0x4c')]('nolimit')){_0x5383c8[_0x38f4('0x2f')]=qs[_0x38f4('0x2f')](_0xb4c27a[_0x38f4('0x44')][_0x38f4('0x2f')]);_0x5383c8[_0x38f4('0x2d')]=qs[_0x38f4('0x2d')](_0xb4c27a[_0x38f4('0x44')][_0x38f4('0x2d')]);}_0x5383c8['order']=qs[_0x38f4('0x4d')](_0xb4c27a[_0x38f4('0x44')][_0x38f4('0x4d')]);_0x5383c8['where']=qs[_0x38f4('0x46')](_[_0x38f4('0x4e')](_0xb4c27a[_0x38f4('0x44')],_0x2504f5[_0x38f4('0x46')]),_0x54b709);if(_0xb4c27a[_0x38f4('0x44')]['filter']){_0x5383c8[_0x38f4('0x4f')]=_['merge'](_0x5383c8['where'],{'$or':_[_0x38f4('0x3f')](_0x54b709,function(_0x13541f){if(_0x13541f[_0x38f4('0x43')]!==_0x38f4('0x50')){var _0x53efd3={};_0x53efd3[_0x13541f['name']]={'$like':'%'+_0xb4c27a['query'][_0x38f4('0x51')]+'%'};return _0x53efd3;}})});}_0x5383c8=_[_0x38f4('0x52')]({},_0x5383c8,_0xb4c27a[_0x38f4('0x53')]);var _0x2342a9={'where':_0x5383c8[_0x38f4('0x4f')]};return db[_0x38f4('0x40')][_0x38f4('0x30')](_0x2342a9)[_0x38f4('0x22')](function(_0x3bfcad){_0x432073['count']=_0x3bfcad;if(_0xb4c27a[_0x38f4('0x44')][_0x38f4('0x54')]){_0x5383c8[_0x38f4('0x55')]=[{'all':!![]}];}return db[_0x38f4('0x40')][_0x38f4('0x56')](_0x5383c8);})[_0x38f4('0x22')](function(_0x1caaf3){_0x432073[_0x38f4('0x57')]=_0x1caaf3;return _0x432073;})[_0x38f4('0x22')](respondWithFilteredResult(_0x1d4af7,_0x5383c8))['catch'](handleError(_0x1d4af7,null));};exports['show']=function(_0x3d6630,_0x26661e){var _0x53fc22={'raw':!![],'where':{'id':_0x3d6630['params']['id']}},_0x3807bd={};_0x3807bd['model']=_[_0x38f4('0x45')](db[_0x38f4('0x40')][_0x38f4('0x41')]);_0x3807bd[_0x38f4('0x44')]=_['keys'](_0x3d6630[_0x38f4('0x44')]);_0x3807bd[_0x38f4('0x46')]=_[_0x38f4('0x47')](_0x3807bd[_0x38f4('0x48')],_0x3807bd[_0x38f4('0x44')]);_0x53fc22[_0x38f4('0x49')]=_[_0x38f4('0x47')](_0x3807bd[_0x38f4('0x48')],qs[_0x38f4('0x4a')](_0x3d6630[_0x38f4('0x44')][_0x38f4('0x4a')]));_0x53fc22['attributes']=_0x53fc22[_0x38f4('0x49')]['length']?_0x53fc22['attributes']:_0x3807bd['model'];if(_0x3d6630[_0x38f4('0x44')][_0x38f4('0x54')]){_0x53fc22['include']=[{'all':!![]}];}_0x53fc22=_[_0x38f4('0x52')]({},_0x53fc22,_0x3d6630['options']);return db[_0x38f4('0x40')]['find'](_0x53fc22)[_0x38f4('0x22')](handleEntityNotFound(_0x26661e,null))[_0x38f4('0x22')](respondWithResult(_0x26661e,null))[_0x38f4('0x58')](handleError(_0x26661e,null));};exports[_0x38f4('0x59')]=function(_0x15a7e8,_0x468bf2){return db[_0x38f4('0x40')][_0x38f4('0x59')](_0x15a7e8[_0x38f4('0x5a')],{})[_0x38f4('0x22')](function(_0x205719){var _0x5b8586=_0x15a7e8['user']['get']({'plain':!![]});if(!_0x5b8586)throw new Error(_0x38f4('0x5b'));if(_0x5b8586[_0x38f4('0x5c')]===_0x38f4('0x5d')){var _0x55459b=_0x205719[_0x38f4('0x38')]({'plain':!![]});var _0x7c8f1d=_0x38f4('0x39');return db[_0x38f4('0x5e')][_0x38f4('0x5f')]({'where':{'name':_0x7c8f1d,'userProfileId':_0x5b8586[_0x38f4('0x60')]},'raw':!![]})[_0x38f4('0x22')](function(_0x59935f){if(_0x59935f&&_0x59935f[_0x38f4('0x61')]===0x0){return db['UserProfileResource'][_0x38f4('0x59')]({'name':_0x55459b[_0x38f4('0x3c')],'resourceId':_0x55459b['id'],'type':_0x59935f[_0x38f4('0x3c')],'sectionId':_0x59935f['id']},{})['then'](function(){return _0x205719;});}else{return _0x205719;}})[_0x38f4('0x58')](function(_0x3c0d04){logger[_0x38f4('0x27')](_0x38f4('0x62'),_0x3c0d04);throw _0x3c0d04;});}return _0x205719;})[_0x38f4('0x22')](respondWithResult(_0x468bf2,0xc9))[_0x38f4('0x58')](handleError(_0x468bf2,null));};exports[_0x38f4('0x36')]=function(_0x570a0b,_0x808dff){if(_0x570a0b[_0x38f4('0x5a')]['id']){delete _0x570a0b[_0x38f4('0x5a')]['id'];}return db[_0x38f4('0x40')][_0x38f4('0x5f')]({'where':{'id':_0x570a0b['params']['id']}})[_0x38f4('0x22')](handleEntityNotFound(_0x808dff,null))[_0x38f4('0x22')](saveUpdates(_0x570a0b[_0x38f4('0x5a')],null))[_0x38f4('0x22')](respondWithResult(_0x808dff,null))[_0x38f4('0x58')](handleError(_0x808dff,null));};exports[_0x38f4('0x37')]=function(_0x199560,_0x28ffef){return db[_0x38f4('0x40')][_0x38f4('0x5f')]({'where':{'id':_0x199560[_0x38f4('0x63')]['id']}})[_0x38f4('0x22')](handleEntityNotFound(_0x28ffef,null))['then'](removeEntity(_0x28ffef,null))[_0x38f4('0x58')](handleError(_0x28ffef,null));};exports[_0x38f4('0x64')]=function(_0x5f20e0,_0x114b18){return db[_0x38f4('0x40')][_0x38f4('0x64')]()[_0x38f4('0x22')](respondWithResult(_0x114b18,null))[_0x38f4('0x58')](handleError(_0x114b18,null));};exports['getMembers']=function(_0x4cab40,_0x32fd42,_0x21dffc){var _0x536133={'raw':!![],'where':{}},_0x4fd3f3={},_0x273ccc;return db[_0x38f4('0x40')]['findOne']({'where':{'id':_0x4cab40[_0x38f4('0x63')]['id']}})[_0x38f4('0x22')](handleEntityNotFound(_0x32fd42,null))[_0x38f4('0x22')](function(_0x1ac0b1){if(_0x1ac0b1){_0x273ccc=_0x1ac0b1[_0x38f4('0x38')]({'plain':!![]});_0x4fd3f3['model']=_['keys'](db[_0x38f4('0x65')][_0x38f4('0x41')]);_0x4fd3f3[_0x38f4('0x44')]=_['keys'](_0x4cab40[_0x38f4('0x44')]);_0x4fd3f3[_0x38f4('0x46')]=_[_0x38f4('0x47')](_0x4fd3f3[_0x38f4('0x48')],_0x4fd3f3[_0x38f4('0x44')]);_0x536133[_0x38f4('0x49')]=_[_0x38f4('0x47')](_0x4fd3f3[_0x38f4('0x48')],qs[_0x38f4('0x4a')](_0x4cab40['query'][_0x38f4('0x4a')]));_0x536133[_0x38f4('0x49')]=_0x536133[_0x38f4('0x49')][_0x38f4('0x4b')]?_0x536133[_0x38f4('0x49')]:_0x4fd3f3[_0x38f4('0x48')];if(!_0x4cab40['query'][_0x38f4('0x4c')]('nolimit')){_0x536133[_0x38f4('0x2f')]=qs[_0x38f4('0x2f')](_0x4cab40[_0x38f4('0x44')]['limit']);_0x536133['offset']=qs['offset'](_0x4cab40[_0x38f4('0x44')]['offset']);}_0x536133[_0x38f4('0x66')]=qs[_0x38f4('0x4d')](_0x4cab40[_0x38f4('0x44')][_0x38f4('0x4d')]);_0x536133['where']=qs[_0x38f4('0x46')](_[_0x38f4('0x4e')](_0x4cab40[_0x38f4('0x44')],_0x4fd3f3['filters']));_0x536133['where'][_0x38f4('0x67')]=_0x1ac0b1['id'];if(_0x4cab40[_0x38f4('0x44')][_0x38f4('0x51')]){_0x536133[_0x38f4('0x4f')]=_[_0x38f4('0x52')](_0x536133['where'],{'$or':_[_0x38f4('0x3f')](_0x536133['attributes'],function(_0x3b391a){var _0x4a5b9a={};_0x4a5b9a[_0x3b391a]={'$like':'%'+_0x4cab40[_0x38f4('0x44')][_0x38f4('0x51')]+'%'};return _0x4a5b9a;})});}_0x536133=_[_0x38f4('0x52')]({},_0x536133,_0x4cab40['options']);return db['UserChatQueue'][_0x38f4('0x56')](_0x536133);}})[_0x38f4('0x22')](function(_0x11ec3b){if(_0x11ec3b){return db['User'][_0x38f4('0x68')]({'where':{'id':_[_0x38f4('0x3f')](_0x11ec3b,_0x38f4('0x69')),'role':_0x38f4('0x6a')},'attributes':['id',_0x38f4('0x3c'),'chatPause',_0x38f4('0x6b'),_0x38f4('0x6c')]});}})['then'](function(_0x489607){if(_0x489607){return{'count':_0x489607[_0x38f4('0x30')],'rows':_[_0x38f4('0x3f')](_0x489607[_0x38f4('0x57')],function(_0xbc6171){return{'membername':_0xbc6171[_0x38f4('0x3c')],'UserId':_0xbc6171['id'],'queue_name':_0x273ccc[_0x38f4('0x3c')],'ChatQueueId':_0x273ccc['id'],'interface':util['format']('%s/%s','SIP',_0xbc6171[_0x38f4('0x3c')]),'penalty':0x0,'paused':_0xbc6171['chatPause'],'createdAt':_0xbc6171[_0x38f4('0x6c')],'updatedAt':_0xbc6171[_0x38f4('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x38f4('0x22')](respondWithFilteredResult(_0x32fd42,_0x536133))[_0x38f4('0x58')](handleError(_0x32fd42,null));};exports[_0x38f4('0x6d')]=function(_0x4d7f13,_0x9dcee1,_0x36366a){var _0x3ce724={};var _0xb9a15c={};var _0xa732fd;var _0x3f4946;return db[_0x38f4('0x40')][_0x38f4('0x6e')]({'where':{'id':_0x4d7f13['params']['id']}})['then'](handleEntityNotFound(_0x9dcee1,null))[_0x38f4('0x22')](function(_0x307eff){if(_0x307eff){_0xa732fd=_0x307eff;_0xb9a15c[_0x38f4('0x48')]=_[_0x38f4('0x45')](db[_0x38f4('0x6f')][_0x38f4('0x41')]);_0xb9a15c[_0x38f4('0x44')]=_['keys'](_0x4d7f13[_0x38f4('0x44')]);_0xb9a15c['filters']=_['intersection'](_0xb9a15c['model'],_0xb9a15c[_0x38f4('0x44')]);_0x3ce724['attributes']=_['intersection'](_0xb9a15c[_0x38f4('0x48')],qs[_0x38f4('0x4a')](_0x4d7f13[_0x38f4('0x44')]['fields']));_0x3ce724[_0x38f4('0x49')]=_0x3ce724[_0x38f4('0x49')][_0x38f4('0x4b')]?_0x3ce724[_0x38f4('0x49')]:_0xb9a15c[_0x38f4('0x48')];_0x3ce724[_0x38f4('0x66')]=qs[_0x38f4('0x4d')](_0x4d7f13[_0x38f4('0x44')]['sort']);_0x3ce724[_0x38f4('0x4f')]=qs['filters'](_[_0x38f4('0x4e')](_0x4d7f13[_0x38f4('0x44')],_0xb9a15c[_0x38f4('0x46')]));if(_0x4d7f13[_0x38f4('0x44')][_0x38f4('0x51')]){_0x3ce724['where']=_[_0x38f4('0x52')](_0x3ce724[_0x38f4('0x4f')],{'$or':_['map'](_0x3ce724[_0x38f4('0x49')],function(_0x4fabe7){var _0x293a2e={};_0x293a2e[_0x4fabe7]={'$like':'%'+_0x4d7f13[_0x38f4('0x44')][_0x38f4('0x51')]+'%'};return _0x293a2e;})});}_0x3ce724=_[_0x38f4('0x52')]({},_0x3ce724,_0x4d7f13[_0x38f4('0x53')]);return _0xa732fd[_0x38f4('0x6d')](_0x3ce724);}})['then'](function(_0x38b8e9){if(_0x38b8e9){_0x3f4946=_0x38b8e9['length'];if(!_0x4d7f13[_0x38f4('0x44')]['hasOwnProperty'](_0x38f4('0x70'))){_0x3ce724[_0x38f4('0x2f')]=qs[_0x38f4('0x2f')](_0x4d7f13[_0x38f4('0x44')][_0x38f4('0x2f')]);_0x3ce724[_0x38f4('0x2d')]=qs[_0x38f4('0x2d')](_0x4d7f13[_0x38f4('0x44')][_0x38f4('0x2d')]);}return _0xa732fd[_0x38f4('0x6d')](_0x3ce724);}})[_0x38f4('0x22')](function(_0xc8e6c5){if(_0xc8e6c5){return _0xc8e6c5?{'count':_0x3f4946,'rows':_0xc8e6c5}:null;}})['then'](respondWithResult(_0x9dcee1,null))[_0x38f4('0x58')](handleError(_0x9dcee1,null));};exports[_0x38f4('0x71')]=function(_0x200ee9,_0x4cb8f6,_0x3bb656){var _0x31514c=_0x200ee9[_0x38f4('0x5a')][_0x38f4('0x72')];return db[_0x38f4('0x6f')][_0x38f4('0x56')]({'where':{'id':_0x31514c},'attributes':['id'],'include':[{'model':db['User'],'as':_0x38f4('0x73'),'attributes':['id','name',_0x38f4('0x74'),_0x38f4('0x75'),_0x38f4('0x76')],'raw':!![]}]})[_0x38f4('0x22')](function(_0x3e7408){if(_0x3e7408){var _0x3aecb3=_[_0x38f4('0x77')](_0x3e7408,function(_0x31abf4){var _0x3eac7e=_0x31abf4[_0x38f4('0x38')]({'plain':!![]});return _0x3eac7e[_0x38f4('0x73')];});return db['ChatQueue'][_0x38f4('0x5f')]({'where':{'id':_0x200ee9['params']['id']}})[_0x38f4('0x22')](function(_0x52047b){return db[_0x38f4('0x78')]['transaction'](function(_0x1c333f){return _0x52047b[_0x38f4('0x71')](_0x31514c,{'transaction':_0x1c333f})[_0x38f4('0x22')](function(){return BPromise[_0x38f4('0x79')](_0x3aecb3,function(_0x42c604){return db[_0x38f4('0x65')][_0x38f4('0x7a')]({'where':{'UserId':_0x42c604['id'],'ChatQueueId':_0x200ee9[_0x38f4('0x63')]['id']},'transaction':_0x1c333f});});})['then'](function(){_0x3aecb3[_0x38f4('0x7b')](function(_0x59d35d){socket[_0x38f4('0x7c')](_0x38f4('0x7d'),{'UserId':_0x59d35d['id'],'ChatQueueId':_0x52047b['id']});});});});});}})[_0x38f4('0x22')](respondWithStatusCode(_0x4cb8f6,null))[_0x38f4('0x58')](handleError(_0x4cb8f6,null));};exports[_0x38f4('0x7e')]=function(_0x482cb4,_0x178188,_0x3f486b){return db[_0x38f4('0x6f')]['findAll']({'where':{'id':_0x482cb4[_0x38f4('0x44')][_0x38f4('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x38f4('0x73'),'attributes':['id'],'raw':!![]}]})[_0x38f4('0x22')](handleEntityNotFound(_0x178188,null))[_0x38f4('0x22')](function(_0x100c0a){var _0x10660e=_[_0x38f4('0x3f')](_0x100c0a,'id');var _0x5d87c6=[];var _0x459a33=[];var _0xe1bd5d=squel[_0x38f4('0x7f')]();_0xe1bd5d[_0x38f4('0x80')](_0x38f4('0x81'))[_0x38f4('0x82')](_0x38f4('0x83'),'tq')[_0x38f4('0x84')]('user_has_teams','ut',_0x38f4('0x85'))[_0x38f4('0x4f')](_0x38f4('0x86'),_0x482cb4[_0x38f4('0x63')]['id']);for(var _0x11eef5=0x0;_0x11eef5<_0x100c0a[_0x38f4('0x4b')];_0x11eef5+=0x1){let _0x5ce0a5=_0x100c0a[_0x11eef5];for(var _0x138b9c=0x0;_0x138b9c<_0x5ce0a5[_0x38f4('0x73')][_0x38f4('0x4b')];_0x138b9c+=0x1){let _0x3c98f4=_0x5ce0a5['Agents'][_0x138b9c];var _0x4cc9c4=_0xe1bd5d[_0x38f4('0x87')]();_0x4cc9c4[_0x38f4('0x4f')](_0x38f4('0x88'),_0x3c98f4['id']);_0x459a33[_0x38f4('0x89')](db[_0x38f4('0x78')][_0x38f4('0x44')](_0x4cc9c4[_0x38f4('0x8a')](),{'type':db['sequelize']['QueryTypes'][_0x38f4('0x8b')]})[_0x38f4('0x22')](function(_0xa41f77){if(_0xa41f77[_0x38f4('0x4b')]===0x1){return _0x3c98f4['id'];}else{var _0x34db12=_['every'](_[_0x38f4('0x3f')](_0xa41f77,_0x38f4('0x8c')),function(_0x5acc28){return _[_0x38f4('0x8d')](_0x10660e,_0x5acc28);});if(_0x34db12){return _0x3c98f4['id'];}}}));}}return BPromise[_0x38f4('0x8e')](_0x459a33)[_0x38f4('0x22')](function(_0x49f047){_0x5d87c6=_(_0x5d87c6)[_0x38f4('0x8f')](_0x49f047)[_0x38f4('0x90')]()[_0x38f4('0x91')]();return db['ChatQueue'][_0x38f4('0x5f')]({'where':{'id':_0x482cb4[_0x38f4('0x63')]['id']}})[_0x38f4('0x22')](function(_0x454c59){return db[_0x38f4('0x78')][_0x38f4('0x92')](function(_0x105aa2){return _0x454c59[_0x38f4('0x7e')](_0x482cb4['query'][_0x38f4('0x72')],{'transaction':_0x105aa2})['then'](function(){if(!_[_0x38f4('0x93')](_0x5d87c6)){return _0x454c59[_0x38f4('0x94')](_0x5d87c6,{'transaction':_0x105aa2});}})['then'](function(){_0x5d87c6[_0x38f4('0x7b')](function(_0x292632){socket[_0x38f4('0x7c')](_0x38f4('0x95'),{'UserId':_0x292632,'ChatQueueId':_0x454c59['id']});});});});});});})['then'](respondWithStatusCode(_0x178188,null))[_0x38f4('0x58')](handleError(_0x178188,null));};exports[_0x38f4('0x96')]=function(_0x41483d,_0x184660,_0x388b2a){return db[_0x38f4('0x40')][_0x38f4('0x5f')]({'where':{'id':_0x41483d[_0x38f4('0x63')]['id']}})['then'](handleEntityNotFound(_0x184660,null))[_0x38f4('0x22')](function(_0x4f3865){if(_0x4f3865){return _0x4f3865['addAgents'](_0x41483d[_0x38f4('0x5a')][_0x38f4('0x72')],_[_0x38f4('0x97')](_0x41483d['body'],['ids','id'])||{})[_0x38f4('0x98')](function(_0x12f544){for(var _0x2b558f=0x0;_0x2b558f<_0x41483d[_0x38f4('0x5a')][_0x38f4('0x72')][_0x38f4('0x4b')];_0x2b558f+=0x1){socket[_0x38f4('0x7c')]('userChatQueue:save',{'UserId':Number(_0x41483d['body'][_0x38f4('0x72')][_0x2b558f]),'ChatQueueId':Number(_0x41483d[_0x38f4('0x63')]['id'])});}return _0x12f544;});}})['then'](respondWithResult(_0x184660,null))['catch'](handleError(_0x184660,null));};exports[_0x38f4('0x94')]=function(_0x4a8e1b,_0x4ee757,_0x320b60){return db[_0x38f4('0x40')][_0x38f4('0x5f')]({'where':{'id':_0x4a8e1b[_0x38f4('0x63')]['id']}})[_0x38f4('0x22')](handleEntityNotFound(_0x4ee757,null))[_0x38f4('0x22')](function(_0x10be31){if(_0x10be31){return _0x10be31[_0x38f4('0x94')](_0x4a8e1b['query']['ids'])[_0x38f4('0x22')](function(){if(_['isArray'](_0x4a8e1b[_0x38f4('0x44')][_0x38f4('0x72')])){for(var _0x503af4=0x0;_0x503af4<_0x4a8e1b[_0x38f4('0x44')][_0x38f4('0x72')][_0x38f4('0x4b')];_0x503af4+=0x1){socket[_0x38f4('0x7c')](_0x38f4('0x95'),{'UserId':Number(_0x4a8e1b[_0x38f4('0x44')][_0x38f4('0x72')][_0x503af4]),'ChatQueueId':Number(_0x4a8e1b[_0x38f4('0x63')]['id'])});}}else{socket[_0x38f4('0x7c')](_0x38f4('0x95'),{'UserId':Number(_0x4a8e1b[_0x38f4('0x44')][_0x38f4('0x72')]),'ChatQueueId':Number(_0x4a8e1b[_0x38f4('0x63')]['id'])});}});}})[_0x38f4('0x22')](respondWithStatusCode(_0x4ee757,null))['catch'](handleError(_0x4ee757,null));};exports['getAgents']=function(_0x3c33da,_0x5cf66b,_0x1dbc53){var _0x546f5c={};var _0x3cc4da={};var _0x213bf5;var _0x31a525;return db['ChatQueue'][_0x38f4('0x6e')]({'where':{'id':_0x3c33da[_0x38f4('0x63')]['id']}})[_0x38f4('0x22')](handleEntityNotFound(_0x5cf66b,null))[_0x38f4('0x22')](function(_0x2e6a0a){if(_0x2e6a0a){_0x213bf5=_0x2e6a0a;_0x3cc4da['model']=_[_0x38f4('0x45')](db[_0x38f4('0x99')][_0x38f4('0x41')]);_0x3cc4da['query']=_[_0x38f4('0x45')](_0x3c33da[_0x38f4('0x44')]);_0x3cc4da[_0x38f4('0x46')]=_['intersection'](_0x3cc4da[_0x38f4('0x48')],_0x3cc4da[_0x38f4('0x44')]);_0x546f5c[_0x38f4('0x49')]=_[_0x38f4('0x47')](_0x3cc4da[_0x38f4('0x48')],qs[_0x38f4('0x4a')](_0x3c33da[_0x38f4('0x44')][_0x38f4('0x4a')]));_0x546f5c[_0x38f4('0x49')]=_0x546f5c['attributes']['length']?_0x546f5c[_0x38f4('0x49')]:_0x3cc4da[_0x38f4('0x48')];_0x546f5c['order']=qs[_0x38f4('0x4d')](_0x3c33da['query'][_0x38f4('0x4d')]);_0x546f5c['where']=qs['filters'](_[_0x38f4('0x4e')](_0x3c33da[_0x38f4('0x44')],_0x3cc4da[_0x38f4('0x46')]));if(_0x3c33da[_0x38f4('0x44')][_0x38f4('0x51')]){_0x546f5c['where']=_[_0x38f4('0x52')](_0x546f5c['where'],{'$or':_[_0x38f4('0x3f')](_0x546f5c['attributes'],function(_0x346bd4){var _0x485e99={};_0x485e99[_0x346bd4]={'$like':'%'+_0x3c33da[_0x38f4('0x44')][_0x38f4('0x51')]+'%'};return _0x485e99;})});}_0x546f5c=_['merge']({},_0x546f5c,_0x3c33da['options']);return _0x213bf5['getAgents'](_0x546f5c);}})['then'](function(_0x462986){if(_0x462986){_0x31a525=_0x462986['length'];if(!_0x3c33da[_0x38f4('0x44')]['hasOwnProperty'](_0x38f4('0x70'))){_0x546f5c['limit']=qs[_0x38f4('0x2f')](_0x3c33da[_0x38f4('0x44')][_0x38f4('0x2f')]);_0x546f5c[_0x38f4('0x2d')]=qs[_0x38f4('0x2d')](_0x3c33da[_0x38f4('0x44')][_0x38f4('0x2d')]);}return _0x213bf5['getAgents'](_0x546f5c);}})[_0x38f4('0x22')](function(_0x36d54a){if(_0x36d54a){return _0x36d54a?{'count':_0x31a525,'rows':_0x36d54a}:null;}})[_0x38f4('0x22')](respondWithResult(_0x5cf66b,null))[_0x38f4('0x58')](handleError(_0x5cf66b,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index f602352..e83dc3d 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 _0x5d8d=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue'];(function(_0x2dc7c9,_0x3a15f8){var _0x3e6536=function(_0x312829){while(--_0x312829){_0x2dc7c9['push'](_0x2dc7c9['shift']());}};_0x3e6536(++_0x3a15f8);}(_0x5d8d,0xe3));var _0xd5d8=function(_0x1545e0,_0x58058d){_0x1545e0=_0x1545e0-0x0;var _0x29a175=_0x5d8d[_0x1545e0];return _0x29a175;};'use strict';var EventEmitter=require(_0xd5d8('0x0'));var ChatQueue=require(_0xd5d8('0x1'))['db'][_0xd5d8('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd5d8('0x3')](0x0);var events={'afterCreate':_0xd5d8('0x4'),'afterUpdate':'update','afterDestroy':_0xd5d8('0x5')};function emitEvent(_0x1b8cc6){return function(_0x4f100c,_0x234ccb,_0x5514bc){ChatQueueEvents[_0xd5d8('0x6')](_0x1b8cc6+':'+_0x4f100c['id'],_0x4f100c);ChatQueueEvents['emit'](_0x1b8cc6,_0x4f100c);_0x5514bc(null);};}for(var e in events){if(events[_0xd5d8('0x7')](e)){var event=events[e];ChatQueue[_0xd5d8('0x8')](e,emitEvent(event));}}module[_0xd5d8('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0x831e=['exports','events','ChatQueue','setMaxListeners','update','remove','emit'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x831e,0xb0));var _0xe831=function(_0x164867,_0x12c1ac){_0x164867=_0x164867-0x0;var _0x2ae0bf=_0x831e[_0x164867];return _0x2ae0bf;};'use strict';var EventEmitter=require(_0xe831('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xe831('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe831('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe831('0x3'),'afterDestroy':_0xe831('0x4')};function emitEvent(_0x21a2b4){return function(_0x32c48f,_0x39fc48,_0x22a250){ChatQueueEvents[_0xe831('0x5')](_0x21a2b4+':'+_0x32c48f['id'],_0x32c48f);ChatQueueEvents[_0xe831('0x5')](_0x21a2b4,_0x32c48f);_0x22a250(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xe831('0x6')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 8bf2a71..cb7597c 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 _0xde84=['ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x59dd53,_0x36529e){var _0xa8e957=function(_0x54fcc6){while(--_0x54fcc6){_0x59dd53['push'](_0x59dd53['shift']());}};_0xa8e957(++_0x36529e);}(_0xde84,0x9c));var _0x4de8=function(_0x488a51,_0x3eb124){_0x488a51=_0x488a51-0x0;var _0x2b3d8b=_0xde84[_0x488a51];return _0x2b3d8b;};'use strict';var _=require(_0x4de8('0x0'));var util=require(_0x4de8('0x1'));var logger=require(_0x4de8('0x2'))(_0x4de8('0x3'));var moment=require(_0x4de8('0x4'));var BPromise=require(_0x4de8('0x5'));var rp=require(_0x4de8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4de8('0x7'));var config=require(_0x4de8('0x8'));var attributes=require(_0x4de8('0x9'));module[_0x4de8('0xa')]=function(_0x2683c1,_0x20c283){return _0x2683c1[_0x4de8('0xb')](_0x4de8('0xc'),attributes,{'tableName':_0x4de8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x916e=['request-promise','path','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','bluebird'];(function(_0x485968,_0x1a878e){var _0x3f55a7=function(_0x576133){while(--_0x576133){_0x485968['push'](_0x485968['shift']());}};_0x3f55a7(++_0x1a878e);}(_0x916e,0xc7));var _0xe916=function(_0x1b7620,_0x843b31){_0x1b7620=_0x1b7620-0x0;var _0x35b000=_0x916e[_0x1b7620];return _0x35b000;};'use strict';var _=require(_0xe916('0x0'));var util=require(_0xe916('0x1'));var logger=require(_0xe916('0x2'))(_0xe916('0x3'));var moment=require('moment');var BPromise=require(_0xe916('0x4'));var rp=require(_0xe916('0x5'));var fs=require('fs');var path=require(_0xe916('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe916('0x7'));module[_0xe916('0x8')]=function(_0x1b9bc2,_0x596d23){return _0x1b9bc2[_0xe916('0x9')](_0xe916('0xa'),attributes,{'tableName':_0xe916('0xb'),'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 0007f45..56c31be 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 _0xb974=['ShowChatQueue','ChatQueue','find','where','lodash','util','ioredis','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','options','raw','include','model','map','attributes','then','stringify'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xb974,0xb3));var _0x4b97=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb974[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x4b97('0x0'));var util=require(_0x4b97('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b97('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4b97('0x3'))(_0x4b97('0x4'));var config=require(_0x4b97('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4b97('0x6')]['http']({'port':0x232a});config[_0x4b97('0x7')]=_['defaults'](config[_0x4b97('0x7')],{'host':_0x4b97('0x8'),'port':0x18eb});var socket=require(_0x4b97('0x9'))(new Redis(config[_0x4b97('0x7')]));require('./chatQueue.socket')[_0x4b97('0xa')](socket);function respondWithRpcPromise(_0xfb45df,_0x4cb1be,_0x409dec){return new BPromise(function(_0x4b32a8,_0xe5ccbd){return client[_0x4b97('0xb')](_0xfb45df,_0x409dec)['then'](function(_0x2dc86a){logger[_0x4b97('0xc')]('ChatQueue,\x20%s,\x20%s',_0x4cb1be,_0x4b97('0xd'));logger[_0x4b97('0xe')](_0x4b97('0xf'),_0x4cb1be,'request\x20sent',JSON['stringify'](_0x2dc86a));if(_0x2dc86a[_0x4b97('0x10')]){if(_0x2dc86a[_0x4b97('0x10')][_0x4b97('0x11')]===0x1f4){logger[_0x4b97('0x10')](_0x4b97('0x12'),_0x4cb1be,_0x2dc86a[_0x4b97('0x10')][_0x4b97('0x13')]);return _0xe5ccbd(_0x2dc86a[_0x4b97('0x10')]['message']);}logger[_0x4b97('0x10')](_0x4b97('0x12'),_0x4cb1be,_0x2dc86a[_0x4b97('0x10')][_0x4b97('0x13')]);return _0x4b32a8(_0x2dc86a[_0x4b97('0x10')][_0x4b97('0x13')]);}else{logger[_0x4b97('0xc')](_0x4b97('0x12'),_0x4cb1be,'request\x20sent');_0x4b32a8(_0x2dc86a[_0x4b97('0x14')][_0x4b97('0x13')]);}})[_0x4b97('0x15')](function(_0x3e8b92){logger[_0x4b97('0x10')](_0x4b97('0x12'),_0x4cb1be,_0x3e8b92);_0xe5ccbd(_0x3e8b92);});});}exports[_0x4b97('0x16')]=function(_0x429f24){var _0x51e38a=this;return new Promise(function(_0x3b1e62,_0x580bad){return db['ChatQueue']['findAll']({'raw':_0x429f24['options']?_0x429f24[_0x4b97('0x17')][_0x4b97('0x18')]===undefined?!![]:![]:!![],'where':_0x429f24[_0x4b97('0x17')]?_0x429f24['options']['where']||null:null,'attributes':_0x429f24[_0x4b97('0x17')]?_0x429f24[_0x4b97('0x17')]['attributes']||null:null,'limit':_0x429f24['options']?_0x429f24['options']['limit']||null:null,'include':_0x429f24['options']?_0x429f24[_0x4b97('0x17')]['include']?_['map'](_0x429f24[_0x4b97('0x17')][_0x4b97('0x19')],function(_0x38d07b){return{'model':db[_0x38d07b[_0x4b97('0x1a')]],'as':_0x38d07b['as'],'attributes':_0x38d07b['attributes'],'include':_0x38d07b['include']?_[_0x4b97('0x1b')](_0x38d07b[_0x4b97('0x19')],function(_0x40a928){return{'model':db[_0x40a928['model']],'as':_0x40a928['as'],'attributes':_0x40a928['attributes'],'include':_0x40a928[_0x4b97('0x19')]?_[_0x4b97('0x1b')](_0x40a928[_0x4b97('0x19')],function(_0xb8e15c){return{'model':db[_0xb8e15c[_0x4b97('0x1a')]],'as':_0xb8e15c['as'],'attributes':_0xb8e15c[_0x4b97('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4b97('0x1d')](function(_0x4583f9){logger[_0x4b97('0xc')](_0x4b97('0x16'),_0x429f24);logger['debug'](_0x4b97('0x16'),_0x429f24,JSON[_0x4b97('0x1e')](_0x4583f9));_0x3b1e62(_0x4583f9);})[_0x4b97('0x15')](function(_0x100839){logger[_0x4b97('0x10')](_0x4b97('0x16'),_0x100839['message'],_0x429f24);_0x580bad(_0x51e38a['error'](0x1f4,_0x100839[_0x4b97('0x13')]));});});};exports[_0x4b97('0x1f')]=function(_0x4560da){var _0x3cff48=this;return new Promise(function(_0xc603a1,_0x1883f0){return db[_0x4b97('0x20')][_0x4b97('0x21')]({'raw':_0x4560da[_0x4b97('0x17')]?_0x4560da[_0x4b97('0x17')][_0x4b97('0x18')]===undefined?!![]:![]:!![],'where':_0x4560da[_0x4b97('0x17')]?_0x4560da[_0x4b97('0x17')][_0x4b97('0x22')]||null:null,'attributes':_0x4560da[_0x4b97('0x17')]?_0x4560da[_0x4b97('0x17')][_0x4b97('0x1c')]||null:null,'include':_0x4560da[_0x4b97('0x17')]?_0x4560da['options'][_0x4b97('0x19')]?_['map'](_0x4560da[_0x4b97('0x17')][_0x4b97('0x19')],function(_0x455c60){return{'model':db[_0x455c60[_0x4b97('0x1a')]],'as':_0x455c60['as'],'attributes':_0x455c60[_0x4b97('0x1c')],'include':_0x455c60[_0x4b97('0x19')]?_[_0x4b97('0x1b')](_0x455c60[_0x4b97('0x19')],function(_0x57bdd3){return{'model':db[_0x57bdd3[_0x4b97('0x1a')]],'as':_0x57bdd3['as'],'attributes':_0x57bdd3['attributes'],'include':_0x57bdd3[_0x4b97('0x19')]?_[_0x4b97('0x1b')](_0x57bdd3[_0x4b97('0x19')],function(_0x572c62){return{'model':db[_0x572c62[_0x4b97('0x1a')]],'as':_0x572c62['as'],'attributes':_0x572c62[_0x4b97('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4b97('0x1d')](function(_0x43323f){logger['info'](_0x4b97('0x1f'),_0x4560da);logger[_0x4b97('0xe')](_0x4b97('0x1f'),_0x4560da,JSON[_0x4b97('0x1e')](_0x43323f));_0xc603a1(_0x43323f);})[_0x4b97('0x15')](function(_0x1598b8){logger[_0x4b97('0x10')]('ShowChatQueue',_0x1598b8['message'],_0x4560da);_0x1883f0(_0x3cff48[_0x4b97('0x10')](0x1f4,_0x1598b8[_0x4b97('0x13')]));});});};
\ No newline at end of file
+var _0xd1f1=['result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','include','map','model','debug','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x184ff,_0x512f37){var _0x35b4d5=function(_0x53fea4){while(--_0x53fea4){_0x184ff['push'](_0x184ff['shift']());}};_0x35b4d5(++_0x512f37);}(_0xd1f1,0x84));var _0x1d1f=function(_0x667ff8,_0x59e7df){_0x667ff8=_0x667ff8-0x0;var _0x2ddfc7=_0xd1f1[_0x667ff8];return _0x2ddfc7;};'use strict';var _=require(_0x1d1f('0x0'));var util=require(_0x1d1f('0x1'));var moment=require(_0x1d1f('0x2'));var BPromise=require(_0x1d1f('0x3'));var rs=require(_0x1d1f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d1f('0x5'))['db'];var utils=require(_0x1d1f('0x6'));var logger=require(_0x1d1f('0x7'))('rpc');var config=require(_0x1d1f('0x8'));var jayson=require(_0x1d1f('0x9'));var client=jayson['client'][_0x1d1f('0xa')]({'port':0x232a});config['redis']=_[_0x1d1f('0xb')](config[_0x1d1f('0xc')],{'host':_0x1d1f('0xd'),'port':0x18eb});var socket=require(_0x1d1f('0xe'))(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x6de58c,_0x2bc44f,_0xff11b6){return new BPromise(function(_0x390baf,_0x5485c9){return client[_0x1d1f('0xf')](_0x6de58c,_0xff11b6)[_0x1d1f('0x10')](function(_0x17a312){logger[_0x1d1f('0x11')](_0x1d1f('0x12'),_0x2bc44f,_0x1d1f('0x13'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2bc44f,'request\x20sent',JSON[_0x1d1f('0x14')](_0x17a312));if(_0x17a312[_0x1d1f('0x15')]){if(_0x17a312[_0x1d1f('0x15')][_0x1d1f('0x16')]===0x1f4){logger[_0x1d1f('0x15')](_0x1d1f('0x12'),_0x2bc44f,_0x17a312[_0x1d1f('0x15')][_0x1d1f('0x17')]);return _0x5485c9(_0x17a312[_0x1d1f('0x15')][_0x1d1f('0x17')]);}logger[_0x1d1f('0x15')](_0x1d1f('0x12'),_0x2bc44f,_0x17a312[_0x1d1f('0x15')]['message']);return _0x390baf(_0x17a312[_0x1d1f('0x15')][_0x1d1f('0x17')]);}else{logger[_0x1d1f('0x11')](_0x1d1f('0x12'),_0x2bc44f,_0x1d1f('0x13'));_0x390baf(_0x17a312[_0x1d1f('0x18')][_0x1d1f('0x17')]);}})[_0x1d1f('0x19')](function(_0x2ee2dc){logger[_0x1d1f('0x15')](_0x1d1f('0x12'),_0x2bc44f,_0x2ee2dc);_0x5485c9(_0x2ee2dc);});});}exports[_0x1d1f('0x1a')]=function(_0x1a0742){var _0x131bc4=this;return new Promise(function(_0x1c6db5,_0x413c87){return db[_0x1d1f('0x1b')][_0x1d1f('0x1c')]({'raw':_0x1a0742[_0x1d1f('0x1d')]?_0x1a0742['options'][_0x1d1f('0x1e')]===undefined?!![]:![]:!![],'where':_0x1a0742[_0x1d1f('0x1d')]?_0x1a0742['options'][_0x1d1f('0x1f')]||null:null,'attributes':_0x1a0742[_0x1d1f('0x1d')]?_0x1a0742[_0x1d1f('0x1d')][_0x1d1f('0x20')]||null:null,'limit':_0x1a0742[_0x1d1f('0x1d')]?_0x1a0742[_0x1d1f('0x1d')]['limit']||null:null,'include':_0x1a0742[_0x1d1f('0x1d')]?_0x1a0742[_0x1d1f('0x1d')][_0x1d1f('0x21')]?_[_0x1d1f('0x22')](_0x1a0742[_0x1d1f('0x1d')]['include'],function(_0x43a03a){return{'model':db[_0x43a03a[_0x1d1f('0x23')]],'as':_0x43a03a['as'],'attributes':_0x43a03a['attributes'],'include':_0x43a03a['include']?_[_0x1d1f('0x22')](_0x43a03a[_0x1d1f('0x21')],function(_0x41bd80){return{'model':db[_0x41bd80[_0x1d1f('0x23')]],'as':_0x41bd80['as'],'attributes':_0x41bd80['attributes'],'include':_0x41bd80['include']?_[_0x1d1f('0x22')](_0x41bd80[_0x1d1f('0x21')],function(_0x2b99e3){return{'model':db[_0x2b99e3[_0x1d1f('0x23')]],'as':_0x2b99e3['as'],'attributes':_0x2b99e3[_0x1d1f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1d1f('0x10')](function(_0x5efc5c){logger['info']('GetChatQueue',_0x1a0742);logger[_0x1d1f('0x24')](_0x1d1f('0x1a'),_0x1a0742,JSON[_0x1d1f('0x14')](_0x5efc5c));_0x1c6db5(_0x5efc5c);})['catch'](function(_0x2e0192){logger[_0x1d1f('0x15')]('GetChatQueue',_0x2e0192[_0x1d1f('0x17')],_0x1a0742);_0x413c87(_0x131bc4[_0x1d1f('0x15')](0x1f4,_0x2e0192[_0x1d1f('0x17')]));});});};exports[_0x1d1f('0x25')]=function(_0x4503a3){var _0x44406f=this;return new Promise(function(_0x47178b,_0x456314){return db[_0x1d1f('0x1b')][_0x1d1f('0x26')]({'raw':_0x4503a3[_0x1d1f('0x1d')]?_0x4503a3[_0x1d1f('0x1d')][_0x1d1f('0x1e')]===undefined?!![]:![]:!![],'where':_0x4503a3[_0x1d1f('0x1d')]?_0x4503a3[_0x1d1f('0x1d')][_0x1d1f('0x1f')]||null:null,'attributes':_0x4503a3[_0x1d1f('0x1d')]?_0x4503a3[_0x1d1f('0x1d')][_0x1d1f('0x20')]||null:null,'include':_0x4503a3[_0x1d1f('0x1d')]?_0x4503a3[_0x1d1f('0x1d')][_0x1d1f('0x21')]?_[_0x1d1f('0x22')](_0x4503a3['options'][_0x1d1f('0x21')],function(_0x2211b9){return{'model':db[_0x2211b9[_0x1d1f('0x23')]],'as':_0x2211b9['as'],'attributes':_0x2211b9[_0x1d1f('0x20')],'include':_0x2211b9['include']?_['map'](_0x2211b9[_0x1d1f('0x21')],function(_0x35dcd7){return{'model':db[_0x35dcd7[_0x1d1f('0x23')]],'as':_0x35dcd7['as'],'attributes':_0x35dcd7[_0x1d1f('0x20')],'include':_0x35dcd7[_0x1d1f('0x21')]?_[_0x1d1f('0x22')](_0x35dcd7['include'],function(_0x1350cd){return{'model':db[_0x1350cd['model']],'as':_0x1350cd['as'],'attributes':_0x1350cd['attributes']};}):[]};}):[]};}):[]:[]})[_0x1d1f('0x10')](function(_0x1f4ffc){logger['info'](_0x1d1f('0x25'),_0x4503a3);logger[_0x1d1f('0x24')](_0x1d1f('0x25'),_0x4503a3,JSON['stringify'](_0x1f4ffc));_0x47178b(_0x1f4ffc);})[_0x1d1f('0x19')](function(_0x490c13){logger[_0x1d1f('0x15')]('ShowChatQueue',_0x490c13[_0x1d1f('0x17')],_0x4503a3);_0x456314(_0x44406f[_0x1d1f('0x15')](0x1f4,_0x490c13['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index bc61a07..2cf15d1 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 _0x6f0d=['update','emit','removeListener','length','save','remove'];(function(_0x53b0f8,_0x459130){var _0x133415=function(_0x37a4a5){while(--_0x37a4a5){_0x53b0f8['push'](_0x53b0f8['shift']());}};_0x133415(++_0x459130);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x23349c,_0x53ec66){_0x23349c=_0x23349c-0x0;var _0xfea7d8=_0x6f0d[_0x23349c];return _0xfea7d8;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xd6f0('0x0'),_0xd6f0('0x1'),_0xd6f0('0x2')];function createListener(_0x107a8c,_0x573473){return function(_0x275230){_0x573473[_0xd6f0('0x3')](_0x107a8c,_0x275230);};}function removeListener(_0x2f78fb,_0x25344b){return function(){ChatQueueEvents[_0xd6f0('0x4')](_0x2f78fb,_0x25344b);};}exports['register']=function(_0x2d2ce6){for(var _0x4a8b0c=0x0,_0xe21ac4=events[_0xd6f0('0x5')];_0x4a8b0c<_0xe21ac4;_0x4a8b0c++){var _0x8b89a9=events[_0x4a8b0c];var _0x1a48a0=createListener('chatQueue:'+_0x8b89a9,_0x2d2ce6);ChatQueueEvents['on'](_0x8b89a9,_0x1a48a0);}};
\ No newline at end of file
+var _0x9bde=['chatQueue:','save','update','emit','removeListener','register','length'];(function(_0x2c18a8,_0x24eaa5){var _0x1e009a=function(_0x5dea3a){while(--_0x5dea3a){_0x2c18a8['push'](_0x2c18a8['shift']());}};_0x1e009a(++_0x24eaa5);}(_0x9bde,0xe1));var _0xe9bd=function(_0xca6dd1,_0x383973){_0xca6dd1=_0xca6dd1-0x0;var _0x30b7bc=_0x9bde[_0xca6dd1];return _0x30b7bc;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe9bd('0x0'),'remove',_0xe9bd('0x1')];function createListener(_0x4c63ca,_0x51786f){return function(_0x3005aa){_0x51786f[_0xe9bd('0x2')](_0x4c63ca,_0x3005aa);};}function removeListener(_0x1c1b34,_0x10822d){return function(){ChatQueueEvents[_0xe9bd('0x3')](_0x1c1b34,_0x10822d);};}exports[_0xe9bd('0x4')]=function(_0x4fd7b8){for(var _0x4763e9=0x0,_0x5f18fe=events[_0xe9bd('0x5')];_0x4763e9<_0x5f18fe;_0x4763e9++){var _0xa66ae2=events[_0x4763e9];var _0x2d5c75=createListener(_0xe9bd('0x6')+_0xa66ae2,_0x4fd7b8);ChatQueueEvents['on'](_0xa66ae2,_0x2d5c75);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 4673804..341290b 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 _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(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5fc3,0xa8));var _0x35fc=function(_0x25d2fb,_0x18a774){_0x25d2fb=_0x25d2fb-0x0;var _0x1ded53=_0x5fc3[_0x25d2fb];return _0x1ded53;};'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
+var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x4e0871,_0x48a07f){var _0x5a72b0=function(_0x4f54ae){while(--_0x4f54ae){_0x4e0871['push'](_0x4e0871['shift']());}};_0x5a72b0(++_0x48a07f);}(_0x814b,0x1a2));var _0xb814=function(_0x502598,_0x1e95c8){_0x502598=_0x502598-0x0;var _0xbdee21=_0x814b[_0x502598];return _0xbdee21;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index ea1f7cf..5e369a4 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 _0xf5fd=['STRING','DATE','moment','exports'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xf5fd,0xbe));var _0xdf5f=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xf5fd[_0x2db12b];return _0x20990b;};'use strict';var moment=require(_0xdf5f('0x0'));var Sequelize=require('sequelize');module[_0xdf5f('0x1')]={'uniqueid':{'type':Sequelize[_0xdf5f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xdf5f('0x2')]},'joinAt':{'type':Sequelize[_0xdf5f('0x3')]},'leaveAt':{'type':Sequelize[_0xdf5f('0x3')]},'acceptAt':{'type':Sequelize[_0xdf5f('0x3')]},'exitAt':{'type':Sequelize[_0xdf5f('0x3')]},'reason':{'type':Sequelize[_0xdf5f('0x2')]}};
\ No newline at end of file
+var _0x3a00=['sequelize','exports','STRING','DATE'];(function(_0x5460aa,_0x48b3c3){var _0x66394d=function(_0x133e60){while(--_0x133e60){_0x5460aa['push'](_0x5460aa['shift']());}};_0x66394d(++_0x48b3c3);}(_0x3a00,0xfc));var _0x03a0=function(_0x1f1511,_0x4ea911){_0x1f1511=_0x1f1511-0x0;var _0x1d9ab8=_0x3a00[_0x1f1511];return _0x1d9ab8;};'use strict';var moment=require('moment');var Sequelize=require(_0x03a0('0x0'));module[_0x03a0('0x1')]={'uniqueid':{'type':Sequelize[_0x03a0('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x03a0('0x3')]},'leaveAt':{'type':Sequelize[_0x03a0('0x3')]},'acceptAt':{'type':Sequelize[_0x03a0('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x03a0('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index c7b811c..5907b0b 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 _0x8917=['length','nolimit','sort','where','pick','filter','merge','VIRTUAL','ChatQueueReport','includeAll','include','catch','show','params','keys','fields','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','update','destroy','then','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes'];(function(_0x2a884b,_0x658da6){var _0x141f83=function(_0x249ee3){while(--_0x249ee3){_0x2a884b['push'](_0x2a884b['shift']());}};_0x141f83(++_0x658da6);}(_0x8917,0x1d7));var _0x7891=function(_0x22dc19,_0x5c59b2){_0x22dc19=_0x22dc19-0x0;var _0x217133=_0x8917[_0x22dc19];return _0x217133;};'use strict';var emlformat=require(_0x7891('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7891('0x1'));var jsonpatch=require(_0x7891('0x2'));var rp=require(_0x7891('0x3'));var moment=require(_0x7891('0x4'));var BPromise=require(_0x7891('0x5'));var Mustache=require(_0x7891('0x6'));var util=require(_0x7891('0x7'));var path=require(_0x7891('0x8'));var sox=require(_0x7891('0x9'));var csv=require('to-csv');var ejs=require(_0x7891('0xa'));var fs=require('fs');var fs_extra=require(_0x7891('0xb'));var _=require(_0x7891('0xc'));var squel=require(_0x7891('0xd'));var crypto=require(_0x7891('0xe'));var jsforce=require(_0x7891('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7891('0x10'));var querystring=require('querystring');var Papa=require(_0x7891('0x11'));var Redis=require(_0x7891('0x12'));var authService=require(_0x7891('0x13'));var qs=require(_0x7891('0x14'));var as=require(_0x7891('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7891('0x16'))(_0x7891('0x17'));var utils=require(_0x7891('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7891('0x19'));var db=require(_0x7891('0x1a'))['db'];function respondWithStatusCode(_0x1a1dbc,_0x31692f){_0x31692f=_0x31692f||0xcc;return function(_0x1b481e){if(_0x1b481e){return _0x1a1dbc['sendStatus'](_0x31692f);}return _0x1a1dbc[_0x7891('0x1b')](_0x31692f)[_0x7891('0x1c')]();};}function respondWithResult(_0x2517f1,_0xc56bc0){_0xc56bc0=_0xc56bc0||0xc8;return function(_0x71e75c){if(_0x71e75c){return _0x2517f1[_0x7891('0x1b')](_0xc56bc0)['json'](_0x71e75c);}};}function respondWithFilteredResult(_0x1fa45b,_0x21a74f){return function(_0x5bfe12){if(_0x5bfe12){var _0x23286b=typeof _0x21a74f[_0x7891('0x1d')]==='undefined'&&typeof _0x21a74f[_0x7891('0x1e')]===_0x7891('0x1f');var _0x250f65=_0x5bfe12[_0x7891('0x20')];var _0x9ff8c2=_0x23286b?0x0:_0x21a74f[_0x7891('0x1d')];var _0x457f50=_0x23286b?_0x5bfe12[_0x7891('0x20')]:_0x21a74f[_0x7891('0x1d')]+_0x21a74f[_0x7891('0x1e')];var _0x20da1e;if(_0x457f50>=_0x250f65){_0x457f50=_0x250f65;_0x20da1e=0xc8;}else{_0x20da1e=0xce;}_0x1fa45b['status'](_0x20da1e);return _0x1fa45b['set'](_0x7891('0x21'),_0x9ff8c2+'-'+_0x457f50+'/'+_0x250f65)[_0x7891('0x22')](_0x5bfe12);}return null;};}function patchUpdates(_0x30b2ae){return function(_0x4c76fe){try{jsonpatch['apply'](_0x4c76fe,_0x30b2ae,!![]);}catch(_0x19a628){return BPromise[_0x7891('0x23')](_0x19a628);}return _0x4c76fe[_0x7891('0x24')]();};}function saveUpdates(_0x36f66a,_0x155a97){return function(_0xf09f20){if(_0xf09f20){return _0xf09f20[_0x7891('0x25')](_0x36f66a)['then'](function(_0x28a917){return _0x28a917;});}return null;};}function removeEntity(_0xab091c,_0x27f2e0){return function(_0x2de356){if(_0x2de356){return _0x2de356[_0x7891('0x26')]()[_0x7891('0x27')](function(){_0xab091c[_0x7891('0x1b')](0xcc)[_0x7891('0x1c')]();});}};}function handleEntityNotFound(_0x24372f,_0x2acda5){return function(_0x55108b){if(!_0x55108b){_0x24372f[_0x7891('0x28')](0x194);}return _0x55108b;};}function handleError(_0x369740,_0x397d03){_0x397d03=_0x397d03||0x1f4;return function(_0x12ed70){logger['error'](_0x12ed70[_0x7891('0x29')]);if(_0x12ed70['name']){delete _0x12ed70[_0x7891('0x2a')];}_0x369740[_0x7891('0x1b')](_0x397d03)[_0x7891('0x2b')](_0x12ed70);};}exports['index']=function(_0x4009f8,_0x1a6bef){var _0x44442f={},_0x263f13={},_0x27be75={'count':0x0,'rows':[]};var _0x2a72d2=_[_0x7891('0x2c')](db['ChatQueueReport'][_0x7891('0x2d')],function(_0x4bb7d7){return{'name':_0x4bb7d7[_0x7891('0x2e')],'type':_0x4bb7d7[_0x7891('0x2f')][_0x7891('0x30')]};});_0x263f13[_0x7891('0x31')]=_[_0x7891('0x2c')](_0x2a72d2,_0x7891('0x2a'));_0x263f13[_0x7891('0x32')]=_['keys'](_0x4009f8[_0x7891('0x32')]);_0x263f13[_0x7891('0x33')]=_[_0x7891('0x34')](_0x263f13[_0x7891('0x31')],_0x263f13[_0x7891('0x32')]);_0x44442f[_0x7891('0x35')]=_[_0x7891('0x34')](_0x263f13['model'],qs['fields'](_0x4009f8['query']['fields']));_0x44442f[_0x7891('0x35')]=_0x44442f[_0x7891('0x35')][_0x7891('0x36')]?_0x44442f[_0x7891('0x35')]:_0x263f13[_0x7891('0x31')];if(!_0x4009f8[_0x7891('0x32')]['hasOwnProperty'](_0x7891('0x37'))){_0x44442f[_0x7891('0x1e')]=qs[_0x7891('0x1e')](_0x4009f8[_0x7891('0x32')][_0x7891('0x1e')]);_0x44442f[_0x7891('0x1d')]=qs[_0x7891('0x1d')](_0x4009f8['query'][_0x7891('0x1d')]);}_0x44442f['order']=qs[_0x7891('0x38')](_0x4009f8['query'][_0x7891('0x38')]);_0x44442f[_0x7891('0x39')]=qs[_0x7891('0x33')](_[_0x7891('0x3a')](_0x4009f8[_0x7891('0x32')],_0x263f13['filters']),_0x2a72d2);if(_0x4009f8[_0x7891('0x32')][_0x7891('0x3b')]){_0x44442f[_0x7891('0x39')]=_[_0x7891('0x3c')](_0x44442f[_0x7891('0x39')],{'$or':_['map'](_0x2a72d2,function(_0x4e63ee){if(_0x4e63ee['type']!==_0x7891('0x3d')){var _0x30117f={};_0x30117f[_0x4e63ee[_0x7891('0x2a')]]={'$like':'%'+_0x4009f8[_0x7891('0x32')][_0x7891('0x3b')]+'%'};return _0x30117f;}})});}_0x44442f=_['merge']({},_0x44442f,_0x4009f8['options']);var _0x439e23={'where':_0x44442f[_0x7891('0x39')]};return db[_0x7891('0x3e')][_0x7891('0x20')](_0x439e23)['then'](function(_0x37503e){_0x27be75[_0x7891('0x20')]=_0x37503e;if(_0x4009f8[_0x7891('0x32')][_0x7891('0x3f')]){_0x44442f[_0x7891('0x40')]=[{'all':!![]}];}return db[_0x7891('0x3e')]['findAll'](_0x44442f);})['then'](function(_0x44cc49){_0x27be75['rows']=_0x44cc49;return _0x27be75;})[_0x7891('0x27')](respondWithFilteredResult(_0x1a6bef,_0x44442f))[_0x7891('0x41')](handleError(_0x1a6bef,null));};exports[_0x7891('0x42')]=function(_0x527420,_0x4a83ae){var _0x29a55b={'raw':!![],'where':{'id':_0x527420[_0x7891('0x43')]['id']}},_0xe65246={};_0xe65246[_0x7891('0x31')]=_[_0x7891('0x44')](db['ChatQueueReport']['rawAttributes']);_0xe65246[_0x7891('0x32')]=_['keys'](_0x527420[_0x7891('0x32')]);_0xe65246['filters']=_[_0x7891('0x34')](_0xe65246[_0x7891('0x31')],_0xe65246[_0x7891('0x32')]);_0x29a55b['attributes']=_[_0x7891('0x34')](_0xe65246[_0x7891('0x31')],qs[_0x7891('0x45')](_0x527420[_0x7891('0x32')]['fields']));_0x29a55b[_0x7891('0x35')]=_0x29a55b[_0x7891('0x35')]['length']?_0x29a55b['attributes']:_0xe65246[_0x7891('0x31')];if(_0x527420['query'][_0x7891('0x3f')]){_0x29a55b[_0x7891('0x40')]=[{'all':!![]}];}_0x29a55b=_[_0x7891('0x3c')]({},_0x29a55b,_0x527420[_0x7891('0x46')]);return db['ChatQueueReport'][_0x7891('0x47')](_0x29a55b)['then'](handleEntityNotFound(_0x4a83ae,null))['then'](respondWithResult(_0x4a83ae,null))['catch'](handleError(_0x4a83ae,null));};exports[_0x7891('0x48')]=function(_0x15a6d8,_0x12099c){return db[_0x7891('0x3e')]['create'](_0x15a6d8[_0x7891('0x49')],{})[_0x7891('0x27')](respondWithResult(_0x12099c,0xc9))[_0x7891('0x41')](handleError(_0x12099c,null));};exports[_0x7891('0x25')]=function(_0xa637bc,_0x551aa9){if(_0xa637bc['body']['id']){delete _0xa637bc[_0x7891('0x49')]['id'];}return db['ChatQueueReport'][_0x7891('0x47')]({'where':{'id':_0xa637bc['params']['id']}})[_0x7891('0x27')](handleEntityNotFound(_0x551aa9,null))[_0x7891('0x27')](saveUpdates(_0xa637bc[_0x7891('0x49')],null))[_0x7891('0x27')](respondWithResult(_0x551aa9,null))[_0x7891('0x41')](handleError(_0x551aa9,null));};exports[_0x7891('0x26')]=function(_0x425cd1,_0x3830af){return db[_0x7891('0x3e')][_0x7891('0x47')]({'where':{'id':_0x425cd1[_0x7891('0x43')]['id']}})[_0x7891('0x27')](handleEntityNotFound(_0x3830af,null))[_0x7891('0x27')](removeEntity(_0x3830af,null))[_0x7891('0x41')](handleError(_0x3830af,null));};exports[_0x7891('0x4a')]=function(_0x3aa4da,_0x51a6fc){return db[_0x7891('0x3e')][_0x7891('0x4a')]()[_0x7891('0x27')](respondWithResult(_0x51a6fc,null))[_0x7891('0x41')](handleError(_0x51a6fc,null));};
\ No newline at end of file
+var _0x8c46=['filter','VIRTUAL','merge','options','include','ChatQueueReport','rows','catch','includeAll','find','create','body','params','describe','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick'];(function(_0x4be325,_0x13dd05){var _0x5cdfd0=function(_0x3feb99){while(--_0x3feb99){_0x4be325['push'](_0x4be325['shift']());}};_0x5cdfd0(++_0x13dd05);}(_0x8c46,0x171));var _0x68c4=function(_0x3b76ae,_0x1f110e){_0x3b76ae=_0x3b76ae-0x0;var _0x11ab0f=_0x8c46[_0x3b76ae];return _0x11ab0f;};'use strict';var emlformat=require(_0x68c4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x68c4('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x68c4('0x2'));var Mustache=require(_0x68c4('0x3'));var util=require(_0x68c4('0x4'));var path=require(_0x68c4('0x5'));var sox=require(_0x68c4('0x6'));var csv=require(_0x68c4('0x7'));var ejs=require(_0x68c4('0x8'));var fs=require('fs');var fs_extra=require(_0x68c4('0x9'));var _=require(_0x68c4('0xa'));var squel=require(_0x68c4('0xb'));var crypto=require('crypto');var jsforce=require(_0x68c4('0xc'));var deskjs=require(_0x68c4('0xd'));var toCsv=require(_0x68c4('0x7'));var querystring=require('querystring');var Papa=require(_0x68c4('0xe'));var Redis=require(_0x68c4('0xf'));var authService=require(_0x68c4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68c4('0x11'));var logger=require(_0x68c4('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x68c4('0x13'));var licenseUtil=require(_0x68c4('0x14'));var db=require(_0x68c4('0x15'))['db'];function respondWithStatusCode(_0x48783b,_0x3a432a){_0x3a432a=_0x3a432a||0xcc;return function(_0x1f5f42){if(_0x1f5f42){return _0x48783b[_0x68c4('0x16')](_0x3a432a);}return _0x48783b['status'](_0x3a432a)[_0x68c4('0x17')]();};}function respondWithResult(_0x14919c,_0x5e1341){_0x5e1341=_0x5e1341||0xc8;return function(_0x52f031){if(_0x52f031){return _0x14919c[_0x68c4('0x18')](_0x5e1341)[_0x68c4('0x19')](_0x52f031);}};}function respondWithFilteredResult(_0x5be0de,_0xc25f7b){return function(_0x4ea2a4){if(_0x4ea2a4){var _0x1a7045=typeof _0xc25f7b['offset']==='undefined'&&typeof _0xc25f7b[_0x68c4('0x1a')]===_0x68c4('0x1b');var _0x4f4797=_0x4ea2a4[_0x68c4('0x1c')];var _0x1d757c=_0x1a7045?0x0:_0xc25f7b[_0x68c4('0x1d')];var _0x33c5c5=_0x1a7045?_0x4ea2a4[_0x68c4('0x1c')]:_0xc25f7b[_0x68c4('0x1d')]+_0xc25f7b[_0x68c4('0x1a')];var _0x415ef2;if(_0x33c5c5>=_0x4f4797){_0x33c5c5=_0x4f4797;_0x415ef2=0xc8;}else{_0x415ef2=0xce;}_0x5be0de[_0x68c4('0x18')](_0x415ef2);return _0x5be0de[_0x68c4('0x1e')](_0x68c4('0x1f'),_0x1d757c+'-'+_0x33c5c5+'/'+_0x4f4797)['json'](_0x4ea2a4);}return null;};}function patchUpdates(_0x398a71){return function(_0x4edf9f){try{jsonpatch['apply'](_0x4edf9f,_0x398a71,!![]);}catch(_0x34d3a6){return BPromise[_0x68c4('0x20')](_0x34d3a6);}return _0x4edf9f[_0x68c4('0x21')]();};}function saveUpdates(_0x42f0bc,_0x5b8135){return function(_0x35e865){if(_0x35e865){return _0x35e865[_0x68c4('0x22')](_0x42f0bc)['then'](function(_0x201742){return _0x201742;});}return null;};}function removeEntity(_0x392ccf,_0x45f9be){return function(_0x10278e){if(_0x10278e){return _0x10278e[_0x68c4('0x23')]()[_0x68c4('0x24')](function(){_0x392ccf[_0x68c4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ff4a5,_0x55355d){return function(_0xf16a78){if(!_0xf16a78){_0x2ff4a5[_0x68c4('0x16')](0x194);}return _0xf16a78;};}function handleError(_0x57f32,_0x4f9d32){_0x4f9d32=_0x4f9d32||0x1f4;return function(_0x1e14db){logger[_0x68c4('0x25')](_0x1e14db[_0x68c4('0x26')]);if(_0x1e14db[_0x68c4('0x27')]){delete _0x1e14db[_0x68c4('0x27')];}_0x57f32[_0x68c4('0x18')](_0x4f9d32)[_0x68c4('0x28')](_0x1e14db);};}exports['index']=function(_0x26d56b,_0x4b4634){var _0x3772b3={},_0x1442ba={},_0x56ed70={'count':0x0,'rows':[]};var _0x2847d1=_[_0x68c4('0x29')](db['ChatQueueReport'][_0x68c4('0x2a')],function(_0x3a1b69){return{'name':_0x3a1b69[_0x68c4('0x2b')],'type':_0x3a1b69[_0x68c4('0x2c')][_0x68c4('0x2d')]};});_0x1442ba[_0x68c4('0x2e')]=_[_0x68c4('0x29')](_0x2847d1,_0x68c4('0x27'));_0x1442ba[_0x68c4('0x2f')]=_[_0x68c4('0x30')](_0x26d56b[_0x68c4('0x2f')]);_0x1442ba[_0x68c4('0x31')]=_[_0x68c4('0x32')](_0x1442ba[_0x68c4('0x2e')],_0x1442ba[_0x68c4('0x2f')]);_0x3772b3[_0x68c4('0x33')]=_[_0x68c4('0x32')](_0x1442ba[_0x68c4('0x2e')],qs['fields'](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x34')]));_0x3772b3[_0x68c4('0x33')]=_0x3772b3[_0x68c4('0x33')][_0x68c4('0x35')]?_0x3772b3['attributes']:_0x1442ba[_0x68c4('0x2e')];if(!_0x26d56b['query']['hasOwnProperty']('nolimit')){_0x3772b3[_0x68c4('0x1a')]=qs[_0x68c4('0x1a')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x1a')]);_0x3772b3['offset']=qs[_0x68c4('0x1d')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x1d')]);}_0x3772b3['order']=qs[_0x68c4('0x36')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x36')]);_0x3772b3[_0x68c4('0x37')]=qs[_0x68c4('0x31')](_[_0x68c4('0x38')](_0x26d56b[_0x68c4('0x2f')],_0x1442ba[_0x68c4('0x31')]),_0x2847d1);if(_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x39')]){_0x3772b3['where']=_['merge'](_0x3772b3[_0x68c4('0x37')],{'$or':_[_0x68c4('0x29')](_0x2847d1,function(_0x460e11){if(_0x460e11[_0x68c4('0x2c')]!==_0x68c4('0x3a')){var _0x13386d={};_0x13386d[_0x460e11[_0x68c4('0x27')]]={'$like':'%'+_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x39')]+'%'};return _0x13386d;}})});}_0x3772b3=_[_0x68c4('0x3b')]({},_0x3772b3,_0x26d56b[_0x68c4('0x3c')]);var _0x30a1cd={'where':_0x3772b3[_0x68c4('0x37')]};return db['ChatQueueReport']['count'](_0x30a1cd)[_0x68c4('0x24')](function(_0x2785b4){_0x56ed70[_0x68c4('0x1c')]=_0x2785b4;if(_0x26d56b[_0x68c4('0x2f')]['includeAll']){_0x3772b3[_0x68c4('0x3d')]=[{'all':!![]}];}return db[_0x68c4('0x3e')]['findAll'](_0x3772b3);})['then'](function(_0x4c564a){_0x56ed70[_0x68c4('0x3f')]=_0x4c564a;return _0x56ed70;})['then'](respondWithFilteredResult(_0x4b4634,_0x3772b3))[_0x68c4('0x40')](handleError(_0x4b4634,null));};exports['show']=function(_0x18da6f,_0x2406b1){var _0xbd848f={'raw':!![],'where':{'id':_0x18da6f['params']['id']}},_0xefe68d={};_0xefe68d[_0x68c4('0x2e')]=_[_0x68c4('0x30')](db[_0x68c4('0x3e')][_0x68c4('0x2a')]);_0xefe68d['query']=_[_0x68c4('0x30')](_0x18da6f[_0x68c4('0x2f')]);_0xefe68d[_0x68c4('0x31')]=_[_0x68c4('0x32')](_0xefe68d[_0x68c4('0x2e')],_0xefe68d['query']);_0xbd848f['attributes']=_['intersection'](_0xefe68d[_0x68c4('0x2e')],qs[_0x68c4('0x34')](_0x18da6f[_0x68c4('0x2f')][_0x68c4('0x34')]));_0xbd848f['attributes']=_0xbd848f[_0x68c4('0x33')][_0x68c4('0x35')]?_0xbd848f[_0x68c4('0x33')]:_0xefe68d[_0x68c4('0x2e')];if(_0x18da6f[_0x68c4('0x2f')][_0x68c4('0x41')]){_0xbd848f[_0x68c4('0x3d')]=[{'all':!![]}];}_0xbd848f=_[_0x68c4('0x3b')]({},_0xbd848f,_0x18da6f[_0x68c4('0x3c')]);return db[_0x68c4('0x3e')][_0x68c4('0x42')](_0xbd848f)['then'](handleEntityNotFound(_0x2406b1,null))[_0x68c4('0x24')](respondWithResult(_0x2406b1,null))['catch'](handleError(_0x2406b1,null));};exports[_0x68c4('0x43')]=function(_0x44e3c9,_0x463a6b){return db[_0x68c4('0x3e')]['create'](_0x44e3c9[_0x68c4('0x44')],{})['then'](respondWithResult(_0x463a6b,0xc9))[_0x68c4('0x40')](handleError(_0x463a6b,null));};exports[_0x68c4('0x22')]=function(_0x570e25,_0x250941){if(_0x570e25[_0x68c4('0x44')]['id']){delete _0x570e25[_0x68c4('0x44')]['id'];}return db[_0x68c4('0x3e')][_0x68c4('0x42')]({'where':{'id':_0x570e25[_0x68c4('0x45')]['id']}})['then'](handleEntityNotFound(_0x250941,null))[_0x68c4('0x24')](saveUpdates(_0x570e25[_0x68c4('0x44')],null))[_0x68c4('0x24')](respondWithResult(_0x250941,null))[_0x68c4('0x40')](handleError(_0x250941,null));};exports['destroy']=function(_0x40ecf6,_0x19aec2){return db[_0x68c4('0x3e')][_0x68c4('0x42')]({'where':{'id':_0x40ecf6[_0x68c4('0x45')]['id']}})[_0x68c4('0x24')](handleEntityNotFound(_0x19aec2,null))['then'](removeEntity(_0x19aec2,null))[_0x68c4('0x40')](handleError(_0x19aec2,null));};exports[_0x68c4('0x46')]=function(_0x3db854,_0x51db14){return db[_0x68c4('0x3e')][_0x68c4('0x46')]()['then'](respondWithResult(_0x51db14,null))['catch'](handleError(_0x51db14,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 39bb34d..6ba259c 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x522c6d,_0x4d250d){var _0x26300d=function(_0x3ab228){while(--_0x3ab228){_0x522c6d['push'](_0x522c6d['shift']());}};_0x26300d(++_0x4d250d);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c1ade,_0xaa1212){_0x5c1ade=_0x5c1ade-0x0;var _0x4980b4=_0xb10b[_0x5c1ade];return _0x4980b4;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 752318b..758a926 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 _0xb05e=['rpc','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0xb05e,0x83));var _0xeb05=function(_0x34c909,_0x50ad00){_0x34c909=_0x34c909-0x0;var _0x3683c4=_0xb05e[_0x34c909];return _0x3683c4;};'use strict';var _=require(_0xeb05('0x0'));var util=require(_0xeb05('0x1'));var moment=require(_0xeb05('0x2'));var BPromise=require(_0xeb05('0x3'));var rs=require(_0xeb05('0x4'));var fs=require('fs');var Redis=require(_0xeb05('0x5'));var db=require(_0xeb05('0x6'))['db'];var utils=require(_0xeb05('0x7'));var logger=require(_0xeb05('0x8'))(_0xeb05('0x9'));var config=require(_0xeb05('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xeb05('0xb')][_0xeb05('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x333779,_0x23b19c,_0x5ee0a4){return new BPromise(function(_0x41f10d,_0x4fe11c){return client[_0xeb05('0xd')](_0x333779,_0x5ee0a4)[_0xeb05('0xe')](function(_0x1722f8){logger[_0xeb05('0xf')](_0xeb05('0x10'),_0x23b19c,_0xeb05('0x11'));logger[_0xeb05('0x12')](_0xeb05('0x13'),_0x23b19c,_0xeb05('0x11'),JSON[_0xeb05('0x14')](_0x1722f8));if(_0x1722f8[_0xeb05('0x15')]){if(_0x1722f8['error'][_0xeb05('0x16')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x23b19c,_0x1722f8['error']['message']);return _0x4fe11c(_0x1722f8['error'][_0xeb05('0x17')]);}logger[_0xeb05('0x15')](_0xeb05('0x10'),_0x23b19c,_0x1722f8['error'][_0xeb05('0x17')]);return _0x41f10d(_0x1722f8['error'][_0xeb05('0x17')]);}else{logger[_0xeb05('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x23b19c,_0xeb05('0x11'));_0x41f10d(_0x1722f8[_0xeb05('0x18')][_0xeb05('0x17')]);}})['catch'](function(_0x86cf91){logger[_0xeb05('0x15')](_0xeb05('0x10'),_0x23b19c,_0x86cf91);_0x4fe11c(_0x86cf91);});});}exports[_0xeb05('0x19')]=function(_0x2d47ae){var _0x5ce6ad=this;return new Promise(function(_0xd7b936,_0x4f87fe){return db[_0xeb05('0x1a')][_0xeb05('0x1b')](_0x2d47ae[_0xeb05('0x1c')],{'raw':_0x2d47ae[_0xeb05('0x1d')]?_0x2d47ae[_0xeb05('0x1d')][_0xeb05('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x23fd39){logger[_0xeb05('0xf')](_0xeb05('0x19'),_0x2d47ae);logger[_0xeb05('0x12')](_0xeb05('0x19'),_0x2d47ae,JSON[_0xeb05('0x14')](_0x23fd39));_0xd7b936(_0x23fd39);})['catch'](function(_0x340b84){logger[_0xeb05('0x15')]('CreateChatQueueReport',_0x340b84[_0xeb05('0x17')],_0x2d47ae);_0x4f87fe(_0x5ce6ad[_0xeb05('0x15')](0x1f4,_0x340b84[_0xeb05('0x17')]));});});};exports[_0xeb05('0x1f')]=function(_0x350482){var _0x8325f8=this;return new Promise(function(_0x303d2d,_0x24816c){return db[_0xeb05('0x1a')][_0xeb05('0x20')](_0x350482[_0xeb05('0x1c')],{'raw':_0x350482['options']?_0x350482[_0xeb05('0x1d')][_0xeb05('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x350482[_0xeb05('0x1d')]?_0x350482[_0xeb05('0x1d')]['where']||null:null,'attributes':_0x350482[_0xeb05('0x1d')]?_0x350482[_0xeb05('0x1d')][_0xeb05('0x21')]||null:null,'limit':_0x350482['options']?_0x350482[_0xeb05('0x1d')][_0xeb05('0x22')]||null:null})['then'](function(_0x1744d8){logger['info'](_0xeb05('0x1f'),_0x350482);logger['debug'](_0xeb05('0x1f'),_0x350482,JSON[_0xeb05('0x14')](_0x1744d8));_0x303d2d(_0x1744d8);})['catch'](function(_0x2a337b){logger['error']('UpdateChatQueueReport',_0x2a337b['message'],_0x350482);_0x24816c(_0x8325f8['error'](0x1f4,_0x2a337b[_0xeb05('0x17')]));});});};
\ No newline at end of file
+var _0x026b=['body','options','raw','UpdateChatQueueReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x026b,0x17d));var _0xb026=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0x026b[_0x2d89ce];return _0x3fad10;};'use strict';var _=require(_0xb026('0x0'));var util=require(_0xb026('0x1'));var moment=require(_0xb026('0x2'));var BPromise=require(_0xb026('0x3'));var rs=require(_0xb026('0x4'));var fs=require('fs');var Redis=require(_0xb026('0x5'));var db=require(_0xb026('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb026('0x7'))(_0xb026('0x8'));var config=require(_0xb026('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb026('0xa')][_0xb026('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a3dd3,_0x51cc4d,_0x27e173){return new BPromise(function(_0xc37ac6,_0x358fd6){return client[_0xb026('0xc')](_0x4a3dd3,_0x27e173)[_0xb026('0xd')](function(_0x198cc3){logger[_0xb026('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x51cc4d,_0xb026('0xf'));logger[_0xb026('0x10')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x51cc4d,_0xb026('0xf'),JSON[_0xb026('0x11')](_0x198cc3));if(_0x198cc3[_0xb026('0x12')]){if(_0x198cc3['error'][_0xb026('0x13')]===0x1f4){logger[_0xb026('0x12')](_0xb026('0x14'),_0x51cc4d,_0x198cc3[_0xb026('0x12')][_0xb026('0x15')]);return _0x358fd6(_0x198cc3['error']['message']);}logger['error'](_0xb026('0x14'),_0x51cc4d,_0x198cc3[_0xb026('0x12')][_0xb026('0x15')]);return _0xc37ac6(_0x198cc3[_0xb026('0x12')][_0xb026('0x15')]);}else{logger[_0xb026('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x51cc4d,_0xb026('0xf'));_0xc37ac6(_0x198cc3[_0xb026('0x16')][_0xb026('0x15')]);}})[_0xb026('0x17')](function(_0x21a8ce){logger[_0xb026('0x12')](_0xb026('0x14'),_0x51cc4d,_0x21a8ce);_0x358fd6(_0x21a8ce);});});}exports[_0xb026('0x18')]=function(_0x1fdf31){var _0x293e80=this;return new Promise(function(_0x105a4d,_0x1016e5){return db[_0xb026('0x19')][_0xb026('0x1a')](_0x1fdf31[_0xb026('0x1b')],{'raw':_0x1fdf31['options']?_0x1fdf31[_0xb026('0x1c')][_0xb026('0x1d')]===undefined?!![]:![]:!![]})[_0xb026('0xd')](function(_0x29588d){logger[_0xb026('0xe')]('CreateChatQueueReport',_0x1fdf31);logger[_0xb026('0x10')]('CreateChatQueueReport',_0x1fdf31,JSON[_0xb026('0x11')](_0x29588d));_0x105a4d(_0x29588d);})[_0xb026('0x17')](function(_0x652518){logger[_0xb026('0x12')](_0xb026('0x18'),_0x652518[_0xb026('0x15')],_0x1fdf31);_0x1016e5(_0x293e80[_0xb026('0x12')](0x1f4,_0x652518['message']));});});};exports[_0xb026('0x1e')]=function(_0x194988){var _0x220622=this;return new Promise(function(_0x178d26,_0x2bff89){return db['ChatQueueReport'][_0xb026('0x1f')](_0x194988[_0xb026('0x1b')],{'raw':_0x194988[_0xb026('0x1c')]?_0x194988[_0xb026('0x1c')][_0xb026('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x194988[_0xb026('0x1c')]?_0x194988[_0xb026('0x1c')][_0xb026('0x20')]||null:null,'attributes':_0x194988[_0xb026('0x1c')]?_0x194988[_0xb026('0x1c')]['attributes']||null:null,'limit':_0x194988[_0xb026('0x1c')]?_0x194988[_0xb026('0x1c')][_0xb026('0x21')]||null:null})[_0xb026('0xd')](function(_0x402e24){logger[_0xb026('0xe')](_0xb026('0x1e'),_0x194988);logger[_0xb026('0x10')](_0xb026('0x1e'),_0x194988,JSON[_0xb026('0x11')](_0x402e24));_0x178d26(_0x402e24);})[_0xb026('0x17')](function(_0x31a5f3){logger['error'](_0xb026('0x1e'),_0x31a5f3[_0xb026('0x15')],_0x194988);_0x2bff89(_0x220622['error'](0x1f4,_0x31a5f3[_0xb026('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 5794cdc..34dcadb 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 _0xffcd=['isAuthenticated','/describe','describe','/:id','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x51d6f9,_0x542c63){var _0x4281e0=function(_0x3b3d47){while(--_0x3b3d47){_0x51d6f9['push'](_0x51d6f9['shift']());}};_0x4281e0(++_0x542c63);}(_0xffcd,0x1ab));var _0xdffc=function(_0x430d8d,_0x6a388a){_0x430d8d=_0x430d8d-0x0;var _0x1476f3=_0xffcd[_0x430d8d];return _0x1476f3;};'use strict';var multer=require(_0xdffc('0x0'));var util=require(_0xdffc('0x1'));var path=require(_0xdffc('0x2'));var timeout=require(_0xdffc('0x3'));var express=require(_0xdffc('0x4'));var router=express[_0xdffc('0x5')]();var fs_extra=require(_0xdffc('0x6'));var auth=require(_0xdffc('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdffc('0x8'));var controller=require('./chatQueueReport.controller');router[_0xdffc('0x9')]('/',auth[_0xdffc('0xa')](),controller['index']);router['get'](_0xdffc('0xb'),auth[_0xdffc('0xa')](),controller[_0xdffc('0xc')]);router[_0xdffc('0x9')](_0xdffc('0xd'),auth[_0xdffc('0xa')](),controller['show']);router[_0xdffc('0xe')]('/',auth[_0xdffc('0xa')](),controller[_0xdffc('0xf')]);router['put'](_0xdffc('0xd'),auth['isAuthenticated'](),controller[_0xdffc('0x10')]);router[_0xdffc('0x11')](_0xdffc('0xd'),auth[_0xdffc('0xa')](),controller['destroy']);module[_0xdffc('0x12')]=router;
\ No newline at end of file
+var _0xb620=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','multer','util','path','connect-timeout'];(function(_0x333df5,_0x3c8b60){var _0x4ec1e3=function(_0x10d9f6){while(--_0x10d9f6){_0x333df5['push'](_0x333df5['shift']());}};_0x4ec1e3(++_0x3c8b60);}(_0xb620,0x88));var _0x0b62=function(_0x1438a5,_0x12ce4c){_0x1438a5=_0x1438a5-0x0;var _0x23ca93=_0xb620[_0x1438a5];return _0x23ca93;};'use strict';var multer=require(_0x0b62('0x0'));var util=require(_0x0b62('0x1'));var path=require(_0x0b62('0x2'));var timeout=require(_0x0b62('0x3'));var express=require(_0x0b62('0x4'));var router=express['Router']();var fs_extra=require(_0x0b62('0x5'));var auth=require(_0x0b62('0x6'));var interaction=require(_0x0b62('0x7'));var config=require(_0x0b62('0x8'));var controller=require(_0x0b62('0x9'));router[_0x0b62('0xa')]('/',auth[_0x0b62('0xb')](),controller[_0x0b62('0xc')]);router[_0x0b62('0xa')](_0x0b62('0xd'),auth['isAuthenticated'](),controller[_0x0b62('0xe')]);router[_0x0b62('0xa')](_0x0b62('0xf'),auth[_0x0b62('0xb')](),controller[_0x0b62('0x10')]);router['post']('/',auth[_0x0b62('0xb')](),controller['create']);router[_0x0b62('0x11')](_0x0b62('0xf'),auth[_0x0b62('0xb')](),controller['update']);router[_0x0b62('0x12')](_0x0b62('0xf'),auth[_0x0b62('0xb')](),controller[_0x0b62('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 fd49975..f1e8cbc 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x529472,_0x1ab233){var _0x5704df=function(_0x1e4685){while(--_0x1e4685){_0x529472['push'](_0x529472['shift']());}};_0x5704df(++_0x1ab233);}(_0x008c,0x188));var _0xc008=function(_0x581d53,_0x4ad997){_0x581d53=_0x581d53-0x0;var _0x56c2d8=_0x008c[_0x581d53];return _0x56c2d8;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0xcf2777,_0x10f996){var _0x374a2a=function(_0x3fd7e2){while(--_0x3fd7e2){_0xcf2777['push'](_0xcf2777['shift']());}};_0x374a2a(++_0x10f996);}(_0x70e0,0x17b));var _0x070e=function(_0x433129,_0x1d68f7){_0x433129=_0x433129-0x0;var _0x24f6b6=_0x70e0[_0x433129];return _0x24f6b6;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index c5723fc..5d46cc3 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 _0x3809=['offset','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','filter','where','options','includeAll','include','ChatTransferReport','findAll','rows','catch','show','params','merge','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count'];(function(_0x3fcfc5,_0x1f242d){var _0x5a07b0=function(_0x2209ab){while(--_0x2209ab){_0x3fcfc5['push'](_0x3fcfc5['shift']());}};_0x5a07b0(++_0x1f242d);}(_0x3809,0xc4));var _0x9380=function(_0x7b84ba,_0x2a8362){_0x7b84ba=_0x7b84ba-0x0;var _0x1c169c=_0x3809[_0x7b84ba];return _0x1c169c;};'use strict';var emlformat=require(_0x9380('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9380('0x1'));var jsonpatch=require(_0x9380('0x2'));var rp=require('request-promise');var moment=require(_0x9380('0x3'));var BPromise=require(_0x9380('0x4'));var Mustache=require(_0x9380('0x5'));var util=require('util');var path=require(_0x9380('0x6'));var sox=require(_0x9380('0x7'));var csv=require(_0x9380('0x8'));var ejs=require(_0x9380('0x9'));var fs=require('fs');var fs_extra=require(_0x9380('0xa'));var _=require(_0x9380('0xb'));var squel=require(_0x9380('0xc'));var crypto=require(_0x9380('0xd'));var jsforce=require(_0x9380('0xe'));var deskjs=require(_0x9380('0xf'));var toCsv=require(_0x9380('0x8'));var querystring=require(_0x9380('0x10'));var Papa=require(_0x9380('0x11'));var Redis=require(_0x9380('0x12'));var authService=require(_0x9380('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9380('0x14'));var hardwareService=require(_0x9380('0x15'));var logger=require('../../config/logger')(_0x9380('0x16'));var utils=require(_0x9380('0x17'));var config=require(_0x9380('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9380('0x19'))['db'];function respondWithStatusCode(_0x2fc892,_0x289f43){_0x289f43=_0x289f43||0xcc;return function(_0xf90dc4){if(_0xf90dc4){return _0x2fc892[_0x9380('0x1a')](_0x289f43);}return _0x2fc892[_0x9380('0x1b')](_0x289f43)['end']();};}function respondWithResult(_0x27cefb,_0x5a8526){_0x5a8526=_0x5a8526||0xc8;return function(_0xe23b9f){if(_0xe23b9f){return _0x27cefb['status'](_0x5a8526)[_0x9380('0x1c')](_0xe23b9f);}};}function respondWithFilteredResult(_0x46d71f,_0x488334){return function(_0x27966e){if(_0x27966e){var _0x140f42=typeof _0x488334['offset']===_0x9380('0x1d')&&typeof _0x488334[_0x9380('0x1e')]===_0x9380('0x1d');var _0x68fb79=_0x27966e[_0x9380('0x1f')];var _0x5bab14=_0x140f42?0x0:_0x488334[_0x9380('0x20')];var _0x45dbfc=_0x140f42?_0x27966e['count']:_0x488334['offset']+_0x488334[_0x9380('0x1e')];var _0xdc6421;if(_0x45dbfc>=_0x68fb79){_0x45dbfc=_0x68fb79;_0xdc6421=0xc8;}else{_0xdc6421=0xce;}_0x46d71f['status'](_0xdc6421);return _0x46d71f['set'](_0x9380('0x21'),_0x5bab14+'-'+_0x45dbfc+'/'+_0x68fb79)[_0x9380('0x1c')](_0x27966e);}return null;};}function patchUpdates(_0x1d2818){return function(_0x47e247){try{jsonpatch[_0x9380('0x22')](_0x47e247,_0x1d2818,!![]);}catch(_0x148f41){return BPromise[_0x9380('0x23')](_0x148f41);}return _0x47e247[_0x9380('0x24')]();};}function saveUpdates(_0xf0455b,_0x40167b){return function(_0x3d3247){if(_0x3d3247){return _0x3d3247[_0x9380('0x25')](_0xf0455b)[_0x9380('0x26')](function(_0x40840f){return _0x40840f;});}return null;};}function removeEntity(_0x1d77b0,_0x1ce271){return function(_0x30f168){if(_0x30f168){return _0x30f168[_0x9380('0x27')]()['then'](function(){_0x1d77b0[_0x9380('0x1b')](0xcc)[_0x9380('0x28')]();});}};}function handleEntityNotFound(_0x2c70b3,_0x2658ba){return function(_0x3d9b45){if(!_0x3d9b45){_0x2c70b3[_0x9380('0x1a')](0x194);}return _0x3d9b45;};}function handleError(_0x17ae84,_0x3b1155){_0x3b1155=_0x3b1155||0x1f4;return function(_0x21def3){logger[_0x9380('0x29')](_0x21def3[_0x9380('0x2a')]);if(_0x21def3[_0x9380('0x2b')]){delete _0x21def3['name'];}_0x17ae84['status'](_0x3b1155)[_0x9380('0x2c')](_0x21def3);};}exports[_0x9380('0x2d')]=function(_0x29abb3,_0x2d9b84){var _0x22aa01={},_0x5339a3={},_0xfca143={'count':0x0,'rows':[]};var _0x4201a7=_[_0x9380('0x2e')](db['ChatTransferReport'][_0x9380('0x2f')],function(_0x28f52b){return{'name':_0x28f52b[_0x9380('0x30')],'type':_0x28f52b[_0x9380('0x31')][_0x9380('0x32')]};});_0x5339a3[_0x9380('0x33')]=_['map'](_0x4201a7,'name');_0x5339a3[_0x9380('0x34')]=_[_0x9380('0x35')](_0x29abb3[_0x9380('0x34')]);_0x5339a3['filters']=_[_0x9380('0x36')](_0x5339a3['model'],_0x5339a3[_0x9380('0x34')]);_0x22aa01[_0x9380('0x37')]=_[_0x9380('0x36')](_0x5339a3[_0x9380('0x33')],qs['fields'](_0x29abb3[_0x9380('0x34')][_0x9380('0x38')]));_0x22aa01[_0x9380('0x37')]=_0x22aa01['attributes'][_0x9380('0x39')]?_0x22aa01[_0x9380('0x37')]:_0x5339a3[_0x9380('0x33')];if(!_0x29abb3[_0x9380('0x34')]['hasOwnProperty'](_0x9380('0x3a'))){_0x22aa01['limit']=qs[_0x9380('0x1e')](_0x29abb3[_0x9380('0x34')]['limit']);_0x22aa01[_0x9380('0x20')]=qs[_0x9380('0x20')](_0x29abb3['query'][_0x9380('0x20')]);}_0x22aa01['order']=qs[_0x9380('0x3b')](_0x29abb3['query'][_0x9380('0x3b')]);_0x22aa01['where']=qs['filters'](_['pick'](_0x29abb3['query'],_0x5339a3['filters']),_0x4201a7);if(_0x29abb3[_0x9380('0x34')][_0x9380('0x3c')]){_0x22aa01[_0x9380('0x3d')]=_['merge'](_0x22aa01[_0x9380('0x3d')],{'$or':_[_0x9380('0x2e')](_0x4201a7,function(_0x2d2280){if(_0x2d2280['type']!=='VIRTUAL'){var _0x159974={};_0x159974[_0x2d2280[_0x9380('0x2b')]]={'$like':'%'+_0x29abb3[_0x9380('0x34')][_0x9380('0x3c')]+'%'};return _0x159974;}})});}_0x22aa01=_['merge']({},_0x22aa01,_0x29abb3[_0x9380('0x3e')]);var _0x4ec04b={'where':_0x22aa01['where']};return db['ChatTransferReport'][_0x9380('0x1f')](_0x4ec04b)[_0x9380('0x26')](function(_0x2d9b70){_0xfca143[_0x9380('0x1f')]=_0x2d9b70;if(_0x29abb3[_0x9380('0x34')][_0x9380('0x3f')]){_0x22aa01[_0x9380('0x40')]=[{'all':!![]}];}return db[_0x9380('0x41')][_0x9380('0x42')](_0x22aa01);})[_0x9380('0x26')](function(_0x543850){_0xfca143[_0x9380('0x43')]=_0x543850;return _0xfca143;})['then'](respondWithFilteredResult(_0x2d9b84,_0x22aa01))[_0x9380('0x44')](handleError(_0x2d9b84,null));};exports[_0x9380('0x45')]=function(_0x3f30e1,_0x2ad161){var _0x440ca5={'raw':!![],'where':{'id':_0x3f30e1[_0x9380('0x46')]['id']}},_0x380624={};_0x380624[_0x9380('0x33')]=_[_0x9380('0x35')](db[_0x9380('0x41')][_0x9380('0x2f')]);_0x380624[_0x9380('0x34')]=_[_0x9380('0x35')](_0x3f30e1['query']);_0x380624['filters']=_['intersection'](_0x380624['model'],_0x380624[_0x9380('0x34')]);_0x440ca5['attributes']=_[_0x9380('0x36')](_0x380624[_0x9380('0x33')],qs[_0x9380('0x38')](_0x3f30e1['query'][_0x9380('0x38')]));_0x440ca5[_0x9380('0x37')]=_0x440ca5[_0x9380('0x37')][_0x9380('0x39')]?_0x440ca5[_0x9380('0x37')]:_0x380624[_0x9380('0x33')];if(_0x3f30e1['query'][_0x9380('0x3f')]){_0x440ca5['include']=[{'all':!![]}];}_0x440ca5=_[_0x9380('0x47')]({},_0x440ca5,_0x3f30e1[_0x9380('0x3e')]);return db[_0x9380('0x41')][_0x9380('0x48')](_0x440ca5)[_0x9380('0x26')](handleEntityNotFound(_0x2ad161,null))[_0x9380('0x26')](respondWithResult(_0x2ad161,null))[_0x9380('0x44')](handleError(_0x2ad161,null));};exports[_0x9380('0x49')]=function(_0x1d5268,_0x15eedc){return db[_0x9380('0x41')][_0x9380('0x49')](_0x1d5268['body'],{})[_0x9380('0x26')](respondWithResult(_0x15eedc,0xc9))['catch'](handleError(_0x15eedc,null));};exports[_0x9380('0x25')]=function(_0x57ac7a,_0x488651){if(_0x57ac7a['body']['id']){delete _0x57ac7a['body']['id'];}return db['ChatTransferReport'][_0x9380('0x48')]({'where':{'id':_0x57ac7a[_0x9380('0x46')]['id']}})['then'](handleEntityNotFound(_0x488651,null))[_0x9380('0x26')](saveUpdates(_0x57ac7a[_0x9380('0x4a')],null))['then'](respondWithResult(_0x488651,null))['catch'](handleError(_0x488651,null));};exports[_0x9380('0x27')]=function(_0x4332a7,_0xfe2f5){return db[_0x9380('0x41')]['find']({'where':{'id':_0x4332a7[_0x9380('0x46')]['id']}})['then'](handleEntityNotFound(_0xfe2f5,null))[_0x9380('0x26')](removeEntity(_0xfe2f5,null))[_0x9380('0x44')](handleError(_0xfe2f5,null));};exports[_0x9380('0x4b')]=function(_0x1a645f,_0x31579a){return db['ChatTransferReport'][_0x9380('0x4b')]()['then'](respondWithResult(_0x31579a,null))[_0x9380('0x44')](handleError(_0x31579a,null));};
\ No newline at end of file
+var _0xfe23=['limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','ChatTransferReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','map','merge','options','includeAll','include','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','end','status','json','offset'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xfe23,0x19a));var _0x3fe2=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xfe23[_0x4e9628];return _0x27bc8c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3fe2('0x0'));var zipdir=require(_0x3fe2('0x1'));var jsonpatch=require(_0x3fe2('0x2'));var rp=require(_0x3fe2('0x3'));var moment=require(_0x3fe2('0x4'));var BPromise=require(_0x3fe2('0x5'));var Mustache=require(_0x3fe2('0x6'));var util=require(_0x3fe2('0x7'));var path=require(_0x3fe2('0x8'));var sox=require(_0x3fe2('0x9'));var csv=require('to-csv');var ejs=require(_0x3fe2('0xa'));var fs=require('fs');var fs_extra=require(_0x3fe2('0xb'));var _=require('lodash');var squel=require(_0x3fe2('0xc'));var crypto=require(_0x3fe2('0xd'));var jsforce=require(_0x3fe2('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3fe2('0xf'));var Redis=require(_0x3fe2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3fe2('0x11'));var as=require(_0x3fe2('0x12'));var hardwareService=require(_0x3fe2('0x13'));var logger=require(_0x3fe2('0x14'))(_0x3fe2('0x15'));var utils=require('../../config/utils');var config=require(_0x3fe2('0x16'));var licenseUtil=require(_0x3fe2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x748954,_0x58bcbb){_0x58bcbb=_0x58bcbb||0xcc;return function(_0x5cde5d){if(_0x5cde5d){return _0x748954['sendStatus'](_0x58bcbb);}return _0x748954['status'](_0x58bcbb)[_0x3fe2('0x18')]();};}function respondWithResult(_0x4e04da,_0x359ad9){_0x359ad9=_0x359ad9||0xc8;return function(_0x3c000a){if(_0x3c000a){return _0x4e04da[_0x3fe2('0x19')](_0x359ad9)[_0x3fe2('0x1a')](_0x3c000a);}};}function respondWithFilteredResult(_0x5705b4,_0x1b7078){return function(_0x3719af){if(_0x3719af){var _0x18c37a=typeof _0x1b7078[_0x3fe2('0x1b')]==='undefined'&&typeof _0x1b7078[_0x3fe2('0x1c')]===_0x3fe2('0x1d');var _0x5216a9=_0x3719af[_0x3fe2('0x1e')];var _0x49c64f=_0x18c37a?0x0:_0x1b7078[_0x3fe2('0x1b')];var _0x573acc=_0x18c37a?_0x3719af[_0x3fe2('0x1e')]:_0x1b7078['offset']+_0x1b7078['limit'];var _0x2a0f22;if(_0x573acc>=_0x5216a9){_0x573acc=_0x5216a9;_0x2a0f22=0xc8;}else{_0x2a0f22=0xce;}_0x5705b4[_0x3fe2('0x19')](_0x2a0f22);return _0x5705b4[_0x3fe2('0x1f')](_0x3fe2('0x20'),_0x49c64f+'-'+_0x573acc+'/'+_0x5216a9)['json'](_0x3719af);}return null;};}function patchUpdates(_0x1be4dc){return function(_0x2a7682){try{jsonpatch[_0x3fe2('0x21')](_0x2a7682,_0x1be4dc,!![]);}catch(_0x1bc7dc){return BPromise[_0x3fe2('0x22')](_0x1bc7dc);}return _0x2a7682[_0x3fe2('0x23')]();};}function saveUpdates(_0x27c8b6,_0x1351da){return function(_0x32b538){if(_0x32b538){return _0x32b538[_0x3fe2('0x24')](_0x27c8b6)[_0x3fe2('0x25')](function(_0x381949){return _0x381949;});}return null;};}function removeEntity(_0x430b80,_0x4449fc){return function(_0x34479c){if(_0x34479c){return _0x34479c[_0x3fe2('0x26')]()[_0x3fe2('0x25')](function(){_0x430b80['status'](0xcc)[_0x3fe2('0x18')]();});}};}function handleEntityNotFound(_0xf86eb4,_0x53408f){return function(_0x48f8d8){if(!_0x48f8d8){_0xf86eb4[_0x3fe2('0x27')](0x194);}return _0x48f8d8;};}function handleError(_0x23e147,_0x4f2f46){_0x4f2f46=_0x4f2f46||0x1f4;return function(_0x5503fa){logger[_0x3fe2('0x28')](_0x5503fa['stack']);if(_0x5503fa[_0x3fe2('0x29')]){delete _0x5503fa[_0x3fe2('0x29')];}_0x23e147[_0x3fe2('0x19')](_0x4f2f46)['send'](_0x5503fa);};}exports['index']=function(_0x58def4,_0x46c773){var _0x22ce4a={},_0x36553f={},_0x3acf20={'count':0x0,'rows':[]};var _0x5692dc=_['map'](db[_0x3fe2('0x2a')][_0x3fe2('0x2b')],function(_0x15eb3c){return{'name':_0x15eb3c['fieldName'],'type':_0x15eb3c[_0x3fe2('0x2c')]['key']};});_0x36553f[_0x3fe2('0x2d')]=_['map'](_0x5692dc,_0x3fe2('0x29'));_0x36553f[_0x3fe2('0x2e')]=_[_0x3fe2('0x2f')](_0x58def4[_0x3fe2('0x2e')]);_0x36553f['filters']=_[_0x3fe2('0x30')](_0x36553f[_0x3fe2('0x2d')],_0x36553f['query']);_0x22ce4a[_0x3fe2('0x31')]=_['intersection'](_0x36553f[_0x3fe2('0x2d')],qs[_0x3fe2('0x32')](_0x58def4[_0x3fe2('0x2e')]['fields']));_0x22ce4a[_0x3fe2('0x31')]=_0x22ce4a[_0x3fe2('0x31')][_0x3fe2('0x33')]?_0x22ce4a[_0x3fe2('0x31')]:_0x36553f['model'];if(!_0x58def4['query'][_0x3fe2('0x34')](_0x3fe2('0x35'))){_0x22ce4a[_0x3fe2('0x1c')]=qs[_0x3fe2('0x1c')](_0x58def4['query'][_0x3fe2('0x1c')]);_0x22ce4a[_0x3fe2('0x1b')]=qs[_0x3fe2('0x1b')](_0x58def4[_0x3fe2('0x2e')][_0x3fe2('0x1b')]);}_0x22ce4a[_0x3fe2('0x36')]=qs[_0x3fe2('0x37')](_0x58def4['query'][_0x3fe2('0x37')]);_0x22ce4a['where']=qs[_0x3fe2('0x38')](_[_0x3fe2('0x39')](_0x58def4[_0x3fe2('0x2e')],_0x36553f[_0x3fe2('0x38')]),_0x5692dc);if(_0x58def4[_0x3fe2('0x2e')][_0x3fe2('0x3a')]){_0x22ce4a[_0x3fe2('0x3b')]=_['merge'](_0x22ce4a[_0x3fe2('0x3b')],{'$or':_[_0x3fe2('0x3c')](_0x5692dc,function(_0x4ef281){if(_0x4ef281['type']!=='VIRTUAL'){var _0x772110={};_0x772110[_0x4ef281[_0x3fe2('0x29')]]={'$like':'%'+_0x58def4['query'][_0x3fe2('0x3a')]+'%'};return _0x772110;}})});}_0x22ce4a=_[_0x3fe2('0x3d')]({},_0x22ce4a,_0x58def4[_0x3fe2('0x3e')]);var _0x1dd4ab={'where':_0x22ce4a[_0x3fe2('0x3b')]};return db[_0x3fe2('0x2a')][_0x3fe2('0x1e')](_0x1dd4ab)['then'](function(_0x5d7568){_0x3acf20[_0x3fe2('0x1e')]=_0x5d7568;if(_0x58def4['query'][_0x3fe2('0x3f')]){_0x22ce4a[_0x3fe2('0x40')]=[{'all':!![]}];}return db[_0x3fe2('0x2a')]['findAll'](_0x22ce4a);})['then'](function(_0x123f23){_0x3acf20[_0x3fe2('0x41')]=_0x123f23;return _0x3acf20;})['then'](respondWithFilteredResult(_0x46c773,_0x22ce4a))[_0x3fe2('0x42')](handleError(_0x46c773,null));};exports[_0x3fe2('0x43')]=function(_0x11ba47,_0x140a17){var _0x549e86={'raw':!![],'where':{'id':_0x11ba47[_0x3fe2('0x44')]['id']}},_0x5713a9={};_0x5713a9[_0x3fe2('0x2d')]=_[_0x3fe2('0x2f')](db[_0x3fe2('0x2a')][_0x3fe2('0x2b')]);_0x5713a9[_0x3fe2('0x2e')]=_[_0x3fe2('0x2f')](_0x11ba47['query']);_0x5713a9['filters']=_[_0x3fe2('0x30')](_0x5713a9[_0x3fe2('0x2d')],_0x5713a9['query']);_0x549e86[_0x3fe2('0x31')]=_[_0x3fe2('0x30')](_0x5713a9[_0x3fe2('0x2d')],qs[_0x3fe2('0x32')](_0x11ba47[_0x3fe2('0x2e')][_0x3fe2('0x32')]));_0x549e86[_0x3fe2('0x31')]=_0x549e86['attributes'][_0x3fe2('0x33')]?_0x549e86[_0x3fe2('0x31')]:_0x5713a9[_0x3fe2('0x2d')];if(_0x11ba47[_0x3fe2('0x2e')][_0x3fe2('0x3f')]){_0x549e86[_0x3fe2('0x40')]=[{'all':!![]}];}_0x549e86=_[_0x3fe2('0x3d')]({},_0x549e86,_0x11ba47[_0x3fe2('0x3e')]);return db[_0x3fe2('0x2a')][_0x3fe2('0x45')](_0x549e86)[_0x3fe2('0x25')](handleEntityNotFound(_0x140a17,null))[_0x3fe2('0x25')](respondWithResult(_0x140a17,null))[_0x3fe2('0x42')](handleError(_0x140a17,null));};exports['create']=function(_0x174cb9,_0x4c7803){return db[_0x3fe2('0x2a')][_0x3fe2('0x46')](_0x174cb9[_0x3fe2('0x47')],{})[_0x3fe2('0x25')](respondWithResult(_0x4c7803,0xc9))[_0x3fe2('0x42')](handleError(_0x4c7803,null));};exports[_0x3fe2('0x24')]=function(_0x31d662,_0x3e4cce){if(_0x31d662[_0x3fe2('0x47')]['id']){delete _0x31d662[_0x3fe2('0x47')]['id'];}return db['ChatTransferReport'][_0x3fe2('0x45')]({'where':{'id':_0x31d662[_0x3fe2('0x44')]['id']}})['then'](handleEntityNotFound(_0x3e4cce,null))[_0x3fe2('0x25')](saveUpdates(_0x31d662[_0x3fe2('0x47')],null))[_0x3fe2('0x25')](respondWithResult(_0x3e4cce,null))[_0x3fe2('0x42')](handleError(_0x3e4cce,null));};exports['destroy']=function(_0x129c07,_0x54d3ef){return db['ChatTransferReport']['find']({'where':{'id':_0x129c07[_0x3fe2('0x44')]['id']}})['then'](handleEntityNotFound(_0x54d3ef,null))[_0x3fe2('0x25')](removeEntity(_0x54d3ef,null))[_0x3fe2('0x42')](handleError(_0x54d3ef,null));};exports[_0x3fe2('0x48')]=function(_0x11321d,_0x396b26){return db[_0x3fe2('0x2a')]['describe']()[_0x3fe2('0x25')](respondWithResult(_0x396b26,null))[_0x3fe2('0x42')](handleError(_0x396b26,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index c655c98..585376f 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 _0x7905=['report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatTransferReport.attributes','exports','ChatTransferReport'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7905,0x154));var _0x5790=function(_0x197041,_0x408c42){_0x197041=_0x197041-0x0;var _0x59ddaf=_0x7905[_0x197041];return _0x59ddaf;};'use strict';var _=require(_0x5790('0x0'));var util=require(_0x5790('0x1'));var logger=require('../../config/logger')(_0x5790('0x2'));var moment=require(_0x5790('0x3'));var BPromise=require(_0x5790('0x4'));var rp=require(_0x5790('0x5'));var fs=require('fs');var path=require(_0x5790('0x6'));var rimraf=require(_0x5790('0x7'));var config=require('../../config/environment');var attributes=require(_0x5790('0x8'));module[_0x5790('0x9')]=function(_0x220dd8,_0x32529f){return _0x220dd8['define'](_0x5790('0xa'),attributes,{'tableName':_0x5790('0xb'),'paranoid':![],'indexes':[{'name':_0x5790('0xc'),'fields':[_0x5790('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c7a=['lodash','util','api','moment','request-promise','path','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x238957,_0x4147ea){var _0x1e4042=function(_0x58358f){while(--_0x58358f){_0x238957['push'](_0x238957['shift']());}};_0x1e4042(++_0x4147ea);}(_0x2c7a,0x179));var _0xa2c7=function(_0x12ec80,_0xb69070){_0x12ec80=_0x12ec80-0x0;var _0x1cf529=_0x2c7a[_0x12ec80];return _0x1cf529;};'use strict';var _=require(_0xa2c7('0x0'));var util=require(_0xa2c7('0x1'));var logger=require('../../config/logger')(_0xa2c7('0x2'));var moment=require(_0xa2c7('0x3'));var BPromise=require('bluebird');var rp=require(_0xa2c7('0x4'));var fs=require('fs');var path=require(_0xa2c7('0x5'));var rimraf=require(_0xa2c7('0x6'));var config=require('../../config/environment');var attributes=require(_0xa2c7('0x7'));module[_0xa2c7('0x8')]=function(_0x2fe36e,_0x2e2878){return _0x2fe36e[_0xa2c7('0x9')](_0xa2c7('0xa'),attributes,{'tableName':_0xa2c7('0xb'),'paranoid':![],'indexes':[{'name':_0xa2c7('0xc'),'fields':[_0xa2c7('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 4df02df..8b09c0d 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 _0x8370=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0xdb95a0,_0x28c797){var _0x2a0665=function(_0x2e7536){while(--_0x2e7536){_0xdb95a0['push'](_0xdb95a0['shift']());}};_0x2a0665(++_0x28c797);}(_0x8370,0xdb));var _0x0837=function(_0x112d02,_0x5d5610){_0x112d02=_0x112d02-0x0;var _0x9c7d66=_0x8370[_0x112d02];return _0x9c7d66;};'use strict';var _=require(_0x0837('0x0'));var util=require(_0x0837('0x1'));var moment=require(_0x0837('0x2'));var BPromise=require(_0x0837('0x3'));var rs=require(_0x0837('0x4'));var fs=require('fs');var Redis=require(_0x0837('0x5'));var db=require(_0x0837('0x6'))['db'];var utils=require(_0x0837('0x7'));var logger=require(_0x0837('0x8'))(_0x0837('0x9'));var config=require(_0x0837('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0837('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ec944,_0x16a994,_0xb56c0b){return new BPromise(function(_0x32b069,_0x360f25){return client[_0x0837('0xc')](_0x3ec944,_0xb56c0b)[_0x0837('0xd')](function(_0x4441e9){logger['info'](_0x0837('0xe'),_0x16a994,'request\x20sent');logger[_0x0837('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x16a994,_0x0837('0x10'),JSON[_0x0837('0x11')](_0x4441e9));if(_0x4441e9[_0x0837('0x12')]){if(_0x4441e9[_0x0837('0x12')][_0x0837('0x13')]===0x1f4){logger[_0x0837('0x12')](_0x0837('0xe'),_0x16a994,_0x4441e9['error'][_0x0837('0x14')]);return _0x360f25(_0x4441e9[_0x0837('0x12')]['message']);}logger[_0x0837('0x12')](_0x0837('0xe'),_0x16a994,_0x4441e9[_0x0837('0x12')][_0x0837('0x14')]);return _0x32b069(_0x4441e9[_0x0837('0x12')][_0x0837('0x14')]);}else{logger[_0x0837('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x16a994,'request\x20sent');_0x32b069(_0x4441e9[_0x0837('0x16')][_0x0837('0x14')]);}})[_0x0837('0x17')](function(_0x47be2a){logger[_0x0837('0x12')](_0x0837('0xe'),_0x16a994,_0x47be2a);_0x360f25(_0x47be2a);});});}
\ No newline at end of file
+var _0x87ad=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x87ad,0x157));var _0xd87a=function(_0x33524a,_0x1309ab){_0x33524a=_0x33524a-0x0;var _0x32573b=_0x87ad[_0x33524a];return _0x32573b;};'use strict';var _=require(_0xd87a('0x0'));var util=require(_0xd87a('0x1'));var moment=require(_0xd87a('0x2'));var BPromise=require(_0xd87a('0x3'));var rs=require(_0xd87a('0x4'));var fs=require('fs');var Redis=require(_0xd87a('0x5'));var db=require(_0xd87a('0x6'))['db'];var utils=require(_0xd87a('0x7'));var logger=require('../../config/logger')(_0xd87a('0x8'));var config=require(_0xd87a('0x9'));var jayson=require(_0xd87a('0xa'));var client=jayson[_0xd87a('0xb')][_0xd87a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x379445,_0x1243dc,_0x5444f2){return new BPromise(function(_0x5b0263,_0x152450){return client[_0xd87a('0xd')](_0x379445,_0x5444f2)['then'](function(_0x364022){logger[_0xd87a('0xe')](_0xd87a('0xf'),_0x1243dc,_0xd87a('0x10'));logger[_0xd87a('0x11')](_0xd87a('0x12'),_0x1243dc,_0xd87a('0x10'),JSON[_0xd87a('0x13')](_0x364022));if(_0x364022[_0xd87a('0x14')]){if(_0x364022[_0xd87a('0x14')]['code']===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x1243dc,_0x364022[_0xd87a('0x14')][_0xd87a('0x15')]);return _0x152450(_0x364022['error'][_0xd87a('0x15')]);}logger['error'](_0xd87a('0xf'),_0x1243dc,_0x364022[_0xd87a('0x14')][_0xd87a('0x15')]);return _0x5b0263(_0x364022[_0xd87a('0x14')][_0xd87a('0x15')]);}else{logger[_0xd87a('0xe')](_0xd87a('0xf'),_0x1243dc,_0xd87a('0x10'));_0x5b0263(_0x364022['result'][_0xd87a('0x15')]);}})[_0xd87a('0x16')](function(_0x5b298b){logger[_0xd87a('0x14')](_0xd87a('0xf'),_0x1243dc,_0x5b298b);_0x152450(_0x5b298b);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index d4cef78..9c6aa1d 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 _0x356c=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x356c,0x80));var _0xc356=function(_0x2574cf,_0x12801b){_0x2574cf=_0x2574cf-0x0;var _0x25268e=_0x356c[_0x2574cf];return _0x25268e;};'use strict';var multer=require(_0xc356('0x0'));var util=require('util');var path=require(_0xc356('0x1'));var timeout=require(_0xc356('0x2'));var express=require(_0xc356('0x3'));var router=express[_0xc356('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc356('0x5'));var interaction=require(_0xc356('0x6'));var config=require(_0xc356('0x7'));var controller=require(_0xc356('0x8'));router[_0xc356('0x9')]('/',auth[_0xc356('0xa')](),controller[_0xc356('0xb')]);router[_0xc356('0x9')](_0xc356('0xc'),auth[_0xc356('0xa')](),controller[_0xc356('0xd')]);router[_0xc356('0x9')](_0xc356('0xe'),auth['isAuthenticated'](),controller[_0xc356('0xf')]);router[_0xc356('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc356('0x11')](_0xc356('0xe'),auth[_0xc356('0xa')](),controller[_0xc356('0x12')]);router['delete'](_0xc356('0xe'),auth[_0xc356('0xa')](),controller[_0xc356('0x13')]);module[_0xc356('0x14')]=router;
\ No newline at end of file
+var _0x2514=['/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x57160c,_0x5fb60f){var _0x5587a2=function(_0x42525f){while(--_0x42525f){_0x57160c['push'](_0x57160c['shift']());}};_0x5587a2(++_0x5fb60f);}(_0x2514,0xe4));var _0x4251=function(_0x28d56f,_0x111806){_0x28d56f=_0x28d56f-0x0;var _0x269a53=_0x2514[_0x28d56f];return _0x269a53;};'use strict';var multer=require(_0x4251('0x0'));var util=require(_0x4251('0x1'));var path=require(_0x4251('0x2'));var timeout=require(_0x4251('0x3'));var express=require(_0x4251('0x4'));var router=express['Router']();var fs_extra=require(_0x4251('0x5'));var auth=require(_0x4251('0x6'));var interaction=require(_0x4251('0x7'));var config=require('../../config/environment');var controller=require(_0x4251('0x8'));router[_0x4251('0x9')]('/',auth[_0x4251('0xa')](),controller[_0x4251('0xb')]);router['get'](_0x4251('0xc'),auth[_0x4251('0xa')](),controller[_0x4251('0xd')]);router[_0x4251('0x9')](_0x4251('0xe'),auth[_0x4251('0xa')](),controller[_0x4251('0xf')]);router[_0x4251('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4251('0x11')](_0x4251('0xe'),auth[_0x4251('0xa')](),controller[_0x4251('0x12')]);router[_0x4251('0x13')](_0x4251('0xe'),auth[_0x4251('0xa')](),controller[_0x4251('0x14')]);module[_0x4251('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index bba55ad..b91b743 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 _0xe59a=['alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','Send','Contact\x20us','Powered\x20by\x20xCALLY','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Skip','Feedback','star','stringify','input','text','name','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT'];(function(_0x27f825,_0x463497){var _0x1a40fd=function(_0x849c25){while(--_0x849c25){_0x27f825['push'](_0x27f825['shift']());}};_0x1a40fd(++_0x463497);}(_0xe59a,0xce));var _0xae59=function(_0x2c0d6f,_0x379525){_0x2c0d6f=_0x2c0d6f-0x0;var _0x388c09=_0xe59a[_0x2c0d6f];return _0x388c09;};'use strict';var Sequelize=require(_0xae59('0x0'));var rs=require(_0xae59('0x1'));module[_0xae59('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xae59('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xae59('0x3')]},'mapKey':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0x4')},'mapKeyOffline':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xae59('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xae59('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xae59('0x3')],'allowNull':![],'defaultValue':_0xae59('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xae59('0x3')],'allowNull':![],'defaultValue':_0xae59('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xae59('0x3')],'allowNull':![],'defaultValue':_0xae59('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xae59('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xae59('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xae59('0x8')](_0xae59('0x9'),_0xae59('0xa')),'defaultValue':_0xae59('0x9')},'header_online':{'type':Sequelize[_0xae59('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xae59('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0xb')},'header_offline':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xae59('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0xae59('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xae59('0xf')]},'closingQuestion':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xae59('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0x13')},'closingMessage':{'type':Sequelize[_0xae59('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0xb')},'skipMessageButton':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0x14')},'conditionAgreement':{'type':Sequelize[_0xae59('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xae59('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xae59('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0x15')},'ratingType':{'type':Sequelize['ENUM'](_0xae59('0x16'),'thumb'),'defaultValue':_0xae59('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xae59('0x17')]({'items':[{'type':_0xae59('0x18'),'variable':null,'config':{'placeholder':'name','type':_0xae59('0x19'),'required':!![]},'props':{'title':_0xae59('0x1a'),'helpText':''}},{'type':_0xae59('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xae59('0x4'),'type':_0xae59('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xae59('0x1b'))?JSON[_0xae59('0x1c')](this[_0xae59('0x1d')](_0xae59('0x1b'))):{};},'set':function(_0x4142ba){return this[_0xae59('0x1e')](_0xae59('0x1b'),JSON[_0xae59('0x17')](_0x4142ba));}},'offlineForm':{'type':Sequelize[_0xae59('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xae59('0x18'),'props':{'title':_0xae59('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xae59('0x4'),'type':_0xae59('0x4')},'variable':null},{'type':_0xae59('0x1f'),'config':{'placeholder':_0xae59('0x20')},'props':{'title':_0xae59('0x20'),'helpText':_0xae59('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xae59('0x1d')](_0xae59('0x22'))?JSON['parse'](this[_0xae59('0x1d')](_0xae59('0x22'))):{};},'set':function(_0x549dfd){return this[_0xae59('0x1e')]('offlineForm',JSON[_0xae59('0x17')](_0x549dfd));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xae59('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xae59('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xae59('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xae59('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xae59('0x3')]},'waitingTitle':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0x24')},'waitingMessage':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xae59('0x26')},'offlineMessageBody':{'type':Sequelize[_0xae59('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xae59('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0x27')},'skipUnmanaged':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0x14')},'sendUnmanaged':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0xae59('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xae59('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xae59('0x3')]},'notificationTemplate':{'type':Sequelize[_0xae59('0xf')],'defaultValue':function(){return _0xae59('0x28');}},'notificationSound':{'type':Sequelize[_0xae59('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xae59('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xae59('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xae59('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0x2a')},'verticalAlignment':{'type':Sequelize[_0xae59('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0x2b')},'messagesAlignment':{'type':Sequelize[_0xae59('0x3')],'defaultValue':_0xae59('0x2c')},'defaultTitle':{'type':Sequelize[_0xae59('0x3')]},'customerAvatar':{'type':Sequelize[_0xae59('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xae59('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xae59('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xae59('0x3')],'allowNull':![],'defaultValue':_0xae59('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xae59('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xae59('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xae59('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xae59('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xae59('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xae59('0xe')],'defaultValue':![],'comment':_0xae59('0x2f'),'set':function(_0x24f09d){if(!_0x24f09d)this[_0xae59('0x1e')]('mandatoryDispositionPauseId',null);this[_0xae59('0x1e')]('mandatoryDisposition',_0x24f09d);}},'vidaooEscalation':{'type':Sequelize[_0xae59('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xae59('0x3')]},'vidaooTopic':{'type':Sequelize[_0xae59('0x3')],'allowNull':![],'defaultValue':_0xae59('0x30')},'vidaooNote':{'type':Sequelize[_0xae59('0x3')],'defaultValue':function(){return _0xae59('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xae59('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xae59('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xae59('0xf')]}};
\ No newline at end of file
+var _0x2d68=['Your\x20request\x20has\x20not\x20been\x20processed.','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','address','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','input','name','onlineForm','parse','setDataValue','stringify','textarea','Comments','getDataValue','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'];(function(_0x38511a,_0x226b17){var _0x165d9e=function(_0x142362){while(--_0x142362){_0x38511a['push'](_0x38511a['shift']());}};_0x165d9e(++_0x226b17);}(_0x2d68,0xdf));var _0x82d6=function(_0x2123aa,_0x2e8a74){_0x2123aa=_0x2123aa-0x0;var _0x413cde=_0x2d68[_0x2123aa];return _0x413cde;};'use strict';var Sequelize=require(_0x82d6('0x0'));var rs=require(_0x82d6('0x1'));module[_0x82d6('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x82d6('0x3')},'description':{'type':Sequelize[_0x82d6('0x4')]},'mapKey':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x5')},'mapKeyOffline':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x5')},'key':{'type':Sequelize[_0x82d6('0x4')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x6')},'customerAlias':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x82d6('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x82d6('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x82d6('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x82d6('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x82d6('0x4')]},'animation':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x82d6('0xb')](_0x82d6('0xc'),_0x82d6('0xd')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0xe')},'start_chat_button':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0xf')},'offline_chat_button':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x10')},'header_offline':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x11')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x82d6('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x12')},'defaultWhiteLabel':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x82d6('0x13')]},'closingQuestion':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x14')},'noteTitle':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x15')},'placeholderMessage':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x16')},'closingMessage':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x17')},'closingMessageButton':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x10')},'skipMessageButton':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x18')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x19')},'ratingType':{'type':Sequelize[_0x82d6('0xb')](_0x82d6('0x1a'),_0x82d6('0x1b')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x82d6('0x13')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x82d6('0x1c'),'variable':null,'config':{'placeholder':_0x82d6('0x1d'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x82d6('0x1c'),'props':{'title':_0x82d6('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x82d6('0x5'),'type':_0x82d6('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x82d6('0x1e'))?JSON[_0x82d6('0x1f')](this['getDataValue'](_0x82d6('0x1e'))):{};},'set':function(_0x1439c7){return this[_0x82d6('0x20')](_0x82d6('0x1e'),JSON['stringify'](_0x1439c7));}},'offlineForm':{'type':Sequelize[_0x82d6('0x13')],'defaultValue':function(){return JSON[_0x82d6('0x21')]({'items':[{'type':_0x82d6('0x1c'),'props':{'title':_0x82d6('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x82d6('0x5'),'type':'email'},'variable':null},{'type':_0x82d6('0x22'),'config':{'placeholder':_0x82d6('0x23')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x82d6('0x24')](_0x82d6('0x25'))?JSON['parse'](this['getDataValue'](_0x82d6('0x25'))):{};},'set':function(_0x4d82d0){return this[_0x82d6('0x20')](_0x82d6('0x25'),JSON['stringify'](_0x4d82d0));}},'token':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':function(){return rs[_0x82d6('0x26')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x82d6('0x4')]},'forwardOffline':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x82d6('0x4')]},'waitingTitle':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x28')},'offlineMessageBody':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x82d6('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x18')},'sendUnmanaged':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x10')},'enableCustomerAttachment':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x82d6('0x13')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x82d6('0x4')]},'notificationTemplate':{'type':Sequelize[_0x82d6('0x13')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x82d6('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x2b')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x2c')},'messagesAlignment':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x2d')},'defaultTitle':{'type':Sequelize[_0x82d6('0x4')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x82d6('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x82d6('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x82d6('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x82d6('0x2f')},'systemAvatar':{'type':Sequelize[_0x82d6('0x13')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x82d6('0x9')],'comment':_0x82d6('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x82d6('0x31'),'set':function(_0x700457){if(!_0x700457)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0x82d6('0x32'),_0x700457);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x82d6('0x4')]},'vidaooTopic':{'type':Sequelize[_0x82d6('0x4')],'allowNull':![],'defaultValue':_0x82d6('0x33')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x82d6('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 3d641d4..c02df41 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 _0x330c=['offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','Smtp','user','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','lastName','Chat','NotifyMailAccount','notifyMail','attachments','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','color_button','backgroundColor','hideWhenOffline','addApplications','transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','omit','getProactiveActions','ChatProactiveAction','getFields','false','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','update','destroy','get','UserProfileResource','name','index','Pause','ChatWebsite','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','includeAll','find','create','body','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','length','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','notify','headers','user-agent','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','from','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','Contacts','updatedAt','DESC','ChatApplication','Applications','List','account','applications','orderBy','priority','asc','ListId','CmContact','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','EventManager','offline','files','send','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server'];(function(_0x45d10a,_0x14e1b7){var _0x1edad7=function(_0x1e6966){while(--_0x1e6966){_0x45d10a['push'](_0x45d10a['shift']());}};_0x1edad7(++_0x14e1b7);}(_0x330c,0x186));var _0xc330=function(_0x39d279,_0x5d516c){_0x39d279=_0x39d279-0x0;var _0x19de67=_0x330c[_0x39d279];return _0x19de67;};'use strict';var BPromise=require(_0xc330('0x0'));var Mustache=require(_0xc330('0x1'));var util=require(_0xc330('0x2'));var path=require(_0xc330('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc330('0x4'));var _=require(_0xc330('0x5'));var querystring=require(_0xc330('0x6'));var Redis=require(_0xc330('0x7'));var qs=require(_0xc330('0x8'));var logger=require(_0xc330('0x9'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xc330('0xa')]=_[_0xc330('0xb')](config[_0xc330('0xa')],{'host':_0xc330('0xc'),'port':0x18eb});var socket=require(_0xc330('0xd'))(new Redis(config[_0xc330('0xa')]));require(_0xc330('0xe'))['register'](socket);var htmlToText=require(_0xc330('0xf'));var jayson=require(_0xc330('0x10'));var client=jayson[_0xc330('0x11')]['http']({'port':0x232c});var client9002=jayson[_0xc330('0x11')][_0xc330('0x12')]({'port':0x232a});var client9003=jayson[_0xc330('0x11')][_0xc330('0x12')]({'port':0x232b});var client9001=jayson[_0xc330('0x11')][_0xc330('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x3e6fb9,_0x167b72,_0x32ef69,_0x48d215){return new BPromise(function(_0x514344,_0x2249c5){var _0x1c559b=_0x48d215||client;return _0x1c559b['request'](_0x3e6fb9,_0x32ef69)[_0xc330('0x13')](function(_0x27fa30){logger[_0xc330('0x14')](_0xc330('0x15'),_0x167b72,_0xc330('0x16'));logger[_0xc330('0x17')](_0xc330('0x18'),_0x167b72,_0xc330('0x16'),JSON[_0xc330('0x19')](_0x27fa30));if(_0x27fa30['error']){if(_0x27fa30[_0xc330('0x1a')][_0xc330('0x1b')]===0x1f4){logger['error'](_0xc330('0x15'),_0x167b72,_0x27fa30[_0xc330('0x1a')][_0xc330('0x1c')]);return _0x2249c5(_0x27fa30[_0xc330('0x1a')][_0xc330('0x1c')]);}logger['error'](_0xc330('0x15'),_0x167b72,_0x27fa30['error'][_0xc330('0x1c')]);return _0x514344(_0x27fa30[_0xc330('0x1a')][_0xc330('0x1c')]);}else{logger[_0xc330('0x14')](_0xc330('0x15'),_0x167b72,_0xc330('0x16'));_0x514344(_0x27fa30[_0xc330('0x1d')][_0xc330('0x1c')]);}})[_0xc330('0x1e')](function(_0x2b3001){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x167b72,_0x2b3001);_0x2249c5(_0x2b3001);});});}function respondWithStatusCode(_0x379b64,_0x20b844){_0x20b844=_0x20b844||0xcc;return function(_0x1ce74e){if(_0x1ce74e){return _0x379b64[_0xc330('0x1f')](_0x20b844);}return _0x379b64[_0xc330('0x20')](_0x20b844)[_0xc330('0x21')]();};}function respondWithResult(_0x2fbfc5,_0x93d52c){_0x93d52c=_0x93d52c||0xc8;return function(_0x41a9c3){if(_0x41a9c3){return _0x2fbfc5[_0xc330('0x20')](_0x93d52c)[_0xc330('0x22')](_0x41a9c3);}};}function respondWithFilteredResult(_0x248132,_0x2e773d){return function(_0x5e4654){if(_0x5e4654){var _0xbbd365=typeof _0x2e773d['offset']===_0xc330('0x23')&&typeof _0x2e773d[_0xc330('0x24')]===_0xc330('0x23');var _0x4c53eb=_0x5e4654['count'];var _0x5f50df=_0xbbd365?0x0:_0x2e773d['offset'];var _0x5ab1f7=_0xbbd365?_0x5e4654[_0xc330('0x25')]:_0x2e773d[_0xc330('0x26')]+_0x2e773d[_0xc330('0x24')];var _0x339dfb;if(_0x5ab1f7>=_0x4c53eb){_0x5ab1f7=_0x4c53eb;_0x339dfb=0xc8;}else{_0x339dfb=0xce;}_0x248132[_0xc330('0x20')](_0x339dfb);return _0x248132[_0xc330('0x27')]('Content-Range',_0x5f50df+'-'+_0x5ab1f7+'/'+_0x4c53eb)[_0xc330('0x22')](_0x5e4654);}return null;};}function saveUpdates(_0x562e21){return function(_0x171d7b){if(_0x171d7b){return _0x171d7b[_0xc330('0x28')](_0x562e21)[_0xc330('0x13')](function(_0x280945){return _0x280945;});}return null;};}function removeEntity(_0x5870fe){return function(_0x2e372a){if(_0x2e372a){return _0x2e372a[_0xc330('0x29')]()[_0xc330('0x13')](function(){var _0x515dfe=_0x2e372a[_0xc330('0x2a')]({'plain':!![]});var _0x19981d='ChatWebsites';return db[_0xc330('0x2b')][_0xc330('0x29')]({'where':{'type':_0x19981d,'resourceId':_0x515dfe['id']}})[_0xc330('0x13')](function(){return _0x2e372a;});})[_0xc330('0x13')](function(){_0x5870fe[_0xc330('0x20')](0xcc)[_0xc330('0x21')]();});}};}function handleEntityNotFound(_0x1d08e2){return function(_0x56bb76){if(!_0x56bb76){_0x1d08e2[_0xc330('0x1f')](0x194);}return _0x56bb76;};}function handleError(_0x215b7d,_0x4899a2){_0x4899a2=_0x4899a2||0x1f4;return function(_0x5d7969){logger['error'](_0x5d7969['stack']);if(_0x5d7969['name']){delete _0x5d7969[_0xc330('0x2c')];}_0x215b7d[_0xc330('0x20')](_0x4899a2)['send'](_0x5d7969);};}exports[_0xc330('0x2d')]=function(_0x32b2ce,_0xa38fa3){var _0xac80d5={'include':[{'model':db[_0xc330('0x2e')],'as':'mandatoryDispositionPause'}]},_0x339f27={},_0x528566={'count':0x0,'rows':[]};var _0xb35e2d=_['map'](db[_0xc330('0x2f')]['rawAttributes'],function(_0x4aa3ea){return{'name':_0x4aa3ea[_0xc330('0x30')],'type':_0x4aa3ea[_0xc330('0x31')][_0xc330('0x32')]};});_0x339f27[_0xc330('0x33')]=_[_0xc330('0x34')](_0xb35e2d,_0xc330('0x2c'));_0x339f27[_0xc330('0x35')]=_[_0xc330('0x36')](_0x32b2ce[_0xc330('0x35')]);_0x339f27[_0xc330('0x37')]=_[_0xc330('0x38')](_0x339f27['model'],_0x339f27[_0xc330('0x35')]);_0xac80d5[_0xc330('0x39')]=_[_0xc330('0x38')](_0x339f27['model'],qs[_0xc330('0x3a')](_0x32b2ce['query'][_0xc330('0x3a')]));_0xac80d5['attributes']=_0xac80d5['attributes']['length']?_0xac80d5['attributes']:_0x339f27[_0xc330('0x33')];if(!_0x32b2ce[_0xc330('0x35')][_0xc330('0x3b')](_0xc330('0x3c'))){_0xac80d5[_0xc330('0x24')]=qs['limit'](_0x32b2ce['query']['limit']);_0xac80d5[_0xc330('0x26')]=qs['offset'](_0x32b2ce[_0xc330('0x35')][_0xc330('0x26')]);}_0xac80d5[_0xc330('0x3d')]=qs[_0xc330('0x3e')](_0x32b2ce[_0xc330('0x35')][_0xc330('0x3e')]);_0xac80d5['where']=qs[_0xc330('0x37')](_[_0xc330('0x3f')](_0x32b2ce[_0xc330('0x35')],_0x339f27['filters']),_0xb35e2d);if(_0x32b2ce[_0xc330('0x35')][_0xc330('0x40')]){_0xac80d5[_0xc330('0x41')]=_[_0xc330('0x42')](_0xac80d5[_0xc330('0x41')],{'$or':_[_0xc330('0x34')](_0xb35e2d,function(_0x52d01c){if(_0x52d01c[_0xc330('0x31')]!==_0xc330('0x43')){var _0x5af8c3={};_0x5af8c3[_0x52d01c[_0xc330('0x2c')]]={'$like':'%'+_0x32b2ce['query']['filter']+'%'};return _0x5af8c3;}})});}_0xac80d5=_['merge']({},_0xac80d5,_0x32b2ce[_0xc330('0x44')]);var _0x188aa9={'where':_0xac80d5['where']};return db[_0xc330('0x2f')]['count'](_0x188aa9)['then'](function(_0x3269b7){_0x528566[_0xc330('0x25')]=_0x3269b7;if(_0x32b2ce[_0xc330('0x35')]['includeAll']){_0xac80d5[_0xc330('0x45')]=[{'all':!![]}];}return db[_0xc330('0x2f')][_0xc330('0x46')](_0xac80d5);})[_0xc330('0x13')](function(_0x4a3c9f){_0x528566[_0xc330('0x47')]=_0x4a3c9f;return _0x528566;})[_0xc330('0x13')](respondWithFilteredResult(_0xa38fa3,_0xac80d5))['catch'](handleError(_0xa38fa3,null));};exports[_0xc330('0x48')]=function(_0x3be528,_0x5756e7){var _0x19d5a6={'raw':![],'where':{'id':_0x3be528[_0xc330('0x49')]['id']},'include':[{'model':db[_0xc330('0x2e')],'as':_0xc330('0x4a')}]},_0x3ecd8e={};_0x3ecd8e[_0xc330('0x33')]=_[_0xc330('0x36')](db[_0xc330('0x2f')][_0xc330('0x4b')]);_0x3ecd8e[_0xc330('0x35')]=_[_0xc330('0x36')](_0x3be528['query']);_0x3ecd8e[_0xc330('0x37')]=_['intersection'](_0x3ecd8e[_0xc330('0x33')],_0x3ecd8e['query']);_0x19d5a6[_0xc330('0x39')]=_[_0xc330('0x38')](_0x3ecd8e[_0xc330('0x33')],qs[_0xc330('0x3a')](_0x3be528[_0xc330('0x35')]['fields']));_0x19d5a6[_0xc330('0x39')]=_0x19d5a6[_0xc330('0x39')]['length']?_0x19d5a6[_0xc330('0x39')]:_0x3ecd8e['model'];if(_0x3be528['query'][_0xc330('0x4c')]){_0x19d5a6[_0xc330('0x45')]=[{'all':!![]}];}_0x19d5a6=_[_0xc330('0x42')]({},_0x19d5a6,_0x3be528[_0xc330('0x44')]);return db['ChatWebsite'][_0xc330('0x4d')](_0x19d5a6)[_0xc330('0x13')](handleEntityNotFound(_0x5756e7,null))[_0xc330('0x13')](respondWithResult(_0x5756e7,null))[_0xc330('0x1e')](handleError(_0x5756e7,null));};exports['create']=function(_0x473d51,_0x3e5411){return db['ChatWebsite'][_0xc330('0x4e')](_0x473d51[_0xc330('0x4f')],{})['then'](function(_0x220194){var _0x159920=_0x473d51['user'][_0xc330('0x2a')]({'plain':!![]});if(!_0x159920)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x159920[_0xc330('0x50')]==='user'){var _0x17501c=_0x220194[_0xc330('0x2a')]({'plain':!![]});var _0x4d7d32=_0xc330('0x51');return db[_0xc330('0x52')]['find']({'where':{'name':_0x4d7d32,'userProfileId':_0x159920[_0xc330('0x53')]},'raw':!![]})[_0xc330('0x13')](function(_0x65dad){if(_0x65dad&&_0x65dad[_0xc330('0x54')]===0x0){return db[_0xc330('0x2b')][_0xc330('0x4e')]({'name':_0x17501c[_0xc330('0x2c')],'resourceId':_0x17501c['id'],'type':_0x65dad[_0xc330('0x2c')],'sectionId':_0x65dad['id']},{})[_0xc330('0x13')](function(){return _0x220194;});}else{return _0x220194;}})[_0xc330('0x1e')](function(_0x5b25bb){logger[_0xc330('0x1a')](_0xc330('0x55'),_0x5b25bb);throw _0x5b25bb;});}return _0x220194;})[_0xc330('0x13')](respondWithResult(_0x3e5411,0xc9))[_0xc330('0x1e')](handleError(_0x3e5411,null));};exports[_0xc330('0x28')]=function(_0x4c5286,_0x2fc799){if(_0x4c5286[_0xc330('0x4f')]['id']){delete _0x4c5286[_0xc330('0x4f')]['id'];}return db[_0xc330('0x2f')]['find']({'where':{'id':_0x4c5286[_0xc330('0x49')]['id']},'include':[{'model':db[_0xc330('0x2e')],'as':_0xc330('0x4a')}]})['then'](handleEntityNotFound(_0x2fc799,null))['then'](saveUpdates(_0x4c5286[_0xc330('0x4f')],null))[_0xc330('0x13')](respondWithResult(_0x2fc799,null))[_0xc330('0x1e')](handleError(_0x2fc799,null));};exports['destroy']=function(_0x31cba4,_0x384892){return db[_0xc330('0x2f')][_0xc330('0x4d')]({'where':{'id':_0x31cba4[_0xc330('0x49')]['id']}})[_0xc330('0x13')](handleEntityNotFound(_0x384892,null))[_0xc330('0x13')](removeEntity(_0x384892,null))[_0xc330('0x1e')](handleError(_0x384892,null));};exports['describe']=function(_0x5e65aa,_0x121c7b){return db[_0xc330('0x2f')][_0xc330('0x56')]()[_0xc330('0x13')](respondWithResult(_0x121c7b,null))[_0xc330('0x1e')](handleError(_0x121c7b,null));};exports[_0xc330('0x57')]=function(_0x8fc0db,_0x3232c1){if(_0x8fc0db[_0xc330('0x4f')]['id']){delete _0x8fc0db[_0xc330('0x4f')]['id'];}return db[_0xc330('0x2f')][_0xc330('0x4d')]({'where':{'id':_0x8fc0db[_0xc330('0x49')]['id']}})[_0xc330('0x13')](handleEntityNotFound(_0x3232c1,null))[_0xc330('0x13')](function(_0x29b8aa){if(_0x29b8aa){_0x8fc0db[_0xc330('0x4f')]['ChatWebsiteId']=_0x29b8aa['id'];return db[_0xc330('0x58')][_0xc330('0x4e')](_0x8fc0db[_0xc330('0x4f')]);}})[_0xc330('0x13')](respondWithResult(_0x3232c1,null))[_0xc330('0x1e')](handleError(_0x3232c1,null));};exports[_0xc330('0x59')]=function(_0x1cad9b,_0x430d5e){var _0x419afd={'raw':![],'where':{}};var _0x421e05={};var _0x453371={'count':0x0,'rows':[]};return db[_0xc330('0x2f')]['findOne']({'where':{'id':_0x1cad9b[_0xc330('0x49')]['id']}})[_0xc330('0x13')](handleEntityNotFound(_0x430d5e,null))['then'](function(_0x5853f6){if(_0x5853f6){_0x421e05[_0xc330('0x33')]=_[_0xc330('0x36')](db[_0xc330('0x58')][_0xc330('0x4b')]);_0x421e05[_0xc330('0x35')]=_[_0xc330('0x36')](_0x1cad9b[_0xc330('0x35')]);_0x421e05[_0xc330('0x37')]=_[_0xc330('0x38')](_0x421e05['model'],_0x421e05[_0xc330('0x35')]);_0x419afd['attributes']=_[_0xc330('0x38')](_0x421e05[_0xc330('0x33')],qs[_0xc330('0x3a')](_0x1cad9b['query']['fields']));_0x419afd[_0xc330('0x39')]=_0x419afd[_0xc330('0x39')][_0xc330('0x5a')]?_0x419afd['attributes']:_0x421e05[_0xc330('0x33')];if(!_0x1cad9b['query']['hasOwnProperty'](_0xc330('0x3c'))){_0x419afd[_0xc330('0x24')]=qs['limit'](_0x1cad9b['query'][_0xc330('0x24')]);_0x419afd[_0xc330('0x26')]=qs['offset'](_0x1cad9b[_0xc330('0x35')]['offset']);}_0x419afd['order']=qs[_0xc330('0x3e')](_0x1cad9b['query'][_0xc330('0x3e')]);_0x419afd[_0xc330('0x41')]=qs[_0xc330('0x37')](_[_0xc330('0x3f')](_0x1cad9b[_0xc330('0x35')],_0x421e05[_0xc330('0x37')]));_0x419afd[_0xc330('0x41')][_0xc330('0x5b')]=_0x5853f6['id'];if(_0x1cad9b[_0xc330('0x35')][_0xc330('0x40')]){_0x419afd['where']=_[_0xc330('0x42')](_0x419afd[_0xc330('0x41')],{'$or':_[_0xc330('0x34')](_0x419afd[_0xc330('0x39')],function(_0x1742ad){var _0x2c9a53={};_0x2c9a53[_0x1742ad]={'$like':'%'+_0x1cad9b[_0xc330('0x35')]['filter']+'%'};return _0x2c9a53;})});}_0x419afd=_[_0xc330('0x42')]({},_0x419afd,_0x1cad9b['options']);return db['Disposition'][_0xc330('0x25')]({'where':_0x419afd[_0xc330('0x41')]})[_0xc330('0x13')](function(_0x43c683){_0x453371[_0xc330('0x25')]=_0x43c683;if(_0x1cad9b[_0xc330('0x35')][_0xc330('0x4c')]){_0x419afd[_0xc330('0x45')]=[{'all':!![]}];}return db[_0xc330('0x58')][_0xc330('0x46')](_0x419afd);})['then'](function(_0x1756ba){_0x453371[_0xc330('0x47')]=_0x1756ba;return _0x453371;});}})[_0xc330('0x13')](respondWithFilteredResult(_0x430d5e,_0x419afd))[_0xc330('0x1e')](handleError(_0x430d5e,null));};exports['removeDispositions']=function(_0x27af45,_0x2779c5){return db[_0xc330('0x2f')][_0xc330('0x4d')]({'where':{'id':_0x27af45[_0xc330('0x49')]['id']}})['then'](handleEntityNotFound(_0x2779c5,null))[_0xc330('0x13')](function(_0x5b7f46){if(_0x5b7f46){return _0x5b7f46[_0xc330('0x5c')](_0x27af45[_0xc330('0x35')][_0xc330('0x5d')]);}})['then'](respondWithStatusCode(_0x2779c5,null))[_0xc330('0x1e')](handleError(_0x2779c5,null));};exports[_0xc330('0x5e')]=function(_0x42a255,_0x25f238){if(_0x42a255['body']['id']){delete _0x42a255[_0xc330('0x4f')]['id'];}return db[_0xc330('0x2f')][_0xc330('0x4d')]({'where':{'id':_0x42a255[_0xc330('0x49')]['id']}})[_0xc330('0x13')](handleEntityNotFound(_0x25f238,null))['then'](function(_0x3532a0){if(_0x3532a0){_0x42a255[_0xc330('0x4f')][_0xc330('0x5b')]=_0x3532a0['id'];return db[_0xc330('0x5f')]['create'](_0x42a255[_0xc330('0x4f')]);}})['then'](respondWithResult(_0x25f238,null))['catch'](handleError(_0x25f238,null));};exports[_0xc330('0x60')]=function(_0x17e0fc,_0x4f44e5){var _0x554c8a={'raw':![],'where':{}};var _0x40167f={};var _0x3d2c57={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc330('0x61')]({'where':{'id':_0x17e0fc[_0xc330('0x49')]['id']}})['then'](handleEntityNotFound(_0x4f44e5,null))['then'](function(_0x44c0f2){if(_0x44c0f2){_0x40167f[_0xc330('0x33')]=_['keys'](db[_0xc330('0x5f')]['rawAttributes']);_0x40167f[_0xc330('0x35')]=_[_0xc330('0x36')](_0x17e0fc[_0xc330('0x35')]);_0x40167f['filters']=_[_0xc330('0x38')](_0x40167f['model'],_0x40167f[_0xc330('0x35')]);_0x554c8a['attributes']=_['intersection'](_0x40167f['model'],qs['fields'](_0x17e0fc['query'][_0xc330('0x3a')]));_0x554c8a[_0xc330('0x39')]=_0x554c8a[_0xc330('0x39')]['length']?_0x554c8a[_0xc330('0x39')]:_0x40167f['model'];if(!_0x17e0fc[_0xc330('0x35')][_0xc330('0x3b')](_0xc330('0x3c'))){_0x554c8a[_0xc330('0x24')]=qs[_0xc330('0x24')](_0x17e0fc[_0xc330('0x35')][_0xc330('0x24')]);_0x554c8a[_0xc330('0x26')]=qs[_0xc330('0x26')](_0x17e0fc[_0xc330('0x35')]['offset']);}_0x554c8a[_0xc330('0x3d')]=qs[_0xc330('0x3e')](_0x17e0fc[_0xc330('0x35')][_0xc330('0x3e')]);_0x554c8a[_0xc330('0x41')]=qs[_0xc330('0x37')](_[_0xc330('0x3f')](_0x17e0fc[_0xc330('0x35')],_0x40167f[_0xc330('0x37')]));_0x554c8a[_0xc330('0x41')][_0xc330('0x5b')]=_0x44c0f2['id'];if(_0x17e0fc[_0xc330('0x35')][_0xc330('0x40')]){_0x554c8a[_0xc330('0x41')]=_[_0xc330('0x42')](_0x554c8a['where'],{'$or':_[_0xc330('0x34')](_0x554c8a[_0xc330('0x39')],function(_0x34a385){var _0x7bc4c1={};_0x7bc4c1[_0x34a385]={'$like':'%'+_0x17e0fc[_0xc330('0x35')][_0xc330('0x40')]+'%'};return _0x7bc4c1;})});}_0x554c8a=_[_0xc330('0x42')]({},_0x554c8a,_0x17e0fc[_0xc330('0x44')]);return db['CannedAnswer'][_0xc330('0x25')]({'where':_0x554c8a[_0xc330('0x41')]})[_0xc330('0x13')](function(_0x222629){_0x3d2c57[_0xc330('0x25')]=_0x222629;if(_0x17e0fc[_0xc330('0x35')][_0xc330('0x4c')]){_0x554c8a['include']=[{'all':!![]}];}return db[_0xc330('0x5f')][_0xc330('0x46')](_0x554c8a);})['then'](function(_0x39e215){_0x3d2c57[_0xc330('0x47')]=_0x39e215;return _0x3d2c57;});}})[_0xc330('0x13')](respondWithFilteredResult(_0x4f44e5,_0x554c8a))['catch'](handleError(_0x4f44e5,null));};exports[_0xc330('0x62')]=function(_0x38407c,_0x39d8fc){return db[_0xc330('0x2f')][_0xc330('0x4d')]({'where':{'id':_0x38407c[_0xc330('0x49')]['id']}})[_0xc330('0x13')](handleEntityNotFound(_0x39d8fc,null))[_0xc330('0x13')](function(_0x2e0bb4){if(_0x2e0bb4){return _0x2e0bb4['removeAnswers'](_0x38407c[_0xc330('0x35')][_0xc330('0x5d')]);}})[_0xc330('0x13')](respondWithStatusCode(_0x39d8fc,null))[_0xc330('0x1e')](handleError(_0x39d8fc,null));};exports[_0xc330('0x63')]=function(_0x2db1ff,_0x473bb7){_0x2db1ff['body'][_0xc330('0x64')]=_0x2db1ff['file'][_0xc330('0x65')];return db[_0xc330('0x2f')][_0xc330('0x4d')]({'where':{'id':_0x2db1ff[_0xc330('0x49')]['id']}})[_0xc330('0x13')](handleEntityNotFound(_0x473bb7,null))[_0xc330('0x13')](saveUpdates(_0x2db1ff[_0xc330('0x4f')],null))[_0xc330('0x13')](respondWithResult(_0x473bb7,null))[_0xc330('0x1e')](handleError(_0x473bb7,null));};exports[_0xc330('0x66')]=function(_0x482956,_0x3a6538){_0x482956[_0xc330('0x4f')][_0xc330('0x67')]=_0x482956[_0xc330('0x68')][_0xc330('0x65')];return db[_0xc330('0x2f')][_0xc330('0x4d')]({'where':{'id':_0x482956[_0xc330('0x49')]['id']}})[_0xc330('0x13')](handleEntityNotFound(_0x3a6538,null))['then'](saveUpdates(_0x482956['body'],null))[_0xc330('0x13')](respondWithResult(_0x3a6538,null))[_0xc330('0x1e')](handleError(_0x3a6538,null));};exports[_0xc330('0x69')]=function(_0x3486b9,_0x1b5b42){_0x3486b9[_0xc330('0x4f')][_0xc330('0x6a')]=_0x3486b9['file'][_0xc330('0x65')];return db[_0xc330('0x2f')]['find']({'where':{'id':_0x3486b9[_0xc330('0x49')]['id']}})[_0xc330('0x13')](handleEntityNotFound(_0x1b5b42,null))['then'](saveUpdates(_0x3486b9[_0xc330('0x4f')],null))[_0xc330('0x13')](respondWithResult(_0x1b5b42,null))[_0xc330('0x1e')](handleError(_0x1b5b42,null));};exports['addSystemAvatar']=function(_0x4da9f6,_0x4fb5ac){_0x4da9f6[_0xc330('0x4f')][_0xc330('0x6b')]=_0x4da9f6[_0xc330('0x68')][_0xc330('0x65')];return db[_0xc330('0x2f')]['find']({'where':{'id':_0x4da9f6[_0xc330('0x49')]['id']}})[_0xc330('0x13')](handleEntityNotFound(_0x4fb5ac,null))[_0xc330('0x13')](saveUpdates(_0x4da9f6[_0xc330('0x4f')],null))[_0xc330('0x13')](respondWithResult(_0x4fb5ac,null))[_0xc330('0x1e')](handleError(_0x4fb5ac,null));};exports['getLogo']=function(_0x5dd4dc,_0x5698e1){var _0x156878=path[_0xc330('0x6c')](config[_0xc330('0x6d')],_0xc330('0x6e'));var _0x132671={'where':{'id':_0x5dd4dc[_0xc330('0x49')]['id']},'attributes':['id',_0xc330('0x64')],'raw':!![]};var _0x2d300d=![];return require(_0xc330('0x6f'))[_0xc330('0x70')]()['then'](function(_0x1f8cdf){if(_0x1f8cdf){_0x2d300d=_0x1f8cdf[_0xc330('0x71')];}})[_0xc330('0x13')](function(){return db[_0xc330('0x2f')][_0xc330('0x4d')](_0x132671);})[_0xc330('0x13')](handleEntityNotFound(_0x5698e1,null))['then'](function(_0x3579c1){if(_0x3579c1){if(!_[_0xc330('0x72')](_0x3579c1['sitepic'])){if(fs[_0xc330('0x73')](path[_0xc330('0x6c')](config[_0xc330('0x6d')],_0xc330('0x74'),_0x3579c1[_0xc330('0x64')]))&&_0x2d300d){_0x156878=path[_0xc330('0x6c')](config[_0xc330('0x6d')],'server/files/images/logos/',_0x3579c1[_0xc330('0x64')]);}}return _0x5698e1[_0xc330('0x75')](_0x156878);}})['catch'](handleError(_0x5698e1,null));};exports[_0xc330('0x76')]=function(_0x2bff6d,_0x3bbcd5){var _0x373fe3=path[_0xc330('0x6c')](config[_0xc330('0x6d')],_0xc330('0x77'));var _0x272581={'where':{'id':_0x2bff6d[_0xc330('0x49')]['id']},'attributes':['id',_0xc330('0x67')],'raw':!![]};return db[_0xc330('0x2f')][_0xc330('0x4d')](_0x272581)[_0xc330('0x13')](handleEntityNotFound(_0x3bbcd5,null))[_0xc330('0x13')](function(_0x556a06){if(_0x556a06){if(!_['isNil'](_0x556a06[_0xc330('0x67')])){if(fs['existsSync'](path['join'](config[_0xc330('0x6d')],_0xc330('0x78'),_0x556a06[_0xc330('0x67')]))){_0x373fe3=path[_0xc330('0x6c')](config['root'],_0xc330('0x78'),_0x556a06[_0xc330('0x67')]);}}return _0x3bbcd5[_0xc330('0x75')](_0x373fe3);}})[_0xc330('0x1e')](handleError(_0x3bbcd5,null));};exports['getCustomerAvatar']=function(_0x458eae,_0x57f2e6){var _0x7e29ef=path[_0xc330('0x6c')](config[_0xc330('0x6d')],'server/files/images/avatars/customer_avatar.png');var _0x33af9a={'where':{'id':_0x458eae[_0xc330('0x49')]['id']},'attributes':['id',_0xc330('0x6a'),_0xc330('0x79')],'raw':!![]};return db[_0xc330('0x2f')][_0xc330('0x4d')](_0x33af9a)[_0xc330('0x13')](handleEntityNotFound(_0x57f2e6,null))['then'](function(_0x15ade4){if(_0x15ade4){if(!_[_0xc330('0x72')](_0x15ade4[_0xc330('0x6a')])){if(fs[_0xc330('0x73')](path['join'](config[_0xc330('0x6d')],_0xc330('0x78'),_0x15ade4[_0xc330('0x6a')]))&&_0x15ade4[_0xc330('0x79')]){_0x7e29ef=path[_0xc330('0x6c')](config[_0xc330('0x6d')],_0xc330('0x78'),_0x15ade4[_0xc330('0x6a')]);}}return _0x57f2e6[_0xc330('0x75')](_0x7e29ef);}})[_0xc330('0x1e')](handleError(_0x57f2e6,null));};exports[_0xc330('0x7a')]=function(_0xc0fedb,_0x3580d1){var _0x562a7d=path[_0xc330('0x6c')](config[_0xc330('0x6d')],'server/files/images/avatars/system_avatar.png');var _0x58568a={'where':{'id':_0xc0fedb[_0xc330('0x49')]['id']},'attributes':['id',_0xc330('0x6b')],'raw':!![]};return db[_0xc330('0x2f')]['find'](_0x58568a)[_0xc330('0x13')](handleEntityNotFound(_0x3580d1,null))[_0xc330('0x13')](function(_0x3853a3){if(_0x3853a3){if(!_[_0xc330('0x72')](_0x3853a3[_0xc330('0x6b')])){if(fs[_0xc330('0x73')](path[_0xc330('0x6c')](config[_0xc330('0x6d')],_0xc330('0x78'),_0x3853a3[_0xc330('0x6b')]))){_0x562a7d=path['join'](config[_0xc330('0x6d')],'server/files/images/avatars/',_0x3853a3[_0xc330('0x6b')]);}}return _0x3580d1[_0xc330('0x75')](_0x562a7d);}})[_0xc330('0x1e')](handleError(_0x3580d1,null));};exports[_0xc330('0x7b')]=function(_0x4a3d40,_0xe468ec){var _0x321a88=require('user-agent-parser');var _0xba1be4=new _0x321a88();var _0x33965d=_0xba1be4['setUA'](_0x4a3d40[_0xc330('0x7c')][_0xc330('0x7d')])['getResult']();var _0x443679={'body':_0x4a3d40[_0xc330('0x4f')],'channel':_0xc330('0x7e')};var _0x50cbdd=[];var _0x2d313a=[];var _0x30f1ec={};var _0xcc1dbd=![];return db['CmContact'][_0xc330('0x56')]()[_0xc330('0x13')](function(_0x449f84){if(!_0x449f84){throw new db[(_0xc330('0x7f'))][(_0xc330('0x80'))](_0xc330('0x81'));}_0x50cbdd=_[_0xc330('0x82')](_['keys'](_0x449f84),[_0xc330('0x83'),'updatedAt']);_0x2d313a=_[_0xc330('0x82')](_[_0xc330('0x36')](_0x449f84),[_0xc330('0x83'),'updatedAt',_0xc330('0x84'),'ListId']);if(_0x4a3d40['body']['id']){delete _0x4a3d40[_0xc330('0x4f')]['id'];}if(_[_0xc330('0x72')](_0x4a3d40[_0xc330('0x4f')][_0xc330('0x85')])){throw new db[(_0xc330('0x7f'))][(_0xc330('0x80'))](_0xc330('0x86'));}if(_[_0xc330('0x72')](_0x4a3d40[_0xc330('0x4f')][_0xc330('0x4f')])||_0x4a3d40[_0xc330('0x4f')][_0xc330('0x4f')]===''){throw new db['Sequelize']['ValidationError'](_0xc330('0x87'));}if(_[_0xc330('0x72')](_0x4a3d40[_0xc330('0x4f')][_0xc330('0x88')])){throw new db[(_0xc330('0x7f'))][(_0xc330('0x80'))](_0xc330('0x89')+_0x2d313a);}if(!_[_0xc330('0x8a')](_0x2d313a,_0x4a3d40[_0xc330('0x4f')]['mapKey'])){throw new db[(_0xc330('0x7f'))][(_0xc330('0x80'))](_0xc330('0x8b')+_0x2d313a);}_0x30f1ec[_0x4a3d40[_0xc330('0x4f')][_0xc330('0x88')]]=_0x4a3d40['body'][_0xc330('0x85')];})[_0xc330('0x13')](function(){return db[_0xc330('0x2f')][_0xc330('0x4d')]({'where':{'id':_0x4a3d40[_0xc330('0x49')]['id']},'include':[{'model':db[_0xc330('0x8c')],'as':'List','include':[{'model':db['CmContact'],'as':_0xc330('0x8d'),'where':_0x30f1ec,'limit':0x1,'order':[[_0xc330('0x8e'),_0xc330('0x8f')]]}]},{'model':db[_0xc330('0x90')],'as':_0xc330('0x91')}]});})[_0xc330('0x13')](handleEntityNotFound(_0xe468ec,null))[_0xc330('0x13')](function(_0xd66489){if(_0xd66489&&_0xd66489[_0xc330('0x92')]){_0x443679[_0xc330('0x93')]=_0xd66489;_0x443679[_0xc330('0x94')]=_0xd66489[_0xc330('0x91')];_0x443679['list']=_0xd66489[_0xc330('0x92')];_0x443679[_0xc330('0x94')]=_[_0xc330('0x95')](_0x443679[_0xc330('0x94')],[_0xc330('0x96')],[_0xc330('0x97')]);if(_0x443679[_0xc330('0x93')]['Applications']){delete _0x443679['account']['Applications'];}if(_0x443679[_0xc330('0x93')]['List']&&_0x443679[_0xc330('0x93')][_0xc330('0x92')][_0xc330('0x8d')]['length']){return _0x443679[_0xc330('0x93')]['List']['Contacts'][0x0];}var _0xe3739e=_['defaults'](_0x4a3d40[_0xc330('0x4f')],{'firstName':_0x4a3d40[_0xc330('0x4f')]['from'],'ListId':_0xd66489[_0xc330('0x98')]});_0xe3739e[_0x4a3d40['body'][_0xc330('0x88')]]=_0x4a3d40['body'][_0xc330('0x85')];return db[_0xc330('0x99')][_0xc330('0x4e')](_0xe3739e,{'fields':_0x50cbdd,'raw':!![]});}})[_0xc330('0x13')](handleEntityNotFound(_0xe468ec,null))[_0xc330('0x13')](function(_0x47f361){_0x443679[_0xc330('0x9a')]=_0x47f361;var _0x10d4a5=_0x4a3d40[_0xc330('0x4f')][_0xc330('0x9b')];if(_0x4a3d40[_0xc330('0x7c')][_0xc330('0x9c')]){_0x10d4a5=_0x4a3d40[_0xc330('0x7c')]['cf-connecting-ip'];}else if(_0x4a3d40[_0xc330('0x7c')][_0xc330('0x9d')]){_0x10d4a5=_['first'](_0x4a3d40[_0xc330('0x7c')]['x-forwarded-for'][_0xc330('0x9e')](','));}if(_0x47f361){var _0x59b02e={'ContactId':_0x47f361['id'],'ChatWebsiteId':_0x4a3d40[_0xc330('0x49')]['id'],'from':(_0x47f361[_0xc330('0x9f')]||'')+'\x20'+(_0x47f361['lastName']||''),'customerIp':_0x10d4a5,'customerPort':_0x4a3d40[_0xc330('0x7c')]['x-real-port']?_0x4a3d40[_0xc330('0x7c')][_0xc330('0xa0')]:null,'referer':_0x4a3d40[_0xc330('0x4f')][_0xc330('0xa1')],'browserName':_0x33965d[_0xc330('0xa2')][_0xc330('0x2c')]&&_0x33965d['browser'][_0xc330('0xa3')]?util[_0xc330('0xa4')]('%s\x20%s',_0x33965d['browser'][_0xc330('0x2c')],_0x33965d[_0xc330('0xa2')]['version']):_0xc330('0xa5'),'browserVersion':_0x33965d[_0xc330('0xa2')]['version']||_0xc330('0xa5'),'osName':util[_0xc330('0xa4')](_0xc330('0xa6'),_0x33965d['os']['name'],_0x33965d['os']['version']),'osVersion':_0x33965d['os']['version'],'deviceModel':_0x33965d['device']['model']&&_0x33965d[_0xc330('0xa7')]['vendor']?util[_0xc330('0xa4')](_0xc330('0xa8'),_0x33965d['device'][_0xc330('0x33')],_0x33965d[_0xc330('0xa7')][_0xc330('0xa9')],_0x33965d[_0xc330('0xa7')][_0xc330('0x31')]):null,'deviceVendor':_0x33965d[_0xc330('0xa7')]['vendor'],'deviceType':_0x33965d['device']['type'],'formData':JSON[_0xc330('0x19')](_0x4a3d40[_0xc330('0x4f')])};var _0x59f0ff={'ChatWebsiteId':_0x4a3d40[_0xc330('0x49')]['id'],'closed':![]};if(_0x4a3d40[_0xc330('0x4f')][_0xc330('0xaa')]){_0x59f0ff['threadId']=_0x4a3d40['body'][_0xc330('0xaa')];return db[_0xc330('0xab')][_0xc330('0x4d')]({'where':_0x59f0ff})[_0xc330('0x13')](function(_0x34fafe){if(_0x34fafe){return[_0x34fafe,![]];}_0x59b02e[_0xc330('0xaa')]=_0x4a3d40['body'][_0xc330('0xaa')];_0x59b02e[_0xc330('0xac')]=_0x4a3d40['body'][_0xc330('0xac')];return db[_0xc330('0xab')][_0xc330('0x4e')](_0x59b02e)[_0xc330('0x13')](function(_0x5eb68b){return[_0x5eb68b,!![]];});});}_0x59f0ff[_0xc330('0xad')]=_0x47f361['id'];if(_0x4a3d40[_0xc330('0x4f')]['interaction']&&_0x4a3d40['body']['interaction']['id']){_0x59f0ff['id']=_0x4a3d40['body']['interaction']['id'];return db['ChatInteraction'][_0xc330('0x4d')]({'where':_0x59f0ff})[_0xc330('0x13')](function(_0x5a8b8a){if(_0x5a8b8a){return[_0x5a8b8a,![]];}return db[_0xc330('0xab')][_0xc330('0x4e')](_0x59b02e)[_0xc330('0x13')](function(_0x5da965){return[_0x5da965,!![]];});});}return db[_0xc330('0xab')][_0xc330('0x4e')](_0x59b02e)[_0xc330('0x13')](function(_0x15e6c6){return[_0x15e6c6,!![]];});}})[_0xc330('0xae')](function(_0x52369d,_0x40b6c8){if(_0x52369d){_0xcc1dbd=_0x40b6c8;if(!_0x40b6c8){var _0x2f0607={'from':(_0x443679[_0xc330('0x9a')][_0xc330('0x9f')]||'')+'\x20'+(_0x443679['contact']['lastName']||'')};if(_0x4a3d40[_0xc330('0x4f')]['threadId']&&_0x4a3d40[_0xc330('0x4f')]['messageId']&&_0x4a3d40[_0xc330('0x4f')][_0xc330('0xaa')]!=_0x4a3d40['body'][_0xc330('0xaf')]){_0x2f0607[_0xc330('0xaa')]=_0x4a3d40[_0xc330('0x4f')][_0xc330('0xaf')];}return _0x52369d['update'](_0x2f0607);}else{return _0x52369d;}}})[_0xc330('0x13')](function(_0x44311b){_0x443679[_0xc330('0xb0')]=_0x44311b['get']({'plain':!![]});_0x443679[_0xc330('0xb0')][_0xc330('0xb1')]=_0xcc1dbd;if(_0x443679[_0xc330('0xb0')]['created']){if(_0x443679[_0xc330('0x93')][_0xc330('0xb2')]){_0x443679[_0xc330('0x94')][_0xc330('0xb3')]({'id':0x0,'priority':_0x443679[_0xc330('0x94')][_0xc330('0x5a')]+0x1,'app':_0xc330('0xb4'),'appdata':_0xc330('0xb5'),'interval':_0xc330('0xb6')});}}return db[_0xc330('0xb7')]['create']({'body':_0x4a3d40[_0xc330('0x4f')][_0xc330('0x4f')],'ChatWebsiteId':_0x4a3d40[_0xc330('0x49')]['id'],'ChatInteractionId':_0x44311b['id'],'direction':'in','ContactId':_0x443679[_0xc330('0x9a')]['id'],'AttachmentId':_0x4a3d40[_0xc330('0x4f')][_0xc330('0xb8')]});})[_0xc330('0x13')](function(_0x12724f){_0x443679[_0xc330('0x1c')]=_0x12724f;if(_0x443679[_0xc330('0xb0')][_0xc330('0xb9')]){return db['User'][_0xc330('0x4d')]({'attributes':['id','name'],'where':{'id':_0x443679[_0xc330('0xb0')][_0xc330('0xb9')]}})[_0xc330('0x13')](function(_0x519322){if(_0x519322){_0x443679[_0xc330('0x94')][_0xc330('0xba')]({'id':0x0,'priority':0x0,'app':_0xc330('0xbb'),'appdata':_0x519322[_0xc330('0x2c')]+','+(_0x443679[_0xc330('0x93')][_0xc330('0xbc')]||0xa),'interval':_0xc330('0xb6')});_0x443679['forcedOwnership']=!![];}return respondWithRpcPromise(_0xc330('0xbd'),'startRouting',_0x443679);});}return respondWithRpcPromise(_0xc330('0xbd'),'startRouting',_0x443679);})[_0xc330('0x13')](function(_0x5e7fa6){respondWithRpcPromise('EventManager',_0xc330('0xbe'),{'event':_0xc330('0x7b'),'message':_0x5e7fa6},client9002);return _0x5e7fa6;})[_0xc330('0x13')](respondWithResult(_0xe468ec,null))[_0xc330('0x1e')](handleError(_0xe468ec,null));};exports[_0xc330('0xbf')]=function(_0x9aac43,_0x47db16){var _0x46b786,_0x98cf42,_0x5298b9;var _0x493c8d=[];var _0xb958e={};var _0x4b7394=_0x9aac43[_0xc330('0xc0')]||[];var _0xa7a705=[];var _0x2c455c;return db[_0xc330('0x99')][_0xc330('0x56')]()[_0xc330('0x13')](function(_0x4cc877){if(!_0x4cc877){throw new db[(_0xc330('0x7f'))][(_0xc330('0x80'))](_0xc330('0x81'));}_0x493c8d=_[_0xc330('0x82')](_['keys'](_0x4cc877),[_0xc330('0x83'),_0xc330('0x8e'),'CompanyId',_0xc330('0x98')]);if(_0x9aac43['body']['id']){delete _0x9aac43[_0xc330('0x4f')]['id'];}if(_[_0xc330('0x72')](_0x9aac43[_0xc330('0x4f')][_0xc330('0x85')])){throw _0x47db16['status'](0x1f4)[_0xc330('0xc1')](new db[(_0xc330('0x7f'))][(_0xc330('0x80'))](_0xc330('0x86')));}if(_[_0xc330('0x72')](_0x9aac43['body'][_0xc330('0x4f')])||_0x9aac43[_0xc330('0x4f')]['body']===''){throw _0x47db16[_0xc330('0x20')](0x1f4)[_0xc330('0xc1')](new db[(_0xc330('0x7f'))]['ValidationError'](_0xc330('0x87')));}if(_[_0xc330('0x72')](_0x9aac43[_0xc330('0x4f')][_0xc330('0xc2')])){throw _0x47db16[_0xc330('0x20')](0x1f4)['send'](new db[(_0xc330('0x7f'))][(_0xc330('0x80'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x493c8d));}if(!_['includes'](_0x493c8d,_0x9aac43[_0xc330('0x4f')]['mapKeyOffline'])){throw _0x47db16['status'](0x1f4)[_0xc330('0xc1')](new db['Sequelize'][(_0xc330('0x80'))](_0xc330('0xc3')+_0x493c8d));}_0xb958e[_0x9aac43[_0xc330('0x4f')][_0xc330('0xc2')]]=_0x9aac43['body'][_0xc330('0x85')];})['then'](function(){return db[_0xc330('0x2f')]['find']({'where':{'id':_0x9aac43[_0xc330('0x49')]['id']},'include':[{'model':db[_0xc330('0x8c')],'as':_0xc330('0x92')},{'model':db[_0xc330('0xc4')],'as':_0xc330('0xc4')}]});})[_0xc330('0x13')](handleEntityNotFound(_0x47db16,null))[_0xc330('0x13')](function(_0x4ffc58){if(_0x4ffc58&&_0x4ffc58[_0xc330('0x92')]){_0x98cf42=_0x4ffc58;var _0x29e729=_[_0xc330('0xb')](_0x9aac43[_0xc330('0x4f')],{'firstName':_0x9aac43[_0xc330('0x4f')][_0xc330('0x85')],'phone':_0x9aac43[_0xc330('0x4f')]['from'],'ListId':_0x4ffc58['ListId']});_0x29e729[_0x9aac43['body'][_0xc330('0xc2')]]=_0x9aac43[_0xc330('0x4f')][_0xc330('0x85')];return db['CmContact']['findOrCreate']({'where':_0xb958e,'defaults':_0x29e729});}})['spread'](function(_0xc25cec){if(_0xc25cec){_0x5298b9=_0xc25cec;var _0x5c46ba=fs[_0xc330('0xc5')](path[_0xc330('0x6c')](config[_0xc330('0x6d')],'server/files/templates/chatOfflineMessage.ejs'),_0xc330('0xc6'));var _0x34a403=ejs['render'](_0x5c46ba,{'body':_[_0xc330('0xc7')](_0x9aac43[_0xc330('0x4f')][_0xc330('0x4f')]),'bodyTitle':_0x98cf42[_0xc330('0xc8')]});return db[_0xc330('0xc9')][_0xc330('0x4e')]({'body':_0x34a403,'plainBody':htmlToText[_0xc330('0xca')](_0x34a403),'ContactId':_0xc25cec['id'],'ChatWebsiteId':_0x98cf42['id']});}})['then'](function(_0x492e24){_0x2c455c=_0x492e24;if(_0x4b7394[_0xc330('0x5a')]){var _0x3ec7e3=_0x4b7394['map'](function(_0x2fd9ac){return{'name':_0x2fd9ac[_0xc330('0xcb')],'basename':_0x2fd9ac[_0xc330('0x65')],'type':_0x2fd9ac[_0xc330('0xcc')],'ChatOfflineMessageId':_0x492e24['id']};});_0xa7a705=_0x3ec7e3[_0xc330('0x34')](_0x274eb3=>{var _0x59badd={'filename':_0x274eb3['name'],'path':path['join'](config[_0xc330('0x6d')],_0xc330('0xcd'),'files','attachments',_0xc330('0xce'),_0x274eb3[_0xc330('0xcf')])};return _0x59badd;});if(!_0x98cf42[_0xc330('0xd0')]){return db[_0xc330('0xd1')]['transaction'](function(_0x2b51fd){return db[_0xc330('0xd2')][_0xc330('0xd3')](_0x3ec7e3,{'transaction':_0x2b51fd});});}}})[_0xc330('0x13')](function(){if(_0x2c455c){_0x46b786=_0x2c455c;return db[_0xc330('0xc4')][_0xc330('0x61')]({'where':{'service':!![]},'include':[{'model':db[_0xc330('0xd4')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xc330('0xd5')],'as':_0xc330('0xd5'),'raw':!![]}]}]});}})[_0xc330('0x13')](function(_0x336439){if(_0x336439&&_0x336439['Smtp']&&_0x98cf42['forwardOffline']&&_0x98cf42['forwardOfflineAddress']){var _0x350dfb=_0x336439[_0xc330('0xd6')]();return respondWithRpcPromise('SendMail',_0xc330('0xd7'),{'account':_0x350dfb,'message':{'from':util[_0xc330('0xa4')](_0xc330('0xd8'),_0x336439[_0xc330('0x2c')],_0x336439[_0xc330('0xd9')]||_0x336439[_0xc330('0xda')][_0xc330('0xdb')]),'to':_0x98cf42[_0xc330('0xdc')],'subject':_0x98cf42[_0xc330('0xdd')],'html':_0x46b786[_0xc330('0x4f')],'attachments':_0xa7a705}},client9003)[_0xc330('0x13')](function(){return _0x46b786;})[_0xc330('0x1e')](function(_0x1c909f){logger[_0xc330('0x1a')](_0x1c909f);});}})[_0xc330('0x13')](function(){if(_0x98cf42&&_0x98cf42['openNewInteraction']&&_0x98cf42[_0xc330('0xde')]){var _0x9a0165=[];if(_0x4b7394[_0xc330('0x5a')]){_0x9a0165=_0x4b7394[_0xc330('0x34')](function(_0x1c584a){return{'name':_0x1c584a[_0xc330('0xcb')],'basename':_0x1c584a[_0xc330('0x65')],'type':_0x1c584a[_0xc330('0xcc')],'ChatOfflineMessageId':_0x2c455c['id']};});}var _0x167eed;if(!_[_0xc330('0x72')](_0x98cf42[_0xc330('0xdf')])){var _0x4c137e=_['map'](_0x9aac43[_0xc330('0x4f')],function(_0x3f16e3){return _0x3f16e3;});var _0x1281aa=_['toPairsIn'](_0x4c137e)[0x0];var _0x7e444=_[_0xc330('0xe0')](_0x1281aa,function(_0x5ab155){return _0x5ab155;});_0x167eed=_0x7e444[0x1][_0x98cf42['subjectOffline']];}var _0x48b6cf={'from':_0x5298b9[_0xc330('0xd9')],'firstName':_0x5298b9[_0xc330('0x9f')],'lastName':_0x5298b9[_0xc330('0xe1')],'mapKey':_0xc330('0xd9'),'message':{'from':_0x5298b9[_0xc330('0xd9')],'to':_0x98cf42[_0xc330('0xc4')]['email'],'cc':'','subject':_[_0xc330('0x72')](_0x167eed)?_0x98cf42['offlineMessageSubject']:_0x167eed,'messageId':'','sentAt':new Date(),'attach':_0x9a0165[_0xc330('0x5a')],'attachments':_0x9a0165,'originChannel':_0xc330('0xe2'),'ChatWebsiteId':_0x98cf42['id'],'ChatOfflineMessageId':_0x46b786['id'],'originTo':_0x98cf42[_0xc330('0xc4')][_0xc330('0xd9')]},'body':_0x46b786[_0xc330('0x4f')]};var _0x4c616a={'account':{'id':_0x98cf42['MailAccountId']},'body':_0x48b6cf,'log':_0xc330('0xe3')};return respondWithRpcPromise(_0xc330('0xe3'),_0xc330('0xe4'),_0x4c616a,client9001)[_0xc330('0x13')](function(){return _0x46b786;})[_0xc330('0x1e')](function(_0x3eec60){logger[_0xc330('0x1a')](_0x3eec60);});}return;})[_0xc330('0x13')](function(){if(_0x46b786){return _0x46b786;}})[_0xc330('0x13')](respondWithResult(_0x47db16,null))['catch'](function(_0x1f48e0){logger['error'](_0xc330('0x1e'),_0x1f48e0);for(var _0x493a62 of _0x4b7394){var _0x116e55=path['join'](config[_0xc330('0x6d')],_0xc330('0xcd'),_0xc330('0xc0'),_0xc330('0xe5'),_0xc330('0xce'),_0x493a62['filename']);fs_extra['remove'](_0x116e55)[_0xc330('0x1e')](function(_0x337bd8){logger[_0xc330('0x1a')](_0xc330('0xe6'),_0x116e55,_0x337bd8);});}});};exports['addInteraction']=function(_0x577c56,_0x15e562){return db[_0xc330('0xab')][_0xc330('0x4d')]({'where':{'id':_0x577c56[_0xc330('0x49')]['id']}})['then'](handleEntityNotFound(_0x15e562,null))[_0xc330('0x13')](function(_0x225fb7){if(_0x225fb7){return _0x225fb7[_0xc330('0xe7')](_0x577c56[_0xc330('0x4f')]['ids'],_['omit'](_0x577c56['body'],[_0xc330('0x5d'),'id'])||{});}})[_0xc330('0x13')](respondWithResult(_0x15e562,null))[_0xc330('0x1e')](handleError(_0x15e562,null));};exports[_0xc330('0xe8')]=function(_0x1bd8d3,_0x381dcd){var _0xb7de3e={'raw':![],'where':{}};var _0x49cf27={};var _0x3006c6={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc330('0x61')]({'where':{'id':_0x1bd8d3[_0xc330('0x49')]['id']}})['then'](handleEntityNotFound(_0x381dcd,null))['then'](function(_0xaef4ef){if(_0xaef4ef){_0x49cf27[_0xc330('0x33')]=_[_0xc330('0x36')](db[_0xc330('0xab')][_0xc330('0x4b')]);_0x49cf27[_0xc330('0x35')]=_['keys'](_0x1bd8d3[_0xc330('0x35')]);_0x49cf27[_0xc330('0x37')]=_[_0xc330('0x38')](_0x49cf27['model'],_0x49cf27[_0xc330('0x35')]);_0xb7de3e[_0xc330('0x39')]=_['intersection'](_0x49cf27['model'],qs['fields'](_0x1bd8d3[_0xc330('0x35')][_0xc330('0x3a')]));_0xb7de3e[_0xc330('0x39')]=_0xb7de3e[_0xc330('0x39')]['length']?_0xb7de3e['attributes']:_0x49cf27[_0xc330('0x33')];if(!_0x1bd8d3[_0xc330('0x35')]['hasOwnProperty']('nolimit')){_0xb7de3e['limit']=qs[_0xc330('0x24')](_0x1bd8d3[_0xc330('0x35')]['limit']);_0xb7de3e[_0xc330('0x26')]=qs['offset'](_0x1bd8d3['query'][_0xc330('0x26')]);}_0xb7de3e[_0xc330('0x3d')]=qs[_0xc330('0x3e')](_0x1bd8d3[_0xc330('0x35')][_0xc330('0x3e')]);_0xb7de3e[_0xc330('0x41')]=qs['filters'](_[_0xc330('0x3f')](_0x1bd8d3[_0xc330('0x35')],_0x49cf27[_0xc330('0x37')]));_0xb7de3e[_0xc330('0x41')][_0xc330('0x5b')]=_0xaef4ef['id'];if(_0x1bd8d3[_0xc330('0x35')]['filter']){_0xb7de3e[_0xc330('0x41')]=_['merge'](_0xb7de3e['where'],{'$or':_[_0xc330('0x34')](_0xb7de3e['attributes'],function(_0x45f1b5){var _0x4c77eb={};_0x4c77eb[_0x45f1b5]={'$like':'%'+_0x1bd8d3[_0xc330('0x35')][_0xc330('0x40')]+'%'};return _0x4c77eb;})});}_0xb7de3e=_[_0xc330('0x42')]({},_0xb7de3e,_0x1bd8d3[_0xc330('0x44')]);return db[_0xc330('0xab')]['count']({'where':_0xb7de3e[_0xc330('0x41')]})[_0xc330('0x13')](function(_0x497f83){_0x3006c6[_0xc330('0x25')]=_0x497f83;if(_0x1bd8d3[_0xc330('0x35')]['includeAll']){_0xb7de3e[_0xc330('0x45')]=[{'model':db[_0xc330('0x99')],'as':_0xc330('0xe9'),'required':![]},{'model':db[_0xc330('0xea')],'as':_0xc330('0xeb'),'attributes':[_0xc330('0x2c'),_0xc330('0xec'),_0xc330('0xed')],'required':![]},{'model':db[_0xc330('0xee')],'as':_0xc330('0xef'),'attributes':['id',_0xc330('0x2c'),'color'],'where':_0x1bd8d3['query']['tag']?{'id':_0x1bd8d3[_0xc330('0x35')][_0xc330('0xf0')]}:undefined,'required':_0x1bd8d3[_0xc330('0x35')][_0xc330('0xf0')]?!![]:![]}];}return db[_0xc330('0xab')][_0xc330('0x46')](_0xb7de3e);})['then'](function(_0x8b3a5f){_0x3006c6[_0xc330('0x47')]=_0x8b3a5f;return _0x3006c6;});}})[_0xc330('0x13')](respondWithFilteredResult(_0x381dcd,_0xb7de3e))['catch'](handleError(_0x381dcd,null));};function iftimePromise(_0x5c1eec,_0x1538f7){return respondWithRpcPromise(_0xc330('0xf1'),_0xc330('0xf2'),{'command':_0x1538f7[_0xc330('0xf3')]?util['format'](_0xc330('0xf4'),_0x5c1eec[_0xc330('0xf5')],_0x1538f7[_0xc330('0xf3')]):util[_0xc330('0xa4')]('iftime\x20%s',_0x5c1eec['interval'])},client9002)[_0xc330('0x13')](function(_0x59dc61){var _0x2f8ff3=_0x59dc61&&_0x59dc61[_0xc330('0xf6')](_0xc330('0xf7'))>=0x0?!![]:![];logger[_0xc330('0x14')](_0xc330('0xf8'),_0x1538f7['id'],_0x5c1eec['id'],_0x5c1eec['interval'],_0x2f8ff3?_0xc330('0xf9'):_0xc330('0xfa'),_0x1538f7[_0xc330('0xf3')]?_0x1538f7[_0xc330('0xf3')]:_0xc330('0xfb'));return _0x2f8ff3;})[_0xc330('0x1e')](function(_0x168d11){logger[_0xc330('0x1a')](_0xc330('0xf8'),_0x1538f7['id'],_0x5c1eec['id'],_0x5c1eec[_0xc330('0xf5')],util[_0xc330('0xfc')](_0x168d11,{'showHidden':![],'depth':null}),_0x1538f7['timezone']?_0x1538f7['timezone']:_0xc330('0xfb'));return![];});}exports[_0xc330('0xf2')]=function(_0x425140,_0x3087c4){var _0x330691=0x0;var _0x2a4a86=0x0;var _0x56a797=![];var _0x1dfe1b;var _0x2cc4ff;return db['ChatWebsite'][_0xc330('0x4d')]({'where':{'id':_0x425140[_0xc330('0x49')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0xc330('0xfd')],'as':'Intervals','attributes':['id',_0xc330('0xf5')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3087c4,null))['then'](function(_0x381a97){if(_0x381a97){_0x1dfe1b=_0x381a97;return _0x381a97['getProactiveActions']({'raw':!![]});}})[_0xc330('0x13')](function(_0x49f768){if(_0x1dfe1b){if(_0x49f768){_0x2cc4ff=_0x49f768;}}return require(_0xc330('0x6f'))[_0xc330('0x70')]();})[_0xc330('0x13')](function(_0x33e822){if(_0x33e822){_0x2a4a86=_0x33e822[_0xc330('0xfe')];_0x56a797=_0x33e822[_0xc330('0x71')];}})['then'](function(){return db[_0xc330('0xab')][_0xc330('0x25')]({'where':{'closed':![]}});})['then'](function(_0x26206c){_0x330691=_0x26206c;if(_0x2a4a86&&_0x26206c>_0x2a4a86){return db[_0xc330('0xff')][_0xc330('0x61')]({'where':{'id':0x1}})[_0xc330('0x13')](function(_0x5718f2){if(_0x5718f2){_0x5718f2[_0xc330('0x100')](_0xc330('0x101'));}});}})['then'](function(){if(_0x1dfe1b[_0xc330('0xfd')]&&_0x1dfe1b[_0xc330('0xfd')]['Intervals']){var _0x333285=[];for(var _0x3c7294=0x0;_0x3c7294<_0x1dfe1b[_0xc330('0xfd')][_0xc330('0x102')][_0xc330('0x5a')];_0x3c7294++){var _0x396fba=_0x1dfe1b[_0xc330('0xfd')][_0xc330('0x102')][_0x3c7294][_0xc330('0x2a')]({'plain':!![]});_0x333285[_0xc330('0xb3')](iftimePromise(_0x396fba,_0x1dfe1b));}return BPromise[_0xc330('0x103')](_0x333285)[_0xc330('0x13')](function(_0x261d20){return _[_0xc330('0x104')](_0x261d20);});}else{return!![];}})[_0xc330('0x13')](function(_0x75542b){var _0x22e6ee=fs['readFileSync'](path['join'](config['root'],_0xc330('0x105')),'utf8');var _0xc765cf={'remote':_0x1dfe1b['remote'],'query':querystring[_0xc330('0x19')](_[_0xc330('0x42')](_0x1dfe1b['get']({'plain':!![]}),{'customerIp':_0x425140[_0xc330('0x7c')][_0xc330('0x9d')]||_0x425140['headers'][_0xc330('0x106')]||_0x425140[_0xc330('0x107')][_0xc330('0x108')]||_0x425140['ip'],'referer':_0x425140[_0xc330('0x7c')][_0xc330('0xa1')],'openedInteractions':_0x330691,'maxInteractions':_0x2a4a86,'virtual':_0x56a797[_0xc330('0xfe')],'online':_0x75542b,'custom':_0x56a797}))[_0xc330('0x109')](/'/g,'\x5c\x27')};_0x3087c4[_0xc330('0xc1')](ejs[_0xc330('0x10a')](Mustache[_0xc330('0x10a')](_0x22e6ee,_0xc765cf),{'proactiveActions':_0x2cc4ff,'alignment':_0x1dfe1b[_0xc330('0x10b')],'verticalAlignment':_0x1dfe1b[_0xc330('0x10c')],'div_color':_0x1dfe1b['color'],'labelText':_0x1dfe1b['labelText'],'text_color':_0x1dfe1b['textColor'],'button_color':_0x1dfe1b[_0xc330('0x10d')],'background_color':_0x1dfe1b[_0xc330('0x10e')],'hideWhenOffline':_0x1dfe1b[_0xc330('0x10f')],'interval':_0x1dfe1b['IntervalId']}));})[_0xc330('0x1e')](handleError(_0x3087c4,null));};exports[_0xc330('0x110')]=function(_0x4d0a9a,_0x2426d8){var _0x1db526=_0x4d0a9a[_0xc330('0x49')]['id'];var _0x17dbcf=_0x4d0a9a[_0xc330('0x4f')];var _0x40ea33=0xc8;var _0x2f94f4=null;return db[_0xc330('0xd1')][_0xc330('0x111')]({'isolationLevel':db[_0xc330('0xd1')]['Transaction'][_0xc330('0x112')][_0xc330('0x113')]},function(_0x3ba58f){return db[_0xc330('0x2f')][_0xc330('0x61')]({'where':{'id':_0x1db526},'transaction':_0x3ba58f})[_0xc330('0x13')](function(_0x1d3416){if(_0x1d3416){return db[_0xc330('0x90')][_0xc330('0x29')]({'where':{'ChatWebsiteId':_0x1db526},'transaction':_0x3ba58f})[_0xc330('0x13')](function(){var _0x36a4b1=_['map'](_0x17dbcf,function(_0x170a25){_0x170a25['ChatWebsiteId']=_0x1db526;return _0x170a25;});return db[_0xc330('0x90')][_0xc330('0xd3')](_0x36a4b1,{'transaction':_0x3ba58f});});}else{_0x40ea33=0x194;_0x2f94f4=[];}});})[_0xc330('0x13')](function(){if(_0x40ea33!==0x194){return db['ChatApplication'][_0xc330('0x114')]({'where':{'ChatWebsiteId':_0x1db526},'order':_0xc330('0x96')})[_0xc330('0x13')](function(_0x1268c7){_0x2f94f4=_0x1268c7;});}})[_0xc330('0x1e')](function(_0x268f92){_0x40ea33=0x1f4;logger[_0xc330('0x1a')](_0x268f92[_0xc330('0x115')]);if(_0x268f92['name']){delete _0x268f92['name'];}_0x2f94f4=_0x268f92;})[_0xc330('0x116')](function(){if(_0x2f94f4===null){_0x2426d8[_0xc330('0x1f')](_0x40ea33);}else{if(_0x40ea33===0x1f4){_0x2426d8[_0xc330('0x20')](_0x40ea33)[_0xc330('0xc1')](_0x2f94f4);}else{_0x2426d8['status'](_0x40ea33)[_0xc330('0x22')](_0x2f94f4);}}});};exports[_0xc330('0x117')]=function(_0x5a7cf1,_0x1a9a04){var _0xd330e5={};var _0x7178ed={};var _0x16d18b;var _0x46beec;return db[_0xc330('0x2f')][_0xc330('0x61')]({'where':{'id':_0x5a7cf1[_0xc330('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a9a04,null))['then'](function(_0x2c4867){if(_0x2c4867){_0x16d18b=_0x2c4867;_0x7178ed[_0xc330('0x33')]=_['keys'](db[_0xc330('0x90')]['rawAttributes']);_0x7178ed[_0xc330('0x35')]=_[_0xc330('0x36')](_0x5a7cf1[_0xc330('0x35')]);_0x7178ed[_0xc330('0x37')]=_[_0xc330('0x38')](_0x7178ed['model'],_0x7178ed[_0xc330('0x35')]);_0xd330e5[_0xc330('0x39')]=_[_0xc330('0x38')](_0x7178ed['model'],qs[_0xc330('0x3a')](_0x5a7cf1['query']['fields']));_0xd330e5[_0xc330('0x39')]=_0xd330e5[_0xc330('0x39')][_0xc330('0x5a')]?_0xd330e5['attributes']:_0x7178ed[_0xc330('0x33')];_0xd330e5[_0xc330('0x3d')]=qs['sort'](_0x5a7cf1[_0xc330('0x35')][_0xc330('0x3e')]);_0xd330e5[_0xc330('0x41')]=qs[_0xc330('0x37')](_[_0xc330('0x3f')](_0x5a7cf1[_0xc330('0x35')],_0x7178ed[_0xc330('0x37')]));if(_0x5a7cf1[_0xc330('0x35')][_0xc330('0x40')]){_0xd330e5['where']=_[_0xc330('0x42')](_0xd330e5[_0xc330('0x41')],{'$or':_[_0xc330('0x34')](_0xd330e5[_0xc330('0x39')],function(_0x3775b5){var _0x2c4814={};_0x2c4814[_0x3775b5]={'$like':'%'+_0x5a7cf1['query'][_0xc330('0x40')]+'%'};return _0x2c4814;})});}_0xd330e5=_[_0xc330('0x42')]({},_0xd330e5,_0x5a7cf1[_0xc330('0x44')]);return _0x16d18b[_0xc330('0x117')](_0xd330e5);}})['then'](function(_0x2ea511){if(_0x2ea511){_0x46beec=_0x2ea511[_0xc330('0x5a')];if(!_0x5a7cf1[_0xc330('0x35')][_0xc330('0x3b')](_0xc330('0x3c'))){_0xd330e5[_0xc330('0x24')]=qs[_0xc330('0x24')](_0x5a7cf1[_0xc330('0x35')]['limit']);_0xd330e5[_0xc330('0x26')]=qs[_0xc330('0x26')](_0x5a7cf1[_0xc330('0x35')][_0xc330('0x26')]);}return _0x16d18b[_0xc330('0x117')](_0xd330e5);}})[_0xc330('0x13')](function(_0x2163f){if(_0x2163f){return _0x2163f?{'count':_0x46beec,'rows':_0x2163f}:null;}})[_0xc330('0x13')](respondWithResult(_0x1a9a04,null))[_0xc330('0x1e')](handleError(_0x1a9a04,null));};exports[_0xc330('0x118')]=function(_0x1b8715,_0x9e3442){return db[_0xc330('0x119')][_0xc330('0x4d')]({'where':{'id':_0x1b8715['params']['id']}})[_0xc330('0x13')](handleEntityNotFound(_0x9e3442,null))[_0xc330('0x13')](function(_0x3ee1e7){if(_0x3ee1e7){return _0x3ee1e7['addProactiveActions'](_0x1b8715[_0xc330('0x4f')][_0xc330('0x5d')],_[_0xc330('0x11a')](_0x1b8715[_0xc330('0x4f')],[_0xc330('0x5d'),'id'])||{});}})[_0xc330('0x13')](respondWithResult(_0x9e3442,null))[_0xc330('0x1e')](handleError(_0x9e3442,null));};exports[_0xc330('0x11b')]=function(_0x43850d,_0x5b7e79){var _0x555dd6={};var _0x4a6393={};var _0x244caa;var _0x1e4228;return db[_0xc330('0x2f')][_0xc330('0x61')]({'where':{'id':_0x43850d[_0xc330('0x49')]['id']}})[_0xc330('0x13')](handleEntityNotFound(_0x5b7e79,null))['then'](function(_0x3b93bd){if(_0x3b93bd){_0x244caa=_0x3b93bd;_0x4a6393['model']=_[_0xc330('0x36')](db[_0xc330('0x11c')][_0xc330('0x4b')]);_0x4a6393[_0xc330('0x35')]=_[_0xc330('0x36')](_0x43850d[_0xc330('0x35')]);_0x4a6393['filters']=_[_0xc330('0x38')](_0x4a6393[_0xc330('0x33')],_0x4a6393[_0xc330('0x35')]);_0x555dd6[_0xc330('0x39')]=_['intersection'](_0x4a6393[_0xc330('0x33')],qs['fields'](_0x43850d[_0xc330('0x35')]['fields']));_0x555dd6['attributes']=_0x555dd6[_0xc330('0x39')][_0xc330('0x5a')]?_0x555dd6[_0xc330('0x39')]:_0x4a6393[_0xc330('0x33')];_0x555dd6[_0xc330('0x3d')]=qs[_0xc330('0x3e')](_0x43850d[_0xc330('0x35')][_0xc330('0x3e')]);_0x555dd6['where']=qs[_0xc330('0x37')](_['pick'](_0x43850d['query'],_0x4a6393[_0xc330('0x37')]));if(_0x43850d[_0xc330('0x35')][_0xc330('0x40')]){_0x555dd6[_0xc330('0x41')]=_[_0xc330('0x42')](_0x555dd6[_0xc330('0x41')],{'$or':_[_0xc330('0x34')](_0x555dd6[_0xc330('0x39')],function(_0xfd3a4a){var _0x5f1a8f={};_0x5f1a8f[_0xfd3a4a]={'$like':'%'+_0x43850d['query'][_0xc330('0x40')]+'%'};return _0x5f1a8f;})});}_0x555dd6=_[_0xc330('0x42')]({},_0x555dd6,_0x43850d[_0xc330('0x44')]);return _0x244caa[_0xc330('0x11b')](_0x555dd6);}})[_0xc330('0x13')](function(_0x442007){if(_0x442007){_0x1e4228=_0x442007['length'];if(!_0x43850d['query'][_0xc330('0x3b')](_0xc330('0x3c'))){_0x555dd6[_0xc330('0x24')]=qs['limit'](_0x43850d[_0xc330('0x35')]['limit']);_0x555dd6['offset']=qs[_0xc330('0x26')](_0x43850d[_0xc330('0x35')]['offset']);}return _0x244caa[_0xc330('0x11b')](_0x555dd6);}})[_0xc330('0x13')](function(_0x1b2aa2){if(_0x1b2aa2){return _0x1b2aa2?{'count':_0x1e4228,'rows':_0x1b2aa2}:null;}})[_0xc330('0x13')](respondWithResult(_0x5b7e79,null))[_0xc330('0x1e')](handleError(_0x5b7e79,null));};exports[_0xc330('0x11d')]=function(_0x27ac24,_0x5151f6){var _0x3fe9f2=_0x27ac24[_0xc330('0x35')]['online']===_0xc330('0x11e')?'offlineForm':'onlineForm';return db[_0xc330('0x2f')]['find']({'attributes':['id',_0x3fe9f2],'where':{'id':_0x27ac24[_0xc330('0x49')]['id']}})[_0xc330('0x13')](handleEntityNotFound(_0x5151f6,null))[_0xc330('0x13')](function(_0x30d0e6){if(_0x30d0e6){var _0x42bd91=_0x30d0e6[_0x3fe9f2];var _0x5d7c29=_0x42bd91&&_0x42bd91[_0xc330('0x11f')]?_0x42bd91[_0xc330('0x11f')]:[];_0x5151f6['send']({'fromKey':_[_0xc330('0x72')](_0x42bd91['fromKey'])?undefined:_0x42bd91[_0xc330('0x120')],'count':_0x5d7c29[_0xc330('0x5a')],'rows':_0x5d7c29});}})['catch'](handleError(_0x5151f6,null));};exports[_0xc330('0x121')]=function(_0x16ec51,_0x3f5710){var _0x377f02={'raw':![],'where':{}};var _0x411ace={};var _0x1b77ff={'count':0x0,'rows':[]};return db[_0xc330('0x2f')][_0xc330('0x61')]({'where':{'id':_0x16ec51[_0xc330('0x49')]['id']}})[_0xc330('0x13')](handleEntityNotFound(_0x3f5710,null))[_0xc330('0x13')](function(_0x40d2df){if(_0x40d2df){_0x411ace[_0xc330('0x33')]=_[_0xc330('0x36')](db[_0xc330('0xc9')][_0xc330('0x4b')]);_0x411ace[_0xc330('0x35')]=_[_0xc330('0x36')](_0x16ec51[_0xc330('0x35')]);_0x411ace['filters']=_['intersection'](_0x411ace[_0xc330('0x33')],_0x411ace['query']);_0x377f02[_0xc330('0x39')]=_[_0xc330('0x38')](_0x411ace[_0xc330('0x33')],qs[_0xc330('0x3a')](_0x16ec51[_0xc330('0x35')]['fields']));_0x377f02[_0xc330('0x39')]=_0x377f02[_0xc330('0x39')]['length']?_0x377f02[_0xc330('0x39')]:_0x411ace[_0xc330('0x33')];if(!_0x16ec51['query']['hasOwnProperty']('nolimit')){_0x377f02[_0xc330('0x24')]=qs[_0xc330('0x24')](_0x16ec51[_0xc330('0x35')][_0xc330('0x24')]);_0x377f02['offset']=qs['offset'](_0x16ec51[_0xc330('0x35')][_0xc330('0x26')]);}_0x377f02[_0xc330('0x3d')]=qs[_0xc330('0x3e')](_0x16ec51['query'][_0xc330('0x3e')]);_0x377f02[_0xc330('0x41')]=qs['filters'](_[_0xc330('0x3f')](_0x16ec51['query'],_0x411ace['filters']));_0x377f02[_0xc330('0x41')]['ChatWebsiteId']=_0x40d2df['id'];if(_0x16ec51[_0xc330('0x35')]['filter']){_0x377f02[_0xc330('0x41')]=_[_0xc330('0x42')](_0x377f02[_0xc330('0x41')],{'$or':_['map'](_0x377f02[_0xc330('0x39')],function(_0x24df1b){var _0x5f4ae6={};_0x5f4ae6[_0x24df1b]={'$like':'%'+_0x16ec51[_0xc330('0x35')][_0xc330('0x40')]+'%'};return _0x5f4ae6;})});}_0x377f02=_['merge']({},_0x377f02,_0x16ec51['options']);return db[_0xc330('0xc9')][_0xc330('0x25')]({'where':_0x377f02[_0xc330('0x41')]})['then'](function(_0x3f7604){_0x1b77ff['count']=_0x3f7604;if(_0x16ec51[_0xc330('0x35')][_0xc330('0x4c')]){_0x377f02['include']=[{'all':!![]}];}else{_0x377f02[_0xc330('0x45')]=[{'model':db['CmContact'],'as':_0xc330('0xe9'),'required':![]},{'model':db[_0xc330('0xd2')],'as':_0xc330('0x122'),'required':![]}];}return db[_0xc330('0xc9')]['findAll'](_0x377f02);})[_0xc330('0x13')](function(_0x433540){_0x1b77ff[_0xc330('0x47')]=_0x433540;return _0x1b77ff;});}})[_0xc330('0x13')](respondWithFilteredResult(_0x3f5710,_0x377f02))[_0xc330('0x1e')](handleError(_0x3f5710,null));};exports['addAgents']=function(_0x2a53aa,_0x3ee2e0){return db['ChatWebsite']['find']({'where':{'id':_0x2a53aa[_0xc330('0x49')]['id']}})[_0xc330('0x13')](handleEntityNotFound(_0x3ee2e0,null))[_0xc330('0x13')](function(_0x253f03){if(_0x253f03){return _0x253f03[_0xc330('0x123')](_0x2a53aa['body'][_0xc330('0x5d')],_[_0xc330('0x11a')](_0x2a53aa[_0xc330('0x4f')],[_0xc330('0x5d'),'id'])||{})[_0xc330('0xae')](function(_0x53d1dd){for(var _0x3afd46=0x0;_0x3afd46<_0x2a53aa[_0xc330('0x4f')][_0xc330('0x5d')][_0xc330('0x5a')];_0x3afd46+=0x1){socket[_0xc330('0x124')](_0xc330('0x125'),{'UserId':Number(_0x2a53aa[_0xc330('0x4f')]['ids'][_0x3afd46]),'ChatWebsiteId':Number(_0x2a53aa[_0xc330('0x49')]['id'])});}return _0x53d1dd;});}})[_0xc330('0x13')](respondWithResult(_0x3ee2e0,null))['catch'](handleError(_0x3ee2e0,null));};exports[_0xc330('0x126')]=function(_0x4eff5f,_0x42331c){return db[_0xc330('0x2f')]['find']({'where':{'id':_0x4eff5f[_0xc330('0x49')]['id']}})[_0xc330('0x13')](handleEntityNotFound(_0x42331c,null))[_0xc330('0x13')](function(_0x75713a){if(_0x75713a){return _0x75713a['removeAgents'](_0x4eff5f[_0xc330('0x35')][_0xc330('0x5d')])[_0xc330('0x13')](function(){if(_[_0xc330('0x127')](_0x4eff5f[_0xc330('0x35')]['ids'])){for(var _0x1a72d3=0x0;_0x1a72d3<_0x4eff5f[_0xc330('0x35')]['ids'][_0xc330('0x5a')];_0x1a72d3+=0x1){socket[_0xc330('0x124')](_0xc330('0x128'),{'UserId':Number(_0x4eff5f[_0xc330('0x35')][_0xc330('0x5d')][_0x1a72d3]),'ChatWebsiteId':Number(_0x4eff5f[_0xc330('0x49')]['id'])});}}else{socket[_0xc330('0x124')](_0xc330('0x128'),{'UserId':Number(_0x4eff5f['query']['ids']),'ChatWebsiteId':Number(_0x4eff5f[_0xc330('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x42331c,null))[_0xc330('0x1e')](handleError(_0x42331c,null));};exports['getAgents']=function(_0x92da15,_0x2608a9){var _0x3a7ae6={};var _0x8930bb={};var _0x1fa135;var _0xe5098c;return db[_0xc330('0x2f')][_0xc330('0x61')]({'where':{'id':_0x92da15[_0xc330('0x49')]['id']}})[_0xc330('0x13')](handleEntityNotFound(_0x2608a9,null))['then'](function(_0x5b5d3c){if(_0x5b5d3c){_0x1fa135=_0x5b5d3c;_0x8930bb['model']=_['keys'](db[_0xc330('0xea')][_0xc330('0x4b')]);_0x8930bb[_0xc330('0x35')]=_['keys'](_0x92da15[_0xc330('0x35')]);_0x8930bb['filters']=_[_0xc330('0x38')](_0x8930bb['model'],_0x8930bb[_0xc330('0x35')]);_0x3a7ae6['attributes']=_['intersection'](_0x8930bb['model'],qs[_0xc330('0x3a')](_0x92da15['query'][_0xc330('0x3a')]));_0x3a7ae6[_0xc330('0x39')]=_0x3a7ae6[_0xc330('0x39')]['length']?_0x3a7ae6['attributes']:_0x8930bb[_0xc330('0x33')];_0x3a7ae6[_0xc330('0x3d')]=qs[_0xc330('0x3e')](_0x92da15['query'][_0xc330('0x3e')]);_0x3a7ae6[_0xc330('0x41')]=qs[_0xc330('0x37')](_[_0xc330('0x3f')](_0x92da15[_0xc330('0x35')],_0x8930bb[_0xc330('0x37')]));if(_0x92da15[_0xc330('0x35')]['filter']){_0x3a7ae6[_0xc330('0x41')]=_[_0xc330('0x42')](_0x3a7ae6[_0xc330('0x41')],{'$or':_[_0xc330('0x34')](_0x3a7ae6[_0xc330('0x39')],function(_0x244377){var _0x20d56d={};_0x20d56d[_0x244377]={'$like':'%'+_0x92da15[_0xc330('0x35')][_0xc330('0x40')]+'%'};return _0x20d56d;})});}_0x3a7ae6=_[_0xc330('0x42')]({},_0x3a7ae6,_0x92da15[_0xc330('0x44')]);return _0x1fa135[_0xc330('0x129')](_0x3a7ae6);}})[_0xc330('0x13')](function(_0x55b692){if(_0x55b692){_0xe5098c=_0x55b692[_0xc330('0x5a')];if(!_0x92da15[_0xc330('0x35')][_0xc330('0x3b')](_0xc330('0x3c'))){_0x3a7ae6['limit']=qs[_0xc330('0x24')](_0x92da15['query'][_0xc330('0x24')]);_0x3a7ae6[_0xc330('0x26')]=qs[_0xc330('0x26')](_0x92da15[_0xc330('0x35')][_0xc330('0x26')]);}return _0x1fa135[_0xc330('0x129')](_0x3a7ae6);}})['then'](function(_0x337317){if(_0x337317){return _0x337317?{'count':_0xe5098c,'rows':_0x337317}:null;}})[_0xc330('0x13')](respondWithResult(_0x2608a9,null))['catch'](handleError(_0x2608a9,null));};
\ No newline at end of file
+var _0x0ba7=['SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','files','offline-chat','omit','getInteractions','Owner','fullname','Tag','Tags','tag','Command','getSnippet','timezone','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','getLicense','virtual','License','chatLicenseExceeded','some','server/files/chat/iframe.ejs','remote','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','color','labelText','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','getAgents','bluebird','util','path','ejs','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','undefined','limit','count','offset','json','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','create','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','Disposition','getDispositions','findOne','length','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','pick','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','agentAvatar','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','Applications','List','applications','list','orderBy','priority','asc','account','contact','customerIp','headers','cf-connecting-ip','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','update','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','User','forcedOwnership','Start','startRouting','EventManager','notify','offline','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','ListId','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','openNewInteraction','sequelize','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions'];(function(_0x1d7dd3,_0x490932){var _0x85d60=function(_0x1fd445){while(--_0x1fd445){_0x1d7dd3['push'](_0x1d7dd3['shift']());}};_0x85d60(++_0x490932);}(_0x0ba7,0x16d));var _0x70ba=function(_0x57dd6b,_0x21dd15){_0x57dd6b=_0x57dd6b-0x0;var _0x9e3256=_0x0ba7[_0x57dd6b];return _0x9e3256;};'use strict';var BPromise=require(_0x70ba('0x0'));var Mustache=require('mustache');var util=require(_0x70ba('0x1'));var path=require(_0x70ba('0x2'));var ejs=require(_0x70ba('0x3'));var fs=require('fs');var fs_extra=require(_0x70ba('0x4'));var _=require('lodash');var querystring=require(_0x70ba('0x5'));var Redis=require(_0x70ba('0x6'));var qs=require(_0x70ba('0x7'));var logger=require(_0x70ba('0x8'))(_0x70ba('0x9'));var config=require(_0x70ba('0xa'));var db=require(_0x70ba('0xb'))['db'];config[_0x70ba('0xc')]=_[_0x70ba('0xd')](config[_0x70ba('0xc')],{'host':_0x70ba('0xe'),'port':0x18eb});var socket=require(_0x70ba('0xf'))(new Redis(config[_0x70ba('0xc')]));require(_0x70ba('0x10'))[_0x70ba('0x11')](socket);var htmlToText=require('html-to-text');var jayson=require(_0x70ba('0x12'));var client=jayson['client'][_0x70ba('0x13')]({'port':0x232c});var client9002=jayson[_0x70ba('0x14')][_0x70ba('0x13')]({'port':0x232a});var client9003=jayson[_0x70ba('0x14')]['http']({'port':0x232b});var client9001=jayson['client'][_0x70ba('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x4a2c2e,_0xd6580e,_0x5e94c7,_0x285dad){return new BPromise(function(_0x35cb3f,_0x4df1e3){var _0x1d674b=_0x285dad||client;return _0x1d674b['request'](_0x4a2c2e,_0x5e94c7)[_0x70ba('0x15')](function(_0x2728e1){logger[_0x70ba('0x16')](_0x70ba('0x17'),_0xd6580e,_0x70ba('0x18'));logger[_0x70ba('0x19')](_0x70ba('0x1a'),_0xd6580e,_0x70ba('0x18'),JSON[_0x70ba('0x1b')](_0x2728e1));if(_0x2728e1[_0x70ba('0x1c')]){if(_0x2728e1[_0x70ba('0x1c')][_0x70ba('0x1d')]===0x1f4){logger[_0x70ba('0x1c')](_0x70ba('0x17'),_0xd6580e,_0x2728e1['error']['message']);return _0x4df1e3(_0x2728e1['error'][_0x70ba('0x1e')]);}logger[_0x70ba('0x1c')](_0x70ba('0x17'),_0xd6580e,_0x2728e1[_0x70ba('0x1c')][_0x70ba('0x1e')]);return _0x35cb3f(_0x2728e1[_0x70ba('0x1c')][_0x70ba('0x1e')]);}else{logger[_0x70ba('0x16')](_0x70ba('0x17'),_0xd6580e,_0x70ba('0x18'));_0x35cb3f(_0x2728e1[_0x70ba('0x1f')][_0x70ba('0x1e')]);}})[_0x70ba('0x20')](function(_0x4570b0){logger[_0x70ba('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0xd6580e,_0x4570b0);_0x4df1e3(_0x4570b0);});});}function respondWithStatusCode(_0x3b31ef,_0x4203cc){_0x4203cc=_0x4203cc||0xcc;return function(_0x52accf){if(_0x52accf){return _0x3b31ef[_0x70ba('0x21')](_0x4203cc);}return _0x3b31ef['status'](_0x4203cc)['end']();};}function respondWithResult(_0x112aeb,_0x5152b2){_0x5152b2=_0x5152b2||0xc8;return function(_0x45bbf2){if(_0x45bbf2){return _0x112aeb[_0x70ba('0x22')](_0x5152b2)['json'](_0x45bbf2);}};}function respondWithFilteredResult(_0xf403fc,_0x4ef847){return function(_0x5ad828){if(_0x5ad828){var _0x39482c=typeof _0x4ef847['offset']===_0x70ba('0x23')&&typeof _0x4ef847[_0x70ba('0x24')]===_0x70ba('0x23');var _0x33e218=_0x5ad828[_0x70ba('0x25')];var _0x265423=_0x39482c?0x0:_0x4ef847['offset'];var _0x2d840e=_0x39482c?_0x5ad828[_0x70ba('0x25')]:_0x4ef847[_0x70ba('0x26')]+_0x4ef847['limit'];var _0x445fe5;if(_0x2d840e>=_0x33e218){_0x2d840e=_0x33e218;_0x445fe5=0xc8;}else{_0x445fe5=0xce;}_0xf403fc['status'](_0x445fe5);return _0xf403fc['set']('Content-Range',_0x265423+'-'+_0x2d840e+'/'+_0x33e218)[_0x70ba('0x27')](_0x5ad828);}return null;};}function saveUpdates(_0x345edd){return function(_0x5b6e6e){if(_0x5b6e6e){return _0x5b6e6e['update'](_0x345edd)[_0x70ba('0x15')](function(_0x4ff810){return _0x4ff810;});}return null;};}function removeEntity(_0x102661){return function(_0x45d972){if(_0x45d972){return _0x45d972[_0x70ba('0x28')]()[_0x70ba('0x15')](function(){var _0x1db0c4=_0x45d972[_0x70ba('0x29')]({'plain':!![]});var _0x1f86cf=_0x70ba('0x2a');return db[_0x70ba('0x2b')][_0x70ba('0x28')]({'where':{'type':_0x1f86cf,'resourceId':_0x1db0c4['id']}})[_0x70ba('0x15')](function(){return _0x45d972;});})['then'](function(){_0x102661['status'](0xcc)[_0x70ba('0x2c')]();});}};}function handleEntityNotFound(_0x39433a){return function(_0x943e49){if(!_0x943e49){_0x39433a['sendStatus'](0x194);}return _0x943e49;};}function handleError(_0x5a5249,_0x507f00){_0x507f00=_0x507f00||0x1f4;return function(_0x2ada50){logger[_0x70ba('0x1c')](_0x2ada50[_0x70ba('0x2d')]);if(_0x2ada50['name']){delete _0x2ada50[_0x70ba('0x2e')];}_0x5a5249['status'](_0x507f00)['send'](_0x2ada50);};}exports[_0x70ba('0x2f')]=function(_0x591596,_0x15774e){var _0x14c86d={'include':[{'model':db[_0x70ba('0x30')],'as':_0x70ba('0x31')}]},_0x4f3d6f={},_0x68316e={'count':0x0,'rows':[]};var _0x48328e=_[_0x70ba('0x32')](db[_0x70ba('0x33')][_0x70ba('0x34')],function(_0x75fbbe){return{'name':_0x75fbbe['fieldName'],'type':_0x75fbbe[_0x70ba('0x35')]['key']};});_0x4f3d6f[_0x70ba('0x36')]=_[_0x70ba('0x32')](_0x48328e,_0x70ba('0x2e'));_0x4f3d6f[_0x70ba('0x37')]=_[_0x70ba('0x38')](_0x591596[_0x70ba('0x37')]);_0x4f3d6f[_0x70ba('0x39')]=_['intersection'](_0x4f3d6f[_0x70ba('0x36')],_0x4f3d6f[_0x70ba('0x37')]);_0x14c86d[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x4f3d6f[_0x70ba('0x36')],qs[_0x70ba('0x3c')](_0x591596['query'][_0x70ba('0x3c')]));_0x14c86d[_0x70ba('0x3a')]=_0x14c86d[_0x70ba('0x3a')]['length']?_0x14c86d['attributes']:_0x4f3d6f['model'];if(!_0x591596[_0x70ba('0x37')][_0x70ba('0x3d')](_0x70ba('0x3e'))){_0x14c86d['limit']=qs[_0x70ba('0x24')](_0x591596[_0x70ba('0x37')][_0x70ba('0x24')]);_0x14c86d[_0x70ba('0x26')]=qs[_0x70ba('0x26')](_0x591596['query']['offset']);}_0x14c86d[_0x70ba('0x3f')]=qs[_0x70ba('0x40')](_0x591596[_0x70ba('0x37')]['sort']);_0x14c86d['where']=qs[_0x70ba('0x39')](_['pick'](_0x591596[_0x70ba('0x37')],_0x4f3d6f[_0x70ba('0x39')]),_0x48328e);if(_0x591596[_0x70ba('0x37')][_0x70ba('0x41')]){_0x14c86d[_0x70ba('0x42')]=_['merge'](_0x14c86d[_0x70ba('0x42')],{'$or':_[_0x70ba('0x32')](_0x48328e,function(_0x20e0b9){if(_0x20e0b9[_0x70ba('0x35')]!==_0x70ba('0x43')){var _0x3fdefb={};_0x3fdefb[_0x20e0b9[_0x70ba('0x2e')]]={'$like':'%'+_0x591596[_0x70ba('0x37')][_0x70ba('0x41')]+'%'};return _0x3fdefb;}})});}_0x14c86d=_[_0x70ba('0x44')]({},_0x14c86d,_0x591596[_0x70ba('0x45')]);var _0x349059={'where':_0x14c86d[_0x70ba('0x42')]};return db[_0x70ba('0x33')][_0x70ba('0x25')](_0x349059)['then'](function(_0xd7638f){_0x68316e[_0x70ba('0x25')]=_0xd7638f;if(_0x591596['query'][_0x70ba('0x46')]){_0x14c86d[_0x70ba('0x47')]=[{'all':!![]}];}return db[_0x70ba('0x33')][_0x70ba('0x48')](_0x14c86d);})[_0x70ba('0x15')](function(_0x224fce){_0x68316e[_0x70ba('0x49')]=_0x224fce;return _0x68316e;})['then'](respondWithFilteredResult(_0x15774e,_0x14c86d))[_0x70ba('0x20')](handleError(_0x15774e,null));};exports[_0x70ba('0x4a')]=function(_0x390cd0,_0x3d1f89){var _0x3d46db={'raw':![],'where':{'id':_0x390cd0[_0x70ba('0x4b')]['id']},'include':[{'model':db[_0x70ba('0x30')],'as':_0x70ba('0x31')}]},_0x383d53={};_0x383d53[_0x70ba('0x36')]=_[_0x70ba('0x38')](db[_0x70ba('0x33')][_0x70ba('0x34')]);_0x383d53[_0x70ba('0x37')]=_[_0x70ba('0x38')](_0x390cd0[_0x70ba('0x37')]);_0x383d53[_0x70ba('0x39')]=_['intersection'](_0x383d53[_0x70ba('0x36')],_0x383d53[_0x70ba('0x37')]);_0x3d46db[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x383d53['model'],qs['fields'](_0x390cd0['query'][_0x70ba('0x3c')]));_0x3d46db[_0x70ba('0x3a')]=_0x3d46db['attributes']['length']?_0x3d46db[_0x70ba('0x3a')]:_0x383d53[_0x70ba('0x36')];if(_0x390cd0[_0x70ba('0x37')][_0x70ba('0x46')]){_0x3d46db[_0x70ba('0x47')]=[{'all':!![]}];}_0x3d46db=_[_0x70ba('0x44')]({},_0x3d46db,_0x390cd0[_0x70ba('0x45')]);return db['ChatWebsite']['find'](_0x3d46db)[_0x70ba('0x15')](handleEntityNotFound(_0x3d1f89,null))[_0x70ba('0x15')](respondWithResult(_0x3d1f89,null))[_0x70ba('0x20')](handleError(_0x3d1f89,null));};exports[_0x70ba('0x4c')]=function(_0x4d4a45,_0x42ca9e){return db[_0x70ba('0x33')]['create'](_0x4d4a45['body'],{})['then'](function(_0x4acb51){var _0x2195d9=_0x4d4a45[_0x70ba('0x4d')][_0x70ba('0x29')]({'plain':!![]});if(!_0x2195d9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2195d9[_0x70ba('0x4e')]===_0x70ba('0x4d')){var _0x29bb0b=_0x4acb51['get']({'plain':!![]});var _0x1bdcd4=_0x70ba('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x1bdcd4,'userProfileId':_0x2195d9[_0x70ba('0x4f')]},'raw':!![]})[_0x70ba('0x15')](function(_0x212204){if(_0x212204&&_0x212204[_0x70ba('0x50')]===0x0){return db[_0x70ba('0x2b')][_0x70ba('0x4c')]({'name':_0x29bb0b[_0x70ba('0x2e')],'resourceId':_0x29bb0b['id'],'type':_0x212204['name'],'sectionId':_0x212204['id']},{})[_0x70ba('0x15')](function(){return _0x4acb51;});}else{return _0x4acb51;}})[_0x70ba('0x20')](function(_0x4de412){logger['error'](_0x70ba('0x51'),_0x4de412);throw _0x4de412;});}return _0x4acb51;})[_0x70ba('0x15')](respondWithResult(_0x42ca9e,0xc9))['catch'](handleError(_0x42ca9e,null));};exports['update']=function(_0x3279bf,_0x5ddf78){if(_0x3279bf['body']['id']){delete _0x3279bf[_0x70ba('0x52')]['id'];}return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x3279bf[_0x70ba('0x4b')]['id']},'include':[{'model':db[_0x70ba('0x30')],'as':_0x70ba('0x31')}]})[_0x70ba('0x15')](handleEntityNotFound(_0x5ddf78,null))['then'](saveUpdates(_0x3279bf[_0x70ba('0x52')],null))[_0x70ba('0x15')](respondWithResult(_0x5ddf78,null))[_0x70ba('0x20')](handleError(_0x5ddf78,null));};exports[_0x70ba('0x28')]=function(_0x355df4,_0x1799a2){return db['ChatWebsite'][_0x70ba('0x53')]({'where':{'id':_0x355df4['params']['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x1799a2,null))['then'](removeEntity(_0x1799a2,null))[_0x70ba('0x20')](handleError(_0x1799a2,null));};exports[_0x70ba('0x54')]=function(_0x750a06,_0x305df9){return db[_0x70ba('0x33')][_0x70ba('0x54')]()['then'](respondWithResult(_0x305df9,null))[_0x70ba('0x20')](handleError(_0x305df9,null));};exports['addDisposition']=function(_0x490948,_0x31bf24){if(_0x490948[_0x70ba('0x52')]['id']){delete _0x490948['body']['id'];}return db[_0x70ba('0x33')]['find']({'where':{'id':_0x490948[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x31bf24,null))[_0x70ba('0x15')](function(_0x59e5c1){if(_0x59e5c1){_0x490948[_0x70ba('0x52')]['ChatWebsiteId']=_0x59e5c1['id'];return db[_0x70ba('0x55')]['create'](_0x490948[_0x70ba('0x52')]);}})[_0x70ba('0x15')](respondWithResult(_0x31bf24,null))[_0x70ba('0x20')](handleError(_0x31bf24,null));};exports[_0x70ba('0x56')]=function(_0x4bd8f6,_0x2b9489){var _0x530324={'raw':![],'where':{}};var _0x2c95c8={};var _0x28e490={'count':0x0,'rows':[]};return db[_0x70ba('0x33')][_0x70ba('0x57')]({'where':{'id':_0x4bd8f6['params']['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x2b9489,null))[_0x70ba('0x15')](function(_0x3a2132){if(_0x3a2132){_0x2c95c8[_0x70ba('0x36')]=_[_0x70ba('0x38')](db[_0x70ba('0x55')][_0x70ba('0x34')]);_0x2c95c8[_0x70ba('0x37')]=_['keys'](_0x4bd8f6[_0x70ba('0x37')]);_0x2c95c8[_0x70ba('0x39')]=_[_0x70ba('0x3b')](_0x2c95c8[_0x70ba('0x36')],_0x2c95c8[_0x70ba('0x37')]);_0x530324[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x2c95c8['model'],qs[_0x70ba('0x3c')](_0x4bd8f6[_0x70ba('0x37')][_0x70ba('0x3c')]));_0x530324[_0x70ba('0x3a')]=_0x530324[_0x70ba('0x3a')][_0x70ba('0x58')]?_0x530324[_0x70ba('0x3a')]:_0x2c95c8[_0x70ba('0x36')];if(!_0x4bd8f6['query']['hasOwnProperty'](_0x70ba('0x3e'))){_0x530324[_0x70ba('0x24')]=qs[_0x70ba('0x24')](_0x4bd8f6['query'][_0x70ba('0x24')]);_0x530324[_0x70ba('0x26')]=qs[_0x70ba('0x26')](_0x4bd8f6['query'][_0x70ba('0x26')]);}_0x530324[_0x70ba('0x3f')]=qs[_0x70ba('0x40')](_0x4bd8f6[_0x70ba('0x37')][_0x70ba('0x40')]);_0x530324[_0x70ba('0x42')]=qs[_0x70ba('0x39')](_['pick'](_0x4bd8f6[_0x70ba('0x37')],_0x2c95c8['filters']));_0x530324['where'][_0x70ba('0x59')]=_0x3a2132['id'];if(_0x4bd8f6[_0x70ba('0x37')][_0x70ba('0x41')]){_0x530324[_0x70ba('0x42')]=_[_0x70ba('0x44')](_0x530324[_0x70ba('0x42')],{'$or':_[_0x70ba('0x32')](_0x530324[_0x70ba('0x3a')],function(_0x48a362){var _0x122ea1={};_0x122ea1[_0x48a362]={'$like':'%'+_0x4bd8f6[_0x70ba('0x37')][_0x70ba('0x41')]+'%'};return _0x122ea1;})});}_0x530324=_['merge']({},_0x530324,_0x4bd8f6['options']);return db['Disposition'][_0x70ba('0x25')]({'where':_0x530324['where']})['then'](function(_0x5659ed){_0x28e490[_0x70ba('0x25')]=_0x5659ed;if(_0x4bd8f6[_0x70ba('0x37')][_0x70ba('0x46')]){_0x530324[_0x70ba('0x47')]=[{'all':!![]}];}return db[_0x70ba('0x55')]['findAll'](_0x530324);})['then'](function(_0x10758e){_0x28e490[_0x70ba('0x49')]=_0x10758e;return _0x28e490;});}})['then'](respondWithFilteredResult(_0x2b9489,_0x530324))[_0x70ba('0x20')](handleError(_0x2b9489,null));};exports[_0x70ba('0x5a')]=function(_0x30a7e7,_0x498af4){return db[_0x70ba('0x33')]['find']({'where':{'id':_0x30a7e7[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x498af4,null))['then'](function(_0xf8e8){if(_0xf8e8){return _0xf8e8['removeDispositions'](_0x30a7e7[_0x70ba('0x37')][_0x70ba('0x5b')]);}})['then'](respondWithStatusCode(_0x498af4,null))[_0x70ba('0x20')](handleError(_0x498af4,null));};exports[_0x70ba('0x5c')]=function(_0x35ebc4,_0xb3c58c){if(_0x35ebc4[_0x70ba('0x52')]['id']){delete _0x35ebc4[_0x70ba('0x52')]['id'];}return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x35ebc4[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0xb3c58c,null))['then'](function(_0x16e2f3){if(_0x16e2f3){_0x35ebc4[_0x70ba('0x52')][_0x70ba('0x59')]=_0x16e2f3['id'];return db[_0x70ba('0x5d')]['create'](_0x35ebc4[_0x70ba('0x52')]);}})['then'](respondWithResult(_0xb3c58c,null))[_0x70ba('0x20')](handleError(_0xb3c58c,null));};exports['getAnswers']=function(_0x44b3ad,_0x18d129){var _0x56a430={'raw':![],'where':{}};var _0x15a587={};var _0x849a57={'count':0x0,'rows':[]};return db[_0x70ba('0x33')][_0x70ba('0x57')]({'where':{'id':_0x44b3ad[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x18d129,null))[_0x70ba('0x15')](function(_0x5150c){if(_0x5150c){_0x15a587['model']=_[_0x70ba('0x38')](db[_0x70ba('0x5d')][_0x70ba('0x34')]);_0x15a587[_0x70ba('0x37')]=_[_0x70ba('0x38')](_0x44b3ad[_0x70ba('0x37')]);_0x15a587[_0x70ba('0x39')]=_[_0x70ba('0x3b')](_0x15a587['model'],_0x15a587[_0x70ba('0x37')]);_0x56a430[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x15a587['model'],qs[_0x70ba('0x3c')](_0x44b3ad[_0x70ba('0x37')][_0x70ba('0x3c')]));_0x56a430['attributes']=_0x56a430['attributes'][_0x70ba('0x58')]?_0x56a430['attributes']:_0x15a587['model'];if(!_0x44b3ad[_0x70ba('0x37')][_0x70ba('0x3d')](_0x70ba('0x3e'))){_0x56a430[_0x70ba('0x24')]=qs[_0x70ba('0x24')](_0x44b3ad[_0x70ba('0x37')]['limit']);_0x56a430['offset']=qs[_0x70ba('0x26')](_0x44b3ad[_0x70ba('0x37')][_0x70ba('0x26')]);}_0x56a430[_0x70ba('0x3f')]=qs['sort'](_0x44b3ad[_0x70ba('0x37')][_0x70ba('0x40')]);_0x56a430[_0x70ba('0x42')]=qs[_0x70ba('0x39')](_[_0x70ba('0x5e')](_0x44b3ad[_0x70ba('0x37')],_0x15a587[_0x70ba('0x39')]));_0x56a430[_0x70ba('0x42')][_0x70ba('0x59')]=_0x5150c['id'];if(_0x44b3ad[_0x70ba('0x37')][_0x70ba('0x41')]){_0x56a430[_0x70ba('0x42')]=_[_0x70ba('0x44')](_0x56a430[_0x70ba('0x42')],{'$or':_['map'](_0x56a430[_0x70ba('0x3a')],function(_0x24328e){var _0x407b29={};_0x407b29[_0x24328e]={'$like':'%'+_0x44b3ad['query']['filter']+'%'};return _0x407b29;})});}_0x56a430=_['merge']({},_0x56a430,_0x44b3ad[_0x70ba('0x45')]);return db[_0x70ba('0x5d')][_0x70ba('0x25')]({'where':_0x56a430[_0x70ba('0x42')]})['then'](function(_0x36c69b){_0x849a57[_0x70ba('0x25')]=_0x36c69b;if(_0x44b3ad[_0x70ba('0x37')][_0x70ba('0x46')]){_0x56a430['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x56a430);})[_0x70ba('0x15')](function(_0x5deba6){_0x849a57[_0x70ba('0x49')]=_0x5deba6;return _0x849a57;});}})['then'](respondWithFilteredResult(_0x18d129,_0x56a430))[_0x70ba('0x20')](handleError(_0x18d129,null));};exports[_0x70ba('0x5f')]=function(_0x4f9d65,_0x4808cb){return db[_0x70ba('0x33')]['find']({'where':{'id':_0x4f9d65['params']['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x4808cb,null))[_0x70ba('0x15')](function(_0x2e5aa7){if(_0x2e5aa7){return _0x2e5aa7[_0x70ba('0x5f')](_0x4f9d65[_0x70ba('0x37')][_0x70ba('0x5b')]);}})[_0x70ba('0x15')](respondWithStatusCode(_0x4808cb,null))[_0x70ba('0x20')](handleError(_0x4808cb,null));};exports[_0x70ba('0x60')]=function(_0x26c4a7,_0x39df97){_0x26c4a7[_0x70ba('0x52')][_0x70ba('0x61')]=_0x26c4a7[_0x70ba('0x62')][_0x70ba('0x63')];return db['ChatWebsite'][_0x70ba('0x53')]({'where':{'id':_0x26c4a7[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x39df97,null))['then'](saveUpdates(_0x26c4a7[_0x70ba('0x52')],null))[_0x70ba('0x15')](respondWithResult(_0x39df97,null))['catch'](handleError(_0x39df97,null));};exports[_0x70ba('0x64')]=function(_0x490b96,_0x4cf238){_0x490b96[_0x70ba('0x52')]['agentAvatar']=_0x490b96[_0x70ba('0x62')]['filename'];return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x490b96[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x4cf238,null))[_0x70ba('0x15')](saveUpdates(_0x490b96[_0x70ba('0x52')],null))[_0x70ba('0x15')](respondWithResult(_0x4cf238,null))[_0x70ba('0x20')](handleError(_0x4cf238,null));};exports[_0x70ba('0x65')]=function(_0x541fb6,_0x300b4e){_0x541fb6['body'][_0x70ba('0x66')]=_0x541fb6[_0x70ba('0x62')][_0x70ba('0x63')];return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x541fb6[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x300b4e,null))[_0x70ba('0x15')](saveUpdates(_0x541fb6[_0x70ba('0x52')],null))['then'](respondWithResult(_0x300b4e,null))['catch'](handleError(_0x300b4e,null));};exports['addSystemAvatar']=function(_0x6660df,_0x556c20){_0x6660df[_0x70ba('0x52')][_0x70ba('0x67')]=_0x6660df[_0x70ba('0x62')]['filename'];return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x6660df[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x556c20,null))[_0x70ba('0x15')](saveUpdates(_0x6660df[_0x70ba('0x52')],null))['then'](respondWithResult(_0x556c20,null))['catch'](handleError(_0x556c20,null));};exports[_0x70ba('0x68')]=function(_0x4302e6,_0x554b47){var _0x25691a=path['join'](config[_0x70ba('0x69')],_0x70ba('0x6a'));var _0x4b9213={'where':{'id':_0x4302e6[_0x70ba('0x4b')]['id']},'attributes':['id',_0x70ba('0x61')],'raw':!![]};var _0x814ec6=![];return require(_0x70ba('0x6b'))['getLicense']()[_0x70ba('0x15')](function(_0xc0a10){if(_0xc0a10){_0x814ec6=_0xc0a10[_0x70ba('0x6c')];}})[_0x70ba('0x15')](function(){return db['ChatWebsite'][_0x70ba('0x53')](_0x4b9213);})[_0x70ba('0x15')](handleEntityNotFound(_0x554b47,null))[_0x70ba('0x15')](function(_0x21f988){if(_0x21f988){if(!_['isNil'](_0x21f988['sitepic'])){if(fs[_0x70ba('0x6d')](path[_0x70ba('0x6e')](config['root'],_0x70ba('0x6f'),_0x21f988[_0x70ba('0x61')]))&&_0x814ec6){_0x25691a=path[_0x70ba('0x6e')](config[_0x70ba('0x69')],_0x70ba('0x6f'),_0x21f988[_0x70ba('0x61')]);}}return _0x554b47[_0x70ba('0x70')](_0x25691a);}})[_0x70ba('0x20')](handleError(_0x554b47,null));};exports[_0x70ba('0x71')]=function(_0x373eb1,_0x2740ac){var _0x2772f2=path[_0x70ba('0x6e')](config[_0x70ba('0x69')],_0x70ba('0x72'));var _0x203622={'where':{'id':_0x373eb1[_0x70ba('0x4b')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x70ba('0x33')][_0x70ba('0x53')](_0x203622)[_0x70ba('0x15')](handleEntityNotFound(_0x2740ac,null))[_0x70ba('0x15')](function(_0x322af0){if(_0x322af0){if(!_[_0x70ba('0x73')](_0x322af0[_0x70ba('0x74')])){if(fs['existsSync'](path['join'](config[_0x70ba('0x69')],'server/files/images/avatars/',_0x322af0[_0x70ba('0x74')]))){_0x2772f2=path[_0x70ba('0x6e')](config[_0x70ba('0x69')],_0x70ba('0x75'),_0x322af0[_0x70ba('0x74')]);}}return _0x2740ac[_0x70ba('0x70')](_0x2772f2);}})[_0x70ba('0x20')](handleError(_0x2740ac,null));};exports['getCustomerAvatar']=function(_0x386d6e,_0x1729da){var _0xb3cf6=path[_0x70ba('0x6e')](config[_0x70ba('0x69')],_0x70ba('0x76'));var _0x55214a={'where':{'id':_0x386d6e[_0x70ba('0x4b')]['id']},'attributes':['id',_0x70ba('0x66'),_0x70ba('0x77')],'raw':!![]};return db[_0x70ba('0x33')][_0x70ba('0x53')](_0x55214a)[_0x70ba('0x15')](handleEntityNotFound(_0x1729da,null))[_0x70ba('0x15')](function(_0x494430){if(_0x494430){if(!_['isNil'](_0x494430[_0x70ba('0x66')])){if(fs[_0x70ba('0x6d')](path['join'](config[_0x70ba('0x69')],'server/files/images/avatars/',_0x494430[_0x70ba('0x66')]))&&_0x494430[_0x70ba('0x77')]){_0xb3cf6=path[_0x70ba('0x6e')](config[_0x70ba('0x69')],_0x70ba('0x75'),_0x494430[_0x70ba('0x66')]);}}return _0x1729da[_0x70ba('0x70')](_0xb3cf6);}})[_0x70ba('0x20')](handleError(_0x1729da,null));};exports[_0x70ba('0x78')]=function(_0x57cd06,_0x408eef){var _0x237d3b=path[_0x70ba('0x6e')](config['root'],_0x70ba('0x79'));var _0x2f7d0b={'where':{'id':_0x57cd06['params']['id']},'attributes':['id',_0x70ba('0x67')],'raw':!![]};return db[_0x70ba('0x33')][_0x70ba('0x53')](_0x2f7d0b)[_0x70ba('0x15')](handleEntityNotFound(_0x408eef,null))[_0x70ba('0x15')](function(_0x3016dd){if(_0x3016dd){if(!_[_0x70ba('0x73')](_0x3016dd[_0x70ba('0x67')])){if(fs[_0x70ba('0x6d')](path[_0x70ba('0x6e')](config[_0x70ba('0x69')],_0x70ba('0x75'),_0x3016dd[_0x70ba('0x67')]))){_0x237d3b=path['join'](config[_0x70ba('0x69')],'server/files/images/avatars/',_0x3016dd[_0x70ba('0x67')]);}}return _0x408eef[_0x70ba('0x70')](_0x237d3b);}})['catch'](handleError(_0x408eef,null));};exports['notify']=function(_0x5e5e6b,_0x28e339){var _0x43aba3=require(_0x70ba('0x7a'));var _0x28dff2=new _0x43aba3();var _0x226f09=_0x28dff2['setUA'](_0x5e5e6b['headers'][_0x70ba('0x7b')])['getResult']();var _0xb1be95={'body':_0x5e5e6b[_0x70ba('0x52')],'channel':_0x70ba('0x7c')};var _0x95e0fc=[];var _0x1c8b80=[];var _0x6b82ab={};var _0xfc0de6=![];return db[_0x70ba('0x7d')][_0x70ba('0x54')]()[_0x70ba('0x15')](function(_0x33189d){if(!_0x33189d){throw new db[(_0x70ba('0x7e'))][(_0x70ba('0x7f'))](_0x70ba('0x80'));}_0x95e0fc=_[_0x70ba('0x81')](_[_0x70ba('0x38')](_0x33189d),['createdAt',_0x70ba('0x82')]);_0x1c8b80=_['difference'](_[_0x70ba('0x38')](_0x33189d),['createdAt',_0x70ba('0x82'),_0x70ba('0x83'),'ListId']);if(_0x5e5e6b[_0x70ba('0x52')]['id']){delete _0x5e5e6b[_0x70ba('0x52')]['id'];}if(_[_0x70ba('0x73')](_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0x84')])){throw new db[(_0x70ba('0x7e'))][(_0x70ba('0x7f'))](_0x70ba('0x85'));}if(_[_0x70ba('0x73')](_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0x52')])||_0x5e5e6b['body'][_0x70ba('0x52')]===''){throw new db[(_0x70ba('0x7e'))][(_0x70ba('0x7f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x70ba('0x73')](_0x5e5e6b['body'][_0x70ba('0x86')])){throw new db['Sequelize'][(_0x70ba('0x7f'))](_0x70ba('0x87')+_0x1c8b80);}if(!_[_0x70ba('0x88')](_0x1c8b80,_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0x86')])){throw new db[(_0x70ba('0x7e'))][(_0x70ba('0x7f'))](_0x70ba('0x89')+_0x1c8b80);}_0x6b82ab[_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0x86')]]=_0x5e5e6b['body']['from'];})['then'](function(){return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x5e5e6b[_0x70ba('0x4b')]['id']},'include':[{'model':db[_0x70ba('0x8a')],'as':'List','include':[{'model':db[_0x70ba('0x7d')],'as':_0x70ba('0x8b'),'where':_0x6b82ab,'limit':0x1,'order':[[_0x70ba('0x82'),_0x70ba('0x8c')]]}]},{'model':db['ChatApplication'],'as':_0x70ba('0x8d')}]});})[_0x70ba('0x15')](handleEntityNotFound(_0x28e339,null))['then'](function(_0x13ce5d){if(_0x13ce5d&&_0x13ce5d[_0x70ba('0x8e')]){_0xb1be95['account']=_0x13ce5d;_0xb1be95[_0x70ba('0x8f')]=_0x13ce5d['Applications'];_0xb1be95[_0x70ba('0x90')]=_0x13ce5d[_0x70ba('0x8e')];_0xb1be95[_0x70ba('0x8f')]=_[_0x70ba('0x91')](_0xb1be95['applications'],[_0x70ba('0x92')],[_0x70ba('0x93')]);if(_0xb1be95[_0x70ba('0x94')][_0x70ba('0x8d')]){delete _0xb1be95[_0x70ba('0x94')]['Applications'];}if(_0xb1be95[_0x70ba('0x94')][_0x70ba('0x8e')]&&_0xb1be95['account'][_0x70ba('0x8e')][_0x70ba('0x8b')][_0x70ba('0x58')]){return _0xb1be95[_0x70ba('0x94')][_0x70ba('0x8e')]['Contacts'][0x0];}var _0x17e3b4=_['defaults'](_0x5e5e6b['body'],{'firstName':_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0x84')],'ListId':_0x13ce5d['ListId']});_0x17e3b4[_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0x86')]]=_0x5e5e6b['body']['from'];return db[_0x70ba('0x7d')]['create'](_0x17e3b4,{'fields':_0x95e0fc,'raw':!![]});}})[_0x70ba('0x15')](handleEntityNotFound(_0x28e339,null))[_0x70ba('0x15')](function(_0x1c6580){_0xb1be95[_0x70ba('0x95')]=_0x1c6580;var _0x54fa03=_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0x96')];if(_0x5e5e6b[_0x70ba('0x97')][_0x70ba('0x98')]){_0x54fa03=_0x5e5e6b[_0x70ba('0x97')]['cf-connecting-ip'];}else if(_0x5e5e6b[_0x70ba('0x97')]['x-forwarded-for']){_0x54fa03=_[_0x70ba('0x99')](_0x5e5e6b[_0x70ba('0x97')]['x-forwarded-for'][_0x70ba('0x9a')](','));}if(_0x1c6580){var _0x230785={'ContactId':_0x1c6580['id'],'ChatWebsiteId':_0x5e5e6b[_0x70ba('0x4b')]['id'],'from':(_0x1c6580[_0x70ba('0x9b')]||'')+'\x20'+(_0x1c6580[_0x70ba('0x9c')]||''),'customerIp':_0x54fa03,'customerPort':_0x5e5e6b['headers'][_0x70ba('0x9d')]?_0x5e5e6b['headers'][_0x70ba('0x9d')]:null,'referer':_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0x9e')],'browserName':_0x226f09[_0x70ba('0x9f')][_0x70ba('0x2e')]&&_0x226f09[_0x70ba('0x9f')]['version']?util[_0x70ba('0xa0')](_0x70ba('0xa1'),_0x226f09[_0x70ba('0x9f')][_0x70ba('0x2e')],_0x226f09['browser'][_0x70ba('0xa2')]):_0x70ba('0xa3'),'browserVersion':_0x226f09[_0x70ba('0x9f')][_0x70ba('0xa2')]||_0x70ba('0xa3'),'osName':util['format'](_0x70ba('0xa1'),_0x226f09['os'][_0x70ba('0x2e')],_0x226f09['os'][_0x70ba('0xa2')]),'osVersion':_0x226f09['os'][_0x70ba('0xa2')],'deviceModel':_0x226f09[_0x70ba('0xa4')]['model']&&_0x226f09[_0x70ba('0xa4')][_0x70ba('0xa5')]?util[_0x70ba('0xa0')](_0x70ba('0xa6'),_0x226f09['device']['model'],_0x226f09[_0x70ba('0xa4')][_0x70ba('0xa5')],_0x226f09['device']['type']):null,'deviceVendor':_0x226f09[_0x70ba('0xa4')][_0x70ba('0xa5')],'deviceType':_0x226f09[_0x70ba('0xa4')]['type'],'formData':JSON[_0x70ba('0x1b')](_0x5e5e6b['body'])};var _0x3a2000={'ChatWebsiteId':_0x5e5e6b[_0x70ba('0x4b')]['id'],'closed':![]};if(_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xa7')]){_0x3a2000[_0x70ba('0xa7')]=_0x5e5e6b[_0x70ba('0x52')]['threadId'];return db[_0x70ba('0xa8')]['find']({'where':_0x3a2000})[_0x70ba('0x15')](function(_0x1811cd){if(_0x1811cd){return[_0x1811cd,![]];}_0x230785[_0x70ba('0xa7')]=_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xa7')];_0x230785[_0x70ba('0xa9')]=_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xa9')];return db[_0x70ba('0xa8')][_0x70ba('0x4c')](_0x230785)[_0x70ba('0x15')](function(_0xa15fd){return[_0xa15fd,!![]];});});}_0x3a2000[_0x70ba('0xaa')]=_0x1c6580['id'];if(_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xab')]&&_0x5e5e6b['body']['interaction']['id']){_0x3a2000['id']=_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xab')]['id'];return db[_0x70ba('0xa8')][_0x70ba('0x53')]({'where':_0x3a2000})[_0x70ba('0x15')](function(_0x415365){if(_0x415365){return[_0x415365,![]];}return db[_0x70ba('0xa8')][_0x70ba('0x4c')](_0x230785)[_0x70ba('0x15')](function(_0x11fb0a){return[_0x11fb0a,!![]];});});}return db['ChatInteraction'][_0x70ba('0x4c')](_0x230785)[_0x70ba('0x15')](function(_0x1bdae4){return[_0x1bdae4,!![]];});}})[_0x70ba('0xac')](function(_0x4521e4,_0x34f7ec){if(_0x4521e4){_0xfc0de6=_0x34f7ec;if(!_0x34f7ec){var _0x3c80ab={'from':(_0xb1be95[_0x70ba('0x95')][_0x70ba('0x9b')]||'')+'\x20'+(_0xb1be95[_0x70ba('0x95')][_0x70ba('0x9c')]||'')};if(_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xa7')]&&_0x5e5e6b[_0x70ba('0x52')]['messageId']&&_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xa7')]!=_0x5e5e6b[_0x70ba('0x52')]['messageId']){_0x3c80ab[_0x70ba('0xa7')]=_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xad')];}return _0x4521e4[_0x70ba('0xae')](_0x3c80ab);}else{return _0x4521e4;}}})[_0x70ba('0x15')](function(_0x5df64b){_0xb1be95['interaction']=_0x5df64b[_0x70ba('0x29')]({'plain':!![]});_0xb1be95[_0x70ba('0xab')]['created']=_0xfc0de6;if(_0xb1be95[_0x70ba('0xab')][_0x70ba('0xaf')]){if(_0xb1be95['account'][_0x70ba('0xb0')]){_0xb1be95[_0x70ba('0x8f')][_0x70ba('0xb1')]({'id':0x0,'priority':_0xb1be95['applications'][_0x70ba('0x58')]+0x1,'app':_0x70ba('0xb2'),'appdata':_0x70ba('0xb3'),'interval':_0x70ba('0xb4')});}}return db['ChatMessage'][_0x70ba('0x4c')]({'body':_0x5e5e6b['body']['body'],'ChatWebsiteId':_0x5e5e6b[_0x70ba('0x4b')]['id'],'ChatInteractionId':_0x5df64b['id'],'direction':'in','ContactId':_0xb1be95[_0x70ba('0x95')]['id'],'AttachmentId':_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xb5')]});})[_0x70ba('0x15')](function(_0x927046){_0xb1be95[_0x70ba('0x1e')]=_0x927046;if(_0xb1be95[_0x70ba('0xab')]['UserId']){return db[_0x70ba('0xb6')][_0x70ba('0x53')]({'attributes':['id',_0x70ba('0x2e')],'where':{'id':_0xb1be95[_0x70ba('0xab')]['UserId']}})[_0x70ba('0x15')](function(_0x5eec0f){if(_0x5eec0f){_0xb1be95['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5eec0f[_0x70ba('0x2e')]+','+(_0xb1be95[_0x70ba('0x94')]['waitForTheAssignedAgent']||0xa),'interval':_0x70ba('0xb4')});_0xb1be95[_0x70ba('0xb7')]=!![];}return respondWithRpcPromise(_0x70ba('0xb8'),_0x70ba('0xb9'),_0xb1be95);});}return respondWithRpcPromise(_0x70ba('0xb8'),_0x70ba('0xb9'),_0xb1be95);})['then'](function(_0x14f5b1){respondWithRpcPromise(_0x70ba('0xba'),_0x70ba('0xba'),{'event':_0x70ba('0xbb'),'message':_0x14f5b1},client9002);return _0x14f5b1;})['then'](respondWithResult(_0x28e339,null))['catch'](handleError(_0x28e339,null));};exports[_0x70ba('0xbc')]=function(_0xc6268e,_0xef2393){var _0x46f57d,_0x4aa467,_0x4f0cc2;var _0x5b4710=[];var _0x36703b={};var _0x5e04b6=_0xc6268e['files']||[];var _0xc40464=[];var _0x41918a;return db[_0x70ba('0x7d')]['describe']()['then'](function(_0x4f4934){if(!_0x4f4934){throw new db[(_0x70ba('0x7e'))][(_0x70ba('0x7f'))](_0x70ba('0x80'));}_0x5b4710=_[_0x70ba('0x81')](_['keys'](_0x4f4934),['createdAt','updatedAt',_0x70ba('0x83'),'ListId']);if(_0xc6268e['body']['id']){delete _0xc6268e[_0x70ba('0x52')]['id'];}if(_[_0x70ba('0x73')](_0xc6268e['body']['from'])){throw _0xef2393[_0x70ba('0x22')](0x1f4)[_0x70ba('0xbd')](new db[(_0x70ba('0x7e'))]['ValidationError'](_0x70ba('0x85')));}if(_[_0x70ba('0x73')](_0xc6268e['body']['body'])||_0xc6268e[_0x70ba('0x52')]['body']===''){throw _0xef2393[_0x70ba('0x22')](0x1f4)[_0x70ba('0xbd')](new db[(_0x70ba('0x7e'))]['ValidationError'](_0x70ba('0xbe')));}if(_[_0x70ba('0x73')](_0xc6268e[_0x70ba('0x52')][_0x70ba('0xbf')])){throw _0xef2393[_0x70ba('0x22')](0x1f4)[_0x70ba('0xbd')](new db[(_0x70ba('0x7e'))][(_0x70ba('0x7f'))](_0x70ba('0xc0')+_0x5b4710));}if(!_['includes'](_0x5b4710,_0xc6268e[_0x70ba('0x52')]['mapKeyOffline'])){throw _0xef2393[_0x70ba('0x22')](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0x70ba('0xc1')+_0x5b4710));}_0x36703b[_0xc6268e[_0x70ba('0x52')][_0x70ba('0xbf')]]=_0xc6268e[_0x70ba('0x52')][_0x70ba('0x84')];})[_0x70ba('0x15')](function(){return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0xc6268e[_0x70ba('0x4b')]['id']},'include':[{'model':db[_0x70ba('0x8a')],'as':_0x70ba('0x8e')},{'model':db[_0x70ba('0xc2')],'as':'MailAccount'}]});})[_0x70ba('0x15')](handleEntityNotFound(_0xef2393,null))[_0x70ba('0x15')](function(_0x232e13){if(_0x232e13&&_0x232e13[_0x70ba('0x8e')]){_0x4aa467=_0x232e13;var _0x56100e=_[_0x70ba('0xd')](_0xc6268e[_0x70ba('0x52')],{'firstName':_0xc6268e[_0x70ba('0x52')]['from'],'phone':_0xc6268e[_0x70ba('0x52')][_0x70ba('0x84')],'ListId':_0x232e13[_0x70ba('0xc3')]});_0x56100e[_0xc6268e[_0x70ba('0x52')]['mapKeyOffline']]=_0xc6268e[_0x70ba('0x52')]['from'];return db[_0x70ba('0x7d')][_0x70ba('0xc4')]({'where':_0x36703b,'defaults':_0x56100e});}})[_0x70ba('0xac')](function(_0x1536cc){if(_0x1536cc){_0x4f0cc2=_0x1536cc;var _0x54df0d=fs[_0x70ba('0xc5')](path[_0x70ba('0x6e')](config[_0x70ba('0x69')],'server/files/templates/chatOfflineMessage.ejs'),_0x70ba('0xc6'));var _0x2773df=ejs[_0x70ba('0xc7')](_0x54df0d,{'body':_[_0x70ba('0xc8')](_0xc6268e[_0x70ba('0x52')][_0x70ba('0x52')]),'bodyTitle':_0x4aa467[_0x70ba('0xc9')]});return db[_0x70ba('0xca')][_0x70ba('0x4c')]({'body':_0x2773df,'plainBody':htmlToText['fromString'](_0x2773df),'ContactId':_0x1536cc['id'],'ChatWebsiteId':_0x4aa467['id']});}})[_0x70ba('0x15')](function(_0x584939){_0x41918a=_0x584939;if(_0x5e04b6[_0x70ba('0x58')]){var _0x204372=_0x5e04b6[_0x70ba('0x32')](function(_0x790d7b){return{'name':_0x790d7b[_0x70ba('0xcb')],'basename':_0x790d7b[_0x70ba('0x63')],'type':_0x790d7b[_0x70ba('0xcc')],'ChatOfflineMessageId':_0x584939['id']};});_0xc40464=_0x204372['map'](_0x4bf752=>{var _0x70d514={'filename':_0x4bf752[_0x70ba('0x2e')],'path':path[_0x70ba('0x6e')](config[_0x70ba('0x69')],_0x70ba('0xcd'),'files',_0x70ba('0xce'),'offline-chat',_0x4bf752['basename'])};return _0x70d514;});if(!_0x4aa467[_0x70ba('0xcf')]){return db[_0x70ba('0xd0')]['transaction'](function(_0xff0716){return db['Attachment'][_0x70ba('0xd1')](_0x204372,{'transaction':_0xff0716});});}}})[_0x70ba('0x15')](function(){if(_0x41918a){_0x46f57d=_0x41918a;return db[_0x70ba('0xc2')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x70ba('0xd2')],'as':_0x70ba('0xd3'),'raw':!![],'include':[{'model':db[_0x70ba('0xd4')],'as':_0x70ba('0xd4'),'raw':!![]}]}]});}})[_0x70ba('0x15')](function(_0x42bcea){if(_0x42bcea&&_0x42bcea['Smtp']&&_0x4aa467['forwardOffline']&&_0x4aa467[_0x70ba('0xd5')]){var _0x3d4881=_0x42bcea[_0x70ba('0xd6')]();return respondWithRpcPromise(_0x70ba('0xd7'),_0x70ba('0xd8'),{'account':_0x3d4881,'message':{'from':util[_0x70ba('0xa0')](_0x70ba('0xd9'),_0x42bcea[_0x70ba('0x2e')],_0x42bcea[_0x70ba('0xda')]||_0x42bcea['Smtp'][_0x70ba('0x4d')]),'to':_0x4aa467[_0x70ba('0xd5')],'subject':_0x4aa467[_0x70ba('0xdb')],'html':_0x46f57d[_0x70ba('0x52')],'attachments':_0xc40464}},client9003)[_0x70ba('0x15')](function(){return _0x46f57d;})[_0x70ba('0x20')](function(_0x1c0bfa){logger['error'](_0x1c0bfa);});}})[_0x70ba('0x15')](function(){if(_0x4aa467&&_0x4aa467[_0x70ba('0xcf')]&&_0x4aa467[_0x70ba('0xdc')]){var _0x393f9f=[];if(_0x5e04b6[_0x70ba('0x58')]){_0x393f9f=_0x5e04b6[_0x70ba('0x32')](function(_0x285242){return{'name':_0x285242[_0x70ba('0xcb')],'basename':_0x285242[_0x70ba('0x63')],'type':_0x285242[_0x70ba('0xcc')],'ChatOfflineMessageId':_0x41918a['id']};});}var _0x498eaa;if(!_['isNil'](_0x4aa467[_0x70ba('0xdd')])){var _0xe29063=_[_0x70ba('0x32')](_0xc6268e[_0x70ba('0x52')],function(_0x280ff1){return _0x280ff1;});var _0x2f1d41=_[_0x70ba('0xde')](_0xe29063)[0x0];var _0x541fd6=_[_0x70ba('0xdf')](_0x2f1d41,function(_0xf0f523){return _0xf0f523;});_0x498eaa=_0x541fd6[0x1][_0x4aa467[_0x70ba('0xdd')]];}var _0x36318c={'from':_0x4f0cc2[_0x70ba('0xda')],'firstName':_0x4f0cc2[_0x70ba('0x9b')],'lastName':_0x4f0cc2[_0x70ba('0x9c')],'mapKey':_0x70ba('0xda'),'message':{'from':_0x4f0cc2[_0x70ba('0xda')],'to':_0x4aa467[_0x70ba('0xc2')]['email'],'cc':'','subject':_['isNil'](_0x498eaa)?_0x4aa467[_0x70ba('0xdb')]:_0x498eaa,'messageId':'','sentAt':new Date(),'attach':_0x393f9f[_0x70ba('0x58')],'attachments':_0x393f9f,'originChannel':_0x70ba('0xe0'),'ChatWebsiteId':_0x4aa467['id'],'ChatOfflineMessageId':_0x46f57d['id'],'originTo':_0x4aa467[_0x70ba('0xc2')][_0x70ba('0xda')]},'body':_0x46f57d[_0x70ba('0x52')]};var _0xac585={'account':{'id':_0x4aa467[_0x70ba('0xdc')]},'body':_0x36318c,'log':_0x70ba('0xe1')};return respondWithRpcPromise(_0x70ba('0xe1'),'notifyMail',_0xac585,client9001)[_0x70ba('0x15')](function(){return _0x46f57d;})[_0x70ba('0x20')](function(_0x38e3a2){logger[_0x70ba('0x1c')](_0x38e3a2);});}return;})['then'](function(){if(_0x46f57d){return _0x46f57d;}})['then'](respondWithResult(_0xef2393,null))[_0x70ba('0x20')](function(_0x5b39c7){logger['error'](_0x70ba('0x20'),_0x5b39c7);for(var _0x1232b9 of _0x5e04b6){var _0x5898a7=path['join'](config[_0x70ba('0x69')],_0x70ba('0xcd'),_0x70ba('0xe2'),_0x70ba('0xce'),_0x70ba('0xe3'),_0x1232b9[_0x70ba('0x63')]);fs_extra['remove'](_0x5898a7)['catch'](function(_0x3659d0){logger[_0x70ba('0x1c')]('Could\x20not\x20remove\x20attachment\x20file',_0x5898a7,_0x3659d0);});}});};exports['addInteraction']=function(_0x12958b,_0x2c7d8d){return db['ChatInteraction']['find']({'where':{'id':_0x12958b[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x2c7d8d,null))[_0x70ba('0x15')](function(_0x27df76){if(_0x27df76){return _0x27df76['addInteraction'](_0x12958b[_0x70ba('0x52')]['ids'],_[_0x70ba('0xe4')](_0x12958b['body'],[_0x70ba('0x5b'),'id'])||{});}})[_0x70ba('0x15')](respondWithResult(_0x2c7d8d,null))[_0x70ba('0x20')](handleError(_0x2c7d8d,null));};exports[_0x70ba('0xe5')]=function(_0x48ef56,_0x39cbff){var _0x48014f={'raw':![],'where':{}};var _0x455bfd={};var _0x27d93e={'count':0x0,'rows':[]};return db[_0x70ba('0x33')]['findOne']({'where':{'id':_0x48ef56['params']['id']}})['then'](handleEntityNotFound(_0x39cbff,null))[_0x70ba('0x15')](function(_0x48f634){if(_0x48f634){_0x455bfd[_0x70ba('0x36')]=_[_0x70ba('0x38')](db[_0x70ba('0xa8')][_0x70ba('0x34')]);_0x455bfd[_0x70ba('0x37')]=_[_0x70ba('0x38')](_0x48ef56[_0x70ba('0x37')]);_0x455bfd[_0x70ba('0x39')]=_[_0x70ba('0x3b')](_0x455bfd[_0x70ba('0x36')],_0x455bfd[_0x70ba('0x37')]);_0x48014f[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x455bfd[_0x70ba('0x36')],qs['fields'](_0x48ef56[_0x70ba('0x37')][_0x70ba('0x3c')]));_0x48014f[_0x70ba('0x3a')]=_0x48014f[_0x70ba('0x3a')][_0x70ba('0x58')]?_0x48014f[_0x70ba('0x3a')]:_0x455bfd['model'];if(!_0x48ef56[_0x70ba('0x37')][_0x70ba('0x3d')]('nolimit')){_0x48014f[_0x70ba('0x24')]=qs[_0x70ba('0x24')](_0x48ef56[_0x70ba('0x37')][_0x70ba('0x24')]);_0x48014f[_0x70ba('0x26')]=qs[_0x70ba('0x26')](_0x48ef56[_0x70ba('0x37')][_0x70ba('0x26')]);}_0x48014f[_0x70ba('0x3f')]=qs[_0x70ba('0x40')](_0x48ef56[_0x70ba('0x37')][_0x70ba('0x40')]);_0x48014f[_0x70ba('0x42')]=qs[_0x70ba('0x39')](_['pick'](_0x48ef56[_0x70ba('0x37')],_0x455bfd['filters']));_0x48014f['where'][_0x70ba('0x59')]=_0x48f634['id'];if(_0x48ef56['query'][_0x70ba('0x41')]){_0x48014f[_0x70ba('0x42')]=_[_0x70ba('0x44')](_0x48014f[_0x70ba('0x42')],{'$or':_[_0x70ba('0x32')](_0x48014f[_0x70ba('0x3a')],function(_0xf3906e){var _0x105b68={};_0x105b68[_0xf3906e]={'$like':'%'+_0x48ef56[_0x70ba('0x37')][_0x70ba('0x41')]+'%'};return _0x105b68;})});}_0x48014f=_[_0x70ba('0x44')]({},_0x48014f,_0x48ef56['options']);return db[_0x70ba('0xa8')][_0x70ba('0x25')]({'where':_0x48014f[_0x70ba('0x42')]})['then'](function(_0x204089){_0x27d93e['count']=_0x204089;if(_0x48ef56['query'][_0x70ba('0x46')]){_0x48014f[_0x70ba('0x47')]=[{'model':db[_0x70ba('0x7d')],'as':'Contact','required':![]},{'model':db[_0x70ba('0xb6')],'as':_0x70ba('0xe6'),'attributes':[_0x70ba('0x2e'),_0x70ba('0xe7'),'internal'],'required':![]},{'model':db[_0x70ba('0xe8')],'as':_0x70ba('0xe9'),'attributes':['id',_0x70ba('0x2e'),'color'],'where':_0x48ef56[_0x70ba('0x37')][_0x70ba('0xea')]?{'id':_0x48ef56['query'][_0x70ba('0xea')]}:undefined,'required':_0x48ef56['query']['tag']?!![]:![]}];}return db[_0x70ba('0xa8')]['findAll'](_0x48014f);})[_0x70ba('0x15')](function(_0x6d80e6){_0x27d93e[_0x70ba('0x49')]=_0x6d80e6;return _0x27d93e;});}})[_0x70ba('0x15')](respondWithFilteredResult(_0x39cbff,_0x48014f))[_0x70ba('0x20')](handleError(_0x39cbff,null));};function iftimePromise(_0x46fc83,_0x5ca299){return respondWithRpcPromise(_0x70ba('0xeb'),_0x70ba('0xec'),{'command':_0x5ca299[_0x70ba('0xed')]?util[_0x70ba('0xa0')]('iftime\x20%s,%s',_0x46fc83[_0x70ba('0xee')],_0x5ca299[_0x70ba('0xed')]):util['format']('iftime\x20%s',_0x46fc83[_0x70ba('0xee')])},client9002)[_0x70ba('0x15')](function(_0x344d78){var _0x4fe10b=_0x344d78&&_0x344d78[_0x70ba('0xef')]('true')>=0x0?!![]:![];logger[_0x70ba('0x16')](_0x70ba('0xf0'),_0x5ca299['id'],_0x46fc83['id'],_0x46fc83['interval'],_0x4fe10b?_0x70ba('0xf1'):_0x70ba('0xf2'),_0x5ca299['timezone']?_0x5ca299['timezone']:'No\x20timezone');return _0x4fe10b;})['catch'](function(_0xbbda92){logger[_0x70ba('0x1c')](_0x70ba('0xf0'),_0x5ca299['id'],_0x46fc83['id'],_0x46fc83['interval'],util[_0x70ba('0xf3')](_0xbbda92,{'showHidden':![],'depth':null}),_0x5ca299['timezone']?_0x5ca299[_0x70ba('0xed')]:_0x70ba('0xf4'));return![];});}exports[_0x70ba('0xec')]=function(_0x1427f8,_0x410088){var _0x4fd1a5=0x0;var _0x12e0e9=0x0;var _0x54668c=![];var _0x5567ce;var _0x5ad1d1;return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x1427f8[_0x70ba('0x4b')]['id']},'include':[{'model':db['Interval'],'as':_0x70ba('0xf5'),'include':[{'model':db[_0x70ba('0xf5')],'as':_0x70ba('0xf6'),'attributes':['id',_0x70ba('0xee')],'raw':!![]}]}]})[_0x70ba('0x15')](handleEntityNotFound(_0x410088,null))[_0x70ba('0x15')](function(_0x1f031d){if(_0x1f031d){_0x5567ce=_0x1f031d;return _0x1f031d[_0x70ba('0xf7')]({'raw':!![]});}})[_0x70ba('0x15')](function(_0x33ef13){if(_0x5567ce){if(_0x33ef13){_0x5ad1d1=_0x33ef13;}}return require(_0x70ba('0x6b'))[_0x70ba('0xf8')]();})[_0x70ba('0x15')](function(_0x10397e){if(_0x10397e){_0x12e0e9=_0x10397e[_0x70ba('0xf9')];_0x54668c=_0x10397e[_0x70ba('0x6c')];}})['then'](function(){return db[_0x70ba('0xa8')][_0x70ba('0x25')]({'where':{'closed':![]}});})[_0x70ba('0x15')](function(_0x58edf1){_0x4fd1a5=_0x58edf1;if(_0x12e0e9&&_0x58edf1>_0x12e0e9){return db[_0x70ba('0xfa')][_0x70ba('0x57')]({'where':{'id':0x1}})[_0x70ba('0x15')](function(_0x4141d5){if(_0x4141d5){_0x4141d5['increment'](_0x70ba('0xfb'));}});}})[_0x70ba('0x15')](function(){if(_0x5567ce[_0x70ba('0xf5')]&&_0x5567ce[_0x70ba('0xf5')][_0x70ba('0xf6')]){var _0x1c47c0=[];for(var _0x4c208e=0x0;_0x4c208e<_0x5567ce[_0x70ba('0xf5')][_0x70ba('0xf6')]['length'];_0x4c208e++){var _0x5f41f8=_0x5567ce['Interval'][_0x70ba('0xf6')][_0x4c208e]['get']({'plain':!![]});_0x1c47c0[_0x70ba('0xb1')](iftimePromise(_0x5f41f8,_0x5567ce));}return BPromise['all'](_0x1c47c0)['then'](function(_0x2e49be){return _[_0x70ba('0xfc')](_0x2e49be);});}else{return!![];}})[_0x70ba('0x15')](function(_0x1439d3){var _0x138af3=fs[_0x70ba('0xc5')](path[_0x70ba('0x6e')](config[_0x70ba('0x69')],_0x70ba('0xfd')),_0x70ba('0xc6'));var _0x125daf={'remote':_0x5567ce[_0x70ba('0xfe')],'query':querystring[_0x70ba('0x1b')](_[_0x70ba('0x44')](_0x5567ce[_0x70ba('0x29')]({'plain':!![]}),{'customerIp':_0x1427f8[_0x70ba('0x97')]['x-forwarded-for']||_0x1427f8['headers'][_0x70ba('0xff')]||_0x1427f8['connection'][_0x70ba('0x100')]||_0x1427f8['ip'],'referer':_0x1427f8[_0x70ba('0x97')]['referer'],'openedInteractions':_0x4fd1a5,'maxInteractions':_0x12e0e9,'virtual':_0x54668c[_0x70ba('0xf9')],'online':_0x1439d3,'custom':_0x54668c}))[_0x70ba('0x101')](/'/g,'\x5c\x27')};_0x410088[_0x70ba('0xbd')](ejs[_0x70ba('0xc7')](Mustache['render'](_0x138af3,_0x125daf),{'proactiveActions':_0x5ad1d1,'alignment':_0x5567ce[_0x70ba('0x102')],'verticalAlignment':_0x5567ce[_0x70ba('0x103')],'div_color':_0x5567ce[_0x70ba('0x104')],'labelText':_0x5567ce[_0x70ba('0x105')],'text_color':_0x5567ce['textColor'],'button_color':_0x5567ce[_0x70ba('0x106')],'background_color':_0x5567ce[_0x70ba('0x107')],'hideWhenOffline':_0x5567ce[_0x70ba('0x108')],'interval':_0x5567ce[_0x70ba('0x109')]}));})[_0x70ba('0x20')](handleError(_0x410088,null));};exports[_0x70ba('0x10a')]=function(_0x3637a7,_0x5ca739){var _0x365164=_0x3637a7['params']['id'];var _0x194e6b=_0x3637a7[_0x70ba('0x52')];var _0x162a5c=0xc8;var _0x41e6fd=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x70ba('0xd0')][_0x70ba('0x10b')][_0x70ba('0x10c')][_0x70ba('0x10d')]},function(_0x802a0){return db['ChatWebsite'][_0x70ba('0x57')]({'where':{'id':_0x365164},'transaction':_0x802a0})[_0x70ba('0x15')](function(_0x40ec93){if(_0x40ec93){return db[_0x70ba('0x10e')][_0x70ba('0x28')]({'where':{'ChatWebsiteId':_0x365164},'transaction':_0x802a0})['then'](function(){var _0x157781=_[_0x70ba('0x32')](_0x194e6b,function(_0x3ea5ec){_0x3ea5ec[_0x70ba('0x59')]=_0x365164;return _0x3ea5ec;});return db[_0x70ba('0x10e')][_0x70ba('0xd1')](_0x157781,{'transaction':_0x802a0});});}else{_0x162a5c=0x194;_0x41e6fd=[];}});})['then'](function(){if(_0x162a5c!==0x194){return db[_0x70ba('0x10e')][_0x70ba('0x10f')]({'where':{'ChatWebsiteId':_0x365164},'order':_0x70ba('0x92')})[_0x70ba('0x15')](function(_0x24beaa){_0x41e6fd=_0x24beaa;});}})[_0x70ba('0x20')](function(_0x276bf5){_0x162a5c=0x1f4;logger[_0x70ba('0x1c')](_0x276bf5[_0x70ba('0x2d')]);if(_0x276bf5[_0x70ba('0x2e')]){delete _0x276bf5[_0x70ba('0x2e')];}_0x41e6fd=_0x276bf5;})[_0x70ba('0x110')](function(){if(_0x41e6fd===null){_0x5ca739[_0x70ba('0x21')](_0x162a5c);}else{if(_0x162a5c===0x1f4){_0x5ca739[_0x70ba('0x22')](_0x162a5c)['send'](_0x41e6fd);}else{_0x5ca739[_0x70ba('0x22')](_0x162a5c)['json'](_0x41e6fd);}}});};exports[_0x70ba('0x111')]=function(_0x1c3dca,_0x4ea206){var _0x545325={};var _0x5a3c96={};var _0x3c627b;var _0x483333;return db[_0x70ba('0x33')][_0x70ba('0x57')]({'where':{'id':_0x1c3dca[_0x70ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4ea206,null))['then'](function(_0x37a4e6){if(_0x37a4e6){_0x3c627b=_0x37a4e6;_0x5a3c96[_0x70ba('0x36')]=_[_0x70ba('0x38')](db[_0x70ba('0x10e')][_0x70ba('0x34')]);_0x5a3c96[_0x70ba('0x37')]=_[_0x70ba('0x38')](_0x1c3dca[_0x70ba('0x37')]);_0x5a3c96[_0x70ba('0x39')]=_[_0x70ba('0x3b')](_0x5a3c96['model'],_0x5a3c96['query']);_0x545325[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x5a3c96[_0x70ba('0x36')],qs['fields'](_0x1c3dca[_0x70ba('0x37')]['fields']));_0x545325[_0x70ba('0x3a')]=_0x545325[_0x70ba('0x3a')]['length']?_0x545325[_0x70ba('0x3a')]:_0x5a3c96[_0x70ba('0x36')];_0x545325[_0x70ba('0x3f')]=qs['sort'](_0x1c3dca[_0x70ba('0x37')][_0x70ba('0x40')]);_0x545325[_0x70ba('0x42')]=qs[_0x70ba('0x39')](_[_0x70ba('0x5e')](_0x1c3dca['query'],_0x5a3c96[_0x70ba('0x39')]));if(_0x1c3dca[_0x70ba('0x37')][_0x70ba('0x41')]){_0x545325['where']=_[_0x70ba('0x44')](_0x545325[_0x70ba('0x42')],{'$or':_['map'](_0x545325['attributes'],function(_0x5b2da3){var _0x38efa7={};_0x38efa7[_0x5b2da3]={'$like':'%'+_0x1c3dca[_0x70ba('0x37')][_0x70ba('0x41')]+'%'};return _0x38efa7;})});}_0x545325=_['merge']({},_0x545325,_0x1c3dca[_0x70ba('0x45')]);return _0x3c627b['getApplications'](_0x545325);}})[_0x70ba('0x15')](function(_0x427106){if(_0x427106){_0x483333=_0x427106[_0x70ba('0x58')];if(!_0x1c3dca[_0x70ba('0x37')]['hasOwnProperty']('nolimit')){_0x545325[_0x70ba('0x24')]=qs[_0x70ba('0x24')](_0x1c3dca[_0x70ba('0x37')]['limit']);_0x545325[_0x70ba('0x26')]=qs[_0x70ba('0x26')](_0x1c3dca[_0x70ba('0x37')][_0x70ba('0x26')]);}return _0x3c627b['getApplications'](_0x545325);}})[_0x70ba('0x15')](function(_0x44d4e6){if(_0x44d4e6){return _0x44d4e6?{'count':_0x483333,'rows':_0x44d4e6}:null;}})[_0x70ba('0x15')](respondWithResult(_0x4ea206,null))[_0x70ba('0x20')](handleError(_0x4ea206,null));};exports[_0x70ba('0x112')]=function(_0x159c6f,_0x3903d6){return db[_0x70ba('0x113')][_0x70ba('0x53')]({'where':{'id':_0x159c6f['params']['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x3903d6,null))[_0x70ba('0x15')](function(_0x27266b){if(_0x27266b){return _0x27266b[_0x70ba('0x112')](_0x159c6f[_0x70ba('0x52')][_0x70ba('0x5b')],_[_0x70ba('0xe4')](_0x159c6f['body'],[_0x70ba('0x5b'),'id'])||{});}})[_0x70ba('0x15')](respondWithResult(_0x3903d6,null))['catch'](handleError(_0x3903d6,null));};exports[_0x70ba('0xf7')]=function(_0x14f242,_0x64b525){var _0x127807={};var _0x3bd943={};var _0x5136b9;var _0x3d39a9;return db['ChatWebsite'][_0x70ba('0x57')]({'where':{'id':_0x14f242[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x64b525,null))[_0x70ba('0x15')](function(_0x1b6df6){if(_0x1b6df6){_0x5136b9=_0x1b6df6;_0x3bd943[_0x70ba('0x36')]=_[_0x70ba('0x38')](db[_0x70ba('0x114')][_0x70ba('0x34')]);_0x3bd943[_0x70ba('0x37')]=_[_0x70ba('0x38')](_0x14f242['query']);_0x3bd943['filters']=_[_0x70ba('0x3b')](_0x3bd943['model'],_0x3bd943[_0x70ba('0x37')]);_0x127807[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x3bd943[_0x70ba('0x36')],qs[_0x70ba('0x3c')](_0x14f242['query']['fields']));_0x127807['attributes']=_0x127807[_0x70ba('0x3a')]['length']?_0x127807[_0x70ba('0x3a')]:_0x3bd943['model'];_0x127807['order']=qs[_0x70ba('0x40')](_0x14f242['query'][_0x70ba('0x40')]);_0x127807[_0x70ba('0x42')]=qs[_0x70ba('0x39')](_[_0x70ba('0x5e')](_0x14f242[_0x70ba('0x37')],_0x3bd943[_0x70ba('0x39')]));if(_0x14f242[_0x70ba('0x37')][_0x70ba('0x41')]){_0x127807[_0x70ba('0x42')]=_['merge'](_0x127807[_0x70ba('0x42')],{'$or':_[_0x70ba('0x32')](_0x127807['attributes'],function(_0x2dc128){var _0x5aa67f={};_0x5aa67f[_0x2dc128]={'$like':'%'+_0x14f242[_0x70ba('0x37')]['filter']+'%'};return _0x5aa67f;})});}_0x127807=_[_0x70ba('0x44')]({},_0x127807,_0x14f242['options']);return _0x5136b9['getProactiveActions'](_0x127807);}})['then'](function(_0x29ac90){if(_0x29ac90){_0x3d39a9=_0x29ac90['length'];if(!_0x14f242[_0x70ba('0x37')][_0x70ba('0x3d')](_0x70ba('0x3e'))){_0x127807[_0x70ba('0x24')]=qs['limit'](_0x14f242[_0x70ba('0x37')][_0x70ba('0x24')]);_0x127807['offset']=qs[_0x70ba('0x26')](_0x14f242['query'][_0x70ba('0x26')]);}return _0x5136b9[_0x70ba('0xf7')](_0x127807);}})[_0x70ba('0x15')](function(_0x3a7eb6){if(_0x3a7eb6){return _0x3a7eb6?{'count':_0x3d39a9,'rows':_0x3a7eb6}:null;}})[_0x70ba('0x15')](respondWithResult(_0x64b525,null))['catch'](handleError(_0x64b525,null));};exports['getFields']=function(_0x87c389,_0x414704){var _0x3fa3e5=_0x87c389['query']['online']==='false'?_0x70ba('0x115'):_0x70ba('0x116');return db[_0x70ba('0x33')]['find']({'attributes':['id',_0x3fa3e5],'where':{'id':_0x87c389['params']['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x414704,null))[_0x70ba('0x15')](function(_0xf966b8){if(_0xf966b8){var _0x444c5a=_0xf966b8[_0x3fa3e5];var _0x3aa637=_0x444c5a&&_0x444c5a[_0x70ba('0x117')]?_0x444c5a[_0x70ba('0x117')]:[];_0x414704[_0x70ba('0xbd')]({'fromKey':_[_0x70ba('0x73')](_0x444c5a['fromKey'])?undefined:_0x444c5a[_0x70ba('0x118')],'count':_0x3aa637[_0x70ba('0x58')],'rows':_0x3aa637});}})[_0x70ba('0x20')](handleError(_0x414704,null));};exports[_0x70ba('0x119')]=function(_0x54b253,_0x2d775a){var _0x23c420={'raw':![],'where':{}};var _0x4822d2={};var _0x148c21={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x70ba('0x57')]({'where':{'id':_0x54b253[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x2d775a,null))[_0x70ba('0x15')](function(_0x2a590a){if(_0x2a590a){_0x4822d2['model']=_[_0x70ba('0x38')](db['ChatOfflineMessage']['rawAttributes']);_0x4822d2[_0x70ba('0x37')]=_[_0x70ba('0x38')](_0x54b253[_0x70ba('0x37')]);_0x4822d2['filters']=_['intersection'](_0x4822d2[_0x70ba('0x36')],_0x4822d2['query']);_0x23c420[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x4822d2[_0x70ba('0x36')],qs[_0x70ba('0x3c')](_0x54b253[_0x70ba('0x37')][_0x70ba('0x3c')]));_0x23c420['attributes']=_0x23c420[_0x70ba('0x3a')][_0x70ba('0x58')]?_0x23c420[_0x70ba('0x3a')]:_0x4822d2[_0x70ba('0x36')];if(!_0x54b253[_0x70ba('0x37')][_0x70ba('0x3d')]('nolimit')){_0x23c420['limit']=qs[_0x70ba('0x24')](_0x54b253['query'][_0x70ba('0x24')]);_0x23c420[_0x70ba('0x26')]=qs[_0x70ba('0x26')](_0x54b253[_0x70ba('0x37')][_0x70ba('0x26')]);}_0x23c420['order']=qs['sort'](_0x54b253[_0x70ba('0x37')]['sort']);_0x23c420[_0x70ba('0x42')]=qs[_0x70ba('0x39')](_[_0x70ba('0x5e')](_0x54b253['query'],_0x4822d2[_0x70ba('0x39')]));_0x23c420[_0x70ba('0x42')][_0x70ba('0x59')]=_0x2a590a['id'];if(_0x54b253[_0x70ba('0x37')][_0x70ba('0x41')]){_0x23c420['where']=_[_0x70ba('0x44')](_0x23c420[_0x70ba('0x42')],{'$or':_[_0x70ba('0x32')](_0x23c420['attributes'],function(_0x329644){var _0x55fb0a={};_0x55fb0a[_0x329644]={'$like':'%'+_0x54b253[_0x70ba('0x37')][_0x70ba('0x41')]+'%'};return _0x55fb0a;})});}_0x23c420=_[_0x70ba('0x44')]({},_0x23c420,_0x54b253['options']);return db[_0x70ba('0xca')][_0x70ba('0x25')]({'where':_0x23c420[_0x70ba('0x42')]})[_0x70ba('0x15')](function(_0x2323b3){_0x148c21[_0x70ba('0x25')]=_0x2323b3;if(_0x54b253[_0x70ba('0x37')]['includeAll']){_0x23c420[_0x70ba('0x47')]=[{'all':!![]}];}else{_0x23c420[_0x70ba('0x47')]=[{'model':db[_0x70ba('0x7d')],'as':_0x70ba('0x11a'),'required':![]},{'model':db['Attachment'],'as':_0x70ba('0x11b'),'required':![]}];}return db[_0x70ba('0xca')][_0x70ba('0x48')](_0x23c420);})[_0x70ba('0x15')](function(_0x36eafe){_0x148c21[_0x70ba('0x49')]=_0x36eafe;return _0x148c21;});}})['then'](respondWithFilteredResult(_0x2d775a,_0x23c420))['catch'](handleError(_0x2d775a,null));};exports[_0x70ba('0x11c')]=function(_0x4171a6,_0x2a1c36){return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x4171a6[_0x70ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2a1c36,null))[_0x70ba('0x15')](function(_0x2435aa){if(_0x2435aa){return _0x2435aa[_0x70ba('0x11c')](_0x4171a6['body'][_0x70ba('0x5b')],_[_0x70ba('0xe4')](_0x4171a6[_0x70ba('0x52')],[_0x70ba('0x5b'),'id'])||{})['spread'](function(_0x11e4d1){for(var _0x28b15e=0x0;_0x28b15e<_0x4171a6[_0x70ba('0x52')][_0x70ba('0x5b')][_0x70ba('0x58')];_0x28b15e+=0x1){socket[_0x70ba('0x11d')](_0x70ba('0x11e'),{'UserId':Number(_0x4171a6[_0x70ba('0x52')][_0x70ba('0x5b')][_0x28b15e]),'ChatWebsiteId':Number(_0x4171a6[_0x70ba('0x4b')]['id'])});}return _0x11e4d1;});}})[_0x70ba('0x15')](respondWithResult(_0x2a1c36,null))[_0x70ba('0x20')](handleError(_0x2a1c36,null));};exports[_0x70ba('0x11f')]=function(_0x5a4371,_0xcbc178){return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x5a4371[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0xcbc178,null))['then'](function(_0x4128a2){if(_0x4128a2){return _0x4128a2[_0x70ba('0x11f')](_0x5a4371[_0x70ba('0x37')][_0x70ba('0x5b')])[_0x70ba('0x15')](function(){if(_[_0x70ba('0x120')](_0x5a4371[_0x70ba('0x37')][_0x70ba('0x5b')])){for(var _0xb85429=0x0;_0xb85429<_0x5a4371[_0x70ba('0x37')][_0x70ba('0x5b')][_0x70ba('0x58')];_0xb85429+=0x1){socket[_0x70ba('0x11d')]('userChatWebsite:remove',{'UserId':Number(_0x5a4371['query'][_0x70ba('0x5b')][_0xb85429]),'ChatWebsiteId':Number(_0x5a4371[_0x70ba('0x4b')]['id'])});}}else{socket[_0x70ba('0x11d')]('userChatWebsite:remove',{'UserId':Number(_0x5a4371[_0x70ba('0x37')][_0x70ba('0x5b')]),'ChatWebsiteId':Number(_0x5a4371[_0x70ba('0x4b')]['id'])});}});}})[_0x70ba('0x15')](respondWithStatusCode(_0xcbc178,null))['catch'](handleError(_0xcbc178,null));};exports[_0x70ba('0x121')]=function(_0x14e603,_0x48dcce){var _0xf9acab={};var _0x3ad18e={};var _0x1c460f;var _0x52a29f;return db['ChatWebsite'][_0x70ba('0x57')]({'where':{'id':_0x14e603[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x48dcce,null))[_0x70ba('0x15')](function(_0x4c15ee){if(_0x4c15ee){_0x1c460f=_0x4c15ee;_0x3ad18e[_0x70ba('0x36')]=_['keys'](db[_0x70ba('0xb6')][_0x70ba('0x34')]);_0x3ad18e[_0x70ba('0x37')]=_['keys'](_0x14e603[_0x70ba('0x37')]);_0x3ad18e['filters']=_[_0x70ba('0x3b')](_0x3ad18e[_0x70ba('0x36')],_0x3ad18e[_0x70ba('0x37')]);_0xf9acab['attributes']=_[_0x70ba('0x3b')](_0x3ad18e[_0x70ba('0x36')],qs[_0x70ba('0x3c')](_0x14e603['query']['fields']));_0xf9acab[_0x70ba('0x3a')]=_0xf9acab[_0x70ba('0x3a')][_0x70ba('0x58')]?_0xf9acab['attributes']:_0x3ad18e[_0x70ba('0x36')];_0xf9acab[_0x70ba('0x3f')]=qs['sort'](_0x14e603[_0x70ba('0x37')][_0x70ba('0x40')]);_0xf9acab[_0x70ba('0x42')]=qs[_0x70ba('0x39')](_[_0x70ba('0x5e')](_0x14e603[_0x70ba('0x37')],_0x3ad18e[_0x70ba('0x39')]));if(_0x14e603[_0x70ba('0x37')][_0x70ba('0x41')]){_0xf9acab['where']=_[_0x70ba('0x44')](_0xf9acab[_0x70ba('0x42')],{'$or':_[_0x70ba('0x32')](_0xf9acab['attributes'],function(_0x25f0fc){var _0x2baf04={};_0x2baf04[_0x25f0fc]={'$like':'%'+_0x14e603[_0x70ba('0x37')]['filter']+'%'};return _0x2baf04;})});}_0xf9acab=_[_0x70ba('0x44')]({},_0xf9acab,_0x14e603['options']);return _0x1c460f['getAgents'](_0xf9acab);}})['then'](function(_0x4679c9){if(_0x4679c9){_0x52a29f=_0x4679c9[_0x70ba('0x58')];if(!_0x14e603['query'][_0x70ba('0x3d')]('nolimit')){_0xf9acab['limit']=qs[_0x70ba('0x24')](_0x14e603['query'][_0x70ba('0x24')]);_0xf9acab[_0x70ba('0x26')]=qs[_0x70ba('0x26')](_0x14e603[_0x70ba('0x37')]['offset']);}return _0x1c460f[_0x70ba('0x121')](_0xf9acab);}})[_0x70ba('0x15')](function(_0x247767){if(_0x247767){return _0x247767?{'count':_0x52a29f,'rows':_0x247767}:null;}})[_0x70ba('0x15')](respondWithResult(_0x48dcce,null))[_0x70ba('0x20')](handleError(_0x48dcce,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 7ddd605..3d7a001 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 _0x7dfd=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd7df('0x0'));var ChatWebsite=require(_0xd7df('0x1'))['db'][_0xd7df('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd7df('0x3')](0x0);var events={'afterCreate':_0xd7df('0x4'),'afterUpdate':_0xd7df('0x5'),'afterDestroy':_0xd7df('0x6')};function emitEvent(_0x38eee7){return function(_0x3ef231,_0x3d8c5a,_0x65a0b6){ChatWebsiteEvents[_0xd7df('0x7')](_0x38eee7+':'+_0x3ef231['id'],_0x3ef231);ChatWebsiteEvents[_0xd7df('0x7')](_0x38eee7,_0x3ef231);_0x65a0b6(null);};}for(var e in events){if(events[_0xd7df('0x8')](e)){var event=events[e];ChatWebsite[_0xd7df('0x9')](e,emitEvent(event));}}module[_0xd7df('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x2263=['events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0xf2f367,_0x188411){var _0x3e918a=function(_0x445c8b){while(--_0x445c8b){_0xf2f367['push'](_0xf2f367['shift']());}};_0x3e918a(++_0x188411);}(_0x2263,0x6e));var _0x3226=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x2263[_0x40ac5e];return _0x2839d6;};'use strict';var EventEmitter=require(_0x3226('0x0'));var ChatWebsite=require(_0x3226('0x1'))['db'][_0x3226('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3226('0x3')](0x0);var events={'afterCreate':_0x3226('0x4'),'afterUpdate':_0x3226('0x5'),'afterDestroy':_0x3226('0x6')};function emitEvent(_0x1541e7){return function(_0x4acb00,_0x242bcf,_0x572291){ChatWebsiteEvents[_0x3226('0x7')](_0x1541e7+':'+_0x4acb00['id'],_0x4acb00);ChatWebsiteEvents[_0x3226('0x7')](_0x1541e7,_0x4acb00);_0x572291(null);};}for(var e in events){if(events[_0x3226('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x3226('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 268477e..68407b9 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 _0x60cf=['../../config/logger','api','moment','bluebird','../../config/environment','./chatWebsite.attributes','define','chat_websites','lodash'];(function(_0x55340d,_0x38f6f0){var _0x387ca5=function(_0x1dc303){while(--_0x1dc303){_0x55340d['push'](_0x55340d['shift']());}};_0x387ca5(++_0x38f6f0);}(_0x60cf,0x155));var _0xf60c=function(_0x421970,_0x181bc5){_0x421970=_0x421970-0x0;var _0x1d885e=_0x60cf[_0x421970];return _0x1d885e;};'use strict';var _=require(_0xf60c('0x0'));var util=require('util');var logger=require(_0xf60c('0x1'))(_0xf60c('0x2'));var moment=require(_0xf60c('0x3'));var BPromise=require(_0xf60c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf60c('0x5'));var attributes=require(_0xf60c('0x6'));module['exports']=function(_0x319506,_0x1a787c){return _0x319506[_0xf60c('0x7')]('ChatWebsite',attributes,{'tableName':_0xf60c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xae94=['path','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x39c9a5,_0xa9a25f){var _0x4ebfda=function(_0x5dd594){while(--_0x5dd594){_0x39c9a5['push'](_0x39c9a5['shift']());}};_0x4ebfda(++_0xa9a25f);}(_0xae94,0x1b4));var _0x4ae9=function(_0x561f49,_0x1ccfd8){_0x561f49=_0x561f49-0x0;var _0x1c8a47=_0xae94[_0x561f49];return _0x1c8a47;};'use strict';var _=require(_0x4ae9('0x0'));var util=require(_0x4ae9('0x1'));var logger=require(_0x4ae9('0x2'))(_0x4ae9('0x3'));var moment=require('moment');var BPromise=require(_0x4ae9('0x4'));var rp=require(_0x4ae9('0x5'));var fs=require('fs');var path=require(_0x4ae9('0x6'));var rimraf=require(_0x4ae9('0x7'));var config=require(_0x4ae9('0x8'));var attributes=require(_0x4ae9('0x9'));module[_0x4ae9('0xa')]=function(_0x5949b2,_0x34e76b){return _0x5949b2['define'](_0x4ae9('0xb'),attributes,{'tableName':_0x4ae9('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 f9bcaea..a1e8451 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 _0x7086=['code','message','ChatWebsite,\x20%s,\x20%s','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','./chatWebsite.socket','register','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x50089b,_0x3ec5e4){var _0x18d520=function(_0x24e21a){while(--_0x24e21a){_0x50089b['push'](_0x50089b['shift']());}};_0x18d520(++_0x3ec5e4);}(_0x7086,0x170));var _0x6708=function(_0x5982cd,_0x13ca4f){_0x5982cd=_0x5982cd-0x0;var _0x1050e0=_0x7086[_0x5982cd];return _0x1050e0;};'use strict';var _=require('lodash');var util=require(_0x6708('0x0'));var moment=require(_0x6708('0x1'));var BPromise=require(_0x6708('0x2'));var rs=require(_0x6708('0x3'));var fs=require('fs');var Redis=require(_0x6708('0x4'));var db=require(_0x6708('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6708('0x6'))(_0x6708('0x7'));var config=require(_0x6708('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6708('0x9')]({'port':0x232a});config['redis']=_[_0x6708('0xa')](config[_0x6708('0xb')],{'host':_0x6708('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6708('0xb')]));require(_0x6708('0xd'))[_0x6708('0xe')](socket);function respondWithRpcPromise(_0x3eaf81,_0x35f1e7,_0x285902){return new BPromise(function(_0x15c9cd,_0x431980){return client['request'](_0x3eaf81,_0x285902)[_0x6708('0xf')](function(_0x5dd370){logger[_0x6708('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x35f1e7,'request\x20sent');logger[_0x6708('0x11')](_0x6708('0x12'),_0x35f1e7,_0x6708('0x13'),JSON[_0x6708('0x14')](_0x5dd370));if(_0x5dd370[_0x6708('0x15')]){if(_0x5dd370['error'][_0x6708('0x16')]===0x1f4){logger[_0x6708('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x35f1e7,_0x5dd370[_0x6708('0x15')][_0x6708('0x17')]);return _0x431980(_0x5dd370['error'][_0x6708('0x17')]);}logger[_0x6708('0x15')](_0x6708('0x18'),_0x35f1e7,_0x5dd370['error'][_0x6708('0x17')]);return _0x15c9cd(_0x5dd370[_0x6708('0x15')][_0x6708('0x17')]);}else{logger[_0x6708('0x10')](_0x6708('0x18'),_0x35f1e7,'request\x20sent');_0x15c9cd(_0x5dd370['result'][_0x6708('0x17')]);}})[_0x6708('0x19')](function(_0x59e60f){logger[_0x6708('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x35f1e7,_0x59e60f);_0x431980(_0x59e60f);});});}
\ No newline at end of file
+var _0xa9a4=['info','request\x20sent','debug','stringify','code','error','message','ChatWebsite,\x20%s,\x20%s','result','catch','lodash','util','moment','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','./chatWebsite.socket','register'];(function(_0x5ed43b,_0x4e3b43){var _0x8007d8=function(_0x1f5160){while(--_0x1f5160){_0x5ed43b['push'](_0x5ed43b['shift']());}};_0x8007d8(++_0x4e3b43);}(_0xa9a4,0x145));var _0x4a9a=function(_0x8ede0d,_0xaa023d){_0x8ede0d=_0x8ede0d-0x0;var _0x31cbaa=_0xa9a4[_0x8ede0d];return _0x31cbaa;};'use strict';var _=require(_0x4a9a('0x0'));var util=require(_0x4a9a('0x1'));var moment=require(_0x4a9a('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(_0x4a9a('0x3'));var logger=require(_0x4a9a('0x4'))('rpc');var config=require(_0x4a9a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4a9a('0x6')]['http']({'port':0x232a});config[_0x4a9a('0x7')]=_['defaults'](config[_0x4a9a('0x7')],{'host':_0x4a9a('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a9a('0x7')]));require(_0x4a9a('0x9'))[_0x4a9a('0xa')](socket);function respondWithRpcPromise(_0x2c0e95,_0x367e19,_0x2d387e){return new BPromise(function(_0x27d8d3,_0x4e9220){return client['request'](_0x2c0e95,_0x2d387e)['then'](function(_0x410557){logger[_0x4a9a('0xb')]('ChatWebsite,\x20%s,\x20%s',_0x367e19,_0x4a9a('0xc'));logger[_0x4a9a('0xd')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x367e19,_0x4a9a('0xc'),JSON[_0x4a9a('0xe')](_0x410557));if(_0x410557['error']){if(_0x410557['error'][_0x4a9a('0xf')]===0x1f4){logger[_0x4a9a('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x367e19,_0x410557[_0x4a9a('0x10')][_0x4a9a('0x11')]);return _0x4e9220(_0x410557[_0x4a9a('0x10')]['message']);}logger[_0x4a9a('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x367e19,_0x410557['error'][_0x4a9a('0x11')]);return _0x27d8d3(_0x410557['error'][_0x4a9a('0x11')]);}else{logger['info'](_0x4a9a('0x12'),_0x367e19,_0x4a9a('0xc'));_0x27d8d3(_0x410557[_0x4a9a('0x13')]['message']);}})[_0x4a9a('0x14')](function(_0x44a418){logger[_0x4a9a('0x10')](_0x4a9a('0x12'),_0x367e19,_0x44a418);_0x4e9220(_0x44a418);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index a7d86d9..23d8475 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 _0x2917=['length','remove','update','emit','removeListener','register'];(function(_0x59eedb,_0xf45d2c){var _0x4cc264=function(_0x255547){while(--_0x255547){_0x59eedb['push'](_0x59eedb['shift']());}};_0x4cc264(++_0xf45d2c);}(_0x2917,0x73));var _0x7291=function(_0x559a80,_0x3d193d){_0x559a80=_0x559a80-0x0;var _0x42f555=_0x2917[_0x559a80];return _0x42f555;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0x7291('0x0'),_0x7291('0x1')];function createListener(_0x187545,_0xb0630e){return function(_0x3544f6){_0xb0630e[_0x7291('0x2')](_0x187545,_0x3544f6);};}function removeListener(_0x460fb8,_0x284346){return function(){ChatWebsiteEvents[_0x7291('0x3')](_0x460fb8,_0x284346);};}exports[_0x7291('0x4')]=function(_0x266927){for(var _0x173b09=0x0,_0x3491d3=events[_0x7291('0x5')];_0x173b09<_0x3491d3;_0x173b09++){var _0x4b6deb=events[_0x173b09];var _0x10f1b2=createListener('chatWebsite:'+_0x4b6deb,_0x266927);ChatWebsiteEvents['on'](_0x4b6deb,_0x10f1b2);}};
\ No newline at end of file
+var _0xe250=['remove','update','removeListener','chatWebsite:','./chatWebsite.events','save'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xe250,0x13c));var _0x0e25=function(_0x1e02da,_0x14633b){_0x1e02da=_0x1e02da-0x0;var _0x5d0d87=_0xe250[_0x1e02da];return _0x5d0d87;};'use strict';var ChatWebsiteEvents=require(_0x0e25('0x0'));var events=[_0x0e25('0x1'),_0x0e25('0x2'),_0x0e25('0x3')];function createListener(_0x5de450,_0x336aa7){return function(_0x195678){_0x336aa7['emit'](_0x5de450,_0x195678);};}function removeListener(_0x432e18,_0x5e3054){return function(){ChatWebsiteEvents[_0x0e25('0x4')](_0x432e18,_0x5e3054);};}exports['register']=function(_0x18c7f5){for(var _0x27d7d2=0x0,_0x2ca53d=events['length'];_0x27d7d2<_0x2ca53d;_0x27d7d2++){var _0x32d3b6=events[_0x27d7d2];var _0x5abfcb=createListener(_0x0e25('0x5')+_0x32d3b6,_0x18c7f5);ChatWebsiteEvents['on'](_0x32d3b6,_0x5abfcb);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 393956b..ca70e5f 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 _0x0df6=['offline-chat','replace','extname','any','offline','/:id/interactions','addProactiveActions','put','delete','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','/:id','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','root','server/files/images/logos/','single','file','addLogo','diskStorage','join','server/files/images/avatars/','%s-%s','now','originalname','format','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','notify','server/files'];(function(_0x8d4a92,_0x3f3d11){var _0x171abf=function(_0x20d3c3){while(--_0x20d3c3){_0x8d4a92['push'](_0x8d4a92['shift']());}};_0x171abf(++_0x3f3d11);}(_0x0df6,0x157));var _0x60df=function(_0x468bc7,_0x1683ce){_0x468bc7=_0x468bc7-0x0;var _0x2cafc9=_0x0df6[_0x468bc7];return _0x2cafc9;};'use strict';var multer=require(_0x60df('0x0'));var util=require('util');var path=require(_0x60df('0x1'));var timeout=require(_0x60df('0x2'));var express=require(_0x60df('0x3'));var router=express['Router']();var fs_extra=require(_0x60df('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x60df('0x5'));var config=require(_0x60df('0x6'));var controller=require(_0x60df('0x7'));router[_0x60df('0x8')]('/',auth[_0x60df('0x9')](),controller['index']);router[_0x60df('0x8')](_0x60df('0xa'),auth[_0x60df('0x9')](),controller['describe']);router[_0x60df('0x8')](_0x60df('0xb'),auth[_0x60df('0x9')](),controller['show']);router[_0x60df('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x60df('0x9')](),controller[_0x60df('0xc')]);router[_0x60df('0x8')](_0x60df('0xd'),controller[_0x60df('0xe')]);router[_0x60df('0x8')](_0x60df('0xf'),controller[_0x60df('0x10')]);router[_0x60df('0x8')](_0x60df('0x11'),controller[_0x60df('0x12')]);router['get']('/:id/system_avatar',controller[_0x60df('0x13')]);router[_0x60df('0x8')]('/:id/interactions',auth[_0x60df('0x9')](),controller[_0x60df('0x14')]);router[_0x60df('0x8')](_0x60df('0x15'),controller[_0x60df('0x16')]);router[_0x60df('0x8')](_0x60df('0x17'),auth[_0x60df('0x9')](),controller[_0x60df('0x18')]);router[_0x60df('0x8')](_0x60df('0x19'),auth[_0x60df('0x9')](),controller['getProactiveActions']);router['get'](_0x60df('0x1a'),controller[_0x60df('0x1b')]);router['get']('/:id/offline_messages',auth[_0x60df('0x9')](),controller[_0x60df('0x1c')]);router['get'](_0x60df('0x1d'),auth[_0x60df('0x9')](),controller[_0x60df('0x1e')]);router[_0x60df('0x1f')]('/',auth[_0x60df('0x9')](),controller[_0x60df('0x20')]);router[_0x60df('0x1f')]('/:id/dispositions',auth[_0x60df('0x9')](),controller[_0x60df('0x21')]);router[_0x60df('0x1f')](_0x60df('0x22'),auth[_0x60df('0x9')](),controller[_0x60df('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x85d6ad,_0xfbc0b9,_0x10ed36){_0x10ed36(null,path['join'](config[_0x60df('0x24')],_0x60df('0x25')));},'filename':function(_0x457a18,_0x1478cd,_0x4fa70d){_0x4fa70d(null,util['format']('%s-%s',Date['now'](),_0x1478cd['originalname']));}})});router['post'](_0x60df('0xd'),upload[_0x60df('0x26')](_0x60df('0x27')),controller[_0x60df('0x28')]);var upload=multer({'storage':multer[_0x60df('0x29')]({'destination':function(_0x385707,_0x3795cf,_0x614aae){_0x614aae(null,path[_0x60df('0x2a')](config['root'],_0x60df('0x2b')));},'filename':function(_0x4c2cfb,_0x27bdd8,_0x51dfbc){_0x51dfbc(null,util['format'](_0x60df('0x2c'),Date[_0x60df('0x2d')](),_0x27bdd8[_0x60df('0x2e')]));}})});router[_0x60df('0x1f')]('/:id/avatar',upload[_0x60df('0x26')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x60df('0x29')]({'destination':function(_0x4a4b65,_0x543936,_0x47fd96){_0x47fd96(null,path[_0x60df('0x2a')](config[_0x60df('0x24')],_0x60df('0x2b')));},'filename':function(_0x531789,_0x5b48c8,_0x507be8){_0x507be8(null,util[_0x60df('0x2f')](_0x60df('0x2c'),Date['now'](),_0x5b48c8[_0x60df('0x2e')]));}})});router[_0x60df('0x1f')](_0x60df('0x11'),upload[_0x60df('0x26')]('file'),controller[_0x60df('0x30')]);var upload=multer({'storage':multer[_0x60df('0x29')]({'destination':function(_0x47aff8,_0x12c5f9,_0x4e2098){_0x4e2098(null,path[_0x60df('0x2a')](config[_0x60df('0x24')],_0x60df('0x2b')));},'filename':function(_0x1d7e4b,_0x400d18,_0x35f6d2){_0x35f6d2(null,util[_0x60df('0x2f')](_0x60df('0x2c'),Date[_0x60df('0x2d')](),_0x400d18['originalname']));}})});router[_0x60df('0x1f')](_0x60df('0x31'),upload[_0x60df('0x26')](_0x60df('0x27')),controller[_0x60df('0x32')]);router[_0x60df('0x1f')]('/:id/notify',controller[_0x60df('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x60df('0x29')]({'destination':function(_0xdbc113,_0x1eefe7,_0x1edca9){const _0x5b2f91=path[_0x60df('0x2a')](config[_0x60df('0x24')],_0x60df('0x34'),'attachments',_0x60df('0x35'));fs_extra['ensureDir'](_0x5b2f91,function(){_0x1edca9(null,_0x5b2f91);});},'filename':function(_0x2648a5,_0x5c44f3,_0x42e33f){const _0x5f0bf0=_0x5c44f3[_0x60df('0x2e')][_0x60df('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4fc377=path[_0x60df('0x37')](_0x5f0bf0);const _0x50e86e=Date['now']()+'-'+_0x5f0bf0[_0x60df('0x36')](_0x4fc377,'')+_0x4fc377;_0x42e33f(null,_0x50e86e);}})});router['post']('/:id/offline',offlineUploadMulter[_0x60df('0x38')](),controller[_0x60df('0x39')]);router[_0x60df('0x1f')](_0x60df('0x3a'),auth[_0x60df('0x9')](),controller['addInteraction']);router[_0x60df('0x1f')](_0x60df('0x17'),auth['isAuthenticated'](),controller['addApplications']);router[_0x60df('0x1f')]('/:id/proactive_actions',auth[_0x60df('0x9')](),controller[_0x60df('0x3b')]);router[_0x60df('0x1f')](_0x60df('0x1d'),auth[_0x60df('0x9')](),controller['addAgents']);router[_0x60df('0x3c')](_0x60df('0xb'),auth[_0x60df('0x9')](),controller['update']);router[_0x60df('0x3d')]('/:id',auth[_0x60df('0x9')](),controller['destroy']);router[_0x60df('0x3d')](_0x60df('0x3e'),auth[_0x60df('0x9')](),controller[_0x60df('0x3f')]);router[_0x60df('0x3d')](_0x60df('0x22'),auth[_0x60df('0x9')](),controller[_0x60df('0x40')]);router[_0x60df('0x3d')](_0x60df('0x1d'),auth['isAuthenticated'](),controller[_0x60df('0x41')]);module['exports']=router;
\ No newline at end of file
+var _0x5180=['addAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','addInteraction','addProactiveActions','/:id/users','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','getOfflineMessages','post','addDisposition','diskStorage','join','root','server/files/images/logos/','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','format','now'];(function(_0x21dea4,_0x414d26){var _0x5e0e33=function(_0x530f8b){while(--_0x530f8b){_0x21dea4['push'](_0x21dea4['shift']());}};_0x5e0e33(++_0x414d26);}(_0x5180,0xe4));var _0x0518=function(_0x344d27,_0x562e14){_0x344d27=_0x344d27-0x0;var _0x53e3ee=_0x5180[_0x344d27];return _0x53e3ee;};'use strict';var multer=require('multer');var util=require(_0x0518('0x0'));var path=require(_0x0518('0x1'));var timeout=require(_0x0518('0x2'));var express=require(_0x0518('0x3'));var router=express[_0x0518('0x4')]();var fs_extra=require(_0x0518('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0518('0x6'));var config=require(_0x0518('0x7'));var controller=require(_0x0518('0x8'));router[_0x0518('0x9')]('/',auth['isAuthenticated'](),controller[_0x0518('0xa')]);router[_0x0518('0x9')](_0x0518('0xb'),auth[_0x0518('0xc')](),controller[_0x0518('0xd')]);router['get'](_0x0518('0xe'),auth[_0x0518('0xc')](),controller[_0x0518('0xf')]);router[_0x0518('0x9')](_0x0518('0x10'),auth[_0x0518('0xc')](),controller['getDispositions']);router[_0x0518('0x9')](_0x0518('0x11'),auth['isAuthenticated'](),controller[_0x0518('0x12')]);router[_0x0518('0x9')](_0x0518('0x13'),controller[_0x0518('0x14')]);router[_0x0518('0x9')](_0x0518('0x15'),controller['getAvatar']);router[_0x0518('0x9')](_0x0518('0x16'),controller[_0x0518('0x17')]);router[_0x0518('0x9')](_0x0518('0x18'),controller[_0x0518('0x19')]);router[_0x0518('0x9')](_0x0518('0x1a'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x0518('0x9')](_0x0518('0x1b'),controller[_0x0518('0x1c')]);router[_0x0518('0x9')](_0x0518('0x1d'),auth['isAuthenticated'](),controller['getApplications']);router[_0x0518('0x9')](_0x0518('0x1e'),auth[_0x0518('0xc')](),controller[_0x0518('0x1f')]);router[_0x0518('0x9')]('/:id/fields',controller['getFields']);router[_0x0518('0x9')](_0x0518('0x20'),auth['isAuthenticated'](),controller[_0x0518('0x21')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x0518('0x22')]('/',auth[_0x0518('0xc')](),controller['create']);router[_0x0518('0x22')](_0x0518('0x10'),auth[_0x0518('0xc')](),controller[_0x0518('0x23')]);router[_0x0518('0x22')](_0x0518('0x11'),auth[_0x0518('0xc')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x0518('0x24')]({'destination':function(_0x5e0b20,_0x296fc5,_0x3124f9){_0x3124f9(null,path[_0x0518('0x25')](config[_0x0518('0x26')],_0x0518('0x27')));},'filename':function(_0x331521,_0x1d4114,_0x4a056a){_0x4a056a(null,util['format'](_0x0518('0x28'),Date['now'](),_0x1d4114[_0x0518('0x29')]));}})});router[_0x0518('0x22')]('/:id/logo',upload[_0x0518('0x2a')](_0x0518('0x2b')),controller[_0x0518('0x2c')]);var upload=multer({'storage':multer[_0x0518('0x24')]({'destination':function(_0x8a99ce,_0x5d01a2,_0x24f495){_0x24f495(null,path[_0x0518('0x25')](config[_0x0518('0x26')],_0x0518('0x2d')));},'filename':function(_0x5ea80a,_0x5169a7,_0x4ea2b1){_0x4ea2b1(null,util[_0x0518('0x2e')]('%s-%s',Date[_0x0518('0x2f')](),_0x5169a7['originalname']));}})});router[_0x0518('0x22')]('/:id/avatar',upload['single'](_0x0518('0x2b')),controller[_0x0518('0x30')]);var upload=multer({'storage':multer[_0x0518('0x24')]({'destination':function(_0x23430b,_0x51b2ac,_0x125ea3){_0x125ea3(null,path[_0x0518('0x25')](config[_0x0518('0x26')],_0x0518('0x2d')));},'filename':function(_0x5a5f40,_0x4579f4,_0x5d1439){_0x5d1439(null,util[_0x0518('0x2e')](_0x0518('0x28'),Date[_0x0518('0x2f')](),_0x4579f4[_0x0518('0x29')]));}})});router[_0x0518('0x22')](_0x0518('0x16'),upload[_0x0518('0x2a')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1ecd64,_0x434837,_0x20d5d3){_0x20d5d3(null,path['join'](config[_0x0518('0x26')],_0x0518('0x2d')));},'filename':function(_0x207d83,_0x311b45,_0x5f043b){_0x5f043b(null,util[_0x0518('0x2e')](_0x0518('0x28'),Date[_0x0518('0x2f')](),_0x311b45[_0x0518('0x29')]));}})});router[_0x0518('0x22')](_0x0518('0x18'),upload[_0x0518('0x2a')]('file'),controller[_0x0518('0x31')]);router[_0x0518('0x22')](_0x0518('0x32'),controller[_0x0518('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x2d5c15,_0x3c689f,_0x459fb7){const _0x4a91a3=path[_0x0518('0x25')](config['root'],_0x0518('0x34'),_0x0518('0x35'),_0x0518('0x36'));fs_extra[_0x0518('0x37')](_0x4a91a3,function(){_0x459fb7(null,_0x4a91a3);});},'filename':function(_0x14b971,_0x2759a9,_0x5cab19){const _0x20f541=_0x2759a9['originalname'][_0x0518('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3392a8=path['extname'](_0x20f541);const _0x57dcd0=Date[_0x0518('0x2f')]()+'-'+_0x20f541[_0x0518('0x38')](_0x3392a8,'')+_0x3392a8;_0x5cab19(null,_0x57dcd0);}})});router[_0x0518('0x22')](_0x0518('0x39'),offlineUploadMulter[_0x0518('0x3a')](),controller['offline']);router[_0x0518('0x22')](_0x0518('0x1a'),auth[_0x0518('0xc')](),controller[_0x0518('0x3b')]);router['post'](_0x0518('0x1d'),auth['isAuthenticated'](),controller['addApplications']);router[_0x0518('0x22')](_0x0518('0x1e'),auth[_0x0518('0xc')](),controller[_0x0518('0x3c')]);router['post'](_0x0518('0x3d'),auth[_0x0518('0xc')](),controller['addAgents']);router[_0x0518('0x3e')](_0x0518('0xe'),auth[_0x0518('0xc')](),controller['update']);router[_0x0518('0x3f')](_0x0518('0xe'),auth[_0x0518('0xc')](),controller[_0x0518('0x40')]);router[_0x0518('0x3f')](_0x0518('0x10'),auth[_0x0518('0xc')](),controller[_0x0518('0x41')]);router[_0x0518('0x3f')]('/:id/canned_answers',auth[_0x0518('0xc')](),controller[_0x0518('0x42')]);router['delete'](_0x0518('0x3d'),auth[_0x0518('0xc')](),controller[_0x0518('0x43')]);module[_0x0518('0x44')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 87eaec5..6a303c0 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd198=['app','get','Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','beaver-logger/server','express','../components/auth/service','env','production'];(function(_0x293cfe,_0x42ee33){var _0x592a19=function(_0x3f05e8){while(--_0x3f05e8){_0x293cfe['push'](_0x293cfe['shift']());}};_0x592a19(++_0x42ee33);}(_0xd198,0x1b3));var _0x8d19=function(_0xdedef0,_0x16668c){_0xdedef0=_0xdedef0-0x0;var _0x248498=_0xd198[_0xdedef0];return _0x248498;};var beaverLogger=require(_0x8d19('0x0'));var express=require(_0x8d19('0x1'));var auth=require(_0x8d19('0x2'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x8d19('0x3')]===_0x8d19('0x4')||![];function clientSideLogs(_0x55fda8,_0x2f5263,_0x386bda){var _0x3240ac=_0x55fda8[_0x8d19('0x5')][_0x8d19('0x6')]('client-side-logger');if(!_0x3240ac){throw new Error(_0x8d19('0x7'));}return beaverLogger['expressEndpoint']({'uri':_0x8d19('0x8'),'logger':_0x3240ac,'enableCors':!isProduction})(_0x55fda8,_0x2f5263,_0x386bda);}router[_0x8d19('0x9')](auth[_0x8d19('0xa')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x67d2=['isAuthenticated','exports','express','../components/auth/service','../config/environment','Router','env','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use'];(function(_0x80d5e8,_0x3be93c){var _0x3e8164=function(_0x138cf2){while(--_0x138cf2){_0x80d5e8['push'](_0x80d5e8['shift']());}};_0x3e8164(++_0x3be93c);}(_0x67d2,0xc2));var _0x267d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x67d2[_0x432682];return _0x463d05;};var beaverLogger=require('beaver-logger/server');var express=require(_0x267d('0x0'));var auth=require(_0x267d('0x1'));var config=require(_0x267d('0x2'));var router=express[_0x267d('0x3')]();var isProduction=config[_0x267d('0x4')]==='production'||![];function clientSideLogs(_0x252104,_0x3904f5,_0x48f201){var _0x34deca=_0x252104['app']['get'](_0x267d('0x5'));if(!_0x34deca){throw new Error(_0x267d('0x6'));}return beaverLogger[_0x267d('0x7')]({'uri':_0x267d('0x8'),'logger':_0x34deca,'enableCors':!isProduction})(_0x252104,_0x3904f5,_0x48f201);}router[_0x267d('0x9')](auth[_0x267d('0xa')](),clientSideLogs);module[_0x267d('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 89a082d..5d79c7d 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 _0xd14a=['Google','Dynamics365','MicrosoftAzure\x20=>\x20tenant','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x5c59ee,_0x38230f){var _0x22af1f=function(_0x3d0ec9){while(--_0x3d0ec9){_0x5c59ee['push'](_0x5c59ee['shift']());}};_0x22af1f(++_0x38230f);}(_0xd14a,0x10e));var _0xad14=function(_0x26b3f6,_0x5bcc21){_0x26b3f6=_0x26b3f6-0x0;var _0x2ebb0b=_0xd14a[_0x26b3f6];return _0x2ebb0b;};'use strict';var Sequelize=require(_0xad14('0x0'));module[_0xad14('0x1')]={'name':{'type':Sequelize[_0xad14('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xad14('0x3')](_0xad14('0x4'),_0xad14('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0xad14('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':_0xad14('0x7')},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xad14('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xad14('0x8')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xad14('0x8')],'comment':_0xad14('0x9')},'data7':{'type':Sequelize[_0xad14('0x8')],'comment':_0xad14('0xa')}};
\ No newline at end of file
+var _0xa9c8=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365'];(function(_0x1cd746,_0x4be7ad){var _0x333b65=function(_0x232401){while(--_0x232401){_0x1cd746['push'](_0x1cd746['shift']());}};_0x333b65(++_0x4be7ad);}(_0xa9c8,0x108));var _0x8a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8a9c('0x0'));module[_0x8a9c('0x1')]={'name':{'type':Sequelize[_0x8a9c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x8a9c('0x3'),_0x8a9c('0x4'),_0x8a9c('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x8a9c('0x6')](_0x8a9c('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0x8a9c('0x2')],'comment':_0x8a9c('0x8')},'data2':{'type':Sequelize[_0x8a9c('0x2')],'comment':_0x8a9c('0x9')},'data3':{'type':Sequelize['STRING'],'comment':_0x8a9c('0xa')},'data4':{'type':Sequelize['STRING'],'comment':_0x8a9c('0xb')},'data5':{'type':Sequelize[_0x8a9c('0xc')],'comment':_0x8a9c('0xd')},'data6':{'type':Sequelize[_0x8a9c('0xc')],'comment':_0x8a9c('0xe')},'data7':{'type':Sequelize[_0x8a9c('0xc')],'comment':_0x8a9c('0xf')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index ae06f8c..a13e092 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 _0xd25d=['undefined','limit','count','Content-Range','update','then','destroy','error','stack','name','send','padEnd','slice','index','CloudProvider','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','params','keys','catch','create','body','Name\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','parse','from','base64','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','state','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','sendStatus','status','json','offset'];(function(_0x42bec8,_0x2695ff){var _0x6c51c0=function(_0x2ad6be){while(--_0x2ad6be){_0x42bec8['push'](_0x42bec8['shift']());}};_0x6c51c0(++_0x2695ff);}(_0xd25d,0xb0));var _0xdd25=function(_0x31855d,_0xb4743c){_0x31855d=_0x31855d-0x0;var _0xb69808=_0xd25d[_0x31855d];return _0xb69808;};'use strict';var _=require(_0xdd25('0x0'));var Redis=require(_0xdd25('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xdd25('0x2'));var config=require(_0xdd25('0x3'));var logger=require(_0xdd25('0x4'))(_0xdd25('0x5'));var db=require(_0xdd25('0x6'))['db'];var oauth=require('./cloudProvider.oauth');config[_0xdd25('0x7')]=_[_0xdd25('0x8')](config['redis'],{'host':_0xdd25('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdd25('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x1b1a5e,_0x40a614){_0x40a614=_0x40a614||0xcc;return function(_0x3bc2b9){if(_0x3bc2b9){return _0x1b1a5e[_0xdd25('0xa')](_0x40a614);}return _0x1b1a5e[_0xdd25('0xb')](_0x40a614)['end']();};}function respondWithResult(_0x32c507,_0x22116e){_0x22116e=_0x22116e||0xc8;return function(_0x45b6f2){if(_0x45b6f2){return _0x32c507['status'](_0x22116e)[_0xdd25('0xc')](_0x45b6f2);}};}function respondWithFilteredResult(_0x6057b0,_0xe42a65){return function(_0x5e21d8){if(_0x5e21d8){var _0x3db24b=typeof _0xe42a65[_0xdd25('0xd')]===_0xdd25('0xe')&&typeof _0xe42a65[_0xdd25('0xf')]===_0xdd25('0xe');var _0x4e11ba=_0x5e21d8[_0xdd25('0x10')];var _0x5ea3a7=_0x3db24b?0x0:_0xe42a65['offset'];var _0x5cd00=_0x3db24b?_0x5e21d8['count']:_0xe42a65[_0xdd25('0xd')]+_0xe42a65[_0xdd25('0xf')];var _0x444994;if(_0x5cd00>=_0x4e11ba){_0x5cd00=_0x4e11ba;_0x444994=0xc8;}else{_0x444994=0xce;}_0x6057b0[_0xdd25('0xb')](_0x444994);return _0x6057b0['set'](_0xdd25('0x11'),_0x5ea3a7+'-'+_0x5cd00+'/'+_0x4e11ba)[_0xdd25('0xc')](_0x5e21d8);}return null;};}function saveUpdates(_0x150f81){return function(_0x4de37d){if(_0x4de37d){return _0x4de37d[_0xdd25('0x12')](_0x150f81)[_0xdd25('0x13')](function(_0x26aadc){return _0x26aadc;});}return null;};}function removeEntity(_0x3e37d9){return function(_0x5861eb){if(_0x5861eb){return _0x5861eb[_0xdd25('0x14')]()['then'](function(){_0x3e37d9[_0xdd25('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5edfea){return function(_0x4ceefa){if(!_0x4ceefa){_0x5edfea[_0xdd25('0xa')](0x194);}return _0x4ceefa;};}function handleError(_0x36875a,_0x534599){_0x534599=_0x534599||0x1f4;return function(_0x174a58){logger[_0xdd25('0x15')](_0x174a58[_0xdd25('0x16')]);if(_0x174a58[_0xdd25('0x17')]){delete _0x174a58[_0xdd25('0x17')];}_0x36875a[_0xdd25('0xb')](_0x534599)[_0xdd25('0x18')](_0x174a58);};}function maskClientSecret(_0x1e2ec6){return _[_0xdd25('0x19')](_0x1e2ec6[_0xdd25('0x1a')](0x0,0x3),0x14,'*');}exports[_0xdd25('0x1b')]=function(_0x3f85e2,_0x46ce61){var _0x4cddc4={},_0x4661e2={},_0x35b8e5={'count':0x0,'rows':[]};var _0x532e77=_['map'](db[_0xdd25('0x1c')][_0xdd25('0x1d')],function(_0x327d9d){return{'name':_0x327d9d['fieldName'],'type':_0x327d9d[_0xdd25('0x1e')][_0xdd25('0x1f')]};});_0x4661e2['model']=_['map'](_0x532e77,_0xdd25('0x17'));_0x4661e2[_0xdd25('0x20')]=_['keys'](_0x3f85e2[_0xdd25('0x20')]);_0x4661e2[_0xdd25('0x21')]=_[_0xdd25('0x22')](_0x4661e2[_0xdd25('0x23')],_0x4661e2[_0xdd25('0x20')]);_0x4cddc4['attributes']=_[_0xdd25('0x22')](_0x4661e2[_0xdd25('0x23')],qs[_0xdd25('0x24')](_0x3f85e2['query']['fields']));_0x4cddc4[_0xdd25('0x25')]=_0x4cddc4[_0xdd25('0x25')][_0xdd25('0x26')]?_0x4cddc4[_0xdd25('0x25')]:_0x4661e2[_0xdd25('0x23')];if(!_0x3f85e2[_0xdd25('0x20')][_0xdd25('0x27')]('nolimit')){_0x4cddc4[_0xdd25('0xf')]=qs[_0xdd25('0xf')](_0x3f85e2[_0xdd25('0x20')][_0xdd25('0xf')]);_0x4cddc4[_0xdd25('0xd')]=qs[_0xdd25('0xd')](_0x3f85e2[_0xdd25('0x20')][_0xdd25('0xd')]);}_0x4cddc4[_0xdd25('0x28')]=qs[_0xdd25('0x29')](_0x3f85e2[_0xdd25('0x20')]['sort']);_0x4cddc4[_0xdd25('0x2a')]=qs[_0xdd25('0x21')](_[_0xdd25('0x2b')](_0x3f85e2[_0xdd25('0x20')],_0x4661e2[_0xdd25('0x21')]),_0x532e77);if(_0x3f85e2[_0xdd25('0x20')][_0xdd25('0x2c')]){_0x4cddc4[_0xdd25('0x2a')]=_[_0xdd25('0x2d')](_0x4cddc4[_0xdd25('0x2a')],{'$or':_[_0xdd25('0x2e')](_0x532e77,function(_0x1e1821){if(_0x1e1821[_0xdd25('0x1e')]!=='VIRTUAL'){var _0x5e922c={};_0x5e922c[_0x1e1821[_0xdd25('0x17')]]={'$like':'%'+_0x3f85e2[_0xdd25('0x20')]['filter']+'%'};return _0x5e922c;}})});}_0x4cddc4=_[_0xdd25('0x2d')]({},_0x4cddc4,_0x3f85e2[_0xdd25('0x2f')]);var _0x429526={'where':_0x4cddc4[_0xdd25('0x2a')]};return db['CloudProvider']['count'](_0x429526)[_0xdd25('0x13')](function(_0xb7f2ae){_0x35b8e5[_0xdd25('0x10')]=_0xb7f2ae;if(_0x3f85e2[_0xdd25('0x20')][_0xdd25('0x30')]){_0x4cddc4[_0xdd25('0x31')]=[{'all':!![]}];}return db[_0xdd25('0x1c')][_0xdd25('0x32')](_0x4cddc4);})['then'](function(_0x479408){_0x35b8e5[_0xdd25('0x33')]=_[_0xdd25('0x2e')](_0x479408,function(_0x40dc8f){if(_0x40dc8f[_0xdd25('0x34')]===_0xdd25('0x35')){var _0x1afbdd=encryptor[_0xdd25('0x36')](_0x40dc8f[_0xdd25('0x37')]);_0x40dc8f[_0xdd25('0x37')]=maskClientSecret(_0x1afbdd);}return _0x40dc8f;});return _0x35b8e5;})['then'](respondWithFilteredResult(_0x46ce61,_0x4cddc4))['catch'](handleError(_0x46ce61,null));};exports['show']=function(_0xfee405,_0x112291){var _0x499a84={'raw':!![],'where':{'id':_0xfee405[_0xdd25('0x38')]['id']}},_0x360e25={};_0x360e25[_0xdd25('0x23')]=_[_0xdd25('0x39')](db[_0xdd25('0x1c')][_0xdd25('0x1d')]);_0x360e25[_0xdd25('0x20')]=_[_0xdd25('0x39')](_0xfee405['query']);_0x360e25[_0xdd25('0x21')]=_[_0xdd25('0x22')](_0x360e25[_0xdd25('0x23')],_0x360e25[_0xdd25('0x20')]);_0x499a84[_0xdd25('0x25')]=_[_0xdd25('0x22')](_0x360e25[_0xdd25('0x23')],qs['fields'](_0xfee405[_0xdd25('0x20')][_0xdd25('0x24')]));_0x499a84[_0xdd25('0x25')]=_0x499a84[_0xdd25('0x25')]['length']?_0x499a84[_0xdd25('0x25')]:_0x360e25['model'];if(_0xfee405[_0xdd25('0x20')][_0xdd25('0x30')]){_0x499a84['include']=[{'all':!![]}];}_0x499a84=_[_0xdd25('0x2d')]({},_0x499a84,_0xfee405['options']);return db['CloudProvider']['find'](_0x499a84)[_0xdd25('0x13')](handleEntityNotFound(_0x112291,null))[_0xdd25('0x13')](function(_0x162e4f){if(_0x162e4f[_0xdd25('0x34')]==='MicrosoftAzure'){var _0x1596a4=encryptor[_0xdd25('0x36')](_0x162e4f[_0xdd25('0x37')]);_0x162e4f[_0xdd25('0x37')]=maskClientSecret(_0x1596a4);}return _0x162e4f;})[_0xdd25('0x13')](respondWithResult(_0x112291,null))[_0xdd25('0x3a')](handleError(_0x112291,null));};exports[_0xdd25('0x3b')]=function(_0xd6acac,_0x3b915a){if(!_0xd6acac[_0xdd25('0x3c')][_0xdd25('0x17')])throw new Error(_0xdd25('0x3d'));if(!_0xd6acac[_0xdd25('0x3c')][_0xdd25('0x34')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x19ceca=db[_0xdd25('0x1c')][_0xdd25('0x1d')][_0xdd25('0x34')]['values'];if(!_0x19ceca[_0xdd25('0x3e')](_0xd6acac['body']['service']))throw new Error(_0xdd25('0x3f')+_0x19ceca[_0xdd25('0x40')](',\x20'));if(_0xd6acac[_0xdd25('0x3c')][_0xdd25('0x34')]===_0xdd25('0x35')&&_0xd6acac[_0xdd25('0x3c')][_0xdd25('0x37')]){_0xd6acac['body'][_0xdd25('0x37')]=encryptor[_0xdd25('0x41')](_0xd6acac[_0xdd25('0x3c')][_0xdd25('0x37')]);}return db[_0xdd25('0x1c')][_0xdd25('0x3b')](_0xd6acac[_0xdd25('0x3c')],{})[_0xdd25('0x13')](respondWithResult(_0x3b915a,0xc9))[_0xdd25('0x3a')](handleError(_0x3b915a,null));};exports['update']=function(_0x1f1d2e,_0x410163){if(_0x1f1d2e[_0xdd25('0x3c')]['id']){delete _0x1f1d2e[_0xdd25('0x3c')]['id'];}return db[_0xdd25('0x1c')][_0xdd25('0x42')]({'where':{'id':_0x1f1d2e[_0xdd25('0x38')]['id']}})[_0xdd25('0x13')](handleEntityNotFound(_0x410163,null))['then'](function(_0x27551c){if(_0x27551c['service']==='MicrosoftAzure'&&_0x1f1d2e['body'][_0xdd25('0x37')]){_0x1f1d2e[_0xdd25('0x3c')][_0xdd25('0x37')]=encryptor[_0xdd25('0x41')](_0x1f1d2e[_0xdd25('0x3c')][_0xdd25('0x37')]);}return _0x27551c;})['then'](saveUpdates(_0x1f1d2e[_0xdd25('0x3c')],null))[_0xdd25('0x13')](respondWithResult(_0x410163,null))[_0xdd25('0x3a')](handleError(_0x410163,null));};exports[_0xdd25('0x14')]=function(_0x4246f8,_0x1a102c){return db[_0xdd25('0x1c')][_0xdd25('0x42')]({'where':{'id':_0x4246f8[_0xdd25('0x38')]['id']}})['then'](handleEntityNotFound(_0x1a102c,null))[_0xdd25('0x13')](removeEntity(_0x1a102c,null))['catch'](handleError(_0x1a102c,null));};exports['oauth2MicrosoftAuthorize']=function(_0x1852ff,_0x388781){return db['CloudProvider'][_0xdd25('0x43')]({'where':{'id':_0x1852ff[_0xdd25('0x38')]['id']},'raw':!![]})['then'](function(_0x44e950){if(!_0x44e950)return _0x388781[_0xdd25('0xa')](0x194);return{'url':oauth[_0xdd25('0x44')](_0x44e950,_0x1852ff[_0xdd25('0x45')]['id'])};})[_0xdd25('0x13')](respondWithResult(_0x388781,null))['catch'](handleError(_0x388781,null));};exports[_0xdd25('0x46')]=function(_0x5569ac,_0x19a49){var _0x3a8818=_0x5569ac[_0xdd25('0x3c')];var _0x17de3b;var _0x2aca52;if(_0x3a8818[_0xdd25('0x15')])throw _0x3a8818;redis[_0xdd25('0x47')](_0x3a8818['state'])[_0xdd25('0x13')](function(_0x3240da){if(!_0x3240da)throw new Error('Invalid\x20state\x20parameter');_0x17de3b=JSON[_0xdd25('0x48')](_0x3240da);var _0x1315bf=Buffer[_0xdd25('0x49')](_0x3a8818['state'],_0xdd25('0x4a'))['toString'](_0xdd25('0x4b'));_0x2aca52=JSON[_0xdd25('0x48')](_0x1315bf);if(!oauth[_0xdd25('0x4c')](_0x3a8818[_0xdd25('0x4d')],_0x17de3b[_0xdd25('0x4e')]))throw new Error(_0xdd25('0x4f'));redis[_0xdd25('0x50')](_0x3a8818[_0xdd25('0x51')]);return oauth[_0xdd25('0x52')](_0x3a8818[_0xdd25('0x53')],_0x17de3b);})[_0xdd25('0x13')](function(_0x37e0e3){_0x17de3b[_0xdd25('0x54')]=_0x37e0e3[_0xdd25('0x55')];_0x17de3b['data6']=_0x37e0e3[_0xdd25('0x56')];return db[_0xdd25('0x1c')]['update']({'data5':_0x17de3b[_0xdd25('0x54')],'data6':_0x17de3b['data6']},{'where':{'id':_0x17de3b['id']}});})[_0xdd25('0x13')](function(){oauth[_0xdd25('0x57')](_0x17de3b);socket['emit'](_0xdd25('0x58'),{'id':_0x2aca52['id']});return;})[_0xdd25('0x13')](respondWithStatusCode(_0x19a49,null))['catch'](function(_0x3ba01e){if(_0x2aca52){socket[_0xdd25('0x59')](_0xdd25('0x5a'),{'id':_0x2aca52['id']});}if(!_0x17de3b){logger[_0xdd25('0x15')](_0xdd25('0x5b'),_0x3ba01e);return _0x19a49['status'](0x1f4)['send'](_0x3ba01e[_0xdd25('0x5c')]);}logger[_0xdd25('0x15')](_0xdd25('0x5d'),_0x17de3b['id'],JSON[_0xdd25('0x5e')](_0x3ba01e));});};
\ No newline at end of file
+var _0xb258=['offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','stack','send','slice','index','CloudProvider','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','service','decryptString','data3','catch','show','params','rawAttributes','include','create','body','Name\x20parameter\x20not\x20specified','join','MicrosoftAzure','encryptString','find','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json'];(function(_0x561f16,_0x3b9227){var _0x887390=function(_0x3b14de){while(--_0x3b14de){_0x561f16['push'](_0x561f16['shift']());}};_0x887390(++_0x3b9227);}(_0xb258,0x176));var _0x8b25=function(_0x1d36cd,_0x20ea11){_0x1d36cd=_0x1d36cd-0x0;var _0x35c2e2=_0xb258[_0x1d36cd];return _0x35c2e2;};'use strict';var _=require(_0x8b25('0x0'));var Redis=require(_0x8b25('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x8b25('0x2'));var config=require('../../config/environment');var logger=require(_0x8b25('0x3'))(_0x8b25('0x4'));var db=require(_0x8b25('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x8b25('0x6')]=_[_0x8b25('0x7')](config[_0x8b25('0x6')],{'host':_0x8b25('0x8'),'port':0x18eb});var socket=require(_0x8b25('0x9'))(new Redis(config[_0x8b25('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x136513,_0x3f7087){_0x3f7087=_0x3f7087||0xcc;return function(_0xada10b){if(_0xada10b){return _0x136513[_0x8b25('0xa')](_0x3f7087);}return _0x136513[_0x8b25('0xb')](_0x3f7087)[_0x8b25('0xc')]();};}function respondWithResult(_0x263912,_0x29ade1){_0x29ade1=_0x29ade1||0xc8;return function(_0x30706c){if(_0x30706c){return _0x263912[_0x8b25('0xb')](_0x29ade1)[_0x8b25('0xd')](_0x30706c);}};}function respondWithFilteredResult(_0x57a286,_0x100a5a){return function(_0x266902){if(_0x266902){var _0x108150=typeof _0x100a5a[_0x8b25('0xe')]===_0x8b25('0xf')&&typeof _0x100a5a['limit']===_0x8b25('0xf');var _0x37224c=_0x266902[_0x8b25('0x10')];var _0x1106b0=_0x108150?0x0:_0x100a5a[_0x8b25('0xe')];var _0x3c9fee=_0x108150?_0x266902[_0x8b25('0x10')]:_0x100a5a[_0x8b25('0xe')]+_0x100a5a[_0x8b25('0x11')];var _0x39ca7b;if(_0x3c9fee>=_0x37224c){_0x3c9fee=_0x37224c;_0x39ca7b=0xc8;}else{_0x39ca7b=0xce;}_0x57a286[_0x8b25('0xb')](_0x39ca7b);return _0x57a286[_0x8b25('0x12')](_0x8b25('0x13'),_0x1106b0+'-'+_0x3c9fee+'/'+_0x37224c)['json'](_0x266902);}return null;};}function saveUpdates(_0x28f7b3){return function(_0x55b3ed){if(_0x55b3ed){return _0x55b3ed[_0x8b25('0x14')](_0x28f7b3)[_0x8b25('0x15')](function(_0x1046f6){return _0x1046f6;});}return null;};}function removeEntity(_0x100d9c){return function(_0x3506f0){if(_0x3506f0){return _0x3506f0[_0x8b25('0x16')]()[_0x8b25('0x15')](function(){_0x100d9c[_0x8b25('0xb')](0xcc)[_0x8b25('0xc')]();});}};}function handleEntityNotFound(_0x228d97){return function(_0xa7812f){if(!_0xa7812f){_0x228d97['sendStatus'](0x194);}return _0xa7812f;};}function handleError(_0x336bc5,_0x405c56){_0x405c56=_0x405c56||0x1f4;return function(_0x272a35){logger[_0x8b25('0x17')](_0x272a35[_0x8b25('0x18')]);if(_0x272a35['name']){delete _0x272a35['name'];}_0x336bc5[_0x8b25('0xb')](_0x405c56)[_0x8b25('0x19')](_0x272a35);};}function maskClientSecret(_0x419679){return _['padEnd'](_0x419679[_0x8b25('0x1a')](0x0,0x3),0x14,'*');}exports[_0x8b25('0x1b')]=function(_0x54dafb,_0x13a0a5){var _0x467bab={},_0x5141db={},_0x14c28d={'count':0x0,'rows':[]};var _0x2abc7c=_['map'](db[_0x8b25('0x1c')]['rawAttributes'],function(_0x22193e){return{'name':_0x22193e[_0x8b25('0x1d')],'type':_0x22193e[_0x8b25('0x1e')][_0x8b25('0x1f')]};});_0x5141db[_0x8b25('0x20')]=_[_0x8b25('0x21')](_0x2abc7c,'name');_0x5141db[_0x8b25('0x22')]=_[_0x8b25('0x23')](_0x54dafb['query']);_0x5141db['filters']=_[_0x8b25('0x24')](_0x5141db['model'],_0x5141db[_0x8b25('0x22')]);_0x467bab[_0x8b25('0x25')]=_[_0x8b25('0x24')](_0x5141db[_0x8b25('0x20')],qs[_0x8b25('0x26')](_0x54dafb[_0x8b25('0x22')][_0x8b25('0x26')]));_0x467bab[_0x8b25('0x25')]=_0x467bab[_0x8b25('0x25')][_0x8b25('0x27')]?_0x467bab['attributes']:_0x5141db[_0x8b25('0x20')];if(!_0x54dafb['query'][_0x8b25('0x28')](_0x8b25('0x29'))){_0x467bab[_0x8b25('0x11')]=qs[_0x8b25('0x11')](_0x54dafb['query']['limit']);_0x467bab[_0x8b25('0xe')]=qs[_0x8b25('0xe')](_0x54dafb[_0x8b25('0x22')][_0x8b25('0xe')]);}_0x467bab['order']=qs['sort'](_0x54dafb[_0x8b25('0x22')]['sort']);_0x467bab[_0x8b25('0x2a')]=qs[_0x8b25('0x2b')](_[_0x8b25('0x2c')](_0x54dafb['query'],_0x5141db[_0x8b25('0x2b')]),_0x2abc7c);if(_0x54dafb['query'][_0x8b25('0x2d')]){_0x467bab[_0x8b25('0x2a')]=_[_0x8b25('0x2e')](_0x467bab['where'],{'$or':_[_0x8b25('0x21')](_0x2abc7c,function(_0x5a1fb1){if(_0x5a1fb1[_0x8b25('0x1e')]!==_0x8b25('0x2f')){var _0x2fde3e={};_0x2fde3e[_0x5a1fb1['name']]={'$like':'%'+_0x54dafb[_0x8b25('0x22')][_0x8b25('0x2d')]+'%'};return _0x2fde3e;}})});}_0x467bab=_['merge']({},_0x467bab,_0x54dafb[_0x8b25('0x30')]);var _0x4ea533={'where':_0x467bab[_0x8b25('0x2a')]};return db[_0x8b25('0x1c')][_0x8b25('0x10')](_0x4ea533)['then'](function(_0x20e62e){_0x14c28d[_0x8b25('0x10')]=_0x20e62e;if(_0x54dafb['query'][_0x8b25('0x31')]){_0x467bab['include']=[{'all':!![]}];}return db[_0x8b25('0x1c')][_0x8b25('0x32')](_0x467bab);})[_0x8b25('0x15')](function(_0x8b33f4){_0x14c28d[_0x8b25('0x33')]=_[_0x8b25('0x21')](_0x8b33f4,function(_0x4630aa){if(_0x4630aa[_0x8b25('0x34')]==='MicrosoftAzure'){var _0x213a88=encryptor[_0x8b25('0x35')](_0x4630aa['data3']);_0x4630aa[_0x8b25('0x36')]=maskClientSecret(_0x213a88);}return _0x4630aa;});return _0x14c28d;})['then'](respondWithFilteredResult(_0x13a0a5,_0x467bab))[_0x8b25('0x37')](handleError(_0x13a0a5,null));};exports[_0x8b25('0x38')]=function(_0x5e1e0e,_0x537729){var _0x1b564d={'raw':!![],'where':{'id':_0x5e1e0e[_0x8b25('0x39')]['id']}},_0x82978c={};_0x82978c[_0x8b25('0x20')]=_['keys'](db[_0x8b25('0x1c')][_0x8b25('0x3a')]);_0x82978c['query']=_['keys'](_0x5e1e0e['query']);_0x82978c[_0x8b25('0x2b')]=_[_0x8b25('0x24')](_0x82978c['model'],_0x82978c[_0x8b25('0x22')]);_0x1b564d[_0x8b25('0x25')]=_[_0x8b25('0x24')](_0x82978c[_0x8b25('0x20')],qs[_0x8b25('0x26')](_0x5e1e0e[_0x8b25('0x22')]['fields']));_0x1b564d[_0x8b25('0x25')]=_0x1b564d['attributes'][_0x8b25('0x27')]?_0x1b564d['attributes']:_0x82978c[_0x8b25('0x20')];if(_0x5e1e0e[_0x8b25('0x22')][_0x8b25('0x31')]){_0x1b564d[_0x8b25('0x3b')]=[{'all':!![]}];}_0x1b564d=_[_0x8b25('0x2e')]({},_0x1b564d,_0x5e1e0e['options']);return db['CloudProvider']['find'](_0x1b564d)['then'](handleEntityNotFound(_0x537729,null))[_0x8b25('0x15')](function(_0x4f160b){if(_0x4f160b[_0x8b25('0x34')]==='MicrosoftAzure'){var _0x6170dc=encryptor[_0x8b25('0x35')](_0x4f160b[_0x8b25('0x36')]);_0x4f160b[_0x8b25('0x36')]=maskClientSecret(_0x6170dc);}return _0x4f160b;})[_0x8b25('0x15')](respondWithResult(_0x537729,null))[_0x8b25('0x37')](handleError(_0x537729,null));};exports[_0x8b25('0x3c')]=function(_0x6e33da,_0x1c4043){if(!_0x6e33da[_0x8b25('0x3d')]['name'])throw new Error(_0x8b25('0x3e'));if(!_0x6e33da['body']['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x6910fb=db['CloudProvider'][_0x8b25('0x3a')][_0x8b25('0x34')]['values'];if(!_0x6910fb['includes'](_0x6e33da[_0x8b25('0x3d')][_0x8b25('0x34')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x6910fb[_0x8b25('0x3f')](',\x20'));if(_0x6e33da[_0x8b25('0x3d')]['service']===_0x8b25('0x40')&&_0x6e33da[_0x8b25('0x3d')][_0x8b25('0x36')]){_0x6e33da[_0x8b25('0x3d')][_0x8b25('0x36')]=encryptor[_0x8b25('0x41')](_0x6e33da[_0x8b25('0x3d')][_0x8b25('0x36')]);}return db[_0x8b25('0x1c')][_0x8b25('0x3c')](_0x6e33da[_0x8b25('0x3d')],{})[_0x8b25('0x15')](respondWithResult(_0x1c4043,0xc9))[_0x8b25('0x37')](handleError(_0x1c4043,null));};exports['update']=function(_0x57eb58,_0x281741){if(_0x57eb58[_0x8b25('0x3d')]['id']){delete _0x57eb58[_0x8b25('0x3d')]['id'];}return db['CloudProvider'][_0x8b25('0x42')]({'where':{'id':_0x57eb58['params']['id']}})['then'](handleEntityNotFound(_0x281741,null))[_0x8b25('0x15')](function(_0x3152bd){if(_0x3152bd[_0x8b25('0x34')]===_0x8b25('0x40')&&_0x57eb58[_0x8b25('0x3d')]['data3']){_0x57eb58[_0x8b25('0x3d')][_0x8b25('0x36')]=encryptor[_0x8b25('0x41')](_0x57eb58[_0x8b25('0x3d')][_0x8b25('0x36')]);}return _0x3152bd;})[_0x8b25('0x15')](saveUpdates(_0x57eb58[_0x8b25('0x3d')],null))['then'](respondWithResult(_0x281741,null))[_0x8b25('0x37')](handleError(_0x281741,null));};exports[_0x8b25('0x16')]=function(_0x3f9870,_0x4b9495){return db[_0x8b25('0x1c')][_0x8b25('0x42')]({'where':{'id':_0x3f9870[_0x8b25('0x39')]['id']}})[_0x8b25('0x15')](handleEntityNotFound(_0x4b9495,null))[_0x8b25('0x15')](removeEntity(_0x4b9495,null))[_0x8b25('0x37')](handleError(_0x4b9495,null));};exports[_0x8b25('0x43')]=function(_0x56768d,_0x3e1b89){return db[_0x8b25('0x1c')][_0x8b25('0x44')]({'where':{'id':_0x56768d[_0x8b25('0x39')]['id']},'raw':!![]})[_0x8b25('0x15')](function(_0x54b4dc){if(!_0x54b4dc)return _0x3e1b89['sendStatus'](0x194);return{'url':oauth[_0x8b25('0x45')](_0x54b4dc,_0x56768d[_0x8b25('0x46')]['id'])};})[_0x8b25('0x15')](respondWithResult(_0x3e1b89,null))['catch'](handleError(_0x3e1b89,null));};exports[_0x8b25('0x47')]=function(_0x5ee99b,_0x2b36ec){var _0xf39f9a=_0x5ee99b['body'];var _0x1a6dcb;var _0x1e6ae4;if(_0xf39f9a[_0x8b25('0x17')])throw _0xf39f9a;redis[_0x8b25('0x48')](_0xf39f9a[_0x8b25('0x49')])[_0x8b25('0x15')](function(_0x273ab3){if(!_0x273ab3)throw new Error(_0x8b25('0x4a'));_0x1a6dcb=JSON[_0x8b25('0x4b')](_0x273ab3);var _0x239962=Buffer[_0x8b25('0x4c')](_0xf39f9a[_0x8b25('0x49')],_0x8b25('0x4d'))[_0x8b25('0x4e')]('ascii');_0x1e6ae4=JSON[_0x8b25('0x4b')](_0x239962);if(!oauth[_0x8b25('0x4f')](_0xf39f9a[_0x8b25('0x50')],_0x1a6dcb[_0x8b25('0x51')]))throw new Error(_0x8b25('0x52'));redis[_0x8b25('0x53')](_0xf39f9a['state']);return oauth[_0x8b25('0x54')](_0xf39f9a[_0x8b25('0x55')],_0x1a6dcb);})[_0x8b25('0x15')](function(_0x55dc78){_0x1a6dcb[_0x8b25('0x56')]=_0x55dc78[_0x8b25('0x57')];_0x1a6dcb[_0x8b25('0x58')]=_0x55dc78[_0x8b25('0x59')];return db[_0x8b25('0x1c')][_0x8b25('0x14')]({'data5':_0x1a6dcb['data5'],'data6':_0x1a6dcb[_0x8b25('0x58')]},{'where':{'id':_0x1a6dcb['id']}});})[_0x8b25('0x15')](function(){oauth[_0x8b25('0x5a')](_0x1a6dcb);socket[_0x8b25('0x5b')](_0x8b25('0x5c'),{'id':_0x1e6ae4['id']});return;})['then'](respondWithStatusCode(_0x2b36ec,null))['catch'](function(_0xc118cc){if(_0x1e6ae4){socket[_0x8b25('0x5b')](_0x8b25('0x5d'),{'id':_0x1e6ae4['id']});}if(!_0x1a6dcb){logger['error'](_0x8b25('0x5e'),_0xc118cc);return _0x2b36ec['status'](0x1f4)[_0x8b25('0x19')](_0xc118cc['message']);}logger['error'](_0x8b25('0x5f'),_0x1a6dcb['id'],JSON[_0x8b25('0x60')](_0xc118cc));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 64f56da..dc8eeb8 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 _0x614b=['request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird'];(function(_0x2e0319,_0x1353c0){var _0x7da0a4=function(_0x43ec39){while(--_0x43ec39){_0x2e0319['push'](_0x2e0319['shift']());}};_0x7da0a4(++_0x1353c0);}(_0x614b,0x1a8));var _0xb614=function(_0x39dd07,_0x32ee45){_0x39dd07=_0x39dd07-0x0;var _0x274d9b=_0x614b[_0x39dd07];return _0x274d9b;};'use strict';var _=require(_0xb614('0x0'));var util=require(_0xb614('0x1'));var logger=require(_0xb614('0x2'))(_0xb614('0x3'));var moment=require('moment');var BPromise=require(_0xb614('0x4'));var rp=require(_0xb614('0x5'));var fs=require('fs');var path=require(_0xb614('0x6'));var rimraf=require('rimraf');var config=require(_0xb614('0x7'));var attributes=require(_0xb614('0x8'));module[_0xb614('0x9')]=function(_0x16d918,_0x3693f3){return _0x16d918[_0xb614('0xa')](_0xb614('0xb'),attributes,{'tableName':_0xb614('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf90e=['CloudProvider','cloud_providers','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5358f2,_0x49d10c){var _0x1c8340=function(_0x5a4a88){while(--_0x5a4a88){_0x5358f2['push'](_0x5358f2['shift']());}};_0x1c8340(++_0x49d10c);}(_0xf90e,0xfe));var _0xef90=function(_0x1732d3,_0x4bc1ab){_0x1732d3=_0x1732d3-0x0;var _0x5182a7=_0xf90e[_0x1732d3];return _0x5182a7;};'use strict';var _=require(_0xef90('0x0'));var util=require('util');var logger=require(_0xef90('0x1'))(_0xef90('0x2'));var moment=require('moment');var BPromise=require(_0xef90('0x3'));var rp=require(_0xef90('0x4'));var fs=require('fs');var path=require(_0xef90('0x5'));var rimraf=require(_0xef90('0x6'));var config=require(_0xef90('0x7'));var attributes=require('./cloudProvider.attributes');module[_0xef90('0x8')]=function(_0x461f3a,_0x269cc6){return _0x461f3a[_0xef90('0x9')](_0xef90('0xa'),attributes,{'tableName':_0xef90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 930a87c..202f14b 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x522d=['offline_access','/authorize','/token','map','type','Dynamics365','push','/.default','join','Outlook365','data7','replace','{TENANT_ID}','data2','id_token','from','stringify','base64','toString','client_id','data1','response_type','data4','response_mode','scope','prompt','login','key','value','oauth2Claims','oauth2/','set','payload','issuer','nonce','isAfter','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data5','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','openid','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All'];(function(_0x605573,_0x45795d){var _0x4ce60c=function(_0xfd2312){while(--_0xfd2312){_0x605573['push'](_0x605573['shift']());}};_0x4ce60c(++_0x45795d);}(_0x522d,0x85));var _0xd522=function(_0x3b9af9,_0x200fd6){_0x3b9af9=_0x3b9af9-0x0;var _0x20efe4=_0x522d[_0x3b9af9];return _0x20efe4;};'use strict';var _=require(_0xd522('0x0'));var crypto=require(_0xd522('0x1'));var jwt=require(_0xd522('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require(_0xd522('0x3'));var util=require(_0xd522('0x4'));var encryptor=require(_0xd522('0x5'));var config=require(_0xd522('0x6'));var logger=require(_0xd522('0x7'))(_0xd522('0x8'));var schedule=require(_0xd522('0x9'));var db=require(_0xd522('0xa'))['db'];config[_0xd522('0xb')]=_[_0xd522('0xc')](config[_0xd522('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xd522('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xd522('0xd'),'profile',_0xd522('0xe'),'offline_access',_0xd522('0xf'),_0xd522('0x10'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xd522('0xd'),_0xd522('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xd522('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xd522('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x270ec8){var _0x1e90b2=_[_0xd522('0x14')](AZURE_AUTH_SCOPES[_0x270ec8[_0xd522('0x15')]]);if(_0x270ec8[_0xd522('0x15')]===_0xd522('0x16'))_0x1e90b2[_0xd522('0x17')](_0x270ec8['data7']+_0xd522('0x18'));return _0x1e90b2[_0xd522('0x19')]('\x20');}function getAccessTokenScope(_0x313f5b){if(_0x313f5b[_0xd522('0x15')]===_0xd522('0x1a'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x313f5b['type']===_0xd522('0x16'))return _0x313f5b[_0xd522('0x1b')]+_0xd522('0x18');}function generateMicrosoftAuthorizationUrl(_0xeda8df,_0x5bb523){var _0x13ed03=MICROSOFT_AUTH_URL[_0xd522('0x1c')](_0xd522('0x1d'),_0xeda8df[_0xd522('0x1e')]);var _0x4eec7b=['code',_0xd522('0x1f')];var _0x58e7af=Buffer[_0xd522('0x20')](JSON[_0xd522('0x21')]({'id':_0x5bb523}))['toString'](_0xd522('0x22'));var _0x4ce910=crypto['randomBytes'](0x10)[_0xd522('0x23')]('hex');var _0x1f8bf8=getAuthorizationScopes(_0xeda8df);var _0x2c07ae=[{'key':_0xd522('0x24'),'value':_0xeda8df[_0xd522('0x25')]},{'key':_0xd522('0x26'),'value':encodeURIComponent(_0x4eec7b[_0xd522('0x19')]('\x20'))},{'key':'redirect_uri','value':_0xeda8df[_0xd522('0x27')]},{'key':_0xd522('0x28'),'value':'form_post'},{'key':_0xd522('0x29'),'value':encodeURIComponent(_0x1f8bf8)},{'key':'state','value':_0x58e7af},{'key':'nonce','value':_0x4ce910},{'key':_0xd522('0x2a'),'value':_0xd522('0x2b')}];var _0x2da3fb=_0x13ed03+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xd522('0x14')](_0x2c07ae,function(_0x6c1c0c){return _0x6c1c0c[_0xd522('0x2c')]+'='+_0x6c1c0c[_0xd522('0x2d')];})[_0xd522('0x19')]('&');_0xeda8df[_0xd522('0x2e')]={'issuer':_0x13ed03[_0xd522('0x1c')](_0xd522('0x2f'),''),'audience':_0xeda8df[_0xd522('0x25')],'state':_0x58e7af,'nonce':_0x4ce910};redis[_0xd522('0x30')](_0x58e7af,JSON[_0xd522('0x21')](_0xeda8df));return _0x2da3fb;}function isValidIdToken(_0x58fb79,_0x16e414){try{var _0x16dfba=jwt['decode'](_0x58fb79,{'complete':!![]});var _0x2bd75d=_0x16dfba[_0xd522('0x31')];if(_0x2bd75d['iss']!==_0x16e414[_0xd522('0x32')])return![];if(_0x2bd75d['aud']!==_0x16e414['audience'])return![];if(_0x2bd75d[_0xd522('0x33')]!==_0x16e414[_0xd522('0x33')])return![];if(moment()[_0xd522('0x34')](moment['unix'](_0x2bd75d[_0xd522('0x35')])))return![];return!![];}catch(_0x1026f4){throw _0x1026f4;}}function refreshOauth2MicrosoftAccessToken(_0x520dfa){return Promise[_0xd522('0x36')]()[_0xd522('0x37')](function(){if(_0x520dfa[_0xd522('0x38')])return _0x520dfa;return db[_0xd522('0x39')][_0xd522('0x3a')]({'where':{'id':_0x520dfa['id']},'raw':!![]});})[_0xd522('0x37')](function(_0x66e7c5){var _0x55ccf0={'grant_type':_0xd522('0x3b'),'refresh_token':_0x66e7c5[_0xd522('0x3c')],'scope':getAccessTokenScope(_0x66e7c5),'redirect_uri':_0x66e7c5['data4'],'client_id':_0x66e7c5[_0xd522('0x25')],'client_secret':encryptor[_0xd522('0x3d')](_0x66e7c5[_0xd522('0x38')])};var _0x517f24={'method':_0xd522('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xd522('0x1c')](_0xd522('0x1d'),_0x66e7c5['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x55ccf0,'json':!![]};return rp(_0x517f24);})[_0xd522('0x37')](function(_0x7cbf21){_0x520dfa[_0xd522('0x3f')]=_0x7cbf21['access_token'];_0x520dfa[_0xd522('0x3c')]=_0x7cbf21[_0xd522('0x3b')];return db[_0xd522('0x39')][_0xd522('0x40')]({'data5':_0x520dfa['data5'],'data6':_0x520dfa['data6']},{'where':{'id':_0x520dfa['id']}});})[_0xd522('0x37')](function(){return _0x520dfa;})[_0xd522('0x41')](function(_0x9f6a8){logger[_0xd522('0x42')](_0xd522('0x43'),_0x520dfa['id'],_0x9f6a8);});}function getOauth2MicrosoftAccessToken(_0x18ce4b,_0x470af0){var _0x13d43a={'grant_type':_0xd522('0x44'),'code':_0x18ce4b,'scope':getAccessTokenScope(_0x470af0),'redirect_uri':_0x470af0['data4'],'client_id':_0x470af0[_0xd522('0x25')],'client_secret':encryptor[_0xd522('0x3d')](_0x470af0[_0xd522('0x38')])};var _0x34f0ee={'method':_0xd522('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xd522('0x1c')](_0xd522('0x1d'),_0x470af0[_0xd522('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x13d43a,'json':!![]};return rp(_0x34f0ee);}function startRefreshInterval(_0xa263bf){var _0x4ed6af=schedule[_0xd522('0x45')];if(_0x4ed6af[_0xa263bf['id']])clearInterval(_0x4ed6af[_0xa263bf['id']]);_0x4ed6af[_0xa263bf['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xd522('0x46')](this,{'id':_0xa263bf['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xd522('0x45')]=_0x4ed6af;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xd522('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x512122){var _0x5abf7b=_0x512122[_0xd522('0x14')](function(_0x25389b){return refreshOauth2MicrosoftAccessToken(_0x25389b)['then'](function(_0x4e3f77){startRefreshInterval(_0x4e3f77);});});return Promise[_0xd522('0x48')](_0x5abf7b);})[_0xd522('0x41')](function(_0x3652a5){var _0x110f4e=_0x3652a5?util[_0xd522('0x49')](_0x3652a5,{'showHidden':![],'depth':null}):'';logger[_0xd522('0x42')](_0xd522('0x4a'),_0x110f4e);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xfc43=['isAfter','unix','exp','resolve','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}','then','data5','access_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','bind','intervals','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','openid','profile','email','offline_access','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','/.default','replace','data2','code','id_token','from','stringify','base64','randomBytes','toString','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','key','value','oauth2Claims','decode','payload','iss','issuer','aud'];(function(_0x52972d,_0x39df87){var _0x1c853c=function(_0x4c7e1b){while(--_0x4c7e1b){_0x52972d['push'](_0x52972d['shift']());}};_0x1c853c(++_0x39df87);}(_0xfc43,0xc1));var _0x3fc4=function(_0x440572,_0x27491b){_0x440572=_0x440572-0x0;var _0x1781c4=_0xfc43[_0x440572];return _0x1781c4;};'use strict';var _=require(_0x3fc4('0x0'));var crypto=require(_0x3fc4('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x3fc4('0x2'));var Redis=require(_0x3fc4('0x3'));var rp=require(_0x3fc4('0x4'));var util=require(_0x3fc4('0x5'));var encryptor=require(_0x3fc4('0x6'));var config=require(_0x3fc4('0x7'));var logger=require(_0x3fc4('0x8'))(_0x3fc4('0x9'));var schedule=require(_0x3fc4('0xa'));var db=require(_0x3fc4('0xb'))['db'];config[_0x3fc4('0xc')]=_['defaults'](config['redis'],{'host':_0x3fc4('0xd'),'port':0x18eb});var redis=new Redis(config[_0x3fc4('0xc')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x3fc4('0xe'),_0x3fc4('0xf'),_0x3fc4('0x10'),_0x3fc4('0x11'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0x3fc4('0x12')],'Dynamics365':['openid',_0x3fc4('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x3fc4('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x3fc4('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x229677){var _0x344521=_[_0x3fc4('0x15')](AZURE_AUTH_SCOPES[_0x229677[_0x3fc4('0x16')]]);if(_0x229677[_0x3fc4('0x16')]===_0x3fc4('0x17'))_0x344521[_0x3fc4('0x18')](_0x229677[_0x3fc4('0x19')]+'/.default');return _0x344521[_0x3fc4('0x1a')]('\x20');}function getAccessTokenScope(_0xe89d1b){if(_0xe89d1b[_0x3fc4('0x16')]===_0x3fc4('0x1b'))return _0x3fc4('0x1c');if(_0xe89d1b[_0x3fc4('0x16')]===_0x3fc4('0x17'))return _0xe89d1b[_0x3fc4('0x19')]+_0x3fc4('0x1d');}function generateMicrosoftAuthorizationUrl(_0x51519b,_0x1464e1){var _0xa78ebd=MICROSOFT_AUTH_URL[_0x3fc4('0x1e')]('{TENANT_ID}',_0x51519b[_0x3fc4('0x1f')]);var _0x853db4=[_0x3fc4('0x20'),_0x3fc4('0x21')];var _0x4dc58a=Buffer[_0x3fc4('0x22')](JSON[_0x3fc4('0x23')]({'id':_0x1464e1}))['toString'](_0x3fc4('0x24'));var _0xd3614=crypto[_0x3fc4('0x25')](0x10)[_0x3fc4('0x26')](_0x3fc4('0x27'));var _0x198175=getAuthorizationScopes(_0x51519b);var _0x3a9ed6=[{'key':_0x3fc4('0x28'),'value':_0x51519b[_0x3fc4('0x29')]},{'key':_0x3fc4('0x2a'),'value':encodeURIComponent(_0x853db4[_0x3fc4('0x1a')]('\x20'))},{'key':_0x3fc4('0x2b'),'value':_0x51519b[_0x3fc4('0x2c')]},{'key':_0x3fc4('0x2d'),'value':_0x3fc4('0x2e')},{'key':_0x3fc4('0x2f'),'value':encodeURIComponent(_0x198175)},{'key':_0x3fc4('0x30'),'value':_0x4dc58a},{'key':_0x3fc4('0x31'),'value':_0xd3614},{'key':_0x3fc4('0x32'),'value':'login'}];var _0x4e374d=_0xa78ebd+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x3fc4('0x15')](_0x3a9ed6,function(_0x1f9e2c){return _0x1f9e2c[_0x3fc4('0x33')]+'='+_0x1f9e2c[_0x3fc4('0x34')];})[_0x3fc4('0x1a')]('&');_0x51519b[_0x3fc4('0x35')]={'issuer':_0xa78ebd[_0x3fc4('0x1e')]('oauth2/',''),'audience':_0x51519b[_0x3fc4('0x29')],'state':_0x4dc58a,'nonce':_0xd3614};redis['set'](_0x4dc58a,JSON[_0x3fc4('0x23')](_0x51519b));return _0x4e374d;}function isValidIdToken(_0x5dd3e6,_0x5838df){try{var _0xf71a8=jwt[_0x3fc4('0x36')](_0x5dd3e6,{'complete':!![]});var _0x1fd6d5=_0xf71a8[_0x3fc4('0x37')];if(_0x1fd6d5[_0x3fc4('0x38')]!==_0x5838df[_0x3fc4('0x39')])return![];if(_0x1fd6d5[_0x3fc4('0x3a')]!==_0x5838df['audience'])return![];if(_0x1fd6d5[_0x3fc4('0x31')]!==_0x5838df['nonce'])return![];if(moment()[_0x3fc4('0x3b')](moment[_0x3fc4('0x3c')](_0x1fd6d5[_0x3fc4('0x3d')])))return![];return!![];}catch(_0x2b9665){throw _0x2b9665;}}function refreshOauth2MicrosoftAccessToken(_0x49b14f){return Promise[_0x3fc4('0x3e')]()['then'](function(){if(_0x49b14f[_0x3fc4('0x3f')])return _0x49b14f;return db[_0x3fc4('0x40')][_0x3fc4('0x41')]({'where':{'id':_0x49b14f['id']},'raw':!![]});})['then'](function(_0x5959d7){var _0x12eb0a={'grant_type':_0x3fc4('0x42'),'refresh_token':_0x5959d7[_0x3fc4('0x43')],'scope':getAccessTokenScope(_0x5959d7),'redirect_uri':_0x5959d7[_0x3fc4('0x2c')],'client_id':_0x5959d7['data1'],'client_secret':encryptor[_0x3fc4('0x44')](_0x5959d7['data3'])};var _0x2abd19={'method':_0x3fc4('0x45'),'uri':MICROSOFT_AUTH_URL[_0x3fc4('0x1e')](_0x3fc4('0x46'),_0x5959d7[_0x3fc4('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x12eb0a,'json':!![]};return rp(_0x2abd19);})[_0x3fc4('0x47')](function(_0x50593d){_0x49b14f[_0x3fc4('0x48')]=_0x50593d[_0x3fc4('0x49')];_0x49b14f['data6']=_0x50593d['refresh_token'];return db[_0x3fc4('0x40')]['update']({'data5':_0x49b14f[_0x3fc4('0x48')],'data6':_0x49b14f[_0x3fc4('0x43')]},{'where':{'id':_0x49b14f['id']}});})[_0x3fc4('0x47')](function(){return _0x49b14f;})[_0x3fc4('0x4a')](function(_0x4f0452){logger[_0x3fc4('0x4b')](_0x3fc4('0x4c'),_0x49b14f['id'],_0x4f0452);});}function getOauth2MicrosoftAccessToken(_0x295a93,_0x38fb7a){var _0x12a686={'grant_type':_0x3fc4('0x4d'),'code':_0x295a93,'scope':getAccessTokenScope(_0x38fb7a),'redirect_uri':_0x38fb7a[_0x3fc4('0x2c')],'client_id':_0x38fb7a[_0x3fc4('0x29')],'client_secret':encryptor[_0x3fc4('0x44')](_0x38fb7a[_0x3fc4('0x3f')])};var _0x53b10f={'method':_0x3fc4('0x45'),'uri':MICROSOFT_AUTH_URL[_0x3fc4('0x1e')](_0x3fc4('0x46'),_0x38fb7a[_0x3fc4('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x12a686,'json':!![]};return rp(_0x53b10f);}function startRefreshInterval(_0xaf047f){var _0x383b8b=schedule['intervals'];if(_0x383b8b[_0xaf047f['id']])clearInterval(_0x383b8b[_0xaf047f['id']]);_0x383b8b[_0xaf047f['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x3fc4('0x4e')](this,{'id':_0xaf047f['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x3fc4('0x4f')]=_0x383b8b;}function startAllRefreshIntervals(){return db[_0x3fc4('0x40')][_0x3fc4('0x50')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x3fc4('0x47')](function(_0x4097df){var _0x1204cf=_0x4097df[_0x3fc4('0x15')](function(_0x4e5af1){return refreshOauth2MicrosoftAccessToken(_0x4e5af1)[_0x3fc4('0x47')](function(_0x25a12f){startRefreshInterval(_0x25a12f);});});return Promise[_0x3fc4('0x51')](_0x1204cf);})[_0x3fc4('0x4a')](function(_0x307c6b){var _0x315c90=_0x307c6b?util['inspect'](_0x307c6b,{'showHidden':![],'depth':null}):'';logger[_0x3fc4('0x4b')](_0x3fc4('0x52'),_0x315c90);});}module[_0x3fc4('0x53')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 45d0e89..a059f55 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 _0x014c=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util'];(function(_0x430ad9,_0x2b466d){var _0x39469d=function(_0x4fb9a0){while(--_0x4fb9a0){_0x430ad9['push'](_0x430ad9['shift']());}};_0x39469d(++_0x2b466d);}(_0x014c,0x17b));var _0xc014=function(_0x8b631b,_0x386724){_0x8b631b=_0x8b631b-0x0;var _0x3e6832=_0x014c[_0x8b631b];return _0x3e6832;};'use strict';var _=require('lodash');var util=require(_0xc014('0x0'));var moment=require('moment');var BPromise=require(_0xc014('0x1'));var rs=require(_0xc014('0x2'));var fs=require('fs');var Redis=require(_0xc014('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc014('0x4'))(_0xc014('0x5'));var config=require(_0xc014('0x6'));var jayson=require(_0xc014('0x7'));var client=jayson[_0xc014('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x398960,_0x367c5c,_0x5785d1){return new BPromise(function(_0x175bdb,_0x52139f){return client[_0xc014('0x9')](_0x398960,_0x5785d1)[_0xc014('0xa')](function(_0x5701db){logger['info'](_0xc014('0xb'),_0x367c5c,_0xc014('0xc'));logger[_0xc014('0xd')](_0xc014('0xe'),_0x367c5c,'request\x20sent',JSON[_0xc014('0xf')](_0x5701db));if(_0x5701db['error']){if(_0x5701db[_0xc014('0x10')]['code']===0x1f4){logger[_0xc014('0x10')](_0xc014('0xb'),_0x367c5c,_0x5701db[_0xc014('0x10')][_0xc014('0x11')]);return _0x52139f(_0x5701db['error'][_0xc014('0x11')]);}logger[_0xc014('0x10')](_0xc014('0xb'),_0x367c5c,_0x5701db['error'][_0xc014('0x11')]);return _0x175bdb(_0x5701db['error'][_0xc014('0x11')]);}else{logger[_0xc014('0x12')](_0xc014('0xb'),_0x367c5c,_0xc014('0xc'));_0x175bdb(_0x5701db[_0xc014('0x13')][_0xc014('0x11')]);}})['catch'](function(_0x462650){logger[_0xc014('0x10')](_0xc014('0xb'),_0x367c5c,_0x462650);_0x52139f(_0x462650);});});}
\ No newline at end of file
+var _0xf960=['CloudProvider,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2c4ca7,_0x5abe87){var _0xc82d75=function(_0x27780f){while(--_0x27780f){_0x2c4ca7['push'](_0x2c4ca7['shift']());}};_0xc82d75(++_0x5abe87);}(_0xf960,0x193));var _0x0f96=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xf960[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x0f96('0x0'));var util=require('util');var moment=require(_0x0f96('0x1'));var BPromise=require('bluebird');var rs=require(_0x0f96('0x2'));var fs=require('fs');var Redis=require(_0x0f96('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f96('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x0f96('0x5'));var jayson=require(_0x0f96('0x6'));var client=jayson[_0x0f96('0x7')][_0x0f96('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x765dfe,_0x5c61f0,_0x48a12b){return new BPromise(function(_0x1c690a,_0x354642){return client[_0x0f96('0x9')](_0x765dfe,_0x48a12b)[_0x0f96('0xa')](function(_0x1eb762){logger[_0x0f96('0xb')]('CloudProvider,\x20%s,\x20%s',_0x5c61f0,_0x0f96('0xc'));logger['debug'](_0x0f96('0xd'),_0x5c61f0,'request\x20sent',JSON[_0x0f96('0xe')](_0x1eb762));if(_0x1eb762[_0x0f96('0xf')]){if(_0x1eb762[_0x0f96('0xf')][_0x0f96('0x10')]===0x1f4){logger['error'](_0x0f96('0x11'),_0x5c61f0,_0x1eb762[_0x0f96('0xf')][_0x0f96('0x12')]);return _0x354642(_0x1eb762[_0x0f96('0xf')]['message']);}logger[_0x0f96('0xf')](_0x0f96('0x11'),_0x5c61f0,_0x1eb762[_0x0f96('0xf')][_0x0f96('0x12')]);return _0x1c690a(_0x1eb762[_0x0f96('0xf')][_0x0f96('0x12')]);}else{logger['info'](_0x0f96('0x11'),_0x5c61f0,'request\x20sent');_0x1c690a(_0x1eb762['result'][_0x0f96('0x12')]);}})[_0x0f96('0x13')](function(_0x183d93){logger[_0x0f96('0xf')](_0x0f96('0x11'),_0x5c61f0,_0x183d93);_0x354642(_0x183d93);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 189f8cd..21694e8 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7a54,0x106));var _0x47a5=function(_0x141b13,_0x3bba31){_0x141b13=_0x141b13-0x0;var _0x5a09b7=_0x7a54[_0x141b13];return _0x5a09b7;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
+var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x34ad56,_0x2c9ac4){var _0x2d4c7c=function(_0x5935c9){while(--_0x5935c9){_0x34ad56['push'](_0x34ad56['shift']());}};_0x2d4c7c(++_0x2c9ac4);}(_0xadb5,0xad));var _0x5adb=function(_0xa3d728,_0x465555){_0xa3d728=_0xa3d728-0x0;var _0xe3754c=_0xadb5[_0xa3d728];return _0xe3754c;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index c4ba3a8..c004199 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 _0xc8d8=['exports','STRING'];(function(_0x1fdb40,_0x51351c){var _0x281f93=function(_0x35eebe){while(--_0x35eebe){_0x1fdb40['push'](_0x1fdb40['shift']());}};_0x281f93(++_0x51351c);}(_0xc8d8,0x6c));var _0x8c8d=function(_0x4a2268,_0x2c6a30){_0x4a2268=_0x4a2268-0x0;var _0x57f41a=_0xc8d8[_0x4a2268];return _0x57f41a;};'use strict';var Sequelize=require('sequelize');module[_0x8c8d('0x0')]={'name':{'type':Sequelize[_0x8c8d('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8c8d('0x1')]},'companyId':{'type':Sequelize[_0x8c8d('0x1')]},'website':{'type':Sequelize[_0x8c8d('0x1')]},'phone':{'type':Sequelize[_0x8c8d('0x1')]},'fax':{'type':Sequelize[_0x8c8d('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x8c8d('0x1')]},'postalCode':{'type':Sequelize[_0x8c8d('0x1')]},'city':{'type':Sequelize[_0x8c8d('0x1')]},'country':{'type':Sequelize[_0x8c8d('0x1')]},'email':{'type':Sequelize[_0x8c8d('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x8c8d('0x1')]},'sStreet':{'type':Sequelize[_0x8c8d('0x1')]},'sPostalCode':{'type':Sequelize[_0x8c8d('0x1')]},'sCity':{'type':Sequelize[_0x8c8d('0x1')]},'sCountry':{'type':Sequelize[_0x8c8d('0x1')]},'description':{'type':Sequelize[_0x8c8d('0x1')]}};
\ No newline at end of file
+var _0x9772=['sequelize','STRING'];(function(_0x3f8f8c,_0x32716c){var _0x3cdf64=function(_0x16e3bb){while(--_0x16e3bb){_0x3f8f8c['push'](_0x3f8f8c['shift']());}};_0x3cdf64(++_0x32716c);}(_0x9772,0x74));var _0x2977=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9772[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x2977('0x0'));module['exports']={'name':{'type':Sequelize[_0x2977('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2977('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x2977('0x1')]},'fax':{'type':Sequelize[_0x2977('0x1')]},'type':{'type':Sequelize[_0x2977('0x1')]},'street':{'type':Sequelize[_0x2977('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x2977('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x2977('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x2977('0x1')]},'sPostalCode':{'type':Sequelize[_0x2977('0x1')]},'sCity':{'type':Sequelize[_0x2977('0x1')]},'sCountry':{'type':Sequelize[_0x2977('0x1')]},'description':{'type':Sequelize[_0x2977('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 77ec5e4..2de68e0 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 _0xa5d9=['Companies','UserProfileResource','error','name','index','CmCompany','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','includeAll','findAll','rows','catch','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','getContacts','findOne','options','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','save','update','then','destroy'];(function(_0x57e6c6,_0x248465){var _0x470ef9=function(_0x3d04d4){while(--_0x3d04d4){_0x57e6c6['push'](_0x57e6c6['shift']());}};_0x470ef9(++_0x248465);}(_0xa5d9,0xd1));var _0x9a5d=function(_0x21dffd,_0x14b0b0){_0x21dffd=_0x21dffd-0x0;var _0x32a878=_0xa5d9[_0x21dffd];return _0x32a878;};'use strict';var emlformat=require(_0x9a5d('0x0'));var rimraf=require(_0x9a5d('0x1'));var zipdir=require(_0x9a5d('0x2'));var jsonpatch=require(_0x9a5d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9a5d('0x4'));var Mustache=require(_0x9a5d('0x5'));var util=require(_0x9a5d('0x6'));var path=require(_0x9a5d('0x7'));var sox=require(_0x9a5d('0x8'));var csv=require(_0x9a5d('0x9'));var ejs=require(_0x9a5d('0xa'));var fs=require('fs');var fs_extra=require(_0x9a5d('0xb'));var _=require('lodash');var squel=require(_0x9a5d('0xc'));var crypto=require(_0x9a5d('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9a5d('0x9'));var querystring=require(_0x9a5d('0xe'));var Papa=require(_0x9a5d('0xf'));var Redis=require(_0x9a5d('0x10'));var authService=require(_0x9a5d('0x11'));var qs=require(_0x9a5d('0x12'));var as=require(_0x9a5d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a5d('0x14'))(_0x9a5d('0x15'));var utils=require('../../config/utils');var config=require(_0x9a5d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a5d('0x17'))['db'];function respondWithStatusCode(_0x3b4f89,_0x6fd96f){_0x6fd96f=_0x6fd96f||0xcc;return function(_0x266141){if(_0x266141){return _0x3b4f89['sendStatus'](_0x6fd96f);}return _0x3b4f89[_0x9a5d('0x18')](_0x6fd96f)[_0x9a5d('0x19')]();};}function respondWithResult(_0x565a4d,_0x5c9367){_0x5c9367=_0x5c9367||0xc8;return function(_0xef2324){if(_0xef2324){return _0x565a4d[_0x9a5d('0x18')](_0x5c9367)['json'](_0xef2324);}};}function respondWithFilteredResult(_0xb9c51f,_0x29f3b4){return function(_0x154991){if(_0x154991){var _0x353628=typeof _0x29f3b4[_0x9a5d('0x1a')]===_0x9a5d('0x1b')&&typeof _0x29f3b4['limit']===_0x9a5d('0x1b');var _0x18077e=_0x154991[_0x9a5d('0x1c')];var _0x42cec1=_0x353628?0x0:_0x29f3b4[_0x9a5d('0x1a')];var _0x16fa7e=_0x353628?_0x154991[_0x9a5d('0x1c')]:_0x29f3b4['offset']+_0x29f3b4['limit'];var _0x3f2fda;if(_0x16fa7e>=_0x18077e){_0x16fa7e=_0x18077e;_0x3f2fda=0xc8;}else{_0x3f2fda=0xce;}_0xb9c51f['status'](_0x3f2fda);return _0xb9c51f[_0x9a5d('0x1d')](_0x9a5d('0x1e'),_0x42cec1+'-'+_0x16fa7e+'/'+_0x18077e)[_0x9a5d('0x1f')](_0x154991);}return null;};}function patchUpdates(_0x1cfecd){return function(_0x4cf5b5){try{jsonpatch[_0x9a5d('0x20')](_0x4cf5b5,_0x1cfecd,!![]);}catch(_0x3842c7){return BPromise['reject'](_0x3842c7);}return _0x4cf5b5[_0x9a5d('0x21')]();};}function saveUpdates(_0x140c11,_0x40d16e){return function(_0x21d37e){if(_0x21d37e){return _0x21d37e[_0x9a5d('0x22')](_0x140c11)[_0x9a5d('0x23')](function(_0x191e8d){return _0x191e8d;});}return null;};}function removeEntity(_0x33892f,_0x316251){return function(_0x2335a7){if(_0x2335a7){return _0x2335a7[_0x9a5d('0x24')]()['then'](function(){var _0x38367b=_0x2335a7['get']({'plain':!![]});var _0x535f59=_0x9a5d('0x25');return db[_0x9a5d('0x26')][_0x9a5d('0x24')]({'where':{'type':_0x535f59,'resourceId':_0x38367b['id']}})[_0x9a5d('0x23')](function(){return _0x2335a7;});})[_0x9a5d('0x23')](function(){_0x33892f[_0x9a5d('0x18')](0xcc)[_0x9a5d('0x19')]();});}};}function handleEntityNotFound(_0x46acca,_0x3a2804){return function(_0x2fde67){if(!_0x2fde67){_0x46acca['sendStatus'](0x194);}return _0x2fde67;};}function handleError(_0xe30962,_0x2bd429){_0x2bd429=_0x2bd429||0x1f4;return function(_0x5b4f23){logger[_0x9a5d('0x27')](_0x5b4f23['stack']);if(_0x5b4f23[_0x9a5d('0x28')]){delete _0x5b4f23[_0x9a5d('0x28')];}_0xe30962[_0x9a5d('0x18')](_0x2bd429)['send'](_0x5b4f23);};}exports[_0x9a5d('0x29')]=function(_0x1f95c0,_0x51e238){var _0x212345={},_0x549ed6={},_0x4eb480={'count':0x0,'rows':[]};return db[_0x9a5d('0x2a')]['describe']()[_0x9a5d('0x23')](function(_0x3e35f2){_0x549ed6[_0x9a5d('0x2b')]=_['keys'](_0x3e35f2);_0x549ed6[_0x9a5d('0x2c')]=_[_0x9a5d('0x2d')](_0x1f95c0['query']);_0x549ed6[_0x9a5d('0x2e')]=_[_0x9a5d('0x2f')](_0x549ed6['model'],_0x549ed6['query']);_0x212345[_0x9a5d('0x30')]=_[_0x9a5d('0x2f')](_0x549ed6[_0x9a5d('0x2b')],qs[_0x9a5d('0x31')](_0x1f95c0[_0x9a5d('0x2c')][_0x9a5d('0x31')]));_0x212345['attributes']=_0x212345[_0x9a5d('0x30')][_0x9a5d('0x32')]?_0x212345[_0x9a5d('0x30')]:_0x549ed6[_0x9a5d('0x2b')];if(!_0x1f95c0['query'][_0x9a5d('0x33')](_0x9a5d('0x34'))){_0x212345[_0x9a5d('0x35')]=qs['limit'](_0x1f95c0[_0x9a5d('0x2c')][_0x9a5d('0x35')]);_0x212345[_0x9a5d('0x1a')]=qs[_0x9a5d('0x1a')](_0x1f95c0['query']['offset']);}_0x212345[_0x9a5d('0x36')]=qs[_0x9a5d('0x37')](_0x1f95c0[_0x9a5d('0x2c')][_0x9a5d('0x37')]);_0x212345[_0x9a5d('0x38')]=qs[_0x9a5d('0x2e')](_[_0x9a5d('0x39')](_0x1f95c0[_0x9a5d('0x2c')],_0x549ed6[_0x9a5d('0x2e')]),_0x3e35f2);if(_0x1f95c0['query'][_0x9a5d('0x3a')]){_0x212345['where']=_[_0x9a5d('0x3b')](_0x212345[_0x9a5d('0x38')],{'$or':_[_0x9a5d('0x3c')](_0x212345[_0x9a5d('0x30')],function(_0x330b89){var _0x2a09b2={};_0x2a09b2[_0x330b89]={'$like':'%'+_0x1f95c0[_0x9a5d('0x2c')][_0x9a5d('0x3a')]+'%'};return _0x2a09b2;})});}_0x212345=_[_0x9a5d('0x3b')]({},_0x212345,_0x1f95c0['options']);var _0x3fa425={'where':_0x212345[_0x9a5d('0x38')]};return db[_0x9a5d('0x2a')][_0x9a5d('0x1c')](_0x3fa425)[_0x9a5d('0x23')](function(_0x37bc71){_0x4eb480[_0x9a5d('0x1c')]=_0x37bc71;if(_0x1f95c0[_0x9a5d('0x2c')][_0x9a5d('0x3d')]){_0x212345['include']=[{'all':!![]}];}return db['CmCompany'][_0x9a5d('0x3e')](_0x212345);})[_0x9a5d('0x23')](function(_0x539b63){_0x4eb480[_0x9a5d('0x3f')]=_0x539b63;return _0x4eb480;})[_0x9a5d('0x23')](respondWithFilteredResult(_0x51e238,_0x212345))[_0x9a5d('0x40')](handleError(_0x51e238,null));})[_0x9a5d('0x40')](handleError(_0x51e238,null));};exports['show']=function(_0x2a3be4,_0x32dcbf){var _0x445610={'raw':![],'where':{'id':_0x2a3be4['params']['id']}},_0x5cb9a1={};_0x5cb9a1['model']=_[_0x9a5d('0x2d')](db[_0x9a5d('0x2a')][_0x9a5d('0x41')]);_0x5cb9a1['query']=_['keys'](_0x2a3be4[_0x9a5d('0x2c')]);_0x5cb9a1[_0x9a5d('0x2e')]=_[_0x9a5d('0x2f')](_0x5cb9a1[_0x9a5d('0x2b')],_0x5cb9a1[_0x9a5d('0x2c')]);_0x445610['attributes']=_[_0x9a5d('0x2f')](_0x5cb9a1['model'],qs[_0x9a5d('0x31')](_0x2a3be4[_0x9a5d('0x2c')][_0x9a5d('0x31')]));_0x445610[_0x9a5d('0x30')]=_0x445610[_0x9a5d('0x30')][_0x9a5d('0x32')]?_0x445610[_0x9a5d('0x30')]:_0x5cb9a1[_0x9a5d('0x2b')];if(_0x2a3be4[_0x9a5d('0x2c')]['includeAll']){_0x445610[_0x9a5d('0x42')]=[{'all':!![]}];}_0x445610=_[_0x9a5d('0x3b')]({},_0x445610,_0x2a3be4['options']);return db[_0x9a5d('0x2a')][_0x9a5d('0x43')](_0x445610)[_0x9a5d('0x23')](handleEntityNotFound(_0x32dcbf,null))[_0x9a5d('0x23')](respondWithResult(_0x32dcbf,null))[_0x9a5d('0x40')](handleError(_0x32dcbf,null));};exports[_0x9a5d('0x44')]=function(_0x35b5a0,_0x5926d1){return db[_0x9a5d('0x2a')][_0x9a5d('0x44')](_0x35b5a0[_0x9a5d('0x45')],{})['then'](function(_0x5d618e){var _0x1bbd18=_0x35b5a0['user']['get']({'plain':!![]});if(!_0x1bbd18)throw new Error(_0x9a5d('0x46'));if(_0x1bbd18['role']==='user'){var _0x1568c0=_0x5d618e[_0x9a5d('0x47')]({'plain':!![]});var _0x472d47=_0x9a5d('0x25');return db[_0x9a5d('0x48')][_0x9a5d('0x43')]({'where':{'name':_0x472d47,'userProfileId':_0x1bbd18[_0x9a5d('0x49')]},'raw':!![]})[_0x9a5d('0x23')](function(_0x54856d){if(_0x54856d&&_0x54856d['autoAssociation']===0x0){return db[_0x9a5d('0x26')][_0x9a5d('0x44')]({'name':_0x1568c0[_0x9a5d('0x28')],'resourceId':_0x1568c0['id'],'type':_0x54856d['name'],'sectionId':_0x54856d['id']},{})[_0x9a5d('0x23')](function(){return _0x5d618e;});}else{return _0x5d618e;}})[_0x9a5d('0x40')](function(_0x422f28){logger[_0x9a5d('0x27')](_0x9a5d('0x4a'),_0x422f28);throw _0x422f28;});}return _0x5d618e;})[_0x9a5d('0x23')](respondWithResult(_0x5926d1,0xc9))['catch'](handleError(_0x5926d1,null));};exports['update']=function(_0x2d4df2,_0x167353){if(_0x2d4df2[_0x9a5d('0x45')]['id']){delete _0x2d4df2[_0x9a5d('0x45')]['id'];}return db[_0x9a5d('0x2a')]['find']({'where':{'id':_0x2d4df2['params']['id']}})[_0x9a5d('0x23')](handleEntityNotFound(_0x167353,null))[_0x9a5d('0x23')](saveUpdates(_0x2d4df2['body'],null))[_0x9a5d('0x23')](respondWithResult(_0x167353,null))[_0x9a5d('0x40')](handleError(_0x167353,null));};exports[_0x9a5d('0x24')]=function(_0x886752,_0x181361){return db['CmCompany']['find']({'where':{'id':_0x886752['params']['id']}})[_0x9a5d('0x23')](handleEntityNotFound(_0x181361,null))[_0x9a5d('0x23')](removeEntity(_0x181361,null))['catch'](handleError(_0x181361,null));};exports[_0x9a5d('0x4b')]=function(_0x1dde52,_0x53b4df){return db[_0x9a5d('0x2a')][_0x9a5d('0x4b')]()[_0x9a5d('0x23')](respondWithResult(_0x53b4df,null))[_0x9a5d('0x40')](handleError(_0x53b4df,null));};exports[_0x9a5d('0x4c')]=function(_0x63eaf1,_0x482c19,_0x12431c){return db[_0x9a5d('0x4d')]['find']({'where':{'id':_0x63eaf1['params']['id']}})['then'](handleEntityNotFound(_0x482c19,null))[_0x9a5d('0x23')](function(_0x397eb5){if(_0x397eb5){return _0x397eb5['addContacts'](_0x63eaf1['body'][_0x9a5d('0x4e')],_['omit'](_0x63eaf1[_0x9a5d('0x45')],['ids','id'])||{});}})[_0x9a5d('0x23')](respondWithResult(_0x482c19,null))[_0x9a5d('0x40')](handleError(_0x482c19,null));};exports[_0x9a5d('0x4f')]=function(_0x5edf20,_0xe826b,_0x3302c9){var _0x54aac9={};var _0x51e533={};var _0x2c2524;var _0x559532;return db['CmCompany'][_0x9a5d('0x50')]({'where':{'id':_0x5edf20['params']['id']}})[_0x9a5d('0x23')](handleEntityNotFound(_0xe826b,null))['then'](function(_0x5bf40c){if(_0x5bf40c){_0x2c2524=_0x5bf40c;_0x51e533[_0x9a5d('0x2b')]=_[_0x9a5d('0x2d')](db[_0x9a5d('0x4d')][_0x9a5d('0x41')]);_0x51e533[_0x9a5d('0x2c')]=_[_0x9a5d('0x2d')](_0x5edf20['query']);_0x51e533[_0x9a5d('0x2e')]=_[_0x9a5d('0x2f')](_0x51e533[_0x9a5d('0x2b')],_0x51e533[_0x9a5d('0x2c')]);_0x54aac9[_0x9a5d('0x30')]=_[_0x9a5d('0x2f')](_0x51e533[_0x9a5d('0x2b')],qs[_0x9a5d('0x31')](_0x5edf20[_0x9a5d('0x2c')][_0x9a5d('0x31')]));_0x54aac9['attributes']=_0x54aac9[_0x9a5d('0x30')][_0x9a5d('0x32')]?_0x54aac9[_0x9a5d('0x30')]:_0x51e533[_0x9a5d('0x2b')];_0x54aac9['order']=qs[_0x9a5d('0x37')](_0x5edf20[_0x9a5d('0x2c')][_0x9a5d('0x37')]);_0x54aac9[_0x9a5d('0x38')]=qs[_0x9a5d('0x2e')](_[_0x9a5d('0x39')](_0x5edf20[_0x9a5d('0x2c')],_0x51e533['filters']));if(_0x5edf20['query'][_0x9a5d('0x3a')]){_0x54aac9[_0x9a5d('0x38')]=_[_0x9a5d('0x3b')](_0x54aac9[_0x9a5d('0x38')],{'$or':_[_0x9a5d('0x3c')](_0x54aac9[_0x9a5d('0x30')],function(_0x687af4){var _0x453cac={};_0x453cac[_0x687af4]={'$like':'%'+_0x5edf20[_0x9a5d('0x2c')][_0x9a5d('0x3a')]+'%'};return _0x453cac;})});}_0x54aac9=_['merge']({},_0x54aac9,_0x5edf20[_0x9a5d('0x51')]);return _0x2c2524[_0x9a5d('0x4f')](_0x54aac9);}})[_0x9a5d('0x23')](function(_0x2ef651){if(_0x2ef651){_0x559532=_0x2ef651[_0x9a5d('0x32')];if(!_0x5edf20['query'][_0x9a5d('0x33')](_0x9a5d('0x34'))){_0x54aac9[_0x9a5d('0x35')]=qs['limit'](_0x5edf20[_0x9a5d('0x2c')][_0x9a5d('0x35')]);_0x54aac9[_0x9a5d('0x1a')]=qs[_0x9a5d('0x1a')](_0x5edf20[_0x9a5d('0x2c')][_0x9a5d('0x1a')]);}return _0x2c2524['getContacts'](_0x54aac9);}})[_0x9a5d('0x23')](function(_0x12f5b3){if(_0x12f5b3){return _0x12f5b3?{'count':_0x559532,'rows':_0x12f5b3}:null;}})[_0x9a5d('0x23')](respondWithResult(_0xe826b,null))[_0x9a5d('0x40')](handleError(_0xe826b,null));};
\ No newline at end of file
+var _0x804f=['get','Companies','UserProfileResource','then','sendStatus','error','stack','name','send','index','CmCompany','describe','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','addContacts','ids','getContacts','findOne','CmContact','where','hasOwnProperty','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy'];(function(_0xfca425,_0x2950d6){var _0x44ea89=function(_0x5c0db6){while(--_0x5c0db6){_0xfca425['push'](_0xfca425['shift']());}};_0x44ea89(++_0x2950d6);}(_0x804f,0xe5));var _0xf804=function(_0xef55d2,_0x3dde91){_0xef55d2=_0xef55d2-0x0;var _0x355272=_0x804f[_0xef55d2];return _0x355272;};'use strict';var emlformat=require(_0xf804('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf804('0x1'));var jsonpatch=require(_0xf804('0x2'));var rp=require('request-promise');var moment=require(_0xf804('0x3'));var BPromise=require(_0xf804('0x4'));var Mustache=require(_0xf804('0x5'));var util=require('util');var path=require(_0xf804('0x6'));var sox=require(_0xf804('0x7'));var csv=require(_0xf804('0x8'));var ejs=require(_0xf804('0x9'));var fs=require('fs');var fs_extra=require(_0xf804('0xa'));var _=require('lodash');var squel=require(_0xf804('0xb'));var crypto=require(_0xf804('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf804('0xd'));var toCsv=require(_0xf804('0x8'));var querystring=require('querystring');var Papa=require(_0xf804('0xe'));var Redis=require(_0xf804('0xf'));var authService=require(_0xf804('0x10'));var qs=require(_0xf804('0x11'));var as=require(_0xf804('0x12'));var hardwareService=require(_0xf804('0x13'));var logger=require('../../config/logger')(_0xf804('0x14'));var utils=require(_0xf804('0x15'));var config=require(_0xf804('0x16'));var licenseUtil=require(_0xf804('0x17'));var db=require(_0xf804('0x18'))['db'];function respondWithStatusCode(_0xd723f9,_0x20cbcb){_0x20cbcb=_0x20cbcb||0xcc;return function(_0x1aa93b){if(_0x1aa93b){return _0xd723f9['sendStatus'](_0x20cbcb);}return _0xd723f9[_0xf804('0x19')](_0x20cbcb)[_0xf804('0x1a')]();};}function respondWithResult(_0x3d4fba,_0x3060cf){_0x3060cf=_0x3060cf||0xc8;return function(_0x69a31e){if(_0x69a31e){return _0x3d4fba[_0xf804('0x19')](_0x3060cf)[_0xf804('0x1b')](_0x69a31e);}};}function respondWithFilteredResult(_0x1d7092,_0x58b9bb){return function(_0x178939){if(_0x178939){var _0x5b7bf6=typeof _0x58b9bb[_0xf804('0x1c')]===_0xf804('0x1d')&&typeof _0x58b9bb[_0xf804('0x1e')]==='undefined';var _0x219fc=_0x178939[_0xf804('0x1f')];var _0x5294e9=_0x5b7bf6?0x0:_0x58b9bb['offset'];var _0x230544=_0x5b7bf6?_0x178939[_0xf804('0x1f')]:_0x58b9bb[_0xf804('0x1c')]+_0x58b9bb['limit'];var _0x8dbbd8;if(_0x230544>=_0x219fc){_0x230544=_0x219fc;_0x8dbbd8=0xc8;}else{_0x8dbbd8=0xce;}_0x1d7092['status'](_0x8dbbd8);return _0x1d7092[_0xf804('0x20')](_0xf804('0x21'),_0x5294e9+'-'+_0x230544+'/'+_0x219fc)[_0xf804('0x1b')](_0x178939);}return null;};}function patchUpdates(_0x40f3e6){return function(_0x12e304){try{jsonpatch[_0xf804('0x22')](_0x12e304,_0x40f3e6,!![]);}catch(_0x318f76){return BPromise[_0xf804('0x23')](_0x318f76);}return _0x12e304['save']();};}function saveUpdates(_0x36828d,_0x4682b8){return function(_0x8da672){if(_0x8da672){return _0x8da672[_0xf804('0x24')](_0x36828d)['then'](function(_0x4e70ca){return _0x4e70ca;});}return null;};}function removeEntity(_0x507df5,_0xbf371f){return function(_0x2c9aeb){if(_0x2c9aeb){return _0x2c9aeb[_0xf804('0x25')]()['then'](function(){var _0x100575=_0x2c9aeb[_0xf804('0x26')]({'plain':!![]});var _0x3a06ad=_0xf804('0x27');return db[_0xf804('0x28')]['destroy']({'where':{'type':_0x3a06ad,'resourceId':_0x100575['id']}})['then'](function(){return _0x2c9aeb;});})[_0xf804('0x29')](function(){_0x507df5[_0xf804('0x19')](0xcc)[_0xf804('0x1a')]();});}};}function handleEntityNotFound(_0x599cd7,_0x5f2131){return function(_0x2d0c6f){if(!_0x2d0c6f){_0x599cd7[_0xf804('0x2a')](0x194);}return _0x2d0c6f;};}function handleError(_0x4be56a,_0x272843){_0x272843=_0x272843||0x1f4;return function(_0x48dfea){logger[_0xf804('0x2b')](_0x48dfea[_0xf804('0x2c')]);if(_0x48dfea[_0xf804('0x2d')]){delete _0x48dfea['name'];}_0x4be56a[_0xf804('0x19')](_0x272843)[_0xf804('0x2e')](_0x48dfea);};}exports[_0xf804('0x2f')]=function(_0x493ef0,_0x16226d){var _0x159785={},_0xfbbc={},_0x3ed71f={'count':0x0,'rows':[]};return db[_0xf804('0x30')][_0xf804('0x31')]()['then'](function(_0x11a8ed){_0xfbbc[_0xf804('0x32')]=_['keys'](_0x11a8ed);_0xfbbc[_0xf804('0x33')]=_[_0xf804('0x34')](_0x493ef0[_0xf804('0x33')]);_0xfbbc[_0xf804('0x35')]=_['intersection'](_0xfbbc[_0xf804('0x32')],_0xfbbc[_0xf804('0x33')]);_0x159785[_0xf804('0x36')]=_[_0xf804('0x37')](_0xfbbc[_0xf804('0x32')],qs[_0xf804('0x38')](_0x493ef0['query'][_0xf804('0x38')]));_0x159785['attributes']=_0x159785[_0xf804('0x36')][_0xf804('0x39')]?_0x159785['attributes']:_0xfbbc[_0xf804('0x32')];if(!_0x493ef0[_0xf804('0x33')]['hasOwnProperty'](_0xf804('0x3a'))){_0x159785[_0xf804('0x1e')]=qs[_0xf804('0x1e')](_0x493ef0[_0xf804('0x33')][_0xf804('0x1e')]);_0x159785[_0xf804('0x1c')]=qs[_0xf804('0x1c')](_0x493ef0[_0xf804('0x33')][_0xf804('0x1c')]);}_0x159785[_0xf804('0x3b')]=qs[_0xf804('0x3c')](_0x493ef0[_0xf804('0x33')][_0xf804('0x3c')]);_0x159785['where']=qs[_0xf804('0x35')](_[_0xf804('0x3d')](_0x493ef0[_0xf804('0x33')],_0xfbbc['filters']),_0x11a8ed);if(_0x493ef0[_0xf804('0x33')][_0xf804('0x3e')]){_0x159785['where']=_[_0xf804('0x3f')](_0x159785['where'],{'$or':_[_0xf804('0x40')](_0x159785['attributes'],function(_0x512445){var _0x2f003b={};_0x2f003b[_0x512445]={'$like':'%'+_0x493ef0[_0xf804('0x33')]['filter']+'%'};return _0x2f003b;})});}_0x159785=_['merge']({},_0x159785,_0x493ef0[_0xf804('0x41')]);var _0xbd9b8b={'where':_0x159785['where']};return db[_0xf804('0x30')][_0xf804('0x1f')](_0xbd9b8b)['then'](function(_0x1a89c1){_0x3ed71f['count']=_0x1a89c1;if(_0x493ef0[_0xf804('0x33')][_0xf804('0x42')]){_0x159785[_0xf804('0x43')]=[{'all':!![]}];}return db[_0xf804('0x30')][_0xf804('0x44')](_0x159785);})[_0xf804('0x29')](function(_0x3fb6f1){_0x3ed71f[_0xf804('0x45')]=_0x3fb6f1;return _0x3ed71f;})['then'](respondWithFilteredResult(_0x16226d,_0x159785))['catch'](handleError(_0x16226d,null));})[_0xf804('0x46')](handleError(_0x16226d,null));};exports[_0xf804('0x47')]=function(_0x164869,_0x4dde93){var _0x9750d={'raw':![],'where':{'id':_0x164869[_0xf804('0x48')]['id']}},_0x5c4972={};_0x5c4972['model']=_[_0xf804('0x34')](db[_0xf804('0x30')][_0xf804('0x49')]);_0x5c4972['query']=_[_0xf804('0x34')](_0x164869[_0xf804('0x33')]);_0x5c4972[_0xf804('0x35')]=_[_0xf804('0x37')](_0x5c4972[_0xf804('0x32')],_0x5c4972[_0xf804('0x33')]);_0x9750d['attributes']=_[_0xf804('0x37')](_0x5c4972[_0xf804('0x32')],qs[_0xf804('0x38')](_0x164869[_0xf804('0x33')]['fields']));_0x9750d[_0xf804('0x36')]=_0x9750d['attributes'][_0xf804('0x39')]?_0x9750d[_0xf804('0x36')]:_0x5c4972['model'];if(_0x164869[_0xf804('0x33')][_0xf804('0x42')]){_0x9750d['include']=[{'all':!![]}];}_0x9750d=_[_0xf804('0x3f')]({},_0x9750d,_0x164869['options']);return db[_0xf804('0x30')]['find'](_0x9750d)[_0xf804('0x29')](handleEntityNotFound(_0x4dde93,null))[_0xf804('0x29')](respondWithResult(_0x4dde93,null))[_0xf804('0x46')](handleError(_0x4dde93,null));};exports[_0xf804('0x4a')]=function(_0xb5b4e5,_0x521634){return db[_0xf804('0x30')][_0xf804('0x4a')](_0xb5b4e5[_0xf804('0x4b')],{})['then'](function(_0x47357d){var _0x2588de=_0xb5b4e5[_0xf804('0x4c')][_0xf804('0x26')]({'plain':!![]});if(!_0x2588de)throw new Error(_0xf804('0x4d'));if(_0x2588de[_0xf804('0x4e')]===_0xf804('0x4c')){var _0x2eaf3c=_0x47357d[_0xf804('0x26')]({'plain':!![]});var _0x13a84f=_0xf804('0x27');return db[_0xf804('0x4f')][_0xf804('0x50')]({'where':{'name':_0x13a84f,'userProfileId':_0x2588de['userProfileId']},'raw':!![]})[_0xf804('0x29')](function(_0x5ef6c8){if(_0x5ef6c8&&_0x5ef6c8[_0xf804('0x51')]===0x0){return db[_0xf804('0x28')][_0xf804('0x4a')]({'name':_0x2eaf3c['name'],'resourceId':_0x2eaf3c['id'],'type':_0x5ef6c8[_0xf804('0x2d')],'sectionId':_0x5ef6c8['id']},{})[_0xf804('0x29')](function(){return _0x47357d;});}else{return _0x47357d;}})[_0xf804('0x46')](function(_0x13ce8f){logger[_0xf804('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13ce8f);throw _0x13ce8f;});}return _0x47357d;})[_0xf804('0x29')](respondWithResult(_0x521634,0xc9))[_0xf804('0x46')](handleError(_0x521634,null));};exports[_0xf804('0x24')]=function(_0x2dfc6b,_0x5c35b5){if(_0x2dfc6b[_0xf804('0x4b')]['id']){delete _0x2dfc6b[_0xf804('0x4b')]['id'];}return db[_0xf804('0x30')][_0xf804('0x50')]({'where':{'id':_0x2dfc6b[_0xf804('0x48')]['id']}})['then'](handleEntityNotFound(_0x5c35b5,null))['then'](saveUpdates(_0x2dfc6b[_0xf804('0x4b')],null))['then'](respondWithResult(_0x5c35b5,null))[_0xf804('0x46')](handleError(_0x5c35b5,null));};exports[_0xf804('0x25')]=function(_0x1470cd,_0x1ca086){return db[_0xf804('0x30')]['find']({'where':{'id':_0x1470cd[_0xf804('0x48')]['id']}})[_0xf804('0x29')](handleEntityNotFound(_0x1ca086,null))['then'](removeEntity(_0x1ca086,null))[_0xf804('0x46')](handleError(_0x1ca086,null));};exports['describe']=function(_0x2a2596,_0x3826a5){return db[_0xf804('0x30')][_0xf804('0x31')]()[_0xf804('0x29')](respondWithResult(_0x3826a5,null))[_0xf804('0x46')](handleError(_0x3826a5,null));};exports[_0xf804('0x52')]=function(_0x4ea719,_0x39ccb3,_0x165d98){return db['CmContact'][_0xf804('0x50')]({'where':{'id':_0x4ea719['params']['id']}})[_0xf804('0x29')](handleEntityNotFound(_0x39ccb3,null))[_0xf804('0x29')](function(_0x17f57c){if(_0x17f57c){return _0x17f57c['addContacts'](_0x4ea719[_0xf804('0x4b')][_0xf804('0x53')],_['omit'](_0x4ea719[_0xf804('0x4b')],[_0xf804('0x53'),'id'])||{});}})[_0xf804('0x29')](respondWithResult(_0x39ccb3,null))['catch'](handleError(_0x39ccb3,null));};exports[_0xf804('0x54')]=function(_0x1663b0,_0x7d9cae,_0x1f5db6){var _0x9921e2={};var _0x4c262b={};var _0x200df9;var _0x5ecdd3;return db[_0xf804('0x30')][_0xf804('0x55')]({'where':{'id':_0x1663b0[_0xf804('0x48')]['id']}})[_0xf804('0x29')](handleEntityNotFound(_0x7d9cae,null))[_0xf804('0x29')](function(_0x5bb704){if(_0x5bb704){_0x200df9=_0x5bb704;_0x4c262b[_0xf804('0x32')]=_[_0xf804('0x34')](db[_0xf804('0x56')][_0xf804('0x49')]);_0x4c262b[_0xf804('0x33')]=_[_0xf804('0x34')](_0x1663b0[_0xf804('0x33')]);_0x4c262b['filters']=_[_0xf804('0x37')](_0x4c262b['model'],_0x4c262b[_0xf804('0x33')]);_0x9921e2[_0xf804('0x36')]=_[_0xf804('0x37')](_0x4c262b[_0xf804('0x32')],qs[_0xf804('0x38')](_0x1663b0['query'][_0xf804('0x38')]));_0x9921e2[_0xf804('0x36')]=_0x9921e2[_0xf804('0x36')][_0xf804('0x39')]?_0x9921e2[_0xf804('0x36')]:_0x4c262b[_0xf804('0x32')];_0x9921e2[_0xf804('0x3b')]=qs[_0xf804('0x3c')](_0x1663b0[_0xf804('0x33')][_0xf804('0x3c')]);_0x9921e2[_0xf804('0x57')]=qs[_0xf804('0x35')](_[_0xf804('0x3d')](_0x1663b0[_0xf804('0x33')],_0x4c262b[_0xf804('0x35')]));if(_0x1663b0[_0xf804('0x33')]['filter']){_0x9921e2[_0xf804('0x57')]=_[_0xf804('0x3f')](_0x9921e2['where'],{'$or':_[_0xf804('0x40')](_0x9921e2['attributes'],function(_0x56d189){var _0x31c203={};_0x31c203[_0x56d189]={'$like':'%'+_0x1663b0[_0xf804('0x33')][_0xf804('0x3e')]+'%'};return _0x31c203;})});}_0x9921e2=_[_0xf804('0x3f')]({},_0x9921e2,_0x1663b0[_0xf804('0x41')]);return _0x200df9[_0xf804('0x54')](_0x9921e2);}})[_0xf804('0x29')](function(_0x5d5b68){if(_0x5d5b68){_0x5ecdd3=_0x5d5b68['length'];if(!_0x1663b0[_0xf804('0x33')][_0xf804('0x58')](_0xf804('0x3a'))){_0x9921e2[_0xf804('0x1e')]=qs[_0xf804('0x1e')](_0x1663b0[_0xf804('0x33')][_0xf804('0x1e')]);_0x9921e2['offset']=qs[_0xf804('0x1c')](_0x1663b0[_0xf804('0x33')]['offset']);}return _0x200df9['getContacts'](_0x9921e2);}})[_0xf804('0x29')](function(_0x34782e){if(_0x34782e){return _0x34782e?{'count':_0x5ecdd3,'rows':_0x34782e}:null;}})['then'](respondWithResult(_0x7d9cae,null))[_0xf804('0x46')](handleError(_0x7d9cae,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index b260814..75730be 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 _0x82f0=['moment','bluebird','request-promise','path','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','api'];(function(_0xd71a75,_0x51afd3){var _0x278bf9=function(_0x586b78){while(--_0x586b78){_0xd71a75['push'](_0xd71a75['shift']());}};_0x278bf9(++_0x51afd3);}(_0x82f0,0x136));var _0x082f=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x82f0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x082f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x082f('0x1'));var moment=require(_0x082f('0x2'));var BPromise=require(_0x082f('0x3'));var rp=require(_0x082f('0x4'));var fs=require('fs');var path=require(_0x082f('0x5'));var rimraf=require(_0x082f('0x6'));var config=require('../../config/environment');var attributes=require(_0x082f('0x7'));module[_0x082f('0x8')]=function(_0x22766c,_0x17387c){return _0x22766c[_0x082f('0x9')](_0x082f('0xa'),attributes,{'tableName':_0x082f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3691=['path','rimraf','./cmCompany.attributes','exports','define','CmCompany','lodash','util','moment','bluebird'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x3691,0x1d2));var _0x1369=function(_0x43da4a,_0x4d9ec1){_0x43da4a=_0x43da4a-0x0;var _0x12b578=_0x3691[_0x43da4a];return _0x12b578;};'use strict';var _=require(_0x1369('0x0'));var util=require(_0x1369('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1369('0x2'));var BPromise=require(_0x1369('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1369('0x4'));var rimraf=require(_0x1369('0x5'));var config=require('../../config/environment');var attributes=require(_0x1369('0x6'));module[_0x1369('0x7')]=function(_0x735f28,_0x14e25b){return _0x735f28[_0x1369('0x8')](_0x1369('0x9'),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 39b9200..6365b89 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 _0x77c1=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0xb124ea,_0x362974){var _0x16ec9e=function(_0x4793d9){while(--_0x4793d9){_0xb124ea['push'](_0xb124ea['shift']());}};_0x16ec9e(++_0x362974);}(_0x77c1,0xbd));var _0x177c=function(_0x30adcd,_0x39e60d){_0x30adcd=_0x30adcd-0x0;var _0x2d08c1=_0x77c1[_0x30adcd];return _0x2d08c1;};'use strict';var _=require(_0x177c('0x0'));var util=require(_0x177c('0x1'));var moment=require(_0x177c('0x2'));var BPromise=require(_0x177c('0x3'));var rs=require(_0x177c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x177c('0x5'));var logger=require(_0x177c('0x6'))(_0x177c('0x7'));var config=require(_0x177c('0x8'));var jayson=require(_0x177c('0x9'));var client=jayson[_0x177c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a0345,_0x17043a,_0x4e78f6){return new BPromise(function(_0x3a13a4,_0x9c675c){return client['request'](_0x1a0345,_0x4e78f6)[_0x177c('0xb')](function(_0x1a5c2d){logger[_0x177c('0xc')](_0x177c('0xd'),_0x17043a,_0x177c('0xe'));logger[_0x177c('0xf')](_0x177c('0x10'),_0x17043a,'request\x20sent',JSON['stringify'](_0x1a5c2d));if(_0x1a5c2d[_0x177c('0x11')]){if(_0x1a5c2d['error'][_0x177c('0x12')]===0x1f4){logger[_0x177c('0x11')](_0x177c('0xd'),_0x17043a,_0x1a5c2d[_0x177c('0x11')][_0x177c('0x13')]);return _0x9c675c(_0x1a5c2d[_0x177c('0x11')]['message']);}logger[_0x177c('0x11')](_0x177c('0xd'),_0x17043a,_0x1a5c2d[_0x177c('0x11')][_0x177c('0x13')]);return _0x3a13a4(_0x1a5c2d[_0x177c('0x11')]['message']);}else{logger[_0x177c('0xc')]('CmCompany,\x20%s,\x20%s',_0x17043a,_0x177c('0xe'));_0x3a13a4(_0x1a5c2d[_0x177c('0x14')]['message']);}})['catch'](function(_0x24d965){logger[_0x177c('0x11')](_0x177c('0xd'),_0x17043a,_0x24d965);_0x9c675c(_0x24d965);});});}
\ No newline at end of file
+var _0x1753=['info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x2fcec4,_0x4f816b){var _0x23381c=function(_0x4ee0e9){while(--_0x4ee0e9){_0x2fcec4['push'](_0x2fcec4['shift']());}};_0x23381c(++_0x4f816b);}(_0x1753,0x71));var _0x3175=function(_0x1ca6f4,_0x498aad){_0x1ca6f4=_0x1ca6f4-0x0;var _0xeddabe=_0x1753[_0x1ca6f4];return _0xeddabe;};'use strict';var _=require(_0x3175('0x0'));var util=require(_0x3175('0x1'));var moment=require('moment');var BPromise=require(_0x3175('0x2'));var rs=require(_0x3175('0x3'));var fs=require('fs');var Redis=require(_0x3175('0x4'));var db=require(_0x3175('0x5'))['db'];var utils=require(_0x3175('0x6'));var logger=require(_0x3175('0x7'))(_0x3175('0x8'));var config=require('../../config/environment');var jayson=require(_0x3175('0x9'));var client=jayson[_0x3175('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x571a10,_0x441555,_0xc01269){return new BPromise(function(_0x956d68,_0x5f4340){return client[_0x3175('0xb')](_0x571a10,_0xc01269)[_0x3175('0xc')](function(_0x30fa00){logger[_0x3175('0xd')](_0x3175('0xe'),_0x441555,'request\x20sent');logger[_0x3175('0xf')](_0x3175('0x10'),_0x441555,_0x3175('0x11'),JSON[_0x3175('0x12')](_0x30fa00));if(_0x30fa00[_0x3175('0x13')]){if(_0x30fa00[_0x3175('0x13')]['code']===0x1f4){logger[_0x3175('0x13')](_0x3175('0xe'),_0x441555,_0x30fa00[_0x3175('0x13')][_0x3175('0x14')]);return _0x5f4340(_0x30fa00[_0x3175('0x13')][_0x3175('0x14')]);}logger[_0x3175('0x13')](_0x3175('0xe'),_0x441555,_0x30fa00['error'][_0x3175('0x14')]);return _0x956d68(_0x30fa00['error'][_0x3175('0x14')]);}else{logger['info'](_0x3175('0xe'),_0x441555,_0x3175('0x11'));_0x956d68(_0x30fa00['result'][_0x3175('0x14')]);}})['catch'](function(_0x5c8a5a){logger['error'](_0x3175('0xe'),_0x441555,_0x5c8a5a);_0x5f4340(_0x5c8a5a);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index c46de3f..a7e3e98 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 _0xcc97=['update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','/describe','describe','get','show','/:id/contacts','post','create','addContacts','put','/:id'];(function(_0x96f3a3,_0x14ea73){var _0x5e0277=function(_0x14dac6){while(--_0x14dac6){_0x96f3a3['push'](_0x96f3a3['shift']());}};_0x5e0277(++_0x14ea73);}(_0xcc97,0x1b3));var _0x7cc9=function(_0x51b879,_0x5d0f5e){_0x51b879=_0x51b879-0x0;var _0x1ec20c=_0xcc97[_0x51b879];return _0x1ec20c;};'use strict';var multer=require(_0x7cc9('0x0'));var util=require(_0x7cc9('0x1'));var path=require('path');var timeout=require(_0x7cc9('0x2'));var express=require(_0x7cc9('0x3'));var router=express[_0x7cc9('0x4')]();var fs_extra=require(_0x7cc9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7cc9('0x6'));var config=require(_0x7cc9('0x7'));var controller=require(_0x7cc9('0x8'));router['get']('/',auth[_0x7cc9('0x9')](),controller[_0x7cc9('0xa')]);router['get'](_0x7cc9('0xb'),auth[_0x7cc9('0x9')](),controller[_0x7cc9('0xc')]);router[_0x7cc9('0xd')]('/:id',auth[_0x7cc9('0x9')](),controller[_0x7cc9('0xe')]);router[_0x7cc9('0xd')](_0x7cc9('0xf'),auth[_0x7cc9('0x9')](),controller['getContacts']);router[_0x7cc9('0x10')]('/',auth[_0x7cc9('0x9')](),controller[_0x7cc9('0x11')]);router['post'](_0x7cc9('0xf'),auth['isAuthenticated'](),controller[_0x7cc9('0x12')]);router[_0x7cc9('0x13')](_0x7cc9('0x14'),auth[_0x7cc9('0x9')](),controller[_0x7cc9('0x15')]);router['delete']('/:id',auth[_0x7cc9('0x9')](),controller[_0x7cc9('0x16')]);module[_0x7cc9('0x17')]=router;
\ No newline at end of file
+var _0xe7ba=['delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','post','create','/:id/contacts','addContacts','update'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xe7ba,0x1d1));var _0xae7b=function(_0xe1b111,_0x5661dc){_0xe1b111=_0xe1b111-0x0;var _0x339286=_0xe7ba[_0xe1b111];return _0x339286;};'use strict';var multer=require(_0xae7b('0x0'));var util=require(_0xae7b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xae7b('0x2'));var router=express['Router']();var fs_extra=require(_0xae7b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xae7b('0x4'));var config=require('../../config/environment');var controller=require(_0xae7b('0x5'));router[_0xae7b('0x6')]('/',auth[_0xae7b('0x7')](),controller[_0xae7b('0x8')]);router[_0xae7b('0x6')](_0xae7b('0x9'),auth['isAuthenticated'](),controller[_0xae7b('0xa')]);router[_0xae7b('0x6')](_0xae7b('0xb'),auth[_0xae7b('0x7')](),controller[_0xae7b('0xc')]);router['get']('/:id/contacts',auth[_0xae7b('0x7')](),controller[_0xae7b('0xd')]);router[_0xae7b('0xe')]('/',auth['isAuthenticated'](),controller[_0xae7b('0xf')]);router[_0xae7b('0xe')](_0xae7b('0x10'),auth[_0xae7b('0x7')](),controller[_0xae7b('0x11')]);router['put']('/:id',auth[_0xae7b('0x7')](),controller[_0xae7b('0x12')]);router[_0xae7b('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xae7b('0x14')]);module[_0xae7b('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index a49853f..d9df0a0 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 _0xbaf0=['DATE','NOW','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x26bab2,_0xc26979){var _0xde48cf=function(_0x3b8073){while(--_0x3b8073){_0x26bab2['push'](_0x26bab2['shift']());}};_0xde48cf(++_0xc26979);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var Sequelize=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'firstName':{'type':Sequelize[_0x0baf('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0baf('0x2')]},'street':{'type':Sequelize[_0x0baf('0x2')]},'postalCode':{'type':Sequelize[_0x0baf('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0baf('0x2')]},'dateOfBirth':{'type':Sequelize[_0x0baf('0x2')]},'description':{'type':Sequelize[_0x0baf('0x3')]},'phone':{'type':Sequelize[_0x0baf('0x2')]},'mobile':{'type':Sequelize[_0x0baf('0x2')]},'fax':{'type':Sequelize[_0x0baf('0x2')]},'email':{'type':Sequelize[_0x0baf('0x2')]},'url':{'type':Sequelize[_0x0baf('0x2')]},'facebook':{'type':Sequelize[_0x0baf('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x0baf('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x0baf('0x2')]},'viber':{'type':Sequelize[_0x0baf('0x2')]},'line':{'type':Sequelize[_0x0baf('0x2')]},'wechat':{'type':Sequelize[_0x0baf('0x2')]},'telegram':{'type':Sequelize[_0x0baf('0x2')]},'UserId':{'type':Sequelize[_0x0baf('0x4')]},'priority':{'type':Sequelize[_0x0baf('0x4')](0x2)[_0x0baf('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0baf('0x6')],'defaultValue':Sequelize[_0x0baf('0x7')]},'dialTimezone':{'type':Sequelize[_0x0baf('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xb7e7=['NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xb7e7[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0x7b7e('0x0'));var Sequelize=require('sequelize');module[_0x7b7e('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x7b7e('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x7b7e('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x7b7e('0x2')]},'dateOfBirth':{'type':Sequelize[_0x7b7e('0x2')]},'description':{'type':Sequelize[_0x7b7e('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x7b7e('0x2')]},'email':{'type':Sequelize[_0x7b7e('0x2')]},'url':{'type':Sequelize[_0x7b7e('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x7b7e('0x2')]},'twitter':{'type':Sequelize[_0x7b7e('0x2')]},'skype':{'type':Sequelize[_0x7b7e('0x2')]},'teams':{'type':Sequelize[_0x7b7e('0x2')]},'viber':{'type':Sequelize[_0x7b7e('0x2')]},'line':{'type':Sequelize[_0x7b7e('0x2')]},'wechat':{'type':Sequelize[_0x7b7e('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x7b7e('0x4')]},'priority':{'type':Sequelize[_0x7b7e('0x4')](0x2)[_0x7b7e('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7b7e('0x6')],'defaultValue':Sequelize[_0x7b7e('0x7')]},'dialTimezone':{'type':Sequelize[_0x7b7e('0x2')]},'utcOffset':{'type':Sequelize[_0x7b7e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 7ec71e0..d883b7b 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 _0xf411=['TagIds','Tags','rows','catch','find','params','tags','analytics','CmCustomField','findAll','columnName','displayName','values','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','destroy','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','ReportAgentPreview','ChatQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','dialTimezone','timezones','utcOffset','bulkCreate','duplicates','$or','findOrCreate','spread','show','Tag','$and','format','cf_%d','omit','pickBy','table','setFields','id\x20=\x20?','toParam','text','phone','getTags','findOne','rawAttributes','pick','options','setTags','ids','getHoppers','nolimit','includeAll','getHopperHistories','CmHopperHistory','include','getHopperFinals','ContactId','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','0777','child_process','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','parse','meta','fork','../../components/import/cm/csv2','stringify','message','exit','getJourney','mail','chat','sms','fax','voice','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','note','createdAt','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Account','closed','closedAt','secondDisposition','thirdDisposition','Owner','browserName','customerPort','deviceModel','osName','ratingMessage','referer','subject','substatus','openchannel','threadId','Interaction','flatten','sortBy','slice','moment','bluebird','util','path','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','update','then','end','sendStatus','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','trimStart','all','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','select','field','color','tools_tags','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','where','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','value','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','dateOfBirth','datetime','DATE','start','isNil','Contact','isEmpty','forEach','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','filter','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','clone','having','t.id\x20IN\x20?','resolve','user','role','some','getLists','c.ListId\x20IS\x20NULL','agent','ListId','sequelize','toString','merge','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf411,0xa0));var _0x1f41=function(_0x327e23,_0x22dd8c){_0x327e23=_0x327e23-0x0;var _0x4e9b6d=_0xf411[_0x327e23];return _0x4e9b6d;};'use strict';var moment=require(_0x1f41('0x0'));var BPromise=require(_0x1f41('0x1'));var util=require(_0x1f41('0x2'));var path=require(_0x1f41('0x3'));var fs=require('fs');var _=require(_0x1f41('0x4'));var squel=require(_0x1f41('0x5'));var Papa=require('papaparse');var Redis=require(_0x1f41('0x6'));var qs=require(_0x1f41('0x7'));var as=require(_0x1f41('0x8'));var logger=require('../../config/logger')(_0x1f41('0x9'));var config=require('../../config/environment');var shared=require(_0x1f41('0xa'));var db=require('../../mysqldb')['db'];config[_0x1f41('0xb')]=_[_0x1f41('0xc')](config[_0x1f41('0xb')],{'host':_0x1f41('0xd'),'port':0x18eb});var socket=require(_0x1f41('0xe'))(new Redis(config[_0x1f41('0xb')]));require(_0x1f41('0xf'))[_0x1f41('0x10')](socket);function respondWithResult(_0x28ecaf,_0x1e3018){_0x1e3018=_0x1e3018||0xc8;return function(_0x1f929e){if(_0x1f929e){return _0x28ecaf[_0x1f41('0x11')](_0x1e3018)[_0x1f41('0x12')](_0x1f929e);}};}function respondWithFilteredResult(_0x297612,_0x371cc5){return function(_0x580355){if(_0x580355){var _0x46debd=typeof _0x371cc5[_0x1f41('0x13')]===_0x1f41('0x14')&&typeof _0x371cc5[_0x1f41('0x15')]===_0x1f41('0x14');var _0x9f45ff=_0x580355[_0x1f41('0x16')];var _0x42cea6=_0x46debd?0x0:_0x371cc5['offset'];var _0x449b96=_0x46debd?_0x580355[_0x1f41('0x16')]:_0x371cc5['offset']+_0x371cc5['limit'];var _0x54a44a;if(_0x449b96>=_0x9f45ff){_0x449b96=_0x9f45ff;_0x54a44a=0xc8;}else{_0x54a44a=0xce;}_0x297612[_0x1f41('0x11')](_0x54a44a);return _0x297612[_0x1f41('0x17')]('Content-Range',_0x42cea6+'-'+_0x449b96+'/'+_0x9f45ff)[_0x1f41('0x12')](_0x580355);}return null;};}function saveUpdates(_0x2036d4){return function(_0x258965){if(_0x258965){return _0x258965[_0x1f41('0x18')](_0x2036d4)[_0x1f41('0x19')](function(_0x172c78){return _0x172c78;});}return null;};}function removeEntity(_0x3186dd){return function(_0x5716eb){if(_0x5716eb){return _0x5716eb['destroy']()[_0x1f41('0x19')](function(){_0x3186dd[_0x1f41('0x11')](0xcc)[_0x1f41('0x1a')]();});}};}function handleEntityNotFound(_0x2b7c2d){return function(_0x5362ce){if(!_0x5362ce){_0x2b7c2d[_0x1f41('0x1b')](0x194);}return _0x5362ce;};}function handleError(_0x44af44,_0x44f116){_0x44f116=_0x44f116||0x1f4;return function(_0x4884af){logger[_0x1f41('0x1c')](_0x4884af[_0x1f41('0x1d')]);if(_0x4884af[_0x1f41('0x1e')]){delete _0x4884af[_0x1f41('0x1e')];}_0x44af44['status'](_0x44f116)[_0x1f41('0x1f')](_0x4884af);};}exports[_0x1f41('0x20')]=function(_0x5df932,_0x54f98a){var _0x48633a={},_0x3f7733={},_0xec81fe={'count':0x0,'rows':[]};return db[_0x1f41('0x21')][_0x1f41('0x22')]()[_0x1f41('0x19')](function(_0x12e4d3){var _0x5ba912=[];for(var _0x1aa5ce=0x0;_0x1aa5ce
','Attachments','Title','Data','generateXOAuth2Token','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','generate','@xcally.com','value','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','html','test','replace','0x1?_0x336c2b[_0xab28('0x13')](0x0,-0x1)[_0xab28('0x14')]('\x20'):_0x142579[_0xab28('0xe')];}return _0xab28('0x15');}function getLastName(_0x2996e9){var _0x1939b0=_['head'](_0x2996e9[_0xab28('0xd')]);if(_0x1939b0&&_0x1939b0[_0xab28('0xe')]){var _0x4bce8e=_0x1939b0[_0xab28('0xe')][_0xab28('0x11')](/\s+/);return _0x4bce8e[_0xab28('0x12')]>0x1?_0x4bce8e[_0xab28('0x16')]():'';}return'';}function getMails(_0x54d2f9,_0x35ce96){var _0x41bf6c='';for(var _0x1fed3b=0x0;_0x1fed3b<_0x35ce96['value'][_0xab28('0x12')];_0x1fed3b+=0x1){if(_0x35ce96[_0xab28('0xd')][_0x1fed3b][_0xab28('0xa')]!==_0x54d2f9){if(!_[_0xab28('0x17')](_0x41bf6c)){_0x41bf6c+=',';}_0x41bf6c+=_0x35ce96[_0xab28('0xd')][_0x1fed3b][_0xab28('0xe')]||_0x35ce96[_0xab28('0xd')][_0x1fed3b][_0xab28('0xa')]||'';_0x41bf6c+='\x20<';_0x41bf6c+=_0x35ce96['value'][_0x1fed3b][_0xab28('0xa')]?_0x35ce96[_0xab28('0xd')][_0x1fed3b][_0xab28('0xa')]:'anonymous'+random[_0xab28('0xb')](0x6)+_0xab28('0xc');_0x41bf6c+='>';}}return _0x41bf6c;}function parseEmail(_0x23cded,_0x2e6a24,_0x26097f){if(_0x2e6a24[_0xab28('0x18')]){var _0x522e94=/