From: Andrea Amorese
Date: Thu, 4 Nov 2021 16:07:42 +0000 (+0100)
Subject: Built motion from commit b31e0cc2.|2.5.37
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png//%22%27?a=commitdiff_plain;h=3511b88b71c1a571a54867c057c4452ad17f7d43;p=motion2.git
Built motion from commit b31e0cc2.|2.5.37
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 3b04a21..00a2c65 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-04T15:48:49.362Z",
+ "time": "2021-11-04T15:58:39.573Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 28a7a78..4132b1e 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-04T15:48:49.362Z",
+ "time": "2021-11-04T15:58:39.573Z",
"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 87ce64d..9588a54 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 _0x08a9=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','exports','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','script','STRING','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)]'];(function(_0x4bea95,_0x2026cb){var _0x52aa29=function(_0x333759){while(--_0x333759){_0x4bea95['push'](_0x4bea95['shift']());}};_0x52aa29(++_0x2026cb);}(_0x08a9,0x147));var _0x908a=function(_0x673722,_0x275d7e){_0x673722=_0x673722-0x0;var _0x21249c=_0x08a9[_0x673722];return _0x21249c;};'use strict';var Sequelize=require('sequelize');module[_0x908a('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x39774b){return this[_0x908a('0x1')](_0x908a('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x908a('0x3'),_0x908a('0x4'),_0x908a('0x5'),_0x908a('0x6'),_0x908a('0x7'),_0x908a('0x8'),'bot',_0x908a('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x908a('0xa')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x908a('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x908a('0xc')},'data4':{'type':Sequelize[_0x908a('0xa')](0x1000),'comments':_0x908a('0xd')},'data5':{'type':Sequelize[_0x908a('0xa')](0x1000),'comments':_0x908a('0xe')},'data6':{'type':Sequelize[_0x908a('0xa')],'comments':_0x908a('0xf')},'data7':{'type':Sequelize[_0x908a('0x10')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xa61b=['getDataValue','action','STRING','contactManager','integration','motionbar','urlForward','browser','bot','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)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','sequelize','exports','VIRTUAL'];(function(_0xc8069a,_0x2968fc){var _0x16bc69=function(_0x4e8a44){while(--_0x4e8a44){_0xc8069a['push'](_0xc8069a['shift']());}};_0x16bc69(++_0x2968fc);}(_0xa61b,0x7b));var _0xba61=function(_0x2d4664,_0xe3a407){_0x2d4664=_0x2d4664-0x0;var _0x1360e8=_0xa61b[_0x2d4664];return _0x1360e8;};'use strict';var Sequelize=require(_0xba61('0x0'));module[_0xba61('0x1')]={'name':{'type':Sequelize[_0xba61('0x2')],'get':function(_0x376527){return this[_0xba61('0x3')](_0xba61('0x4'));}},'action':{'type':Sequelize[_0xba61('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xba61('0x6'),_0xba61('0x7'),_0xba61('0x8'),'jscripty',_0xba61('0x9'),_0xba61('0xa'),_0xba61('0xb'),'script']],'msg':_0xba61('0xc')}},'comment':_0xba61('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xba61('0xd')},'data2':{'type':Sequelize[_0xba61('0x5')](0x1000),'comment':_0xba61('0xe')},'data3':{'type':Sequelize[_0xba61('0x5')](0x1000),'comment':_0xba61('0xf')},'data4':{'type':Sequelize[_0xba61('0x5')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xba61('0x5')](0x1000),'comments':_0xba61('0x10')},'data6':{'type':Sequelize[_0xba61('0x5')],'comments':_0xba61('0x11')},'data7':{'type':Sequelize['TEXT'],'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 8426c4e..5e06c1d 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 _0xccde=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','error','stack','name','body','Action','find','params','catch','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xccde,0x83));var _0xeccd=function(_0x2731f0,_0x126b1b){_0x2731f0=_0x2731f0-0x0;var _0x36a180=_0xccde[_0x2731f0];return _0x36a180;};'use strict';var emlformat=require(_0xeccd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeccd('0x1'));var rp=require(_0xeccd('0x2'));var moment=require(_0xeccd('0x3'));var BPromise=require(_0xeccd('0x4'));var Mustache=require(_0xeccd('0x5'));var util=require(_0xeccd('0x6'));var path=require(_0xeccd('0x7'));var sox=require(_0xeccd('0x8'));var csv=require(_0xeccd('0x9'));var ejs=require(_0xeccd('0xa'));var fs=require('fs');var fs_extra=require(_0xeccd('0xb'));var _=require(_0xeccd('0xc'));var squel=require('squel');var crypto=require(_0xeccd('0xd'));var jsforce=require(_0xeccd('0xe'));var deskjs=require(_0xeccd('0xf'));var toCsv=require(_0xeccd('0x9'));var querystring=require(_0xeccd('0x10'));var Papa=require(_0xeccd('0x11'));var Redis=require(_0xeccd('0x12'));var authService=require(_0xeccd('0x13'));var qs=require(_0xeccd('0x14'));var as=require(_0xeccd('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeccd('0x16'))(_0xeccd('0x17'));var utils=require(_0xeccd('0x18'));var config=require(_0xeccd('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x293712,_0x20cd4e){_0x20cd4e=_0x20cd4e||0xcc;return function(_0x1bc2e8){if(_0x1bc2e8){return _0x293712[_0xeccd('0x1a')](_0x20cd4e);}return _0x293712[_0xeccd('0x1b')](_0x20cd4e)[_0xeccd('0x1c')]();};}function respondWithResult(_0x5c039d,_0x258beb){_0x258beb=_0x258beb||0xc8;return function(_0x59778c){if(_0x59778c){return _0x5c039d['status'](_0x258beb)['json'](_0x59778c);}};}function respondWithFilteredResult(_0x54909c,_0x31e630){return function(_0x4c904b){if(_0x4c904b){var _0x355fc9=typeof _0x31e630['offset']===_0xeccd('0x1d')&&typeof _0x31e630[_0xeccd('0x1e')]==='undefined';var _0x4cb0d9=_0x4c904b['count'];var _0x222ad8=_0x355fc9?0x0:_0x31e630[_0xeccd('0x1f')];var _0x3af8b6=_0x355fc9?_0x4c904b[_0xeccd('0x20')]:_0x31e630[_0xeccd('0x1f')]+_0x31e630[_0xeccd('0x1e')];var _0x5e6ca2;if(_0x3af8b6>=_0x4cb0d9){_0x3af8b6=_0x4cb0d9;_0x5e6ca2=0xc8;}else{_0x5e6ca2=0xce;}_0x54909c[_0xeccd('0x1b')](_0x5e6ca2);return _0x54909c[_0xeccd('0x21')](_0xeccd('0x22'),_0x222ad8+'-'+_0x3af8b6+'/'+_0x4cb0d9)['json'](_0x4c904b);}return null;};}function patchUpdates(_0x4f4255){return function(_0x5f1da2){try{jsonpatch[_0xeccd('0x23')](_0x5f1da2,_0x4f4255,!![]);}catch(_0x407613){return BPromise[_0xeccd('0x24')](_0x407613);}return _0x5f1da2['save']();};}function saveUpdates(_0x16009d,_0x4e3a0e){return function(_0x38ef5b){if(_0x38ef5b){return _0x38ef5b[_0xeccd('0x25')](_0x16009d)['then'](function(_0x406745){return _0x406745;});}return null;};}function removeEntity(_0x3b5267,_0x58fc14){return function(_0x2a1237){if(_0x2a1237){return _0x2a1237['destroy']()[_0xeccd('0x26')](function(){_0x3b5267[_0xeccd('0x1b')](0xcc)[_0xeccd('0x1c')]();});}};}function handleEntityNotFound(_0x177dcd,_0x4ce11e){return function(_0x258d84){if(!_0x258d84){_0x177dcd[_0xeccd('0x1a')](0x194);}return _0x258d84;};}function handleError(_0x290ace,_0x251447){_0x251447=_0x251447||0x1f4;return function(_0x57941d){logger[_0xeccd('0x27')](_0x57941d[_0xeccd('0x28')]);if(_0x57941d[_0xeccd('0x29')]){delete _0x57941d['name'];}_0x290ace[_0xeccd('0x1b')](_0x251447)['send'](_0x57941d);};}exports[_0xeccd('0x25')]=function(_0x2f934e,_0x2e59f3){if(_0x2f934e['body']['id']){delete _0x2f934e[_0xeccd('0x2a')]['id'];}return db[_0xeccd('0x2b')][_0xeccd('0x2c')]({'where':{'id':_0x2f934e['params']['id']}})[_0xeccd('0x26')](handleEntityNotFound(_0x2e59f3,null))['then'](saveUpdates(_0x2f934e[_0xeccd('0x2a')],null))[_0xeccd('0x26')](respondWithResult(_0x2e59f3,null))['catch'](handleError(_0x2e59f3,null));};exports['destroy']=function(_0x49f8a1,_0x6b542d){return db['Action'][_0xeccd('0x2c')]({'where':{'id':_0x49f8a1[_0xeccd('0x2d')]['id']}})[_0xeccd('0x26')](handleEntityNotFound(_0x6b542d,null))[_0xeccd('0x26')](removeEntity(_0x6b542d,null))[_0xeccd('0x2e')](handleError(_0x6b542d,null));};
\ No newline at end of file
+var _0xacc0=['lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','offset','status','apply','reject','save','update','then','stack','name','body','Action','find','catch','destroy','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xacc0,0x1c1));var _0x0acc=function(_0x458c0d,_0x4d6aa1){_0x458c0d=_0x458c0d-0x0;var _0x151ccc=_0xacc0[_0x458c0d];return _0x151ccc;};'use strict';var emlformat=require(_0x0acc('0x0'));var rimraf=require(_0x0acc('0x1'));var zipdir=require(_0x0acc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0acc('0x3'));var moment=require(_0x0acc('0x4'));var BPromise=require(_0x0acc('0x5'));var Mustache=require(_0x0acc('0x6'));var util=require(_0x0acc('0x7'));var path=require(_0x0acc('0x8'));var sox=require(_0x0acc('0x9'));var csv=require(_0x0acc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0acc('0xb'));var squel=require(_0x0acc('0xc'));var crypto=require(_0x0acc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0acc('0xe'));var toCsv=require(_0x0acc('0xa'));var querystring=require(_0x0acc('0xf'));var Papa=require(_0x0acc('0x10'));var Redis=require(_0x0acc('0x11'));var authService=require(_0x0acc('0x12'));var qs=require(_0x0acc('0x13'));var as=require(_0x0acc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0acc('0x15'))(_0x0acc('0x16'));var utils=require('../../config/utils');var config=require(_0x0acc('0x17'));var licenseUtil=require(_0x0acc('0x18'));var db=require(_0x0acc('0x19'))['db'];function respondWithStatusCode(_0x10d966,_0x34602b){_0x34602b=_0x34602b||0xcc;return function(_0x3ce327){if(_0x3ce327){return _0x10d966[_0x0acc('0x1a')](_0x34602b);}return _0x10d966['status'](_0x34602b)[_0x0acc('0x1b')]();};}function respondWithResult(_0x2fd7ff,_0x5983da){_0x5983da=_0x5983da||0xc8;return function(_0x5bf9c8){if(_0x5bf9c8){return _0x2fd7ff['status'](_0x5983da)[_0x0acc('0x1c')](_0x5bf9c8);}};}function respondWithFilteredResult(_0x1e98a9,_0x2a5fa1){return function(_0x4fe84e){if(_0x4fe84e){var _0x1812c5=typeof _0x2a5fa1['offset']==='undefined'&&typeof _0x2a5fa1[_0x0acc('0x1d')]===_0x0acc('0x1e');var _0x4ca14c=_0x4fe84e['count'];var _0x1be9aa=_0x1812c5?0x0:_0x2a5fa1['offset'];var _0x332493=_0x1812c5?_0x4fe84e['count']:_0x2a5fa1[_0x0acc('0x1f')]+_0x2a5fa1[_0x0acc('0x1d')];var _0x1c6f40;if(_0x332493>=_0x4ca14c){_0x332493=_0x4ca14c;_0x1c6f40=0xc8;}else{_0x1c6f40=0xce;}_0x1e98a9[_0x0acc('0x20')](_0x1c6f40);return _0x1e98a9['set']('Content-Range',_0x1be9aa+'-'+_0x332493+'/'+_0x4ca14c)[_0x0acc('0x1c')](_0x4fe84e);}return null;};}function patchUpdates(_0x33eecf){return function(_0x55ef55){try{jsonpatch[_0x0acc('0x21')](_0x55ef55,_0x33eecf,!![]);}catch(_0x3522ee){return BPromise[_0x0acc('0x22')](_0x3522ee);}return _0x55ef55[_0x0acc('0x23')]();};}function saveUpdates(_0x2ba5ae,_0x144ff8){return function(_0x306fda){if(_0x306fda){return _0x306fda[_0x0acc('0x24')](_0x2ba5ae)['then'](function(_0x5246a8){return _0x5246a8;});}return null;};}function removeEntity(_0x38f331,_0x3b0cb7){return function(_0x28cdc0){if(_0x28cdc0){return _0x28cdc0['destroy']()[_0x0acc('0x25')](function(){_0x38f331[_0x0acc('0x20')](0xcc)[_0x0acc('0x1b')]();});}};}function handleEntityNotFound(_0x439481,_0x56cd45){return function(_0x2d47f9){if(!_0x2d47f9){_0x439481['sendStatus'](0x194);}return _0x2d47f9;};}function handleError(_0x4aa594,_0x9907cd){_0x9907cd=_0x9907cd||0x1f4;return function(_0x4c7434){logger['error'](_0x4c7434[_0x0acc('0x26')]);if(_0x4c7434[_0x0acc('0x27')]){delete _0x4c7434['name'];}_0x4aa594[_0x0acc('0x20')](_0x9907cd)['send'](_0x4c7434);};}exports[_0x0acc('0x24')]=function(_0x169b55,_0x221e0d){if(_0x169b55[_0x0acc('0x28')]['id']){delete _0x169b55[_0x0acc('0x28')]['id'];}return db[_0x0acc('0x29')][_0x0acc('0x2a')]({'where':{'id':_0x169b55['params']['id']}})['then'](handleEntityNotFound(_0x221e0d,null))[_0x0acc('0x25')](saveUpdates(_0x169b55[_0x0acc('0x28')],null))['then'](respondWithResult(_0x221e0d,null))[_0x0acc('0x2b')](handleError(_0x221e0d,null));};exports[_0x0acc('0x2c')]=function(_0x36b028,_0xbed0e0){return db[_0x0acc('0x29')]['find']({'where':{'id':_0x36b028[_0x0acc('0x2d')]['id']}})[_0x0acc('0x25')](handleEntityNotFound(_0xbed0e0,null))[_0x0acc('0x25')](removeEntity(_0xbed0e0,null))['catch'](handleError(_0xbed0e0,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 8bac696..0b62de2 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 _0x3acc=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./action.attributes','exports','define','Action'];(function(_0x3f70b4,_0x3d3d4b){var _0x8a55bd=function(_0x97c419){while(--_0x97c419){_0x3f70b4['push'](_0x3f70b4['shift']());}};_0x8a55bd(++_0x3d3d4b);}(_0x3acc,0x13f));var _0xc3ac=function(_0x2a534d,_0xa45332){_0x2a534d=_0x2a534d-0x0;var _0x5890e9=_0x3acc[_0x2a534d];return _0x5890e9;};'use strict';var _=require(_0xc3ac('0x0'));var util=require(_0xc3ac('0x1'));var logger=require(_0xc3ac('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc3ac('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3ac('0x4'));var rimraf=require(_0xc3ac('0x5'));var config=require(_0xc3ac('0x6'));var attributes=require(_0xc3ac('0x7'));module[_0xc3ac('0x8')]=function(_0x18928d,_0xa811df){return _0x18928d[_0xc3ac('0x9')](_0xc3ac('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb78e=['Action','tools_actions','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','define'];(function(_0x2f2d3d,_0x356ffa){var _0x5bf78a=function(_0x5f25f3){while(--_0x5f25f3){_0x2f2d3d['push'](_0x2f2d3d['shift']());}};_0x5bf78a(++_0x356ffa);}(_0xb78e,0x1c9));var _0xeb78=function(_0x7cfa25,_0x8b59d5){_0x7cfa25=_0x7cfa25-0x0;var _0x481972=_0xb78e[_0x7cfa25];return _0x481972;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var logger=require('../../config/logger')(_0xeb78('0x2'));var moment=require(_0xeb78('0x3'));var BPromise=require(_0xeb78('0x4'));var rp=require(_0xeb78('0x5'));var fs=require('fs');var path=require(_0xeb78('0x6'));var rimraf=require(_0xeb78('0x7'));var config=require(_0xeb78('0x8'));var attributes=require(_0xeb78('0x9'));module['exports']=function(_0x3c35e7,_0x17a736){return _0x3c35e7[_0xeb78('0xa')](_0xeb78('0xb'),attributes,{'tableName':_0xeb78('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index fe36c5a..259fb3a 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 _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x509da7,_0x49c1d0){var _0x2dcbc1=function(_0x2bf2ea){while(--_0x2bf2ea){_0x509da7['push'](_0x509da7['shift']());}};_0x2dcbc1(++_0x49c1d0);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2cb7ef,_0x4dd339){_0x2cb7ef=_0x2cb7ef-0x0;var _0x5ce2e6=_0x7fbe[_0x2cb7ef];return _0x5ce2e6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
+var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x53ec,0x192));var _0xc53e=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0x53ec[_0x318840];return _0x223da4;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index f19f15b..c2545ac 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 _0x4535=['update','delete','isAuthenticated','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x16e601,_0x3afff1){var _0x52d161=function(_0x48f786){while(--_0x48f786){_0x16e601['push'](_0x16e601['shift']());}};_0x52d161(++_0x3afff1);}(_0x4535,0x1d4));var _0x5453=function(_0x876ec0,_0x22c3d7){_0x876ec0=_0x876ec0-0x0;var _0x12a539=_0x4535[_0x876ec0];return _0x12a539;};'use strict';var multer=require(_0x5453('0x0'));var util=require('util');var path=require(_0x5453('0x1'));var timeout=require(_0x5453('0x2'));var express=require(_0x5453('0x3'));var router=express[_0x5453('0x4')]();var fs_extra=require(_0x5453('0x5'));var auth=require(_0x5453('0x6'));var interaction=require(_0x5453('0x7'));var config=require(_0x5453('0x8'));var controller=require(_0x5453('0x9'));router[_0x5453('0xa')](_0x5453('0xb'),auth['isAuthenticated'](),controller[_0x5453('0xc')]);router[_0x5453('0xd')](_0x5453('0xb'),auth[_0x5453('0xe')](),controller[_0x5453('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x8ad3=['../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x468bc8,_0x552cfc){var _0xe1c86b=function(_0x154ced){while(--_0x154ced){_0x468bc8['push'](_0x468bc8['shift']());}};_0xe1c86b(++_0x552cfc);}(_0x8ad3,0x181));var _0x38ad=function(_0x420bf8,_0x1351a4){_0x420bf8=_0x420bf8-0x0;var _0x1fd7e2=_0x8ad3[_0x420bf8];return _0x1fd7e2;};'use strict';var multer=require(_0x38ad('0x0'));var util=require('util');var path=require(_0x38ad('0x1'));var timeout=require(_0x38ad('0x2'));var express=require(_0x38ad('0x3'));var router=express[_0x38ad('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x38ad('0x5'));var interaction=require(_0x38ad('0x6'));var config=require(_0x38ad('0x7'));var controller=require(_0x38ad('0x8'));router[_0x38ad('0x9')](_0x38ad('0xa'),auth[_0x38ad('0xb')](),controller[_0x38ad('0xc')]);router[_0x38ad('0xd')](_0x38ad('0xa'),auth[_0x38ad('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 8a8a150..28a6ba3 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 _0xb138=['TEXT','sequelize','exports','STRING'];(function(_0x52935d,_0xca418d){var _0x3aa520=function(_0x19fd18){while(--_0x19fd18){_0x52935d['push'](_0x52935d['shift']());}};_0x3aa520(++_0xca418d);}(_0xb138,0x1dd));var _0x8b13=function(_0x4db013,_0xc6dd89){_0x4db013=_0x4db013-0x0;var _0x105821=_0xb138[_0x4db013];return _0x105821;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'name':{'type':Sequelize[_0x8b13('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8b13('0x2')]},'parent':{'type':Sequelize[_0x8b13('0x2')]},'table':{'type':Sequelize[_0x8b13('0x2')]},'conditions':{'type':Sequelize[_0x8b13('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x2d39b2,_0x23bd7e){var _0x44e183=function(_0x43e474){while(--_0x43e474){_0x2d39b2['push'](_0x2d39b2['shift']());}};_0x44e183(++_0x23bd7e);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x1697a3,_0x6e243c){_0x1697a3=_0x1697a3-0x0;var _0x1ec940=_0x3eea[_0x1697a3];return _0x1ec940;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 078ba54..8fd87cf 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 _0x446f=['IS\x20NOT\x20NULL','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','undefined','count','offset','limit','set','apply','reject','save','update','destroy','get','CustomReports','UserProfileResource','then','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','field','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','QueryTypes','SELECT','SUM(%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','operator','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','run','runReport','HOUR(%s)'];(function(_0x9affab,_0x5e6290){var _0x2a23d9=function(_0x51441a){while(--_0x51441a){_0x9affab['push'](_0x9affab['shift']());}};_0x2a23d9(++_0x5e6290);}(_0x446f,0x154));var _0xf446=function(_0x1c2079,_0x379b35){_0x1c2079=_0x1c2079-0x0;var _0x1e4ed=_0x446f[_0x1c2079];return _0x1e4ed;};'use strict';var emlformat=require(_0xf446('0x0'));var rimraf=require(_0xf446('0x1'));var zipdir=require(_0xf446('0x2'));var jsonpatch=require(_0xf446('0x3'));var rp=require(_0xf446('0x4'));var moment=require('moment');var BPromise=require(_0xf446('0x5'));var Mustache=require(_0xf446('0x6'));var util=require(_0xf446('0x7'));var path=require('path');var sox=require(_0xf446('0x8'));var csv=require(_0xf446('0x9'));var ejs=require(_0xf446('0xa'));var fs=require('fs');var fs_extra=require(_0xf446('0xb'));var _=require(_0xf446('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf446('0xd'));var deskjs=require(_0xf446('0xe'));var toCsv=require(_0xf446('0x9'));var querystring=require(_0xf446('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf446('0x10'));var as=require(_0xf446('0x11'));var hardwareService=require(_0xf446('0x12'));var logger=require(_0xf446('0x13'))(_0xf446('0x14'));var utils=require(_0xf446('0x15'));var config=require(_0xf446('0x16'));var licenseUtil=require(_0xf446('0x17'));var db=require(_0xf446('0x18'))['db'];var dbH=require(_0xf446('0x18'))[_0xf446('0x19')];function respondWithStatusCode(_0x291ecc,_0x308b87){_0x308b87=_0x308b87||0xcc;return function(_0x5e8ef2){if(_0x5e8ef2){return _0x291ecc[_0xf446('0x1a')](_0x308b87);}return _0x291ecc[_0xf446('0x1b')](_0x308b87)[_0xf446('0x1c')]();};}function respondWithResult(_0x1ef13b,_0x196b42){_0x196b42=_0x196b42||0xc8;return function(_0x4a5ee1){if(_0x4a5ee1){return _0x1ef13b[_0xf446('0x1b')](_0x196b42)['json'](_0x4a5ee1);}};}function respondWithFilteredResult(_0x528e5c,_0x496776){return function(_0x3a5e7b){if(_0x3a5e7b){var _0x211890=typeof _0x496776['offset']===_0xf446('0x1d')&&typeof _0x496776['limit']===_0xf446('0x1d');var _0x18b078=_0x3a5e7b[_0xf446('0x1e')];var _0x597e17=_0x211890?0x0:_0x496776['offset'];var _0x565df6=_0x211890?_0x3a5e7b[_0xf446('0x1e')]:_0x496776[_0xf446('0x1f')]+_0x496776[_0xf446('0x20')];var _0x5d62e2;if(_0x565df6>=_0x18b078){_0x565df6=_0x18b078;_0x5d62e2=0xc8;}else{_0x5d62e2=0xce;}_0x528e5c[_0xf446('0x1b')](_0x5d62e2);return _0x528e5c[_0xf446('0x21')]('Content-Range',_0x597e17+'-'+_0x565df6+'/'+_0x18b078)['json'](_0x3a5e7b);}return null;};}function patchUpdates(_0x1f8f07){return function(_0x3ccbde){try{jsonpatch[_0xf446('0x22')](_0x3ccbde,_0x1f8f07,!![]);}catch(_0x5b48df){return BPromise[_0xf446('0x23')](_0x5b48df);}return _0x3ccbde[_0xf446('0x24')]();};}function saveUpdates(_0x26692c,_0x38a6f7){return function(_0x15d30e){if(_0x15d30e){return _0x15d30e[_0xf446('0x25')](_0x26692c)['then'](function(_0x150ca1){return _0x150ca1;});}return null;};}function removeEntity(_0x431cfa,_0xea87c7){return function(_0x2afb60){if(_0x2afb60){return _0x2afb60[_0xf446('0x26')]()['then'](function(){var _0x327d7c=_0x2afb60[_0xf446('0x27')]({'plain':!![]});var _0x4a8c8a=_0xf446('0x28');return db[_0xf446('0x29')][_0xf446('0x26')]({'where':{'type':_0x4a8c8a,'resourceId':_0x327d7c['id']}})[_0xf446('0x2a')](function(){return _0x2afb60;});})['then'](function(){_0x431cfa[_0xf446('0x1b')](0xcc)[_0xf446('0x1c')]();});}};}function handleEntityNotFound(_0x496426,_0x464071){return function(_0x3520a1){if(!_0x3520a1){_0x496426[_0xf446('0x1a')](0x194);}return _0x3520a1;};}function handleError(_0x43fec0,_0x3bfb49){_0x3bfb49=_0x3bfb49||0x1f4;return function(_0x2c8b11){logger[_0xf446('0x2b')](_0x2c8b11[_0xf446('0x2c')]);if(_0x2c8b11[_0xf446('0x2d')]){delete _0x2c8b11[_0xf446('0x2d')];}_0x43fec0[_0xf446('0x1b')](_0x3bfb49)[_0xf446('0x2e')](_0x2c8b11);};}exports['index']=function(_0x1a9d23,_0x1c9f1b){var _0x3a43e1={},_0x83d071={},_0x236462={'count':0x0,'rows':[]};var _0x21880f=_[_0xf446('0x2f')](db[_0xf446('0x30')][_0xf446('0x31')],function(_0x3a153b){return{'name':_0x3a153b[_0xf446('0x32')],'type':_0x3a153b[_0xf446('0x33')][_0xf446('0x34')]};});_0x83d071['model']=_[_0xf446('0x2f')](_0x21880f,'name');_0x83d071['query']=_[_0xf446('0x35')](_0x1a9d23[_0xf446('0x36')]);_0x83d071[_0xf446('0x37')]=_[_0xf446('0x38')](_0x83d071[_0xf446('0x39')],_0x83d071[_0xf446('0x36')]);_0x3a43e1[_0xf446('0x3a')]=_[_0xf446('0x38')](_0x83d071['model'],qs['fields'](_0x1a9d23[_0xf446('0x36')][_0xf446('0x3b')]));_0x3a43e1['attributes']=_0x3a43e1['attributes'][_0xf446('0x3c')]?_0x3a43e1['attributes']:_0x83d071[_0xf446('0x39')];if(!_0x1a9d23[_0xf446('0x36')][_0xf446('0x3d')](_0xf446('0x3e'))){_0x3a43e1[_0xf446('0x20')]=qs[_0xf446('0x20')](_0x1a9d23[_0xf446('0x36')][_0xf446('0x20')]);_0x3a43e1[_0xf446('0x1f')]=qs[_0xf446('0x1f')](_0x1a9d23['query']['offset']);}_0x3a43e1[_0xf446('0x3f')]=qs['sort'](_0x1a9d23[_0xf446('0x36')][_0xf446('0x40')]);_0x3a43e1[_0xf446('0x41')]=qs[_0xf446('0x37')](_[_0xf446('0x42')](_0x1a9d23['query'],_0x83d071[_0xf446('0x37')]),_0x21880f);if(_0x1a9d23[_0xf446('0x36')][_0xf446('0x43')]){_0x3a43e1[_0xf446('0x41')]=_[_0xf446('0x44')](_0x3a43e1[_0xf446('0x41')],{'$or':_[_0xf446('0x2f')](_0x21880f,function(_0x247abc){if(_0x247abc[_0xf446('0x33')]!==_0xf446('0x45')){var _0x5fdc97={};_0x5fdc97[_0x247abc[_0xf446('0x2d')]]={'$like':'%'+_0x1a9d23['query'][_0xf446('0x43')]+'%'};return _0x5fdc97;}})});}_0x3a43e1=_[_0xf446('0x44')]({},_0x3a43e1,_0x1a9d23[_0xf446('0x46')]);var _0x1eb6a0={'where':_0x3a43e1[_0xf446('0x41')]};return db[_0xf446('0x30')][_0xf446('0x1e')](_0x1eb6a0)[_0xf446('0x2a')](function(_0x418a67){_0x236462[_0xf446('0x1e')]=_0x418a67;if(_0x1a9d23[_0xf446('0x36')][_0xf446('0x47')]){_0x3a43e1['include']=[{'all':!![]}];}return db[_0xf446('0x30')][_0xf446('0x48')](_0x3a43e1);})[_0xf446('0x2a')](function(_0xa5be7e){_0x236462[_0xf446('0x49')]=_0xa5be7e;return _0x236462;})[_0xf446('0x2a')](respondWithFilteredResult(_0x1c9f1b,_0x3a43e1))['catch'](handleError(_0x1c9f1b,null));};exports[_0xf446('0x4a')]=function(_0x3579ca,_0x276ca7){var _0x383056={'raw':![],'where':{'id':_0x3579ca[_0xf446('0x4b')]['id']}},_0x40b247={};_0x40b247[_0xf446('0x39')]=_[_0xf446('0x35')](db['AnalyticCustomReport']['rawAttributes']);_0x40b247[_0xf446('0x36')]=_[_0xf446('0x35')](_0x3579ca[_0xf446('0x36')]);_0x40b247[_0xf446('0x37')]=_[_0xf446('0x38')](_0x40b247['model'],_0x40b247['query']);_0x383056[_0xf446('0x3a')]=_[_0xf446('0x38')](_0x40b247[_0xf446('0x39')],qs[_0xf446('0x3b')](_0x3579ca[_0xf446('0x36')][_0xf446('0x3b')]));_0x383056[_0xf446('0x3a')]=_0x383056[_0xf446('0x3a')][_0xf446('0x3c')]?_0x383056['attributes']:_0x40b247['model'];if(_0x3579ca['query'][_0xf446('0x47')]){_0x383056['include']=[{'all':!![]}];}_0x383056=_[_0xf446('0x44')]({},_0x383056,_0x3579ca[_0xf446('0x46')]);return db[_0xf446('0x30')][_0xf446('0x4c')](_0x383056)['then'](handleEntityNotFound(_0x276ca7,null))[_0xf446('0x2a')](respondWithResult(_0x276ca7,null))[_0xf446('0x4d')](handleError(_0x276ca7,null));};exports['create']=function(_0x52efd4,_0x3c5cb0){return db[_0xf446('0x30')][_0xf446('0x4e')](_0x52efd4[_0xf446('0x4f')],{})[_0xf446('0x2a')](function(_0x32559d){var _0x201603=_0x52efd4[_0xf446('0x50')]['get']({'plain':!![]});if(!_0x201603)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x201603[_0xf446('0x51')]===_0xf446('0x50')){var _0x503f27=_0x32559d['get']({'plain':!![]});var _0x37e77a='Reports';return db[_0xf446('0x52')][_0xf446('0x4c')]({'where':{'name':_0x37e77a,'userProfileId':_0x201603[_0xf446('0x53')]},'raw':!![]})[_0xf446('0x2a')](function(_0x2e78a6){if(_0x2e78a6&&_0x2e78a6[_0xf446('0x54')]===0x0){return db[_0xf446('0x29')]['create']({'name':_0x503f27['name'],'resourceId':_0x503f27['id'],'type':_0xf446('0x28'),'sectionId':_0x2e78a6['id']},{})[_0xf446('0x2a')](function(){return _0x32559d;});}else{return _0x32559d;}})[_0xf446('0x4d')](function(_0x56c613){logger[_0xf446('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56c613);throw _0x56c613;});}return _0x32559d;})[_0xf446('0x2a')](respondWithResult(_0x3c5cb0,0xc9))[_0xf446('0x4d')](handleError(_0x3c5cb0,null));};exports[_0xf446('0x25')]=function(_0x362d71,_0x36137d){if(_0x362d71[_0xf446('0x4f')]['id']){delete _0x362d71[_0xf446('0x4f')]['id'];}return db['AnalyticCustomReport'][_0xf446('0x4c')]({'where':{'id':_0x362d71['params']['id']}})[_0xf446('0x2a')](handleEntityNotFound(_0x36137d,null))[_0xf446('0x2a')](saveUpdates(_0x362d71['body'],null))[_0xf446('0x2a')](respondWithResult(_0x36137d,null))[_0xf446('0x4d')](handleError(_0x36137d,null));};exports[_0xf446('0x26')]=function(_0x166a35,_0x131f39){return db[_0xf446('0x30')]['find']({'where':{'id':_0x166a35[_0xf446('0x4b')]['id']}})[_0xf446('0x2a')](handleEntityNotFound(_0x131f39,null))['then'](removeEntity(_0x131f39,null))[_0xf446('0x4d')](handleError(_0x131f39,null));};exports[_0xf446('0x55')]=function(_0xb97f64,_0x4eebf4){var _0x23c1b0=0xa;var _0x36df7d=[_0xf446('0x56'),_0xf446('0x57'),_0xf446('0x58'),_0xf446('0x59')];var _0x7ea649={'SUM':'SUM(%s)','COUNT':_0xf446('0x5a'),'COUNT DISTINCT':_0xf446('0x5b'),'MAX':'MAX(%s)','MIN':_0xf446('0x5c'),'AVG':_0xf446('0x5d'),'GROUP_CONCAT':_0xf446('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf446('0x5f')};var _0x52543d={'SEC_TO_TIME':_0xf446('0x60'),'DATE':_0xf446('0x61'),'HOUR':'HOUR(%s)','ROUND':_0xf446('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5f554e=function(_0x45d4f1){return!_[_0xf446('0x63')]([_0xf446('0x64'),'IS\x20NOT\x20NULL',_0xf446('0x65'),_0xf446('0x66')],_0x45d4f1);};var _0x3b520a=function(_0xc2b5c2){if(!_0xc2b5c2||!_0xc2b5c2['rules'][_0xf446('0x3c')]){return'';}for(var _0x5bf6ca='(',_0x3eaa92=0x0;_0x3eaa92<_0xc2b5c2['rules'][_0xf446('0x3c')];_0x3eaa92+=0x1){_0x3eaa92>0x0&&(_0x5bf6ca+='\x20'+_0xc2b5c2['operator']+'\x20');_0x5bf6ca+=_0xc2b5c2[_0xf446('0x67')][_0x3eaa92][_0xf446('0x68')]?_0x3b520a(_0xc2b5c2[_0xf446('0x67')][_0x3eaa92]['group']):_0xc2b5c2[_0xf446('0x67')][_0x3eaa92]['field']+'\x20'+_0xc2b5c2[_0xf446('0x67')][_0x3eaa92][_0xf446('0x69')]+(_0x5f554e(_0xc2b5c2[_0xf446('0x67')][_0x3eaa92][_0xf446('0x69')])?'\x20'+_0xc2b5c2[_0xf446('0x67')][_0x3eaa92]['value']:'');}return _0x5bf6ca+')';};var _0x570969={'where':{'id':_0xb97f64[_0xf446('0x4b')]['id']}},_0x3b316c,_0x41f910,_0xe22852,_0x303c4c,_0x1c8c98;_0x570969=_[_0xf446('0x44')]({},_0x570969,_0xb97f64[_0xf446('0x46')]);return db[_0xf446('0x30')][_0xf446('0x4c')](_0x570969)[_0xf446('0x2a')](function(_0x724115){if(_0x724115){_0x3b316c=_0x724115;return _0x724115[_0xf446('0x6a')]();}return null;})[_0xf446('0x2a')](function(_0x5ab2d5){if(_0x5ab2d5){if(!_0x5ab2d5['length']){throw new db[(_0xf446('0x6b'))][(_0xf446('0x6c'))](_0xf446('0x6d'),0x193);}_0x41f910=_0x5ab2d5;return db[_0xf446('0x6e')][_0xf446('0x48')]({'raw':!![]});}return null;})[_0xf446('0x2a')](function(_0x1006e3){if(_0x1006e3){_0xe22852=_[_0xf446('0x6f')](_0x1006e3,'id');var _0x28f316;var _0x52f253=squel[_0xf446('0x70')]();_0x52f253[_0xf446('0x71')](_0x3b316c[_0xf446('0x72')]);for(var _0xe99b32=0x0;_0xe99b32<_0x41f910[_0xf446('0x3c')];_0xe99b32+=0x1){_0x28f316=_0x41f910[_0xe99b32]['MetricId']?_0xe22852[_0x41f910[_0xe99b32][_0xf446('0x73')]][_0xf446('0x74')]:_0x41f910[_0xe99b32]['field'];_0x28f316=_0x41f910[_0xe99b32][_0xf446('0x75')]?_[_0xf446('0x76')](_0x7ea649[_0x41f910[_0xe99b32]['function']],'%s',_0x28f316):_0x28f316;_0x28f316=_0x41f910[_0xe99b32]['format']?_[_0xf446('0x76')](_0x52543d[_0x41f910[_0xe99b32][_0xf446('0x77')]],'%s',_0x28f316):_0x28f316;if(_0x41f910[_0xe99b32][_0xf446('0x78')]){_0x52f253[_0xf446('0x68')](_0x28f316);}_0x41f910[_0xe99b32][_0xf446('0x79')]&&_0x52f253[_0xf446('0x3f')](_0x28f316,_0x41f910[_0xe99b32]['orderBy']===_0xf446('0x7a')?![]:!![]);_0x52f253[_0xf446('0x7b')](_0x28f316,_0x41f910[_0xe99b32][_0xf446('0x7c')]||_0x28f316);}if(_0x3b316c[_0xf446('0x7d')]){_0x3b316c[_0xf446('0x7d')]=JSON['parse'](_0x3b316c[_0xf446('0x7d')]);for(var _0x3e7ba8=0x0;_0x3e7ba8<_0x3b316c['joins'][_0xf446('0x3c')];_0x3e7ba8+=0x1){if(_0x3b316c[_0xf446('0x7d')][_0x3e7ba8][_0xf446('0x33')]&&_[_0xf446('0x63')](_0x36df7d,_0x3b316c[_0xf446('0x7d')][_0x3e7ba8][_0xf446('0x33')])&&_0x3b316c['joins'][_0x3e7ba8][_0xf446('0x7e')]&&_0x3b316c[_0xf446('0x7d')][_0x3e7ba8]['foreignTable']&&_0x3b316c[_0xf446('0x7d')][_0x3e7ba8][_0xf446('0x7f')]){_0x52f253[_0x3b316c[_0xf446('0x7d')][_0x3e7ba8]['type']](_0x3b316c['joins'][_0x3e7ba8][_0xf446('0x80')],null,util[_0xf446('0x77')](_0xf446('0x81'),_0x3b316c[_0xf446('0x72')],_0x3b316c[_0xf446('0x7d')][_0x3e7ba8][_0xf446('0x7e')],_0x3b316c[_0xf446('0x7d')][_0x3e7ba8][_0xf446('0x80')],_0x3b316c[_0xf446('0x7d')][_0x3e7ba8][_0xf446('0x7f')]));}}}if(_0x3b316c[_0xf446('0x82')]){_0x3b316c['conditions']=JSON[_0xf446('0x83')](_0x3b316c[_0xf446('0x82')]);_0x52f253[_0xf446('0x41')](_0x3b520a(_0x3b316c[_0xf446('0x82')][_0xf446('0x68')]));}_0x1c8c98=_0x52f253[_0xf446('0x84')]();_0x52f253['limit'](_0x23c1b0);_0x52f253[_0xf446('0x1f')](0x0);logger[_0xf446('0x85')](_0xf446('0x86'),_0x52f253[_0xf446('0x87')]());return dbH['sequelize'][_0xf446('0x36')](_0x52f253[_0xf446('0x87')](),{'type':dbH['sequelize'][_0xf446('0x88')][_0xf446('0x89')]});}})[_0xf446('0x2a')](respondWithResult(_0x4eebf4,null))[_0xf446('0x4d')](handleError(_0x4eebf4,null));};function runReport(_0x36f101,_0x47b2f7,_0x5388f7){var _0xbaf2b2=_0x47b2f7[_0xf446('0x2d')];var _0x5e0483=0xa;var _0x3e3462=[_0xf446('0x56'),_0xf446('0x57'),_0xf446('0x58'),_0xf446('0x59')];var _0x2340e8={'SUM':_0xf446('0x8a'),'COUNT':_0xf446('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xf446('0x8b'),'MIN':_0xf446('0x5c'),'AVG':_0xf446('0x5d'),'GROUP_CONCAT':_0xf446('0x5e'),'GROUP_CONCAT ASC':_0xf446('0x8c'),'GROUP_CONCAT DESC':_0xf446('0x5f')};var _0x12caf4={'SEC_TO_TIME':_0xf446('0x60'),'DATE':_0xf446('0x61'),'HOUR':'HOUR(%s)','ROUND':_0xf446('0x62'),'UNIX_TIMESTAMP':_0xf446('0x8d')};var _0x1a964a=function(_0x444c78){return!_[_0xf446('0x63')]([_0xf446('0x64'),'IS\x20NOT\x20NULL',_0xf446('0x65'),_0xf446('0x66')],_0x444c78);};var _0x10d31f=function(_0x5949db){if(!_0x5949db||!_0x5949db[_0xf446('0x67')][_0xf446('0x3c')]){return'';}for(var _0x23328e='(',_0x4f6c4e=0x0;_0x4f6c4e<_0x5949db[_0xf446('0x67')][_0xf446('0x3c')];_0x4f6c4e+=0x1){_0x4f6c4e>0x0&&(_0x23328e+='\x20'+_0x5949db[_0xf446('0x8e')]+'\x20');_0x23328e+=_0x5949db['rules'][_0x4f6c4e]['group']?_0x10d31f(_0x5949db['rules'][_0x4f6c4e][_0xf446('0x68')]):_0x5949db[_0xf446('0x67')][_0x4f6c4e]['field']+'\x20'+_0x5949db['rules'][_0x4f6c4e][_0xf446('0x69')]+(_0x1a964a(_0x5949db['rules'][_0x4f6c4e][_0xf446('0x69')])?'\x20'+_0x5949db[_0xf446('0x67')][_0x4f6c4e]['value']:'');}return _0x23328e+')';};var _0x20efd8={'where':{'id':_0x36f101['id']}},_0x2ab0c5,_0xaf4964,_0x3071e5,_0xf10ffe,_0x44405f;_0x20efd8=_[_0xf446('0x44')]({},_0x20efd8,_0x5388f7);return db[_0xf446('0x30')][_0xf446('0x4c')](_0x20efd8)[_0xf446('0x2a')](function(_0x568cbc){if(_0x568cbc){_0x2ab0c5=_0x568cbc;return _0x568cbc[_0xf446('0x6a')]();}return null;})[_0xf446('0x2a')](function(_0x1c685e){if(_0x1c685e){if(!_0x1c685e['length']){throw new db[(_0xf446('0x6b'))][(_0xf446('0x6c'))](_0xf446('0x6d'),0x193);}_0xaf4964=_0x1c685e;return db[_0xf446('0x6e')][_0xf446('0x48')]({'raw':!![]});}return null;})['then'](function(_0x558771){if(_0x558771){_0x3071e5=_[_0xf446('0x6f')](_0x558771,'id');var _0x379243;var _0x415b32=squel['select']();_0x415b32['from'](_0x2ab0c5['table']);for(var _0x294ba9=0x0;_0x294ba9<_0xaf4964[_0xf446('0x3c')];_0x294ba9+=0x1){_0x379243=_0xaf4964[_0x294ba9][_0xf446('0x73')]?_0x3071e5[_0xaf4964[_0x294ba9]['MetricId']][_0xf446('0x74')]:_0xaf4964[_0x294ba9]['field'];_0x379243=_0xaf4964[_0x294ba9]['function']?_['replace'](_0x2340e8[_0xaf4964[_0x294ba9][_0xf446('0x75')]],'%s',_0x379243):_0x379243;_0x379243=_0xaf4964[_0x294ba9]['format']?_[_0xf446('0x76')](_0x12caf4[_0xaf4964[_0x294ba9][_0xf446('0x77')]],'%s',_0x379243):_0x379243;if(_0xaf4964[_0x294ba9][_0xf446('0x78')]){_0x415b32['group'](_0x379243);}_0xaf4964[_0x294ba9]['orderBy']&&_0x415b32['order'](_0x379243,_0xaf4964[_0x294ba9][_0xf446('0x79')]===_0xf446('0x7a')?![]:!![]);_0x415b32[_0xf446('0x7b')](_0x379243,_0xaf4964[_0x294ba9]['alias']||_0x379243);}if(_0x2ab0c5[_0xf446('0x7d')]){_0x2ab0c5['joins']=JSON[_0xf446('0x83')](_0x2ab0c5[_0xf446('0x7d')]);for(var _0x41c660=0x0;_0x41c660<_0x2ab0c5[_0xf446('0x7d')][_0xf446('0x3c')];_0x41c660+=0x1){if(_0x2ab0c5[_0xf446('0x7d')][_0x41c660][_0xf446('0x33')]&&_['includes'](_0x3e3462,_0x2ab0c5[_0xf446('0x7d')][_0x41c660][_0xf446('0x33')])&&_0x2ab0c5[_0xf446('0x7d')][_0x41c660][_0xf446('0x7e')]&&_0x2ab0c5[_0xf446('0x7d')][_0x41c660][_0xf446('0x80')]&&_0x2ab0c5[_0xf446('0x7d')][_0x41c660]['foreignKey']){_0x415b32[_0x2ab0c5[_0xf446('0x7d')][_0x41c660][_0xf446('0x33')]](_0x2ab0c5[_0xf446('0x7d')][_0x41c660][_0xf446('0x80')],null,util[_0xf446('0x77')](_0xf446('0x81'),_0x2ab0c5[_0xf446('0x72')],_0x2ab0c5[_0xf446('0x7d')][_0x41c660][_0xf446('0x7e')],_0x2ab0c5[_0xf446('0x7d')][_0x41c660][_0xf446('0x80')],_0x2ab0c5[_0xf446('0x7d')][_0x41c660]['foreignKey']));}}}if(_0x2ab0c5['conditions']){_0x2ab0c5[_0xf446('0x82')]=JSON[_0xf446('0x83')](_0x2ab0c5['conditions']);_0x415b32[_0xf446('0x41')](_0x10d31f(_0x2ab0c5[_0xf446('0x82')]['group']));}_0x44405f=_0x415b32[_0xf446('0x84')]();_0x415b32['limit'](_0x5e0483);_0x415b32[_0xf446('0x1f')](0x0);return;}})[_0xf446('0x2a')](function(){if(_0x47b2f7[_0xf446('0x8f')]===_0xf446('0x90')){return null;}var _0xc66c0f=_[_0xf446('0x44')](_0x47b2f7,{'name':_0x47b2f7[_0xf446('0x91')]||_0x47b2f7[_0xf446('0x2d')]||_0x2ab0c5[_0xf446('0x2d')],'basename':_0xbaf2b2,'savename':util['format'](_0xf446('0x92'),_0x47b2f7[_0xf446('0x2d')]||_0x2ab0c5['name'],require(_0xf446('0x93'))[_0xf446('0x94')](0x4),_0x47b2f7[_0xf446('0x8f')]||_0xf446('0x95')),'reportId':_0x2ab0c5['id'],'reportType':'custom'});return db[_0xf446('0x96')]['create'](_0xc66c0f,{'raw':!![]});})[_0xf446('0x2a')](function(_0x2c0fba){if(_0x2ab0c5[_0xf446('0x72')]==='cdr'){_0x44405f[_0xf446('0x41')](_0x2ab0c5['table']+_0xf446('0x97'),_0x47b2f7['startDate'],_0x47b2f7[_0xf446('0x98')]);}else{_0x44405f['where'](_0x2ab0c5[_0xf446('0x72')]+_0xf446('0x99'),_0x47b2f7[_0xf446('0x9a')],_0x47b2f7[_0xf446('0x98')]);}if(_0x2c0fba){logger[_0xf446('0x9b')]('Run\x20Query:',_0x44405f['toString']());require(_0xf446('0x9c'))[_0xf446('0x9d')](path[_0xf446('0x56')](__dirname,_0xf446('0x9e'),_0x2c0fba[_0xf446('0x8f')]),[_0x2c0fba['id'],_0x44405f[_0xf446('0x87')](),path[_0xf446('0x56')](__dirname,_0xf446('0x9f'),_0x2c0fba[_0xf446('0xa0')]),_0xbaf2b2]);return _0x2c0fba;}else{var _0x4606b3=squel[_0xf446('0x70')]();_0x4606b3[_0xf446('0x71')]('('+_0x44405f[_0xf446('0x87')]()+')',_0xf446('0xa1'));_0x4606b3[_0xf446('0x7b')](_0xf446('0xa2'),_0xf446('0x1e'));_0x44405f[_0xf446('0x20')](_0x47b2f7['limit']||_0x5e0483);_0x44405f['offset'](_0x47b2f7[_0xf446('0x1f')]||0x0);return dbH['sequelize']['query'](_0x4606b3[_0xf446('0x87')](),{'type':dbH[_0xf446('0xa3')][_0xf446('0x88')][_0xf446('0x89')]})[_0xf446('0x2a')](function(_0x5236aa){if(!_0x5236aa[_0xf446('0x3c')]){_0xf10ffe=0x0;}else{_0xf10ffe=_0x5236aa[0x0]['count']||0x0;}return dbH[_0xf446('0xa3')][_0xf446('0x36')](_0x44405f[_0xf446('0x87')](),{'type':dbH[_0xf446('0xa3')][_0xf446('0x88')][_0xf446('0x89')]});})[_0xf446('0x2a')](function(_0x2f18c9){return{'rows':_0x2f18c9||[],'count':_0xf10ffe};});}});}exports[_0xf446('0xa4')]=function(_0x19eee4,_0x1e90b4){return runReport(_0x19eee4[_0xf446('0x4b')],_0x19eee4[_0xf446('0x36')],_0x19eee4[_0xf446('0x46')])[_0xf446('0x2a')](respondWithResult(_0x1e90b4,null))[_0xf446('0x4d')](handleError(_0x1e90b4,null));};exports[_0xf446('0xa5')]=runReport;exports['query']=function(_0x1ad807,_0x15eaca){var _0x4874d5=0xa;var _0x3463f6=['join',_0xf446('0x57'),_0xf446('0x58'),_0xf446('0x59')];var _0x500dcc={'SUM':_0xf446('0x8a'),'COUNT':_0xf446('0x5a'),'COUNT DISTINCT':_0xf446('0x5b'),'MAX':_0xf446('0x8b'),'MIN':_0xf446('0x5c'),'AVG':_0xf446('0x5d'),'GROUP_CONCAT':_0xf446('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf446('0x5f')};var _0x498f8b={'SEC_TO_TIME':_0xf446('0x60'),'DATE':'DATE(%s)','HOUR':_0xf446('0xa6'),'ROUND':_0xf446('0x62'),'UNIX_TIMESTAMP':_0xf446('0x8d')};var _0x40a3b3=function(_0x38ea4b){return!_[_0xf446('0x63')]([_0xf446('0x64'),_0xf446('0xa7'),'IS\x20EMPTY',_0xf446('0x66')],_0x38ea4b);};var _0x4dd4c9=function(_0x39822a){if(!_0x39822a||!_0x39822a[_0xf446('0x67')][_0xf446('0x3c')]){return'';}for(var _0x586657='(',_0x7a704f=0x0;_0x7a704f<_0x39822a['rules'][_0xf446('0x3c')];_0x7a704f+=0x1){_0x7a704f>0x0&&(_0x586657+='\x20'+_0x39822a[_0xf446('0x8e')]+'\x20');_0x586657+=_0x39822a[_0xf446('0x67')][_0x7a704f][_0xf446('0x68')]?_0x4dd4c9(_0x39822a[_0xf446('0x67')][_0x7a704f]['group']):_0x39822a[_0xf446('0x67')][_0x7a704f][_0xf446('0x7b')]+'\x20'+_0x39822a[_0xf446('0x67')][_0x7a704f]['condition']+(_0x40a3b3(_0x39822a[_0xf446('0x67')][_0x7a704f][_0xf446('0x69')])?'\x20'+_0x39822a[_0xf446('0x67')][_0x7a704f][_0xf446('0xa8')]:'');}return _0x586657+')';};var _0x14dc5b={'where':{'id':_0x1ad807[_0xf446('0x4b')]['id']}},_0x1845de,_0x1deeb0,_0xedfd0d,_0x16ef36,_0x1c065a;_0x14dc5b=_[_0xf446('0x44')]({},_0x14dc5b,_0x1ad807[_0xf446('0x46')]);return db['AnalyticCustomReport'][_0xf446('0x4c')](_0x14dc5b)[_0xf446('0x2a')](function(_0x4e9a60){if(_0x4e9a60){_0x1845de=_0x4e9a60;return _0x4e9a60[_0xf446('0x6a')]();}return null;})[_0xf446('0x2a')](function(_0x274573){if(_0x274573){if(!_0x274573[_0xf446('0x3c')]){throw new db[(_0xf446('0x6b'))][(_0xf446('0x6c'))](_0xf446('0x6d'),0x193);}_0x1deeb0=_0x274573;return db[_0xf446('0x6e')][_0xf446('0x48')]({'raw':!![]});}return null;})['then'](function(_0x4ce92a){if(_0x4ce92a){_0xedfd0d=_[_0xf446('0x6f')](_0x4ce92a,'id');var _0x5d0e08;var _0x23de6a=squel['select']();_0x23de6a[_0xf446('0x71')](_0x1845de[_0xf446('0x72')]);for(var _0x2edf6a=0x0;_0x2edf6a<_0x1deeb0['length'];_0x2edf6a+=0x1){_0x5d0e08=_0x1deeb0[_0x2edf6a][_0xf446('0x73')]?_0xedfd0d[_0x1deeb0[_0x2edf6a][_0xf446('0x73')]][_0xf446('0x74')]:_0x1deeb0[_0x2edf6a][_0xf446('0x7b')];_0x5d0e08=_0x1deeb0[_0x2edf6a][_0xf446('0x75')]?_[_0xf446('0x76')](_0x500dcc[_0x1deeb0[_0x2edf6a][_0xf446('0x75')]],'%s',_0x5d0e08):_0x5d0e08;_0x5d0e08=_0x1deeb0[_0x2edf6a][_0xf446('0x77')]?_[_0xf446('0x76')](_0x498f8b[_0x1deeb0[_0x2edf6a][_0xf446('0x77')]],'%s',_0x5d0e08):_0x5d0e08;if(_0x1deeb0[_0x2edf6a][_0xf446('0x78')]){_0x23de6a[_0xf446('0x68')](_0x5d0e08);}_0x1deeb0[_0x2edf6a][_0xf446('0x79')]&&_0x23de6a['order'](_0x5d0e08,_0x1deeb0[_0x2edf6a][_0xf446('0x79')]===_0xf446('0x7a')?![]:!![]);_0x23de6a[_0xf446('0x7b')](_0x5d0e08,_0x1deeb0[_0x2edf6a][_0xf446('0x7c')]||_0x5d0e08);}if(_0x1845de['joins']){_0x1845de['joins']=JSON['parse'](_0x1845de['joins']);for(var _0x39f805=0x0;_0x39f805<_0x1845de['joins'][_0xf446('0x3c')];_0x39f805+=0x1){if(_0x1845de[_0xf446('0x7d')][_0x39f805]['type']&&_['includes'](_0x3463f6,_0x1845de[_0xf446('0x7d')][_0x39f805]['type'])&&_0x1845de[_0xf446('0x7d')][_0x39f805][_0xf446('0x7e')]&&_0x1845de[_0xf446('0x7d')][_0x39f805][_0xf446('0x80')]&&_0x1845de['joins'][_0x39f805][_0xf446('0x7f')]){_0x23de6a[_0x1845de[_0xf446('0x7d')][_0x39f805]['type']](_0x1845de[_0xf446('0x7d')][_0x39f805][_0xf446('0x80')],null,util[_0xf446('0x77')](_0xf446('0x81'),_0x1845de[_0xf446('0x72')],_0x1845de[_0xf446('0x7d')][_0x39f805][_0xf446('0x7e')],_0x1845de[_0xf446('0x7d')][_0x39f805]['foreignTable'],_0x1845de['joins'][_0x39f805][_0xf446('0x7f')]));}}}if(_0x1845de[_0xf446('0x82')]){_0x1845de[_0xf446('0x82')]=JSON['parse'](_0x1845de[_0xf446('0x82')]);_0x23de6a[_0xf446('0x41')](_0x4dd4c9(_0x1845de[_0xf446('0x82')][_0xf446('0x68')]));}_0x1c065a=_0x23de6a['clone']();_0x23de6a[_0xf446('0x20')](_0x4874d5);_0x23de6a[_0xf446('0x1f')](0x0);logger['debug'](_0xf446('0x86'),_0x23de6a[_0xf446('0x87')]());return dbH['sequelize']['query'](_0x23de6a[_0xf446('0x87')](),{'type':dbH['sequelize'][_0xf446('0x88')][_0xf446('0x89')]});}})[_0xf446('0x2a')](function(){return{'sql':_0x1c065a[_0xf446('0x87')]()};})[_0xf446('0x2a')](respondWithResult(_0x15eaca,null))[_0xf446('0x4d')](handleError(_0x15eaca,null));};
\ No newline at end of file
+var _0x4148=['index','AnalyticCustomReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','length','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_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)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','field','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(DISTINCT\x20%s)','SEC_TO_TIME(%s)','DATE(%s)','condition','ValidationErrorItem','AnalyticMetric','clone','web','fullPath','%s-%s.%s','randomstring','output','csv','custom','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','QueryTypes','runReport','right_join','UNIX_TIMESTAMP(%s)','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','limit','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','get','CustomReports','UserProfileResource','destroy','then','error','stack','name','send'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4148,0x75));var _0x8414=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0x4148[_0x133277];return _0x5b4a22;};'use strict';var emlformat=require(_0x8414('0x0'));var rimraf=require(_0x8414('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8414('0x2'));var moment=require(_0x8414('0x3'));var BPromise=require(_0x8414('0x4'));var Mustache=require(_0x8414('0x5'));var util=require(_0x8414('0x6'));var path=require('path');var sox=require(_0x8414('0x7'));var csv=require(_0x8414('0x8'));var ejs=require(_0x8414('0x9'));var fs=require('fs');var fs_extra=require(_0x8414('0xa'));var _=require(_0x8414('0xb'));var squel=require(_0x8414('0xc'));var crypto=require('crypto');var jsforce=require(_0x8414('0xd'));var deskjs=require(_0x8414('0xe'));var toCsv=require(_0x8414('0x8'));var querystring=require(_0x8414('0xf'));var Papa=require('papaparse');var Redis=require(_0x8414('0x10'));var authService=require(_0x8414('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8414('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8414('0x13'))(_0x8414('0x14'));var utils=require('../../config/utils');var config=require(_0x8414('0x15'));var licenseUtil=require(_0x8414('0x16'));var db=require(_0x8414('0x17'))['db'];var dbH=require(_0x8414('0x17'))[_0x8414('0x18')];function respondWithStatusCode(_0x1b82bf,_0x1efc91){_0x1efc91=_0x1efc91||0xcc;return function(_0xc1d07b){if(_0xc1d07b){return _0x1b82bf[_0x8414('0x19')](_0x1efc91);}return _0x1b82bf['status'](_0x1efc91)[_0x8414('0x1a')]();};}function respondWithResult(_0x4df682,_0x135483){_0x135483=_0x135483||0xc8;return function(_0x3f1bba){if(_0x3f1bba){return _0x4df682[_0x8414('0x1b')](_0x135483)['json'](_0x3f1bba);}};}function respondWithFilteredResult(_0x209da9,_0x9aa9bd){return function(_0x2daf8d){if(_0x2daf8d){var _0x2e2752=typeof _0x9aa9bd['offset']==='undefined'&&typeof _0x9aa9bd[_0x8414('0x1c')]===_0x8414('0x1d');var _0x3d0165=_0x2daf8d['count'];var _0x43051b=_0x2e2752?0x0:_0x9aa9bd[_0x8414('0x1e')];var _0x5a0fec=_0x2e2752?_0x2daf8d[_0x8414('0x1f')]:_0x9aa9bd['offset']+_0x9aa9bd[_0x8414('0x1c')];var _0x235b65;if(_0x5a0fec>=_0x3d0165){_0x5a0fec=_0x3d0165;_0x235b65=0xc8;}else{_0x235b65=0xce;}_0x209da9[_0x8414('0x1b')](_0x235b65);return _0x209da9[_0x8414('0x20')](_0x8414('0x21'),_0x43051b+'-'+_0x5a0fec+'/'+_0x3d0165)[_0x8414('0x22')](_0x2daf8d);}return null;};}function patchUpdates(_0x1294ab){return function(_0x44cbe6){try{jsonpatch[_0x8414('0x23')](_0x44cbe6,_0x1294ab,!![]);}catch(_0x1c838c){return BPromise[_0x8414('0x24')](_0x1c838c);}return _0x44cbe6[_0x8414('0x25')]();};}function saveUpdates(_0x11eaa8,_0x20b71a){return function(_0x4ad4d8){if(_0x4ad4d8){return _0x4ad4d8[_0x8414('0x26')](_0x11eaa8)['then'](function(_0x1d2b61){return _0x1d2b61;});}return null;};}function removeEntity(_0x36df01,_0xbff4b5){return function(_0x23fd31){if(_0x23fd31){return _0x23fd31['destroy']()['then'](function(){var _0x503b55=_0x23fd31[_0x8414('0x27')]({'plain':!![]});var _0x43ffcb=_0x8414('0x28');return db[_0x8414('0x29')][_0x8414('0x2a')]({'where':{'type':_0x43ffcb,'resourceId':_0x503b55['id']}})[_0x8414('0x2b')](function(){return _0x23fd31;});})[_0x8414('0x2b')](function(){_0x36df01['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c0a9d,_0x111824){return function(_0x4b4700){if(!_0x4b4700){_0x5c0a9d[_0x8414('0x19')](0x194);}return _0x4b4700;};}function handleError(_0x57701d,_0x398295){_0x398295=_0x398295||0x1f4;return function(_0x23eee1){logger[_0x8414('0x2c')](_0x23eee1[_0x8414('0x2d')]);if(_0x23eee1[_0x8414('0x2e')]){delete _0x23eee1[_0x8414('0x2e')];}_0x57701d[_0x8414('0x1b')](_0x398295)[_0x8414('0x2f')](_0x23eee1);};}exports[_0x8414('0x30')]=function(_0x25d62f,_0xe75fc7){var _0x439ea5={},_0x2d9990={},_0x5bc946={'count':0x0,'rows':[]};var _0x53ac6a=_['map'](db[_0x8414('0x31')][_0x8414('0x32')],function(_0xdc3dce){return{'name':_0xdc3dce[_0x8414('0x33')],'type':_0xdc3dce['type'][_0x8414('0x34')]};});_0x2d9990[_0x8414('0x35')]=_[_0x8414('0x36')](_0x53ac6a,_0x8414('0x2e'));_0x2d9990[_0x8414('0x37')]=_['keys'](_0x25d62f[_0x8414('0x37')]);_0x2d9990[_0x8414('0x38')]=_[_0x8414('0x39')](_0x2d9990['model'],_0x2d9990[_0x8414('0x37')]);_0x439ea5[_0x8414('0x3a')]=_[_0x8414('0x39')](_0x2d9990[_0x8414('0x35')],qs[_0x8414('0x3b')](_0x25d62f[_0x8414('0x37')]['fields']));_0x439ea5[_0x8414('0x3a')]=_0x439ea5[_0x8414('0x3a')]['length']?_0x439ea5[_0x8414('0x3a')]:_0x2d9990['model'];if(!_0x25d62f[_0x8414('0x37')][_0x8414('0x3c')]('nolimit')){_0x439ea5[_0x8414('0x1c')]=qs[_0x8414('0x1c')](_0x25d62f[_0x8414('0x37')]['limit']);_0x439ea5[_0x8414('0x1e')]=qs[_0x8414('0x1e')](_0x25d62f[_0x8414('0x37')]['offset']);}_0x439ea5[_0x8414('0x3d')]=qs[_0x8414('0x3e')](_0x25d62f['query'][_0x8414('0x3e')]);_0x439ea5[_0x8414('0x3f')]=qs['filters'](_['pick'](_0x25d62f['query'],_0x2d9990['filters']),_0x53ac6a);if(_0x25d62f[_0x8414('0x37')][_0x8414('0x40')]){_0x439ea5[_0x8414('0x3f')]=_['merge'](_0x439ea5['where'],{'$or':_['map'](_0x53ac6a,function(_0x3338c5){if(_0x3338c5[_0x8414('0x41')]!==_0x8414('0x42')){var _0x2b3154={};_0x2b3154[_0x3338c5[_0x8414('0x2e')]]={'$like':'%'+_0x25d62f[_0x8414('0x37')][_0x8414('0x40')]+'%'};return _0x2b3154;}})});}_0x439ea5=_['merge']({},_0x439ea5,_0x25d62f[_0x8414('0x43')]);var _0x2a611c={'where':_0x439ea5[_0x8414('0x3f')]};return db[_0x8414('0x31')]['count'](_0x2a611c)[_0x8414('0x2b')](function(_0x510f33){_0x5bc946[_0x8414('0x1f')]=_0x510f33;if(_0x25d62f[_0x8414('0x37')][_0x8414('0x44')]){_0x439ea5[_0x8414('0x45')]=[{'all':!![]}];}return db[_0x8414('0x31')][_0x8414('0x46')](_0x439ea5);})[_0x8414('0x2b')](function(_0x3b1b7d){_0x5bc946[_0x8414('0x47')]=_0x3b1b7d;return _0x5bc946;})[_0x8414('0x2b')](respondWithFilteredResult(_0xe75fc7,_0x439ea5))[_0x8414('0x48')](handleError(_0xe75fc7,null));};exports['show']=function(_0x13682c,_0xe956bf){var _0x2555e6={'raw':![],'where':{'id':_0x13682c[_0x8414('0x49')]['id']}},_0x21082e={};_0x21082e[_0x8414('0x35')]=_[_0x8414('0x4a')](db['AnalyticCustomReport'][_0x8414('0x32')]);_0x21082e[_0x8414('0x37')]=_[_0x8414('0x4a')](_0x13682c[_0x8414('0x37')]);_0x21082e['filters']=_[_0x8414('0x39')](_0x21082e[_0x8414('0x35')],_0x21082e['query']);_0x2555e6['attributes']=_[_0x8414('0x39')](_0x21082e[_0x8414('0x35')],qs[_0x8414('0x3b')](_0x13682c[_0x8414('0x37')]['fields']));_0x2555e6['attributes']=_0x2555e6[_0x8414('0x3a')][_0x8414('0x4b')]?_0x2555e6['attributes']:_0x21082e[_0x8414('0x35')];if(_0x13682c['query'][_0x8414('0x44')]){_0x2555e6[_0x8414('0x45')]=[{'all':!![]}];}_0x2555e6=_[_0x8414('0x4c')]({},_0x2555e6,_0x13682c[_0x8414('0x43')]);return db[_0x8414('0x31')]['find'](_0x2555e6)[_0x8414('0x2b')](handleEntityNotFound(_0xe956bf,null))[_0x8414('0x2b')](respondWithResult(_0xe956bf,null))[_0x8414('0x48')](handleError(_0xe956bf,null));};exports['create']=function(_0x1da558,_0x3beeed){return db['AnalyticCustomReport'][_0x8414('0x4d')](_0x1da558[_0x8414('0x4e')],{})[_0x8414('0x2b')](function(_0x11ee2d){var _0x2e5512=_0x1da558[_0x8414('0x4f')][_0x8414('0x27')]({'plain':!![]});if(!_0x2e5512)throw new Error(_0x8414('0x50'));if(_0x2e5512['role']===_0x8414('0x4f')){var _0x804410=_0x11ee2d[_0x8414('0x27')]({'plain':!![]});var _0x487ae6=_0x8414('0x51');return db[_0x8414('0x52')][_0x8414('0x53')]({'where':{'name':_0x487ae6,'userProfileId':_0x2e5512[_0x8414('0x54')]},'raw':!![]})['then'](function(_0x1d6e7f){if(_0x1d6e7f&&_0x1d6e7f[_0x8414('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x804410[_0x8414('0x2e')],'resourceId':_0x804410['id'],'type':_0x8414('0x28'),'sectionId':_0x1d6e7f['id']},{})['then'](function(){return _0x11ee2d;});}else{return _0x11ee2d;}})[_0x8414('0x48')](function(_0x1264d5){logger[_0x8414('0x2c')](_0x8414('0x56'),_0x1264d5);throw _0x1264d5;});}return _0x11ee2d;})[_0x8414('0x2b')](respondWithResult(_0x3beeed,0xc9))[_0x8414('0x48')](handleError(_0x3beeed,null));};exports[_0x8414('0x26')]=function(_0xe8cb55,_0x1d0f00){if(_0xe8cb55['body']['id']){delete _0xe8cb55[_0x8414('0x4e')]['id'];}return db[_0x8414('0x31')][_0x8414('0x53')]({'where':{'id':_0xe8cb55[_0x8414('0x49')]['id']}})['then'](handleEntityNotFound(_0x1d0f00,null))[_0x8414('0x2b')](saveUpdates(_0xe8cb55['body'],null))['then'](respondWithResult(_0x1d0f00,null))[_0x8414('0x48')](handleError(_0x1d0f00,null));};exports[_0x8414('0x2a')]=function(_0x398a41,_0x20e9e){return db[_0x8414('0x31')][_0x8414('0x53')]({'where':{'id':_0x398a41[_0x8414('0x49')]['id']}})['then'](handleEntityNotFound(_0x20e9e,null))[_0x8414('0x2b')](removeEntity(_0x20e9e,null))[_0x8414('0x48')](handleError(_0x20e9e,null));};exports[_0x8414('0x57')]=function(_0xa28eb4,_0x1a59f5){var _0x17de1c=0xa;var _0x44dc33=[_0x8414('0x58'),_0x8414('0x59'),'right_join',_0x8414('0x5a')];var _0x159cba={'SUM':_0x8414('0x5b'),'COUNT':_0x8414('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8414('0x5d'),'MIN':_0x8414('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x8414('0x5f'),'GROUP_CONCAT ASC':_0x8414('0x60'),'GROUP_CONCAT DESC':_0x8414('0x61')};var _0x2adc12={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x8414('0x62'),'ROUND':_0x8414('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x8e2584=function(_0x104238){return!_['includes']([_0x8414('0x64'),_0x8414('0x65'),_0x8414('0x66'),_0x8414('0x67')],_0x104238);};var _0x28cae8=function(_0x1acd2c){if(!_0x1acd2c||!_0x1acd2c[_0x8414('0x68')][_0x8414('0x4b')]){return'';}for(var _0x47121d='(',_0x5d8036=0x0;_0x5d8036<_0x1acd2c[_0x8414('0x68')]['length'];_0x5d8036+=0x1){_0x5d8036>0x0&&(_0x47121d+='\x20'+_0x1acd2c['operator']+'\x20');_0x47121d+=_0x1acd2c['rules'][_0x5d8036]['group']?_0x28cae8(_0x1acd2c[_0x8414('0x68')][_0x5d8036][_0x8414('0x69')]):_0x1acd2c[_0x8414('0x68')][_0x5d8036]['field']+'\x20'+_0x1acd2c[_0x8414('0x68')][_0x5d8036]['condition']+(_0x8e2584(_0x1acd2c[_0x8414('0x68')][_0x5d8036]['condition'])?'\x20'+_0x1acd2c[_0x8414('0x68')][_0x5d8036][_0x8414('0x6a')]:'');}return _0x47121d+')';};var _0x17393f={'where':{'id':_0xa28eb4[_0x8414('0x49')]['id']}},_0x2a30ea,_0x188cc6,_0x51c461,_0x38842f,_0xa7039f;_0x17393f=_[_0x8414('0x4c')]({},_0x17393f,_0xa28eb4['options']);return db[_0x8414('0x31')][_0x8414('0x53')](_0x17393f)[_0x8414('0x2b')](function(_0x3ada5e){if(_0x3ada5e){_0x2a30ea=_0x3ada5e;return _0x3ada5e[_0x8414('0x6b')]();}return null;})[_0x8414('0x2b')](function(_0x543003){if(_0x543003){if(!_0x543003[_0x8414('0x4b')]){throw new db[(_0x8414('0x6c'))]['ValidationErrorItem'](_0x8414('0x6d'),0x193);}_0x188cc6=_0x543003;return db['AnalyticMetric'][_0x8414('0x46')]({'raw':!![]});}return null;})[_0x8414('0x2b')](function(_0x4e1048){if(_0x4e1048){_0x51c461=_[_0x8414('0x6e')](_0x4e1048,'id');var _0x328750;var _0x27011b=squel[_0x8414('0x6f')]();_0x27011b[_0x8414('0x70')](_0x2a30ea[_0x8414('0x71')]);for(var _0x2f9322=0x0;_0x2f9322<_0x188cc6[_0x8414('0x4b')];_0x2f9322+=0x1){_0x328750=_0x188cc6[_0x2f9322][_0x8414('0x72')]?_0x51c461[_0x188cc6[_0x2f9322][_0x8414('0x72')]][_0x8414('0x73')]:_0x188cc6[_0x2f9322]['field'];_0x328750=_0x188cc6[_0x2f9322][_0x8414('0x74')]?_[_0x8414('0x75')](_0x159cba[_0x188cc6[_0x2f9322]['function']],'%s',_0x328750):_0x328750;_0x328750=_0x188cc6[_0x2f9322][_0x8414('0x76')]?_['replace'](_0x2adc12[_0x188cc6[_0x2f9322][_0x8414('0x76')]],'%s',_0x328750):_0x328750;if(_0x188cc6[_0x2f9322][_0x8414('0x77')]){_0x27011b[_0x8414('0x69')](_0x328750);}_0x188cc6[_0x2f9322][_0x8414('0x78')]&&_0x27011b[_0x8414('0x3d')](_0x328750,_0x188cc6[_0x2f9322][_0x8414('0x78')]===_0x8414('0x79')?![]:!![]);_0x27011b[_0x8414('0x7a')](_0x328750,_0x188cc6[_0x2f9322][_0x8414('0x7b')]||_0x328750);}if(_0x2a30ea[_0x8414('0x7c')]){_0x2a30ea['joins']=JSON[_0x8414('0x7d')](_0x2a30ea[_0x8414('0x7c')]);for(var _0x59e789=0x0;_0x59e789<_0x2a30ea[_0x8414('0x7c')][_0x8414('0x4b')];_0x59e789+=0x1){if(_0x2a30ea['joins'][_0x59e789][_0x8414('0x41')]&&_[_0x8414('0x7e')](_0x44dc33,_0x2a30ea[_0x8414('0x7c')][_0x59e789][_0x8414('0x41')])&&_0x2a30ea[_0x8414('0x7c')][_0x59e789][_0x8414('0x7f')]&&_0x2a30ea[_0x8414('0x7c')][_0x59e789][_0x8414('0x80')]&&_0x2a30ea[_0x8414('0x7c')][_0x59e789][_0x8414('0x81')]){_0x27011b[_0x2a30ea[_0x8414('0x7c')][_0x59e789][_0x8414('0x41')]](_0x2a30ea[_0x8414('0x7c')][_0x59e789][_0x8414('0x80')],null,util['format'](_0x8414('0x82'),_0x2a30ea[_0x8414('0x71')],_0x2a30ea[_0x8414('0x7c')][_0x59e789][_0x8414('0x7f')],_0x2a30ea[_0x8414('0x7c')][_0x59e789]['foreignTable'],_0x2a30ea[_0x8414('0x7c')][_0x59e789][_0x8414('0x81')]));}}}if(_0x2a30ea[_0x8414('0x83')]){_0x2a30ea['conditions']=JSON[_0x8414('0x7d')](_0x2a30ea['conditions']);_0x27011b[_0x8414('0x3f')](_0x28cae8(_0x2a30ea[_0x8414('0x83')][_0x8414('0x69')]));}_0xa7039f=_0x27011b['clone']();_0x27011b[_0x8414('0x1c')](_0x17de1c);_0x27011b[_0x8414('0x1e')](0x0);logger[_0x8414('0x84')](_0x8414('0x85'),_0x27011b['toString']());return dbH['sequelize'][_0x8414('0x37')](_0x27011b[_0x8414('0x86')](),{'type':dbH[_0x8414('0x87')]['QueryTypes'][_0x8414('0x88')]});}})[_0x8414('0x2b')](respondWithResult(_0x1a59f5,null))['catch'](handleError(_0x1a59f5,null));};function runReport(_0x4b4b36,_0x446c16,_0x5e4303){var _0x22b1b6=_0x446c16[_0x8414('0x2e')];var _0x30a451=0xa;var _0x4c35b2=[_0x8414('0x58'),_0x8414('0x59'),'right_join','cross_join'];var _0x2ea3dc={'SUM':_0x8414('0x5b'),'COUNT':_0x8414('0x5c'),'COUNT DISTINCT':_0x8414('0x89'),'MAX':'MAX(%s)','MIN':_0x8414('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x8414('0x60'),'GROUP_CONCAT DESC':_0x8414('0x61')};var _0x1b920c={'SEC_TO_TIME':_0x8414('0x8a'),'DATE':_0x8414('0x8b'),'HOUR':_0x8414('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x491e8=function(_0x31bb9a){return!_[_0x8414('0x7e')]([_0x8414('0x64'),'IS\x20NOT\x20NULL',_0x8414('0x66'),_0x8414('0x67')],_0x31bb9a);};var _0x5ab4b8=function(_0xd95612){if(!_0xd95612||!_0xd95612['rules']['length']){return'';}for(var _0x3a0ca1='(',_0x86d216=0x0;_0x86d216<_0xd95612[_0x8414('0x68')]['length'];_0x86d216+=0x1){_0x86d216>0x0&&(_0x3a0ca1+='\x20'+_0xd95612['operator']+'\x20');_0x3a0ca1+=_0xd95612['rules'][_0x86d216][_0x8414('0x69')]?_0x5ab4b8(_0xd95612[_0x8414('0x68')][_0x86d216]['group']):_0xd95612[_0x8414('0x68')][_0x86d216]['field']+'\x20'+_0xd95612[_0x8414('0x68')][_0x86d216][_0x8414('0x8c')]+(_0x491e8(_0xd95612['rules'][_0x86d216][_0x8414('0x8c')])?'\x20'+_0xd95612[_0x8414('0x68')][_0x86d216]['value']:'');}return _0x3a0ca1+')';};var _0x5294ec={'where':{'id':_0x4b4b36['id']}},_0x5d7409,_0x316bdb,_0x462525,_0x263cfe,_0x59b12f;_0x5294ec=_[_0x8414('0x4c')]({},_0x5294ec,_0x5e4303);return db['AnalyticCustomReport'][_0x8414('0x53')](_0x5294ec)[_0x8414('0x2b')](function(_0x3effc1){if(_0x3effc1){_0x5d7409=_0x3effc1;return _0x3effc1[_0x8414('0x6b')]();}return null;})[_0x8414('0x2b')](function(_0xb507f1){if(_0xb507f1){if(!_0xb507f1['length']){throw new db['Sequelize'][(_0x8414('0x8d'))](_0x8414('0x6d'),0x193);}_0x316bdb=_0xb507f1;return db[_0x8414('0x8e')]['findAll']({'raw':!![]});}return null;})[_0x8414('0x2b')](function(_0x5a7593){if(_0x5a7593){_0x462525=_['keyBy'](_0x5a7593,'id');var _0x2d3950;var _0x5eb2fa=squel['select']();_0x5eb2fa['from'](_0x5d7409['table']);for(var _0x14e69e=0x0;_0x14e69e<_0x316bdb[_0x8414('0x4b')];_0x14e69e+=0x1){_0x2d3950=_0x316bdb[_0x14e69e][_0x8414('0x72')]?_0x462525[_0x316bdb[_0x14e69e][_0x8414('0x72')]]['metric']:_0x316bdb[_0x14e69e][_0x8414('0x7a')];_0x2d3950=_0x316bdb[_0x14e69e][_0x8414('0x74')]?_[_0x8414('0x75')](_0x2ea3dc[_0x316bdb[_0x14e69e][_0x8414('0x74')]],'%s',_0x2d3950):_0x2d3950;_0x2d3950=_0x316bdb[_0x14e69e][_0x8414('0x76')]?_[_0x8414('0x75')](_0x1b920c[_0x316bdb[_0x14e69e][_0x8414('0x76')]],'%s',_0x2d3950):_0x2d3950;if(_0x316bdb[_0x14e69e][_0x8414('0x77')]){_0x5eb2fa[_0x8414('0x69')](_0x2d3950);}_0x316bdb[_0x14e69e][_0x8414('0x78')]&&_0x5eb2fa[_0x8414('0x3d')](_0x2d3950,_0x316bdb[_0x14e69e]['orderBy']===_0x8414('0x79')?![]:!![]);_0x5eb2fa[_0x8414('0x7a')](_0x2d3950,_0x316bdb[_0x14e69e]['alias']||_0x2d3950);}if(_0x5d7409[_0x8414('0x7c')]){_0x5d7409[_0x8414('0x7c')]=JSON['parse'](_0x5d7409[_0x8414('0x7c')]);for(var _0x51dd4d=0x0;_0x51dd4d<_0x5d7409['joins']['length'];_0x51dd4d+=0x1){if(_0x5d7409[_0x8414('0x7c')][_0x51dd4d][_0x8414('0x41')]&&_[_0x8414('0x7e')](_0x4c35b2,_0x5d7409[_0x8414('0x7c')][_0x51dd4d][_0x8414('0x41')])&&_0x5d7409[_0x8414('0x7c')][_0x51dd4d][_0x8414('0x7f')]&&_0x5d7409[_0x8414('0x7c')][_0x51dd4d][_0x8414('0x80')]&&_0x5d7409['joins'][_0x51dd4d][_0x8414('0x81')]){_0x5eb2fa[_0x5d7409['joins'][_0x51dd4d][_0x8414('0x41')]](_0x5d7409[_0x8414('0x7c')][_0x51dd4d][_0x8414('0x80')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x5d7409['table'],_0x5d7409[_0x8414('0x7c')][_0x51dd4d][_0x8414('0x7f')],_0x5d7409[_0x8414('0x7c')][_0x51dd4d]['foreignTable'],_0x5d7409['joins'][_0x51dd4d][_0x8414('0x81')]));}}}if(_0x5d7409['conditions']){_0x5d7409[_0x8414('0x83')]=JSON[_0x8414('0x7d')](_0x5d7409['conditions']);_0x5eb2fa[_0x8414('0x3f')](_0x5ab4b8(_0x5d7409[_0x8414('0x83')]['group']));}_0x59b12f=_0x5eb2fa[_0x8414('0x8f')]();_0x5eb2fa[_0x8414('0x1c')](_0x30a451);_0x5eb2fa[_0x8414('0x1e')](0x0);return;}})[_0x8414('0x2b')](function(){if(_0x446c16['output']===_0x8414('0x90')){return null;}var _0x44fb4c=_[_0x8414('0x4c')](_0x446c16,{'name':_0x446c16[_0x8414('0x91')]||_0x446c16[_0x8414('0x2e')]||_0x5d7409[_0x8414('0x2e')],'basename':_0x22b1b6,'savename':util['format'](_0x8414('0x92'),_0x446c16['name']||_0x5d7409[_0x8414('0x2e')],require(_0x8414('0x93'))['generate'](0x4),_0x446c16[_0x8414('0x94')]||_0x8414('0x95')),'reportId':_0x5d7409['id'],'reportType':_0x8414('0x96')});return db[_0x8414('0x97')][_0x8414('0x4d')](_0x44fb4c,{'raw':!![]});})[_0x8414('0x2b')](function(_0x3b78cc){if(_0x5d7409['table']==='cdr'){_0x59b12f['where'](_0x5d7409[_0x8414('0x71')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x446c16[_0x8414('0x98')],_0x446c16[_0x8414('0x99')]);}else{_0x59b12f[_0x8414('0x3f')](_0x5d7409[_0x8414('0x71')]+_0x8414('0x9a'),_0x446c16[_0x8414('0x98')],_0x446c16[_0x8414('0x99')]);}if(_0x3b78cc){logger['info']('Run\x20Query:',_0x59b12f['toString']());require(_0x8414('0x9b'))[_0x8414('0x9c')](path[_0x8414('0x58')](__dirname,_0x8414('0x9d'),_0x3b78cc[_0x8414('0x94')]),[_0x3b78cc['id'],_0x59b12f[_0x8414('0x86')](),path['join'](__dirname,'../../files/reports',_0x3b78cc[_0x8414('0x9e')]),_0x22b1b6]);return _0x3b78cc;}else{var _0x4f65a8=squel['select']();_0x4f65a8[_0x8414('0x70')]('('+_0x59b12f[_0x8414('0x86')]()+')',_0x8414('0x9f'));_0x4f65a8[_0x8414('0x7a')](_0x8414('0xa0'),_0x8414('0x1f'));_0x59b12f[_0x8414('0x1c')](_0x446c16[_0x8414('0x1c')]||_0x30a451);_0x59b12f[_0x8414('0x1e')](_0x446c16[_0x8414('0x1e')]||0x0);return dbH[_0x8414('0x87')][_0x8414('0x37')](_0x4f65a8[_0x8414('0x86')](),{'type':dbH[_0x8414('0x87')][_0x8414('0xa1')][_0x8414('0x88')]})[_0x8414('0x2b')](function(_0x12e107){if(!_0x12e107[_0x8414('0x4b')]){_0x263cfe=0x0;}else{_0x263cfe=_0x12e107[0x0][_0x8414('0x1f')]||0x0;}return dbH[_0x8414('0x87')][_0x8414('0x37')](_0x59b12f[_0x8414('0x86')](),{'type':dbH['sequelize'][_0x8414('0xa1')][_0x8414('0x88')]});})[_0x8414('0x2b')](function(_0x196f76){return{'rows':_0x196f76||[],'count':_0x263cfe};});}});}exports['run']=function(_0x5971df,_0x9a77d5){return runReport(_0x5971df[_0x8414('0x49')],_0x5971df[_0x8414('0x37')],_0x5971df['options'])[_0x8414('0x2b')](respondWithResult(_0x9a77d5,null))[_0x8414('0x48')](handleError(_0x9a77d5,null));};exports[_0x8414('0xa2')]=runReport;exports[_0x8414('0x37')]=function(_0x3c8d61,_0x4e3642){var _0x3c6e2e=0xa;var _0x32553b=[_0x8414('0x58'),'left_join',_0x8414('0xa3'),'cross_join'];var _0xdeac3c={'SUM':'SUM(%s)','COUNT':_0x8414('0x5c'),'COUNT DISTINCT':_0x8414('0x89'),'MAX':_0x8414('0x5d'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x8414('0x5f'),'GROUP_CONCAT ASC':_0x8414('0x60'),'GROUP_CONCAT DESC':_0x8414('0x61')};var _0x1549a9={'SEC_TO_TIME':_0x8414('0x8a'),'DATE':_0x8414('0x8b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x8414('0xa4')};var _0x18b130=function(_0x43424f){return!_['includes']([_0x8414('0x64'),'IS\x20NOT\x20NULL',_0x8414('0x66'),_0x8414('0x67')],_0x43424f);};var _0x568f51=function(_0x5d05dd){if(!_0x5d05dd||!_0x5d05dd[_0x8414('0x68')]['length']){return'';}for(var _0x5ce81a='(',_0x2b9db2=0x0;_0x2b9db2<_0x5d05dd[_0x8414('0x68')][_0x8414('0x4b')];_0x2b9db2+=0x1){_0x2b9db2>0x0&&(_0x5ce81a+='\x20'+_0x5d05dd['operator']+'\x20');_0x5ce81a+=_0x5d05dd[_0x8414('0x68')][_0x2b9db2][_0x8414('0x69')]?_0x568f51(_0x5d05dd['rules'][_0x2b9db2][_0x8414('0x69')]):_0x5d05dd[_0x8414('0x68')][_0x2b9db2][_0x8414('0x7a')]+'\x20'+_0x5d05dd[_0x8414('0x68')][_0x2b9db2][_0x8414('0x8c')]+(_0x18b130(_0x5d05dd[_0x8414('0x68')][_0x2b9db2][_0x8414('0x8c')])?'\x20'+_0x5d05dd['rules'][_0x2b9db2][_0x8414('0x6a')]:'');}return _0x5ce81a+')';};var _0x214703={'where':{'id':_0x3c8d61[_0x8414('0x49')]['id']}},_0xc0c6e2,_0x4783c3,_0x1b046d,_0x8ef1a6,_0x4d7fc1;_0x214703=_[_0x8414('0x4c')]({},_0x214703,_0x3c8d61[_0x8414('0x43')]);return db[_0x8414('0x31')][_0x8414('0x53')](_0x214703)[_0x8414('0x2b')](function(_0x1c960b){if(_0x1c960b){_0xc0c6e2=_0x1c960b;return _0x1c960b[_0x8414('0x6b')]();}return null;})[_0x8414('0x2b')](function(_0x5f2345){if(_0x5f2345){if(!_0x5f2345[_0x8414('0x4b')]){throw new db[(_0x8414('0x6c'))][(_0x8414('0x8d'))](_0x8414('0x6d'),0x193);}_0x4783c3=_0x5f2345;return db['AnalyticMetric'][_0x8414('0x46')]({'raw':!![]});}return null;})[_0x8414('0x2b')](function(_0x3e835f){if(_0x3e835f){_0x1b046d=_[_0x8414('0x6e')](_0x3e835f,'id');var _0x185fe0;var _0x5d2c98=squel[_0x8414('0x6f')]();_0x5d2c98['from'](_0xc0c6e2[_0x8414('0x71')]);for(var _0x3f8f11=0x0;_0x3f8f11<_0x4783c3[_0x8414('0x4b')];_0x3f8f11+=0x1){_0x185fe0=_0x4783c3[_0x3f8f11][_0x8414('0x72')]?_0x1b046d[_0x4783c3[_0x3f8f11][_0x8414('0x72')]][_0x8414('0x73')]:_0x4783c3[_0x3f8f11][_0x8414('0x7a')];_0x185fe0=_0x4783c3[_0x3f8f11][_0x8414('0x74')]?_[_0x8414('0x75')](_0xdeac3c[_0x4783c3[_0x3f8f11]['function']],'%s',_0x185fe0):_0x185fe0;_0x185fe0=_0x4783c3[_0x3f8f11][_0x8414('0x76')]?_[_0x8414('0x75')](_0x1549a9[_0x4783c3[_0x3f8f11][_0x8414('0x76')]],'%s',_0x185fe0):_0x185fe0;if(_0x4783c3[_0x3f8f11][_0x8414('0x77')]){_0x5d2c98['group'](_0x185fe0);}_0x4783c3[_0x3f8f11]['orderBy']&&_0x5d2c98[_0x8414('0x3d')](_0x185fe0,_0x4783c3[_0x3f8f11][_0x8414('0x78')]===_0x8414('0x79')?![]:!![]);_0x5d2c98[_0x8414('0x7a')](_0x185fe0,_0x4783c3[_0x3f8f11]['alias']||_0x185fe0);}if(_0xc0c6e2[_0x8414('0x7c')]){_0xc0c6e2['joins']=JSON[_0x8414('0x7d')](_0xc0c6e2[_0x8414('0x7c')]);for(var _0x56ba71=0x0;_0x56ba71<_0xc0c6e2[_0x8414('0x7c')][_0x8414('0x4b')];_0x56ba71+=0x1){if(_0xc0c6e2[_0x8414('0x7c')][_0x56ba71][_0x8414('0x41')]&&_['includes'](_0x32553b,_0xc0c6e2[_0x8414('0x7c')][_0x56ba71][_0x8414('0x41')])&&_0xc0c6e2['joins'][_0x56ba71][_0x8414('0x7f')]&&_0xc0c6e2['joins'][_0x56ba71][_0x8414('0x80')]&&_0xc0c6e2[_0x8414('0x7c')][_0x56ba71][_0x8414('0x81')]){_0x5d2c98[_0xc0c6e2[_0x8414('0x7c')][_0x56ba71]['type']](_0xc0c6e2['joins'][_0x56ba71][_0x8414('0x80')],null,util[_0x8414('0x76')]('%s.%s\x20=\x20%s.%s',_0xc0c6e2['table'],_0xc0c6e2[_0x8414('0x7c')][_0x56ba71]['parentKey'],_0xc0c6e2['joins'][_0x56ba71]['foreignTable'],_0xc0c6e2[_0x8414('0x7c')][_0x56ba71][_0x8414('0x81')]));}}}if(_0xc0c6e2[_0x8414('0x83')]){_0xc0c6e2[_0x8414('0x83')]=JSON[_0x8414('0x7d')](_0xc0c6e2[_0x8414('0x83')]);_0x5d2c98[_0x8414('0x3f')](_0x568f51(_0xc0c6e2[_0x8414('0x83')][_0x8414('0x69')]));}_0x4d7fc1=_0x5d2c98[_0x8414('0x8f')]();_0x5d2c98['limit'](_0x3c6e2e);_0x5d2c98['offset'](0x0);logger['debug'](_0x8414('0x85'),_0x5d2c98['toString']());return dbH[_0x8414('0x87')][_0x8414('0x37')](_0x5d2c98['toString'](),{'type':dbH[_0x8414('0x87')][_0x8414('0xa1')][_0x8414('0x88')]});}})[_0x8414('0x2b')](function(){return{'sql':_0x4d7fc1[_0x8414('0x86')]()};})[_0x8414('0x2b')](respondWithResult(_0x4e3642,null))[_0x8414('0x48')](handleError(_0x4e3642,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 3d2caa9..e87a342 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 _0x98c2=['request-promise','path','rimraf','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5aaf48,_0x597553){var _0x7e9e64=function(_0x29ccbc){while(--_0x29ccbc){_0x5aaf48['push'](_0x5aaf48['shift']());}};_0x7e9e64(++_0x597553);}(_0x98c2,0x8b));var _0x298c=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x98c2[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x298c('0x0'));var util=require('util');var logger=require(_0x298c('0x1'))(_0x298c('0x2'));var moment=require(_0x298c('0x3'));var BPromise=require(_0x298c('0x4'));var rp=require(_0x298c('0x5'));var fs=require('fs');var path=require(_0x298c('0x6'));var rimraf=require(_0x298c('0x7'));var config=require('../../config/environment');var attributes=require(_0x298c('0x8'));module[_0x298c('0x9')]=function(_0xf4d9ca,_0x1ae27f){return _0xf4d9ca['define'](_0x298c('0xa'),attributes,{'tableName':_0x298c('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ac5=['AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ac5,0x17b));var _0x58ac=function(_0x1b4245,_0x1a8f35){_0x1b4245=_0x1b4245-0x0;var _0x17ca9a=_0x8ac5[_0x1b4245];return _0x17ca9a;};'use strict';var _=require(_0x58ac('0x0'));var util=require(_0x58ac('0x1'));var logger=require(_0x58ac('0x2'))(_0x58ac('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x58ac('0x4'));var fs=require('fs');var path=require(_0x58ac('0x5'));var rimraf=require(_0x58ac('0x6'));var config=require(_0x58ac('0x7'));var attributes=require(_0x58ac('0x8'));module[_0x58ac('0x9')]=function(_0x22d06f,_0x4daeb1){return _0x22d06f[_0x58ac('0xa')](_0x58ac('0xb'),attributes,{'tableName':_0x58ac('0xc'),'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 be9e05c..1e058f7 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 _0xa23b=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2ff82d,_0xa36a7){var _0x303127=function(_0x4a25ce){while(--_0x4a25ce){_0x2ff82d['push'](_0x2ff82d['shift']());}};_0x303127(++_0xa36a7);}(_0xa23b,0x150));var _0xba23=function(_0x4469e3,_0x3ee822){_0x4469e3=_0x4469e3-0x0;var _0x2cf73a=_0xa23b[_0x4469e3];return _0x2cf73a;};'use strict';var _=require(_0xba23('0x0'));var util=require('util');var moment=require(_0xba23('0x1'));var BPromise=require(_0xba23('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba23('0x3'));var db=require(_0xba23('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xba23('0x5'))(_0xba23('0x6'));var config=require(_0xba23('0x7'));var jayson=require(_0xba23('0x8'));var client=jayson[_0xba23('0x9')][_0xba23('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a5eed,_0x1deb09,_0x3ca941){return new BPromise(function(_0x23ed0d,_0x20c3d5){return client[_0xba23('0xb')](_0x1a5eed,_0x3ca941)['then'](function(_0x2a2f51){logger[_0xba23('0xc')](_0xba23('0xd'),_0x1deb09,_0xba23('0xe'));logger[_0xba23('0xf')](_0xba23('0x10'),_0x1deb09,_0xba23('0xe'),JSON[_0xba23('0x11')](_0x2a2f51));if(_0x2a2f51['error']){if(_0x2a2f51[_0xba23('0x12')][_0xba23('0x13')]===0x1f4){logger[_0xba23('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1deb09,_0x2a2f51[_0xba23('0x12')]['message']);return _0x20c3d5(_0x2a2f51[_0xba23('0x12')][_0xba23('0x14')]);}logger['error'](_0xba23('0xd'),_0x1deb09,_0x2a2f51[_0xba23('0x12')]['message']);return _0x23ed0d(_0x2a2f51[_0xba23('0x12')][_0xba23('0x14')]);}else{logger[_0xba23('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1deb09,_0xba23('0xe'));_0x23ed0d(_0x2a2f51[_0xba23('0x15')]['message']);}})['catch'](function(_0x55186f){logger['error'](_0xba23('0xd'),_0x1deb09,_0x55186f);_0x20c3d5(_0x55186f);});});}
\ No newline at end of file
+var _0xbac9=['catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x1cb5e3,_0x12944e){var _0x5a32ad=function(_0x53857b){while(--_0x53857b){_0x1cb5e3['push'](_0x1cb5e3['shift']());}};_0x5a32ad(++_0x12944e);}(_0xbac9,0x121));var _0x9bac=function(_0x25b4a4,_0x2e081b){_0x25b4a4=_0x25b4a4-0x0;var _0x707267=_0xbac9[_0x25b4a4];return _0x707267;};'use strict';var _=require(_0x9bac('0x0'));var util=require(_0x9bac('0x1'));var moment=require(_0x9bac('0x2'));var BPromise=require('bluebird');var rs=require(_0x9bac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9bac('0x4'))['db'];var utils=require(_0x9bac('0x5'));var logger=require(_0x9bac('0x6'))(_0x9bac('0x7'));var config=require(_0x9bac('0x8'));var jayson=require(_0x9bac('0x9'));var client=jayson[_0x9bac('0xa')][_0x9bac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b1149,_0x1137b0,_0x50e496){return new BPromise(function(_0x126691,_0x1f13d6){return client[_0x9bac('0xc')](_0x1b1149,_0x50e496)[_0x9bac('0xd')](function(_0x218f69){logger['info'](_0x9bac('0xe'),_0x1137b0,_0x9bac('0xf'));logger[_0x9bac('0x10')](_0x9bac('0x11'),_0x1137b0,_0x9bac('0xf'),JSON[_0x9bac('0x12')](_0x218f69));if(_0x218f69[_0x9bac('0x13')]){if(_0x218f69[_0x9bac('0x13')]['code']===0x1f4){logger[_0x9bac('0x13')](_0x9bac('0xe'),_0x1137b0,_0x218f69[_0x9bac('0x13')][_0x9bac('0x14')]);return _0x1f13d6(_0x218f69[_0x9bac('0x13')][_0x9bac('0x14')]);}logger[_0x9bac('0x13')](_0x9bac('0xe'),_0x1137b0,_0x218f69[_0x9bac('0x13')]['message']);return _0x126691(_0x218f69[_0x9bac('0x13')]['message']);}else{logger[_0x9bac('0x15')](_0x9bac('0xe'),_0x1137b0,_0x9bac('0xf'));_0x126691(_0x218f69[_0x9bac('0x16')][_0x9bac('0x14')]);}})[_0x9bac('0x17')](function(_0x38f526){logger[_0x9bac('0x13')](_0x9bac('0xe'),_0x1137b0,_0x38f526);_0x1f13d6(_0x38f526);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index a2bbdb3..ab4c196 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 _0x0a7e=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy','exports','path'];(function(_0x460f81,_0x553431){var _0x423f0d=function(_0x267a6b){while(--_0x267a6b){_0x460f81['push'](_0x460f81['shift']());}};_0x423f0d(++_0x553431);}(_0x0a7e,0x149));var _0xe0a7=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x0a7e[_0x1d1779];return _0x2377e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe0a7('0x0'));var timeout=require(_0xe0a7('0x1'));var express=require('express');var router=express[_0xe0a7('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe0a7('0x3'));var config=require(_0xe0a7('0x4'));var controller=require(_0xe0a7('0x5'));router[_0xe0a7('0x6')]('/',auth['isAuthenticated'](),controller[_0xe0a7('0x7')]);router[_0xe0a7('0x6')](_0xe0a7('0x8'),auth[_0xe0a7('0x9')](),controller[_0xe0a7('0xa')]);router[_0xe0a7('0x6')](_0xe0a7('0xb'),auth[_0xe0a7('0x9')](),controller['preview']);router[_0xe0a7('0x6')](_0xe0a7('0xc'),auth[_0xe0a7('0x9')](),controller[_0xe0a7('0xd')]);router[_0xe0a7('0x6')](_0xe0a7('0xe'),auth[_0xe0a7('0x9')](),controller[_0xe0a7('0xf')]);router[_0xe0a7('0x10')]('/',auth[_0xe0a7('0x9')](),controller[_0xe0a7('0x11')]);router[_0xe0a7('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xe0a7('0x13')]);router['delete']('/:id',auth[_0xe0a7('0x9')](),controller[_0xe0a7('0x14')]);module[_0xe0a7('0x15')]=router;
\ No newline at end of file
+var _0x26d2=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','query','post','put','/:id','update','destroy','exports'];(function(_0x2c9913,_0x541ece){var _0x12c13a=function(_0x35e281){while(--_0x35e281){_0x2c9913['push'](_0x2c9913['shift']());}};_0x12c13a(++_0x541ece);}(_0x26d2,0x180));var _0x226d=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x26d2[_0x4c445a];return _0x2f611c;};'use strict';var multer=require(_0x226d('0x0'));var util=require(_0x226d('0x1'));var path=require(_0x226d('0x2'));var timeout=require(_0x226d('0x3'));var express=require(_0x226d('0x4'));var router=express[_0x226d('0x5')]();var fs_extra=require(_0x226d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x226d('0x7'));var config=require(_0x226d('0x8'));var controller=require(_0x226d('0x9'));router[_0x226d('0xa')]('/',auth[_0x226d('0xb')](),controller['index']);router[_0x226d('0xa')]('/:id',auth[_0x226d('0xb')](),controller[_0x226d('0xc')]);router[_0x226d('0xa')](_0x226d('0xd'),auth[_0x226d('0xb')](),controller['preview']);router['get'](_0x226d('0xe'),auth[_0x226d('0xb')](),controller[_0x226d('0xf')]);router[_0x226d('0xa')](_0x226d('0x10'),auth['isAuthenticated'](),controller[_0x226d('0x11')]);router[_0x226d('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x226d('0x13')](_0x226d('0x14'),auth['isAuthenticated'](),controller[_0x226d('0x15')]);router['delete'](_0x226d('0x14'),auth[_0x226d('0xb')](),controller[_0x226d('0x16')]);module[_0x226d('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 4aabcee..f730ee3 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 _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x189c9e,_0x1c3b55){var _0x3f38ca=function(_0x4c05ec){while(--_0x4c05ec){_0x189c9e['push'](_0x189c9e['shift']());}};_0x3f38ca(++_0x1c3b55);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0xfdbd[_0x368e09];return _0x14b7df;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}};
\ No newline at end of file
+var _0x71ab=['TEXT','exports','STRING'];(function(_0xb281ec,_0x8342fa){var _0x91ed4e=function(_0x12a9a9){while(--_0x12a9a9){_0xb281ec['push'](_0xb281ec['shift']());}};_0x91ed4e(++_0x8342fa);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index ad68d4b..e86a3aa 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 _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x47d7aa,_0x1cde3f){var _0x4941fb=function(_0x19987a){while(--_0x19987a){_0x47d7aa['push'](_0x47d7aa['shift']());}};_0x4941fb(++_0x1cde3f);}(_0x31f0,0xb7));var _0x031f=function(_0x4f58a6,_0x58874d){_0x4f58a6=_0x4f58a6-0x0;var _0x982f87=_0x31f0[_0x4f58a6];return _0x982f87;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));};
\ No newline at end of file
+var _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_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)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x26133e,_0x37f1d5){var _0x347b6a=function(_0x41eaeb){while(--_0x41eaeb){_0x26133e['push'](_0x26133e['shift']());}};_0x347b6a(++_0x37f1d5);}(_0x1261,0x144));var _0x1126=function(_0x45ee03,_0x2f5319){_0x45ee03=_0x45ee03-0x0;var _0x13d535=_0x1261[_0x45ee03];return _0x13d535;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 6ba1fa6..91387dc 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 _0x7142=['bluebird','request-promise','rimraf','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','moment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7142,0xbb));var _0x2714=function(_0x5b8132,_0x242dce){_0x5b8132=_0x5b8132-0x0;var _0x3d84cc=_0x7142[_0x5b8132];return _0x3d84cc;};'use strict';var _=require('lodash');var util=require(_0x2714('0x0'));var logger=require(_0x2714('0x1'))('api');var moment=require(_0x2714('0x2'));var BPromise=require(_0x2714('0x3'));var rp=require(_0x2714('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2714('0x5'));var config=require('../../config/environment');var attributes=require(_0x2714('0x6'));module[_0x2714('0x7')]=function(_0x468600,_0x45f58d){return _0x468600['define'](_0x2714('0x8'),attributes,{'tableName':_0x2714('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x41ce=['lodash','util','../../config/logger','api','bluebird','path','rimraf','exports','AnalyticDefaultReport','analytics_default_reports'];(function(_0x1195ed,_0x4d4af3){var _0x466010=function(_0x1c830f){while(--_0x1c830f){_0x1195ed['push'](_0x1195ed['shift']());}};_0x466010(++_0x4d4af3);}(_0x41ce,0x1ae));var _0xe41c=function(_0x430e31,_0x54d176){_0x430e31=_0x430e31-0x0;var _0x592dd1=_0x41ce[_0x430e31];return _0x592dd1;};'use strict';var _=require(_0xe41c('0x0'));var util=require(_0xe41c('0x1'));var logger=require(_0xe41c('0x2'))(_0xe41c('0x3'));var moment=require('moment');var BPromise=require(_0xe41c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe41c('0x5'));var rimraf=require(_0xe41c('0x6'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0xe41c('0x7')]=function(_0x816c0b,_0x3b0cb9){return _0x816c0b['define'](_0xe41c('0x8'),attributes,{'tableName':_0xe41c('0x9'),'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 9841fa0..a7bc362 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 _0xbb83=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3d41ba,_0x4fce49){var _0x375cfd=function(_0x329929){while(--_0x329929){_0x3d41ba['push'](_0x3d41ba['shift']());}};_0x375cfd(++_0x4fce49);}(_0xbb83,0x17c));var _0x3bb8=function(_0xbeea1c,_0x541820){_0xbeea1c=_0xbeea1c-0x0;var _0x294011=_0xbb83[_0xbeea1c];return _0x294011;};'use strict';var _=require(_0x3bb8('0x0'));var util=require(_0x3bb8('0x1'));var moment=require(_0x3bb8('0x2'));var BPromise=require(_0x3bb8('0x3'));var rs=require(_0x3bb8('0x4'));var fs=require('fs');var Redis=require(_0x3bb8('0x5'));var db=require(_0x3bb8('0x6'))['db'];var utils=require(_0x3bb8('0x7'));var logger=require(_0x3bb8('0x8'))(_0x3bb8('0x9'));var config=require(_0x3bb8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3bb8('0xb')][_0x3bb8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x380885,_0x16f226,_0x2c5c01){return new BPromise(function(_0xc2c0b,_0x20a51c){return client[_0x3bb8('0xd')](_0x380885,_0x2c5c01)[_0x3bb8('0xe')](function(_0x2fd999){logger[_0x3bb8('0xf')](_0x3bb8('0x10'),_0x16f226,_0x3bb8('0x11'));logger['debug'](_0x3bb8('0x12'),_0x16f226,_0x3bb8('0x11'),JSON['stringify'](_0x2fd999));if(_0x2fd999[_0x3bb8('0x13')]){if(_0x2fd999[_0x3bb8('0x13')][_0x3bb8('0x14')]===0x1f4){logger[_0x3bb8('0x13')](_0x3bb8('0x10'),_0x16f226,_0x2fd999[_0x3bb8('0x13')][_0x3bb8('0x15')]);return _0x20a51c(_0x2fd999[_0x3bb8('0x13')][_0x3bb8('0x15')]);}logger[_0x3bb8('0x13')](_0x3bb8('0x10'),_0x16f226,_0x2fd999['error']['message']);return _0xc2c0b(_0x2fd999[_0x3bb8('0x13')]['message']);}else{logger[_0x3bb8('0xf')](_0x3bb8('0x10'),_0x16f226,_0x3bb8('0x11'));_0xc2c0b(_0x2fd999[_0x3bb8('0x16')][_0x3bb8('0x15')]);}})[_0x3bb8('0x17')](function(_0x30c992){logger[_0x3bb8('0x13')](_0x3bb8('0x10'),_0x16f226,_0x30c992);_0x20a51c(_0x30c992);});});}
\ No newline at end of file
+var _0xe214=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s','catch','lodash','util','moment'];(function(_0x2deaf8,_0x27b02a){var _0x2f9dad=function(_0x4b42ba){while(--_0x4b42ba){_0x2deaf8['push'](_0x2deaf8['shift']());}};_0x2f9dad(++_0x27b02a);}(_0xe214,0x131));var _0x4e21=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe214[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x4e21('0x0'));var util=require(_0x4e21('0x1'));var moment=require(_0x4e21('0x2'));var BPromise=require(_0x4e21('0x3'));var rs=require(_0x4e21('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4e21('0x5'));var logger=require(_0x4e21('0x6'))(_0x4e21('0x7'));var config=require(_0x4e21('0x8'));var jayson=require(_0x4e21('0x9'));var client=jayson[_0x4e21('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b3ddd,_0x31508f,_0x4ae216){return new BPromise(function(_0x310db2,_0x2b033c){return client[_0x4e21('0xb')](_0x1b3ddd,_0x4ae216)[_0x4e21('0xc')](function(_0x3af735){logger[_0x4e21('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x31508f,'request\x20sent');logger['debug'](_0x4e21('0xe'),_0x31508f,_0x4e21('0xf'),JSON[_0x4e21('0x10')](_0x3af735));if(_0x3af735[_0x4e21('0x11')]){if(_0x3af735[_0x4e21('0x11')][_0x4e21('0x12')]===0x1f4){logger[_0x4e21('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x31508f,_0x3af735[_0x4e21('0x11')][_0x4e21('0x13')]);return _0x2b033c(_0x3af735[_0x4e21('0x11')][_0x4e21('0x13')]);}logger[_0x4e21('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x31508f,_0x3af735[_0x4e21('0x11')]['message']);return _0x310db2(_0x3af735[_0x4e21('0x11')][_0x4e21('0x13')]);}else{logger[_0x4e21('0xd')](_0x4e21('0x14'),_0x31508f,_0x4e21('0xf'));_0x310db2(_0x3af735['result'][_0x4e21('0x13')]);}})[_0x4e21('0x15')](function(_0x5a8ff9){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x31508f,_0x5a8ff9);_0x2b033c(_0x5a8ff9);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 8663f93..a90995c 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 _0xebba=['index','get','/:id','isAuthenticated','preview','/:id/run','run','/:id/query','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./analyticDefaultReport.controller'];(function(_0x5bfedc,_0x24a222){var _0x3b041c=function(_0x467ad2){while(--_0x467ad2){_0x5bfedc['push'](_0x5bfedc['shift']());}};_0x3b041c(++_0x24a222);}(_0xebba,0x1b2));var _0xaebb=function(_0x3cb957,_0xaddd8a){_0x3cb957=_0x3cb957-0x0;var _0xf51734=_0xebba[_0x3cb957];return _0xf51734;};'use strict';var multer=require('multer');var util=require(_0xaebb('0x0'));var path=require(_0xaebb('0x1'));var timeout=require(_0xaebb('0x2'));var express=require(_0xaebb('0x3'));var router=express[_0xaebb('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaebb('0x5'));var controller=require(_0xaebb('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xaebb('0x7')]);router[_0xaebb('0x8')](_0xaebb('0x9'),auth[_0xaebb('0xa')](),controller['show']);router['get']('/:id/preview',auth[_0xaebb('0xa')](),controller[_0xaebb('0xb')]);router[_0xaebb('0x8')](_0xaebb('0xc'),auth['isAuthenticated'](),controller[_0xaebb('0xd')]);router[_0xaebb('0x8')](_0xaebb('0xe'),auth['isAuthenticated'](),controller['query']);router[_0xaebb('0xf')]('/',auth[_0xaebb('0xa')](),controller[_0xaebb('0x10')]);router[_0xaebb('0x11')]('/:id',auth[_0xaebb('0xa')](),controller['update']);router[_0xaebb('0x12')](_0xaebb('0x9'),auth['isAuthenticated'](),controller[_0xaebb('0x13')]);module[_0xaebb('0x14')]=router;
\ No newline at end of file
+var _0x6851=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','get','show','/:id/preview','preview','run','/:id/query','query','put','/:id','update','delete','destroy','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x6851,0x1a2));var _0x1685=function(_0x408d13,_0x294bd0){_0x408d13=_0x408d13-0x0;var _0x260a99=_0x6851[_0x408d13];return _0x260a99;};'use strict';var multer=require('multer');var util=require(_0x1685('0x0'));var path=require(_0x1685('0x1'));var timeout=require('connect-timeout');var express=require(_0x1685('0x2'));var router=express['Router']();var fs_extra=require(_0x1685('0x3'));var auth=require(_0x1685('0x4'));var interaction=require(_0x1685('0x5'));var config=require(_0x1685('0x6'));var controller=require(_0x1685('0x7'));router['get']('/',auth[_0x1685('0x8')](),controller['index']);router[_0x1685('0x9')]('/:id',auth[_0x1685('0x8')](),controller[_0x1685('0xa')]);router[_0x1685('0x9')](_0x1685('0xb'),auth[_0x1685('0x8')](),controller[_0x1685('0xc')]);router[_0x1685('0x9')]('/:id/run',auth[_0x1685('0x8')](),controller[_0x1685('0xd')]);router['get'](_0x1685('0xe'),auth['isAuthenticated'](),controller[_0x1685('0xf')]);router['post']('/',auth[_0x1685('0x8')](),controller['create']);router[_0x1685('0x10')](_0x1685('0x11'),auth[_0x1685('0x8')](),controller[_0x1685('0x12')]);router[_0x1685('0x13')]('/:id',auth[_0x1685('0x8')](),controller[_0x1685('0x14')]);module[_0x1685('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index f553c51..b0f327e 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 _0x1748=['exports','STRING','ENUM','csv','pdf','Loading','manual','INTEGER','sequelize','moment'];(function(_0x43b1f3,_0x3840cd){var _0x4bd021=function(_0x2c06c0){while(--_0x2c06c0){_0x43b1f3['push'](_0x43b1f3['shift']());}};_0x4bd021(++_0x3840cd);}(_0x1748,0xc6));var _0x8174=function(_0x52008d,_0x12b374){_0x52008d=_0x52008d-0x0;var _0x2058bf=_0x1748[_0x52008d];return _0x2058bf;};'use strict';var Sequelize=require(_0x8174('0x0'));var moment=require(_0x8174('0x1'));module[_0x8174('0x2')]={'name':{'type':Sequelize[_0x8174('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x8174('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x8174('0x4')](_0x8174('0x5'),_0x8174('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0x8174('0x5')},'savename':{'type':Sequelize[_0x8174('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8174('0x3')],'defaultValue':_0x8174('0x7')},'type':{'type':Sequelize['ENUM'](_0x8174('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x8174('0x8')},'reportId':{'type':Sequelize[_0x8174('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x8174('0x3')]}};
\ No newline at end of file
+var _0x0c2a=['xlsx','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf'];(function(_0xd81ba,_0x3f8c8a){var _0x13459c=function(_0x5e0821){while(--_0x5e0821){_0xd81ba['push'](_0xd81ba['shift']());}};_0x13459c(++_0x3f8c8a);}(_0x0c2a,0x1a6));var _0xa0c2=function(_0x3945b8,_0x4c5537){_0x3945b8=_0x3945b8-0x0;var _0x29acdb=_0x0c2a[_0x3945b8];return _0x29acdb;};'use strict';var Sequelize=require(_0xa0c2('0x0'));var moment=require(_0xa0c2('0x1'));module[_0xa0c2('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xa0c2('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xa0c2('0x4')](_0xa0c2('0x5'),_0xa0c2('0x6'),_0xa0c2('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xa0c2('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xa0c2('0x8')]},'endDate':{'type':Sequelize[_0xa0c2('0x8')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xa0c2('0x9')},'type':{'type':Sequelize['ENUM'](_0xa0c2('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0xa0c2('0xa')},'reportId':{'type':Sequelize[_0xa0c2('0xb')](0xb)[_0xa0c2('0xc')]},'reportType':{'type':Sequelize[_0xa0c2('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 1a3b2ca..fd77d46 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 _0x6f69=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','ExtractedReports','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','create','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','basename','savename','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','%s.%s','output','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','papaparse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f69,0x16e));var _0x96f6=function(_0x424466,_0x31297b){_0x424466=_0x424466-0x0;var _0x9f0e18=_0x6f69[_0x424466];return _0x9f0e18;};'use strict';var emlformat=require(_0x96f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x96f6('0x1'));var jsonpatch=require(_0x96f6('0x2'));var rp=require(_0x96f6('0x3'));var moment=require('moment');var BPromise=require(_0x96f6('0x4'));var Mustache=require(_0x96f6('0x5'));var util=require(_0x96f6('0x6'));var path=require(_0x96f6('0x7'));var sox=require('sox');var csv=require(_0x96f6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96f6('0x9'));var _=require(_0x96f6('0xa'));var squel=require('squel');var crypto=require(_0x96f6('0xb'));var jsforce=require(_0x96f6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x96f6('0xd'));var Redis=require('ioredis');var authService=require(_0x96f6('0xe'));var qs=require(_0x96f6('0xf'));var as=require(_0x96f6('0x10'));var hardwareService=require(_0x96f6('0x11'));var logger=require('../../config/logger')(_0x96f6('0x12'));var utils=require(_0x96f6('0x13'));var config=require(_0x96f6('0x14'));var licenseUtil=require(_0x96f6('0x15'));var db=require(_0x96f6('0x16'))['db'];function respondWithStatusCode(_0x4279f9,_0x5d000f){_0x5d000f=_0x5d000f||0xcc;return function(_0x16f993){if(_0x16f993){return _0x4279f9['sendStatus'](_0x5d000f);}return _0x4279f9[_0x96f6('0x17')](_0x5d000f)['end']();};}function respondWithResult(_0x29b734,_0x4f59d8){_0x4f59d8=_0x4f59d8||0xc8;return function(_0x32ddc4){if(_0x32ddc4){return _0x29b734[_0x96f6('0x17')](_0x4f59d8)[_0x96f6('0x18')](_0x32ddc4);}};}function respondWithFilteredResult(_0x56e99f,_0x5a67f9){return function(_0x208fd6){if(_0x208fd6){var _0x153aab=typeof _0x5a67f9[_0x96f6('0x19')]===_0x96f6('0x1a')&&typeof _0x5a67f9[_0x96f6('0x1b')]===_0x96f6('0x1a');var _0x51e19c=_0x208fd6[_0x96f6('0x1c')];var _0x3d038f=_0x153aab?0x0:_0x5a67f9['offset'];var _0xc97afa=_0x153aab?_0x208fd6[_0x96f6('0x1c')]:_0x5a67f9[_0x96f6('0x19')]+_0x5a67f9[_0x96f6('0x1b')];var _0x1f6cf4;if(_0xc97afa>=_0x51e19c){_0xc97afa=_0x51e19c;_0x1f6cf4=0xc8;}else{_0x1f6cf4=0xce;}_0x56e99f[_0x96f6('0x17')](_0x1f6cf4);return _0x56e99f[_0x96f6('0x1d')](_0x96f6('0x1e'),_0x3d038f+'-'+_0xc97afa+'/'+_0x51e19c)['json'](_0x208fd6);}return null;};}function patchUpdates(_0x2b91cc){return function(_0x189617){try{jsonpatch[_0x96f6('0x1f')](_0x189617,_0x2b91cc,!![]);}catch(_0x331a64){return BPromise[_0x96f6('0x20')](_0x331a64);}return _0x189617['save']();};}function saveUpdates(_0x59017d,_0xae1d94){return function(_0x5b2ac1){if(_0x5b2ac1){return _0x5b2ac1[_0x96f6('0x21')](_0x59017d)[_0x96f6('0x22')](function(_0x500063){return _0x500063;});}return null;};}function removeEntity(_0x50cd4d,_0x2de468){return function(_0x4c3d97){if(_0x4c3d97){return _0x4c3d97[_0x96f6('0x23')]()[_0x96f6('0x22')](function(){var _0x2b2e63=_0x4c3d97[_0x96f6('0x24')]({'plain':!![]});var _0x1821e5=_0x96f6('0x25');return db[_0x96f6('0x26')][_0x96f6('0x23')]({'where':{'type':_0x1821e5,'resourceId':_0x2b2e63['id']}})[_0x96f6('0x22')](function(){return _0x4c3d97;});})[_0x96f6('0x22')](function(){_0x50cd4d[_0x96f6('0x17')](0xcc)[_0x96f6('0x27')]();});}};}function handleEntityNotFound(_0x26f3e9,_0x58498c){return function(_0x54fe91){if(!_0x54fe91){_0x26f3e9[_0x96f6('0x28')](0x194);}return _0x54fe91;};}function handleError(_0x272078,_0x480ac7){_0x480ac7=_0x480ac7||0x1f4;return function(_0x3b5d3b){logger[_0x96f6('0x29')](_0x3b5d3b[_0x96f6('0x2a')]);if(_0x3b5d3b['name']){delete _0x3b5d3b[_0x96f6('0x2b')];}_0x272078['status'](_0x480ac7)[_0x96f6('0x2c')](_0x3b5d3b);};}exports[_0x96f6('0x2d')]=function(_0x325f3f,_0x46d506){var _0x181435={},_0x2b5e70={},_0x1b9898={'count':0x0,'rows':[]};var _0x20eed4=_[_0x96f6('0x2e')](db[_0x96f6('0x2f')][_0x96f6('0x30')],function(_0x490112){return{'name':_0x490112[_0x96f6('0x31')],'type':_0x490112['type'][_0x96f6('0x32')]};});_0x2b5e70[_0x96f6('0x33')]=_[_0x96f6('0x2e')](_0x20eed4,_0x96f6('0x2b'));_0x2b5e70[_0x96f6('0x34')]=_['keys'](_0x325f3f[_0x96f6('0x34')]);_0x2b5e70['filters']=_[_0x96f6('0x35')](_0x2b5e70[_0x96f6('0x33')],_0x2b5e70['query']);_0x181435['attributes']=_[_0x96f6('0x35')](_0x2b5e70[_0x96f6('0x33')],qs[_0x96f6('0x36')](_0x325f3f['query'][_0x96f6('0x36')]));_0x181435[_0x96f6('0x37')]=_0x181435[_0x96f6('0x37')][_0x96f6('0x38')]?_0x181435[_0x96f6('0x37')]:_0x2b5e70[_0x96f6('0x33')];if(!_0x325f3f[_0x96f6('0x34')][_0x96f6('0x39')]('nolimit')){_0x181435[_0x96f6('0x1b')]=qs[_0x96f6('0x1b')](_0x325f3f[_0x96f6('0x34')]['limit']);_0x181435[_0x96f6('0x19')]=qs['offset'](_0x325f3f[_0x96f6('0x34')][_0x96f6('0x19')]);}_0x181435[_0x96f6('0x3a')]=qs[_0x96f6('0x3b')](_0x325f3f[_0x96f6('0x34')][_0x96f6('0x3b')]);_0x181435[_0x96f6('0x3c')]=qs['filters'](_[_0x96f6('0x3d')](_0x325f3f[_0x96f6('0x34')],_0x2b5e70[_0x96f6('0x3e')]),_0x20eed4);if(_0x325f3f[_0x96f6('0x34')][_0x96f6('0x3f')]){_0x181435[_0x96f6('0x3c')]=_[_0x96f6('0x40')](_0x181435['where'],{'$or':_[_0x96f6('0x2e')](_0x20eed4,function(_0xd530dd){if(_0xd530dd[_0x96f6('0x41')]!==_0x96f6('0x42')){var _0x3be25b={};_0x3be25b[_0xd530dd[_0x96f6('0x2b')]]={'$like':'%'+_0x325f3f[_0x96f6('0x34')][_0x96f6('0x3f')]+'%'};return _0x3be25b;}})});}_0x181435=_[_0x96f6('0x40')]({},_0x181435,_0x325f3f[_0x96f6('0x43')]);var _0x598f1f={'where':_0x181435['where']};return db['AnalyticExtractedReport'][_0x96f6('0x1c')](_0x598f1f)[_0x96f6('0x22')](function(_0x13d288){_0x1b9898['count']=_0x13d288;if(_0x325f3f[_0x96f6('0x34')][_0x96f6('0x44')]){_0x181435[_0x96f6('0x45')]=[{'all':!![]}];}return db[_0x96f6('0x2f')][_0x96f6('0x46')](_0x181435);})['then'](function(_0x47f19b){_0x1b9898[_0x96f6('0x47')]=_0x47f19b;return _0x1b9898;})[_0x96f6('0x22')](respondWithFilteredResult(_0x46d506,_0x181435))[_0x96f6('0x48')](handleError(_0x46d506,null));};exports['show']=function(_0x4588ee,_0x18ecda){var _0x2da745={'raw':!![],'where':{'id':_0x4588ee['params']['id']}},_0x4ab955={};_0x4ab955[_0x96f6('0x33')]=_['keys'](db[_0x96f6('0x2f')][_0x96f6('0x30')]);_0x4ab955[_0x96f6('0x34')]=_[_0x96f6('0x49')](_0x4588ee[_0x96f6('0x34')]);_0x4ab955[_0x96f6('0x3e')]=_['intersection'](_0x4ab955[_0x96f6('0x33')],_0x4ab955[_0x96f6('0x34')]);_0x2da745[_0x96f6('0x37')]=_[_0x96f6('0x35')](_0x4ab955[_0x96f6('0x33')],qs[_0x96f6('0x36')](_0x4588ee[_0x96f6('0x34')]['fields']));_0x2da745[_0x96f6('0x37')]=_0x2da745[_0x96f6('0x37')][_0x96f6('0x38')]?_0x2da745['attributes']:_0x4ab955[_0x96f6('0x33')];if(_0x4588ee[_0x96f6('0x34')][_0x96f6('0x44')]){_0x2da745[_0x96f6('0x45')]=[{'all':!![]}];}_0x2da745=_[_0x96f6('0x40')]({},_0x2da745,_0x4588ee['options']);return db['AnalyticExtractedReport'][_0x96f6('0x4a')](_0x2da745)[_0x96f6('0x22')](handleEntityNotFound(_0x18ecda,null))['then'](respondWithResult(_0x18ecda,null))[_0x96f6('0x48')](handleError(_0x18ecda,null));};exports[_0x96f6('0x4b')]=function(_0x9dee7e,_0x37d26c){return db['AnalyticExtractedReport'][_0x96f6('0x4b')](_0x9dee7e['body'],{})[_0x96f6('0x22')](function(_0x44b225){var _0x533dff=_0x9dee7e[_0x96f6('0x4c')][_0x96f6('0x24')]({'plain':!![]});if(!_0x533dff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x533dff['role']===_0x96f6('0x4c')){var _0x238c12=_0x44b225[_0x96f6('0x24')]({'plain':!![]});var _0x388dac='ExtractedReports';return db[_0x96f6('0x4d')]['find']({'where':{'name':_0x388dac,'userProfileId':_0x533dff[_0x96f6('0x4e')]},'raw':!![]})[_0x96f6('0x22')](function(_0x369a83){if(_0x369a83&&_0x369a83['autoAssociation']===0x0){return db['UserProfileResource'][_0x96f6('0x4b')]({'name':_0x238c12[_0x96f6('0x2b')],'resourceId':_0x238c12['id'],'type':_0x369a83[_0x96f6('0x2b')],'sectionId':_0x369a83['id']},{})['then'](function(){return _0x44b225;});}else{return _0x44b225;}})[_0x96f6('0x48')](function(_0x435495){logger[_0x96f6('0x29')](_0x96f6('0x4f'),_0x435495);throw _0x435495;});}return _0x44b225;})[_0x96f6('0x22')](respondWithResult(_0x37d26c,0xc9))[_0x96f6('0x48')](handleError(_0x37d26c,null));};exports[_0x96f6('0x21')]=function(_0x3aa64f,_0xb35f17){if(_0x3aa64f['body']['id']){delete _0x3aa64f['body']['id'];}return db[_0x96f6('0x2f')][_0x96f6('0x4a')]({'where':{'id':_0x3aa64f[_0x96f6('0x50')]['id']}})[_0x96f6('0x22')](handleEntityNotFound(_0xb35f17,null))[_0x96f6('0x22')](saveUpdates(_0x3aa64f[_0x96f6('0x51')],null))['then'](respondWithResult(_0xb35f17,null))[_0x96f6('0x48')](handleError(_0xb35f17,null));};exports[_0x96f6('0x23')]=function(_0xd5a624,_0x2e7bfb){return db[_0x96f6('0x2f')][_0x96f6('0x4a')]({'where':{'id':_0xd5a624[_0x96f6('0x50')]['id']}})[_0x96f6('0x22')](handleEntityNotFound(_0x2e7bfb,null))[_0x96f6('0x22')](removeEntity(_0x2e7bfb,null))[_0x96f6('0x48')](handleError(_0x2e7bfb,null));};exports['download']=function(_0x2b69a2,_0x3e8e3d,_0x5ae554){return db[_0x96f6('0x2f')][_0x96f6('0x4a')]({'where':{'id':_0x2b69a2[_0x96f6('0x50')]['id']},'attributes':[_0x96f6('0x2b'),_0x96f6('0x52'),_0x96f6('0x53'),'output'],'raw':!![]})[_0x96f6('0x22')](handleEntityNotFound(_0x3e8e3d,null))[_0x96f6('0x22')](function(_0x5cd8d2){if(_0x5cd8d2){if(!fs[_0x96f6('0x54')](path[_0x96f6('0x55')](config[_0x96f6('0x56')],_0x96f6('0x57'),_0x5cd8d2[_0x96f6('0x53')]))){throw new db['Sequelize'][(_0x96f6('0x58'))](_0x96f6('0x59'));}if(_0x2b69a2['query'][_0x96f6('0x5a')]){return _0x3e8e3d['sendStatus'](0xc8);}return _0x3e8e3d[_0x96f6('0x5b')](path['join'](config[_0x96f6('0x56')],'server/files/reports',_0x5cd8d2[_0x96f6('0x53')]),util['format'](_0x96f6('0x5c'),_0x5cd8d2[_0x96f6('0x52')]||_0x5cd8d2[_0x96f6('0x2b')],_0x5cd8d2[_0x96f6('0x5d')][_0x96f6('0x5e')]()));}})[_0x96f6('0x48')](handleError(_0x3e8e3d,null));};
\ No newline at end of file
+var _0x665a=['catch','download','savename','output','existsSync','join','root','server/files/reports','ValidationError','sendStatus','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','undefined','limit','offset','count','status','set','apply','save','update','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0x665a,0x192));var _0xa665=function(_0x3bb966,_0x12f2ce){_0x3bb966=_0x3bb966-0x0;var _0xa1257d=_0x665a[_0x3bb966];return _0xa1257d;};'use strict';var emlformat=require(_0xa665('0x0'));var rimraf=require(_0xa665('0x1'));var zipdir=require(_0xa665('0x2'));var jsonpatch=require(_0xa665('0x3'));var rp=require(_0xa665('0x4'));var moment=require(_0xa665('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa665('0x6'));var util=require(_0xa665('0x7'));var path=require(_0xa665('0x8'));var sox=require(_0xa665('0x9'));var csv=require(_0xa665('0xa'));var ejs=require(_0xa665('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa665('0xc'));var squel=require(_0xa665('0xd'));var crypto=require(_0xa665('0xe'));var jsforce=require(_0xa665('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa665('0xa'));var querystring=require(_0xa665('0x10'));var Papa=require(_0xa665('0x11'));var Redis=require(_0xa665('0x12'));var authService=require(_0xa665('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa665('0x14'));var logger=require(_0xa665('0x15'))(_0xa665('0x16'));var utils=require(_0xa665('0x17'));var config=require(_0xa665('0x18'));var licenseUtil=require(_0xa665('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb487e2,_0x26aedb){_0x26aedb=_0x26aedb||0xcc;return function(_0x3bb993){if(_0x3bb993){return _0xb487e2['sendStatus'](_0x26aedb);}return _0xb487e2['status'](_0x26aedb)[_0xa665('0x1a')]();};}function respondWithResult(_0x2fb156,_0x54e0f1){_0x54e0f1=_0x54e0f1||0xc8;return function(_0xf78ed3){if(_0xf78ed3){return _0x2fb156['status'](_0x54e0f1)[_0xa665('0x1b')](_0xf78ed3);}};}function respondWithFilteredResult(_0x3f2124,_0x471b42){return function(_0x375ff2){if(_0x375ff2){var _0x29df7b=typeof _0x471b42['offset']===_0xa665('0x1c')&&typeof _0x471b42[_0xa665('0x1d')]===_0xa665('0x1c');var _0x48e36c=_0x375ff2['count'];var _0x34e7a9=_0x29df7b?0x0:_0x471b42[_0xa665('0x1e')];var _0xaccf6e=_0x29df7b?_0x375ff2[_0xa665('0x1f')]:_0x471b42[_0xa665('0x1e')]+_0x471b42[_0xa665('0x1d')];var _0x24a171;if(_0xaccf6e>=_0x48e36c){_0xaccf6e=_0x48e36c;_0x24a171=0xc8;}else{_0x24a171=0xce;}_0x3f2124[_0xa665('0x20')](_0x24a171);return _0x3f2124[_0xa665('0x21')]('Content-Range',_0x34e7a9+'-'+_0xaccf6e+'/'+_0x48e36c)['json'](_0x375ff2);}return null;};}function patchUpdates(_0x4ff19b){return function(_0x4b54df){try{jsonpatch[_0xa665('0x22')](_0x4b54df,_0x4ff19b,!![]);}catch(_0xc5aa17){return BPromise['reject'](_0xc5aa17);}return _0x4b54df[_0xa665('0x23')]();};}function saveUpdates(_0x4a4383,_0x55780e){return function(_0x547ec8){if(_0x547ec8){return _0x547ec8[_0xa665('0x24')](_0x4a4383)[_0xa665('0x25')](function(_0x1daba5){return _0x1daba5;});}return null;};}function removeEntity(_0xade328,_0x5d3a3e){return function(_0x51c474){if(_0x51c474){return _0x51c474[_0xa665('0x26')]()[_0xa665('0x25')](function(){var _0x15d668=_0x51c474['get']({'plain':!![]});var _0x46018b=_0xa665('0x27');return db[_0xa665('0x28')][_0xa665('0x26')]({'where':{'type':_0x46018b,'resourceId':_0x15d668['id']}})[_0xa665('0x25')](function(){return _0x51c474;});})[_0xa665('0x25')](function(){_0xade328[_0xa665('0x20')](0xcc)[_0xa665('0x1a')]();});}};}function handleEntityNotFound(_0xa39eec,_0x2effad){return function(_0x23743e){if(!_0x23743e){_0xa39eec['sendStatus'](0x194);}return _0x23743e;};}function handleError(_0x5a9345,_0x544fc2){_0x544fc2=_0x544fc2||0x1f4;return function(_0x5371cf){logger[_0xa665('0x29')](_0x5371cf[_0xa665('0x2a')]);if(_0x5371cf[_0xa665('0x2b')]){delete _0x5371cf[_0xa665('0x2b')];}_0x5a9345['status'](_0x544fc2)[_0xa665('0x2c')](_0x5371cf);};}exports[_0xa665('0x2d')]=function(_0x15a3bf,_0x5b754b){var _0x1f6e6f={},_0x2bfbdb={},_0x56049f={'count':0x0,'rows':[]};var _0xe350a9=_[_0xa665('0x2e')](db[_0xa665('0x2f')]['rawAttributes'],function(_0x18ff99){return{'name':_0x18ff99[_0xa665('0x30')],'type':_0x18ff99[_0xa665('0x31')][_0xa665('0x32')]};});_0x2bfbdb['model']=_[_0xa665('0x2e')](_0xe350a9,_0xa665('0x2b'));_0x2bfbdb[_0xa665('0x33')]=_[_0xa665('0x34')](_0x15a3bf[_0xa665('0x33')]);_0x2bfbdb[_0xa665('0x35')]=_[_0xa665('0x36')](_0x2bfbdb[_0xa665('0x37')],_0x2bfbdb[_0xa665('0x33')]);_0x1f6e6f[_0xa665('0x38')]=_[_0xa665('0x36')](_0x2bfbdb[_0xa665('0x37')],qs['fields'](_0x15a3bf[_0xa665('0x33')][_0xa665('0x39')]));_0x1f6e6f[_0xa665('0x38')]=_0x1f6e6f[_0xa665('0x38')][_0xa665('0x3a')]?_0x1f6e6f[_0xa665('0x38')]:_0x2bfbdb[_0xa665('0x37')];if(!_0x15a3bf[_0xa665('0x33')][_0xa665('0x3b')]('nolimit')){_0x1f6e6f[_0xa665('0x1d')]=qs['limit'](_0x15a3bf['query']['limit']);_0x1f6e6f['offset']=qs['offset'](_0x15a3bf[_0xa665('0x33')][_0xa665('0x1e')]);}_0x1f6e6f[_0xa665('0x3c')]=qs[_0xa665('0x3d')](_0x15a3bf[_0xa665('0x33')]['sort']);_0x1f6e6f[_0xa665('0x3e')]=qs['filters'](_['pick'](_0x15a3bf[_0xa665('0x33')],_0x2bfbdb[_0xa665('0x35')]),_0xe350a9);if(_0x15a3bf['query'][_0xa665('0x3f')]){_0x1f6e6f[_0xa665('0x3e')]=_[_0xa665('0x40')](_0x1f6e6f[_0xa665('0x3e')],{'$or':_[_0xa665('0x2e')](_0xe350a9,function(_0x4a6e30){if(_0x4a6e30[_0xa665('0x31')]!==_0xa665('0x41')){var _0x444013={};_0x444013[_0x4a6e30[_0xa665('0x2b')]]={'$like':'%'+_0x15a3bf['query'][_0xa665('0x3f')]+'%'};return _0x444013;}})});}_0x1f6e6f=_[_0xa665('0x40')]({},_0x1f6e6f,_0x15a3bf[_0xa665('0x42')]);var _0x1651ac={'where':_0x1f6e6f['where']};return db['AnalyticExtractedReport'][_0xa665('0x1f')](_0x1651ac)[_0xa665('0x25')](function(_0x58cb78){_0x56049f[_0xa665('0x1f')]=_0x58cb78;if(_0x15a3bf[_0xa665('0x33')]['includeAll']){_0x1f6e6f[_0xa665('0x43')]=[{'all':!![]}];}return db[_0xa665('0x2f')][_0xa665('0x44')](_0x1f6e6f);})[_0xa665('0x25')](function(_0x1903bc){_0x56049f[_0xa665('0x45')]=_0x1903bc;return _0x56049f;})[_0xa665('0x25')](respondWithFilteredResult(_0x5b754b,_0x1f6e6f))['catch'](handleError(_0x5b754b,null));};exports[_0xa665('0x46')]=function(_0x6cb437,_0x27f36e){var _0x1047a9={'raw':!![],'where':{'id':_0x6cb437[_0xa665('0x47')]['id']}},_0x15a340={};_0x15a340[_0xa665('0x37')]=_['keys'](db['AnalyticExtractedReport'][_0xa665('0x48')]);_0x15a340[_0xa665('0x33')]=_[_0xa665('0x34')](_0x6cb437[_0xa665('0x33')]);_0x15a340[_0xa665('0x35')]=_[_0xa665('0x36')](_0x15a340[_0xa665('0x37')],_0x15a340[_0xa665('0x33')]);_0x1047a9[_0xa665('0x38')]=_[_0xa665('0x36')](_0x15a340[_0xa665('0x37')],qs[_0xa665('0x39')](_0x6cb437[_0xa665('0x33')][_0xa665('0x39')]));_0x1047a9[_0xa665('0x38')]=_0x1047a9['attributes'][_0xa665('0x3a')]?_0x1047a9['attributes']:_0x15a340['model'];if(_0x6cb437[_0xa665('0x33')][_0xa665('0x49')]){_0x1047a9[_0xa665('0x43')]=[{'all':!![]}];}_0x1047a9=_['merge']({},_0x1047a9,_0x6cb437['options']);return db['AnalyticExtractedReport']['find'](_0x1047a9)['then'](handleEntityNotFound(_0x27f36e,null))[_0xa665('0x25')](respondWithResult(_0x27f36e,null))['catch'](handleError(_0x27f36e,null));};exports[_0xa665('0x4a')]=function(_0x2e308c,_0x3c867b){return db[_0xa665('0x2f')][_0xa665('0x4a')](_0x2e308c[_0xa665('0x4b')],{})[_0xa665('0x25')](function(_0x53c077){var _0xe0cd62=_0x2e308c['user']['get']({'plain':!![]});if(!_0xe0cd62)throw new Error(_0xa665('0x4c'));if(_0xe0cd62[_0xa665('0x4d')]==='user'){var _0x1b6545=_0x53c077[_0xa665('0x4e')]({'plain':!![]});var _0x517533=_0xa665('0x27');return db['UserProfileSection'][_0xa665('0x4f')]({'where':{'name':_0x517533,'userProfileId':_0xe0cd62[_0xa665('0x50')]},'raw':!![]})['then'](function(_0xe7a7c7){if(_0xe7a7c7&&_0xe7a7c7[_0xa665('0x51')]===0x0){return db[_0xa665('0x28')][_0xa665('0x4a')]({'name':_0x1b6545[_0xa665('0x2b')],'resourceId':_0x1b6545['id'],'type':_0xe7a7c7[_0xa665('0x2b')],'sectionId':_0xe7a7c7['id']},{})[_0xa665('0x25')](function(){return _0x53c077;});}else{return _0x53c077;}})['catch'](function(_0x5c0683){logger[_0xa665('0x29')](_0xa665('0x52'),_0x5c0683);throw _0x5c0683;});}return _0x53c077;})[_0xa665('0x25')](respondWithResult(_0x3c867b,0xc9))[_0xa665('0x53')](handleError(_0x3c867b,null));};exports['update']=function(_0x33710c,_0x49eec8){if(_0x33710c[_0xa665('0x4b')]['id']){delete _0x33710c[_0xa665('0x4b')]['id'];}return db[_0xa665('0x2f')][_0xa665('0x4f')]({'where':{'id':_0x33710c[_0xa665('0x47')]['id']}})[_0xa665('0x25')](handleEntityNotFound(_0x49eec8,null))[_0xa665('0x25')](saveUpdates(_0x33710c[_0xa665('0x4b')],null))[_0xa665('0x25')](respondWithResult(_0x49eec8,null))['catch'](handleError(_0x49eec8,null));};exports[_0xa665('0x26')]=function(_0x1da593,_0x242842){return db[_0xa665('0x2f')][_0xa665('0x4f')]({'where':{'id':_0x1da593[_0xa665('0x47')]['id']}})['then'](handleEntityNotFound(_0x242842,null))[_0xa665('0x25')](removeEntity(_0x242842,null))[_0xa665('0x53')](handleError(_0x242842,null));};exports[_0xa665('0x54')]=function(_0x37dfee,_0x2663c0,_0x5ef77d){return db['AnalyticExtractedReport'][_0xa665('0x4f')]({'where':{'id':_0x37dfee[_0xa665('0x47')]['id']},'attributes':[_0xa665('0x2b'),'basename',_0xa665('0x55'),_0xa665('0x56')],'raw':!![]})[_0xa665('0x25')](handleEntityNotFound(_0x2663c0,null))[_0xa665('0x25')](function(_0x2e2c52){if(_0x2e2c52){if(!fs[_0xa665('0x57')](path[_0xa665('0x58')](config[_0xa665('0x59')],_0xa665('0x5a'),_0x2e2c52[_0xa665('0x55')]))){throw new db['Sequelize'][(_0xa665('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x37dfee[_0xa665('0x33')]['exists']){return _0x2663c0[_0xa665('0x5c')](0xc8);}return _0x2663c0['download'](path[_0xa665('0x58')](config['root'],_0xa665('0x5a'),_0x2e2c52[_0xa665('0x55')]),util[_0xa665('0x5d')](_0xa665('0x5e'),_0x2e2c52[_0xa665('0x5f')]||_0x2e2c52[_0xa665('0x2b')],_0x2e2c52[_0xa665('0x56')][_0xa665('0x60')]()));}})[_0xa665('0x53')](handleError(_0x2663c0,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 007e855..5f68cd4 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 _0xe441=['api','moment','request-promise','path','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util','../../config/logger'];(function(_0x84d96e,_0x57c507){var _0x4a5548=function(_0x4556c6){while(--_0x4556c6){_0x84d96e['push'](_0x84d96e['shift']());}};_0x4a5548(++_0x57c507);}(_0xe441,0xa2));var _0x1e44=function(_0x223e04,_0x15a0df){_0x223e04=_0x223e04-0x0;var _0xa0df60=_0xe441[_0x223e04];return _0xa0df60;};'use strict';var _=require(_0x1e44('0x0'));var util=require(_0x1e44('0x1'));var logger=require(_0x1e44('0x2'))(_0x1e44('0x3'));var moment=require(_0x1e44('0x4'));var BPromise=require('bluebird');var rp=require(_0x1e44('0x5'));var fs=require('fs');var path=require(_0x1e44('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1e44('0x7'));module[_0x1e44('0x8')]=function(_0x10f225,_0x69ab10){return _0x10f225[_0x1e44('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0x1e44('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdb43=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','bluebird','request-promise'];(function(_0x29feb2,_0x596cc4){var _0x93af00=function(_0x3f7cf2){while(--_0x3f7cf2){_0x29feb2['push'](_0x29feb2['shift']());}};_0x93af00(++_0x596cc4);}(_0xdb43,0x70));var _0x3db4=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xdb43[_0x40220a];return _0x3903cc;};'use strict';var _=require('lodash');var util=require(_0x3db4('0x0'));var logger=require(_0x3db4('0x1'))(_0x3db4('0x2'));var moment=require('moment');var BPromise=require(_0x3db4('0x3'));var rp=require(_0x3db4('0x4'));var fs=require('fs');var path=require(_0x3db4('0x5'));var rimraf=require(_0x3db4('0x6'));var config=require(_0x3db4('0x7'));var attributes=require(_0x3db4('0x8'));module[_0x3db4('0x9')]=function(_0x109be2,_0x5e5159){return _0x109be2[_0x3db4('0xa')](_0x3db4('0xb'),attributes,{'tableName':_0x3db4('0xc'),'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 93dd51d..2357db1 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 _0x0fa8=['result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x36fc1f,_0x479482){var _0x377e9e=function(_0x11e197){while(--_0x11e197){_0x36fc1f['push'](_0x36fc1f['shift']());}};_0x377e9e(++_0x479482);}(_0x0fa8,0x8c));var _0x80fa=function(_0x4fa92b,_0x7d972){_0x4fa92b=_0x4fa92b-0x0;var _0x2a6579=_0x0fa8[_0x4fa92b];return _0x2a6579;};'use strict';var _=require('lodash');var util=require(_0x80fa('0x0'));var moment=require(_0x80fa('0x1'));var BPromise=require(_0x80fa('0x2'));var rs=require(_0x80fa('0x3'));var fs=require('fs');var Redis=require(_0x80fa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x80fa('0x5'));var logger=require(_0x80fa('0x6'))(_0x80fa('0x7'));var config=require('../../config/environment');var jayson=require(_0x80fa('0x8'));var client=jayson[_0x80fa('0x9')][_0x80fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ad7b2,_0x2f4739,_0x90e54e){return new BPromise(function(_0x1c9ea0,_0x3de2f5){return client[_0x80fa('0xb')](_0x1ad7b2,_0x90e54e)[_0x80fa('0xc')](function(_0x5341e6){logger[_0x80fa('0xd')](_0x80fa('0xe'),_0x2f4739,_0x80fa('0xf'));logger[_0x80fa('0x10')](_0x80fa('0x11'),_0x2f4739,_0x80fa('0xf'),JSON['stringify'](_0x5341e6));if(_0x5341e6['error']){if(_0x5341e6[_0x80fa('0x12')][_0x80fa('0x13')]===0x1f4){logger[_0x80fa('0x12')](_0x80fa('0xe'),_0x2f4739,_0x5341e6[_0x80fa('0x12')]['message']);return _0x3de2f5(_0x5341e6[_0x80fa('0x12')][_0x80fa('0x14')]);}logger[_0x80fa('0x12')](_0x80fa('0xe'),_0x2f4739,_0x5341e6[_0x80fa('0x12')][_0x80fa('0x14')]);return _0x1c9ea0(_0x5341e6[_0x80fa('0x12')]['message']);}else{logger[_0x80fa('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2f4739,'request\x20sent');_0x1c9ea0(_0x5341e6[_0x80fa('0x15')][_0x80fa('0x14')]);}})[_0x80fa('0x16')](function(_0x2fff1b){logger['error'](_0x80fa('0xe'),_0x2f4739,_0x2fff1b);_0x3de2f5(_0x2fff1b);});});}
\ No newline at end of file
+var _0x609c=['AnalyticExtractedReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5cc8ff,_0x1c8a33){var _0x47e5e1=function(_0x3b9552){while(--_0x3b9552){_0x5cc8ff['push'](_0x5cc8ff['shift']());}};_0x47e5e1(++_0x1c8a33);}(_0x609c,0x18f));var _0xc609=function(_0x60bd64,_0x2d29a2){_0x60bd64=_0x60bd64-0x0;var _0x54673a=_0x609c[_0x60bd64];return _0x54673a;};'use strict';var _=require(_0xc609('0x0'));var util=require(_0xc609('0x1'));var moment=require(_0xc609('0x2'));var BPromise=require(_0xc609('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc609('0x4'));var db=require(_0xc609('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc609('0x6'))(_0xc609('0x7'));var config=require(_0xc609('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc609('0x9')][_0xc609('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1472e7,_0x29a5a6,_0xb95a){return new BPromise(function(_0x2f9282,_0x5c2351){return client[_0xc609('0xb')](_0x1472e7,_0xb95a)[_0xc609('0xc')](function(_0x170449){logger[_0xc609('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x29a5a6,'request\x20sent');logger[_0xc609('0xe')](_0xc609('0xf'),_0x29a5a6,'request\x20sent',JSON[_0xc609('0x10')](_0x170449));if(_0x170449[_0xc609('0x11')]){if(_0x170449['error'][_0xc609('0x12')]===0x1f4){logger[_0xc609('0x11')](_0xc609('0x13'),_0x29a5a6,_0x170449[_0xc609('0x11')][_0xc609('0x14')]);return _0x5c2351(_0x170449[_0xc609('0x11')][_0xc609('0x14')]);}logger[_0xc609('0x11')](_0xc609('0x13'),_0x29a5a6,_0x170449['error'][_0xc609('0x14')]);return _0x2f9282(_0x170449[_0xc609('0x11')][_0xc609('0x14')]);}else{logger['info'](_0xc609('0x13'),_0x29a5a6,'request\x20sent');_0x2f9282(_0x170449['result'][_0xc609('0x14')]);}})[_0xc609('0x15')](function(_0x2aa08a){logger[_0xc609('0x11')](_0xc609('0x13'),_0x29a5a6,_0x2aa08a);_0x5c2351(_0x2aa08a);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index ff14afe..5cdf092 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 _0xb6ba=['../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','destroy','exports','util','path','../../components/auth/service','../../components/interaction/service'];(function(_0x73a84b,_0x23d3bb){var _0x9e2a66=function(_0x2153dc){while(--_0x2153dc){_0x73a84b['push'](_0x73a84b['shift']());}};_0x9e2a66(++_0x23d3bb);}(_0xb6ba,0xe0));var _0xab6b=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0xb6ba[_0x3cea78];return _0x33b66b;};'use strict';var multer=require('multer');var util=require(_0xab6b('0x0'));var path=require(_0xab6b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xab6b('0x2'));var interaction=require(_0xab6b('0x3'));var config=require(_0xab6b('0x4'));var controller=require(_0xab6b('0x5'));router[_0xab6b('0x6')]('/',auth[_0xab6b('0x7')](),controller[_0xab6b('0x8')]);router['get'](_0xab6b('0x9'),auth[_0xab6b('0x7')](),controller[_0xab6b('0xa')]);router[_0xab6b('0x6')](_0xab6b('0xb'),auth[_0xab6b('0x7')](),controller[_0xab6b('0xc')]);router[_0xab6b('0xd')]('/',auth['isAuthenticated'](),controller[_0xab6b('0xe')]);router[_0xab6b('0xf')](_0xab6b('0x9'),auth[_0xab6b('0x7')](),controller[_0xab6b('0x10')]);router['delete'](_0xab6b('0x9'),auth[_0xab6b('0x7')](),controller[_0xab6b('0x11')]);module[_0xab6b('0x12')]=router;
\ No newline at end of file
+var _0x2f2d=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','show','/:id/download','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x217c2e,_0x358f06){var _0x22b7d8=function(_0x111c48){while(--_0x111c48){_0x217c2e['push'](_0x217c2e['shift']());}};_0x22b7d8(++_0x358f06);}(_0x2f2d,0x10d));var _0xd2f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f2d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd2f2('0x0'));var util=require(_0xd2f2('0x1'));var path=require(_0xd2f2('0x2'));var timeout=require(_0xd2f2('0x3'));var express=require(_0xd2f2('0x4'));var router=express[_0xd2f2('0x5')]();var fs_extra=require(_0xd2f2('0x6'));var auth=require(_0xd2f2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd2f2('0x8'));var controller=require(_0xd2f2('0x9'));router[_0xd2f2('0xa')]('/',auth[_0xd2f2('0xb')](),controller['index']);router['get']('/:id',auth[_0xd2f2('0xb')](),controller[_0xd2f2('0xc')]);router[_0xd2f2('0xa')](_0xd2f2('0xd'),auth[_0xd2f2('0xb')](),controller['download']);router[_0xd2f2('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd2f2('0xf')](_0xd2f2('0x10'),auth[_0xd2f2('0xb')](),controller[_0xd2f2('0x11')]);router[_0xd2f2('0x12')](_0xd2f2('0x10'),auth[_0xd2f2('0xb')](),controller[_0xd2f2('0x13')]);module[_0xd2f2('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 3b84fa1..9e302c0 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 _0x80e0=['sequelize','exports','STRING','BOOLEAN'];(function(_0x308109,_0x4347f0){var _0x29d4b=function(_0x3277e5){while(--_0x3277e5){_0x308109['push'](_0x308109['shift']());}};_0x29d4b(++_0x4347f0);}(_0x80e0,0x98));var _0x080e=function(_0x5a2b9a,_0x4359c9){_0x5a2b9a=_0x5a2b9a-0x0;var _0x100c09=_0x80e0[_0x5a2b9a];return _0x100c09;};'use strict';var Sequelize=require(_0x080e('0x0'));module[_0x080e('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x080e('0x2')]},'format':{'type':Sequelize[_0x080e('0x2')]},'groupBy':{'type':Sequelize[_0x080e('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x080e('0x2')]},'custom':{'type':Sequelize[_0x080e('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x0bb0=['STRING','BOOLEAN','exports','TEXT'];(function(_0x2a7898,_0x21cb4a){var _0x57e7f0=function(_0x583a12){while(--_0x583a12){_0x2a7898['push'](_0x2a7898['shift']());}};_0x57e7f0(++_0x21cb4a);}(_0x0bb0,0x142));var _0x00bb=function(_0x2c9513,_0x545a12){_0x2c9513=_0x2c9513-0x0;var _0x28802b=_0x0bb0[_0x2c9513];return _0x28802b;};'use strict';var Sequelize=require('sequelize');module[_0x00bb('0x0')]={'field':{'type':Sequelize[_0x00bb('0x1')]},'alias':{'type':Sequelize[_0x00bb('0x2')]},'function':{'type':Sequelize[_0x00bb('0x2')]},'format':{'type':Sequelize[_0x00bb('0x2')]},'groupBy':{'type':Sequelize[_0x00bb('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x00bb('0x2')]},'custom':{'type':Sequelize[_0x00bb('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 3caa5e2..0a4b8b7 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 _0xc43b=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','length','options','create','body','catch','bulkCreate','find','bulkDestroy','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3a834c,_0x475e51){var _0x689233=function(_0x2005f2){while(--_0x2005f2){_0x3a834c['push'](_0x3a834c['shift']());}};_0x689233(++_0x475e51);}(_0xc43b,0x1e3));var _0xbc43=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc43b[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0xbc43('0x0'));var rimraf=require(_0xbc43('0x1'));var zipdir=require(_0xbc43('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbc43('0x3'));var BPromise=require(_0xbc43('0x4'));var Mustache=require(_0xbc43('0x5'));var util=require('util');var path=require('path');var sox=require(_0xbc43('0x6'));var csv=require(_0xbc43('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc43('0x8'));var _=require(_0xbc43('0x9'));var squel=require(_0xbc43('0xa'));var crypto=require(_0xbc43('0xb'));var jsforce=require(_0xbc43('0xc'));var deskjs=require(_0xbc43('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbc43('0xe'));var Papa=require(_0xbc43('0xf'));var Redis=require(_0xbc43('0x10'));var authService=require(_0xbc43('0x11'));var qs=require(_0xbc43('0x12'));var as=require(_0xbc43('0x13'));var hardwareService=require(_0xbc43('0x14'));var logger=require(_0xbc43('0x15'))(_0xbc43('0x16'));var utils=require('../../config/utils');var config=require(_0xbc43('0x17'));var licenseUtil=require(_0xbc43('0x18'));var db=require(_0xbc43('0x19'))['db'];function respondWithStatusCode(_0x5f322c,_0x26e243){_0x26e243=_0x26e243||0xcc;return function(_0x174639){if(_0x174639){return _0x5f322c[_0xbc43('0x1a')](_0x26e243);}return _0x5f322c[_0xbc43('0x1b')](_0x26e243)[_0xbc43('0x1c')]();};}function respondWithResult(_0x1588ac,_0x199c8e){_0x199c8e=_0x199c8e||0xc8;return function(_0x16838b){if(_0x16838b){return _0x1588ac[_0xbc43('0x1b')](_0x199c8e)[_0xbc43('0x1d')](_0x16838b);}};}function respondWithFilteredResult(_0x582c67,_0x2e1401){return function(_0x37bce){if(_0x37bce){var _0x2dd04f=typeof _0x2e1401[_0xbc43('0x1e')]==='undefined'&&typeof _0x2e1401[_0xbc43('0x1f')]===_0xbc43('0x20');var _0x30c93c=_0x37bce[_0xbc43('0x21')];var _0x43602e=_0x2dd04f?0x0:_0x2e1401['offset'];var _0x32e6ee=_0x2dd04f?_0x37bce[_0xbc43('0x21')]:_0x2e1401[_0xbc43('0x1e')]+_0x2e1401['limit'];var _0x5a829a;if(_0x32e6ee>=_0x30c93c){_0x32e6ee=_0x30c93c;_0x5a829a=0xc8;}else{_0x5a829a=0xce;}_0x582c67[_0xbc43('0x1b')](_0x5a829a);return _0x582c67[_0xbc43('0x22')]('Content-Range',_0x43602e+'-'+_0x32e6ee+'/'+_0x30c93c)[_0xbc43('0x1d')](_0x37bce);}return null;};}function patchUpdates(_0x4dbb6e){return function(_0x81b435){try{jsonpatch[_0xbc43('0x23')](_0x81b435,_0x4dbb6e,!![]);}catch(_0x3a29ff){return BPromise['reject'](_0x3a29ff);}return _0x81b435[_0xbc43('0x24')]();};}function saveUpdates(_0x46192f,_0x3c2b52){return function(_0x3eb797){if(_0x3eb797){return _0x3eb797[_0xbc43('0x25')](_0x46192f)[_0xbc43('0x26')](function(_0x16dc30){return _0x16dc30;});}return null;};}function removeEntity(_0x3972c8,_0x301a7a){return function(_0x6a9c9){if(_0x6a9c9){return _0x6a9c9[_0xbc43('0x27')]()[_0xbc43('0x26')](function(){_0x3972c8[_0xbc43('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x268407,_0x492e98){return function(_0x34073c){if(!_0x34073c){_0x268407[_0xbc43('0x1a')](0x194);}return _0x34073c;};}function handleError(_0x172ef9,_0x1f9f17){_0x1f9f17=_0x1f9f17||0x1f4;return function(_0x4a026b){logger[_0xbc43('0x28')](_0x4a026b[_0xbc43('0x29')]);if(_0x4a026b['name']){delete _0x4a026b[_0xbc43('0x2a')];}_0x172ef9[_0xbc43('0x1b')](_0x1f9f17)[_0xbc43('0x2b')](_0x4a026b);};}exports[_0xbc43('0x2c')]=function(_0x25a37b,_0x6d6d92){var _0x12b59e={},_0x5103ca={},_0x16d8b9={'count':0x0,'rows':[]};var _0x1eefad=_[_0xbc43('0x2d')](db[_0xbc43('0x2e')][_0xbc43('0x2f')],function(_0xb16b17){return{'name':_0xb16b17[_0xbc43('0x30')],'type':_0xb16b17[_0xbc43('0x31')]['key']};});_0x5103ca[_0xbc43('0x32')]=_[_0xbc43('0x2d')](_0x1eefad,_0xbc43('0x2a'));_0x5103ca[_0xbc43('0x33')]=_['keys'](_0x25a37b[_0xbc43('0x33')]);_0x5103ca['filters']=_[_0xbc43('0x34')](_0x5103ca[_0xbc43('0x32')],_0x5103ca[_0xbc43('0x33')]);_0x12b59e['attributes']=_[_0xbc43('0x34')](_0x5103ca[_0xbc43('0x32')],qs[_0xbc43('0x35')](_0x25a37b[_0xbc43('0x33')][_0xbc43('0x35')]));_0x12b59e['attributes']=_0x12b59e[_0xbc43('0x36')]['length']?_0x12b59e[_0xbc43('0x36')]:_0x5103ca[_0xbc43('0x32')];if(!_0x25a37b[_0xbc43('0x33')][_0xbc43('0x37')](_0xbc43('0x38'))){_0x12b59e[_0xbc43('0x1f')]=qs[_0xbc43('0x1f')](_0x25a37b['query'][_0xbc43('0x1f')]);_0x12b59e['offset']=qs[_0xbc43('0x1e')](_0x25a37b['query'][_0xbc43('0x1e')]);}_0x12b59e['order']=qs[_0xbc43('0x39')](_0x25a37b['query'][_0xbc43('0x39')]);_0x12b59e[_0xbc43('0x3a')]=qs[_0xbc43('0x3b')](_[_0xbc43('0x3c')](_0x25a37b[_0xbc43('0x33')],_0x5103ca['filters']),_0x1eefad);if(_0x25a37b[_0xbc43('0x33')][_0xbc43('0x3d')]){_0x12b59e['where']=_[_0xbc43('0x3e')](_0x12b59e[_0xbc43('0x3a')],{'$or':_[_0xbc43('0x2d')](_0x1eefad,function(_0x1de208){if(_0x1de208[_0xbc43('0x31')]!==_0xbc43('0x3f')){var _0x35364e={};_0x35364e[_0x1de208[_0xbc43('0x2a')]]={'$like':'%'+_0x25a37b['query'][_0xbc43('0x3d')]+'%'};return _0x35364e;}})});}_0x12b59e=_[_0xbc43('0x3e')]({},_0x12b59e,_0x25a37b['options']);var _0x3c32e0={'where':_0x12b59e[_0xbc43('0x3a')]};return db[_0xbc43('0x2e')][_0xbc43('0x21')](_0x3c32e0)['then'](function(_0x597664){_0x16d8b9[_0xbc43('0x21')]=_0x597664;if(_0x25a37b[_0xbc43('0x33')][_0xbc43('0x40')]){_0x12b59e[_0xbc43('0x41')]=[{'all':!![]}];}return db[_0xbc43('0x2e')][_0xbc43('0x42')](_0x12b59e);})[_0xbc43('0x26')](function(_0x2a2a89){_0x16d8b9[_0xbc43('0x43')]=_0x2a2a89;return _0x16d8b9;})['then'](respondWithFilteredResult(_0x6d6d92,_0x12b59e))['catch'](handleError(_0x6d6d92,null));};exports[_0xbc43('0x44')]=function(_0x633fb1,_0x18ed6f){var _0x30e56e={'raw':![],'where':{'id':_0x633fb1[_0xbc43('0x45')]['id']}},_0x344ed4={};_0x344ed4['model']=_[_0xbc43('0x46')](db[_0xbc43('0x2e')][_0xbc43('0x2f')]);_0x344ed4[_0xbc43('0x33')]=_[_0xbc43('0x46')](_0x633fb1[_0xbc43('0x33')]);_0x344ed4[_0xbc43('0x3b')]=_[_0xbc43('0x34')](_0x344ed4[_0xbc43('0x32')],_0x344ed4['query']);_0x30e56e[_0xbc43('0x36')]=_['intersection'](_0x344ed4[_0xbc43('0x32')],qs[_0xbc43('0x35')](_0x633fb1['query'][_0xbc43('0x35')]));_0x30e56e[_0xbc43('0x36')]=_0x30e56e[_0xbc43('0x36')][_0xbc43('0x47')]?_0x30e56e[_0xbc43('0x36')]:_0x344ed4[_0xbc43('0x32')];if(_0x633fb1[_0xbc43('0x33')][_0xbc43('0x40')]){_0x30e56e[_0xbc43('0x41')]=[{'all':!![]}];}_0x30e56e=_[_0xbc43('0x3e')]({},_0x30e56e,_0x633fb1[_0xbc43('0x48')]);return db['AnalyticFieldReport']['find'](_0x30e56e)[_0xbc43('0x26')](handleEntityNotFound(_0x18ed6f,null))[_0xbc43('0x26')](respondWithResult(_0x18ed6f,null))['catch'](handleError(_0x18ed6f,null));};exports[_0xbc43('0x49')]=function(_0x51d257,_0x4493ff){return db[_0xbc43('0x2e')][_0xbc43('0x49')](_0x51d257[_0xbc43('0x4a')],{})[_0xbc43('0x26')](respondWithResult(_0x4493ff,0xc9))[_0xbc43('0x4b')](handleError(_0x4493ff,null));};exports[_0xbc43('0x4c')]=function(_0x161404,_0x364433){return db[_0xbc43('0x2e')][_0xbc43('0x4c')](_0x161404[_0xbc43('0x4a')],{'raw':![],'individualHooks':!![]})[_0xbc43('0x26')](respondWithResult(_0x364433,0xc9))[_0xbc43('0x4b')](handleError(_0x364433,null));};exports[_0xbc43('0x25')]=function(_0x326e7c,_0x4daa76){if(_0x326e7c['body']['id']){delete _0x326e7c[_0xbc43('0x4a')]['id'];}return db['AnalyticFieldReport'][_0xbc43('0x4d')]({'where':{'id':_0x326e7c[_0xbc43('0x45')]['id']}})[_0xbc43('0x26')](handleEntityNotFound(_0x4daa76,null))[_0xbc43('0x26')](saveUpdates(_0x326e7c[_0xbc43('0x4a')],null))[_0xbc43('0x26')](respondWithResult(_0x4daa76,null))[_0xbc43('0x4b')](handleError(_0x4daa76,null));};exports[_0xbc43('0x27')]=function(_0x335691,_0x38c91d){return db[_0xbc43('0x2e')][_0xbc43('0x4d')]({'where':{'id':_0x335691[_0xbc43('0x45')]['id']}})[_0xbc43('0x26')](handleEntityNotFound(_0x38c91d,null))[_0xbc43('0x26')](removeEntity(_0x38c91d,null))['catch'](handleError(_0x38c91d,null));};exports[_0xbc43('0x4e')]=function(_0x50571c,_0x225f11){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x50571c[_0xbc43('0x33')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xbc43('0x26')](respondWithResult(_0x225f11,0xcc))[_0xbc43('0x4b')](handleError(_0x225f11,null));};exports['addFields']=function(_0x514c96,_0x3a2961,_0x3db5d8){return db[_0xbc43('0x4f')][_0xbc43('0x50')]({'where':{'id':_0x514c96[_0xbc43('0x45')]['id']}})[_0xbc43('0x26')](handleEntityNotFound(_0x3a2961,null))[_0xbc43('0x26')](function(_0x935864){if(_0x935864){return db[_0xbc43('0x51')][_0xbc43('0x52')](function(_0x1a9996){return db[_0xbc43('0x2e')][_0xbc43('0x27')]({'where':{'CustomReportId':_0x514c96[_0xbc43('0x45')]['id']},'transaction':_0x1a9996})[_0xbc43('0x26')](function(_0x19d69d){var _0x1d58ce=_[_0xbc43('0x2d')](_0x514c96[_0xbc43('0x4a')],function(_0x1a0d97){delete _0x1a0d97['id'];_0x1a0d97[_0xbc43('0x53')]=_0x514c96[_0xbc43('0x45')]['id'];return _0x1a0d97;});return db[_0xbc43('0x2e')][_0xbc43('0x4c')](_0x1d58ce,{'transaction':_0x1a9996});});})[_0xbc43('0x26')](function(){return db[_0xbc43('0x2e')][_0xbc43('0x42')]({'where':{'CustomReportId':_0x514c96[_0xbc43('0x45')]['id']}});});}})[_0xbc43('0x26')](respondWithResult(_0x3a2961,null))[_0xbc43('0x4b')](handleError(_0x3a2961,null));};
\ No newline at end of file
+var _0xbe5d=['update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','AnalyticFieldReport','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','bulkCreate','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x2be1f,_0x548fd4){var _0x2d1372=function(_0x570d87){while(--_0x570d87){_0x2be1f['push'](_0x2be1f['shift']());}};_0x2d1372(++_0x548fd4);}(_0xbe5d,0x12a));var _0xdbe5=function(_0x2d46a3,_0x28457a){_0x2d46a3=_0x2d46a3-0x0;var _0x169497=_0xbe5d[_0x2d46a3];return _0x169497;};'use strict';var emlformat=require(_0xdbe5('0x0'));var rimraf=require(_0xdbe5('0x1'));var zipdir=require(_0xdbe5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdbe5('0x3'));var moment=require(_0xdbe5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdbe5('0x5'));var sox=require(_0xdbe5('0x6'));var csv=require('to-csv');var ejs=require(_0xdbe5('0x7'));var fs=require('fs');var fs_extra=require(_0xdbe5('0x8'));var _=require(_0xdbe5('0x9'));var squel=require('squel');var crypto=require(_0xdbe5('0xa'));var jsforce=require(_0xdbe5('0xb'));var deskjs=require(_0xdbe5('0xc'));var toCsv=require(_0xdbe5('0xd'));var querystring=require('querystring');var Papa=require(_0xdbe5('0xe'));var Redis=require(_0xdbe5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdbe5('0x10'));var as=require(_0xdbe5('0x11'));var hardwareService=require(_0xdbe5('0x12'));var logger=require(_0xdbe5('0x13'))(_0xdbe5('0x14'));var utils=require(_0xdbe5('0x15'));var config=require(_0xdbe5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdbe5('0x17'))['db'];function respondWithStatusCode(_0x2cbc2b,_0x36ec48){_0x36ec48=_0x36ec48||0xcc;return function(_0x2661df){if(_0x2661df){return _0x2cbc2b['sendStatus'](_0x36ec48);}return _0x2cbc2b[_0xdbe5('0x18')](_0x36ec48)[_0xdbe5('0x19')]();};}function respondWithResult(_0x4f1a7d,_0x6e05d2){_0x6e05d2=_0x6e05d2||0xc8;return function(_0x290e2a){if(_0x290e2a){return _0x4f1a7d[_0xdbe5('0x18')](_0x6e05d2)[_0xdbe5('0x1a')](_0x290e2a);}};}function respondWithFilteredResult(_0x39a50b,_0x1238fe){return function(_0x1c8b67){if(_0x1c8b67){var _0x20b59e=typeof _0x1238fe['offset']===_0xdbe5('0x1b')&&typeof _0x1238fe[_0xdbe5('0x1c')]===_0xdbe5('0x1b');var _0x364a5f=_0x1c8b67[_0xdbe5('0x1d')];var _0x4dfca9=_0x20b59e?0x0:_0x1238fe[_0xdbe5('0x1e')];var _0x14c017=_0x20b59e?_0x1c8b67[_0xdbe5('0x1d')]:_0x1238fe[_0xdbe5('0x1e')]+_0x1238fe[_0xdbe5('0x1c')];var _0x52bdf5;if(_0x14c017>=_0x364a5f){_0x14c017=_0x364a5f;_0x52bdf5=0xc8;}else{_0x52bdf5=0xce;}_0x39a50b[_0xdbe5('0x18')](_0x52bdf5);return _0x39a50b[_0xdbe5('0x1f')](_0xdbe5('0x20'),_0x4dfca9+'-'+_0x14c017+'/'+_0x364a5f)[_0xdbe5('0x1a')](_0x1c8b67);}return null;};}function patchUpdates(_0x363d0d){return function(_0x46d492){try{jsonpatch[_0xdbe5('0x21')](_0x46d492,_0x363d0d,!![]);}catch(_0x2589a9){return BPromise['reject'](_0x2589a9);}return _0x46d492['save']();};}function saveUpdates(_0x294a95,_0x4a4957){return function(_0x2a8604){if(_0x2a8604){return _0x2a8604[_0xdbe5('0x22')](_0x294a95)[_0xdbe5('0x23')](function(_0x573c3e){return _0x573c3e;});}return null;};}function removeEntity(_0x130a36,_0x2125ae){return function(_0x5b0004){if(_0x5b0004){return _0x5b0004['destroy']()['then'](function(){_0x130a36[_0xdbe5('0x18')](0xcc)[_0xdbe5('0x19')]();});}};}function handleEntityNotFound(_0x3624c2,_0x187b7d){return function(_0x4590da){if(!_0x4590da){_0x3624c2[_0xdbe5('0x24')](0x194);}return _0x4590da;};}function handleError(_0xe871e2,_0x390c1d){_0x390c1d=_0x390c1d||0x1f4;return function(_0x5a9907){logger[_0xdbe5('0x25')](_0x5a9907['stack']);if(_0x5a9907[_0xdbe5('0x26')]){delete _0x5a9907[_0xdbe5('0x26')];}_0xe871e2['status'](_0x390c1d)[_0xdbe5('0x27')](_0x5a9907);};}exports[_0xdbe5('0x28')]=function(_0x59dac0,_0x266f77){var _0x2bb63d={},_0xe48d45={},_0x22ef03={'count':0x0,'rows':[]};var _0x3b891e=_[_0xdbe5('0x29')](db['AnalyticFieldReport'][_0xdbe5('0x2a')],function(_0x192445){return{'name':_0x192445[_0xdbe5('0x2b')],'type':_0x192445['type'][_0xdbe5('0x2c')]};});_0xe48d45[_0xdbe5('0x2d')]=_[_0xdbe5('0x29')](_0x3b891e,_0xdbe5('0x26'));_0xe48d45[_0xdbe5('0x2e')]=_[_0xdbe5('0x2f')](_0x59dac0['query']);_0xe48d45[_0xdbe5('0x30')]=_[_0xdbe5('0x31')](_0xe48d45['model'],_0xe48d45['query']);_0x2bb63d['attributes']=_[_0xdbe5('0x31')](_0xe48d45['model'],qs[_0xdbe5('0x32')](_0x59dac0['query']['fields']));_0x2bb63d[_0xdbe5('0x33')]=_0x2bb63d[_0xdbe5('0x33')][_0xdbe5('0x34')]?_0x2bb63d['attributes']:_0xe48d45[_0xdbe5('0x2d')];if(!_0x59dac0[_0xdbe5('0x2e')][_0xdbe5('0x35')]('nolimit')){_0x2bb63d[_0xdbe5('0x1c')]=qs[_0xdbe5('0x1c')](_0x59dac0[_0xdbe5('0x2e')][_0xdbe5('0x1c')]);_0x2bb63d[_0xdbe5('0x1e')]=qs[_0xdbe5('0x1e')](_0x59dac0[_0xdbe5('0x2e')][_0xdbe5('0x1e')]);}_0x2bb63d[_0xdbe5('0x36')]=qs[_0xdbe5('0x37')](_0x59dac0[_0xdbe5('0x2e')]['sort']);_0x2bb63d[_0xdbe5('0x38')]=qs[_0xdbe5('0x30')](_[_0xdbe5('0x39')](_0x59dac0['query'],_0xe48d45[_0xdbe5('0x30')]),_0x3b891e);if(_0x59dac0[_0xdbe5('0x2e')][_0xdbe5('0x3a')]){_0x2bb63d[_0xdbe5('0x38')]=_[_0xdbe5('0x3b')](_0x2bb63d[_0xdbe5('0x38')],{'$or':_[_0xdbe5('0x29')](_0x3b891e,function(_0x28d976){if(_0x28d976[_0xdbe5('0x3c')]!==_0xdbe5('0x3d')){var _0x4f16b7={};_0x4f16b7[_0x28d976[_0xdbe5('0x26')]]={'$like':'%'+_0x59dac0[_0xdbe5('0x2e')]['filter']+'%'};return _0x4f16b7;}})});}_0x2bb63d=_[_0xdbe5('0x3b')]({},_0x2bb63d,_0x59dac0[_0xdbe5('0x3e')]);var _0x1c59d8={'where':_0x2bb63d[_0xdbe5('0x38')]};return db[_0xdbe5('0x3f')][_0xdbe5('0x1d')](_0x1c59d8)[_0xdbe5('0x23')](function(_0x50543d){_0x22ef03[_0xdbe5('0x1d')]=_0x50543d;if(_0x59dac0[_0xdbe5('0x2e')][_0xdbe5('0x40')]){_0x2bb63d[_0xdbe5('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xdbe5('0x42')](_0x2bb63d);})[_0xdbe5('0x23')](function(_0x557187){_0x22ef03[_0xdbe5('0x43')]=_0x557187;return _0x22ef03;})[_0xdbe5('0x23')](respondWithFilteredResult(_0x266f77,_0x2bb63d))[_0xdbe5('0x44')](handleError(_0x266f77,null));};exports[_0xdbe5('0x45')]=function(_0x258ebe,_0x38c59c){var _0x5f19d0={'raw':![],'where':{'id':_0x258ebe['params']['id']}},_0x557b75={};_0x557b75[_0xdbe5('0x2d')]=_[_0xdbe5('0x2f')](db['AnalyticFieldReport'][_0xdbe5('0x2a')]);_0x557b75[_0xdbe5('0x2e')]=_[_0xdbe5('0x2f')](_0x258ebe[_0xdbe5('0x2e')]);_0x557b75[_0xdbe5('0x30')]=_[_0xdbe5('0x31')](_0x557b75['model'],_0x557b75[_0xdbe5('0x2e')]);_0x5f19d0[_0xdbe5('0x33')]=_['intersection'](_0x557b75[_0xdbe5('0x2d')],qs['fields'](_0x258ebe[_0xdbe5('0x2e')]['fields']));_0x5f19d0['attributes']=_0x5f19d0[_0xdbe5('0x33')][_0xdbe5('0x34')]?_0x5f19d0[_0xdbe5('0x33')]:_0x557b75[_0xdbe5('0x2d')];if(_0x258ebe['query'][_0xdbe5('0x40')]){_0x5f19d0[_0xdbe5('0x41')]=[{'all':!![]}];}_0x5f19d0=_[_0xdbe5('0x3b')]({},_0x5f19d0,_0x258ebe[_0xdbe5('0x3e')]);return db[_0xdbe5('0x3f')][_0xdbe5('0x46')](_0x5f19d0)[_0xdbe5('0x23')](handleEntityNotFound(_0x38c59c,null))[_0xdbe5('0x23')](respondWithResult(_0x38c59c,null))[_0xdbe5('0x44')](handleError(_0x38c59c,null));};exports[_0xdbe5('0x47')]=function(_0x5d9a4f,_0x441434){return db['AnalyticFieldReport'][_0xdbe5('0x47')](_0x5d9a4f[_0xdbe5('0x48')],{})[_0xdbe5('0x23')](respondWithResult(_0x441434,0xc9))['catch'](handleError(_0x441434,null));};exports['bulkCreate']=function(_0xf3c3ab,_0x42817a){return db[_0xdbe5('0x3f')]['bulkCreate'](_0xf3c3ab[_0xdbe5('0x48')],{'raw':![],'individualHooks':!![]})[_0xdbe5('0x23')](respondWithResult(_0x42817a,0xc9))[_0xdbe5('0x44')](handleError(_0x42817a,null));};exports[_0xdbe5('0x22')]=function(_0x2a6e1b,_0x486923){if(_0x2a6e1b[_0xdbe5('0x48')]['id']){delete _0x2a6e1b[_0xdbe5('0x48')]['id'];}return db[_0xdbe5('0x3f')][_0xdbe5('0x46')]({'where':{'id':_0x2a6e1b[_0xdbe5('0x49')]['id']}})[_0xdbe5('0x23')](handleEntityNotFound(_0x486923,null))['then'](saveUpdates(_0x2a6e1b[_0xdbe5('0x48')],null))[_0xdbe5('0x23')](respondWithResult(_0x486923,null))[_0xdbe5('0x44')](handleError(_0x486923,null));};exports[_0xdbe5('0x4a')]=function(_0x4c0085,_0x2325c0){return db[_0xdbe5('0x3f')][_0xdbe5('0x46')]({'where':{'id':_0x4c0085[_0xdbe5('0x49')]['id']}})[_0xdbe5('0x23')](handleEntityNotFound(_0x2325c0,null))[_0xdbe5('0x23')](removeEntity(_0x2325c0,null))['catch'](handleError(_0x2325c0,null));};exports['bulkDestroy']=function(_0x441216,_0x49ee01){return db[_0xdbe5('0x3f')][_0xdbe5('0x4a')]({'where':{'id':_0x441216[_0xdbe5('0x2e')][_0xdbe5('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0xdbe5('0x23')](respondWithResult(_0x49ee01,0xcc))[_0xdbe5('0x44')](handleError(_0x49ee01,null));};exports[_0xdbe5('0x4c')]=function(_0x18f508,_0x52080f,_0x18050f){return db[_0xdbe5('0x4d')][_0xdbe5('0x4e')]({'where':{'id':_0x18f508[_0xdbe5('0x49')]['id']}})[_0xdbe5('0x23')](handleEntityNotFound(_0x52080f,null))['then'](function(_0x3257b1){if(_0x3257b1){return db[_0xdbe5('0x4f')][_0xdbe5('0x50')](function(_0x56e9b3){return db[_0xdbe5('0x3f')][_0xdbe5('0x4a')]({'where':{'CustomReportId':_0x18f508[_0xdbe5('0x49')]['id']},'transaction':_0x56e9b3})[_0xdbe5('0x23')](function(_0x18f993){var _0x7e0db8=_['map'](_0x18f508[_0xdbe5('0x48')],function(_0x11d584){delete _0x11d584['id'];_0x11d584[_0xdbe5('0x51')]=_0x18f508['params']['id'];return _0x11d584;});return db[_0xdbe5('0x3f')][_0xdbe5('0x52')](_0x7e0db8,{'transaction':_0x56e9b3});});})[_0xdbe5('0x23')](function(){return db[_0xdbe5('0x3f')][_0xdbe5('0x42')]({'where':{'CustomReportId':_0x18f508[_0xdbe5('0x49')]['id']}});});}})['then'](respondWithResult(_0x52080f,null))[_0xdbe5('0x44')](handleError(_0x52080f,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 77b618a..c63f500 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 _0x8bf5=['api','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x6a4fb0,_0x34915b){var _0x478350=function(_0x138fc3){while(--_0x138fc3){_0x6a4fb0['push'](_0x6a4fb0['shift']());}};_0x478350(++_0x34915b);}(_0x8bf5,0x19d));var _0x58bf=function(_0x909734,_0x16d6c2){_0x909734=_0x909734-0x0;var _0x1063eb=_0x8bf5[_0x909734];return _0x1063eb;};'use strict';var _=require(_0x58bf('0x0'));var util=require(_0x58bf('0x1'));var logger=require(_0x58bf('0x2'))(_0x58bf('0x3'));var moment=require('moment');var BPromise=require(_0x58bf('0x4'));var rp=require(_0x58bf('0x5'));var fs=require('fs');var path=require(_0x58bf('0x6'));var rimraf=require('rimraf');var config=require(_0x58bf('0x7'));var attributes=require(_0x58bf('0x8'));module[_0x58bf('0x9')]=function(_0x45c691,_0x21e95c){return _0x45c691[_0x58bf('0xa')](_0x58bf('0xb'),attributes,{'tableName':_0x58bf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9903=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','util','../../config/logger','api'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x9903,0x1a1));var _0x3990=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9903[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3990('0x0'));var logger=require(_0x3990('0x1'))(_0x3990('0x2'));var moment=require('moment');var BPromise=require(_0x3990('0x3'));var rp=require(_0x3990('0x4'));var fs=require('fs');var path=require(_0x3990('0x5'));var rimraf=require(_0x3990('0x6'));var config=require(_0x3990('0x7'));var attributes=require(_0x3990('0x8'));module[_0x3990('0x9')]=function(_0x1e15f9,_0x696267){return _0x1e15f9[_0x3990('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0x3990('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 344c523..95d7576 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 _0xf819=['request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3d3c89,_0x51bf87){var _0x181dd1=function(_0x21ac73){while(--_0x21ac73){_0x3d3c89['push'](_0x3d3c89['shift']());}};_0x181dd1(++_0x51bf87);}(_0xf819,0x9d));var _0x9f81=function(_0x2a66df,_0x4e9b7b){_0x2a66df=_0x2a66df-0x0;var _0x3186b2=_0xf819[_0x2a66df];return _0x3186b2;};'use strict';var _=require(_0x9f81('0x0'));var util=require(_0x9f81('0x1'));var moment=require('moment');var BPromise=require(_0x9f81('0x2'));var rs=require(_0x9f81('0x3'));var fs=require('fs');var Redis=require(_0x9f81('0x4'));var db=require(_0x9f81('0x5'))['db'];var utils=require(_0x9f81('0x6'));var logger=require('../../config/logger')(_0x9f81('0x7'));var config=require('../../config/environment');var jayson=require(_0x9f81('0x8'));var client=jayson[_0x9f81('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42629a,_0x5976cd,_0x64195e){return new BPromise(function(_0x38ba13,_0x5a45fe){return client[_0x9f81('0xa')](_0x42629a,_0x64195e)[_0x9f81('0xb')](function(_0x320736){logger['info'](_0x9f81('0xc'),_0x5976cd,'request\x20sent');logger[_0x9f81('0xd')](_0x9f81('0xe'),_0x5976cd,'request\x20sent',JSON[_0x9f81('0xf')](_0x320736));if(_0x320736['error']){if(_0x320736[_0x9f81('0x10')][_0x9f81('0x11')]===0x1f4){logger[_0x9f81('0x10')](_0x9f81('0xc'),_0x5976cd,_0x320736[_0x9f81('0x10')][_0x9f81('0x12')]);return _0x5a45fe(_0x320736[_0x9f81('0x10')][_0x9f81('0x12')]);}logger[_0x9f81('0x10')](_0x9f81('0xc'),_0x5976cd,_0x320736[_0x9f81('0x10')]['message']);return _0x38ba13(_0x320736[_0x9f81('0x10')][_0x9f81('0x12')]);}else{logger['info'](_0x9f81('0xc'),_0x5976cd,_0x9f81('0x13'));_0x38ba13(_0x320736[_0x9f81('0x14')][_0x9f81('0x12')]);}})[_0x9f81('0x15')](function(_0x576e76){logger[_0x9f81('0x10')](_0x9f81('0xc'),_0x5976cd,_0x576e76);_0x5a45fe(_0x576e76);});});}
\ No newline at end of file
+var _0x81b8=['rpc','../../config/environment','jayson/promise','client','http','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4bdc88,_0x58297c){var _0x2b7173=function(_0x7f679f){while(--_0x7f679f){_0x4bdc88['push'](_0x4bdc88['shift']());}};_0x2b7173(++_0x58297c);}(_0x81b8,0xb1));var _0x881b=function(_0x3dc852,_0x4d908f){_0x3dc852=_0x3dc852-0x0;var _0x42921d=_0x81b8[_0x3dc852];return _0x42921d;};'use strict';var _=require(_0x881b('0x0'));var util=require('util');var moment=require(_0x881b('0x1'));var BPromise=require(_0x881b('0x2'));var rs=require(_0x881b('0x3'));var fs=require('fs');var Redis=require(_0x881b('0x4'));var db=require(_0x881b('0x5'))['db'];var utils=require(_0x881b('0x6'));var logger=require('../../config/logger')(_0x881b('0x7'));var config=require(_0x881b('0x8'));var jayson=require(_0x881b('0x9'));var client=jayson[_0x881b('0xa')][_0x881b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54cc7b,_0x13bd3f,_0x41a2af){return new BPromise(function(_0x38cda9,_0x30318e){return client['request'](_0x54cc7b,_0x41a2af)['then'](function(_0x3b8108){logger[_0x881b('0xc')](_0x881b('0xd'),_0x13bd3f,_0x881b('0xe'));logger[_0x881b('0xf')](_0x881b('0x10'),_0x13bd3f,_0x881b('0xe'),JSON[_0x881b('0x11')](_0x3b8108));if(_0x3b8108['error']){if(_0x3b8108[_0x881b('0x12')][_0x881b('0x13')]===0x1f4){logger[_0x881b('0x12')](_0x881b('0xd'),_0x13bd3f,_0x3b8108[_0x881b('0x12')][_0x881b('0x14')]);return _0x30318e(_0x3b8108[_0x881b('0x12')][_0x881b('0x14')]);}logger[_0x881b('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x13bd3f,_0x3b8108[_0x881b('0x12')][_0x881b('0x14')]);return _0x38cda9(_0x3b8108[_0x881b('0x12')][_0x881b('0x14')]);}else{logger[_0x881b('0xc')](_0x881b('0xd'),_0x13bd3f,_0x881b('0xe'));_0x38cda9(_0x3b8108[_0x881b('0x15')]['message']);}})[_0x881b('0x16')](function(_0x539dad){logger[_0x881b('0x12')](_0x881b('0xd'),_0x13bd3f,_0x539dad);_0x30318e(_0x539dad);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 1f6ba10..1dd9cb3 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(_0x50e993,_0x138e4b){var _0x5ce15c=function(_0x556cba){while(--_0x556cba){_0x50e993['push'](_0x50e993['shift']());}};_0x5ce15c(++_0x138e4b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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(_0x278240,_0x5d5406){var _0x3ccabf=function(_0xf0814e){while(--_0xf0814e){_0x278240['push'](_0x278240['shift']());}};_0x3ccabf(++_0x5d5406);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 d11f7cf..5f470b1 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 _0x803f=['sequelize','STRING','name','TEXT'];(function(_0xa2e8d9,_0x53a7be){var _0x3eb404=function(_0x79422c){while(--_0x79422c){_0xa2e8d9['push'](_0xa2e8d9['shift']());}};_0x3eb404(++_0x53a7be);}(_0x803f,0x64));var _0xf803=function(_0x33b5d7,_0x3794b2){_0x33b5d7=_0x33b5d7-0x0;var _0x145f1a=_0x803f[_0x33b5d7];return _0x145f1a;};'use strict';var Sequelize=require(_0xf803('0x0'));module['exports']={'name':{'type':Sequelize[_0xf803('0x1')],'allowNull':![],'unique':_0xf803('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xf803('0x3')]},'description':{'type':Sequelize[_0xf803('0x1')]}};
\ No newline at end of file
+var _0x682e=['name','TEXT','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x682e,0x1ce));var _0xe682=function(_0x255c76,_0x20b1db){_0x255c76=_0x255c76-0x0;var _0x1ccbfb=_0x682e[_0x255c76];return _0x1ccbfb;};'use strict';var Sequelize=require(_0xe682('0x0'));module[_0xe682('0x1')]={'name':{'type':Sequelize[_0xe682('0x2')],'allowNull':![],'unique':_0xe682('0x3')},'table':{'type':Sequelize[_0xe682('0x2')]},'metric':{'type':Sequelize[_0xe682('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 8a78400..094bd90 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 _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x3b3f2c,_0x5c5189){var _0x238d96=function(_0x43732d){while(--_0x43732d){_0x3b3f2c['push'](_0x3b3f2c['shift']());}};_0x238d96(++_0x5c5189);}(_0xe14b,0x93));var _0xbe14=function(_0x5f675a,_0x23937b){_0x5f675a=_0x5f675a-0x0;var _0x30c035=_0xe14b[_0x5f675a];return _0x30c035;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['AnalyticMetric'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));};
\ No newline at end of file
+var _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x559f13,_0x58733b){var _0x4a7320=function(_0x43a77f){while(--_0x43a77f){_0x559f13['push'](_0x559f13['shift']());}};_0x4a7320(++_0x58733b);}(_0xe5b3,0x133));var _0x3e5b=function(_0x20b0bd,_0x26e296){_0x20b0bd=_0x20b0bd-0x0;var _0x2051c8=_0xe5b3[_0x20b0bd];return _0x2051c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 1e0c874..39ebe0e 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 _0x5aaa=['define','AnalyticMetric','analytics_metrics','lodash','request-promise','path','rimraf','./analyticMetric.attributes','exports'];(function(_0x73ba1f,_0x588ccb){var _0x2e2725=function(_0x145578){while(--_0x145578){_0x73ba1f['push'](_0x73ba1f['shift']());}};_0x2e2725(++_0x588ccb);}(_0x5aaa,0xff));var _0xa5aa=function(_0x404922,_0x4ae8c2){_0x404922=_0x404922-0x0;var _0x58f609=_0x5aaa[_0x404922];return _0x58f609;};'use strict';var _=require(_0xa5aa('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa5aa('0x1'));var fs=require('fs');var path=require(_0xa5aa('0x2'));var rimraf=require(_0xa5aa('0x3'));var config=require('../../config/environment');var attributes=require(_0xa5aa('0x4'));module[_0xa5aa('0x5')]=function(_0x5e1865,_0x21d216){return _0x5e1865[_0xa5aa('0x6')](_0xa5aa('0x7'),attributes,{'tableName':_0xa5aa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1115=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','AnalyticMetric','analytics_metrics','util','../../config/logger'];(function(_0x44b5c8,_0x18f16b){var _0x555974=function(_0x2a5603){while(--_0x2a5603){_0x44b5c8['push'](_0x44b5c8['shift']());}};_0x555974(++_0x18f16b);}(_0x1115,0x1b6));var _0x5111=function(_0x21c613,_0x4fa837){_0x21c613=_0x21c613-0x0;var _0x2551bc=_0x1115[_0x21c613];return _0x2551bc;};'use strict';var _=require('lodash');var util=require(_0x5111('0x0'));var logger=require(_0x5111('0x1'))(_0x5111('0x2'));var moment=require(_0x5111('0x3'));var BPromise=require(_0x5111('0x4'));var rp=require(_0x5111('0x5'));var fs=require('fs');var path=require(_0x5111('0x6'));var rimraf=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x467c3a,_0x115ba7){return _0x467c3a['define'](_0x5111('0x9'),attributes,{'tableName':_0x5111('0xa'),'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 500e67f..859608d 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 _0x9454=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x3ccc28,_0x5036d5){var _0x47dd45=function(_0xd86e79){while(--_0xd86e79){_0x3ccc28['push'](_0x3ccc28['shift']());}};_0x47dd45(++_0x5036d5);}(_0x9454,0x104));var _0x4945=function(_0x44f63c,_0x34b07d){_0x44f63c=_0x44f63c-0x0;var _0x68ae76=_0x9454[_0x44f63c];return _0x68ae76;};'use strict';var _=require(_0x4945('0x0'));var util=require(_0x4945('0x1'));var moment=require(_0x4945('0x2'));var BPromise=require(_0x4945('0x3'));var rs=require(_0x4945('0x4'));var fs=require('fs');var Redis=require(_0x4945('0x5'));var db=require(_0x4945('0x6'))['db'];var utils=require(_0x4945('0x7'));var logger=require(_0x4945('0x8'))('rpc');var config=require(_0x4945('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4945('0xa')][_0x4945('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ef4ca,_0xc619b0,_0xcc48af){return new BPromise(function(_0xcd16a7,_0x29f5e5){return client[_0x4945('0xc')](_0x2ef4ca,_0xcc48af)[_0x4945('0xd')](function(_0x4dbc10){logger[_0x4945('0xe')](_0x4945('0xf'),_0xc619b0,_0x4945('0x10'));logger[_0x4945('0x11')](_0x4945('0x12'),_0xc619b0,_0x4945('0x10'),JSON[_0x4945('0x13')](_0x4dbc10));if(_0x4dbc10[_0x4945('0x14')]){if(_0x4dbc10['error'][_0x4945('0x15')]===0x1f4){logger[_0x4945('0x14')](_0x4945('0xf'),_0xc619b0,_0x4dbc10[_0x4945('0x14')]['message']);return _0x29f5e5(_0x4dbc10[_0x4945('0x14')][_0x4945('0x16')]);}logger[_0x4945('0x14')](_0x4945('0xf'),_0xc619b0,_0x4dbc10[_0x4945('0x14')][_0x4945('0x16')]);return _0xcd16a7(_0x4dbc10[_0x4945('0x14')][_0x4945('0x16')]);}else{logger[_0x4945('0xe')](_0x4945('0xf'),_0xc619b0,'request\x20sent');_0xcd16a7(_0x4dbc10[_0x4945('0x17')][_0x4945('0x16')]);}})[_0x4945('0x18')](function(_0x579501){logger[_0x4945('0x14')](_0x4945('0xf'),_0xc619b0,_0x579501);_0x29f5e5(_0x579501);});});}
\ No newline at end of file
+var _0x6cc5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','bluebird','randomstring'];(function(_0x361a82,_0x627320){var _0x2270ec=function(_0x53219f){while(--_0x53219f){_0x361a82['push'](_0x361a82['shift']());}};_0x2270ec(++_0x627320);}(_0x6cc5,0x104));var _0x56cc=function(_0x46e781,_0x2ed644){_0x46e781=_0x46e781-0x0;var _0xd1644f=_0x6cc5[_0x46e781];return _0xd1644f;};'use strict';var _=require(_0x56cc('0x0'));var util=require(_0x56cc('0x1'));var moment=require('moment');var BPromise=require(_0x56cc('0x2'));var rs=require(_0x56cc('0x3'));var fs=require('fs');var Redis=require(_0x56cc('0x4'));var db=require(_0x56cc('0x5'))['db'];var utils=require(_0x56cc('0x6'));var logger=require(_0x56cc('0x7'))('rpc');var config=require(_0x56cc('0x8'));var jayson=require(_0x56cc('0x9'));var client=jayson[_0x56cc('0xa')][_0x56cc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ade30,_0x1cacb7,_0x7f66e0){return new BPromise(function(_0x49f21d,_0x30ebed){return client[_0x56cc('0xc')](_0x2ade30,_0x7f66e0)[_0x56cc('0xd')](function(_0x9376d7){logger[_0x56cc('0xe')](_0x56cc('0xf'),_0x1cacb7,'request\x20sent');logger[_0x56cc('0x10')](_0x56cc('0x11'),_0x1cacb7,'request\x20sent',JSON[_0x56cc('0x12')](_0x9376d7));if(_0x9376d7[_0x56cc('0x13')]){if(_0x9376d7[_0x56cc('0x13')][_0x56cc('0x14')]===0x1f4){logger[_0x56cc('0x13')](_0x56cc('0xf'),_0x1cacb7,_0x9376d7['error']['message']);return _0x30ebed(_0x9376d7[_0x56cc('0x13')][_0x56cc('0x15')]);}logger['error'](_0x56cc('0xf'),_0x1cacb7,_0x9376d7[_0x56cc('0x13')]['message']);return _0x49f21d(_0x9376d7[_0x56cc('0x13')]['message']);}else{logger[_0x56cc('0xe')](_0x56cc('0xf'),_0x1cacb7,_0x56cc('0x16'));_0x49f21d(_0x9376d7[_0x56cc('0x17')]['message']);}})['catch'](function(_0x25cc4c){logger[_0x56cc('0x13')](_0x56cc('0xf'),_0x1cacb7,_0x25cc4c);_0x30ebed(_0x25cc4c);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index dccbcf9..6a2a5de 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 _0x24ca=['/:id','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index'];(function(_0x2147eb,_0x440352){var _0x3c6434=function(_0x11c174){while(--_0x11c174){_0x2147eb['push'](_0x2147eb['shift']());}};_0x3c6434(++_0x440352);}(_0x24ca,0x1bc));var _0xa24c=function(_0x3816c2,_0xb221e1){_0x3816c2=_0x3816c2-0x0;var _0x144669=_0x24ca[_0x3816c2];return _0x144669;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var fs_extra=require(_0xa24c('0x4'));var auth=require(_0xa24c('0x5'));var interaction=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var controller=require(_0xa24c('0x8'));router[_0xa24c('0x9')]('/',auth[_0xa24c('0xa')](),controller[_0xa24c('0xb')]);router[_0xa24c('0x9')](_0xa24c('0xc'),auth[_0xa24c('0xa')](),controller['show']);router[_0xa24c('0xd')]('/',auth[_0xa24c('0xa')](),controller[_0xa24c('0xe')]);router['put'](_0xa24c('0xc'),auth[_0xa24c('0xa')](),controller[_0xa24c('0xf')]);router[_0xa24c('0x10')](_0xa24c('0xc'),auth[_0xa24c('0xa')](),controller[_0xa24c('0x11')]);module[_0xa24c('0x12')]=router;
\ No newline at end of file
+var _0x95f4=['exports','multer','util','path','Router','fs-extra','../../config/environment','./analyticMetric.controller','get','index','/:id','show','post','isAuthenticated','update','destroy'];(function(_0x495337,_0x48e1c1){var _0x1594c3=function(_0x1c6be9){while(--_0x1c6be9){_0x495337['push'](_0x495337['shift']());}};_0x1594c3(++_0x48e1c1);}(_0x95f4,0xf1));var _0x495f=function(_0x1bf684,_0x1d461c){_0x1bf684=_0x1bf684-0x0;var _0x39b7aa=_0x95f4[_0x1bf684];return _0x39b7aa;};'use strict';var multer=require(_0x495f('0x0'));var util=require(_0x495f('0x1'));var path=require(_0x495f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x495f('0x3')]();var fs_extra=require(_0x495f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x495f('0x5'));var controller=require(_0x495f('0x6'));router[_0x495f('0x7')]('/',auth['isAuthenticated'](),controller[_0x495f('0x8')]);router[_0x495f('0x7')](_0x495f('0x9'),auth['isAuthenticated'](),controller[_0x495f('0xa')]);router[_0x495f('0xb')]('/',auth[_0x495f('0xc')](),controller['create']);router['put'](_0x495f('0x9'),auth['isAuthenticated'](),controller[_0x495f('0xd')]);router['delete'](_0x495f('0x9'),auth[_0x495f('0xc')](),controller[_0x495f('0xe')]);module[_0x495f('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 8450d69..9df2db8 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 _0x53b5=['exports','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53b5,0xd3));var _0x553b=function(_0xec6f95,_0x3e82b6){_0xec6f95=_0xec6f95-0x0;var _0x63904f=_0x53b5[_0xec6f95];return _0x63904f;};'use strict';var Sequelize=require(_0x553b('0x0'));module[_0x553b('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x6c38=['exports','TEXT','sequelize'];(function(_0x496333,_0x1c47d6){var _0x44256e=function(_0x58767d){while(--_0x58767d){_0x496333['push'](_0x496333['shift']());}};_0x44256e(++_0x1c47d6);}(_0x6c38,0x8f));var _0x86c3=function(_0x3704d2,_0x180599){_0x3704d2=_0x3704d2-0x0;var _0x47301a=_0x6c38[_0x3704d2];return _0x47301a;};'use strict';var Sequelize=require(_0x86c3('0x0'));module[_0x86c3('0x1')]={'tree':{'type':Sequelize[_0x86c3('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 86139f3..49b3096 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 _0x6b21=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','desk.js','querystring','papaparse'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x6b21,0x1db));var _0x16b2=function(_0x1e3d48,_0x4f4593){_0x1e3d48=_0x1e3d48-0x0;var _0x19b49d=_0x6b21[_0x1e3d48];return _0x19b49d;};'use strict';var emlformat=require(_0x16b2('0x0'));var rimraf=require(_0x16b2('0x1'));var zipdir=require(_0x16b2('0x2'));var jsonpatch=require(_0x16b2('0x3'));var rp=require(_0x16b2('0x4'));var moment=require('moment');var BPromise=require(_0x16b2('0x5'));var Mustache=require(_0x16b2('0x6'));var util=require(_0x16b2('0x7'));var path=require(_0x16b2('0x8'));var sox=require('sox');var csv=require(_0x16b2('0x9'));var ejs=require(_0x16b2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x16b2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x16b2('0xc'));var toCsv=require(_0x16b2('0x9'));var querystring=require(_0x16b2('0xd'));var Papa=require(_0x16b2('0xe'));var Redis=require(_0x16b2('0xf'));var authService=require(_0x16b2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x16b2('0x11'));var logger=require(_0x16b2('0x12'))('api');var utils=require(_0x16b2('0x13'));var config=require(_0x16b2('0x14'));var licenseUtil=require(_0x16b2('0x15'));var db=require(_0x16b2('0x16'))['db'];function respondWithStatusCode(_0x21b6a9,_0xa99bd5){_0xa99bd5=_0xa99bd5||0xcc;return function(_0x32819f){if(_0x32819f){return _0x21b6a9['sendStatus'](_0xa99bd5);}return _0x21b6a9['status'](_0xa99bd5)[_0x16b2('0x17')]();};}function respondWithResult(_0x4fdc4,_0x1606fc){_0x1606fc=_0x1606fc||0xc8;return function(_0x5acda2){if(_0x5acda2){return _0x4fdc4[_0x16b2('0x18')](_0x1606fc)[_0x16b2('0x19')](_0x5acda2);}};}function respondWithFilteredResult(_0x480104,_0xc8e1){return function(_0x4ee53a){if(_0x4ee53a){var _0x252a08=typeof _0xc8e1[_0x16b2('0x1a')]===_0x16b2('0x1b')&&typeof _0xc8e1['limit']===_0x16b2('0x1b');var _0x583259=_0x4ee53a[_0x16b2('0x1c')];var _0x2bf706=_0x252a08?0x0:_0xc8e1['offset'];var _0x2c91d9=_0x252a08?_0x4ee53a[_0x16b2('0x1c')]:_0xc8e1[_0x16b2('0x1a')]+_0xc8e1[_0x16b2('0x1d')];var _0x837d4b;if(_0x2c91d9>=_0x583259){_0x2c91d9=_0x583259;_0x837d4b=0xc8;}else{_0x837d4b=0xce;}_0x480104[_0x16b2('0x18')](_0x837d4b);return _0x480104['set'](_0x16b2('0x1e'),_0x2bf706+'-'+_0x2c91d9+'/'+_0x583259)[_0x16b2('0x19')](_0x4ee53a);}return null;};}function patchUpdates(_0x504cae){return function(_0x3b95dc){try{jsonpatch[_0x16b2('0x1f')](_0x3b95dc,_0x504cae,!![]);}catch(_0x16ae64){return BPromise[_0x16b2('0x20')](_0x16ae64);}return _0x3b95dc[_0x16b2('0x21')]();};}function saveUpdates(_0x333530,_0x4a2a8c){return function(_0xbdb1fd){if(_0xbdb1fd){return _0xbdb1fd[_0x16b2('0x22')](_0x333530)['then'](function(_0x28c06b){return _0x28c06b;});}return null;};}function removeEntity(_0x1b3829,_0x40fe27){return function(_0x57aa5a){if(_0x57aa5a){return _0x57aa5a[_0x16b2('0x23')]()[_0x16b2('0x24')](function(){_0x1b3829[_0x16b2('0x18')](0xcc)[_0x16b2('0x17')]();});}};}function handleEntityNotFound(_0x28a879,_0x35eec1){return function(_0x579dec){if(!_0x579dec){_0x28a879[_0x16b2('0x25')](0x194);}return _0x579dec;};}function handleError(_0x54257d,_0x4b24a0){_0x4b24a0=_0x4b24a0||0x1f4;return function(_0x11b293){logger[_0x16b2('0x26')](_0x11b293['stack']);if(_0x11b293[_0x16b2('0x27')]){delete _0x11b293[_0x16b2('0x27')];}_0x54257d[_0x16b2('0x18')](_0x4b24a0)[_0x16b2('0x28')](_0x11b293);};}exports[_0x16b2('0x29')]=function(_0x38c184,_0x2d5b42){var _0x72a8c0={},_0x5e1eee={},_0x436f0b={'count':0x0,'rows':[]};var _0x1a25fd=_[_0x16b2('0x2a')](db[_0x16b2('0x2b')][_0x16b2('0x2c')],function(_0x3b99b8){return{'name':_0x3b99b8['fieldName'],'type':_0x3b99b8[_0x16b2('0x2d')][_0x16b2('0x2e')]};});_0x5e1eee[_0x16b2('0x2f')]=_[_0x16b2('0x2a')](_0x1a25fd,_0x16b2('0x27'));_0x5e1eee[_0x16b2('0x30')]=_[_0x16b2('0x31')](_0x38c184['query']);_0x5e1eee['filters']=_['intersection'](_0x5e1eee['model'],_0x5e1eee[_0x16b2('0x30')]);_0x72a8c0[_0x16b2('0x32')]=_[_0x16b2('0x33')](_0x5e1eee[_0x16b2('0x2f')],qs[_0x16b2('0x34')](_0x38c184[_0x16b2('0x30')][_0x16b2('0x34')]));_0x72a8c0[_0x16b2('0x32')]=_0x72a8c0[_0x16b2('0x32')]['length']?_0x72a8c0[_0x16b2('0x32')]:_0x5e1eee[_0x16b2('0x2f')];if(!_0x38c184[_0x16b2('0x30')][_0x16b2('0x35')](_0x16b2('0x36'))){_0x72a8c0[_0x16b2('0x1d')]=qs[_0x16b2('0x1d')](_0x38c184[_0x16b2('0x30')][_0x16b2('0x1d')]);_0x72a8c0[_0x16b2('0x1a')]=qs['offset'](_0x38c184[_0x16b2('0x30')][_0x16b2('0x1a')]);}_0x72a8c0['order']=qs[_0x16b2('0x37')](_0x38c184['query'][_0x16b2('0x37')]);_0x72a8c0[_0x16b2('0x38')]=qs[_0x16b2('0x39')](_['pick'](_0x38c184[_0x16b2('0x30')],_0x5e1eee[_0x16b2('0x39')]),_0x1a25fd);if(_0x38c184['query'][_0x16b2('0x3a')]){_0x72a8c0[_0x16b2('0x38')]=_[_0x16b2('0x3b')](_0x72a8c0[_0x16b2('0x38')],{'$or':_[_0x16b2('0x2a')](_0x1a25fd,function(_0x49325f){if(_0x49325f[_0x16b2('0x2d')]!==_0x16b2('0x3c')){var _0x16b3d7={};_0x16b3d7[_0x49325f[_0x16b2('0x27')]]={'$like':'%'+_0x38c184['query'][_0x16b2('0x3a')]+'%'};return _0x16b3d7;}})});}_0x72a8c0=_[_0x16b2('0x3b')]({},_0x72a8c0,_0x38c184[_0x16b2('0x3d')]);var _0xf6304d={'where':_0x72a8c0['where']};return db[_0x16b2('0x2b')][_0x16b2('0x1c')](_0xf6304d)[_0x16b2('0x24')](function(_0x5a9fcd){_0x436f0b[_0x16b2('0x1c')]=_0x5a9fcd;if(_0x38c184[_0x16b2('0x30')][_0x16b2('0x3e')]){_0x72a8c0[_0x16b2('0x3f')]=[{'all':!![]}];}return db[_0x16b2('0x2b')][_0x16b2('0x40')](_0x72a8c0);})[_0x16b2('0x24')](function(_0x19f507){_0x436f0b['rows']=_0x19f507;return _0x436f0b;})['then'](respondWithFilteredResult(_0x2d5b42,_0x72a8c0))['catch'](handleError(_0x2d5b42,null));};exports[_0x16b2('0x41')]=function(_0xedbb18,_0x1dbd5a){var _0x172058={'raw':!![],'where':{'id':_0xedbb18[_0x16b2('0x42')]['id']}},_0x2bdaed={};_0x2bdaed[_0x16b2('0x2f')]=_[_0x16b2('0x31')](db[_0x16b2('0x2b')][_0x16b2('0x2c')]);_0x2bdaed[_0x16b2('0x30')]=_[_0x16b2('0x31')](_0xedbb18[_0x16b2('0x30')]);_0x2bdaed['filters']=_['intersection'](_0x2bdaed[_0x16b2('0x2f')],_0x2bdaed[_0x16b2('0x30')]);_0x172058['attributes']=_[_0x16b2('0x33')](_0x2bdaed['model'],qs[_0x16b2('0x34')](_0xedbb18['query'][_0x16b2('0x34')]));_0x172058[_0x16b2('0x32')]=_0x172058[_0x16b2('0x32')]['length']?_0x172058[_0x16b2('0x32')]:_0x2bdaed[_0x16b2('0x2f')];if(_0xedbb18[_0x16b2('0x30')][_0x16b2('0x3e')]){_0x172058[_0x16b2('0x3f')]=[{'all':!![]}];}_0x172058=_[_0x16b2('0x3b')]({},_0x172058,_0xedbb18['options']);return db[_0x16b2('0x2b')][_0x16b2('0x43')](_0x172058)[_0x16b2('0x24')](handleEntityNotFound(_0x1dbd5a,null))[_0x16b2('0x24')](respondWithResult(_0x1dbd5a,null))[_0x16b2('0x44')](handleError(_0x1dbd5a,null));};exports['create']=function(_0x193d00,_0x414298){return db[_0x16b2('0x2b')]['create'](_0x193d00['body'],{})[_0x16b2('0x24')](respondWithResult(_0x414298,0xc9))[_0x16b2('0x44')](handleError(_0x414298,null));};exports[_0x16b2('0x22')]=function(_0x5826fe,_0x34edab){if(_0x5826fe[_0x16b2('0x45')]['id']){delete _0x5826fe[_0x16b2('0x45')]['id'];}return db[_0x16b2('0x2b')][_0x16b2('0x43')]({'where':{'id':_0x5826fe['params']['id']}})[_0x16b2('0x24')](handleEntityNotFound(_0x34edab,null))[_0x16b2('0x24')](saveUpdates(_0x5826fe[_0x16b2('0x45')],null))['then'](respondWithResult(_0x34edab,null))[_0x16b2('0x44')](handleError(_0x34edab,null));};exports[_0x16b2('0x23')]=function(_0x32999d,_0x107815){return db[_0x16b2('0x2b')]['find']({'where':{'id':_0x32999d[_0x16b2('0x42')]['id']}})[_0x16b2('0x24')](handleEntityNotFound(_0x107815,null))[_0x16b2('0x24')](removeEntity(_0x107815,null))['catch'](handleError(_0x107815,null));};
\ No newline at end of file
+var _0xe207=['body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create'];(function(_0x49d57a,_0x2fc11f){var _0x5316a0=function(_0x5ed573){while(--_0x5ed573){_0x49d57a['push'](_0x49d57a['shift']());}};_0x5316a0(++_0x2fc11f);}(_0xe207,0x1dc));var _0x7e20=function(_0x3e5766,_0x42ef6e){_0x3e5766=_0x3e5766-0x0;var _0x2fa83a=_0xe207[_0x3e5766];return _0x2fa83a;};'use strict';var emlformat=require(_0x7e20('0x0'));var rimraf=require(_0x7e20('0x1'));var zipdir=require(_0x7e20('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e20('0x3'));var moment=require(_0x7e20('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7e20('0x5'));var util=require(_0x7e20('0x6'));var path=require(_0x7e20('0x7'));var sox=require(_0x7e20('0x8'));var csv=require(_0x7e20('0x9'));var ejs=require(_0x7e20('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7e20('0xb'));var crypto=require(_0x7e20('0xc'));var jsforce=require(_0x7e20('0xd'));var deskjs=require(_0x7e20('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7e20('0xf'));var Papa=require(_0x7e20('0x10'));var Redis=require(_0x7e20('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7e20('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e20('0x13'));var logger=require(_0x7e20('0x14'))(_0x7e20('0x15'));var utils=require(_0x7e20('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7e20('0x17'));var db=require(_0x7e20('0x18'))['db'];function respondWithStatusCode(_0x6e72ba,_0x38084a){_0x38084a=_0x38084a||0xcc;return function(_0x433cb3){if(_0x433cb3){return _0x6e72ba[_0x7e20('0x19')](_0x38084a);}return _0x6e72ba[_0x7e20('0x1a')](_0x38084a)[_0x7e20('0x1b')]();};}function respondWithResult(_0x3390a3,_0x481075){_0x481075=_0x481075||0xc8;return function(_0xa9e3f3){if(_0xa9e3f3){return _0x3390a3[_0x7e20('0x1a')](_0x481075)[_0x7e20('0x1c')](_0xa9e3f3);}};}function respondWithFilteredResult(_0x44f508,_0x2f841a){return function(_0x2853a3){if(_0x2853a3){var _0x29bbf0=typeof _0x2f841a['offset']==='undefined'&&typeof _0x2f841a[_0x7e20('0x1d')]===_0x7e20('0x1e');var _0x3dd019=_0x2853a3[_0x7e20('0x1f')];var _0x28d754=_0x29bbf0?0x0:_0x2f841a[_0x7e20('0x20')];var _0x5dfe5d=_0x29bbf0?_0x2853a3[_0x7e20('0x1f')]:_0x2f841a['offset']+_0x2f841a[_0x7e20('0x1d')];var _0x395dc0;if(_0x5dfe5d>=_0x3dd019){_0x5dfe5d=_0x3dd019;_0x395dc0=0xc8;}else{_0x395dc0=0xce;}_0x44f508[_0x7e20('0x1a')](_0x395dc0);return _0x44f508[_0x7e20('0x21')](_0x7e20('0x22'),_0x28d754+'-'+_0x5dfe5d+'/'+_0x3dd019)[_0x7e20('0x1c')](_0x2853a3);}return null;};}function patchUpdates(_0x58b69d){return function(_0x165abb){try{jsonpatch[_0x7e20('0x23')](_0x165abb,_0x58b69d,!![]);}catch(_0x40df1f){return BPromise['reject'](_0x40df1f);}return _0x165abb[_0x7e20('0x24')]();};}function saveUpdates(_0x338a30,_0x1cb7b1){return function(_0x2a0e21){if(_0x2a0e21){return _0x2a0e21[_0x7e20('0x25')](_0x338a30)[_0x7e20('0x26')](function(_0xf61170){return _0xf61170;});}return null;};}function removeEntity(_0x1c3820,_0x28574e){return function(_0x4aff0f){if(_0x4aff0f){return _0x4aff0f['destroy']()['then'](function(){_0x1c3820[_0x7e20('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x472cf5,_0x1e93f0){return function(_0x4bff3a){if(!_0x4bff3a){_0x472cf5[_0x7e20('0x19')](0x194);}return _0x4bff3a;};}function handleError(_0x1760ff,_0x5e2aa0){_0x5e2aa0=_0x5e2aa0||0x1f4;return function(_0xe808d1){logger[_0x7e20('0x27')](_0xe808d1[_0x7e20('0x28')]);if(_0xe808d1[_0x7e20('0x29')]){delete _0xe808d1['name'];}_0x1760ff[_0x7e20('0x1a')](_0x5e2aa0)[_0x7e20('0x2a')](_0xe808d1);};}exports[_0x7e20('0x2b')]=function(_0x4266e7,_0x4a8a4c){var _0x5c6783={},_0x2887e1={},_0x2a18f0={'count':0x0,'rows':[]};var _0xaa3b1b=_[_0x7e20('0x2c')](db[_0x7e20('0x2d')][_0x7e20('0x2e')],function(_0x5cf032){return{'name':_0x5cf032[_0x7e20('0x2f')],'type':_0x5cf032[_0x7e20('0x30')][_0x7e20('0x31')]};});_0x2887e1[_0x7e20('0x32')]=_[_0x7e20('0x2c')](_0xaa3b1b,'name');_0x2887e1[_0x7e20('0x33')]=_[_0x7e20('0x34')](_0x4266e7[_0x7e20('0x33')]);_0x2887e1[_0x7e20('0x35')]=_[_0x7e20('0x36')](_0x2887e1[_0x7e20('0x32')],_0x2887e1[_0x7e20('0x33')]);_0x5c6783[_0x7e20('0x37')]=_[_0x7e20('0x36')](_0x2887e1['model'],qs['fields'](_0x4266e7['query']['fields']));_0x5c6783[_0x7e20('0x37')]=_0x5c6783[_0x7e20('0x37')][_0x7e20('0x38')]?_0x5c6783[_0x7e20('0x37')]:_0x2887e1[_0x7e20('0x32')];if(!_0x4266e7[_0x7e20('0x33')][_0x7e20('0x39')](_0x7e20('0x3a'))){_0x5c6783[_0x7e20('0x1d')]=qs[_0x7e20('0x1d')](_0x4266e7[_0x7e20('0x33')]['limit']);_0x5c6783['offset']=qs[_0x7e20('0x20')](_0x4266e7[_0x7e20('0x33')][_0x7e20('0x20')]);}_0x5c6783[_0x7e20('0x3b')]=qs[_0x7e20('0x3c')](_0x4266e7[_0x7e20('0x33')]['sort']);_0x5c6783[_0x7e20('0x3d')]=qs[_0x7e20('0x35')](_[_0x7e20('0x3e')](_0x4266e7[_0x7e20('0x33')],_0x2887e1[_0x7e20('0x35')]),_0xaa3b1b);if(_0x4266e7['query'][_0x7e20('0x3f')]){_0x5c6783[_0x7e20('0x3d')]=_['merge'](_0x5c6783[_0x7e20('0x3d')],{'$or':_[_0x7e20('0x2c')](_0xaa3b1b,function(_0x4e04ec){if(_0x4e04ec[_0x7e20('0x30')]!==_0x7e20('0x40')){var _0x5d96d9={};_0x5d96d9[_0x4e04ec[_0x7e20('0x29')]]={'$like':'%'+_0x4266e7[_0x7e20('0x33')]['filter']+'%'};return _0x5d96d9;}})});}_0x5c6783=_[_0x7e20('0x41')]({},_0x5c6783,_0x4266e7[_0x7e20('0x42')]);var _0x15a82b={'where':_0x5c6783[_0x7e20('0x3d')]};return db['AnalyticTreeReport']['count'](_0x15a82b)[_0x7e20('0x26')](function(_0x15dcc2){_0x2a18f0[_0x7e20('0x1f')]=_0x15dcc2;if(_0x4266e7[_0x7e20('0x33')][_0x7e20('0x43')]){_0x5c6783[_0x7e20('0x44')]=[{'all':!![]}];}return db[_0x7e20('0x2d')][_0x7e20('0x45')](_0x5c6783);})[_0x7e20('0x26')](function(_0x3e4979){_0x2a18f0[_0x7e20('0x46')]=_0x3e4979;return _0x2a18f0;})[_0x7e20('0x26')](respondWithFilteredResult(_0x4a8a4c,_0x5c6783))[_0x7e20('0x47')](handleError(_0x4a8a4c,null));};exports[_0x7e20('0x48')]=function(_0x35826c,_0x3c585a){var _0xe8be2d={'raw':!![],'where':{'id':_0x35826c[_0x7e20('0x49')]['id']}},_0x2d2dd9={};_0x2d2dd9[_0x7e20('0x32')]=_[_0x7e20('0x34')](db[_0x7e20('0x2d')][_0x7e20('0x2e')]);_0x2d2dd9[_0x7e20('0x33')]=_[_0x7e20('0x34')](_0x35826c[_0x7e20('0x33')]);_0x2d2dd9['filters']=_[_0x7e20('0x36')](_0x2d2dd9[_0x7e20('0x32')],_0x2d2dd9['query']);_0xe8be2d['attributes']=_[_0x7e20('0x36')](_0x2d2dd9['model'],qs[_0x7e20('0x4a')](_0x35826c[_0x7e20('0x33')][_0x7e20('0x4a')]));_0xe8be2d[_0x7e20('0x37')]=_0xe8be2d[_0x7e20('0x37')]['length']?_0xe8be2d[_0x7e20('0x37')]:_0x2d2dd9[_0x7e20('0x32')];if(_0x35826c['query']['includeAll']){_0xe8be2d[_0x7e20('0x44')]=[{'all':!![]}];}_0xe8be2d=_[_0x7e20('0x41')]({},_0xe8be2d,_0x35826c[_0x7e20('0x42')]);return db[_0x7e20('0x2d')][_0x7e20('0x4b')](_0xe8be2d)[_0x7e20('0x26')](handleEntityNotFound(_0x3c585a,null))[_0x7e20('0x26')](respondWithResult(_0x3c585a,null))[_0x7e20('0x47')](handleError(_0x3c585a,null));};exports[_0x7e20('0x4c')]=function(_0x563371,_0x4ff191){return db[_0x7e20('0x2d')][_0x7e20('0x4c')](_0x563371[_0x7e20('0x4d')],{})[_0x7e20('0x26')](respondWithResult(_0x4ff191,0xc9))[_0x7e20('0x47')](handleError(_0x4ff191,null));};exports['update']=function(_0x3ce02d,_0x3debcd){if(_0x3ce02d[_0x7e20('0x4d')]['id']){delete _0x3ce02d[_0x7e20('0x4d')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x3ce02d['params']['id']}})[_0x7e20('0x26')](handleEntityNotFound(_0x3debcd,null))[_0x7e20('0x26')](saveUpdates(_0x3ce02d[_0x7e20('0x4d')],null))['then'](respondWithResult(_0x3debcd,null))[_0x7e20('0x47')](handleError(_0x3debcd,null));};exports[_0x7e20('0x4e')]=function(_0x58e434,_0x1ef13){return db['AnalyticTreeReport'][_0x7e20('0x4b')]({'where':{'id':_0x58e434[_0x7e20('0x49')]['id']}})[_0x7e20('0x26')](handleEntityNotFound(_0x1ef13,null))[_0x7e20('0x26')](removeEntity(_0x1ef13,null))[_0x7e20('0x47')](handleError(_0x1ef13,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 6318d6c..69960a1 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 _0x2207=['path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x2207,0x1c1));var _0x7220=function(_0x3806e2,_0x31b0b4){_0x3806e2=_0x3806e2-0x0;var _0x13fcaf=_0x2207[_0x3806e2];return _0x13fcaf;};'use strict';var _=require(_0x7220('0x0'));var util=require('util');var logger=require(_0x7220('0x1'))(_0x7220('0x2'));var moment=require(_0x7220('0x3'));var BPromise=require(_0x7220('0x4'));var rp=require(_0x7220('0x5'));var fs=require('fs');var path=require(_0x7220('0x6'));var rimraf=require(_0x7220('0x7'));var config=require(_0x7220('0x8'));var attributes=require(_0x7220('0x9'));module[_0x7220('0xa')]=function(_0x4e1111,_0x491eab){return _0x4e1111[_0x7220('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0x7220('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6426=['exports','analytics_report_trees','lodash','moment','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x1f40ab,_0x453500){var _0x14ae0e=function(_0x41904a){while(--_0x41904a){_0x1f40ab['push'](_0x1f40ab['shift']());}};_0x14ae0e(++_0x453500);}(_0x6426,0x13d));var _0x6642=function(_0x34b3cf,_0x56b2b4){_0x34b3cf=_0x34b3cf-0x0;var _0x14e21=_0x6426[_0x34b3cf];return _0x14e21;};'use strict';var _=require(_0x6642('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6642('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6642('0x2'));var config=require(_0x6642('0x3'));var attributes=require(_0x6642('0x4'));module[_0x6642('0x5')]=function(_0x4a834a,_0x511282){return _0x4a834a['define']('AnalyticTreeReport',attributes,{'tableName':_0x6642('0x6'),'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 b619158..42cbdbd 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 _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(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0xadb5,0xad));var _0x5adb=function(_0x4c19ae,_0x48126f){_0x4c19ae=_0x4c19ae-0x0;var _0x694a18=_0xadb5[_0x4c19ae];return _0x694a18;};'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
+var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x555583,_0x58df45){_0x555583=_0x555583-0x0;var _0x12b553=_0x7a54[_0x555583];return _0x12b553;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index fae0261..6cad0e8 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 _0x1f5f=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id'];(function(_0x5bb206,_0xcf25a1){var _0x353569=function(_0xd16135){while(--_0xd16135){_0x5bb206['push'](_0x5bb206['shift']());}};_0x353569(++_0xcf25a1);}(_0x1f5f,0x182));var _0xf1f5=function(_0x525148,_0x5d34c0){_0x525148=_0x525148-0x0;var _0x497d88=_0x1f5f[_0x525148];return _0x497d88;};'use strict';var multer=require(_0xf1f5('0x0'));var util=require(_0xf1f5('0x1'));var path=require(_0xf1f5('0x2'));var timeout=require(_0xf1f5('0x3'));var express=require(_0xf1f5('0x4'));var router=express[_0xf1f5('0x5')]();var fs_extra=require(_0xf1f5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf1f5('0x7'));var config=require(_0xf1f5('0x8'));var controller=require(_0xf1f5('0x9'));router[_0xf1f5('0xa')]('/',auth[_0xf1f5('0xb')](),controller['index']);router[_0xf1f5('0xa')](_0xf1f5('0xc'),auth[_0xf1f5('0xb')](),controller[_0xf1f5('0xd')]);router[_0xf1f5('0xe')]('/',auth['isAuthenticated'](),controller[_0xf1f5('0xf')]);router[_0xf1f5('0x10')](_0xf1f5('0xc'),auth[_0xf1f5('0xb')](),controller[_0xf1f5('0x11')]);router[_0xf1f5('0x12')]('/:id',auth[_0xf1f5('0xb')](),controller[_0xf1f5('0x13')]);module[_0xf1f5('0x14')]=router;
\ No newline at end of file
+var _0x044e=['destroy','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','create','put','update','delete'];(function(_0x206c64,_0x484424){var _0x4651a6=function(_0x1710a4){while(--_0x1710a4){_0x206c64['push'](_0x206c64['shift']());}};_0x4651a6(++_0x484424);}(_0x044e,0x1a1));var _0xe044=function(_0x329437,_0x1de73a){_0x329437=_0x329437-0x0;var _0x3789d9=_0x044e[_0x329437];return _0x3789d9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe044('0x0'));var timeout=require(_0xe044('0x1'));var express=require(_0xe044('0x2'));var router=express['Router']();var fs_extra=require(_0xe044('0x3'));var auth=require(_0xe044('0x4'));var interaction=require(_0xe044('0x5'));var config=require(_0xe044('0x6'));var controller=require(_0xe044('0x7'));router[_0xe044('0x8')]('/',auth[_0xe044('0x9')](),controller['index']);router[_0xe044('0x8')](_0xe044('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xe044('0x9')](),controller[_0xe044('0xb')]);router[_0xe044('0xc')](_0xe044('0xa'),auth['isAuthenticated'](),controller[_0xe044('0xd')]);router[_0xe044('0xe')](_0xe044('0xa'),auth[_0xe044('0x9')](),controller[_0xe044('0xf')]);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 9156b67..31b37c1 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 _0x19ea=['sequelize','STRING'];(function(_0x313df3,_0x4fca45){var _0x241d59=function(_0x452786){while(--_0x452786){_0x313df3['push'](_0x313df3['shift']());}};_0x241d59(++_0x4fca45);}(_0x19ea,0xfe));var _0xa19e=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0x19ea[_0x34bc6c];return _0x168820;};'use strict';var Sequelize=require(_0xa19e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xa19e('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x12c9=['STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x12c9,0x1c9));var _0x912c=function(_0x36af4a,_0x207d0a){_0x36af4a=_0x36af4a-0x0;var _0x2d54d4=_0x12c9[_0x36af4a];return _0x2d54d4;};'use strict';var Sequelize=require(_0x912c('0x0'));module[_0x912c('0x1')]={'name':{'type':Sequelize[_0x912c('0x2')]},'basename':{'type':Sequelize[_0x912c('0x2')]},'type':{'type':Sequelize[_0x912c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 5fa4464..efef7a7 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 _0xef51=['ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','error','stack','send','index','map','fieldName','type','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','Attachment','findAll','rows','catch','keys','find','params','rawAttributes','include','get','omit','createdAt','updatedAt','body','create','file','basename','filename','mimetype','findOne'];(function(_0x89be1c,_0x1bfcaa){var _0x567694=function(_0x45b733){while(--_0x45b733){_0x89be1c['push'](_0x89be1c['shift']());}};_0x567694(++_0x1bfcaa);}(_0xef51,0x155));var _0x1ef5=function(_0x110479,_0x492d7b){_0x110479=_0x110479-0x0;var _0x55335=_0xef51[_0x110479];return _0x55335;};'use strict';var emlformat=require(_0x1ef5('0x0'));var rimraf=require(_0x1ef5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1ef5('0x2'));var rp=require('request-promise');var moment=require(_0x1ef5('0x3'));var BPromise=require(_0x1ef5('0x4'));var Mustache=require(_0x1ef5('0x5'));var util=require('util');var path=require('path');var sox=require(_0x1ef5('0x6'));var csv=require(_0x1ef5('0x7'));var ejs=require(_0x1ef5('0x8'));var fs=require('fs');var fs_extra=require(_0x1ef5('0x9'));var _=require(_0x1ef5('0xa'));var squel=require(_0x1ef5('0xb'));var crypto=require('crypto');var jsforce=require(_0x1ef5('0xc'));var deskjs=require(_0x1ef5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1ef5('0xe'));var Papa=require('papaparse');var Redis=require(_0x1ef5('0xf'));var authService=require(_0x1ef5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1ef5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ef5('0x12'))(_0x1ef5('0x13'));var utils=require(_0x1ef5('0x14'));var config=require(_0x1ef5('0x15'));var licenseUtil=require(_0x1ef5('0x16'));var db=require(_0x1ef5('0x17'))['db'];function respondWithStatusCode(_0x439c07,_0x160ba9){_0x160ba9=_0x160ba9||0xcc;return function(_0x4c27d6){if(_0x4c27d6){return _0x439c07['sendStatus'](_0x160ba9);}return _0x439c07[_0x1ef5('0x18')](_0x160ba9)['end']();};}function respondWithResult(_0xc2020b,_0x77ed0c){_0x77ed0c=_0x77ed0c||0xc8;return function(_0xec40d0){if(_0xec40d0){return _0xc2020b['status'](_0x77ed0c)['json'](_0xec40d0);}};}function respondWithFilteredResult(_0x4fcf42,_0x33fe85){return function(_0x272955){if(_0x272955){var _0x27414b=typeof _0x33fe85[_0x1ef5('0x19')]===_0x1ef5('0x1a')&&typeof _0x33fe85[_0x1ef5('0x1b')]==='undefined';var _0x3b4908=_0x272955[_0x1ef5('0x1c')];var _0x4cc974=_0x27414b?0x0:_0x33fe85[_0x1ef5('0x19')];var _0x563b61=_0x27414b?_0x272955['count']:_0x33fe85[_0x1ef5('0x19')]+_0x33fe85['limit'];var _0xd5b977;if(_0x563b61>=_0x3b4908){_0x563b61=_0x3b4908;_0xd5b977=0xc8;}else{_0xd5b977=0xce;}_0x4fcf42['status'](_0xd5b977);return _0x4fcf42[_0x1ef5('0x1d')](_0x1ef5('0x1e'),_0x4cc974+'-'+_0x563b61+'/'+_0x3b4908)[_0x1ef5('0x1f')](_0x272955);}return null;};}function patchUpdates(_0x39bcb5){return function(_0x96e4d6){try{jsonpatch[_0x1ef5('0x20')](_0x96e4d6,_0x39bcb5,!![]);}catch(_0x5698a2){return BPromise[_0x1ef5('0x21')](_0x5698a2);}return _0x96e4d6['save']();};}function saveUpdates(_0x2d8b58,_0x13310d){return function(_0x49e163){if(_0x49e163){return _0x49e163['update'](_0x2d8b58)['then'](function(_0x2caf33){return _0x2caf33;});}return null;};}function removeEntity(_0x4d4fdf,_0x11549e){return function(_0x32d774){if(_0x32d774){return _0x32d774['destroy']()[_0x1ef5('0x22')](function(){_0x4d4fdf[_0x1ef5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x140f6c,_0x167915){return function(_0x1c26c2){if(!_0x1c26c2){_0x140f6c['sendStatus'](0x194);}return _0x1c26c2;};}function handleError(_0x5a77e5,_0xc18885){_0xc18885=_0xc18885||0x1f4;return function(_0x40d715){logger[_0x1ef5('0x23')](_0x40d715[_0x1ef5('0x24')]);if(_0x40d715['name']){delete _0x40d715['name'];}_0x5a77e5[_0x1ef5('0x18')](_0xc18885)[_0x1ef5('0x25')](_0x40d715);};}exports[_0x1ef5('0x26')]=function(_0x370496,_0x2fc73a){var _0x41145b={},_0x433989={},_0x212870={'count':0x0,'rows':[]};var _0x2b6bd=_[_0x1ef5('0x27')](db['Attachment']['rawAttributes'],function(_0x26f6af){return{'name':_0x26f6af[_0x1ef5('0x28')],'type':_0x26f6af[_0x1ef5('0x29')]['key']};});_0x433989[_0x1ef5('0x2a')]=_[_0x1ef5('0x27')](_0x2b6bd,_0x1ef5('0x2b'));_0x433989[_0x1ef5('0x2c')]=_['keys'](_0x370496[_0x1ef5('0x2c')]);_0x433989[_0x1ef5('0x2d')]=_[_0x1ef5('0x2e')](_0x433989[_0x1ef5('0x2a')],_0x433989[_0x1ef5('0x2c')]);_0x41145b[_0x1ef5('0x2f')]=_[_0x1ef5('0x2e')](_0x433989['model'],qs[_0x1ef5('0x30')](_0x370496['query'][_0x1ef5('0x30')]));_0x41145b[_0x1ef5('0x2f')]=_0x41145b[_0x1ef5('0x2f')][_0x1ef5('0x31')]?_0x41145b[_0x1ef5('0x2f')]:_0x433989['model'];if(!_0x370496[_0x1ef5('0x2c')][_0x1ef5('0x32')](_0x1ef5('0x33'))){_0x41145b[_0x1ef5('0x1b')]=qs[_0x1ef5('0x1b')](_0x370496[_0x1ef5('0x2c')][_0x1ef5('0x1b')]);_0x41145b[_0x1ef5('0x19')]=qs['offset'](_0x370496['query']['offset']);}_0x41145b['order']=qs[_0x1ef5('0x34')](_0x370496[_0x1ef5('0x2c')][_0x1ef5('0x34')]);_0x41145b[_0x1ef5('0x35')]=qs[_0x1ef5('0x2d')](_[_0x1ef5('0x36')](_0x370496['query'],_0x433989[_0x1ef5('0x2d')]),_0x2b6bd);if(_0x370496[_0x1ef5('0x2c')][_0x1ef5('0x37')]){_0x41145b['where']=_[_0x1ef5('0x38')](_0x41145b[_0x1ef5('0x35')],{'$or':_['map'](_0x2b6bd,function(_0x18c809){if(_0x18c809['type']!==_0x1ef5('0x39')){var _0x327db4={};_0x327db4[_0x18c809[_0x1ef5('0x2b')]]={'$like':'%'+_0x370496[_0x1ef5('0x2c')][_0x1ef5('0x37')]+'%'};return _0x327db4;}})});}_0x41145b=_['merge']({},_0x41145b,_0x370496['options']);var _0x31881e={'where':_0x41145b['where']};return db['Attachment'][_0x1ef5('0x1c')](_0x31881e)[_0x1ef5('0x22')](function(_0x1ac7b5){_0x212870['count']=_0x1ac7b5;if(_0x370496[_0x1ef5('0x2c')][_0x1ef5('0x3a')]){_0x41145b['include']=[{'all':!![]}];}return db[_0x1ef5('0x3b')][_0x1ef5('0x3c')](_0x41145b);})[_0x1ef5('0x22')](function(_0x1d7f34){_0x212870[_0x1ef5('0x3d')]=_0x1d7f34;return _0x212870;})['then'](respondWithFilteredResult(_0x2fc73a,_0x41145b))[_0x1ef5('0x3e')](handleError(_0x2fc73a,null));};exports['show']=function(_0x1170ea,_0x6bda44){var _0x42889f={'raw':!![],'where':{'id':_0x1170ea['params']['id']}},_0x1c539a={};_0x1c539a[_0x1ef5('0x2a')]=_['keys'](db[_0x1ef5('0x3b')]['rawAttributes']);_0x1c539a[_0x1ef5('0x2c')]=_[_0x1ef5('0x3f')](_0x1170ea[_0x1ef5('0x2c')]);_0x1c539a[_0x1ef5('0x2d')]=_['intersection'](_0x1c539a[_0x1ef5('0x2a')],_0x1c539a['query']);_0x42889f[_0x1ef5('0x2f')]=_[_0x1ef5('0x2e')](_0x1c539a[_0x1ef5('0x2a')],qs[_0x1ef5('0x30')](_0x1170ea[_0x1ef5('0x2c')]['fields']));_0x42889f[_0x1ef5('0x2f')]=_0x42889f['attributes']['length']?_0x42889f[_0x1ef5('0x2f')]:_0x1c539a['model'];if(_0x1170ea['query'][_0x1ef5('0x3a')]){_0x42889f['include']=[{'all':!![]}];}_0x42889f=_[_0x1ef5('0x38')]({},_0x42889f,_0x1170ea['options']);return db['Attachment'][_0x1ef5('0x40')](_0x42889f)[_0x1ef5('0x22')](handleEntityNotFound(_0x6bda44,null))[_0x1ef5('0x22')](respondWithResult(_0x6bda44,null))[_0x1ef5('0x3e')](handleError(_0x6bda44,null));};exports['clone']=function(_0x51c3c2,_0x2f219b){var _0x4127af={'where':{'id':_0x51c3c2[_0x1ef5('0x41')]['id']}},_0x5ed429={};_0x5ed429[_0x1ef5('0x2a')]=_[_0x1ef5('0x3f')](db[_0x1ef5('0x3b')][_0x1ef5('0x42')]);_0x4127af[_0x1ef5('0x2f')]=_[_0x1ef5('0x2e')](_0x5ed429['model'],qs[_0x1ef5('0x30')](_0x51c3c2[_0x1ef5('0x2c')][_0x1ef5('0x30')]));_0x4127af['attributes']=_0x4127af[_0x1ef5('0x2f')]['length']?_0x4127af[_0x1ef5('0x2f')]:_0x5ed429['model'];if(_0x51c3c2[_0x1ef5('0x2c')][_0x1ef5('0x3a')]){_0x4127af[_0x1ef5('0x43')]=[{'all':!![]}];}_0x4127af=_[_0x1ef5('0x38')]({},_0x4127af,_0x51c3c2['options']);return db[_0x1ef5('0x3b')]['find'](_0x4127af)[_0x1ef5('0x22')](handleEntityNotFound(_0x2f219b,null))[_0x1ef5('0x22')](function(_0x2912ef){if(_0x2912ef){var _0x526516=_0x2912ef[_0x1ef5('0x44')]({'plain':!![]});_0x526516=qs[_0x1ef5('0x45')](_0x526516,['id',_0x1ef5('0x46'),_0x1ef5('0x47')]);_0x51c3c2[_0x1ef5('0x48')]=_[_0x1ef5('0x45')](_0x51c3c2[_0x1ef5('0x48')],['id',_0x1ef5('0x46'),_0x1ef5('0x47')]);return db[_0x1ef5('0x3b')][_0x1ef5('0x49')](_[_0x1ef5('0x38')](_0x526516,_0x51c3c2['body']),{'include':_0x51c3c2[_0x1ef5('0x2c')][_0x1ef5('0x3a')]?[{'all':!![]}]:undefined});}})[_0x1ef5('0x22')](respondWithResult(_0x2f219b,0xc9))[_0x1ef5('0x3e')](handleError(_0x2f219b,null));};exports['update']=function(_0x597bc8,_0x4be03a){if(_0x597bc8[_0x1ef5('0x48')]['id']){delete _0x597bc8[_0x1ef5('0x48')]['id'];}return db[_0x1ef5('0x3b')][_0x1ef5('0x40')]({'where':{'id':_0x597bc8['params']['id']}})[_0x1ef5('0x22')](handleEntityNotFound(_0x4be03a,null))[_0x1ef5('0x22')](saveUpdates(_0x597bc8[_0x1ef5('0x48')],null))[_0x1ef5('0x22')](respondWithResult(_0x4be03a,null))[_0x1ef5('0x3e')](handleError(_0x4be03a,null));};exports['destroy']=function(_0x2344d3,_0x24a894){return db[_0x1ef5('0x3b')]['find']({'where':{'id':_0x2344d3[_0x1ef5('0x41')]['id']}})[_0x1ef5('0x22')](handleEntityNotFound(_0x24a894,null))[_0x1ef5('0x22')](removeEntity(_0x24a894,null))[_0x1ef5('0x3e')](handleError(_0x24a894,null));};exports[_0x1ef5('0x49')]=function(_0x363ec5,_0x279eae,_0x3d23d6){_0x363ec5[_0x1ef5('0x48')][_0x1ef5('0x2b')]=_0x363ec5[_0x1ef5('0x4a')]['originalname'];_0x363ec5[_0x1ef5('0x48')][_0x1ef5('0x4b')]=_0x363ec5[_0x1ef5('0x4a')][_0x1ef5('0x4c')];_0x363ec5[_0x1ef5('0x48')][_0x1ef5('0x29')]=_0x363ec5['file'][_0x1ef5('0x4d')];return db[_0x1ef5('0x3b')][_0x1ef5('0x49')](_0x363ec5[_0x1ef5('0x48')])[_0x1ef5('0x22')](respondWithResult(_0x279eae,0xc9))[_0x1ef5('0x3e')](handleError(_0x279eae,null));};exports['download']=function(_0x4f41db,_0x22bcee,_0x242f60){return db[_0x1ef5('0x3b')][_0x1ef5('0x4e')]({'where':{'id':_0x4f41db['params']['id']},'raw':!![]})[_0x1ef5('0x22')](handleEntityNotFound(_0x22bcee,null))[_0x1ef5('0x22')](function(_0x39bde9){if(_0x39bde9){var _0x4b03e4=_0x39bde9[_0x1ef5('0x4f')]!==null;var _0x508987=path[_0x1ef5('0x50')](config[_0x1ef5('0x51')],_0x1ef5('0x52'));if(_0x4b03e4){_0x508987=path[_0x1ef5('0x50')](_0x508987,_0x1ef5('0x53'));}var _0x37c9cf=path[_0x1ef5('0x50')](_0x508987,_0x39bde9[_0x1ef5('0x4b')]);return _0x22bcee['download'](_0x37c9cf);}})['catch'](handleError(_0x22bcee,null));};
\ No newline at end of file
+var _0xd4a5=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','clone','get','omit','createdAt','body','updatedAt','create','update','file','originalname','basename','mimetype','download','findOne','join','server/files/attachments/','offline-chat/','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x547b2d,_0xfe6417){var _0xaecf99=function(_0x2a6e11){while(--_0x2a6e11){_0x547b2d['push'](_0x547b2d['shift']());}};_0xaecf99(++_0xfe6417);}(_0xd4a5,0x166));var _0x5d4a=function(_0x23fb54,_0x585c9e){_0x23fb54=_0x23fb54-0x0;var _0x3372d4=_0xd4a5[_0x23fb54];return _0x3372d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5d4a('0x0'));var zipdir=require(_0x5d4a('0x1'));var jsonpatch=require(_0x5d4a('0x2'));var rp=require(_0x5d4a('0x3'));var moment=require('moment');var BPromise=require(_0x5d4a('0x4'));var Mustache=require('mustache');var util=require(_0x5d4a('0x5'));var path=require(_0x5d4a('0x6'));var sox=require(_0x5d4a('0x7'));var csv=require(_0x5d4a('0x8'));var ejs=require(_0x5d4a('0x9'));var fs=require('fs');var fs_extra=require(_0x5d4a('0xa'));var _=require(_0x5d4a('0xb'));var squel=require(_0x5d4a('0xc'));var crypto=require(_0x5d4a('0xd'));var jsforce=require(_0x5d4a('0xe'));var deskjs=require(_0x5d4a('0xf'));var toCsv=require(_0x5d4a('0x8'));var querystring=require(_0x5d4a('0x10'));var Papa=require(_0x5d4a('0x11'));var Redis=require(_0x5d4a('0x12'));var authService=require(_0x5d4a('0x13'));var qs=require(_0x5d4a('0x14'));var as=require(_0x5d4a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d4a('0x16'))(_0x5d4a('0x17'));var utils=require(_0x5d4a('0x18'));var config=require(_0x5d4a('0x19'));var licenseUtil=require(_0x5d4a('0x1a'));var db=require(_0x5d4a('0x1b'))['db'];function respondWithStatusCode(_0x5ae7c7,_0x59ae48){_0x59ae48=_0x59ae48||0xcc;return function(_0x2f26ce){if(_0x2f26ce){return _0x5ae7c7[_0x5d4a('0x1c')](_0x59ae48);}return _0x5ae7c7[_0x5d4a('0x1d')](_0x59ae48)[_0x5d4a('0x1e')]();};}function respondWithResult(_0x408ba3,_0x2cbe99){_0x2cbe99=_0x2cbe99||0xc8;return function(_0x246d10){if(_0x246d10){return _0x408ba3['status'](_0x2cbe99)[_0x5d4a('0x1f')](_0x246d10);}};}function respondWithFilteredResult(_0x432213,_0x1671a0){return function(_0x1770d0){if(_0x1770d0){var _0x35460c=typeof _0x1671a0['offset']==='undefined'&&typeof _0x1671a0['limit']===_0x5d4a('0x20');var _0x32d209=_0x1770d0['count'];var _0x51da13=_0x35460c?0x0:_0x1671a0[_0x5d4a('0x21')];var _0xae9138=_0x35460c?_0x1770d0[_0x5d4a('0x22')]:_0x1671a0[_0x5d4a('0x21')]+_0x1671a0[_0x5d4a('0x23')];var _0x2f7116;if(_0xae9138>=_0x32d209){_0xae9138=_0x32d209;_0x2f7116=0xc8;}else{_0x2f7116=0xce;}_0x432213[_0x5d4a('0x1d')](_0x2f7116);return _0x432213[_0x5d4a('0x24')](_0x5d4a('0x25'),_0x51da13+'-'+_0xae9138+'/'+_0x32d209)[_0x5d4a('0x1f')](_0x1770d0);}return null;};}function patchUpdates(_0x44ac23){return function(_0x556ab4){try{jsonpatch[_0x5d4a('0x26')](_0x556ab4,_0x44ac23,!![]);}catch(_0x119ba9){return BPromise[_0x5d4a('0x27')](_0x119ba9);}return _0x556ab4['save']();};}function saveUpdates(_0x1a35d6,_0x4aadce){return function(_0x8be507){if(_0x8be507){return _0x8be507['update'](_0x1a35d6)[_0x5d4a('0x28')](function(_0x1fd289){return _0x1fd289;});}return null;};}function removeEntity(_0x4aef08,_0x205a4e){return function(_0x50d714){if(_0x50d714){return _0x50d714[_0x5d4a('0x29')]()[_0x5d4a('0x28')](function(){_0x4aef08['status'](0xcc)[_0x5d4a('0x1e')]();});}};}function handleEntityNotFound(_0xa1bdeb,_0x1c8482){return function(_0x4c66cc){if(!_0x4c66cc){_0xa1bdeb[_0x5d4a('0x1c')](0x194);}return _0x4c66cc;};}function handleError(_0x4ff3a6,_0x2b7b81){_0x2b7b81=_0x2b7b81||0x1f4;return function(_0x25e032){logger[_0x5d4a('0x2a')](_0x25e032[_0x5d4a('0x2b')]);if(_0x25e032[_0x5d4a('0x2c')]){delete _0x25e032['name'];}_0x4ff3a6[_0x5d4a('0x1d')](_0x2b7b81)['send'](_0x25e032);};}exports[_0x5d4a('0x2d')]=function(_0x5ecaae,_0x4e94db){var _0x466468={},_0xd76df4={},_0x462a4b={'count':0x0,'rows':[]};var _0xb52c4a=_[_0x5d4a('0x2e')](db[_0x5d4a('0x2f')][_0x5d4a('0x30')],function(_0x1a12f7){return{'name':_0x1a12f7[_0x5d4a('0x31')],'type':_0x1a12f7[_0x5d4a('0x32')][_0x5d4a('0x33')]};});_0xd76df4['model']=_[_0x5d4a('0x2e')](_0xb52c4a,_0x5d4a('0x2c'));_0xd76df4[_0x5d4a('0x34')]=_[_0x5d4a('0x35')](_0x5ecaae[_0x5d4a('0x34')]);_0xd76df4[_0x5d4a('0x36')]=_[_0x5d4a('0x37')](_0xd76df4[_0x5d4a('0x38')],_0xd76df4[_0x5d4a('0x34')]);_0x466468[_0x5d4a('0x39')]=_['intersection'](_0xd76df4[_0x5d4a('0x38')],qs[_0x5d4a('0x3a')](_0x5ecaae['query'][_0x5d4a('0x3a')]));_0x466468[_0x5d4a('0x39')]=_0x466468['attributes'][_0x5d4a('0x3b')]?_0x466468[_0x5d4a('0x39')]:_0xd76df4[_0x5d4a('0x38')];if(!_0x5ecaae[_0x5d4a('0x34')][_0x5d4a('0x3c')](_0x5d4a('0x3d'))){_0x466468[_0x5d4a('0x23')]=qs[_0x5d4a('0x23')](_0x5ecaae['query'][_0x5d4a('0x23')]);_0x466468[_0x5d4a('0x21')]=qs[_0x5d4a('0x21')](_0x5ecaae['query'][_0x5d4a('0x21')]);}_0x466468[_0x5d4a('0x3e')]=qs[_0x5d4a('0x3f')](_0x5ecaae[_0x5d4a('0x34')][_0x5d4a('0x3f')]);_0x466468[_0x5d4a('0x40')]=qs[_0x5d4a('0x36')](_[_0x5d4a('0x41')](_0x5ecaae['query'],_0xd76df4[_0x5d4a('0x36')]),_0xb52c4a);if(_0x5ecaae[_0x5d4a('0x34')]['filter']){_0x466468[_0x5d4a('0x40')]=_['merge'](_0x466468['where'],{'$or':_[_0x5d4a('0x2e')](_0xb52c4a,function(_0x1abc99){if(_0x1abc99[_0x5d4a('0x32')]!==_0x5d4a('0x42')){var _0x1fc764={};_0x1fc764[_0x1abc99[_0x5d4a('0x2c')]]={'$like':'%'+_0x5ecaae[_0x5d4a('0x34')]['filter']+'%'};return _0x1fc764;}})});}_0x466468=_[_0x5d4a('0x43')]({},_0x466468,_0x5ecaae[_0x5d4a('0x44')]);var _0x252e15={'where':_0x466468['where']};return db[_0x5d4a('0x2f')][_0x5d4a('0x22')](_0x252e15)[_0x5d4a('0x28')](function(_0x52bd9e){_0x462a4b[_0x5d4a('0x22')]=_0x52bd9e;if(_0x5ecaae[_0x5d4a('0x34')]['includeAll']){_0x466468[_0x5d4a('0x45')]=[{'all':!![]}];}return db[_0x5d4a('0x2f')][_0x5d4a('0x46')](_0x466468);})[_0x5d4a('0x28')](function(_0x4f9b53){_0x462a4b[_0x5d4a('0x47')]=_0x4f9b53;return _0x462a4b;})[_0x5d4a('0x28')](respondWithFilteredResult(_0x4e94db,_0x466468))[_0x5d4a('0x48')](handleError(_0x4e94db,null));};exports[_0x5d4a('0x49')]=function(_0x5b09a0,_0x40a1ac){var _0x14d561={'raw':!![],'where':{'id':_0x5b09a0[_0x5d4a('0x4a')]['id']}},_0x4a6acb={};_0x4a6acb[_0x5d4a('0x38')]=_['keys'](db[_0x5d4a('0x2f')][_0x5d4a('0x30')]);_0x4a6acb[_0x5d4a('0x34')]=_[_0x5d4a('0x35')](_0x5b09a0[_0x5d4a('0x34')]);_0x4a6acb[_0x5d4a('0x36')]=_['intersection'](_0x4a6acb[_0x5d4a('0x38')],_0x4a6acb['query']);_0x14d561['attributes']=_['intersection'](_0x4a6acb[_0x5d4a('0x38')],qs[_0x5d4a('0x3a')](_0x5b09a0[_0x5d4a('0x34')][_0x5d4a('0x3a')]));_0x14d561[_0x5d4a('0x39')]=_0x14d561[_0x5d4a('0x39')][_0x5d4a('0x3b')]?_0x14d561[_0x5d4a('0x39')]:_0x4a6acb['model'];if(_0x5b09a0[_0x5d4a('0x34')][_0x5d4a('0x4b')]){_0x14d561['include']=[{'all':!![]}];}_0x14d561=_[_0x5d4a('0x43')]({},_0x14d561,_0x5b09a0[_0x5d4a('0x44')]);return db[_0x5d4a('0x2f')][_0x5d4a('0x4c')](_0x14d561)['then'](handleEntityNotFound(_0x40a1ac,null))['then'](respondWithResult(_0x40a1ac,null))['catch'](handleError(_0x40a1ac,null));};exports[_0x5d4a('0x4d')]=function(_0x5aa765,_0x1d8e30){var _0x3ca03a={'where':{'id':_0x5aa765['params']['id']}},_0x2c8ce7={};_0x2c8ce7[_0x5d4a('0x38')]=_[_0x5d4a('0x35')](db['Attachment'][_0x5d4a('0x30')]);_0x3ca03a['attributes']=_[_0x5d4a('0x37')](_0x2c8ce7[_0x5d4a('0x38')],qs[_0x5d4a('0x3a')](_0x5aa765[_0x5d4a('0x34')][_0x5d4a('0x3a')]));_0x3ca03a[_0x5d4a('0x39')]=_0x3ca03a[_0x5d4a('0x39')][_0x5d4a('0x3b')]?_0x3ca03a[_0x5d4a('0x39')]:_0x2c8ce7[_0x5d4a('0x38')];if(_0x5aa765[_0x5d4a('0x34')][_0x5d4a('0x4b')]){_0x3ca03a[_0x5d4a('0x45')]=[{'all':!![]}];}_0x3ca03a=_[_0x5d4a('0x43')]({},_0x3ca03a,_0x5aa765['options']);return db[_0x5d4a('0x2f')][_0x5d4a('0x4c')](_0x3ca03a)[_0x5d4a('0x28')](handleEntityNotFound(_0x1d8e30,null))[_0x5d4a('0x28')](function(_0x3ddf13){if(_0x3ddf13){var _0x1406c8=_0x3ddf13[_0x5d4a('0x4e')]({'plain':!![]});_0x1406c8=qs[_0x5d4a('0x4f')](_0x1406c8,['id',_0x5d4a('0x50'),'updatedAt']);_0x5aa765[_0x5d4a('0x51')]=_[_0x5d4a('0x4f')](_0x5aa765[_0x5d4a('0x51')],['id',_0x5d4a('0x50'),_0x5d4a('0x52')]);return db['Attachment'][_0x5d4a('0x53')](_[_0x5d4a('0x43')](_0x1406c8,_0x5aa765[_0x5d4a('0x51')]),{'include':_0x5aa765[_0x5d4a('0x34')][_0x5d4a('0x4b')]?[{'all':!![]}]:undefined});}})[_0x5d4a('0x28')](respondWithResult(_0x1d8e30,0xc9))[_0x5d4a('0x48')](handleError(_0x1d8e30,null));};exports[_0x5d4a('0x54')]=function(_0x13a2c6,_0x1292ce){if(_0x13a2c6[_0x5d4a('0x51')]['id']){delete _0x13a2c6[_0x5d4a('0x51')]['id'];}return db[_0x5d4a('0x2f')]['find']({'where':{'id':_0x13a2c6[_0x5d4a('0x4a')]['id']}})[_0x5d4a('0x28')](handleEntityNotFound(_0x1292ce,null))[_0x5d4a('0x28')](saveUpdates(_0x13a2c6['body'],null))[_0x5d4a('0x28')](respondWithResult(_0x1292ce,null))[_0x5d4a('0x48')](handleError(_0x1292ce,null));};exports[_0x5d4a('0x29')]=function(_0xd5a25,_0x49b730){return db[_0x5d4a('0x2f')]['find']({'where':{'id':_0xd5a25[_0x5d4a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x49b730,null))['then'](removeEntity(_0x49b730,null))[_0x5d4a('0x48')](handleError(_0x49b730,null));};exports[_0x5d4a('0x53')]=function(_0x3baadf,_0x38a2ab,_0xcea70c){_0x3baadf[_0x5d4a('0x51')][_0x5d4a('0x2c')]=_0x3baadf[_0x5d4a('0x55')][_0x5d4a('0x56')];_0x3baadf[_0x5d4a('0x51')][_0x5d4a('0x57')]=_0x3baadf[_0x5d4a('0x55')]['filename'];_0x3baadf['body'][_0x5d4a('0x32')]=_0x3baadf[_0x5d4a('0x55')][_0x5d4a('0x58')];return db[_0x5d4a('0x2f')]['create'](_0x3baadf[_0x5d4a('0x51')])[_0x5d4a('0x28')](respondWithResult(_0x38a2ab,0xc9))[_0x5d4a('0x48')](handleError(_0x38a2ab,null));};exports[_0x5d4a('0x59')]=function(_0x273142,_0x43aa92,_0x38a901){return db['Attachment'][_0x5d4a('0x5a')]({'where':{'id':_0x273142[_0x5d4a('0x4a')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x43aa92,null))[_0x5d4a('0x28')](function(_0x340ea0){if(_0x340ea0){var _0x1313ce=_0x340ea0['ChatOfflineMessageId']!==null;var _0x4a8472=path[_0x5d4a('0x5b')](config['root'],_0x5d4a('0x5c'));if(_0x1313ce){_0x4a8472=path[_0x5d4a('0x5b')](_0x4a8472,_0x5d4a('0x5d'));}var _0x195fdd=path['join'](_0x4a8472,_0x340ea0[_0x5d4a('0x57')]);return _0x43aa92[_0x5d4a('0x59')](_0x195fdd);}})['catch'](handleError(_0x43aa92,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index af0b4de..1525858 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 _0x88f1=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash'];(function(_0x3b3700,_0x340bfb){var _0x20874c=function(_0x1d0d4d){while(--_0x1d0d4d){_0x3b3700['push'](_0x3b3700['shift']());}};_0x20874c(++_0x340bfb);}(_0x88f1,0x68));var _0x188f=function(_0xb9b680,_0x48d725){_0xb9b680=_0xb9b680-0x0;var _0x2382e9=_0x88f1[_0xb9b680];return _0x2382e9;};'use strict';var _=require(_0x188f('0x0'));var util=require(_0x188f('0x1'));var logger=require(_0x188f('0x2'))(_0x188f('0x3'));var moment=require(_0x188f('0x4'));var BPromise=require(_0x188f('0x5'));var rp=require(_0x188f('0x6'));var fs=require('fs');var path=require(_0x188f('0x7'));var rimraf=require(_0x188f('0x8'));var config=require(_0x188f('0x9'));var attributes=require(_0x188f('0xa'));module[_0x188f('0xb')]=function(_0x544e5a,_0x17be24){return _0x544e5a[_0x188f('0xc')](_0x188f('0xd'),attributes,{'tableName':_0x188f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd41d=['moment','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','attachments','lodash','../../config/logger','api'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xd41d,0x131));var _0xdd41=function(_0x9acccd,_0x187b12){_0x9acccd=_0x9acccd-0x0;var _0x14f79b=_0xd41d[_0x9acccd];return _0x14f79b;};'use strict';var _=require(_0xdd41('0x0'));var util=require('util');var logger=require(_0xdd41('0x1'))(_0xdd41('0x2'));var moment=require(_0xdd41('0x3'));var BPromise=require(_0xdd41('0x4'));var rp=require(_0xdd41('0x5'));var fs=require('fs');var path=require(_0xdd41('0x6'));var rimraf=require(_0xdd41('0x7'));var config=require('../../config/environment');var attributes=require(_0xdd41('0x8'));module[_0xdd41('0x9')]=function(_0x2bffa0,_0x46310d){return _0x2bffa0['define']('Attachment',attributes,{'tableName':_0xdd41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index f0c0745..af94d9a 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 _0x94dc=['raw','CreateAttachment','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','create','body','options'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0x94dc,0xb1));var _0xc94d=function(_0x14bf17,_0x10082d){_0x14bf17=_0x14bf17-0x0;var _0x49ceed=_0x94dc[_0x14bf17];return _0x49ceed;};'use strict';var _=require(_0xc94d('0x0'));var util=require('util');var moment=require(_0xc94d('0x1'));var BPromise=require('bluebird');var rs=require(_0xc94d('0x2'));var fs=require('fs');var Redis=require(_0xc94d('0x3'));var db=require(_0xc94d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc94d('0x5'))(_0xc94d('0x6'));var config=require(_0xc94d('0x7'));var jayson=require(_0xc94d('0x8'));var client=jayson[_0xc94d('0x9')][_0xc94d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb7275c,_0x5776ab,_0x2f9757){return new BPromise(function(_0xbe5904,_0x15265c){return client[_0xc94d('0xb')](_0xb7275c,_0x2f9757)[_0xc94d('0xc')](function(_0x579245){logger[_0xc94d('0xd')](_0xc94d('0xe'),_0x5776ab,_0xc94d('0xf'));logger[_0xc94d('0x10')](_0xc94d('0x11'),_0x5776ab,_0xc94d('0xf'),JSON['stringify'](_0x579245));if(_0x579245[_0xc94d('0x12')]){if(_0x579245[_0xc94d('0x12')][_0xc94d('0x13')]===0x1f4){logger[_0xc94d('0x12')]('Attachment,\x20%s,\x20%s',_0x5776ab,_0x579245['error']['message']);return _0x15265c(_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);}logger[_0xc94d('0x12')](_0xc94d('0xe'),_0x5776ab,_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);return _0xbe5904(_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);}else{logger[_0xc94d('0xd')](_0xc94d('0xe'),_0x5776ab,_0xc94d('0xf'));_0xbe5904(_0x579245[_0xc94d('0x15')][_0xc94d('0x14')]);}})[_0xc94d('0x16')](function(_0x19508d){logger['error']('Attachment,\x20%s,\x20%s',_0x5776ab,_0x19508d);_0x15265c(_0x19508d);});});}exports['CreateAttachment']=function(_0x48b879){var _0x345259=this;return new Promise(function(_0x4784a2,_0x4f7287){return db['Attachment'][_0xc94d('0x17')](_0x48b879[_0xc94d('0x18')],{'raw':_0x48b879['options']?_0x48b879[_0xc94d('0x19')][_0xc94d('0x1a')]===undefined?!![]:![]:!![]})[_0xc94d('0xc')](function(_0xb5c1fd){logger[_0xc94d('0xd')](_0xc94d('0x1b'),_0x48b879);logger[_0xc94d('0x10')](_0xc94d('0x1b'),_0x48b879,JSON[_0xc94d('0x1c')](_0xb5c1fd));_0x4784a2(_0xb5c1fd);})[_0xc94d('0x16')](function(_0x5f2820){logger[_0xc94d('0x12')](_0xc94d('0x1b'),_0x5f2820[_0xc94d('0x14')],_0x48b879);_0x4f7287(_0x345259[_0xc94d('0x12')](0x1f4,_0x5f2820[_0xc94d('0x14')]));});});};
\ No newline at end of file
+var _0x1ba2=['http','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Attachment','create','body','options','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1a9a95,_0x211379){var _0x32ff9c=function(_0x29c219){while(--_0x29c219){_0x1a9a95['push'](_0x1a9a95['shift']());}};_0x32ff9c(++_0x211379);}(_0x1ba2,0xb4));var _0x21ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ba2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x21ba('0x0'));var util=require('util');var moment=require(_0x21ba('0x1'));var BPromise=require('bluebird');var rs=require(_0x21ba('0x2'));var fs=require('fs');var Redis=require(_0x21ba('0x3'));var db=require(_0x21ba('0x4'))['db'];var utils=require(_0x21ba('0x5'));var logger=require(_0x21ba('0x6'))('rpc');var config=require(_0x21ba('0x7'));var jayson=require(_0x21ba('0x8'));var client=jayson['client'][_0x21ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53b3e0,_0x44eb71,_0x23c3b7){return new BPromise(function(_0x5c50aa,_0x17755a){return client['request'](_0x53b3e0,_0x23c3b7)[_0x21ba('0xa')](function(_0x261a15){logger['info'](_0x21ba('0xb'),_0x44eb71,_0x21ba('0xc'));logger[_0x21ba('0xd')](_0x21ba('0xe'),_0x44eb71,_0x21ba('0xc'),JSON[_0x21ba('0xf')](_0x261a15));if(_0x261a15[_0x21ba('0x10')]){if(_0x261a15[_0x21ba('0x10')][_0x21ba('0x11')]===0x1f4){logger[_0x21ba('0x10')](_0x21ba('0xb'),_0x44eb71,_0x261a15[_0x21ba('0x10')]['message']);return _0x17755a(_0x261a15['error'][_0x21ba('0x12')]);}logger[_0x21ba('0x10')](_0x21ba('0xb'),_0x44eb71,_0x261a15['error']['message']);return _0x5c50aa(_0x261a15[_0x21ba('0x10')]['message']);}else{logger[_0x21ba('0x13')]('Attachment,\x20%s,\x20%s',_0x44eb71,_0x21ba('0xc'));_0x5c50aa(_0x261a15[_0x21ba('0x14')][_0x21ba('0x12')]);}})[_0x21ba('0x15')](function(_0x10b9e6){logger['error'](_0x21ba('0xb'),_0x44eb71,_0x10b9e6);_0x17755a(_0x10b9e6);});});}exports['CreateAttachment']=function(_0xc995ee){var _0xa1022=this;return new Promise(function(_0x1f2f48,_0x154ef4){return db[_0x21ba('0x16')][_0x21ba('0x17')](_0xc995ee[_0x21ba('0x18')],{'raw':_0xc995ee[_0x21ba('0x19')]?_0xc995ee['options'][_0x21ba('0x1a')]===undefined?!![]:![]:!![]})[_0x21ba('0xa')](function(_0x58ba99){logger[_0x21ba('0x13')]('CreateAttachment',_0xc995ee);logger[_0x21ba('0xd')]('CreateAttachment',_0xc995ee,JSON[_0x21ba('0xf')](_0x58ba99));_0x1f2f48(_0x58ba99);})[_0x21ba('0x15')](function(_0x30ac7a){logger[_0x21ba('0x10')]('CreateAttachment',_0x30ac7a['message'],_0xc995ee);_0x154ef4(_0xa1022['error'](0x1f4,_0x30ac7a['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 47ddecb..3ab9898 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(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5acaec,_0x3fe55a){var _0x2800c0=function(_0x553508){while(--_0x553508){_0x5acaec['push'](_0x5acaec['shift']());}};_0x2800c0(++_0x3fe55a);}(_0x2032,0xd9));var _0x2203=function(_0x42f8b9,_0x110025){_0x42f8b9=_0x42f8b9-0x0;var _0x1dfa39=_0x2032[_0x42f8b9];return _0x1dfa39;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index fe55bb4..dbb495c 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 _0x7062=['../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','profile','email','callback','clientID','secret','callbackURL','Setting','allowedLoginAttempts','blockDuration','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb'];(function(_0x4d26a7,_0x101ad2){var _0x53eab5=function(_0x58d5ee){while(--_0x58d5ee){_0x4d26a7['push'](_0x4d26a7['shift']());}};_0x53eab5(++_0x101ad2);}(_0x7062,0x17b));var _0x2706=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7062[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x2706('0x0'));var passport=require(_0x2706('0x1'));var GoogleStrategy=require(_0x2706('0x2'))[_0x2706('0x3')];var moment=require(_0x2706('0x4'));var db=require(_0x2706('0x5'))['db'];var config=require(_0x2706('0x6'));var signToken=require(_0x2706('0x7'))[_0x2706('0x8')];var utils=require(_0x2706('0x9'));exports[_0x2706('0xa')]=passport[_0x2706('0xb')](_0x2706('0xc'),{'failureRedirect':_0x2706('0xd'),'scope':[_0x2706('0xe'),_0x2706('0xf')],'session':![]});exports[_0x2706('0x10')]=passport['authenticate']('google',{'failureRedirect':_0x2706('0xd'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x2706('0xc')]?config[_0x2706('0xc')][_0x2706('0x11')]:'id','clientSecret':config[_0x2706('0xc')]?config[_0x2706('0xc')]['clientSecret']:_0x2706('0x12'),'callbackURL':config[_0x2706('0xc')]?config[_0x2706('0xc')][_0x2706('0x13')]:''},function(_0x29d55c,_0x312f86,_0x134622,_0x4ac778){var _0x4ebce0,_0x2be654;return db[_0x2706('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0x2706('0x15'),_0x2706('0x16')],'raw':!![]})['then'](function(_0x310a91){_0x4ebce0=_0x310a91;return db['User']['find']({'where':{'email':_[_0x2706('0x17')](_0x134622[_0x2706('0x18')],_0x2706('0x19')),'role':{'$or':[_0x2706('0x1a'),_0x2706('0x1b'),'agent']}}});})[_0x2706('0x1c')](function(_0x3dcbbf){_0x2be654=_0x3dcbbf;if(_0x2be654){if(_0x2be654[_0x2706('0x1d')]){return _0x4ac778(_0x2706('0x1e'));}else if(_0x4ebce0['blockDuration']>0x0){if(_0x2be654['blocked']){if(moment(_0x2be654['blockedAt'])[_0x2706('0x1f')](_0x4ebce0['blockDuration'],_0x2706('0x20'))>moment()){return _0x4ac778(_0x2706('0x1e'));}else{return utils['clearBlockUser'](_0x2be654,0x0,![],null)[_0x2706('0x1c')](function(){return utils[_0x2706('0x21')](_0x2be654);})[_0x2706('0x1c')](function(){return _0x4ac778(null,_0x2be654);});}}else{return utils[_0x2706('0x21')](_0x2be654)['then'](function(){return _0x4ac778(null,_0x2be654);});}}else{return utils[_0x2706('0x21')](_0x2be654)[_0x2706('0x1c')](function(){return _0x4ac778(null,_0x2be654);});}}return _0x4ac778('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x2706('0x22')](function(_0x104125){_0x4ac778(_0x104125);});}));
\ No newline at end of file
+var _0x3831=['passport-google-oauth20','Strategy','moment','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','/login','profile','email','callback','google','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','value','admin','user','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','blockDuration','getLicense','passport'];(function(_0x40b17f,_0x2945ab){var _0x53d4b0=function(_0x1a53de){while(--_0x1a53de){_0x40b17f['push'](_0x40b17f['shift']());}};_0x53d4b0(++_0x2945ab);}(_0x3831,0x131));var _0x1383=function(_0x17e0ff,_0x4dbd1e){_0x17e0ff=_0x17e0ff-0x0;var _0x357979=_0x3831[_0x17e0ff];return _0x357979;};'use strict';var _=require('lodash');var passport=require(_0x1383('0x0'));var GoogleStrategy=require(_0x1383('0x1'))[_0x1383('0x2')];var moment=require(_0x1383('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0x1383('0x4'));var signToken=require(_0x1383('0x5'))[_0x1383('0x6')];var utils=require(_0x1383('0x7'));exports[_0x1383('0x8')]=passport[_0x1383('0x9')]('google',{'failureRedirect':_0x1383('0xa'),'scope':[_0x1383('0xb'),_0x1383('0xc')],'session':![]});exports[_0x1383('0xd')]=passport[_0x1383('0x9')](_0x1383('0xe'),{'failureRedirect':_0x1383('0xa'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x1383('0xe')]?config[_0x1383('0xe')]['clientID']:'id','clientSecret':config[_0x1383('0xe')]?config[_0x1383('0xe')][_0x1383('0xf')]:_0x1383('0x10'),'callbackURL':config[_0x1383('0xe')]?config[_0x1383('0xe')][_0x1383('0x11')]:''},function(_0x4e36e2,_0x538c86,_0x568569,_0x7e9be3){var _0x2ee13f,_0x2249c4;return db[_0x1383('0x12')][_0x1383('0x13')]({'where':{'id':0x1},'attributes':[_0x1383('0x14'),'blockDuration'],'raw':!![]})['then'](function(_0x466d28){_0x2ee13f=_0x466d28;return db[_0x1383('0x15')][_0x1383('0x16')]({'where':{'email':_[_0x1383('0x17')](_0x568569['emails'],_0x1383('0x18')),'role':{'$or':[_0x1383('0x19'),_0x1383('0x1a'),'agent']}}});})[_0x1383('0x1b')](function(_0x21f5b1){_0x2249c4=_0x21f5b1;if(_0x2249c4){if(_0x2249c4['disabled']){return _0x7e9be3(_0x1383('0x1c'));}else if(_0x2ee13f['blockDuration']>0x0){if(_0x2249c4[_0x1383('0x1d')]){if(moment(_0x2249c4[_0x1383('0x1e')])[_0x1383('0x1f')](_0x2ee13f[_0x1383('0x20')],'minutes')>moment()){return _0x7e9be3(_0x1383('0x1c'));}else{return utils['clearBlockUser'](_0x2249c4,0x0,![],null)[_0x1383('0x1b')](function(){return utils[_0x1383('0x21')](_0x2249c4);})[_0x1383('0x1b')](function(){return _0x7e9be3(null,_0x2249c4);});}}else{return utils[_0x1383('0x21')](_0x2249c4)[_0x1383('0x1b')](function(){return _0x7e9be3(null,_0x2249c4);});}}else{return utils[_0x1383('0x21')](_0x2249c4)[_0x1383('0x1b')](function(){return _0x7e9be3(null,_0x2249c4);});}}return _0x7e9be3(_0x1383('0x1c'));})['catch'](function(_0x3e3e9b){_0x7e9be3(_0x3e3e9b);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 3c8996a..b0001e4 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 _0xd289=['../user/user.controller.js','../../components/auth/service','get','callback','isMiddleware','exports','passport','./authGoogle.controller'];(function(_0x39f4e3,_0x392558){var _0x1ebdcb=function(_0x103643){while(--_0x103643){_0x39f4e3['push'](_0x39f4e3['shift']());}};_0x1ebdcb(++_0x392558);}(_0xd289,0xf6));var _0x9d28=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0xd289[_0x1dbaf7];return _0x593f05;};'use strict';var express=require('express');var passport=require(_0x9d28('0x0'));var router=express['Router']();var controller=require(_0x9d28('0x1'));var userController=require(_0x9d28('0x2'));var authService=require(_0x9d28('0x3'));router[_0x9d28('0x4')]('/',controller['login']);router['get']('/callback',controller[_0x9d28('0x5')],authService[_0x9d28('0x6')],userController['login'],authService['setTokenCookie']);module[_0x9d28('0x7')]=router;
\ No newline at end of file
+var _0xad36=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','isMiddleware','setTokenCookie','exports','passport','Router'];(function(_0x243890,_0xa7ab52){var _0xcb3344=function(_0x40b70a){while(--_0x40b70a){_0x243890['push'](_0x243890['shift']());}};_0xcb3344(++_0xa7ab52);}(_0xad36,0x11c));var _0x6ad3=function(_0x4212d8,_0x4d6025){_0x4212d8=_0x4212d8-0x0;var _0x1d5f6d=_0xad36[_0x4212d8];return _0x1d5f6d;};'use strict';var express=require('express');var passport=require(_0x6ad3('0x0'));var router=express[_0x6ad3('0x1')]();var controller=require(_0x6ad3('0x2'));var userController=require(_0x6ad3('0x3'));var authService=require(_0x6ad3('0x4'));router[_0x6ad3('0x5')]('/',controller[_0x6ad3('0x6')]);router[_0x6ad3('0x5')](_0x6ad3('0x7'),controller['callback'],authService[_0x6ad3('0x8')],userController[_0x6ad3('0x6')],authService[_0x6ad3('0x9')]);module[_0x6ad3('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 56e60cc..25446f8 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 _0x0bff=['save','xCally\x20Motion\x20Password\x20Reset','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','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport-local','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','disabled','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','merge','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local','json','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken'];(function(_0x237b12,_0x52e59a){var _0xcd4f97=function(_0x39adfc){while(--_0x39adfc){_0x237b12['push'](_0x237b12['shift']());}};_0xcd4f97(++_0x52e59a);}(_0x0bff,0x1ce));var _0xf0bf=function(_0xf4dbb,_0x49876b){_0xf4dbb=_0xf4dbb-0x0;var _0x246307=_0x0bff[_0xf4dbb];return _0x246307;};'use strict';var util=require(_0xf0bf('0x0'));var passport=require('passport');var LocalStrategy=require(_0xf0bf('0x1'))['Strategy'];var jayson=require(_0xf0bf('0x2'));var _=require('lodash');var rs=require(_0xf0bf('0x3'));var moment=require(_0xf0bf('0x4'));var db=require(_0xf0bf('0x5'))['db'];var authService=require(_0xf0bf('0x6'));var utils=require(_0xf0bf('0x7'));var client=jayson[_0xf0bf('0x8')][_0xf0bf('0x9')]({'port':0x232b});function localAuthenticate(_0x4310cc,_0x20f08b,_0x502b3c,_0x2df76d){var _0x42483e,_0x288d9c;return db[_0xf0bf('0xa')][_0xf0bf('0xb')]({'where':{'id':0x1},'attributes':[_0xf0bf('0xc'),_0xf0bf('0xd')],'raw':!![]})[_0xf0bf('0xe')](function(_0x5ce30f){_0x42483e=_0x5ce30f;return _0x4310cc[_0xf0bf('0xb')]({'attributes':['id',_0xf0bf('0xf'),'password',_0xf0bf('0x10'),_0xf0bf('0x11'),_0xf0bf('0x12'),'blocked',_0xf0bf('0x13'),_0xf0bf('0x14')],'where':{'name':_0x20f08b,'role':{'$or':[_0xf0bf('0x15'),'user',_0xf0bf('0x16')]}}});})[_0xf0bf('0xe')](function(_0x267924){if(!_0x267924||_0x267924&&_0x267924[_0xf0bf('0xf')]!==_0x20f08b){throw new Error(_0xf0bf('0x17'));}else{_0x288d9c=_0x267924;return _0x288d9c;}})[_0xf0bf('0xe')](function(){_0x288d9c[_0xf0bf('0x18')](_0x502b3c,function(_0x72e9d4,_0x1e1fce){var _0x199e4f=_0x288d9c[_0xf0bf('0x14')]+0x1;if(_0x72e9d4){return _0x2df76d(_0x72e9d4);}else if(!_0x1e1fce){if(_0x288d9c['disabled']){return _0x2df76d(null,![],{'message':_0xf0bf('0x17')});}else if(_0x42483e['allowedLoginAttempts']>0x0){if(_0x288d9c[_0xf0bf('0x19')]){if(_0x42483e['blockDuration']>0x0){if(moment(_0x288d9c[_0xf0bf('0x13')])[_0xf0bf('0x1a')](_0x42483e[_0xf0bf('0xd')],_0xf0bf('0x1b'))>moment()){return _0x2df76d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf0bf('0x1c')](_0x288d9c,_0x199e4f,![],null)[_0xf0bf('0xe')](function(){return _0x2df76d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2df76d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x199e4f>=_0x42483e['allowedLoginAttempts']){return utils[_0xf0bf('0x1c')](_0x288d9c,0x0,!![],moment())[_0xf0bf('0xe')](function(){return _0x2df76d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xf0bf('0x1c')](_0x288d9c,_0x199e4f,![],null)[_0xf0bf('0xe')](function(){return _0x2df76d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x2df76d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x288d9c[_0xf0bf('0x12')]){return _0x2df76d(null,![],{'message':_0xf0bf('0x17')});}else if(_0x42483e['allowedLoginAttempts']>0x0){if(_0x288d9c[_0xf0bf('0x19')]){if(_0x42483e['blockDuration']>0x0){if(moment(_0x288d9c['blockedAt'])['add'](_0x42483e[_0xf0bf('0xd')],_0xf0bf('0x1b'))>moment()){return _0x2df76d(null,![],{'message':_0xf0bf('0x17')});}else{return utils[_0xf0bf('0x1c')](_0x288d9c,0x0,![],null)[_0xf0bf('0xe')](function(){return utils[_0xf0bf('0x1d')](_0x288d9c);})[_0xf0bf('0xe')](function(){return _0x2df76d(null,_0x288d9c);});}}else{return _0x2df76d(null,![],{'message':_0xf0bf('0x17')});}}else{return utils[_0xf0bf('0x1c')](_0x288d9c,0x0,![],null)[_0xf0bf('0xe')](function(){return utils['getLicense'](_0x288d9c);})[_0xf0bf('0xe')](function(){return _0x2df76d(null,_0x288d9c);})[_0xf0bf('0x1e')](function(_0x42e922){return _0x2df76d(null,![],_0x42e922);});}}else{if(_0x288d9c[_0xf0bf('0x19')]){return _0x2df76d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf0bf('0x1d')](_0x288d9c)[_0xf0bf('0xe')](function(){return _0x2df76d(null,_0x288d9c);});}}}});})[_0xf0bf('0x1e')](function(_0x553942){return _0x2df76d(null,![],_0x553942);});}function sendServiceMail(_0x48b8d6){return db[_0xf0bf('0x1f')][_0xf0bf('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0xf0bf('0x21')],'include':[{'model':db[_0xf0bf('0x22')],'as':_0xf0bf('0x23')}]})['then'](function(_0x254859){if(!_0x254859){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3f4dbd={'tls':{'rejectUnauthorized':![]}};if(_0x254859[_0xf0bf('0x23')][_0xf0bf('0x24')]){_0x3f4dbd[_0xf0bf('0x24')]=_0x254859[_0xf0bf('0x23')][_0xf0bf('0x24')];}else{_0x3f4dbd[_0xf0bf('0x25')]=_0x254859[_0xf0bf('0x23')]['host'];_0x3f4dbd[_0xf0bf('0x26')]=_0x254859[_0xf0bf('0x23')][_0xf0bf('0x26')];_0x3f4dbd[_0xf0bf('0x27')]=_0x254859[_0xf0bf('0x23')][_0xf0bf('0x27')];}if(_0x254859[_0xf0bf('0x23')][_0xf0bf('0x28')]){_0x3f4dbd[_0xf0bf('0x29')]={'user':_0x254859['Smtp'][_0xf0bf('0x2a')],'pass':_0x254859[_0xf0bf('0x23')][_0xf0bf('0x2b')]};}var _0x14f1e1={'account':_0x3f4dbd,'message':_[_0xf0bf('0x2c')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x254859['name'],_0x254859[_0xf0bf('0x21')]||_0x254859[_0xf0bf('0x23')][_0xf0bf('0x2a')])},_0x48b8d6)};return client[_0xf0bf('0x2d')]('SendMail',_0x14f1e1);})['then'](function(_0x55bb3b){if(_0x55bb3b[_0xf0bf('0x2e')]){throw new Error(util[_0xf0bf('0x2f')](_0xf0bf('0x30'),_0x55bb3b[_0xf0bf('0x2e')][_0xf0bf('0x31')]||JSON[_0xf0bf('0x32')](_0x55bb3b['error'])));}return!![];});}function handleError(_0xd1f7a0,_0x321eff,_0x4d339){return _0xd1f7a0[_0xf0bf('0x33')](_0x321eff||0x1f4)[_0xf0bf('0x34')]({'message':_0x4d339?_0x4d339['message']||_0x4d339:''});}exports[_0xf0bf('0x35')]=function(_0x75bdb8,_0xe452c7,_0x3f4d2f){passport[_0xf0bf('0x18')](_0xf0bf('0x36'),function(_0x369263,_0x322a86,_0x56c430){var _0x2756e8=_0x369263||_0x56c430;if(_0x2756e8){return handleError(_0xe452c7,0x191,_0x2756e8);}if(!_0x322a86){return handleError(_0xe452c7,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x139727={'payload':{'id':_0x322a86['id'],'role':_0x322a86['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x139727)[_0xf0bf('0xe')](function(_0x346bf7){_0xe452c7[_0xf0bf('0x37')]({'id':_0x322a86['id'],'token':_0x346bf7,'statusCall':'','isAlreadyLogged':_0x322a86['online']});});}})(_0x75bdb8,_0xe452c7,_0x3f4d2f);};exports['forgot']=function(_0x1978f7,_0x4133d6,_0x40e44a){if(!_0x1978f7[_0xf0bf('0x38')][_0xf0bf('0x21')]){return handleError(_0x4133d6,0x1f4,{'message':_0xf0bf('0x39')});}var _0xf828a6=rs[_0xf0bf('0x3a')]();_0x1978f7[_0xf0bf('0x38')][_0xf0bf('0x21')]=_0x1978f7['body'][_0xf0bf('0x21')][_0xf0bf('0x3b')]()[_0xf0bf('0x3c')]();var _0x31d6c4;return db[_0xf0bf('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0xf0bf('0xc'),_0xf0bf('0xd')],'raw':!![]})[_0xf0bf('0xe')](function(_0x315212){_0x31d6c4=_0x315212;return db[_0xf0bf('0x3d')]['find']({'where':{'email':_0x1978f7[_0xf0bf('0x38')][_0xf0bf('0x21')]}});})[_0xf0bf('0xe')](function(_0x383775){if(!_0x383775){throw new Error(_0xf0bf('0x3e'));}if(_0x383775[_0xf0bf('0x12')]){throw new Error(_0xf0bf('0x3f'));}if(_0x383775[_0xf0bf('0x19')]){if(moment(_0x383775[_0xf0bf('0x13')])[_0xf0bf('0x1a')](_0x31d6c4[_0xf0bf('0xd')],_0xf0bf('0x1b'))>moment()){throw new Error(_0xf0bf('0x40'));}else{_0x383775[_0xf0bf('0x19')]=![];_0x383775[_0xf0bf('0x13')]=null;}}_0x383775[_0xf0bf('0x41')]=_0xf828a6;_0x383775['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x383775[_0xf0bf('0x42')]();})[_0xf0bf('0xe')](function(){return sendServiceMail({'to':_0x1978f7['body'][_0xf0bf('0x21')],'subject':_0xf0bf('0x43'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xf0bf('0x44')+_0xf0bf('0x45')+_0x1978f7['headers'][_0xf0bf('0x25')]+_0xf0bf('0x46')+_0xf828a6+'\x0a\x0a'+_0xf0bf('0x47')});})[_0xf0bf('0xe')](function(){_0x4133d6[_0xf0bf('0x33')](0xc8)['send']({'message':_0xf0bf('0x48')});})[_0xf0bf('0x1e')](function(_0x1d9536){return handleError(_0x4133d6,0x1f4,_0x1d9536);});};exports[_0xf0bf('0x49')]=function(_0xd22ac4,_0x5c8d60,_0x8ffe67){return db[_0xf0bf('0x3d')][_0xf0bf('0x20')]({'where':{'resetPasswordToken':_0xd22ac4[_0xf0bf('0x4a')][_0xf0bf('0x4b')],'resetPasswordExpires':{'$gt':Date[_0xf0bf('0x4c')]()}}})['then'](function(_0x5797ee){if(!_0x5797ee){throw new Error(_0xf0bf('0x4d'));}return db[_0xf0bf('0xa')]['findOne']({'attributes':['id',_0xf0bf('0x4e'),_0xf0bf('0x4f'),_0xf0bf('0x50')]})[_0xf0bf('0xe')](function(_0x28075a){if(_0x28075a['securePassword'])authService[_0xf0bf('0x51')](_0xd22ac4[_0xf0bf('0x38')][_0xf0bf('0x52')]);if(!_0x28075a[_0xf0bf('0x4f')]||!_0x5797ee[_0xf0bf('0x53')])return _0x5797ee;authService[_0xf0bf('0x54')](_0xd22ac4[_0xf0bf('0x38')]['password'],_0x5797ee[_0xf0bf('0x53')],_0x28075a[_0xf0bf('0x50')]);return _0x5797ee;})[_0xf0bf('0xe')](function(){_0x5797ee[_0xf0bf('0x52')]=_0xd22ac4[_0xf0bf('0x38')]['password'];_0x5797ee['resetPasswordToken']=null;_0x5797ee[_0xf0bf('0x55')]=null;return _0x5797ee[_0xf0bf('0x42')]();});})[_0xf0bf('0xe')](function(){_0x5c8d60[_0xf0bf('0x33')](0xc8)[_0xf0bf('0x34')]({'message':_0xf0bf('0x56')});})[_0xf0bf('0x1e')](function(_0x7467e5){return handleError(_0x5c8d60,0x1f4,_0x7467e5);});};passport[_0xf0bf('0x57')](new LocalStrategy({'usernameField':_0xf0bf('0xf'),'passwordField':_0xf0bf('0x52')},function(_0x45444f,_0x408e37,_0x58cd64){return localAuthenticate(db[_0xf0bf('0x3d')],_0x45444f,_0x408e37,_0x58cd64);}));
\ No newline at end of file
+var _0x52c0=['catch','MailAccount','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','\x22%s\x22\x20<%s>','SendMail','error','format','message','status','send','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','forgot','body','generate','trim','toLowerCase','findOne','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','save','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','name','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','clearBlockUser','minutes','getLicense'];(function(_0x1632e3,_0x2bf4e4){var _0x120eeb=function(_0x549bf6){while(--_0x549bf6){_0x1632e3['push'](_0x1632e3['shift']());}};_0x120eeb(++_0x2bf4e4);}(_0x52c0,0xe6));var _0x052c=function(_0x4754b7,_0x4a0b9e){_0x4754b7=_0x4754b7-0x0;var _0x425f5e=_0x52c0[_0x4754b7];return _0x425f5e;};'use strict';var util=require(_0x052c('0x0'));var passport=require(_0x052c('0x1'));var LocalStrategy=require(_0x052c('0x2'))['Strategy'];var jayson=require(_0x052c('0x3'));var _=require(_0x052c('0x4'));var rs=require(_0x052c('0x5'));var moment=require(_0x052c('0x6'));var db=require(_0x052c('0x7'))['db'];var authService=require(_0x052c('0x8'));var utils=require(_0x052c('0x9'));var client=jayson[_0x052c('0xa')][_0x052c('0xb')]({'port':0x232b});function localAuthenticate(_0x3c4f45,_0x3f2d3d,_0x34afd5,_0x190372){var _0x12c915,_0x4f889b;return db[_0x052c('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0x052c('0xd'),_0x052c('0xe')],'raw':!![]})[_0x052c('0xf')](function(_0x571b52){_0x12c915=_0x571b52;return _0x3c4f45['findOne']({'attributes':['id',_0x052c('0x10'),_0x052c('0x11'),_0x052c('0x12'),'role',_0x052c('0x13'),_0x052c('0x14'),_0x052c('0x15'),_0x052c('0x16')],'where':{'name':_0x3f2d3d,'role':{'$or':[_0x052c('0x17'),_0x052c('0x18'),_0x052c('0x19')]}}});})[_0x052c('0xf')](function(_0x345ae0){if(!_0x345ae0||_0x345ae0&&_0x345ae0[_0x052c('0x10')]!==_0x3f2d3d){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x4f889b=_0x345ae0;return _0x4f889b;}})[_0x052c('0xf')](function(){_0x4f889b['authenticate'](_0x34afd5,function(_0x58797f,_0x529021){var _0x5a1244=_0x4f889b[_0x052c('0x16')]+0x1;if(_0x58797f){return _0x190372(_0x58797f);}else if(!_0x529021){if(_0x4f889b[_0x052c('0x13')]){return _0x190372(null,![],{'message':_0x052c('0x1a')});}else if(_0x12c915[_0x052c('0xd')]>0x0){if(_0x4f889b['blocked']){if(_0x12c915[_0x052c('0xe')]>0x0){if(moment(_0x4f889b['blockedAt'])[_0x052c('0x1b')](_0x12c915[_0x052c('0xe')],'minutes')>moment()){return _0x190372(null,![],{'message':_0x052c('0x1a')});}else{return utils[_0x052c('0x1c')](_0x4f889b,_0x5a1244,![],null)['then'](function(){return _0x190372(null,![],{'message':_0x052c('0x1a')});});}}else{return _0x190372(null,![],{'message':_0x052c('0x1a')});}}else{if(_0x5a1244>=_0x12c915[_0x052c('0xd')]){return utils[_0x052c('0x1c')](_0x4f889b,0x0,!![],moment())[_0x052c('0xf')](function(){return _0x190372(null,![],{'message':_0x052c('0x1a')});});}else{return utils[_0x052c('0x1c')](_0x4f889b,_0x5a1244,![],null)[_0x052c('0xf')](function(){return _0x190372(null,![],{'message':_0x052c('0x1a')});});}}}else{return _0x190372(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x4f889b[_0x052c('0x13')]){return _0x190372(null,![],{'message':_0x052c('0x1a')});}else if(_0x12c915[_0x052c('0xd')]>0x0){if(_0x4f889b[_0x052c('0x14')]){if(_0x12c915['blockDuration']>0x0){if(moment(_0x4f889b['blockedAt'])[_0x052c('0x1b')](_0x12c915['blockDuration'],_0x052c('0x1d'))>moment()){return _0x190372(null,![],{'message':_0x052c('0x1a')});}else{return utils[_0x052c('0x1c')](_0x4f889b,0x0,![],null)[_0x052c('0xf')](function(){return utils[_0x052c('0x1e')](_0x4f889b);})['then'](function(){return _0x190372(null,_0x4f889b);});}}else{return _0x190372(null,![],{'message':_0x052c('0x1a')});}}else{return utils[_0x052c('0x1c')](_0x4f889b,0x0,![],null)['then'](function(){return utils[_0x052c('0x1e')](_0x4f889b);})['then'](function(){return _0x190372(null,_0x4f889b);})[_0x052c('0x1f')](function(_0xfa0e4c){return _0x190372(null,![],_0xfa0e4c);});}}else{if(_0x4f889b[_0x052c('0x14')]){return _0x190372(null,![],{'message':_0x052c('0x1a')});}else{return utils[_0x052c('0x1e')](_0x4f889b)['then'](function(){return _0x190372(null,_0x4f889b);});}}}});})['catch'](function(_0x428c79){return _0x190372(null,![],_0x428c79);});}function sendServiceMail(_0x267c43){return db[_0x052c('0x20')]['find']({'where':{'service':!![]},'attributes':['id',_0x052c('0x10'),_0x052c('0x21')],'include':[{'model':db[_0x052c('0x22')],'as':_0x052c('0x23')}]})[_0x052c('0xf')](function(_0xbe51e2){if(!_0xbe51e2){throw new Error(_0x052c('0x24'));}var _0xae1250={'tls':{'rejectUnauthorized':![]}};if(_0xbe51e2[_0x052c('0x23')][_0x052c('0x25')]){_0xae1250[_0x052c('0x25')]=_0xbe51e2[_0x052c('0x23')][_0x052c('0x25')];}else{_0xae1250['host']=_0xbe51e2[_0x052c('0x23')][_0x052c('0x26')];_0xae1250[_0x052c('0x27')]=_0xbe51e2['Smtp'][_0x052c('0x27')];_0xae1250[_0x052c('0x28')]=_0xbe51e2[_0x052c('0x23')][_0x052c('0x28')];}if(_0xbe51e2[_0x052c('0x23')][_0x052c('0x29')]){_0xae1250['auth']={'user':_0xbe51e2[_0x052c('0x23')]['user'],'pass':_0xbe51e2[_0x052c('0x23')][_0x052c('0x2a')]};}var _0x5d09c0={'account':_0xae1250,'message':_['merge']({'from':util['format'](_0x052c('0x2b'),_0xbe51e2[_0x052c('0x10')],_0xbe51e2[_0x052c('0x21')]||_0xbe51e2[_0x052c('0x23')]['user'])},_0x267c43)};return client['request'](_0x052c('0x2c'),_0x5d09c0);})['then'](function(_0x5aad17){if(_0x5aad17[_0x052c('0x2d')]){throw new Error(util[_0x052c('0x2e')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x5aad17[_0x052c('0x2d')][_0x052c('0x2f')]||JSON['stringify'](_0x5aad17[_0x052c('0x2d')])));}return!![];});}function handleError(_0x2cfe08,_0x2e4cd5,_0x4d5a3b){return _0x2cfe08[_0x052c('0x30')](_0x2e4cd5||0x1f4)[_0x052c('0x31')]({'message':_0x4d5a3b?_0x4d5a3b[_0x052c('0x2f')]||_0x4d5a3b:''});}exports['login']=function(_0x4ed2c9,_0xcdd981,_0x3dab10){passport[_0x052c('0x32')](_0x052c('0x33'),function(_0x5bb68e,_0x234e51,_0x408088){var _0x2e0ab7=_0x5bb68e||_0x408088;if(_0x2e0ab7){return handleError(_0xcdd981,0x191,_0x2e0ab7);}if(!_0x234e51){return handleError(_0xcdd981,0x194,{'message':_0x052c('0x34')});}else{var _0x3bd9e8={'payload':{'id':_0x234e51['id'],'role':_0x234e51[_0x052c('0x35')]},'options':{'expiresIn':0x15180}};return authService[_0x052c('0x36')](_0x3bd9e8)[_0x052c('0xf')](function(_0x200b51){_0xcdd981[_0x052c('0x37')]({'id':_0x234e51['id'],'token':_0x200b51,'statusCall':'','isAlreadyLogged':_0x234e51['online']});});}})(_0x4ed2c9,_0xcdd981,_0x3dab10);};exports[_0x052c('0x38')]=function(_0x4064d8,_0x468c13,_0xbbcf87){if(!_0x4064d8[_0x052c('0x39')]['email']){return handleError(_0x468c13,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x57a985=rs[_0x052c('0x3a')]();_0x4064d8[_0x052c('0x39')]['email']=_0x4064d8['body'][_0x052c('0x21')][_0x052c('0x3b')]()[_0x052c('0x3c')]();var _0x45dd90;return db['Setting'][_0x052c('0x3d')]({'where':{'id':0x1},'attributes':[_0x052c('0xd'),_0x052c('0xe')],'raw':!![]})[_0x052c('0xf')](function(_0x105294){_0x45dd90=_0x105294;return db['User'][_0x052c('0x3e')]({'where':{'email':_0x4064d8[_0x052c('0x39')][_0x052c('0x21')]}});})[_0x052c('0xf')](function(_0x506a87){if(!_0x506a87){throw new Error(_0x052c('0x3f'));}if(_0x506a87[_0x052c('0x13')]){throw new Error(_0x052c('0x40'));}if(_0x506a87[_0x052c('0x14')]){if(moment(_0x506a87[_0x052c('0x15')])['add'](_0x45dd90['blockDuration'],'minutes')>moment()){throw new Error(_0x052c('0x41'));}else{_0x506a87[_0x052c('0x14')]=![];_0x506a87['blockedAt']=null;}}_0x506a87[_0x052c('0x42')]=_0x57a985;_0x506a87[_0x052c('0x43')]=Date[_0x052c('0x44')]()+0x36ee80;return _0x506a87['save']();})[_0x052c('0xf')](function(){return sendServiceMail({'to':_0x4064d8['body'][_0x052c('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x052c('0x45')+_0x052c('0x46')+_0x052c('0x47')+_0x4064d8['headers'][_0x052c('0x26')]+_0x052c('0x48')+_0x57a985+'\x0a\x0a'+_0x052c('0x49')});})[_0x052c('0xf')](function(){_0x468c13['status'](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x143025){return handleError(_0x468c13,0x1f4,_0x143025);});};exports[_0x052c('0x4a')]=function(_0xaa538c,_0x271990,_0x1e5970){return db[_0x052c('0x4b')]['find']({'where':{'resetPasswordToken':_0xaa538c[_0x052c('0x4c')][_0x052c('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x052c('0x44')]()}}})[_0x052c('0xf')](function(_0x28507d){if(!_0x28507d){throw new Error(_0x052c('0x4e'));}return db[_0x052c('0xc')][_0x052c('0x3d')]({'attributes':['id',_0x052c('0x4f'),_0x052c('0x50'),_0x052c('0x51')]})[_0x052c('0xf')](function(_0x5b17c9){if(_0x5b17c9['securePassword'])authService[_0x052c('0x52')](_0xaa538c[_0x052c('0x39')]['password']);if(!_0x5b17c9[_0x052c('0x50')]||!_0x28507d['previousPasswords'])return _0x28507d;authService['validatePasswordHistory'](_0xaa538c[_0x052c('0x39')][_0x052c('0x11')],_0x28507d[_0x052c('0x53')],_0x5b17c9[_0x052c('0x51')]);return _0x28507d;})[_0x052c('0xf')](function(){_0x28507d[_0x052c('0x11')]=_0xaa538c[_0x052c('0x39')][_0x052c('0x11')];_0x28507d[_0x052c('0x42')]=null;_0x28507d[_0x052c('0x43')]=null;return _0x28507d[_0x052c('0x54')]();});})[_0x052c('0xf')](function(){_0x271990[_0x052c('0x30')](0xc8)[_0x052c('0x31')]({'message':_0x052c('0x55')});})[_0x052c('0x1f')](function(_0x59e81b){return handleError(_0x271990,0x1f4,_0x59e81b);});};passport[_0x052c('0x56')](new LocalStrategy({'usernameField':_0x052c('0x10'),'passwordField':_0x052c('0x11')},function(_0x37df22,_0x4b05a3,_0x3881d6){return localAuthenticate(db[_0x052c('0x4b')],_0x37df22,_0x4b05a3,_0x3881d6);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index edb08ba..363ed6d 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 _0x71bd=['exports','express','Router','post','login','forgot','reset'];(function(_0x10d157,_0x1014f7){var _0x3fa120=function(_0x1842bf){while(--_0x1842bf){_0x10d157['push'](_0x10d157['shift']());}};_0x3fa120(++_0x1014f7);}(_0x71bd,0x112));var _0xd71b=function(_0x5e1b5f,_0x4b472b){_0x5e1b5f=_0x5e1b5f-0x0;var _0x421700=_0x71bd[_0x5e1b5f];return _0x421700;};'use strict';var express=require(_0xd71b('0x0'));var router=express[_0xd71b('0x1')]();var controller=require('./authLocal.controller');router[_0xd71b('0x2')]('/',controller[_0xd71b('0x3')]);router[_0xd71b('0x2')]('/forgot',controller[_0xd71b('0x4')]);router[_0xd71b('0x2')]('/reset/:token',controller[_0xd71b('0x5')]);module[_0xd71b('0x6')]=router;
\ No newline at end of file
+var _0x28b2=['/forgot','forgot','/reset/:token','exports','express','Router','./authLocal.controller','login','post'];(function(_0x3eb87c,_0x4e53e7){var _0x1f9c20=function(_0x52b24c){while(--_0x52b24c){_0x3eb87c['push'](_0x3eb87c['shift']());}};_0x1f9c20(++_0x4e53e7);}(_0x28b2,0xf7));var _0x228b=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x28b2[_0x2f45ea];return _0x485a84;};'use strict';var express=require(_0x228b('0x0'));var router=express[_0x228b('0x1')]();var controller=require(_0x228b('0x2'));router['post']('/',controller[_0x228b('0x3')]);router[_0x228b('0x4')](_0x228b('0x5'),controller[_0x228b('0x6')]);router['post'](_0x228b('0x7'),controller['reset']);module[_0x228b('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 5641d6b..d3843e0 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 _0xd19a=['sequelize','STRING','INTEGER'];(function(_0x32cf96,_0x7502d5){var _0x125cc1=function(_0x376987){while(--_0x376987){_0x32cf96['push'](_0x32cf96['shift']());}};_0x125cc1(++_0x7502d5);}(_0xd19a,0x147));var _0xad19=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd19a[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xad19('0x0'));module['exports']={'name':{'type':Sequelize[_0xad19('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xad19('0x1')]},'description':{'type':Sequelize[_0xad19('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xad19('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xf1c5=['INTEGER','sequelize','exports','STRING'];(function(_0x5e5e77,_0x290ee4){var _0x2d7c62=function(_0x5e6cf3){while(--_0x5e6cf3){_0x5e5e77['push'](_0x5e5e77['shift']());}};_0x2d7c62(++_0x290ee4);}(_0xf1c5,0x81));var _0x5f1c=function(_0x321be3,_0xdf3108){_0x321be3=_0x321be3-0x0;var _0xb0a8e6=_0xf1c5[_0x321be3];return _0xb0a8e6;};'use strict';var Sequelize=require(_0x5f1c('0x0'));module[_0x5f1c('0x1')]={'name':{'type':Sequelize[_0x5f1c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x5f1c('0x2')]},'description':{'type':Sequelize[_0x5f1c('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5f1c('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 95ea9bc..a931c1b 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 _0x004d=['getConditions','findOne','length','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','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','undefined','limit','offset','set','Content-Range','reject','save','update','destroy','sendStatus','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','then','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','addConditions','Condition','ids','omit'];(function(_0x20f9bc,_0x1057f0){var _0x2060a4=function(_0x3e3e89){while(--_0x3e3e89){_0x20f9bc['push'](_0x20f9bc['shift']());}};_0x2060a4(++_0x1057f0);}(_0x004d,0xb7));var _0xd004=function(_0x5592a9,_0x352349){_0x5592a9=_0x5592a9-0x0;var _0xa0795=_0x004d[_0x5592a9];return _0xa0795;};'use strict';var emlformat=require(_0xd004('0x0'));var rimraf=require(_0xd004('0x1'));var zipdir=require(_0xd004('0x2'));var jsonpatch=require(_0xd004('0x3'));var rp=require(_0xd004('0x4'));var moment=require(_0xd004('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd004('0x6'));var util=require('util');var path=require(_0xd004('0x7'));var sox=require(_0xd004('0x8'));var csv=require(_0xd004('0x9'));var ejs=require(_0xd004('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd004('0xb'));var squel=require(_0xd004('0xc'));var crypto=require(_0xd004('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd004('0xe'));var toCsv=require(_0xd004('0x9'));var querystring=require(_0xd004('0xf'));var Papa=require(_0xd004('0x10'));var Redis=require(_0xd004('0x11'));var authService=require(_0xd004('0x12'));var qs=require(_0xd004('0x13'));var as=require(_0xd004('0x14'));var hardwareService=require(_0xd004('0x15'));var logger=require('../../config/logger')(_0xd004('0x16'));var utils=require(_0xd004('0x17'));var config=require(_0xd004('0x18'));var licenseUtil=require(_0xd004('0x19'));var db=require(_0xd004('0x1a'))['db'];function respondWithStatusCode(_0x545e7b,_0x1d88d6){_0x1d88d6=_0x1d88d6||0xcc;return function(_0x1b90a7){if(_0x1b90a7){return _0x545e7b['sendStatus'](_0x1d88d6);}return _0x545e7b[_0xd004('0x1b')](_0x1d88d6)[_0xd004('0x1c')]();};}function respondWithResult(_0x203c03,_0x454734){_0x454734=_0x454734||0xc8;return function(_0x2a28f5){if(_0x2a28f5){return _0x203c03[_0xd004('0x1b')](_0x454734)['json'](_0x2a28f5);}};}function respondWithFilteredResult(_0x4fde0a,_0x1e818f){return function(_0x199d68){if(_0x199d68){var _0x2a2582=typeof _0x1e818f['offset']===_0xd004('0x1d')&&typeof _0x1e818f[_0xd004('0x1e')]===_0xd004('0x1d');var _0x28c317=_0x199d68['count'];var _0x4f42fa=_0x2a2582?0x0:_0x1e818f[_0xd004('0x1f')];var _0x5d0447=_0x2a2582?_0x199d68['count']:_0x1e818f[_0xd004('0x1f')]+_0x1e818f['limit'];var _0x2014e2;if(_0x5d0447>=_0x28c317){_0x5d0447=_0x28c317;_0x2014e2=0xc8;}else{_0x2014e2=0xce;}_0x4fde0a['status'](_0x2014e2);return _0x4fde0a[_0xd004('0x20')](_0xd004('0x21'),_0x4f42fa+'-'+_0x5d0447+'/'+_0x28c317)['json'](_0x199d68);}return null;};}function patchUpdates(_0x1aee8a){return function(_0x48a120){try{jsonpatch['apply'](_0x48a120,_0x1aee8a,!![]);}catch(_0x63eb92){return BPromise[_0xd004('0x22')](_0x63eb92);}return _0x48a120[_0xd004('0x23')]();};}function saveUpdates(_0x3b1cd5,_0x1f5b1a){return function(_0x518d7d){if(_0x518d7d){return _0x518d7d[_0xd004('0x24')](_0x3b1cd5)['then'](function(_0x52e965){return _0x52e965;});}return null;};}function removeEntity(_0x20a9e3,_0x5c4225){return function(_0xc3d2c8){if(_0xc3d2c8){return _0xc3d2c8[_0xd004('0x25')]()['then'](function(){_0x20a9e3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50121b,_0x3a2ed6){return function(_0x1dfea3){if(!_0x1dfea3){_0x50121b[_0xd004('0x26')](0x194);}return _0x1dfea3;};}function handleError(_0x245a88,_0x290c6d){_0x290c6d=_0x290c6d||0x1f4;return function(_0x2ad8bd){logger[_0xd004('0x27')](_0x2ad8bd[_0xd004('0x28')]);if(_0x2ad8bd[_0xd004('0x29')]){delete _0x2ad8bd[_0xd004('0x29')];}_0x245a88[_0xd004('0x1b')](_0x290c6d)[_0xd004('0x2a')](_0x2ad8bd);};}exports[_0xd004('0x2b')]=function(_0x53185c,_0x1e9744){var _0x37ac46={},_0xf409aa={},_0x581db1={'count':0x0,'rows':[]};var _0x3b1236=_['map'](db[_0xd004('0x2c')][_0xd004('0x2d')],function(_0x5d0326){return{'name':_0x5d0326[_0xd004('0x2e')],'type':_0x5d0326[_0xd004('0x2f')][_0xd004('0x30')]};});_0xf409aa[_0xd004('0x31')]=_[_0xd004('0x32')](_0x3b1236,_0xd004('0x29'));_0xf409aa[_0xd004('0x33')]=_[_0xd004('0x34')](_0x53185c[_0xd004('0x33')]);_0xf409aa['filters']=_[_0xd004('0x35')](_0xf409aa[_0xd004('0x31')],_0xf409aa['query']);_0x37ac46['attributes']=_[_0xd004('0x35')](_0xf409aa[_0xd004('0x31')],qs[_0xd004('0x36')](_0x53185c['query'][_0xd004('0x36')]));_0x37ac46[_0xd004('0x37')]=_0x37ac46['attributes']['length']?_0x37ac46[_0xd004('0x37')]:_0xf409aa[_0xd004('0x31')];if(!_0x53185c['query']['hasOwnProperty'](_0xd004('0x38'))){_0x37ac46[_0xd004('0x1e')]=qs[_0xd004('0x1e')](_0x53185c['query']['limit']);_0x37ac46['offset']=qs[_0xd004('0x1f')](_0x53185c[_0xd004('0x33')][_0xd004('0x1f')]);}_0x37ac46['order']=qs[_0xd004('0x39')](_0x53185c[_0xd004('0x33')][_0xd004('0x39')]);_0x37ac46[_0xd004('0x3a')]=qs['filters'](_[_0xd004('0x3b')](_0x53185c[_0xd004('0x33')],_0xf409aa[_0xd004('0x3c')]),_0x3b1236);if(_0x53185c[_0xd004('0x33')][_0xd004('0x3d')]){_0x37ac46[_0xd004('0x3a')]=_[_0xd004('0x3e')](_0x37ac46[_0xd004('0x3a')],{'$or':_[_0xd004('0x32')](_0x3b1236,function(_0x2bb8f1){if(_0x2bb8f1[_0xd004('0x2f')]!==_0xd004('0x3f')){var _0x32a9ec={};_0x32a9ec[_0x2bb8f1['name']]={'$like':'%'+_0x53185c[_0xd004('0x33')][_0xd004('0x3d')]+'%'};return _0x32a9ec;}})});}_0x37ac46=_[_0xd004('0x3e')]({},_0x37ac46,_0x53185c[_0xd004('0x40')]);var _0x5e625b={'where':_0x37ac46[_0xd004('0x3a')]};return db[_0xd004('0x2c')]['count'](_0x5e625b)[_0xd004('0x41')](function(_0x466823){_0x581db1[_0xd004('0x42')]=_0x466823;if(_0x53185c[_0xd004('0x33')][_0xd004('0x43')]){_0x37ac46['include']=[{'all':!![]}];}return db[_0xd004('0x2c')][_0xd004('0x44')](_0x37ac46);})['then'](function(_0x575ae9){_0x581db1[_0xd004('0x45')]=_0x575ae9;return _0x581db1;})[_0xd004('0x41')](respondWithFilteredResult(_0x1e9744,_0x37ac46))[_0xd004('0x46')](handleError(_0x1e9744,null));};exports[_0xd004('0x47')]=function(_0x472210,_0x268694){var _0x228a2d={'raw':![],'where':{'id':_0x472210['params']['id']}},_0xf7f6e7={};_0xf7f6e7[_0xd004('0x31')]=_[_0xd004('0x34')](db[_0xd004('0x2c')][_0xd004('0x2d')]);_0xf7f6e7[_0xd004('0x33')]=_['keys'](_0x472210[_0xd004('0x33')]);_0xf7f6e7[_0xd004('0x3c')]=_[_0xd004('0x35')](_0xf7f6e7[_0xd004('0x31')],_0xf7f6e7[_0xd004('0x33')]);_0x228a2d['attributes']=_[_0xd004('0x35')](_0xf7f6e7[_0xd004('0x31')],qs[_0xd004('0x36')](_0x472210[_0xd004('0x33')][_0xd004('0x36')]));_0x228a2d[_0xd004('0x37')]=_0x228a2d[_0xd004('0x37')]['length']?_0x228a2d['attributes']:_0xf7f6e7[_0xd004('0x31')];if(_0x472210[_0xd004('0x33')][_0xd004('0x43')]){_0x228a2d[_0xd004('0x48')]=[{'all':!![]}];}_0x228a2d=_[_0xd004('0x3e')]({},_0x228a2d,_0x472210['options']);return db['Automation'][_0xd004('0x49')](_0x228a2d)[_0xd004('0x41')](handleEntityNotFound(_0x268694,null))[_0xd004('0x41')](respondWithResult(_0x268694,null))[_0xd004('0x46')](handleError(_0x268694,null));};exports['create']=function(_0x432040,_0x1d9f3c){return db[_0xd004('0x2c')][_0xd004('0x4a')](_0x432040[_0xd004('0x4b')],{})[_0xd004('0x41')](respondWithResult(_0x1d9f3c,0xc9))['catch'](handleError(_0x1d9f3c,null));};exports[_0xd004('0x24')]=function(_0x278de1,_0x2e3f35){if(_0x278de1['body']['id']){delete _0x278de1[_0xd004('0x4b')]['id'];}return db['Automation'][_0xd004('0x49')]({'where':{'id':_0x278de1[_0xd004('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2e3f35,null))[_0xd004('0x41')](saveUpdates(_0x278de1[_0xd004('0x4b')],null))[_0xd004('0x41')](respondWithResult(_0x2e3f35,null))[_0xd004('0x46')](handleError(_0x2e3f35,null));};exports[_0xd004('0x25')]=function(_0x179ca6,_0x53ae76){return db[_0xd004('0x2c')][_0xd004('0x49')]({'where':{'id':_0x179ca6[_0xd004('0x4c')]['id']}})[_0xd004('0x41')](handleEntityNotFound(_0x53ae76,null))[_0xd004('0x41')](removeEntity(_0x53ae76,null))['catch'](handleError(_0x53ae76,null));};exports[_0xd004('0x4d')]=function(_0x48b50c,_0x4957c8,_0x5c0517){return db[_0xd004('0x4e')][_0xd004('0x49')]({'where':{'id':_0x48b50c[_0xd004('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4957c8,null))['then'](function(_0x2f3346){if(_0x2f3346){return _0x2f3346[_0xd004('0x4d')](_0x48b50c[_0xd004('0x4b')][_0xd004('0x4f')],_[_0xd004('0x50')](_0x48b50c[_0xd004('0x4b')],[_0xd004('0x4f'),'id'])||{});}})[_0xd004('0x41')](respondWithResult(_0x4957c8,null))['catch'](handleError(_0x4957c8,null));};exports[_0xd004('0x51')]=function(_0x584d25,_0x2b946a,_0x5d9046){var _0x1424f1={};var _0x3d23cf={};var _0x88ad3b;var _0x2b2b5d;return db[_0xd004('0x2c')][_0xd004('0x52')]({'where':{'id':_0x584d25[_0xd004('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2b946a,null))[_0xd004('0x41')](function(_0x9ff447){if(_0x9ff447){_0x88ad3b=_0x9ff447;_0x3d23cf[_0xd004('0x31')]=_['keys'](db[_0xd004('0x4e')][_0xd004('0x2d')]);_0x3d23cf[_0xd004('0x33')]=_[_0xd004('0x34')](_0x584d25['query']);_0x3d23cf[_0xd004('0x3c')]=_[_0xd004('0x35')](_0x3d23cf['model'],_0x3d23cf['query']);_0x1424f1[_0xd004('0x37')]=_[_0xd004('0x35')](_0x3d23cf['model'],qs[_0xd004('0x36')](_0x584d25[_0xd004('0x33')][_0xd004('0x36')]));_0x1424f1['attributes']=_0x1424f1[_0xd004('0x37')][_0xd004('0x53')]?_0x1424f1[_0xd004('0x37')]:_0x3d23cf['model'];_0x1424f1['order']=qs['sort'](_0x584d25['query'][_0xd004('0x39')]);_0x1424f1[_0xd004('0x3a')]=qs[_0xd004('0x3c')](_['pick'](_0x584d25['query'],_0x3d23cf['filters']));if(_0x584d25[_0xd004('0x33')][_0xd004('0x3d')]){_0x1424f1[_0xd004('0x3a')]=_['merge'](_0x1424f1[_0xd004('0x3a')],{'$or':_['map'](_0x1424f1[_0xd004('0x37')],function(_0x2924d1){var _0x39eb9b={};_0x39eb9b[_0x2924d1]={'$like':'%'+_0x584d25[_0xd004('0x33')][_0xd004('0x3d')]+'%'};return _0x39eb9b;})});}_0x1424f1=_['merge']({},_0x1424f1,_0x584d25[_0xd004('0x40')]);return _0x88ad3b[_0xd004('0x51')](_0x1424f1);}})[_0xd004('0x41')](function(_0x3bcc82){if(_0x3bcc82){_0x2b2b5d=_0x3bcc82[_0xd004('0x53')];if(!_0x584d25[_0xd004('0x33')][_0xd004('0x54')]('nolimit')){_0x1424f1[_0xd004('0x1e')]=qs[_0xd004('0x1e')](_0x584d25['query'][_0xd004('0x1e')]);_0x1424f1[_0xd004('0x1f')]=qs[_0xd004('0x1f')](_0x584d25[_0xd004('0x33')][_0xd004('0x1f')]);}return _0x88ad3b['getConditions'](_0x1424f1);}})[_0xd004('0x41')](function(_0x3850a8){if(_0x3850a8){return _0x3850a8?{'count':_0x2b2b5d,'rows':_0x3850a8}:null;}})[_0xd004('0x41')](respondWithResult(_0x2b946a,null))['catch'](handleError(_0x2b946a,null));};exports[_0xd004('0x55')]=function(_0x2a296c,_0x279329,_0x31de28){return db[_0xd004('0x56')][_0xd004('0x49')]({'where':{'id':_0x2a296c['params']['id']}})[_0xd004('0x41')](handleEntityNotFound(_0x279329,null))['then'](function(_0x353cd5){if(_0x353cd5){return _0x353cd5[_0xd004('0x55')](_0x2a296c['body'][_0xd004('0x4f')],_[_0xd004('0x50')](_0x2a296c[_0xd004('0x4b')],[_0xd004('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x279329,null))[_0xd004('0x46')](handleError(_0x279329,null));};exports[_0xd004('0x57')]=function(_0x4e1763,_0x38a195,_0x192e18){var _0x136cc6={};var _0x2170cc={};var _0x2d412b;var _0x4c90be;return db['Automation'][_0xd004('0x52')]({'where':{'id':_0x4e1763[_0xd004('0x4c')]['id']}})[_0xd004('0x41')](handleEntityNotFound(_0x38a195,null))['then'](function(_0x253baf){if(_0x253baf){_0x2d412b=_0x253baf;_0x2170cc[_0xd004('0x31')]=_[_0xd004('0x34')](db['Action']['rawAttributes']);_0x2170cc[_0xd004('0x33')]=_[_0xd004('0x34')](_0x4e1763['query']);_0x2170cc[_0xd004('0x3c')]=_[_0xd004('0x35')](_0x2170cc[_0xd004('0x31')],_0x2170cc[_0xd004('0x33')]);_0x136cc6[_0xd004('0x37')]=_[_0xd004('0x35')](_0x2170cc[_0xd004('0x31')],qs[_0xd004('0x36')](_0x4e1763['query'][_0xd004('0x36')]));_0x136cc6['attributes']=_0x136cc6[_0xd004('0x37')][_0xd004('0x53')]?_0x136cc6['attributes']:_0x2170cc['model'];_0x136cc6['order']=qs[_0xd004('0x39')](_0x4e1763['query']['sort']);_0x136cc6[_0xd004('0x3a')]=qs[_0xd004('0x3c')](_[_0xd004('0x3b')](_0x4e1763[_0xd004('0x33')],_0x2170cc[_0xd004('0x3c')]));if(_0x4e1763[_0xd004('0x33')][_0xd004('0x3d')]){_0x136cc6['where']=_[_0xd004('0x3e')](_0x136cc6[_0xd004('0x3a')],{'$or':_[_0xd004('0x32')](_0x136cc6[_0xd004('0x37')],function(_0x19db0c){var _0x18a133={};_0x18a133[_0x19db0c]={'$like':'%'+_0x4e1763['query'][_0xd004('0x3d')]+'%'};return _0x18a133;})});}_0x136cc6=_['merge']({},_0x136cc6,_0x4e1763[_0xd004('0x40')]);return _0x2d412b['getActions'](_0x136cc6);}})[_0xd004('0x41')](function(_0x2338c9){if(_0x2338c9){_0x4c90be=_0x2338c9[_0xd004('0x53')];if(!_0x4e1763[_0xd004('0x33')][_0xd004('0x54')](_0xd004('0x38'))){_0x136cc6[_0xd004('0x1e')]=qs[_0xd004('0x1e')](_0x4e1763['query'][_0xd004('0x1e')]);_0x136cc6[_0xd004('0x1f')]=qs['offset'](_0x4e1763[_0xd004('0x33')][_0xd004('0x1f')]);}return _0x2d412b[_0xd004('0x57')](_0x136cc6);}})[_0xd004('0x41')](function(_0x4aedff){if(_0x4aedff){return _0x4aedff?{'count':_0x4c90be,'rows':_0x4aedff}:null;}})[_0xd004('0x41')](respondWithResult(_0x38a195,null))['catch'](handleError(_0x38a195,null));};
\ No newline at end of file
+var _0x0eb2=['length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','catch','show','params','includeAll','options','create','body','find','addConditions','getConditions','Condition','nolimit','addActions','ids','omit','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','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','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','Automation','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields'];(function(_0xc448c3,_0x455089){var _0x1f332d=function(_0x3703e9){while(--_0x3703e9){_0xc448c3['push'](_0xc448c3['shift']());}};_0x1f332d(++_0x455089);}(_0x0eb2,0x16b));var _0x20eb=function(_0x5e6141,_0x259edc){_0x5e6141=_0x5e6141-0x0;var _0x42340f=_0x0eb2[_0x5e6141];return _0x42340f;};'use strict';var emlformat=require(_0x20eb('0x0'));var rimraf=require(_0x20eb('0x1'));var zipdir=require(_0x20eb('0x2'));var jsonpatch=require(_0x20eb('0x3'));var rp=require(_0x20eb('0x4'));var moment=require(_0x20eb('0x5'));var BPromise=require(_0x20eb('0x6'));var Mustache=require(_0x20eb('0x7'));var util=require(_0x20eb('0x8'));var path=require(_0x20eb('0x9'));var sox=require(_0x20eb('0xa'));var csv=require(_0x20eb('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x20eb('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x20eb('0xd'));var jsforce=require(_0x20eb('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x20eb('0xf'));var Redis=require(_0x20eb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x20eb('0x11'));var as=require(_0x20eb('0x12'));var hardwareService=require(_0x20eb('0x13'));var logger=require(_0x20eb('0x14'))('api');var utils=require(_0x20eb('0x15'));var config=require(_0x20eb('0x16'));var licenseUtil=require(_0x20eb('0x17'));var db=require(_0x20eb('0x18'))['db'];function respondWithStatusCode(_0x2798c9,_0x490533){_0x490533=_0x490533||0xcc;return function(_0x364df7){if(_0x364df7){return _0x2798c9[_0x20eb('0x19')](_0x490533);}return _0x2798c9[_0x20eb('0x1a')](_0x490533)[_0x20eb('0x1b')]();};}function respondWithResult(_0x474bf4,_0x2530b1){_0x2530b1=_0x2530b1||0xc8;return function(_0x5c77f7){if(_0x5c77f7){return _0x474bf4['status'](_0x2530b1)[_0x20eb('0x1c')](_0x5c77f7);}};}function respondWithFilteredResult(_0x3c7d84,_0x4a6386){return function(_0x2987d1){if(_0x2987d1){var _0x4e15b0=typeof _0x4a6386[_0x20eb('0x1d')]===_0x20eb('0x1e')&&typeof _0x4a6386['limit']===_0x20eb('0x1e');var _0x5e4eb8=_0x2987d1[_0x20eb('0x1f')];var _0x395e16=_0x4e15b0?0x0:_0x4a6386[_0x20eb('0x1d')];var _0x519812=_0x4e15b0?_0x2987d1['count']:_0x4a6386[_0x20eb('0x1d')]+_0x4a6386[_0x20eb('0x20')];var _0x3ecc6;if(_0x519812>=_0x5e4eb8){_0x519812=_0x5e4eb8;_0x3ecc6=0xc8;}else{_0x3ecc6=0xce;}_0x3c7d84[_0x20eb('0x1a')](_0x3ecc6);return _0x3c7d84[_0x20eb('0x21')](_0x20eb('0x22'),_0x395e16+'-'+_0x519812+'/'+_0x5e4eb8)[_0x20eb('0x1c')](_0x2987d1);}return null;};}function patchUpdates(_0x3ad27d){return function(_0x2c8327){try{jsonpatch[_0x20eb('0x23')](_0x2c8327,_0x3ad27d,!![]);}catch(_0x18fc4e){return BPromise[_0x20eb('0x24')](_0x18fc4e);}return _0x2c8327['save']();};}function saveUpdates(_0x415eb1,_0x534469){return function(_0x9c9785){if(_0x9c9785){return _0x9c9785[_0x20eb('0x25')](_0x415eb1)[_0x20eb('0x26')](function(_0x37db07){return _0x37db07;});}return null;};}function removeEntity(_0x54ad17,_0x4a2015){return function(_0x5815ff){if(_0x5815ff){return _0x5815ff[_0x20eb('0x27')]()['then'](function(){_0x54ad17[_0x20eb('0x1a')](0xcc)[_0x20eb('0x1b')]();});}};}function handleEntityNotFound(_0x566669,_0x2494b6){return function(_0x4a99d5){if(!_0x4a99d5){_0x566669['sendStatus'](0x194);}return _0x4a99d5;};}function handleError(_0xa2099b,_0x1da478){_0x1da478=_0x1da478||0x1f4;return function(_0x21896f){logger[_0x20eb('0x28')](_0x21896f[_0x20eb('0x29')]);if(_0x21896f[_0x20eb('0x2a')]){delete _0x21896f[_0x20eb('0x2a')];}_0xa2099b[_0x20eb('0x1a')](_0x1da478)[_0x20eb('0x2b')](_0x21896f);};}exports['index']=function(_0x299a73,_0x4f2eb8){var _0xf94d0b={},_0x15b893={},_0x5eec61={'count':0x0,'rows':[]};var _0x38c2b4=_['map'](db[_0x20eb('0x2c')][_0x20eb('0x2d')],function(_0x32494e){return{'name':_0x32494e[_0x20eb('0x2e')],'type':_0x32494e[_0x20eb('0x2f')][_0x20eb('0x30')]};});_0x15b893['model']=_[_0x20eb('0x31')](_0x38c2b4,_0x20eb('0x2a'));_0x15b893[_0x20eb('0x32')]=_[_0x20eb('0x33')](_0x299a73[_0x20eb('0x32')]);_0x15b893[_0x20eb('0x34')]=_['intersection'](_0x15b893[_0x20eb('0x35')],_0x15b893[_0x20eb('0x32')]);_0xf94d0b[_0x20eb('0x36')]=_[_0x20eb('0x37')](_0x15b893[_0x20eb('0x35')],qs[_0x20eb('0x38')](_0x299a73[_0x20eb('0x32')]['fields']));_0xf94d0b[_0x20eb('0x36')]=_0xf94d0b[_0x20eb('0x36')][_0x20eb('0x39')]?_0xf94d0b[_0x20eb('0x36')]:_0x15b893[_0x20eb('0x35')];if(!_0x299a73['query'][_0x20eb('0x3a')]('nolimit')){_0xf94d0b['limit']=qs[_0x20eb('0x20')](_0x299a73[_0x20eb('0x32')][_0x20eb('0x20')]);_0xf94d0b['offset']=qs[_0x20eb('0x1d')](_0x299a73[_0x20eb('0x32')][_0x20eb('0x1d')]);}_0xf94d0b[_0x20eb('0x3b')]=qs['sort'](_0x299a73[_0x20eb('0x32')][_0x20eb('0x3c')]);_0xf94d0b[_0x20eb('0x3d')]=qs['filters'](_[_0x20eb('0x3e')](_0x299a73[_0x20eb('0x32')],_0x15b893[_0x20eb('0x34')]),_0x38c2b4);if(_0x299a73[_0x20eb('0x32')][_0x20eb('0x3f')]){_0xf94d0b[_0x20eb('0x3d')]=_[_0x20eb('0x40')](_0xf94d0b[_0x20eb('0x3d')],{'$or':_[_0x20eb('0x31')](_0x38c2b4,function(_0x298726){if(_0x298726[_0x20eb('0x2f')]!==_0x20eb('0x41')){var _0x2acea8={};_0x2acea8[_0x298726[_0x20eb('0x2a')]]={'$like':'%'+_0x299a73[_0x20eb('0x32')][_0x20eb('0x3f')]+'%'};return _0x2acea8;}})});}_0xf94d0b=_['merge']({},_0xf94d0b,_0x299a73['options']);var _0x35c02e={'where':_0xf94d0b['where']};return db[_0x20eb('0x2c')][_0x20eb('0x1f')](_0x35c02e)['then'](function(_0xc041be){_0x5eec61['count']=_0xc041be;if(_0x299a73[_0x20eb('0x32')]['includeAll']){_0xf94d0b[_0x20eb('0x42')]=[{'all':!![]}];}return db['Automation']['findAll'](_0xf94d0b);})[_0x20eb('0x26')](function(_0x285697){_0x5eec61['rows']=_0x285697;return _0x5eec61;})['then'](respondWithFilteredResult(_0x4f2eb8,_0xf94d0b))[_0x20eb('0x43')](handleError(_0x4f2eb8,null));};exports[_0x20eb('0x44')]=function(_0x1c2819,_0x13fd3a){var _0x4a520a={'raw':![],'where':{'id':_0x1c2819[_0x20eb('0x45')]['id']}},_0x44ec76={};_0x44ec76[_0x20eb('0x35')]=_[_0x20eb('0x33')](db['Automation'][_0x20eb('0x2d')]);_0x44ec76[_0x20eb('0x32')]=_[_0x20eb('0x33')](_0x1c2819[_0x20eb('0x32')]);_0x44ec76[_0x20eb('0x34')]=_[_0x20eb('0x37')](_0x44ec76[_0x20eb('0x35')],_0x44ec76['query']);_0x4a520a[_0x20eb('0x36')]=_[_0x20eb('0x37')](_0x44ec76['model'],qs[_0x20eb('0x38')](_0x1c2819['query'][_0x20eb('0x38')]));_0x4a520a[_0x20eb('0x36')]=_0x4a520a[_0x20eb('0x36')][_0x20eb('0x39')]?_0x4a520a[_0x20eb('0x36')]:_0x44ec76['model'];if(_0x1c2819['query'][_0x20eb('0x46')]){_0x4a520a[_0x20eb('0x42')]=[{'all':!![]}];}_0x4a520a=_['merge']({},_0x4a520a,_0x1c2819[_0x20eb('0x47')]);return db['Automation']['find'](_0x4a520a)[_0x20eb('0x26')](handleEntityNotFound(_0x13fd3a,null))[_0x20eb('0x26')](respondWithResult(_0x13fd3a,null))['catch'](handleError(_0x13fd3a,null));};exports[_0x20eb('0x48')]=function(_0x3da55b,_0x3acbf6){return db['Automation'][_0x20eb('0x48')](_0x3da55b[_0x20eb('0x49')],{})[_0x20eb('0x26')](respondWithResult(_0x3acbf6,0xc9))[_0x20eb('0x43')](handleError(_0x3acbf6,null));};exports[_0x20eb('0x25')]=function(_0x58ef4a,_0x12b41f){if(_0x58ef4a[_0x20eb('0x49')]['id']){delete _0x58ef4a[_0x20eb('0x49')]['id'];}return db[_0x20eb('0x2c')][_0x20eb('0x4a')]({'where':{'id':_0x58ef4a[_0x20eb('0x45')]['id']}})[_0x20eb('0x26')](handleEntityNotFound(_0x12b41f,null))['then'](saveUpdates(_0x58ef4a[_0x20eb('0x49')],null))[_0x20eb('0x26')](respondWithResult(_0x12b41f,null))[_0x20eb('0x43')](handleError(_0x12b41f,null));};exports[_0x20eb('0x27')]=function(_0x4ec7f6,_0x415df6){return db['Automation'][_0x20eb('0x4a')]({'where':{'id':_0x4ec7f6[_0x20eb('0x45')]['id']}})[_0x20eb('0x26')](handleEntityNotFound(_0x415df6,null))['then'](removeEntity(_0x415df6,null))[_0x20eb('0x43')](handleError(_0x415df6,null));};exports['addConditions']=function(_0xa229e9,_0x44f947,_0x2e2492){return db['Condition'][_0x20eb('0x4a')]({'where':{'id':_0xa229e9['params']['id']}})['then'](handleEntityNotFound(_0x44f947,null))['then'](function(_0xe3e781){if(_0xe3e781){return _0xe3e781[_0x20eb('0x4b')](_0xa229e9[_0x20eb('0x49')]['ids'],_['omit'](_0xa229e9['body'],['ids','id'])||{});}})[_0x20eb('0x26')](respondWithResult(_0x44f947,null))[_0x20eb('0x43')](handleError(_0x44f947,null));};exports[_0x20eb('0x4c')]=function(_0x45a5da,_0x50281e,_0x2daf22){var _0x1ab050={};var _0xdcf18={};var _0x3e2ab9;var _0x1d382f;return db['Automation']['findOne']({'where':{'id':_0x45a5da['params']['id']}})['then'](handleEntityNotFound(_0x50281e,null))[_0x20eb('0x26')](function(_0x54f7af){if(_0x54f7af){_0x3e2ab9=_0x54f7af;_0xdcf18[_0x20eb('0x35')]=_[_0x20eb('0x33')](db[_0x20eb('0x4d')]['rawAttributes']);_0xdcf18[_0x20eb('0x32')]=_[_0x20eb('0x33')](_0x45a5da[_0x20eb('0x32')]);_0xdcf18[_0x20eb('0x34')]=_['intersection'](_0xdcf18[_0x20eb('0x35')],_0xdcf18['query']);_0x1ab050[_0x20eb('0x36')]=_[_0x20eb('0x37')](_0xdcf18[_0x20eb('0x35')],qs[_0x20eb('0x38')](_0x45a5da[_0x20eb('0x32')][_0x20eb('0x38')]));_0x1ab050['attributes']=_0x1ab050[_0x20eb('0x36')]['length']?_0x1ab050['attributes']:_0xdcf18['model'];_0x1ab050[_0x20eb('0x3b')]=qs['sort'](_0x45a5da[_0x20eb('0x32')][_0x20eb('0x3c')]);_0x1ab050['where']=qs[_0x20eb('0x34')](_[_0x20eb('0x3e')](_0x45a5da['query'],_0xdcf18['filters']));if(_0x45a5da['query'][_0x20eb('0x3f')]){_0x1ab050[_0x20eb('0x3d')]=_[_0x20eb('0x40')](_0x1ab050[_0x20eb('0x3d')],{'$or':_['map'](_0x1ab050['attributes'],function(_0x1d9880){var _0x29879a={};_0x29879a[_0x1d9880]={'$like':'%'+_0x45a5da[_0x20eb('0x32')]['filter']+'%'};return _0x29879a;})});}_0x1ab050=_[_0x20eb('0x40')]({},_0x1ab050,_0x45a5da[_0x20eb('0x47')]);return _0x3e2ab9['getConditions'](_0x1ab050);}})['then'](function(_0x2d892e){if(_0x2d892e){_0x1d382f=_0x2d892e[_0x20eb('0x39')];if(!_0x45a5da['query'][_0x20eb('0x3a')](_0x20eb('0x4e'))){_0x1ab050[_0x20eb('0x20')]=qs[_0x20eb('0x20')](_0x45a5da[_0x20eb('0x32')]['limit']);_0x1ab050['offset']=qs[_0x20eb('0x1d')](_0x45a5da[_0x20eb('0x32')][_0x20eb('0x1d')]);}return _0x3e2ab9[_0x20eb('0x4c')](_0x1ab050);}})[_0x20eb('0x26')](function(_0x3b52b7){if(_0x3b52b7){return _0x3b52b7?{'count':_0x1d382f,'rows':_0x3b52b7}:null;}})[_0x20eb('0x26')](respondWithResult(_0x50281e,null))[_0x20eb('0x43')](handleError(_0x50281e,null));};exports[_0x20eb('0x4f')]=function(_0x5c7793,_0x249b75,_0x3b879f){return db['Action'][_0x20eb('0x4a')]({'where':{'id':_0x5c7793[_0x20eb('0x45')]['id']}})[_0x20eb('0x26')](handleEntityNotFound(_0x249b75,null))['then'](function(_0xb1ffe1){if(_0xb1ffe1){return _0xb1ffe1[_0x20eb('0x4f')](_0x5c7793[_0x20eb('0x49')][_0x20eb('0x50')],_[_0x20eb('0x51')](_0x5c7793['body'],[_0x20eb('0x50'),'id'])||{});}})[_0x20eb('0x26')](respondWithResult(_0x249b75,null))[_0x20eb('0x43')](handleError(_0x249b75,null));};exports[_0x20eb('0x52')]=function(_0x46cc50,_0x4c925e,_0x2d97f6){var _0x1be866={};var _0x1c901f={};var _0x27a2a1;var _0x39213a;return db[_0x20eb('0x2c')][_0x20eb('0x53')]({'where':{'id':_0x46cc50[_0x20eb('0x45')]['id']}})[_0x20eb('0x26')](handleEntityNotFound(_0x4c925e,null))['then'](function(_0x5680f7){if(_0x5680f7){_0x27a2a1=_0x5680f7;_0x1c901f[_0x20eb('0x35')]=_[_0x20eb('0x33')](db['Action'][_0x20eb('0x2d')]);_0x1c901f[_0x20eb('0x32')]=_[_0x20eb('0x33')](_0x46cc50[_0x20eb('0x32')]);_0x1c901f[_0x20eb('0x34')]=_['intersection'](_0x1c901f['model'],_0x1c901f[_0x20eb('0x32')]);_0x1be866[_0x20eb('0x36')]=_[_0x20eb('0x37')](_0x1c901f[_0x20eb('0x35')],qs[_0x20eb('0x38')](_0x46cc50[_0x20eb('0x32')][_0x20eb('0x38')]));_0x1be866['attributes']=_0x1be866['attributes'][_0x20eb('0x39')]?_0x1be866[_0x20eb('0x36')]:_0x1c901f[_0x20eb('0x35')];_0x1be866[_0x20eb('0x3b')]=qs[_0x20eb('0x3c')](_0x46cc50['query'][_0x20eb('0x3c')]);_0x1be866[_0x20eb('0x3d')]=qs[_0x20eb('0x34')](_[_0x20eb('0x3e')](_0x46cc50[_0x20eb('0x32')],_0x1c901f[_0x20eb('0x34')]));if(_0x46cc50[_0x20eb('0x32')][_0x20eb('0x3f')]){_0x1be866[_0x20eb('0x3d')]=_[_0x20eb('0x40')](_0x1be866[_0x20eb('0x3d')],{'$or':_['map'](_0x1be866[_0x20eb('0x36')],function(_0x42f6fb){var _0x661d72={};_0x661d72[_0x42f6fb]={'$like':'%'+_0x46cc50[_0x20eb('0x32')][_0x20eb('0x3f')]+'%'};return _0x661d72;})});}_0x1be866=_[_0x20eb('0x40')]({},_0x1be866,_0x46cc50[_0x20eb('0x47')]);return _0x27a2a1[_0x20eb('0x52')](_0x1be866);}})['then'](function(_0xd500ec){if(_0xd500ec){_0x39213a=_0xd500ec[_0x20eb('0x39')];if(!_0x46cc50[_0x20eb('0x32')][_0x20eb('0x3a')](_0x20eb('0x4e'))){_0x1be866[_0x20eb('0x20')]=qs['limit'](_0x46cc50[_0x20eb('0x32')][_0x20eb('0x20')]);_0x1be866[_0x20eb('0x1d')]=qs[_0x20eb('0x1d')](_0x46cc50[_0x20eb('0x32')][_0x20eb('0x1d')]);}return _0x27a2a1[_0x20eb('0x52')](_0x1be866);}})[_0x20eb('0x26')](function(_0x2ae184){if(_0x2ae184){return _0x2ae184?{'count':_0x39213a,'rows':_0x2ae184}:null;}})['then'](respondWithResult(_0x4c925e,null))[_0x20eb('0x43')](handleError(_0x4c925e,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 77e038a..95db704 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 _0x6fb5=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash'];(function(_0x5809ee,_0x562615){var _0x4c2578=function(_0x3cdc4a){while(--_0x3cdc4a){_0x5809ee['push'](_0x5809ee['shift']());}};_0x4c2578(++_0x562615);}(_0x6fb5,0x151));var _0x56fb=function(_0x3f04c7,_0x551468){_0x3f04c7=_0x3f04c7-0x0;var _0x48569a=_0x6fb5[_0x3f04c7];return _0x48569a;};'use strict';var _=require(_0x56fb('0x0'));var util=require('util');var logger=require(_0x56fb('0x1'))(_0x56fb('0x2'));var moment=require(_0x56fb('0x3'));var BPromise=require(_0x56fb('0x4'));var rp=require(_0x56fb('0x5'));var fs=require('fs');var path=require(_0x56fb('0x6'));var rimraf=require('rimraf');var config=require(_0x56fb('0x7'));var attributes=require(_0x56fb('0x8'));module[_0x56fb('0x9')]=function(_0x887fd3,_0x1a8a6c){return _0x887fd3[_0x56fb('0xa')](_0x56fb('0xb'),attributes,{'tableName':_0x56fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3cae=['../../config/environment','define','../../config/logger','api','moment','path','rimraf'];(function(_0xf1af27,_0x598bb1){var _0x46b274=function(_0x1dba43){while(--_0x1dba43){_0xf1af27['push'](_0xf1af27['shift']());}};_0x46b274(++_0x598bb1);}(_0x3cae,0x160));var _0xe3ca=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x3cae[_0x1b828b];return _0x98da1a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe3ca('0x0'))(_0xe3ca('0x1'));var moment=require(_0xe3ca('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3ca('0x3'));var rimraf=require(_0xe3ca('0x4'));var config=require(_0xe3ca('0x5'));var attributes=require('./automation.attributes');module['exports']=function(_0x4de347,_0x54de10){return _0x4de347[_0xe3ca('0x6')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index ddced8d..74a02b9 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 _0x793b=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','lodash','util','moment'];(function(_0x967959,_0x53c5c1){var _0x5c4489=function(_0x1ae5c6){while(--_0x1ae5c6){_0x967959['push'](_0x967959['shift']());}};_0x5c4489(++_0x53c5c1);}(_0x793b,0x189));var _0xb793=function(_0x3febe5,_0x394164){_0x3febe5=_0x3febe5-0x0;var _0x19f600=_0x793b[_0x3febe5];return _0x19f600;};'use strict';var _=require(_0xb793('0x0'));var util=require(_0xb793('0x1'));var moment=require(_0xb793('0x2'));var BPromise=require(_0xb793('0x3'));var rs=require(_0xb793('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb793('0x5'))['db'];var utils=require(_0xb793('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb793('0x7'));var jayson=require(_0xb793('0x8'));var client=jayson[_0xb793('0x9')][_0xb793('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39f110,_0x42d0c7,_0x134ac4){return new BPromise(function(_0x23a718,_0x149720){return client[_0xb793('0xb')](_0x39f110,_0x134ac4)[_0xb793('0xc')](function(_0x22c9ea){logger[_0xb793('0xd')](_0xb793('0xe'),_0x42d0c7,'request\x20sent');logger[_0xb793('0xf')](_0xb793('0x10'),_0x42d0c7,'request\x20sent',JSON['stringify'](_0x22c9ea));if(_0x22c9ea[_0xb793('0x11')]){if(_0x22c9ea[_0xb793('0x11')]['code']===0x1f4){logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x22c9ea['error'][_0xb793('0x12')]);return _0x149720(_0x22c9ea[_0xb793('0x11')][_0xb793('0x12')]);}logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x22c9ea[_0xb793('0x11')][_0xb793('0x12')]);return _0x23a718(_0x22c9ea['error'][_0xb793('0x12')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x42d0c7,_0xb793('0x13'));_0x23a718(_0x22c9ea[_0xb793('0x14')][_0xb793('0x12')]);}})[_0xb793('0x15')](function(_0x38d9f2){logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x38d9f2);_0x149720(_0x38d9f2);});});}
\ No newline at end of file
+var _0xf846=['http','request','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x37d57e,_0x20ee57){var _0x2a820a=function(_0x3dc5ab){while(--_0x3dc5ab){_0x37d57e['push'](_0x37d57e['shift']());}};_0x2a820a(++_0x20ee57);}(_0xf846,0x85));var _0x6f84=function(_0x436fc4,_0x27e86b){_0x436fc4=_0x436fc4-0x0;var _0x4186a1=_0xf846[_0x436fc4];return _0x4186a1;};'use strict';var _=require(_0x6f84('0x0'));var util=require(_0x6f84('0x1'));var moment=require(_0x6f84('0x2'));var BPromise=require(_0x6f84('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f84('0x4'));var db=require(_0x6f84('0x5'))['db'];var utils=require(_0x6f84('0x6'));var logger=require(_0x6f84('0x7'))('rpc');var config=require(_0x6f84('0x8'));var jayson=require(_0x6f84('0x9'));var client=jayson[_0x6f84('0xa')][_0x6f84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x162a59,_0x45dd2b,_0x4dcf04){return new BPromise(function(_0x196c7a,_0x2da435){return client[_0x6f84('0xc')](_0x162a59,_0x4dcf04)['then'](function(_0x156032){logger[_0x6f84('0xd')]('Automation,\x20%s,\x20%s',_0x45dd2b,_0x6f84('0xe'));logger[_0x6f84('0xf')](_0x6f84('0x10'),_0x45dd2b,_0x6f84('0xe'),JSON[_0x6f84('0x11')](_0x156032));if(_0x156032[_0x6f84('0x12')]){if(_0x156032[_0x6f84('0x12')][_0x6f84('0x13')]===0x1f4){logger[_0x6f84('0x12')](_0x6f84('0x14'),_0x45dd2b,_0x156032[_0x6f84('0x12')]['message']);return _0x2da435(_0x156032[_0x6f84('0x12')]['message']);}logger[_0x6f84('0x12')](_0x6f84('0x14'),_0x45dd2b,_0x156032['error'][_0x6f84('0x15')]);return _0x196c7a(_0x156032['error'][_0x6f84('0x15')]);}else{logger['info'](_0x6f84('0x14'),_0x45dd2b,'request\x20sent');_0x196c7a(_0x156032[_0x6f84('0x16')]['message']);}})[_0x6f84('0x17')](function(_0x27bc7d){logger[_0x6f84('0x12')](_0x6f84('0x14'),_0x45dd2b,_0x27bc7d);_0x2da435(_0x27bc7d);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index c25e5ae..4967a8c 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 _0xfd28=['isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','/:id','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get'];(function(_0x76075d,_0x5d1b3e){var _0x531f01=function(_0x250585){while(--_0x250585){_0x76075d['push'](_0x76075d['shift']());}};_0x531f01(++_0x5d1b3e);}(_0xfd28,0x148));var _0x8fd2=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xfd28[_0x53abe5];return _0xc1c37e;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var fs_extra=require(_0x8fd2('0x3'));var auth=require(_0x8fd2('0x4'));var interaction=require(_0x8fd2('0x5'));var config=require('../../config/environment');var controller=require(_0x8fd2('0x6'));router[_0x8fd2('0x7')]('/',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x9')]);router[_0x8fd2('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x8fd2('0xa')]);router[_0x8fd2('0x7')](_0x8fd2('0xb'),auth['isAuthenticated'](),controller[_0x8fd2('0xc')]);router['get'](_0x8fd2('0xd'),auth['isAuthenticated'](),controller[_0x8fd2('0xe')]);router['post']('/',auth[_0x8fd2('0x8')](),controller['create']);router[_0x8fd2('0xf')]('/:id/conditions',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x10')]);router[_0x8fd2('0xf')](_0x8fd2('0xd'),auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x11')]);router[_0x8fd2('0x12')](_0x8fd2('0x13'),auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x14')]);router[_0x8fd2('0x15')](_0x8fd2('0x13'),auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x16')]);module[_0x8fd2('0x17')]=router;
\ No newline at end of file
+var _0xbeff=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./automation.controller','get','index','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','/:id','destroy','exports','util','path'];(function(_0x3401ee,_0x19476c){var _0x383615=function(_0x43ff06){while(--_0x43ff06){_0x3401ee['push'](_0x3401ee['shift']());}};_0x383615(++_0x19476c);}(_0xbeff,0x8e));var _0xfbef=function(_0x15d376,_0x474400){_0x15d376=_0x15d376-0x0;var _0x125fa1=_0xbeff[_0x15d376];return _0x125fa1;};'use strict';var multer=require('multer');var util=require(_0xfbef('0x0'));var path=require(_0xfbef('0x1'));var timeout=require(_0xfbef('0x2'));var express=require(_0xfbef('0x3'));var router=express[_0xfbef('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfbef('0x5'));var config=require(_0xfbef('0x6'));var controller=require(_0xfbef('0x7'));router[_0xfbef('0x8')]('/',auth['isAuthenticated'](),controller[_0xfbef('0x9')]);router[_0xfbef('0x8')]('/:id',auth[_0xfbef('0xa')](),controller[_0xfbef('0xb')]);router['get'](_0xfbef('0xc'),auth['isAuthenticated'](),controller[_0xfbef('0xd')]);router['get'](_0xfbef('0xe'),auth[_0xfbef('0xa')](),controller[_0xfbef('0xf')]);router[_0xfbef('0x10')]('/',auth[_0xfbef('0xa')](),controller[_0xfbef('0x11')]);router[_0xfbef('0x10')](_0xfbef('0xc'),auth['isAuthenticated'](),controller[_0xfbef('0x12')]);router[_0xfbef('0x10')](_0xfbef('0xe'),auth[_0xfbef('0xa')](),controller[_0xfbef('0x13')]);router[_0xfbef('0x14')](_0xfbef('0x15'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xfbef('0xa')](),controller[_0xfbef('0x16')]);module[_0xfbef('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 be9cac4..9e2edeb 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 _0xd615=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0xee6027,_0x2f2baf){var _0x95d4d6=function(_0x2b3165){while(--_0x2b3165){_0xee6027['push'](_0xee6027['shift']());}};_0x95d4d6(++_0x2f2baf);}(_0xd615,0x132));var _0x5d61=function(_0x4a11b3,_0x3b563a){_0x4a11b3=_0x4a11b3-0x0;var _0x49c4a1=_0xd615[_0x4a11b3];return _0x49c4a1;};'use strict';var Sequelize=require(_0x5d61('0x0'));module[_0x5d61('0x1')]={'name':{'type':Sequelize[_0x5d61('0x2')],'unique':_0x5d61('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5d61('0x4')](_0x5d61('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5d61('0x6')},'limitCalls':{'type':Sequelize[_0x5d61('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5d61('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5d61('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5d61('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x5d61('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d61('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5d61('0x7')](0x3)[_0x5d61('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d61('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5d61('0x7')](0x5)[_0x5d61('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d61('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x5d61('0x7')](0x3)[_0x5d61('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d61('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5d61('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d61('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5d61('0x7')](0x3)[_0x5d61('0x9')],'defaultValue':0x3,'comment':_0x5d61('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5d61('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x5d61('0x7')](0x3)[_0x5d61('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x5d61('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5d61('0x2')],'defaultValue':_0x5d61('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x5d61('0x4')](_0x5d61('0x11'),_0x5d61('0x12'),'onlyIfOpen'),'defaultValue':_0x5d61('0x11')},'dialAMDActive':{'type':Sequelize[_0x5d61('0x13')],'defaultValue':0x0,'comment':_0x5d61('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5d61('0x15')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x5d61('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5d61('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5d61('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5d61('0x7')](0x9)[_0x5d61('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x5d61('0x7')](0x9)[_0x5d61('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5d61('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5d61('0x7')](0x9)[_0x5d61('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5d61('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5d61('0x7')](0x9)[_0x5d61('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5d61('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x5d61('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5d61('0x7')](0x9)[_0x5d61('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5d61('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5d61('0x4')](_0x5d61('0x1c'),_0x5d61('0x1d')),'defaultValue':_0x5d61('0x1c')},'dialPrefix':{'type':Sequelize[_0x5d61('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5d61('0x7')](0x3)[_0x5d61('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5d61('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5d61('0x7')](0x3)[_0x5d61('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d61('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5d61('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d61('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x5d61('0x7')](0x3)[_0x5d61('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x5d61('0x7')](0x5)[_0x5d61('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d61('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5d61('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5d61('0x7')](0x5)[_0x5d61('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x5d61('0x7')](0x3)[_0x5d61('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d61('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5d61('0x7')](0x5)[_0x5d61('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d61('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5d61('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d61('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5d61('0x7')](0x5)[_0x5d61('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d61('0x25')}};
\ No newline at end of file
+var _0xf34b=['DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','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','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\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)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length'];(function(_0x3abd20,_0x205c3d){var _0xe2f3af=function(_0x373102){while(--_0x373102){_0x3abd20['push'](_0x3abd20['shift']());}};_0xe2f3af(++_0x205c3d);}(_0xf34b,0x10e));var _0xbf34=function(_0x36831e,_0x14f9de){_0x36831e=_0x36831e-0x0;var _0x508c65=_0xf34b[_0x36831e];return _0x508c65;};'use strict';var Sequelize=require(_0xbf34('0x0'));module[_0xbf34('0x1')]={'name':{'type':Sequelize[_0xbf34('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xbf34('0x3')](_0xbf34('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xbf34('0x5')},'limitCalls':{'type':Sequelize[_0xbf34('0x6')](0x4)[_0xbf34('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xbf34('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xbf34('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xbf34('0x6')](0x3)[_0xbf34('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xbf34('0x6')](0x3)[_0xbf34('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf34('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xbf34('0x6')](0x5)[_0xbf34('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xbf34('0x6')](0x3)[_0xbf34('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xbf34('0x6')](0x5)[_0xbf34('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf34('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xbf34('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xbf34('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf34('0xc')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbf34('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xbf34('0x2')],'defaultValue':_0xbf34('0xd')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xbf34('0xe'),_0xbf34('0xf'),_0xbf34('0x10')),'defaultValue':_0xbf34('0xe')},'dialAMDActive':{'type':Sequelize[_0xbf34('0x11')],'defaultValue':0x0,'comment':_0xbf34('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xbf34('0x6')](0x9)[_0xbf34('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xbf34('0x6')](0x9)[_0xbf34('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xbf34('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xbf34('0x6')](0x9)[_0xbf34('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xbf34('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xbf34('0x6')](0x9)[_0xbf34('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbf34('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xbf34('0x6')](0x9)[_0xbf34('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xbf34('0x6')](0x9)[_0xbf34('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xbf34('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xbf34('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xbf34('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xbf34('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xbf34('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xbf34('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbf34('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xbf34('0x3')](_0xbf34('0x1a'),_0xbf34('0x1b')),'defaultValue':_0xbf34('0x1a')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbf34('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbf34('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbf34('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xbf34('0x6')](0x5)[_0xbf34('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xbf34('0x6')](0x3)[_0xbf34('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf34('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbf34('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf34('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbf34('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbf34('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf34('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf34('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0xbf34('0x6')](0x5)[_0xbf34('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf34('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xbf34('0x6')](0x3)[_0xbf34('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf34('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbf34('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf34('0x24')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index eea5906..9851568 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 _0x501d=['Campaign','includeAll','findAll','rows','catch','show','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','clone','params','omit','updatedAt','createdAt','userProfileId','update','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','ListId','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','IvrCampaigns','UserProfileResource','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','nolimit','order','sort','filters','pick','filter','where','merge','options'];(function(_0x285800,_0x26765e){var _0x4b809e=function(_0x12c58b){while(--_0x12c58b){_0x285800['push'](_0x285800['shift']());}};_0x4b809e(++_0x26765e);}(_0x501d,0x15c));var _0xd501=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x501d[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd501('0x0'));var zipdir=require(_0xd501('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd501('0x2'));var moment=require(_0xd501('0x3'));var BPromise=require(_0xd501('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd501('0x5'));var sox=require(_0xd501('0x6'));var csv=require(_0xd501('0x7'));var ejs=require(_0xd501('0x8'));var fs=require('fs');var fs_extra=require(_0xd501('0x9'));var _=require(_0xd501('0xa'));var squel=require(_0xd501('0xb'));var crypto=require(_0xd501('0xc'));var jsforce=require(_0xd501('0xd'));var deskjs=require(_0xd501('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd501('0xf'));var Papa=require(_0xd501('0x10'));var Redis=require(_0xd501('0x11'));var authService=require(_0xd501('0x12'));var qs=require(_0xd501('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd501('0x14'));var logger=require(_0xd501('0x15'))(_0xd501('0x16'));var utils=require('../../config/utils');var config=require(_0xd501('0x17'));var licenseUtil=require(_0xd501('0x18'));var db=require(_0xd501('0x19'))['db'];function respondWithStatusCode(_0x4d8c08,_0x316274){_0x316274=_0x316274||0xcc;return function(_0x3317d2){if(_0x3317d2){return _0x4d8c08[_0xd501('0x1a')](_0x316274);}return _0x4d8c08[_0xd501('0x1b')](_0x316274)[_0xd501('0x1c')]();};}function respondWithResult(_0x51ee5d,_0x5b1b2d){_0x5b1b2d=_0x5b1b2d||0xc8;return function(_0x3a6a7a){if(_0x3a6a7a){return _0x51ee5d[_0xd501('0x1b')](_0x5b1b2d)[_0xd501('0x1d')](_0x3a6a7a);}};}function respondWithFilteredResult(_0x204260,_0x40dbd1){return function(_0x81b380){if(_0x81b380){var _0x5bb88b=typeof _0x40dbd1[_0xd501('0x1e')]===_0xd501('0x1f')&&typeof _0x40dbd1[_0xd501('0x20')]===_0xd501('0x1f');var _0xea725d=_0x81b380[_0xd501('0x21')];var _0x6950a0=_0x5bb88b?0x0:_0x40dbd1[_0xd501('0x1e')];var _0x3e542f=_0x5bb88b?_0x81b380[_0xd501('0x21')]:_0x40dbd1[_0xd501('0x1e')]+_0x40dbd1['limit'];var _0x217415;if(_0x3e542f>=_0xea725d){_0x3e542f=_0xea725d;_0x217415=0xc8;}else{_0x217415=0xce;}_0x204260['status'](_0x217415);return _0x204260[_0xd501('0x22')](_0xd501('0x23'),_0x6950a0+'-'+_0x3e542f+'/'+_0xea725d)[_0xd501('0x1d')](_0x81b380);}return null;};}function patchUpdates(_0x56e883){return function(_0x21d5f2){try{jsonpatch[_0xd501('0x24')](_0x21d5f2,_0x56e883,!![]);}catch(_0x30b216){return BPromise[_0xd501('0x25')](_0x30b216);}return _0x21d5f2[_0xd501('0x26')]();};}function saveUpdates(_0xe41c4f,_0x2d64ae){return function(_0x2391be){if(_0x2391be){return _0x2391be['update'](_0xe41c4f)['then'](function(_0x5f0900){return _0x5f0900;});}return null;};}function removeEntity(_0x34d4dc,_0x51ab8d){return function(_0x53c2ac){if(_0x53c2ac){return _0x53c2ac[_0xd501('0x27')]()['then'](function(){var _0x466b4f=_0x53c2ac[_0xd501('0x28')]({'plain':!![]});var _0x347c87=_0xd501('0x29');return db[_0xd501('0x2a')][_0xd501('0x27')]({'where':{'type':_0x347c87,'resourceId':_0x466b4f['id']}})[_0xd501('0x2b')](function(){return _0x53c2ac;});})['then'](function(){_0x34d4dc[_0xd501('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x542676,_0x582224){return function(_0x38767f){if(!_0x38767f){_0x542676[_0xd501('0x1a')](0x194);}return _0x38767f;};}function handleError(_0x5eaee3,_0xc304b9){_0xc304b9=_0xc304b9||0x1f4;return function(_0x48d169){logger[_0xd501('0x2c')](_0x48d169[_0xd501('0x2d')]);if(_0x48d169['name']){delete _0x48d169[_0xd501('0x2e')];}_0x5eaee3['status'](_0xc304b9)[_0xd501('0x2f')](_0x48d169);};}exports[_0xd501('0x30')]=function(_0x2907d1,_0x2d7723){var _0x14f535={},_0x3393f5={},_0x5ea9b6={'count':0x0,'rows':[]};var _0xd5009=_[_0xd501('0x31')](db['Campaign'][_0xd501('0x32')],function(_0x362d27){return{'name':_0x362d27[_0xd501('0x33')],'type':_0x362d27[_0xd501('0x34')][_0xd501('0x35')]};});_0x3393f5[_0xd501('0x36')]=_[_0xd501('0x31')](_0xd5009,_0xd501('0x2e'));_0x3393f5[_0xd501('0x37')]=_[_0xd501('0x38')](_0x2907d1[_0xd501('0x37')]);_0x3393f5['filters']=_['intersection'](_0x3393f5[_0xd501('0x36')],_0x3393f5['query']);_0x14f535[_0xd501('0x39')]=_[_0xd501('0x3a')](_0x3393f5[_0xd501('0x36')],qs[_0xd501('0x3b')](_0x2907d1[_0xd501('0x37')][_0xd501('0x3b')]));_0x14f535[_0xd501('0x39')]=_0x14f535[_0xd501('0x39')]['length']?_0x14f535['attributes']:_0x3393f5['model'];if(!_0x2907d1[_0xd501('0x37')]['hasOwnProperty'](_0xd501('0x3c'))){_0x14f535['limit']=qs['limit'](_0x2907d1[_0xd501('0x37')][_0xd501('0x20')]);_0x14f535['offset']=qs['offset'](_0x2907d1[_0xd501('0x37')][_0xd501('0x1e')]);}_0x14f535[_0xd501('0x3d')]=qs['sort'](_0x2907d1['query'][_0xd501('0x3e')]);_0x14f535['where']=qs[_0xd501('0x3f')](_[_0xd501('0x40')](_0x2907d1[_0xd501('0x37')],_0x3393f5['filters']),_0xd5009);if(_0x2907d1['query'][_0xd501('0x41')]){_0x14f535[_0xd501('0x42')]=_['merge'](_0x14f535[_0xd501('0x42')],{'$or':_['map'](_0xd5009,function(_0x395dd4){if(_0x395dd4[_0xd501('0x34')]!=='VIRTUAL'){var _0x54de9d={};_0x54de9d[_0x395dd4[_0xd501('0x2e')]]={'$like':'%'+_0x2907d1[_0xd501('0x37')][_0xd501('0x41')]+'%'};return _0x54de9d;}})});}_0x14f535=_[_0xd501('0x43')]({},_0x14f535,_0x2907d1[_0xd501('0x44')]);var _0x23d698={'where':_0x14f535[_0xd501('0x42')]};return db[_0xd501('0x45')][_0xd501('0x21')](_0x23d698)[_0xd501('0x2b')](function(_0x551727){_0x5ea9b6['count']=_0x551727;if(_0x2907d1['query'][_0xd501('0x46')]){_0x14f535['include']=[{'all':!![]}];}return db['Campaign'][_0xd501('0x47')](_0x14f535);})[_0xd501('0x2b')](function(_0x1f26b2){_0x5ea9b6[_0xd501('0x48')]=_0x1f26b2;return _0x5ea9b6;})['then'](respondWithFilteredResult(_0x2d7723,_0x14f535))[_0xd501('0x49')](handleError(_0x2d7723,null));};exports[_0xd501('0x4a')]=function(_0x901bfc,_0xec443e){var _0x2a1e3a={'raw':![],'where':{'id':_0x901bfc['params']['id']}},_0x2b93b6={};_0x2b93b6['model']=_[_0xd501('0x38')](db['Campaign'][_0xd501('0x32')]);_0x2b93b6[_0xd501('0x37')]=_[_0xd501('0x38')](_0x901bfc[_0xd501('0x37')]);_0x2b93b6['filters']=_['intersection'](_0x2b93b6[_0xd501('0x36')],_0x2b93b6[_0xd501('0x37')]);_0x2a1e3a[_0xd501('0x39')]=_[_0xd501('0x3a')](_0x2b93b6[_0xd501('0x36')],qs[_0xd501('0x3b')](_0x901bfc[_0xd501('0x37')][_0xd501('0x3b')]));_0x2a1e3a[_0xd501('0x39')]=_0x2a1e3a['attributes'][_0xd501('0x4b')]?_0x2a1e3a['attributes']:_0x2b93b6['model'];if(_0x901bfc[_0xd501('0x37')][_0xd501('0x46')]){_0x2a1e3a[_0xd501('0x4c')]=[{'all':!![]}];}_0x2a1e3a=_['merge']({},_0x2a1e3a,_0x901bfc[_0xd501('0x44')]);return db[_0xd501('0x45')][_0xd501('0x4d')](_0x2a1e3a)[_0xd501('0x2b')](handleEntityNotFound(_0xec443e,null))['then'](respondWithResult(_0xec443e,null))['catch'](handleError(_0xec443e,null));};exports['create']=function(_0x409e84,_0x5d07cf){return db[_0xd501('0x45')][_0xd501('0x4e')](_0x409e84[_0xd501('0x4f')],{})['then'](function(_0x4fd03f){var _0x26bd32=_0x409e84[_0xd501('0x50')][_0xd501('0x28')]({'plain':!![]});if(!_0x26bd32)throw new Error(_0xd501('0x51'));if(_0x26bd32[_0xd501('0x52')]==='user'){var _0x4be9c8=_0x4fd03f[_0xd501('0x28')]({'plain':!![]});var _0x310727='IvrCampaigns';return db[_0xd501('0x53')][_0xd501('0x4d')]({'where':{'name':_0x310727,'userProfileId':_0x26bd32['userProfileId']},'raw':!![]})[_0xd501('0x2b')](function(_0x4d67fa){if(_0x4d67fa&&_0x4d67fa[_0xd501('0x54')]===0x0){return db['UserProfileResource'][_0xd501('0x4e')]({'name':_0x4be9c8[_0xd501('0x2e')],'resourceId':_0x4be9c8['id'],'type':_0x4d67fa[_0xd501('0x2e')],'sectionId':_0x4d67fa['id']},{})[_0xd501('0x2b')](function(){return _0x4fd03f;});}else{return _0x4fd03f;}})[_0xd501('0x49')](function(_0x1659f3){logger[_0xd501('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1659f3);throw _0x1659f3;});}return _0x4fd03f;})[_0xd501('0x2b')](respondWithResult(_0x5d07cf,0xc9))[_0xd501('0x49')](handleError(_0x5d07cf,null));};exports[_0xd501('0x55')]=function(_0x30c39b,_0x2c9579){var _0x495034={'where':{'id':_0x30c39b[_0xd501('0x56')]['id']}},_0x5573d8={};_0x5573d8[_0xd501('0x36')]=_[_0xd501('0x38')](db['Campaign'][_0xd501('0x32')]);_0x495034[_0xd501('0x39')]=_[_0xd501('0x3a')](_0x5573d8[_0xd501('0x36')],qs[_0xd501('0x3b')](_0x30c39b[_0xd501('0x37')][_0xd501('0x3b')]));_0x495034[_0xd501('0x39')]=_0x495034[_0xd501('0x39')][_0xd501('0x4b')]?_0x495034['attributes']:_0x5573d8[_0xd501('0x36')];if(_0x30c39b[_0xd501('0x37')][_0xd501('0x46')]){_0x495034[_0xd501('0x4c')]=[{'all':!![]}];}_0x495034=_['merge']({},_0x495034,_0x30c39b['options']);return db[_0xd501('0x45')][_0xd501('0x4d')](_0x495034)[_0xd501('0x2b')](handleEntityNotFound(_0x2c9579,null))[_0xd501('0x2b')](function(_0x3abbd2){if(_0x3abbd2){var _0x21a742=_0x3abbd2[_0xd501('0x28')]({'plain':!![]});_0x21a742=qs[_0xd501('0x57')](_0x21a742,['id','createdAt',_0xd501('0x58')]);_0x30c39b['body']=_[_0xd501('0x57')](_0x30c39b[_0xd501('0x4f')],['id',_0xd501('0x59'),'updatedAt']);return db[_0xd501('0x45')][_0xd501('0x4e')](_[_0xd501('0x43')](_0x21a742,_0x30c39b[_0xd501('0x4f')]),{'include':_0x30c39b[_0xd501('0x37')][_0xd501('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x252a8d){var _0x4ff99e=_0x30c39b['user'][_0xd501('0x28')]({'plain':!![]});if(!_0x4ff99e)throw new Error(_0xd501('0x51'));if(_0x4ff99e[_0xd501('0x52')]===_0xd501('0x50')){var _0x364543=_0x252a8d[_0xd501('0x28')]({'plain':!![]});var _0xfb3614=_0xd501('0x29');return db['UserProfileSection'][_0xd501('0x4d')]({'where':{'name':_0xfb3614,'userProfileId':_0x4ff99e[_0xd501('0x5a')]},'raw':!![]})[_0xd501('0x2b')](function(_0x231f3f){if(_0x231f3f&&_0x231f3f[_0xd501('0x54')]===0x0){return db[_0xd501('0x2a')][_0xd501('0x4e')]({'name':_0x364543[_0xd501('0x2e')],'resourceId':_0x364543['id'],'type':_0x231f3f[_0xd501('0x2e')],'sectionId':_0x231f3f['id']},{})['then'](function(){return _0x252a8d;});}else{return _0x252a8d;}})[_0xd501('0x49')](function(_0x44fb55){logger[_0xd501('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fb55);throw _0x44fb55;});}return _0x252a8d;});}})[_0xd501('0x2b')](respondWithResult(_0x2c9579,0xc9))[_0xd501('0x49')](handleError(_0x2c9579,null));};exports[_0xd501('0x5b')]=function(_0xb63ac3,_0x313d2b){if(_0xb63ac3[_0xd501('0x4f')]['id']){delete _0xb63ac3[_0xd501('0x4f')]['id'];}return db[_0xd501('0x45')][_0xd501('0x4d')]({'where':{'id':_0xb63ac3[_0xd501('0x56')]['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x313d2b,null))[_0xd501('0x2b')](saveUpdates(_0xb63ac3[_0xd501('0x4f')],null))[_0xd501('0x2b')](respondWithResult(_0x313d2b,null))['catch'](handleError(_0x313d2b,null));};exports[_0xd501('0x27')]=function(_0x5aafc8,_0x387f33){return db[_0xd501('0x45')]['find']({'where':{'id':_0x5aafc8[_0xd501('0x56')]['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x387f33,null))[_0xd501('0x2b')](removeEntity(_0x387f33,null))[_0xd501('0x49')](handleError(_0x387f33,null));};exports[_0xd501('0x5c')]=function(_0x5c3e92,_0x224a02,_0x53e572){var _0x3d7146={'raw':!![],'where':{}};var _0x2a62d3={};var _0x518048={'count':0x0,'rows':[]};return db[_0xd501('0x45')][_0xd501('0x5d')]({'where':{'id':_0x5c3e92[_0xd501('0x56')]['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x224a02,null))[_0xd501('0x2b')](function(_0x103895){if(_0x103895){_0x2a62d3[_0xd501('0x36')]=_['keys'](db[_0xd501('0x5e')]['rawAttributes']);_0x2a62d3['query']=_[_0xd501('0x38')](_0x5c3e92['query']);_0x2a62d3[_0xd501('0x3f')]=_[_0xd501('0x3a')](_0x2a62d3[_0xd501('0x36')],_0x2a62d3['query']);_0x3d7146['attributes']=_['intersection'](_0x2a62d3[_0xd501('0x36')],qs[_0xd501('0x3b')](_0x5c3e92[_0xd501('0x37')]['fields']));_0x3d7146[_0xd501('0x39')]=_0x3d7146[_0xd501('0x39')]['length']?_0x3d7146['attributes']:_0x2a62d3[_0xd501('0x36')];if(!_0x5c3e92[_0xd501('0x37')][_0xd501('0x5f')](_0xd501('0x3c'))){_0x3d7146[_0xd501('0x20')]=qs[_0xd501('0x20')](_0x5c3e92[_0xd501('0x37')][_0xd501('0x20')]);_0x3d7146[_0xd501('0x1e')]=qs[_0xd501('0x1e')](_0x5c3e92[_0xd501('0x37')]['offset']);}_0x3d7146[_0xd501('0x3d')]=qs['sort'](_0x5c3e92['query'][_0xd501('0x3e')]);_0x3d7146['where']=qs[_0xd501('0x3f')](_['pick'](_0x5c3e92[_0xd501('0x37')],_0x2a62d3[_0xd501('0x3f')]));_0x3d7146[_0xd501('0x42')][_0xd501('0x60')]=_0x103895['id'];if(_0x5c3e92[_0xd501('0x37')][_0xd501('0x41')]){_0x3d7146[_0xd501('0x42')]=_[_0xd501('0x43')](_0x3d7146['where'],{'$or':_[_0xd501('0x31')](_0x3d7146[_0xd501('0x39')],function(_0x2a92cd){var _0x42bed8={};_0x42bed8[_0x2a92cd]={'$like':'%'+_0x5c3e92[_0xd501('0x37')][_0xd501('0x41')]+'%'};return _0x42bed8;})});}_0x3d7146=_[_0xd501('0x43')]({},_0x3d7146,_0x5c3e92[_0xd501('0x44')]);return db[_0xd501('0x5e')][_0xd501('0x21')]({'where':_0x3d7146[_0xd501('0x42')]})[_0xd501('0x2b')](function(_0x523d97){_0x518048[_0xd501('0x21')]=_0x523d97;if(_0x5c3e92['query']['includeAll']){_0x3d7146[_0xd501('0x4c')]=[{'all':!![]}];}return db[_0xd501('0x5e')][_0xd501('0x47')](_0x3d7146);})['then'](function(_0x43c05f){_0x518048[_0xd501('0x48')]=_0x43c05f;return _0x518048;});}})[_0xd501('0x2b')](respondWithFilteredResult(_0x224a02,_0x3d7146))[_0xd501('0x49')](handleError(_0x224a02,null));};exports[_0xd501('0x61')]=function(_0xc5c8e4,_0x5a2bbd,_0x5ec760){var _0x4de2a2={'raw':!![],'where':{}};var _0x27ecaa={};var _0x19cb24={'count':0x0,'rows':[]};return db[_0xd501('0x45')][_0xd501('0x5d')]({'where':{'id':_0xc5c8e4['params']['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x5a2bbd,null))[_0xd501('0x2b')](function(_0xf0ab1c){if(_0xf0ab1c){_0x27ecaa[_0xd501('0x36')]=_[_0xd501('0x38')](db[_0xd501('0x62')][_0xd501('0x32')]);_0x27ecaa['query']=_[_0xd501('0x38')](_0xc5c8e4[_0xd501('0x37')]);_0x27ecaa[_0xd501('0x3f')]=_[_0xd501('0x3a')](_0x27ecaa[_0xd501('0x36')],_0x27ecaa['query']);_0x4de2a2[_0xd501('0x39')]=_[_0xd501('0x3a')](_0x27ecaa['model'],qs[_0xd501('0x3b')](_0xc5c8e4[_0xd501('0x37')][_0xd501('0x3b')]));_0x4de2a2[_0xd501('0x39')]=_0x4de2a2[_0xd501('0x39')][_0xd501('0x4b')]?_0x4de2a2[_0xd501('0x39')]:_0x27ecaa[_0xd501('0x36')];if(!_0xc5c8e4[_0xd501('0x37')][_0xd501('0x5f')](_0xd501('0x3c'))){_0x4de2a2[_0xd501('0x20')]=qs[_0xd501('0x20')](_0xc5c8e4[_0xd501('0x37')][_0xd501('0x20')]);_0x4de2a2['offset']=qs[_0xd501('0x1e')](_0xc5c8e4[_0xd501('0x37')][_0xd501('0x1e')]);}_0x4de2a2[_0xd501('0x3d')]=qs[_0xd501('0x3e')](_0xc5c8e4['query'][_0xd501('0x3e')]);_0x4de2a2[_0xd501('0x42')]=qs[_0xd501('0x3f')](_[_0xd501('0x40')](_0xc5c8e4['query'],_0x27ecaa[_0xd501('0x3f')]));_0x4de2a2[_0xd501('0x42')][_0xd501('0x60')]=_0xf0ab1c['id'];if(_0xc5c8e4[_0xd501('0x37')]['filter']){_0x4de2a2[_0xd501('0x42')]=_['merge'](_0x4de2a2[_0xd501('0x42')],{'$or':_[_0xd501('0x31')](_0x4de2a2[_0xd501('0x39')],function(_0x1b85e9){var _0xd93f96={};_0xd93f96[_0x1b85e9]={'$like':'%'+_0xc5c8e4['query'][_0xd501('0x41')]+'%'};return _0xd93f96;})});}_0x4de2a2=_[_0xd501('0x43')]({},_0x4de2a2,_0xc5c8e4['options']);return db[_0xd501('0x62')][_0xd501('0x21')]({'where':_0x4de2a2[_0xd501('0x42')]})[_0xd501('0x2b')](function(_0xaffa3e){_0x19cb24[_0xd501('0x21')]=_0xaffa3e;if(_0xc5c8e4[_0xd501('0x37')][_0xd501('0x46')]){_0x4de2a2[_0xd501('0x4c')]=[{'all':!![]}];}return db[_0xd501('0x62')]['findAll'](_0x4de2a2);})[_0xd501('0x2b')](function(_0xbf4389){_0x19cb24[_0xd501('0x48')]=_0xbf4389;return _0x19cb24;});}})['then'](respondWithFilteredResult(_0x5a2bbd,_0x4de2a2))[_0xd501('0x49')](handleError(_0x5a2bbd,null));};exports[_0xd501('0x63')]=function(_0x4f51e5,_0x7fb30e,_0x1987eb){var _0x331c4f={'raw':!![],'where':{}};var _0x340191={};var _0x868cc6={'count':0x0,'rows':[]};return db[_0xd501('0x45')][_0xd501('0x5d')]({'where':{'id':_0x4f51e5[_0xd501('0x56')]['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x7fb30e,null))[_0xd501('0x2b')](function(_0x1c0753){if(_0x1c0753){_0x340191[_0xd501('0x36')]=_['keys'](db[_0xd501('0x64')][_0xd501('0x32')]);_0x340191[_0xd501('0x37')]=_[_0xd501('0x38')](_0x4f51e5[_0xd501('0x37')]);_0x340191['filters']=_[_0xd501('0x3a')](_0x340191[_0xd501('0x36')],_0x340191['query']);_0x331c4f[_0xd501('0x39')]=_[_0xd501('0x3a')](_0x340191[_0xd501('0x36')],qs[_0xd501('0x3b')](_0x4f51e5['query']['fields']));_0x331c4f[_0xd501('0x39')]=_0x331c4f[_0xd501('0x39')][_0xd501('0x4b')]?_0x331c4f[_0xd501('0x39')]:_0x340191['model'];if(!_0x4f51e5[_0xd501('0x37')][_0xd501('0x5f')](_0xd501('0x3c'))){_0x331c4f[_0xd501('0x20')]=qs['limit'](_0x4f51e5[_0xd501('0x37')][_0xd501('0x20')]);_0x331c4f[_0xd501('0x1e')]=qs[_0xd501('0x1e')](_0x4f51e5[_0xd501('0x37')][_0xd501('0x1e')]);}_0x331c4f[_0xd501('0x3d')]=qs[_0xd501('0x3e')](_0x4f51e5[_0xd501('0x37')][_0xd501('0x3e')]);_0x331c4f[_0xd501('0x42')]=qs[_0xd501('0x3f')](_[_0xd501('0x40')](_0x4f51e5[_0xd501('0x37')],_0x340191[_0xd501('0x3f')]));_0x331c4f[_0xd501('0x42')][_0xd501('0x60')]=_0x1c0753['id'];if(_0x4f51e5[_0xd501('0x37')]['filter']){_0x331c4f[_0xd501('0x42')]=_[_0xd501('0x43')](_0x331c4f[_0xd501('0x42')],{'$or':_[_0xd501('0x31')](_0x331c4f[_0xd501('0x39')],function(_0x2352a6){var _0x238e13={};_0x238e13[_0x2352a6]={'$like':'%'+_0x4f51e5[_0xd501('0x37')][_0xd501('0x41')]+'%'};return _0x238e13;})});}_0x331c4f=_[_0xd501('0x43')]({},_0x331c4f,_0x4f51e5[_0xd501('0x44')]);return db['CmHopperFinal'][_0xd501('0x21')]({'where':_0x331c4f[_0xd501('0x42')]})[_0xd501('0x2b')](function(_0x6d5158){_0x868cc6[_0xd501('0x21')]=_0x6d5158;if(_0x4f51e5[_0xd501('0x37')][_0xd501('0x46')]){_0x331c4f[_0xd501('0x4c')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x331c4f);})[_0xd501('0x2b')](function(_0x7a70df){_0x868cc6[_0xd501('0x48')]=_0x7a70df;return _0x868cc6;});}})['then'](respondWithFilteredResult(_0x7fb30e,_0x331c4f))['catch'](handleError(_0x7fb30e,null));};exports['getHopperBlacks']=function(_0x6402f9,_0x45b203,_0x451ca9){var _0x5e5c9f={'raw':!![],'where':{}};var _0x57e332={};var _0x7d6196={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x6402f9[_0xd501('0x56')]['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x45b203,null))[_0xd501('0x2b')](function(_0x1654c1){if(_0x1654c1){_0x57e332[_0xd501('0x36')]=_[_0xd501('0x38')](db[_0xd501('0x65')][_0xd501('0x32')]);_0x57e332[_0xd501('0x37')]=_[_0xd501('0x38')](_0x6402f9[_0xd501('0x37')]);_0x57e332[_0xd501('0x3f')]=_[_0xd501('0x3a')](_0x57e332['model'],_0x57e332[_0xd501('0x37')]);_0x5e5c9f[_0xd501('0x39')]=_['intersection'](_0x57e332[_0xd501('0x36')],qs[_0xd501('0x3b')](_0x6402f9[_0xd501('0x37')][_0xd501('0x3b')]));_0x5e5c9f[_0xd501('0x39')]=_0x5e5c9f[_0xd501('0x39')][_0xd501('0x4b')]?_0x5e5c9f[_0xd501('0x39')]:_0x57e332[_0xd501('0x36')];if(!_0x6402f9[_0xd501('0x37')][_0xd501('0x5f')](_0xd501('0x3c'))){_0x5e5c9f[_0xd501('0x20')]=qs[_0xd501('0x20')](_0x6402f9[_0xd501('0x37')][_0xd501('0x20')]);_0x5e5c9f[_0xd501('0x1e')]=qs[_0xd501('0x1e')](_0x6402f9[_0xd501('0x37')]['offset']);}_0x5e5c9f[_0xd501('0x3d')]=qs[_0xd501('0x3e')](_0x6402f9[_0xd501('0x37')]['sort']);_0x5e5c9f[_0xd501('0x42')]=qs[_0xd501('0x3f')](_[_0xd501('0x40')](_0x6402f9[_0xd501('0x37')],_0x57e332[_0xd501('0x3f')]));_0x5e5c9f[_0xd501('0x42')][_0xd501('0x60')]=_0x1654c1['id'];if(_0x6402f9['query'][_0xd501('0x41')]){_0x5e5c9f[_0xd501('0x42')]=_[_0xd501('0x43')](_0x5e5c9f[_0xd501('0x42')],{'$or':_[_0xd501('0x31')](_0x5e5c9f[_0xd501('0x39')],function(_0x1c38fc){var _0xeaf7bc={};_0xeaf7bc[_0x1c38fc]={'$like':'%'+_0x6402f9['query'][_0xd501('0x41')]+'%'};return _0xeaf7bc;})});}_0x5e5c9f=_[_0xd501('0x43')]({},_0x5e5c9f,_0x6402f9[_0xd501('0x44')]);return db[_0xd501('0x65')][_0xd501('0x21')]({'where':_0x5e5c9f[_0xd501('0x42')]})['then'](function(_0x1f6f83){_0x7d6196['count']=_0x1f6f83;if(_0x6402f9['query'][_0xd501('0x46')]){_0x5e5c9f[_0xd501('0x4c')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xd501('0x47')](_0x5e5c9f);})[_0xd501('0x2b')](function(_0xf0339b){_0x7d6196[_0xd501('0x48')]=_0xf0339b;return _0x7d6196;});}})[_0xd501('0x2b')](respondWithFilteredResult(_0x45b203,_0x5e5c9f))[_0xd501('0x49')](handleError(_0x45b203,null));};exports['getLists']=function(_0x54cfa3,_0x4c4e90,_0x15b1d2){var _0x12c83f={};var _0x10b9dd={};var _0x2c7de6;var _0x5a9335;return db['Campaign'][_0xd501('0x5d')]({'where':{'id':_0x54cfa3['params']['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x4c4e90,null))[_0xd501('0x2b')](function(_0x1e7a19){if(_0x1e7a19){_0x2c7de6=_0x1e7a19;_0x10b9dd[_0xd501('0x36')]=_[_0xd501('0x38')](db['CmList'][_0xd501('0x32')]);_0x10b9dd[_0xd501('0x37')]=_[_0xd501('0x38')](_0x54cfa3[_0xd501('0x37')]);_0x10b9dd[_0xd501('0x3f')]=_['intersection'](_0x10b9dd['model'],_0x10b9dd[_0xd501('0x37')]);_0x12c83f['attributes']=_[_0xd501('0x3a')](_0x10b9dd[_0xd501('0x36')],qs[_0xd501('0x3b')](_0x54cfa3['query'][_0xd501('0x3b')]));_0x12c83f['attributes']=_0x12c83f[_0xd501('0x39')]['length']?_0x12c83f['attributes']:_0x10b9dd['model'];_0x12c83f['order']=qs[_0xd501('0x3e')](_0x54cfa3[_0xd501('0x37')][_0xd501('0x3e')]);_0x12c83f[_0xd501('0x42')]=qs[_0xd501('0x3f')](_['pick'](_0x54cfa3[_0xd501('0x37')],_0x10b9dd[_0xd501('0x3f')]));if(_0x54cfa3[_0xd501('0x37')][_0xd501('0x41')]){_0x12c83f[_0xd501('0x42')]=_[_0xd501('0x43')](_0x12c83f[_0xd501('0x42')],{'$or':_[_0xd501('0x31')](_0x12c83f[_0xd501('0x39')],function(_0x246d98){var _0x47365d={};_0x47365d[_0x246d98]={'$like':'%'+_0x54cfa3['query'][_0xd501('0x41')]+'%'};return _0x47365d;})});}_0x12c83f=_[_0xd501('0x43')]({},_0x12c83f,_0x54cfa3[_0xd501('0x44')]);return _0x2c7de6['getLists'](_0x12c83f);}})['then'](function(_0x1c5854){if(_0x1c5854){_0x5a9335=_0x1c5854[_0xd501('0x4b')];if(!_0x54cfa3[_0xd501('0x37')][_0xd501('0x5f')](_0xd501('0x3c'))){_0x12c83f[_0xd501('0x20')]=qs[_0xd501('0x20')](_0x54cfa3[_0xd501('0x37')]['limit']);_0x12c83f[_0xd501('0x1e')]=qs[_0xd501('0x1e')](_0x54cfa3['query'][_0xd501('0x1e')]);}return _0x2c7de6[_0xd501('0x66')](_0x12c83f);}})[_0xd501('0x2b')](function(_0x5a4752){if(_0x5a4752){return _0x5a4752?{'count':_0x5a9335,'rows':_0x5a4752}:null;}})[_0xd501('0x2b')](respondWithResult(_0x4c4e90,null))[_0xd501('0x49')](handleError(_0x4c4e90,null));};exports[_0xd501('0x67')]=function(_0x427fc3,_0x10582a,_0x3a0e35){var _0x4cff1c,_0x48df21;return db[_0xd501('0x45')][_0xd501('0x4d')]({'where':{'id':_0x427fc3[_0xd501('0x56')]['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x10582a,null))[_0xd501('0x2b')](function(_0x51f42e){if(_0x51f42e){_0x48df21=_0x51f42e;return _0x51f42e[_0xd501('0x67')](_0x427fc3['body'][_0xd501('0x68')],_[_0xd501('0x57')](_0x427fc3[_0xd501('0x4f')],[_0xd501('0x68'),'id'])||{});}return null;})[_0xd501('0x69')](function(_0x22c91d){var _0x4a97e7;_0x4cff1c=_0x22c91d||[];var _0x7cb549=[];if(_0x22c91d){for(var _0x27ae0d=0x0;_0x27ae0d<_0x22c91d[_0xd501('0x4b')];_0x27ae0d+=0x1){var _0x9c4537=_0x22c91d[_0x27ae0d][_0xd501('0x28')]({'plain':!![]});_0x48df21[_0xd501('0x6a')]=_0x427fc3[_0xd501('0x4f')][_0xd501('0x6a')]?_0x427fc3[_0xd501('0x4f')][_0xd501('0x6a')]:_0x48df21[_0xd501('0x6a')];switch(_0x48df21['dialCheckDuplicateType']){case _0xd501('0x6b'):_0x4a97e7=squel['insert']()[_0xd501('0x6c')](_0xd501('0x6d'))[_0xd501('0x6e')]([_0xd501('0x6f'),_0xd501('0x70'),_0xd501('0x71'),'ListId',_0xd501('0x60'),'createdAt',_0xd501('0x58')],squel[_0xd501('0x72')]()[_0xd501('0x73')]('phone','phone')[_0xd501('0x73')](_0xd501('0x74'),_0xd501('0x70'))['field']('id',_0xd501('0x71'))[_0xd501('0x73')](_0x9c4537[_0xd501('0x75')][_0xd501('0x76')](),'ListId')[_0xd501('0x73')](_0x427fc3[_0xd501('0x56')]['id'][_0xd501('0x76')](),_0xd501('0x60'))[_0xd501('0x73')](_0xd501('0x74'),_0xd501('0x59'))[_0xd501('0x73')](_0xd501('0x74'),'updatedAt')[_0xd501('0x77')](_0xd501('0x78'))[_0xd501('0x42')](_0xd501('0x79'))['where'](_0xd501('0x7a'),_0x9c4537[_0xd501('0x75')][_0xd501('0x76')]())[_0xd501('0x42')](_0xd501('0x7b'))['where'](_0xd501('0x7c'),squel[_0xd501('0x72')]()[_0xd501('0x73')]('COALESCE(calleridnum,\x27\x27)')[_0xd501('0x77')](_0xd501('0x7d'))[_0xd501('0x42')](_0xd501('0x7e'),_0x427fc3['params']['id'][_0xd501('0x76')]()))[_0xd501('0x42')](_0xd501('0x7c'),squel[_0xd501('0x72')]()['field'](_0xd501('0x7f'))[_0xd501('0x77')](_0xd501('0x6d'))[_0xd501('0x42')](_0xd501('0x7e'),_0x427fc3[_0xd501('0x56')]['id'][_0xd501('0x76')]())))[_0xd501('0x76')]();break;case _0xd501('0x80'):_0x4a97e7=squel[_0xd501('0x81')]()[_0xd501('0x6c')](_0xd501('0x6d'))[_0xd501('0x6e')]([_0xd501('0x6f'),_0xd501('0x70'),_0xd501('0x71'),_0xd501('0x82'),'CampaignId',_0xd501('0x59'),_0xd501('0x58')],squel[_0xd501('0x72')]()[_0xd501('0x73')](_0xd501('0x6f'),_0xd501('0x6f'))[_0xd501('0x73')](_0xd501('0x74'),_0xd501('0x70'))[_0xd501('0x73')]('id',_0xd501('0x71'))[_0xd501('0x73')](_0x9c4537[_0xd501('0x75')]['toString'](),_0xd501('0x82'))[_0xd501('0x73')](_0x427fc3[_0xd501('0x56')]['id'][_0xd501('0x76')](),'CampaignId')[_0xd501('0x73')](_0xd501('0x74'),_0xd501('0x59'))['field'](_0xd501('0x74'),_0xd501('0x58'))[_0xd501('0x77')](_0xd501('0x78'))[_0xd501('0x42')](_0xd501('0x79'))['where'](_0xd501('0x7a'),_0x9c4537[_0xd501('0x75')]['toString']())[_0xd501('0x42')](_0xd501('0x7b'))[_0xd501('0x42')](_0xd501('0x7c'),squel[_0xd501('0x72')]()[_0xd501('0x73')]('COALESCE(phone,\x27\x27)')[_0xd501('0x77')](_0xd501('0x6d'))[_0xd501('0x42')](_0xd501('0x7e'),_0x427fc3[_0xd501('0x56')]['id'][_0xd501('0x76')]())))['toString']();break;default:_0x4a97e7=squel[_0xd501('0x81')]()[_0xd501('0x6c')]('cm_hopper')[_0xd501('0x6e')]([_0xd501('0x6f'),_0xd501('0x70'),'ContactId',_0xd501('0x82'),_0xd501('0x60'),_0xd501('0x59'),'updatedAt'],squel[_0xd501('0x72')]()['field'](_0xd501('0x6f'),'phone')[_0xd501('0x73')]('NOW()',_0xd501('0x70'))[_0xd501('0x73')]('id',_0xd501('0x71'))[_0xd501('0x73')](_0x9c4537[_0xd501('0x75')]['toString'](),_0xd501('0x82'))[_0xd501('0x73')](_0x427fc3[_0xd501('0x56')]['id'][_0xd501('0x76')](),_0xd501('0x60'))[_0xd501('0x73')]('NOW()','createdAt')[_0xd501('0x73')](_0xd501('0x74'),_0xd501('0x58'))['from'](_0xd501('0x78'))[_0xd501('0x42')](_0xd501('0x79'))[_0xd501('0x42')](_0xd501('0x7a'),_0x9c4537[_0xd501('0x75')]['toString']())[_0xd501('0x42')](_0xd501('0x7b')))['toString']();}_0x7cb549[_0xd501('0x83')](db['sequelize'][_0xd501('0x37')](_0x4a97e7));}return BPromise[_0xd501('0x84')](_0x7cb549);}})[_0xd501('0x2b')](function(){return _0x4cff1c;})[_0xd501('0x2b')](respondWithResult(_0x10582a,null))[_0xd501('0x49')](handleError(_0x10582a,null));};exports['removeLists']=function(_0xa86acb,_0x84af1a,_0xea966f){return db[_0xd501('0x45')][_0xd501('0x4d')]({'where':{'id':_0xa86acb[_0xd501('0x56')]['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x84af1a,null))['then'](function(_0x5c4aa3){if(_0x5c4aa3){return _0x5c4aa3[_0xd501('0x85')](_0xa86acb[_0xd501('0x37')][_0xd501('0x68')]);}})[_0xd501('0x2b')](function(_0x1fdc25){if(_0x1fdc25){return db[_0xd501('0x5e')][_0xd501('0x27')]({'where':{'ListId':_0xa86acb[_0xd501('0x37')]['ids'],'CampaignId':_0xa86acb[_0xd501('0x56')]['id']}})['then'](function(){return _0x1fdc25;});}})[_0xd501('0x2b')](respondWithStatusCode(_0x84af1a,null))['catch'](handleError(_0x84af1a,null));};exports['getBlackLists']=function(_0x127f6c,_0x454a2c,_0x4faf2c){var _0x43e81c={};var _0x58ccab={};var _0x47dc26;var _0x49b5e4;return db[_0xd501('0x45')]['findOne']({'where':{'id':_0x127f6c[_0xd501('0x56')]['id']}})['then'](handleEntityNotFound(_0x454a2c,null))[_0xd501('0x2b')](function(_0x25fb40){if(_0x25fb40){_0x47dc26=_0x25fb40;_0x58ccab[_0xd501('0x36')]=_[_0xd501('0x38')](db['CmList'][_0xd501('0x32')]);_0x58ccab[_0xd501('0x37')]=_[_0xd501('0x38')](_0x127f6c[_0xd501('0x37')]);_0x58ccab[_0xd501('0x3f')]=_['intersection'](_0x58ccab[_0xd501('0x36')],_0x58ccab[_0xd501('0x37')]);_0x43e81c[_0xd501('0x39')]=_[_0xd501('0x3a')](_0x58ccab[_0xd501('0x36')],qs[_0xd501('0x3b')](_0x127f6c['query'][_0xd501('0x3b')]));_0x43e81c[_0xd501('0x39')]=_0x43e81c[_0xd501('0x39')][_0xd501('0x4b')]?_0x43e81c['attributes']:_0x58ccab['model'];_0x43e81c[_0xd501('0x3d')]=qs[_0xd501('0x3e')](_0x127f6c[_0xd501('0x37')][_0xd501('0x3e')]);_0x43e81c[_0xd501('0x42')]=qs['filters'](_[_0xd501('0x40')](_0x127f6c[_0xd501('0x37')],_0x58ccab[_0xd501('0x3f')]));if(_0x127f6c[_0xd501('0x37')]['filter']){_0x43e81c[_0xd501('0x42')]=_[_0xd501('0x43')](_0x43e81c[_0xd501('0x42')],{'$or':_['map'](_0x43e81c[_0xd501('0x39')],function(_0xd22fc8){var _0x9b1e4f={};_0x9b1e4f[_0xd22fc8]={'$like':'%'+_0x127f6c[_0xd501('0x37')][_0xd501('0x41')]+'%'};return _0x9b1e4f;})});}_0x43e81c=_['merge']({},_0x43e81c,_0x127f6c[_0xd501('0x44')]);return _0x47dc26[_0xd501('0x86')](_0x43e81c);}})[_0xd501('0x2b')](function(_0x20bbf8){if(_0x20bbf8){_0x49b5e4=_0x20bbf8[_0xd501('0x4b')];if(!_0x127f6c[_0xd501('0x37')][_0xd501('0x5f')](_0xd501('0x3c'))){_0x43e81c[_0xd501('0x20')]=qs[_0xd501('0x20')](_0x127f6c[_0xd501('0x37')][_0xd501('0x20')]);_0x43e81c[_0xd501('0x1e')]=qs[_0xd501('0x1e')](_0x127f6c[_0xd501('0x37')]['offset']);}return _0x47dc26[_0xd501('0x86')](_0x43e81c);}})[_0xd501('0x2b')](function(_0x28718f){if(_0x28718f){return _0x28718f?{'count':_0x49b5e4,'rows':_0x28718f}:null;}})[_0xd501('0x2b')](respondWithResult(_0x454a2c,null))[_0xd501('0x49')](handleError(_0x454a2c,null));};exports[_0xd501('0x87')]=function(_0x5c4f92,_0x15c5c,_0x34d140){var _0x123b1e,_0x44b12f;return db[_0xd501('0x45')][_0xd501('0x4d')]({'where':{'id':_0x5c4f92[_0xd501('0x56')]['id']}})[_0xd501('0x2b')](handleEntityNotFound(_0x15c5c,null))[_0xd501('0x2b')](function(_0x4b69e9){if(_0x4b69e9){_0x44b12f=_0x4b69e9;return _0x4b69e9[_0xd501('0x87')](_0x5c4f92[_0xd501('0x4f')][_0xd501('0x68')],_[_0xd501('0x57')](_0x5c4f92[_0xd501('0x4f')],[_0xd501('0x68'),'id'])||{});}return null;})[_0xd501('0x69')](function(_0x2c0a3f){var _0x1ba522;_0x123b1e=_0x2c0a3f||[];var _0x6c592d=[];if(_0x2c0a3f){for(var _0x2837dd=0x0;_0x2837dd<_0x2c0a3f['length'];_0x2837dd+=0x1){var _0x4ab8c4=_0x2c0a3f[_0x2837dd][_0xd501('0x28')]({'plain':!![]});_0x1ba522=squel[_0xd501('0x81')]()['into'](_0xd501('0x88'))[_0xd501('0x6e')]([_0xd501('0x6f'),'ContactId','ListId',_0xd501('0x60'),'createdAt',_0xd501('0x58')],squel[_0xd501('0x72')]()[_0xd501('0x73')](_0xd501('0x6f'),_0xd501('0x6f'))[_0xd501('0x73')]('id','ContactId')[_0xd501('0x73')](_0x4ab8c4[_0xd501('0x75')][_0xd501('0x76')](),_0xd501('0x82'))['field'](_0x5c4f92[_0xd501('0x56')]['id'][_0xd501('0x76')](),_0xd501('0x60'))[_0xd501('0x73')](_0xd501('0x74'),_0xd501('0x59'))['field']('NOW()',_0xd501('0x58'))[_0xd501('0x77')]('cm_contacts')[_0xd501('0x42')](_0xd501('0x79'))[_0xd501('0x42')]('ListId\x20=\x20?',_0x4ab8c4[_0xd501('0x75')][_0xd501('0x76')]())['where'](_0xd501('0x7b')))[_0xd501('0x76')]();_0x6c592d['push'](db[_0xd501('0x89')][_0xd501('0x37')](_0x1ba522));}return BPromise[_0xd501('0x84')](_0x6c592d);}})['then'](function(){return _0x123b1e;})[_0xd501('0x2b')](respondWithResult(_0x15c5c,null))['catch'](handleError(_0x15c5c,null));};exports[_0xd501('0x8a')]=function(_0xaa9fec,_0x3135fe,_0x7fdbed){return db['Campaign'][_0xd501('0x4d')]({'where':{'id':_0xaa9fec[_0xd501('0x56')]['id']}})['then'](handleEntityNotFound(_0x3135fe,null))['then'](function(_0x511a7a){if(_0x511a7a){return _0x511a7a[_0xd501('0x8a')](_0xaa9fec['query']['ids']);}})[_0xd501('0x2b')](function(_0x1cceb4){if(_0x1cceb4){return db[_0xd501('0x65')][_0xd501('0x27')]({'where':{'ListId':_0xaa9fec[_0xd501('0x37')][_0xd501('0x68')],'CampaignId':_0xaa9fec['params']['id']}})[_0xd501('0x2b')](function(){return _0x1cceb4;});}})[_0xd501('0x2b')](respondWithStatusCode(_0x3135fe,null))[_0xd501('0x49')](handleError(_0x3135fe,null));};
\ No newline at end of file
+var _0x92fd=['options','includeAll','include','rows','show','params','intersection','find','catch','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','clone','createdAt','updatedAt','omit','IvrCampaigns','destroy','getHoppers','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','findOne','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','pick','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','ListId','select','field','phone','NOW()','scheduledAt','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','ContactId','phone\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','push','sequelize','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x92fd,0x1ec));var _0xd92f=function(_0x57d740,_0x50be99){_0x57d740=_0x57d740-0x0;var _0x6607ef=_0x92fd[_0x57d740];return _0x6607ef;};'use strict';var emlformat=require(_0xd92f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd92f('0x1'));var jsonpatch=require(_0xd92f('0x2'));var rp=require(_0xd92f('0x3'));var moment=require(_0xd92f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd92f('0x5'));var util=require(_0xd92f('0x6'));var path=require(_0xd92f('0x7'));var sox=require(_0xd92f('0x8'));var csv=require(_0xd92f('0x9'));var ejs=require(_0xd92f('0xa'));var fs=require('fs');var fs_extra=require(_0xd92f('0xb'));var _=require(_0xd92f('0xc'));var squel=require(_0xd92f('0xd'));var crypto=require('crypto');var jsforce=require(_0xd92f('0xe'));var deskjs=require(_0xd92f('0xf'));var toCsv=require(_0xd92f('0x9'));var querystring=require(_0xd92f('0x10'));var Papa=require(_0xd92f('0x11'));var Redis=require(_0xd92f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd92f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd92f('0x14'));var utils=require(_0xd92f('0x15'));var config=require(_0xd92f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd92f('0x17'))['db'];function respondWithStatusCode(_0x7f8f5,_0x3ad70f){_0x3ad70f=_0x3ad70f||0xcc;return function(_0x317b6c){if(_0x317b6c){return _0x7f8f5[_0xd92f('0x18')](_0x3ad70f);}return _0x7f8f5['status'](_0x3ad70f)[_0xd92f('0x19')]();};}function respondWithResult(_0x5f156f,_0x4c1c78){_0x4c1c78=_0x4c1c78||0xc8;return function(_0x1f4e7f){if(_0x1f4e7f){return _0x5f156f[_0xd92f('0x1a')](_0x4c1c78)[_0xd92f('0x1b')](_0x1f4e7f);}};}function respondWithFilteredResult(_0x5cde6f,_0x568290){return function(_0x1acea3){if(_0x1acea3){var _0x115a81=typeof _0x568290[_0xd92f('0x1c')]===_0xd92f('0x1d')&&typeof _0x568290[_0xd92f('0x1e')]===_0xd92f('0x1d');var _0x2f548b=_0x1acea3[_0xd92f('0x1f')];var _0x1e696a=_0x115a81?0x0:_0x568290[_0xd92f('0x1c')];var _0xdd6b89=_0x115a81?_0x1acea3[_0xd92f('0x1f')]:_0x568290['offset']+_0x568290[_0xd92f('0x1e')];var _0x393a5f;if(_0xdd6b89>=_0x2f548b){_0xdd6b89=_0x2f548b;_0x393a5f=0xc8;}else{_0x393a5f=0xce;}_0x5cde6f[_0xd92f('0x1a')](_0x393a5f);return _0x5cde6f[_0xd92f('0x20')](_0xd92f('0x21'),_0x1e696a+'-'+_0xdd6b89+'/'+_0x2f548b)[_0xd92f('0x1b')](_0x1acea3);}return null;};}function patchUpdates(_0x274ede){return function(_0x3f0ec0){try{jsonpatch[_0xd92f('0x22')](_0x3f0ec0,_0x274ede,!![]);}catch(_0x4b88f4){return BPromise[_0xd92f('0x23')](_0x4b88f4);}return _0x3f0ec0[_0xd92f('0x24')]();};}function saveUpdates(_0x3bb3a3,_0x38d4ff){return function(_0xc6f90d){if(_0xc6f90d){return _0xc6f90d[_0xd92f('0x25')](_0x3bb3a3)['then'](function(_0x4a9657){return _0x4a9657;});}return null;};}function removeEntity(_0x21f432,_0x18ed44){return function(_0x404c61){if(_0x404c61){return _0x404c61['destroy']()[_0xd92f('0x26')](function(){var _0x55f3e6=_0x404c61[_0xd92f('0x27')]({'plain':!![]});var _0x15fe64='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x15fe64,'resourceId':_0x55f3e6['id']}})[_0xd92f('0x26')](function(){return _0x404c61;});})[_0xd92f('0x26')](function(){_0x21f432[_0xd92f('0x1a')](0xcc)[_0xd92f('0x19')]();});}};}function handleEntityNotFound(_0x57f05,_0x590edb){return function(_0x43a6ed){if(!_0x43a6ed){_0x57f05['sendStatus'](0x194);}return _0x43a6ed;};}function handleError(_0x161dd8,_0x5588c7){_0x5588c7=_0x5588c7||0x1f4;return function(_0x44d09e){logger['error'](_0x44d09e[_0xd92f('0x28')]);if(_0x44d09e[_0xd92f('0x29')]){delete _0x44d09e[_0xd92f('0x29')];}_0x161dd8['status'](_0x5588c7)[_0xd92f('0x2a')](_0x44d09e);};}exports[_0xd92f('0x2b')]=function(_0x5c9e92,_0x111d84){var _0x2e6e6f={},_0x3c81de={},_0x29cf67={'count':0x0,'rows':[]};var _0x1684a1=_[_0xd92f('0x2c')](db[_0xd92f('0x2d')][_0xd92f('0x2e')],function(_0x330551){return{'name':_0x330551[_0xd92f('0x2f')],'type':_0x330551[_0xd92f('0x30')][_0xd92f('0x31')]};});_0x3c81de[_0xd92f('0x32')]=_[_0xd92f('0x2c')](_0x1684a1,_0xd92f('0x29'));_0x3c81de['query']=_[_0xd92f('0x33')](_0x5c9e92[_0xd92f('0x34')]);_0x3c81de[_0xd92f('0x35')]=_['intersection'](_0x3c81de[_0xd92f('0x32')],_0x3c81de[_0xd92f('0x34')]);_0x2e6e6f[_0xd92f('0x36')]=_['intersection'](_0x3c81de[_0xd92f('0x32')],qs[_0xd92f('0x37')](_0x5c9e92[_0xd92f('0x34')][_0xd92f('0x37')]));_0x2e6e6f[_0xd92f('0x36')]=_0x2e6e6f['attributes'][_0xd92f('0x38')]?_0x2e6e6f['attributes']:_0x3c81de[_0xd92f('0x32')];if(!_0x5c9e92[_0xd92f('0x34')]['hasOwnProperty'](_0xd92f('0x39'))){_0x2e6e6f[_0xd92f('0x1e')]=qs[_0xd92f('0x1e')](_0x5c9e92[_0xd92f('0x34')][_0xd92f('0x1e')]);_0x2e6e6f[_0xd92f('0x1c')]=qs['offset'](_0x5c9e92[_0xd92f('0x34')][_0xd92f('0x1c')]);}_0x2e6e6f[_0xd92f('0x3a')]=qs[_0xd92f('0x3b')](_0x5c9e92[_0xd92f('0x34')][_0xd92f('0x3b')]);_0x2e6e6f[_0xd92f('0x3c')]=qs[_0xd92f('0x35')](_['pick'](_0x5c9e92[_0xd92f('0x34')],_0x3c81de[_0xd92f('0x35')]),_0x1684a1);if(_0x5c9e92['query'][_0xd92f('0x3d')]){_0x2e6e6f['where']=_[_0xd92f('0x3e')](_0x2e6e6f[_0xd92f('0x3c')],{'$or':_['map'](_0x1684a1,function(_0x408950){if(_0x408950['type']!==_0xd92f('0x3f')){var _0x45e5e7={};_0x45e5e7[_0x408950['name']]={'$like':'%'+_0x5c9e92[_0xd92f('0x34')][_0xd92f('0x3d')]+'%'};return _0x45e5e7;}})});}_0x2e6e6f=_[_0xd92f('0x3e')]({},_0x2e6e6f,_0x5c9e92[_0xd92f('0x40')]);var _0x3f6b52={'where':_0x2e6e6f['where']};return db[_0xd92f('0x2d')][_0xd92f('0x1f')](_0x3f6b52)['then'](function(_0x59adaf){_0x29cf67[_0xd92f('0x1f')]=_0x59adaf;if(_0x5c9e92['query'][_0xd92f('0x41')]){_0x2e6e6f[_0xd92f('0x42')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x2e6e6f);})[_0xd92f('0x26')](function(_0x54f89f){_0x29cf67[_0xd92f('0x43')]=_0x54f89f;return _0x29cf67;})[_0xd92f('0x26')](respondWithFilteredResult(_0x111d84,_0x2e6e6f))['catch'](handleError(_0x111d84,null));};exports[_0xd92f('0x44')]=function(_0x420358,_0x3a03b6){var _0x429f54={'raw':![],'where':{'id':_0x420358[_0xd92f('0x45')]['id']}},_0x26b037={};_0x26b037[_0xd92f('0x32')]=_[_0xd92f('0x33')](db[_0xd92f('0x2d')]['rawAttributes']);_0x26b037[_0xd92f('0x34')]=_[_0xd92f('0x33')](_0x420358[_0xd92f('0x34')]);_0x26b037[_0xd92f('0x35')]=_[_0xd92f('0x46')](_0x26b037['model'],_0x26b037[_0xd92f('0x34')]);_0x429f54[_0xd92f('0x36')]=_[_0xd92f('0x46')](_0x26b037[_0xd92f('0x32')],qs[_0xd92f('0x37')](_0x420358['query'][_0xd92f('0x37')]));_0x429f54['attributes']=_0x429f54['attributes'][_0xd92f('0x38')]?_0x429f54['attributes']:_0x26b037['model'];if(_0x420358[_0xd92f('0x34')][_0xd92f('0x41')]){_0x429f54['include']=[{'all':!![]}];}_0x429f54=_[_0xd92f('0x3e')]({},_0x429f54,_0x420358[_0xd92f('0x40')]);return db[_0xd92f('0x2d')][_0xd92f('0x47')](_0x429f54)[_0xd92f('0x26')](handleEntityNotFound(_0x3a03b6,null))['then'](respondWithResult(_0x3a03b6,null))[_0xd92f('0x48')](handleError(_0x3a03b6,null));};exports[_0xd92f('0x49')]=function(_0x870ab4,_0x6f3592){return db[_0xd92f('0x2d')][_0xd92f('0x49')](_0x870ab4[_0xd92f('0x4a')],{})[_0xd92f('0x26')](function(_0x218650){var _0x39c49f=_0x870ab4[_0xd92f('0x4b')]['get']({'plain':!![]});if(!_0x39c49f)throw new Error(_0xd92f('0x4c'));if(_0x39c49f[_0xd92f('0x4d')]===_0xd92f('0x4b')){var _0x35983b=_0x218650[_0xd92f('0x27')]({'plain':!![]});var _0x4255ac='IvrCampaigns';return db[_0xd92f('0x4e')]['find']({'where':{'name':_0x4255ac,'userProfileId':_0x39c49f[_0xd92f('0x4f')]},'raw':!![]})[_0xd92f('0x26')](function(_0x31878b){if(_0x31878b&&_0x31878b[_0xd92f('0x50')]===0x0){return db[_0xd92f('0x51')]['create']({'name':_0x35983b['name'],'resourceId':_0x35983b['id'],'type':_0x31878b['name'],'sectionId':_0x31878b['id']},{})[_0xd92f('0x26')](function(){return _0x218650;});}else{return _0x218650;}})[_0xd92f('0x48')](function(_0x24d0b2){logger[_0xd92f('0x52')](_0xd92f('0x53'),_0x24d0b2);throw _0x24d0b2;});}return _0x218650;})[_0xd92f('0x26')](respondWithResult(_0x6f3592,0xc9))[_0xd92f('0x48')](handleError(_0x6f3592,null));};exports[_0xd92f('0x54')]=function(_0x353396,_0x805096){var _0x4f4a47={'where':{'id':_0x353396[_0xd92f('0x45')]['id']}},_0x439990={};_0x439990[_0xd92f('0x32')]=_[_0xd92f('0x33')](db[_0xd92f('0x2d')][_0xd92f('0x2e')]);_0x4f4a47['attributes']=_[_0xd92f('0x46')](_0x439990[_0xd92f('0x32')],qs['fields'](_0x353396[_0xd92f('0x34')]['fields']));_0x4f4a47[_0xd92f('0x36')]=_0x4f4a47[_0xd92f('0x36')][_0xd92f('0x38')]?_0x4f4a47[_0xd92f('0x36')]:_0x439990['model'];if(_0x353396[_0xd92f('0x34')]['includeAll']){_0x4f4a47[_0xd92f('0x42')]=[{'all':!![]}];}_0x4f4a47=_[_0xd92f('0x3e')]({},_0x4f4a47,_0x353396[_0xd92f('0x40')]);return db[_0xd92f('0x2d')]['find'](_0x4f4a47)[_0xd92f('0x26')](handleEntityNotFound(_0x805096,null))[_0xd92f('0x26')](function(_0x4ef13d){if(_0x4ef13d){var _0x4088c9=_0x4ef13d[_0xd92f('0x27')]({'plain':!![]});_0x4088c9=qs['omit'](_0x4088c9,['id',_0xd92f('0x55'),_0xd92f('0x56')]);_0x353396[_0xd92f('0x4a')]=_[_0xd92f('0x57')](_0x353396[_0xd92f('0x4a')],['id','createdAt','updatedAt']);return db[_0xd92f('0x2d')]['create'](_[_0xd92f('0x3e')](_0x4088c9,_0x353396[_0xd92f('0x4a')]),{'include':_0x353396[_0xd92f('0x34')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2bb9d5){var _0x523f43=_0x353396[_0xd92f('0x4b')][_0xd92f('0x27')]({'plain':!![]});if(!_0x523f43)throw new Error(_0xd92f('0x4c'));if(_0x523f43[_0xd92f('0x4d')]===_0xd92f('0x4b')){var _0x330975=_0x2bb9d5[_0xd92f('0x27')]({'plain':!![]});var _0x2a790c=_0xd92f('0x58');return db[_0xd92f('0x4e')]['find']({'where':{'name':_0x2a790c,'userProfileId':_0x523f43[_0xd92f('0x4f')]},'raw':!![]})[_0xd92f('0x26')](function(_0x306948){if(_0x306948&&_0x306948[_0xd92f('0x50')]===0x0){return db['UserProfileResource'][_0xd92f('0x49')]({'name':_0x330975['name'],'resourceId':_0x330975['id'],'type':_0x306948['name'],'sectionId':_0x306948['id']},{})[_0xd92f('0x26')](function(){return _0x2bb9d5;});}else{return _0x2bb9d5;}})[_0xd92f('0x48')](function(_0x5cada3){logger[_0xd92f('0x52')](_0xd92f('0x53'),_0x5cada3);throw _0x5cada3;});}return _0x2bb9d5;});}})[_0xd92f('0x26')](respondWithResult(_0x805096,0xc9))[_0xd92f('0x48')](handleError(_0x805096,null));};exports[_0xd92f('0x25')]=function(_0x111795,_0x2d895e){if(_0x111795[_0xd92f('0x4a')]['id']){delete _0x111795[_0xd92f('0x4a')]['id'];}return db['Campaign'][_0xd92f('0x47')]({'where':{'id':_0x111795[_0xd92f('0x45')]['id']}})[_0xd92f('0x26')](handleEntityNotFound(_0x2d895e,null))['then'](saveUpdates(_0x111795[_0xd92f('0x4a')],null))['then'](respondWithResult(_0x2d895e,null))['catch'](handleError(_0x2d895e,null));};exports[_0xd92f('0x59')]=function(_0x2bc74a,_0xdacaa4){return db['Campaign'][_0xd92f('0x47')]({'where':{'id':_0x2bc74a[_0xd92f('0x45')]['id']}})['then'](handleEntityNotFound(_0xdacaa4,null))[_0xd92f('0x26')](removeEntity(_0xdacaa4,null))[_0xd92f('0x48')](handleError(_0xdacaa4,null));};exports[_0xd92f('0x5a')]=function(_0x3a4759,_0x1b7bfb,_0x3813e4){var _0x15f93e={'raw':!![],'where':{}};var _0x2924b6={};var _0x3d26a6={'count':0x0,'rows':[]};return db[_0xd92f('0x2d')]['findOne']({'where':{'id':_0x3a4759[_0xd92f('0x45')]['id']}})[_0xd92f('0x26')](handleEntityNotFound(_0x1b7bfb,null))['then'](function(_0x312f89){if(_0x312f89){_0x2924b6[_0xd92f('0x32')]=_[_0xd92f('0x33')](db[_0xd92f('0x5b')][_0xd92f('0x2e')]);_0x2924b6[_0xd92f('0x34')]=_[_0xd92f('0x33')](_0x3a4759[_0xd92f('0x34')]);_0x2924b6[_0xd92f('0x35')]=_[_0xd92f('0x46')](_0x2924b6['model'],_0x2924b6[_0xd92f('0x34')]);_0x15f93e['attributes']=_['intersection'](_0x2924b6[_0xd92f('0x32')],qs[_0xd92f('0x37')](_0x3a4759['query'][_0xd92f('0x37')]));_0x15f93e['attributes']=_0x15f93e[_0xd92f('0x36')][_0xd92f('0x38')]?_0x15f93e[_0xd92f('0x36')]:_0x2924b6[_0xd92f('0x32')];if(!_0x3a4759[_0xd92f('0x34')][_0xd92f('0x5c')](_0xd92f('0x39'))){_0x15f93e[_0xd92f('0x1e')]=qs[_0xd92f('0x1e')](_0x3a4759['query'][_0xd92f('0x1e')]);_0x15f93e[_0xd92f('0x1c')]=qs['offset'](_0x3a4759[_0xd92f('0x34')][_0xd92f('0x1c')]);}_0x15f93e[_0xd92f('0x3a')]=qs[_0xd92f('0x3b')](_0x3a4759[_0xd92f('0x34')]['sort']);_0x15f93e[_0xd92f('0x3c')]=qs[_0xd92f('0x35')](_['pick'](_0x3a4759[_0xd92f('0x34')],_0x2924b6['filters']));_0x15f93e[_0xd92f('0x3c')][_0xd92f('0x5d')]=_0x312f89['id'];if(_0x3a4759['query']['filter']){_0x15f93e[_0xd92f('0x3c')]=_['merge'](_0x15f93e['where'],{'$or':_['map'](_0x15f93e[_0xd92f('0x36')],function(_0x274f1a){var _0x24220f={};_0x24220f[_0x274f1a]={'$like':'%'+_0x3a4759[_0xd92f('0x34')]['filter']+'%'};return _0x24220f;})});}_0x15f93e=_[_0xd92f('0x3e')]({},_0x15f93e,_0x3a4759[_0xd92f('0x40')]);return db[_0xd92f('0x5b')][_0xd92f('0x1f')]({'where':_0x15f93e[_0xd92f('0x3c')]})[_0xd92f('0x26')](function(_0x1ca876){_0x3d26a6[_0xd92f('0x1f')]=_0x1ca876;if(_0x3a4759[_0xd92f('0x34')]['includeAll']){_0x15f93e[_0xd92f('0x42')]=[{'all':!![]}];}return db[_0xd92f('0x5b')]['findAll'](_0x15f93e);})[_0xd92f('0x26')](function(_0x17f8fc){_0x3d26a6[_0xd92f('0x43')]=_0x17f8fc;return _0x3d26a6;});}})[_0xd92f('0x26')](respondWithFilteredResult(_0x1b7bfb,_0x15f93e))[_0xd92f('0x48')](handleError(_0x1b7bfb,null));};exports[_0xd92f('0x5e')]=function(_0x9589fc,_0x183976,_0x8242cb){var _0x52becf={'raw':!![],'where':{}};var _0x5d475c={};var _0x26b921={'count':0x0,'rows':[]};return db[_0xd92f('0x2d')][_0xd92f('0x5f')]({'where':{'id':_0x9589fc['params']['id']}})[_0xd92f('0x26')](handleEntityNotFound(_0x183976,null))['then'](function(_0x33f123){if(_0x33f123){_0x5d475c[_0xd92f('0x32')]=_[_0xd92f('0x33')](db['CmHopperHistory'][_0xd92f('0x2e')]);_0x5d475c[_0xd92f('0x34')]=_['keys'](_0x9589fc[_0xd92f('0x34')]);_0x5d475c[_0xd92f('0x35')]=_[_0xd92f('0x46')](_0x5d475c[_0xd92f('0x32')],_0x5d475c[_0xd92f('0x34')]);_0x52becf['attributes']=_['intersection'](_0x5d475c[_0xd92f('0x32')],qs[_0xd92f('0x37')](_0x9589fc[_0xd92f('0x34')][_0xd92f('0x37')]));_0x52becf[_0xd92f('0x36')]=_0x52becf['attributes'][_0xd92f('0x38')]?_0x52becf[_0xd92f('0x36')]:_0x5d475c[_0xd92f('0x32')];if(!_0x9589fc['query'][_0xd92f('0x5c')](_0xd92f('0x39'))){_0x52becf[_0xd92f('0x1e')]=qs['limit'](_0x9589fc[_0xd92f('0x34')][_0xd92f('0x1e')]);_0x52becf[_0xd92f('0x1c')]=qs['offset'](_0x9589fc[_0xd92f('0x34')][_0xd92f('0x1c')]);}_0x52becf[_0xd92f('0x3a')]=qs[_0xd92f('0x3b')](_0x9589fc[_0xd92f('0x34')][_0xd92f('0x3b')]);_0x52becf[_0xd92f('0x3c')]=qs[_0xd92f('0x35')](_['pick'](_0x9589fc[_0xd92f('0x34')],_0x5d475c[_0xd92f('0x35')]));_0x52becf['where'][_0xd92f('0x5d')]=_0x33f123['id'];if(_0x9589fc[_0xd92f('0x34')][_0xd92f('0x3d')]){_0x52becf['where']=_[_0xd92f('0x3e')](_0x52becf[_0xd92f('0x3c')],{'$or':_[_0xd92f('0x2c')](_0x52becf[_0xd92f('0x36')],function(_0x24a966){var _0xa29929={};_0xa29929[_0x24a966]={'$like':'%'+_0x9589fc[_0xd92f('0x34')]['filter']+'%'};return _0xa29929;})});}_0x52becf=_[_0xd92f('0x3e')]({},_0x52becf,_0x9589fc['options']);return db['CmHopperHistory']['count']({'where':_0x52becf[_0xd92f('0x3c')]})[_0xd92f('0x26')](function(_0x2e5fc2){_0x26b921[_0xd92f('0x1f')]=_0x2e5fc2;if(_0x9589fc[_0xd92f('0x34')][_0xd92f('0x41')]){_0x52becf[_0xd92f('0x42')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xd92f('0x60')](_0x52becf);})[_0xd92f('0x26')](function(_0x3c8be4){_0x26b921[_0xd92f('0x43')]=_0x3c8be4;return _0x26b921;});}})['then'](respondWithFilteredResult(_0x183976,_0x52becf))[_0xd92f('0x48')](handleError(_0x183976,null));};exports[_0xd92f('0x61')]=function(_0x3e7386,_0x19f35d,_0x31b96e){var _0x59c26d={'raw':!![],'where':{}};var _0x123045={};var _0x5de838={'count':0x0,'rows':[]};return db[_0xd92f('0x2d')][_0xd92f('0x5f')]({'where':{'id':_0x3e7386[_0xd92f('0x45')]['id']}})['then'](handleEntityNotFound(_0x19f35d,null))[_0xd92f('0x26')](function(_0x47227d){if(_0x47227d){_0x123045[_0xd92f('0x32')]=_['keys'](db['CmHopperFinal'][_0xd92f('0x2e')]);_0x123045[_0xd92f('0x34')]=_[_0xd92f('0x33')](_0x3e7386[_0xd92f('0x34')]);_0x123045[_0xd92f('0x35')]=_['intersection'](_0x123045[_0xd92f('0x32')],_0x123045[_0xd92f('0x34')]);_0x59c26d[_0xd92f('0x36')]=_[_0xd92f('0x46')](_0x123045['model'],qs[_0xd92f('0x37')](_0x3e7386[_0xd92f('0x34')][_0xd92f('0x37')]));_0x59c26d['attributes']=_0x59c26d['attributes'][_0xd92f('0x38')]?_0x59c26d[_0xd92f('0x36')]:_0x123045[_0xd92f('0x32')];if(!_0x3e7386[_0xd92f('0x34')]['hasOwnProperty'](_0xd92f('0x39'))){_0x59c26d[_0xd92f('0x1e')]=qs[_0xd92f('0x1e')](_0x3e7386[_0xd92f('0x34')]['limit']);_0x59c26d[_0xd92f('0x1c')]=qs[_0xd92f('0x1c')](_0x3e7386[_0xd92f('0x34')][_0xd92f('0x1c')]);}_0x59c26d[_0xd92f('0x3a')]=qs[_0xd92f('0x3b')](_0x3e7386[_0xd92f('0x34')][_0xd92f('0x3b')]);_0x59c26d[_0xd92f('0x3c')]=qs[_0xd92f('0x35')](_['pick'](_0x3e7386[_0xd92f('0x34')],_0x123045[_0xd92f('0x35')]));_0x59c26d[_0xd92f('0x3c')][_0xd92f('0x5d')]=_0x47227d['id'];if(_0x3e7386[_0xd92f('0x34')][_0xd92f('0x3d')]){_0x59c26d[_0xd92f('0x3c')]=_[_0xd92f('0x3e')](_0x59c26d[_0xd92f('0x3c')],{'$or':_[_0xd92f('0x2c')](_0x59c26d['attributes'],function(_0x338bee){var _0x31bdb2={};_0x31bdb2[_0x338bee]={'$like':'%'+_0x3e7386['query']['filter']+'%'};return _0x31bdb2;})});}_0x59c26d=_[_0xd92f('0x3e')]({},_0x59c26d,_0x3e7386[_0xd92f('0x40')]);return db[_0xd92f('0x62')]['count']({'where':_0x59c26d[_0xd92f('0x3c')]})['then'](function(_0x37facb){_0x5de838[_0xd92f('0x1f')]=_0x37facb;if(_0x3e7386[_0xd92f('0x34')][_0xd92f('0x41')]){_0x59c26d[_0xd92f('0x42')]=[{'all':!![]}];}return db[_0xd92f('0x62')]['findAll'](_0x59c26d);})['then'](function(_0x41da6f){_0x5de838[_0xd92f('0x43')]=_0x41da6f;return _0x5de838;});}})[_0xd92f('0x26')](respondWithFilteredResult(_0x19f35d,_0x59c26d))[_0xd92f('0x48')](handleError(_0x19f35d,null));};exports[_0xd92f('0x63')]=function(_0x3c1aad,_0x80595a,_0x47c0b4){var _0x2c6183={'raw':!![],'where':{}};var _0xfbbee3={};var _0x288ad9={'count':0x0,'rows':[]};return db[_0xd92f('0x2d')][_0xd92f('0x5f')]({'where':{'id':_0x3c1aad[_0xd92f('0x45')]['id']}})[_0xd92f('0x26')](handleEntityNotFound(_0x80595a,null))[_0xd92f('0x26')](function(_0x1dbbe6){if(_0x1dbbe6){_0xfbbee3[_0xd92f('0x32')]=_[_0xd92f('0x33')](db['CmHopperBlack'][_0xd92f('0x2e')]);_0xfbbee3[_0xd92f('0x34')]=_['keys'](_0x3c1aad[_0xd92f('0x34')]);_0xfbbee3[_0xd92f('0x35')]=_[_0xd92f('0x46')](_0xfbbee3[_0xd92f('0x32')],_0xfbbee3['query']);_0x2c6183[_0xd92f('0x36')]=_['intersection'](_0xfbbee3[_0xd92f('0x32')],qs[_0xd92f('0x37')](_0x3c1aad[_0xd92f('0x34')]['fields']));_0x2c6183['attributes']=_0x2c6183[_0xd92f('0x36')]['length']?_0x2c6183['attributes']:_0xfbbee3[_0xd92f('0x32')];if(!_0x3c1aad['query'][_0xd92f('0x5c')](_0xd92f('0x39'))){_0x2c6183[_0xd92f('0x1e')]=qs['limit'](_0x3c1aad[_0xd92f('0x34')][_0xd92f('0x1e')]);_0x2c6183[_0xd92f('0x1c')]=qs['offset'](_0x3c1aad['query'][_0xd92f('0x1c')]);}_0x2c6183[_0xd92f('0x3a')]=qs[_0xd92f('0x3b')](_0x3c1aad[_0xd92f('0x34')][_0xd92f('0x3b')]);_0x2c6183[_0xd92f('0x3c')]=qs[_0xd92f('0x35')](_[_0xd92f('0x64')](_0x3c1aad[_0xd92f('0x34')],_0xfbbee3[_0xd92f('0x35')]));_0x2c6183[_0xd92f('0x3c')][_0xd92f('0x5d')]=_0x1dbbe6['id'];if(_0x3c1aad['query'][_0xd92f('0x3d')]){_0x2c6183[_0xd92f('0x3c')]=_[_0xd92f('0x3e')](_0x2c6183[_0xd92f('0x3c')],{'$or':_['map'](_0x2c6183[_0xd92f('0x36')],function(_0x511f56){var _0x533f86={};_0x533f86[_0x511f56]={'$like':'%'+_0x3c1aad['query']['filter']+'%'};return _0x533f86;})});}_0x2c6183=_[_0xd92f('0x3e')]({},_0x2c6183,_0x3c1aad[_0xd92f('0x40')]);return db[_0xd92f('0x65')][_0xd92f('0x1f')]({'where':_0x2c6183[_0xd92f('0x3c')]})[_0xd92f('0x26')](function(_0x1dcc4d){_0x288ad9['count']=_0x1dcc4d;if(_0x3c1aad['query']['includeAll']){_0x2c6183[_0xd92f('0x42')]=[{'all':!![]}];}return db[_0xd92f('0x65')][_0xd92f('0x60')](_0x2c6183);})[_0xd92f('0x26')](function(_0x54f33b){_0x288ad9[_0xd92f('0x43')]=_0x54f33b;return _0x288ad9;});}})['then'](respondWithFilteredResult(_0x80595a,_0x2c6183))['catch'](handleError(_0x80595a,null));};exports[_0xd92f('0x66')]=function(_0x2350aa,_0x43c167,_0x201c11){var _0x48c19a={};var _0x702421={};var _0x463303;var _0xb180e0;return db[_0xd92f('0x2d')][_0xd92f('0x5f')]({'where':{'id':_0x2350aa[_0xd92f('0x45')]['id']}})['then'](handleEntityNotFound(_0x43c167,null))[_0xd92f('0x26')](function(_0x2c20d3){if(_0x2c20d3){_0x463303=_0x2c20d3;_0x702421[_0xd92f('0x32')]=_[_0xd92f('0x33')](db[_0xd92f('0x67')][_0xd92f('0x2e')]);_0x702421[_0xd92f('0x34')]=_['keys'](_0x2350aa[_0xd92f('0x34')]);_0x702421[_0xd92f('0x35')]=_[_0xd92f('0x46')](_0x702421['model'],_0x702421['query']);_0x48c19a[_0xd92f('0x36')]=_[_0xd92f('0x46')](_0x702421[_0xd92f('0x32')],qs['fields'](_0x2350aa['query'][_0xd92f('0x37')]));_0x48c19a['attributes']=_0x48c19a[_0xd92f('0x36')][_0xd92f('0x38')]?_0x48c19a[_0xd92f('0x36')]:_0x702421[_0xd92f('0x32')];_0x48c19a[_0xd92f('0x3a')]=qs['sort'](_0x2350aa[_0xd92f('0x34')][_0xd92f('0x3b')]);_0x48c19a[_0xd92f('0x3c')]=qs[_0xd92f('0x35')](_[_0xd92f('0x64')](_0x2350aa[_0xd92f('0x34')],_0x702421[_0xd92f('0x35')]));if(_0x2350aa[_0xd92f('0x34')][_0xd92f('0x3d')]){_0x48c19a[_0xd92f('0x3c')]=_['merge'](_0x48c19a['where'],{'$or':_[_0xd92f('0x2c')](_0x48c19a['attributes'],function(_0x5f3d9f){var _0x45c8ca={};_0x45c8ca[_0x5f3d9f]={'$like':'%'+_0x2350aa[_0xd92f('0x34')][_0xd92f('0x3d')]+'%'};return _0x45c8ca;})});}_0x48c19a=_[_0xd92f('0x3e')]({},_0x48c19a,_0x2350aa['options']);return _0x463303['getLists'](_0x48c19a);}})[_0xd92f('0x26')](function(_0x3fc3b9){if(_0x3fc3b9){_0xb180e0=_0x3fc3b9[_0xd92f('0x38')];if(!_0x2350aa[_0xd92f('0x34')][_0xd92f('0x5c')](_0xd92f('0x39'))){_0x48c19a[_0xd92f('0x1e')]=qs[_0xd92f('0x1e')](_0x2350aa[_0xd92f('0x34')][_0xd92f('0x1e')]);_0x48c19a[_0xd92f('0x1c')]=qs[_0xd92f('0x1c')](_0x2350aa['query']['offset']);}return _0x463303[_0xd92f('0x66')](_0x48c19a);}})[_0xd92f('0x26')](function(_0x10e7b1){if(_0x10e7b1){return _0x10e7b1?{'count':_0xb180e0,'rows':_0x10e7b1}:null;}})[_0xd92f('0x26')](respondWithResult(_0x43c167,null))[_0xd92f('0x48')](handleError(_0x43c167,null));};exports[_0xd92f('0x68')]=function(_0x342015,_0x19f756,_0x157882){var _0x5c96e1,_0x59d92b;return db[_0xd92f('0x2d')]['find']({'where':{'id':_0x342015['params']['id']}})[_0xd92f('0x26')](handleEntityNotFound(_0x19f756,null))['then'](function(_0x1a27c5){if(_0x1a27c5){_0x59d92b=_0x1a27c5;return _0x1a27c5[_0xd92f('0x68')](_0x342015[_0xd92f('0x4a')]['ids'],_[_0xd92f('0x57')](_0x342015[_0xd92f('0x4a')],[_0xd92f('0x69'),'id'])||{});}return null;})[_0xd92f('0x6a')](function(_0xd3cf29){var _0x5acb44;_0x5c96e1=_0xd3cf29||[];var _0x3c6cae=[];if(_0xd3cf29){for(var _0x30b856=0x0;_0x30b856<_0xd3cf29[_0xd92f('0x38')];_0x30b856+=0x1){var _0x769214=_0xd3cf29[_0x30b856][_0xd92f('0x27')]({'plain':!![]});_0x59d92b[_0xd92f('0x6b')]=_0x342015[_0xd92f('0x4a')][_0xd92f('0x6b')]?_0x342015[_0xd92f('0x4a')][_0xd92f('0x6b')]:_0x59d92b[_0xd92f('0x6b')];switch(_0x59d92b[_0xd92f('0x6b')]){case _0xd92f('0x6c'):_0x5acb44=squel[_0xd92f('0x6d')]()[_0xd92f('0x6e')](_0xd92f('0x6f'))['fromQuery'](['phone','scheduledAt','ContactId',_0xd92f('0x70'),_0xd92f('0x5d'),_0xd92f('0x55'),_0xd92f('0x56')],squel[_0xd92f('0x71')]()[_0xd92f('0x72')](_0xd92f('0x73'),'phone')[_0xd92f('0x72')](_0xd92f('0x74'),_0xd92f('0x75'))[_0xd92f('0x72')]('id','ContactId')[_0xd92f('0x72')](_0x769214[_0xd92f('0x76')]['toString'](),_0xd92f('0x70'))[_0xd92f('0x72')](_0x342015[_0xd92f('0x45')]['id'][_0xd92f('0x77')](),_0xd92f('0x5d'))['field'](_0xd92f('0x74'),_0xd92f('0x55'))[_0xd92f('0x72')](_0xd92f('0x74'),_0xd92f('0x56'))['from'](_0xd92f('0x78'))['where'](_0xd92f('0x79'))[_0xd92f('0x3c')](_0xd92f('0x7a'),_0x769214[_0xd92f('0x76')][_0xd92f('0x77')]())[_0xd92f('0x3c')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xd92f('0x7b'),squel[_0xd92f('0x71')]()['field'](_0xd92f('0x7c'))[_0xd92f('0x7d')](_0xd92f('0x7e'))['where']('CampaignId\x20=\x20?',_0x342015[_0xd92f('0x45')]['id'][_0xd92f('0x77')]()))[_0xd92f('0x3c')](_0xd92f('0x7b'),squel[_0xd92f('0x71')]()[_0xd92f('0x72')](_0xd92f('0x7f'))[_0xd92f('0x7d')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x342015[_0xd92f('0x45')]['id'][_0xd92f('0x77')]())))[_0xd92f('0x77')]();break;case _0xd92f('0x80'):_0x5acb44=squel[_0xd92f('0x6d')]()[_0xd92f('0x6e')]('cm_hopper')[_0xd92f('0x81')]([_0xd92f('0x73'),_0xd92f('0x75'),_0xd92f('0x82'),_0xd92f('0x70'),'CampaignId',_0xd92f('0x55'),_0xd92f('0x56')],squel['select']()['field'](_0xd92f('0x73'),_0xd92f('0x73'))[_0xd92f('0x72')](_0xd92f('0x74'),_0xd92f('0x75'))['field']('id',_0xd92f('0x82'))[_0xd92f('0x72')](_0x769214[_0xd92f('0x76')]['toString'](),'ListId')[_0xd92f('0x72')](_0x342015[_0xd92f('0x45')]['id'][_0xd92f('0x77')](),_0xd92f('0x5d'))[_0xd92f('0x72')](_0xd92f('0x74'),_0xd92f('0x55'))[_0xd92f('0x72')]('NOW()','updatedAt')[_0xd92f('0x7d')](_0xd92f('0x78'))[_0xd92f('0x3c')](_0xd92f('0x79'))[_0xd92f('0x3c')](_0xd92f('0x7a'),_0x769214[_0xd92f('0x76')][_0xd92f('0x77')]())['where'](_0xd92f('0x83'))[_0xd92f('0x3c')](_0xd92f('0x7b'),squel[_0xd92f('0x71')]()[_0xd92f('0x72')](_0xd92f('0x7f'))[_0xd92f('0x7d')](_0xd92f('0x6f'))[_0xd92f('0x3c')](_0xd92f('0x84'),_0x342015['params']['id'][_0xd92f('0x77')]())))[_0xd92f('0x77')]();break;default:_0x5acb44=squel['insert']()[_0xd92f('0x6e')](_0xd92f('0x6f'))['fromQuery']([_0xd92f('0x73'),_0xd92f('0x75'),'ContactId',_0xd92f('0x70'),'CampaignId',_0xd92f('0x55'),_0xd92f('0x56')],squel['select']()[_0xd92f('0x72')](_0xd92f('0x73'),_0xd92f('0x73'))['field']('NOW()',_0xd92f('0x75'))[_0xd92f('0x72')]('id',_0xd92f('0x82'))[_0xd92f('0x72')](_0x769214[_0xd92f('0x76')][_0xd92f('0x77')](),_0xd92f('0x70'))[_0xd92f('0x72')](_0x342015[_0xd92f('0x45')]['id'][_0xd92f('0x77')](),_0xd92f('0x5d'))['field']('NOW()','createdAt')['field'](_0xd92f('0x74'),'updatedAt')[_0xd92f('0x7d')]('cm_contacts')['where'](_0xd92f('0x79'))[_0xd92f('0x3c')](_0xd92f('0x7a'),_0x769214[_0xd92f('0x76')][_0xd92f('0x77')]())[_0xd92f('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0xd92f('0x77')]();}_0x3c6cae[_0xd92f('0x85')](db[_0xd92f('0x86')][_0xd92f('0x34')](_0x5acb44));}return BPromise['all'](_0x3c6cae);}})[_0xd92f('0x26')](function(){return _0x5c96e1;})['then'](respondWithResult(_0x19f756,null))[_0xd92f('0x48')](handleError(_0x19f756,null));};exports[_0xd92f('0x87')]=function(_0x4230ed,_0x362f5d,_0x539258){return db['Campaign'][_0xd92f('0x47')]({'where':{'id':_0x4230ed[_0xd92f('0x45')]['id']}})[_0xd92f('0x26')](handleEntityNotFound(_0x362f5d,null))[_0xd92f('0x26')](function(_0x4514bc){if(_0x4514bc){return _0x4514bc[_0xd92f('0x87')](_0x4230ed['query'][_0xd92f('0x69')]);}})['then'](function(_0x34f34b){if(_0x34f34b){return db[_0xd92f('0x5b')]['destroy']({'where':{'ListId':_0x4230ed[_0xd92f('0x34')]['ids'],'CampaignId':_0x4230ed[_0xd92f('0x45')]['id']}})[_0xd92f('0x26')](function(){return _0x34f34b;});}})[_0xd92f('0x26')](respondWithStatusCode(_0x362f5d,null))[_0xd92f('0x48')](handleError(_0x362f5d,null));};exports[_0xd92f('0x88')]=function(_0x4e2357,_0x1f08e8,_0x43c40b){var _0x5b9c40={};var _0x2ff474={};var _0x201673;var _0xe0f392;return db[_0xd92f('0x2d')][_0xd92f('0x5f')]({'where':{'id':_0x4e2357[_0xd92f('0x45')]['id']}})['then'](handleEntityNotFound(_0x1f08e8,null))[_0xd92f('0x26')](function(_0x4e17b9){if(_0x4e17b9){_0x201673=_0x4e17b9;_0x2ff474['model']=_[_0xd92f('0x33')](db[_0xd92f('0x67')]['rawAttributes']);_0x2ff474[_0xd92f('0x34')]=_[_0xd92f('0x33')](_0x4e2357[_0xd92f('0x34')]);_0x2ff474[_0xd92f('0x35')]=_['intersection'](_0x2ff474[_0xd92f('0x32')],_0x2ff474[_0xd92f('0x34')]);_0x5b9c40[_0xd92f('0x36')]=_[_0xd92f('0x46')](_0x2ff474['model'],qs[_0xd92f('0x37')](_0x4e2357[_0xd92f('0x34')][_0xd92f('0x37')]));_0x5b9c40[_0xd92f('0x36')]=_0x5b9c40[_0xd92f('0x36')][_0xd92f('0x38')]?_0x5b9c40[_0xd92f('0x36')]:_0x2ff474[_0xd92f('0x32')];_0x5b9c40[_0xd92f('0x3a')]=qs[_0xd92f('0x3b')](_0x4e2357[_0xd92f('0x34')][_0xd92f('0x3b')]);_0x5b9c40[_0xd92f('0x3c')]=qs[_0xd92f('0x35')](_['pick'](_0x4e2357[_0xd92f('0x34')],_0x2ff474[_0xd92f('0x35')]));if(_0x4e2357[_0xd92f('0x34')][_0xd92f('0x3d')]){_0x5b9c40['where']=_[_0xd92f('0x3e')](_0x5b9c40[_0xd92f('0x3c')],{'$or':_[_0xd92f('0x2c')](_0x5b9c40[_0xd92f('0x36')],function(_0x1dd228){var _0x20f68d={};_0x20f68d[_0x1dd228]={'$like':'%'+_0x4e2357[_0xd92f('0x34')]['filter']+'%'};return _0x20f68d;})});}_0x5b9c40=_[_0xd92f('0x3e')]({},_0x5b9c40,_0x4e2357[_0xd92f('0x40')]);return _0x201673[_0xd92f('0x88')](_0x5b9c40);}})['then'](function(_0x4cc193){if(_0x4cc193){_0xe0f392=_0x4cc193[_0xd92f('0x38')];if(!_0x4e2357[_0xd92f('0x34')][_0xd92f('0x5c')](_0xd92f('0x39'))){_0x5b9c40[_0xd92f('0x1e')]=qs[_0xd92f('0x1e')](_0x4e2357[_0xd92f('0x34')][_0xd92f('0x1e')]);_0x5b9c40[_0xd92f('0x1c')]=qs['offset'](_0x4e2357[_0xd92f('0x34')]['offset']);}return _0x201673[_0xd92f('0x88')](_0x5b9c40);}})[_0xd92f('0x26')](function(_0x39cc86){if(_0x39cc86){return _0x39cc86?{'count':_0xe0f392,'rows':_0x39cc86}:null;}})['then'](respondWithResult(_0x1f08e8,null))[_0xd92f('0x48')](handleError(_0x1f08e8,null));};exports[_0xd92f('0x89')]=function(_0x2f119d,_0x333a5b,_0x358234){var _0x573b38,_0x152506;return db[_0xd92f('0x2d')][_0xd92f('0x47')]({'where':{'id':_0x2f119d['params']['id']}})['then'](handleEntityNotFound(_0x333a5b,null))['then'](function(_0x58de62){if(_0x58de62){_0x152506=_0x58de62;return _0x58de62[_0xd92f('0x89')](_0x2f119d[_0xd92f('0x4a')][_0xd92f('0x69')],_[_0xd92f('0x57')](_0x2f119d[_0xd92f('0x4a')],[_0xd92f('0x69'),'id'])||{});}return null;})[_0xd92f('0x6a')](function(_0x2a316a){var _0x5694d6;_0x573b38=_0x2a316a||[];var _0x11de7b=[];if(_0x2a316a){for(var _0x9e92f9=0x0;_0x9e92f9<_0x2a316a[_0xd92f('0x38')];_0x9e92f9+=0x1){var _0x9e228a=_0x2a316a[_0x9e92f9]['get']({'plain':!![]});_0x5694d6=squel[_0xd92f('0x6d')]()[_0xd92f('0x6e')]('cm_hopper_black')[_0xd92f('0x81')]([_0xd92f('0x73'),'ContactId',_0xd92f('0x70'),'CampaignId',_0xd92f('0x55'),'updatedAt'],squel[_0xd92f('0x71')]()[_0xd92f('0x72')](_0xd92f('0x73'),_0xd92f('0x73'))['field']('id',_0xd92f('0x82'))[_0xd92f('0x72')](_0x9e228a['CmListId'][_0xd92f('0x77')](),'ListId')[_0xd92f('0x72')](_0x2f119d[_0xd92f('0x45')]['id'][_0xd92f('0x77')](),'CampaignId')['field'](_0xd92f('0x74'),_0xd92f('0x55'))['field']('NOW()',_0xd92f('0x56'))['from']('cm_contacts')[_0xd92f('0x3c')](_0xd92f('0x79'))[_0xd92f('0x3c')](_0xd92f('0x7a'),_0x9e228a[_0xd92f('0x76')][_0xd92f('0x77')]())[_0xd92f('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0xd92f('0x77')]();_0x11de7b[_0xd92f('0x85')](db[_0xd92f('0x86')][_0xd92f('0x34')](_0x5694d6));}return BPromise['all'](_0x11de7b);}})[_0xd92f('0x26')](function(){return _0x573b38;})[_0xd92f('0x26')](respondWithResult(_0x333a5b,null))[_0xd92f('0x48')](handleError(_0x333a5b,null));};exports[_0xd92f('0x8a')]=function(_0x2d4f48,_0x6efb41,_0x3bc395){return db[_0xd92f('0x2d')]['find']({'where':{'id':_0x2d4f48[_0xd92f('0x45')]['id']}})[_0xd92f('0x26')](handleEntityNotFound(_0x6efb41,null))[_0xd92f('0x26')](function(_0x507c75){if(_0x507c75){return _0x507c75['removeBlackLists'](_0x2d4f48[_0xd92f('0x34')][_0xd92f('0x69')]);}})[_0xd92f('0x26')](function(_0xbc3a04){if(_0xbc3a04){return db[_0xd92f('0x65')][_0xd92f('0x59')]({'where':{'ListId':_0x2d4f48[_0xd92f('0x34')]['ids'],'CampaignId':_0x2d4f48[_0xd92f('0x45')]['id']}})['then'](function(){return _0xbc3a04;});}})[_0xd92f('0x26')](respondWithStatusCode(_0x6efb41,null))[_0xd92f('0x48')](handleError(_0x6efb41,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 119c4b6..26e74da 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(_0x25a18e,_0x22efae){var _0x31bd81=function(_0x24ed2f){while(--_0x24ed2f){_0x25a18e['push'](_0x25a18e['shift']());}};_0x31bd81(++_0x22efae);}(_0x7a54,0x106));var _0x47a5=function(_0x1aaa9f,_0x1abd55){_0x1aaa9f=_0x1aaa9f-0x0;var _0x5e8a4f=_0x7a54[_0x1aaa9f];return _0x5e8a4f;};'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(_0x2c4e32,_0x3a5590){var _0x1eac30=function(_0x236c8e){while(--_0x236c8e){_0x2c4e32['push'](_0x2c4e32['shift']());}};_0x1eac30(++_0x3a5590);}(_0x7a54,0x106));var _0x47a5=function(_0x351b19,_0x431911){_0x351b19=_0x351b19-0x0;var _0x22ce54=_0x7a54[_0x351b19];return _0x22ce54;};'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 f64accc..3f77e07 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 _0x777f=['../../config/environment','request','then','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','Campaign,\x20%s,\x20%s','message','info','result','catch','GetCampaign','findAll','options','include','map','attributes','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x5a5bff,_0x350844){var _0x2ffe98=function(_0x285d45){while(--_0x285d45){_0x5a5bff['push'](_0x5a5bff['shift']());}};_0x2ffe98(++_0x350844);}(_0x777f,0x9f));var _0xf777=function(_0x2f71f6,_0x3a1f4d){_0x2f71f6=_0x2f71f6-0x0;var _0x2b23ea=_0x777f[_0x2f71f6];return _0x2b23ea;};'use strict';var _=require(_0xf777('0x0'));var util=require(_0xf777('0x1'));var moment=require(_0xf777('0x2'));var BPromise=require(_0xf777('0x3'));var rs=require(_0xf777('0x4'));var fs=require('fs');var Redis=require(_0xf777('0x5'));var db=require(_0xf777('0x6'))['db'];var utils=require(_0xf777('0x7'));var logger=require('../../config/logger')(_0xf777('0x8'));var config=require(_0xf777('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa78a3,_0x6d105c,_0x3cbcaa){return new BPromise(function(_0x4582bd,_0x50a918){return client[_0xf777('0xa')](_0xa78a3,_0x3cbcaa)[_0xf777('0xb')](function(_0x1d4d64){logger['info']('Campaign,\x20%s,\x20%s',_0x6d105c,'request\x20sent');logger[_0xf777('0xc')](_0xf777('0xd'),_0x6d105c,'request\x20sent',JSON[_0xf777('0xe')](_0x1d4d64));if(_0x1d4d64[_0xf777('0xf')]){if(_0x1d4d64[_0xf777('0xf')]['code']===0x1f4){logger[_0xf777('0xf')](_0xf777('0x10'),_0x6d105c,_0x1d4d64[_0xf777('0xf')][_0xf777('0x11')]);return _0x50a918(_0x1d4d64[_0xf777('0xf')][_0xf777('0x11')]);}logger[_0xf777('0xf')]('Campaign,\x20%s,\x20%s',_0x6d105c,_0x1d4d64['error'][_0xf777('0x11')]);return _0x4582bd(_0x1d4d64['error'][_0xf777('0x11')]);}else{logger[_0xf777('0x12')](_0xf777('0x10'),_0x6d105c,'request\x20sent');_0x4582bd(_0x1d4d64[_0xf777('0x13')][_0xf777('0x11')]);}})[_0xf777('0x14')](function(_0x426a3a){logger[_0xf777('0xf')](_0xf777('0x10'),_0x6d105c,_0x426a3a);_0x50a918(_0x426a3a);});});}exports[_0xf777('0x15')]=function(_0x3e0ba3){var _0x36a88f=this;return new Promise(function(_0x126f72,_0xcd34fe){return db['Campaign'][_0xf777('0x16')]({'raw':_0x3e0ba3['options']?_0x3e0ba3[_0xf777('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3e0ba3[_0xf777('0x17')]?_0x3e0ba3['options']['where']||null:null,'attributes':_0x3e0ba3[_0xf777('0x17')]?_0x3e0ba3[_0xf777('0x17')]['attributes']||null:null,'limit':_0x3e0ba3[_0xf777('0x17')]?_0x3e0ba3[_0xf777('0x17')]['limit']||null:null,'include':_0x3e0ba3['options']?_0x3e0ba3['options'][_0xf777('0x18')]?_[_0xf777('0x19')](_0x3e0ba3['options']['include'],function(_0x43384d){return{'model':db[_0x43384d['model']],'as':_0x43384d['as'],'attributes':_0x43384d[_0xf777('0x1a')],'include':_0x43384d['include']?_[_0xf777('0x19')](_0x43384d['include'],function(_0x4fd176){return{'model':db[_0x4fd176[_0xf777('0x1b')]],'as':_0x4fd176['as'],'attributes':_0x4fd176['attributes'],'include':_0x4fd176[_0xf777('0x18')]?_['map'](_0x4fd176[_0xf777('0x18')],function(_0x1a1d74){return{'model':db[_0x1a1d74[_0xf777('0x1b')]],'as':_0x1a1d74['as'],'attributes':_0x1a1d74[_0xf777('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf777('0xb')](function(_0x232b3c){logger['info'](_0xf777('0x15'),_0x3e0ba3);logger[_0xf777('0xc')](_0xf777('0x15'),_0x3e0ba3,JSON['stringify'](_0x232b3c));_0x126f72(_0x232b3c);})['catch'](function(_0x451e21){logger['error'](_0xf777('0x15'),_0x451e21['message'],_0x3e0ba3);_0xcd34fe(_0x36a88f[_0xf777('0xf')](0x1f4,_0x451e21['message']));});});};
\ No newline at end of file
+var _0x149c=['Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','map','include','model','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3b2ffe,_0x10a462){var _0x2e9295=function(_0x274489){while(--_0x274489){_0x3b2ffe['push'](_0x3b2ffe['shift']());}};_0x2e9295(++_0x10a462);}(_0x149c,0x143));var _0xc149=function(_0x4fd3d3,_0xc1fc2a){_0x4fd3d3=_0x4fd3d3-0x0;var _0x5cab0e=_0x149c[_0x4fd3d3];return _0x5cab0e;};'use strict';var _=require(_0xc149('0x0'));var util=require('util');var moment=require(_0xc149('0x1'));var BPromise=require(_0xc149('0x2'));var rs=require(_0xc149('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc149('0x4'))['db'];var utils=require(_0xc149('0x5'));var logger=require(_0xc149('0x6'))(_0xc149('0x7'));var config=require(_0xc149('0x8'));var jayson=require(_0xc149('0x9'));var client=jayson[_0xc149('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x578cec,_0x351b75,_0x34710e){return new BPromise(function(_0x3a1739,_0x1d9eca){return client[_0xc149('0xb')](_0x578cec,_0x34710e)[_0xc149('0xc')](function(_0x25fb58){logger[_0xc149('0xd')](_0xc149('0xe'),_0x351b75,_0xc149('0xf'));logger[_0xc149('0x10')](_0xc149('0x11'),_0x351b75,_0xc149('0xf'),JSON[_0xc149('0x12')](_0x25fb58));if(_0x25fb58[_0xc149('0x13')]){if(_0x25fb58[_0xc149('0x13')][_0xc149('0x14')]===0x1f4){logger[_0xc149('0x13')]('Campaign,\x20%s,\x20%s',_0x351b75,_0x25fb58[_0xc149('0x13')]['message']);return _0x1d9eca(_0x25fb58[_0xc149('0x13')]['message']);}logger[_0xc149('0x13')](_0xc149('0xe'),_0x351b75,_0x25fb58['error']['message']);return _0x3a1739(_0x25fb58[_0xc149('0x13')][_0xc149('0x15')]);}else{logger[_0xc149('0xd')](_0xc149('0xe'),_0x351b75,_0xc149('0xf'));_0x3a1739(_0x25fb58[_0xc149('0x16')]['message']);}})[_0xc149('0x17')](function(_0x44dcb2){logger[_0xc149('0x13')](_0xc149('0xe'),_0x351b75,_0x44dcb2);_0x1d9eca(_0x44dcb2);});});}exports[_0xc149('0x18')]=function(_0x503124){var _0x2286f1=this;return new Promise(function(_0x32c339,_0x11ca5f){return db[_0xc149('0x19')][_0xc149('0x1a')]({'raw':_0x503124[_0xc149('0x1b')]?_0x503124['options'][_0xc149('0x1c')]===undefined?!![]:![]:!![],'where':_0x503124[_0xc149('0x1b')]?_0x503124['options']['where']||null:null,'attributes':_0x503124[_0xc149('0x1b')]?_0x503124[_0xc149('0x1b')][_0xc149('0x1d')]||null:null,'limit':_0x503124[_0xc149('0x1b')]?_0x503124[_0xc149('0x1b')][_0xc149('0x1e')]||null:null,'include':_0x503124[_0xc149('0x1b')]?_0x503124['options']['include']?_[_0xc149('0x1f')](_0x503124['options']['include'],function(_0xb4ea4f){return{'model':db[_0xb4ea4f['model']],'as':_0xb4ea4f['as'],'attributes':_0xb4ea4f[_0xc149('0x1d')],'include':_0xb4ea4f['include']?_[_0xc149('0x1f')](_0xb4ea4f[_0xc149('0x20')],function(_0x1e08e3){return{'model':db[_0x1e08e3[_0xc149('0x21')]],'as':_0x1e08e3['as'],'attributes':_0x1e08e3[_0xc149('0x1d')],'include':_0x1e08e3[_0xc149('0x20')]?_[_0xc149('0x1f')](_0x1e08e3['include'],function(_0x2d2700){return{'model':db[_0x2d2700['model']],'as':_0x2d2700['as'],'attributes':_0x2d2700[_0xc149('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc149('0xc')](function(_0x43e5e5){logger[_0xc149('0xd')](_0xc149('0x18'),_0x503124);logger[_0xc149('0x10')](_0xc149('0x18'),_0x503124,JSON[_0xc149('0x12')](_0x43e5e5));_0x32c339(_0x43e5e5);})[_0xc149('0x17')](function(_0x34ffd9){logger[_0xc149('0x13')]('GetCampaign',_0x34ffd9[_0xc149('0x15')],_0x503124);_0x11ca5f(_0x2286f1[_0xc149('0x13')](0x1f4,_0x34ffd9['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index b7bed35..7b064c2 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 _0x362d=['../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','get','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addLists','put','/:id','update','delete','destroy','removeBlackLists','exports','path','connect-timeout','express'];(function(_0x5a3162,_0x55e981){var _0x557ae0=function(_0x13a4d0){while(--_0x13a4d0){_0x5a3162['push'](_0x5a3162['shift']());}};_0x557ae0(++_0x55e981);}(_0x362d,0xbd));var _0xd362=function(_0x40d507,_0x3ddd3f){_0x40d507=_0x40d507-0x0;var _0x5028e8=_0x362d[_0x40d507];return _0x5028e8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd362('0x0'));var timeout=require(_0xd362('0x1'));var express=require(_0xd362('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd362('0x3'));var interaction=require(_0xd362('0x4'));var config=require('../../config/environment');var controller=require(_0xd362('0x5'));router['get']('/',auth[_0xd362('0x6')](),controller['index']);router[_0xd362('0x7')]('/:id',auth[_0xd362('0x6')](),controller[_0xd362('0x8')]);router[_0xd362('0x7')](_0xd362('0x9'),auth[_0xd362('0x6')](),controller[_0xd362('0xa')]);router['get'](_0xd362('0xb'),auth[_0xd362('0x6')](),controller[_0xd362('0xc')]);router['get'](_0xd362('0xd'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0xd362('0x7')](_0xd362('0xe'),auth[_0xd362('0x6')](),controller[_0xd362('0xf')]);router[_0xd362('0x7')](_0xd362('0x10'),auth[_0xd362('0x6')](),controller[_0xd362('0x11')]);router['get'](_0xd362('0x12'),auth[_0xd362('0x6')](),controller[_0xd362('0x13')]);router['post']('/',auth[_0xd362('0x6')](),controller[_0xd362('0x14')]);router[_0xd362('0x15')](_0xd362('0x16'),auth[_0xd362('0x6')](),controller[_0xd362('0x17')]);router['post'](_0xd362('0x10'),auth['isAuthenticated'](),controller[_0xd362('0x18')]);router[_0xd362('0x15')]('/:id/blacklists',auth[_0xd362('0x6')](),controller['addBlackLists']);router[_0xd362('0x19')](_0xd362('0x1a'),auth['isAuthenticated'](),controller[_0xd362('0x1b')]);router[_0xd362('0x1c')](_0xd362('0x1a'),auth[_0xd362('0x6')](),controller[_0xd362('0x1d')]);router[_0xd362('0x1c')](_0xd362('0x10'),auth[_0xd362('0x6')](),controller['removeLists']);router[_0xd362('0x1c')](_0xd362('0x12'),auth[_0xd362('0x6')](),controller[_0xd362('0x1e')]);module[_0xd362('0x1f')]=router;
\ No newline at end of file
+var _0x26e5=['removeLists','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','update','destroy','delete'];(function(_0x433ab5,_0x16e711){var _0x315911=function(_0x2d24a2){while(--_0x2d24a2){_0x433ab5['push'](_0x433ab5['shift']());}};_0x315911(++_0x16e711);}(_0x26e5,0x102));var _0x526e=function(_0x478c8a,_0x9afc92){_0x478c8a=_0x478c8a-0x0;var _0x3b6b3e=_0x26e5[_0x478c8a];return _0x3b6b3e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x526e('0x0'));var timeout=require(_0x526e('0x1'));var express=require(_0x526e('0x2'));var router=express['Router']();var fs_extra=require(_0x526e('0x3'));var auth=require(_0x526e('0x4'));var interaction=require(_0x526e('0x5'));var config=require(_0x526e('0x6'));var controller=require(_0x526e('0x7'));router[_0x526e('0x8')]('/',auth[_0x526e('0x9')](),controller['index']);router[_0x526e('0x8')](_0x526e('0xa'),auth[_0x526e('0x9')](),controller[_0x526e('0xb')]);router[_0x526e('0x8')](_0x526e('0xc'),auth[_0x526e('0x9')](),controller['getHoppers']);router['get'](_0x526e('0xd'),auth[_0x526e('0x9')](),controller[_0x526e('0xe')]);router[_0x526e('0x8')](_0x526e('0xf'),auth[_0x526e('0x9')](),controller[_0x526e('0x10')]);router[_0x526e('0x8')]('/:id/hopper_black',auth[_0x526e('0x9')](),controller[_0x526e('0x11')]);router[_0x526e('0x8')](_0x526e('0x12'),auth[_0x526e('0x9')](),controller['getLists']);router[_0x526e('0x8')]('/:id/blacklists',auth[_0x526e('0x9')](),controller[_0x526e('0x13')]);router[_0x526e('0x14')]('/',auth['isAuthenticated'](),controller[_0x526e('0x15')]);router[_0x526e('0x14')](_0x526e('0x16'),auth['isAuthenticated'](),controller[_0x526e('0x17')]);router[_0x526e('0x14')]('/:id/lists',auth[_0x526e('0x9')](),controller[_0x526e('0x18')]);router['post'](_0x526e('0x19'),auth[_0x526e('0x9')](),controller[_0x526e('0x1a')]);router['put']('/:id',auth[_0x526e('0x9')](),controller[_0x526e('0x1b')]);router['delete']('/:id',auth[_0x526e('0x9')](),controller[_0x526e('0x1c')]);router[_0x526e('0x1d')]('/:id/lists',auth[_0x526e('0x9')](),controller[_0x526e('0x1e')]);router[_0x526e('0x1d')](_0x526e('0x19'),auth[_0x526e('0x9')](),controller['removeBlackLists']);module[_0x526e('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index f28dd01..84ac913 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 _0xd4a1=['VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0xd4a1,0x11d));var _0x1d4a=function(_0x21d83a,_0x387685){_0x21d83a=_0x21d83a-0x0;var _0x3a4e39=_0xd4a1[_0x21d83a];return _0x3a4e39;};'use strict';var Sequelize=require(_0x1d4a('0x0'));module[_0x1d4a('0x1')]={'key':{'type':Sequelize[_0x1d4a('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x1d4a('0x2')]},'name':{'type':Sequelize[_0x1d4a('0x3')],'get':function(){return this[_0x1d4a('0x4')](_0x1d4a('0x5'));}}};
\ No newline at end of file
+var _0x9174=['sequelize','exports','TEXT','VIRTUAL','getDataValue','key'];(function(_0x365e74,_0x595298){var _0x505d5c=function(_0x24cf57){while(--_0x24cf57){_0x365e74['push'](_0x365e74['shift']());}};_0x505d5c(++_0x595298);}(_0x9174,0xba));var _0x4917=function(_0x142857,_0x18b628){_0x142857=_0x142857-0x0;var _0x422131=_0x9174[_0x142857];return _0x422131;};'use strict';var Sequelize=require(_0x4917('0x0'));module[_0x4917('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x4917('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x4917('0x3')],'get':function(){return this[_0x4917('0x4')](_0x4917('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 7d56004..72051d2 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 _0x3a81=['stack','name','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','merge','filter','findAll','catch','show','params','includeAll','include','options','find','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','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','offset','limit','undefined','count','Content-Range','reject','save','update','then','CannedAnswers','UserProfileResource'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0x3a81,0x1c6));var _0x13a8=function(_0x388da2,_0x571cad){_0x388da2=_0x388da2-0x0;var _0x2b1a45=_0x3a81[_0x388da2];return _0x2b1a45;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x13a8('0x0'));var zipdir=require(_0x13a8('0x1'));var jsonpatch=require(_0x13a8('0x2'));var rp=require(_0x13a8('0x3'));var moment=require('moment');var BPromise=require(_0x13a8('0x4'));var Mustache=require(_0x13a8('0x5'));var util=require(_0x13a8('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x13a8('0x7'));var ejs=require(_0x13a8('0x8'));var fs=require('fs');var fs_extra=require(_0x13a8('0x9'));var _=require('lodash');var squel=require(_0x13a8('0xa'));var crypto=require(_0x13a8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x13a8('0xc'));var toCsv=require(_0x13a8('0x7'));var querystring=require(_0x13a8('0xd'));var Papa=require(_0x13a8('0xe'));var Redis=require(_0x13a8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x13a8('0x10'));var as=require(_0x13a8('0x11'));var hardwareService=require(_0x13a8('0x12'));var logger=require(_0x13a8('0x13'))('api');var utils=require(_0x13a8('0x14'));var config=require(_0x13a8('0x15'));var licenseUtil=require(_0x13a8('0x16'));var db=require(_0x13a8('0x17'))['db'];function respondWithStatusCode(_0x23fab7,_0x4f2fcf){_0x4f2fcf=_0x4f2fcf||0xcc;return function(_0x586da0){if(_0x586da0){return _0x23fab7[_0x13a8('0x18')](_0x4f2fcf);}return _0x23fab7[_0x13a8('0x19')](_0x4f2fcf)[_0x13a8('0x1a')]();};}function respondWithResult(_0x4e9f2a,_0x3af602){_0x3af602=_0x3af602||0xc8;return function(_0x86dfe3){if(_0x86dfe3){return _0x4e9f2a['status'](_0x3af602)['json'](_0x86dfe3);}};}function respondWithFilteredResult(_0x381750,_0x249952){return function(_0x1b179d){if(_0x1b179d){var _0xe0f4d4=typeof _0x249952[_0x13a8('0x1b')]==='undefined'&&typeof _0x249952[_0x13a8('0x1c')]===_0x13a8('0x1d');var _0x5e19ae=_0x1b179d[_0x13a8('0x1e')];var _0x5b088c=_0xe0f4d4?0x0:_0x249952[_0x13a8('0x1b')];var _0x510dd1=_0xe0f4d4?_0x1b179d['count']:_0x249952[_0x13a8('0x1b')]+_0x249952[_0x13a8('0x1c')];var _0x13941c;if(_0x510dd1>=_0x5e19ae){_0x510dd1=_0x5e19ae;_0x13941c=0xc8;}else{_0x13941c=0xce;}_0x381750[_0x13a8('0x19')](_0x13941c);return _0x381750['set'](_0x13a8('0x1f'),_0x5b088c+'-'+_0x510dd1+'/'+_0x5e19ae)['json'](_0x1b179d);}return null;};}function patchUpdates(_0x554973){return function(_0x3fa563){try{jsonpatch['apply'](_0x3fa563,_0x554973,!![]);}catch(_0x33aa56){return BPromise[_0x13a8('0x20')](_0x33aa56);}return _0x3fa563[_0x13a8('0x21')]();};}function saveUpdates(_0x27afcc,_0x28ad3f){return function(_0x1b8949){if(_0x1b8949){return _0x1b8949[_0x13a8('0x22')](_0x27afcc)[_0x13a8('0x23')](function(_0x5f21b3){return _0x5f21b3;});}return null;};}function removeEntity(_0x179778,_0x5320de){return function(_0x402da1){if(_0x402da1){return _0x402da1['destroy']()[_0x13a8('0x23')](function(){var _0x4f0d26=_0x402da1['get']({'plain':!![]});var _0x28907e=_0x13a8('0x24');return db[_0x13a8('0x25')]['destroy']({'where':{'type':_0x28907e,'resourceId':_0x4f0d26['id']}})[_0x13a8('0x23')](function(){return _0x402da1;});})[_0x13a8('0x23')](function(){_0x179778[_0x13a8('0x19')](0xcc)[_0x13a8('0x1a')]();});}};}function handleEntityNotFound(_0x534581,_0x4f881d){return function(_0x361b20){if(!_0x361b20){_0x534581['sendStatus'](0x194);}return _0x361b20;};}function handleError(_0x103ad9,_0x5c6ae2){_0x5c6ae2=_0x5c6ae2||0x1f4;return function(_0x556aa8){logger['error'](_0x556aa8[_0x13a8('0x26')]);if(_0x556aa8[_0x13a8('0x27')]){delete _0x556aa8[_0x13a8('0x27')];}_0x103ad9['status'](_0x5c6ae2)['send'](_0x556aa8);};}exports[_0x13a8('0x28')]=function(_0x4c7808,_0x598b23){var _0x3149c6={},_0x1206b8={},_0x2a210c={'count':0x0,'rows':[]};var _0x2d8ad9=_['map'](db[_0x13a8('0x29')][_0x13a8('0x2a')],function(_0x595aad){return{'name':_0x595aad[_0x13a8('0x2b')],'type':_0x595aad[_0x13a8('0x2c')][_0x13a8('0x2d')]};});_0x1206b8[_0x13a8('0x2e')]=_[_0x13a8('0x2f')](_0x2d8ad9,_0x13a8('0x27'));_0x1206b8[_0x13a8('0x30')]=_[_0x13a8('0x31')](_0x4c7808[_0x13a8('0x30')]);_0x1206b8[_0x13a8('0x32')]=_[_0x13a8('0x33')](_0x1206b8['model'],_0x1206b8['query']);_0x3149c6[_0x13a8('0x34')]=_[_0x13a8('0x33')](_0x1206b8[_0x13a8('0x2e')],qs[_0x13a8('0x35')](_0x4c7808[_0x13a8('0x30')]['fields']));_0x3149c6[_0x13a8('0x34')]=_0x3149c6[_0x13a8('0x34')]['length']?_0x3149c6['attributes']:_0x1206b8[_0x13a8('0x2e')];if(!_0x4c7808[_0x13a8('0x30')][_0x13a8('0x36')]('nolimit')){_0x3149c6['limit']=qs[_0x13a8('0x1c')](_0x4c7808[_0x13a8('0x30')][_0x13a8('0x1c')]);_0x3149c6[_0x13a8('0x1b')]=qs[_0x13a8('0x1b')](_0x4c7808[_0x13a8('0x30')]['offset']);}_0x3149c6['order']=qs[_0x13a8('0x37')](_0x4c7808['query'][_0x13a8('0x37')]);_0x3149c6[_0x13a8('0x38')]=qs[_0x13a8('0x32')](_['pick'](_0x4c7808[_0x13a8('0x30')],_0x1206b8[_0x13a8('0x32')]),_0x2d8ad9);if(_0x4c7808[_0x13a8('0x30')]['filter']){_0x3149c6[_0x13a8('0x38')]=_[_0x13a8('0x39')](_0x3149c6[_0x13a8('0x38')],{'$or':[{'key':{'$like':'%'+_0x4c7808[_0x13a8('0x30')][_0x13a8('0x3a')]+'%'}},{'value':{'$like':'%'+_0x4c7808[_0x13a8('0x30')][_0x13a8('0x3a')]+'%'}}]});}_0x3149c6=_['merge']({},_0x3149c6,_0x4c7808['options']);var _0x55368d={'where':_0x3149c6[_0x13a8('0x38')]};return db[_0x13a8('0x29')]['count'](_0x55368d)[_0x13a8('0x23')](function(_0x58bc19){_0x2a210c[_0x13a8('0x1e')]=_0x58bc19;if(_0x4c7808[_0x13a8('0x30')]['includeAll']){_0x3149c6['include']=[{'all':!![]}];}return db[_0x13a8('0x29')][_0x13a8('0x3b')](_0x3149c6);})['then'](function(_0x49cdcd){_0x2a210c['rows']=_0x49cdcd;return _0x2a210c;})['then'](respondWithFilteredResult(_0x598b23,_0x3149c6))[_0x13a8('0x3c')](handleError(_0x598b23,null));};exports[_0x13a8('0x3d')]=function(_0x3234c8,_0x27eeca){var _0x538f14={'raw':!![],'where':{'id':_0x3234c8[_0x13a8('0x3e')]['id']}},_0x3dbc94={};_0x3dbc94[_0x13a8('0x2e')]=_[_0x13a8('0x31')](db[_0x13a8('0x29')][_0x13a8('0x2a')]);_0x3dbc94[_0x13a8('0x30')]=_['keys'](_0x3234c8[_0x13a8('0x30')]);_0x3dbc94[_0x13a8('0x32')]=_[_0x13a8('0x33')](_0x3dbc94['model'],_0x3dbc94[_0x13a8('0x30')]);_0x538f14[_0x13a8('0x34')]=_[_0x13a8('0x33')](_0x3dbc94[_0x13a8('0x2e')],qs[_0x13a8('0x35')](_0x3234c8[_0x13a8('0x30')][_0x13a8('0x35')]));_0x538f14[_0x13a8('0x34')]=_0x538f14[_0x13a8('0x34')]['length']?_0x538f14[_0x13a8('0x34')]:_0x3dbc94['model'];if(_0x3234c8[_0x13a8('0x30')][_0x13a8('0x3f')]){_0x538f14[_0x13a8('0x40')]=[{'all':!![]}];}_0x538f14=_[_0x13a8('0x39')]({},_0x538f14,_0x3234c8[_0x13a8('0x41')]);return db[_0x13a8('0x29')][_0x13a8('0x42')](_0x538f14)[_0x13a8('0x23')](handleEntityNotFound(_0x27eeca,null))[_0x13a8('0x23')](respondWithResult(_0x27eeca,null))[_0x13a8('0x3c')](handleError(_0x27eeca,null));};exports[_0x13a8('0x22')]=function(_0x2e7bb3,_0x1eaa10){if(_0x2e7bb3[_0x13a8('0x43')]['id']){delete _0x2e7bb3['body']['id'];}return db[_0x13a8('0x29')][_0x13a8('0x42')]({'where':{'id':_0x2e7bb3[_0x13a8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1eaa10,null))[_0x13a8('0x23')](saveUpdates(_0x2e7bb3[_0x13a8('0x43')],null))['then'](respondWithResult(_0x1eaa10,null))[_0x13a8('0x3c')](handleError(_0x1eaa10,null));};exports[_0x13a8('0x44')]=function(_0x412cd4,_0x147254){return db[_0x13a8('0x29')][_0x13a8('0x42')]({'where':{'id':_0x412cd4[_0x13a8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x147254,null))[_0x13a8('0x23')](removeEntity(_0x147254,null))[_0x13a8('0x3c')](handleError(_0x147254,null));};exports[_0x13a8('0x45')]=function(_0x3f4428,_0x1411cb){var _0x52f34f={'key':_0x3f4428[_0x13a8('0x43')][_0x13a8('0x2d')]};if(_0x3f4428['body'][_0x13a8('0x46')]){_0x52f34f[_0x13a8('0x46')]=_0x3f4428[_0x13a8('0x43')][_0x13a8('0x46')];}else if(_0x3f4428['body'][_0x13a8('0x47')]){_0x52f34f[_0x13a8('0x47')]=_0x3f4428[_0x13a8('0x43')][_0x13a8('0x47')];}else if(_0x3f4428[_0x13a8('0x43')]['OpenchannelAccountId']){_0x52f34f[_0x13a8('0x48')]=_0x3f4428[_0x13a8('0x43')]['OpenchannelAccountId'];}else if(_0x3f4428[_0x13a8('0x43')]['ChatWebsiteId']){_0x52f34f[_0x13a8('0x49')]=_0x3f4428[_0x13a8('0x43')][_0x13a8('0x49')];}return db[_0x13a8('0x29')][_0x13a8('0x42')]({'where':_0x52f34f})[_0x13a8('0x23')](function(_0x5a2630){if(_0x5a2630){throw new db['Sequelize'][(_0x13a8('0x4a'))](_0x13a8('0x4b'));}return db['CannedAnswer']['create'](_0x3f4428['body']);})[_0x13a8('0x23')](function(_0x42cba3){var _0x848419=_0x3f4428[_0x13a8('0x4c')][_0x13a8('0x4d')]({'plain':!![]});if(!_0x848419)throw new Error(_0x13a8('0x4e'));if(_0x848419['role']===_0x13a8('0x4c')){var _0x423d6b=_0x42cba3['get']({'plain':!![]});return db['UserProfileSection'][_0x13a8('0x42')]({'where':{'name':_0x13a8('0x24'),'userProfileId':_0x848419[_0x13a8('0x4f')]},'raw':!![]})[_0x13a8('0x23')](function(_0x283733){if(_0x283733&&_0x283733[_0x13a8('0x50')]===0x0){return db[_0x13a8('0x25')]['create']({'name':_0x423d6b[_0x13a8('0x27')],'resourceId':_0x423d6b['id'],'type':_0x283733[_0x13a8('0x27')],'sectionId':_0x283733['id']},{})['then'](function(){return _0x42cba3;});}else{return _0x42cba3;}})[_0x13a8('0x3c')](function(_0x3cd117){logger['error'](_0x13a8('0x51'),_0x3cd117);throw _0x3cd117;});}return _0x42cba3;})['then'](respondWithResult(_0x1411cb,0xc9))[_0x13a8('0x3c')](handleError(_0x1411cb,null));};
\ No newline at end of file
+var _0x0e2a=['send','index','map','CannedAnswer','rawAttributes','fieldName','key','model','keys','filters','attributes','intersection','fields','query','length','order','sort','where','filter','merge','options','findAll','catch','params','includeAll','include','find','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','get','UserProfileResource','error','stack','name'];(function(_0x25b3ad,_0x27d0e3){var _0x2c58b3=function(_0x21dee9){while(--_0x21dee9){_0x25b3ad['push'](_0x25b3ad['shift']());}};_0x2c58b3(++_0x27d0e3);}(_0x0e2a,0xd9));var _0xa0e2=function(_0x1304c6,_0x6bb485){_0x1304c6=_0x1304c6-0x0;var _0x2e6654=_0x0e2a[_0x1304c6];return _0x2e6654;};'use strict';var emlformat=require(_0xa0e2('0x0'));var rimraf=require(_0xa0e2('0x1'));var zipdir=require(_0xa0e2('0x2'));var jsonpatch=require(_0xa0e2('0x3'));var rp=require(_0xa0e2('0x4'));var moment=require(_0xa0e2('0x5'));var BPromise=require(_0xa0e2('0x6'));var Mustache=require(_0xa0e2('0x7'));var util=require(_0xa0e2('0x8'));var path=require(_0xa0e2('0x9'));var sox=require(_0xa0e2('0xa'));var csv=require(_0xa0e2('0xb'));var ejs=require(_0xa0e2('0xc'));var fs=require('fs');var fs_extra=require(_0xa0e2('0xd'));var _=require(_0xa0e2('0xe'));var squel=require(_0xa0e2('0xf'));var crypto=require(_0xa0e2('0x10'));var jsforce=require(_0xa0e2('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xa0e2('0xb'));var querystring=require(_0xa0e2('0x12'));var Papa=require('papaparse');var Redis=require(_0xa0e2('0x13'));var authService=require(_0xa0e2('0x14'));var qs=require(_0xa0e2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa0e2('0x16'));var logger=require(_0xa0e2('0x17'))('api');var utils=require(_0xa0e2('0x18'));var config=require(_0xa0e2('0x19'));var licenseUtil=require(_0xa0e2('0x1a'));var db=require(_0xa0e2('0x1b'))['db'];function respondWithStatusCode(_0x42352d,_0x55bfdd){_0x55bfdd=_0x55bfdd||0xcc;return function(_0x4f54d4){if(_0x4f54d4){return _0x42352d[_0xa0e2('0x1c')](_0x55bfdd);}return _0x42352d[_0xa0e2('0x1d')](_0x55bfdd)[_0xa0e2('0x1e')]();};}function respondWithResult(_0x2e1c7f,_0x1eb6a8){_0x1eb6a8=_0x1eb6a8||0xc8;return function(_0x4dcad0){if(_0x4dcad0){return _0x2e1c7f[_0xa0e2('0x1d')](_0x1eb6a8)[_0xa0e2('0x1f')](_0x4dcad0);}};}function respondWithFilteredResult(_0x53674a,_0x30b180){return function(_0x187dc9){if(_0x187dc9){var _0x4c2e3c=typeof _0x30b180['offset']===_0xa0e2('0x20')&&typeof _0x30b180[_0xa0e2('0x21')]===_0xa0e2('0x20');var _0x53150f=_0x187dc9[_0xa0e2('0x22')];var _0x7f0b3=_0x4c2e3c?0x0:_0x30b180[_0xa0e2('0x23')];var _0x2c26b7=_0x4c2e3c?_0x187dc9[_0xa0e2('0x22')]:_0x30b180[_0xa0e2('0x23')]+_0x30b180[_0xa0e2('0x21')];var _0x18b95;if(_0x2c26b7>=_0x53150f){_0x2c26b7=_0x53150f;_0x18b95=0xc8;}else{_0x18b95=0xce;}_0x53674a[_0xa0e2('0x1d')](_0x18b95);return _0x53674a[_0xa0e2('0x24')](_0xa0e2('0x25'),_0x7f0b3+'-'+_0x2c26b7+'/'+_0x53150f)[_0xa0e2('0x1f')](_0x187dc9);}return null;};}function patchUpdates(_0x23a6a3){return function(_0x41e933){try{jsonpatch['apply'](_0x41e933,_0x23a6a3,!![]);}catch(_0x332771){return BPromise[_0xa0e2('0x26')](_0x332771);}return _0x41e933[_0xa0e2('0x27')]();};}function saveUpdates(_0x557153,_0x325c05){return function(_0x55f9f2){if(_0x55f9f2){return _0x55f9f2[_0xa0e2('0x28')](_0x557153)['then'](function(_0x5c4ad8){return _0x5c4ad8;});}return null;};}function removeEntity(_0x17effd,_0x24aa9a){return function(_0x7dcea1){if(_0x7dcea1){return _0x7dcea1['destroy']()[_0xa0e2('0x29')](function(){var _0x255fc9=_0x7dcea1[_0xa0e2('0x2a')]({'plain':!![]});var _0x559b77='CannedAnswers';return db[_0xa0e2('0x2b')]['destroy']({'where':{'type':_0x559b77,'resourceId':_0x255fc9['id']}})['then'](function(){return _0x7dcea1;});})['then'](function(){_0x17effd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bfe1a,_0x3d6197){return function(_0x425943){if(!_0x425943){_0x4bfe1a[_0xa0e2('0x1c')](0x194);}return _0x425943;};}function handleError(_0x3afba0,_0x254a99){_0x254a99=_0x254a99||0x1f4;return function(_0x407fda){logger[_0xa0e2('0x2c')](_0x407fda[_0xa0e2('0x2d')]);if(_0x407fda[_0xa0e2('0x2e')]){delete _0x407fda['name'];}_0x3afba0[_0xa0e2('0x1d')](_0x254a99)[_0xa0e2('0x2f')](_0x407fda);};}exports[_0xa0e2('0x30')]=function(_0x2497dc,_0x4d2714){var _0x2cf19d={},_0x404522={},_0x172030={'count':0x0,'rows':[]};var _0x2dcd5f=_[_0xa0e2('0x31')](db[_0xa0e2('0x32')][_0xa0e2('0x33')],function(_0x3cb1c1){return{'name':_0x3cb1c1[_0xa0e2('0x34')],'type':_0x3cb1c1['type'][_0xa0e2('0x35')]};});_0x404522[_0xa0e2('0x36')]=_[_0xa0e2('0x31')](_0x2dcd5f,_0xa0e2('0x2e'));_0x404522['query']=_[_0xa0e2('0x37')](_0x2497dc['query']);_0x404522[_0xa0e2('0x38')]=_['intersection'](_0x404522[_0xa0e2('0x36')],_0x404522['query']);_0x2cf19d[_0xa0e2('0x39')]=_[_0xa0e2('0x3a')](_0x404522[_0xa0e2('0x36')],qs[_0xa0e2('0x3b')](_0x2497dc[_0xa0e2('0x3c')][_0xa0e2('0x3b')]));_0x2cf19d[_0xa0e2('0x39')]=_0x2cf19d[_0xa0e2('0x39')][_0xa0e2('0x3d')]?_0x2cf19d[_0xa0e2('0x39')]:_0x404522[_0xa0e2('0x36')];if(!_0x2497dc['query']['hasOwnProperty']('nolimit')){_0x2cf19d[_0xa0e2('0x21')]=qs[_0xa0e2('0x21')](_0x2497dc[_0xa0e2('0x3c')]['limit']);_0x2cf19d[_0xa0e2('0x23')]=qs[_0xa0e2('0x23')](_0x2497dc['query']['offset']);}_0x2cf19d[_0xa0e2('0x3e')]=qs['sort'](_0x2497dc[_0xa0e2('0x3c')][_0xa0e2('0x3f')]);_0x2cf19d[_0xa0e2('0x40')]=qs[_0xa0e2('0x38')](_['pick'](_0x2497dc[_0xa0e2('0x3c')],_0x404522[_0xa0e2('0x38')]),_0x2dcd5f);if(_0x2497dc[_0xa0e2('0x3c')]['filter']){_0x2cf19d['where']=_['merge'](_0x2cf19d[_0xa0e2('0x40')],{'$or':[{'key':{'$like':'%'+_0x2497dc[_0xa0e2('0x3c')][_0xa0e2('0x41')]+'%'}},{'value':{'$like':'%'+_0x2497dc[_0xa0e2('0x3c')][_0xa0e2('0x41')]+'%'}}]});}_0x2cf19d=_[_0xa0e2('0x42')]({},_0x2cf19d,_0x2497dc[_0xa0e2('0x43')]);var _0x4547fd={'where':_0x2cf19d['where']};return db[_0xa0e2('0x32')][_0xa0e2('0x22')](_0x4547fd)[_0xa0e2('0x29')](function(_0xea3fc8){_0x172030[_0xa0e2('0x22')]=_0xea3fc8;if(_0x2497dc[_0xa0e2('0x3c')]['includeAll']){_0x2cf19d['include']=[{'all':!![]}];}return db[_0xa0e2('0x32')][_0xa0e2('0x44')](_0x2cf19d);})[_0xa0e2('0x29')](function(_0x58356e){_0x172030['rows']=_0x58356e;return _0x172030;})['then'](respondWithFilteredResult(_0x4d2714,_0x2cf19d))[_0xa0e2('0x45')](handleError(_0x4d2714,null));};exports['show']=function(_0x120183,_0x49e6ef){var _0x4c21dd={'raw':!![],'where':{'id':_0x120183[_0xa0e2('0x46')]['id']}},_0x27fc9a={};_0x27fc9a[_0xa0e2('0x36')]=_[_0xa0e2('0x37')](db['CannedAnswer'][_0xa0e2('0x33')]);_0x27fc9a[_0xa0e2('0x3c')]=_['keys'](_0x120183[_0xa0e2('0x3c')]);_0x27fc9a[_0xa0e2('0x38')]=_[_0xa0e2('0x3a')](_0x27fc9a[_0xa0e2('0x36')],_0x27fc9a[_0xa0e2('0x3c')]);_0x4c21dd['attributes']=_['intersection'](_0x27fc9a[_0xa0e2('0x36')],qs[_0xa0e2('0x3b')](_0x120183[_0xa0e2('0x3c')][_0xa0e2('0x3b')]));_0x4c21dd[_0xa0e2('0x39')]=_0x4c21dd[_0xa0e2('0x39')][_0xa0e2('0x3d')]?_0x4c21dd['attributes']:_0x27fc9a[_0xa0e2('0x36')];if(_0x120183['query'][_0xa0e2('0x47')]){_0x4c21dd[_0xa0e2('0x48')]=[{'all':!![]}];}_0x4c21dd=_[_0xa0e2('0x42')]({},_0x4c21dd,_0x120183[_0xa0e2('0x43')]);return db['CannedAnswer'][_0xa0e2('0x49')](_0x4c21dd)[_0xa0e2('0x29')](handleEntityNotFound(_0x49e6ef,null))[_0xa0e2('0x29')](respondWithResult(_0x49e6ef,null))['catch'](handleError(_0x49e6ef,null));};exports['update']=function(_0x49c402,_0x272b24){if(_0x49c402['body']['id']){delete _0x49c402[_0xa0e2('0x4a')]['id'];}return db[_0xa0e2('0x32')][_0xa0e2('0x49')]({'where':{'id':_0x49c402[_0xa0e2('0x46')]['id']}})[_0xa0e2('0x29')](handleEntityNotFound(_0x272b24,null))[_0xa0e2('0x29')](saveUpdates(_0x49c402['body'],null))['then'](respondWithResult(_0x272b24,null))['catch'](handleError(_0x272b24,null));};exports[_0xa0e2('0x4b')]=function(_0x271c64,_0x48fd13){return db[_0xa0e2('0x32')][_0xa0e2('0x49')]({'where':{'id':_0x271c64['params']['id']}})['then'](handleEntityNotFound(_0x48fd13,null))[_0xa0e2('0x29')](removeEntity(_0x48fd13,null))['catch'](handleError(_0x48fd13,null));};exports[_0xa0e2('0x4c')]=function(_0x4f008e,_0x5780d1){var _0x4b4ef5={'key':_0x4f008e['body'][_0xa0e2('0x35')]};if(_0x4f008e[_0xa0e2('0x4a')][_0xa0e2('0x4d')]){_0x4b4ef5['MailAccountId']=_0x4f008e[_0xa0e2('0x4a')][_0xa0e2('0x4d')];}else if(_0x4f008e['body'][_0xa0e2('0x4e')]){_0x4b4ef5[_0xa0e2('0x4e')]=_0x4f008e[_0xa0e2('0x4a')][_0xa0e2('0x4e')];}else if(_0x4f008e[_0xa0e2('0x4a')][_0xa0e2('0x4f')]){_0x4b4ef5['OpenchannelAccountId']=_0x4f008e[_0xa0e2('0x4a')][_0xa0e2('0x4f')];}else if(_0x4f008e[_0xa0e2('0x4a')]['ChatWebsiteId']){_0x4b4ef5['ChatWebsiteId']=_0x4f008e[_0xa0e2('0x4a')][_0xa0e2('0x50')];}return db[_0xa0e2('0x32')][_0xa0e2('0x49')]({'where':_0x4b4ef5})[_0xa0e2('0x29')](function(_0x410430){if(_0x410430){throw new db['Sequelize']['ValidationError'](_0xa0e2('0x51'));}return db[_0xa0e2('0x32')]['create'](_0x4f008e[_0xa0e2('0x4a')]);})[_0xa0e2('0x29')](function(_0x486fa5){var _0x2f8977=_0x4f008e[_0xa0e2('0x52')][_0xa0e2('0x2a')]({'plain':!![]});if(!_0x2f8977)throw new Error(_0xa0e2('0x53'));if(_0x2f8977[_0xa0e2('0x54')]===_0xa0e2('0x52')){var _0x416365=_0x486fa5[_0xa0e2('0x2a')]({'plain':!![]});return db[_0xa0e2('0x55')][_0xa0e2('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x2f8977[_0xa0e2('0x56')]},'raw':!![]})[_0xa0e2('0x29')](function(_0x5b726c){if(_0x5b726c&&_0x5b726c['autoAssociation']===0x0){return db[_0xa0e2('0x2b')]['create']({'name':_0x416365['name'],'resourceId':_0x416365['id'],'type':_0x5b726c[_0xa0e2('0x2e')],'sectionId':_0x5b726c['id']},{})[_0xa0e2('0x29')](function(){return _0x486fa5;});}else{return _0x486fa5;}})[_0xa0e2('0x45')](function(_0x1086de){logger[_0xa0e2('0x2c')](_0xa0e2('0x57'),_0x1086de);throw _0x1086de;});}return _0x486fa5;})['then'](respondWithResult(_0x5780d1,0xc9))[_0xa0e2('0x45')](handleError(_0x5780d1,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 0e95fc9..2d9c55c 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 _0xb76d=['../../config/environment','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','path','rimraf'];(function(_0x558e45,_0x4f5e4f){var _0x3e9075=function(_0x289725){while(--_0x289725){_0x558e45['push'](_0x558e45['shift']());}};_0x3e9075(++_0x4f5e4f);}(_0xb76d,0x19f));var _0xdb76=function(_0x3e319e,_0x40be91){_0x3e319e=_0x3e319e-0x0;var _0x1a80be=_0xb76d[_0x3e319e];return _0x1a80be;};'use strict';var _=require(_0xdb76('0x0'));var util=require(_0xdb76('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdb76('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb76('0x3'));var rimraf=require(_0xdb76('0x4'));var config=require(_0xdb76('0x5'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x3ab524,_0x2c516d){return _0x3ab524[_0xdb76('0x6')]('CannedAnswer',attributes,{'tableName':_0xdb76('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb76('0x8'),'collate':_0xdb76('0x9')});};
\ No newline at end of file
+var _0xf151=['CannedAnswer','tools_canned_answers','utf8mb4','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf151,0xab));var _0x1f15=function(_0x273a0d,_0x45885f){_0x273a0d=_0x273a0d-0x0;var _0x2ebc5d=_0xf151[_0x273a0d];return _0x2ebc5d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f15('0x0'))(_0x1f15('0x1'));var moment=require(_0x1f15('0x2'));var BPromise=require(_0x1f15('0x3'));var rp=require(_0x1f15('0x4'));var fs=require('fs');var path=require(_0x1f15('0x5'));var rimraf=require(_0x1f15('0x6'));var config=require(_0x1f15('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x1f15('0x8')]=function(_0x5548bb,_0x4cfc7b){return _0x5548bb['define'](_0x1f15('0x9'),attributes,{'tableName':_0x1f15('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1f15('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index b62ecec..1c6f6bd 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(_0x330298,_0x2392c9){var _0x763a55=function(_0x2a0f33){while(--_0x2a0f33){_0x330298['push'](_0x330298['shift']());}};_0x763a55(++_0x2392c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x406f90,_0x1481d4){var _0x5b6871=function(_0x103e25){while(--_0x103e25){_0x406f90['push'](_0x406f90['shift']());}};_0x5b6871(++_0x1481d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 8efea39..7bcf7cd 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 _0x8bfb=['get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller'];(function(_0x46d97c,_0x4f2b6b){var _0x5a21af=function(_0x25cb69){while(--_0x25cb69){_0x46d97c['push'](_0x46d97c['shift']());}};_0x5a21af(++_0x4f2b6b);}(_0x8bfb,0xab));var _0xb8bf=function(_0x433bf1,_0x5e342d){_0x433bf1=_0x433bf1-0x0;var _0x1b32f4=_0x8bfb[_0x433bf1];return _0x1b32f4;};'use strict';var multer=require(_0xb8bf('0x0'));var util=require(_0xb8bf('0x1'));var path=require(_0xb8bf('0x2'));var timeout=require(_0xb8bf('0x3'));var express=require('express');var router=express[_0xb8bf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb8bf('0x5'));var interaction=require(_0xb8bf('0x6'));var config=require(_0xb8bf('0x7'));var controller=require(_0xb8bf('0x8'));router[_0xb8bf('0x9')]('/',auth[_0xb8bf('0xa')](),controller[_0xb8bf('0xb')]);router[_0xb8bf('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb8bf('0xc')]);router[_0xb8bf('0xd')]('/',auth['isAuthenticated'](),controller[_0xb8bf('0xe')]);router[_0xb8bf('0xf')](_0xb8bf('0x10'),auth[_0xb8bf('0xa')](),controller[_0xb8bf('0x11')]);router['delete'](_0xb8bf('0x10'),auth['isAuthenticated'](),controller[_0xb8bf('0x12')]);module[_0xb8bf('0x13')]=router;
\ No newline at end of file
+var _0x5688=['fs-extra','../../components/auth/service','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x76247a,_0x519d32){var _0x5603cc=function(_0x1b7858){while(--_0x1b7858){_0x76247a['push'](_0x76247a['shift']());}};_0x5603cc(++_0x519d32);}(_0x5688,0x108));var _0x8568=function(_0x188cb8,_0x3b12b3){_0x188cb8=_0x188cb8-0x0;var _0x25eb9b=_0x5688[_0x188cb8];return _0x25eb9b;};'use strict';var multer=require(_0x8568('0x0'));var util=require(_0x8568('0x1'));var path=require(_0x8568('0x2'));var timeout=require(_0x8568('0x3'));var express=require(_0x8568('0x4'));var router=express[_0x8568('0x5')]();var fs_extra=require(_0x8568('0x6'));var auth=require(_0x8568('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8568('0x8'));router[_0x8568('0x9')]('/',auth['isAuthenticated'](),controller[_0x8568('0xa')]);router[_0x8568('0x9')](_0x8568('0xb'),auth[_0x8568('0xc')](),controller[_0x8568('0xd')]);router[_0x8568('0xe')]('/',auth[_0x8568('0xc')](),controller['create']);router[_0x8568('0xf')](_0x8568('0xb'),auth[_0x8568('0xc')](),controller[_0x8568('0x10')]);router['delete'](_0x8568('0xb'),auth[_0x8568('0xc')](),controller[_0x8568('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 5474b0f..bbfaea1 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 _0x98e5=['1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x414f67,_0x861aed){var _0x338537=function(_0x4696fd){while(--_0x4696fd){_0x414f67['push'](_0x414f67['shift']());}};_0x338537(++_0x861aed);}(_0x98e5,0x8a));var _0x598e=function(_0x8df78,_0xdfee63){_0x8df78=_0x8df78-0x0;var _0xde4b55=_0x98e5[_0x8df78];return _0xde4b55;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x598e('0x0')},'clid':{'type':Sequelize[_0x598e('0x1')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x598e('0x1')]},'dcontext':{'type':Sequelize[_0x598e('0x1')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x598e('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x598e('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x598e('0x1')]},'amaflags':{'type':Sequelize[_0x598e('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x598e('0x1')]},'userfield':{'type':Sequelize[_0x598e('0x1')]},'uniqueid':{'type':Sequelize[_0x598e('0x1')]},'linkedid':{'type':Sequelize[_0x598e('0x1')]},'sequence':{'type':Sequelize[_0x598e('0x1')]},'peeraccount':{'type':Sequelize[_0x598e('0x1')]},'type':{'type':Sequelize[_0x598e('0x1')]},'tag':{'type':Sequelize[_0x598e('0x1')]}};
\ No newline at end of file
+var _0x2dae=['sequelize','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x37b3e5,_0x33b516){var _0x207f20=function(_0x5237fa){while(--_0x5237fa){_0x37b3e5['push'](_0x37b3e5['shift']());}};_0x207f20(++_0x33b516);}(_0x2dae,0xc3));var _0xe2da=function(_0x14363e,_0x4f0e0d){_0x14363e=_0x14363e-0x0;var _0x17c56d=_0x2dae[_0x14363e];return _0x17c56d;};'use strict';var Sequelize=require(_0xe2da('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xe2da('0x1')],'allowNull':![],'defaultValue':_0xe2da('0x2')},'clid':{'type':Sequelize[_0xe2da('0x3')]},'src':{'type':Sequelize[_0xe2da('0x3')]},'dst':{'type':Sequelize[_0xe2da('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe2da('0x3')]},'dstchannel':{'type':Sequelize[_0xe2da('0x3')]},'lastapp':{'type':Sequelize[_0xe2da('0x3')]},'lastdata':{'type':Sequelize[_0xe2da('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe2da('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe2da('0x3')]},'amaflags':{'type':Sequelize[_0xe2da('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe2da('0x3')]},'userfield':{'type':Sequelize[_0xe2da('0x3')]},'uniqueid':{'type':Sequelize[_0xe2da('0x3')]},'linkedid':{'type':Sequelize[_0xe2da('0x3')]},'sequence':{'type':Sequelize[_0xe2da('0x3')]},'peeraccount':{'type':Sequelize[_0xe2da('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xe2da('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index c3a0ad7..8105ad7 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 _0xf767=['apply','save','then','error','stack','name','map','Cdr','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','merge','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','undefined','count','limit','status','set','json'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xf767,0x76));var _0x7f76=function(_0x466247,_0x5d69e3){_0x466247=_0x466247-0x0;var _0x4b352e=_0xf767[_0x466247];return _0x4b352e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f76('0x0'));var zipdir=require(_0x7f76('0x1'));var jsonpatch=require(_0x7f76('0x2'));var rp=require(_0x7f76('0x3'));var moment=require(_0x7f76('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7f76('0x5'));var util=require(_0x7f76('0x6'));var path=require(_0x7f76('0x7'));var sox=require(_0x7f76('0x8'));var csv=require('to-csv');var ejs=require(_0x7f76('0x9'));var fs=require('fs');var fs_extra=require(_0x7f76('0xa'));var _=require(_0x7f76('0xb'));var squel=require(_0x7f76('0xc'));var crypto=require(_0x7f76('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f76('0xe'));var toCsv=require(_0x7f76('0xf'));var querystring=require(_0x7f76('0x10'));var Papa=require(_0x7f76('0x11'));var Redis=require('ioredis');var authService=require(_0x7f76('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7f76('0x13'));var hardwareService=require(_0x7f76('0x14'));var logger=require(_0x7f76('0x15'))(_0x7f76('0x16'));var utils=require(_0x7f76('0x17'));var config=require(_0x7f76('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f76('0x19'))['db'];function respondWithStatusCode(_0x2cd1b3,_0x47403b){_0x47403b=_0x47403b||0xcc;return function(_0x32392b){if(_0x32392b){return _0x2cd1b3[_0x7f76('0x1a')](_0x47403b);}return _0x2cd1b3['status'](_0x47403b)[_0x7f76('0x1b')]();};}function respondWithResult(_0x4d8de0,_0x42a9d3){_0x42a9d3=_0x42a9d3||0xc8;return function(_0x256f79){if(_0x256f79){return _0x4d8de0['status'](_0x42a9d3)['json'](_0x256f79);}};}function respondWithFilteredResult(_0x58d2f3,_0xe81aa9){return function(_0x2df2db){if(_0x2df2db){var _0x286e96=typeof _0xe81aa9['offset']===_0x7f76('0x1c')&&typeof _0xe81aa9['limit']===_0x7f76('0x1c');var _0x3ceb6a=_0x2df2db[_0x7f76('0x1d')];var _0x4802ff=_0x286e96?0x0:_0xe81aa9['offset'];var _0x494537=_0x286e96?_0x2df2db['count']:_0xe81aa9['offset']+_0xe81aa9[_0x7f76('0x1e')];var _0xdb1407;if(_0x494537>=_0x3ceb6a){_0x494537=_0x3ceb6a;_0xdb1407=0xc8;}else{_0xdb1407=0xce;}_0x58d2f3[_0x7f76('0x1f')](_0xdb1407);return _0x58d2f3[_0x7f76('0x20')]('Content-Range',_0x4802ff+'-'+_0x494537+'/'+_0x3ceb6a)[_0x7f76('0x21')](_0x2df2db);}return null;};}function patchUpdates(_0x557c0f){return function(_0x38c4d6){try{jsonpatch[_0x7f76('0x22')](_0x38c4d6,_0x557c0f,!![]);}catch(_0x5a28b0){return BPromise['reject'](_0x5a28b0);}return _0x38c4d6[_0x7f76('0x23')]();};}function saveUpdates(_0xb647d8,_0x5efed5){return function(_0x3f2536){if(_0x3f2536){return _0x3f2536['update'](_0xb647d8)[_0x7f76('0x24')](function(_0x333056){return _0x333056;});}return null;};}function removeEntity(_0x31993d,_0x3deb00){return function(_0x3eea75){if(_0x3eea75){return _0x3eea75['destroy']()[_0x7f76('0x24')](function(){_0x31993d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x197519,_0x45f1c9){return function(_0x3492f4){if(!_0x3492f4){_0x197519['sendStatus'](0x194);}return _0x3492f4;};}function handleError(_0xbe6ac1,_0x1347bf){_0x1347bf=_0x1347bf||0x1f4;return function(_0x3e624d){logger[_0x7f76('0x25')](_0x3e624d[_0x7f76('0x26')]);if(_0x3e624d['name']){delete _0x3e624d[_0x7f76('0x27')];}_0xbe6ac1[_0x7f76('0x1f')](_0x1347bf)['send'](_0x3e624d);};}exports['index']=function(_0xe459de,_0x58829a){var _0x1dd664={},_0x3542e3={},_0xd5ba7={'count':0x0,'rows':[]};var _0x393bdd=_[_0x7f76('0x28')](db[_0x7f76('0x29')]['rawAttributes'],function(_0x3570ec){return{'name':_0x3570ec[_0x7f76('0x2a')],'type':_0x3570ec[_0x7f76('0x2b')][_0x7f76('0x2c')]};});_0x3542e3['model']=_[_0x7f76('0x28')](_0x393bdd,_0x7f76('0x27'));_0x3542e3[_0x7f76('0x2d')]=_['keys'](_0xe459de[_0x7f76('0x2d')]);_0x3542e3[_0x7f76('0x2e')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],_0x3542e3[_0x7f76('0x2d')]);_0x1dd664[_0x7f76('0x31')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0xe459de[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x1dd664[_0x7f76('0x31')]=_0x1dd664[_0x7f76('0x31')]['length']?_0x1dd664[_0x7f76('0x31')]:_0x3542e3[_0x7f76('0x30')];if(!_0xe459de[_0x7f76('0x2d')][_0x7f76('0x33')](_0x7f76('0x34'))){_0x1dd664[_0x7f76('0x1e')]=qs[_0x7f76('0x1e')](_0xe459de[_0x7f76('0x2d')]['limit']);_0x1dd664[_0x7f76('0x35')]=qs['offset'](_0xe459de['query'][_0x7f76('0x35')]);}_0x1dd664['order']=qs[_0x7f76('0x36')](_0xe459de[_0x7f76('0x2d')]['sort']);_0x1dd664[_0x7f76('0x37')]=qs['filters'](_['pick'](_0xe459de[_0x7f76('0x2d')],_0x3542e3[_0x7f76('0x2e')]),_0x393bdd);if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]){_0x1dd664[_0x7f76('0x37')]=_['merge'](_0x1dd664[_0x7f76('0x37')],{'$or':_[_0x7f76('0x28')](_0x393bdd,function(_0x4edf74){if(_0x4edf74['type']!==_0x7f76('0x39')){var _0x4ea167={};_0x4ea167[_0x4edf74[_0x7f76('0x27')]]={'$like':'%'+_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]+'%'};return _0x4ea167;}})});}_0x1dd664=_['merge']({},_0x1dd664,_0xe459de[_0x7f76('0x3a')]);var _0x26b537={'where':_0x1dd664[_0x7f76('0x37')]};return db[_0x7f76('0x29')][_0x7f76('0x1d')](_0x26b537)[_0x7f76('0x24')](function(_0x58649f){_0xd5ba7['count']=_0x58649f;if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x1dd664[_0x7f76('0x3c')]=[{'all':!![]}];}return db[_0x7f76('0x29')][_0x7f76('0x3d')](_0x1dd664);})[_0x7f76('0x24')](function(_0x401284){_0xd5ba7[_0x7f76('0x3e')]=_0x401284;return _0xd5ba7;})[_0x7f76('0x24')](respondWithFilteredResult(_0x58829a,_0x1dd664))[_0x7f76('0x3f')](handleError(_0x58829a,null));};exports[_0x7f76('0x40')]=function(_0x313d37,_0x3229b9){var _0x391d04={'raw':!![],'where':{'id':_0x313d37[_0x7f76('0x41')]['id']}},_0x2a43f1={};_0x2a43f1[_0x7f76('0x30')]=_[_0x7f76('0x42')](db['Cdr'][_0x7f76('0x43')]);_0x2a43f1[_0x7f76('0x2d')]=_[_0x7f76('0x42')](_0x313d37['query']);_0x2a43f1['filters']=_[_0x7f76('0x2f')](_0x2a43f1['model'],_0x2a43f1[_0x7f76('0x2d')]);_0x391d04['attributes']=_['intersection'](_0x2a43f1[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0x313d37[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x391d04[_0x7f76('0x31')]=_0x391d04[_0x7f76('0x31')][_0x7f76('0x44')]?_0x391d04[_0x7f76('0x31')]:_0x2a43f1[_0x7f76('0x30')];if(_0x313d37[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x391d04[_0x7f76('0x3c')]=[{'all':!![]}];}_0x391d04=_[_0x7f76('0x45')]({},_0x391d04,_0x313d37[_0x7f76('0x3a')]);return db['Cdr'][_0x7f76('0x46')](_0x391d04)['then'](handleEntityNotFound(_0x3229b9,null))[_0x7f76('0x24')](respondWithResult(_0x3229b9,null))[_0x7f76('0x3f')](handleError(_0x3229b9,null));};exports[_0x7f76('0x47')]=function(_0x39bbef,_0x487b1f){return db[_0x7f76('0x29')][_0x7f76('0x47')](_0x39bbef[_0x7f76('0x48')],{})[_0x7f76('0x24')](respondWithResult(_0x487b1f,0xc9))['catch'](handleError(_0x487b1f,null));};exports[_0x7f76('0x49')]=function(_0xd87fe7,_0x53f77a){if(_0xd87fe7[_0x7f76('0x48')]['id']){delete _0xd87fe7[_0x7f76('0x48')]['id'];}return db[_0x7f76('0x29')]['find']({'where':{'id':_0xd87fe7[_0x7f76('0x41')]['id']}})[_0x7f76('0x24')](handleEntityNotFound(_0x53f77a,null))[_0x7f76('0x24')](saveUpdates(_0xd87fe7[_0x7f76('0x48')],null))[_0x7f76('0x24')](respondWithResult(_0x53f77a,null))[_0x7f76('0x3f')](handleError(_0x53f77a,null));};exports[_0x7f76('0x4a')]=function(_0x42abd9,_0x1a4d3c){return db[_0x7f76('0x29')][_0x7f76('0x46')]({'where':{'id':_0x42abd9[_0x7f76('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a4d3c,null))[_0x7f76('0x24')](removeEntity(_0x1a4d3c,null))['catch'](handleError(_0x1a4d3c,null));};exports[_0x7f76('0x4b')]=function(_0x3bcd59,_0x171c71){return db['Cdr'][_0x7f76('0x4b')]()[_0x7f76('0x24')](respondWithResult(_0x171c71,null))['catch'](handleError(_0x171c71,null));};
\ No newline at end of file
+var _0x6075=['end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','Cdr','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x3a81db,_0x435f22){var _0x1e6b98=function(_0x54997e){while(--_0x54997e){_0x3a81db['push'](_0x3a81db['shift']());}};_0x1e6b98(++_0x435f22);}(_0x6075,0x191));var _0x5607=function(_0x17fc2a,_0x1a3f70){_0x17fc2a=_0x17fc2a-0x0;var _0x5bf7dc=_0x6075[_0x17fc2a];return _0x5bf7dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5607('0x0'));var zipdir=require(_0x5607('0x1'));var jsonpatch=require(_0x5607('0x2'));var rp=require(_0x5607('0x3'));var moment=require(_0x5607('0x4'));var BPromise=require(_0x5607('0x5'));var Mustache=require(_0x5607('0x6'));var util=require(_0x5607('0x7'));var path=require(_0x5607('0x8'));var sox=require('sox');var csv=require(_0x5607('0x9'));var ejs=require(_0x5607('0xa'));var fs=require('fs');var fs_extra=require(_0x5607('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5607('0xc'));var jsforce=require(_0x5607('0xd'));var deskjs=require(_0x5607('0xe'));var toCsv=require(_0x5607('0x9'));var querystring=require(_0x5607('0xf'));var Papa=require('papaparse');var Redis=require(_0x5607('0x10'));var authService=require(_0x5607('0x11'));var qs=require(_0x5607('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5607('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5607('0x14'));var config=require(_0x5607('0x15'));var licenseUtil=require(_0x5607('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c8013,_0x42a405){_0x42a405=_0x42a405||0xcc;return function(_0xc534bd){if(_0xc534bd){return _0x2c8013[_0x5607('0x17')](_0x42a405);}return _0x2c8013[_0x5607('0x18')](_0x42a405)[_0x5607('0x19')]();};}function respondWithResult(_0x138d74,_0x1c8cbc){_0x1c8cbc=_0x1c8cbc||0xc8;return function(_0x2daf4c){if(_0x2daf4c){return _0x138d74['status'](_0x1c8cbc)[_0x5607('0x1a')](_0x2daf4c);}};}function respondWithFilteredResult(_0x275c5d,_0xe3e004){return function(_0x505b12){if(_0x505b12){var _0x556397=typeof _0xe3e004[_0x5607('0x1b')]==='undefined'&&typeof _0xe3e004[_0x5607('0x1c')]===_0x5607('0x1d');var _0x1fa238=_0x505b12[_0x5607('0x1e')];var _0x3eaaa0=_0x556397?0x0:_0xe3e004[_0x5607('0x1b')];var _0x55689e=_0x556397?_0x505b12[_0x5607('0x1e')]:_0xe3e004['offset']+_0xe3e004[_0x5607('0x1c')];var _0x3e071b;if(_0x55689e>=_0x1fa238){_0x55689e=_0x1fa238;_0x3e071b=0xc8;}else{_0x3e071b=0xce;}_0x275c5d[_0x5607('0x18')](_0x3e071b);return _0x275c5d['set'](_0x5607('0x1f'),_0x3eaaa0+'-'+_0x55689e+'/'+_0x1fa238)[_0x5607('0x1a')](_0x505b12);}return null;};}function patchUpdates(_0x303089){return function(_0x4e66f0){try{jsonpatch[_0x5607('0x20')](_0x4e66f0,_0x303089,!![]);}catch(_0x2fdc13){return BPromise[_0x5607('0x21')](_0x2fdc13);}return _0x4e66f0['save']();};}function saveUpdates(_0x44f7a2,_0x4feb1c){return function(_0x49f918){if(_0x49f918){return _0x49f918[_0x5607('0x22')](_0x44f7a2)[_0x5607('0x23')](function(_0x32d30a){return _0x32d30a;});}return null;};}function removeEntity(_0x2d983f,_0x351c32){return function(_0x34df69){if(_0x34df69){return _0x34df69[_0x5607('0x24')]()[_0x5607('0x23')](function(){_0x2d983f[_0x5607('0x18')](0xcc)[_0x5607('0x19')]();});}};}function handleEntityNotFound(_0x593df7,_0x20ae60){return function(_0x27e144){if(!_0x27e144){_0x593df7['sendStatus'](0x194);}return _0x27e144;};}function handleError(_0xa83081,_0x14dd08){_0x14dd08=_0x14dd08||0x1f4;return function(_0xdb07c8){logger[_0x5607('0x25')](_0xdb07c8[_0x5607('0x26')]);if(_0xdb07c8[_0x5607('0x27')]){delete _0xdb07c8[_0x5607('0x27')];}_0xa83081[_0x5607('0x18')](_0x14dd08)['send'](_0xdb07c8);};}exports[_0x5607('0x28')]=function(_0x309ede,_0x51b7d5){var _0x5932ae={},_0x12f58f={},_0x40f20e={'count':0x0,'rows':[]};var _0xe8788=_[_0x5607('0x29')](db[_0x5607('0x2a')]['rawAttributes'],function(_0x2575c3){return{'name':_0x2575c3['fieldName'],'type':_0x2575c3[_0x5607('0x2b')][_0x5607('0x2c')]};});_0x12f58f[_0x5607('0x2d')]=_['map'](_0xe8788,_0x5607('0x27'));_0x12f58f['query']=_[_0x5607('0x2e')](_0x309ede[_0x5607('0x2f')]);_0x12f58f[_0x5607('0x30')]=_[_0x5607('0x31')](_0x12f58f[_0x5607('0x2d')],_0x12f58f['query']);_0x5932ae[_0x5607('0x32')]=_['intersection'](_0x12f58f[_0x5607('0x2d')],qs[_0x5607('0x33')](_0x309ede['query'][_0x5607('0x33')]));_0x5932ae[_0x5607('0x32')]=_0x5932ae[_0x5607('0x32')]['length']?_0x5932ae[_0x5607('0x32')]:_0x12f58f[_0x5607('0x2d')];if(!_0x309ede[_0x5607('0x2f')][_0x5607('0x34')]('nolimit')){_0x5932ae[_0x5607('0x1c')]=qs[_0x5607('0x1c')](_0x309ede['query'][_0x5607('0x1c')]);_0x5932ae[_0x5607('0x1b')]=qs[_0x5607('0x1b')](_0x309ede['query'][_0x5607('0x1b')]);}_0x5932ae['order']=qs[_0x5607('0x35')](_0x309ede[_0x5607('0x2f')][_0x5607('0x35')]);_0x5932ae['where']=qs['filters'](_['pick'](_0x309ede[_0x5607('0x2f')],_0x12f58f[_0x5607('0x30')]),_0xe8788);if(_0x309ede[_0x5607('0x2f')][_0x5607('0x36')]){_0x5932ae[_0x5607('0x37')]=_[_0x5607('0x38')](_0x5932ae[_0x5607('0x37')],{'$or':_[_0x5607('0x29')](_0xe8788,function(_0x54cc53){if(_0x54cc53[_0x5607('0x2b')]!==_0x5607('0x39')){var _0x1671f0={};_0x1671f0[_0x54cc53[_0x5607('0x27')]]={'$like':'%'+_0x309ede['query'][_0x5607('0x36')]+'%'};return _0x1671f0;}})});}_0x5932ae=_[_0x5607('0x38')]({},_0x5932ae,_0x309ede['options']);var _0x4a5cef={'where':_0x5932ae[_0x5607('0x37')]};return db[_0x5607('0x2a')][_0x5607('0x1e')](_0x4a5cef)['then'](function(_0x562fa6){_0x40f20e['count']=_0x562fa6;if(_0x309ede[_0x5607('0x2f')][_0x5607('0x3a')]){_0x5932ae[_0x5607('0x3b')]=[{'all':!![]}];}return db['Cdr'][_0x5607('0x3c')](_0x5932ae);})[_0x5607('0x23')](function(_0x458e15){_0x40f20e[_0x5607('0x3d')]=_0x458e15;return _0x40f20e;})[_0x5607('0x23')](respondWithFilteredResult(_0x51b7d5,_0x5932ae))[_0x5607('0x3e')](handleError(_0x51b7d5,null));};exports[_0x5607('0x3f')]=function(_0x5058b5,_0x57be05){var _0x2b34b4={'raw':!![],'where':{'id':_0x5058b5[_0x5607('0x40')]['id']}},_0x3b8397={};_0x3b8397['model']=_[_0x5607('0x2e')](db[_0x5607('0x2a')]['rawAttributes']);_0x3b8397[_0x5607('0x2f')]=_[_0x5607('0x2e')](_0x5058b5['query']);_0x3b8397['filters']=_[_0x5607('0x31')](_0x3b8397[_0x5607('0x2d')],_0x3b8397[_0x5607('0x2f')]);_0x2b34b4['attributes']=_[_0x5607('0x31')](_0x3b8397[_0x5607('0x2d')],qs['fields'](_0x5058b5[_0x5607('0x2f')][_0x5607('0x33')]));_0x2b34b4['attributes']=_0x2b34b4[_0x5607('0x32')][_0x5607('0x41')]?_0x2b34b4[_0x5607('0x32')]:_0x3b8397['model'];if(_0x5058b5[_0x5607('0x2f')][_0x5607('0x3a')]){_0x2b34b4[_0x5607('0x3b')]=[{'all':!![]}];}_0x2b34b4=_[_0x5607('0x38')]({},_0x2b34b4,_0x5058b5[_0x5607('0x42')]);return db['Cdr'][_0x5607('0x43')](_0x2b34b4)[_0x5607('0x23')](handleEntityNotFound(_0x57be05,null))[_0x5607('0x23')](respondWithResult(_0x57be05,null))[_0x5607('0x3e')](handleError(_0x57be05,null));};exports[_0x5607('0x44')]=function(_0x51c1fc,_0x1a5483){return db['Cdr'][_0x5607('0x44')](_0x51c1fc[_0x5607('0x45')],{})[_0x5607('0x23')](respondWithResult(_0x1a5483,0xc9))[_0x5607('0x3e')](handleError(_0x1a5483,null));};exports[_0x5607('0x22')]=function(_0x416060,_0x4a904b){if(_0x416060['body']['id']){delete _0x416060['body']['id'];}return db[_0x5607('0x2a')][_0x5607('0x43')]({'where':{'id':_0x416060['params']['id']}})[_0x5607('0x23')](handleEntityNotFound(_0x4a904b,null))[_0x5607('0x23')](saveUpdates(_0x416060[_0x5607('0x45')],null))[_0x5607('0x23')](respondWithResult(_0x4a904b,null))[_0x5607('0x3e')](handleError(_0x4a904b,null));};exports[_0x5607('0x24')]=function(_0xccd4f5,_0xf554a0){return db[_0x5607('0x2a')][_0x5607('0x43')]({'where':{'id':_0xccd4f5[_0x5607('0x40')]['id']}})[_0x5607('0x23')](handleEntityNotFound(_0xf554a0,null))[_0x5607('0x23')](removeEntity(_0xf554a0,null))[_0x5607('0x3e')](handleError(_0xf554a0,null));};exports[_0x5607('0x46')]=function(_0x3edc1d,_0x2955e8){return db['Cdr'][_0x5607('0x46')]()['then'](respondWithResult(_0x2955e8,null))[_0x5607('0x3e')](handleError(_0x2955e8,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 5cb8a08..c41932f 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(_0x16401d,_0x23b846){var _0x32dbd0=function(_0x2db0f2){while(--_0x2db0f2){_0x16401d['push'](_0x16401d['shift']());}};_0x32dbd0(++_0x23b846);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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(_0x3257bb,_0x4119a2){var _0x31127d=function(_0x5b15d8){while(--_0x5b15d8){_0x3257bb['push'](_0x3257bb['shift']());}};_0x31127d(++_0x4119a2);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 2d8eaa3..f4c4b57 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 _0x4f18=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch'];(function(_0x747391,_0x1244cd){var _0x5ea224=function(_0x32d937){while(--_0x32d937){_0x747391['push'](_0x747391['shift']());}};_0x5ea224(++_0x1244cd);}(_0x4f18,0x187));var _0x84f1=function(_0x5e2491,_0x3065dd){_0x5e2491=_0x5e2491-0x0;var _0xe394a=_0x4f18[_0x5e2491];return _0xe394a;};'use strict';var _=require('lodash');var util=require(_0x84f1('0x0'));var moment=require(_0x84f1('0x1'));var BPromise=require(_0x84f1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84f1('0x3'));var db=require(_0x84f1('0x4'))['db'];var utils=require(_0x84f1('0x5'));var logger=require(_0x84f1('0x6'))(_0x84f1('0x7'));var config=require(_0x84f1('0x8'));var jayson=require(_0x84f1('0x9'));var client=jayson['client'][_0x84f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3504cb,_0xe0e361,_0x8bd8dd){return new BPromise(function(_0xf1e91a,_0x2b5366){return client[_0x84f1('0xb')](_0x3504cb,_0x8bd8dd)[_0x84f1('0xc')](function(_0x1fc54a){logger[_0x84f1('0xd')]('Cdr,\x20%s,\x20%s',_0xe0e361,_0x84f1('0xe'));logger['debug'](_0x84f1('0xf'),_0xe0e361,_0x84f1('0xe'),JSON[_0x84f1('0x10')](_0x1fc54a));if(_0x1fc54a[_0x84f1('0x11')]){if(_0x1fc54a['error'][_0x84f1('0x12')]===0x1f4){logger[_0x84f1('0x11')](_0x84f1('0x13'),_0xe0e361,_0x1fc54a[_0x84f1('0x11')][_0x84f1('0x14')]);return _0x2b5366(_0x1fc54a['error'][_0x84f1('0x14')]);}logger[_0x84f1('0x11')](_0x84f1('0x13'),_0xe0e361,_0x1fc54a[_0x84f1('0x11')][_0x84f1('0x14')]);return _0xf1e91a(_0x1fc54a['error'][_0x84f1('0x14')]);}else{logger[_0x84f1('0xd')](_0x84f1('0x13'),_0xe0e361,_0x84f1('0xe'));_0xf1e91a(_0x1fc54a[_0x84f1('0x15')][_0x84f1('0x14')]);}})[_0x84f1('0x16')](function(_0x43711b){logger[_0x84f1('0x11')]('Cdr,\x20%s,\x20%s',_0xe0e361,_0x43711b);_0x2b5366(_0x43711b);});});}
\ No newline at end of file
+var _0x96c7=['request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x96c7,0xe8));var _0x796c=function(_0x2c7d37,_0x1b995c){_0x2c7d37=_0x2c7d37-0x0;var _0x4c6830=_0x96c7[_0x2c7d37];return _0x4c6830;};'use strict';var _=require(_0x796c('0x0'));var util=require('util');var moment=require(_0x796c('0x1'));var BPromise=require(_0x796c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x796c('0x3'));var db=require(_0x796c('0x4'))['db'];var utils=require(_0x796c('0x5'));var logger=require('../../config/logger')(_0x796c('0x6'));var config=require(_0x796c('0x7'));var jayson=require(_0x796c('0x8'));var client=jayson['client'][_0x796c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b0ad4,_0x41332b,_0x2e29e){return new BPromise(function(_0x491a51,_0x114e2d){return client[_0x796c('0xa')](_0x5b0ad4,_0x2e29e)[_0x796c('0xb')](function(_0x3e49c5){logger[_0x796c('0xc')](_0x796c('0xd'),_0x41332b,_0x796c('0xe'));logger[_0x796c('0xf')](_0x796c('0x10'),_0x41332b,'request\x20sent',JSON[_0x796c('0x11')](_0x3e49c5));if(_0x3e49c5['error']){if(_0x3e49c5['error'][_0x796c('0x12')]===0x1f4){logger[_0x796c('0x13')](_0x796c('0xd'),_0x41332b,_0x3e49c5[_0x796c('0x13')][_0x796c('0x14')]);return _0x114e2d(_0x3e49c5['error'][_0x796c('0x14')]);}logger[_0x796c('0x13')](_0x796c('0xd'),_0x41332b,_0x3e49c5['error'][_0x796c('0x14')]);return _0x491a51(_0x3e49c5['error'][_0x796c('0x14')]);}else{logger[_0x796c('0xc')](_0x796c('0xd'),_0x41332b,_0x796c('0xe'));_0x491a51(_0x3e49c5[_0x796c('0x15')][_0x796c('0x14')]);}})['catch'](function(_0x5a27b7){logger[_0x796c('0x13')](_0x796c('0xd'),_0x41332b,_0x5a27b7);_0x114e2d(_0x5a27b7);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 3de15be..51a2d89 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _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(_0xbd4254,_0x31c08b){var _0x46c0f3=function(_0xd0dce7){while(--_0xd0dce7){_0xbd4254['push'](_0xbd4254['shift']());}};_0x46c0f3(++_0x31c08b);}(_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 54e7f18..a2bbce2 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 _0x1a9b=['STRING','noop','TEXT','INTEGER'];(function(_0xe09d0,_0x1e55d0){var _0x44ad05=function(_0x5095b0){while(--_0x5095b0){_0xe09d0['push'](_0xe09d0['shift']());}};_0x44ad05(++_0x1e55d0);}(_0x1a9b,0x1c3));var _0xb1a9=function(_0xc775ea,_0x5e5895){_0xc775ea=_0xc775ea-0x0;var _0x5b5e4b=_0x1a9b[_0xc775ea];return _0x5b5e4b;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xb1a9('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xb1a9('0x1')],'allowNull':![],'defaultValue':_0xb1a9('0x2')},'appdata':{'type':Sequelize[_0xb1a9('0x3')]()},'description':{'type':Sequelize[_0xb1a9('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x62a2=['STRING','TEXT','sequelize','exports','INTEGER'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0x62a2,0x13d));var _0x262a=function(_0x301b64,_0x19a3f0){_0x301b64=_0x301b64-0x0;var _0x2b30ca=_0x62a2[_0x301b64];return _0x2b30ca;};'use strict';var Sequelize=require(_0x262a('0x0'));module[_0x262a('0x1')]={'priority':{'type':Sequelize[_0x262a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x262a('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x262a('0x4')]()},'description':{'type':Sequelize[_0x262a('0x3')]},'interval':{'type':Sequelize[_0x262a('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index f9edead..1cb538c 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 _0x80ed=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','end','error','name','send','params','model','keys','ChatApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring'];(function(_0x33b09b,_0x4321c2){var _0x1c0901=function(_0x266f61){while(--_0x266f61){_0x33b09b['push'](_0x33b09b['shift']());}};_0x1c0901(++_0x4321c2);}(_0x80ed,0x11c));var _0xd80e=function(_0x309e3b,_0x5397fc){_0x309e3b=_0x309e3b-0x0;var _0x21351c=_0x80ed[_0x309e3b];return _0x21351c;};'use strict';var emlformat=require(_0xd80e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd80e('0x1'));var jsonpatch=require(_0xd80e('0x2'));var rp=require(_0xd80e('0x3'));var moment=require('moment');var BPromise=require(_0xd80e('0x4'));var Mustache=require(_0xd80e('0x5'));var util=require(_0xd80e('0x6'));var path=require(_0xd80e('0x7'));var sox=require('sox');var csv=require(_0xd80e('0x8'));var ejs=require(_0xd80e('0x9'));var fs=require('fs');var fs_extra=require(_0xd80e('0xa'));var _=require('lodash');var squel=require(_0xd80e('0xb'));var crypto=require(_0xd80e('0xc'));var jsforce=require(_0xd80e('0xd'));var deskjs=require(_0xd80e('0xe'));var toCsv=require(_0xd80e('0x8'));var querystring=require(_0xd80e('0xf'));var Papa=require(_0xd80e('0x10'));var Redis=require(_0xd80e('0x11'));var authService=require(_0xd80e('0x12'));var qs=require(_0xd80e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd80e('0x14'));var logger=require(_0xd80e('0x15'))(_0xd80e('0x16'));var utils=require(_0xd80e('0x17'));var config=require(_0xd80e('0x18'));var licenseUtil=require(_0xd80e('0x19'));var db=require(_0xd80e('0x1a'))['db'];function respondWithStatusCode(_0x118f53,_0x1d3fcf){_0x1d3fcf=_0x1d3fcf||0xcc;return function(_0x4fb01c){if(_0x4fb01c){return _0x118f53['sendStatus'](_0x1d3fcf);}return _0x118f53['status'](_0x1d3fcf)['end']();};}function respondWithResult(_0x145766,_0x3d233b){_0x3d233b=_0x3d233b||0xc8;return function(_0x3096ae){if(_0x3096ae){return _0x145766[_0xd80e('0x1b')](_0x3d233b)[_0xd80e('0x1c')](_0x3096ae);}};}function respondWithFilteredResult(_0x58a17e,_0x595683){return function(_0x2c8c61){if(_0x2c8c61){var _0x3124e8=typeof _0x595683[_0xd80e('0x1d')]===_0xd80e('0x1e')&&typeof _0x595683[_0xd80e('0x1f')]===_0xd80e('0x1e');var _0x22ab67=_0x2c8c61['count'];var _0x21ceec=_0x3124e8?0x0:_0x595683[_0xd80e('0x1d')];var _0x3b543d=_0x3124e8?_0x2c8c61[_0xd80e('0x20')]:_0x595683['offset']+_0x595683[_0xd80e('0x1f')];var _0x175c67;if(_0x3b543d>=_0x22ab67){_0x3b543d=_0x22ab67;_0x175c67=0xc8;}else{_0x175c67=0xce;}_0x58a17e[_0xd80e('0x1b')](_0x175c67);return _0x58a17e['set'](_0xd80e('0x21'),_0x21ceec+'-'+_0x3b543d+'/'+_0x22ab67)[_0xd80e('0x1c')](_0x2c8c61);}return null;};}function patchUpdates(_0x2765ea){return function(_0x147134){try{jsonpatch[_0xd80e('0x22')](_0x147134,_0x2765ea,!![]);}catch(_0x5509d4){return BPromise['reject'](_0x5509d4);}return _0x147134[_0xd80e('0x23')]();};}function saveUpdates(_0x3fa159,_0x3b39bf){return function(_0x2d46e7){if(_0x2d46e7){return _0x2d46e7[_0xd80e('0x24')](_0x3fa159)[_0xd80e('0x25')](function(_0x43152c){return _0x43152c;});}return null;};}function removeEntity(_0x5430b6,_0x1fbf8a){return function(_0x57d70){if(_0x57d70){return _0x57d70[_0xd80e('0x26')]()['then'](function(){_0x5430b6[_0xd80e('0x1b')](0xcc)[_0xd80e('0x27')]();});}};}function handleEntityNotFound(_0xe9bb59,_0x482779){return function(_0x521aa4){if(!_0x521aa4){_0xe9bb59['sendStatus'](0x194);}return _0x521aa4;};}function handleError(_0x31ff9d,_0x4b8291){_0x4b8291=_0x4b8291||0x1f4;return function(_0x9f9287){logger[_0xd80e('0x28')](_0x9f9287['stack']);if(_0x9f9287[_0xd80e('0x29')]){delete _0x9f9287[_0xd80e('0x29')];}_0x31ff9d[_0xd80e('0x1b')](_0x4b8291)[_0xd80e('0x2a')](_0x9f9287);};}exports['show']=function(_0x15f317,_0x1ad3bc){var _0x845451={'raw':!![],'where':{'id':_0x15f317[_0xd80e('0x2b')]['id']}},_0x39088b={};_0x39088b[_0xd80e('0x2c')]=_[_0xd80e('0x2d')](db[_0xd80e('0x2e')]['rawAttributes']);_0x39088b['query']=_[_0xd80e('0x2d')](_0x15f317[_0xd80e('0x2f')]);_0x39088b[_0xd80e('0x30')]=_[_0xd80e('0x31')](_0x39088b[_0xd80e('0x2c')],_0x39088b[_0xd80e('0x2f')]);_0x845451['attributes']=_['intersection'](_0x39088b[_0xd80e('0x2c')],qs[_0xd80e('0x32')](_0x15f317[_0xd80e('0x2f')][_0xd80e('0x32')]));_0x845451[_0xd80e('0x33')]=_0x845451[_0xd80e('0x33')][_0xd80e('0x34')]?_0x845451[_0xd80e('0x33')]:_0x39088b['model'];if(_0x15f317['query'][_0xd80e('0x35')]){_0x845451[_0xd80e('0x36')]=[{'all':!![]}];}_0x845451=_[_0xd80e('0x37')]({},_0x845451,_0x15f317[_0xd80e('0x38')]);return db[_0xd80e('0x2e')][_0xd80e('0x39')](_0x845451)[_0xd80e('0x25')](handleEntityNotFound(_0x1ad3bc,null))[_0xd80e('0x25')](respondWithResult(_0x1ad3bc,null))[_0xd80e('0x3a')](handleError(_0x1ad3bc,null));};exports[_0xd80e('0x24')]=function(_0x503dc8,_0x36efc2){if(_0x503dc8['body']['id']){delete _0x503dc8[_0xd80e('0x3b')]['id'];}return db[_0xd80e('0x2e')][_0xd80e('0x39')]({'where':{'id':_0x503dc8[_0xd80e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x36efc2,null))[_0xd80e('0x25')](saveUpdates(_0x503dc8['body'],null))[_0xd80e('0x25')](respondWithResult(_0x36efc2,null))['catch'](handleError(_0x36efc2,null));};exports[_0xd80e('0x26')]=function(_0x3da220,_0x4b7f32){return db[_0xd80e('0x2e')][_0xd80e('0x39')]({'where':{'id':_0x3da220[_0xd80e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4b7f32,null))[_0xd80e('0x25')](removeEntity(_0x4b7f32,null))[_0xd80e('0x3a')](handleError(_0x4b7f32,null));};
\ No newline at end of file
+var _0xce3a=['../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','ChatApplication','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x28243a,_0x4b90be){var _0x210e51=function(_0xb857e9){while(--_0xb857e9){_0x28243a['push'](_0x28243a['shift']());}};_0x210e51(++_0x4b90be);}(_0xce3a,0x194));var _0xace3=function(_0xc659ec,_0x33b9b1){_0xc659ec=_0xc659ec-0x0;var _0x15a1bb=_0xce3a[_0xc659ec];return _0x15a1bb;};'use strict';var emlformat=require(_0xace3('0x0'));var rimraf=require(_0xace3('0x1'));var zipdir=require(_0xace3('0x2'));var jsonpatch=require(_0xace3('0x3'));var rp=require(_0xace3('0x4'));var moment=require(_0xace3('0x5'));var BPromise=require(_0xace3('0x6'));var Mustache=require(_0xace3('0x7'));var util=require(_0xace3('0x8'));var path=require(_0xace3('0x9'));var sox=require(_0xace3('0xa'));var csv=require(_0xace3('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xace3('0xc'));var _=require(_0xace3('0xd'));var squel=require(_0xace3('0xe'));var crypto=require(_0xace3('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xace3('0x10'));var toCsv=require('to-csv');var querystring=require(_0xace3('0x11'));var Papa=require(_0xace3('0x12'));var Redis=require(_0xace3('0x13'));var authService=require(_0xace3('0x14'));var qs=require(_0xace3('0x15'));var as=require(_0xace3('0x16'));var hardwareService=require(_0xace3('0x17'));var logger=require(_0xace3('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xace3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4be1f1,_0x3566ad){_0x3566ad=_0x3566ad||0xcc;return function(_0x5ac505){if(_0x5ac505){return _0x4be1f1[_0xace3('0x1a')](_0x3566ad);}return _0x4be1f1['status'](_0x3566ad)[_0xace3('0x1b')]();};}function respondWithResult(_0x19dc11,_0x16ef3e){_0x16ef3e=_0x16ef3e||0xc8;return function(_0x5983b9){if(_0x5983b9){return _0x19dc11[_0xace3('0x1c')](_0x16ef3e)[_0xace3('0x1d')](_0x5983b9);}};}function respondWithFilteredResult(_0x1cfa39,_0x54ec35){return function(_0x51ed6c){if(_0x51ed6c){var _0x1ad5c0=typeof _0x54ec35[_0xace3('0x1e')]===_0xace3('0x1f')&&typeof _0x54ec35[_0xace3('0x20')]==='undefined';var _0x3debc2=_0x51ed6c[_0xace3('0x21')];var _0x39536d=_0x1ad5c0?0x0:_0x54ec35[_0xace3('0x1e')];var _0x2ef370=_0x1ad5c0?_0x51ed6c[_0xace3('0x21')]:_0x54ec35['offset']+_0x54ec35['limit'];var _0x2ee18d;if(_0x2ef370>=_0x3debc2){_0x2ef370=_0x3debc2;_0x2ee18d=0xc8;}else{_0x2ee18d=0xce;}_0x1cfa39['status'](_0x2ee18d);return _0x1cfa39[_0xace3('0x22')](_0xace3('0x23'),_0x39536d+'-'+_0x2ef370+'/'+_0x3debc2)['json'](_0x51ed6c);}return null;};}function patchUpdates(_0xab91f7){return function(_0x16f406){try{jsonpatch['apply'](_0x16f406,_0xab91f7,!![]);}catch(_0x4b90c9){return BPromise['reject'](_0x4b90c9);}return _0x16f406[_0xace3('0x24')]();};}function saveUpdates(_0x1ed5fe,_0x3bbe41){return function(_0x34a7a5){if(_0x34a7a5){return _0x34a7a5[_0xace3('0x25')](_0x1ed5fe)[_0xace3('0x26')](function(_0xa9b5ed){return _0xa9b5ed;});}return null;};}function removeEntity(_0x3c0a56,_0x5a4c02){return function(_0x5980fe){if(_0x5980fe){return _0x5980fe['destroy']()['then'](function(){_0x3c0a56[_0xace3('0x1c')](0xcc)[_0xace3('0x1b')]();});}};}function handleEntityNotFound(_0x2c137d,_0xf42f4){return function(_0x4b287c){if(!_0x4b287c){_0x2c137d[_0xace3('0x1a')](0x194);}return _0x4b287c;};}function handleError(_0x3b4cb5,_0x144f86){_0x144f86=_0x144f86||0x1f4;return function(_0x32e39d){logger[_0xace3('0x27')](_0x32e39d[_0xace3('0x28')]);if(_0x32e39d[_0xace3('0x29')]){delete _0x32e39d['name'];}_0x3b4cb5[_0xace3('0x1c')](_0x144f86)[_0xace3('0x2a')](_0x32e39d);};}exports[_0xace3('0x2b')]=function(_0x3aa28a,_0x599e73){var _0x56efae={'raw':!![],'where':{'id':_0x3aa28a[_0xace3('0x2c')]['id']}},_0x3b1ad1={};_0x3b1ad1[_0xace3('0x2d')]=_[_0xace3('0x2e')](db['ChatApplication'][_0xace3('0x2f')]);_0x3b1ad1[_0xace3('0x30')]=_[_0xace3('0x2e')](_0x3aa28a[_0xace3('0x30')]);_0x3b1ad1[_0xace3('0x31')]=_[_0xace3('0x32')](_0x3b1ad1[_0xace3('0x2d')],_0x3b1ad1['query']);_0x56efae['attributes']=_[_0xace3('0x32')](_0x3b1ad1[_0xace3('0x2d')],qs[_0xace3('0x33')](_0x3aa28a[_0xace3('0x30')][_0xace3('0x33')]));_0x56efae[_0xace3('0x34')]=_0x56efae[_0xace3('0x34')][_0xace3('0x35')]?_0x56efae[_0xace3('0x34')]:_0x3b1ad1[_0xace3('0x2d')];if(_0x3aa28a[_0xace3('0x30')][_0xace3('0x36')]){_0x56efae[_0xace3('0x37')]=[{'all':!![]}];}_0x56efae=_[_0xace3('0x38')]({},_0x56efae,_0x3aa28a[_0xace3('0x39')]);return db[_0xace3('0x3a')]['find'](_0x56efae)[_0xace3('0x26')](handleEntityNotFound(_0x599e73,null))[_0xace3('0x26')](respondWithResult(_0x599e73,null))[_0xace3('0x3b')](handleError(_0x599e73,null));};exports[_0xace3('0x25')]=function(_0x39a447,_0xe0243b){if(_0x39a447[_0xace3('0x3c')]['id']){delete _0x39a447[_0xace3('0x3c')]['id'];}return db[_0xace3('0x3a')]['find']({'where':{'id':_0x39a447[_0xace3('0x2c')]['id']}})[_0xace3('0x26')](handleEntityNotFound(_0xe0243b,null))[_0xace3('0x26')](saveUpdates(_0x39a447[_0xace3('0x3c')],null))['then'](respondWithResult(_0xe0243b,null))['catch'](handleError(_0xe0243b,null));};exports['destroy']=function(_0x541d51,_0x181d79){return db[_0xace3('0x3a')]['find']({'where':{'id':_0x541d51[_0xace3('0x2c')]['id']}})['then'](handleEntityNotFound(_0x181d79,null))['then'](removeEntity(_0x181d79,null))[_0xace3('0x3b')](handleError(_0x181d79,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 8cd655b..8f45e03 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 _0x6dcc=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4'];(function(_0x1da21d,_0x2cdf5e){var _0x1418a6=function(_0x5e0c18){while(--_0x5e0c18){_0x1da21d['push'](_0x1da21d['shift']());}};_0x1418a6(++_0x2cdf5e);}(_0x6dcc,0xa6));var _0xc6dc=function(_0x3569d0,_0x2def24){_0x3569d0=_0x3569d0-0x0;var _0xe3d161=_0x6dcc[_0x3569d0];return _0xe3d161;};'use strict';var _=require(_0xc6dc('0x0'));var util=require(_0xc6dc('0x1'));var logger=require(_0xc6dc('0x2'))(_0xc6dc('0x3'));var moment=require(_0xc6dc('0x4'));var BPromise=require(_0xc6dc('0x5'));var rp=require(_0xc6dc('0x6'));var fs=require('fs');var path=require(_0xc6dc('0x7'));var rimraf=require(_0xc6dc('0x8'));var config=require('../../config/environment');var attributes=require(_0xc6dc('0x9'));module[_0xc6dc('0xa')]=function(_0x4abca8,_0x33c249){return _0x4abca8['define'](_0xc6dc('0xb'),attributes,{'tableName':_0xc6dc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc6dc('0xd'),'collate':_0xc6dc('0xe')});};
\ No newline at end of file
+var _0xa3d4=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications'];(function(_0x5ba887,_0x331d3d){var _0x66d887=function(_0x30b14d){while(--_0x30b14d){_0x5ba887['push'](_0x5ba887['shift']());}};_0x66d887(++_0x331d3d);}(_0xa3d4,0x12e));var _0x4a3d=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xa3d4[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0x4a3d('0x0'));var logger=require(_0x4a3d('0x1'))(_0x4a3d('0x2'));var moment=require('moment');var BPromise=require(_0x4a3d('0x3'));var rp=require(_0x4a3d('0x4'));var fs=require('fs');var path=require(_0x4a3d('0x5'));var rimraf=require(_0x4a3d('0x6'));var config=require(_0x4a3d('0x7'));var attributes=require(_0x4a3d('0x8'));module[_0x4a3d('0x9')]=function(_0x5bb9d0,_0x486c9b){return _0x5bb9d0[_0x4a3d('0xa')](_0x4a3d('0xb'),attributes,{'tableName':_0x4a3d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4a3d('0xd'),'collate':_0x4a3d('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index fafb595..f134cbe 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 _0x0911=['util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash'];(function(_0x49d5a6,_0x3a1f12){var _0x56d4fa=function(_0x1faeb8){while(--_0x1faeb8){_0x49d5a6['push'](_0x49d5a6['shift']());}};_0x56d4fa(++_0x3a1f12);}(_0x0911,0x1b8));var _0x1091=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x0911[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x1091('0x0'));var util=require(_0x1091('0x1'));var moment=require('moment');var BPromise=require(_0x1091('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1091('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1091('0x4'));var logger=require(_0x1091('0x5'))(_0x1091('0x6'));var config=require(_0x1091('0x7'));var jayson=require(_0x1091('0x8'));var client=jayson[_0x1091('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x526c0e,_0x193e63,_0x1a4d12){return new BPromise(function(_0x2ddfc4,_0x29f3a7){return client[_0x1091('0xa')](_0x526c0e,_0x1a4d12)[_0x1091('0xb')](function(_0x141301){logger[_0x1091('0xc')](_0x1091('0xd'),_0x193e63,'request\x20sent');logger[_0x1091('0xe')](_0x1091('0xf'),_0x193e63,_0x1091('0x10'),JSON[_0x1091('0x11')](_0x141301));if(_0x141301[_0x1091('0x12')]){if(_0x141301[_0x1091('0x12')]['code']===0x1f4){logger[_0x1091('0x12')](_0x1091('0xd'),_0x193e63,_0x141301[_0x1091('0x12')][_0x1091('0x13')]);return _0x29f3a7(_0x141301[_0x1091('0x12')][_0x1091('0x13')]);}logger['error'](_0x1091('0xd'),_0x193e63,_0x141301[_0x1091('0x12')]['message']);return _0x2ddfc4(_0x141301[_0x1091('0x12')][_0x1091('0x13')]);}else{logger[_0x1091('0xc')](_0x1091('0xd'),_0x193e63,_0x1091('0x10'));_0x2ddfc4(_0x141301['result'][_0x1091('0x13')]);}})[_0x1091('0x14')](function(_0x122d67){logger[_0x1091('0x12')]('ChatApplication,\x20%s,\x20%s',_0x193e63,_0x122d67);_0x29f3a7(_0x122d67);});});}
\ No newline at end of file
+var _0x9c81=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c81,0x112));var _0x19c8=function(_0x37dc98,_0x5ad75a){_0x37dc98=_0x37dc98-0x0;var _0x2dc963=_0x9c81[_0x37dc98];return _0x2dc963;};'use strict';var _=require(_0x19c8('0x0'));var util=require(_0x19c8('0x1'));var moment=require(_0x19c8('0x2'));var BPromise=require(_0x19c8('0x3'));var rs=require(_0x19c8('0x4'));var fs=require('fs');var Redis=require(_0x19c8('0x5'));var db=require(_0x19c8('0x6'))['db'];var utils=require(_0x19c8('0x7'));var logger=require(_0x19c8('0x8'))('rpc');var config=require(_0x19c8('0x9'));var jayson=require(_0x19c8('0xa'));var client=jayson[_0x19c8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f14db,_0x297f7d,_0x2f125d){return new BPromise(function(_0x277db5,_0x314d35){return client[_0x19c8('0xc')](_0x2f14db,_0x2f125d)[_0x19c8('0xd')](function(_0x132dcb){logger[_0x19c8('0xe')](_0x19c8('0xf'),_0x297f7d,'request\x20sent');logger[_0x19c8('0x10')](_0x19c8('0x11'),_0x297f7d,'request\x20sent',JSON[_0x19c8('0x12')](_0x132dcb));if(_0x132dcb[_0x19c8('0x13')]){if(_0x132dcb['error'][_0x19c8('0x14')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x297f7d,_0x132dcb['error'][_0x19c8('0x15')]);return _0x314d35(_0x132dcb[_0x19c8('0x13')][_0x19c8('0x15')]);}logger[_0x19c8('0x13')](_0x19c8('0xf'),_0x297f7d,_0x132dcb[_0x19c8('0x13')][_0x19c8('0x15')]);return _0x277db5(_0x132dcb[_0x19c8('0x13')][_0x19c8('0x15')]);}else{logger[_0x19c8('0xe')](_0x19c8('0xf'),_0x297f7d,_0x19c8('0x16'));_0x277db5(_0x132dcb[_0x19c8('0x17')][_0x19c8('0x15')]);}})[_0x19c8('0x18')](function(_0x5ea467){logger[_0x19c8('0x13')](_0x19c8('0xf'),_0x297f7d,_0x5ea467);_0x314d35(_0x5ea467);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index c74623d..f898bf4 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 _0x93a7=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','put','/:id','update','delete','destroy'];(function(_0x34a434,_0x19fb02){var _0x5ca262=function(_0x5ccd59){while(--_0x5ccd59){_0x34a434['push'](_0x34a434['shift']());}};_0x5ca262(++_0x19fb02);}(_0x93a7,0x1d1));var _0x793a=function(_0x599776,_0x2e740f){_0x599776=_0x599776-0x0;var _0x3db1cc=_0x93a7[_0x599776];return _0x3db1cc;};'use strict';var multer=require(_0x793a('0x0'));var util=require('util');var path=require(_0x793a('0x1'));var timeout=require(_0x793a('0x2'));var express=require(_0x793a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x793a('0x4'));var interaction=require(_0x793a('0x5'));var config=require(_0x793a('0x6'));var controller=require(_0x793a('0x7'));router[_0x793a('0x8')]('/:id',auth[_0x793a('0x9')](),controller['show']);router[_0x793a('0xa')](_0x793a('0xb'),auth[_0x793a('0x9')](),controller[_0x793a('0xc')]);router[_0x793a('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x793a('0xe')]);module[_0x793a('0xf')]=router;
\ No newline at end of file
+var _0xe254=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x18175b,_0x4d7376){var _0x210d45=function(_0x24f924){while(--_0x24f924){_0x18175b['push'](_0x18175b['shift']());}};_0x210d45(++_0x4d7376);}(_0xe254,0xa7));var _0x4e25=function(_0x4583cb,_0x4fff10){_0x4583cb=_0x4583cb-0x0;var _0x204e0c=_0xe254[_0x4583cb];return _0x204e0c;};'use strict';var multer=require(_0x4e25('0x0'));var util=require(_0x4e25('0x1'));var path=require(_0x4e25('0x2'));var timeout=require(_0x4e25('0x3'));var express=require(_0x4e25('0x4'));var router=express[_0x4e25('0x5')]();var fs_extra=require(_0x4e25('0x6'));var auth=require(_0x4e25('0x7'));var interaction=require(_0x4e25('0x8'));var config=require(_0x4e25('0x9'));var controller=require(_0x4e25('0xa'));router[_0x4e25('0xb')](_0x4e25('0xc'),auth[_0x4e25('0xd')](),controller[_0x4e25('0xe')]);router[_0x4e25('0xf')](_0x4e25('0xc'),auth[_0x4e25('0xd')](),controller[_0x4e25('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4e25('0x11')]);module[_0x4e25('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 6f11f2c..3d3220b 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 _0xfe8f=['BOOLEAN','STRING'];(function(_0x43412a,_0x5cb519){var _0xc0e6aa=function(_0x3de05b){while(--_0x3de05b){_0x43412a['push'](_0x43412a['shift']());}};_0xc0e6aa(++_0x5cb519);}(_0xfe8f,0xdb));var _0xffe8=function(_0x147813,_0x4239d2){_0x147813=_0x147813-0x0;var _0x56648f=_0xfe8f[_0x147813];return _0x56648f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xffe8('0x0')]},'write':{'type':Sequelize[_0xffe8('0x1')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x04e7=['exports','STRING','sequelize'];(function(_0x5815cc,_0x22ac53){var _0x6a8e=function(_0x2ceec6){while(--_0x2ceec6){_0x5815cc['push'](_0x5815cc['shift']());}};_0x6a8e(++_0x22ac53);}(_0x04e7,0x1ca));var _0x704e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x04e7[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x704e('0x0'));module[_0x704e('0x1')]={'name':{'type':Sequelize[_0x704e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x704e('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 2b8da3a..c833aa0 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 _0x9bff=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','length','includeAll','find','body','describe','getUnread','user','addMembers','ids','omit','getMembers','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','create','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x3df1e9,_0x3cd30e){var _0xd6b371=function(_0x4b5457){while(--_0x4b5457){_0x3df1e9['push'](_0x3df1e9['shift']());}};_0xd6b371(++_0x3cd30e);}(_0x9bff,0xf3));var _0xf9bf=function(_0x2aca66,_0x2cf8d6){_0x2aca66=_0x2aca66-0x0;var _0x569919=_0x9bff[_0x2aca66];return _0x569919;};'use strict';var emlformat=require(_0xf9bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf9bf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf9bf('0x2'));var moment=require(_0xf9bf('0x3'));var BPromise=require(_0xf9bf('0x4'));var Mustache=require(_0xf9bf('0x5'));var util=require('util');var path=require(_0xf9bf('0x6'));var sox=require(_0xf9bf('0x7'));var csv=require(_0xf9bf('0x8'));var ejs=require(_0xf9bf('0x9'));var fs=require('fs');var fs_extra=require(_0xf9bf('0xa'));var _=require(_0xf9bf('0xb'));var squel=require('squel');var crypto=require(_0xf9bf('0xc'));var jsforce=require(_0xf9bf('0xd'));var deskjs=require(_0xf9bf('0xe'));var toCsv=require(_0xf9bf('0x8'));var querystring=require('querystring');var Papa=require(_0xf9bf('0xf'));var Redis=require(_0xf9bf('0x10'));var authService=require(_0xf9bf('0x11'));var qs=require(_0xf9bf('0x12'));var as=require(_0xf9bf('0x13'));var hardwareService=require(_0xf9bf('0x14'));var logger=require(_0xf9bf('0x15'))(_0xf9bf('0x16'));var utils=require(_0xf9bf('0x17'));var config=require(_0xf9bf('0x18'));var licenseUtil=require(_0xf9bf('0x19'));var db=require(_0xf9bf('0x1a'))['db'];config[_0xf9bf('0x1b')]=_[_0xf9bf('0x1c')](config[_0xf9bf('0x1b')],{'host':_0xf9bf('0x1d'),'port':0x18eb});var socket=require(_0xf9bf('0x1e'))(new Redis(config[_0xf9bf('0x1b')]));require('./chatGroup.socket')[_0xf9bf('0x1f')](socket);function respondWithStatusCode(_0x4847b1,_0x19f7ab){_0x19f7ab=_0x19f7ab||0xcc;return function(_0x3000b6){if(_0x3000b6){return _0x4847b1[_0xf9bf('0x20')](_0x19f7ab);}return _0x4847b1[_0xf9bf('0x21')](_0x19f7ab)[_0xf9bf('0x22')]();};}function respondWithResult(_0x4fa35a,_0x1dbb45){_0x1dbb45=_0x1dbb45||0xc8;return function(_0x360c06){if(_0x360c06){return _0x4fa35a[_0xf9bf('0x21')](_0x1dbb45)[_0xf9bf('0x23')](_0x360c06);}};}function respondWithFilteredResult(_0x304a07,_0x128997){return function(_0x2167f9){if(_0x2167f9){var _0x56ed29=typeof _0x128997[_0xf9bf('0x24')]===_0xf9bf('0x25')&&typeof _0x128997[_0xf9bf('0x26')]===_0xf9bf('0x25');var _0x210aff=_0x2167f9[_0xf9bf('0x27')];var _0x42f558=_0x56ed29?0x0:_0x128997[_0xf9bf('0x24')];var _0x5c55fb=_0x56ed29?_0x2167f9[_0xf9bf('0x27')]:_0x128997[_0xf9bf('0x24')]+_0x128997['limit'];var _0xca782c;if(_0x5c55fb>=_0x210aff){_0x5c55fb=_0x210aff;_0xca782c=0xc8;}else{_0xca782c=0xce;}_0x304a07[_0xf9bf('0x21')](_0xca782c);return _0x304a07[_0xf9bf('0x28')](_0xf9bf('0x29'),_0x42f558+'-'+_0x5c55fb+'/'+_0x210aff)[_0xf9bf('0x23')](_0x2167f9);}return null;};}function patchUpdates(_0x3f4d2b){return function(_0x439891){try{jsonpatch[_0xf9bf('0x2a')](_0x439891,_0x3f4d2b,!![]);}catch(_0x41edcc){return BPromise[_0xf9bf('0x2b')](_0x41edcc);}return _0x439891[_0xf9bf('0x2c')]();};}function saveUpdates(_0x1cde77,_0x1761b3){return function(_0x4f1441){if(_0x4f1441){return _0x4f1441[_0xf9bf('0x2d')](_0x1cde77)['then'](function(_0x1054e6){return _0x1054e6;});}return null;};}function removeEntity(_0x2de5b6,_0x58fc49){return function(_0xbdac47){if(_0xbdac47){return _0xbdac47[_0xf9bf('0x2e')]()[_0xf9bf('0x2f')](function(){_0x2de5b6[_0xf9bf('0x21')](0xcc)[_0xf9bf('0x22')]();});}};}function handleEntityNotFound(_0x6e429f,_0x3f8312){return function(_0x4bdb47){if(!_0x4bdb47){_0x6e429f['sendStatus'](0x194);}return _0x4bdb47;};}function handleError(_0x42141b,_0x2bc01c){_0x2bc01c=_0x2bc01c||0x1f4;return function(_0x15b1d6){logger[_0xf9bf('0x30')](_0x15b1d6['stack']);if(_0x15b1d6[_0xf9bf('0x31')]){delete _0x15b1d6[_0xf9bf('0x31')];}_0x42141b[_0xf9bf('0x21')](_0x2bc01c)[_0xf9bf('0x32')](_0x15b1d6);};}exports[_0xf9bf('0x33')]=function(_0x499c7e,_0xc99246){var _0x41897c={},_0x1d51cb={},_0x2471db={'count':0x0,'rows':[]};var _0x429e96=_[_0xf9bf('0x34')](db[_0xf9bf('0x35')][_0xf9bf('0x36')],function(_0x3e18fb){return{'name':_0x3e18fb[_0xf9bf('0x37')],'type':_0x3e18fb[_0xf9bf('0x38')][_0xf9bf('0x39')]};});_0x1d51cb[_0xf9bf('0x3a')]=_['map'](_0x429e96,_0xf9bf('0x31'));_0x1d51cb[_0xf9bf('0x3b')]=_[_0xf9bf('0x3c')](_0x499c7e[_0xf9bf('0x3b')]);_0x1d51cb[_0xf9bf('0x3d')]=_[_0xf9bf('0x3e')](_0x1d51cb[_0xf9bf('0x3a')],_0x1d51cb[_0xf9bf('0x3b')]);_0x41897c[_0xf9bf('0x3f')]=_[_0xf9bf('0x3e')](_0x1d51cb['model'],qs['fields'](_0x499c7e[_0xf9bf('0x3b')][_0xf9bf('0x40')]));_0x41897c[_0xf9bf('0x3f')]=_0x41897c[_0xf9bf('0x3f')]['length']?_0x41897c[_0xf9bf('0x3f')]:_0x1d51cb[_0xf9bf('0x3a')];if(!_0x499c7e[_0xf9bf('0x3b')][_0xf9bf('0x41')](_0xf9bf('0x42'))){_0x41897c['limit']=qs[_0xf9bf('0x26')](_0x499c7e['query'][_0xf9bf('0x26')]);_0x41897c[_0xf9bf('0x24')]=qs[_0xf9bf('0x24')](_0x499c7e[_0xf9bf('0x3b')][_0xf9bf('0x24')]);}_0x41897c[_0xf9bf('0x43')]=qs[_0xf9bf('0x44')](_0x499c7e[_0xf9bf('0x3b')][_0xf9bf('0x44')]);_0x41897c[_0xf9bf('0x45')]=qs[_0xf9bf('0x3d')](_[_0xf9bf('0x46')](_0x499c7e['query'],_0x1d51cb[_0xf9bf('0x3d')]),_0x429e96);if(_0x499c7e[_0xf9bf('0x3b')][_0xf9bf('0x47')]){_0x41897c[_0xf9bf('0x45')]=_[_0xf9bf('0x48')](_0x41897c[_0xf9bf('0x45')],{'$or':_[_0xf9bf('0x34')](_0x429e96,function(_0x1f66be){if(_0x1f66be['type']!==_0xf9bf('0x49')){var _0x57697b={};_0x57697b[_0x1f66be[_0xf9bf('0x31')]]={'$like':'%'+_0x499c7e[_0xf9bf('0x3b')][_0xf9bf('0x47')]+'%'};return _0x57697b;}})});}_0x41897c=_['merge']({},_0x41897c,_0x499c7e['options']);var _0x26a95f={'where':_0x41897c[_0xf9bf('0x45')]};return db[_0xf9bf('0x35')][_0xf9bf('0x27')](_0x26a95f)['then'](function(_0x2065f3){_0x2471db[_0xf9bf('0x27')]=_0x2065f3;if(_0x499c7e[_0xf9bf('0x3b')]['includeAll']){_0x41897c[_0xf9bf('0x4a')]=[{'all':!![]}];}return db['ChatGroup'][_0xf9bf('0x4b')](_0x41897c);})[_0xf9bf('0x2f')](function(_0x37f7ec){_0x2471db['rows']=_0x37f7ec;return _0x2471db;})[_0xf9bf('0x2f')](respondWithFilteredResult(_0xc99246,_0x41897c))[_0xf9bf('0x4c')](handleError(_0xc99246,null));};exports[_0xf9bf('0x4d')]=function(_0x55010d,_0x5918b2){var _0x43e6bc={'raw':!![],'where':{'id':_0x55010d[_0xf9bf('0x4e')]['id']}},_0x26f076={};_0x26f076[_0xf9bf('0x3a')]=_[_0xf9bf('0x3c')](db[_0xf9bf('0x35')][_0xf9bf('0x36')]);_0x26f076[_0xf9bf('0x3b')]=_[_0xf9bf('0x3c')](_0x55010d[_0xf9bf('0x3b')]);_0x26f076['filters']=_[_0xf9bf('0x3e')](_0x26f076['model'],_0x26f076[_0xf9bf('0x3b')]);_0x43e6bc['attributes']=_[_0xf9bf('0x3e')](_0x26f076['model'],qs['fields'](_0x55010d[_0xf9bf('0x3b')][_0xf9bf('0x40')]));_0x43e6bc['attributes']=_0x43e6bc[_0xf9bf('0x3f')][_0xf9bf('0x4f')]?_0x43e6bc['attributes']:_0x26f076[_0xf9bf('0x3a')];if(_0x55010d[_0xf9bf('0x3b')][_0xf9bf('0x50')]){_0x43e6bc[_0xf9bf('0x4a')]=[{'all':!![]}];}_0x43e6bc=_[_0xf9bf('0x48')]({},_0x43e6bc,_0x55010d['options']);return db[_0xf9bf('0x35')][_0xf9bf('0x51')](_0x43e6bc)['then'](handleEntityNotFound(_0x5918b2,null))['then'](respondWithResult(_0x5918b2,null))[_0xf9bf('0x4c')](handleError(_0x5918b2,null));};exports['create']=function(_0x42a22e,_0x45450d){return db['ChatGroup']['create'](_0x42a22e[_0xf9bf('0x52')],{})[_0xf9bf('0x2f')](respondWithResult(_0x45450d,0xc9))[_0xf9bf('0x4c')](handleError(_0x45450d,null));};exports[_0xf9bf('0x2d')]=function(_0x445d1c,_0xf697ad){if(_0x445d1c[_0xf9bf('0x52')]['id']){delete _0x445d1c['body']['id'];}return db['ChatGroup'][_0xf9bf('0x51')]({'where':{'id':_0x445d1c[_0xf9bf('0x4e')]['id']}})[_0xf9bf('0x2f')](handleEntityNotFound(_0xf697ad,null))[_0xf9bf('0x2f')](saveUpdates(_0x445d1c[_0xf9bf('0x52')],null))[_0xf9bf('0x2f')](respondWithResult(_0xf697ad,null))[_0xf9bf('0x4c')](handleError(_0xf697ad,null));};exports[_0xf9bf('0x2e')]=function(_0x1c4412,_0xf74fe4){return db['ChatGroup']['find']({'where':{'id':_0x1c4412[_0xf9bf('0x4e')]['id']}})[_0xf9bf('0x2f')](handleEntityNotFound(_0xf74fe4,null))[_0xf9bf('0x2f')](removeEntity(_0xf74fe4,null))[_0xf9bf('0x4c')](handleError(_0xf74fe4,null));};exports[_0xf9bf('0x53')]=function(_0x4f0333,_0x1fc492){return db[_0xf9bf('0x35')][_0xf9bf('0x53')]()[_0xf9bf('0x2f')](respondWithResult(_0x1fc492,null))[_0xf9bf('0x4c')](handleError(_0x1fc492,null));};exports[_0xf9bf('0x54')]=function(_0x336120,_0x36890b,_0x1a63ee){return db['ChatInternalMessage'][_0xf9bf('0x27')]({'where':{'ChatGroupId':_0x336120['params']['id'],'ToId':_0x336120[_0xf9bf('0x55')]['id'],'read':![]}})[_0xf9bf('0x2f')](function(_0x1fba9b){return{'id':_['toInteger'](_0x336120['params']['id']),'count':_0x1fba9b};})['then'](respondWithResult(_0x36890b,null))[_0xf9bf('0x4c')](handleError(_0x36890b,null));};exports[_0xf9bf('0x56')]=function(_0x29559b,_0x544b1,_0x2f652f){return db[_0xf9bf('0x35')][_0xf9bf('0x51')]({'where':{'id':_0x29559b[_0xf9bf('0x4e')]['id']}})[_0xf9bf('0x2f')](handleEntityNotFound(_0x544b1,null))[_0xf9bf('0x2f')](function(_0x15968b){if(_0x15968b){return _0x15968b[_0xf9bf('0x56')](_0x29559b[_0xf9bf('0x52')][_0xf9bf('0x57')],_[_0xf9bf('0x58')](_0x29559b[_0xf9bf('0x52')],['ids','id'])||{});}})[_0xf9bf('0x2f')](respondWithResult(_0x544b1,null))[_0xf9bf('0x4c')](handleError(_0x544b1,null));};exports[_0xf9bf('0x59')]=function(_0x4c8e08,_0x173a26,_0x2b5335){var _0x339e93={};var _0x270357={};var _0x2c10a8;var _0x19d323;return db[_0xf9bf('0x35')]['findOne']({'where':{'id':_0x4c8e08[_0xf9bf('0x4e')]['id']}})[_0xf9bf('0x2f')](handleEntityNotFound(_0x173a26,null))['then'](function(_0x3760c3){if(_0x3760c3){_0x2c10a8=_0x3760c3;_0x270357[_0xf9bf('0x3a')]=_[_0xf9bf('0x3c')](db['User']['rawAttributes']);_0x270357[_0xf9bf('0x3b')]=_[_0xf9bf('0x3c')](_0x4c8e08[_0xf9bf('0x3b')]);_0x270357['filters']=_[_0xf9bf('0x3e')](_0x270357[_0xf9bf('0x3a')],_0x270357['query']);_0x339e93[_0xf9bf('0x3f')]=_[_0xf9bf('0x3e')](_0x270357[_0xf9bf('0x3a')],qs[_0xf9bf('0x40')](_0x4c8e08[_0xf9bf('0x3b')]['fields']));_0x339e93['attributes']=_0x339e93[_0xf9bf('0x3f')][_0xf9bf('0x4f')]?_0x339e93[_0xf9bf('0x3f')]:_0x270357['model'];_0x339e93[_0xf9bf('0x43')]=qs[_0xf9bf('0x44')](_0x4c8e08['query'][_0xf9bf('0x44')]);_0x339e93[_0xf9bf('0x45')]=qs[_0xf9bf('0x3d')](_[_0xf9bf('0x46')](_0x4c8e08[_0xf9bf('0x3b')],_0x270357[_0xf9bf('0x3d')]));if(_0x4c8e08['query'][_0xf9bf('0x47')]){_0x339e93[_0xf9bf('0x45')]=_[_0xf9bf('0x48')](_0x339e93[_0xf9bf('0x45')],{'$or':_[_0xf9bf('0x34')](_0x339e93[_0xf9bf('0x3f')],function(_0x5c77f7){var _0x2d22c0={};_0x2d22c0[_0x5c77f7]={'$like':'%'+_0x4c8e08[_0xf9bf('0x3b')][_0xf9bf('0x47')]+'%'};return _0x2d22c0;})});}_0x339e93=_[_0xf9bf('0x48')]({},_0x339e93,_0x4c8e08['options']);return _0x2c10a8[_0xf9bf('0x59')](_0x339e93);}})[_0xf9bf('0x2f')](function(_0x6ef2e1){if(_0x6ef2e1){_0x19d323=_0x6ef2e1[_0xf9bf('0x4f')];if(!_0x4c8e08[_0xf9bf('0x3b')]['hasOwnProperty'](_0xf9bf('0x42'))){_0x339e93[_0xf9bf('0x26')]=qs[_0xf9bf('0x26')](_0x4c8e08['query'][_0xf9bf('0x26')]);_0x339e93[_0xf9bf('0x24')]=qs[_0xf9bf('0x24')](_0x4c8e08[_0xf9bf('0x3b')]['offset']);}return _0x2c10a8[_0xf9bf('0x59')](_0x339e93);}})[_0xf9bf('0x2f')](function(_0xc0bf71){if(_0xc0bf71){return _0xc0bf71?{'count':_0x19d323,'rows':_0xc0bf71}:null;}})[_0xf9bf('0x2f')](respondWithResult(_0x173a26,null))[_0xf9bf('0x4c')](handleError(_0x173a26,null));};exports[_0xf9bf('0x5a')]=function(_0x287592,_0x9ed10d,_0x14ee8b){return db['ChatGroup'][_0xf9bf('0x51')]({'where':{'id':_0x287592[_0xf9bf('0x4e')]['id']}})[_0xf9bf('0x2f')](handleEntityNotFound(_0x9ed10d,null))['then'](function(_0x53e87c){if(_0x53e87c){return _0x53e87c['removeMembers'](_0x287592['query'][_0xf9bf('0x57')]);}})['then'](respondWithStatusCode(_0x9ed10d,null))[_0xf9bf('0x4c')](handleError(_0x9ed10d,null));};exports[_0xf9bf('0x5b')]=function(_0xc3358e,_0x132077,_0x4804ee){if(_0xc3358e['body']['id']){delete _0xc3358e[_0xf9bf('0x52')]['id'];}return db[_0xf9bf('0x35')][_0xf9bf('0x51')]({'where':{'id':_0xc3358e[_0xf9bf('0x4e')]['id']}})[_0xf9bf('0x2f')](handleEntityNotFound(_0x132077,null))[_0xf9bf('0x2f')](function(_0x2e8761){if(_0x2e8761){_0xc3358e[_0xf9bf('0x52')][_0xf9bf('0x5c')]=_0x2e8761['id'];return db[_0xf9bf('0x5d')][_0xf9bf('0x5e')](_0xc3358e[_0xf9bf('0x52')]);}})['then'](respondWithResult(_0x132077,null))[_0xf9bf('0x4c')](handleError(_0x132077,null));};exports[_0xf9bf('0x5f')]=function(_0x36d4f7,_0x3a30ed,_0x196cfd){var _0x26816e={};var _0x2d8418={};var _0x373803;var _0x264ada;return db[_0xf9bf('0x35')][_0xf9bf('0x60')]({'where':{'id':_0x36d4f7['params']['id']}})[_0xf9bf('0x2f')](handleEntityNotFound(_0x3a30ed,null))['then'](function(_0x5d1b51){if(_0x5d1b51){_0x373803=_0x5d1b51;_0x2d8418['model']=_[_0xf9bf('0x3c')](db['ChatInternalMessage']['rawAttributes']);_0x2d8418[_0xf9bf('0x3b')]=_[_0xf9bf('0x3c')](_0x36d4f7[_0xf9bf('0x3b')]);_0x2d8418[_0xf9bf('0x3d')]=_['intersection'](_0x2d8418[_0xf9bf('0x3a')],_0x2d8418[_0xf9bf('0x3b')]);_0x26816e[_0xf9bf('0x3f')]=_[_0xf9bf('0x3e')](_0x2d8418[_0xf9bf('0x3a')],qs[_0xf9bf('0x40')](_0x36d4f7[_0xf9bf('0x3b')][_0xf9bf('0x40')]));_0x26816e['attributes']=_0x26816e[_0xf9bf('0x3f')][_0xf9bf('0x4f')]?_0x26816e[_0xf9bf('0x3f')]:_0x2d8418['model'];_0x26816e['order']=qs[_0xf9bf('0x44')](_0x36d4f7[_0xf9bf('0x3b')][_0xf9bf('0x44')]);_0x26816e[_0xf9bf('0x45')]=qs[_0xf9bf('0x3d')](_[_0xf9bf('0x46')](_0x36d4f7[_0xf9bf('0x3b')],_0x2d8418[_0xf9bf('0x3d')]));if(_0x36d4f7[_0xf9bf('0x3b')][_0xf9bf('0x47')]){_0x26816e[_0xf9bf('0x45')]=_[_0xf9bf('0x48')](_0x26816e[_0xf9bf('0x45')],{'$or':_['map'](_0x26816e[_0xf9bf('0x3f')],function(_0x43c07c){var _0x22aaba={};_0x22aaba[_0x43c07c]={'$like':'%'+_0x36d4f7['query']['filter']+'%'};return _0x22aaba;})});}if(_0x36d4f7[_0xf9bf('0x3b')][_0xf9bf('0x61')]){var _0x54a59a=_0x36d4f7[_0xf9bf('0x3b')][_0xf9bf('0x61')][_0xf9bf('0x62')](',');var _0x5b38a1={};_0x5b38a1[_0x54a59a[0x0]]={'$gte':moment(_0x54a59a[0x1])[_0xf9bf('0x63')](_0xf9bf('0x64'))};_0x26816e[_0xf9bf('0x45')]=_[_0xf9bf('0x48')](_0x26816e[_0xf9bf('0x45')],_0x5b38a1);}_0x26816e=_[_0xf9bf('0x48')]({},_0x26816e,_0x36d4f7[_0xf9bf('0x65')]);return _0x373803[_0xf9bf('0x5f')](_0x26816e);}})[_0xf9bf('0x2f')](function(_0x5c23cd){if(_0x5c23cd){_0x264ada=_0x5c23cd[_0xf9bf('0x4f')];if(!_0x36d4f7[_0xf9bf('0x3b')][_0xf9bf('0x41')](_0xf9bf('0x42'))){_0x26816e[_0xf9bf('0x26')]=qs[_0xf9bf('0x26')](_0x36d4f7[_0xf9bf('0x3b')][_0xf9bf('0x26')]);_0x26816e[_0xf9bf('0x24')]=qs[_0xf9bf('0x24')](_0x36d4f7['query'][_0xf9bf('0x24')]);}return _0x373803['getMessages'](_0x26816e);}})[_0xf9bf('0x2f')](function(_0x341b01){if(_0x341b01){return _0x341b01?{'count':_0x264ada,'rows':_0x341b01}:null;}})[_0xf9bf('0x2f')](respondWithResult(_0x3a30ed,null))['catch'](handleError(_0x3a30ed,null));};
\ No newline at end of file
+var _0xdf38=['order','sort','pick','merge','VIRTUAL','filter','options','where','includeAll','include','findAll','find','catch','body','params','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','findOne','User','getMembers','removeMembers','ChatGroupId','create','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x23ca3a,_0xe44c43){var _0x5c1aab=function(_0x29bcdd){while(--_0x29bcdd){_0x23ca3a['push'](_0x23ca3a['shift']());}};_0x5c1aab(++_0xe44c43);}(_0xdf38,0x1a8));var _0x8df3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xdf38[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x8df3('0x0'));var rimraf=require(_0x8df3('0x1'));var zipdir=require(_0x8df3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8df3('0x3'));var moment=require(_0x8df3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8df3('0x5'));var util=require(_0x8df3('0x6'));var path=require(_0x8df3('0x7'));var sox=require(_0x8df3('0x8'));var csv=require(_0x8df3('0x9'));var ejs=require(_0x8df3('0xa'));var fs=require('fs');var fs_extra=require(_0x8df3('0xb'));var _=require(_0x8df3('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8df3('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8df3('0xe'));var Papa=require(_0x8df3('0xf'));var Redis=require(_0x8df3('0x10'));var authService=require(_0x8df3('0x11'));var qs=require(_0x8df3('0x12'));var as=require(_0x8df3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8df3('0x14'))(_0x8df3('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8df3('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8df3('0x17')](config[_0x8df3('0x18')],{'host':_0x8df3('0x19'),'port':0x18eb});var socket=require(_0x8df3('0x1a'))(new Redis(config[_0x8df3('0x18')]));require(_0x8df3('0x1b'))[_0x8df3('0x1c')](socket);function respondWithStatusCode(_0x351dc0,_0x32c4c8){_0x32c4c8=_0x32c4c8||0xcc;return function(_0x1212bf){if(_0x1212bf){return _0x351dc0[_0x8df3('0x1d')](_0x32c4c8);}return _0x351dc0['status'](_0x32c4c8)['end']();};}function respondWithResult(_0x202c90,_0x4502b7){_0x4502b7=_0x4502b7||0xc8;return function(_0x32c7ff){if(_0x32c7ff){return _0x202c90[_0x8df3('0x1e')](_0x4502b7)[_0x8df3('0x1f')](_0x32c7ff);}};}function respondWithFilteredResult(_0x5eb673,_0x3e83a3){return function(_0x245df9){if(_0x245df9){var _0x5cbada=typeof _0x3e83a3[_0x8df3('0x20')]===_0x8df3('0x21')&&typeof _0x3e83a3[_0x8df3('0x22')]===_0x8df3('0x21');var _0x4383b4=_0x245df9[_0x8df3('0x23')];var _0x169c03=_0x5cbada?0x0:_0x3e83a3[_0x8df3('0x20')];var _0x4b9dd5=_0x5cbada?_0x245df9[_0x8df3('0x23')]:_0x3e83a3['offset']+_0x3e83a3[_0x8df3('0x22')];var _0x1709f2;if(_0x4b9dd5>=_0x4383b4){_0x4b9dd5=_0x4383b4;_0x1709f2=0xc8;}else{_0x1709f2=0xce;}_0x5eb673['status'](_0x1709f2);return _0x5eb673[_0x8df3('0x24')](_0x8df3('0x25'),_0x169c03+'-'+_0x4b9dd5+'/'+_0x4383b4)[_0x8df3('0x1f')](_0x245df9);}return null;};}function patchUpdates(_0x7cfe0b){return function(_0x407620){try{jsonpatch[_0x8df3('0x26')](_0x407620,_0x7cfe0b,!![]);}catch(_0x13ccc8){return BPromise[_0x8df3('0x27')](_0x13ccc8);}return _0x407620[_0x8df3('0x28')]();};}function saveUpdates(_0x31a5e9,_0x4d9097){return function(_0x391cc8){if(_0x391cc8){return _0x391cc8[_0x8df3('0x29')](_0x31a5e9)[_0x8df3('0x2a')](function(_0xa7d8d8){return _0xa7d8d8;});}return null;};}function removeEntity(_0x41383b,_0x3ac5c5){return function(_0x4ab044){if(_0x4ab044){return _0x4ab044[_0x8df3('0x2b')]()[_0x8df3('0x2a')](function(){_0x41383b[_0x8df3('0x1e')](0xcc)[_0x8df3('0x2c')]();});}};}function handleEntityNotFound(_0x2f6aaa,_0x31638c){return function(_0x296fbf){if(!_0x296fbf){_0x2f6aaa[_0x8df3('0x1d')](0x194);}return _0x296fbf;};}function handleError(_0x4683fc,_0x2c71f9){_0x2c71f9=_0x2c71f9||0x1f4;return function(_0x3daad2){logger[_0x8df3('0x2d')](_0x3daad2[_0x8df3('0x2e')]);if(_0x3daad2[_0x8df3('0x2f')]){delete _0x3daad2['name'];}_0x4683fc[_0x8df3('0x1e')](_0x2c71f9)[_0x8df3('0x30')](_0x3daad2);};}exports[_0x8df3('0x31')]=function(_0x2f786b,_0x11d0a1){var _0x4dead0={},_0x5ec0b6={},_0x3b49d8={'count':0x0,'rows':[]};var _0x137060=_[_0x8df3('0x32')](db[_0x8df3('0x33')][_0x8df3('0x34')],function(_0xeb1e15){return{'name':_0xeb1e15[_0x8df3('0x35')],'type':_0xeb1e15[_0x8df3('0x36')][_0x8df3('0x37')]};});_0x5ec0b6[_0x8df3('0x38')]=_[_0x8df3('0x32')](_0x137060,'name');_0x5ec0b6[_0x8df3('0x39')]=_[_0x8df3('0x3a')](_0x2f786b[_0x8df3('0x39')]);_0x5ec0b6[_0x8df3('0x3b')]=_['intersection'](_0x5ec0b6['model'],_0x5ec0b6[_0x8df3('0x39')]);_0x4dead0['attributes']=_[_0x8df3('0x3c')](_0x5ec0b6[_0x8df3('0x38')],qs[_0x8df3('0x3d')](_0x2f786b[_0x8df3('0x39')][_0x8df3('0x3d')]));_0x4dead0['attributes']=_0x4dead0[_0x8df3('0x3e')][_0x8df3('0x3f')]?_0x4dead0[_0x8df3('0x3e')]:_0x5ec0b6[_0x8df3('0x38')];if(!_0x2f786b['query'][_0x8df3('0x40')](_0x8df3('0x41'))){_0x4dead0[_0x8df3('0x22')]=qs['limit'](_0x2f786b['query']['limit']);_0x4dead0[_0x8df3('0x20')]=qs[_0x8df3('0x20')](_0x2f786b['query'][_0x8df3('0x20')]);}_0x4dead0[_0x8df3('0x42')]=qs[_0x8df3('0x43')](_0x2f786b[_0x8df3('0x39')][_0x8df3('0x43')]);_0x4dead0['where']=qs[_0x8df3('0x3b')](_[_0x8df3('0x44')](_0x2f786b[_0x8df3('0x39')],_0x5ec0b6[_0x8df3('0x3b')]),_0x137060);if(_0x2f786b[_0x8df3('0x39')]['filter']){_0x4dead0['where']=_[_0x8df3('0x45')](_0x4dead0['where'],{'$or':_[_0x8df3('0x32')](_0x137060,function(_0x88b63c){if(_0x88b63c[_0x8df3('0x36')]!==_0x8df3('0x46')){var _0x5e6d0d={};_0x5e6d0d[_0x88b63c['name']]={'$like':'%'+_0x2f786b[_0x8df3('0x39')][_0x8df3('0x47')]+'%'};return _0x5e6d0d;}})});}_0x4dead0=_['merge']({},_0x4dead0,_0x2f786b[_0x8df3('0x48')]);var _0x4561cc={'where':_0x4dead0[_0x8df3('0x49')]};return db[_0x8df3('0x33')][_0x8df3('0x23')](_0x4561cc)[_0x8df3('0x2a')](function(_0xc6d18c){_0x3b49d8[_0x8df3('0x23')]=_0xc6d18c;if(_0x2f786b[_0x8df3('0x39')][_0x8df3('0x4a')]){_0x4dead0[_0x8df3('0x4b')]=[{'all':!![]}];}return db[_0x8df3('0x33')][_0x8df3('0x4c')](_0x4dead0);})[_0x8df3('0x2a')](function(_0x4478c6){_0x3b49d8['rows']=_0x4478c6;return _0x3b49d8;})[_0x8df3('0x2a')](respondWithFilteredResult(_0x11d0a1,_0x4dead0))['catch'](handleError(_0x11d0a1,null));};exports['show']=function(_0x3a47ca,_0x5344d2){var _0x35c8c6={'raw':!![],'where':{'id':_0x3a47ca['params']['id']}},_0x1a6e1b={};_0x1a6e1b[_0x8df3('0x38')]=_['keys'](db[_0x8df3('0x33')][_0x8df3('0x34')]);_0x1a6e1b[_0x8df3('0x39')]=_[_0x8df3('0x3a')](_0x3a47ca[_0x8df3('0x39')]);_0x1a6e1b[_0x8df3('0x3b')]=_['intersection'](_0x1a6e1b[_0x8df3('0x38')],_0x1a6e1b[_0x8df3('0x39')]);_0x35c8c6[_0x8df3('0x3e')]=_[_0x8df3('0x3c')](_0x1a6e1b[_0x8df3('0x38')],qs[_0x8df3('0x3d')](_0x3a47ca[_0x8df3('0x39')][_0x8df3('0x3d')]));_0x35c8c6[_0x8df3('0x3e')]=_0x35c8c6[_0x8df3('0x3e')]['length']?_0x35c8c6[_0x8df3('0x3e')]:_0x1a6e1b[_0x8df3('0x38')];if(_0x3a47ca[_0x8df3('0x39')][_0x8df3('0x4a')]){_0x35c8c6[_0x8df3('0x4b')]=[{'all':!![]}];}_0x35c8c6=_[_0x8df3('0x45')]({},_0x35c8c6,_0x3a47ca[_0x8df3('0x48')]);return db['ChatGroup'][_0x8df3('0x4d')](_0x35c8c6)[_0x8df3('0x2a')](handleEntityNotFound(_0x5344d2,null))[_0x8df3('0x2a')](respondWithResult(_0x5344d2,null))[_0x8df3('0x4e')](handleError(_0x5344d2,null));};exports['create']=function(_0xcfb8d5,_0x26ffcf){return db[_0x8df3('0x33')]['create'](_0xcfb8d5[_0x8df3('0x4f')],{})[_0x8df3('0x2a')](respondWithResult(_0x26ffcf,0xc9))[_0x8df3('0x4e')](handleError(_0x26ffcf,null));};exports[_0x8df3('0x29')]=function(_0x3fadc0,_0x40dd34){if(_0x3fadc0[_0x8df3('0x4f')]['id']){delete _0x3fadc0[_0x8df3('0x4f')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x3fadc0[_0x8df3('0x50')]['id']}})[_0x8df3('0x2a')](handleEntityNotFound(_0x40dd34,null))[_0x8df3('0x2a')](saveUpdates(_0x3fadc0[_0x8df3('0x4f')],null))[_0x8df3('0x2a')](respondWithResult(_0x40dd34,null))[_0x8df3('0x4e')](handleError(_0x40dd34,null));};exports[_0x8df3('0x2b')]=function(_0x5c0ace,_0x12942f){return db[_0x8df3('0x33')][_0x8df3('0x4d')]({'where':{'id':_0x5c0ace[_0x8df3('0x50')]['id']}})[_0x8df3('0x2a')](handleEntityNotFound(_0x12942f,null))[_0x8df3('0x2a')](removeEntity(_0x12942f,null))[_0x8df3('0x4e')](handleError(_0x12942f,null));};exports[_0x8df3('0x51')]=function(_0x4dbe0e,_0x30f288){return db[_0x8df3('0x33')]['describe']()[_0x8df3('0x2a')](respondWithResult(_0x30f288,null))[_0x8df3('0x4e')](handleError(_0x30f288,null));};exports[_0x8df3('0x52')]=function(_0x7e94bd,_0x581207,_0x41f2a7){return db[_0x8df3('0x53')][_0x8df3('0x23')]({'where':{'ChatGroupId':_0x7e94bd[_0x8df3('0x50')]['id'],'ToId':_0x7e94bd['user']['id'],'read':![]}})['then'](function(_0x655c33){return{'id':_[_0x8df3('0x54')](_0x7e94bd[_0x8df3('0x50')]['id']),'count':_0x655c33};})[_0x8df3('0x2a')](respondWithResult(_0x581207,null))[_0x8df3('0x4e')](handleError(_0x581207,null));};exports['addMembers']=function(_0x3618d3,_0xaa5928,_0x2750b2){return db['ChatGroup'][_0x8df3('0x4d')]({'where':{'id':_0x3618d3[_0x8df3('0x50')]['id']}})[_0x8df3('0x2a')](handleEntityNotFound(_0xaa5928,null))[_0x8df3('0x2a')](function(_0x536d38){if(_0x536d38){return _0x536d38[_0x8df3('0x55')](_0x3618d3[_0x8df3('0x4f')][_0x8df3('0x56')],_[_0x8df3('0x57')](_0x3618d3[_0x8df3('0x4f')],[_0x8df3('0x56'),'id'])||{});}})[_0x8df3('0x2a')](respondWithResult(_0xaa5928,null))[_0x8df3('0x4e')](handleError(_0xaa5928,null));};exports['getMembers']=function(_0x1bd16e,_0x77859f,_0x1dfb32){var _0x113513={};var _0x44b29a={};var _0x3b5393;var _0x5453f9;return db['ChatGroup'][_0x8df3('0x58')]({'where':{'id':_0x1bd16e['params']['id']}})[_0x8df3('0x2a')](handleEntityNotFound(_0x77859f,null))[_0x8df3('0x2a')](function(_0x31f2d9){if(_0x31f2d9){_0x3b5393=_0x31f2d9;_0x44b29a['model']=_[_0x8df3('0x3a')](db[_0x8df3('0x59')]['rawAttributes']);_0x44b29a[_0x8df3('0x39')]=_['keys'](_0x1bd16e[_0x8df3('0x39')]);_0x44b29a[_0x8df3('0x3b')]=_['intersection'](_0x44b29a[_0x8df3('0x38')],_0x44b29a[_0x8df3('0x39')]);_0x113513[_0x8df3('0x3e')]=_[_0x8df3('0x3c')](_0x44b29a['model'],qs[_0x8df3('0x3d')](_0x1bd16e[_0x8df3('0x39')][_0x8df3('0x3d')]));_0x113513[_0x8df3('0x3e')]=_0x113513[_0x8df3('0x3e')]['length']?_0x113513[_0x8df3('0x3e')]:_0x44b29a[_0x8df3('0x38')];_0x113513['order']=qs['sort'](_0x1bd16e[_0x8df3('0x39')]['sort']);_0x113513['where']=qs[_0x8df3('0x3b')](_[_0x8df3('0x44')](_0x1bd16e[_0x8df3('0x39')],_0x44b29a[_0x8df3('0x3b')]));if(_0x1bd16e[_0x8df3('0x39')][_0x8df3('0x47')]){_0x113513[_0x8df3('0x49')]=_['merge'](_0x113513['where'],{'$or':_['map'](_0x113513[_0x8df3('0x3e')],function(_0x52af0e){var _0x2b0b2b={};_0x2b0b2b[_0x52af0e]={'$like':'%'+_0x1bd16e[_0x8df3('0x39')][_0x8df3('0x47')]+'%'};return _0x2b0b2b;})});}_0x113513=_[_0x8df3('0x45')]({},_0x113513,_0x1bd16e[_0x8df3('0x48')]);return _0x3b5393[_0x8df3('0x5a')](_0x113513);}})[_0x8df3('0x2a')](function(_0x1c79c5){if(_0x1c79c5){_0x5453f9=_0x1c79c5[_0x8df3('0x3f')];if(!_0x1bd16e['query']['hasOwnProperty'](_0x8df3('0x41'))){_0x113513[_0x8df3('0x22')]=qs['limit'](_0x1bd16e[_0x8df3('0x39')][_0x8df3('0x22')]);_0x113513[_0x8df3('0x20')]=qs['offset'](_0x1bd16e[_0x8df3('0x39')][_0x8df3('0x20')]);}return _0x3b5393[_0x8df3('0x5a')](_0x113513);}})[_0x8df3('0x2a')](function(_0x2033d9){if(_0x2033d9){return _0x2033d9?{'count':_0x5453f9,'rows':_0x2033d9}:null;}})[_0x8df3('0x2a')](respondWithResult(_0x77859f,null))[_0x8df3('0x4e')](handleError(_0x77859f,null));};exports[_0x8df3('0x5b')]=function(_0x208bfa,_0xc42ca5,_0x572e02){return db[_0x8df3('0x33')][_0x8df3('0x4d')]({'where':{'id':_0x208bfa['params']['id']}})[_0x8df3('0x2a')](handleEntityNotFound(_0xc42ca5,null))[_0x8df3('0x2a')](function(_0x44152d){if(_0x44152d){return _0x44152d[_0x8df3('0x5b')](_0x208bfa[_0x8df3('0x39')][_0x8df3('0x56')]);}})[_0x8df3('0x2a')](respondWithStatusCode(_0xc42ca5,null))[_0x8df3('0x4e')](handleError(_0xc42ca5,null));};exports['addMessage']=function(_0x16fd0f,_0x5cfc1a,_0x16e727){if(_0x16fd0f[_0x8df3('0x4f')]['id']){delete _0x16fd0f[_0x8df3('0x4f')]['id'];}return db[_0x8df3('0x33')][_0x8df3('0x4d')]({'where':{'id':_0x16fd0f[_0x8df3('0x50')]['id']}})[_0x8df3('0x2a')](handleEntityNotFound(_0x5cfc1a,null))[_0x8df3('0x2a')](function(_0x4d30fb){if(_0x4d30fb){_0x16fd0f[_0x8df3('0x4f')][_0x8df3('0x5c')]=_0x4d30fb['id'];return db['ChatInternalMessage'][_0x8df3('0x5d')](_0x16fd0f[_0x8df3('0x4f')]);}})['then'](respondWithResult(_0x5cfc1a,null))[_0x8df3('0x4e')](handleError(_0x5cfc1a,null));};exports[_0x8df3('0x5e')]=function(_0x18b8ed,_0x946680,_0x115407){var _0x2e2cd2={};var _0x14d04c={};var _0x4d6958;var _0x1702c6;return db['ChatGroup']['findOne']({'where':{'id':_0x18b8ed[_0x8df3('0x50')]['id']}})[_0x8df3('0x2a')](handleEntityNotFound(_0x946680,null))['then'](function(_0x16b19f){if(_0x16b19f){_0x4d6958=_0x16b19f;_0x14d04c[_0x8df3('0x38')]=_[_0x8df3('0x3a')](db[_0x8df3('0x53')][_0x8df3('0x34')]);_0x14d04c['query']=_['keys'](_0x18b8ed['query']);_0x14d04c['filters']=_[_0x8df3('0x3c')](_0x14d04c['model'],_0x14d04c[_0x8df3('0x39')]);_0x2e2cd2[_0x8df3('0x3e')]=_[_0x8df3('0x3c')](_0x14d04c[_0x8df3('0x38')],qs[_0x8df3('0x3d')](_0x18b8ed[_0x8df3('0x39')][_0x8df3('0x3d')]));_0x2e2cd2[_0x8df3('0x3e')]=_0x2e2cd2['attributes'][_0x8df3('0x3f')]?_0x2e2cd2['attributes']:_0x14d04c[_0x8df3('0x38')];_0x2e2cd2['order']=qs[_0x8df3('0x43')](_0x18b8ed[_0x8df3('0x39')][_0x8df3('0x43')]);_0x2e2cd2[_0x8df3('0x49')]=qs[_0x8df3('0x3b')](_[_0x8df3('0x44')](_0x18b8ed[_0x8df3('0x39')],_0x14d04c['filters']));if(_0x18b8ed[_0x8df3('0x39')]['filter']){_0x2e2cd2[_0x8df3('0x49')]=_[_0x8df3('0x45')](_0x2e2cd2[_0x8df3('0x49')],{'$or':_[_0x8df3('0x32')](_0x2e2cd2[_0x8df3('0x3e')],function(_0x392968){var _0x355eff={};_0x355eff[_0x392968]={'$like':'%'+_0x18b8ed[_0x8df3('0x39')]['filter']+'%'};return _0x355eff;})});}if(_0x18b8ed[_0x8df3('0x39')][_0x8df3('0x5f')]){var _0x5d2992=_0x18b8ed[_0x8df3('0x39')][_0x8df3('0x5f')][_0x8df3('0x60')](',');var _0xc544db={};_0xc544db[_0x5d2992[0x0]]={'$gte':moment(_0x5d2992[0x1])[_0x8df3('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2e2cd2[_0x8df3('0x49')]=_['merge'](_0x2e2cd2[_0x8df3('0x49')],_0xc544db);}_0x2e2cd2=_[_0x8df3('0x45')]({},_0x2e2cd2,_0x18b8ed['options']);return _0x4d6958['getMessages'](_0x2e2cd2);}})['then'](function(_0x67f8f){if(_0x67f8f){_0x1702c6=_0x67f8f['length'];if(!_0x18b8ed[_0x8df3('0x39')]['hasOwnProperty']('nolimit')){_0x2e2cd2[_0x8df3('0x22')]=qs['limit'](_0x18b8ed[_0x8df3('0x39')][_0x8df3('0x22')]);_0x2e2cd2[_0x8df3('0x20')]=qs[_0x8df3('0x20')](_0x18b8ed[_0x8df3('0x39')][_0x8df3('0x20')]);}return _0x4d6958[_0x8df3('0x5e')](_0x2e2cd2);}})[_0x8df3('0x2a')](function(_0x564f66){if(_0x564f66){return _0x564f66?{'count':_0x1702c6,'rows':_0x564f66}:null;}})[_0x8df3('0x2a')](respondWithResult(_0x946680,null))[_0x8df3('0x4e')](handleError(_0x946680,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 545ad33..4bad489 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 _0x83d4=['hasOwnProperty','hook','exports','events','setMaxListeners','update','emit'];(function(_0xf312c4,_0x5d81ca){var _0x3b3ca1=function(_0x315c81){while(--_0x315c81){_0xf312c4['push'](_0xf312c4['shift']());}};_0x3b3ca1(++_0x5d81ca);}(_0x83d4,0xf1));var _0x483d=function(_0x13404e,_0x3a20c1){_0x13404e=_0x13404e-0x0;var _0x259fa3=_0x83d4[_0x13404e];return _0x259fa3;};'use strict';var EventEmitter=require(_0x483d('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x483d('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x483d('0x2'),'afterDestroy':'remove'};function emitEvent(_0x838b4c){return function(_0x447f73,_0x224829,_0x1e1c37){ChatGroupEvents[_0x483d('0x3')](_0x838b4c+':'+_0x447f73['id'],_0x447f73);ChatGroupEvents['emit'](_0x838b4c,_0x447f73);_0x1e1c37(null);};}for(var e in events){if(events[_0x483d('0x4')](e)){var event=events[e];ChatGroup[_0x483d('0x5')](e,emitEvent(event));}}module[_0x483d('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0x9c4a=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x2a78c5,_0x4bd133){var _0x4c0fcb=function(_0x4441da){while(--_0x4441da){_0x2a78c5['push'](_0x2a78c5['shift']());}};_0x4c0fcb(++_0x4bd133);}(_0x9c4a,0x1dd));var _0xa9c4=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x9c4a[_0x4dc7b9];return _0x3ab114;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xa9c4('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xa9c4('0x1')](0x0);var events={'afterCreate':_0xa9c4('0x2'),'afterUpdate':'update','afterDestroy':_0xa9c4('0x3')};function emitEvent(_0x58635b){return function(_0x25bba6,_0x34730e,_0x115c75){ChatGroupEvents[_0xa9c4('0x4')](_0x58635b+':'+_0x25bba6['id'],_0x25bba6);ChatGroupEvents[_0xa9c4('0x4')](_0x58635b,_0x25bba6);_0x115c75(null);};}for(var e in events){if(events[_0xa9c4('0x5')](e)){var event=events[e];ChatGroup[_0xa9c4('0x6')](e,emitEvent(event));}}module[_0xa9c4('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 0db81ec..2295d85 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 _0x2919=['./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x28d79e,_0x55bf08){var _0x54337=function(_0x59b8b4){while(--_0x59b8b4){_0x28d79e['push'](_0x28d79e['shift']());}};_0x54337(++_0x55bf08);}(_0x2919,0x71));var _0x9291=function(_0x252991,_0x498d8a){_0x252991=_0x252991-0x0;var _0x2c4d9b=_0x2919[_0x252991];return _0x2c4d9b;};'use strict';var _=require('lodash');var util=require(_0x9291('0x0'));var logger=require(_0x9291('0x1'))('api');var moment=require(_0x9291('0x2'));var BPromise=require('bluebird');var rp=require(_0x9291('0x3'));var fs=require('fs');var path=require(_0x9291('0x4'));var rimraf=require(_0x9291('0x5'));var config=require(_0x9291('0x6'));var attributes=require(_0x9291('0x7'));module[_0x9291('0x8')]=function(_0x5426fd,_0x4d92af){return _0x5426fd[_0x9291('0x9')](_0x9291('0xa'),attributes,{'tableName':_0x9291('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ec0=['../../config/logger','api','moment','request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash'];(function(_0x1b3287,_0x15c015){var _0x10b1bc=function(_0x104798){while(--_0x104798){_0x1b3287['push'](_0x1b3287['shift']());}};_0x10b1bc(++_0x15c015);}(_0x4ec0,0x1d8));var _0x04ec=function(_0x5171e0,_0x52c013){_0x5171e0=_0x5171e0-0x0;var _0x5da691=_0x4ec0[_0x5171e0];return _0x5da691;};'use strict';var _=require(_0x04ec('0x0'));var util=require('util');var logger=require(_0x04ec('0x1'))(_0x04ec('0x2'));var moment=require(_0x04ec('0x3'));var BPromise=require('bluebird');var rp=require(_0x04ec('0x4'));var fs=require('fs');var path=require(_0x04ec('0x5'));var rimraf=require('rimraf');var config=require(_0x04ec('0x6'));var attributes=require(_0x04ec('0x7'));module[_0x04ec('0x8')]=function(_0x2d4dcf,_0x542c42){return _0x2d4dcf[_0x04ec('0x9')]('ChatGroup',attributes,{'tableName':_0x04ec('0xa'),'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 32f0158..31d02a5 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 _0x7f42=['debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info'];(function(_0x2aa23c,_0x10a438){var _0x2ce3a5=function(_0xfc2baa){while(--_0xfc2baa){_0x2aa23c['push'](_0x2aa23c['shift']());}};_0x2ce3a5(++_0x10a438);}(_0x7f42,0x1dd));var _0x27f4=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x7f42[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x27f4('0x0'));var util=require('util');var moment=require(_0x27f4('0x1'));var BPromise=require(_0x27f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27f4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x27f4('0x4'));var logger=require('../../config/logger')(_0x27f4('0x5'));var config=require('../../config/environment');var jayson=require(_0x27f4('0x6'));var client=jayson['client'][_0x27f4('0x7')]({'port':0x232a});config[_0x27f4('0x8')]=_[_0x27f4('0x9')](config[_0x27f4('0x8')],{'host':_0x27f4('0xa'),'port':0x18eb});var socket=require(_0x27f4('0xb'))(new Redis(config[_0x27f4('0x8')]));require(_0x27f4('0xc'))[_0x27f4('0xd')](socket);function respondWithRpcPromise(_0x453565,_0x3bbb54,_0x21eab6){return new BPromise(function(_0x2fc74a,_0x247c47){return client[_0x27f4('0xe')](_0x453565,_0x21eab6)[_0x27f4('0xf')](function(_0x1ddc75){logger[_0x27f4('0x10')]('ChatGroup,\x20%s,\x20%s',_0x3bbb54,'request\x20sent');logger[_0x27f4('0x11')](_0x27f4('0x12'),_0x3bbb54,_0x27f4('0x13'),JSON[_0x27f4('0x14')](_0x1ddc75));if(_0x1ddc75[_0x27f4('0x15')]){if(_0x1ddc75[_0x27f4('0x15')][_0x27f4('0x16')]===0x1f4){logger[_0x27f4('0x15')]('ChatGroup,\x20%s,\x20%s',_0x3bbb54,_0x1ddc75['error'][_0x27f4('0x17')]);return _0x247c47(_0x1ddc75[_0x27f4('0x15')][_0x27f4('0x17')]);}logger[_0x27f4('0x15')]('ChatGroup,\x20%s,\x20%s',_0x3bbb54,_0x1ddc75[_0x27f4('0x15')][_0x27f4('0x17')]);return _0x2fc74a(_0x1ddc75[_0x27f4('0x15')]['message']);}else{logger[_0x27f4('0x10')](_0x27f4('0x18'),_0x3bbb54,_0x27f4('0x13'));_0x2fc74a(_0x1ddc75['result'][_0x27f4('0x17')]);}})[_0x27f4('0x19')](function(_0x5091e0){logger['error'](_0x27f4('0x18'),_0x3bbb54,_0x5091e0);_0x247c47(_0x5091e0);});});}
\ No newline at end of file
+var _0xde9c=['../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','debug','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x402565,_0x431efa){var _0x2ed987=function(_0x3d1fff){while(--_0x3d1fff){_0x402565['push'](_0x402565['shift']());}};_0x2ed987(++_0x431efa);}(_0xde9c,0xa9));var _0xcde9=function(_0x42718d,_0x1d114d){_0x42718d=_0x42718d-0x0;var _0x381084=_0xde9c[_0x42718d];return _0x381084;};'use strict';var _=require(_0xcde9('0x0'));var util=require(_0xcde9('0x1'));var moment=require('moment');var BPromise=require(_0xcde9('0x2'));var rs=require(_0xcde9('0x3'));var fs=require('fs');var Redis=require(_0xcde9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcde9('0x5'));var logger=require(_0xcde9('0x6'))(_0xcde9('0x7'));var config=require(_0xcde9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcde9('0x9')]({'port':0x232a});config[_0xcde9('0xa')]=_[_0xcde9('0xb')](config['redis'],{'host':_0xcde9('0xc'),'port':0x18eb});var socket=require(_0xcde9('0xd'))(new Redis(config[_0xcde9('0xa')]));require(_0xcde9('0xe'))[_0xcde9('0xf')](socket);function respondWithRpcPromise(_0x9fba8e,_0x187b6e,_0x38c601){return new BPromise(function(_0xbefa80,_0xbce3f9){return client[_0xcde9('0x10')](_0x9fba8e,_0x38c601)['then'](function(_0x1ba1cd){logger[_0xcde9('0x11')]('ChatGroup,\x20%s,\x20%s',_0x187b6e,'request\x20sent');logger[_0xcde9('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x187b6e,'request\x20sent',JSON[_0xcde9('0x13')](_0x1ba1cd));if(_0x1ba1cd[_0xcde9('0x14')]){if(_0x1ba1cd[_0xcde9('0x14')][_0xcde9('0x15')]===0x1f4){logger[_0xcde9('0x14')](_0xcde9('0x16'),_0x187b6e,_0x1ba1cd[_0xcde9('0x14')][_0xcde9('0x17')]);return _0xbce3f9(_0x1ba1cd[_0xcde9('0x14')][_0xcde9('0x17')]);}logger[_0xcde9('0x14')](_0xcde9('0x16'),_0x187b6e,_0x1ba1cd['error'][_0xcde9('0x17')]);return _0xbefa80(_0x1ba1cd['error'][_0xcde9('0x17')]);}else{logger[_0xcde9('0x11')]('ChatGroup,\x20%s,\x20%s',_0x187b6e,'request\x20sent');_0xbefa80(_0x1ba1cd[_0xcde9('0x18')][_0xcde9('0x17')]);}})['catch'](function(_0x1bfd79){logger[_0xcde9('0x14')](_0xcde9('0x16'),_0x187b6e,_0x1bfd79);_0xbce3f9(_0x1bfd79);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 047cd5f..55d6880 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 _0x889a=['length','chatGroup:','./chatGroup.events','save','update'];(function(_0x50773f,_0x4daeda){var _0x2f80ba=function(_0x328009){while(--_0x328009){_0x50773f['push'](_0x50773f['shift']());}};_0x2f80ba(++_0x4daeda);}(_0x889a,0xf2));var _0xa889=function(_0x25dbb2,_0x60818f){_0x25dbb2=_0x25dbb2-0x0;var _0x267cbe=_0x889a[_0x25dbb2];return _0x267cbe;};'use strict';var ChatGroupEvents=require(_0xa889('0x0'));var events=[_0xa889('0x1'),'remove',_0xa889('0x2')];function createListener(_0x2eae85,_0xfc4976){return function(_0x5a9ca1){_0xfc4976['emit'](_0x2eae85,_0x5a9ca1);};}function removeListener(_0x257540,_0x5021a0){return function(){ChatGroupEvents['removeListener'](_0x257540,_0x5021a0);};}exports['register']=function(_0x1f72f5){for(var _0x10b06a=0x0,_0x46224a=events[_0xa889('0x3')];_0x10b06a<_0x46224a;_0x10b06a++){var _0x3ee41f=events[_0x10b06a];var _0x582bc5=createListener(_0xa889('0x4')+_0x3ee41f,_0x1f72f5);ChatGroupEvents['on'](_0x3ee41f,_0x582bc5);}};
\ No newline at end of file
+var _0x4edb=['save','remove','update','removeListener','register','./chatGroup.events'];(function(_0x1c7ed2,_0x4ef1c8){var _0x2469fa=function(_0x424cb5){while(--_0x424cb5){_0x1c7ed2['push'](_0x1c7ed2['shift']());}};_0x2469fa(++_0x4ef1c8);}(_0x4edb,0x107));var _0xb4ed=function(_0x39fd11,_0x5d7883){_0x39fd11=_0x39fd11-0x0;var _0x302799=_0x4edb[_0x39fd11];return _0x302799;};'use strict';var ChatGroupEvents=require(_0xb4ed('0x0'));var events=[_0xb4ed('0x1'),_0xb4ed('0x2'),_0xb4ed('0x3')];function createListener(_0xc88137,_0x49caf2){return function(_0x24e982){_0x49caf2['emit'](_0xc88137,_0x24e982);};}function removeListener(_0x24ca7b,_0x2173af){return function(){ChatGroupEvents[_0xb4ed('0x4')](_0x24ca7b,_0x2173af);};}exports[_0xb4ed('0x5')]=function(_0x1df5f8){for(var _0x2dd51b=0x0,_0x1c6c2b=events['length'];_0x2dd51b<_0x1c6c2b;_0x2dd51b++){var _0x599a79=events[_0x2dd51b];var _0x39710d=createListener('chatGroup:'+_0x599a79,_0x1df5f8);ChatGroupEvents['on'](_0x599a79,_0x39710d);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 974c418..77974aa 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 _0x262f=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','addMessage','put','update','destroy','delete','removeMembers','multer'];(function(_0x18b20e,_0x46903c){var _0xadd3a9=function(_0x477ece){while(--_0x477ece){_0x18b20e['push'](_0x18b20e['shift']());}};_0xadd3a9(++_0x46903c);}(_0x262f,0xb3));var _0xf262=function(_0x84d960,_0x3dc95f){_0x84d960=_0x84d960-0x0;var _0x493ee0=_0x262f[_0x84d960];return _0x493ee0;};'use strict';var multer=require(_0xf262('0x0'));var util=require(_0xf262('0x1'));var path=require(_0xf262('0x2'));var timeout=require(_0xf262('0x3'));var express=require(_0xf262('0x4'));var router=express[_0xf262('0x5')]();var fs_extra=require(_0xf262('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf262('0x7'));var config=require(_0xf262('0x8'));var controller=require('./chatGroup.controller');router[_0xf262('0x9')]('/',auth['isAuthenticated'](),controller[_0xf262('0xa')]);router['get'](_0xf262('0xb'),auth[_0xf262('0xc')](),controller[_0xf262('0xd')]);router['get']('/:id',auth[_0xf262('0xc')](),controller[_0xf262('0xe')]);router[_0xf262('0x9')](_0xf262('0xf'),auth['isAuthenticated'](),controller[_0xf262('0x10')]);router[_0xf262('0x9')](_0xf262('0x11'),auth['isAuthenticated'](),controller[_0xf262('0x12')]);router[_0xf262('0x9')](_0xf262('0x13'),auth[_0xf262('0xc')](),controller[_0xf262('0x14')]);router['post']('/',auth[_0xf262('0xc')](),controller[_0xf262('0x15')]);router[_0xf262('0x16')](_0xf262('0x11'),auth['isAuthenticated'](),controller[_0xf262('0x17')]);router['post']('/:id/messages',auth[_0xf262('0xc')](),controller[_0xf262('0x18')]);router[_0xf262('0x19')]('/:id',auth[_0xf262('0xc')](),controller[_0xf262('0x1a')]);router['delete']('/:id',auth[_0xf262('0xc')](),controller[_0xf262('0x1b')]);router[_0xf262('0x1c')](_0xf262('0x11'),auth[_0xf262('0xc')](),controller[_0xf262('0x1d')]);module['exports']=router;
\ No newline at end of file
+var _0x3586=['index','/describe','describe','/:id','show','/:id/unread','getMembers','/:id/messages','post','/:id/members','addMembers','addMessage','put','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated'];(function(_0x17f716,_0x4a06c7){var _0x31f0de=function(_0x5476e4){while(--_0x5476e4){_0x17f716['push'](_0x17f716['shift']());}};_0x31f0de(++_0x4a06c7);}(_0x3586,0x11f));var _0x6358=function(_0x2c39c3,_0x3d9848){_0x2c39c3=_0x2c39c3-0x0;var _0x74f703=_0x3586[_0x2c39c3];return _0x74f703;};'use strict';var multer=require(_0x6358('0x0'));var util=require(_0x6358('0x1'));var path=require(_0x6358('0x2'));var timeout=require(_0x6358('0x3'));var express=require(_0x6358('0x4'));var router=express[_0x6358('0x5')]();var fs_extra=require(_0x6358('0x6'));var auth=require(_0x6358('0x7'));var interaction=require(_0x6358('0x8'));var config=require(_0x6358('0x9'));var controller=require(_0x6358('0xa'));router[_0x6358('0xb')]('/',auth[_0x6358('0xc')](),controller[_0x6358('0xd')]);router['get'](_0x6358('0xe'),auth[_0x6358('0xc')](),controller[_0x6358('0xf')]);router['get'](_0x6358('0x10'),auth['isAuthenticated'](),controller[_0x6358('0x11')]);router[_0x6358('0xb')](_0x6358('0x12'),auth['isAuthenticated'](),controller['getUnread']);router[_0x6358('0xb')]('/:id/members',auth[_0x6358('0xc')](),controller[_0x6358('0x13')]);router[_0x6358('0xb')](_0x6358('0x14'),auth['isAuthenticated'](),controller['getMessages']);router[_0x6358('0x15')]('/',auth[_0x6358('0xc')](),controller['create']);router['post'](_0x6358('0x16'),auth[_0x6358('0xc')](),controller[_0x6358('0x17')]);router[_0x6358('0x15')](_0x6358('0x14'),auth[_0x6358('0xc')](),controller[_0x6358('0x18')]);router[_0x6358('0x19')](_0x6358('0x10'),auth[_0x6358('0xc')](),controller['update']);router[_0x6358('0x1a')]('/:id',auth[_0x6358('0xc')](),controller[_0x6358('0x1b')]);router['delete']('/:id/members',auth[_0x6358('0xc')](),controller[_0x6358('0x1c')]);module[_0x6358('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index cbc8fc0..1783f65 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 _0xcbe1=['long','out','exports','thumb','star','TEXT','DATE','STRING'];(function(_0x33cfe6,_0x3e215c){var _0x34b6cf=function(_0x4ce4c5){while(--_0x4ce4c5){_0x33cfe6['push'](_0x33cfe6['shift']());}};_0x34b6cf(++_0x3e215c);}(_0xcbe1,0x1a2));var _0x1cbe=function(_0x78db5e,_0x3b9804){_0x78db5e=_0x78db5e-0x0;var _0x250b88=_0xcbe1[_0x78db5e];return _0x250b88;};'use strict';var Sequelize=require('sequelize');module[_0x1cbe('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM']('star',_0x1cbe('0x1')),'defaultValue':_0x1cbe('0x2')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x1cbe('0x3')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1cbe('0x4')]},'disposition':{'type':Sequelize[_0x1cbe('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1cbe('0x5')]},'note':{'type':Sequelize[_0x1cbe('0x5')]},'browserName':{'type':Sequelize[_0x1cbe('0x5')]},'browserVersion':{'type':Sequelize[_0x1cbe('0x5')]},'osName':{'type':Sequelize[_0x1cbe('0x5')]},'osVersion':{'type':Sequelize[_0x1cbe('0x5')]},'deviceModel':{'type':Sequelize[_0x1cbe('0x5')]},'deviceVendor':{'type':Sequelize[_0x1cbe('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x1cbe('0x3')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x1cbe('0x3')](_0x1cbe('0x6'))},'read1stAt':{'type':Sequelize[_0x1cbe('0x4')]},'lastMsgAt':{'type':Sequelize[_0x1cbe('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1cbe('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x1cbe('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x1cbe('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x5ba3=['sequelize','BOOLEAN','INTEGER','star','thumb','TEXT','STRING','DATE','ENUM','out'];(function(_0x397013,_0x2e6917){var _0x52516f=function(_0x303d6e){while(--_0x303d6e){_0x397013['push'](_0x397013['shift']());}};_0x52516f(++_0x2e6917);}(_0x5ba3,0x140));var _0x35ba=function(_0x3f4ef1,_0x2e5db7){_0x3f4ef1=_0x3f4ef1-0x0;var _0x5af5bc=_0x5ba3[_0x3f4ef1];return _0x5af5bc;};'use strict';var Sequelize=require(_0x35ba('0x0'));module['exports']={'closed':{'type':Sequelize[_0x35ba('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x35ba('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x35ba('0x3'),_0x35ba('0x4')),'defaultValue':_0x35ba('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x35ba('0x5')]},'mailTranscript':{'type':Sequelize[_0x35ba('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x35ba('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x35ba('0x6')]},'note':{'type':Sequelize[_0x35ba('0x6')]},'browserName':{'type':Sequelize[_0x35ba('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x35ba('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x35ba('0x6')]},'deviceVendor':{'type':Sequelize[_0x35ba('0x6')]},'deviceType':{'type':Sequelize[_0x35ba('0x6')]},'referer':{'type':Sequelize[_0x35ba('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x35ba('0x5')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x35ba('0x8')]('in',_0x35ba('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x35ba('0x6')]},'customerPort':{'type':Sequelize[_0x35ba('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x35ba('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x35ba('0x1')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 2bf3668..3aef4c8 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 _0x896e=['group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','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','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','show','params','rawAttributes','include','options','create','update','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','vidaooEscalation','email','https://api-vidaoo.xcally.com/api/v1/meetings','follow','metadata','ValidationError','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','Unauthorized','ChatOfflineMessageId','join','root','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','%s%d','System','Visitor','website_alias','agentAlias','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','secret','includeAgent','includeAll','findAll','addTags','setTags','spread','Tag','chatInteractionTags:save','removeTags','download','server','files','attachments','transcript-%d-%s.zip','firstName','Account','Owner','get','mkdirSync','Chat','closedAt','disposition','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','createWriteStream','out','lastName','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','register','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save','name','render','merge','body','contact','account','fullname','TagIds','Tags','split','forEach','push','catch','map','ChatInteraction','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','field','color','from','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?'];(function(_0x1f721d,_0x3f9cdf){var _0x476355=function(_0x537ffb){while(--_0x537ffb){_0x1f721d['push'](_0x1f721d['shift']());}};_0x476355(++_0x3f9cdf);}(_0x896e,0x1e9));var _0xe896=function(_0xc708f2,_0x10b2dc){_0xc708f2=_0xc708f2-0x0;var _0x416158=_0x896e[_0xc708f2];return _0x416158;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xe896('0x15'));var logger=require(_0xe896('0x16'))(_0xe896('0x17'));var utils=require('../../config/utils');var config=require(_0xe896('0x18'));var licenseUtil=require(_0xe896('0x19'));var db=require(_0xe896('0x1a'))['db'];config['redis']=_[_0xe896('0x1b')](config[_0xe896('0x1c')],{'host':_0xe896('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe896('0x1c')]));require(_0xe896('0x1e'))[_0xe896('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xe896('0x20')]({'port':0x232b});var client9004=jayson[_0xe896('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5e78d6,_0x11f41c,_0x16e272,_0x57f04b){return new BPromise(function(_0x50d224,_0x4e062a){var _0x41cbd7=_0x57f04b||client;return _0x41cbd7[_0xe896('0x22')](_0x5e78d6,_0x16e272)[_0xe896('0x23')](function(_0x5dc89d){logger[_0xe896('0x24')](_0xe896('0x25'),_0x11f41c,_0xe896('0x26'));logger[_0xe896('0x27')](_0xe896('0x28'),_0x11f41c,_0xe896('0x26'),JSON[_0xe896('0x29')](_0x5dc89d));if(_0x5dc89d[_0xe896('0x2a')]){if(_0x5dc89d['error'][_0xe896('0x2b')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x11f41c,_0x5dc89d[_0xe896('0x2a')][_0xe896('0x2c')]);return _0x4e062a(_0x5dc89d[_0xe896('0x2a')][_0xe896('0x2c')]);}logger['error'](_0xe896('0x25'),_0x11f41c,_0x5dc89d['error']['message']);return _0x50d224(_0x5dc89d[_0xe896('0x2a')][_0xe896('0x2c')]);}else{logger[_0xe896('0x24')](_0xe896('0x25'),_0x11f41c,_0xe896('0x26'));_0x50d224(_0x5dc89d[_0xe896('0x2d')][_0xe896('0x2c')]);}})['catch'](function(_0x390128){logger[_0xe896('0x2a')](_0xe896('0x25'),_0x11f41c,_0x390128);_0x4e062a(_0x390128);});});}function respondWithStatusCode(_0x569d5f,_0x26635e){_0x26635e=_0x26635e||0xcc;return function(_0xd50fe2){if(_0xd50fe2){return _0x569d5f[_0xe896('0x2e')](_0x26635e);}return _0x569d5f[_0xe896('0x2f')](_0x26635e)[_0xe896('0x30')]();};}function respondWithResult(_0x3f8ceb,_0x498341){_0x498341=_0x498341||0xc8;return function(_0x10adad){if(_0x10adad){return _0x3f8ceb[_0xe896('0x2f')](_0x498341)[_0xe896('0x31')](_0x10adad);}};}function respondWithFilteredResult(_0xbfb15b,_0xace03f){return function(_0x5e0d9b){if(_0x5e0d9b){var _0x47c268=typeof _0xace03f['offset']==='undefined'&&typeof _0xace03f['limit']===_0xe896('0x32');var _0x29a18e=_0x5e0d9b[_0xe896('0x33')];var _0x76c781=_0x47c268?0x0:_0xace03f[_0xe896('0x34')];var _0x1a6090=_0x47c268?_0x5e0d9b[_0xe896('0x33')]:_0xace03f[_0xe896('0x34')]+_0xace03f['limit'];var _0x4ce052;if(_0x1a6090>=_0x29a18e){_0x1a6090=_0x29a18e;_0x4ce052=0xc8;}else{_0x4ce052=0xce;}_0xbfb15b[_0xe896('0x2f')](_0x4ce052);return _0xbfb15b[_0xe896('0x35')](_0xe896('0x36'),_0x76c781+'-'+_0x1a6090+'/'+_0x29a18e)[_0xe896('0x31')](_0x5e0d9b);}return null;};}function patchUpdates(_0x4ddeb6){return function(_0x14ad7a){try{jsonpatch['apply'](_0x14ad7a,_0x4ddeb6,!![]);}catch(_0x57c6e8){return BPromise[_0xe896('0x37')](_0x57c6e8);}return _0x14ad7a[_0xe896('0x38')]();};}function saveUpdates(_0x266c0e,_0x4a1115){return function(_0x4d8092){if(_0x4d8092){return _0x4d8092['update'](_0x266c0e)[_0xe896('0x23')](function(_0x1493b8){return _0x1493b8;});}return null;};}function removeEntity(_0x10fa64,_0x13e8fa){return function(_0x36d2d7){if(_0x36d2d7){return _0x36d2d7['destroy']()[_0xe896('0x23')](function(){_0x10fa64[_0xe896('0x2f')](0xcc)[_0xe896('0x30')]();});}};}function handleEntityNotFound(_0x28e09c,_0x1366d0){return function(_0x2cce09){if(!_0x2cce09){_0x28e09c[_0xe896('0x2e')](0x194);}return _0x2cce09;};}function handleError(_0x3e28f0,_0x5ea3ce){_0x5ea3ce=_0x5ea3ce||0x1f4;return function(_0x42f3fb){logger[_0xe896('0x2a')](_0x42f3fb['stack']);if(_0x42f3fb[_0xe896('0x39')]){delete _0x42f3fb['name'];}_0x3e28f0[_0xe896('0x2f')](_0x5ea3ce)['send'](_0x42f3fb);};}function getMustacheRender(_0x42f445,_0x5ba71e){return Mustache[_0xe896('0x3a')](_0x42f445,_[_0xe896('0x3b')](_0x5ba71e[_0xe896('0x3c')],{'contact':_0x5ba71e[_0xe896('0x3d')],'message':_0x5ba71e[_0xe896('0x2c')],'agent':_0x5ba71e['agent'],'interaction':_0x5ba71e['interaction'],'account':_0x5ba71e[_0xe896('0x3e')]}))||'';}function getInteractionUsers(_0x2ea387,_0x387cc6){return new BPromise(function(_0x15b6c5,_0x2ff489){try{if(_0x387cc6[_0x2ea387['id']]){_0x2ea387['Users']=_['map'](_0x387cc6[_0x2ea387['id']],function(_0x127a6f){return{'id':_0x127a6f['id'],'fullname':_0x127a6f[_0xe896('0x3f')]};});}}catch(_0x5890b1){_0x2ff489(_0x5890b1);}_0x15b6c5(_0x2ea387);});}function getInteractionTags(_0x57e194,_0x19d2fd){return new BPromise(function(_0x3b1de8,_0x911adb){try{if(_0x57e194[_0xe896('0x40')]){_0x57e194[_0xe896('0x41')]=[];_0x57e194[_0xe896('0x40')][_0xe896('0x42')](',')[_0xe896('0x43')](function(_0x372c71){_0x57e194[_0xe896('0x41')][_0xe896('0x44')](_0x19d2fd[_0x372c71]);});}delete _0x57e194[_0xe896('0x40')];}catch(_0x5c00c6){_0x911adb(_0x5c00c6);}_0x3b1de8(_0x57e194);});}function updateChatInteraction(_0x1e5434,_0x143ad4,_0x59b97f){return new BPromise(function(_0x57366b,_0x5cd5a3){return getInteractionUsers(_0x1e5434,_0x59b97f)[_0xe896('0x23')](function(_0x2a354f){return getInteractionTags(_0x2a354f,_0x143ad4);})[_0xe896('0x23')](function(_0x5d1a19){_0x57366b(_0x5d1a19);})[_0xe896('0x45')](function(_0x22189c){_0x5cd5a3(_0x22189c);});});}exports['index']=function(_0x4c05ce,_0x489254){var _0x22c628={},_0x2b0273={},_0x16927a={'count':0x0,'rows':[]};var _0x402aef=_[_0xe896('0x46')](db[_0xe896('0x47')]['rawAttributes'],function(_0x125fbc){return{'name':_0x125fbc[_0xe896('0x48')],'type':_0x125fbc['type'][_0xe896('0x49')]};});_0x2b0273[_0xe896('0x4a')]=_[_0xe896('0x46')](_0x402aef,_0xe896('0x39'));_0x2b0273['query']=_[_0xe896('0x4b')](_0x4c05ce[_0xe896('0x4c')]);_0x2b0273[_0xe896('0x4d')]=_[_0xe896('0x4e')](_0x2b0273[_0xe896('0x4a')],_0x2b0273[_0xe896('0x4c')]);_0x22c628['attributes']=_[_0xe896('0x4e')](_0x2b0273['model'],qs[_0xe896('0x4f')](_0x4c05ce[_0xe896('0x4c')][_0xe896('0x4f')]));_0x22c628[_0xe896('0x50')]=_0x22c628[_0xe896('0x50')][_0xe896('0x51')]?_0x22c628['attributes']:_0x2b0273[_0xe896('0x4a')];if(!_0x4c05ce[_0xe896('0x4c')]['hasOwnProperty'](_0xe896('0x52'))){_0x22c628[_0xe896('0x53')]=qs['limit'](_0x4c05ce[_0xe896('0x4c')]['limit']);_0x22c628[_0xe896('0x34')]=qs[_0xe896('0x34')](_0x4c05ce[_0xe896('0x4c')][_0xe896('0x34')]);}_0x22c628[_0xe896('0x54')]=qs['sort'](_0x4c05ce[_0xe896('0x4c')][_0xe896('0x55')]);_0x22c628[_0xe896('0x56')]=qs['filters'](_[_0xe896('0x57')](_0x4c05ce['query'],_0x2b0273['filters']),_0x402aef);var _0x388375=[];var _0x20fe4f=squel['select']()[_0xe896('0x58')]('id')[_0xe896('0x58')]('name')['field'](_0xe896('0x59'))[_0xe896('0x5a')]('tools_tags');var _0x1d18f6=squel[_0xe896('0x5b')]()[_0xe896('0x58')](_0xe896('0x5c'))[_0xe896('0x58')](_0xe896('0x5d'))[_0xe896('0x58')](_0xe896('0x5e'))[_0xe896('0x5a')](_0xe896('0x5f'),'ui')[_0xe896('0x60')]('users','u',_0xe896('0x61'));var _0x2a23a2=squel[_0xe896('0x5b')]()[_0xe896('0x5a')](_0xe896('0x62'),'i')[_0xe896('0x60')](_0xe896('0x63'),'c',_0xe896('0x64'))[_0xe896('0x60')](_0xe896('0x65'),'o',_0xe896('0x66'))[_0xe896('0x60')]('chat_websites','a',_0xe896('0x67'))[_0xe896('0x60')](_0xe896('0x68'),'me','me.ChatInteractionId\x20=\x20i.id')['left_join']('chat_interaction_has_tags','it',_0xe896('0x69'))[_0xe896('0x60')](_0xe896('0x6a'),'t',_0xe896('0x6b'));var _0x50c910=squel[_0xe896('0x6c')]();var _0x28396c=[];var _0x57ed84=squel[_0xe896('0x6c')]();var _0x5d6c1c;if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x6d')]){_0x5d6c1c=as['parseSearch'](_0x4c05ce[_0xe896('0x4c')][_0xe896('0x6d')]);var _0x568d89=_0x5d6c1c['sqlOperator'];for(var _0x2a5e68=0x0;_0x2a5e68<_0x5d6c1c[_0xe896('0x6e')][_0xe896('0x51')];_0x2a5e68++){var _0x11291a=_0x5d6c1c[_0xe896('0x6e')][_0x2a5e68];var _0x4e4092='i';var _0xdadb92=_[_0xe896('0x6f')](_0x402aef,[_0xe896('0x39'),_0x11291a[_0xe896('0x58')]]);if(!_0xdadb92){switch(_0x11291a['field']){case'unreadMessages':if(_0x11291a[_0xe896('0x70')]==0x1){_0x2a23a2[_0xe896('0x71')]('`'+_0x11291a['field']+_0xe896('0x72'));}else{_0x2a23a2['having']('`'+_0x11291a[_0xe896('0x58')]+_0xe896('0x73'));}break;case _0xe896('0x74'):if(_0x11291a[_0xe896('0x75')]===_0xe896('0x76')){if(_0x11291a[_0xe896('0x70')][_0xe896('0x42')]('\x20')[_0xe896('0x51')]>0x1){_0x50c910[_0x568d89](_0xe896('0x77'),qs[_0xe896('0x78')](_0x11291a[_0xe896('0x70')]),null);}else{var _0x3248e6='%'+_0x11291a[_0xe896('0x70')]+'%';_0x50c910[_0x568d89](_0xe896('0x79'),_0x3248e6,_0x3248e6,_0x3248e6);}}else{_0xdadb92=_[_0xe896('0x6f')](_0x402aef,[_0xe896('0x39'),_0xe896('0x7a')]);_0x11291a[_0xe896('0x58')]=_0xe896('0x7a');_0x1c118e=as[_0xe896('0x7b')](_0x4e4092,_0xdadb92[_0xe896('0x7c')],_0x11291a);_0x50c910[_0x568d89](_0x1c118e[_0xe896('0x7d')],_0x1c118e['value']['start'],_0x1c118e[_0xe896('0x70')][_0xe896('0x30')]);}break;case'Tag':var _0x1165ad=_0x11291a[_0xe896('0x70')][_0xe896('0x42')](',')[_0xe896('0x46')](function(_0x19781b){return Number(_0x19781b);});_0x1165ad[_0xe896('0x43')](function(_0x475459){_0x57ed84['or'](_0xe896('0x7e'),'%,'+_0x475459+',%');});_0x28396c=_[_0xe896('0x7f')](_0x28396c,_0x1165ad);break;case _0xe896('0x80'):if(_0x11291a[_0xe896('0x75')]==='$substring'){_0x50c910[_0x568d89](_0xe896('0x81'),'%'+_0x11291a[_0xe896('0x70')]+'%',null);}else{_0xdadb92=_['find'](_0x402aef,[_0xe896('0x39'),'UserId']);_0x11291a['field']=_0xe896('0x82');_0x1c118e=as[_0xe896('0x7b')](_0x4e4092,_0xdadb92['type'],_0x11291a);_0x50c910[_0x568d89](_0x1c118e['text'],_0x1c118e[_0xe896('0x70')]['start'],_0x1c118e['value'][_0xe896('0x30')]);}break;case _0xe896('0x3c'):_0x1c118e=as[_0xe896('0x7b')]('me',null,_0x11291a);_0x50c910[_0x568d89](_0x1c118e['text'],_0x1c118e[_0xe896('0x70')][_0xe896('0x83')],_0x1c118e[_0xe896('0x70')]['end']);break;}}else{var _0x1c118e=as[_0xe896('0x7b')](_0x4e4092,_0xdadb92[_0xe896('0x7c')],_0x11291a);_0x50c910[_0x568d89](_0x1c118e[_0xe896('0x7d')],_0x1c118e['value'][_0xe896('0x83')],_0x1c118e[_0xe896('0x70')][_0xe896('0x30')]);}}}else{var _0x4fcd37=_(_0x4c05ce['query'])[_0xe896('0x4b')]()[_0xe896('0x46')](function(_0x4c5091){return _[_0xe896('0x84')](_0x402aef,[_0xe896('0x39'),_0x4c5091])?_0x4c5091:undefined;})[_0xe896('0x85')]()[_0xe896('0x70')]();if(!_['isEmpty'](_0x4fcd37)){_0x4fcd37[_0xe896('0x43')](function(_0x234a3a){if(_0x234a3a===_0xe896('0x86')){_0x2a23a2[_0xe896('0x56')](_0xe896('0x87'),[][_0xe896('0x88')](_0x4c05ce['query'][_0x234a3a]));}else if(_0x234a3a==='createdAt'){var _0x48b523=JSON[_0xe896('0x89')](_0x4c05ce[_0xe896('0x4c')][_0x234a3a])[_0xe896('0x8a')];var _0x270121=JSON[_0xe896('0x89')](_0x4c05ce[_0xe896('0x4c')][_0x234a3a])[_0xe896('0x8b')];_0x2a23a2['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x48b523,_0x270121);}else{if(_0x4c05ce[_0xe896('0x4c')][_0x234a3a]==='null'){_0x2a23a2[_0xe896('0x56')]('i.'+_0x234a3a+'\x20IS\x20NULL');}else{_0x2a23a2[_0xe896('0x56')]('i.'+_0x234a3a+'\x20=\x20?',_0x4c05ce[_0xe896('0x4c')][_0x234a3a]);}}});}if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x8c')]){if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x8c')]==0x1){_0x2a23a2['having'](_0xe896('0x8d'));}else{_0x2a23a2[_0xe896('0x71')](_0xe896('0x8e'));}}if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x8f')]){_0x28396c=_[_0xe896('0x90')](_0x4c05ce[_0xe896('0x4c')]['tag'])?_0x4c05ce[_0xe896('0x4c')]['tag']:new Array(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x8f')]);_0x28396c[_0xe896('0x43')](function(_0x503131){_0x57ed84['or'](_0xe896('0x7e'),'%,'+_0x503131+',%');});}if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x91')]){var _0x1913b2=_0x4c05ce[_0xe896('0x4c')][_0xe896('0x91')][_0xe896('0x92')]('\x5c','\x5c\x5c')[_0xe896('0x92')](/'/g,'\x27\x27');if(qs[_0xe896('0x93')](_0x1913b2)){_0x50c910['or'](_0xe896('0x94'),_0x1913b2+'%');}else{_0x50c910['or'](_0xe896('0x95'),qs['getFullTextValue'](_0x1913b2))['or'](_0xe896('0x96'),_0x1913b2+'%');}}}_0x2a23a2[_0xe896('0x56')](_0x50c910);_0x2a23a2[_0xe896('0x97')](_0xe896('0x98'));var _0x48885e={'type':db[_0xe896('0x99')][_0xe896('0x9a')][_0xe896('0x9b')],'raw':!![]};var _0x779db6=_0x2a23a2[_0xe896('0x9c')]();_0x779db6[_0xe896('0x58')](_0xe896('0x98'));_0x779db6[_0xe896('0x58')](_0xe896('0x9d'),_0xe896('0x9e'));if(_0x22c628[_0xe896('0x54')]){_0x22c628[_0xe896('0x54')]['forEach'](function(_0x2bd061){var _0x1d1364=_0x2bd061[0x0]===_0xe896('0x9f')?_0x2bd061[0x0]:'i.'+_0x2bd061[0x0];_0x2a23a2['order'](_0x1d1364,_0x2bd061[0x1]===_0xe896('0xa0')?![]:!![]);});}if(!_['isEmpty'](_0x28396c)){_0x2a23a2['having'](_0x57ed84);_0x779db6[_0xe896('0x56')](_0xe896('0xa1'),_0x28396c);}BPromise[_0xe896('0xa2')]()['then'](function(){if(!_0x5d6c1c){if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x86')])return;_0x779db6['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x2a23a2[_0xe896('0x56')](_0xe896('0xa3'));return;}if(_0x4c05ce[_0xe896('0xa4')][_0xe896('0xa5')]!==_0xe896('0xa6'))return;return _0x4c05ce[_0xe896('0xa4')][_0xe896('0xa7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x544d2d){if(_[_0xe896('0xa8')](_0x544d2d)){_0x779db6['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x2a23a2[_0xe896('0x56')](_0xe896('0xa9'));}else{_0x779db6[_0xe896('0x56')](_0xe896('0x87'),_['map'](_0x544d2d,'id'));_0x2a23a2[_0xe896('0x56')](_0xe896('0x87'),_['map'](_0x544d2d,'id'));}});})[_0xe896('0x23')](function(){if(_0x4c05ce[_0xe896('0xa4')][_0xe896('0xa5')]===_0xe896('0xa6')&&!_0x5d6c1c&&!_0x4c05ce[_0xe896('0x4c')][_0xe896('0x86')])return[];return db[_0xe896('0xaa')][_0xe896('0x4c')](_0x779db6[_0xe896('0xab')](),_0x48885e);})[_0xe896('0x23')](function(_0x16ff5e){_0x16927a[_0xe896('0x33')]=_0x16ff5e[_0xe896('0x51')];if(_0x16927a['count']===0x0)return[];return db[_0xe896('0xaa')][_0xe896('0x4c')](_0x20fe4f[_0xe896('0xab')](),_0x48885e)[_0xe896('0x23')](function(_0x229150){_0x388375=_[_0xe896('0xac')](_0x229150,'id');_0x48885e=_[_0xe896('0x3b')](_0x48885e,{'model':db[_0xe896('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x4f')]){_0x22c628['attributes']['forEach'](function(_0x41e6c4){_0x2a23a2[_0xe896('0x58')]('i.'+_0x41e6c4);});}else{_0x2a23a2[_0xe896('0x58')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe896('0x9e'));_0x2a23a2[_0xe896('0x58')]('a.key',_0xe896('0xad'));_0x2a23a2[_0xe896('0x58')]('a.mandatoryDisposition',_0xe896('0xae'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xaf'),_0xe896('0x9f'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xb0'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xb1'),'Contact.firstName');_0x2a23a2[_0xe896('0x58')](_0xe896('0xb2'),_0xe896('0xb3'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xb4'),'Contact.email');_0x2a23a2[_0xe896('0x58')](_0xe896('0xb5'),_0xe896('0xb6'));_0x2a23a2['field'](_0xe896('0xb7'),_0xe896('0xb8'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xb9'),_0xe896('0xba'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xbb'),_0xe896('0xbc'));_0x2a23a2[_0xe896('0x58')]('o.internal',_0xe896('0xbd'));_0x2a23a2['field'](_0xe896('0xbe'),_0xe896('0x40'));}if(_0x22c628[_0xe896('0x53')])_0x2a23a2[_0xe896('0x53')](_0x22c628['limit']);if(_0x22c628[_0xe896('0x34')])_0x2a23a2[_0xe896('0x34')](_0x22c628['offset']);return db[_0xe896('0xaa')][_0xe896('0x4c')](_0x2a23a2[_0xe896('0xab')](),_0x48885e);})['then'](function(_0xadc81f){if(_0xadc81f['length']>0x0)_0x1d18f6['where'](_0xe896('0xbf'),_[_0xe896('0x46')](_0xadc81f,'id'));return db['sequelize'][_0xe896('0x4c')](_0x1d18f6[_0xe896('0xab')](),_0x48885e)['then'](function(_0x529df2){var _0x5b4e01=_['groupBy'](_0x529df2,_0xe896('0xc0'));var _0x237cae=[];_0xadc81f[_0xe896('0x43')](function(_0xc0fa84){_0x237cae[_0xe896('0x44')](updateChatInteraction(_0xc0fa84,_0x388375,_0x5b4e01));});return BPromise[_0xe896('0xc1')](_0x237cae);});});})[_0xe896('0x23')](function(_0x2dbfd3){_0x16927a['rows']=_0x2dbfd3;return _0x16927a;})[_0xe896('0x23')](respondWithFilteredResult(_0x489254,_0x22c628))[_0xe896('0x45')](handleError(_0x489254,null));};exports[_0xe896('0xc2')]=function(_0x2a1d41,_0x5a254b){var _0x4f4d26={'raw':![],'where':{'id':_0x2a1d41[_0xe896('0xc3')]['id']}},_0x2f30a9={};_0x2f30a9['model']=_['keys'](db[_0xe896('0x47')][_0xe896('0xc4')]);_0x2f30a9[_0xe896('0x4c')]=_[_0xe896('0x4b')](_0x2a1d41[_0xe896('0x4c')]);_0x2f30a9['filters']=_[_0xe896('0x4e')](_0x2f30a9[_0xe896('0x4a')],_0x2f30a9[_0xe896('0x4c')]);_0x4f4d26['attributes']=_[_0xe896('0x4e')](_0x2f30a9[_0xe896('0x4a')],qs[_0xe896('0x4f')](_0x2a1d41[_0xe896('0x4c')][_0xe896('0x4f')]));_0x4f4d26['attributes']=_0x4f4d26[_0xe896('0x50')][_0xe896('0x51')]?_0x4f4d26[_0xe896('0x50')]:_0x2f30a9['model'];if(_0x2a1d41[_0xe896('0x4c')]['includeAll']){_0x4f4d26[_0xe896('0xc5')]=[{'all':!![]}];}_0x4f4d26=_[_0xe896('0x3b')]({},_0x4f4d26,_0x2a1d41[_0xe896('0xc6')]);return db[_0xe896('0x47')][_0xe896('0x6f')](_0x4f4d26)[_0xe896('0x23')](handleEntityNotFound(_0x5a254b,null))['then'](respondWithResult(_0x5a254b,null))['catch'](handleError(_0x5a254b,null));};exports[_0xe896('0xc7')]=function(_0x54c61f,_0x15af0e){return db[_0xe896('0x47')]['create'](_0x54c61f[_0xe896('0x3c')],{})[_0xe896('0x23')](respondWithResult(_0x15af0e,0xc9))['catch'](handleError(_0x15af0e,null));};exports[_0xe896('0xc8')]=function(_0x4bcd8c,_0x326c67){if(_0x4bcd8c[_0xe896('0x3c')]['id']){delete _0x4bcd8c[_0xe896('0x3c')]['id'];}return db[_0xe896('0x47')]['find']({'where':{'id':_0x4bcd8c[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x326c67,null))[_0xe896('0x23')](saveUpdates(_0x4bcd8c[_0xe896('0x3c')],null))[_0xe896('0x23')](respondWithResult(_0x326c67,null))[_0xe896('0x45')](handleError(_0x326c67,null));};exports[_0xe896('0xc9')]=function(_0x3c8951,_0x41b162){return db[_0xe896('0x47')][_0xe896('0x6f')]({'where':{'id':_0x3c8951[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x41b162,null))[_0xe896('0x23')](removeEntity(_0x41b162,null))[_0xe896('0x45')](handleError(_0x41b162,null));};exports[_0xe896('0xca')]=function(_0x16b398,_0x4edeaf){return db[_0xe896('0x47')][_0xe896('0xca')]()['then'](respondWithResult(_0x4edeaf,null))['catch'](handleError(_0x4edeaf,null));};exports[_0xe896('0xcb')]=function(_0xdd4767,_0x3df01d){var _0xf6563d=_0xdd4767[_0xe896('0xc3')]['id'];var _0x21e7a2;var _0x43b9e0;var _0x46a4f0;return db['ChatInteraction'][_0xe896('0xcc')]({'where':{'id':_0xf6563d}})[_0xe896('0x23')](function(_0x2ee264){_0x21e7a2=_0x2ee264;return db[_0xe896('0xcd')]['findOne']({'where':{'id':_0x2ee264[_0xe896('0x86')]},'attributes':['id','vidaooApiKey','vidaooEscalation',_0xe896('0xce'),_0xe896('0xcf'),_0xe896('0xd0')],'raw':!![]});})[_0xe896('0x23')](function(_0x3e55b7){if(_0x3e55b7&&_0x3e55b7[_0xe896('0xd1')]&&_0x3e55b7[_0xe896('0xd2')]){_0x43b9e0=_0x3e55b7;var _0x49293e={'interaction':{'id':_0xf6563d},'agent':{'id':_0xdd4767[_0xe896('0xa4')]['id'],'name':_0xdd4767[_0xe896('0xa4')][_0xe896('0x39')],'fullname':_0xdd4767[_0xe896('0xa4')][_0xe896('0x3f')],'email':_0xdd4767[_0xe896('0xa4')][_0xe896('0xd3')]},'contact':_0xdd4767[_0xe896('0x3c')][_0xe896('0x3d')],'account':_0xdd4767['body'][_0xe896('0x3e')]};var _0x13c2fb={'rejectUnauthorized':![],'method':'POST','url':_0xe896('0xd4'),'headers':{'X-APIKEY':_0x3e55b7['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0xdd4767['user'][_0xe896('0xd3')]],'buttons':null,'topic':_0x43b9e0['vidaooTopic'],'note':_['isNull'](_0x43b9e0[_0xe896('0xcf')])?null:getMustacheRender(_0x43b9e0[_0xe896('0xcf')],_0x49293e),'metadata':null},'redirect':_0xe896('0xd5'),'json':!![]};try{if(!_['isNull'](_0x43b9e0[_0xe896('0xd0')])){var _0x55be9b=getMustacheRender(_0x43b9e0[_0xe896('0xd0')],_0x49293e);var _0x1406c2=JSON['parse'](_0x55be9b);_0x13c2fb[_0xe896('0x3c')][_0xe896('0xd6')]=_0x1406c2;}}catch(_0x53cebb){throw new db[(_0xe896('0x99'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x13c2fb);}else{throw new db['Sequelize'][(_0xe896('0xd7'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xe896('0x23')](function(_0x30c8f4){_0x46a4f0=_0x30c8f4;if(_0x46a4f0['id']){var _0x386f5a={'body':_0x46a4f0[_0xe896('0xd8')],'ChatWebsiteId':_0x43b9e0['id'],'ChatInteractionId':_0x21e7a2['id'],'direction':'out','UserId':_0xdd4767[_0xe896('0xa4')]['id']};return db[_0xe896('0xd9')][_0xe896('0xc7')](_0x386f5a,{});}else{throw new db[(_0xe896('0x99'))]['ValidationError'](_0xe896('0xda'));}})['then'](function(){return _0x21e7a2[_0xe896('0xdb')]({'vidaooSessionId':_0x46a4f0['id']});})[_0xe896('0x23')](respondWithResult(_0x3df01d,null))[_0xe896('0x45')](handleError(_0x3df01d,null));};exports[_0xe896('0xdc')]=function(_0x5a5336,_0x42ab19){if(_0x5a5336['body']['id']){delete _0x5a5336[_0xe896('0x3c')]['id'];}return db['ChatInteraction'][_0xe896('0x6f')]({'where':{'id':_0x5a5336[_0xe896('0xc3')]['id']},'include':[{'model':db[_0xe896('0xdd')],'as':'Contact'}]})[_0xe896('0x23')](handleEntityNotFound(_0x42ab19,null))['then'](saveUpdates(_0x5a5336[_0xe896('0x3c')],null))[_0xe896('0x23')](respondWithResult(_0x42ab19,null))['catch'](handleError(_0x42ab19,null));};exports[_0xe896('0xde')]=function(_0x384116,_0x5949f1,_0x432775){if(_0x384116[_0xe896('0x3c')]['id']){delete _0x384116[_0xe896('0x3c')]['id'];}return db[_0xe896('0x47')][_0xe896('0x6f')]({'where':{'id':_0x384116[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](function(_0x5da1fa){if(!_0x5da1fa){logger[_0xe896('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0xe896('0xdf'));_0x5949f1[_0xe896('0x2e')](0x194);}else{if(_0x5da1fa['UserId']){throw new db[(_0xe896('0x99'))][(_0xe896('0xd7'))]('Interaction\x20already\x20assigned');}}return _0x5da1fa;})['then'](function(_0x24c6bc){if(_0x24c6bc){return _0x24c6bc[_0xe896('0xc8')]({'closed':_0x384116['body'][_0xe896('0xe0')],'disposition':_0x384116[_0xe896('0x3c')]['disposition']})[_0xe896('0x23')](function(_0x54219c){return _0x54219c;});}})[_0xe896('0x23')](function(_0x577d5a){return respondWithRpcPromise(_0xe896('0xe1'),_0xe896('0xde'),_0x384116['body'],client9004);})[_0xe896('0x23')](respondWithResult(_0x5949f1,null))[_0xe896('0x45')](handleError(_0x5949f1,null));};exports[_0xe896('0xe2')]=function(_0x32f30e,_0x265206,_0x90a856){_0x32f30e[_0xe896('0x3c')][_0xe896('0x39')]=_0x32f30e[_0xe896('0xe3')][_0xe896('0xe4')];_0x32f30e[_0xe896('0x3c')][_0xe896('0xe5')]=_0x32f30e[_0xe896('0xe3')][_0xe896('0xe6')];_0x32f30e['body'][_0xe896('0x7c')]=_0x32f30e['file'][_0xe896('0xe7')];return db[_0xe896('0xe8')]['create'](_0x32f30e[_0xe896('0x3c')])[_0xe896('0x23')](respondWithResult(_0x265206,0xc9))[_0xe896('0x45')](handleError(_0x265206,null));};exports['attachmentDownload']=function(_0x28deef,_0x3f32f7,_0x2b1427){return db[_0xe896('0x47')][_0xe896('0xcc')]({'where':{'id':_0x28deef[_0xe896('0xc3')]['id']},'raw':!![]})[_0xe896('0x23')](handleEntityNotFound(_0x3f32f7,null))[_0xe896('0x23')](function(_0xdd5dbf){if(_0xdd5dbf){if(_0xdd5dbf['closed']){return _0x3f32f7['status'](0x193)['json']({'status':0x193,'message':_0xe896('0xe9')});}return db['Attachment']['findOne']({'where':{'id':_0x28deef[_0xe896('0x4c')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x3f32f7,null));}})['then'](function(_0x348cd5){if(_0x348cd5){var _0x4a5f7f=_0x348cd5[_0xe896('0xea')]!==null;var _0x222029=path[_0xe896('0xeb')](config[_0xe896('0xec')],'server/files/attachments/');if(_0x4a5f7f){_0x222029=path[_0xe896('0xeb')](_0x222029,_0xe896('0xed'));}var _0x36c394=path[_0xe896('0xeb')](_0x222029,_0x348cd5[_0xe896('0xe5')]);return _0x3f32f7['download'](_0x36c394);}})['catch'](handleError(_0x3f32f7,null));};exports[_0xe896('0xee')]=function(_0x1a5056,_0x57aa1b){var _0x21b078=null;var _0x17edcd=null;var _0x71d912=null;var _0x22a63d=null;if(_0x1a5056[_0xe896('0x3c')]['id']){delete _0x1a5056[_0xe896('0x3c')]['id'];}if(_0x1a5056[_0xe896('0x3c')][_0xe896('0xef')]){_0x22a63d=path[_0xe896('0xeb')](config[_0xe896('0xec')],_0xe896('0xf0'),util[_0xe896('0xf1')](_0xe896('0xf2'),Date['now']()));_0x1a5056[_0xe896('0x3c')][_0xe896('0xf3')]=_0x22a63d;}return db['ChatInteraction'][_0xe896('0x6f')]({'where':{'id':_0x1a5056[_0xe896('0xc3')]['id']},'include':[{'model':db[_0xe896('0xd9')],'as':_0xe896('0xf4'),'include':[{'model':db[_0xe896('0x80')],'as':_0xe896('0x80')}]}]})[_0xe896('0x23')](handleEntityNotFound(_0x57aa1b,null))[_0xe896('0x23')](saveUpdates(_0x1a5056[_0xe896('0x3c')],null))[_0xe896('0x23')](function(_0x5487f0){if(_0x5487f0){_0x21b078=_0x5487f0;return db[_0xe896('0xcd')]['find']({'where':{'id':_0x21b078[_0xe896('0x86')]}});}})[_0xe896('0x23')](function(_0xb528ff){if(_0xb528ff){_0x71d912=_0xb528ff;return db[_0xe896('0xdd')][_0xe896('0x6f')]({'where':{'id':_0x21b078[_0xe896('0x7a')]}});}})[_0xe896('0x23')](function(_0x6e53ae){if(_0x6e53ae){_0x17edcd=_0x6e53ae;if(_0x22a63d){var _0x52337e=null;for(var _0x1d6003=0x1;_0x1d6003<_0x21b078[_0xe896('0xf4')][_0xe896('0x51')];++_0x1d6003){_0x52337e=_0x21b078[_0xe896('0xf4')][_0x1d6003];var _0x882a0e=_0x52337e[_0xe896('0x82')]?util[_0xe896('0xf1')](_0xe896('0xf5'),_0x71d912['agentAlias'],_0x52337e[_0xe896('0x82')]):_0xe896('0xf6');var _0x27743a=_0x1a5056['body']['customer']||util[_0xe896('0xf1')](_0xe896('0xf5'),_0xe896('0xf7'),_0x52337e['ContactId']);switch(_0x71d912['agentIdentifier']){case _0xe896('0xf8'):_0x882a0e=_0x52337e[_0xe896('0x82')]?util['format'](_0xe896('0xf5'),_0x71d912[_0xe896('0xf9')],_0x52337e[_0xe896('0x82')]):_0xe896('0xf6');break;case _0xe896('0xfa'):_0x882a0e=_0x52337e[_0xe896('0x82')]?_0x52337e['User'][_0xe896('0xfb')]||_0x52337e[_0xe896('0x80')]['fullname']:_0xe896('0xf6');break;case _0xe896('0xfc'):_0x882a0e=_0x52337e['UserId']?_0x52337e['User']['fullname']:'System';break;default:_0x882a0e=_0x52337e[_0xe896('0x82')]?util[_0xe896('0xf1')](_0xe896('0xf5'),_0x71d912[_0xe896('0xf9')],_0x52337e[_0xe896('0x82')]):_0xe896('0xf6');}var _0x58fcf9=util[_0xe896('0xf1')]('[%s]\x20%s:\x20%s\x0a',moment(_0x52337e[_0xe896('0xfd')])['format'](_0xe896('0xfe')),_0x52337e[_0xe896('0xff')]==='in'?_0x27743a:_0x882a0e,_0x52337e['body']);if(!_0x52337e['secret']){fs[_0xe896('0x100')](_0x22a63d,_0x58fcf9);}}return db[_0xe896('0x101')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xe896('0x102'),'raw':!![]}]});}}})[_0xe896('0x23')](function(_0xbee8fa){if(_0xbee8fa&&_0xbee8fa[_0xe896('0x102')]&&_0x1a5056[_0xe896('0x3c')]){var _0x1a50c3={'tls':{'rejectUnauthorized':![]}};if(_0xbee8fa[_0xe896('0x102')][_0xe896('0x103')]){_0x1a50c3[_0xe896('0x103')]=_0xbee8fa[_0xe896('0x102')][_0xe896('0x103')];}else{_0x1a50c3[_0xe896('0x104')]=_0xbee8fa[_0xe896('0x102')]['host'];_0x1a50c3['port']=_0xbee8fa[_0xe896('0x102')][_0xe896('0x105')];_0x1a50c3[_0xe896('0x106')]=_0xbee8fa[_0xe896('0x102')][_0xe896('0x106')];}if(_0xbee8fa[_0xe896('0x102')][_0xe896('0x107')]){_0x1a50c3[_0xe896('0x108')]={'user':_0xbee8fa[_0xe896('0x102')][_0xe896('0xa4')],'pass':_0xbee8fa[_0xe896('0x102')][_0xe896('0x109')]};}return respondWithRpcPromise(_0xe896('0x10a'),_0xe896('0x10b'),{'account':_0x1a50c3,'message':{'from':util[_0xe896('0xf1')](_0xe896('0x10c'),_0xbee8fa['name'],_0xbee8fa['email']||_0xbee8fa['Smtp'][_0xe896('0xa4')]),'to':_0x1a5056[_0xe896('0x3c')][_0xe896('0xef')],'subject':_0xe896('0x10d'),'text':util[_0xe896('0xf1')](_0xe896('0x10e'),_0x1a5056[_0xe896('0x3c')]['mailTranscript']),'attachments':[{'path':_0x22a63d}]}})['then'](function(){return _0x21b078;})[_0xe896('0x45')](function(_0x550c55){console['error'](_0x550c55);});}else{return _0x21b078;}})['then'](respondWithStatusCode(_0x57aa1b,0xc8))[_0xe896('0x45')](handleError(_0x57aa1b,null));};exports[_0xe896('0x10f')]=function(_0x14da55,_0x5656d0,_0x31ca0b){return db[_0xe896('0xd9')][_0xe896('0x6f')]({'where':{'id':_0x14da55[_0xe896('0xc3')]['id']}})['then'](handleEntityNotFound(_0x5656d0,null))['then'](function(_0x518847){if(_0x518847){return _0x518847[_0xe896('0x10f')](_0x14da55[_0xe896('0x3c')]['ids'],_[_0xe896('0x110')](_0x14da55[_0xe896('0x3c')],[_0xe896('0x111'),'id'])||{});}})[_0xe896('0x23')](respondWithResult(_0x5656d0,null))['catch'](handleError(_0x5656d0,null));};exports[_0xe896('0x112')]=function(_0xf78ce2,_0x3f8ea0,_0x254420){var _0x1196d4={'raw':![],'where':{}};var _0x1ee26e={};var _0x1bd649={'count':0x0,'rows':[]};return db[_0xe896('0x47')][_0xe896('0xcc')]({'where':{'id':_0xf78ce2[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x3f8ea0,null))[_0xe896('0x23')](function(_0x2e5c38){if(_0x2e5c38){_0x1ee26e[_0xe896('0x4a')]=_['keys'](db[_0xe896('0xd9')]['rawAttributes']);_0x1ee26e[_0xe896('0x4c')]=_[_0xe896('0x4b')](_0xf78ce2['query']);_0x1ee26e['filters']=_[_0xe896('0x4e')](_0x1ee26e[_0xe896('0x4a')],_0x1ee26e[_0xe896('0x4c')]);_0x1196d4['attributes']=_[_0xe896('0x4e')](_0x1ee26e[_0xe896('0x4a')],qs[_0xe896('0x4f')](_0xf78ce2['query'][_0xe896('0x4f')]));_0x1196d4[_0xe896('0x50')]=_0x1196d4[_0xe896('0x50')]['length']?_0x1196d4['attributes']:_0x1ee26e[_0xe896('0x4a')];if(!_0xf78ce2['query'][_0xe896('0x113')](_0xe896('0x52'))){_0x1196d4[_0xe896('0x53')]=qs[_0xe896('0x53')](_0xf78ce2[_0xe896('0x4c')][_0xe896('0x53')]);_0x1196d4[_0xe896('0x34')]=qs['offset'](_0xf78ce2['query'][_0xe896('0x34')]);}_0x1196d4[_0xe896('0x54')]=qs['sort'](_0xf78ce2[_0xe896('0x4c')][_0xe896('0x55')]);_0x1196d4['where']=qs['filters'](_['pick'](_0xf78ce2['query'],_0x1ee26e['filters']));_0x1196d4['where'][_0xe896('0xc0')]=_0x2e5c38['id'];if(_0xf78ce2['query'][_0xe896('0x91')]){_0x1196d4[_0xe896('0x56')]=_[_0xe896('0x3b')](_0x1196d4[_0xe896('0x56')],{'$or':_['map'](_0x1196d4[_0xe896('0x50')],function(_0x646354){var _0x3d751c={};_0x3d751c[_0x646354]={'$like':'%'+_0xf78ce2['query'][_0xe896('0x91')]+'%'};return _0x3d751c;})});}if(_0xf78ce2[_0xe896('0x4c')][_0xe896('0x8a')]){var _0x42bf84=_0xf78ce2[_0xe896('0x4c')][_0xe896('0x8a')][_0xe896('0x42')](',');var _0x115450={};_0x115450[_0x42bf84[0x0]]={'$gte':moment(_0x42bf84[0x1])[_0xe896('0xf1')](_0xe896('0x114'))};_0x1196d4['where']=_[_0xe896('0x3b')](_0x1196d4[_0xe896('0x56')],_0x115450);}_0x1196d4=_[_0xe896('0x3b')]({},_0x1196d4,_0xf78ce2[_0xe896('0xc6')]);return db['ChatMessage'][_0xe896('0x33')]({'where':_0x1196d4[_0xe896('0x56')]})[_0xe896('0x23')](function(_0x3bee56){_0x1bd649[_0xe896('0x33')]=_0x3bee56;if(_0xf78ce2[_0xe896('0x4c')]['includeAll']){_0x1196d4['include']=[{'all':!![]}];}return db[_0xe896('0xd9')]['findAll'](_0x1196d4);})['then'](function(_0x1d3083){_0x1bd649[_0xe896('0x115')]=_0x1d3083;return _0x1bd649;});}})[_0xe896('0x23')](respondWithFilteredResult(_0x3f8ea0,_0x1196d4))['catch'](handleError(_0x3f8ea0,null));};exports[_0xe896('0x116')]=function(_0x4ddfde,_0xc1bdcf,_0xdea91f){var _0x5c2af6={'where':{}},_0x306757={},_0x31f4e1={'count':0x0,'rows':[]};return db[_0xe896('0x47')][_0xe896('0xcc')]({'where':{'id':_0x4ddfde['params']['id']}})[_0xe896('0x23')](handleEntityNotFound(_0xc1bdcf,null))['then'](function(_0x186b58){if(_0x186b58){_0x306757[_0xe896('0x4a')]=_[_0xe896('0x4b')](db['ChatMessage']['rawAttributes']);_0x306757[_0xe896('0x4c')]=_[_0xe896('0x4b')](_0x4ddfde[_0xe896('0x4c')]);_0x306757[_0xe896('0x4d')]=_[_0xe896('0x4e')](_0x306757[_0xe896('0x4a')],_0x306757[_0xe896('0x4c')]);_0x5c2af6[_0xe896('0x50')]=_['intersection'](_0x306757[_0xe896('0x4a')],qs[_0xe896('0x4f')](_0x4ddfde['query'][_0xe896('0x4f')]));_0x5c2af6['attributes']=_0x5c2af6['attributes'][_0xe896('0x51')]?_0x5c2af6[_0xe896('0x50')]:_0x306757[_0xe896('0x4a')];if(!_0x4ddfde[_0xe896('0x4c')][_0xe896('0x113')]('nolimit')){_0x5c2af6[_0xe896('0x53')]=qs[_0xe896('0x53')](_0x4ddfde[_0xe896('0x4c')][_0xe896('0x53')]);_0x5c2af6[_0xe896('0x34')]=qs['offset'](_0x4ddfde[_0xe896('0x4c')][_0xe896('0x34')]);}_0x5c2af6[_0xe896('0x54')]=qs[_0xe896('0x55')](_0x4ddfde['query'][_0xe896('0x55')]);_0x5c2af6[_0xe896('0x56')]=qs[_0xe896('0x4d')](_[_0xe896('0x57')](_0x4ddfde['query'],_0x306757[_0xe896('0x4d')]));_0x5c2af6[_0xe896('0x56')][_0xe896('0xc0')]=_0x186b58['id'];if(_0x4ddfde[_0xe896('0x4c')][_0xe896('0x91')]){_0x5c2af6['where']=_[_0xe896('0x3b')](_0x5c2af6[_0xe896('0x56')],{'$or':_['map'](_0x5c2af6['attributes'],function(_0x42490d){var _0x2dba2f={};_0x2dba2f[_0x42490d]={'$like':'%'+_0x4ddfde[_0xe896('0x4c')][_0xe896('0x91')]+'%'};return _0x2dba2f;})});}_0x5c2af6['where'][_0xe896('0x117')]=![];if(_0x4ddfde[_0xe896('0x4c')]['id']){_0x5c2af6[_0xe896('0x56')]['id']={'$gt':_0x4ddfde[_0xe896('0x4c')]['id']};}_0x5c2af6=_['merge']({},_0x5c2af6,_0x4ddfde['options']);return db['ChatMessage'][_0xe896('0x33')]({'where':_0x5c2af6[_0xe896('0x56')]})[_0xe896('0x23')](function(_0xabf68b){_0x31f4e1[_0xe896('0x33')]=_0xabf68b;_0x5c2af6['include']=[];if(_0x4ddfde[_0xe896('0x4c')][_0xe896('0x118')]){_0x5c2af6['include'][_0xe896('0x44')]({'model':db[_0xe896('0x80')],'as':_0xe896('0x80'),'attributes':['id','fullname',_0xe896('0xfb')]});}if(_0x4ddfde[_0xe896('0x4c')][_0xe896('0x119')]){_0x5c2af6[_0xe896('0xc5')]=[{'all':!![]}];}return db[_0xe896('0xd9')][_0xe896('0x11a')](_0x5c2af6);})['then'](function(_0xbf5fec){_0x31f4e1[_0xe896('0x115')]=_0xbf5fec;return _0x31f4e1;});}})['then'](respondWithFilteredResult(_0xc1bdcf,_0x5c2af6))[_0xe896('0x45')](handleError(_0xc1bdcf,null));};exports[_0xe896('0x11b')]=function(_0x50e9f6,_0x3f7f9b,_0x45fbfd){return db['ChatInteraction']['find']({'where':{'id':_0x50e9f6[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x3f7f9b,null))['then'](function(_0xd7222b){if(_0xd7222b){return _0xd7222b[_0xe896('0x11c')](_0x50e9f6['body'][_0xe896('0x111')],_[_0xe896('0x110')](_0x50e9f6[_0xe896('0x3c')],[_0xe896('0x111'),'id'])||{})[_0xe896('0x11d')](function(){return db[_0xe896('0x11e')][_0xe896('0x11a')]({'attributes':['id',_0xe896('0x39'),_0xe896('0x59')],'where':{'id':_0x50e9f6[_0xe896('0x3c')]['ids']}});})[_0xe896('0x23')](function(_0x4b7dda){socket['emit'](_0xe896('0x11f'),{'id':Number(_0x50e9f6[_0xe896('0xc3')]['id']),'tags':_0x4b7dda||[]});return{'id':Number(_0x50e9f6['params']['id']),'tags':_0x4b7dda||[]};});}})['then'](respondWithResult(_0x3f7f9b,null))[_0xe896('0x45')](handleError(_0x3f7f9b,null));};exports[_0xe896('0x120')]=function(_0x40efd6,_0x513fbe,_0x17b841){return db[_0xe896('0x47')][_0xe896('0x6f')]({'where':{'id':_0x40efd6[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x513fbe,null))['then'](function(_0x704996){if(_0x704996){return _0x704996[_0xe896('0x120')](_0x40efd6[_0xe896('0x4c')]['ids']);}})[_0xe896('0x23')](respondWithStatusCode(_0x513fbe,null))[_0xe896('0x45')](handleError(_0x513fbe,null));};exports[_0xe896('0x121')]=function(_0x99a090,_0x15c4f9){var _0x4b1785=moment()['unix']()[_0xe896('0xab')]();var _0x5bc230=path[_0xe896('0xeb')](config[_0xe896('0xec')],_0xe896('0x122'),_0xe896('0x123'),'tmp');var _0x2d2654=path[_0xe896('0xeb')](config[_0xe896('0xec')],'server',_0xe896('0x123'),_0xe896('0x124'));var _0x5bbc65=path[_0xe896('0xeb')](_0x5bc230,_0x4b1785);var _0x194003=util[_0xe896('0xf1')](_0xe896('0x125'),_0x99a090[_0xe896('0xc3')]['id'],_0x4b1785);var _0x2a3489=path[_0xe896('0xeb')](_0x5bc230,_0x194003);var _0x54df80=[];_0x54df80[_0xe896('0x44')]({'model':db[_0xe896('0x80')],'as':_0xe896('0x80'),'attributes':['id',_0xe896('0x3f')],'raw':!![]});_0x54df80[_0xe896('0x44')]({'model':db[_0xe896('0xdd')],'as':_0xe896('0x74'),'attributes':['id',_0xe896('0x126'),'lastName'],'raw':!![]});if(_0x99a090[_0xe896('0x4c')][_0xe896('0x124')]){_0x54df80[_0xe896('0x44')]({'model':db['Attachment'],'as':_0xe896('0xe8'),'raw':!![]});}var _0x2279c9=[{'model':db[_0xe896('0xd9')],'as':_0xe896('0xf4'),'attributes':['id','body',_0xe896('0xfd'),_0xe896('0xff'),_0xe896('0x117'),_0xe896('0x8c')],'include':_0x54df80}];_0x2279c9[_0xe896('0x44')]({'model':db[_0xe896('0xcd')],'as':_0xe896('0x127'),'attributes':['id',_0xe896('0x39')]});_0x2279c9[_0xe896('0x44')]({'model':db[_0xe896('0x80')],'as':_0xe896('0x128'),'attributes':['id',_0xe896('0x3f')]});return db[_0xe896('0x47')][_0xe896('0x6f')]({'where':{'id':_0x99a090[_0xe896('0xc3')]['id']},'include':_0x2279c9})['then'](handleEntityNotFound(_0x15c4f9,null))['then'](function(_0x5cd4ff){if(_0x5cd4ff){var _0x81d8be=_0x5cd4ff[_0xe896('0x129')]({'plain':!![]});fs[_0xe896('0x12a')](_0x5bbc65);var _0x132625={'channel':_0xe896('0x12b'),'account':_0x81d8be[_0xe896('0x127')][_0xe896('0x39')],'agent':_0x81d8be[_0xe896('0x128')]?_0x81d8be[_0xe896('0x128')][_0xe896('0x3f')]:'N.A.','createdAt':moment(_0x81d8be[_0xe896('0xfd')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe896('0xab')](),'closedAt':_0x81d8be[_0xe896('0xe0')]?moment(_0x81d8be[_0xe896('0x12c')])[_0xe896('0xf1')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe896('0xab')]():'','disposition':_0x81d8be[_0xe896('0x12d')],'chatInfo':{'browser':_0x81d8be['browserName'],'os':_0x81d8be[_0xe896('0x12e')],'referer':_0x81d8be[_0xe896('0x12f')],'customerIp':_0x81d8be[_0xe896('0x130')],'customerPort':_0x81d8be[_0xe896('0x131')]?_0x81d8be['customerPort']:_0xe896('0x132')},'messages':_(_0x81d8be['Messages'])[_0xe896('0x133')]()[_0xe896('0x91')]({'secret':![]})[_0xe896('0x46')](function(_0x374e2f){if(_0x374e2f[_0xe896('0xe8')]){var _0x328e2b=path['join'](_0x2d2654,_0x374e2f[_0xe896('0xe8')][_0xe896('0xe5')]);if(fs[_0xe896('0x134')](_0x328e2b)){fs[_0xe896('0x135')](_0x328e2b)['pipe'](fs[_0xe896('0x136')](path[_0xe896('0xeb')](_0x5bbc65,_0x374e2f[_0xe896('0xe8')][_0xe896('0xe5')])));}}return{'date':moment(_0x374e2f['createdAt'])[_0xe896('0xf1')](_0xe896('0x114'))[_0xe896('0xab')](),'sender':_0x374e2f[_0xe896('0xff')]===_0xe896('0x137')?_0x374e2f[_0xe896('0x80')]?_0x374e2f[_0xe896('0x80')][_0xe896('0x3f')]:'System':_0x374e2f['Contact'][_0xe896('0x126')]+(_0x374e2f[_0xe896('0x74')][_0xe896('0x138')]?'\x20'+_0x374e2f[_0xe896('0x74')]['lastName']:''),'body':_0x374e2f[_0xe896('0xe8')]?_0x374e2f[_0xe896('0xe8')][_0xe896('0xe5')]:_0x374e2f[_0xe896('0x3c')],'direction':_0x374e2f[_0xe896('0xff')]===_0xe896('0x137')?'A':'C','secret':_0x374e2f[_0xe896('0x117')],'read':_0x374e2f['read'],'attachment':_0x374e2f[_0xe896('0xe8')]};})[_0xe896('0x70')]()};return ejs[_0xe896('0x139')](path[_0xe896('0xeb')](config[_0xe896('0xec')],'server',_0xe896('0x13a'),'downloadInteraction.ejs'),{'interaction':_0x132625})[_0xe896('0x23')](function(_0x50d56b){var _0x5d05a4=path[_0xe896('0xeb')](_0x5bbc65,_0xe896('0x13b')+_0x81d8be['id']+'-'+_0x4b1785+_0xe896('0x13c'));var _0x9223f={'path':_0x5d05a4,'channel':_0xe896('0x12b'),'interactionId':_0x81d8be['id']};return pdf[_0xe896('0x13d')](_0x50d56b,_0x9223f);})[_0xe896('0x23')](function(){return new BPromise(function(_0x399827,_0x2a2fa5){zipdir(_0x5bbc65,{'saveTo':_0x2a3489},function(_0x21d235,_0x3d7f5f){if(_0x21d235)return _0x2a2fa5(_0x21d235);return _0x399827(_0x3d7f5f);});})[_0xe896('0x23')](function(){return new BPromise(function(_0x313eb0,_0x54a741){rimraf(_0x5bbc65,function(_0x3edee9){if(_0x3edee9)_0x54a741(_0x3edee9);return _0x313eb0();});});})[_0xe896('0x23')](function(){return _0x15c4f9['download'](_0x2a3489,_0x194003,function(_0x42163c){if(_0x42163c){console[_0xe896('0x13e')]('err',_0x42163c);}else{fs[_0xe896('0x13f')](_0x2a3489);}});});});}else{return _0x15c4f9[_0xe896('0x2e')](0xc8);}})[_0xe896('0x45')](handleError(_0x15c4f9,null));};
\ No newline at end of file
+var _0x0abf=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','select','field','color','from','tools_tags','user_has_chat_interactions','users','chat_interactions','left_join','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','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','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.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','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','show','includeAll','include','options','params','describe','ChatWebsite','findOne','vidaooApiKey','vidaooTopic','vidaooMetadata','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','create','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','download','mailTranscript','format','transcript-%s.txt','now','User','CmContact','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','pick','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','root','attachments','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','firstName','views','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','json','offset','undefined','limit','count','reject','update','destroy','end','stack','name','render','merge','body','contact','agent','account','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','rawAttributes','fieldName','type','key','model'];(function(_0x3d2ebf,_0x492745){var _0x3ec55c=function(_0x17f9d9){while(--_0x17f9d9){_0x3d2ebf['push'](_0x3d2ebf['shift']());}};_0x3ec55c(++_0x492745);}(_0x0abf,0xe8));var _0xf0ab=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0abf[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0xf0ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ab('0x1'));var jsonpatch=require(_0xf0ab('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0ab('0x3'));var Mustache=require('mustache');var util=require(_0xf0ab('0x4'));var path=require(_0xf0ab('0x5'));var sox=require(_0xf0ab('0x6'));var csv=require(_0xf0ab('0x7'));var ejs=require(_0xf0ab('0x8'));var fs=require('fs');var fs_extra=require(_0xf0ab('0x9'));var _=require(_0xf0ab('0xa'));var squel=require('squel');var crypto=require(_0xf0ab('0xb'));var jsforce=require(_0xf0ab('0xc'));var deskjs=require(_0xf0ab('0xd'));var toCsv=require(_0xf0ab('0x7'));var querystring=require('querystring');var Papa=require(_0xf0ab('0xe'));var Redis=require(_0xf0ab('0xf'));var authService=require(_0xf0ab('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xf0ab('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0ab('0x12'))(_0xf0ab('0x13'));var utils=require(_0xf0ab('0x14'));var config=require(_0xf0ab('0x15'));var licenseUtil=require(_0xf0ab('0x16'));var db=require(_0xf0ab('0x17'))['db'];config[_0xf0ab('0x18')]=_['defaults'](config[_0xf0ab('0x18')],{'host':_0xf0ab('0x19'),'port':0x18eb});var socket=require(_0xf0ab('0x1a'))(new Redis(config[_0xf0ab('0x18')]));require(_0xf0ab('0x1b'))[_0xf0ab('0x1c')](socket);var jayson=require(_0xf0ab('0x1d'));var client=jayson[_0xf0ab('0x1e')][_0xf0ab('0x1f')]({'port':0x232b});var client9004=jayson[_0xf0ab('0x1e')][_0xf0ab('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x221bac,_0x200cf5,_0x2f4618,_0x230f40){return new BPromise(function(_0x54b0ce,_0x457465){var _0x9e3b47=_0x230f40||client;return _0x9e3b47[_0xf0ab('0x20')](_0x221bac,_0x2f4618)[_0xf0ab('0x21')](function(_0x776619){logger[_0xf0ab('0x22')](_0xf0ab('0x23'),_0x200cf5,_0xf0ab('0x24'));logger[_0xf0ab('0x25')](_0xf0ab('0x26'),_0x200cf5,_0xf0ab('0x24'),JSON[_0xf0ab('0x27')](_0x776619));if(_0x776619[_0xf0ab('0x28')]){if(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x29')]===0x1f4){logger[_0xf0ab('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);return _0x457465(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);}logger[_0xf0ab('0x28')](_0xf0ab('0x23'),_0x200cf5,_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);return _0x54b0ce(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);}else{logger[_0xf0ab('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,'request\x20sent');_0x54b0ce(_0x776619['result'][_0xf0ab('0x2a')]);}})['catch'](function(_0x3eca32){logger[_0xf0ab('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,_0x3eca32);_0x457465(_0x3eca32);});});}function respondWithStatusCode(_0x163078,_0x22671e){_0x22671e=_0x22671e||0xcc;return function(_0x10bf5f){if(_0x10bf5f){return _0x163078[_0xf0ab('0x2b')](_0x22671e);}return _0x163078[_0xf0ab('0x2c')](_0x22671e)['end']();};}function respondWithResult(_0x2d0da7,_0x574ce7){_0x574ce7=_0x574ce7||0xc8;return function(_0x55d799){if(_0x55d799){return _0x2d0da7[_0xf0ab('0x2c')](_0x574ce7)[_0xf0ab('0x2d')](_0x55d799);}};}function respondWithFilteredResult(_0x1b223d,_0x445160){return function(_0x43476c){if(_0x43476c){var _0x174052=typeof _0x445160[_0xf0ab('0x2e')]===_0xf0ab('0x2f')&&typeof _0x445160[_0xf0ab('0x30')]===_0xf0ab('0x2f');var _0x21e8ac=_0x43476c[_0xf0ab('0x31')];var _0x58cbe1=_0x174052?0x0:_0x445160[_0xf0ab('0x2e')];var _0x35973a=_0x174052?_0x43476c['count']:_0x445160['offset']+_0x445160[_0xf0ab('0x30')];var _0x1dc84e;if(_0x35973a>=_0x21e8ac){_0x35973a=_0x21e8ac;_0x1dc84e=0xc8;}else{_0x1dc84e=0xce;}_0x1b223d[_0xf0ab('0x2c')](_0x1dc84e);return _0x1b223d['set']('Content-Range',_0x58cbe1+'-'+_0x35973a+'/'+_0x21e8ac)[_0xf0ab('0x2d')](_0x43476c);}return null;};}function patchUpdates(_0x58fa03){return function(_0x1cfd52){try{jsonpatch['apply'](_0x1cfd52,_0x58fa03,!![]);}catch(_0x3f66fa){return BPromise[_0xf0ab('0x32')](_0x3f66fa);}return _0x1cfd52['save']();};}function saveUpdates(_0x56e728,_0x469f42){return function(_0x27c6f9){if(_0x27c6f9){return _0x27c6f9[_0xf0ab('0x33')](_0x56e728)[_0xf0ab('0x21')](function(_0x2519c7){return _0x2519c7;});}return null;};}function removeEntity(_0x36195d,_0x17f3b3){return function(_0xf8f0f4){if(_0xf8f0f4){return _0xf8f0f4[_0xf0ab('0x34')]()[_0xf0ab('0x21')](function(){_0x36195d[_0xf0ab('0x2c')](0xcc)[_0xf0ab('0x35')]();});}};}function handleEntityNotFound(_0x22dcfe,_0x437fdb){return function(_0x5d8443){if(!_0x5d8443){_0x22dcfe[_0xf0ab('0x2b')](0x194);}return _0x5d8443;};}function handleError(_0x45c449,_0xc575ed){_0xc575ed=_0xc575ed||0x1f4;return function(_0x5c9192){logger[_0xf0ab('0x28')](_0x5c9192[_0xf0ab('0x36')]);if(_0x5c9192[_0xf0ab('0x37')]){delete _0x5c9192['name'];}_0x45c449[_0xf0ab('0x2c')](_0xc575ed)['send'](_0x5c9192);};}function getMustacheRender(_0xda3971,_0x492d7c){return Mustache[_0xf0ab('0x38')](_0xda3971,_[_0xf0ab('0x39')](_0x492d7c[_0xf0ab('0x3a')],{'contact':_0x492d7c[_0xf0ab('0x3b')],'message':_0x492d7c[_0xf0ab('0x2a')],'agent':_0x492d7c[_0xf0ab('0x3c')],'interaction':_0x492d7c['interaction'],'account':_0x492d7c[_0xf0ab('0x3d')]}))||'';}function getInteractionUsers(_0x683d08,_0x5a6df5){return new BPromise(function(_0x207fbb,_0xce89bc){try{if(_0x5a6df5[_0x683d08['id']]){_0x683d08[_0xf0ab('0x3e')]=_[_0xf0ab('0x3f')](_0x5a6df5[_0x683d08['id']],function(_0x31fa72){return{'id':_0x31fa72['id'],'fullname':_0x31fa72[_0xf0ab('0x40')]};});}}catch(_0x28c20c){_0xce89bc(_0x28c20c);}_0x207fbb(_0x683d08);});}function getInteractionTags(_0x528d4b,_0x406a1d){return new BPromise(function(_0x4f6e93,_0x7c4629){try{if(_0x528d4b['TagIds']){_0x528d4b[_0xf0ab('0x41')]=[];_0x528d4b[_0xf0ab('0x42')][_0xf0ab('0x43')](',')[_0xf0ab('0x44')](function(_0x2b7ed5){_0x528d4b['Tags'][_0xf0ab('0x45')](_0x406a1d[_0x2b7ed5]);});}delete _0x528d4b[_0xf0ab('0x42')];}catch(_0x28e7a4){_0x7c4629(_0x28e7a4);}_0x4f6e93(_0x528d4b);});}function updateChatInteraction(_0x197955,_0x191caf,_0x17a73){return new BPromise(function(_0x45849c,_0x413f5c){return getInteractionUsers(_0x197955,_0x17a73)[_0xf0ab('0x21')](function(_0x3b214a){return getInteractionTags(_0x3b214a,_0x191caf);})[_0xf0ab('0x21')](function(_0x32ec93){_0x45849c(_0x32ec93);})[_0xf0ab('0x46')](function(_0x5e6b6b){_0x413f5c(_0x5e6b6b);});});}exports['index']=function(_0x2fc677,_0x4e6c41){var _0x1fc766={},_0x2d50c0={},_0x4bbdf6={'count':0x0,'rows':[]};var _0x8c2d2c=_[_0xf0ab('0x3f')](db['ChatInteraction'][_0xf0ab('0x47')],function(_0x29cc6a){return{'name':_0x29cc6a[_0xf0ab('0x48')],'type':_0x29cc6a[_0xf0ab('0x49')][_0xf0ab('0x4a')]};});_0x2d50c0[_0xf0ab('0x4b')]=_[_0xf0ab('0x3f')](_0x8c2d2c,_0xf0ab('0x37'));_0x2d50c0[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x2fc677[_0xf0ab('0x4c')]);_0x2d50c0[_0xf0ab('0x4e')]=_[_0xf0ab('0x4f')](_0x2d50c0[_0xf0ab('0x4b')],_0x2d50c0['query']);_0x1fc766['attributes']=_[_0xf0ab('0x4f')](_0x2d50c0['model'],qs['fields'](_0x2fc677['query'][_0xf0ab('0x50')]));_0x1fc766[_0xf0ab('0x51')]=_0x1fc766[_0xf0ab('0x51')][_0xf0ab('0x52')]?_0x1fc766[_0xf0ab('0x51')]:_0x2d50c0[_0xf0ab('0x4b')];if(!_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x53')](_0xf0ab('0x54'))){_0x1fc766[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x2fc677[_0xf0ab('0x4c')]['limit']);_0x1fc766[_0xf0ab('0x2e')]=qs[_0xf0ab('0x2e')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x2e')]);}_0x1fc766[_0xf0ab('0x55')]=qs[_0xf0ab('0x56')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x56')]);_0x1fc766['where']=qs['filters'](_['pick'](_0x2fc677[_0xf0ab('0x4c')],_0x2d50c0[_0xf0ab('0x4e')]),_0x8c2d2c);var _0x577c85=[];var _0xa1a416=squel[_0xf0ab('0x57')]()['field']('id')[_0xf0ab('0x58')](_0xf0ab('0x37'))[_0xf0ab('0x58')](_0xf0ab('0x59'))[_0xf0ab('0x5a')](_0xf0ab('0x5b'));var _0x26508b=squel['select']()[_0xf0ab('0x58')]('u.id')[_0xf0ab('0x58')]('u.fullname')[_0xf0ab('0x58')]('ui.ChatInteractionId')['from'](_0xf0ab('0x5c'),'ui')['left_join'](_0xf0ab('0x5d'),'u','u.id\x20=\x20ui.UserId');var _0x2eff07=squel['select']()[_0xf0ab('0x5a')](_0xf0ab('0x5e'),'i')[_0xf0ab('0x5f')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xf0ab('0x5d'),'o',_0xf0ab('0x60'))['left_join']('chat_websites','a',_0xf0ab('0x61'))[_0xf0ab('0x5f')](_0xf0ab('0x62'),'me',_0xf0ab('0x63'))[_0xf0ab('0x5f')](_0xf0ab('0x64'),'it',_0xf0ab('0x65'))[_0xf0ab('0x5f')](_0xf0ab('0x5b'),'t',_0xf0ab('0x66'));var _0x1e6a4e=squel['expr']();var _0x41ed17=[];var _0x5b24e3=squel[_0xf0ab('0x67')]();var _0x61d3db;if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x68')]){_0x61d3db=as[_0xf0ab('0x69')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x68')]);var _0x1f11aa=_0x61d3db[_0xf0ab('0x6a')];for(var _0x180ee6=0x0;_0x180ee6<_0x61d3db['conditions'][_0xf0ab('0x52')];_0x180ee6++){var _0x2266f3=_0x61d3db[_0xf0ab('0x6b')][_0x180ee6];var _0x1d4a72='i';var _0x2232eb=_[_0xf0ab('0x6c')](_0x8c2d2c,[_0xf0ab('0x37'),_0x2266f3[_0xf0ab('0x58')]]);if(!_0x2232eb){switch(_0x2266f3[_0xf0ab('0x58')]){case'unreadMessages':if(_0x2266f3['value']==0x1){_0x2eff07[_0xf0ab('0x6d')]('`'+_0x2266f3[_0xf0ab('0x58')]+_0xf0ab('0x6e'));}else{_0x2eff07['having']('`'+_0x2266f3[_0xf0ab('0x58')]+_0xf0ab('0x6f'));}break;case _0xf0ab('0x70'):if(_0x2266f3['operator']===_0xf0ab('0x71')){if(_0x2266f3[_0xf0ab('0x72')][_0xf0ab('0x43')]('\x20')[_0xf0ab('0x52')]>0x1){_0x1e6a4e[_0x1f11aa](_0xf0ab('0x73'),qs['getFullTextValue'](_0x2266f3[_0xf0ab('0x72')]),null);}else{var _0x70b02d='%'+_0x2266f3[_0xf0ab('0x72')]+'%';_0x1e6a4e[_0x1f11aa](_0xf0ab('0x74'),_0x70b02d,_0x70b02d,_0x70b02d);}}else{_0x2232eb=_[_0xf0ab('0x6c')](_0x8c2d2c,[_0xf0ab('0x37'),_0xf0ab('0x75')]);_0x2266f3[_0xf0ab('0x58')]=_0xf0ab('0x75');_0x5154f5=as[_0xf0ab('0x76')](_0x1d4a72,_0x2232eb[_0xf0ab('0x49')],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')]['start'],_0x5154f5['value'][_0xf0ab('0x35')]);}break;case _0xf0ab('0x78'):var _0x325ad6=_0x2266f3['value'][_0xf0ab('0x43')](',')['map'](function(_0x1a32dc){return Number(_0x1a32dc);});_0x325ad6[_0xf0ab('0x44')](function(_0x1787e2){_0x5b24e3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1787e2+',%');});_0x41ed17=_[_0xf0ab('0x79')](_0x41ed17,_0x325ad6);break;case'User':if(_0x2266f3['operator']===_0xf0ab('0x71')){_0x1e6a4e[_0x1f11aa](_0xf0ab('0x7a'),'%'+_0x2266f3[_0xf0ab('0x72')]+'%',null);}else{_0x2232eb=_['find'](_0x8c2d2c,[_0xf0ab('0x37'),_0xf0ab('0x7b')]);_0x2266f3[_0xf0ab('0x58')]=_0xf0ab('0x7b');_0x5154f5=as['buildExpression'](_0x1d4a72,_0x2232eb['type'],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5['text'],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);}break;case _0xf0ab('0x3a'):_0x5154f5=as[_0xf0ab('0x76')]('me',null,_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);break;}}else{var _0x5154f5=as[_0xf0ab('0x76')](_0x1d4a72,_0x2232eb[_0xf0ab('0x49')],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);}}}else{var _0x42f067=_(_0x2fc677['query'])[_0xf0ab('0x4d')]()[_0xf0ab('0x3f')](function(_0x4c8e95){return _['some'](_0x8c2d2c,['name',_0x4c8e95])?_0x4c8e95:undefined;})[_0xf0ab('0x7d')]()[_0xf0ab('0x72')]();if(!_[_0xf0ab('0x7e')](_0x42f067)){_0x42f067[_0xf0ab('0x44')](function(_0x15aa78){if(_0x15aa78===_0xf0ab('0x7f')){_0x2eff07['where'](_0xf0ab('0x80'),[]['concat'](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]));}else if(_0x15aa78==='createdAt'){var _0x2978a9=JSON['parse'](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78])['$gte'];var _0x58ca28=JSON[_0xf0ab('0x81')](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78])[_0xf0ab('0x82')];_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x84'),_0x2978a9,_0x58ca28);}else{if(_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]===_0xf0ab('0x85')){_0x2eff07[_0xf0ab('0x83')]('i.'+_0x15aa78+_0xf0ab('0x86'));}else{_0x2eff07[_0xf0ab('0x83')]('i.'+_0x15aa78+_0xf0ab('0x87'),_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]);}}});}if(_0x2fc677[_0xf0ab('0x4c')]['read']){if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x88')]==0x1){_0x2eff07[_0xf0ab('0x6d')](_0xf0ab('0x89'));}else{_0x2eff07[_0xf0ab('0x6d')](_0xf0ab('0x8a'));}}if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')]){_0x41ed17=_[_0xf0ab('0x8c')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')])?_0x2fc677[_0xf0ab('0x4c')]['tag']:new Array(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')]);_0x41ed17[_0xf0ab('0x44')](function(_0x2196a7){_0x5b24e3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2196a7+',%');});}if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8d')]){var _0x4463cc=_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8d')]['replace']('\x5c','\x5c\x5c')[_0xf0ab('0x8e')](/'/g,'\x27\x27');if(qs[_0xf0ab('0x8f')](_0x4463cc)){_0x1e6a4e['or']('i.id\x20LIKE\x20?',_0x4463cc+'%');}else{_0x1e6a4e['or'](_0xf0ab('0x90'),qs['getFullTextValue'](_0x4463cc))['or'](_0xf0ab('0x91'),_0x4463cc+'%');}}}_0x2eff07[_0xf0ab('0x83')](_0x1e6a4e);_0x2eff07['group'](_0xf0ab('0x92'));var _0x148a72={'type':db['Sequelize']['QueryTypes'][_0xf0ab('0x93')],'raw':!![]};var _0x58140c=_0x2eff07[_0xf0ab('0x94')]();_0x58140c[_0xf0ab('0x58')]('i.id');_0x58140c['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf0ab('0x95'));if(_0x1fc766[_0xf0ab('0x55')]){_0x1fc766[_0xf0ab('0x55')][_0xf0ab('0x44')](function(_0x49c89f){var _0x272f9c=_0x49c89f[0x0]===_0xf0ab('0x96')?_0x49c89f[0x0]:'i.'+_0x49c89f[0x0];_0x2eff07[_0xf0ab('0x55')](_0x272f9c,_0x49c89f[0x1]===_0xf0ab('0x97')?![]:!![]);});}if(!_[_0xf0ab('0x7e')](_0x41ed17)){_0x2eff07['having'](_0x5b24e3);_0x58140c['where'](_0xf0ab('0x98'),_0x41ed17);}BPromise[_0xf0ab('0x99')]()['then'](function(){if(!_0x61d3db){if(_0x2fc677['query'][_0xf0ab('0x7f')])return;_0x58140c[_0xf0ab('0x83')](_0xf0ab('0x9a'));_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x9a'));return;}if(_0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9c')]!==_0xf0ab('0x3c'))return;return _0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9d')]({'attributes':['id'],'raw':!![]})[_0xf0ab('0x21')](function(_0x52eca9){if(_['isEmpty'](_0x52eca9)){_0x58140c[_0xf0ab('0x83')]('i.ChatWebsiteId\x20IS\x20NULL');_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x9e'));}else{_0x58140c[_0xf0ab('0x83')](_0xf0ab('0x80'),_['map'](_0x52eca9,'id'));_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x80'),_[_0xf0ab('0x3f')](_0x52eca9,'id'));}});})[_0xf0ab('0x21')](function(){if(_0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9c')]===_0xf0ab('0x3c')&&!_0x61d3db&&!_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x7f')])return[];return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0x58140c[_0xf0ab('0xa0')](),_0x148a72);})[_0xf0ab('0x21')](function(_0x4211a1){_0x4bbdf6['count']=_0x4211a1[_0xf0ab('0x52')];if(_0x4bbdf6[_0xf0ab('0x31')]===0x0)return[];return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0xa1a416[_0xf0ab('0xa0')](),_0x148a72)[_0xf0ab('0x21')](function(_0x611cf7){_0x577c85=_['keyBy'](_0x611cf7,'id');_0x148a72=_['merge'](_0x148a72,{'model':db[_0xf0ab('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x50')]){_0x1fc766['attributes'][_0xf0ab('0x44')](function(_0x405b34){_0x2eff07[_0xf0ab('0x58')]('i.'+_0x405b34);});}else{_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa2'),'unreadMessages');_0x2eff07['field'](_0xf0ab('0xa3'),'Account.key');_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa4'),'Account.mandatoryDisposition');_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa5'),_0xf0ab('0x96'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa6'));_0x2eff07['field'](_0xf0ab('0xa7'),_0xf0ab('0xa8'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa9'),_0xf0ab('0xaa'));_0x2eff07['field'](_0xf0ab('0xab'),_0xf0ab('0xac'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xad'),_0xf0ab('0xae'));_0x2eff07['field'](_0xf0ab('0xaf'),_0xf0ab('0xb0'));_0x2eff07[_0xf0ab('0x58')]('c.fax',_0xf0ab('0xb1'));_0x2eff07['field'](_0xf0ab('0xb2'),_0xf0ab('0xb3'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xb4'),'Owner.internal');_0x2eff07[_0xf0ab('0x58')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x1fc766[_0xf0ab('0x30')])_0x2eff07['limit'](_0x1fc766['limit']);if(_0x1fc766[_0xf0ab('0x2e')])_0x2eff07[_0xf0ab('0x2e')](_0x1fc766['offset']);return db['sequelize']['query'](_0x2eff07['toString'](),_0x148a72);})[_0xf0ab('0x21')](function(_0x12d9b6){if(_0x12d9b6[_0xf0ab('0x52')]>0x0)_0x26508b[_0xf0ab('0x83')](_0xf0ab('0xb5'),_['map'](_0x12d9b6,'id'));return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0x26508b[_0xf0ab('0xa0')](),_0x148a72)[_0xf0ab('0x21')](function(_0x84eab9){var _0x27cd98=_[_0xf0ab('0xb6')](_0x84eab9,'ChatInteractionId');var _0x16dca7=[];_0x12d9b6[_0xf0ab('0x44')](function(_0x39633a){_0x16dca7[_0xf0ab('0x45')](updateChatInteraction(_0x39633a,_0x577c85,_0x27cd98));});return BPromise[_0xf0ab('0xb7')](_0x16dca7);});});})[_0xf0ab('0x21')](function(_0x527a4b){_0x4bbdf6[_0xf0ab('0xb8')]=_0x527a4b;return _0x4bbdf6;})[_0xf0ab('0x21')](respondWithFilteredResult(_0x4e6c41,_0x1fc766))[_0xf0ab('0x46')](handleError(_0x4e6c41,null));};exports[_0xf0ab('0xb9')]=function(_0x4ca7a3,_0x426419){var _0x395bf6={'raw':![],'where':{'id':_0x4ca7a3['params']['id']}},_0x5b7744={};_0x5b7744[_0xf0ab('0x4b')]=_[_0xf0ab('0x4d')](db[_0xf0ab('0xa1')][_0xf0ab('0x47')]);_0x5b7744[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x4ca7a3[_0xf0ab('0x4c')]);_0x5b7744[_0xf0ab('0x4e')]=_['intersection'](_0x5b7744[_0xf0ab('0x4b')],_0x5b7744['query']);_0x395bf6['attributes']=_[_0xf0ab('0x4f')](_0x5b7744[_0xf0ab('0x4b')],qs[_0xf0ab('0x50')](_0x4ca7a3[_0xf0ab('0x4c')][_0xf0ab('0x50')]));_0x395bf6[_0xf0ab('0x51')]=_0x395bf6[_0xf0ab('0x51')][_0xf0ab('0x52')]?_0x395bf6['attributes']:_0x5b7744[_0xf0ab('0x4b')];if(_0x4ca7a3[_0xf0ab('0x4c')][_0xf0ab('0xba')]){_0x395bf6[_0xf0ab('0xbb')]=[{'all':!![]}];}_0x395bf6=_[_0xf0ab('0x39')]({},_0x395bf6,_0x4ca7a3[_0xf0ab('0xbc')]);return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')](_0x395bf6)[_0xf0ab('0x21')](handleEntityNotFound(_0x426419,null))[_0xf0ab('0x21')](respondWithResult(_0x426419,null))['catch'](handleError(_0x426419,null));};exports['create']=function(_0x58946c,_0x2f339d){return db['ChatInteraction']['create'](_0x58946c[_0xf0ab('0x3a')],{})[_0xf0ab('0x21')](respondWithResult(_0x2f339d,0xc9))[_0xf0ab('0x46')](handleError(_0x2f339d,null));};exports[_0xf0ab('0x33')]=function(_0xdf495,_0x55a296){if(_0xdf495[_0xf0ab('0x3a')]['id']){delete _0xdf495[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0xdf495[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x55a296,null))[_0xf0ab('0x21')](saveUpdates(_0xdf495[_0xf0ab('0x3a')],null))['then'](respondWithResult(_0x55a296,null))[_0xf0ab('0x46')](handleError(_0x55a296,null));};exports['destroy']=function(_0x3c1a2c,_0x17a3b6){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x3c1a2c[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x17a3b6,null))[_0xf0ab('0x21')](removeEntity(_0x17a3b6,null))[_0xf0ab('0x46')](handleError(_0x17a3b6,null));};exports[_0xf0ab('0xbe')]=function(_0x1f2efa,_0x1d12fb){return db[_0xf0ab('0xa1')]['describe']()[_0xf0ab('0x21')](respondWithResult(_0x1d12fb,null))[_0xf0ab('0x46')](handleError(_0x1d12fb,null));};exports['createVidaooSession']=function(_0x35486d,_0x3f5ade){var _0x135a10=_0x35486d[_0xf0ab('0xbd')]['id'];var _0x48fc7e;var _0x5f55d2;var _0x7c7c3b;return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x135a10}})[_0xf0ab('0x21')](function(_0x2beaaa){_0x48fc7e=_0x2beaaa;return db[_0xf0ab('0xbf')][_0xf0ab('0xc0')]({'where':{'id':_0x2beaaa[_0xf0ab('0x7f')]},'attributes':['id',_0xf0ab('0xc1'),'vidaooEscalation',_0xf0ab('0xc2'),'vidaooNote',_0xf0ab('0xc3')],'raw':!![]});})[_0xf0ab('0x21')](function(_0x354e18){if(_0x354e18&&_0x354e18['vidaooApiKey']&&_0x354e18[_0xf0ab('0xc4')]){_0x5f55d2=_0x354e18;var _0x2068d6={'interaction':{'id':_0x135a10},'agent':{'id':_0x35486d[_0xf0ab('0x9b')]['id'],'name':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0x37')],'fullname':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0x40')],'email':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0xc5')]},'contact':_0x35486d['body']['contact'],'account':_0x35486d[_0xf0ab('0x3a')][_0xf0ab('0x3d')]};var _0x35b480={'rejectUnauthorized':![],'method':_0xf0ab('0xc6'),'url':_0xf0ab('0xc7'),'headers':{'X-APIKEY':_0x354e18[_0xf0ab('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0xc5')]],'buttons':null,'topic':_0x5f55d2[_0xf0ab('0xc2')],'note':_[_0xf0ab('0xc8')](_0x5f55d2['vidaooNote'])?null:getMustacheRender(_0x5f55d2[_0xf0ab('0xc9')],_0x2068d6),'metadata':null},'redirect':_0xf0ab('0xca'),'json':!![]};try{if(!_[_0xf0ab('0xc8')](_0x5f55d2[_0xf0ab('0xc3')])){var _0x41e2d8=getMustacheRender(_0x5f55d2[_0xf0ab('0xc3')],_0x2068d6);var _0x57f44d=JSON[_0xf0ab('0x81')](_0x41e2d8);_0x35b480[_0xf0ab('0x3a')][_0xf0ab('0xcb')]=_0x57f44d;}}catch(_0x533b37){throw new db[(_0xf0ab('0xcc'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x35b480);}else{throw new db[(_0xf0ab('0xcc'))][(_0xf0ab('0xcd'))](_0xf0ab('0xce'));}})['then'](function(_0x1697ca){_0x7c7c3b=_0x1697ca;if(_0x7c7c3b['id']){var _0x15da8a={'body':_0x7c7c3b[_0xf0ab('0xcf')],'ChatWebsiteId':_0x5f55d2['id'],'ChatInteractionId':_0x48fc7e['id'],'direction':'out','UserId':_0x35486d[_0xf0ab('0x9b')]['id']};return db[_0xf0ab('0xd0')][_0xf0ab('0xd1')](_0x15da8a,{});}else{throw new db['Sequelize'][(_0xf0ab('0xcd'))](_0xf0ab('0xd2'));}})[_0xf0ab('0x21')](function(){return _0x48fc7e[_0xf0ab('0xd3')]({'vidaooSessionId':_0x7c7c3b['id']});})[_0xf0ab('0x21')](respondWithResult(_0x3f5ade,null))[_0xf0ab('0x46')](handleError(_0x3f5ade,null));};exports[_0xf0ab('0xd4')]=function(_0x115e3d,_0x2d0f9c){if(_0x115e3d[_0xf0ab('0x3a')]['id']){delete _0x115e3d[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x115e3d[_0xf0ab('0xbd')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xf0ab('0x21')](handleEntityNotFound(_0x2d0f9c,null))[_0xf0ab('0x21')](saveUpdates(_0x115e3d['body'],null))[_0xf0ab('0x21')](respondWithResult(_0x2d0f9c,null))['catch'](handleError(_0x2d0f9c,null));};exports[_0xf0ab('0xd5')]=function(_0x1e9768,_0x4398a3,_0x4195d9){if(_0x1e9768[_0xf0ab('0x3a')]['id']){delete _0x1e9768[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x1e9768[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](function(_0x5f10a5){if(!_0x5f10a5){logger[_0xf0ab('0x28')](_0xf0ab('0xd6'),_0xf0ab('0xd5'),0x194,_0xf0ab('0xd7'));_0x4398a3[_0xf0ab('0x2b')](0x194);}else{if(_0x5f10a5[_0xf0ab('0x7b')]){throw new db['Sequelize']['ValidationError'](_0xf0ab('0xd8'));}}return _0x5f10a5;})[_0xf0ab('0x21')](function(_0x564124){if(_0x564124){return _0x564124[_0xf0ab('0x33')]({'closed':_0x1e9768[_0xf0ab('0x3a')][_0xf0ab('0xd9')],'disposition':_0x1e9768['body'][_0xf0ab('0xda')]})[_0xf0ab('0x21')](function(_0x2d9046){return _0x2d9046;});}})[_0xf0ab('0x21')](function(_0x4e5f1e){return respondWithRpcPromise(_0xf0ab('0xdb'),_0xf0ab('0xd5'),_0x1e9768[_0xf0ab('0x3a')],client9004);})['then'](respondWithResult(_0x4398a3,null))['catch'](handleError(_0x4398a3,null));};exports['attachmentUpload']=function(_0x581cb1,_0x22251d,_0x2b5993){_0x581cb1[_0xf0ab('0x3a')]['name']=_0x581cb1[_0xf0ab('0xdc')]['originalname'];_0x581cb1[_0xf0ab('0x3a')][_0xf0ab('0xdd')]=_0x581cb1[_0xf0ab('0xdc')][_0xf0ab('0xde')];_0x581cb1[_0xf0ab('0x3a')][_0xf0ab('0x49')]=_0x581cb1[_0xf0ab('0xdc')][_0xf0ab('0xdf')];return db[_0xf0ab('0xe0')][_0xf0ab('0xd1')](_0x581cb1[_0xf0ab('0x3a')])[_0xf0ab('0x21')](respondWithResult(_0x22251d,0xc9))[_0xf0ab('0x46')](handleError(_0x22251d,null));};exports[_0xf0ab('0xe1')]=function(_0x4d09bf,_0x415b9d,_0x11ed58){return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x4d09bf[_0xf0ab('0xbd')]['id']},'raw':!![]})[_0xf0ab('0x21')](handleEntityNotFound(_0x415b9d,null))[_0xf0ab('0x21')](function(_0x278e32){if(_0x278e32){if(_0x278e32['closed']){return _0x415b9d[_0xf0ab('0x2c')](0x193)[_0xf0ab('0x2d')]({'status':0x193,'message':_0xf0ab('0xe2')});}return db[_0xf0ab('0xe0')][_0xf0ab('0xc0')]({'where':{'id':_0x4d09bf[_0xf0ab('0x4c')][_0xf0ab('0xe3')]},'raw':!![]})[_0xf0ab('0x21')](handleEntityNotFound(_0x415b9d,null));}})['then'](function(_0xadae03){if(_0xadae03){var _0x550b00=_0xadae03[_0xf0ab('0xe4')]!==null;var _0x2bfb6a=path[_0xf0ab('0xe5')](config['root'],_0xf0ab('0xe6'));if(_0x550b00){_0x2bfb6a=path[_0xf0ab('0xe5')](_0x2bfb6a,'offline-chat/');}var _0x5d62e4=path['join'](_0x2bfb6a,_0xadae03['basename']);return _0x415b9d[_0xf0ab('0xe7')](_0x5d62e4);}})['catch'](handleError(_0x415b9d,null));};exports['close']=function(_0x3b8bbe,_0x7e24c4){var _0x2d0ea3=null;var _0x4a18ad=null;var _0x57aaae=null;var _0x2ab0be=null;if(_0x3b8bbe[_0xf0ab('0x3a')]['id']){delete _0x3b8bbe['body']['id'];}if(_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xe8')]){_0x2ab0be=path['join'](config['root'],'server/files/chat/upload/',util[_0xf0ab('0xe9')](_0xf0ab('0xea'),Date[_0xf0ab('0xeb')]()));_0x3b8bbe[_0xf0ab('0x3a')]['pathTranscript']=_0x2ab0be;}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x3b8bbe['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0xf0ab('0xec')],'as':'User'}]}]})[_0xf0ab('0x21')](handleEntityNotFound(_0x7e24c4,null))[_0xf0ab('0x21')](saveUpdates(_0x3b8bbe[_0xf0ab('0x3a')],null))[_0xf0ab('0x21')](function(_0x116c84){if(_0x116c84){_0x2d0ea3=_0x116c84;return db[_0xf0ab('0xbf')][_0xf0ab('0x6c')]({'where':{'id':_0x2d0ea3[_0xf0ab('0x7f')]}});}})[_0xf0ab('0x21')](function(_0x1d6e15){if(_0x1d6e15){_0x57aaae=_0x1d6e15;return db[_0xf0ab('0xed')][_0xf0ab('0x6c')]({'where':{'id':_0x2d0ea3['ContactId']}});}})[_0xf0ab('0x21')](function(_0x29427c){if(_0x29427c){_0x4a18ad=_0x29427c;if(_0x2ab0be){var _0x29d4a1=null;for(var _0x50e996=0x1;_0x50e996<_0x2d0ea3['Messages'][_0xf0ab('0x52')];++_0x50e996){_0x29d4a1=_0x2d0ea3[_0xf0ab('0xee')][_0x50e996];var _0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae[_0xf0ab('0xf0')],_0x29d4a1[_0xf0ab('0x7b')]):_0xf0ab('0xf1');var _0xc1537e=_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xf2')]||util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0xf0ab('0xf3'),_0x29d4a1[_0xf0ab('0x75')]);switch(_0x57aaae[_0xf0ab('0xf4')]){case _0xf0ab('0xf5'):_0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae['agentAlias'],_0x29d4a1[_0xf0ab('0x7b')]):'System';break;case _0xf0ab('0xf6'):_0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?_0x29d4a1[_0xf0ab('0xec')][_0xf0ab('0xf7')]||_0x29d4a1['User'][_0xf0ab('0x40')]:'System';break;case'agent_fullname':_0x8e04bb=_0x29d4a1['UserId']?_0x29d4a1[_0xf0ab('0xec')][_0xf0ab('0x40')]:_0xf0ab('0xf1');break;default:_0x8e04bb=_0x29d4a1['UserId']?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae[_0xf0ab('0xf0')],_0x29d4a1[_0xf0ab('0x7b')]):_0xf0ab('0xf1');}var _0x2c39f0=util[_0xf0ab('0xe9')](_0xf0ab('0xf8'),moment(_0x29d4a1[_0xf0ab('0xf9')])[_0xf0ab('0xe9')](_0xf0ab('0xfa')),_0x29d4a1[_0xf0ab('0xfb')]==='in'?_0xc1537e:_0x8e04bb,_0x29d4a1['body']);if(!_0x29d4a1[_0xf0ab('0xfc')]){fs[_0xf0ab('0xfd')](_0x2ab0be,_0x2c39f0);}}return db[_0xf0ab('0xfe')][_0xf0ab('0xc0')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf0ab('0xff'),'raw':!![]}]});}}})['then'](function(_0x21eb2b){if(_0x21eb2b&&_0x21eb2b['Smtp']&&_0x3b8bbe[_0xf0ab('0x3a')]){var _0x262659={'tls':{'rejectUnauthorized':![]}};if(_0x21eb2b['Smtp'][_0xf0ab('0x100')]){_0x262659[_0xf0ab('0x100')]=_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x100')];}else{_0x262659[_0xf0ab('0x101')]=_0x21eb2b['Smtp'][_0xf0ab('0x101')];_0x262659[_0xf0ab('0x102')]=_0x21eb2b[_0xf0ab('0xff')]['port'];_0x262659['secure']=_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x103')];}if(_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x104')]){_0x262659['auth']={'user':_0x21eb2b['Smtp'][_0xf0ab('0x9b')],'pass':_0x21eb2b[_0xf0ab('0xff')]['pass']};}return respondWithRpcPromise('SendMail',_0xf0ab('0x105'),{'account':_0x262659,'message':{'from':util['format'](_0xf0ab('0x106'),_0x21eb2b['name'],_0x21eb2b[_0xf0ab('0xc5')]||_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x9b')]),'to':_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xe8')],'subject':_0xf0ab('0x107'),'text':util[_0xf0ab('0xe9')](_0xf0ab('0x108'),_0x3b8bbe['body'][_0xf0ab('0xe8')]),'attachments':[{'path':_0x2ab0be}]}})[_0xf0ab('0x21')](function(){return _0x2d0ea3;})[_0xf0ab('0x46')](function(_0x15f041){console[_0xf0ab('0x28')](_0x15f041);});}else{return _0x2d0ea3;}})['then'](respondWithStatusCode(_0x7e24c4,0xc8))[_0xf0ab('0x46')](handleError(_0x7e24c4,null));};exports[_0xf0ab('0x109')]=function(_0x5eda4b,_0x57a8ab,_0x3cee1d){return db[_0xf0ab('0xd0')][_0xf0ab('0x6c')]({'where':{'id':_0x5eda4b[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x57a8ab,null))[_0xf0ab('0x21')](function(_0x4dff6e){if(_0x4dff6e){return _0x4dff6e[_0xf0ab('0x109')](_0x5eda4b[_0xf0ab('0x3a')][_0xf0ab('0x10a')],_[_0xf0ab('0x10b')](_0x5eda4b[_0xf0ab('0x3a')],[_0xf0ab('0x10a'),'id'])||{});}})['then'](respondWithResult(_0x57a8ab,null))[_0xf0ab('0x46')](handleError(_0x57a8ab,null));};exports['getMessages']=function(_0x283bf5,_0x1afcea,_0x22a9f8){var _0x33dbfc={'raw':![],'where':{}};var _0x487318={};var _0x546e13={'count':0x0,'rows':[]};return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x283bf5[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x1afcea,null))[_0xf0ab('0x21')](function(_0xa3b903){if(_0xa3b903){_0x487318['model']=_[_0xf0ab('0x4d')](db[_0xf0ab('0xd0')][_0xf0ab('0x47')]);_0x487318[_0xf0ab('0x4c')]=_['keys'](_0x283bf5[_0xf0ab('0x4c')]);_0x487318[_0xf0ab('0x4e')]=_['intersection'](_0x487318[_0xf0ab('0x4b')],_0x487318[_0xf0ab('0x4c')]);_0x33dbfc[_0xf0ab('0x51')]=_[_0xf0ab('0x4f')](_0x487318[_0xf0ab('0x4b')],qs['fields'](_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x50')]));_0x33dbfc[_0xf0ab('0x51')]=_0x33dbfc['attributes'][_0xf0ab('0x52')]?_0x33dbfc[_0xf0ab('0x51')]:_0x487318[_0xf0ab('0x4b')];if(!_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x53')](_0xf0ab('0x54'))){_0x33dbfc[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x30')]);_0x33dbfc['offset']=qs['offset'](_0x283bf5[_0xf0ab('0x4c')]['offset']);}_0x33dbfc['order']=qs[_0xf0ab('0x56')](_0x283bf5[_0xf0ab('0x4c')]['sort']);_0x33dbfc[_0xf0ab('0x83')]=qs[_0xf0ab('0x4e')](_[_0xf0ab('0x10c')](_0x283bf5['query'],_0x487318[_0xf0ab('0x4e')]));_0x33dbfc['where'][_0xf0ab('0x10d')]=_0xa3b903['id'];if(_0x283bf5['query'][_0xf0ab('0x8d')]){_0x33dbfc[_0xf0ab('0x83')]=_[_0xf0ab('0x39')](_0x33dbfc['where'],{'$or':_[_0xf0ab('0x3f')](_0x33dbfc[_0xf0ab('0x51')],function(_0x2ddc1d){var _0x3cef14={};_0x3cef14[_0x2ddc1d]={'$like':'%'+_0x283bf5['query'][_0xf0ab('0x8d')]+'%'};return _0x3cef14;})});}if(_0x283bf5[_0xf0ab('0x4c')]['$gte']){var _0x38ea18=_0x283bf5[_0xf0ab('0x4c')]['$gte']['split'](',');var _0x7ee6b3={};_0x7ee6b3[_0x38ea18[0x0]]={'$gte':moment(_0x38ea18[0x1])[_0xf0ab('0xe9')](_0xf0ab('0x10e'))};_0x33dbfc['where']=_[_0xf0ab('0x39')](_0x33dbfc['where'],_0x7ee6b3);}_0x33dbfc=_[_0xf0ab('0x39')]({},_0x33dbfc,_0x283bf5['options']);return db[_0xf0ab('0xd0')]['count']({'where':_0x33dbfc['where']})['then'](function(_0x1d1451){_0x546e13['count']=_0x1d1451;if(_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0xba')]){_0x33dbfc[_0xf0ab('0xbb')]=[{'all':!![]}];}return db[_0xf0ab('0xd0')][_0xf0ab('0x10f')](_0x33dbfc);})['then'](function(_0x16a1d2){_0x546e13[_0xf0ab('0xb8')]=_0x16a1d2;return _0x546e13;});}})[_0xf0ab('0x21')](respondWithFilteredResult(_0x1afcea,_0x33dbfc))[_0xf0ab('0x46')](handleError(_0x1afcea,null));};exports[_0xf0ab('0x110')]=function(_0x4b91de,_0x3a602f,_0x47788a){var _0x3592f1={'where':{}},_0x577f13={},_0x2f99c2={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf0ab('0xc0')]({'where':{'id':_0x4b91de[_0xf0ab('0xbd')]['id']}})['then'](handleEntityNotFound(_0x3a602f,null))['then'](function(_0x43c6b8){if(_0x43c6b8){_0x577f13['model']=_[_0xf0ab('0x4d')](db[_0xf0ab('0xd0')][_0xf0ab('0x47')]);_0x577f13[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x4b91de[_0xf0ab('0x4c')]);_0x577f13['filters']=_[_0xf0ab('0x4f')](_0x577f13[_0xf0ab('0x4b')],_0x577f13[_0xf0ab('0x4c')]);_0x3592f1[_0xf0ab('0x51')]=_[_0xf0ab('0x4f')](_0x577f13[_0xf0ab('0x4b')],qs[_0xf0ab('0x50')](_0x4b91de['query'][_0xf0ab('0x50')]));_0x3592f1[_0xf0ab('0x51')]=_0x3592f1['attributes'][_0xf0ab('0x52')]?_0x3592f1['attributes']:_0x577f13[_0xf0ab('0x4b')];if(!_0x4b91de['query']['hasOwnProperty']('nolimit')){_0x3592f1[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x30')]);_0x3592f1[_0xf0ab('0x2e')]=qs[_0xf0ab('0x2e')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x2e')]);}_0x3592f1[_0xf0ab('0x55')]=qs[_0xf0ab('0x56')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x56')]);_0x3592f1[_0xf0ab('0x83')]=qs[_0xf0ab('0x4e')](_[_0xf0ab('0x10c')](_0x4b91de[_0xf0ab('0x4c')],_0x577f13[_0xf0ab('0x4e')]));_0x3592f1['where'][_0xf0ab('0x10d')]=_0x43c6b8['id'];if(_0x4b91de['query'][_0xf0ab('0x8d')]){_0x3592f1['where']=_[_0xf0ab('0x39')](_0x3592f1[_0xf0ab('0x83')],{'$or':_[_0xf0ab('0x3f')](_0x3592f1['attributes'],function(_0x58f64c){var _0x5dc7d4={};_0x5dc7d4[_0x58f64c]={'$like':'%'+_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x8d')]+'%'};return _0x5dc7d4;})});}_0x3592f1['where'][_0xf0ab('0xfc')]=![];if(_0x4b91de[_0xf0ab('0x4c')]['id']){_0x3592f1[_0xf0ab('0x83')]['id']={'$gt':_0x4b91de[_0xf0ab('0x4c')]['id']};}_0x3592f1=_['merge']({},_0x3592f1,_0x4b91de['options']);return db[_0xf0ab('0xd0')][_0xf0ab('0x31')]({'where':_0x3592f1[_0xf0ab('0x83')]})[_0xf0ab('0x21')](function(_0x2ab983){_0x2f99c2['count']=_0x2ab983;_0x3592f1[_0xf0ab('0xbb')]=[];if(_0x4b91de['query'][_0xf0ab('0x111')]){_0x3592f1[_0xf0ab('0xbb')][_0xf0ab('0x45')]({'model':db['User'],'as':_0xf0ab('0xec'),'attributes':['id',_0xf0ab('0x40'),_0xf0ab('0xf7')]});}if(_0x4b91de[_0xf0ab('0x4c')]['includeAll']){_0x3592f1[_0xf0ab('0xbb')]=[{'all':!![]}];}return db[_0xf0ab('0xd0')][_0xf0ab('0x10f')](_0x3592f1);})[_0xf0ab('0x21')](function(_0x3d70c0){_0x2f99c2[_0xf0ab('0xb8')]=_0x3d70c0;return _0x2f99c2;});}})[_0xf0ab('0x21')](respondWithFilteredResult(_0x3a602f,_0x3592f1))[_0xf0ab('0x46')](handleError(_0x3a602f,null));};exports['addTags']=function(_0x4d10af,_0x5cf4bd,_0x368523){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x4d10af['params']['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x5cf4bd,null))[_0xf0ab('0x21')](function(_0x46a38a){if(_0x46a38a){return _0x46a38a[_0xf0ab('0x112')](_0x4d10af[_0xf0ab('0x3a')][_0xf0ab('0x10a')],_['omit'](_0x4d10af[_0xf0ab('0x3a')],[_0xf0ab('0x10a'),'id'])||{})[_0xf0ab('0x113')](function(){return db['Tag'][_0xf0ab('0x10f')]({'attributes':['id',_0xf0ab('0x37'),_0xf0ab('0x59')],'where':{'id':_0x4d10af[_0xf0ab('0x3a')][_0xf0ab('0x10a')]}});})[_0xf0ab('0x21')](function(_0x1df97b){socket[_0xf0ab('0x114')](_0xf0ab('0x115'),{'id':Number(_0x4d10af[_0xf0ab('0xbd')]['id']),'tags':_0x1df97b||[]});return{'id':Number(_0x4d10af[_0xf0ab('0xbd')]['id']),'tags':_0x1df97b||[]};});}})[_0xf0ab('0x21')](respondWithResult(_0x5cf4bd,null))['catch'](handleError(_0x5cf4bd,null));};exports[_0xf0ab('0x116')]=function(_0x3ca465,_0x4e379d,_0x122e66){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x3ca465[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x4e379d,null))[_0xf0ab('0x21')](function(_0x5c56e0){if(_0x5c56e0){return _0x5c56e0[_0xf0ab('0x116')](_0x3ca465[_0xf0ab('0x4c')][_0xf0ab('0x10a')]);}})['then'](respondWithStatusCode(_0x4e379d,null))[_0xf0ab('0x46')](handleError(_0x4e379d,null));};exports[_0xf0ab('0xe7')]=function(_0x2baa40,_0x4ff52d){var _0x2a2fea=moment()[_0xf0ab('0x117')]()[_0xf0ab('0xa0')]();var _0x4eccbd=path['join'](config['root'],_0xf0ab('0x118'),_0xf0ab('0x119'),_0xf0ab('0x11a'));var _0x5b6475=path[_0xf0ab('0xe5')](config[_0xf0ab('0x11b')],'server',_0xf0ab('0x119'),_0xf0ab('0x11c'));var _0x595bda=path[_0xf0ab('0xe5')](_0x4eccbd,_0x2a2fea);var _0x2bd3e3=util['format']('transcript-%d-%s.zip',_0x2baa40[_0xf0ab('0xbd')]['id'],_0x2a2fea);var _0x25242e=path[_0xf0ab('0xe5')](_0x4eccbd,_0x2bd3e3);var _0x3d8794=[];_0x3d8794[_0xf0ab('0x45')]({'model':db['User'],'as':_0xf0ab('0xec'),'attributes':['id','fullname'],'raw':!![]});_0x3d8794[_0xf0ab('0x45')]({'model':db[_0xf0ab('0xed')],'as':_0xf0ab('0x70'),'attributes':['id','firstName',_0xf0ab('0x11d')],'raw':!![]});if(_0x2baa40[_0xf0ab('0x4c')][_0xf0ab('0x11c')]){_0x3d8794[_0xf0ab('0x45')]({'model':db[_0xf0ab('0xe0')],'as':'Attachment','raw':!![]});}var _0x243763=[{'model':db[_0xf0ab('0xd0')],'as':_0xf0ab('0xee'),'attributes':['id',_0xf0ab('0x3a'),'createdAt',_0xf0ab('0xfb'),_0xf0ab('0xfc'),_0xf0ab('0x88')],'include':_0x3d8794}];_0x243763['push']({'model':db[_0xf0ab('0xbf')],'as':_0xf0ab('0x11e'),'attributes':['id',_0xf0ab('0x37')]});_0x243763['push']({'model':db[_0xf0ab('0xec')],'as':_0xf0ab('0x11f'),'attributes':['id',_0xf0ab('0x40')]});return db[_0xf0ab('0xa1')]['find']({'where':{'id':_0x2baa40[_0xf0ab('0xbd')]['id']},'include':_0x243763})[_0xf0ab('0x21')](handleEntityNotFound(_0x4ff52d,null))[_0xf0ab('0x21')](function(_0x2c2e20){if(_0x2c2e20){var _0x57bd77=_0x2c2e20[_0xf0ab('0x120')]({'plain':!![]});fs[_0xf0ab('0x121')](_0x595bda);var _0x169b02={'channel':_0xf0ab('0x122'),'account':_0x57bd77[_0xf0ab('0x11e')]['name'],'agent':_0x57bd77[_0xf0ab('0x11f')]?_0x57bd77['Owner'][_0xf0ab('0x40')]:_0xf0ab('0x123'),'createdAt':moment(_0x57bd77[_0xf0ab('0xf9')])['format'](_0xf0ab('0x10e'))['toString'](),'closedAt':_0x57bd77['closed']?moment(_0x57bd77['closedAt'])[_0xf0ab('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x57bd77[_0xf0ab('0xda')],'chatInfo':{'browser':_0x57bd77[_0xf0ab('0x124')],'os':_0x57bd77[_0xf0ab('0x125')],'referer':_0x57bd77[_0xf0ab('0x126')],'customerIp':_0x57bd77[_0xf0ab('0x127')],'customerPort':_0x57bd77['customerPort']?_0x57bd77[_0xf0ab('0x128')]:_0xf0ab('0x123')},'messages':_(_0x57bd77['Messages'])[_0xf0ab('0x129')]()[_0xf0ab('0x8d')]({'secret':![]})[_0xf0ab('0x3f')](function(_0x2aa512){if(_0x2aa512['Attachment']){var _0x26009e=path[_0xf0ab('0xe5')](_0x5b6475,_0x2aa512['Attachment'][_0xf0ab('0xdd')]);if(fs[_0xf0ab('0x12a')](_0x26009e)){fs['createReadStream'](_0x26009e)[_0xf0ab('0x12b')](fs[_0xf0ab('0x12c')](path['join'](_0x595bda,_0x2aa512[_0xf0ab('0xe0')][_0xf0ab('0xdd')])));}}return{'date':moment(_0x2aa512[_0xf0ab('0xf9')])[_0xf0ab('0xe9')](_0xf0ab('0x10e'))['toString'](),'sender':_0x2aa512[_0xf0ab('0xfb')]==='out'?_0x2aa512[_0xf0ab('0xec')]?_0x2aa512['User'][_0xf0ab('0x40')]:_0xf0ab('0xf1'):_0x2aa512[_0xf0ab('0x70')][_0xf0ab('0x12d')]+(_0x2aa512[_0xf0ab('0x70')][_0xf0ab('0x11d')]?'\x20'+_0x2aa512[_0xf0ab('0x70')]['lastName']:''),'body':_0x2aa512[_0xf0ab('0xe0')]?_0x2aa512[_0xf0ab('0xe0')][_0xf0ab('0xdd')]:_0x2aa512[_0xf0ab('0x3a')],'direction':_0x2aa512[_0xf0ab('0xfb')]==='out'?'A':'C','secret':_0x2aa512[_0xf0ab('0xfc')],'read':_0x2aa512[_0xf0ab('0x88')],'attachment':_0x2aa512[_0xf0ab('0xe0')]};})[_0xf0ab('0x72')]()};return ejs['renderFile'](path[_0xf0ab('0xe5')](config[_0xf0ab('0x11b')],_0xf0ab('0x118'),_0xf0ab('0x12e'),'downloadInteraction.ejs'),{'interaction':_0x169b02})['then'](function(_0x3ad886){var _0x3df4a2=path['join'](_0x595bda,'transcript-'+_0x57bd77['id']+'-'+_0x2a2fea+_0xf0ab('0x12f'));var _0x378d44={'path':_0x3df4a2,'channel':_0xf0ab('0x122'),'interactionId':_0x57bd77['id']};return pdf[_0xf0ab('0x130')](_0x3ad886,_0x378d44);})[_0xf0ab('0x21')](function(){return new BPromise(function(_0x1e4acb,_0x25a1eb){zipdir(_0x595bda,{'saveTo':_0x25242e},function(_0x406090,_0x414d09){if(_0x406090)return _0x25a1eb(_0x406090);return _0x1e4acb(_0x414d09);});})[_0xf0ab('0x21')](function(){return new BPromise(function(_0x235528,_0x581c80){rimraf(_0x595bda,function(_0x14332a){if(_0x14332a)_0x581c80(_0x14332a);return _0x235528();});});})[_0xf0ab('0x21')](function(){return _0x4ff52d[_0xf0ab('0xe7')](_0x25242e,_0x2bd3e3,function(_0x4f9211){if(_0x4f9211){console[_0xf0ab('0x131')](_0xf0ab('0x132'),_0x4f9211);}else{fs[_0xf0ab('0x133')](_0x25242e);}});});});}else{return _0x4ff52d['sendStatus'](0xc8);}})[_0xf0ab('0x46')](handleError(_0x4ff52d,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 88cb8dd..92156c6 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 _0x37fc=['setMaxListeners','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage'];(function(_0x5dc606,_0x17e9bf){var _0x5c4706=function(_0x10c4a4){while(--_0x10c4a4){_0x5dc606['push'](_0x5dc606['shift']());}};_0x5c4706(++_0x17e9bf);}(_0x37fc,0x7a));var _0xc37f=function(_0x7f4f24,_0x483077){_0x7f4f24=_0x7f4f24-0x0;var _0x295488=_0x37fc[_0x7f4f24];return _0x295488;};'use strict';var EventEmitter=require(_0xc37f('0x0'));var ChatInteraction=require(_0xc37f('0x1'))['db'][_0xc37f('0x2')];var ChatMessage=require(_0xc37f('0x1'))['db'][_0xc37f('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc37f('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc37f('0x5')};function emitEvent(_0x569f0f){return function(_0x498bd4,_0x5a4931,_0x5b7ad1){_0x498bd4[_0xc37f('0x6')]({'attributes':['id'],'raw':!![]})[_0xc37f('0x7')](function(_0x1959f2){_0x498bd4[_0xc37f('0x8')]('Users',_0x1959f2[_0xc37f('0x9')](function(_0xd19813){return{'id':_0xd19813['id']};}));return ChatMessage[_0xc37f('0xa')]({'where':{'ChatInteractionId':_0x498bd4['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc37f('0x7')](function(_0x59f403){_0x498bd4[_0xc37f('0x8')](_0xc37f('0xb'),_0x59f403[_0xc37f('0xc')]);ChatInteractionEvents[_0xc37f('0xd')](_0x569f0f+':'+_0x498bd4['id'],_0x498bd4);ChatInteractionEvents['emit'](_0x569f0f,_0x498bd4);_0x5b7ad1(null);})[_0xc37f('0xe')](_0x5b7ad1(null));};}for(var e in events){if(events[_0xc37f('0xf')](e)){var event=events[e];ChatInteraction[_0xc37f('0x10')](e,emitEvent(event));}}module[_0xc37f('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x3032=['Users','findAll','unreadMessages','length','emit','catch','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','getUsers','then','setDataValue'];(function(_0x4fa0e6,_0x2c483c){var _0x15f33b=function(_0x2163d0){while(--_0x2163d0){_0x4fa0e6['push'](_0x4fa0e6['shift']());}};_0x15f33b(++_0x2c483c);}(_0x3032,0x15f));var _0x2303=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3032[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x2303('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x2303('0x1'))['db'][_0x2303('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2303('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2303('0x4'),'afterDestroy':_0x2303('0x5')};function emitEvent(_0x21339d){return function(_0x42e00b,_0x1741e5,_0x178f8e){_0x42e00b[_0x2303('0x6')]({'attributes':['id'],'raw':!![]})[_0x2303('0x7')](function(_0x5f4467){_0x42e00b[_0x2303('0x8')](_0x2303('0x9'),_0x5f4467['map'](function(_0x56e98e){return{'id':_0x56e98e['id']};}));return ChatMessage[_0x2303('0xa')]({'where':{'ChatInteractionId':_0x42e00b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2303('0x7')](function(_0x154df6){_0x42e00b[_0x2303('0x8')](_0x2303('0xb'),_0x154df6[_0x2303('0xc')]);ChatInteractionEvents[_0x2303('0xd')](_0x21339d+':'+_0x42e00b['id'],_0x42e00b);ChatInteractionEvents['emit'](_0x21339d,_0x42e00b);_0x178f8e(null);})[_0x2303('0xe')](_0x178f8e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 476bf8b..86d6af6 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 _0x2085=['closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed'];(function(_0x568257,_0x12ae64){var _0x5ca887=function(_0x398b93){while(--_0x398b93){_0x568257['push'](_0x568257['shift']());}};_0x5ca887(++_0x12ae64);}(_0x2085,0x135));var _0x5208=function(_0x1639be,_0x4ac980){_0x1639be=_0x1639be-0x0;var _0x4af3e1=_0x2085[_0x1639be];return _0x4af3e1;};'use strict';var _=require('lodash');var util=require(_0x5208('0x0'));var logger=require(_0x5208('0x1'))('api');var moment=require(_0x5208('0x2'));var BPromise=require(_0x5208('0x3'));var rp=require(_0x5208('0x4'));var fs=require('fs');var path=require(_0x5208('0x5'));var rimraf=require(_0x5208('0x6'));var config=require(_0x5208('0x7'));var attributes=require(_0x5208('0x8'));module[_0x5208('0x9')]=function(_0x3d1541,_0x4bf9c0){return _0x3d1541[_0x5208('0xa')](_0x5208('0xb'),attributes,{'tableName':_0x5208('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f60aa,_0x58fd6e,_0x2dff06){if(_0x2f60aa[_0x5208('0xd')](_0x5208('0xe'))){_0x2f60aa['closedAt']=moment()[_0x5208('0xf')](_0x5208('0x10'));}_0x2dff06(null,_0x2f60aa);}},'charset':_0x5208('0x11'),'collate':_0x5208('0x12')});};
\ No newline at end of file
+var _0x1114=['path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3d5351,_0x27bc80){var _0x1db4db=function(_0x3f572b){while(--_0x3f572b){_0x3d5351['push'](_0x3d5351['shift']());}};_0x1db4db(++_0x27bc80);}(_0x1114,0x104));var _0x4111=function(_0x4b075e,_0x57874c){_0x4b075e=_0x4b075e-0x0;var _0x31385c=_0x1114[_0x4b075e];return _0x31385c;};'use strict';var _=require(_0x4111('0x0'));var util=require('util');var logger=require(_0x4111('0x1'))(_0x4111('0x2'));var moment=require(_0x4111('0x3'));var BPromise=require(_0x4111('0x4'));var rp=require(_0x4111('0x5'));var fs=require('fs');var path=require(_0x4111('0x6'));var rimraf=require(_0x4111('0x7'));var config=require(_0x4111('0x8'));var attributes=require(_0x4111('0x9'));module[_0x4111('0xa')]=function(_0x11c13c,_0x1961c2){return _0x11c13c['define'](_0x4111('0xb'),attributes,{'tableName':_0x4111('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a5744,_0x256b7a,_0x3f4712){if(_0x1a5744['changed'](_0x4111('0xd'))){_0x1a5744[_0x4111('0xe')]=moment()[_0x4111('0xf')](_0x4111('0x10'));}_0x3f4712(null,_0x1a5744);}},'charset':_0x4111('0x11'),'collate':_0x4111('0x12')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 0284c7b..1f35b83 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 _0xc365=['redis','defaults','localhost','socket.io-emitter','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','debug','catch','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x225838,_0x29b914){var _0x1da96b=function(_0x3e54b3){while(--_0x3e54b3){_0x225838['push'](_0x225838['shift']());}};_0x1da96b(++_0x29b914);}(_0xc365,0xa0));var _0x5c36=function(_0x20f043,_0xfe363e){_0x20f043=_0x20f043-0x0;var _0x110e4b=_0xc365[_0x20f043];return _0x110e4b;};'use strict';var _=require(_0x5c36('0x0'));var util=require('util');var moment=require(_0x5c36('0x1'));var BPromise=require(_0x5c36('0x2'));var rs=require(_0x5c36('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c36('0x4'))['db'];var utils=require(_0x5c36('0x5'));var logger=require(_0x5c36('0x6'))(_0x5c36('0x7'));var config=require(_0x5c36('0x8'));var jayson=require(_0x5c36('0x9'));var client=jayson[_0x5c36('0xa')][_0x5c36('0xb')]({'port':0x232a});config[_0x5c36('0xc')]=_[_0x5c36('0xd')](config[_0x5c36('0xc')],{'host':_0x5c36('0xe'),'port':0x18eb});var socket=require(_0x5c36('0xf'))(new Redis(config[_0x5c36('0xc')]));require('./chatInteraction.socket')[_0x5c36('0x10')](socket);function respondWithRpcPromise(_0x2ed42d,_0x2cd804,_0x5330b3){return new BPromise(function(_0x25c3e9,_0x2f5ca1){return client['request'](_0x2ed42d,_0x5330b3)[_0x5c36('0x11')](function(_0x8fd662){logger[_0x5c36('0x12')](_0x5c36('0x13'),_0x2cd804,_0x5c36('0x14'));logger['debug'](_0x5c36('0x15'),_0x2cd804,_0x5c36('0x14'),JSON[_0x5c36('0x16')](_0x8fd662));if(_0x8fd662[_0x5c36('0x17')]){if(_0x8fd662[_0x5c36('0x17')][_0x5c36('0x18')]===0x1f4){logger['error'](_0x5c36('0x13'),_0x2cd804,_0x8fd662[_0x5c36('0x17')][_0x5c36('0x19')]);return _0x2f5ca1(_0x8fd662[_0x5c36('0x17')][_0x5c36('0x19')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2cd804,_0x8fd662[_0x5c36('0x17')][_0x5c36('0x19')]);return _0x25c3e9(_0x8fd662[_0x5c36('0x17')]['message']);}else{logger[_0x5c36('0x12')](_0x5c36('0x13'),_0x2cd804,'request\x20sent');_0x25c3e9(_0x8fd662[_0x5c36('0x1a')][_0x5c36('0x19')]);}})['catch'](function(_0x6d6cd3){logger[_0x5c36('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x2cd804,_0x6d6cd3);_0x2f5ca1(_0x6d6cd3);});});}exports[_0x5c36('0x1b')]=function(_0x3f2ca0){var _0x4033c0=this;return new Promise(function(_0x418c5f,_0x15766f){return db[_0x5c36('0x1c')]['update'](_0x3f2ca0[_0x5c36('0x1d')],{'raw':_0x3f2ca0[_0x5c36('0x1e')]?_0x3f2ca0[_0x5c36('0x1e')][_0x5c36('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f2ca0[_0x5c36('0x1e')]?_0x3f2ca0[_0x5c36('0x1e')][_0x5c36('0x20')]||null:null,'attributes':_0x3f2ca0[_0x5c36('0x1e')]?_0x3f2ca0[_0x5c36('0x1e')][_0x5c36('0x21')]||null:null,'limit':_0x3f2ca0[_0x5c36('0x1e')]?_0x3f2ca0[_0x5c36('0x1e')][_0x5c36('0x22')]||null:null})[_0x5c36('0x11')](function(_0x40c105){logger[_0x5c36('0x12')](_0x5c36('0x1b'),_0x3f2ca0);logger[_0x5c36('0x23')](_0x5c36('0x1b'),_0x3f2ca0,JSON[_0x5c36('0x16')](_0x40c105));_0x418c5f(_0x40c105);})[_0x5c36('0x24')](function(_0x2bd581){logger[_0x5c36('0x17')]('UpdateChatInteraction',_0x2bd581[_0x5c36('0x19')],_0x3f2ca0);_0x15766f(_0x4033c0[_0x5c36('0x17')](0x1f4,_0x2bd581[_0x5c36('0x19')]));});});};exports[_0x5c36('0x25')]=function(_0x236c48){return new Promise(function(_0x3561db,_0x3cfb39){return db[_0x5c36('0x1c')][_0x5c36('0x26')]({'where':_0x236c48[_0x5c36('0x1e')]?_0x236c48['options']['where']||null:null})[_0x5c36('0x11')](function(_0x85e625){if(_0x85e625){return _0x85e625[_0x5c36('0x27')](_0x236c48['body'][_0x5c36('0x28')],_[_0x5c36('0x29')](_0x236c48[_0x5c36('0x1d')],['ids','id'])||{});}})['spread'](function(_0x46d46e){logger[_0x5c36('0x12')](_0x5c36('0x2a'),_0x236c48);logger[_0x5c36('0x23')]('AddTags',_0x236c48,JSON[_0x5c36('0x16')](_0x46d46e));_0x3561db(_0x46d46e);})[_0x5c36('0x24')](function(_0x39ffd4){logger[_0x5c36('0x17')](_0x5c36('0x2a'),_0x39ffd4['message'],_0x236c48);_0x3cfb39(_this[_0x5c36('0x17')](0x1f4,_0x39ffd4[_0x5c36('0x19')]));});});};
\ No newline at end of file
+var _0x2030=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','defaults','redis','socket.io-emitter','register','request','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','ChatInteraction','update','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','ids','omit','body','AddTags','lodash','util'];(function(_0x368056,_0x3817b7){var _0x586fb6=function(_0x48f3ce){while(--_0x48f3ce){_0x368056['push'](_0x368056['shift']());}};_0x586fb6(++_0x3817b7);}(_0x2030,0x1c1));var _0x0203=function(_0x429d19,_0x17710b){_0x429d19=_0x429d19-0x0;var _0x2c90db=_0x2030[_0x429d19];return _0x2c90db;};'use strict';var _=require(_0x0203('0x0'));var util=require(_0x0203('0x1'));var moment=require(_0x0203('0x2'));var BPromise=require(_0x0203('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0203('0x4'));var db=require(_0x0203('0x5'))['db'];var utils=require(_0x0203('0x6'));var logger=require('../../config/logger')(_0x0203('0x7'));var config=require(_0x0203('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0203('0x9')]['http']({'port':0x232a});config['redis']=_[_0x0203('0xa')](config[_0x0203('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0203('0xc'))(new Redis(config[_0x0203('0xb')]));require('./chatInteraction.socket')[_0x0203('0xd')](socket);function respondWithRpcPromise(_0x35d892,_0x463da4,_0x59d175){return new BPromise(function(_0x4c68c0,_0x21b7e9){return client[_0x0203('0xe')](_0x35d892,_0x59d175)[_0x0203('0xf')](function(_0x5923ab){logger['info'](_0x0203('0x10'),_0x463da4,'request\x20sent');logger[_0x0203('0x11')](_0x0203('0x12'),_0x463da4,'request\x20sent',JSON[_0x0203('0x13')](_0x5923ab));if(_0x5923ab[_0x0203('0x14')]){if(_0x5923ab['error']['code']===0x1f4){logger[_0x0203('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x463da4,_0x5923ab[_0x0203('0x14')][_0x0203('0x15')]);return _0x21b7e9(_0x5923ab[_0x0203('0x14')][_0x0203('0x15')]);}logger['error'](_0x0203('0x10'),_0x463da4,_0x5923ab['error'][_0x0203('0x15')]);return _0x4c68c0(_0x5923ab['error'][_0x0203('0x15')]);}else{logger[_0x0203('0x16')](_0x0203('0x10'),_0x463da4,_0x0203('0x17'));_0x4c68c0(_0x5923ab[_0x0203('0x18')][_0x0203('0x15')]);}})[_0x0203('0x19')](function(_0x9af66){logger[_0x0203('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x463da4,_0x9af66);_0x21b7e9(_0x9af66);});});}exports['UpdateChatInteraction']=function(_0x4edc56){var _0x24f928=this;return new Promise(function(_0x57bb80,_0x1bd228){return db[_0x0203('0x1a')][_0x0203('0x1b')](_0x4edc56['body'],{'raw':_0x4edc56[_0x0203('0x1c')]?_0x4edc56[_0x0203('0x1c')][_0x0203('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4edc56[_0x0203('0x1c')]?_0x4edc56[_0x0203('0x1c')][_0x0203('0x1e')]||null:null,'attributes':_0x4edc56[_0x0203('0x1c')]?_0x4edc56[_0x0203('0x1c')][_0x0203('0x1f')]||null:null,'limit':_0x4edc56['options']?_0x4edc56[_0x0203('0x1c')][_0x0203('0x20')]||null:null})[_0x0203('0xf')](function(_0x612b34){logger[_0x0203('0x16')]('UpdateChatInteraction',_0x4edc56);logger['debug'](_0x0203('0x21'),_0x4edc56,JSON[_0x0203('0x13')](_0x612b34));_0x57bb80(_0x612b34);})[_0x0203('0x19')](function(_0x4ca18a){logger['error'](_0x0203('0x21'),_0x4ca18a[_0x0203('0x15')],_0x4edc56);_0x1bd228(_0x24f928[_0x0203('0x14')](0x1f4,_0x4ca18a[_0x0203('0x15')]));});});};exports[_0x0203('0x22')]=function(_0x3216bc){return new Promise(function(_0x3ebcbf,_0x1f2989){return db[_0x0203('0x1a')][_0x0203('0x23')]({'where':_0x3216bc[_0x0203('0x1c')]?_0x3216bc[_0x0203('0x1c')][_0x0203('0x1e')]||null:null})[_0x0203('0xf')](function(_0x90234){if(_0x90234){return _0x90234[_0x0203('0x24')](_0x3216bc['body'][_0x0203('0x25')],_[_0x0203('0x26')](_0x3216bc[_0x0203('0x27')],[_0x0203('0x25'),'id'])||{});}})['spread'](function(_0x5862a4){logger[_0x0203('0x16')](_0x0203('0x28'),_0x3216bc);logger['debug'](_0x0203('0x28'),_0x3216bc,JSON[_0x0203('0x13')](_0x5862a4));_0x3ebcbf(_0x5862a4);})[_0x0203('0x19')](function(_0x3d215d){logger['error'](_0x0203('0x28'),_0x3d215d[_0x0203('0x15')],_0x3216bc);_0x1f2989(_this[_0x0203('0x14')](0x1f4,_0x3d215d[_0x0203('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 26a2c47..cf3581c 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 _0x61df=['emit','removeListener','register','chatInteraction:','update'];(function(_0x28489b,_0x3c80ff){var _0x3948c6=function(_0xa82239){while(--_0xa82239){_0x28489b['push'](_0x28489b['shift']());}};_0x3948c6(++_0x3c80ff);}(_0x61df,0xbd));var _0xf61d=function(_0x3e5fc9,_0x2105b1){_0x3e5fc9=_0x3e5fc9-0x0;var _0x15799d=_0x61df[_0x3e5fc9];return _0x15799d;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save','remove',_0xf61d('0x0')];function createListener(_0x449fc,_0x5d85f0){return function(_0x40127d){_0x5d85f0[_0xf61d('0x1')](_0x449fc,_0x40127d);};}function removeListener(_0x485a55,_0x3170e7){return function(){ChatInteractionEvents[_0xf61d('0x2')](_0x485a55,_0x3170e7);};}exports[_0xf61d('0x3')]=function(_0x458eb9){for(var _0x2d0791=0x0,_0x3ac0ec=events['length'];_0x2d0791<_0x3ac0ec;_0x2d0791++){var _0x42b382=events[_0x2d0791];var _0x49523e=createListener(_0xf61d('0x4')+_0x42b382,_0x458eb9);ChatInteractionEvents['on'](_0x42b382,_0x49523e);}};
\ No newline at end of file
+var _0x372b=['length','chatInteraction:','./chatInteraction.events','save','update','emit','removeListener','register'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x372b,0x18a));var _0xb372=function(_0x4d7708,_0x33a2ad){_0x4d7708=_0x4d7708-0x0;var _0x5466a7=_0x372b[_0x4d7708];return _0x5466a7;};'use strict';var ChatInteractionEvents=require(_0xb372('0x0'));var events=[_0xb372('0x1'),'remove',_0xb372('0x2')];function createListener(_0x41734c,_0x4706d0){return function(_0xbd4c2b){_0x4706d0[_0xb372('0x3')](_0x41734c,_0xbd4c2b);};}function removeListener(_0x458bf9,_0x4fe3cb){return function(){ChatInteractionEvents[_0xb372('0x4')](_0x458bf9,_0x4fe3cb);};}exports[_0xb372('0x5')]=function(_0xa1eefa){for(var _0x5c8510=0x0,_0x39c4ac=events[_0xb372('0x6')];_0x5c8510<_0x39c4ac;_0x5c8510++){var _0x1a6925=events[_0x5c8510];var _0x6a7a15=createListener(_0xb372('0x7')+_0x1a6925,_0xa1eefa);ChatInteractionEvents['on'](_0x1a6925,_0x6a7a15);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index ab7d23b..fc45254 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 _0xb718=['multer','util','path','connect-timeout','express','Router','./chatInteraction.controller','get','index','isAuthenticated','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','chatinteraction:destroy','delete','removeTags','exports'];(function(_0x247b2c,_0x52354c){var _0x14986e=function(_0xe60b3d){while(--_0xe60b3d){_0x247b2c['push'](_0x247b2c['shift']());}};_0x14986e(++_0x52354c);}(_0xb718,0xff));var _0x8b71=function(_0x3cc6bb,_0x363a56){_0x3cc6bb=_0x3cc6bb-0x0;var _0x47337b=_0xb718[_0x3cc6bb];return _0x47337b;};'use strict';var multer=require(_0x8b71('0x0'));var util=require(_0x8b71('0x1'));var path=require(_0x8b71('0x2'));var timeout=require(_0x8b71('0x3'));var express=require(_0x8b71('0x4'));var router=express[_0x8b71('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8b71('0x6'));router[_0x8b71('0x7')]('/',auth['isAuthenticated'](),controller[_0x8b71('0x8')]);router[_0x8b71('0x7')]('/describe',auth[_0x8b71('0x9')](),controller['describe']);router[_0x8b71('0x7')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0x8b71('0xa')]);router[_0x8b71('0x7')](_0x8b71('0xb'),auth[_0x8b71('0xc')](),controller[_0x8b71('0xd')]);router[_0x8b71('0x7')](_0x8b71('0xe'),auth['isAuthenticated'](),controller[_0x8b71('0xf')]);router[_0x8b71('0x7')](_0x8b71('0x10'),auth[_0x8b71('0xc')](),controller[_0x8b71('0x11')]);router['get'](_0x8b71('0x12'),auth[_0x8b71('0x9')](),controller[_0x8b71('0x13')]);router[_0x8b71('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8b71('0x14')](_0x8b71('0x15'),auth[_0x8b71('0x9')](),controller[_0x8b71('0x16')]);var upload=multer({'storage':multer[_0x8b71('0x17')]({'destination':function(_0x4746b7,_0x424189,_0x2356f9){_0x2356f9(null,path[_0x8b71('0x18')](config[_0x8b71('0x19')],_0x8b71('0x1a')));},'filename':function(_0x2854be,_0x20b342,_0x219704){_0x219704(null,util[_0x8b71('0x1b')]('%s-%s',Date[_0x8b71('0x1c')](),_0x20b342[_0x8b71('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x8b71('0x1e'),upload[_0x8b71('0x1f')](_0x8b71('0x20')),controller[_0x8b71('0x21')]);router[_0x8b71('0x14')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x8b71('0x22')]);router['post'](_0x8b71('0x23'),auth['isAuthenticated'](),interaction[_0x8b71('0x24')](_0x8b71('0x25'),_0x8b71('0x26')),controller['addTags']);router[_0x8b71('0x27')]('/:id',auth[_0x8b71('0x9')](),interaction['tracked'](_0x8b71('0x25'),_0x8b71('0x28')),controller[_0x8b71('0x29')]);router[_0x8b71('0x27')](_0x8b71('0x2a'),controller[_0x8b71('0x2b')]);router['put'](_0x8b71('0x2c'),auth[_0x8b71('0xc')](),controller['abandon']);router['put'](_0x8b71('0x2d'),controller[_0x8b71('0x2e')]);router['delete']('/:id',auth[_0x8b71('0x9')](),interaction['tracked'](_0x8b71('0x25'),_0x8b71('0x2f')),controller['destroy']);router[_0x8b71('0x30')](_0x8b71('0x23'),auth[_0x8b71('0x9')](),controller[_0x8b71('0x31')]);module[_0x8b71('0x32')]=router;
\ No newline at end of file
+var _0xd9f8=['destroy','/:id/tags','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','download','post','create','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','/:id','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy'];(function(_0x209e4b,_0x1400ea){var _0x25d7d9=function(_0x84faa5){while(--_0x84faa5){_0x209e4b['push'](_0x209e4b['shift']());}};_0x25d7d9(++_0x1400ea);}(_0xd9f8,0x101));var _0x8d9f=function(_0x55c288,_0x52d730){_0x55c288=_0x55c288-0x0;var _0x1ecaea=_0xd9f8[_0x55c288];return _0x1ecaea;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8d9f('0x0'));var timeout=require(_0x8d9f('0x1'));var express=require('express');var router=express[_0x8d9f('0x2')]();var fs_extra=require(_0x8d9f('0x3'));var auth=require(_0x8d9f('0x4'));var interaction=require(_0x8d9f('0x5'));var config=require('../../config/environment');var controller=require(_0x8d9f('0x6'));router[_0x8d9f('0x7')]('/',auth[_0x8d9f('0x8')](),controller[_0x8d9f('0x9')]);router['get'](_0x8d9f('0xa'),auth[_0x8d9f('0x8')](),controller['describe']);router[_0x8d9f('0x7')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0x8d9f('0xb')]);router[_0x8d9f('0x7')](_0x8d9f('0xc'),auth[_0x8d9f('0xd')](),controller[_0x8d9f('0xe')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x8d9f('0xf')]);router[_0x8d9f('0x7')](_0x8d9f('0x10'),auth[_0x8d9f('0xd')](),controller[_0x8d9f('0x11')]);router[_0x8d9f('0x7')]('/:id/download',auth[_0x8d9f('0x8')](),controller[_0x8d9f('0x12')]);router[_0x8d9f('0x13')]('/',auth['isAuthenticated'](),controller[_0x8d9f('0x14')]);router[_0x8d9f('0x13')]('/:id/vidaoo',auth[_0x8d9f('0x8')](),controller[_0x8d9f('0x15')]);var upload=multer({'storage':multer[_0x8d9f('0x16')]({'destination':function(_0x15178c,_0x3efcf7,_0x1f6b22){_0x1f6b22(null,path['join'](config[_0x8d9f('0x17')],_0x8d9f('0x18')));},'filename':function(_0x3777e7,_0x5038c3,_0x51d802){_0x51d802(null,util[_0x8d9f('0x19')](_0x8d9f('0x1a'),Date[_0x8d9f('0x1b')](),_0x5038c3[_0x8d9f('0x1c')][_0x8d9f('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8d9f('0x13')]('/:id/attachment_upload',upload[_0x8d9f('0x1e')]('file'),controller[_0x8d9f('0x1f')]);router[_0x8d9f('0x13')](_0x8d9f('0x20'),auth[_0x8d9f('0xd')](),controller[_0x8d9f('0x21')]);router[_0x8d9f('0x13')]('/:id/tags',auth[_0x8d9f('0x8')](),interaction[_0x8d9f('0x22')](_0x8d9f('0x23'),_0x8d9f('0x24')),controller['addTags']);router['put'](_0x8d9f('0x25'),auth[_0x8d9f('0x8')](),interaction[_0x8d9f('0x22')](_0x8d9f('0x23'),_0x8d9f('0x26')),controller[_0x8d9f('0x27')]);router[_0x8d9f('0x28')](_0x8d9f('0x29'),controller[_0x8d9f('0x2a')]);router[_0x8d9f('0x28')](_0x8d9f('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0x8d9f('0x2c')]);router[_0x8d9f('0x28')](_0x8d9f('0x2d'),controller[_0x8d9f('0x2e')]);router[_0x8d9f('0x2f')](_0x8d9f('0x25'),auth[_0x8d9f('0x8')](),interaction[_0x8d9f('0x22')](_0x8d9f('0x23'),_0x8d9f('0x30')),controller[_0x8d9f('0x31')]);router[_0x8d9f('0x2f')](_0x8d9f('0x32'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 2e2dfc5..b52b88e 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 _0x417d=['INTEGER','sequelize','exports','medium','BOOLEAN'];(function(_0xa4ae32,_0x289050){var _0x506fb8=function(_0x129488){while(--_0x129488){_0xa4ae32['push'](_0xa4ae32['shift']());}};_0x506fb8(++_0x289050);}(_0x417d,0x141));var _0xd417=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x417d[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0xd417('0x0'));module[_0xd417('0x1')]={'body':{'type':Sequelize['TEXT'](_0xd417('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd417('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd417('0x4')]}};
\ No newline at end of file
+var _0xf609=['exports','medium','BOOLEAN','INTEGER'];(function(_0x1d93b1,_0x2fedaf){var _0x248a7a=function(_0x26a6be){while(--_0x26a6be){_0x1d93b1['push'](_0x1d93b1['shift']());}};_0x248a7a(++_0x2fedaf);}(_0xf609,0x150));var _0x9f60=function(_0x46ccd2,_0xf04613){_0x46ccd2=_0x46ccd2-0x0;var _0x1d5c6f=_0xf609[_0x46ccd2];return _0x1d5c6f;};'use strict';var Sequelize=require('sequelize');module[_0x9f60('0x0')]={'body':{'type':Sequelize['TEXT'](_0x9f60('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x9f60('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9f60('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 4f299bc..ba8ed05 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 _0x1aaf=['resourceId','push','ToId','read','all','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','destroy','then','name','send','index','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','show','params','rawAttributes','merge','find','catch','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','User','agent','user','fullname','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty'];(function(_0x52085a,_0x3717ca){var _0x5afc1a=function(_0x2aa175){while(--_0x2aa175){_0x52085a['push'](_0x52085a['shift']());}};_0x5afc1a(++_0x3717ca);}(_0x1aaf,0x74));var _0xf1aa=function(_0x3b1474,_0x48a3b8){_0x3b1474=_0x3b1474-0x0;var _0x5060b9=_0x1aaf[_0x3b1474];return _0x5060b9;};'use strict';var emlformat=require(_0xf1aa('0x0'));var rimraf=require(_0xf1aa('0x1'));var zipdir=require(_0xf1aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1aa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf1aa('0x4'));var util=require(_0xf1aa('0x5'));var path=require(_0xf1aa('0x6'));var sox=require(_0xf1aa('0x7'));var csv=require(_0xf1aa('0x8'));var ejs=require(_0xf1aa('0x9'));var fs=require('fs');var fs_extra=require(_0xf1aa('0xa'));var _=require(_0xf1aa('0xb'));var squel=require(_0xf1aa('0xc'));var crypto=require(_0xf1aa('0xd'));var jsforce=require(_0xf1aa('0xe'));var deskjs=require(_0xf1aa('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf1aa('0x10'));var Papa=require('papaparse');var Redis=require(_0xf1aa('0x11'));var authService=require(_0xf1aa('0x12'));var qs=require(_0xf1aa('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf1aa('0x14'));var logger=require(_0xf1aa('0x15'))(_0xf1aa('0x16'));var utils=require(_0xf1aa('0x17'));var config=require(_0xf1aa('0x18'));var licenseUtil=require(_0xf1aa('0x19'));var db=require(_0xf1aa('0x1a'))['db'];config[_0xf1aa('0x1b')]=_[_0xf1aa('0x1c')](config[_0xf1aa('0x1b')],{'host':_0xf1aa('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf1aa('0x1e'))[_0xf1aa('0x1f')](socket);function respondWithStatusCode(_0x250626,_0x58b77b){_0x58b77b=_0x58b77b||0xcc;return function(_0x28f44d){if(_0x28f44d){return _0x250626[_0xf1aa('0x20')](_0x58b77b);}return _0x250626[_0xf1aa('0x21')](_0x58b77b)[_0xf1aa('0x22')]();};}function respondWithResult(_0x2d80ef,_0x3a07db){_0x3a07db=_0x3a07db||0xc8;return function(_0x7a475f){if(_0x7a475f){return _0x2d80ef[_0xf1aa('0x21')](_0x3a07db)['json'](_0x7a475f);}};}function respondWithFilteredResult(_0x560b0d,_0x28aa11){return function(_0x250a29){if(_0x250a29){var _0x2d3571=typeof _0x28aa11[_0xf1aa('0x23')]===_0xf1aa('0x24')&&typeof _0x28aa11[_0xf1aa('0x25')]===_0xf1aa('0x24');var _0x271e61=_0x250a29[_0xf1aa('0x26')];var _0x258cab=_0x2d3571?0x0:_0x28aa11[_0xf1aa('0x23')];var _0x1334b6=_0x2d3571?_0x250a29[_0xf1aa('0x26')]:_0x28aa11[_0xf1aa('0x23')]+_0x28aa11[_0xf1aa('0x25')];var _0x1f1700;if(_0x1334b6>=_0x271e61){_0x1334b6=_0x271e61;_0x1f1700=0xc8;}else{_0x1f1700=0xce;}_0x560b0d[_0xf1aa('0x21')](_0x1f1700);return _0x560b0d[_0xf1aa('0x27')]('Content-Range',_0x258cab+'-'+_0x1334b6+'/'+_0x271e61)[_0xf1aa('0x28')](_0x250a29);}return null;};}function patchUpdates(_0x5c0ec3){return function(_0x2e6295){try{jsonpatch['apply'](_0x2e6295,_0x5c0ec3,!![]);}catch(_0x12ca48){return BPromise[_0xf1aa('0x29')](_0x12ca48);}return _0x2e6295[_0xf1aa('0x2a')]();};}function saveUpdates(_0x464c33,_0x4226b6){return function(_0x46a409){if(_0x46a409){return _0x46a409[_0xf1aa('0x2b')](_0x464c33)['then'](function(_0x4c8202){return _0x4c8202;});}return null;};}function removeEntity(_0xf18db2,_0xfbdf1e){return function(_0x52dce9){if(_0x52dce9){return _0x52dce9[_0xf1aa('0x2c')]()[_0xf1aa('0x2d')](function(){_0xf18db2[_0xf1aa('0x21')](0xcc)[_0xf1aa('0x22')]();});}};}function handleEntityNotFound(_0x501f93,_0x910148){return function(_0x55c095){if(!_0x55c095){_0x501f93['sendStatus'](0x194);}return _0x55c095;};}function handleError(_0x3efecb,_0x45cdc5){_0x45cdc5=_0x45cdc5||0x1f4;return function(_0x3907bc){logger['error'](_0x3907bc['stack']);if(_0x3907bc[_0xf1aa('0x2e')]){delete _0x3907bc[_0xf1aa('0x2e')];}_0x3efecb['status'](_0x45cdc5)[_0xf1aa('0x2f')](_0x3907bc);};}exports[_0xf1aa('0x30')]=function(_0x3e93c3,_0x55d734){var _0x2f10ee={},_0x50d82a={},_0x3e27ba={'count':0x0,'rows':[]};var _0x4178a=_[_0xf1aa('0x31')](db['ChatInternalMessage']['rawAttributes'],function(_0x15189d){return{'name':_0x15189d[_0xf1aa('0x32')],'type':_0x15189d[_0xf1aa('0x33')]['key']};});_0x50d82a[_0xf1aa('0x34')]=_['map'](_0x4178a,_0xf1aa('0x2e'));_0x50d82a[_0xf1aa('0x35')]=_[_0xf1aa('0x36')](_0x3e93c3[_0xf1aa('0x35')]);_0x50d82a['filters']=_[_0xf1aa('0x37')](_0x50d82a[_0xf1aa('0x34')],_0x50d82a['query']);_0x2f10ee[_0xf1aa('0x38')]=_[_0xf1aa('0x37')](_0x50d82a[_0xf1aa('0x34')],qs[_0xf1aa('0x39')](_0x3e93c3[_0xf1aa('0x35')][_0xf1aa('0x39')]));_0x2f10ee['attributes']=_0x2f10ee[_0xf1aa('0x38')][_0xf1aa('0x3a')]?_0x2f10ee[_0xf1aa('0x38')]:_0x50d82a['model'];if(!_0x3e93c3[_0xf1aa('0x35')][_0xf1aa('0x3b')]('nolimit')){_0x2f10ee[_0xf1aa('0x25')]=qs[_0xf1aa('0x25')](_0x3e93c3['query'][_0xf1aa('0x25')]);_0x2f10ee[_0xf1aa('0x23')]=qs[_0xf1aa('0x23')](_0x3e93c3[_0xf1aa('0x35')][_0xf1aa('0x23')]);}_0x2f10ee['order']=qs[_0xf1aa('0x3c')](_0x3e93c3['query'][_0xf1aa('0x3c')]);_0x2f10ee[_0xf1aa('0x3d')]=qs[_0xf1aa('0x3e')](_['pick'](_0x3e93c3[_0xf1aa('0x35')],_0x50d82a[_0xf1aa('0x3e')]),_0x4178a);if(_0x3e93c3['query'][_0xf1aa('0x3f')]){_0x2f10ee['where']=_['merge'](_0x2f10ee[_0xf1aa('0x3d')],{'$or':_[_0xf1aa('0x31')](_0x4178a,function(_0xfccab){if(_0xfccab[_0xf1aa('0x33')]!==_0xf1aa('0x40')){var _0x18ef4a={};_0x18ef4a[_0xfccab[_0xf1aa('0x2e')]]={'$like':'%'+_0x3e93c3[_0xf1aa('0x35')][_0xf1aa('0x3f')]+'%'};return _0x18ef4a;}})});}_0x2f10ee=_['merge']({},_0x2f10ee,_0x3e93c3[_0xf1aa('0x41')]);var _0x28f5e8={'where':_0x2f10ee[_0xf1aa('0x3d')]};return db[_0xf1aa('0x42')][_0xf1aa('0x26')](_0x28f5e8)[_0xf1aa('0x2d')](function(_0x17235b){_0x3e27ba[_0xf1aa('0x26')]=_0x17235b;if(_0x3e93c3[_0xf1aa('0x35')][_0xf1aa('0x43')]){_0x2f10ee[_0xf1aa('0x44')]=[{'all':!![]}];}return db[_0xf1aa('0x42')][_0xf1aa('0x45')](_0x2f10ee);})[_0xf1aa('0x2d')](function(_0x5c7686){_0x3e27ba[_0xf1aa('0x46')]=_0x5c7686;return _0x3e27ba;})['then'](respondWithFilteredResult(_0x55d734,_0x2f10ee))['catch'](handleError(_0x55d734,null));};exports[_0xf1aa('0x47')]=function(_0x19341f,_0x4d926f){var _0x5cf65a={'raw':!![],'where':{'id':_0x19341f[_0xf1aa('0x48')]['id']}},_0xd87fa9={};_0xd87fa9['model']=_[_0xf1aa('0x36')](db[_0xf1aa('0x42')][_0xf1aa('0x49')]);_0xd87fa9[_0xf1aa('0x35')]=_[_0xf1aa('0x36')](_0x19341f[_0xf1aa('0x35')]);_0xd87fa9[_0xf1aa('0x3e')]=_[_0xf1aa('0x37')](_0xd87fa9[_0xf1aa('0x34')],_0xd87fa9[_0xf1aa('0x35')]);_0x5cf65a[_0xf1aa('0x38')]=_[_0xf1aa('0x37')](_0xd87fa9[_0xf1aa('0x34')],qs[_0xf1aa('0x39')](_0x19341f[_0xf1aa('0x35')]['fields']));_0x5cf65a['attributes']=_0x5cf65a[_0xf1aa('0x38')]['length']?_0x5cf65a[_0xf1aa('0x38')]:_0xd87fa9[_0xf1aa('0x34')];if(_0x19341f['query'][_0xf1aa('0x43')]){_0x5cf65a[_0xf1aa('0x44')]=[{'all':!![]}];}_0x5cf65a=_[_0xf1aa('0x4a')]({},_0x5cf65a,_0x19341f[_0xf1aa('0x41')]);return db[_0xf1aa('0x42')][_0xf1aa('0x4b')](_0x5cf65a)[_0xf1aa('0x2d')](handleEntityNotFound(_0x4d926f,null))['then'](respondWithResult(_0x4d926f,null))[_0xf1aa('0x4c')](handleError(_0x4d926f,null));};exports[_0xf1aa('0x4d')]=function(_0x13772e,_0x4519fd){return db[_0xf1aa('0x42')][_0xf1aa('0x4d')](_0x13772e[_0xf1aa('0x4e')],{})['then'](respondWithResult(_0x4519fd,0xc9))[_0xf1aa('0x4c')](handleError(_0x4519fd,null));};exports[_0xf1aa('0x2b')]=function(_0xe17d83,_0x575653){if(_0xe17d83[_0xf1aa('0x4e')]['id']){delete _0xe17d83[_0xf1aa('0x4e')]['id'];}return db['ChatInternalMessage'][_0xf1aa('0x4b')]({'where':{'id':_0xe17d83[_0xf1aa('0x48')]['id']}})[_0xf1aa('0x2d')](handleEntityNotFound(_0x575653,null))[_0xf1aa('0x2d')](saveUpdates(_0xe17d83[_0xf1aa('0x4e')],null))['then'](respondWithResult(_0x575653,null))[_0xf1aa('0x4c')](handleError(_0x575653,null));};exports[_0xf1aa('0x2c')]=function(_0x515b7c,_0x234d01){return db[_0xf1aa('0x42')][_0xf1aa('0x4b')]({'where':{'id':_0x515b7c[_0xf1aa('0x48')]['id']}})['then'](handleEntityNotFound(_0x234d01,null))[_0xf1aa('0x2d')](removeEntity(_0x234d01,null))[_0xf1aa('0x4c')](handleError(_0x234d01,null));};exports['describe']=function(_0x37d379,_0x1364c0){return db[_0xf1aa('0x42')][_0xf1aa('0x4f')]()[_0xf1aa('0x2d')](respondWithResult(_0x1364c0,null))['catch'](handleError(_0x1364c0,null));};function wrapUser(_0x213918){return function(_0x40c76f){var _0x5d1b43=_0x213918[_0xf1aa('0x50')]({'plain':!![]});_0x5d1b43[_0xf1aa('0x51')]=[];if(_0x40c76f){_0x5d1b43[_0xf1aa('0x52')]=_0x40c76f[_0xf1aa('0x53')];_0x5d1b43[_0xf1aa('0x54')]=_0x40c76f;}else{_0x5d1b43[_0xf1aa('0x52')]=moment(0x0)[_0xf1aa('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x5d1b43[_0xf1aa('0x54')]={};}return _0x5d1b43;};}exports['getUsers']=function(_0x20c533,_0x3844e6,_0x355374){var _0x135ae8=[];return db[_0xf1aa('0x56')][_0xf1aa('0x45')]({'where':{'role':[_0xf1aa('0x57'),'admin',_0xf1aa('0x58')]},'attributes':['id',_0xf1aa('0x59'),_0xf1aa('0x2e'),'role','userpic',_0xf1aa('0x5a'),_0xf1aa('0x5b'),_0xf1aa('0x5c'),_0xf1aa('0x5d'),_0xf1aa('0x5e')],'order':qs['sort'](_0xf1aa('0x5f')),'include':[{'model':db[_0xf1aa('0x60')],'as':_0xf1aa('0x61'),'attributes':['id',_0xf1aa('0x2e'),_0xf1aa('0x33')],'through':{'attributes':[]}}]})[_0xf1aa('0x2d')](function(_0x444c66){if(_0x444c66){var _0x30f95d=_0x20c533[_0xf1aa('0x58')][_0xf1aa('0x50')]({'plain':!![]});if(!_0x30f95d)throw new Error(_0xf1aa('0x62'));if(_0x30f95d[_0xf1aa('0x63')]===_0xf1aa('0x58')){return db[_0xf1aa('0x64')]['find']({'where':{'name':_0xf1aa('0x65'),'userProfileId':_0x30f95d[_0xf1aa('0x66')]},'raw':!![]})[_0xf1aa('0x2d')](function(_0x66eaa4){if(_0x66eaa4){if(_0x66eaa4[_0xf1aa('0x67')]===0x0){return db[_0xf1aa('0x68')][_0xf1aa('0x45')]({'where':{'sectionId':_0x66eaa4['id']},'raw':!![]})['then'](function(_0x18413b){var _0x28905b=[];if(_[_0xf1aa('0x69')](_0x18413b)){_0x28905b=_[_0xf1aa('0x3f')](_0x444c66,function(_0x2c5294){if(_0x2c5294[_0xf1aa('0x63')]!==_0xf1aa('0x57')){return _0x2c5294;}});return _0x28905b;}else{for(var _0x5d097b=0x0;_0x5d097b<_0x444c66[_0xf1aa('0x3a')];_0x5d097b++){var _0x28b0e8=_0x444c66[_0x5d097b];if(_0x28b0e8[_0xf1aa('0x63')]===_0xf1aa('0x57')){var _0x38d04a=_[_0xf1aa('0x4b')](_0x18413b,function(_0x229e2c){return _0x229e2c[_0xf1aa('0x6a')]===_0x28b0e8['id'];});if(_0x38d04a)_0x28905b[_0xf1aa('0x6b')](_0x28b0e8);}else{_0x28905b[_0xf1aa('0x6b')](_0x28b0e8);}}return _0x28905b;}});}else{return _0x444c66;}}else{var _0x164741=_[_0xf1aa('0x3f')](_0x444c66,function(_0x273dec){if(_0x273dec[_0xf1aa('0x63')]!==_0xf1aa('0x57')){return _0x273dec;}});return _0x164741;}});}else{return _0x444c66;}}})[_0xf1aa('0x2d')](function(_0x534a14){var _0x51311b=[];if(_0x534a14){_0x135ae8=_0x534a14;for(var _0xa4d8f=0x0;_0xa4d8f<_0x534a14[_0xf1aa('0x3a')];_0xa4d8f+=0x1){_0x135ae8[_0xa4d8f]['messages']=[];_0x51311b[_0xf1aa('0x6b')](db['ChatInternalMessage'][_0xf1aa('0x4b')]({'where':{'FromId':[_0x20c533[_0xf1aa('0x58')]['id'],_0x534a14[_0xa4d8f]['id']],'ToId':[_0x20c533[_0xf1aa('0x58')]['id'],_0x534a14[_0xa4d8f]['id']],'ChatGroupId':null},'attributes':['id',_0xf1aa('0x53'),'FromId',_0xf1aa('0x6c'),_0xf1aa('0x6d'),'body'],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf1aa('0x2d')](wrapUser(_0x534a14[_0xa4d8f])));}return BPromise[_0xf1aa('0x6e')](_0x51311b);}return[];})[_0xf1aa('0x2d')](function(_0x4b8b5d){return{'rows':_0x4b8b5d,'count':_0x4b8b5d[_0xf1aa('0x3a')]};})[_0xf1aa('0x2d')](respondWithResult(_0x3844e6,null))['catch'](handleError(_0x3844e6,null));};
\ No newline at end of file
+var _0x7202=['resourceId','push','user','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','describe','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','findAll','agent','admin','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','isEmpty'];(function(_0x353be4,_0x45221b){var _0x2449e3=function(_0x5058cb){while(--_0x5058cb){_0x353be4['push'](_0x353be4['shift']());}};_0x2449e3(++_0x45221b);}(_0x7202,0x75));var _0x2720=function(_0x35cc40,_0x48be67){_0x35cc40=_0x35cc40-0x0;var _0x4a4444=_0x7202[_0x35cc40];return _0x4a4444;};'use strict';var emlformat=require(_0x2720('0x0'));var rimraf=require(_0x2720('0x1'));var zipdir=require(_0x2720('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2720('0x3'));var moment=require(_0x2720('0x4'));var BPromise=require(_0x2720('0x5'));var Mustache=require(_0x2720('0x6'));var util=require(_0x2720('0x7'));var path=require(_0x2720('0x8'));var sox=require(_0x2720('0x9'));var csv=require(_0x2720('0xa'));var ejs=require(_0x2720('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2720('0xc'));var squel=require(_0x2720('0xd'));var crypto=require(_0x2720('0xe'));var jsforce=require(_0x2720('0xf'));var deskjs=require(_0x2720('0x10'));var toCsv=require(_0x2720('0xa'));var querystring=require('querystring');var Papa=require(_0x2720('0x11'));var Redis=require('ioredis');var authService=require(_0x2720('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2720('0x13'));var hardwareService=require(_0x2720('0x14'));var logger=require(_0x2720('0x15'))(_0x2720('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2720('0x17'))['db'];config[_0x2720('0x18')]=_[_0x2720('0x19')](config[_0x2720('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2720('0x18')]));require('./chatInternalMessage.socket')[_0x2720('0x1a')](socket);function respondWithStatusCode(_0x3fc74b,_0x386752){_0x386752=_0x386752||0xcc;return function(_0xa4996e){if(_0xa4996e){return _0x3fc74b[_0x2720('0x1b')](_0x386752);}return _0x3fc74b[_0x2720('0x1c')](_0x386752)[_0x2720('0x1d')]();};}function respondWithResult(_0x29ed7d,_0x5e9361){_0x5e9361=_0x5e9361||0xc8;return function(_0x499670){if(_0x499670){return _0x29ed7d['status'](_0x5e9361)[_0x2720('0x1e')](_0x499670);}};}function respondWithFilteredResult(_0x326199,_0x13839c){return function(_0x136ffe){if(_0x136ffe){var _0x264bce=typeof _0x13839c[_0x2720('0x1f')]===_0x2720('0x20')&&typeof _0x13839c[_0x2720('0x21')]===_0x2720('0x20');var _0x9f5b43=_0x136ffe[_0x2720('0x22')];var _0x116340=_0x264bce?0x0:_0x13839c['offset'];var _0x4438ce=_0x264bce?_0x136ffe['count']:_0x13839c[_0x2720('0x1f')]+_0x13839c[_0x2720('0x21')];var _0x2135b6;if(_0x4438ce>=_0x9f5b43){_0x4438ce=_0x9f5b43;_0x2135b6=0xc8;}else{_0x2135b6=0xce;}_0x326199[_0x2720('0x1c')](_0x2135b6);return _0x326199[_0x2720('0x23')]('Content-Range',_0x116340+'-'+_0x4438ce+'/'+_0x9f5b43)[_0x2720('0x1e')](_0x136ffe);}return null;};}function patchUpdates(_0x21f526){return function(_0x25ab7b){try{jsonpatch[_0x2720('0x24')](_0x25ab7b,_0x21f526,!![]);}catch(_0x21d306){return BPromise['reject'](_0x21d306);}return _0x25ab7b[_0x2720('0x25')]();};}function saveUpdates(_0x30787e,_0x21d86e){return function(_0x2532fb){if(_0x2532fb){return _0x2532fb['update'](_0x30787e)[_0x2720('0x26')](function(_0x5591f7){return _0x5591f7;});}return null;};}function removeEntity(_0x535622,_0x21b4a2){return function(_0x3615db){if(_0x3615db){return _0x3615db['destroy']()[_0x2720('0x26')](function(){_0x535622[_0x2720('0x1c')](0xcc)[_0x2720('0x1d')]();});}};}function handleEntityNotFound(_0x22c01a,_0x100e57){return function(_0x2bde20){if(!_0x2bde20){_0x22c01a['sendStatus'](0x194);}return _0x2bde20;};}function handleError(_0x1fbdfe,_0x744439){_0x744439=_0x744439||0x1f4;return function(_0x4b0041){logger['error'](_0x4b0041['stack']);if(_0x4b0041[_0x2720('0x27')]){delete _0x4b0041[_0x2720('0x27')];}_0x1fbdfe['status'](_0x744439)[_0x2720('0x28')](_0x4b0041);};}exports[_0x2720('0x29')]=function(_0x1d6523,_0x5ae55c){var _0x6bef9d={},_0x53358c={},_0x14c91a={'count':0x0,'rows':[]};var _0x97b549=_[_0x2720('0x2a')](db[_0x2720('0x2b')][_0x2720('0x2c')],function(_0x530954){return{'name':_0x530954[_0x2720('0x2d')],'type':_0x530954[_0x2720('0x2e')]['key']};});_0x53358c[_0x2720('0x2f')]=_[_0x2720('0x2a')](_0x97b549,_0x2720('0x27'));_0x53358c[_0x2720('0x30')]=_[_0x2720('0x31')](_0x1d6523[_0x2720('0x30')]);_0x53358c[_0x2720('0x32')]=_[_0x2720('0x33')](_0x53358c['model'],_0x53358c[_0x2720('0x30')]);_0x6bef9d[_0x2720('0x34')]=_[_0x2720('0x33')](_0x53358c['model'],qs[_0x2720('0x35')](_0x1d6523['query'][_0x2720('0x35')]));_0x6bef9d['attributes']=_0x6bef9d[_0x2720('0x34')][_0x2720('0x36')]?_0x6bef9d['attributes']:_0x53358c[_0x2720('0x2f')];if(!_0x1d6523[_0x2720('0x30')][_0x2720('0x37')](_0x2720('0x38'))){_0x6bef9d[_0x2720('0x21')]=qs['limit'](_0x1d6523[_0x2720('0x30')]['limit']);_0x6bef9d[_0x2720('0x1f')]=qs[_0x2720('0x1f')](_0x1d6523['query'][_0x2720('0x1f')]);}_0x6bef9d[_0x2720('0x39')]=qs[_0x2720('0x3a')](_0x1d6523['query'][_0x2720('0x3a')]);_0x6bef9d[_0x2720('0x3b')]=qs[_0x2720('0x32')](_[_0x2720('0x3c')](_0x1d6523[_0x2720('0x30')],_0x53358c[_0x2720('0x32')]),_0x97b549);if(_0x1d6523[_0x2720('0x30')][_0x2720('0x3d')]){_0x6bef9d[_0x2720('0x3b')]=_[_0x2720('0x3e')](_0x6bef9d[_0x2720('0x3b')],{'$or':_[_0x2720('0x2a')](_0x97b549,function(_0x4b898f){if(_0x4b898f['type']!==_0x2720('0x3f')){var _0xbc062c={};_0xbc062c[_0x4b898f[_0x2720('0x27')]]={'$like':'%'+_0x1d6523[_0x2720('0x30')]['filter']+'%'};return _0xbc062c;}})});}_0x6bef9d=_[_0x2720('0x3e')]({},_0x6bef9d,_0x1d6523[_0x2720('0x40')]);var _0x4fbc0c={'where':_0x6bef9d[_0x2720('0x3b')]};return db[_0x2720('0x2b')][_0x2720('0x22')](_0x4fbc0c)[_0x2720('0x26')](function(_0x5e9ba9){_0x14c91a[_0x2720('0x22')]=_0x5e9ba9;if(_0x1d6523['query'][_0x2720('0x41')]){_0x6bef9d[_0x2720('0x42')]=[{'all':!![]}];}return db[_0x2720('0x2b')]['findAll'](_0x6bef9d);})[_0x2720('0x26')](function(_0x324832){_0x14c91a['rows']=_0x324832;return _0x14c91a;})['then'](respondWithFilteredResult(_0x5ae55c,_0x6bef9d))[_0x2720('0x43')](handleError(_0x5ae55c,null));};exports[_0x2720('0x44')]=function(_0x173ab6,_0x10bcf4){var _0x5d9b82={'raw':!![],'where':{'id':_0x173ab6[_0x2720('0x45')]['id']}},_0x2740bf={};_0x2740bf['model']=_[_0x2720('0x31')](db[_0x2720('0x2b')][_0x2720('0x2c')]);_0x2740bf[_0x2720('0x30')]=_[_0x2720('0x31')](_0x173ab6[_0x2720('0x30')]);_0x2740bf[_0x2720('0x32')]=_[_0x2720('0x33')](_0x2740bf[_0x2720('0x2f')],_0x2740bf[_0x2720('0x30')]);_0x5d9b82[_0x2720('0x34')]=_[_0x2720('0x33')](_0x2740bf[_0x2720('0x2f')],qs['fields'](_0x173ab6[_0x2720('0x30')][_0x2720('0x35')]));_0x5d9b82[_0x2720('0x34')]=_0x5d9b82['attributes']['length']?_0x5d9b82[_0x2720('0x34')]:_0x2740bf[_0x2720('0x2f')];if(_0x173ab6[_0x2720('0x30')][_0x2720('0x41')]){_0x5d9b82[_0x2720('0x42')]=[{'all':!![]}];}_0x5d9b82=_[_0x2720('0x3e')]({},_0x5d9b82,_0x173ab6[_0x2720('0x40')]);return db[_0x2720('0x2b')][_0x2720('0x46')](_0x5d9b82)[_0x2720('0x26')](handleEntityNotFound(_0x10bcf4,null))[_0x2720('0x26')](respondWithResult(_0x10bcf4,null))[_0x2720('0x43')](handleError(_0x10bcf4,null));};exports[_0x2720('0x47')]=function(_0x511e8c,_0x2b9816){return db[_0x2720('0x2b')][_0x2720('0x47')](_0x511e8c[_0x2720('0x48')],{})['then'](respondWithResult(_0x2b9816,0xc9))[_0x2720('0x43')](handleError(_0x2b9816,null));};exports[_0x2720('0x49')]=function(_0x1127ad,_0xcd490b){if(_0x1127ad[_0x2720('0x48')]['id']){delete _0x1127ad['body']['id'];}return db['ChatInternalMessage'][_0x2720('0x46')]({'where':{'id':_0x1127ad[_0x2720('0x45')]['id']}})[_0x2720('0x26')](handleEntityNotFound(_0xcd490b,null))[_0x2720('0x26')](saveUpdates(_0x1127ad[_0x2720('0x48')],null))[_0x2720('0x26')](respondWithResult(_0xcd490b,null))['catch'](handleError(_0xcd490b,null));};exports[_0x2720('0x4a')]=function(_0x60f6c5,_0x49c5fe){return db[_0x2720('0x2b')][_0x2720('0x46')]({'where':{'id':_0x60f6c5['params']['id']}})[_0x2720('0x26')](handleEntityNotFound(_0x49c5fe,null))[_0x2720('0x26')](removeEntity(_0x49c5fe,null))[_0x2720('0x43')](handleError(_0x49c5fe,null));};exports[_0x2720('0x4b')]=function(_0x3d1335,_0x313002){return db['ChatInternalMessage'][_0x2720('0x4b')]()[_0x2720('0x26')](respondWithResult(_0x313002,null))[_0x2720('0x43')](handleError(_0x313002,null));};function wrapUser(_0x347e11){return function(_0x3394e1){var _0x10eb98=_0x347e11['get']({'plain':!![]});_0x10eb98[_0x2720('0x4c')]=[];if(_0x3394e1){_0x10eb98[_0x2720('0x4d')]=_0x3394e1[_0x2720('0x4e')];_0x10eb98['lastMessage']=_0x3394e1;}else{_0x10eb98[_0x2720('0x4d')]=moment(0x0)[_0x2720('0x4f')](_0x2720('0x50'));_0x10eb98[_0x2720('0x51')]={};}return _0x10eb98;};}exports[_0x2720('0x52')]=function(_0x207ffb,_0x4bacd3,_0x597485){var _0x19bb3e=[];return db['User'][_0x2720('0x53')]({'where':{'role':[_0x2720('0x54'),_0x2720('0x55'),'user']},'attributes':['id',_0x2720('0x56'),_0x2720('0x27'),_0x2720('0x57'),'userpic',_0x2720('0x58'),_0x2720('0x59'),_0x2720('0x5a'),_0x2720('0x5b'),_0x2720('0x5c')],'order':qs[_0x2720('0x3a')](_0x2720('0x5d')),'include':[{'model':db[_0x2720('0x5e')],'as':_0x2720('0x5f'),'attributes':['id',_0x2720('0x27'),'type'],'through':{'attributes':[]}}]})[_0x2720('0x26')](function(_0x3945a4){if(_0x3945a4){var _0x1b560a=_0x207ffb['user']['get']({'plain':!![]});if(!_0x1b560a)throw new Error(_0x2720('0x60'));if(_0x1b560a['role']==='user'){return db[_0x2720('0x61')]['find']({'where':{'name':'Agents','userProfileId':_0x1b560a[_0x2720('0x62')]},'raw':!![]})[_0x2720('0x26')](function(_0x27155d){if(_0x27155d){if(_0x27155d['autoAssociation']===0x0){return db[_0x2720('0x63')][_0x2720('0x53')]({'where':{'sectionId':_0x27155d['id']},'raw':!![]})[_0x2720('0x26')](function(_0x2ea83c){var _0x5d32fb=[];if(_[_0x2720('0x64')](_0x2ea83c)){_0x5d32fb=_['filter'](_0x3945a4,function(_0x547560){if(_0x547560[_0x2720('0x57')]!==_0x2720('0x54')){return _0x547560;}});return _0x5d32fb;}else{for(var _0x56dd98=0x0;_0x56dd98<_0x3945a4[_0x2720('0x36')];_0x56dd98++){var _0x5c5b38=_0x3945a4[_0x56dd98];if(_0x5c5b38[_0x2720('0x57')]===_0x2720('0x54')){var _0x47a73d=_[_0x2720('0x46')](_0x2ea83c,function(_0x1e482e){return _0x1e482e[_0x2720('0x65')]===_0x5c5b38['id'];});if(_0x47a73d)_0x5d32fb[_0x2720('0x66')](_0x5c5b38);}else{_0x5d32fb[_0x2720('0x66')](_0x5c5b38);}}return _0x5d32fb;}});}else{return _0x3945a4;}}else{var _0x5c6093=_['filter'](_0x3945a4,function(_0x48a17f){if(_0x48a17f['role']!=='agent'){return _0x48a17f;}});return _0x5c6093;}});}else{return _0x3945a4;}}})[_0x2720('0x26')](function(_0xb87ed0){var _0x413fa8=[];if(_0xb87ed0){_0x19bb3e=_0xb87ed0;for(var _0x484877=0x0;_0x484877<_0xb87ed0[_0x2720('0x36')];_0x484877+=0x1){_0x19bb3e[_0x484877][_0x2720('0x4c')]=[];_0x413fa8[_0x2720('0x66')](db[_0x2720('0x2b')][_0x2720('0x46')]({'where':{'FromId':[_0x207ffb[_0x2720('0x67')]['id'],_0xb87ed0[_0x484877]['id']],'ToId':[_0x207ffb[_0x2720('0x67')]['id'],_0xb87ed0[_0x484877]['id']],'ChatGroupId':null},'attributes':['id',_0x2720('0x4e'),_0x2720('0x68'),_0x2720('0x69'),_0x2720('0x6a'),_0x2720('0x48')],'order':qs[_0x2720('0x3a')](_0x2720('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2720('0x26')](wrapUser(_0xb87ed0[_0x484877])));}return BPromise[_0x2720('0x6c')](_0x413fa8);}return[];})['then'](function(_0x3d5e80){return{'rows':_0x3d5e80,'count':_0x3d5e80[_0x2720('0x36')]};})[_0x2720('0x26')](respondWithResult(_0x4bacd3,null))[_0x2720('0x43')](handleError(_0x4bacd3,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 2127b9f..4600c2b 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 _0x1819=['emit','hook','exports','events','setMaxListeners','save','remove'];(function(_0x880a74,_0x2eb30b){var _0x19d1c4=function(_0x277b3b){while(--_0x277b3b){_0x880a74['push'](_0x880a74['shift']());}};_0x19d1c4(++_0x2eb30b);}(_0x1819,0x81));var _0x9181=function(_0x15fc7a,_0xd21741){_0x15fc7a=_0x15fc7a-0x0;var _0x3aa9f4=_0x1819[_0x15fc7a];return _0x3aa9f4;};'use strict';var EventEmitter=require(_0x9181('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x9181('0x1')](0x0);var events={'afterCreate':_0x9181('0x2'),'afterUpdate':'update','afterDestroy':_0x9181('0x3')};function emitEvent(_0x543c56){return function(_0x5432a6,_0x142cdb,_0x41eeec){ChatInternalMessageEvents['emit'](_0x543c56+':'+_0x5432a6['id'],_0x5432a6);ChatInternalMessageEvents[_0x9181('0x4')](_0x543c56,_0x5432a6);_0x41eeec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x9181('0x5')](e,emitEvent(event));}}module[_0x9181('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xa19b=['events','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x7c4f17,_0x2e3597){var _0x203c92=function(_0x55f70a){while(--_0x55f70a){_0x7c4f17['push'](_0x7c4f17['shift']());}};_0x203c92(++_0x2e3597);}(_0xa19b,0x90));var _0xba19=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa19b[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0xba19('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xba19('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xba19('0x2'),'afterDestroy':'remove'};function emitEvent(_0x10983b){return function(_0x3bee83,_0x3cb92a,_0x31a55b){ChatInternalMessageEvents[_0xba19('0x3')](_0x10983b+':'+_0x3bee83['id'],_0x3bee83);ChatInternalMessageEvents['emit'](_0x10983b,_0x3bee83);_0x31a55b(null);};}for(var e in events){if(events[_0xba19('0x4')](e)){var event=events[e];ChatInternalMessage[_0xba19('0x5')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 31100c1..f902a61 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 _0x25da=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x25da,0x120));var _0xa25d=function(_0x15eb71,_0x3e975d){_0x15eb71=_0x15eb71-0x0;var _0x844dd1=_0x25da[_0x15eb71];return _0x844dd1;};'use strict';var _=require(_0xa25d('0x0'));var util=require(_0xa25d('0x1'));var logger=require(_0xa25d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa25d('0x3'));var rimraf=require(_0xa25d('0x4'));var config=require(_0xa25d('0x5'));var attributes=require(_0xa25d('0x6'));module[_0xa25d('0x7')]=function(_0x36c616,_0x84d43){return _0x36c616[_0xa25d('0x8')](_0xa25d('0x9'),attributes,{'tableName':_0xa25d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa25d('0xb'),'collate':_0xa25d('0xc')});};
\ No newline at end of file
+var _0x163a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x30728f,_0x82fb00){var _0x2af5df=function(_0x171ed){while(--_0x171ed){_0x30728f['push'](_0x30728f['shift']());}};_0x2af5df(++_0x82fb00);}(_0x163a,0x186));var _0xa163=function(_0x40ebff,_0x1dd15e){_0x40ebff=_0x40ebff-0x0;var _0x40122a=_0x163a[_0x40ebff];return _0x40122a;};'use strict';var _=require(_0xa163('0x0'));var util=require(_0xa163('0x1'));var logger=require(_0xa163('0x2'))(_0xa163('0x3'));var moment=require(_0xa163('0x4'));var BPromise=require(_0xa163('0x5'));var rp=require(_0xa163('0x6'));var fs=require('fs');var path=require(_0xa163('0x7'));var rimraf=require(_0xa163('0x8'));var config=require(_0xa163('0x9'));var attributes=require('./chatInternalMessage.attributes');module[_0xa163('0xa')]=function(_0x388115,_0x73b724){return _0x388115['define'](_0xa163('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa163('0xc'),'collate':_0xa163('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 4edd1a6..a686282 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 _0xb42c=['randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb42c,0x165));var _0xcb42=function(_0x2a3929,_0x2c871a){_0x2a3929=_0x2a3929-0x0;var _0x478eac=_0xb42c[_0x2a3929];return _0x478eac;};'use strict';var _=require(_0xcb42('0x0'));var util=require(_0xcb42('0x1'));var moment=require('moment');var BPromise=require(_0xcb42('0x2'));var rs=require(_0xcb42('0x3'));var fs=require('fs');var Redis=require(_0xcb42('0x4'));var db=require(_0xcb42('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb42('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcb42('0x7'));var client=jayson['client'][_0xcb42('0x8')]({'port':0x232a});config[_0xcb42('0x9')]=_['defaults'](config[_0xcb42('0x9')],{'host':_0xcb42('0xa'),'port':0x18eb});var socket=require(_0xcb42('0xb'))(new Redis(config[_0xcb42('0x9')]));require(_0xcb42('0xc'))[_0xcb42('0xd')](socket);function respondWithRpcPromise(_0x424bb7,_0x489eed,_0x59219a){return new BPromise(function(_0x5310e2,_0x40f688){return client['request'](_0x424bb7,_0x59219a)[_0xcb42('0xe')](function(_0x21f8d1){logger[_0xcb42('0xf')](_0xcb42('0x10'),_0x489eed,'request\x20sent');logger['debug'](_0xcb42('0x11'),_0x489eed,_0xcb42('0x12'),JSON[_0xcb42('0x13')](_0x21f8d1));if(_0x21f8d1[_0xcb42('0x14')]){if(_0x21f8d1[_0xcb42('0x14')][_0xcb42('0x15')]===0x1f4){logger[_0xcb42('0x14')](_0xcb42('0x10'),_0x489eed,_0x21f8d1[_0xcb42('0x14')]['message']);return _0x40f688(_0x21f8d1[_0xcb42('0x14')][_0xcb42('0x16')]);}logger[_0xcb42('0x14')](_0xcb42('0x10'),_0x489eed,_0x21f8d1[_0xcb42('0x14')]['message']);return _0x5310e2(_0x21f8d1[_0xcb42('0x14')][_0xcb42('0x16')]);}else{logger[_0xcb42('0xf')](_0xcb42('0x10'),_0x489eed,_0xcb42('0x12'));_0x5310e2(_0x21f8d1[_0xcb42('0x17')]['message']);}})['catch'](function(_0x70a75c){logger[_0xcb42('0x14')](_0xcb42('0x10'),_0x489eed,_0x70a75c);_0x40f688(_0x70a75c);});});}
\ No newline at end of file
+var _0xd143=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x3626ad,_0xae31a9){var _0x2d9b1c=function(_0x3a68fd){while(--_0x3a68fd){_0x3626ad['push'](_0x3626ad['shift']());}};_0x2d9b1c(++_0xae31a9);}(_0xd143,0xbc));var _0x3d14=function(_0x318842,_0x2daebb){_0x318842=_0x318842-0x0;var _0x3bace5=_0xd143[_0x318842];return _0x3bace5;};'use strict';var _=require(_0x3d14('0x0'));var util=require('util');var moment=require(_0x3d14('0x1'));var BPromise=require(_0x3d14('0x2'));var rs=require(_0x3d14('0x3'));var fs=require('fs');var Redis=require(_0x3d14('0x4'));var db=require(_0x3d14('0x5'))['db'];var utils=require(_0x3d14('0x6'));var logger=require(_0x3d14('0x7'))(_0x3d14('0x8'));var config=require('../../config/environment');var jayson=require(_0x3d14('0x9'));var client=jayson['client'][_0x3d14('0xa')]({'port':0x232a});config[_0x3d14('0xb')]=_[_0x3d14('0xc')](config[_0x3d14('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d14('0xd'))(new Redis(config[_0x3d14('0xb')]));require('./chatInternalMessage.socket')[_0x3d14('0xe')](socket);function respondWithRpcPromise(_0x19cd97,_0x1b4bfd,_0x2a8c09){return new BPromise(function(_0x314e99,_0x3df8d2){return client[_0x3d14('0xf')](_0x19cd97,_0x2a8c09)[_0x3d14('0x10')](function(_0x51de26){logger[_0x3d14('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x1b4bfd,_0x3d14('0x12'));logger[_0x3d14('0x13')](_0x3d14('0x14'),_0x1b4bfd,_0x3d14('0x12'),JSON['stringify'](_0x51de26));if(_0x51de26[_0x3d14('0x15')]){if(_0x51de26[_0x3d14('0x15')][_0x3d14('0x16')]===0x1f4){logger[_0x3d14('0x15')](_0x3d14('0x17'),_0x1b4bfd,_0x51de26['error'][_0x3d14('0x18')]);return _0x3df8d2(_0x51de26[_0x3d14('0x15')][_0x3d14('0x18')]);}logger[_0x3d14('0x15')](_0x3d14('0x17'),_0x1b4bfd,_0x51de26[_0x3d14('0x15')]['message']);return _0x314e99(_0x51de26[_0x3d14('0x15')][_0x3d14('0x18')]);}else{logger[_0x3d14('0x11')](_0x3d14('0x17'),_0x1b4bfd,_0x3d14('0x12'));_0x314e99(_0x51de26[_0x3d14('0x19')][_0x3d14('0x18')]);}})[_0x3d14('0x1a')](function(_0x341e9e){logger[_0x3d14('0x15')](_0x3d14('0x17'),_0x1b4bfd,_0x341e9e);_0x3df8d2(_0x341e9e);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index fe4e04f..cfdc886 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 _0xda31=['update','removeListener','register','./chatInternalMessage.events','save','remove'];(function(_0x57bb74,_0x39ee1a){var _0x133ce6=function(_0x13ad3c){while(--_0x13ad3c){_0x57bb74['push'](_0x57bb74['shift']());}};_0x133ce6(++_0x39ee1a);}(_0xda31,0x1c5));var _0x1da3=function(_0x1731a9,_0x4fb551){_0x1731a9=_0x1731a9-0x0;var _0x22b9a5=_0xda31[_0x1731a9];return _0x22b9a5;};'use strict';var ChatInternalMessageEvents=require(_0x1da3('0x0'));var events=[_0x1da3('0x1'),_0x1da3('0x2'),_0x1da3('0x3')];function createListener(_0x572a7c,_0x2d31c5){return function(_0x34e237){_0x2d31c5['emit'](_0x572a7c,_0x34e237);};}function removeListener(_0x3d02c0,_0x535125){return function(){ChatInternalMessageEvents[_0x1da3('0x4')](_0x3d02c0,_0x535125);};}exports[_0x1da3('0x5')]=function(_0x5eb90f){for(var _0x464108=0x0,_0x17d1be=events['length'];_0x464108<_0x17d1be;_0x464108++){var _0xbbc9c=events[_0x464108];var _0x46c455=createListener('chatInternalMessage:'+_0xbbc9c,_0x5eb90f);ChatInternalMessageEvents['on'](_0xbbc9c,_0x46c455);}};
\ No newline at end of file
+var _0x3fef=['update','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0xfc0cc7,_0x22bec6){var _0x2cf404=function(_0x5e086f){while(--_0x5e086f){_0xfc0cc7['push'](_0xfc0cc7['shift']());}};_0x2cf404(++_0x22bec6);}(_0x3fef,0x115));var _0xf3fe=function(_0x6b50d5,_0x31ea25){_0x6b50d5=_0x6b50d5-0x0;var _0x185cb1=_0x3fef[_0x6b50d5];return _0x185cb1;};'use strict';var ChatInternalMessageEvents=require(_0xf3fe('0x0'));var events=[_0xf3fe('0x1'),_0xf3fe('0x2'),_0xf3fe('0x3')];function createListener(_0xe18591,_0x47b2c6){return function(_0x253fef){_0x47b2c6['emit'](_0xe18591,_0x253fef);};}function removeListener(_0x4ef52e,_0x43e642){return function(){ChatInternalMessageEvents['removeListener'](_0x4ef52e,_0x43e642);};}exports[_0xf3fe('0x4')]=function(_0x2d5b75){for(var _0x13100f=0x0,_0x529180=events[_0xf3fe('0x5')];_0x13100f<_0x529180;_0x13100f++){var _0x7b4a4b=events[_0x13100f];var _0x1c1f82=createListener(_0xf3fe('0x6')+_0x7b4a4b,_0x2d5b75);ChatInternalMessageEvents['on'](_0x7b4a4b,_0x1c1f82);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 87e8ea2..cec2048 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 _0x6b7f=['post','create','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','getUsers','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b7f,0x124));var _0xf6b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b7f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf6b7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf6b7('0x1'));var express=require(_0xf6b7('0x2'));var router=express[_0xf6b7('0x3')]();var fs_extra=require(_0xf6b7('0x4'));var auth=require(_0xf6b7('0x5'));var interaction=require(_0xf6b7('0x6'));var config=require('../../config/environment');var controller=require(_0xf6b7('0x7'));router[_0xf6b7('0x8')]('/',auth[_0xf6b7('0x9')](),controller[_0xf6b7('0xa')]);router['get'](_0xf6b7('0xb'),auth[_0xf6b7('0x9')](),controller['describe']);router['get']('/users',auth[_0xf6b7('0x9')](),controller[_0xf6b7('0xc')]);router[_0xf6b7('0x8')](_0xf6b7('0xd'),auth[_0xf6b7('0x9')](),controller['show']);router[_0xf6b7('0xe')]('/',auth['isAuthenticated'](),controller[_0xf6b7('0xf')]);router['put'](_0xf6b7('0xd'),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf6b7('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xb6b4=['put','/:id','update','delete','destroy','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','getUsers','show','post','create'];(function(_0xf8e45b,_0x336e08){var _0xb38c41=function(_0x51f9d8){while(--_0x51f9d8){_0xf8e45b['push'](_0xf8e45b['shift']());}};_0xb38c41(++_0x336e08);}(_0xb6b4,0x1bd));var _0x4b6b=function(_0x90506d,_0x14f930){_0x90506d=_0x90506d-0x0;var _0x49dc84=_0xb6b4[_0x90506d];return _0x49dc84;};'use strict';var multer=require(_0x4b6b('0x0'));var util=require(_0x4b6b('0x1'));var path=require(_0x4b6b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x4b6b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4b6b('0x4'));var config=require(_0x4b6b('0x5'));var controller=require(_0x4b6b('0x6'));router['get']('/',auth[_0x4b6b('0x7')](),controller[_0x4b6b('0x8')]);router[_0x4b6b('0x9')](_0x4b6b('0xa'),auth[_0x4b6b('0x7')](),controller[_0x4b6b('0xb')]);router[_0x4b6b('0x9')](_0x4b6b('0xc'),auth[_0x4b6b('0x7')](),controller[_0x4b6b('0xd')]);router[_0x4b6b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4b6b('0xe')]);router[_0x4b6b('0xf')]('/',auth[_0x4b6b('0x7')](),controller[_0x4b6b('0x10')]);router[_0x4b6b('0x11')](_0x4b6b('0x12'),controller[_0x4b6b('0x13')]);router[_0x4b6b('0x14')](_0x4b6b('0x12'),auth['isAuthenticated'](),controller[_0x4b6b('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 0872386..8aeb08e 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 _0x9158=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x9158,0x16e));var _0x8915=function(_0x58d739,_0x356647){_0x58d739=_0x58d739-0x0;var _0x1efeb0=_0x9158[_0x58d739];return _0x1efeb0;};'use strict';var Sequelize=require(_0x8915('0x0'));module[_0x8915('0x1')]={'body':{'type':Sequelize[_0x8915('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8915('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8915('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8915('0x5')]},'providerName':{'type':Sequelize[_0x8915('0x6')]},'providerResponse':{'type':Sequelize[_0x8915('0x2')]}};
\ No newline at end of file
+var _0xee4f=['BOOLEAN','out','DATE','sequelize','medium'];(function(_0x271250,_0x3ca034){var _0x48a33f=function(_0x1df635){while(--_0x1df635){_0x271250['push'](_0x271250['shift']());}};_0x48a33f(++_0x3ca034);}(_0xee4f,0xad));var _0xfee4=function(_0x853463,_0x2c8db3){_0x853463=_0x853463-0x0;var _0x1e96f2=_0xee4f[_0x853463];return _0x1e96f2;};'use strict';var Sequelize=require(_0xfee4('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xfee4('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xfee4('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xfee4('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xfee4('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xfee4('0x4')]},'providerName':{'type':Sequelize['STRING']},'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 261a2c1..894cf10 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 _0x3d27=['get','ChatInteraction','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','format','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','formData','chat','params','ChatInteractionId','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','event','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','defaults','socket.io-emitter','redis','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','end','sendStatus','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','findAll','rows','show','includeAll','options','create','body','find','describe','chat-interactions','accept','UserId','user','agent'];(function(_0x28dfe3,_0x4403f1){var _0x44b339=function(_0x534d8f){while(--_0x534d8f){_0x28dfe3['push'](_0x28dfe3['shift']());}};_0x44b339(++_0x4403f1);}(_0x3d27,0x11d));var _0x73d2=function(_0x1e7345,_0x18bcce){_0x1e7345=_0x1e7345-0x0;var _0x33017c=_0x3d27[_0x1e7345];return _0x33017c;};'use strict';var emlformat=require(_0x73d2('0x0'));var rimraf=require(_0x73d2('0x1'));var zipdir=require(_0x73d2('0x2'));var jsonpatch=require(_0x73d2('0x3'));var rp=require(_0x73d2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x73d2('0x5'));var path=require(_0x73d2('0x6'));var sox=require('sox');var csv=require(_0x73d2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x73d2('0x8'));var squel=require(_0x73d2('0x9'));var crypto=require(_0x73d2('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x73d2('0xb'));var toCsv=require(_0x73d2('0x7'));var querystring=require(_0x73d2('0xc'));var Papa=require(_0x73d2('0xd'));var Redis=require('ioredis');var authService=require(_0x73d2('0xe'));var qs=require(_0x73d2('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x73d2('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x73d2('0x11'));var config=require(_0x73d2('0x12'));var licenseUtil=require(_0x73d2('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x73d2('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x73d2('0x15'))(new Redis(config[_0x73d2('0x16')]));require(_0x73d2('0x17'))['register'](socket);var jayson=require(_0x73d2('0x18'));var client=jayson[_0x73d2('0x19')]['http']({'port':0x232c});var client9002=jayson[_0x73d2('0x19')][_0x73d2('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1a65d9,_0x9d2b5c,_0x394985,_0x3103be){return new BPromise(function(_0xac79cc,_0x311bf2){var _0x278787=_0x3103be||client;return _0x278787[_0x73d2('0x1b')](_0x1a65d9,_0x394985)[_0x73d2('0x1c')](function(_0x576cc2){logger[_0x73d2('0x1d')](_0x73d2('0x1e'),_0x9d2b5c,_0x73d2('0x1f'));logger[_0x73d2('0x20')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x9d2b5c,_0x73d2('0x1f'),JSON[_0x73d2('0x21')](_0x576cc2));if(_0x576cc2[_0x73d2('0x22')]){if(_0x576cc2['error'][_0x73d2('0x23')]===0x1f4){logger[_0x73d2('0x22')](_0x73d2('0x1e'),_0x9d2b5c,_0x576cc2[_0x73d2('0x22')][_0x73d2('0x24')]);return _0x311bf2(_0x576cc2[_0x73d2('0x22')][_0x73d2('0x24')]);}logger[_0x73d2('0x22')]('ChatMessage,\x20%s,\x20%s',_0x9d2b5c,_0x576cc2[_0x73d2('0x22')][_0x73d2('0x24')]);return _0xac79cc(_0x576cc2['error'][_0x73d2('0x24')]);}else{logger['info'](_0x73d2('0x1e'),_0x9d2b5c,_0x73d2('0x1f'));_0xac79cc(_0x576cc2[_0x73d2('0x25')]['message']);}})[_0x73d2('0x26')](function(_0x4d64d9){logger[_0x73d2('0x22')](_0x73d2('0x1e'),_0x9d2b5c,_0x4d64d9);_0x311bf2(_0x4d64d9);});});}function respondWithStatusCode(_0x5ce915,_0x66f3d3){_0x66f3d3=_0x66f3d3||0xcc;return function(_0x3222ea){if(_0x3222ea){return _0x5ce915['sendStatus'](_0x66f3d3);}return _0x5ce915['status'](_0x66f3d3)['end']();};}function respondWithResult(_0xa76414,_0x3041bd){_0x3041bd=_0x3041bd||0xc8;return function(_0x2180f9){if(_0x2180f9){return _0xa76414[_0x73d2('0x27')](_0x3041bd)['json'](_0x2180f9);}};}function respondWithFilteredResult(_0x18ef38,_0x46b1bc){return function(_0x14cd7e){if(_0x14cd7e){var _0xe840=typeof _0x46b1bc[_0x73d2('0x28')]===_0x73d2('0x29')&&typeof _0x46b1bc[_0x73d2('0x2a')]===_0x73d2('0x29');var _0x1200f6=_0x14cd7e[_0x73d2('0x2b')];var _0x5af699=_0xe840?0x0:_0x46b1bc[_0x73d2('0x28')];var _0x45cfd7=_0xe840?_0x14cd7e[_0x73d2('0x2b')]:_0x46b1bc[_0x73d2('0x28')]+_0x46b1bc['limit'];var _0x3081d5;if(_0x45cfd7>=_0x1200f6){_0x45cfd7=_0x1200f6;_0x3081d5=0xc8;}else{_0x3081d5=0xce;}_0x18ef38['status'](_0x3081d5);return _0x18ef38[_0x73d2('0x2c')](_0x73d2('0x2d'),_0x5af699+'-'+_0x45cfd7+'/'+_0x1200f6)[_0x73d2('0x2e')](_0x14cd7e);}return null;};}function patchUpdates(_0x545977){return function(_0x462726){try{jsonpatch[_0x73d2('0x2f')](_0x462726,_0x545977,!![]);}catch(_0x1cf69a){return BPromise[_0x73d2('0x30')](_0x1cf69a);}return _0x462726[_0x73d2('0x31')]();};}function saveUpdates(_0x46bd2f,_0x534bdc){return function(_0x2f8cf8){if(_0x2f8cf8){return _0x2f8cf8[_0x73d2('0x32')](_0x46bd2f)['then'](function(_0x870c2d){return _0x870c2d;});}return null;};}function removeEntity(_0x5355f2,_0x530b24){return function(_0x1a201e){if(_0x1a201e){return _0x1a201e[_0x73d2('0x33')]()['then'](function(){_0x5355f2['status'](0xcc)[_0x73d2('0x34')]();});}};}function handleEntityNotFound(_0x37f5ed,_0x4f7fe1){return function(_0x3f797f){if(!_0x3f797f){_0x37f5ed[_0x73d2('0x35')](0x194);}return _0x3f797f;};}function handleError(_0x179911,_0x99f06c){_0x99f06c=_0x99f06c||0x1f4;return function(_0x1b9505){logger[_0x73d2('0x22')](_0x1b9505['stack']);if(_0x1b9505[_0x73d2('0x36')]){delete _0x1b9505[_0x73d2('0x36')];}_0x179911[_0x73d2('0x27')](_0x99f06c)[_0x73d2('0x37')](_0x1b9505);};}exports['index']=function(_0x45e0b6,_0x3afc7e){var _0x430f35={},_0x48aed7={},_0x10e0bd={'count':0x0,'rows':[]};var _0x155d72=_[_0x73d2('0x38')](db[_0x73d2('0x39')][_0x73d2('0x3a')],function(_0x123b5a){return{'name':_0x123b5a[_0x73d2('0x3b')],'type':_0x123b5a[_0x73d2('0x3c')][_0x73d2('0x3d')]};});_0x48aed7[_0x73d2('0x3e')]=_[_0x73d2('0x38')](_0x155d72,_0x73d2('0x36'));_0x48aed7['query']=_[_0x73d2('0x3f')](_0x45e0b6['query']);_0x48aed7[_0x73d2('0x40')]=_[_0x73d2('0x41')](_0x48aed7[_0x73d2('0x3e')],_0x48aed7[_0x73d2('0x42')]);_0x430f35['attributes']=_['intersection'](_0x48aed7[_0x73d2('0x3e')],qs[_0x73d2('0x43')](_0x45e0b6[_0x73d2('0x42')][_0x73d2('0x43')]));_0x430f35[_0x73d2('0x44')]=_0x430f35[_0x73d2('0x44')][_0x73d2('0x45')]?_0x430f35[_0x73d2('0x44')]:_0x48aed7[_0x73d2('0x3e')];if(!_0x45e0b6[_0x73d2('0x42')][_0x73d2('0x46')](_0x73d2('0x47'))){_0x430f35[_0x73d2('0x2a')]=qs['limit'](_0x45e0b6[_0x73d2('0x42')][_0x73d2('0x2a')]);_0x430f35[_0x73d2('0x28')]=qs[_0x73d2('0x28')](_0x45e0b6['query'][_0x73d2('0x28')]);}_0x430f35[_0x73d2('0x48')]=qs[_0x73d2('0x49')](_0x45e0b6['query']['sort']);_0x430f35[_0x73d2('0x4a')]=qs[_0x73d2('0x40')](_[_0x73d2('0x4b')](_0x45e0b6[_0x73d2('0x42')],_0x48aed7[_0x73d2('0x40')]),_0x155d72);if(_0x45e0b6[_0x73d2('0x42')][_0x73d2('0x4c')]){_0x430f35['where']=_['merge'](_0x430f35[_0x73d2('0x4a')],{'$or':_[_0x73d2('0x38')](_0x155d72,function(_0x4281b2){if(_0x4281b2[_0x73d2('0x3c')]!==_0x73d2('0x4d')){var _0x2dccca={};_0x2dccca[_0x4281b2['name']]={'$like':'%'+_0x45e0b6['query'][_0x73d2('0x4c')]+'%'};return _0x2dccca;}})});}_0x430f35=_[_0x73d2('0x4e')]({},_0x430f35,_0x45e0b6['options']);var _0xeb5e9d={'where':_0x430f35[_0x73d2('0x4a')]};return db[_0x73d2('0x39')]['count'](_0xeb5e9d)['then'](function(_0x29b1a5){_0x10e0bd[_0x73d2('0x2b')]=_0x29b1a5;if(_0x45e0b6['query']['includeAll']){_0x430f35['include']=[{'all':!![]}];}return db[_0x73d2('0x39')][_0x73d2('0x4f')](_0x430f35);})[_0x73d2('0x1c')](function(_0x32aa59){_0x10e0bd[_0x73d2('0x50')]=_0x32aa59;return _0x10e0bd;})['then'](respondWithFilteredResult(_0x3afc7e,_0x430f35))[_0x73d2('0x26')](handleError(_0x3afc7e,null));};exports[_0x73d2('0x51')]=function(_0x282cd4,_0x31c521){var _0x2b5ec0={'raw':!![],'where':{'id':_0x282cd4['params']['id']}},_0x4dabdc={};_0x4dabdc[_0x73d2('0x3e')]=_[_0x73d2('0x3f')](db[_0x73d2('0x39')][_0x73d2('0x3a')]);_0x4dabdc[_0x73d2('0x42')]=_['keys'](_0x282cd4[_0x73d2('0x42')]);_0x4dabdc[_0x73d2('0x40')]=_[_0x73d2('0x41')](_0x4dabdc[_0x73d2('0x3e')],_0x4dabdc[_0x73d2('0x42')]);_0x2b5ec0[_0x73d2('0x44')]=_[_0x73d2('0x41')](_0x4dabdc[_0x73d2('0x3e')],qs[_0x73d2('0x43')](_0x282cd4['query']['fields']));_0x2b5ec0[_0x73d2('0x44')]=_0x2b5ec0[_0x73d2('0x44')][_0x73d2('0x45')]?_0x2b5ec0['attributes']:_0x4dabdc['model'];if(_0x282cd4[_0x73d2('0x42')][_0x73d2('0x52')]){_0x2b5ec0['include']=[{'all':!![]}];}_0x2b5ec0=_['merge']({},_0x2b5ec0,_0x282cd4[_0x73d2('0x53')]);return db['ChatMessage']['find'](_0x2b5ec0)['then'](handleEntityNotFound(_0x31c521,null))[_0x73d2('0x1c')](respondWithResult(_0x31c521,null))['catch'](handleError(_0x31c521,null));};exports[_0x73d2('0x54')]=function(_0x5730a7,_0x2f6199){return db['ChatMessage'][_0x73d2('0x54')](_0x5730a7['body'],{})[_0x73d2('0x1c')](respondWithResult(_0x2f6199,0xc9))[_0x73d2('0x26')](handleError(_0x2f6199,null));};exports[_0x73d2('0x32')]=function(_0x592692,_0x5d673f){if(_0x592692[_0x73d2('0x55')]['id']){delete _0x592692[_0x73d2('0x55')]['id'];}return db[_0x73d2('0x39')][_0x73d2('0x56')]({'where':{'id':_0x592692['params']['id']}})[_0x73d2('0x1c')](handleEntityNotFound(_0x5d673f,null))['then'](saveUpdates(_0x592692[_0x73d2('0x55')],null))[_0x73d2('0x1c')](respondWithResult(_0x5d673f,null))[_0x73d2('0x26')](handleError(_0x5d673f,null));};exports['destroy']=function(_0x4959b2,_0x10348f){return db[_0x73d2('0x39')][_0x73d2('0x56')]({'where':{'id':_0x4959b2['params']['id']}})['then'](handleEntityNotFound(_0x10348f,null))['then'](removeEntity(_0x10348f,null))[_0x73d2('0x26')](handleError(_0x10348f,null));};exports[_0x73d2('0x57')]=function(_0x348fd5,_0x3738ea){return db[_0x73d2('0x39')]['describe']()['then'](respondWithResult(_0x3738ea,null))[_0x73d2('0x26')](handleError(_0x3738ea,null));};var interaction_log=require('../../config/logger')(_0x73d2('0x58'));exports[_0x73d2('0x59')]=function(_0x19091c,_0x49699f,_0x27f637){var _0x210100={'agent':{},'channel':'chat'};if(_0x19091c[_0x73d2('0x55')]['id']){delete _0x19091c[_0x73d2('0x55')]['id'];}_0x19091c[_0x73d2('0x55')]['read']=!![];_0x19091c[_0x73d2('0x55')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x19091c[_0x73d2('0x55')][_0x73d2('0x5a')]=_0x19091c['body'][_0x73d2('0x5a')]||_0x19091c[_0x73d2('0x5b')]['id'];_0x210100[_0x73d2('0x5c')]['id']=_0x19091c[_0x73d2('0x55')]['UserId'];return db[_0x73d2('0x39')][_0x73d2('0x56')]({'where':{'id':_0x19091c['params']['id'],'UserId':null}})[_0x73d2('0x1c')](handleEntityNotFound(_0x49699f,null))[_0x73d2('0x1c')](saveUpdates(_0x19091c[_0x73d2('0x55')],null))[_0x73d2('0x1c')](function(_0x55f05e){if(_0x55f05e){_0x210100[_0x73d2('0x24')]=_0x55f05e[_0x73d2('0x5d')]({'plain':!![]});return db[_0x73d2('0x5e')][_0x73d2('0x56')]({'where':{'id':_0x55f05e['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x49699f,null))[_0x73d2('0x1c')](function(_0xf695a4){if(_0xf695a4){return _0xf695a4[_0x73d2('0x32')]({'UserId':_0x19091c[_0x73d2('0x55')][_0x73d2('0x5a')],'read1stAt':_[_0x73d2('0x5f')](_0xf695a4[_0x73d2('0x60')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x10c060){if(_0x10c060){_0x210100[_0x73d2('0x61')]=_0x10c060[_0x73d2('0x5d')]({'plain':!![]});interaction_log[_0x73d2('0x1d')](_0x73d2('0x62'),_0x19091c[_0x73d2('0x5b')]['id'],_0x19091c['user']['name'],_0x19091c['user'][_0x73d2('0x63')],_0x210100[_0x73d2('0x61')]['id'],_0x19091c[_0x73d2('0x55')]?JSON[_0x73d2('0x21')](_0x19091c[_0x73d2('0x55')]):_0x73d2('0x64'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x210100);}return null;})['then'](function(_0x4e32eb){var _0x1193e4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e32eb[_0x73d2('0x24')][_0x73d2('0x65')];return db['sequelize'][_0x73d2('0x42')](_0x1193e4,{'type':db[_0x73d2('0x66')][_0x73d2('0x67')][_0x73d2('0x68')],'raw':!![]})[_0x73d2('0x1c')](function(_0x5078a4){return _0x5078a4;});})[_0x73d2('0x1c')](function(_0x1d85e1){if(_0x1d85e1){_0x210100[_0x73d2('0x24')][_0x73d2('0x69')]=_0x1d85e1[0x0];if(!_0x19091c['body']['UserId'])return;return db[_0x73d2('0x6a')]['find']({'where':{'id':_0x19091c['body'][_0x73d2('0x5a')],'role':_0x73d2('0x5c')},'attributes':['id',_0x73d2('0x36'),_0x73d2('0x6b'),_0x73d2('0x6c'),_0x73d2('0x6d')],'raw':!![]});}return null;})[_0x73d2('0x1c')](function(_0x55860b){if(!_0x55860b)return null;_0x210100[_0x73d2('0x24')][_0x73d2('0x5c')]=_0x55860b;return _0x210100;})[_0x73d2('0x1c')](function(_0x52143d){if(_0x52143d){if(_0x19091c[_0x73d2('0x55')]['manual']){_0x210100[_0x73d2('0x24')][_0x73d2('0x6e')]=util[_0x73d2('0x6f')](_0x73d2('0x70'),_0x19091c[_0x73d2('0x5b')][_0x73d2('0x36')]);_0x210100[_0x73d2('0x24')][_0x73d2('0x71')]=_0x210100[_0x73d2('0x71')];_0x210100[_0x73d2('0x24')][_0x73d2('0x72')]=_0x210100['channel'];_0x210100['message']['event']=_0x73d2('0x59');return respondWithRpcPromise(_0x73d2('0x73'),_0x73d2('0x73'),{'event':_0x73d2('0x74'),'message':_[_0x73d2('0x4e')](_0x210100[_0x73d2('0x24')],JSON[_0x73d2('0x75')](_0x210100[_0x73d2('0x61')][_0x73d2('0x76')]))},client9002)[_0x73d2('0x1c')](function(){return _0x210100;});}return _0x210100;}return null;})[_0x73d2('0x1c')](respondWithResult(_0x49699f,null))[_0x73d2('0x26')](handleError(_0x49699f,null));};var interaction_log=require('../../config/logger')(_0x73d2('0x58'));exports[_0x73d2('0x30')]=function(_0x25d802,_0x366efc,_0x47d07e){var _0x47e87f={'agent':{},'channel':_0x73d2('0x77')};if(_0x25d802[_0x73d2('0x55')]['id']){delete _0x25d802[_0x73d2('0x55')]['id'];}_0x25d802[_0x73d2('0x55')]['UserId']=_0x25d802[_0x73d2('0x55')]['UserId']||_0x25d802[_0x73d2('0x5b')]['id'];_0x47e87f[_0x73d2('0x5c')]['id']=_0x25d802['body'][_0x73d2('0x5a')];return db[_0x73d2('0x39')][_0x73d2('0x56')]({'where':{'id':_0x25d802[_0x73d2('0x78')]['id'],'UserId':null}})[_0x73d2('0x1c')](handleEntityNotFound(_0x366efc,null))[_0x73d2('0x1c')](function(_0x8b5b70){if(_0x8b5b70){_0x47e87f[_0x73d2('0x24')]=_0x8b5b70[_0x73d2('0x5d')]({'plain':!![]});return db[_0x73d2('0x5e')][_0x73d2('0x56')]({'where':{'id':_0x8b5b70[_0x73d2('0x79')]}});}return null;})[_0x73d2('0x1c')](handleEntityNotFound(_0x366efc,null))[_0x73d2('0x1c')](function(_0x208406){if(_0x208406){_0x47e87f[_0x73d2('0x61')]=_0x208406[_0x73d2('0x5d')]({'plain':!![]});interaction_log[_0x73d2('0x1d')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x25d802[_0x73d2('0x5b')]['id'],_0x25d802[_0x73d2('0x5b')]['name'],_0x25d802['user'][_0x73d2('0x63')],_0x47e87f[_0x73d2('0x61')]['id'],_0x25d802[_0x73d2('0x55')]?JSON[_0x73d2('0x21')](_0x25d802[_0x73d2('0x55')]):_0x73d2('0x64'));return respondWithRpcPromise('RejectMessage',_0x73d2('0x7a'),_0x47e87f);}return null;})['then'](function(_0x20d993){var _0x1248f8=_0x73d2('0x7b')+_0x20d993[_0x73d2('0x24')]['ContactId'];return db[_0x73d2('0x7c')][_0x73d2('0x42')](_0x1248f8,{'type':db['Sequelize'][_0x73d2('0x67')][_0x73d2('0x68')],'raw':!![]})['then'](function(_0x334d8e){return _0x334d8e;});})[_0x73d2('0x1c')](function(_0x4b66ca){if(_0x4b66ca){_0x47e87f[_0x73d2('0x24')][_0x73d2('0x69')]=_0x4b66ca[0x0];if(!_0x25d802[_0x73d2('0x55')]['UserId'])return;return db[_0x73d2('0x6a')][_0x73d2('0x56')]({'where':{'id':_0x25d802[_0x73d2('0x55')][_0x73d2('0x5a')],'role':'agent'},'attributes':['id','name',_0x73d2('0x6b'),_0x73d2('0x6c'),_0x73d2('0x6d')],'raw':!![]});}return null;})[_0x73d2('0x1c')](function(_0x112c9b){if(!_0x112c9b)return null;_0x47e87f[_0x73d2('0x24')]['agent']=_0x112c9b;return _0x47e87f;})[_0x73d2('0x1c')](function(_0x44915f){if(_0x44915f){_0x44915f[_0x73d2('0x24')][_0x73d2('0x6e')]=util['format'](_0x73d2('0x70'),_0x25d802[_0x73d2('0x5b')][_0x73d2('0x36')]);_0x44915f[_0x73d2('0x24')][_0x73d2('0x71')]=_0x47e87f[_0x73d2('0x71')];_0x44915f['message']['motionChannel']=_0x47e87f[_0x73d2('0x71')];_0x44915f['message'][_0x73d2('0x7d')]=_0x73d2('0x30');respondWithRpcPromise(_0x73d2('0x73'),_0x73d2('0x73'),{'event':'rejectmessage','message':_[_0x73d2('0x4e')](_0x47e87f['message'],JSON[_0x73d2('0x75')](_0x47e87f['interaction'][_0x73d2('0x76')]))},client9002);return _0x47e87f;}return null;})['then'](respondWithResult(_0x366efc,null))[_0x73d2('0x26')](handleError(_0x366efc,null));};
\ No newline at end of file
+var _0xa4ce=['../../config/license/util','redis','defaults','localhost','socket.io-emitter','http','request','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','ChatMessage','includeAll','include','findAll','show','params','find','create','update','body','describe','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','isNil','read1stAt','interaction','get','role','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','agent','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','chat-interactions','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','User','internal','formData','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2abd7c,_0x4b708b){var _0xdad63b=function(_0x54d522){while(--_0x54d522){_0x2abd7c['push'](_0x2abd7c['shift']());}};_0xdad63b(++_0x4b708b);}(_0xa4ce,0x1ea));var _0xea4c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa4ce[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xea4c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea4c('0x1'));var jsonpatch=require(_0xea4c('0x2'));var rp=require(_0xea4c('0x3'));var moment=require(_0xea4c('0x4'));var BPromise=require(_0xea4c('0x5'));var Mustache=require('mustache');var util=require(_0xea4c('0x6'));var path=require('path');var sox=require(_0xea4c('0x7'));var csv=require(_0xea4c('0x8'));var ejs=require(_0xea4c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea4c('0xa'));var squel=require(_0xea4c('0xb'));var crypto=require(_0xea4c('0xc'));var jsforce=require(_0xea4c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xea4c('0x8'));var querystring=require(_0xea4c('0xe'));var Papa=require(_0xea4c('0xf'));var Redis=require(_0xea4c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xea4c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea4c('0x12'))(_0xea4c('0x13'));var utils=require(_0xea4c('0x14'));var config=require(_0xea4c('0x15'));var licenseUtil=require(_0xea4c('0x16'));var db=require('../../mysqldb')['db'];config[_0xea4c('0x17')]=_[_0xea4c('0x18')](config[_0xea4c('0x17')],{'host':_0xea4c('0x19'),'port':0x18eb});var socket=require(_0xea4c('0x1a'))(new Redis(config[_0xea4c('0x17')]));require('./chatMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xea4c('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0xea4c('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x5b844a,_0x5c300e,_0xeb6aad,_0xe01e1d){return new BPromise(function(_0x13b51b,_0x4d8978){var _0x8a34f9=_0xe01e1d||client;return _0x8a34f9[_0xea4c('0x1c')](_0x5b844a,_0xeb6aad)[_0xea4c('0x1d')](function(_0x32462f){logger[_0xea4c('0x1e')]('ChatMessage,\x20%s,\x20%s',_0x5c300e,'request\x20sent');logger[_0xea4c('0x1f')](_0xea4c('0x20'),_0x5c300e,_0xea4c('0x21'),JSON[_0xea4c('0x22')](_0x32462f));if(_0x32462f[_0xea4c('0x23')]){if(_0x32462f[_0xea4c('0x23')][_0xea4c('0x24')]===0x1f4){logger['error'](_0xea4c('0x25'),_0x5c300e,_0x32462f['error'][_0xea4c('0x26')]);return _0x4d8978(_0x32462f['error']['message']);}logger['error'](_0xea4c('0x25'),_0x5c300e,_0x32462f['error']['message']);return _0x13b51b(_0x32462f[_0xea4c('0x23')]['message']);}else{logger[_0xea4c('0x1e')](_0xea4c('0x25'),_0x5c300e,_0xea4c('0x21'));_0x13b51b(_0x32462f[_0xea4c('0x27')]['message']);}})[_0xea4c('0x28')](function(_0x2c4ea3){logger[_0xea4c('0x23')](_0xea4c('0x25'),_0x5c300e,_0x2c4ea3);_0x4d8978(_0x2c4ea3);});});}function respondWithStatusCode(_0x210422,_0x3479de){_0x3479de=_0x3479de||0xcc;return function(_0x4bcd9b){if(_0x4bcd9b){return _0x210422[_0xea4c('0x29')](_0x3479de);}return _0x210422[_0xea4c('0x2a')](_0x3479de)[_0xea4c('0x2b')]();};}function respondWithResult(_0x270935,_0x329262){_0x329262=_0x329262||0xc8;return function(_0x2d0aa9){if(_0x2d0aa9){return _0x270935['status'](_0x329262)[_0xea4c('0x2c')](_0x2d0aa9);}};}function respondWithFilteredResult(_0x5687b6,_0x3f4492){return function(_0x5042e0){if(_0x5042e0){var _0x18b593=typeof _0x3f4492[_0xea4c('0x2d')]===_0xea4c('0x2e')&&typeof _0x3f4492[_0xea4c('0x2f')]===_0xea4c('0x2e');var _0x465cb6=_0x5042e0[_0xea4c('0x30')];var _0x48b794=_0x18b593?0x0:_0x3f4492[_0xea4c('0x2d')];var _0x5c3c18=_0x18b593?_0x5042e0['count']:_0x3f4492[_0xea4c('0x2d')]+_0x3f4492[_0xea4c('0x2f')];var _0x597271;if(_0x5c3c18>=_0x465cb6){_0x5c3c18=_0x465cb6;_0x597271=0xc8;}else{_0x597271=0xce;}_0x5687b6[_0xea4c('0x2a')](_0x597271);return _0x5687b6['set'](_0xea4c('0x31'),_0x48b794+'-'+_0x5c3c18+'/'+_0x465cb6)['json'](_0x5042e0);}return null;};}function patchUpdates(_0xcd152a){return function(_0x8ad86f){try{jsonpatch[_0xea4c('0x32')](_0x8ad86f,_0xcd152a,!![]);}catch(_0x2a611a){return BPromise[_0xea4c('0x33')](_0x2a611a);}return _0x8ad86f[_0xea4c('0x34')]();};}function saveUpdates(_0x50e8a6,_0x144863){return function(_0x44956a){if(_0x44956a){return _0x44956a['update'](_0x50e8a6)[_0xea4c('0x1d')](function(_0x251a95){return _0x251a95;});}return null;};}function removeEntity(_0x1b1321,_0x170a50){return function(_0x2a4105){if(_0x2a4105){return _0x2a4105[_0xea4c('0x35')]()[_0xea4c('0x1d')](function(){_0x1b1321[_0xea4c('0x2a')](0xcc)[_0xea4c('0x2b')]();});}};}function handleEntityNotFound(_0x150316,_0x39844a){return function(_0x4bdb0d){if(!_0x4bdb0d){_0x150316[_0xea4c('0x29')](0x194);}return _0x4bdb0d;};}function handleError(_0x3c8d1,_0xf44f08){_0xf44f08=_0xf44f08||0x1f4;return function(_0x2b87e6){logger[_0xea4c('0x23')](_0x2b87e6[_0xea4c('0x36')]);if(_0x2b87e6['name']){delete _0x2b87e6[_0xea4c('0x37')];}_0x3c8d1[_0xea4c('0x2a')](_0xf44f08)[_0xea4c('0x38')](_0x2b87e6);};}exports['index']=function(_0x2ecd42,_0x2a2812){var _0x422b8d={},_0x4c3d43={},_0x16c262={'count':0x0,'rows':[]};var _0x7f4b21=_[_0xea4c('0x39')](db['ChatMessage'][_0xea4c('0x3a')],function(_0x28104a){return{'name':_0x28104a[_0xea4c('0x3b')],'type':_0x28104a[_0xea4c('0x3c')][_0xea4c('0x3d')]};});_0x4c3d43[_0xea4c('0x3e')]=_[_0xea4c('0x39')](_0x7f4b21,_0xea4c('0x37'));_0x4c3d43[_0xea4c('0x3f')]=_[_0xea4c('0x40')](_0x2ecd42[_0xea4c('0x3f')]);_0x4c3d43[_0xea4c('0x41')]=_[_0xea4c('0x42')](_0x4c3d43[_0xea4c('0x3e')],_0x4c3d43['query']);_0x422b8d[_0xea4c('0x43')]=_['intersection'](_0x4c3d43[_0xea4c('0x3e')],qs[_0xea4c('0x44')](_0x2ecd42[_0xea4c('0x3f')][_0xea4c('0x44')]));_0x422b8d[_0xea4c('0x43')]=_0x422b8d[_0xea4c('0x43')][_0xea4c('0x45')]?_0x422b8d[_0xea4c('0x43')]:_0x4c3d43[_0xea4c('0x3e')];if(!_0x2ecd42['query'][_0xea4c('0x46')]('nolimit')){_0x422b8d[_0xea4c('0x2f')]=qs[_0xea4c('0x2f')](_0x2ecd42['query'][_0xea4c('0x2f')]);_0x422b8d[_0xea4c('0x2d')]=qs[_0xea4c('0x2d')](_0x2ecd42['query']['offset']);}_0x422b8d[_0xea4c('0x47')]=qs[_0xea4c('0x48')](_0x2ecd42[_0xea4c('0x3f')]['sort']);_0x422b8d[_0xea4c('0x49')]=qs[_0xea4c('0x41')](_[_0xea4c('0x4a')](_0x2ecd42[_0xea4c('0x3f')],_0x4c3d43[_0xea4c('0x41')]),_0x7f4b21);if(_0x2ecd42[_0xea4c('0x3f')][_0xea4c('0x4b')]){_0x422b8d[_0xea4c('0x49')]=_[_0xea4c('0x4c')](_0x422b8d[_0xea4c('0x49')],{'$or':_['map'](_0x7f4b21,function(_0x8a96ad){if(_0x8a96ad[_0xea4c('0x3c')]!=='VIRTUAL'){var _0x2c2b51={};_0x2c2b51[_0x8a96ad[_0xea4c('0x37')]]={'$like':'%'+_0x2ecd42[_0xea4c('0x3f')]['filter']+'%'};return _0x2c2b51;}})});}_0x422b8d=_[_0xea4c('0x4c')]({},_0x422b8d,_0x2ecd42[_0xea4c('0x4d')]);var _0x595735={'where':_0x422b8d[_0xea4c('0x49')]};return db[_0xea4c('0x4e')][_0xea4c('0x30')](_0x595735)[_0xea4c('0x1d')](function(_0x14c3ab){_0x16c262[_0xea4c('0x30')]=_0x14c3ab;if(_0x2ecd42[_0xea4c('0x3f')][_0xea4c('0x4f')]){_0x422b8d[_0xea4c('0x50')]=[{'all':!![]}];}return db[_0xea4c('0x4e')][_0xea4c('0x51')](_0x422b8d);})['then'](function(_0x433b19){_0x16c262['rows']=_0x433b19;return _0x16c262;})[_0xea4c('0x1d')](respondWithFilteredResult(_0x2a2812,_0x422b8d))[_0xea4c('0x28')](handleError(_0x2a2812,null));};exports[_0xea4c('0x52')]=function(_0x4e1bbe,_0x2dc148){var _0x235960={'raw':!![],'where':{'id':_0x4e1bbe[_0xea4c('0x53')]['id']}},_0x3468d1={};_0x3468d1[_0xea4c('0x3e')]=_[_0xea4c('0x40')](db[_0xea4c('0x4e')][_0xea4c('0x3a')]);_0x3468d1[_0xea4c('0x3f')]=_['keys'](_0x4e1bbe[_0xea4c('0x3f')]);_0x3468d1[_0xea4c('0x41')]=_['intersection'](_0x3468d1[_0xea4c('0x3e')],_0x3468d1[_0xea4c('0x3f')]);_0x235960[_0xea4c('0x43')]=_[_0xea4c('0x42')](_0x3468d1[_0xea4c('0x3e')],qs[_0xea4c('0x44')](_0x4e1bbe[_0xea4c('0x3f')][_0xea4c('0x44')]));_0x235960[_0xea4c('0x43')]=_0x235960[_0xea4c('0x43')][_0xea4c('0x45')]?_0x235960[_0xea4c('0x43')]:_0x3468d1[_0xea4c('0x3e')];if(_0x4e1bbe[_0xea4c('0x3f')][_0xea4c('0x4f')]){_0x235960['include']=[{'all':!![]}];}_0x235960=_[_0xea4c('0x4c')]({},_0x235960,_0x4e1bbe['options']);return db['ChatMessage'][_0xea4c('0x54')](_0x235960)[_0xea4c('0x1d')](handleEntityNotFound(_0x2dc148,null))[_0xea4c('0x1d')](respondWithResult(_0x2dc148,null))[_0xea4c('0x28')](handleError(_0x2dc148,null));};exports[_0xea4c('0x55')]=function(_0x3506e4,_0x5309fe){return db['ChatMessage']['create'](_0x3506e4['body'],{})['then'](respondWithResult(_0x5309fe,0xc9))[_0xea4c('0x28')](handleError(_0x5309fe,null));};exports[_0xea4c('0x56')]=function(_0x4fd41c,_0x4914d9){if(_0x4fd41c[_0xea4c('0x57')]['id']){delete _0x4fd41c[_0xea4c('0x57')]['id'];}return db[_0xea4c('0x4e')]['find']({'where':{'id':_0x4fd41c[_0xea4c('0x53')]['id']}})[_0xea4c('0x1d')](handleEntityNotFound(_0x4914d9,null))[_0xea4c('0x1d')](saveUpdates(_0x4fd41c[_0xea4c('0x57')],null))[_0xea4c('0x1d')](respondWithResult(_0x4914d9,null))['catch'](handleError(_0x4914d9,null));};exports[_0xea4c('0x35')]=function(_0x7390cb,_0x39cc54){return db[_0xea4c('0x4e')][_0xea4c('0x54')]({'where':{'id':_0x7390cb[_0xea4c('0x53')]['id']}})[_0xea4c('0x1d')](handleEntityNotFound(_0x39cc54,null))[_0xea4c('0x1d')](removeEntity(_0x39cc54,null))[_0xea4c('0x28')](handleError(_0x39cc54,null));};exports['describe']=function(_0x37e048,_0x3103c3){return db['ChatMessage'][_0xea4c('0x58')]()[_0xea4c('0x1d')](respondWithResult(_0x3103c3,null))[_0xea4c('0x28')](handleError(_0x3103c3,null));};var interaction_log=require(_0xea4c('0x12'))('chat-interactions');exports['accept']=function(_0x4cd3a2,_0x48ddda,_0x5ba7b4){var _0x2d2d4d={'agent':{},'channel':_0xea4c('0x59')};if(_0x4cd3a2[_0xea4c('0x57')]['id']){delete _0x4cd3a2[_0xea4c('0x57')]['id'];}_0x4cd3a2[_0xea4c('0x57')][_0xea4c('0x5a')]=!![];_0x4cd3a2[_0xea4c('0x57')][_0xea4c('0x5b')]=moment()[_0xea4c('0x5c')](_0xea4c('0x5d'));_0x4cd3a2[_0xea4c('0x57')][_0xea4c('0x5e')]=_0x4cd3a2[_0xea4c('0x57')][_0xea4c('0x5e')]||_0x4cd3a2[_0xea4c('0x5f')]['id'];_0x2d2d4d['agent']['id']=_0x4cd3a2[_0xea4c('0x57')][_0xea4c('0x5e')];return db['ChatMessage'][_0xea4c('0x54')]({'where':{'id':_0x4cd3a2[_0xea4c('0x53')]['id'],'UserId':null}})[_0xea4c('0x1d')](handleEntityNotFound(_0x48ddda,null))[_0xea4c('0x1d')](saveUpdates(_0x4cd3a2[_0xea4c('0x57')],null))['then'](function(_0x4a1234){if(_0x4a1234){_0x2d2d4d[_0xea4c('0x26')]=_0x4a1234['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x4a1234['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x48ddda,null))[_0xea4c('0x1d')](function(_0x510978){if(_0x510978){return _0x510978[_0xea4c('0x56')]({'UserId':_0x4cd3a2[_0xea4c('0x57')]['UserId'],'read1stAt':_[_0xea4c('0x60')](_0x510978[_0xea4c('0x61')])?moment()['format'](_0xea4c('0x5d')):undefined});}return null;})[_0xea4c('0x1d')](function(_0x3a814c){if(_0x3a814c){_0x2d2d4d[_0xea4c('0x62')]=_0x3a814c[_0xea4c('0x63')]({'plain':!![]});interaction_log[_0xea4c('0x1e')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4cd3a2[_0xea4c('0x5f')]['id'],_0x4cd3a2[_0xea4c('0x5f')]['name'],_0x4cd3a2[_0xea4c('0x5f')][_0xea4c('0x64')],_0x2d2d4d[_0xea4c('0x62')]['id'],_0x4cd3a2[_0xea4c('0x57')]?JSON['stringify'](_0x4cd3a2[_0xea4c('0x57')]):_0xea4c('0x65'));return respondWithRpcPromise('AcceptMessage',_0xea4c('0x66'),_0x2d2d4d);}return null;})['then'](function(_0x251f46){var _0x3d8475='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x251f46[_0xea4c('0x26')][_0xea4c('0x67')];return db[_0xea4c('0x68')][_0xea4c('0x3f')](_0x3d8475,{'type':db[_0xea4c('0x69')][_0xea4c('0x6a')][_0xea4c('0x6b')],'raw':!![]})[_0xea4c('0x1d')](function(_0x18a5f3){return _0x18a5f3;});})[_0xea4c('0x1d')](function(_0x37d8da){if(_0x37d8da){_0x2d2d4d[_0xea4c('0x26')]['contact']=_0x37d8da[0x0];if(!_0x4cd3a2[_0xea4c('0x57')][_0xea4c('0x5e')])return;return db['User'][_0xea4c('0x54')]({'where':{'id':_0x4cd3a2[_0xea4c('0x57')]['UserId'],'role':'agent'},'attributes':['id',_0xea4c('0x37'),_0xea4c('0x6c'),'email','internal'],'raw':!![]});}return null;})[_0xea4c('0x1d')](function(_0x31e41d){if(!_0x31e41d)return null;_0x2d2d4d[_0xea4c('0x26')][_0xea4c('0x6d')]=_0x31e41d;return _0x2d2d4d;})['then'](function(_0x34fc6c){if(_0x34fc6c){if(_0x4cd3a2[_0xea4c('0x57')][_0xea4c('0x6e')]){_0x2d2d4d[_0xea4c('0x26')][_0xea4c('0x6f')]=util[_0xea4c('0x5c')](_0xea4c('0x70'),_0x4cd3a2[_0xea4c('0x5f')][_0xea4c('0x37')]);_0x2d2d4d[_0xea4c('0x26')][_0xea4c('0x71')]=_0x2d2d4d['channel'];_0x2d2d4d[_0xea4c('0x26')][_0xea4c('0x72')]=_0x2d2d4d[_0xea4c('0x71')];_0x2d2d4d[_0xea4c('0x26')][_0xea4c('0x73')]='accept';return respondWithRpcPromise(_0xea4c('0x74'),_0xea4c('0x74'),{'event':_0xea4c('0x75'),'message':_[_0xea4c('0x4c')](_0x2d2d4d[_0xea4c('0x26')],JSON[_0xea4c('0x76')](_0x2d2d4d[_0xea4c('0x62')]['formData']))},client9002)[_0xea4c('0x1d')](function(){return _0x2d2d4d;});}return _0x2d2d4d;}return null;})[_0xea4c('0x1d')](respondWithResult(_0x48ddda,null))[_0xea4c('0x28')](handleError(_0x48ddda,null));};var interaction_log=require('../../config/logger')(_0xea4c('0x77'));exports['reject']=function(_0x4cf9f3,_0x5aca16,_0x5ac821){var _0x47f7a3={'agent':{},'channel':_0xea4c('0x59')};if(_0x4cf9f3['body']['id']){delete _0x4cf9f3[_0xea4c('0x57')]['id'];}_0x4cf9f3['body'][_0xea4c('0x5e')]=_0x4cf9f3[_0xea4c('0x57')][_0xea4c('0x5e')]||_0x4cf9f3[_0xea4c('0x5f')]['id'];_0x47f7a3[_0xea4c('0x6d')]['id']=_0x4cf9f3[_0xea4c('0x57')]['UserId'];return db[_0xea4c('0x4e')][_0xea4c('0x54')]({'where':{'id':_0x4cf9f3['params']['id'],'UserId':null}})[_0xea4c('0x1d')](handleEntityNotFound(_0x5aca16,null))[_0xea4c('0x1d')](function(_0x237153){if(_0x237153){_0x47f7a3[_0xea4c('0x26')]=_0x237153[_0xea4c('0x63')]({'plain':!![]});return db[_0xea4c('0x78')][_0xea4c('0x54')]({'where':{'id':_0x237153['ChatInteractionId']}});}return null;})[_0xea4c('0x1d')](handleEntityNotFound(_0x5aca16,null))[_0xea4c('0x1d')](function(_0x2d9ad7){if(_0x2d9ad7){_0x47f7a3['interaction']=_0x2d9ad7[_0xea4c('0x63')]({'plain':!![]});interaction_log[_0xea4c('0x1e')](_0xea4c('0x79'),_0x4cf9f3['user']['id'],_0x4cf9f3['user'][_0xea4c('0x37')],_0x4cf9f3[_0xea4c('0x5f')]['role'],_0x47f7a3['interaction']['id'],_0x4cf9f3[_0xea4c('0x57')]?JSON[_0xea4c('0x22')](_0x4cf9f3['body']):_0xea4c('0x65'));return respondWithRpcPromise(_0xea4c('0x7a'),_0xea4c('0x7b'),_0x47f7a3);}return null;})[_0xea4c('0x1d')](function(_0x2f7b3f){var _0x2c3969='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2f7b3f[_0xea4c('0x26')][_0xea4c('0x67')];return db['sequelize']['query'](_0x2c3969,{'type':db[_0xea4c('0x69')]['QueryTypes'][_0xea4c('0x6b')],'raw':!![]})['then'](function(_0x130062){return _0x130062;});})[_0xea4c('0x1d')](function(_0x1ec449){if(_0x1ec449){_0x47f7a3[_0xea4c('0x26')][_0xea4c('0x7c')]=_0x1ec449[0x0];if(!_0x4cf9f3[_0xea4c('0x57')][_0xea4c('0x5e')])return;return db[_0xea4c('0x7d')][_0xea4c('0x54')]({'where':{'id':_0x4cf9f3['body'][_0xea4c('0x5e')],'role':_0xea4c('0x6d')},'attributes':['id',_0xea4c('0x37'),_0xea4c('0x6c'),'email',_0xea4c('0x7e')],'raw':!![]});}return null;})[_0xea4c('0x1d')](function(_0x329461){if(!_0x329461)return null;_0x47f7a3[_0xea4c('0x26')][_0xea4c('0x6d')]=_0x329461;return _0x47f7a3;})[_0xea4c('0x1d')](function(_0x51861f){if(_0x51861f){_0x51861f[_0xea4c('0x26')][_0xea4c('0x6f')]=util[_0xea4c('0x5c')]('SIP/%s',_0x4cf9f3['user'][_0xea4c('0x37')]);_0x51861f['message'][_0xea4c('0x71')]=_0x47f7a3[_0xea4c('0x71')];_0x51861f['message'][_0xea4c('0x72')]=_0x47f7a3[_0xea4c('0x71')];_0x51861f[_0xea4c('0x26')][_0xea4c('0x73')]=_0xea4c('0x33');respondWithRpcPromise('EventManager',_0xea4c('0x74'),{'event':'rejectmessage','message':_[_0xea4c('0x4c')](_0x47f7a3[_0xea4c('0x26')],JSON[_0xea4c('0x76')](_0x47f7a3[_0xea4c('0x62')][_0xea4c('0x7f')]))},client9002);return _0x47f7a3;}return null;})[_0xea4c('0x1d')](respondWithResult(_0x5aca16,null))['catch'](handleError(_0x5aca16,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 0c78361..3201fd3 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 _0x5aa1=['ChatMessage','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5aa1,0x182));var _0x15aa=function(_0xa650fb,_0x104a00){_0xa650fb=_0xa650fb-0x0;var _0x99f4de=_0x5aa1[_0xa650fb];return _0x99f4de;};'use strict';var EventEmitter=require(_0x15aa('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x15aa('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x15aa('0x2'),'afterUpdate':_0x15aa('0x3'),'afterDestroy':_0x15aa('0x4')};function emitEvent(_0xad9fec){return function(_0x23b41d,_0x5b1eb7,_0x429ddc){ChatMessageEvents[_0x15aa('0x5')](_0xad9fec+':'+_0x23b41d['id'],_0x23b41d);ChatMessageEvents[_0x15aa('0x5')](_0xad9fec,_0x23b41d);_0x429ddc(null);};}for(var e in events){if(events[_0x15aa('0x6')](e)){var event=events[e];ChatMessage[_0x15aa('0x7')](e,emitEvent(event));}}module[_0x15aa('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x6a93=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','exports'];(function(_0x5d92d2,_0x399d73){var _0x5e6d11=function(_0x5029a2){while(--_0x5029a2){_0x5d92d2['push'](_0x5d92d2['shift']());}};_0x5e6d11(++_0x399d73);}(_0x6a93,0x180));var _0x36a9=function(_0x5a2415,_0x2db878){_0x5a2415=_0x5a2415-0x0;var _0x55ad6e=_0x6a93[_0x5a2415];return _0x55ad6e;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x36a9('0x0'))['db'][_0x36a9('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x36a9('0x2')](0x0);var events={'afterCreate':_0x36a9('0x3'),'afterUpdate':_0x36a9('0x4'),'afterDestroy':_0x36a9('0x5')};function emitEvent(_0x35bee4){return function(_0x4930cb,_0x5abd46,_0x4b511d){ChatMessageEvents['emit'](_0x35bee4+':'+_0x4930cb['id'],_0x4930cb);ChatMessageEvents[_0x36a9('0x6')](_0x35bee4,_0x4930cb);_0x4b511d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x36a9('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index d36b6dc..07fcb1a 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 _0x3f25=['request-promise','rimraf','./chatMessage.attributes','ChatMessage','chat_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x43b5a7,_0xf5e3d6){var _0x5461fe=function(_0x5d9d5a){while(--_0x5d9d5a){_0x43b5a7['push'](_0x43b5a7['shift']());}};_0x5461fe(++_0xf5e3d6);}(_0x3f25,0xd5));var _0x53f2=function(_0xb3f5d1,_0x38345c){_0xb3f5d1=_0xb3f5d1-0x0;var _0xf256ee=_0x3f25[_0xb3f5d1];return _0xf256ee;};'use strict';var _=require('lodash');var util=require(_0x53f2('0x0'));var logger=require(_0x53f2('0x1'))(_0x53f2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x53f2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53f2('0x4'));var config=require('../../config/environment');var attributes=require(_0x53f2('0x5'));module['exports']=function(_0x172705,_0x1a7ba3){return _0x172705['define'](_0x53f2('0x6'),attributes,{'tableName':_0x53f2('0x7'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x53f2('0x8')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5bf2cb,_0x3f9669,_0x420fad){var _0x4621b8=_0x172705[_0x53f2('0x9')];var _0x511e48=_0x5bf2cb[_0x53f2('0xa')]({'plain':!![]});if(_0x511e48[_0x53f2('0xb')][_0x53f2('0xc')]()==='in'||_0x511e48['direction']['toLowerCase']()===_0x53f2('0xd')&&!_0x511e48['secret']&&!_[_0x53f2('0xe')](_0x511e48[_0x53f2('0xf')])){_0x4621b8[_0x53f2('0x10')][_0x53f2('0x11')]({'where':{'id':_0x511e48[_0x53f2('0x12')]}})[_0x53f2('0x13')](function(_0x357955){if(_0x357955){_0x357955['update']({'lastMsgAt':_0x511e48['createdAt'],'lastMsgDirection':_0x511e48['direction'][_0x53f2('0xc')]()});}})[_0x53f2('0x14')](function(_0x3d978f){console[_0x53f2('0x15')](_0x3d978f);});}_0x420fad();}},'charset':_0x53f2('0x16'),'collate':_0x53f2('0x17')});};
\ No newline at end of file
+var _0x177a=['secret','isNil','UserId','ChatInteraction','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out'];(function(_0x44c768,_0x552a5e){var _0x55daf5=function(_0x4958e8){while(--_0x4958e8){_0x44c768['push'](_0x44c768['shift']());}};_0x55daf5(++_0x552a5e);}(_0x177a,0xdd));var _0xa177=function(_0x51536f,_0x178a8b){_0x51536f=_0x51536f-0x0;var _0x89d943=_0x177a[_0x51536f];return _0x89d943;};'use strict';var _=require(_0xa177('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa177('0x1'));var moment=require(_0xa177('0x2'));var BPromise=require(_0xa177('0x3'));var rp=require(_0xa177('0x4'));var fs=require('fs');var path=require(_0xa177('0x5'));var rimraf=require(_0xa177('0x6'));var config=require('../../config/environment');var attributes=require(_0xa177('0x7'));module[_0xa177('0x8')]=function(_0x1f37b0,_0x455737){return _0x1f37b0[_0xa177('0x9')](_0xa177('0xa'),attributes,{'tableName':_0xa177('0xb'),'paranoid':![],'indexes':[{'name':_0xa177('0xc'),'fields':['body'],'type':_0xa177('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x53d2ec,_0x2a8a12,_0x210ec5){var _0x4433d2=_0x1f37b0[_0xa177('0xe')];var _0x219c0c=_0x53d2ec[_0xa177('0xf')]({'plain':!![]});if(_0x219c0c[_0xa177('0x10')]['toLowerCase']()==='in'||_0x219c0c[_0xa177('0x10')][_0xa177('0x11')]()===_0xa177('0x12')&&!_0x219c0c[_0xa177('0x13')]&&!_[_0xa177('0x14')](_0x219c0c[_0xa177('0x15')])){_0x4433d2[_0xa177('0x16')]['findOne']({'where':{'id':_0x219c0c['ChatInteractionId']}})[_0xa177('0x17')](function(_0x198a92){if(_0x198a92){_0x198a92[_0xa177('0x18')]({'lastMsgAt':_0x219c0c[_0xa177('0x19')],'lastMsgDirection':_0x219c0c[_0xa177('0x10')][_0xa177('0x11')]()});}})[_0xa177('0x1a')](function(_0xbc9fa4){console[_0xa177('0x1b')](_0xbc9fa4);});}_0x210ec5();}},'charset':_0xa177('0x1c'),'collate':_0xa177('0x1d')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 6fbd86a..2d9cdd5 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 _0x520a=['info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','./chatMessage.socket','register','then'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x520a,0x1de));var _0xa520=function(_0x48b618,_0x7bff4a){_0x48b618=_0x48b618-0x0;var _0x508a99=_0x520a[_0x48b618];return _0x508a99;};'use strict';var _=require(_0xa520('0x0'));var util=require(_0xa520('0x1'));var moment=require(_0xa520('0x2'));var BPromise=require(_0xa520('0x3'));var rs=require(_0xa520('0x4'));var fs=require('fs');var Redis=require(_0xa520('0x5'));var db=require(_0xa520('0x6'))['db'];var utils=require(_0xa520('0x7'));var logger=require(_0xa520('0x8'))(_0xa520('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa520('0xa')]({'port':0x232a});config[_0xa520('0xb')]=_[_0xa520('0xc')](config['redis'],{'host':_0xa520('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa520('0xb')]));require(_0xa520('0xe'))[_0xa520('0xf')](socket);function respondWithRpcPromise(_0x14384d,_0x43dc70,_0xd07eec){return new BPromise(function(_0x310a3f,_0x38c6f6){return client['request'](_0x14384d,_0xd07eec)[_0xa520('0x10')](function(_0x2c5ae2){logger[_0xa520('0x11')](_0xa520('0x12'),_0x43dc70,_0xa520('0x13'));logger[_0xa520('0x14')](_0xa520('0x15'),_0x43dc70,_0xa520('0x13'),JSON[_0xa520('0x16')](_0x2c5ae2));if(_0x2c5ae2[_0xa520('0x17')]){if(_0x2c5ae2[_0xa520('0x17')]['code']===0x1f4){logger[_0xa520('0x17')](_0xa520('0x12'),_0x43dc70,_0x2c5ae2[_0xa520('0x17')]['message']);return _0x38c6f6(_0x2c5ae2[_0xa520('0x17')][_0xa520('0x18')]);}logger['error'](_0xa520('0x12'),_0x43dc70,_0x2c5ae2['error'][_0xa520('0x18')]);return _0x310a3f(_0x2c5ae2[_0xa520('0x17')][_0xa520('0x18')]);}else{logger[_0xa520('0x11')](_0xa520('0x12'),_0x43dc70,'request\x20sent');_0x310a3f(_0x2c5ae2[_0xa520('0x19')][_0xa520('0x18')]);}})[_0xa520('0x1a')](function(_0x597f84){logger[_0xa520('0x17')]('ChatMessage,\x20%s,\x20%s',_0x43dc70,_0x597f84);_0x38c6f6(_0x597f84);});});}exports['CreateChatMessage']=function(_0x58e687){var _0x353eab=this;return new Promise(function(_0x438080,_0x4e5aa5){return db[_0xa520('0x1b')][_0xa520('0x1c')](_0x58e687[_0xa520('0x1d')],{'raw':_0x58e687[_0xa520('0x1e')]?_0x58e687[_0xa520('0x1e')][_0xa520('0x1f')]===undefined?!![]:![]:!![]})[_0xa520('0x10')](function(_0x17ed1c){logger[_0xa520('0x11')](_0xa520('0x20'),_0x58e687);logger[_0xa520('0x14')](_0xa520('0x20'),_0x58e687,JSON[_0xa520('0x16')](_0x17ed1c));_0x438080(_0x17ed1c);})[_0xa520('0x1a')](function(_0x4e5f52){logger[_0xa520('0x17')](_0xa520('0x20'),_0x4e5f52[_0xa520('0x18')],_0x58e687);_0x4e5aa5(_0x353eab[_0xa520('0x17')](0x1f4,_0x4e5f52[_0xa520('0x18')]));});});};
\ No newline at end of file
+var _0x5831=['body','options','raw','CreateChatMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x242b3d,_0x17ad58){var _0x34958f=function(_0x3a75b7){while(--_0x3a75b7){_0x242b3d['push'](_0x242b3d['shift']());}};_0x34958f(++_0x17ad58);}(_0x5831,0x8c));var _0x1583=function(_0xfd9b19,_0x21d75f){_0xfd9b19=_0xfd9b19-0x0;var _0x514918=_0x5831[_0xfd9b19];return _0x514918;};'use strict';var _=require(_0x1583('0x0'));var util=require(_0x1583('0x1'));var moment=require(_0x1583('0x2'));var BPromise=require(_0x1583('0x3'));var rs=require(_0x1583('0x4'));var fs=require('fs');var Redis=require(_0x1583('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1583('0x6'));var logger=require(_0x1583('0x7'))(_0x1583('0x8'));var config=require('../../config/environment');var jayson=require(_0x1583('0x9'));var client=jayson[_0x1583('0xa')][_0x1583('0xb')]({'port':0x232a});config[_0x1583('0xc')]=_[_0x1583('0xd')](config[_0x1583('0xc')],{'host':_0x1583('0xe'),'port':0x18eb});var socket=require(_0x1583('0xf'))(new Redis(config[_0x1583('0xc')]));require(_0x1583('0x10'))[_0x1583('0x11')](socket);function respondWithRpcPromise(_0x53205a,_0x33df2c,_0x1eea64){return new BPromise(function(_0x4a017b,_0x3e4e78){return client[_0x1583('0x12')](_0x53205a,_0x1eea64)[_0x1583('0x13')](function(_0x1c95d9){logger[_0x1583('0x14')](_0x1583('0x15'),_0x33df2c,_0x1583('0x16'));logger['debug'](_0x1583('0x17'),_0x33df2c,_0x1583('0x16'),JSON[_0x1583('0x18')](_0x1c95d9));if(_0x1c95d9['error']){if(_0x1c95d9[_0x1583('0x19')][_0x1583('0x1a')]===0x1f4){logger[_0x1583('0x19')](_0x1583('0x15'),_0x33df2c,_0x1c95d9[_0x1583('0x19')]['message']);return _0x3e4e78(_0x1c95d9[_0x1583('0x19')]['message']);}logger[_0x1583('0x19')](_0x1583('0x15'),_0x33df2c,_0x1c95d9[_0x1583('0x19')][_0x1583('0x1b')]);return _0x4a017b(_0x1c95d9['error'][_0x1583('0x1b')]);}else{logger[_0x1583('0x14')](_0x1583('0x15'),_0x33df2c,_0x1583('0x16'));_0x4a017b(_0x1c95d9[_0x1583('0x1c')][_0x1583('0x1b')]);}})[_0x1583('0x1d')](function(_0x4bc6cb){logger[_0x1583('0x19')]('ChatMessage,\x20%s,\x20%s',_0x33df2c,_0x4bc6cb);_0x3e4e78(_0x4bc6cb);});});}exports['CreateChatMessage']=function(_0x76c34c){var _0x9e2709=this;return new Promise(function(_0x50206d,_0x464721){return db['ChatMessage']['create'](_0x76c34c[_0x1583('0x1e')],{'raw':_0x76c34c[_0x1583('0x1f')]?_0x76c34c['options'][_0x1583('0x20')]===undefined?!![]:![]:!![]})[_0x1583('0x13')](function(_0x2f9ed7){logger[_0x1583('0x14')](_0x1583('0x21'),_0x76c34c);logger['debug'](_0x1583('0x21'),_0x76c34c,JSON[_0x1583('0x18')](_0x2f9ed7));_0x50206d(_0x2f9ed7);})[_0x1583('0x1d')](function(_0x370904){logger[_0x1583('0x19')](_0x1583('0x21'),_0x370904[_0x1583('0x1b')],_0x76c34c);_0x464721(_0x9e2709['error'](0x1f4,_0x370904['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index ebed664..d593bd6 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 _0x2975=['update','removeListener','register','length','chatMessage:','save','remove'];(function(_0x4faab0,_0x544bf3){var _0x5b1f25=function(_0xf5d089){while(--_0xf5d089){_0x4faab0['push'](_0x4faab0['shift']());}};_0x5b1f25(++_0x544bf3);}(_0x2975,0x1c5));var _0x5297=function(_0x413db5,_0x556640){_0x413db5=_0x413db5-0x0;var _0x172bb9=_0x2975[_0x413db5];return _0x172bb9;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5297('0x0'),_0x5297('0x1'),_0x5297('0x2')];function createListener(_0x1a511b,_0x115e60){return function(_0x178801){_0x115e60['emit'](_0x1a511b,_0x178801);};}function removeListener(_0x56371f,_0x5e9de3){return function(){ChatMessageEvents[_0x5297('0x3')](_0x56371f,_0x5e9de3);};}exports[_0x5297('0x4')]=function(_0x11a43d){for(var _0x3da9c6=0x0,_0x4d1d2c=events[_0x5297('0x5')];_0x3da9c6<_0x4d1d2c;_0x3da9c6++){var _0x1b72a7=events[_0x3da9c6];var _0x4f12b0=createListener(_0x5297('0x6')+_0x1b72a7,_0x11a43d);ChatMessageEvents['on'](_0x1b72a7,_0x4f12b0);}};
\ No newline at end of file
+var _0x43fd=['register','length','save','emit','removeListener'];(function(_0x1e05a9,_0x2e529a){var _0x5be255=function(_0x54c279){while(--_0x54c279){_0x1e05a9['push'](_0x1e05a9['shift']());}};_0x5be255(++_0x2e529a);}(_0x43fd,0x1ec));var _0xd43f=function(_0x538ae2,_0xbff0ca){_0x538ae2=_0x538ae2-0x0;var _0x137049=_0x43fd[_0x538ae2];return _0x137049;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xd43f('0x0'),'remove','update'];function createListener(_0x316ee5,_0x1ead65){return function(_0x484615){_0x1ead65[_0xd43f('0x1')](_0x316ee5,_0x484615);};}function removeListener(_0x48f953,_0x3c2af1){return function(){ChatMessageEvents[_0xd43f('0x2')](_0x48f953,_0x3c2af1);};}exports[_0xd43f('0x3')]=function(_0x33ddff){for(var _0x52e75f=0x0,_0xde214d=events[_0xd43f('0x4')];_0x52e75f<_0xde214d;_0x52e75f++){var _0x20ccd7=events[_0x52e75f];var _0x331163=createListener('chatMessage:'+_0x20ccd7,_0x33ddff);ChatMessageEvents['on'](_0x20ccd7,_0x331163);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 00de4b5..b82bb55 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 _0x844f=['/:id','show','tracked','chat','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe'];(function(_0x38c59b,_0x58b8f4){var _0x40fc09=function(_0xae103d){while(--_0xae103d){_0x38c59b['push'](_0x38c59b['shift']());}};_0x40fc09(++_0x58b8f4);}(_0x844f,0x89));var _0xf844=function(_0x5d7686,_0x5d11b1){_0x5d7686=_0x5d7686-0x0;var _0x408ab4=_0x844f[_0x5d7686];return _0x408ab4;};'use strict';var multer=require(_0xf844('0x0'));var util=require(_0xf844('0x1'));var path=require(_0xf844('0x2'));var timeout=require(_0xf844('0x3'));var express=require('express');var router=express[_0xf844('0x4')]();var fs_extra=require(_0xf844('0x5'));var auth=require(_0xf844('0x6'));var interaction=require(_0xf844('0x7'));var config=require(_0xf844('0x8'));var controller=require(_0xf844('0x9'));router[_0xf844('0xa')]('/',auth[_0xf844('0xb')](),controller['index']);router[_0xf844('0xa')](_0xf844('0xc'),auth[_0xf844('0xb')](),controller['describe']);router[_0xf844('0xa')](_0xf844('0xd'),auth[_0xf844('0xb')](),controller[_0xf844('0xe')]);router['post']('/',auth[_0xf844('0xb')](),interaction[_0xf844('0xf')](_0xf844('0x10'),_0xf844('0x11')),controller[_0xf844('0x12')]);router[_0xf844('0x13')](_0xf844('0xd'),controller['update']);router[_0xf844('0x13')](_0xf844('0x14'),auth[_0xf844('0xb')](),controller[_0xf844('0x15')]);router['put'](_0xf844('0x16'),auth[_0xf844('0xb')](),controller['reject']);router[_0xf844('0x17')](_0xf844('0xd'),auth[_0xf844('0xb')](),controller['destroy']);module[_0xf844('0x18')]=router;
\ No newline at end of file
+var _0x0e51=['chat','chatmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','isAuthenticated','/:id','show','tracked'];(function(_0x16efb2,_0x59077a){var _0x147206=function(_0xc79a3f){while(--_0xc79a3f){_0x16efb2['push'](_0x16efb2['shift']());}};_0x147206(++_0x59077a);}(_0x0e51,0xe3));var _0x10e5=function(_0x327a56,_0x1e2a01){_0x327a56=_0x327a56-0x0;var _0xf93156=_0x0e51[_0x327a56];return _0xf93156;};'use strict';var multer=require(_0x10e5('0x0'));var util=require(_0x10e5('0x1'));var path=require(_0x10e5('0x2'));var timeout=require(_0x10e5('0x3'));var express=require(_0x10e5('0x4'));var router=express['Router']();var fs_extra=require(_0x10e5('0x5'));var auth=require(_0x10e5('0x6'));var interaction=require(_0x10e5('0x7'));var config=require(_0x10e5('0x8'));var controller=require(_0x10e5('0x9'));router[_0x10e5('0xa')]('/',auth['isAuthenticated'](),controller[_0x10e5('0xb')]);router[_0x10e5('0xa')]('/describe',auth[_0x10e5('0xc')](),controller['describe']);router[_0x10e5('0xa')](_0x10e5('0xd'),auth[_0x10e5('0xc')](),controller[_0x10e5('0xe')]);router['post']('/',auth[_0x10e5('0xc')](),interaction[_0x10e5('0xf')](_0x10e5('0x10'),_0x10e5('0x11')),controller[_0x10e5('0x12')]);router[_0x10e5('0x13')](_0x10e5('0xd'),controller[_0x10e5('0x14')]);router[_0x10e5('0x13')](_0x10e5('0x15'),auth['isAuthenticated'](),controller[_0x10e5('0x16')]);router[_0x10e5('0x13')]('/:id/reject',auth['isAuthenticated'](),controller[_0x10e5('0x17')]);router[_0x10e5('0x18')](_0x10e5('0xd'),auth['isAuthenticated'](),controller[_0x10e5('0x19')]);module[_0x10e5('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 05ee19e..61c4739 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 _0x86eb=['exports','TEXT','medium','sequelize'];(function(_0x456632,_0x4ed53a){var _0x333f66=function(_0x53aafb){while(--_0x53aafb){_0x456632['push'](_0x456632['shift']());}};_0x333f66(++_0x4ed53a);}(_0x86eb,0x123));var _0xb86e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x86eb[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xb86e('0x0'));module[_0xb86e('0x1')]={'body':{'type':Sequelize[_0xb86e('0x2')](_0xb86e('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x1a68=['TEXT','medium','sequelize','exports'];(function(_0x57b5bf,_0x1e45ed){var _0x1c2194=function(_0x242a1f){while(--_0x242a1f){_0x57b5bf['push'](_0x57b5bf['shift']());}};_0x1c2194(++_0x1e45ed);}(_0x1a68,0x19a));var _0x81a6=function(_0x6422b2,_0x3107fc){_0x6422b2=_0x6422b2-0x0;var _0x41d0b4=_0x1a68[_0x6422b2];return _0x41d0b4;};'use strict';var Sequelize=require(_0x81a6('0x0'));module[_0x81a6('0x1')]={'body':{'type':Sequelize[_0x81a6('0x2')](_0x81a6('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 8c3aaff..2fcf7b9 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(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x7a54,0x106));var _0x47a5=function(_0x211a97,_0x368b9e){_0x211a97=_0x211a97-0x0;var _0x466fe8=_0x7a54[_0x211a97];return _0x466fe8;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x3fd2fe,_0x410287){var _0x490b81=function(_0xb94835){while(--_0xb94835){_0x3fd2fe['push'](_0x3fd2fe['shift']());}};_0x490b81(++_0x410287);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 8081971..a747cc0 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 _0x300f=['chat_offline_messages','utf8mb4_unicode_ci','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x300f,0x1ca));var _0xf300=function(_0x153caa,_0xa8bfc3){_0x153caa=_0x153caa-0x0;var _0x53055a=_0x300f[_0x153caa];return _0x53055a;};'use strict';var _=require('lodash');var util=require(_0xf300('0x0'));var logger=require('../../config/logger')(_0xf300('0x1'));var moment=require('moment');var BPromise=require(_0xf300('0x2'));var rp=require(_0xf300('0x3'));var fs=require('fs');var path=require(_0xf300('0x4'));var rimraf=require(_0xf300('0x5'));var config=require(_0xf300('0x6'));var attributes=require(_0xf300('0x7'));module[_0xf300('0x8')]=function(_0x4001e2,_0x614d23){return _0x4001e2[_0xf300('0x9')]('ChatOfflineMessage',attributes,{'tableName':_0xf300('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf300('0xb')});};
\ No newline at end of file
+var _0xb2c7=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./chatOfflineMessage.attributes','define','chat_offline_messages'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xb2c7,0x199));var _0x7b2c=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xb2c7[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require(_0x7b2c('0x0'));var logger=require(_0x7b2c('0x1'))('api');var moment=require(_0x7b2c('0x2'));var BPromise=require(_0x7b2c('0x3'));var rp=require(_0x7b2c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7b2c('0x5'));var attributes=require(_0x7b2c('0x6'));module['exports']=function(_0x3872cf,_0x4b47c6){return _0x3872cf[_0x7b2c('0x7')]('ChatOfflineMessage',attributes,{'tableName':_0x7b2c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b2c('0x9'),'collate':_0x7b2c('0xa')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 07c60e4..81800f0 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 _0x372b=['info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x372b,0x18a));var _0xb372=function(_0x24e3f0,_0x3086cb){_0x24e3f0=_0x24e3f0-0x0;var _0x1bace1=_0x372b[_0x24e3f0];return _0x1bace1;};'use strict';var _=require(_0xb372('0x0'));var util=require(_0xb372('0x1'));var moment=require('moment');var BPromise=require(_0xb372('0x2'));var rs=require(_0xb372('0x3'));var fs=require('fs');var Redis=require(_0xb372('0x4'));var db=require(_0xb372('0x5'))['db'];var utils=require(_0xb372('0x6'));var logger=require(_0xb372('0x7'))('rpc');var config=require(_0xb372('0x8'));var jayson=require(_0xb372('0x9'));var client=jayson[_0xb372('0xa')][_0xb372('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39c4ac,_0x3a83ed,_0x1a6925){return new BPromise(function(_0x6a7a15,_0xefe498){return client[_0xb372('0xc')](_0x39c4ac,_0x1a6925)[_0xb372('0xd')](function(_0xf42a9b){logger['info'](_0xb372('0xe'),_0x3a83ed,_0xb372('0xf'));logger['debug'](_0xb372('0x10'),_0x3a83ed,_0xb372('0xf'),JSON['stringify'](_0xf42a9b));if(_0xf42a9b[_0xb372('0x11')]){if(_0xf42a9b[_0xb372('0x11')][_0xb372('0x12')]===0x1f4){logger['error'](_0xb372('0xe'),_0x3a83ed,_0xf42a9b[_0xb372('0x11')][_0xb372('0x13')]);return _0xefe498(_0xf42a9b[_0xb372('0x11')][_0xb372('0x13')]);}logger[_0xb372('0x11')](_0xb372('0xe'),_0x3a83ed,_0xf42a9b['error'][_0xb372('0x13')]);return _0x6a7a15(_0xf42a9b[_0xb372('0x11')]['message']);}else{logger[_0xb372('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3a83ed,_0xb372('0xf'));_0x6a7a15(_0xf42a9b[_0xb372('0x15')][_0xb372('0x13')]);}})[_0xb372('0x16')](function(_0x1704b6){logger['error'](_0xb372('0xe'),_0x3a83ed,_0x1704b6);_0xefe498(_0x1704b6);});});}
\ No newline at end of file
+var _0x5ad6=['catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message'];(function(_0x2a4f5a,_0x54f259){var _0x3eafc7=function(_0x486a2a){while(--_0x486a2a){_0x2a4f5a['push'](_0x2a4f5a['shift']());}};_0x3eafc7(++_0x54f259);}(_0x5ad6,0xfd));var _0x65ad=function(_0x9a8878,_0x2ef1b8){_0x9a8878=_0x9a8878-0x0;var _0x5f36a8=_0x5ad6[_0x9a8878];return _0x5f36a8;};'use strict';var _=require(_0x65ad('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x65ad('0x1'));var fs=require('fs');var Redis=require(_0x65ad('0x2'));var db=require(_0x65ad('0x3'))['db'];var utils=require(_0x65ad('0x4'));var logger=require(_0x65ad('0x5'))(_0x65ad('0x6'));var config=require(_0x65ad('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x65ad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a1d63,_0x8cbc9b,_0x369b83){return new BPromise(function(_0x356106,_0xb2b31b){return client[_0x65ad('0x9')](_0x5a1d63,_0x369b83)['then'](function(_0xdd871b){logger[_0x65ad('0xa')](_0x65ad('0xb'),_0x8cbc9b,'request\x20sent');logger[_0x65ad('0xc')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x8cbc9b,_0x65ad('0xd'),JSON[_0x65ad('0xe')](_0xdd871b));if(_0xdd871b[_0x65ad('0xf')]){if(_0xdd871b[_0x65ad('0xf')]['code']===0x1f4){logger[_0x65ad('0xf')](_0x65ad('0xb'),_0x8cbc9b,_0xdd871b[_0x65ad('0xf')]['message']);return _0xb2b31b(_0xdd871b['error'][_0x65ad('0x10')]);}logger[_0x65ad('0xf')](_0x65ad('0xb'),_0x8cbc9b,_0xdd871b['error'][_0x65ad('0x10')]);return _0x356106(_0xdd871b[_0x65ad('0xf')][_0x65ad('0x10')]);}else{logger['info'](_0x65ad('0xb'),_0x8cbc9b,_0x65ad('0xd'));_0x356106(_0xdd871b['result'][_0x65ad('0x10')]);}})[_0x65ad('0x11')](function(_0xfe8a42){logger['error'](_0x65ad('0xb'),_0x8cbc9b,_0xfe8a42);_0xb2b31b(_0xfe8a42);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index b1fa3ad..6927591 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 _0xc43d=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','show','post','put','/:id','update'];(function(_0x853aa8,_0x263572){var _0x171e8b=function(_0x58e1a0){while(--_0x58e1a0){_0x853aa8['push'](_0x853aa8['shift']());}};_0x171e8b(++_0x263572);}(_0xc43d,0xc6));var _0xdc43=function(_0x239dba,_0x309e95){_0x239dba=_0x239dba-0x0;var _0x1ceb11=_0xc43d[_0x239dba];return _0x1ceb11;};'use strict';var multer=require(_0xdc43('0x0'));var util=require(_0xdc43('0x1'));var path=require(_0xdc43('0x2'));var timeout=require(_0xdc43('0x3'));var express=require(_0xdc43('0x4'));var router=express[_0xdc43('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdc43('0x6'));var interaction=require(_0xdc43('0x7'));var config=require('../../config/environment');var controller=require(_0xdc43('0x8'));router[_0xdc43('0x9')]('/',auth[_0xdc43('0xa')](),controller['index']);router[_0xdc43('0x9')](_0xdc43('0xb'),auth[_0xdc43('0xa')](),controller[_0xdc43('0xc')]);router['get']('/:id',auth[_0xdc43('0xa')](),controller[_0xdc43('0xd')]);router[_0xdc43('0xe')]('/',auth[_0xdc43('0xa')](),controller['create']);router[_0xdc43('0xf')](_0xdc43('0x10'),auth[_0xdc43('0xa')](),controller[_0xdc43('0x11')]);router['delete'](_0xdc43('0x10'),auth[_0xdc43('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xfcb6=['/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','index','isAuthenticated','describe'];(function(_0x50e5b5,_0x5f29fe){var _0x1f3b00=function(_0x6c441b){while(--_0x6c441b){_0x50e5b5['push'](_0x50e5b5['shift']());}};_0x1f3b00(++_0x5f29fe);}(_0xfcb6,0x1ab));var _0x6fcb=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xfcb6[_0x1e7b16];return _0x37fadc;};'use strict';var multer=require(_0x6fcb('0x0'));var util=require(_0x6fcb('0x1'));var path=require(_0x6fcb('0x2'));var timeout=require(_0x6fcb('0x3'));var express=require(_0x6fcb('0x4'));var router=express[_0x6fcb('0x5')]();var fs_extra=require(_0x6fcb('0x6'));var auth=require(_0x6fcb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6fcb('0x8'));var controller=require(_0x6fcb('0x9'));router[_0x6fcb('0xa')]('/',auth['isAuthenticated'](),controller[_0x6fcb('0xb')]);router[_0x6fcb('0xa')]('/describe',auth[_0x6fcb('0xc')](),controller[_0x6fcb('0xd')]);router['get'](_0x6fcb('0xe'),auth['isAuthenticated'](),controller[_0x6fcb('0xf')]);router[_0x6fcb('0x10')]('/',auth[_0x6fcb('0xc')](),controller[_0x6fcb('0x11')]);router[_0x6fcb('0x12')](_0x6fcb('0xe'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x6fcb('0xc')](),controller[_0x6fcb('0x13')]);module[_0x6fcb('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index a8f5669..7e5cc25 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 _0x0d5b=['mouseOver','timeout','STRING'];(function(_0x3f32ca,_0x2212f2){var _0xf444d=function(_0x4b5b04){while(--_0x4b5b04){_0x3f32ca['push'](_0x3f32ca['shift']());}};_0xf444d(++_0x2212f2);}(_0x0d5b,0xa7));var _0xb0d5=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x0d5b[_0x4b2863];return _0x567d67;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb0d5('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xb0d5('0x1'),_0xb0d5('0x2')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xb0d5('0x0')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xdeba=['STRING','ENUM','mouseOver','INTEGER','exports'];(function(_0x554dbf,_0x30b7da){var _0x15a0fc=function(_0x338366){while(--_0x338366){_0x554dbf['push'](_0x554dbf['shift']());}};_0x15a0fc(++_0x30b7da);}(_0xdeba,0x9f));var _0xadeb=function(_0x5306f7,_0x474241){_0x5306f7=_0x5306f7-0x0;var _0x47ee7b=_0xdeba[_0x5306f7];return _0x47ee7b;};'use strict';var Sequelize=require('sequelize');module[_0xadeb('0x0')]={'name':{'type':Sequelize[_0xadeb('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xadeb('0x2')]('mouseOver','timeout'),'defaultValue':_0xadeb('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xadeb('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index a6e481f..d895b54 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 _0x3a0f=['send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','catch','create','body','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack'];(function(_0x427f79,_0xa9b4c){var _0x51e7a3=function(_0x396afe){while(--_0x396afe){_0x427f79['push'](_0x427f79['shift']());}};_0x51e7a3(++_0xa9b4c);}(_0x3a0f,0x145));var _0xf3a0=function(_0x13c2ce,_0x13bc0d){_0x13c2ce=_0x13c2ce-0x0;var _0xe4f616=_0x3a0f[_0x13c2ce];return _0xe4f616;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf3a0('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf3a0('0x1'));var BPromise=require(_0xf3a0('0x2'));var Mustache=require(_0xf3a0('0x3'));var util=require(_0xf3a0('0x4'));var path=require(_0xf3a0('0x5'));var sox=require(_0xf3a0('0x6'));var csv=require(_0xf3a0('0x7'));var ejs=require(_0xf3a0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf3a0('0x9'));var squel=require(_0xf3a0('0xa'));var crypto=require(_0xf3a0('0xb'));var jsforce=require(_0xf3a0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf3a0('0x7'));var querystring=require(_0xf3a0('0xd'));var Papa=require(_0xf3a0('0xe'));var Redis=require(_0xf3a0('0xf'));var authService=require(_0xf3a0('0x10'));var qs=require(_0xf3a0('0x11'));var as=require(_0xf3a0('0x12'));var hardwareService=require(_0xf3a0('0x13'));var logger=require('../../config/logger')(_0xf3a0('0x14'));var utils=require(_0xf3a0('0x15'));var config=require(_0xf3a0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3a0('0x17'))['db'];function respondWithStatusCode(_0x923225,_0x19e98c){_0x19e98c=_0x19e98c||0xcc;return function(_0x543728){if(_0x543728){return _0x923225['sendStatus'](_0x19e98c);}return _0x923225[_0xf3a0('0x18')](_0x19e98c)[_0xf3a0('0x19')]();};}function respondWithResult(_0x42522c,_0x426ef3){_0x426ef3=_0x426ef3||0xc8;return function(_0x49b5ff){if(_0x49b5ff){return _0x42522c[_0xf3a0('0x18')](_0x426ef3)[_0xf3a0('0x1a')](_0x49b5ff);}};}function respondWithFilteredResult(_0x34ec7c,_0x223336){return function(_0x2ff90a){if(_0x2ff90a){var _0x239a70=typeof _0x223336[_0xf3a0('0x1b')]===_0xf3a0('0x1c')&&typeof _0x223336['limit']==='undefined';var _0x1be8b9=_0x2ff90a[_0xf3a0('0x1d')];var _0x2c3eba=_0x239a70?0x0:_0x223336[_0xf3a0('0x1b')];var _0x3a47c1=_0x239a70?_0x2ff90a[_0xf3a0('0x1d')]:_0x223336['offset']+_0x223336['limit'];var _0x29d478;if(_0x3a47c1>=_0x1be8b9){_0x3a47c1=_0x1be8b9;_0x29d478=0xc8;}else{_0x29d478=0xce;}_0x34ec7c[_0xf3a0('0x18')](_0x29d478);return _0x34ec7c[_0xf3a0('0x1e')](_0xf3a0('0x1f'),_0x2c3eba+'-'+_0x3a47c1+'/'+_0x1be8b9)[_0xf3a0('0x1a')](_0x2ff90a);}return null;};}function patchUpdates(_0x4f36ae){return function(_0x57a94b){try{jsonpatch[_0xf3a0('0x20')](_0x57a94b,_0x4f36ae,!![]);}catch(_0x4bc714){return BPromise[_0xf3a0('0x21')](_0x4bc714);}return _0x57a94b[_0xf3a0('0x22')]();};}function saveUpdates(_0x307bd4,_0xa984f2){return function(_0x2de459){if(_0x2de459){return _0x2de459[_0xf3a0('0x23')](_0x307bd4)[_0xf3a0('0x24')](function(_0xe7926){return _0xe7926;});}return null;};}function removeEntity(_0x131ab4,_0x2a0955){return function(_0x422601){if(_0x422601){return _0x422601[_0xf3a0('0x25')]()[_0xf3a0('0x24')](function(){_0x131ab4[_0xf3a0('0x18')](0xcc)[_0xf3a0('0x19')]();});}};}function handleEntityNotFound(_0x5569a9,_0x2c4f45){return function(_0x182ce6){if(!_0x182ce6){_0x5569a9[_0xf3a0('0x26')](0x194);}return _0x182ce6;};}function handleError(_0x12ba21,_0x281037){_0x281037=_0x281037||0x1f4;return function(_0x10b5cd){logger[_0xf3a0('0x27')](_0x10b5cd[_0xf3a0('0x28')]);if(_0x10b5cd['name']){delete _0x10b5cd['name'];}_0x12ba21['status'](_0x281037)[_0xf3a0('0x29')](_0x10b5cd);};}exports[_0xf3a0('0x2a')]=function(_0x252f89,_0x260bf2){var _0x51cf50={'raw':!![],'where':{'id':_0x252f89[_0xf3a0('0x2b')]['id']}},_0x2adb99={};_0x2adb99[_0xf3a0('0x2c')]=_[_0xf3a0('0x2d')](db[_0xf3a0('0x2e')][_0xf3a0('0x2f')]);_0x2adb99['query']=_[_0xf3a0('0x2d')](_0x252f89[_0xf3a0('0x30')]);_0x2adb99[_0xf3a0('0x31')]=_[_0xf3a0('0x32')](_0x2adb99[_0xf3a0('0x2c')],_0x2adb99[_0xf3a0('0x30')]);_0x51cf50['attributes']=_[_0xf3a0('0x32')](_0x2adb99[_0xf3a0('0x2c')],qs[_0xf3a0('0x33')](_0x252f89[_0xf3a0('0x30')][_0xf3a0('0x33')]));_0x51cf50[_0xf3a0('0x34')]=_0x51cf50[_0xf3a0('0x34')]['length']?_0x51cf50['attributes']:_0x2adb99[_0xf3a0('0x2c')];if(_0x252f89[_0xf3a0('0x30')][_0xf3a0('0x35')]){_0x51cf50[_0xf3a0('0x36')]=[{'all':!![]}];}_0x51cf50=_[_0xf3a0('0x37')]({},_0x51cf50,_0x252f89[_0xf3a0('0x38')]);return db[_0xf3a0('0x2e')][_0xf3a0('0x39')](_0x51cf50)['then'](handleEntityNotFound(_0x260bf2,null))[_0xf3a0('0x24')](respondWithResult(_0x260bf2,null))[_0xf3a0('0x3a')](handleError(_0x260bf2,null));};exports[_0xf3a0('0x3b')]=function(_0x5e3479,_0x352f51){return db[_0xf3a0('0x2e')][_0xf3a0('0x3b')](_0x5e3479[_0xf3a0('0x3c')],{})['then'](respondWithResult(_0x352f51,0xc9))[_0xf3a0('0x3a')](handleError(_0x352f51,null));};exports[_0xf3a0('0x23')]=function(_0x4e97fb,_0x5cf5ae){if(_0x4e97fb[_0xf3a0('0x3c')]['id']){delete _0x4e97fb[_0xf3a0('0x3c')]['id'];}return db[_0xf3a0('0x2e')][_0xf3a0('0x39')]({'where':{'id':_0x4e97fb['params']['id']}})[_0xf3a0('0x24')](handleEntityNotFound(_0x5cf5ae,null))[_0xf3a0('0x24')](saveUpdates(_0x4e97fb['body'],null))[_0xf3a0('0x24')](respondWithResult(_0x5cf5ae,null))[_0xf3a0('0x3a')](handleError(_0x5cf5ae,null));};exports[_0xf3a0('0x25')]=function(_0x4436b4,_0x256e2d){return db[_0xf3a0('0x2e')][_0xf3a0('0x39')]({'where':{'id':_0x4436b4[_0xf3a0('0x2b')]['id']}})['then'](handleEntityNotFound(_0x256e2d,null))[_0xf3a0('0x24')](removeEntity(_0x256e2d,null))[_0xf3a0('0x3a')](handleError(_0x256e2d,null));};
\ No newline at end of file
+var _0x54da=['moment','mustache','util','path','sox','fs-extra','lodash','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','name','show','params','keys','ChatProactiveAction','query','intersection','model','fields','attributes','length','includeAll','include','options','catch','create','update','body','find','destroy','eml-format','zip-dir'];(function(_0x155c64,_0x26ff95){var _0x1f154a=function(_0xbc46e4){while(--_0xbc46e4){_0x155c64['push'](_0x155c64['shift']());}};_0x1f154a(++_0x26ff95);}(_0x54da,0x9d));var _0xa54d=function(_0x43d0dd,_0x1bd3d2){_0x43d0dd=_0x43d0dd-0x0;var _0x233879=_0x54da[_0x43d0dd];return _0x233879;};'use strict';var emlformat=require(_0xa54d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa54d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa54d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa54d('0x3'));var util=require(_0xa54d('0x4'));var path=require(_0xa54d('0x5'));var sox=require(_0xa54d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa54d('0x7'));var _=require(_0xa54d('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa54d('0x9'));var toCsv=require(_0xa54d('0xa'));var querystring=require(_0xa54d('0xb'));var Papa=require('papaparse');var Redis=require(_0xa54d('0xc'));var authService=require(_0xa54d('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa54d('0xe'));var logger=require('../../config/logger')(_0xa54d('0xf'));var utils=require(_0xa54d('0x10'));var config=require(_0xa54d('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xa54d('0x12'))['db'];function respondWithStatusCode(_0x4aa983,_0x4f1d93){_0x4f1d93=_0x4f1d93||0xcc;return function(_0x5ea2b6){if(_0x5ea2b6){return _0x4aa983[_0xa54d('0x13')](_0x4f1d93);}return _0x4aa983[_0xa54d('0x14')](_0x4f1d93)[_0xa54d('0x15')]();};}function respondWithResult(_0x11d38f,_0xd5c470){_0xd5c470=_0xd5c470||0xc8;return function(_0x5f30f9){if(_0x5f30f9){return _0x11d38f[_0xa54d('0x14')](_0xd5c470)[_0xa54d('0x16')](_0x5f30f9);}};}function respondWithFilteredResult(_0x272e8d,_0xdf2d8){return function(_0x23cd06){if(_0x23cd06){var _0xfc1686=typeof _0xdf2d8[_0xa54d('0x17')]===_0xa54d('0x18')&&typeof _0xdf2d8[_0xa54d('0x19')]===_0xa54d('0x18');var _0x3227f7=_0x23cd06[_0xa54d('0x1a')];var _0x49e221=_0xfc1686?0x0:_0xdf2d8[_0xa54d('0x17')];var _0x1fd2bc=_0xfc1686?_0x23cd06[_0xa54d('0x1a')]:_0xdf2d8[_0xa54d('0x17')]+_0xdf2d8[_0xa54d('0x19')];var _0xa4a36b;if(_0x1fd2bc>=_0x3227f7){_0x1fd2bc=_0x3227f7;_0xa4a36b=0xc8;}else{_0xa4a36b=0xce;}_0x272e8d['status'](_0xa4a36b);return _0x272e8d['set'](_0xa54d('0x1b'),_0x49e221+'-'+_0x1fd2bc+'/'+_0x3227f7)[_0xa54d('0x16')](_0x23cd06);}return null;};}function patchUpdates(_0x44cc3d){return function(_0x23fc6d){try{jsonpatch[_0xa54d('0x1c')](_0x23fc6d,_0x44cc3d,!![]);}catch(_0x2d5893){return BPromise[_0xa54d('0x1d')](_0x2d5893);}return _0x23fc6d[_0xa54d('0x1e')]();};}function saveUpdates(_0x4e4250,_0x42a376){return function(_0x47b7ea){if(_0x47b7ea){return _0x47b7ea['update'](_0x4e4250)[_0xa54d('0x1f')](function(_0x99c1b3){return _0x99c1b3;});}return null;};}function removeEntity(_0x5b135f,_0x5695ad){return function(_0x1447d8){if(_0x1447d8){return _0x1447d8['destroy']()[_0xa54d('0x1f')](function(){_0x5b135f[_0xa54d('0x14')](0xcc)[_0xa54d('0x15')]();});}};}function handleEntityNotFound(_0x346086,_0x37dd6c){return function(_0x468d2e){if(!_0x468d2e){_0x346086[_0xa54d('0x13')](0x194);}return _0x468d2e;};}function handleError(_0x33eb45,_0x4497a0){_0x4497a0=_0x4497a0||0x1f4;return function(_0x15030a){logger[_0xa54d('0x20')](_0x15030a['stack']);if(_0x15030a[_0xa54d('0x21')]){delete _0x15030a[_0xa54d('0x21')];}_0x33eb45[_0xa54d('0x14')](_0x4497a0)['send'](_0x15030a);};}exports[_0xa54d('0x22')]=function(_0xb8661f,_0x13f701){var _0x58b625={'raw':!![],'where':{'id':_0xb8661f[_0xa54d('0x23')]['id']}},_0x2e10ff={};_0x2e10ff['model']=_[_0xa54d('0x24')](db[_0xa54d('0x25')]['rawAttributes']);_0x2e10ff[_0xa54d('0x26')]=_[_0xa54d('0x24')](_0xb8661f['query']);_0x2e10ff['filters']=_[_0xa54d('0x27')](_0x2e10ff[_0xa54d('0x28')],_0x2e10ff['query']);_0x58b625['attributes']=_[_0xa54d('0x27')](_0x2e10ff[_0xa54d('0x28')],qs[_0xa54d('0x29')](_0xb8661f['query']['fields']));_0x58b625['attributes']=_0x58b625[_0xa54d('0x2a')][_0xa54d('0x2b')]?_0x58b625['attributes']:_0x2e10ff[_0xa54d('0x28')];if(_0xb8661f[_0xa54d('0x26')][_0xa54d('0x2c')]){_0x58b625[_0xa54d('0x2d')]=[{'all':!![]}];}_0x58b625=_['merge']({},_0x58b625,_0xb8661f[_0xa54d('0x2e')]);return db[_0xa54d('0x25')]['find'](_0x58b625)[_0xa54d('0x1f')](handleEntityNotFound(_0x13f701,null))[_0xa54d('0x1f')](respondWithResult(_0x13f701,null))[_0xa54d('0x2f')](handleError(_0x13f701,null));};exports[_0xa54d('0x30')]=function(_0x2ecf81,_0x69b869){return db[_0xa54d('0x25')][_0xa54d('0x30')](_0x2ecf81['body'],{})['then'](respondWithResult(_0x69b869,0xc9))[_0xa54d('0x2f')](handleError(_0x69b869,null));};exports[_0xa54d('0x31')]=function(_0x59627b,_0x49d4b8){if(_0x59627b[_0xa54d('0x32')]['id']){delete _0x59627b[_0xa54d('0x32')]['id'];}return db['ChatProactiveAction'][_0xa54d('0x33')]({'where':{'id':_0x59627b[_0xa54d('0x23')]['id']}})['then'](handleEntityNotFound(_0x49d4b8,null))[_0xa54d('0x1f')](saveUpdates(_0x59627b['body'],null))[_0xa54d('0x1f')](respondWithResult(_0x49d4b8,null))[_0xa54d('0x2f')](handleError(_0x49d4b8,null));};exports[_0xa54d('0x34')]=function(_0x482af2,_0x4f9eab){return db[_0xa54d('0x25')][_0xa54d('0x33')]({'where':{'id':_0x482af2[_0xa54d('0x23')]['id']}})[_0xa54d('0x1f')](handleEntityNotFound(_0x4f9eab,null))[_0xa54d('0x1f')](removeEntity(_0x4f9eab,null))[_0xa54d('0x2f')](handleError(_0x4f9eab,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index baa29f3..b8419ff 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 _0xb716=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','moment','bluebird','request-promise','path'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0xb716,0x66));var _0x6b71=function(_0x40e503,_0x217c9b){_0x40e503=_0x40e503-0x0;var _0x3ba3a1=_0xb716[_0x40e503];return _0x3ba3a1;};'use strict';var _=require(_0x6b71('0x0'));var util=require(_0x6b71('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b71('0x2'));var BPromise=require(_0x6b71('0x3'));var rp=require(_0x6b71('0x4'));var fs=require('fs');var path=require(_0x6b71('0x5'));var rimraf=require(_0x6b71('0x6'));var config=require(_0x6b71('0x7'));var attributes=require(_0x6b71('0x8'));module[_0x6b71('0x9')]=function(_0x346fd8,_0x1dcfd4){return _0x346fd8['define'](_0x6b71('0xa'),attributes,{'tableName':_0x6b71('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe6cb=['chat_proactive_actions','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction'];(function(_0xadb3d8,_0x38cfde){var _0x12d6a0=function(_0xbb1924){while(--_0xbb1924){_0xadb3d8['push'](_0xadb3d8['shift']());}};_0x12d6a0(++_0x38cfde);}(_0xe6cb,0x12c));var _0xbe6c=function(_0x37bae1,_0x3c05af){_0x37bae1=_0x37bae1-0x0;var _0x3b3f22=_0xe6cb[_0x37bae1];return _0x3b3f22;};'use strict';var _=require(_0xbe6c('0x0'));var util=require(_0xbe6c('0x1'));var logger=require(_0xbe6c('0x2'))(_0xbe6c('0x3'));var moment=require('moment');var BPromise=require(_0xbe6c('0x4'));var rp=require(_0xbe6c('0x5'));var fs=require('fs');var path=require(_0xbe6c('0x6'));var rimraf=require(_0xbe6c('0x7'));var config=require(_0xbe6c('0x8'));var attributes=require(_0xbe6c('0x9'));module['exports']=function(_0x4c988c,_0xbc3ffc){return _0x4c988c[_0xbe6c('0xa')](_0xbe6c('0xb'),attributes,{'tableName':_0xbe6c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 292080b..2d49f8a 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 _0x0123=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x456026,_0x3535b2){var _0x1dc941=function(_0x3d0864){while(--_0x3d0864){_0x456026['push'](_0x456026['shift']());}};_0x1dc941(++_0x3535b2);}(_0x0123,0x191));var _0x3012=function(_0x6d16c6,_0x3d150a){_0x6d16c6=_0x6d16c6-0x0;var _0x436ffc=_0x0123[_0x6d16c6];return _0x436ffc;};'use strict';var _=require('lodash');var util=require(_0x3012('0x0'));var moment=require(_0x3012('0x1'));var BPromise=require(_0x3012('0x2'));var rs=require(_0x3012('0x3'));var fs=require('fs');var Redis=require(_0x3012('0x4'));var db=require(_0x3012('0x5'))['db'];var utils=require(_0x3012('0x6'));var logger=require(_0x3012('0x7'))(_0x3012('0x8'));var config=require(_0x3012('0x9'));var jayson=require(_0x3012('0xa'));var client=jayson[_0x3012('0xb')][_0x3012('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ce6e6,_0x2fd453,_0x1de7fe){return new BPromise(function(_0x27684d,_0x4387bd){return client[_0x3012('0xd')](_0x2ce6e6,_0x1de7fe)[_0x3012('0xe')](function(_0x1952f6){logger[_0x3012('0xf')](_0x3012('0x10'),_0x2fd453,_0x3012('0x11'));logger[_0x3012('0x12')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2fd453,'request\x20sent',JSON[_0x3012('0x13')](_0x1952f6));if(_0x1952f6[_0x3012('0x14')]){if(_0x1952f6['error']['code']===0x1f4){logger['error'](_0x3012('0x10'),_0x2fd453,_0x1952f6[_0x3012('0x14')]['message']);return _0x4387bd(_0x1952f6[_0x3012('0x14')][_0x3012('0x15')]);}logger[_0x3012('0x14')](_0x3012('0x10'),_0x2fd453,_0x1952f6[_0x3012('0x14')][_0x3012('0x15')]);return _0x27684d(_0x1952f6[_0x3012('0x14')]['message']);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x2fd453,_0x3012('0x11'));_0x27684d(_0x1952f6[_0x3012('0x16')][_0x3012('0x15')]);}})[_0x3012('0x17')](function(_0xf0b928){logger[_0x3012('0x14')](_0x3012('0x10'),_0x2fd453,_0xf0b928);_0x4387bd(_0xf0b928);});});}
\ No newline at end of file
+var _0x351b=['error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20d71f,_0x3a8ea1){var _0x25139=function(_0x4ff467){while(--_0x4ff467){_0x20d71f['push'](_0x20d71f['shift']());}};_0x25139(++_0x3a8ea1);}(_0x351b,0x7d));var _0xb351=function(_0x37723a,_0x60b0c1){_0x37723a=_0x37723a-0x0;var _0x32c835=_0x351b[_0x37723a];return _0x32c835;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb351('0x0'));var BPromise=require(_0xb351('0x1'));var rs=require(_0xb351('0x2'));var fs=require('fs');var Redis=require(_0xb351('0x3'));var db=require(_0xb351('0x4'))['db'];var utils=require(_0xb351('0x5'));var logger=require(_0xb351('0x6'))(_0xb351('0x7'));var config=require(_0xb351('0x8'));var jayson=require(_0xb351('0x9'));var client=jayson[_0xb351('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3772b4,_0x2ada1d,_0x367e2e){return new BPromise(function(_0x2387d7,_0x499170){return client[_0xb351('0xb')](_0x3772b4,_0x367e2e)[_0xb351('0xc')](function(_0x1a84c8){logger[_0xb351('0xd')](_0xb351('0xe'),_0x2ada1d,_0xb351('0xf'));logger[_0xb351('0x10')](_0xb351('0x11'),_0x2ada1d,_0xb351('0xf'),JSON[_0xb351('0x12')](_0x1a84c8));if(_0x1a84c8[_0xb351('0x13')]){if(_0x1a84c8[_0xb351('0x13')][_0xb351('0x14')]===0x1f4){logger[_0xb351('0x13')](_0xb351('0xe'),_0x2ada1d,_0x1a84c8[_0xb351('0x13')][_0xb351('0x15')]);return _0x499170(_0x1a84c8[_0xb351('0x13')][_0xb351('0x15')]);}logger[_0xb351('0x13')](_0xb351('0xe'),_0x2ada1d,_0x1a84c8[_0xb351('0x13')][_0xb351('0x15')]);return _0x2387d7(_0x1a84c8[_0xb351('0x13')]['message']);}else{logger[_0xb351('0xd')](_0xb351('0xe'),_0x2ada1d,_0xb351('0xf'));_0x2387d7(_0x1a84c8[_0xb351('0x16')][_0xb351('0x15')]);}})[_0xb351('0x17')](function(_0x5b5ff6){logger[_0xb351('0x13')](_0xb351('0xe'),_0x2ada1d,_0x5b5ff6);_0x499170(_0x5b5ff6);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index d80a5ac..aa7be8c 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 _0xa630=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x5ddafe,_0x1fb508){var _0x5e23aa=function(_0x423efc){while(--_0x423efc){_0x5ddafe['push'](_0x5ddafe['shift']());}};_0x5e23aa(++_0x1fb508);}(_0xa630,0xbe));var _0x0a63=function(_0x55b05a,_0x271eea){_0x55b05a=_0x55b05a-0x0;var _0x1fb7da=_0xa630[_0x55b05a];return _0x1fb7da;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0x9')]);router[_0x0a63('0xa')]('/',auth[_0x0a63('0xb')](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0xe')]);router[_0x0a63('0xf')](_0x0a63('0x8'),auth[_0x0a63('0xb')](),controller[_0x0a63('0x10')]);module[_0x0a63('0x11')]=router;
\ No newline at end of file
+var _0xd8fb=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x121b02,_0x2978ba){var _0x25048e=function(_0x2d1ed2){while(--_0x2d1ed2){_0x121b02['push'](_0x121b02['shift']());}};_0x25048e(++_0x2978ba);}(_0xd8fb,0x99));var _0xbd8f=function(_0x415599,_0x35740b){_0x415599=_0x415599-0x0;var _0x307cfe=_0xd8fb[_0x415599];return _0x307cfe;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/:id',auth[_0xbd8f('0x8')](),controller['show']);router[_0xbd8f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xc')]);router[_0xbd8f('0xd')](_0xbd8f('0xe'),auth['isAuthenticated'](),controller[_0xbd8f('0xf')]);module[_0xbd8f('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index f2314d9..9d2d74a 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 _0xec2e=['INTEGER','ENUM','beepall','roundrobin','STRING','name'];(function(_0x503620,_0x5d50f4){var _0x39f4e3=function(_0x26f222){while(--_0x26f222){_0x503620['push'](_0x503620['shift']());}};_0x39f4e3(++_0x5d50f4);}(_0xec2e,0x112));var _0xeec2=function(_0x4cacc5,_0x38c6a9){_0x4cacc5=_0x4cacc5-0x0;var _0x321014=_0xec2e[_0x4cacc5];return _0x321014;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xeec2('0x0')],'unique':_0xeec2('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xeec2('0x0')]},'timeout':{'type':Sequelize[_0xeec2('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xeec2('0x3')]('rrmemory',_0xeec2('0x4'),_0xeec2('0x5'))}};
\ No newline at end of file
+var _0xa31e=['INTEGER','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa31e,0x136));var _0xea31=function(_0x415ff8,_0x176fb5){_0x415ff8=_0x415ff8-0x0;var _0x1f347a=_0xa31e[_0x415ff8];return _0x1f347a;};'use strict';var Sequelize=require(_0xea31('0x0'));module[_0xea31('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xea31('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xea31('0x3')]('rrmemory',_0xea31('0x4'),_0xea31('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 9a63ca1..9672dae 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 _0x1839=['UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','union','ids','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','order','getAgents','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','get','ChatQueues','stack','name','send','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','show','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','ChatQueueId'];(function(_0x5ad171,_0x14a45b){var _0x4c9d82=function(_0x2ffe08){while(--_0x2ffe08){_0x5ad171['push'](_0x5ad171['shift']());}};_0x4c9d82(++_0x14a45b);}(_0x1839,0xcb));var _0x9183=function(_0x3e9f07,_0x5868a2){_0x3e9f07=_0x3e9f07-0x0;var _0xf7d079=_0x1839[_0x3e9f07];return _0xf7d079;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9183('0x0'));var jsonpatch=require(_0x9183('0x1'));var rp=require('request-promise');var moment=require(_0x9183('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9183('0x3'));var path=require('path');var sox=require(_0x9183('0x4'));var csv=require(_0x9183('0x5'));var ejs=require(_0x9183('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9183('0x7'));var squel=require(_0x9183('0x8'));var crypto=require(_0x9183('0x9'));var jsforce=require(_0x9183('0xa'));var deskjs=require(_0x9183('0xb'));var toCsv=require(_0x9183('0x5'));var querystring=require(_0x9183('0xc'));var Papa=require(_0x9183('0xd'));var Redis=require('ioredis');var authService=require(_0x9183('0xe'));var qs=require(_0x9183('0xf'));var as=require(_0x9183('0x10'));var hardwareService=require(_0x9183('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x9183('0x12'));var config=require(_0x9183('0x13'));var licenseUtil=require(_0x9183('0x14'));var db=require(_0x9183('0x15'))['db'];config[_0x9183('0x16')]=_[_0x9183('0x17')](config[_0x9183('0x16')],{'host':_0x9183('0x18'),'port':0x18eb});var socket=require(_0x9183('0x19'))(new Redis(config[_0x9183('0x16')]));require('./chatQueue.socket')[_0x9183('0x1a')](socket);var jayson=require(_0x9183('0x1b'));var client=jayson[_0x9183('0x1c')][_0x9183('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x38ccbe,_0x33091a,_0x339fb2,_0xfc8422){return new BPromise(function(_0x31f3dc,_0x563c85){var _0x567078=_0xfc8422||client;return _0x567078[_0x9183('0x1e')](_0x38ccbe,_0x339fb2)['then'](function(_0x595e35){logger[_0x9183('0x1f')](_0x9183('0x20'),_0x33091a,_0x9183('0x21'));logger['debug'](_0x9183('0x22'),_0x33091a,'request\x20sent',JSON[_0x9183('0x23')](_0x595e35));if(_0x595e35['error']){if(_0x595e35[_0x9183('0x24')][_0x9183('0x25')]===0x1f4){logger['error'](_0x9183('0x20'),_0x33091a,_0x595e35[_0x9183('0x24')][_0x9183('0x26')]);return _0x563c85(_0x595e35[_0x9183('0x24')][_0x9183('0x26')]);}logger[_0x9183('0x24')](_0x9183('0x20'),_0x33091a,_0x595e35['error']['message']);return _0x31f3dc(_0x595e35[_0x9183('0x24')][_0x9183('0x26')]);}else{logger[_0x9183('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x33091a,_0x9183('0x21'));_0x31f3dc(_0x595e35[_0x9183('0x27')]['message']);}})[_0x9183('0x28')](function(_0x215866){logger[_0x9183('0x24')]('ChatQueue,\x20%s,\x20%s',_0x33091a,_0x215866);_0x563c85(_0x215866);});});}function respondWithStatusCode(_0x4c4ae5,_0x2c52b9){_0x2c52b9=_0x2c52b9||0xcc;return function(_0xe8ac){if(_0xe8ac){return _0x4c4ae5[_0x9183('0x29')](_0x2c52b9);}return _0x4c4ae5[_0x9183('0x2a')](_0x2c52b9)[_0x9183('0x2b')]();};}function respondWithResult(_0x377917,_0x41a882){_0x41a882=_0x41a882||0xc8;return function(_0x3b266f){if(_0x3b266f){return _0x377917[_0x9183('0x2a')](_0x41a882)['json'](_0x3b266f);}};}function respondWithFilteredResult(_0x55882a,_0x1e834f){return function(_0x5b11a8){if(_0x5b11a8){var _0x554244=typeof _0x1e834f[_0x9183('0x2c')]===_0x9183('0x2d')&&typeof _0x1e834f[_0x9183('0x2e')]===_0x9183('0x2d');var _0x5b3be9=_0x5b11a8['count'];var _0x26fbbd=_0x554244?0x0:_0x1e834f[_0x9183('0x2c')];var _0x5c9509=_0x554244?_0x5b11a8[_0x9183('0x2f')]:_0x1e834f[_0x9183('0x2c')]+_0x1e834f[_0x9183('0x2e')];var _0xa0c938;if(_0x5c9509>=_0x5b3be9){_0x5c9509=_0x5b3be9;_0xa0c938=0xc8;}else{_0xa0c938=0xce;}_0x55882a[_0x9183('0x2a')](_0xa0c938);return _0x55882a['set'](_0x9183('0x30'),_0x26fbbd+'-'+_0x5c9509+'/'+_0x5b3be9)[_0x9183('0x31')](_0x5b11a8);}return null;};}function patchUpdates(_0x53d459){return function(_0x39ca45){try{jsonpatch[_0x9183('0x32')](_0x39ca45,_0x53d459,!![]);}catch(_0x9043a8){return BPromise[_0x9183('0x33')](_0x9043a8);}return _0x39ca45[_0x9183('0x34')]();};}function saveUpdates(_0x5dd9dd,_0x906898){return function(_0x582071){if(_0x582071){return _0x582071['update'](_0x5dd9dd)[_0x9183('0x35')](function(_0x13781c){return _0x13781c;});}return null;};}function removeEntity(_0x264e60,_0xee6594){return function(_0x163bd8){if(_0x163bd8){return _0x163bd8[_0x9183('0x36')]()['then'](function(){var _0x2e434e=_0x163bd8[_0x9183('0x37')]({'plain':!![]});var _0x3672b5=_0x9183('0x38');return db['UserProfileResource'][_0x9183('0x36')]({'where':{'type':_0x3672b5,'resourceId':_0x2e434e['id']}})[_0x9183('0x35')](function(){return _0x163bd8;});})[_0x9183('0x35')](function(){_0x264e60[_0x9183('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3cc2,_0x1de2a2){return function(_0x14fa32){if(!_0x14fa32){_0x2d3cc2[_0x9183('0x29')](0x194);}return _0x14fa32;};}function handleError(_0x1ebb7c,_0x51993d){_0x51993d=_0x51993d||0x1f4;return function(_0x263679){logger[_0x9183('0x24')](_0x263679[_0x9183('0x39')]);if(_0x263679[_0x9183('0x3a')]){delete _0x263679[_0x9183('0x3a')];}_0x1ebb7c[_0x9183('0x2a')](_0x51993d)[_0x9183('0x3b')](_0x263679);};}exports['index']=function(_0x5e9ddd,_0x321fa1){var _0x2d200f={},_0xd31ba3={},_0x3a8463={'count':0x0,'rows':[]};var _0x4bc404=_['map'](db[_0x9183('0x3c')][_0x9183('0x3d')],function(_0x2adb1d){return{'name':_0x2adb1d[_0x9183('0x3e')],'type':_0x2adb1d[_0x9183('0x3f')][_0x9183('0x40')]};});_0xd31ba3[_0x9183('0x41')]=_['map'](_0x4bc404,'name');_0xd31ba3[_0x9183('0x42')]=_[_0x9183('0x43')](_0x5e9ddd[_0x9183('0x42')]);_0xd31ba3[_0x9183('0x44')]=_[_0x9183('0x45')](_0xd31ba3[_0x9183('0x41')],_0xd31ba3[_0x9183('0x42')]);_0x2d200f[_0x9183('0x46')]=_[_0x9183('0x45')](_0xd31ba3[_0x9183('0x41')],qs[_0x9183('0x47')](_0x5e9ddd[_0x9183('0x42')][_0x9183('0x47')]));_0x2d200f[_0x9183('0x46')]=_0x2d200f[_0x9183('0x46')]['length']?_0x2d200f[_0x9183('0x46')]:_0xd31ba3['model'];if(!_0x5e9ddd[_0x9183('0x42')][_0x9183('0x48')](_0x9183('0x49'))){_0x2d200f['limit']=qs[_0x9183('0x2e')](_0x5e9ddd['query'][_0x9183('0x2e')]);_0x2d200f[_0x9183('0x2c')]=qs[_0x9183('0x2c')](_0x5e9ddd[_0x9183('0x42')]['offset']);}_0x2d200f['order']=qs[_0x9183('0x4a')](_0x5e9ddd[_0x9183('0x42')][_0x9183('0x4a')]);_0x2d200f[_0x9183('0x4b')]=qs['filters'](_[_0x9183('0x4c')](_0x5e9ddd[_0x9183('0x42')],_0xd31ba3[_0x9183('0x44')]),_0x4bc404);if(_0x5e9ddd[_0x9183('0x42')][_0x9183('0x4d')]){_0x2d200f['where']=_[_0x9183('0x4e')](_0x2d200f[_0x9183('0x4b')],{'$or':_[_0x9183('0x4f')](_0x4bc404,function(_0x180506){if(_0x180506[_0x9183('0x3f')]!==_0x9183('0x50')){var _0x156278={};_0x156278[_0x180506[_0x9183('0x3a')]]={'$like':'%'+_0x5e9ddd[_0x9183('0x42')][_0x9183('0x4d')]+'%'};return _0x156278;}})});}_0x2d200f=_[_0x9183('0x4e')]({},_0x2d200f,_0x5e9ddd[_0x9183('0x51')]);var _0x2f04d1={'where':_0x2d200f[_0x9183('0x4b')]};return db[_0x9183('0x3c')][_0x9183('0x2f')](_0x2f04d1)[_0x9183('0x35')](function(_0x55cded){_0x3a8463['count']=_0x55cded;if(_0x5e9ddd[_0x9183('0x42')][_0x9183('0x52')]){_0x2d200f['include']=[{'all':!![]}];}return db['ChatQueue'][_0x9183('0x53')](_0x2d200f);})['then'](function(_0x2652b6){_0x3a8463[_0x9183('0x54')]=_0x2652b6;return _0x3a8463;})[_0x9183('0x35')](respondWithFilteredResult(_0x321fa1,_0x2d200f))[_0x9183('0x28')](handleError(_0x321fa1,null));};exports[_0x9183('0x55')]=function(_0x4c8fd6,_0x464f23){var _0x234140={'raw':!![],'where':{'id':_0x4c8fd6['params']['id']}},_0x5018de={};_0x5018de[_0x9183('0x41')]=_[_0x9183('0x43')](db[_0x9183('0x3c')]['rawAttributes']);_0x5018de[_0x9183('0x42')]=_[_0x9183('0x43')](_0x4c8fd6['query']);_0x5018de[_0x9183('0x44')]=_[_0x9183('0x45')](_0x5018de[_0x9183('0x41')],_0x5018de[_0x9183('0x42')]);_0x234140[_0x9183('0x46')]=_[_0x9183('0x45')](_0x5018de[_0x9183('0x41')],qs[_0x9183('0x47')](_0x4c8fd6[_0x9183('0x42')]['fields']));_0x234140[_0x9183('0x46')]=_0x234140['attributes'][_0x9183('0x56')]?_0x234140[_0x9183('0x46')]:_0x5018de[_0x9183('0x41')];if(_0x4c8fd6[_0x9183('0x42')]['includeAll']){_0x234140[_0x9183('0x57')]=[{'all':!![]}];}_0x234140=_[_0x9183('0x4e')]({},_0x234140,_0x4c8fd6['options']);return db[_0x9183('0x3c')]['find'](_0x234140)[_0x9183('0x35')](handleEntityNotFound(_0x464f23,null))[_0x9183('0x35')](respondWithResult(_0x464f23,null))[_0x9183('0x28')](handleError(_0x464f23,null));};exports['create']=function(_0x3fdc6b,_0x7ed0d9){return db[_0x9183('0x3c')][_0x9183('0x58')](_0x3fdc6b[_0x9183('0x59')],{})[_0x9183('0x35')](function(_0x5a88de){var _0x111ca2=_0x3fdc6b[_0x9183('0x5a')][_0x9183('0x37')]({'plain':!![]});if(!_0x111ca2)throw new Error(_0x9183('0x5b'));if(_0x111ca2['role']===_0x9183('0x5a')){var _0x5a228a=_0x5a88de[_0x9183('0x37')]({'plain':!![]});var _0x146abb=_0x9183('0x38');return db['UserProfileSection'][_0x9183('0x5c')]({'where':{'name':_0x146abb,'userProfileId':_0x111ca2[_0x9183('0x5d')]},'raw':!![]})['then'](function(_0x15a7b0){if(_0x15a7b0&&_0x15a7b0[_0x9183('0x5e')]===0x0){return db[_0x9183('0x5f')][_0x9183('0x58')]({'name':_0x5a228a[_0x9183('0x3a')],'resourceId':_0x5a228a['id'],'type':_0x15a7b0[_0x9183('0x3a')],'sectionId':_0x15a7b0['id']},{})[_0x9183('0x35')](function(){return _0x5a88de;});}else{return _0x5a88de;}})['catch'](function(_0x30c3a7){logger[_0x9183('0x24')](_0x9183('0x60'),_0x30c3a7);throw _0x30c3a7;});}return _0x5a88de;})['then'](respondWithResult(_0x7ed0d9,0xc9))[_0x9183('0x28')](handleError(_0x7ed0d9,null));};exports[_0x9183('0x61')]=function(_0x549618,_0xd5fdd2){if(_0x549618['body']['id']){delete _0x549618['body']['id'];}return db['ChatQueue'][_0x9183('0x5c')]({'where':{'id':_0x549618[_0x9183('0x62')]['id']}})['then'](handleEntityNotFound(_0xd5fdd2,null))[_0x9183('0x35')](saveUpdates(_0x549618[_0x9183('0x59')],null))[_0x9183('0x35')](respondWithResult(_0xd5fdd2,null))[_0x9183('0x28')](handleError(_0xd5fdd2,null));};exports[_0x9183('0x36')]=function(_0x28d4c7,_0x3dff5a){return db[_0x9183('0x3c')][_0x9183('0x5c')]({'where':{'id':_0x28d4c7[_0x9183('0x62')]['id']}})[_0x9183('0x35')](handleEntityNotFound(_0x3dff5a,null))[_0x9183('0x35')](removeEntity(_0x3dff5a,null))[_0x9183('0x28')](handleError(_0x3dff5a,null));};exports[_0x9183('0x63')]=function(_0x48e8e3,_0x1481c5){return db[_0x9183('0x3c')][_0x9183('0x63')]()[_0x9183('0x35')](respondWithResult(_0x1481c5,null))[_0x9183('0x28')](handleError(_0x1481c5,null));};exports[_0x9183('0x64')]=function(_0x1e65e7,_0x54ead5,_0x4ec77c){var _0x4dd0d6={'raw':!![],'where':{}},_0x59ce37={},_0x45cf84;return db[_0x9183('0x3c')][_0x9183('0x65')]({'where':{'id':_0x1e65e7[_0x9183('0x62')]['id']}})[_0x9183('0x35')](handleEntityNotFound(_0x54ead5,null))[_0x9183('0x35')](function(_0x3a9479){if(_0x3a9479){_0x45cf84=_0x3a9479['get']({'plain':!![]});_0x59ce37[_0x9183('0x41')]=_[_0x9183('0x43')](db['UserChatQueue'][_0x9183('0x3d')]);_0x59ce37[_0x9183('0x42')]=_[_0x9183('0x43')](_0x1e65e7['query']);_0x59ce37[_0x9183('0x44')]=_[_0x9183('0x45')](_0x59ce37[_0x9183('0x41')],_0x59ce37['query']);_0x4dd0d6[_0x9183('0x46')]=_['intersection'](_0x59ce37[_0x9183('0x41')],qs[_0x9183('0x47')](_0x1e65e7[_0x9183('0x42')]['fields']));_0x4dd0d6['attributes']=_0x4dd0d6[_0x9183('0x46')]['length']?_0x4dd0d6['attributes']:_0x59ce37[_0x9183('0x41')];if(!_0x1e65e7[_0x9183('0x42')]['hasOwnProperty'](_0x9183('0x49'))){_0x4dd0d6[_0x9183('0x2e')]=qs[_0x9183('0x2e')](_0x1e65e7[_0x9183('0x42')][_0x9183('0x2e')]);_0x4dd0d6[_0x9183('0x2c')]=qs['offset'](_0x1e65e7[_0x9183('0x42')][_0x9183('0x2c')]);}_0x4dd0d6['order']=qs[_0x9183('0x4a')](_0x1e65e7[_0x9183('0x42')][_0x9183('0x4a')]);_0x4dd0d6[_0x9183('0x4b')]=qs[_0x9183('0x44')](_['pick'](_0x1e65e7[_0x9183('0x42')],_0x59ce37[_0x9183('0x44')]));_0x4dd0d6[_0x9183('0x4b')][_0x9183('0x66')]=_0x3a9479['id'];if(_0x1e65e7[_0x9183('0x42')]['filter']){_0x4dd0d6['where']=_['merge'](_0x4dd0d6[_0x9183('0x4b')],{'$or':_[_0x9183('0x4f')](_0x4dd0d6[_0x9183('0x46')],function(_0x1f2dc6){var _0x546f3e={};_0x546f3e[_0x1f2dc6]={'$like':'%'+_0x1e65e7['query'][_0x9183('0x4d')]+'%'};return _0x546f3e;})});}_0x4dd0d6=_['merge']({},_0x4dd0d6,_0x1e65e7[_0x9183('0x51')]);return db[_0x9183('0x67')][_0x9183('0x53')](_0x4dd0d6);}})['then'](function(_0x5aab64){if(_0x5aab64){return db[_0x9183('0x68')][_0x9183('0x69')]({'where':{'id':_['map'](_0x5aab64,_0x9183('0x6a')),'role':_0x9183('0x6b')},'attributes':['id','name',_0x9183('0x6c'),_0x9183('0x6d'),_0x9183('0x6e')]});}})[_0x9183('0x35')](function(_0x31206e){if(_0x31206e){return{'count':_0x31206e[_0x9183('0x2f')],'rows':_['map'](_0x31206e[_0x9183('0x54')],function(_0x430d49){return{'membername':_0x430d49[_0x9183('0x3a')],'UserId':_0x430d49['id'],'queue_name':_0x45cf84['name'],'ChatQueueId':_0x45cf84['id'],'interface':util[_0x9183('0x6f')](_0x9183('0x70'),'SIP',_0x430d49[_0x9183('0x3a')]),'penalty':0x0,'paused':_0x430d49[_0x9183('0x6c')],'createdAt':_0x430d49[_0x9183('0x6e')],'updatedAt':_0x430d49[_0x9183('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9183('0x35')](respondWithFilteredResult(_0x54ead5,_0x4dd0d6))['catch'](handleError(_0x54ead5,null));};exports[_0x9183('0x71')]=function(_0x47cd9b,_0x5ba329,_0x328f5e){var _0x2290c6={};var _0x57ff9d={};var _0x5d123f;var _0x31fd4a;return db[_0x9183('0x3c')][_0x9183('0x65')]({'where':{'id':_0x47cd9b['params']['id']}})['then'](handleEntityNotFound(_0x5ba329,null))[_0x9183('0x35')](function(_0x26d1b5){if(_0x26d1b5){_0x5d123f=_0x26d1b5;_0x57ff9d[_0x9183('0x41')]=_['keys'](db[_0x9183('0x72')][_0x9183('0x3d')]);_0x57ff9d[_0x9183('0x42')]=_[_0x9183('0x43')](_0x47cd9b[_0x9183('0x42')]);_0x57ff9d[_0x9183('0x44')]=_[_0x9183('0x45')](_0x57ff9d[_0x9183('0x41')],_0x57ff9d['query']);_0x2290c6[_0x9183('0x46')]=_[_0x9183('0x45')](_0x57ff9d['model'],qs[_0x9183('0x47')](_0x47cd9b[_0x9183('0x42')]['fields']));_0x2290c6['attributes']=_0x2290c6[_0x9183('0x46')][_0x9183('0x56')]?_0x2290c6['attributes']:_0x57ff9d['model'];_0x2290c6['order']=qs[_0x9183('0x4a')](_0x47cd9b['query']['sort']);_0x2290c6[_0x9183('0x4b')]=qs[_0x9183('0x44')](_['pick'](_0x47cd9b[_0x9183('0x42')],_0x57ff9d[_0x9183('0x44')]));if(_0x47cd9b['query']['filter']){_0x2290c6[_0x9183('0x4b')]=_[_0x9183('0x4e')](_0x2290c6[_0x9183('0x4b')],{'$or':_['map'](_0x2290c6['attributes'],function(_0x4f61fb){var _0x420efe={};_0x420efe[_0x4f61fb]={'$like':'%'+_0x47cd9b[_0x9183('0x42')][_0x9183('0x4d')]+'%'};return _0x420efe;})});}_0x2290c6=_['merge']({},_0x2290c6,_0x47cd9b['options']);return _0x5d123f['getTeams'](_0x2290c6);}})['then'](function(_0x3742fd){if(_0x3742fd){_0x31fd4a=_0x3742fd[_0x9183('0x56')];if(!_0x47cd9b[_0x9183('0x42')]['hasOwnProperty']('nolimit')){_0x2290c6[_0x9183('0x2e')]=qs['limit'](_0x47cd9b[_0x9183('0x42')][_0x9183('0x2e')]);_0x2290c6[_0x9183('0x2c')]=qs['offset'](_0x47cd9b[_0x9183('0x42')][_0x9183('0x2c')]);}return _0x5d123f[_0x9183('0x71')](_0x2290c6);}})['then'](function(_0x2a3bd5){if(_0x2a3bd5){return _0x2a3bd5?{'count':_0x31fd4a,'rows':_0x2a3bd5}:null;}})[_0x9183('0x35')](respondWithResult(_0x5ba329,null))[_0x9183('0x28')](handleError(_0x5ba329,null));};exports['addTeams']=function(_0x2a91e7,_0x455141,_0x49128d){var _0x1f31e7=_0x2a91e7['body']['ids'];return db[_0x9183('0x72')][_0x9183('0x53')]({'where':{'id':_0x1f31e7},'attributes':['id'],'include':[{'model':db[_0x9183('0x68')],'as':_0x9183('0x73'),'attributes':['id',_0x9183('0x3a'),_0x9183('0x74'),'voicePause',_0x9183('0x75')],'raw':!![]}]})[_0x9183('0x35')](function(_0x113457){if(_0x113457){var _0x49305e=_[_0x9183('0x76')](_0x113457,function(_0x3a3ab3){var _0x33ae31=_0x3a3ab3[_0x9183('0x37')]({'plain':!![]});return _0x33ae31[_0x9183('0x73')];});return db[_0x9183('0x3c')]['find']({'where':{'id':_0x2a91e7['params']['id']}})['then'](function(_0x2aa7af){return db[_0x9183('0x77')][_0x9183('0x78')](function(_0x2aca44){return _0x2aa7af[_0x9183('0x79')](_0x1f31e7,{'transaction':_0x2aca44})[_0x9183('0x35')](function(){return BPromise[_0x9183('0x7a')](_0x49305e,function(_0x573b7e){return db['UserChatQueue'][_0x9183('0x7b')]({'where':{'UserId':_0x573b7e['id'],'ChatQueueId':_0x2a91e7[_0x9183('0x62')]['id']},'transaction':_0x2aca44});});})['then'](function(){_0x49305e[_0x9183('0x7c')](function(_0x2defa5){socket[_0x9183('0x7d')]('userChatQueue:save',{'UserId':_0x2defa5['id'],'ChatQueueId':_0x2aa7af['id']});});});});});}})[_0x9183('0x35')](respondWithStatusCode(_0x455141,null))[_0x9183('0x28')](handleError(_0x455141,null));};exports[_0x9183('0x7e')]=function(_0x4fdf2b,_0x31234d,_0x59bbd8){return db[_0x9183('0x72')][_0x9183('0x53')]({'where':{'id':_0x4fdf2b[_0x9183('0x42')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9183('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x31234d,null))[_0x9183('0x35')](function(_0x2d7ce3){var _0x165091=_[_0x9183('0x4f')](_0x2d7ce3,'id');var _0x1c4471=[];var _0x40797d=[];var _0x280ba5=squel[_0x9183('0x7f')]();_0x280ba5[_0x9183('0x80')]('tq.TeamId')[_0x9183('0x81')](_0x9183('0x82'),'tq')['join'](_0x9183('0x83'),'ut',_0x9183('0x84'))[_0x9183('0x4b')](_0x9183('0x85'),_0x4fdf2b[_0x9183('0x62')]['id']);for(var _0xfb6f58=0x0;_0xfb6f58<_0x2d7ce3[_0x9183('0x56')];_0xfb6f58+=0x1){let _0xed6907=_0x2d7ce3[_0xfb6f58];for(var _0x23e35b=0x0;_0x23e35b<_0xed6907['Agents'][_0x9183('0x56')];_0x23e35b+=0x1){let _0x5af487=_0xed6907['Agents'][_0x23e35b];var _0x4c7919=_0x280ba5[_0x9183('0x86')]();_0x4c7919[_0x9183('0x4b')](_0x9183('0x87'),_0x5af487['id']);_0x40797d[_0x9183('0x88')](db[_0x9183('0x77')][_0x9183('0x42')](_0x4c7919[_0x9183('0x89')](),{'type':db['sequelize']['QueryTypes'][_0x9183('0x8a')]})[_0x9183('0x35')](function(_0x1f4ee7){if(_0x1f4ee7[_0x9183('0x56')]===0x1){return _0x5af487['id'];}else{var _0x2d1618=_['every'](_[_0x9183('0x4f')](_0x1f4ee7,_0x9183('0x8b')),function(_0x40519c){return _[_0x9183('0x8c')](_0x165091,_0x40519c);});if(_0x2d1618){return _0x5af487['id'];}}}));}}return BPromise['all'](_0x40797d)['then'](function(_0xc5532e){_0x1c4471=_(_0x1c4471)[_0x9183('0x8d')](_0xc5532e)['compact']()['value']();return db[_0x9183('0x3c')][_0x9183('0x5c')]({'where':{'id':_0x4fdf2b[_0x9183('0x62')]['id']}})[_0x9183('0x35')](function(_0x429e24){return db['sequelize']['transaction'](function(_0x57f980){return _0x429e24[_0x9183('0x7e')](_0x4fdf2b[_0x9183('0x42')][_0x9183('0x8e')],{'transaction':_0x57f980})[_0x9183('0x35')](function(){if(!_[_0x9183('0x8f')](_0x1c4471)){return _0x429e24[_0x9183('0x90')](_0x1c4471,{'transaction':_0x57f980});}})[_0x9183('0x35')](function(){_0x1c4471[_0x9183('0x7c')](function(_0x21701c){socket[_0x9183('0x7d')](_0x9183('0x91'),{'UserId':_0x21701c,'ChatQueueId':_0x429e24['id']});});});});});});})[_0x9183('0x35')](respondWithStatusCode(_0x31234d,null))[_0x9183('0x28')](handleError(_0x31234d,null));};exports[_0x9183('0x92')]=function(_0x2f470e,_0x75aef0,_0xeda310){return db[_0x9183('0x3c')]['find']({'where':{'id':_0x2f470e[_0x9183('0x62')]['id']}})['then'](handleEntityNotFound(_0x75aef0,null))[_0x9183('0x35')](function(_0x3eb31d){if(_0x3eb31d){return _0x3eb31d[_0x9183('0x92')](_0x2f470e[_0x9183('0x59')][_0x9183('0x8e')],_[_0x9183('0x93')](_0x2f470e['body'],['ids','id'])||{})[_0x9183('0x94')](function(_0xb6e7a0){for(var _0x44fefa=0x0;_0x44fefa<_0x2f470e[_0x9183('0x59')][_0x9183('0x8e')][_0x9183('0x56')];_0x44fefa+=0x1){socket[_0x9183('0x7d')](_0x9183('0x95'),{'UserId':Number(_0x2f470e[_0x9183('0x59')][_0x9183('0x8e')][_0x44fefa]),'ChatQueueId':Number(_0x2f470e[_0x9183('0x62')]['id'])});}return _0xb6e7a0;});}})[_0x9183('0x35')](respondWithResult(_0x75aef0,null))[_0x9183('0x28')](handleError(_0x75aef0,null));};exports[_0x9183('0x90')]=function(_0xbf01f0,_0x4242ff,_0x4d4c89){return db[_0x9183('0x3c')][_0x9183('0x5c')]({'where':{'id':_0xbf01f0[_0x9183('0x62')]['id']}})[_0x9183('0x35')](handleEntityNotFound(_0x4242ff,null))[_0x9183('0x35')](function(_0xd07532){if(_0xd07532){return _0xd07532[_0x9183('0x90')](_0xbf01f0[_0x9183('0x42')][_0x9183('0x8e')])['then'](function(){if(_[_0x9183('0x96')](_0xbf01f0[_0x9183('0x42')][_0x9183('0x8e')])){for(var _0x3151d5=0x0;_0x3151d5<_0xbf01f0[_0x9183('0x42')][_0x9183('0x8e')][_0x9183('0x56')];_0x3151d5+=0x1){socket[_0x9183('0x7d')](_0x9183('0x91'),{'UserId':Number(_0xbf01f0['query'][_0x9183('0x8e')][_0x3151d5]),'ChatQueueId':Number(_0xbf01f0['params']['id'])});}}else{socket[_0x9183('0x7d')](_0x9183('0x91'),{'UserId':Number(_0xbf01f0[_0x9183('0x42')][_0x9183('0x8e')]),'ChatQueueId':Number(_0xbf01f0[_0x9183('0x62')]['id'])});}});}})[_0x9183('0x35')](respondWithStatusCode(_0x4242ff,null))[_0x9183('0x28')](handleError(_0x4242ff,null));};exports['getAgents']=function(_0x4742f,_0xe402e7,_0x68a5a0){var _0x584405={};var _0x5294a1={};var _0x235789;var _0x111f20;return db[_0x9183('0x3c')]['findOne']({'where':{'id':_0x4742f['params']['id']}})[_0x9183('0x35')](handleEntityNotFound(_0xe402e7,null))['then'](function(_0x737fca){if(_0x737fca){_0x235789=_0x737fca;_0x5294a1[_0x9183('0x41')]=_['keys'](db['User'][_0x9183('0x3d')]);_0x5294a1[_0x9183('0x42')]=_[_0x9183('0x43')](_0x4742f['query']);_0x5294a1['filters']=_['intersection'](_0x5294a1[_0x9183('0x41')],_0x5294a1['query']);_0x584405[_0x9183('0x46')]=_[_0x9183('0x45')](_0x5294a1[_0x9183('0x41')],qs['fields'](_0x4742f[_0x9183('0x42')][_0x9183('0x47')]));_0x584405[_0x9183('0x46')]=_0x584405[_0x9183('0x46')]['length']?_0x584405['attributes']:_0x5294a1[_0x9183('0x41')];_0x584405[_0x9183('0x97')]=qs[_0x9183('0x4a')](_0x4742f[_0x9183('0x42')][_0x9183('0x4a')]);_0x584405['where']=qs['filters'](_[_0x9183('0x4c')](_0x4742f[_0x9183('0x42')],_0x5294a1[_0x9183('0x44')]));if(_0x4742f['query'][_0x9183('0x4d')]){_0x584405[_0x9183('0x4b')]=_[_0x9183('0x4e')](_0x584405[_0x9183('0x4b')],{'$or':_['map'](_0x584405['attributes'],function(_0x118cfc){var _0x372fb4={};_0x372fb4[_0x118cfc]={'$like':'%'+_0x4742f['query'][_0x9183('0x4d')]+'%'};return _0x372fb4;})});}_0x584405=_[_0x9183('0x4e')]({},_0x584405,_0x4742f[_0x9183('0x51')]);return _0x235789['getAgents'](_0x584405);}})['then'](function(_0x2bedc0){if(_0x2bedc0){_0x111f20=_0x2bedc0[_0x9183('0x56')];if(!_0x4742f[_0x9183('0x42')]['hasOwnProperty'](_0x9183('0x49'))){_0x584405[_0x9183('0x2e')]=qs[_0x9183('0x2e')](_0x4742f[_0x9183('0x42')][_0x9183('0x2e')]);_0x584405[_0x9183('0x2c')]=qs[_0x9183('0x2c')](_0x4742f[_0x9183('0x42')][_0x9183('0x2c')]);}return _0x235789[_0x9183('0x98')](_0x584405);}})[_0x9183('0x35')](function(_0x23f8b0){if(_0x23f8b0){return _0x23f8b0?{'count':_0x111f20,'rows':_0x23f8b0}:null;}})['then'](respondWithResult(_0xe402e7,null))[_0x9183('0x28')](handleError(_0xe402e7,null));};
\ No newline at end of file
+var _0x3498=['intersection','fields','attributes','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','destroy','describe','getMembers','findOne','length','hasOwnProperty','pick','UserChatQueue','User','UserId','agent','chatPause','format','%s/%s','SIP','updatedAt','getTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','includes','all','union','compact','value','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','ChatQueues','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','keys','query','filters'];(function(_0x8beacd,_0x30436e){var _0xacc507=function(_0xf41ba9){while(--_0xf41ba9){_0x8beacd['push'](_0x8beacd['shift']());}};_0xacc507(++_0x30436e);}(_0x3498,0xed));var _0x8349=function(_0x9bff75,_0x3e051f){_0x9bff75=_0x9bff75-0x0;var _0x121481=_0x3498[_0x9bff75];return _0x121481;};'use strict';var emlformat=require(_0x8349('0x0'));var rimraf=require(_0x8349('0x1'));var zipdir=require(_0x8349('0x2'));var jsonpatch=require(_0x8349('0x3'));var rp=require(_0x8349('0x4'));var moment=require(_0x8349('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8349('0x6'));var util=require(_0x8349('0x7'));var path=require(_0x8349('0x8'));var sox=require('sox');var csv=require(_0x8349('0x9'));var ejs=require(_0x8349('0xa'));var fs=require('fs');var fs_extra=require(_0x8349('0xb'));var _=require(_0x8349('0xc'));var squel=require('squel');var crypto=require(_0x8349('0xd'));var jsforce=require(_0x8349('0xe'));var deskjs=require(_0x8349('0xf'));var toCsv=require(_0x8349('0x9'));var querystring=require(_0x8349('0x10'));var Papa=require(_0x8349('0x11'));var Redis=require(_0x8349('0x12'));var authService=require(_0x8349('0x13'));var qs=require(_0x8349('0x14'));var as=require(_0x8349('0x15'));var hardwareService=require(_0x8349('0x16'));var logger=require('../../config/logger')(_0x8349('0x17'));var utils=require(_0x8349('0x18'));var config=require(_0x8349('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8349('0x1a'))['db'];config[_0x8349('0x1b')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8349('0x1c'))(new Redis(config[_0x8349('0x1b')]));require(_0x8349('0x1d'))[_0x8349('0x1e')](socket);var jayson=require(_0x8349('0x1f'));var client=jayson[_0x8349('0x20')][_0x8349('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3e3660,_0x3d12c0,_0xa4c321,_0x3f1ccb){return new BPromise(function(_0x2e40c0,_0x3ac284){var _0xb8c509=_0x3f1ccb||client;return _0xb8c509[_0x8349('0x22')](_0x3e3660,_0xa4c321)['then'](function(_0x25c4ec){logger[_0x8349('0x23')]('ChatQueue,\x20%s,\x20%s',_0x3d12c0,_0x8349('0x24'));logger[_0x8349('0x25')](_0x8349('0x26'),_0x3d12c0,_0x8349('0x24'),JSON[_0x8349('0x27')](_0x25c4ec));if(_0x25c4ec['error']){if(_0x25c4ec['error']['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x3d12c0,_0x25c4ec[_0x8349('0x28')][_0x8349('0x29')]);return _0x3ac284(_0x25c4ec[_0x8349('0x28')][_0x8349('0x29')]);}logger[_0x8349('0x28')](_0x8349('0x2a'),_0x3d12c0,_0x25c4ec[_0x8349('0x28')][_0x8349('0x29')]);return _0x2e40c0(_0x25c4ec[_0x8349('0x28')]['message']);}else{logger[_0x8349('0x23')](_0x8349('0x2a'),_0x3d12c0,_0x8349('0x24'));_0x2e40c0(_0x25c4ec[_0x8349('0x2b')]['message']);}})[_0x8349('0x2c')](function(_0x2a3e72){logger[_0x8349('0x28')](_0x8349('0x2a'),_0x3d12c0,_0x2a3e72);_0x3ac284(_0x2a3e72);});});}function respondWithStatusCode(_0x1247cc,_0x512c2b){_0x512c2b=_0x512c2b||0xcc;return function(_0x3ebaa6){if(_0x3ebaa6){return _0x1247cc[_0x8349('0x2d')](_0x512c2b);}return _0x1247cc[_0x8349('0x2e')](_0x512c2b)[_0x8349('0x2f')]();};}function respondWithResult(_0x1f71a0,_0x5c83ed){_0x5c83ed=_0x5c83ed||0xc8;return function(_0x20fc04){if(_0x20fc04){return _0x1f71a0[_0x8349('0x2e')](_0x5c83ed)[_0x8349('0x30')](_0x20fc04);}};}function respondWithFilteredResult(_0x2eda61,_0x24a0b8){return function(_0x70a355){if(_0x70a355){var _0x3dda69=typeof _0x24a0b8[_0x8349('0x31')]===_0x8349('0x32')&&typeof _0x24a0b8[_0x8349('0x33')]===_0x8349('0x32');var _0x15cd69=_0x70a355['count'];var _0x19928f=_0x3dda69?0x0:_0x24a0b8[_0x8349('0x31')];var _0x25c89f=_0x3dda69?_0x70a355[_0x8349('0x34')]:_0x24a0b8[_0x8349('0x31')]+_0x24a0b8['limit'];var _0x38a113;if(_0x25c89f>=_0x15cd69){_0x25c89f=_0x15cd69;_0x38a113=0xc8;}else{_0x38a113=0xce;}_0x2eda61[_0x8349('0x2e')](_0x38a113);return _0x2eda61[_0x8349('0x35')]('Content-Range',_0x19928f+'-'+_0x25c89f+'/'+_0x15cd69)[_0x8349('0x30')](_0x70a355);}return null;};}function patchUpdates(_0x592d3e){return function(_0x525bc1){try{jsonpatch[_0x8349('0x36')](_0x525bc1,_0x592d3e,!![]);}catch(_0x57e31a){return BPromise[_0x8349('0x37')](_0x57e31a);}return _0x525bc1[_0x8349('0x38')]();};}function saveUpdates(_0x17c76e,_0x36c72d){return function(_0x4957a4){if(_0x4957a4){return _0x4957a4[_0x8349('0x39')](_0x17c76e)['then'](function(_0x58d10d){return _0x58d10d;});}return null;};}function removeEntity(_0x17f987,_0x27d53b){return function(_0x351155){if(_0x351155){return _0x351155['destroy']()[_0x8349('0x3a')](function(){var _0x290265=_0x351155['get']({'plain':!![]});var _0x554280=_0x8349('0x3b');return db[_0x8349('0x3c')]['destroy']({'where':{'type':_0x554280,'resourceId':_0x290265['id']}})[_0x8349('0x3a')](function(){return _0x351155;});})[_0x8349('0x3a')](function(){_0x17f987['status'](0xcc)[_0x8349('0x2f')]();});}};}function handleEntityNotFound(_0x46d644,_0x4af2ae){return function(_0x590a1b){if(!_0x590a1b){_0x46d644[_0x8349('0x2d')](0x194);}return _0x590a1b;};}function handleError(_0x6a744f,_0x1e8f1f){_0x1e8f1f=_0x1e8f1f||0x1f4;return function(_0x1fd70a){logger[_0x8349('0x28')](_0x1fd70a['stack']);if(_0x1fd70a['name']){delete _0x1fd70a[_0x8349('0x3d')];}_0x6a744f[_0x8349('0x2e')](_0x1e8f1f)[_0x8349('0x3e')](_0x1fd70a);};}exports[_0x8349('0x3f')]=function(_0x35ede8,_0x125f27){var _0x3c9255={},_0x45ee56={},_0x235913={'count':0x0,'rows':[]};var _0x2c1d30=_[_0x8349('0x40')](db[_0x8349('0x41')][_0x8349('0x42')],function(_0x10d8b3){return{'name':_0x10d8b3[_0x8349('0x43')],'type':_0x10d8b3[_0x8349('0x44')]['key']};});_0x45ee56[_0x8349('0x45')]=_['map'](_0x2c1d30,'name');_0x45ee56['query']=_[_0x8349('0x46')](_0x35ede8[_0x8349('0x47')]);_0x45ee56[_0x8349('0x48')]=_[_0x8349('0x49')](_0x45ee56[_0x8349('0x45')],_0x45ee56['query']);_0x3c9255['attributes']=_[_0x8349('0x49')](_0x45ee56['model'],qs[_0x8349('0x4a')](_0x35ede8[_0x8349('0x47')][_0x8349('0x4a')]));_0x3c9255[_0x8349('0x4b')]=_0x3c9255[_0x8349('0x4b')]['length']?_0x3c9255[_0x8349('0x4b')]:_0x45ee56[_0x8349('0x45')];if(!_0x35ede8['query']['hasOwnProperty'](_0x8349('0x4c'))){_0x3c9255[_0x8349('0x33')]=qs[_0x8349('0x33')](_0x35ede8[_0x8349('0x47')]['limit']);_0x3c9255[_0x8349('0x31')]=qs[_0x8349('0x31')](_0x35ede8[_0x8349('0x47')][_0x8349('0x31')]);}_0x3c9255[_0x8349('0x4d')]=qs['sort'](_0x35ede8[_0x8349('0x47')][_0x8349('0x4e')]);_0x3c9255[_0x8349('0x4f')]=qs[_0x8349('0x48')](_['pick'](_0x35ede8[_0x8349('0x47')],_0x45ee56[_0x8349('0x48')]),_0x2c1d30);if(_0x35ede8[_0x8349('0x47')][_0x8349('0x50')]){_0x3c9255[_0x8349('0x4f')]=_['merge'](_0x3c9255[_0x8349('0x4f')],{'$or':_['map'](_0x2c1d30,function(_0x268e68){if(_0x268e68[_0x8349('0x44')]!==_0x8349('0x51')){var _0x2d95a0={};_0x2d95a0[_0x268e68[_0x8349('0x3d')]]={'$like':'%'+_0x35ede8[_0x8349('0x47')][_0x8349('0x50')]+'%'};return _0x2d95a0;}})});}_0x3c9255=_[_0x8349('0x52')]({},_0x3c9255,_0x35ede8[_0x8349('0x53')]);var _0x526e72={'where':_0x3c9255[_0x8349('0x4f')]};return db[_0x8349('0x41')]['count'](_0x526e72)[_0x8349('0x3a')](function(_0x31f8c5){_0x235913[_0x8349('0x34')]=_0x31f8c5;if(_0x35ede8['query'][_0x8349('0x54')]){_0x3c9255[_0x8349('0x55')]=[{'all':!![]}];}return db[_0x8349('0x41')][_0x8349('0x56')](_0x3c9255);})[_0x8349('0x3a')](function(_0x12a0b4){_0x235913[_0x8349('0x57')]=_0x12a0b4;return _0x235913;})[_0x8349('0x3a')](respondWithFilteredResult(_0x125f27,_0x3c9255))[_0x8349('0x2c')](handleError(_0x125f27,null));};exports[_0x8349('0x58')]=function(_0xf6f1d2,_0x2192e6){var _0x388306={'raw':!![],'where':{'id':_0xf6f1d2['params']['id']}},_0x240e64={};_0x240e64[_0x8349('0x45')]=_[_0x8349('0x46')](db[_0x8349('0x41')]['rawAttributes']);_0x240e64[_0x8349('0x47')]=_[_0x8349('0x46')](_0xf6f1d2[_0x8349('0x47')]);_0x240e64[_0x8349('0x48')]=_[_0x8349('0x49')](_0x240e64[_0x8349('0x45')],_0x240e64[_0x8349('0x47')]);_0x388306[_0x8349('0x4b')]=_['intersection'](_0x240e64['model'],qs['fields'](_0xf6f1d2[_0x8349('0x47')][_0x8349('0x4a')]));_0x388306['attributes']=_0x388306[_0x8349('0x4b')]['length']?_0x388306[_0x8349('0x4b')]:_0x240e64['model'];if(_0xf6f1d2[_0x8349('0x47')][_0x8349('0x54')]){_0x388306[_0x8349('0x55')]=[{'all':!![]}];}_0x388306=_[_0x8349('0x52')]({},_0x388306,_0xf6f1d2[_0x8349('0x53')]);return db[_0x8349('0x41')][_0x8349('0x59')](_0x388306)[_0x8349('0x3a')](handleEntityNotFound(_0x2192e6,null))['then'](respondWithResult(_0x2192e6,null))['catch'](handleError(_0x2192e6,null));};exports[_0x8349('0x5a')]=function(_0x3db7cc,_0x3103e0){return db[_0x8349('0x41')][_0x8349('0x5a')](_0x3db7cc['body'],{})[_0x8349('0x3a')](function(_0xaade27){var _0x254924=_0x3db7cc['user'][_0x8349('0x5b')]({'plain':!![]});if(!_0x254924)throw new Error(_0x8349('0x5c'));if(_0x254924[_0x8349('0x5d')]===_0x8349('0x5e')){var _0x237ea6=_0xaade27[_0x8349('0x5b')]({'plain':!![]});var _0x225695=_0x8349('0x3b');return db[_0x8349('0x5f')][_0x8349('0x59')]({'where':{'name':_0x225695,'userProfileId':_0x254924[_0x8349('0x60')]},'raw':!![]})[_0x8349('0x3a')](function(_0x4901b1){if(_0x4901b1&&_0x4901b1['autoAssociation']===0x0){return db[_0x8349('0x3c')][_0x8349('0x5a')]({'name':_0x237ea6[_0x8349('0x3d')],'resourceId':_0x237ea6['id'],'type':_0x4901b1[_0x8349('0x3d')],'sectionId':_0x4901b1['id']},{})[_0x8349('0x3a')](function(){return _0xaade27;});}else{return _0xaade27;}})['catch'](function(_0x2c3683){logger[_0x8349('0x28')](_0x8349('0x61'),_0x2c3683);throw _0x2c3683;});}return _0xaade27;})[_0x8349('0x3a')](respondWithResult(_0x3103e0,0xc9))[_0x8349('0x2c')](handleError(_0x3103e0,null));};exports['update']=function(_0x4b8ae2,_0x4350a9){if(_0x4b8ae2['body']['id']){delete _0x4b8ae2['body']['id'];}return db[_0x8349('0x41')][_0x8349('0x59')]({'where':{'id':_0x4b8ae2[_0x8349('0x62')]['id']}})['then'](handleEntityNotFound(_0x4350a9,null))[_0x8349('0x3a')](saveUpdates(_0x4b8ae2[_0x8349('0x63')],null))[_0x8349('0x3a')](respondWithResult(_0x4350a9,null))[_0x8349('0x2c')](handleError(_0x4350a9,null));};exports[_0x8349('0x64')]=function(_0x277ad3,_0x31340a){return db[_0x8349('0x41')][_0x8349('0x59')]({'where':{'id':_0x277ad3[_0x8349('0x62')]['id']}})[_0x8349('0x3a')](handleEntityNotFound(_0x31340a,null))[_0x8349('0x3a')](removeEntity(_0x31340a,null))[_0x8349('0x2c')](handleError(_0x31340a,null));};exports[_0x8349('0x65')]=function(_0x335132,_0x410ac6){return db[_0x8349('0x41')][_0x8349('0x65')]()[_0x8349('0x3a')](respondWithResult(_0x410ac6,null))[_0x8349('0x2c')](handleError(_0x410ac6,null));};exports[_0x8349('0x66')]=function(_0xb7167e,_0x1ad09a,_0x58e263){var _0x32922b={'raw':!![],'where':{}},_0x3957f7={},_0x3bd229;return db[_0x8349('0x41')][_0x8349('0x67')]({'where':{'id':_0xb7167e['params']['id']}})[_0x8349('0x3a')](handleEntityNotFound(_0x1ad09a,null))[_0x8349('0x3a')](function(_0x1e112a){if(_0x1e112a){_0x3bd229=_0x1e112a[_0x8349('0x5b')]({'plain':!![]});_0x3957f7['model']=_[_0x8349('0x46')](db['UserChatQueue'][_0x8349('0x42')]);_0x3957f7['query']=_['keys'](_0xb7167e[_0x8349('0x47')]);_0x3957f7[_0x8349('0x48')]=_[_0x8349('0x49')](_0x3957f7['model'],_0x3957f7[_0x8349('0x47')]);_0x32922b[_0x8349('0x4b')]=_[_0x8349('0x49')](_0x3957f7[_0x8349('0x45')],qs[_0x8349('0x4a')](_0xb7167e[_0x8349('0x47')]['fields']));_0x32922b[_0x8349('0x4b')]=_0x32922b[_0x8349('0x4b')][_0x8349('0x68')]?_0x32922b[_0x8349('0x4b')]:_0x3957f7[_0x8349('0x45')];if(!_0xb7167e[_0x8349('0x47')][_0x8349('0x69')](_0x8349('0x4c'))){_0x32922b[_0x8349('0x33')]=qs[_0x8349('0x33')](_0xb7167e[_0x8349('0x47')][_0x8349('0x33')]);_0x32922b[_0x8349('0x31')]=qs[_0x8349('0x31')](_0xb7167e[_0x8349('0x47')][_0x8349('0x31')]);}_0x32922b[_0x8349('0x4d')]=qs[_0x8349('0x4e')](_0xb7167e['query'][_0x8349('0x4e')]);_0x32922b[_0x8349('0x4f')]=qs['filters'](_[_0x8349('0x6a')](_0xb7167e[_0x8349('0x47')],_0x3957f7[_0x8349('0x48')]));_0x32922b[_0x8349('0x4f')]['ChatQueueId']=_0x1e112a['id'];if(_0xb7167e['query'][_0x8349('0x50')]){_0x32922b[_0x8349('0x4f')]=_['merge'](_0x32922b['where'],{'$or':_[_0x8349('0x40')](_0x32922b['attributes'],function(_0x546b28){var _0x4d5459={};_0x4d5459[_0x546b28]={'$like':'%'+_0xb7167e['query'][_0x8349('0x50')]+'%'};return _0x4d5459;})});}_0x32922b=_['merge']({},_0x32922b,_0xb7167e[_0x8349('0x53')]);return db[_0x8349('0x6b')]['findAll'](_0x32922b);}})[_0x8349('0x3a')](function(_0x42664d){if(_0x42664d){return db[_0x8349('0x6c')]['findAndCountAll']({'where':{'id':_[_0x8349('0x40')](_0x42664d,_0x8349('0x6d')),'role':_0x8349('0x6e')},'attributes':['id',_0x8349('0x3d'),_0x8349('0x6f'),'updatedAt','createdAt']});}})[_0x8349('0x3a')](function(_0x237320){if(_0x237320){return{'count':_0x237320[_0x8349('0x34')],'rows':_['map'](_0x237320[_0x8349('0x57')],function(_0x14c243){return{'membername':_0x14c243[_0x8349('0x3d')],'UserId':_0x14c243['id'],'queue_name':_0x3bd229[_0x8349('0x3d')],'ChatQueueId':_0x3bd229['id'],'interface':util[_0x8349('0x70')](_0x8349('0x71'),_0x8349('0x72'),_0x14c243[_0x8349('0x3d')]),'penalty':0x0,'paused':_0x14c243[_0x8349('0x6f')],'createdAt':_0x14c243['createdAt'],'updatedAt':_0x14c243[_0x8349('0x73')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8349('0x3a')](respondWithFilteredResult(_0x1ad09a,_0x32922b))['catch'](handleError(_0x1ad09a,null));};exports[_0x8349('0x74')]=function(_0xd05efb,_0x3df37e,_0x1d2748){var _0x380fca={};var _0x2ca72c={};var _0x431711;var _0x554631;return db[_0x8349('0x41')][_0x8349('0x67')]({'where':{'id':_0xd05efb['params']['id']}})[_0x8349('0x3a')](handleEntityNotFound(_0x3df37e,null))[_0x8349('0x3a')](function(_0x44e3ec){if(_0x44e3ec){_0x431711=_0x44e3ec;_0x2ca72c[_0x8349('0x45')]=_[_0x8349('0x46')](db['Team']['rawAttributes']);_0x2ca72c[_0x8349('0x47')]=_['keys'](_0xd05efb['query']);_0x2ca72c['filters']=_[_0x8349('0x49')](_0x2ca72c['model'],_0x2ca72c['query']);_0x380fca['attributes']=_[_0x8349('0x49')](_0x2ca72c[_0x8349('0x45')],qs[_0x8349('0x4a')](_0xd05efb[_0x8349('0x47')]['fields']));_0x380fca[_0x8349('0x4b')]=_0x380fca[_0x8349('0x4b')][_0x8349('0x68')]?_0x380fca[_0x8349('0x4b')]:_0x2ca72c[_0x8349('0x45')];_0x380fca[_0x8349('0x4d')]=qs[_0x8349('0x4e')](_0xd05efb[_0x8349('0x47')][_0x8349('0x4e')]);_0x380fca[_0x8349('0x4f')]=qs['filters'](_[_0x8349('0x6a')](_0xd05efb[_0x8349('0x47')],_0x2ca72c['filters']));if(_0xd05efb[_0x8349('0x47')]['filter']){_0x380fca[_0x8349('0x4f')]=_[_0x8349('0x52')](_0x380fca['where'],{'$or':_[_0x8349('0x40')](_0x380fca['attributes'],function(_0x2e0aef){var _0x1c1373={};_0x1c1373[_0x2e0aef]={'$like':'%'+_0xd05efb['query'][_0x8349('0x50')]+'%'};return _0x1c1373;})});}_0x380fca=_['merge']({},_0x380fca,_0xd05efb[_0x8349('0x53')]);return _0x431711[_0x8349('0x74')](_0x380fca);}})[_0x8349('0x3a')](function(_0x2e3302){if(_0x2e3302){_0x554631=_0x2e3302['length'];if(!_0xd05efb[_0x8349('0x47')]['hasOwnProperty'](_0x8349('0x4c'))){_0x380fca['limit']=qs[_0x8349('0x33')](_0xd05efb[_0x8349('0x47')][_0x8349('0x33')]);_0x380fca[_0x8349('0x31')]=qs['offset'](_0xd05efb['query']['offset']);}return _0x431711[_0x8349('0x74')](_0x380fca);}})[_0x8349('0x3a')](function(_0x19989c){if(_0x19989c){return _0x19989c?{'count':_0x554631,'rows':_0x19989c}:null;}})[_0x8349('0x3a')](respondWithResult(_0x3df37e,null))[_0x8349('0x2c')](handleError(_0x3df37e,null));};exports['addTeams']=function(_0x139ab9,_0x164bef,_0x63342f){var _0x101992=_0x139ab9[_0x8349('0x63')][_0x8349('0x75')];return db['Team'][_0x8349('0x56')]({'where':{'id':_0x101992},'attributes':['id'],'include':[{'model':db[_0x8349('0x6c')],'as':_0x8349('0x76'),'attributes':['id',_0x8349('0x3d'),_0x8349('0x77'),'voicePause',_0x8349('0x78')],'raw':!![]}]})[_0x8349('0x3a')](function(_0x5f0147){if(_0x5f0147){var _0x2a6c65=_[_0x8349('0x79')](_0x5f0147,function(_0x41f62b){var _0x4072e6=_0x41f62b[_0x8349('0x5b')]({'plain':!![]});return _0x4072e6[_0x8349('0x76')];});return db['ChatQueue'][_0x8349('0x59')]({'where':{'id':_0x139ab9[_0x8349('0x62')]['id']}})[_0x8349('0x3a')](function(_0x2e6500){return db[_0x8349('0x7a')][_0x8349('0x7b')](function(_0x2d5653){return _0x2e6500['addTeams'](_0x101992,{'transaction':_0x2d5653})[_0x8349('0x3a')](function(){return BPromise[_0x8349('0x7c')](_0x2a6c65,function(_0x2074f2){return db['UserChatQueue'][_0x8349('0x7d')]({'where':{'UserId':_0x2074f2['id'],'ChatQueueId':_0x139ab9[_0x8349('0x62')]['id']},'transaction':_0x2d5653});});})['then'](function(){_0x2a6c65['forEach'](function(_0x44d153){socket[_0x8349('0x7e')](_0x8349('0x7f'),{'UserId':_0x44d153['id'],'ChatQueueId':_0x2e6500['id']});});});});});}})[_0x8349('0x3a')](respondWithStatusCode(_0x164bef,null))[_0x8349('0x2c')](handleError(_0x164bef,null));};exports[_0x8349('0x80')]=function(_0x47b6d5,_0x1fdaa0,_0x45f749){return db['Team'][_0x8349('0x56')]({'where':{'id':_0x47b6d5[_0x8349('0x47')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8349('0x6c')],'as':_0x8349('0x76'),'attributes':['id'],'raw':!![]}]})[_0x8349('0x3a')](handleEntityNotFound(_0x1fdaa0,null))[_0x8349('0x3a')](function(_0x592966){var _0x3b6c6b=_[_0x8349('0x40')](_0x592966,'id');var _0x2551e2=[];var _0x881407=[];var _0x34a961=squel[_0x8349('0x81')]();_0x34a961[_0x8349('0x82')](_0x8349('0x83'))[_0x8349('0x84')]('team_has_chat_queues','tq')[_0x8349('0x85')](_0x8349('0x86'),'ut',_0x8349('0x87'))[_0x8349('0x4f')](_0x8349('0x88'),_0x47b6d5[_0x8349('0x62')]['id']);for(var _0x26dc13=0x0;_0x26dc13<_0x592966['length'];_0x26dc13+=0x1){let _0x31c828=_0x592966[_0x26dc13];for(var _0x4a1405=0x0;_0x4a1405<_0x31c828['Agents'][_0x8349('0x68')];_0x4a1405+=0x1){let _0x387538=_0x31c828[_0x8349('0x76')][_0x4a1405];var _0x46c9d4=_0x34a961[_0x8349('0x89')]();_0x46c9d4['where'](_0x8349('0x8a'),_0x387538['id']);_0x881407['push'](db[_0x8349('0x7a')][_0x8349('0x47')](_0x46c9d4[_0x8349('0x8b')](),{'type':db['sequelize'][_0x8349('0x8c')]['SELECT']})[_0x8349('0x3a')](function(_0x402edf){if(_0x402edf[_0x8349('0x68')]===0x1){return _0x387538['id'];}else{var _0x248480=_[_0x8349('0x8d')](_[_0x8349('0x40')](_0x402edf,'TeamId'),function(_0x1bb6ca){return _[_0x8349('0x8e')](_0x3b6c6b,_0x1bb6ca);});if(_0x248480){return _0x387538['id'];}}}));}}return BPromise[_0x8349('0x8f')](_0x881407)[_0x8349('0x3a')](function(_0x1e0bd9){_0x2551e2=_(_0x2551e2)[_0x8349('0x90')](_0x1e0bd9)[_0x8349('0x91')]()[_0x8349('0x92')]();return db['ChatQueue'][_0x8349('0x59')]({'where':{'id':_0x47b6d5['params']['id']}})[_0x8349('0x3a')](function(_0x185019){return db[_0x8349('0x7a')][_0x8349('0x7b')](function(_0x5532bd){return _0x185019['removeTeams'](_0x47b6d5[_0x8349('0x47')]['ids'],{'transaction':_0x5532bd})[_0x8349('0x3a')](function(){if(!_['isEmpty'](_0x2551e2)){return _0x185019[_0x8349('0x93')](_0x2551e2,{'transaction':_0x5532bd});}})[_0x8349('0x3a')](function(){_0x2551e2[_0x8349('0x94')](function(_0x49aa5f){socket[_0x8349('0x7e')](_0x8349('0x95'),{'UserId':_0x49aa5f,'ChatQueueId':_0x185019['id']});});});});});});})[_0x8349('0x3a')](respondWithStatusCode(_0x1fdaa0,null))[_0x8349('0x2c')](handleError(_0x1fdaa0,null));};exports[_0x8349('0x96')]=function(_0x16bcd9,_0x24042a,_0x542b57){return db[_0x8349('0x41')]['find']({'where':{'id':_0x16bcd9[_0x8349('0x62')]['id']}})[_0x8349('0x3a')](handleEntityNotFound(_0x24042a,null))[_0x8349('0x3a')](function(_0x279215){if(_0x279215){return _0x279215[_0x8349('0x96')](_0x16bcd9[_0x8349('0x63')][_0x8349('0x75')],_[_0x8349('0x97')](_0x16bcd9[_0x8349('0x63')],[_0x8349('0x75'),'id'])||{})[_0x8349('0x98')](function(_0x3ffc37){for(var _0x1df54d=0x0;_0x1df54d<_0x16bcd9['body'][_0x8349('0x75')][_0x8349('0x68')];_0x1df54d+=0x1){socket[_0x8349('0x7e')](_0x8349('0x7f'),{'UserId':Number(_0x16bcd9[_0x8349('0x63')][_0x8349('0x75')][_0x1df54d]),'ChatQueueId':Number(_0x16bcd9[_0x8349('0x62')]['id'])});}return _0x3ffc37;});}})[_0x8349('0x3a')](respondWithResult(_0x24042a,null))['catch'](handleError(_0x24042a,null));};exports[_0x8349('0x93')]=function(_0x717630,_0x3d4319,_0x477398){return db[_0x8349('0x41')]['find']({'where':{'id':_0x717630[_0x8349('0x62')]['id']}})[_0x8349('0x3a')](handleEntityNotFound(_0x3d4319,null))[_0x8349('0x3a')](function(_0x506443){if(_0x506443){return _0x506443[_0x8349('0x93')](_0x717630[_0x8349('0x47')]['ids'])[_0x8349('0x3a')](function(){if(_[_0x8349('0x99')](_0x717630[_0x8349('0x47')][_0x8349('0x75')])){for(var _0x5b4da1=0x0;_0x5b4da1<_0x717630[_0x8349('0x47')][_0x8349('0x75')][_0x8349('0x68')];_0x5b4da1+=0x1){socket[_0x8349('0x7e')](_0x8349('0x95'),{'UserId':Number(_0x717630[_0x8349('0x47')][_0x8349('0x75')][_0x5b4da1]),'ChatQueueId':Number(_0x717630[_0x8349('0x62')]['id'])});}}else{socket[_0x8349('0x7e')](_0x8349('0x95'),{'UserId':Number(_0x717630[_0x8349('0x47')][_0x8349('0x75')]),'ChatQueueId':Number(_0x717630[_0x8349('0x62')]['id'])});}});}})[_0x8349('0x3a')](respondWithStatusCode(_0x3d4319,null))[_0x8349('0x2c')](handleError(_0x3d4319,null));};exports[_0x8349('0x9a')]=function(_0x105326,_0x4dcbea,_0x1c048e){var _0x4acd6a={};var _0x13b969={};var _0x3e6dc2;var _0x2ba177;return db['ChatQueue'][_0x8349('0x67')]({'where':{'id':_0x105326[_0x8349('0x62')]['id']}})['then'](handleEntityNotFound(_0x4dcbea,null))[_0x8349('0x3a')](function(_0x256a66){if(_0x256a66){_0x3e6dc2=_0x256a66;_0x13b969[_0x8349('0x45')]=_[_0x8349('0x46')](db[_0x8349('0x6c')][_0x8349('0x42')]);_0x13b969[_0x8349('0x47')]=_[_0x8349('0x46')](_0x105326[_0x8349('0x47')]);_0x13b969['filters']=_[_0x8349('0x49')](_0x13b969[_0x8349('0x45')],_0x13b969[_0x8349('0x47')]);_0x4acd6a[_0x8349('0x4b')]=_['intersection'](_0x13b969['model'],qs[_0x8349('0x4a')](_0x105326[_0x8349('0x47')][_0x8349('0x4a')]));_0x4acd6a['attributes']=_0x4acd6a['attributes']['length']?_0x4acd6a['attributes']:_0x13b969['model'];_0x4acd6a[_0x8349('0x4d')]=qs['sort'](_0x105326[_0x8349('0x47')][_0x8349('0x4e')]);_0x4acd6a[_0x8349('0x4f')]=qs[_0x8349('0x48')](_[_0x8349('0x6a')](_0x105326[_0x8349('0x47')],_0x13b969['filters']));if(_0x105326['query'][_0x8349('0x50')]){_0x4acd6a['where']=_[_0x8349('0x52')](_0x4acd6a[_0x8349('0x4f')],{'$or':_[_0x8349('0x40')](_0x4acd6a[_0x8349('0x4b')],function(_0x3673e2){var _0x3517af={};_0x3517af[_0x3673e2]={'$like':'%'+_0x105326[_0x8349('0x47')][_0x8349('0x50')]+'%'};return _0x3517af;})});}_0x4acd6a=_[_0x8349('0x52')]({},_0x4acd6a,_0x105326['options']);return _0x3e6dc2[_0x8349('0x9a')](_0x4acd6a);}})['then'](function(_0x15c49f){if(_0x15c49f){_0x2ba177=_0x15c49f[_0x8349('0x68')];if(!_0x105326['query']['hasOwnProperty'](_0x8349('0x4c'))){_0x4acd6a[_0x8349('0x33')]=qs[_0x8349('0x33')](_0x105326[_0x8349('0x47')][_0x8349('0x33')]);_0x4acd6a[_0x8349('0x31')]=qs['offset'](_0x105326['query'][_0x8349('0x31')]);}return _0x3e6dc2[_0x8349('0x9a')](_0x4acd6a);}})[_0x8349('0x3a')](function(_0x241c2f){if(_0x241c2f){return _0x241c2f?{'count':_0x2ba177,'rows':_0x241c2f}:null;}})[_0x8349('0x3a')](respondWithResult(_0x4dcbea,null))[_0x8349('0x2c')](handleError(_0x4dcbea,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 4ad427c..b1b06db 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 _0x5d25=['events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2ee35a,_0x3f75b0){var _0x1e1230=function(_0x3c51e2){while(--_0x3c51e2){_0x2ee35a['push'](_0x2ee35a['shift']());}};_0x1e1230(++_0x3f75b0);}(_0x5d25,0x117));var _0x55d2=function(_0x1b7178,_0x1cfbdc){_0x1b7178=_0x1b7178-0x0;var _0x596867=_0x5d25[_0x1b7178];return _0x596867;};'use strict';var EventEmitter=require(_0x55d2('0x0'));var ChatQueue=require(_0x55d2('0x1'))['db'][_0x55d2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x55d2('0x3')](0x0);var events={'afterCreate':_0x55d2('0x4'),'afterUpdate':_0x55d2('0x5'),'afterDestroy':_0x55d2('0x6')};function emitEvent(_0x1b3f53){return function(_0x4621eb,_0x3fac46,_0x35051e){ChatQueueEvents['emit'](_0x1b3f53+':'+_0x4621eb['id'],_0x4621eb);ChatQueueEvents[_0x55d2('0x7')](_0x1b3f53,_0x4621eb);_0x35051e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x55d2('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0xc108=['hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2daafe,_0x588e2d){var _0x3272ab=function(_0x111f9b){while(--_0x111f9b){_0x2daafe['push'](_0x2daafe['shift']());}};_0x3272ab(++_0x588e2d);}(_0xc108,0xe9));var _0x8c10=function(_0x12cb8a,_0x320794){_0x12cb8a=_0x12cb8a-0x0;var _0x204f7a=_0xc108[_0x12cb8a];return _0x204f7a;};'use strict';var EventEmitter=require(_0x8c10('0x0'));var ChatQueue=require(_0x8c10('0x1'))['db'][_0x8c10('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8c10('0x3')](0x0);var events={'afterCreate':_0x8c10('0x4'),'afterUpdate':_0x8c10('0x5'),'afterDestroy':_0x8c10('0x6')};function emitEvent(_0x15e699){return function(_0xec2872,_0x59bcfe,_0x346ca2){ChatQueueEvents[_0x8c10('0x7')](_0x15e699+':'+_0xec2872['id'],_0xec2872);ChatQueueEvents[_0x8c10('0x7')](_0x15e699,_0xec2872);_0x346ca2(null);};}for(var e in events){if(events[_0x8c10('0x8')](e)){var event=events[e];ChatQueue[_0x8c10('0x9')](e,emitEvent(event));}}module[_0x8c10('0xa')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 2457405..bd9dbae 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 _0xc8aa=['bluebird','request-promise','path','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util','../../config/logger','api','moment'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xc8aa,0x98));var _0xac8a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc8aa[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xac8a('0x0'));var logger=require(_0xac8a('0x1'))(_0xac8a('0x2'));var moment=require(_0xac8a('0x3'));var BPromise=require(_0xac8a('0x4'));var rp=require(_0xac8a('0x5'));var fs=require('fs');var path=require(_0xac8a('0x6'));var rimraf=require('rimraf');var config=require(_0xac8a('0x7'));var attributes=require(_0xac8a('0x8'));module[_0xac8a('0x9')]=function(_0x65e486,_0x798a97){return _0x65e486[_0xac8a('0xa')](_0xac8a('0xb'),attributes,{'tableName':_0xac8a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4699=['./chatQueue.attributes','ChatQueue','chat_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1e0157,_0x384e12){var _0x2b17ce=function(_0x2e258a){while(--_0x2e258a){_0x1e0157['push'](_0x1e0157['shift']());}};_0x2b17ce(++_0x384e12);}(_0x4699,0x7b));var _0x9469=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4699[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9469('0x0'))(_0x9469('0x1'));var moment=require(_0x9469('0x2'));var BPromise=require(_0x9469('0x3'));var rp=require(_0x9469('0x4'));var fs=require('fs');var path=require(_0x9469('0x5'));var rimraf=require(_0x9469('0x6'));var config=require('../../config/environment');var attributes=require(_0x9469('0x7'));module['exports']=function(_0x247b63,_0x375b32){return _0x247b63['define'](_0x9469('0x8'),attributes,{'tableName':_0x9469('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index f3dc66f..0d43282 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 _0xfbe6=['register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowChatQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatQueue.socket'];(function(_0x17c188,_0x39a5b9){var _0xcb1f55=function(_0x4e7ea3){while(--_0x4e7ea3){_0x17c188['push'](_0x17c188['shift']());}};_0xcb1f55(++_0x39a5b9);}(_0xfbe6,0x6d));var _0x6fbe=function(_0x2a590d,_0x2f8f75){_0x2a590d=_0x2a590d-0x0;var _0x57f4bd=_0xfbe6[_0x2a590d];return _0x57f4bd;};'use strict';var _=require(_0x6fbe('0x0'));var util=require(_0x6fbe('0x1'));var moment=require(_0x6fbe('0x2'));var BPromise=require('bluebird');var rs=require(_0x6fbe('0x3'));var fs=require('fs');var Redis=require(_0x6fbe('0x4'));var db=require(_0x6fbe('0x5'))['db'];var utils=require(_0x6fbe('0x6'));var logger=require(_0x6fbe('0x7'))(_0x6fbe('0x8'));var config=require(_0x6fbe('0x9'));var jayson=require(_0x6fbe('0xa'));var client=jayson[_0x6fbe('0xb')][_0x6fbe('0xc')]({'port':0x232a});config['redis']=_[_0x6fbe('0xd')](config[_0x6fbe('0xe')],{'host':_0x6fbe('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6fbe('0xe')]));require(_0x6fbe('0x10'))[_0x6fbe('0x11')](socket);function respondWithRpcPromise(_0xf52557,_0x156d44,_0xbc5490){return new BPromise(function(_0x2440a8,_0xabb67){return client[_0x6fbe('0x12')](_0xf52557,_0xbc5490)[_0x6fbe('0x13')](function(_0x57ba06){logger[_0x6fbe('0x14')](_0x6fbe('0x15'),_0x156d44,_0x6fbe('0x16'));logger[_0x6fbe('0x17')](_0x6fbe('0x18'),_0x156d44,_0x6fbe('0x16'),JSON[_0x6fbe('0x19')](_0x57ba06));if(_0x57ba06[_0x6fbe('0x1a')]){if(_0x57ba06['error']['code']===0x1f4){logger[_0x6fbe('0x1a')](_0x6fbe('0x15'),_0x156d44,_0x57ba06[_0x6fbe('0x1a')]['message']);return _0xabb67(_0x57ba06[_0x6fbe('0x1a')][_0x6fbe('0x1b')]);}logger[_0x6fbe('0x1a')](_0x6fbe('0x15'),_0x156d44,_0x57ba06[_0x6fbe('0x1a')][_0x6fbe('0x1b')]);return _0x2440a8(_0x57ba06[_0x6fbe('0x1a')][_0x6fbe('0x1b')]);}else{logger['info'](_0x6fbe('0x15'),_0x156d44,_0x6fbe('0x16'));_0x2440a8(_0x57ba06[_0x6fbe('0x1c')][_0x6fbe('0x1b')]);}})[_0x6fbe('0x1d')](function(_0xc928e3){logger['error'](_0x6fbe('0x15'),_0x156d44,_0xc928e3);_0xabb67(_0xc928e3);});});}exports[_0x6fbe('0x1e')]=function(_0xf621dc){var _0x429a18=this;return new Promise(function(_0x1da159,_0x4155f4){return db['ChatQueue'][_0x6fbe('0x1f')]({'raw':_0xf621dc[_0x6fbe('0x20')]?_0xf621dc[_0x6fbe('0x20')][_0x6fbe('0x21')]===undefined?!![]:![]:!![],'where':_0xf621dc[_0x6fbe('0x20')]?_0xf621dc[_0x6fbe('0x20')][_0x6fbe('0x22')]||null:null,'attributes':_0xf621dc[_0x6fbe('0x20')]?_0xf621dc[_0x6fbe('0x20')][_0x6fbe('0x23')]||null:null,'limit':_0xf621dc['options']?_0xf621dc[_0x6fbe('0x20')][_0x6fbe('0x24')]||null:null,'include':_0xf621dc[_0x6fbe('0x20')]?_0xf621dc[_0x6fbe('0x20')]['include']?_[_0x6fbe('0x25')](_0xf621dc[_0x6fbe('0x20')][_0x6fbe('0x26')],function(_0x403660){return{'model':db[_0x403660['model']],'as':_0x403660['as'],'attributes':_0x403660[_0x6fbe('0x23')],'include':_0x403660['include']?_[_0x6fbe('0x25')](_0x403660[_0x6fbe('0x26')],function(_0x171b76){return{'model':db[_0x171b76[_0x6fbe('0x27')]],'as':_0x171b76['as'],'attributes':_0x171b76[_0x6fbe('0x23')],'include':_0x171b76['include']?_[_0x6fbe('0x25')](_0x171b76['include'],function(_0x102555){return{'model':db[_0x102555[_0x6fbe('0x27')]],'as':_0x102555['as'],'attributes':_0x102555['attributes']};}):[]};}):[]};}):[]:[]})[_0x6fbe('0x13')](function(_0x1d8e33){logger[_0x6fbe('0x14')](_0x6fbe('0x1e'),_0xf621dc);logger[_0x6fbe('0x17')](_0x6fbe('0x1e'),_0xf621dc,JSON[_0x6fbe('0x19')](_0x1d8e33));_0x1da159(_0x1d8e33);})[_0x6fbe('0x1d')](function(_0x191e46){logger[_0x6fbe('0x1a')](_0x6fbe('0x1e'),_0x191e46[_0x6fbe('0x1b')],_0xf621dc);_0x4155f4(_0x429a18[_0x6fbe('0x1a')](0x1f4,_0x191e46['message']));});});};exports[_0x6fbe('0x28')]=function(_0x14927a){var _0x471050=this;return new Promise(function(_0x4332f4,_0x1ff129){return db['ChatQueue'][_0x6fbe('0x29')]({'raw':_0x14927a[_0x6fbe('0x20')]?_0x14927a[_0x6fbe('0x20')][_0x6fbe('0x21')]===undefined?!![]:![]:!![],'where':_0x14927a[_0x6fbe('0x20')]?_0x14927a[_0x6fbe('0x20')][_0x6fbe('0x22')]||null:null,'attributes':_0x14927a['options']?_0x14927a[_0x6fbe('0x20')][_0x6fbe('0x23')]||null:null,'include':_0x14927a[_0x6fbe('0x20')]?_0x14927a[_0x6fbe('0x20')][_0x6fbe('0x26')]?_[_0x6fbe('0x25')](_0x14927a[_0x6fbe('0x20')][_0x6fbe('0x26')],function(_0x32d8d7){return{'model':db[_0x32d8d7[_0x6fbe('0x27')]],'as':_0x32d8d7['as'],'attributes':_0x32d8d7[_0x6fbe('0x23')],'include':_0x32d8d7[_0x6fbe('0x26')]?_['map'](_0x32d8d7['include'],function(_0x4c0dc1){return{'model':db[_0x4c0dc1[_0x6fbe('0x27')]],'as':_0x4c0dc1['as'],'attributes':_0x4c0dc1['attributes'],'include':_0x4c0dc1['include']?_[_0x6fbe('0x25')](_0x4c0dc1[_0x6fbe('0x26')],function(_0xb334b4){return{'model':db[_0xb334b4['model']],'as':_0xb334b4['as'],'attributes':_0xb334b4[_0x6fbe('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x578727){logger[_0x6fbe('0x14')](_0x6fbe('0x28'),_0x14927a);logger[_0x6fbe('0x17')]('ShowChatQueue',_0x14927a,JSON[_0x6fbe('0x19')](_0x578727));_0x4332f4(_0x578727);})[_0x6fbe('0x1d')](function(_0x1cc0b3){logger['error'](_0x6fbe('0x28'),_0x1cc0b3[_0x6fbe('0x1b')],_0x14927a);_0x1ff129(_0x471050[_0x6fbe('0x1a')](0x1f4,_0x1cc0b3['message']));});});};
\ No newline at end of file
+var _0x00f4=['http','redis','defaults','localhost','socket.io-emitter','register','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','map','model','then','stringify','ShowChatQueue','find','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x2aa746,_0x46710e){var _0x250460=function(_0xe75055){while(--_0xe75055){_0x2aa746['push'](_0x2aa746['shift']());}};_0x250460(++_0x46710e);}(_0x00f4,0x137));var _0x400f=function(_0x389c32,_0xe48b5e){_0x389c32=_0x389c32-0x0;var _0x38c203=_0x00f4[_0x389c32];return _0x38c203;};'use strict';var _=require(_0x400f('0x0'));var util=require('util');var moment=require(_0x400f('0x1'));var BPromise=require(_0x400f('0x2'));var rs=require(_0x400f('0x3'));var fs=require('fs');var Redis=require(_0x400f('0x4'));var db=require(_0x400f('0x5'))['db'];var utils=require(_0x400f('0x6'));var logger=require(_0x400f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x400f('0x8'));var client=jayson['client'][_0x400f('0x9')]({'port':0x232a});config[_0x400f('0xa')]=_[_0x400f('0xb')](config[_0x400f('0xa')],{'host':_0x400f('0xc'),'port':0x18eb});var socket=require(_0x400f('0xd'))(new Redis(config[_0x400f('0xa')]));require('./chatQueue.socket')[_0x400f('0xe')](socket);function respondWithRpcPromise(_0x3ad157,_0x162379,_0x448d43){return new BPromise(function(_0x481b05,_0x96bdae){return client[_0x400f('0xf')](_0x3ad157,_0x448d43)['then'](function(_0x2d65b4){logger['info'](_0x400f('0x10'),_0x162379,_0x400f('0x11'));logger[_0x400f('0x12')](_0x400f('0x13'),_0x162379,'request\x20sent',JSON['stringify'](_0x2d65b4));if(_0x2d65b4['error']){if(_0x2d65b4[_0x400f('0x14')][_0x400f('0x15')]===0x1f4){logger[_0x400f('0x14')](_0x400f('0x10'),_0x162379,_0x2d65b4['error'][_0x400f('0x16')]);return _0x96bdae(_0x2d65b4[_0x400f('0x14')][_0x400f('0x16')]);}logger[_0x400f('0x14')](_0x400f('0x10'),_0x162379,_0x2d65b4['error'][_0x400f('0x16')]);return _0x481b05(_0x2d65b4[_0x400f('0x14')]['message']);}else{logger['info'](_0x400f('0x10'),_0x162379,'request\x20sent');_0x481b05(_0x2d65b4[_0x400f('0x17')][_0x400f('0x16')]);}})[_0x400f('0x18')](function(_0x24e1ef){logger['error'](_0x400f('0x10'),_0x162379,_0x24e1ef);_0x96bdae(_0x24e1ef);});});}exports[_0x400f('0x19')]=function(_0x84d0fd){var _0x747b41=this;return new Promise(function(_0x3a9e2c,_0x1245ef){return db[_0x400f('0x1a')]['findAll']({'raw':_0x84d0fd[_0x400f('0x1b')]?_0x84d0fd[_0x400f('0x1b')][_0x400f('0x1c')]===undefined?!![]:![]:!![],'where':_0x84d0fd[_0x400f('0x1b')]?_0x84d0fd[_0x400f('0x1b')][_0x400f('0x1d')]||null:null,'attributes':_0x84d0fd[_0x400f('0x1b')]?_0x84d0fd[_0x400f('0x1b')][_0x400f('0x1e')]||null:null,'limit':_0x84d0fd[_0x400f('0x1b')]?_0x84d0fd['options'][_0x400f('0x1f')]||null:null,'include':_0x84d0fd[_0x400f('0x1b')]?_0x84d0fd[_0x400f('0x1b')][_0x400f('0x20')]?_[_0x400f('0x21')](_0x84d0fd[_0x400f('0x1b')][_0x400f('0x20')],function(_0x4e279f){return{'model':db[_0x4e279f[_0x400f('0x22')]],'as':_0x4e279f['as'],'attributes':_0x4e279f[_0x400f('0x1e')],'include':_0x4e279f[_0x400f('0x20')]?_[_0x400f('0x21')](_0x4e279f[_0x400f('0x20')],function(_0x1b62be){return{'model':db[_0x1b62be[_0x400f('0x22')]],'as':_0x1b62be['as'],'attributes':_0x1b62be[_0x400f('0x1e')],'include':_0x1b62be[_0x400f('0x20')]?_[_0x400f('0x21')](_0x1b62be[_0x400f('0x20')],function(_0x5c52f2){return{'model':db[_0x5c52f2[_0x400f('0x22')]],'as':_0x5c52f2['as'],'attributes':_0x5c52f2[_0x400f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x400f('0x23')](function(_0x49c993){logger['info'](_0x400f('0x19'),_0x84d0fd);logger[_0x400f('0x12')](_0x400f('0x19'),_0x84d0fd,JSON[_0x400f('0x24')](_0x49c993));_0x3a9e2c(_0x49c993);})[_0x400f('0x18')](function(_0x218c58){logger[_0x400f('0x14')](_0x400f('0x19'),_0x218c58['message'],_0x84d0fd);_0x1245ef(_0x747b41['error'](0x1f4,_0x218c58[_0x400f('0x16')]));});});};exports[_0x400f('0x25')]=function(_0xc83b4f){var _0x208d33=this;return new Promise(function(_0x8549ec,_0x5d1975){return db[_0x400f('0x1a')][_0x400f('0x26')]({'raw':_0xc83b4f['options']?_0xc83b4f[_0x400f('0x1b')][_0x400f('0x1c')]===undefined?!![]:![]:!![],'where':_0xc83b4f[_0x400f('0x1b')]?_0xc83b4f['options'][_0x400f('0x1d')]||null:null,'attributes':_0xc83b4f[_0x400f('0x1b')]?_0xc83b4f[_0x400f('0x1b')][_0x400f('0x1e')]||null:null,'include':_0xc83b4f[_0x400f('0x1b')]?_0xc83b4f[_0x400f('0x1b')][_0x400f('0x20')]?_[_0x400f('0x21')](_0xc83b4f[_0x400f('0x1b')][_0x400f('0x20')],function(_0x534d64){return{'model':db[_0x534d64[_0x400f('0x22')]],'as':_0x534d64['as'],'attributes':_0x534d64[_0x400f('0x1e')],'include':_0x534d64[_0x400f('0x20')]?_[_0x400f('0x21')](_0x534d64['include'],function(_0x52e747){return{'model':db[_0x52e747['model']],'as':_0x52e747['as'],'attributes':_0x52e747[_0x400f('0x1e')],'include':_0x52e747[_0x400f('0x20')]?_[_0x400f('0x21')](_0x52e747['include'],function(_0x4d44b0){return{'model':db[_0x4d44b0[_0x400f('0x22')]],'as':_0x4d44b0['as'],'attributes':_0x4d44b0[_0x400f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x400f('0x23')](function(_0x15461a){logger[_0x400f('0x27')]('ShowChatQueue',_0xc83b4f);logger[_0x400f('0x12')](_0x400f('0x25'),_0xc83b4f,JSON[_0x400f('0x24')](_0x15461a));_0x8549ec(_0x15461a);})['catch'](function(_0x3b9d35){logger[_0x400f('0x14')](_0x400f('0x25'),_0x3b9d35[_0x400f('0x16')],_0xc83b4f);_0x5d1975(_0x208d33[_0x400f('0x14')](0x1f4,_0x3b9d35[_0x400f('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index b1f7698..a1fdedd 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(_0x517601,_0x173b35){var _0x1d470a=function(_0x324bae){while(--_0x324bae){_0x517601['push'](_0x517601['shift']());}};_0x1d470a(++_0x173b35);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x57f6ad,_0x4795b6){_0x57f6ad=_0x57f6ad-0x0;var _0x425c09=_0x6f0d[_0x57f6ad];return _0x425c09;};'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 _0x5ad3=['register','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x297dcf,_0x448cf5){_0x297dcf=_0x297dcf-0x0;var _0xe1699b=_0x5ad3[_0x297dcf];return _0xe1699b;};'use strict';var ChatQueueEvents=require(_0x35ad('0x0'));var events=[_0x35ad('0x1'),_0x35ad('0x2'),_0x35ad('0x3')];function createListener(_0x5543d1,_0x468072){return function(_0x373228){_0x468072[_0x35ad('0x4')](_0x5543d1,_0x373228);};}function removeListener(_0x69a0b3,_0x450f55){return function(){ChatQueueEvents[_0x35ad('0x5')](_0x69a0b3,_0x450f55);};}exports[_0x35ad('0x6')]=function(_0x436dcb){for(var _0x36c606=0x0,_0x31cc6a=events['length'];_0x36c606<_0x31cc6a;_0x36c606++){var _0x292521=events[_0x36c606];var _0x3cec3e=createListener(_0x35ad('0x7')+_0x292521,_0x436dcb);ChatQueueEvents['on'](_0x292521,_0x3cec3e);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 305781a..1341c43 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x3555be,_0x4e47ce){var _0x23a8b3=function(_0x4129a1){while(--_0x4129a1){_0x3555be['push'](_0x3555be['shift']());}};_0x23a8b3(++_0x4e47ce);}(_0xe14b,0x93));var _0xbe14=function(_0xe6a63e,_0x94e572){_0xe6a63e=_0xe6a63e-0x0;var _0x4c76af=_0xe14b[_0xe6a63e];return _0x4c76af;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e74,0x175));var _0x43e7=function(_0x440a3b,_0x5d29e4){_0x440a3b=_0x440a3b-0x0;var _0x3d45c9=_0x3e74[_0x440a3b];return _0x3d45c9;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index d3de02e..23d2b36 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 _0xc0af=['exports','STRING','DATE','moment'];(function(_0x1e9c80,_0x386dd6){var _0x53bdd5=function(_0xa1cf40){while(--_0xa1cf40){_0x1e9c80['push'](_0x1e9c80['shift']());}};_0x53bdd5(++_0x386dd6);}(_0xc0af,0x1ab));var _0xfc0a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc0af[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xfc0a('0x0'));var Sequelize=require('sequelize');module[_0xfc0a('0x1')]={'uniqueid':{'type':Sequelize[_0xfc0a('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xfc0a('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xfc0a('0x3')]},'exitAt':{'type':Sequelize[_0xfc0a('0x3')]},'reason':{'type':Sequelize[_0xfc0a('0x2')]}};
\ No newline at end of file
+var _0x7233=['sequelize','exports','STRING','DATE','moment'];(function(_0xd5bc05,_0x4139ee){var _0x4e77a4=function(_0x89f218){while(--_0x89f218){_0xd5bc05['push'](_0xd5bc05['shift']());}};_0x4e77a4(++_0x4139ee);}(_0x7233,0x1b2));var _0x3723=function(_0x1275ce,_0x4eaea7){_0x1275ce=_0x1275ce-0x0;var _0x3fab97=_0x7233[_0x1275ce];return _0x3fab97;};'use strict';var moment=require(_0x3723('0x0'));var Sequelize=require(_0x3723('0x1'));module[_0x3723('0x2')]={'uniqueid':{'type':Sequelize[_0x3723('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3723('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3723('0x4')]},'exitAt':{'type':Sequelize[_0x3723('0x4')]},'reason':{'type':Sequelize[_0x3723('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 9a2d3b7..bcf50ff 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 _0x1a38=['pick','filter','where','merge','options','then','includeAll','ChatQueueReport','findAll','rows','show','params','keys','rawAttributes','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','json','apply','reject','save','update','destroy','error','stack','name','index','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1a38,0xb0));var _0x81a3=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x1a38[_0x20c9b2];return _0x2c6030;};'use strict';var emlformat=require(_0x81a3('0x0'));var rimraf=require(_0x81a3('0x1'));var zipdir=require(_0x81a3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x81a3('0x3'));var Mustache=require(_0x81a3('0x4'));var util=require(_0x81a3('0x5'));var path=require(_0x81a3('0x6'));var sox=require(_0x81a3('0x7'));var csv=require(_0x81a3('0x8'));var ejs=require(_0x81a3('0x9'));var fs=require('fs');var fs_extra=require(_0x81a3('0xa'));var _=require(_0x81a3('0xb'));var squel=require(_0x81a3('0xc'));var crypto=require(_0x81a3('0xd'));var jsforce=require(_0x81a3('0xe'));var deskjs=require(_0x81a3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x81a3('0x10'));var Papa=require(_0x81a3('0x11'));var Redis=require(_0x81a3('0x12'));var authService=require(_0x81a3('0x13'));var qs=require(_0x81a3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x81a3('0x15'));var logger=require(_0x81a3('0x16'))(_0x81a3('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x81a3('0x18'));var db=require(_0x81a3('0x19'))['db'];function respondWithStatusCode(_0x44ac21,_0x45004e){_0x45004e=_0x45004e||0xcc;return function(_0x199fa0){if(_0x199fa0){return _0x44ac21[_0x81a3('0x1a')](_0x45004e);}return _0x44ac21[_0x81a3('0x1b')](_0x45004e)[_0x81a3('0x1c')]();};}function respondWithResult(_0x3305a9,_0x17fa02){_0x17fa02=_0x17fa02||0xc8;return function(_0x2683f3){if(_0x2683f3){return _0x3305a9[_0x81a3('0x1b')](_0x17fa02)['json'](_0x2683f3);}};}function respondWithFilteredResult(_0x168cf1,_0x277e02){return function(_0x2c5a34){if(_0x2c5a34){var _0x2a0b2c=typeof _0x277e02['offset']===_0x81a3('0x1d')&&typeof _0x277e02[_0x81a3('0x1e')]==='undefined';var _0xcf3fd=_0x2c5a34['count'];var _0x4d4b86=_0x2a0b2c?0x0:_0x277e02[_0x81a3('0x1f')];var _0x1cd821=_0x2a0b2c?_0x2c5a34[_0x81a3('0x20')]:_0x277e02[_0x81a3('0x1f')]+_0x277e02[_0x81a3('0x1e')];var _0x2aaa65;if(_0x1cd821>=_0xcf3fd){_0x1cd821=_0xcf3fd;_0x2aaa65=0xc8;}else{_0x2aaa65=0xce;}_0x168cf1[_0x81a3('0x1b')](_0x2aaa65);return _0x168cf1[_0x81a3('0x21')]('Content-Range',_0x4d4b86+'-'+_0x1cd821+'/'+_0xcf3fd)[_0x81a3('0x22')](_0x2c5a34);}return null;};}function patchUpdates(_0x324706){return function(_0x4ef0c4){try{jsonpatch[_0x81a3('0x23')](_0x4ef0c4,_0x324706,!![]);}catch(_0x2babc8){return BPromise[_0x81a3('0x24')](_0x2babc8);}return _0x4ef0c4[_0x81a3('0x25')]();};}function saveUpdates(_0x58b63d,_0x316d48){return function(_0x3f15ca){if(_0x3f15ca){return _0x3f15ca[_0x81a3('0x26')](_0x58b63d)['then'](function(_0x5bf502){return _0x5bf502;});}return null;};}function removeEntity(_0x245e23,_0x328b0d){return function(_0x19d2e1){if(_0x19d2e1){return _0x19d2e1[_0x81a3('0x27')]()['then'](function(){_0x245e23['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1583fd,_0x245026){return function(_0x3ba769){if(!_0x3ba769){_0x1583fd[_0x81a3('0x1a')](0x194);}return _0x3ba769;};}function handleError(_0x1e6603,_0x4096ef){_0x4096ef=_0x4096ef||0x1f4;return function(_0x3f850d){logger[_0x81a3('0x28')](_0x3f850d[_0x81a3('0x29')]);if(_0x3f850d[_0x81a3('0x2a')]){delete _0x3f850d[_0x81a3('0x2a')];}_0x1e6603[_0x81a3('0x1b')](_0x4096ef)['send'](_0x3f850d);};}exports[_0x81a3('0x2b')]=function(_0x346141,_0x398213){var _0x5b4c91={},_0x4afd80={},_0x2e04af={'count':0x0,'rows':[]};var _0x2bec93=_['map'](db['ChatQueueReport']['rawAttributes'],function(_0x962822){return{'name':_0x962822[_0x81a3('0x2c')],'type':_0x962822[_0x81a3('0x2d')][_0x81a3('0x2e')]};});_0x4afd80[_0x81a3('0x2f')]=_[_0x81a3('0x30')](_0x2bec93,'name');_0x4afd80[_0x81a3('0x31')]=_['keys'](_0x346141[_0x81a3('0x31')]);_0x4afd80[_0x81a3('0x32')]=_[_0x81a3('0x33')](_0x4afd80[_0x81a3('0x2f')],_0x4afd80[_0x81a3('0x31')]);_0x5b4c91[_0x81a3('0x34')]=_[_0x81a3('0x33')](_0x4afd80[_0x81a3('0x2f')],qs[_0x81a3('0x35')](_0x346141['query']['fields']));_0x5b4c91[_0x81a3('0x34')]=_0x5b4c91['attributes'][_0x81a3('0x36')]?_0x5b4c91['attributes']:_0x4afd80['model'];if(!_0x346141[_0x81a3('0x31')][_0x81a3('0x37')](_0x81a3('0x38'))){_0x5b4c91[_0x81a3('0x1e')]=qs['limit'](_0x346141[_0x81a3('0x31')][_0x81a3('0x1e')]);_0x5b4c91[_0x81a3('0x1f')]=qs['offset'](_0x346141[_0x81a3('0x31')]['offset']);}_0x5b4c91['order']=qs['sort'](_0x346141[_0x81a3('0x31')][_0x81a3('0x39')]);_0x5b4c91['where']=qs[_0x81a3('0x32')](_[_0x81a3('0x3a')](_0x346141[_0x81a3('0x31')],_0x4afd80['filters']),_0x2bec93);if(_0x346141['query'][_0x81a3('0x3b')]){_0x5b4c91[_0x81a3('0x3c')]=_['merge'](_0x5b4c91[_0x81a3('0x3c')],{'$or':_[_0x81a3('0x30')](_0x2bec93,function(_0x519800){if(_0x519800[_0x81a3('0x2d')]!=='VIRTUAL'){var _0x53cf9f={};_0x53cf9f[_0x519800['name']]={'$like':'%'+_0x346141[_0x81a3('0x31')][_0x81a3('0x3b')]+'%'};return _0x53cf9f;}})});}_0x5b4c91=_[_0x81a3('0x3d')]({},_0x5b4c91,_0x346141[_0x81a3('0x3e')]);var _0x24de2d={'where':_0x5b4c91[_0x81a3('0x3c')]};return db['ChatQueueReport'][_0x81a3('0x20')](_0x24de2d)[_0x81a3('0x3f')](function(_0x33504d){_0x2e04af[_0x81a3('0x20')]=_0x33504d;if(_0x346141[_0x81a3('0x31')][_0x81a3('0x40')]){_0x5b4c91['include']=[{'all':!![]}];}return db[_0x81a3('0x41')][_0x81a3('0x42')](_0x5b4c91);})['then'](function(_0x45bc48){_0x2e04af[_0x81a3('0x43')]=_0x45bc48;return _0x2e04af;})[_0x81a3('0x3f')](respondWithFilteredResult(_0x398213,_0x5b4c91))['catch'](handleError(_0x398213,null));};exports[_0x81a3('0x44')]=function(_0x28c205,_0x4e67ba){var _0x24e250={'raw':!![],'where':{'id':_0x28c205[_0x81a3('0x45')]['id']}},_0x13d5bb={};_0x13d5bb[_0x81a3('0x2f')]=_[_0x81a3('0x46')](db[_0x81a3('0x41')][_0x81a3('0x47')]);_0x13d5bb['query']=_['keys'](_0x28c205['query']);_0x13d5bb[_0x81a3('0x32')]=_[_0x81a3('0x33')](_0x13d5bb[_0x81a3('0x2f')],_0x13d5bb['query']);_0x24e250[_0x81a3('0x34')]=_[_0x81a3('0x33')](_0x13d5bb['model'],qs[_0x81a3('0x35')](_0x28c205[_0x81a3('0x31')][_0x81a3('0x35')]));_0x24e250['attributes']=_0x24e250[_0x81a3('0x34')]['length']?_0x24e250[_0x81a3('0x34')]:_0x13d5bb[_0x81a3('0x2f')];if(_0x28c205['query']['includeAll']){_0x24e250[_0x81a3('0x48')]=[{'all':!![]}];}_0x24e250=_[_0x81a3('0x3d')]({},_0x24e250,_0x28c205['options']);return db[_0x81a3('0x41')][_0x81a3('0x49')](_0x24e250)[_0x81a3('0x3f')](handleEntityNotFound(_0x4e67ba,null))[_0x81a3('0x3f')](respondWithResult(_0x4e67ba,null))[_0x81a3('0x4a')](handleError(_0x4e67ba,null));};exports[_0x81a3('0x4b')]=function(_0x54f2df,_0x30836a){return db['ChatQueueReport']['create'](_0x54f2df[_0x81a3('0x4c')],{})['then'](respondWithResult(_0x30836a,0xc9))[_0x81a3('0x4a')](handleError(_0x30836a,null));};exports[_0x81a3('0x26')]=function(_0x4237af,_0x5d7f5c){if(_0x4237af[_0x81a3('0x4c')]['id']){delete _0x4237af[_0x81a3('0x4c')]['id'];}return db[_0x81a3('0x41')][_0x81a3('0x49')]({'where':{'id':_0x4237af[_0x81a3('0x45')]['id']}})[_0x81a3('0x3f')](handleEntityNotFound(_0x5d7f5c,null))[_0x81a3('0x3f')](saveUpdates(_0x4237af[_0x81a3('0x4c')],null))[_0x81a3('0x3f')](respondWithResult(_0x5d7f5c,null))['catch'](handleError(_0x5d7f5c,null));};exports['destroy']=function(_0x286606,_0x376c6e){return db[_0x81a3('0x41')][_0x81a3('0x49')]({'where':{'id':_0x286606[_0x81a3('0x45')]['id']}})[_0x81a3('0x3f')](handleEntityNotFound(_0x376c6e,null))[_0x81a3('0x3f')](removeEntity(_0x376c6e,null))[_0x81a3('0x4a')](handleError(_0x376c6e,null));};exports[_0x81a3('0x4d')]=function(_0x1029b3,_0x740d0f){return db['ChatQueueReport']['describe']()[_0x81a3('0x3f')](respondWithResult(_0x740d0f,null))['catch'](handleError(_0x740d0f,null));};
\ No newline at end of file
+var _0xce14=['request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','ChatQueueReport','rows','catch','show','params','find','create','body','describe','rimraf','fast-json-patch'];(function(_0x378978,_0xa0a007){var _0x3a9567=function(_0x434b3d){while(--_0x434b3d){_0x378978['push'](_0x378978['shift']());}};_0x3a9567(++_0xa0a007);}(_0xce14,0x17f));var _0x4ce1=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xce14[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ce1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ce1('0x1'));var rp=require(_0x4ce1('0x2'));var moment=require('moment');var BPromise=require(_0x4ce1('0x3'));var Mustache=require(_0x4ce1('0x4'));var util=require(_0x4ce1('0x5'));var path=require(_0x4ce1('0x6'));var sox=require(_0x4ce1('0x7'));var csv=require('to-csv');var ejs=require(_0x4ce1('0x8'));var fs=require('fs');var fs_extra=require(_0x4ce1('0x9'));var _=require(_0x4ce1('0xa'));var squel=require(_0x4ce1('0xb'));var crypto=require('crypto');var jsforce=require(_0x4ce1('0xc'));var deskjs=require(_0x4ce1('0xd'));var toCsv=require(_0x4ce1('0xe'));var querystring=require('querystring');var Papa=require(_0x4ce1('0xf'));var Redis=require(_0x4ce1('0x10'));var authService=require(_0x4ce1('0x11'));var qs=require(_0x4ce1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ce1('0x13'));var logger=require(_0x4ce1('0x14'))(_0x4ce1('0x15'));var utils=require(_0x4ce1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4ce1('0x17'));var db=require(_0x4ce1('0x18'))['db'];function respondWithStatusCode(_0x1297d8,_0x16dade){_0x16dade=_0x16dade||0xcc;return function(_0x171b8f){if(_0x171b8f){return _0x1297d8[_0x4ce1('0x19')](_0x16dade);}return _0x1297d8[_0x4ce1('0x1a')](_0x16dade)[_0x4ce1('0x1b')]();};}function respondWithResult(_0x45f57e,_0x15407b){_0x15407b=_0x15407b||0xc8;return function(_0x321df9){if(_0x321df9){return _0x45f57e['status'](_0x15407b)[_0x4ce1('0x1c')](_0x321df9);}};}function respondWithFilteredResult(_0x4fa4bc,_0x172e2c){return function(_0x1bfd82){if(_0x1bfd82){var _0x1decc2=typeof _0x172e2c[_0x4ce1('0x1d')]==='undefined'&&typeof _0x172e2c[_0x4ce1('0x1e')]==='undefined';var _0x548452=_0x1bfd82['count'];var _0xafda9e=_0x1decc2?0x0:_0x172e2c[_0x4ce1('0x1d')];var _0x3105a9=_0x1decc2?_0x1bfd82[_0x4ce1('0x1f')]:_0x172e2c['offset']+_0x172e2c[_0x4ce1('0x1e')];var _0x48a4ed;if(_0x3105a9>=_0x548452){_0x3105a9=_0x548452;_0x48a4ed=0xc8;}else{_0x48a4ed=0xce;}_0x4fa4bc['status'](_0x48a4ed);return _0x4fa4bc[_0x4ce1('0x20')](_0x4ce1('0x21'),_0xafda9e+'-'+_0x3105a9+'/'+_0x548452)[_0x4ce1('0x1c')](_0x1bfd82);}return null;};}function patchUpdates(_0x44a166){return function(_0x1cb999){try{jsonpatch[_0x4ce1('0x22')](_0x1cb999,_0x44a166,!![]);}catch(_0x896adf){return BPromise[_0x4ce1('0x23')](_0x896adf);}return _0x1cb999['save']();};}function saveUpdates(_0x95457f,_0x3bce9d){return function(_0x5c0b4f){if(_0x5c0b4f){return _0x5c0b4f[_0x4ce1('0x24')](_0x95457f)[_0x4ce1('0x25')](function(_0x5aa1c2){return _0x5aa1c2;});}return null;};}function removeEntity(_0x3cf168,_0x2da360){return function(_0x4de527){if(_0x4de527){return _0x4de527['destroy']()['then'](function(){_0x3cf168[_0x4ce1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41f6ed,_0x7e6cb3){return function(_0x53895a){if(!_0x53895a){_0x41f6ed[_0x4ce1('0x19')](0x194);}return _0x53895a;};}function handleError(_0x173c1c,_0x312486){_0x312486=_0x312486||0x1f4;return function(_0x7bca8c){logger[_0x4ce1('0x26')](_0x7bca8c[_0x4ce1('0x27')]);if(_0x7bca8c[_0x4ce1('0x28')]){delete _0x7bca8c[_0x4ce1('0x28')];}_0x173c1c[_0x4ce1('0x1a')](_0x312486)[_0x4ce1('0x29')](_0x7bca8c);};}exports[_0x4ce1('0x2a')]=function(_0x1fda83,_0x4e895e){var _0x161fc7={},_0x1ceb1e={},_0x1b9f3c={'count':0x0,'rows':[]};var _0x2002b9=_[_0x4ce1('0x2b')](db['ChatQueueReport'][_0x4ce1('0x2c')],function(_0x355f10){return{'name':_0x355f10[_0x4ce1('0x2d')],'type':_0x355f10[_0x4ce1('0x2e')][_0x4ce1('0x2f')]};});_0x1ceb1e[_0x4ce1('0x30')]=_['map'](_0x2002b9,_0x4ce1('0x28'));_0x1ceb1e[_0x4ce1('0x31')]=_[_0x4ce1('0x32')](_0x1fda83['query']);_0x1ceb1e['filters']=_[_0x4ce1('0x33')](_0x1ceb1e[_0x4ce1('0x30')],_0x1ceb1e[_0x4ce1('0x31')]);_0x161fc7[_0x4ce1('0x34')]=_[_0x4ce1('0x33')](_0x1ceb1e[_0x4ce1('0x30')],qs['fields'](_0x1fda83['query'][_0x4ce1('0x35')]));_0x161fc7[_0x4ce1('0x34')]=_0x161fc7['attributes'][_0x4ce1('0x36')]?_0x161fc7[_0x4ce1('0x34')]:_0x1ceb1e[_0x4ce1('0x30')];if(!_0x1fda83[_0x4ce1('0x31')][_0x4ce1('0x37')](_0x4ce1('0x38'))){_0x161fc7[_0x4ce1('0x1e')]=qs[_0x4ce1('0x1e')](_0x1fda83[_0x4ce1('0x31')][_0x4ce1('0x1e')]);_0x161fc7[_0x4ce1('0x1d')]=qs['offset'](_0x1fda83[_0x4ce1('0x31')][_0x4ce1('0x1d')]);}_0x161fc7[_0x4ce1('0x39')]=qs['sort'](_0x1fda83['query'][_0x4ce1('0x3a')]);_0x161fc7['where']=qs[_0x4ce1('0x3b')](_[_0x4ce1('0x3c')](_0x1fda83[_0x4ce1('0x31')],_0x1ceb1e[_0x4ce1('0x3b')]),_0x2002b9);if(_0x1fda83[_0x4ce1('0x31')][_0x4ce1('0x3d')]){_0x161fc7[_0x4ce1('0x3e')]=_['merge'](_0x161fc7['where'],{'$or':_[_0x4ce1('0x2b')](_0x2002b9,function(_0x27d5f4){if(_0x27d5f4[_0x4ce1('0x2e')]!==_0x4ce1('0x3f')){var _0x3a5dd5={};_0x3a5dd5[_0x27d5f4[_0x4ce1('0x28')]]={'$like':'%'+_0x1fda83['query'][_0x4ce1('0x3d')]+'%'};return _0x3a5dd5;}})});}_0x161fc7=_[_0x4ce1('0x40')]({},_0x161fc7,_0x1fda83[_0x4ce1('0x41')]);var _0x3f5d7d={'where':_0x161fc7[_0x4ce1('0x3e')]};return db['ChatQueueReport'][_0x4ce1('0x1f')](_0x3f5d7d)[_0x4ce1('0x25')](function(_0x2247c1){_0x1b9f3c[_0x4ce1('0x1f')]=_0x2247c1;if(_0x1fda83[_0x4ce1('0x31')][_0x4ce1('0x42')]){_0x161fc7[_0x4ce1('0x43')]=[{'all':!![]}];}return db[_0x4ce1('0x44')]['findAll'](_0x161fc7);})[_0x4ce1('0x25')](function(_0x17422){_0x1b9f3c[_0x4ce1('0x45')]=_0x17422;return _0x1b9f3c;})[_0x4ce1('0x25')](respondWithFilteredResult(_0x4e895e,_0x161fc7))[_0x4ce1('0x46')](handleError(_0x4e895e,null));};exports[_0x4ce1('0x47')]=function(_0x22643b,_0x37b9af){var _0x542d5c={'raw':!![],'where':{'id':_0x22643b[_0x4ce1('0x48')]['id']}},_0x44127a={};_0x44127a[_0x4ce1('0x30')]=_[_0x4ce1('0x32')](db[_0x4ce1('0x44')][_0x4ce1('0x2c')]);_0x44127a[_0x4ce1('0x31')]=_[_0x4ce1('0x32')](_0x22643b[_0x4ce1('0x31')]);_0x44127a['filters']=_[_0x4ce1('0x33')](_0x44127a[_0x4ce1('0x30')],_0x44127a[_0x4ce1('0x31')]);_0x542d5c['attributes']=_[_0x4ce1('0x33')](_0x44127a[_0x4ce1('0x30')],qs[_0x4ce1('0x35')](_0x22643b[_0x4ce1('0x31')]['fields']));_0x542d5c[_0x4ce1('0x34')]=_0x542d5c[_0x4ce1('0x34')][_0x4ce1('0x36')]?_0x542d5c[_0x4ce1('0x34')]:_0x44127a['model'];if(_0x22643b['query'][_0x4ce1('0x42')]){_0x542d5c['include']=[{'all':!![]}];}_0x542d5c=_[_0x4ce1('0x40')]({},_0x542d5c,_0x22643b[_0x4ce1('0x41')]);return db[_0x4ce1('0x44')][_0x4ce1('0x49')](_0x542d5c)[_0x4ce1('0x25')](handleEntityNotFound(_0x37b9af,null))[_0x4ce1('0x25')](respondWithResult(_0x37b9af,null))[_0x4ce1('0x46')](handleError(_0x37b9af,null));};exports[_0x4ce1('0x4a')]=function(_0x36d714,_0x4ba44c){return db[_0x4ce1('0x44')]['create'](_0x36d714[_0x4ce1('0x4b')],{})[_0x4ce1('0x25')](respondWithResult(_0x4ba44c,0xc9))['catch'](handleError(_0x4ba44c,null));};exports[_0x4ce1('0x24')]=function(_0x544cac,_0xea34e6){if(_0x544cac[_0x4ce1('0x4b')]['id']){delete _0x544cac[_0x4ce1('0x4b')]['id'];}return db['ChatQueueReport'][_0x4ce1('0x49')]({'where':{'id':_0x544cac[_0x4ce1('0x48')]['id']}})[_0x4ce1('0x25')](handleEntityNotFound(_0xea34e6,null))[_0x4ce1('0x25')](saveUpdates(_0x544cac[_0x4ce1('0x4b')],null))[_0x4ce1('0x25')](respondWithResult(_0xea34e6,null))[_0x4ce1('0x46')](handleError(_0xea34e6,null));};exports['destroy']=function(_0x1e67cb,_0x19c220){return db[_0x4ce1('0x44')]['find']({'where':{'id':_0x1e67cb[_0x4ce1('0x48')]['id']}})[_0x4ce1('0x25')](handleEntityNotFound(_0x19c220,null))[_0x4ce1('0x25')](removeEntity(_0x19c220,null))['catch'](handleError(_0x19c220,null));};exports[_0x4ce1('0x4c')]=function(_0x177da,_0x5efbbf){return db['ChatQueueReport'][_0x4ce1('0x4c')]()[_0x4ce1('0x25')](respondWithResult(_0x5efbbf,null))['catch'](handleError(_0x5efbbf,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index d1e34db..e1902b7 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x4843cf,_0x480cb5){var _0x52ad78=function(_0xc6def3){while(--_0xc6def3){_0x4843cf['push'](_0x4843cf['shift']());}};_0x52ad78(++_0x480cb5);}(_0xe706,0xa3));var _0x6e70=function(_0xbb5075,_0x50d7f5){_0xbb5075=_0xbb5075-0x0;var _0x902d8=_0xe706[_0xbb5075];return _0x902d8;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0xe30e17,_0xce02be){var _0x2342c9=function(_0x20b733){while(--_0x20b733){_0xe30e17['push'](_0xe30e17['shift']());}};_0x2342c9(++_0xce02be);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index b23ca4a..5ecacaf 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 _0x9a48=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ChatQueueReport','create','body','options','raw','debug','CreateChatQueueReport','UpdateChatQueueReport','update','where','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5291a8,_0x17f939){var _0x4bf3c6=function(_0x117c8a){while(--_0x117c8a){_0x5291a8['push'](_0x5291a8['shift']());}};_0x4bf3c6(++_0x17f939);}(_0x9a48,0xa4));var _0x89a4=function(_0x2e6e12,_0x238fc4){_0x2e6e12=_0x2e6e12-0x0;var _0x4bebf6=_0x9a48[_0x2e6e12];return _0x4bebf6;};'use strict';var _=require(_0x89a4('0x0'));var util=require(_0x89a4('0x1'));var moment=require('moment');var BPromise=require(_0x89a4('0x2'));var rs=require(_0x89a4('0x3'));var fs=require('fs');var Redis=require(_0x89a4('0x4'));var db=require(_0x89a4('0x5'))['db'];var utils=require(_0x89a4('0x6'));var logger=require(_0x89a4('0x7'))(_0x89a4('0x8'));var config=require(_0x89a4('0x9'));var jayson=require(_0x89a4('0xa'));var client=jayson[_0x89a4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5896aa,_0x5f07b2,_0x54b9c3){return new BPromise(function(_0x4776bd,_0x34cb63){return client[_0x89a4('0xc')](_0x5896aa,_0x54b9c3)[_0x89a4('0xd')](function(_0x10216b){logger['info'](_0x89a4('0xe'),_0x5f07b2,_0x89a4('0xf'));logger['debug'](_0x89a4('0x10'),_0x5f07b2,_0x89a4('0xf'),JSON[_0x89a4('0x11')](_0x10216b));if(_0x10216b[_0x89a4('0x12')]){if(_0x10216b[_0x89a4('0x12')][_0x89a4('0x13')]===0x1f4){logger[_0x89a4('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x5f07b2,_0x10216b['error'][_0x89a4('0x14')]);return _0x34cb63(_0x10216b[_0x89a4('0x12')]['message']);}logger['error'](_0x89a4('0xe'),_0x5f07b2,_0x10216b[_0x89a4('0x12')][_0x89a4('0x14')]);return _0x4776bd(_0x10216b[_0x89a4('0x12')]['message']);}else{logger[_0x89a4('0x15')](_0x89a4('0xe'),_0x5f07b2,_0x89a4('0xf'));_0x4776bd(_0x10216b['result'][_0x89a4('0x14')]);}})[_0x89a4('0x16')](function(_0x2ad944){logger[_0x89a4('0x12')](_0x89a4('0xe'),_0x5f07b2,_0x2ad944);_0x34cb63(_0x2ad944);});});}exports['CreateChatQueueReport']=function(_0x164379){var _0x2566a8=this;return new Promise(function(_0x5b4bd4,_0x1c30d0){return db[_0x89a4('0x17')][_0x89a4('0x18')](_0x164379[_0x89a4('0x19')],{'raw':_0x164379[_0x89a4('0x1a')]?_0x164379[_0x89a4('0x1a')][_0x89a4('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x1d7974){logger[_0x89a4('0x15')]('CreateChatQueueReport',_0x164379);logger[_0x89a4('0x1c')](_0x89a4('0x1d'),_0x164379,JSON[_0x89a4('0x11')](_0x1d7974));_0x5b4bd4(_0x1d7974);})[_0x89a4('0x16')](function(_0x49fd43){logger['error'](_0x89a4('0x1d'),_0x49fd43[_0x89a4('0x14')],_0x164379);_0x1c30d0(_0x2566a8[_0x89a4('0x12')](0x1f4,_0x49fd43[_0x89a4('0x14')]));});});};exports[_0x89a4('0x1e')]=function(_0x450a41){var _0x1851bf=this;return new Promise(function(_0x10ab85,_0x4f6993){return db[_0x89a4('0x17')][_0x89a4('0x1f')](_0x450a41[_0x89a4('0x19')],{'raw':_0x450a41[_0x89a4('0x1a')]?_0x450a41['options'][_0x89a4('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x450a41['options']?_0x450a41[_0x89a4('0x1a')][_0x89a4('0x20')]||null:null,'attributes':_0x450a41[_0x89a4('0x1a')]?_0x450a41[_0x89a4('0x1a')]['attributes']||null:null,'limit':_0x450a41[_0x89a4('0x1a')]?_0x450a41[_0x89a4('0x1a')][_0x89a4('0x21')]||null:null})['then'](function(_0x24ffd1){logger['info'](_0x89a4('0x1e'),_0x450a41);logger[_0x89a4('0x1c')](_0x89a4('0x1e'),_0x450a41,JSON[_0x89a4('0x11')](_0x24ffd1));_0x10ab85(_0x24ffd1);})[_0x89a4('0x16')](function(_0x57adb7){logger[_0x89a4('0x12')](_0x89a4('0x1e'),_0x57adb7[_0x89a4('0x14')],_0x450a41);_0x4f6993(_0x1851bf[_0x89a4('0x12')](0x1f4,_0x57adb7[_0x89a4('0x14')]));});});};
\ No newline at end of file
+var _0x21c1=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','request\x20sent','error','message','result','CreateChatQueueReport','ChatQueueReport','body','options','raw','stringify','catch','UpdateChatQueueReport','update','where','moment'];(function(_0x3b9bb7,_0x4e24df){var _0x4c0b9e=function(_0x3ab385){while(--_0x3ab385){_0x3b9bb7['push'](_0x3b9bb7['shift']());}};_0x4c0b9e(++_0x4e24df);}(_0x21c1,0xef));var _0x121c=function(_0x25365b,_0x336a39){_0x25365b=_0x25365b-0x0;var _0x260a93=_0x21c1[_0x25365b];return _0x260a93;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x121c('0x0'));var BPromise=require(_0x121c('0x1'));var rs=require(_0x121c('0x2'));var fs=require('fs');var Redis=require(_0x121c('0x3'));var db=require(_0x121c('0x4'))['db'];var utils=require(_0x121c('0x5'));var logger=require('../../config/logger')(_0x121c('0x6'));var config=require(_0x121c('0x7'));var jayson=require(_0x121c('0x8'));var client=jayson[_0x121c('0x9')][_0x121c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d0928,_0x2e957d,_0x492a00){return new BPromise(function(_0x2ad84a,_0x4752fa){return client[_0x121c('0xb')](_0x4d0928,_0x492a00)[_0x121c('0xc')](function(_0x16284c){logger[_0x121c('0xd')](_0x121c('0xe'),_0x2e957d,'request\x20sent');logger[_0x121c('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x2e957d,_0x121c('0x10'),JSON['stringify'](_0x16284c));if(_0x16284c['error']){if(_0x16284c[_0x121c('0x11')]['code']===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x2e957d,_0x16284c[_0x121c('0x11')][_0x121c('0x12')]);return _0x4752fa(_0x16284c['error']['message']);}logger[_0x121c('0x11')](_0x121c('0xe'),_0x2e957d,_0x16284c[_0x121c('0x11')]['message']);return _0x2ad84a(_0x16284c[_0x121c('0x11')][_0x121c('0x12')]);}else{logger[_0x121c('0xd')](_0x121c('0xe'),_0x2e957d,_0x121c('0x10'));_0x2ad84a(_0x16284c[_0x121c('0x13')][_0x121c('0x12')]);}})['catch'](function(_0x2005e0){logger['error'](_0x121c('0xe'),_0x2e957d,_0x2005e0);_0x4752fa(_0x2005e0);});});}exports[_0x121c('0x14')]=function(_0x2d52b8){var _0x115b32=this;return new Promise(function(_0x138320,_0x1a63e0){return db[_0x121c('0x15')]['create'](_0x2d52b8[_0x121c('0x16')],{'raw':_0x2d52b8[_0x121c('0x17')]?_0x2d52b8['options'][_0x121c('0x18')]===undefined?!![]:![]:!![]})[_0x121c('0xc')](function(_0x41605b){logger[_0x121c('0xd')]('CreateChatQueueReport',_0x2d52b8);logger['debug'](_0x121c('0x14'),_0x2d52b8,JSON[_0x121c('0x19')](_0x41605b));_0x138320(_0x41605b);})[_0x121c('0x1a')](function(_0xa429bc){logger[_0x121c('0x11')](_0x121c('0x14'),_0xa429bc[_0x121c('0x12')],_0x2d52b8);_0x1a63e0(_0x115b32[_0x121c('0x11')](0x1f4,_0xa429bc[_0x121c('0x12')]));});});};exports[_0x121c('0x1b')]=function(_0x564f19){var _0x7506bb=this;return new Promise(function(_0x2fc2e5,_0x34c6d0){return db[_0x121c('0x15')][_0x121c('0x1c')](_0x564f19['body'],{'raw':_0x564f19[_0x121c('0x17')]?_0x564f19['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x564f19[_0x121c('0x17')]?_0x564f19[_0x121c('0x17')][_0x121c('0x1d')]||null:null,'attributes':_0x564f19[_0x121c('0x17')]?_0x564f19[_0x121c('0x17')]['attributes']||null:null,'limit':_0x564f19[_0x121c('0x17')]?_0x564f19[_0x121c('0x17')]['limit']||null:null})[_0x121c('0xc')](function(_0x225a4d){logger['info'](_0x121c('0x1b'),_0x564f19);logger[_0x121c('0xf')](_0x121c('0x1b'),_0x564f19,JSON[_0x121c('0x19')](_0x225a4d));_0x2fc2e5(_0x225a4d);})[_0x121c('0x1a')](function(_0x57895d){logger[_0x121c('0x11')]('UpdateChatQueueReport',_0x57895d['message'],_0x564f19);_0x34c6d0(_0x7506bb[_0x121c('0x11')](0x1f4,_0x57895d[_0x121c('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index cf0d407..eff0ce1 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 _0xc93f=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','./chatQueueReport.controller','get','index','/describe','describe','/:id','post','update','destroy','multer'];(function(_0x332c3b,_0x37c5a6){var _0x1980d3=function(_0x25924e){while(--_0x25924e){_0x332c3b['push'](_0x332c3b['shift']());}};_0x1980d3(++_0x37c5a6);}(_0xc93f,0x17f));var _0xfc93=function(_0xe01799,_0x2dbf53){_0xe01799=_0xe01799-0x0;var _0x40a1cd=_0xc93f[_0xe01799];return _0x40a1cd;};'use strict';var multer=require(_0xfc93('0x0'));var util=require(_0xfc93('0x1'));var path=require(_0xfc93('0x2'));var timeout=require(_0xfc93('0x3'));var express=require(_0xfc93('0x4'));var router=express['Router']();var fs_extra=require(_0xfc93('0x5'));var auth=require(_0xfc93('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfc93('0x7'));router[_0xfc93('0x8')]('/',auth['isAuthenticated'](),controller[_0xfc93('0x9')]);router[_0xfc93('0x8')](_0xfc93('0xa'),auth['isAuthenticated'](),controller[_0xfc93('0xb')]);router[_0xfc93('0x8')](_0xfc93('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xfc93('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xfc93('0xe')]);router['delete'](_0xfc93('0xc'),auth['isAuthenticated'](),controller[_0xfc93('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xa755=['./chatQueueReport.controller','index','get','/describe','isAuthenticated','/:id','post','create','put','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x13b360,_0x422276){var _0x5e1085=function(_0x25306e){while(--_0x25306e){_0x13b360['push'](_0x13b360['shift']());}};_0x5e1085(++_0x422276);}(_0xa755,0x139));var _0x5a75=function(_0x15310f,_0x9d88b7){_0x15310f=_0x15310f-0x0;var _0xe68043=_0xa755[_0x15310f];return _0xe68043;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5a75('0x0'));var timeout=require(_0x5a75('0x1'));var express=require(_0x5a75('0x2'));var router=express[_0x5a75('0x3')]();var fs_extra=require(_0x5a75('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5a75('0x5'));var config=require(_0x5a75('0x6'));var controller=require(_0x5a75('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5a75('0x8')]);router[_0x5a75('0x9')](_0x5a75('0xa'),auth[_0x5a75('0xb')](),controller['describe']);router['get'](_0x5a75('0xc'),auth[_0x5a75('0xb')](),controller['show']);router[_0x5a75('0xd')]('/',auth[_0x5a75('0xb')](),controller[_0x5a75('0xe')]);router[_0x5a75('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x5a75('0xc'),auth[_0x5a75('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 7462fa9..9735e83 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x119d13,_0x263cd2){var _0x333c35=function(_0x422c6e){while(--_0x422c6e){_0x119d13['push'](_0x119d13['shift']());}};_0x333c35(++_0x263cd2);}(_0x34e8,0x12c));var _0x834e=function(_0x187500,_0xf0478f){_0x187500=_0x187500-0x0;var _0x2173b6=_0x34e8[_0x187500];return _0x2173b6;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
+var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x2c1aa8,_0x3e0609){var _0x4019f5=function(_0x916eac){while(--_0x916eac){_0x2c1aa8['push'](_0x2c1aa8['shift']());}};_0x4019f5(++_0x3e0609);}(_0x54ef,0x112));var _0xf54e=function(_0x1f35bc,_0x2f6417){_0x1f35bc=_0x1f35bc-0x0;var _0x382a47=_0x54ef[_0x1f35bc];return _0x382a47;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 1f04160..36bd1ee 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 _0xa573=['body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','VIRTUAL','filter','options','where','includeAll','include','findAll','rows','catch','show','params','find','create'];(function(_0x1e3dd7,_0xff7c29){var _0x9b8d3f=function(_0x3271b9){while(--_0x3271b9){_0x1e3dd7['push'](_0x1e3dd7['shift']());}};_0x9b8d3f(++_0xff7c29);}(_0xa573,0x1a7));var _0x3a57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa573[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3a57('0x0'));var rimraf=require(_0x3a57('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a57('0x2'));var rp=require(_0x3a57('0x3'));var moment=require(_0x3a57('0x4'));var BPromise=require(_0x3a57('0x5'));var Mustache=require('mustache');var util=require(_0x3a57('0x6'));var path=require(_0x3a57('0x7'));var sox=require(_0x3a57('0x8'));var csv=require('to-csv');var ejs=require(_0x3a57('0x9'));var fs=require('fs');var fs_extra=require(_0x3a57('0xa'));var _=require(_0x3a57('0xb'));var squel=require(_0x3a57('0xc'));var crypto=require(_0x3a57('0xd'));var jsforce=require(_0x3a57('0xe'));var deskjs=require(_0x3a57('0xf'));var toCsv=require(_0x3a57('0x10'));var querystring=require(_0x3a57('0x11'));var Papa=require(_0x3a57('0x12'));var Redis=require(_0x3a57('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3a57('0x14'));var as=require(_0x3a57('0x15'));var hardwareService=require(_0x3a57('0x16'));var logger=require(_0x3a57('0x17'))(_0x3a57('0x18'));var utils=require(_0x3a57('0x19'));var config=require(_0x3a57('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x3a57('0x1b'))['db'];function respondWithStatusCode(_0x1459ed,_0x559d3f){_0x559d3f=_0x559d3f||0xcc;return function(_0x124ac8){if(_0x124ac8){return _0x1459ed['sendStatus'](_0x559d3f);}return _0x1459ed[_0x3a57('0x1c')](_0x559d3f)[_0x3a57('0x1d')]();};}function respondWithResult(_0x51549b,_0xa9470a){_0xa9470a=_0xa9470a||0xc8;return function(_0x53b71f){if(_0x53b71f){return _0x51549b[_0x3a57('0x1c')](_0xa9470a)[_0x3a57('0x1e')](_0x53b71f);}};}function respondWithFilteredResult(_0x28c759,_0x38cca8){return function(_0x4e6f14){if(_0x4e6f14){var _0x58ed52=typeof _0x38cca8['offset']===_0x3a57('0x1f')&&typeof _0x38cca8['limit']===_0x3a57('0x1f');var _0xfe8691=_0x4e6f14[_0x3a57('0x20')];var _0x9de628=_0x58ed52?0x0:_0x38cca8[_0x3a57('0x21')];var _0x1c8898=_0x58ed52?_0x4e6f14[_0x3a57('0x20')]:_0x38cca8[_0x3a57('0x21')]+_0x38cca8[_0x3a57('0x22')];var _0x1bd0f8;if(_0x1c8898>=_0xfe8691){_0x1c8898=_0xfe8691;_0x1bd0f8=0xc8;}else{_0x1bd0f8=0xce;}_0x28c759[_0x3a57('0x1c')](_0x1bd0f8);return _0x28c759[_0x3a57('0x23')](_0x3a57('0x24'),_0x9de628+'-'+_0x1c8898+'/'+_0xfe8691)[_0x3a57('0x1e')](_0x4e6f14);}return null;};}function patchUpdates(_0x176bae){return function(_0x5a7f22){try{jsonpatch[_0x3a57('0x25')](_0x5a7f22,_0x176bae,!![]);}catch(_0x5b74ff){return BPromise[_0x3a57('0x26')](_0x5b74ff);}return _0x5a7f22[_0x3a57('0x27')]();};}function saveUpdates(_0x51e548,_0x364eeb){return function(_0x55ede7){if(_0x55ede7){return _0x55ede7[_0x3a57('0x28')](_0x51e548)[_0x3a57('0x29')](function(_0x434271){return _0x434271;});}return null;};}function removeEntity(_0x44ca25,_0x163e33){return function(_0x13871d){if(_0x13871d){return _0x13871d['destroy']()[_0x3a57('0x29')](function(){_0x44ca25['status'](0xcc)[_0x3a57('0x1d')]();});}};}function handleEntityNotFound(_0x3a435e,_0x26b9e8){return function(_0x18cba4){if(!_0x18cba4){_0x3a435e[_0x3a57('0x2a')](0x194);}return _0x18cba4;};}function handleError(_0x42e154,_0x256cbe){_0x256cbe=_0x256cbe||0x1f4;return function(_0x5861cb){logger[_0x3a57('0x2b')](_0x5861cb[_0x3a57('0x2c')]);if(_0x5861cb[_0x3a57('0x2d')]){delete _0x5861cb[_0x3a57('0x2d')];}_0x42e154[_0x3a57('0x1c')](_0x256cbe)[_0x3a57('0x2e')](_0x5861cb);};}exports[_0x3a57('0x2f')]=function(_0x31f436,_0x400c7f){var _0x18e7aa={},_0x4fdf57={},_0x25048a={'count':0x0,'rows':[]};var _0x40e3d9=_[_0x3a57('0x30')](db[_0x3a57('0x31')][_0x3a57('0x32')],function(_0x416ce1){return{'name':_0x416ce1[_0x3a57('0x33')],'type':_0x416ce1[_0x3a57('0x34')][_0x3a57('0x35')]};});_0x4fdf57[_0x3a57('0x36')]=_[_0x3a57('0x30')](_0x40e3d9,_0x3a57('0x2d'));_0x4fdf57['query']=_[_0x3a57('0x37')](_0x31f436[_0x3a57('0x38')]);_0x4fdf57[_0x3a57('0x39')]=_[_0x3a57('0x3a')](_0x4fdf57[_0x3a57('0x36')],_0x4fdf57[_0x3a57('0x38')]);_0x18e7aa[_0x3a57('0x3b')]=_[_0x3a57('0x3a')](_0x4fdf57[_0x3a57('0x36')],qs[_0x3a57('0x3c')](_0x31f436[_0x3a57('0x38')][_0x3a57('0x3c')]));_0x18e7aa['attributes']=_0x18e7aa[_0x3a57('0x3b')][_0x3a57('0x3d')]?_0x18e7aa['attributes']:_0x4fdf57[_0x3a57('0x36')];if(!_0x31f436['query'][_0x3a57('0x3e')](_0x3a57('0x3f'))){_0x18e7aa[_0x3a57('0x22')]=qs[_0x3a57('0x22')](_0x31f436[_0x3a57('0x38')][_0x3a57('0x22')]);_0x18e7aa[_0x3a57('0x21')]=qs['offset'](_0x31f436[_0x3a57('0x38')]['offset']);}_0x18e7aa[_0x3a57('0x40')]=qs[_0x3a57('0x41')](_0x31f436[_0x3a57('0x38')][_0x3a57('0x41')]);_0x18e7aa['where']=qs[_0x3a57('0x39')](_[_0x3a57('0x42')](_0x31f436['query'],_0x4fdf57[_0x3a57('0x39')]),_0x40e3d9);if(_0x31f436[_0x3a57('0x38')]['filter']){_0x18e7aa['where']=_[_0x3a57('0x43')](_0x18e7aa['where'],{'$or':_[_0x3a57('0x30')](_0x40e3d9,function(_0x113111){if(_0x113111[_0x3a57('0x34')]!==_0x3a57('0x44')){var _0x4c8edf={};_0x4c8edf[_0x113111[_0x3a57('0x2d')]]={'$like':'%'+_0x31f436['query'][_0x3a57('0x45')]+'%'};return _0x4c8edf;}})});}_0x18e7aa=_[_0x3a57('0x43')]({},_0x18e7aa,_0x31f436[_0x3a57('0x46')]);var _0x56a92c={'where':_0x18e7aa[_0x3a57('0x47')]};return db[_0x3a57('0x31')]['count'](_0x56a92c)[_0x3a57('0x29')](function(_0x306535){_0x25048a['count']=_0x306535;if(_0x31f436[_0x3a57('0x38')][_0x3a57('0x48')]){_0x18e7aa[_0x3a57('0x49')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x3a57('0x4a')](_0x18e7aa);})[_0x3a57('0x29')](function(_0x4815f8){_0x25048a[_0x3a57('0x4b')]=_0x4815f8;return _0x25048a;})[_0x3a57('0x29')](respondWithFilteredResult(_0x400c7f,_0x18e7aa))[_0x3a57('0x4c')](handleError(_0x400c7f,null));};exports[_0x3a57('0x4d')]=function(_0x4dce27,_0x385b2b){var _0x1e3366={'raw':!![],'where':{'id':_0x4dce27[_0x3a57('0x4e')]['id']}},_0x44a5a0={};_0x44a5a0[_0x3a57('0x36')]=_[_0x3a57('0x37')](db[_0x3a57('0x31')][_0x3a57('0x32')]);_0x44a5a0['query']=_[_0x3a57('0x37')](_0x4dce27['query']);_0x44a5a0[_0x3a57('0x39')]=_[_0x3a57('0x3a')](_0x44a5a0[_0x3a57('0x36')],_0x44a5a0[_0x3a57('0x38')]);_0x1e3366[_0x3a57('0x3b')]=_[_0x3a57('0x3a')](_0x44a5a0[_0x3a57('0x36')],qs[_0x3a57('0x3c')](_0x4dce27[_0x3a57('0x38')]['fields']));_0x1e3366[_0x3a57('0x3b')]=_0x1e3366[_0x3a57('0x3b')][_0x3a57('0x3d')]?_0x1e3366[_0x3a57('0x3b')]:_0x44a5a0['model'];if(_0x4dce27[_0x3a57('0x38')][_0x3a57('0x48')]){_0x1e3366[_0x3a57('0x49')]=[{'all':!![]}];}_0x1e3366=_[_0x3a57('0x43')]({},_0x1e3366,_0x4dce27[_0x3a57('0x46')]);return db[_0x3a57('0x31')][_0x3a57('0x4f')](_0x1e3366)[_0x3a57('0x29')](handleEntityNotFound(_0x385b2b,null))[_0x3a57('0x29')](respondWithResult(_0x385b2b,null))[_0x3a57('0x4c')](handleError(_0x385b2b,null));};exports[_0x3a57('0x50')]=function(_0x1d39e1,_0x17ef2b){return db[_0x3a57('0x31')][_0x3a57('0x50')](_0x1d39e1[_0x3a57('0x51')],{})[_0x3a57('0x29')](respondWithResult(_0x17ef2b,0xc9))[_0x3a57('0x4c')](handleError(_0x17ef2b,null));};exports['update']=function(_0x2874f3,_0x1c1991){if(_0x2874f3[_0x3a57('0x51')]['id']){delete _0x2874f3[_0x3a57('0x51')]['id'];}return db[_0x3a57('0x31')][_0x3a57('0x4f')]({'where':{'id':_0x2874f3[_0x3a57('0x4e')]['id']}})[_0x3a57('0x29')](handleEntityNotFound(_0x1c1991,null))['then'](saveUpdates(_0x2874f3[_0x3a57('0x51')],null))[_0x3a57('0x29')](respondWithResult(_0x1c1991,null))[_0x3a57('0x4c')](handleError(_0x1c1991,null));};exports[_0x3a57('0x52')]=function(_0x2f29d6,_0x56e90c){return db[_0x3a57('0x31')][_0x3a57('0x4f')]({'where':{'id':_0x2f29d6['params']['id']}})[_0x3a57('0x29')](handleEntityNotFound(_0x56e90c,null))[_0x3a57('0x29')](removeEntity(_0x56e90c,null))[_0x3a57('0x4c')](handleError(_0x56e90c,null));};exports[_0x3a57('0x53')]=function(_0xc0a7c,_0x20258d){return db['ChatTransferReport']['describe']()['then'](respondWithResult(_0x20258d,null))[_0x3a57('0x4c')](handleError(_0x20258d,null));};
\ No newline at end of file
+var _0x520a=['util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','ChatTransferReport','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x7ca8b3,_0x5acc9d){var _0x14d0f5=function(_0x1143dd){while(--_0x1143dd){_0x7ca8b3['push'](_0x7ca8b3['shift']());}};_0x14d0f5(++_0x5acc9d);}(_0x520a,0xe4));var _0xa520=function(_0x183f82,_0x3920b5){_0x183f82=_0x183f82-0x0;var _0x1d09db=_0x520a[_0x183f82];return _0x1d09db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa520('0x0'));var zipdir=require(_0xa520('0x1'));var jsonpatch=require(_0xa520('0x2'));var rp=require(_0xa520('0x3'));var moment=require(_0xa520('0x4'));var BPromise=require(_0xa520('0x5'));var Mustache=require('mustache');var util=require(_0xa520('0x6'));var path=require('path');var sox=require(_0xa520('0x7'));var csv=require('to-csv');var ejs=require(_0xa520('0x8'));var fs=require('fs');var fs_extra=require(_0xa520('0x9'));var _=require(_0xa520('0xa'));var squel=require(_0xa520('0xb'));var crypto=require(_0xa520('0xc'));var jsforce=require(_0xa520('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa520('0xe'));var querystring=require('querystring');var Papa=require(_0xa520('0xf'));var Redis=require(_0xa520('0x10'));var authService=require(_0xa520('0x11'));var qs=require(_0xa520('0x12'));var as=require(_0xa520('0x13'));var hardwareService=require(_0xa520('0x14'));var logger=require(_0xa520('0x15'))(_0xa520('0x16'));var utils=require(_0xa520('0x17'));var config=require(_0xa520('0x18'));var licenseUtil=require(_0xa520('0x19'));var db=require(_0xa520('0x1a'))['db'];function respondWithStatusCode(_0x4fd59e,_0x3170ea){_0x3170ea=_0x3170ea||0xcc;return function(_0x451dc6){if(_0x451dc6){return _0x4fd59e[_0xa520('0x1b')](_0x3170ea);}return _0x4fd59e[_0xa520('0x1c')](_0x3170ea)['end']();};}function respondWithResult(_0x12861a,_0x51174b){_0x51174b=_0x51174b||0xc8;return function(_0x571283){if(_0x571283){return _0x12861a[_0xa520('0x1c')](_0x51174b)[_0xa520('0x1d')](_0x571283);}};}function respondWithFilteredResult(_0x3c4f71,_0xb6aa59){return function(_0x1fa170){if(_0x1fa170){var _0x5551b4=typeof _0xb6aa59['offset']===_0xa520('0x1e')&&typeof _0xb6aa59[_0xa520('0x1f')]==='undefined';var _0x564057=_0x1fa170[_0xa520('0x20')];var _0x2ee5bb=_0x5551b4?0x0:_0xb6aa59[_0xa520('0x21')];var _0x4cc29e=_0x5551b4?_0x1fa170['count']:_0xb6aa59['offset']+_0xb6aa59[_0xa520('0x1f')];var _0x11f819;if(_0x4cc29e>=_0x564057){_0x4cc29e=_0x564057;_0x11f819=0xc8;}else{_0x11f819=0xce;}_0x3c4f71[_0xa520('0x1c')](_0x11f819);return _0x3c4f71[_0xa520('0x22')]('Content-Range',_0x2ee5bb+'-'+_0x4cc29e+'/'+_0x564057)['json'](_0x1fa170);}return null;};}function patchUpdates(_0x3b7753){return function(_0x30926c){try{jsonpatch[_0xa520('0x23')](_0x30926c,_0x3b7753,!![]);}catch(_0x2631c0){return BPromise[_0xa520('0x24')](_0x2631c0);}return _0x30926c[_0xa520('0x25')]();};}function saveUpdates(_0xcd060f,_0x1800d3){return function(_0x2b2d71){if(_0x2b2d71){return _0x2b2d71[_0xa520('0x26')](_0xcd060f)[_0xa520('0x27')](function(_0x25b03d){return _0x25b03d;});}return null;};}function removeEntity(_0x146b1d,_0x22f1e2){return function(_0x53de5b){if(_0x53de5b){return _0x53de5b[_0xa520('0x28')]()[_0xa520('0x27')](function(){_0x146b1d[_0xa520('0x1c')](0xcc)[_0xa520('0x29')]();});}};}function handleEntityNotFound(_0x257a9c,_0x4ff71f){return function(_0x1a02de){if(!_0x1a02de){_0x257a9c[_0xa520('0x1b')](0x194);}return _0x1a02de;};}function handleError(_0x4a3f78,_0x145c54){_0x145c54=_0x145c54||0x1f4;return function(_0x21059b){logger['error'](_0x21059b[_0xa520('0x2a')]);if(_0x21059b[_0xa520('0x2b')]){delete _0x21059b[_0xa520('0x2b')];}_0x4a3f78['status'](_0x145c54)[_0xa520('0x2c')](_0x21059b);};}exports[_0xa520('0x2d')]=function(_0x7cc457,_0x55f1dc){var _0x2395df={},_0x105ff5={},_0xb2d71a={'count':0x0,'rows':[]};var _0x2ca4e5=_[_0xa520('0x2e')](db[_0xa520('0x2f')]['rawAttributes'],function(_0xeb437a){return{'name':_0xeb437a['fieldName'],'type':_0xeb437a[_0xa520('0x30')][_0xa520('0x31')]};});_0x105ff5[_0xa520('0x32')]=_[_0xa520('0x2e')](_0x2ca4e5,_0xa520('0x2b'));_0x105ff5['query']=_[_0xa520('0x33')](_0x7cc457['query']);_0x105ff5[_0xa520('0x34')]=_[_0xa520('0x35')](_0x105ff5['model'],_0x105ff5[_0xa520('0x36')]);_0x2395df['attributes']=_[_0xa520('0x35')](_0x105ff5[_0xa520('0x32')],qs[_0xa520('0x37')](_0x7cc457[_0xa520('0x36')][_0xa520('0x37')]));_0x2395df[_0xa520('0x38')]=_0x2395df['attributes'][_0xa520('0x39')]?_0x2395df[_0xa520('0x38')]:_0x105ff5[_0xa520('0x32')];if(!_0x7cc457[_0xa520('0x36')][_0xa520('0x3a')](_0xa520('0x3b'))){_0x2395df[_0xa520('0x1f')]=qs['limit'](_0x7cc457['query'][_0xa520('0x1f')]);_0x2395df[_0xa520('0x21')]=qs[_0xa520('0x21')](_0x7cc457[_0xa520('0x36')][_0xa520('0x21')]);}_0x2395df[_0xa520('0x3c')]=qs[_0xa520('0x3d')](_0x7cc457[_0xa520('0x36')]['sort']);_0x2395df[_0xa520('0x3e')]=qs[_0xa520('0x34')](_[_0xa520('0x3f')](_0x7cc457[_0xa520('0x36')],_0x105ff5[_0xa520('0x34')]),_0x2ca4e5);if(_0x7cc457[_0xa520('0x36')][_0xa520('0x40')]){_0x2395df[_0xa520('0x3e')]=_[_0xa520('0x41')](_0x2395df[_0xa520('0x3e')],{'$or':_['map'](_0x2ca4e5,function(_0x140095){if(_0x140095[_0xa520('0x30')]!=='VIRTUAL'){var _0x630e63={};_0x630e63[_0x140095[_0xa520('0x2b')]]={'$like':'%'+_0x7cc457['query']['filter']+'%'};return _0x630e63;}})});}_0x2395df=_[_0xa520('0x41')]({},_0x2395df,_0x7cc457[_0xa520('0x42')]);var _0x4409a5={'where':_0x2395df[_0xa520('0x3e')]};return db[_0xa520('0x2f')][_0xa520('0x20')](_0x4409a5)[_0xa520('0x27')](function(_0x574b9b){_0xb2d71a[_0xa520('0x20')]=_0x574b9b;if(_0x7cc457['query'][_0xa520('0x43')]){_0x2395df[_0xa520('0x44')]=[{'all':!![]}];}return db[_0xa520('0x2f')][_0xa520('0x45')](_0x2395df);})['then'](function(_0x20c258){_0xb2d71a[_0xa520('0x46')]=_0x20c258;return _0xb2d71a;})[_0xa520('0x27')](respondWithFilteredResult(_0x55f1dc,_0x2395df))[_0xa520('0x47')](handleError(_0x55f1dc,null));};exports[_0xa520('0x48')]=function(_0x3640b2,_0x1742ab){var _0x2c4b99={'raw':!![],'where':{'id':_0x3640b2[_0xa520('0x49')]['id']}},_0x3c374c={};_0x3c374c[_0xa520('0x32')]=_[_0xa520('0x33')](db[_0xa520('0x2f')]['rawAttributes']);_0x3c374c[_0xa520('0x36')]=_[_0xa520('0x33')](_0x3640b2[_0xa520('0x36')]);_0x3c374c['filters']=_[_0xa520('0x35')](_0x3c374c[_0xa520('0x32')],_0x3c374c[_0xa520('0x36')]);_0x2c4b99[_0xa520('0x38')]=_[_0xa520('0x35')](_0x3c374c[_0xa520('0x32')],qs[_0xa520('0x37')](_0x3640b2[_0xa520('0x36')][_0xa520('0x37')]));_0x2c4b99[_0xa520('0x38')]=_0x2c4b99['attributes'][_0xa520('0x39')]?_0x2c4b99[_0xa520('0x38')]:_0x3c374c[_0xa520('0x32')];if(_0x3640b2[_0xa520('0x36')][_0xa520('0x43')]){_0x2c4b99[_0xa520('0x44')]=[{'all':!![]}];}_0x2c4b99=_['merge']({},_0x2c4b99,_0x3640b2[_0xa520('0x42')]);return db['ChatTransferReport'][_0xa520('0x4a')](_0x2c4b99)[_0xa520('0x27')](handleEntityNotFound(_0x1742ab,null))['then'](respondWithResult(_0x1742ab,null))[_0xa520('0x47')](handleError(_0x1742ab,null));};exports[_0xa520('0x4b')]=function(_0x32cf56,_0x38c290){return db[_0xa520('0x2f')]['create'](_0x32cf56[_0xa520('0x4c')],{})['then'](respondWithResult(_0x38c290,0xc9))[_0xa520('0x47')](handleError(_0x38c290,null));};exports['update']=function(_0x30fdb0,_0x150e0a){if(_0x30fdb0[_0xa520('0x4c')]['id']){delete _0x30fdb0[_0xa520('0x4c')]['id'];}return db[_0xa520('0x2f')]['find']({'where':{'id':_0x30fdb0[_0xa520('0x49')]['id']}})[_0xa520('0x27')](handleEntityNotFound(_0x150e0a,null))[_0xa520('0x27')](saveUpdates(_0x30fdb0[_0xa520('0x4c')],null))[_0xa520('0x27')](respondWithResult(_0x150e0a,null))[_0xa520('0x47')](handleError(_0x150e0a,null));};exports[_0xa520('0x28')]=function(_0x4c4202,_0x8558b3){return db[_0xa520('0x2f')][_0xa520('0x4a')]({'where':{'id':_0x4c4202['params']['id']}})[_0xa520('0x27')](handleEntityNotFound(_0x8558b3,null))[_0xa520('0x27')](removeEntity(_0x8558b3,null))[_0xa520('0x47')](handleError(_0x8558b3,null));};exports[_0xa520('0x4d')]=function(_0x563b0a,_0x138802){return db[_0xa520('0x2f')][_0xa520('0x4d')]()[_0xa520('0x27')](respondWithResult(_0x138802,null))[_0xa520('0x47')](handleError(_0x138802,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 0ada00e..fcc29bd 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 _0x33c8=['rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x33c8,0x157));var _0x833c=function(_0xeac7f6,_0x2cfdac){_0xeac7f6=_0xeac7f6-0x0;var _0xf7993f=_0x33c8[_0xeac7f6];return _0xf7993f;};'use strict';var _=require(_0x833c('0x0'));var util=require(_0x833c('0x1'));var logger=require(_0x833c('0x2'))(_0x833c('0x3'));var moment=require(_0x833c('0x4'));var BPromise=require('bluebird');var rp=require(_0x833c('0x5'));var fs=require('fs');var path=require(_0x833c('0x6'));var rimraf=require(_0x833c('0x7'));var config=require(_0x833c('0x8'));var attributes=require(_0x833c('0x9'));module[_0x833c('0xa')]=function(_0x3c863f,_0x975972){return _0x3c863f[_0x833c('0xb')](_0x833c('0xc'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x833c('0xd'),'fields':[_0x833c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xab2b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger'];(function(_0x16f414,_0xf03e38){var _0x3e0131=function(_0x5a7040){while(--_0x5a7040){_0x16f414['push'](_0x16f414['shift']());}};_0x3e0131(++_0xf03e38);}(_0xab2b,0xdf));var _0xbab2=function(_0x44a78c,_0x4aaa6){_0x44a78c=_0x44a78c-0x0;var _0x160bf3=_0xab2b[_0x44a78c];return _0x160bf3;};'use strict';var _=require('lodash');var util=require(_0xbab2('0x0'));var logger=require(_0xbab2('0x1'))(_0xbab2('0x2'));var moment=require(_0xbab2('0x3'));var BPromise=require(_0xbab2('0x4'));var rp=require(_0xbab2('0x5'));var fs=require('fs');var path=require(_0xbab2('0x6'));var rimraf=require(_0xbab2('0x7'));var config=require(_0xbab2('0x8'));var attributes=require(_0xbab2('0x9'));module[_0xbab2('0xa')]=function(_0x396fa0,_0x510c31){return _0x396fa0[_0xbab2('0xb')](_0xbab2('0xc'),attributes,{'tableName':_0xbab2('0xd'),'paranoid':![],'indexes':[{'name':_0xbab2('0xe'),'fields':[_0xbab2('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index a9f9ab3..f8f91dc 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 _0x5ed3=['client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1f7d53,_0x25407c){var _0x18f549=function(_0x99b1c7){while(--_0x99b1c7){_0x1f7d53['push'](_0x1f7d53['shift']());}};_0x18f549(++_0x25407c);}(_0x5ed3,0x9f));var _0x35ed=function(_0x5d31b4,_0x2d786c){_0x5d31b4=_0x5d31b4-0x0;var _0x1b6096=_0x5ed3[_0x5d31b4];return _0x1b6096;};'use strict';var _=require(_0x35ed('0x0'));var util=require(_0x35ed('0x1'));var moment=require('moment');var BPromise=require(_0x35ed('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35ed('0x3'))['db'];var utils=require(_0x35ed('0x4'));var logger=require(_0x35ed('0x5'))(_0x35ed('0x6'));var config=require(_0x35ed('0x7'));var jayson=require(_0x35ed('0x8'));var client=jayson[_0x35ed('0x9')][_0x35ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5141f8,_0x16ef50,_0x30444c){return new BPromise(function(_0x29a17f,_0x5e49d4){return client['request'](_0x5141f8,_0x30444c)[_0x35ed('0xb')](function(_0x1636e6){logger[_0x35ed('0xc')](_0x35ed('0xd'),_0x16ef50,_0x35ed('0xe'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x16ef50,_0x35ed('0xe'),JSON[_0x35ed('0xf')](_0x1636e6));if(_0x1636e6[_0x35ed('0x10')]){if(_0x1636e6[_0x35ed('0x10')][_0x35ed('0x11')]===0x1f4){logger[_0x35ed('0x10')](_0x35ed('0xd'),_0x16ef50,_0x1636e6['error'][_0x35ed('0x12')]);return _0x5e49d4(_0x1636e6[_0x35ed('0x10')]['message']);}logger[_0x35ed('0x10')](_0x35ed('0xd'),_0x16ef50,_0x1636e6[_0x35ed('0x10')][_0x35ed('0x12')]);return _0x29a17f(_0x1636e6['error'][_0x35ed('0x12')]);}else{logger['info'](_0x35ed('0xd'),_0x16ef50,_0x35ed('0xe'));_0x29a17f(_0x1636e6[_0x35ed('0x13')][_0x35ed('0x12')]);}})[_0x35ed('0x14')](function(_0x47e4c9){logger[_0x35ed('0x10')](_0x35ed('0xd'),_0x16ef50,_0x47e4c9);_0x5e49d4(_0x47e4c9);});});}
\ No newline at end of file
+var _0x6022=['then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x6022,0x1c1));var _0x2602=function(_0x29a428,_0x4fc21e){_0x29a428=_0x29a428-0x0;var _0x30ffcc=_0x6022[_0x29a428];return _0x30ffcc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2602('0x0'));var BPromise=require(_0x2602('0x1'));var rs=require(_0x2602('0x2'));var fs=require('fs');var Redis=require(_0x2602('0x3'));var db=require(_0x2602('0x4'))['db'];var utils=require(_0x2602('0x5'));var logger=require(_0x2602('0x6'))(_0x2602('0x7'));var config=require(_0x2602('0x8'));var jayson=require(_0x2602('0x9'));var client=jayson[_0x2602('0xa')][_0x2602('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x431c25,_0x184ae5,_0x425dd8){return new BPromise(function(_0x5099b6,_0x32586b){return client[_0x2602('0xc')](_0x431c25,_0x425dd8)[_0x2602('0xd')](function(_0xd57967){logger['info'](_0x2602('0xe'),_0x184ae5,_0x2602('0xf'));logger[_0x2602('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x184ae5,'request\x20sent',JSON['stringify'](_0xd57967));if(_0xd57967[_0x2602('0x11')]){if(_0xd57967[_0x2602('0x11')][_0x2602('0x12')]===0x1f4){logger[_0x2602('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x184ae5,_0xd57967[_0x2602('0x11')][_0x2602('0x13')]);return _0x32586b(_0xd57967[_0x2602('0x11')]['message']);}logger['error'](_0x2602('0xe'),_0x184ae5,_0xd57967['error'][_0x2602('0x13')]);return _0x5099b6(_0xd57967[_0x2602('0x11')]['message']);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x184ae5,_0x2602('0xf'));_0x5099b6(_0xd57967[_0x2602('0x14')][_0x2602('0x13')]);}})[_0x2602('0x15')](function(_0x16c260){logger[_0x2602('0x11')](_0x2602('0xe'),_0x184ae5,_0x16c260);_0x32586b(_0x16c260);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index d20955a..ec93be1 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 _0xee60=['./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','/:id','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2542d1,_0xdb7645){var _0xec2ce7=function(_0x27c486){while(--_0x27c486){_0x2542d1['push'](_0x2542d1['shift']());}};_0xec2ce7(++_0xdb7645);}(_0xee60,0x188));var _0x0ee6=function(_0x27b41a,_0x3b332b){_0x27b41a=_0x27b41a-0x0;var _0x816952=_0xee60[_0x27b41a];return _0x816952;};'use strict';var multer=require(_0x0ee6('0x0'));var util=require(_0x0ee6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0ee6('0x2'));var router=express[_0x0ee6('0x3')]();var fs_extra=require(_0x0ee6('0x4'));var auth=require(_0x0ee6('0x5'));var interaction=require(_0x0ee6('0x6'));var config=require('../../config/environment');var controller=require(_0x0ee6('0x7'));router[_0x0ee6('0x8')]('/',auth[_0x0ee6('0x9')](),controller[_0x0ee6('0xa')]);router['get'](_0x0ee6('0xb'),auth[_0x0ee6('0x9')](),controller[_0x0ee6('0xc')]);router['get']('/:id',auth[_0x0ee6('0x9')](),controller[_0x0ee6('0xd')]);router[_0x0ee6('0xe')]('/',auth[_0x0ee6('0x9')](),controller['create']);router['put'](_0x0ee6('0xf'),auth[_0x0ee6('0x9')](),controller['update']);router[_0x0ee6('0x10')](_0x0ee6('0xf'),auth[_0x0ee6('0x9')](),controller[_0x0ee6('0x11')]);module[_0x0ee6('0x12')]=router;
\ No newline at end of file
+var _0x3923=['get','index','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xf0a2d4,_0x49323f){var _0x1251ae=function(_0x280976){while(--_0x280976){_0xf0a2d4['push'](_0xf0a2d4['shift']());}};_0x1251ae(++_0x49323f);}(_0x3923,0x102));var _0x3392=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3923[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x3392('0x0'));var util=require(_0x3392('0x1'));var path=require(_0x3392('0x2'));var timeout=require(_0x3392('0x3'));var express=require(_0x3392('0x4'));var router=express[_0x3392('0x5')]();var fs_extra=require(_0x3392('0x6'));var auth=require(_0x3392('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x3392('0x8')]('/',auth['isAuthenticated'](),controller[_0x3392('0x9')]);router[_0x3392('0x8')]('/describe',auth[_0x3392('0xa')](),controller[_0x3392('0xb')]);router[_0x3392('0x8')](_0x3392('0xc'),auth['isAuthenticated'](),controller[_0x3392('0xd')]);router[_0x3392('0xe')]('/',auth[_0x3392('0xa')](),controller[_0x3392('0xf')]);router[_0x3392('0x10')](_0x3392('0xc'),auth[_0x3392('0xa')](),controller[_0x3392('0x11')]);router['delete']('/:id',auth[_0x3392('0xa')](),controller[_0x3392('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index d10c5de..05d3e5b 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 _0xc3aa=['bottom_right','alternate','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias'];(function(_0x5c2bef,_0x16806e){var _0xd60cc1=function(_0x40e74a){while(--_0x40e74a){_0x5c2bef['push'](_0x5c2bef['shift']());}};_0xd60cc1(++_0x16806e);}(_0xc3aa,0x1c8));var _0xac3a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc3aa[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xac3a('0x0'));var rs=require(_0xac3a('0x1'));module[_0xac3a('0x2')]={'name':{'type':Sequelize[_0xac3a('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xac3a('0x3')],'allowNull':![],'unique':_0xac3a('0x4')},'description':{'type':Sequelize[_0xac3a('0x3')]},'mapKey':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0xac3a('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x6')},'customerAlias':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xac3a('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xac3a('0x3')],'allowNull':![],'defaultValue':_0xac3a('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xac3a('0x3')],'allowNull':![],'defaultValue':_0xac3a('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xac3a('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xac3a('0x3')]},'animation':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xac3a('0xb')]('rounded',_0xac3a('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xac3a('0xd')},'start_chat_button':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0xe')},'offline_chat_button':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0xf')},'header_offline':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x10')},'download_transcript':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xac3a('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xac3a('0x12')]},'closingQuestion':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x13')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xac3a('0x14')},'noteTitle':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x15')},'placeholderMessage':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x16')},'closingMessageButton':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0xf')},'skipMessageButton':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x18')},'ratingType':{'type':Sequelize[_0xac3a('0xb')](_0xac3a('0x19'),_0xac3a('0x1a')),'defaultValue':_0xac3a('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xac3a('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xac3a('0x12')],'defaultValue':function(){return JSON[_0xac3a('0x1b')]({'items':[{'type':_0xac3a('0x1c'),'variable':null,'config':{'placeholder':_0xac3a('0x1d'),'type':_0xac3a('0x1e'),'required':!![]},'props':{'title':_0xac3a('0x1d'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xac3a('0x5'),'type':_0xac3a('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xac3a('0x1f')](_0xac3a('0x20'))?JSON[_0xac3a('0x21')](this['getDataValue'](_0xac3a('0x20'))):{};},'set':function(_0x3dd0f2){return this[_0xac3a('0x22')]('onlineForm',JSON[_0xac3a('0x1b')](_0x3dd0f2));}},'offlineForm':{'type':Sequelize[_0xac3a('0x12')],'defaultValue':function(){return JSON[_0xac3a('0x1b')]({'items':[{'type':'input','props':{'title':_0xac3a('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xac3a('0x5'),'type':_0xac3a('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xac3a('0x23')},'props':{'title':_0xac3a('0x23'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xac3a('0x1f')](_0xac3a('0x24'))?JSON[_0xac3a('0x21')](this[_0xac3a('0x1f')](_0xac3a('0x24'))):{};},'set':function(_0x4f0b67){return this[_0xac3a('0x22')](_0xac3a('0x24'),JSON['stringify'](_0x4f0b67));}},'token':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':function(){return rs[_0xac3a('0x25')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xac3a('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xac3a('0x26')},'waitingMessage':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xac3a('0x28')},'offlineMessageBody':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xac3a('0x29')},'skipUnmanaged':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x17')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xac3a('0xf')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xac3a('0x12')]},'showAgentAvatar':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xac3a('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xac3a('0x2a');}},'notificationSound':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xac3a('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x2c')},'verticalAlignment':{'type':Sequelize[_0xac3a('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':_0xac3a('0x2d')},'defaultTitle':{'type':Sequelize[_0xac3a('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xac3a('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xac3a('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xac3a('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xac3a('0x9')],'comment':_0xac3a('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xac3a('0x2f'),'set':function(_0x539b29){if(!_0x539b29)this[_0xac3a('0x22')](_0xac3a('0x30'),null);this[_0xac3a('0x22')]('mandatoryDisposition',_0x539b29);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xac3a('0x3')]},'vidaooTopic':{'type':Sequelize[_0xac3a('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xac3a('0x3')],'defaultValue':function(){return _0xac3a('0x31');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xac3a('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xac3a('0x12')]}};
\ No newline at end of file
+var _0x81b2=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','BOOLEAN','squared','rounded','Chat','Send','Contact\x20us','INTEGER','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x179be4,_0x1b1873){var _0x3fde8b=function(_0x187669){while(--_0x187669){_0x179be4['push'](_0x179be4['shift']());}};_0x3fde8b(++_0x1b1873);}(_0x81b2,0x1ad));var _0x281b=function(_0x31ce3d,_0x581047){_0x31ce3d=_0x31ce3d-0x0;var _0x203d95=_0x81b2[_0x31ce3d];return _0x203d95;};'use strict';var Sequelize=require(_0x281b('0x0'));var rs=require(_0x281b('0x1'));module[_0x281b('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x281b('0x3')],'allowNull':![],'unique':_0x281b('0x4')},'description':{'type':Sequelize[_0x281b('0x3')]},'mapKey':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x5')},'mapKeyOffline':{'type':Sequelize[_0x281b('0x3')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x281b('0x3')],'allowNull':![],'defaultValue':_0x281b('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x281b('0x3')],'allowNull':![],'defaultValue':_0x281b('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x281b('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x281b('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0x281b('0x9')),'defaultValue':_0x281b('0xa')},'header_online':{'type':Sequelize[_0x281b('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0xb')},'offline_chat_button':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0xc')},'header_offline':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x281b('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x281b('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x281b('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x281b('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x281b('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x12')},'noteTitle':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x13')},'placeholderMessage':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x14')},'closingMessage':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x15')},'closingMessageButton':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0xc')},'skipMessageButton':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x17')},'ratingType':{'type':Sequelize[_0x281b('0x18')](_0x281b('0x19'),_0x281b('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x281b('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x281b('0xf')],'defaultValue':function(){return JSON[_0x281b('0x1b')]({'items':[{'type':_0x281b('0x1c'),'variable':null,'config':{'placeholder':_0x281b('0x1d'),'type':'text','required':!![]},'props':{'title':_0x281b('0x1d'),'helpText':''}},{'type':_0x281b('0x1c'),'props':{'title':_0x281b('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x281b('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x281b('0x1e')](_0x281b('0x1f'))?JSON[_0x281b('0x20')](this[_0x281b('0x1e')](_0x281b('0x1f'))):{};},'set':function(_0x2f2922){return this[_0x281b('0x21')](_0x281b('0x1f'),JSON['stringify'](_0x2f2922));}},'offlineForm':{'type':Sequelize[_0x281b('0xf')],'defaultValue':function(){return JSON[_0x281b('0x1b')]({'items':[{'type':_0x281b('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x281b('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0x281b('0x22')},'props':{'title':_0x281b('0x22'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x281b('0x1e')]('offlineForm')?JSON[_0x281b('0x20')](this[_0x281b('0x1e')](_0x281b('0x23'))):{};},'set':function(_0x1b13a){return this[_0x281b('0x21')](_0x281b('0x23'),JSON['stringify'](_0x1b13a));}},'token':{'type':Sequelize[_0x281b('0x3')],'defaultValue':function(){return rs[_0x281b('0x24')]();}},'autoclose':{'type':Sequelize[_0x281b('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x25')},'waitingMessage':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x281b('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x281b('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x281b('0x16')},'sendUnmanaged':{'type':Sequelize[_0x281b('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x281b('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x281b('0x3')]},'notificationTemplate':{'type':Sequelize[_0x281b('0xf')],'defaultValue':function(){return _0x281b('0x29');}},'notificationSound':{'type':Sequelize[_0x281b('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x281b('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x281b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x2b')},'verticalAlignment':{'type':Sequelize[_0x281b('0xe')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x2c')},'defaultTitle':{'type':Sequelize[_0x281b('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x281b('0xe')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x281b('0x3')],'allowNull':![],'defaultValue':_0x281b('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x281b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x281b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x281b('0x3')],'defaultValue':_0x281b('0x2e')},'systemAvatar':{'type':Sequelize[_0x281b('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x281b('0xe')],'comment':_0x281b('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![],'comment':_0x281b('0x30'),'set':function(_0x99f00d){if(!_0x99f00d)this[_0x281b('0x21')](_0x281b('0x31'),null);this['setDataValue'](_0x281b('0x32'),_0x99f00d);}},'vidaooEscalation':{'type':Sequelize[_0x281b('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x281b('0x3')],'allowNull':![],'defaultValue':_0x281b('0x33')},'vidaooNote':{'type':Sequelize[_0x281b('0x3')],'defaultValue':function(){return _0x281b('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x281b('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x281b('0xf')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 50a8f48..09af1b9 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 _0xfcf5=['showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','list','applications','orderBy','priority','asc','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','browser','version','%s\x20%s','unknown','device','threadId','externalUrl','ChatInteraction','ContactId','spread','firstName','contact','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','waitForTheAssignedAgent','Start','startRouting','EventManager','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','originalname','mimetype','attachments','basename','sequelize','transaction','Attachment','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','Chat','NotifyMailAccount','notifyMail','server','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','format','interval','iftime\x20%s','indexOf','true','ONLINE','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','getProactiveActions','../../config/license/util','virtual','License','Intervals','push','all','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','render','verticalAlignment','textColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','json','getApplications','addProactiveActions','chatProactiveAction','online','offlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','ejs','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','then','destroy','get','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','Disposition','getDispositions','findOne','length','order','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','rows','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png'];(function(_0x1316b7,_0x1ac684){var _0x30a11c=function(_0x2a9697){while(--_0x2a9697){_0x1316b7['push'](_0x1316b7['shift']());}};_0x30a11c(++_0x1ac684);}(_0xfcf5,0x1d3));var _0x5fcf=function(_0x347da9,_0x19b221){_0x347da9=_0x347da9-0x0;var _0x20b0ef=_0xfcf5[_0x347da9];return _0x20b0ef;};'use strict';var BPromise=require(_0x5fcf('0x0'));var Mustache=require('mustache');var util=require(_0x5fcf('0x1'));var path=require('path');var ejs=require(_0x5fcf('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x5fcf('0x3'));var Redis=require(_0x5fcf('0x4'));var qs=require(_0x5fcf('0x5'));var logger=require(_0x5fcf('0x6'))(_0x5fcf('0x7'));var config=require(_0x5fcf('0x8'));var db=require(_0x5fcf('0x9'))['db'];config[_0x5fcf('0xa')]=_[_0x5fcf('0xb')](config[_0x5fcf('0xa')],{'host':_0x5fcf('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5fcf('0xa')]));require('./chatWebsite.socket')[_0x5fcf('0xd')](socket);var jayson=require(_0x5fcf('0xe'));var client=jayson[_0x5fcf('0xf')]['http']({'port':0x232c});var client9002=jayson['client'][_0x5fcf('0x10')]({'port':0x232a});var client9003=jayson[_0x5fcf('0xf')][_0x5fcf('0x10')]({'port':0x232b});var client9001=jayson[_0x5fcf('0xf')][_0x5fcf('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x3ba27a,_0x487178,_0x2eb81a,_0x1ce4a9){return new BPromise(function(_0x3da251,_0x30d6a7){var _0x32d433=_0x1ce4a9||client;return _0x32d433[_0x5fcf('0x11')](_0x3ba27a,_0x2eb81a)['then'](function(_0x1dce91){logger[_0x5fcf('0x12')](_0x5fcf('0x13'),_0x487178,_0x5fcf('0x14'));logger[_0x5fcf('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x487178,_0x5fcf('0x14'),JSON[_0x5fcf('0x16')](_0x1dce91));if(_0x1dce91[_0x5fcf('0x17')]){if(_0x1dce91[_0x5fcf('0x17')]['code']===0x1f4){logger[_0x5fcf('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x487178,_0x1dce91['error'][_0x5fcf('0x18')]);return _0x30d6a7(_0x1dce91[_0x5fcf('0x17')][_0x5fcf('0x18')]);}logger[_0x5fcf('0x17')](_0x5fcf('0x13'),_0x487178,_0x1dce91[_0x5fcf('0x17')][_0x5fcf('0x18')]);return _0x3da251(_0x1dce91[_0x5fcf('0x17')][_0x5fcf('0x18')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x487178,_0x5fcf('0x14'));_0x3da251(_0x1dce91[_0x5fcf('0x19')]['message']);}})[_0x5fcf('0x1a')](function(_0x3a5c3e){logger[_0x5fcf('0x17')](_0x5fcf('0x13'),_0x487178,_0x3a5c3e);_0x30d6a7(_0x3a5c3e);});});}function respondWithStatusCode(_0x3e30f7,_0x110b49){_0x110b49=_0x110b49||0xcc;return function(_0x4f0768){if(_0x4f0768){return _0x3e30f7[_0x5fcf('0x1b')](_0x110b49);}return _0x3e30f7[_0x5fcf('0x1c')](_0x110b49)[_0x5fcf('0x1d')]();};}function respondWithResult(_0xcf88a0,_0x5e5890){_0x5e5890=_0x5e5890||0xc8;return function(_0x3f6f25){if(_0x3f6f25){return _0xcf88a0[_0x5fcf('0x1c')](_0x5e5890)['json'](_0x3f6f25);}};}function respondWithFilteredResult(_0x3b1458,_0x4c084d){return function(_0x140b28){if(_0x140b28){var _0x4d1d7d=typeof _0x4c084d[_0x5fcf('0x1e')]==='undefined'&&typeof _0x4c084d[_0x5fcf('0x1f')]===_0x5fcf('0x20');var _0x6b7ff3=_0x140b28[_0x5fcf('0x21')];var _0x455232=_0x4d1d7d?0x0:_0x4c084d['offset'];var _0x83fd96=_0x4d1d7d?_0x140b28[_0x5fcf('0x21')]:_0x4c084d[_0x5fcf('0x1e')]+_0x4c084d['limit'];var _0x21bff9;if(_0x83fd96>=_0x6b7ff3){_0x83fd96=_0x6b7ff3;_0x21bff9=0xc8;}else{_0x21bff9=0xce;}_0x3b1458[_0x5fcf('0x1c')](_0x21bff9);return _0x3b1458[_0x5fcf('0x22')](_0x5fcf('0x23'),_0x455232+'-'+_0x83fd96+'/'+_0x6b7ff3)['json'](_0x140b28);}return null;};}function saveUpdates(_0xd62eed){return function(_0x11e9f8){if(_0x11e9f8){return _0x11e9f8['update'](_0xd62eed)[_0x5fcf('0x24')](function(_0x60a908){return _0x60a908;});}return null;};}function removeEntity(_0x2d20e5){return function(_0x23268c){if(_0x23268c){return _0x23268c[_0x5fcf('0x25')]()[_0x5fcf('0x24')](function(){var _0x16d2c7=_0x23268c[_0x5fcf('0x26')]({'plain':!![]});var _0x43a4b1='ChatWebsites';return db[_0x5fcf('0x27')]['destroy']({'where':{'type':_0x43a4b1,'resourceId':_0x16d2c7['id']}})[_0x5fcf('0x24')](function(){return _0x23268c;});})[_0x5fcf('0x24')](function(){_0x2d20e5[_0x5fcf('0x1c')](0xcc)[_0x5fcf('0x1d')]();});}};}function handleEntityNotFound(_0x3f98e1){return function(_0x35b97b){if(!_0x35b97b){_0x3f98e1[_0x5fcf('0x1b')](0x194);}return _0x35b97b;};}function handleError(_0x95ff08,_0x9ebd62){_0x9ebd62=_0x9ebd62||0x1f4;return function(_0x4d8206){logger['error'](_0x4d8206[_0x5fcf('0x28')]);if(_0x4d8206[_0x5fcf('0x29')]){delete _0x4d8206[_0x5fcf('0x29')];}_0x95ff08[_0x5fcf('0x1c')](_0x9ebd62)['send'](_0x4d8206);};}exports[_0x5fcf('0x2a')]=function(_0x275a3d,_0x4189c3){var _0x119284={'include':[{'model':db[_0x5fcf('0x2b')],'as':_0x5fcf('0x2c')}]},_0xc7a42c={},_0x5b963c={'count':0x0,'rows':[]};var _0x1a9da6=_[_0x5fcf('0x2d')](db[_0x5fcf('0x2e')][_0x5fcf('0x2f')],function(_0x4f8660){return{'name':_0x4f8660['fieldName'],'type':_0x4f8660[_0x5fcf('0x30')][_0x5fcf('0x31')]};});_0xc7a42c['model']=_[_0x5fcf('0x2d')](_0x1a9da6,'name');_0xc7a42c[_0x5fcf('0x32')]=_[_0x5fcf('0x33')](_0x275a3d[_0x5fcf('0x32')]);_0xc7a42c[_0x5fcf('0x34')]=_[_0x5fcf('0x35')](_0xc7a42c['model'],_0xc7a42c['query']);_0x119284['attributes']=_[_0x5fcf('0x35')](_0xc7a42c[_0x5fcf('0x36')],qs[_0x5fcf('0x37')](_0x275a3d[_0x5fcf('0x32')][_0x5fcf('0x37')]));_0x119284[_0x5fcf('0x38')]=_0x119284[_0x5fcf('0x38')]['length']?_0x119284['attributes']:_0xc7a42c['model'];if(!_0x275a3d[_0x5fcf('0x32')][_0x5fcf('0x39')](_0x5fcf('0x3a'))){_0x119284[_0x5fcf('0x1f')]=qs['limit'](_0x275a3d[_0x5fcf('0x32')][_0x5fcf('0x1f')]);_0x119284[_0x5fcf('0x1e')]=qs[_0x5fcf('0x1e')](_0x275a3d[_0x5fcf('0x32')][_0x5fcf('0x1e')]);}_0x119284['order']=qs[_0x5fcf('0x3b')](_0x275a3d[_0x5fcf('0x32')][_0x5fcf('0x3b')]);_0x119284['where']=qs[_0x5fcf('0x34')](_[_0x5fcf('0x3c')](_0x275a3d[_0x5fcf('0x32')],_0xc7a42c[_0x5fcf('0x34')]),_0x1a9da6);if(_0x275a3d[_0x5fcf('0x32')][_0x5fcf('0x3d')]){_0x119284[_0x5fcf('0x3e')]=_['merge'](_0x119284[_0x5fcf('0x3e')],{'$or':_[_0x5fcf('0x2d')](_0x1a9da6,function(_0x1b9681){if(_0x1b9681[_0x5fcf('0x30')]!==_0x5fcf('0x3f')){var _0x2ba4c5={};_0x2ba4c5[_0x1b9681['name']]={'$like':'%'+_0x275a3d[_0x5fcf('0x32')]['filter']+'%'};return _0x2ba4c5;}})});}_0x119284=_[_0x5fcf('0x40')]({},_0x119284,_0x275a3d[_0x5fcf('0x41')]);var _0x6d5c3d={'where':_0x119284[_0x5fcf('0x3e')]};return db[_0x5fcf('0x2e')][_0x5fcf('0x21')](_0x6d5c3d)[_0x5fcf('0x24')](function(_0x304118){_0x5b963c[_0x5fcf('0x21')]=_0x304118;if(_0x275a3d[_0x5fcf('0x32')][_0x5fcf('0x42')]){_0x119284[_0x5fcf('0x43')]=[{'all':!![]}];}return db[_0x5fcf('0x2e')][_0x5fcf('0x44')](_0x119284);})['then'](function(_0x5c69bc){_0x5b963c['rows']=_0x5c69bc;return _0x5b963c;})[_0x5fcf('0x24')](respondWithFilteredResult(_0x4189c3,_0x119284))[_0x5fcf('0x1a')](handleError(_0x4189c3,null));};exports[_0x5fcf('0x45')]=function(_0x5a34f6,_0x49e832){var _0x4f0ce7={'raw':![],'where':{'id':_0x5a34f6[_0x5fcf('0x46')]['id']},'include':[{'model':db[_0x5fcf('0x2b')],'as':_0x5fcf('0x2c')}]},_0x31f548={};_0x31f548['model']=_[_0x5fcf('0x33')](db[_0x5fcf('0x2e')][_0x5fcf('0x2f')]);_0x31f548[_0x5fcf('0x32')]=_[_0x5fcf('0x33')](_0x5a34f6[_0x5fcf('0x32')]);_0x31f548[_0x5fcf('0x34')]=_[_0x5fcf('0x35')](_0x31f548[_0x5fcf('0x36')],_0x31f548[_0x5fcf('0x32')]);_0x4f0ce7['attributes']=_[_0x5fcf('0x35')](_0x31f548['model'],qs[_0x5fcf('0x37')](_0x5a34f6['query'][_0x5fcf('0x37')]));_0x4f0ce7[_0x5fcf('0x38')]=_0x4f0ce7[_0x5fcf('0x38')]['length']?_0x4f0ce7[_0x5fcf('0x38')]:_0x31f548[_0x5fcf('0x36')];if(_0x5a34f6[_0x5fcf('0x32')][_0x5fcf('0x42')]){_0x4f0ce7[_0x5fcf('0x43')]=[{'all':!![]}];}_0x4f0ce7=_[_0x5fcf('0x40')]({},_0x4f0ce7,_0x5a34f6['options']);return db[_0x5fcf('0x2e')][_0x5fcf('0x47')](_0x4f0ce7)[_0x5fcf('0x24')](handleEntityNotFound(_0x49e832,null))[_0x5fcf('0x24')](respondWithResult(_0x49e832,null))['catch'](handleError(_0x49e832,null));};exports[_0x5fcf('0x48')]=function(_0x42ef21,_0xdab191){return db['ChatWebsite'][_0x5fcf('0x48')](_0x42ef21[_0x5fcf('0x49')],{})[_0x5fcf('0x24')](function(_0x3a7306){var _0x3be60f=_0x42ef21[_0x5fcf('0x4a')][_0x5fcf('0x26')]({'plain':!![]});if(!_0x3be60f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3be60f[_0x5fcf('0x4b')]===_0x5fcf('0x4a')){var _0x1622c9=_0x3a7306['get']({'plain':!![]});var _0x58acdf='ChatWebsites';return db['UserProfileSection']['find']({'where':{'name':_0x58acdf,'userProfileId':_0x3be60f[_0x5fcf('0x4c')]},'raw':!![]})[_0x5fcf('0x24')](function(_0x4a0e7a){if(_0x4a0e7a&&_0x4a0e7a[_0x5fcf('0x4d')]===0x0){return db[_0x5fcf('0x27')]['create']({'name':_0x1622c9[_0x5fcf('0x29')],'resourceId':_0x1622c9['id'],'type':_0x4a0e7a[_0x5fcf('0x29')],'sectionId':_0x4a0e7a['id']},{})[_0x5fcf('0x24')](function(){return _0x3a7306;});}else{return _0x3a7306;}})[_0x5fcf('0x1a')](function(_0x58c37b){logger['error'](_0x5fcf('0x4e'),_0x58c37b);throw _0x58c37b;});}return _0x3a7306;})[_0x5fcf('0x24')](respondWithResult(_0xdab191,0xc9))[_0x5fcf('0x1a')](handleError(_0xdab191,null));};exports[_0x5fcf('0x4f')]=function(_0x317828,_0x2c083d){if(_0x317828[_0x5fcf('0x49')]['id']){delete _0x317828[_0x5fcf('0x49')]['id'];}return db[_0x5fcf('0x2e')]['find']({'where':{'id':_0x317828[_0x5fcf('0x46')]['id']},'include':[{'model':db[_0x5fcf('0x2b')],'as':_0x5fcf('0x2c')}]})[_0x5fcf('0x24')](handleEntityNotFound(_0x2c083d,null))['then'](saveUpdates(_0x317828[_0x5fcf('0x49')],null))['then'](respondWithResult(_0x2c083d,null))[_0x5fcf('0x1a')](handleError(_0x2c083d,null));};exports[_0x5fcf('0x25')]=function(_0x2add3d,_0x597829){return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x2add3d[_0x5fcf('0x46')]['id']}})['then'](handleEntityNotFound(_0x597829,null))[_0x5fcf('0x24')](removeEntity(_0x597829,null))[_0x5fcf('0x1a')](handleError(_0x597829,null));};exports[_0x5fcf('0x50')]=function(_0x541d53,_0x3c2e22){return db['ChatWebsite']['describe']()[_0x5fcf('0x24')](respondWithResult(_0x3c2e22,null))[_0x5fcf('0x1a')](handleError(_0x3c2e22,null));};exports['addDisposition']=function(_0x48d97e,_0x162e43){if(_0x48d97e[_0x5fcf('0x49')]['id']){delete _0x48d97e[_0x5fcf('0x49')]['id'];}return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x48d97e[_0x5fcf('0x46')]['id']}})['then'](handleEntityNotFound(_0x162e43,null))[_0x5fcf('0x24')](function(_0x9c6d42){if(_0x9c6d42){_0x48d97e['body']['ChatWebsiteId']=_0x9c6d42['id'];return db[_0x5fcf('0x51')][_0x5fcf('0x48')](_0x48d97e[_0x5fcf('0x49')]);}})[_0x5fcf('0x24')](respondWithResult(_0x162e43,null))['catch'](handleError(_0x162e43,null));};exports[_0x5fcf('0x52')]=function(_0xd4895a,_0x1d8e59){var _0x3d3e54={'raw':![],'where':{}};var _0x5c2fdb={};var _0xc3c87a={'count':0x0,'rows':[]};return db[_0x5fcf('0x2e')][_0x5fcf('0x53')]({'where':{'id':_0xd4895a[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x1d8e59,null))[_0x5fcf('0x24')](function(_0x55953b){if(_0x55953b){_0x5c2fdb[_0x5fcf('0x36')]=_['keys'](db[_0x5fcf('0x51')]['rawAttributes']);_0x5c2fdb['query']=_[_0x5fcf('0x33')](_0xd4895a[_0x5fcf('0x32')]);_0x5c2fdb['filters']=_[_0x5fcf('0x35')](_0x5c2fdb[_0x5fcf('0x36')],_0x5c2fdb['query']);_0x3d3e54[_0x5fcf('0x38')]=_['intersection'](_0x5c2fdb[_0x5fcf('0x36')],qs[_0x5fcf('0x37')](_0xd4895a['query'][_0x5fcf('0x37')]));_0x3d3e54['attributes']=_0x3d3e54['attributes'][_0x5fcf('0x54')]?_0x3d3e54[_0x5fcf('0x38')]:_0x5c2fdb['model'];if(!_0xd4895a[_0x5fcf('0x32')][_0x5fcf('0x39')]('nolimit')){_0x3d3e54[_0x5fcf('0x1f')]=qs[_0x5fcf('0x1f')](_0xd4895a[_0x5fcf('0x32')][_0x5fcf('0x1f')]);_0x3d3e54[_0x5fcf('0x1e')]=qs[_0x5fcf('0x1e')](_0xd4895a[_0x5fcf('0x32')][_0x5fcf('0x1e')]);}_0x3d3e54[_0x5fcf('0x55')]=qs[_0x5fcf('0x3b')](_0xd4895a[_0x5fcf('0x32')][_0x5fcf('0x3b')]);_0x3d3e54[_0x5fcf('0x3e')]=qs[_0x5fcf('0x34')](_[_0x5fcf('0x3c')](_0xd4895a['query'],_0x5c2fdb[_0x5fcf('0x34')]));_0x3d3e54[_0x5fcf('0x3e')][_0x5fcf('0x56')]=_0x55953b['id'];if(_0xd4895a[_0x5fcf('0x32')][_0x5fcf('0x3d')]){_0x3d3e54[_0x5fcf('0x3e')]=_[_0x5fcf('0x40')](_0x3d3e54[_0x5fcf('0x3e')],{'$or':_['map'](_0x3d3e54['attributes'],function(_0x408e6f){var _0x5c7b44={};_0x5c7b44[_0x408e6f]={'$like':'%'+_0xd4895a[_0x5fcf('0x32')]['filter']+'%'};return _0x5c7b44;})});}_0x3d3e54=_[_0x5fcf('0x40')]({},_0x3d3e54,_0xd4895a[_0x5fcf('0x41')]);return db['Disposition'][_0x5fcf('0x21')]({'where':_0x3d3e54[_0x5fcf('0x3e')]})[_0x5fcf('0x24')](function(_0xb003f2){_0xc3c87a[_0x5fcf('0x21')]=_0xb003f2;if(_0xd4895a['query'][_0x5fcf('0x42')]){_0x3d3e54[_0x5fcf('0x43')]=[{'all':!![]}];}return db[_0x5fcf('0x51')][_0x5fcf('0x44')](_0x3d3e54);})[_0x5fcf('0x24')](function(_0x198819){_0xc3c87a['rows']=_0x198819;return _0xc3c87a;});}})[_0x5fcf('0x24')](respondWithFilteredResult(_0x1d8e59,_0x3d3e54))['catch'](handleError(_0x1d8e59,null));};exports[_0x5fcf('0x57')]=function(_0x10ae56,_0x398d0e){return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x10ae56[_0x5fcf('0x46')]['id']}})['then'](handleEntityNotFound(_0x398d0e,null))['then'](function(_0x372272){if(_0x372272){return _0x372272[_0x5fcf('0x57')](_0x10ae56[_0x5fcf('0x32')][_0x5fcf('0x58')]);}})[_0x5fcf('0x24')](respondWithStatusCode(_0x398d0e,null))[_0x5fcf('0x1a')](handleError(_0x398d0e,null));};exports[_0x5fcf('0x59')]=function(_0x579f4f,_0x114513){if(_0x579f4f[_0x5fcf('0x49')]['id']){delete _0x579f4f[_0x5fcf('0x49')]['id'];}return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x579f4f[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x114513,null))['then'](function(_0x304b28){if(_0x304b28){_0x579f4f[_0x5fcf('0x49')][_0x5fcf('0x56')]=_0x304b28['id'];return db[_0x5fcf('0x5a')][_0x5fcf('0x48')](_0x579f4f[_0x5fcf('0x49')]);}})[_0x5fcf('0x24')](respondWithResult(_0x114513,null))[_0x5fcf('0x1a')](handleError(_0x114513,null));};exports['getAnswers']=function(_0x19548c,_0xef60d9){var _0x42ea5e={'raw':![],'where':{}};var _0xe6af5a={};var _0x6e00fe={'count':0x0,'rows':[]};return db[_0x5fcf('0x2e')]['findOne']({'where':{'id':_0x19548c[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0xef60d9,null))[_0x5fcf('0x24')](function(_0x431daf){if(_0x431daf){_0xe6af5a[_0x5fcf('0x36')]=_[_0x5fcf('0x33')](db[_0x5fcf('0x5a')][_0x5fcf('0x2f')]);_0xe6af5a[_0x5fcf('0x32')]=_[_0x5fcf('0x33')](_0x19548c[_0x5fcf('0x32')]);_0xe6af5a[_0x5fcf('0x34')]=_[_0x5fcf('0x35')](_0xe6af5a['model'],_0xe6af5a['query']);_0x42ea5e[_0x5fcf('0x38')]=_[_0x5fcf('0x35')](_0xe6af5a[_0x5fcf('0x36')],qs[_0x5fcf('0x37')](_0x19548c[_0x5fcf('0x32')][_0x5fcf('0x37')]));_0x42ea5e[_0x5fcf('0x38')]=_0x42ea5e[_0x5fcf('0x38')][_0x5fcf('0x54')]?_0x42ea5e[_0x5fcf('0x38')]:_0xe6af5a[_0x5fcf('0x36')];if(!_0x19548c[_0x5fcf('0x32')][_0x5fcf('0x39')]('nolimit')){_0x42ea5e[_0x5fcf('0x1f')]=qs[_0x5fcf('0x1f')](_0x19548c[_0x5fcf('0x32')]['limit']);_0x42ea5e['offset']=qs['offset'](_0x19548c['query'][_0x5fcf('0x1e')]);}_0x42ea5e[_0x5fcf('0x55')]=qs['sort'](_0x19548c[_0x5fcf('0x32')][_0x5fcf('0x3b')]);_0x42ea5e['where']=qs[_0x5fcf('0x34')](_[_0x5fcf('0x3c')](_0x19548c[_0x5fcf('0x32')],_0xe6af5a[_0x5fcf('0x34')]));_0x42ea5e[_0x5fcf('0x3e')][_0x5fcf('0x56')]=_0x431daf['id'];if(_0x19548c['query'][_0x5fcf('0x3d')]){_0x42ea5e[_0x5fcf('0x3e')]=_[_0x5fcf('0x40')](_0x42ea5e[_0x5fcf('0x3e')],{'$or':_[_0x5fcf('0x2d')](_0x42ea5e[_0x5fcf('0x38')],function(_0x43c719){var _0x3c2451={};_0x3c2451[_0x43c719]={'$like':'%'+_0x19548c[_0x5fcf('0x32')][_0x5fcf('0x3d')]+'%'};return _0x3c2451;})});}_0x42ea5e=_[_0x5fcf('0x40')]({},_0x42ea5e,_0x19548c[_0x5fcf('0x41')]);return db[_0x5fcf('0x5a')]['count']({'where':_0x42ea5e[_0x5fcf('0x3e')]})[_0x5fcf('0x24')](function(_0x10d973){_0x6e00fe[_0x5fcf('0x21')]=_0x10d973;if(_0x19548c['query']['includeAll']){_0x42ea5e[_0x5fcf('0x43')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x42ea5e);})[_0x5fcf('0x24')](function(_0x3aca37){_0x6e00fe[_0x5fcf('0x5b')]=_0x3aca37;return _0x6e00fe;});}})['then'](respondWithFilteredResult(_0xef60d9,_0x42ea5e))[_0x5fcf('0x1a')](handleError(_0xef60d9,null));};exports[_0x5fcf('0x5c')]=function(_0x42d1ee,_0xed2078){return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x42d1ee['params']['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0xed2078,null))[_0x5fcf('0x24')](function(_0x207e1e){if(_0x207e1e){return _0x207e1e['removeAnswers'](_0x42d1ee[_0x5fcf('0x32')][_0x5fcf('0x58')]);}})[_0x5fcf('0x24')](respondWithStatusCode(_0xed2078,null))[_0x5fcf('0x1a')](handleError(_0xed2078,null));};exports[_0x5fcf('0x5d')]=function(_0x33df2c,_0x54226c){_0x33df2c[_0x5fcf('0x49')][_0x5fcf('0x5e')]=_0x33df2c[_0x5fcf('0x5f')][_0x5fcf('0x60')];return db['ChatWebsite'][_0x5fcf('0x47')]({'where':{'id':_0x33df2c[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x54226c,null))[_0x5fcf('0x24')](saveUpdates(_0x33df2c[_0x5fcf('0x49')],null))[_0x5fcf('0x24')](respondWithResult(_0x54226c,null))['catch'](handleError(_0x54226c,null));};exports['addAvatar']=function(_0x251b2e,_0x56bacb){_0x251b2e[_0x5fcf('0x49')][_0x5fcf('0x61')]=_0x251b2e[_0x5fcf('0x5f')][_0x5fcf('0x60')];return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x251b2e[_0x5fcf('0x46')]['id']}})['then'](handleEntityNotFound(_0x56bacb,null))[_0x5fcf('0x24')](saveUpdates(_0x251b2e[_0x5fcf('0x49')],null))['then'](respondWithResult(_0x56bacb,null))[_0x5fcf('0x1a')](handleError(_0x56bacb,null));};exports[_0x5fcf('0x62')]=function(_0x253fca,_0x3950e2){_0x253fca[_0x5fcf('0x49')][_0x5fcf('0x63')]=_0x253fca[_0x5fcf('0x5f')][_0x5fcf('0x60')];return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x253fca['params']['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x3950e2,null))[_0x5fcf('0x24')](saveUpdates(_0x253fca['body'],null))[_0x5fcf('0x24')](respondWithResult(_0x3950e2,null))['catch'](handleError(_0x3950e2,null));};exports[_0x5fcf('0x64')]=function(_0x32526c,_0x269838){_0x32526c[_0x5fcf('0x49')][_0x5fcf('0x65')]=_0x32526c[_0x5fcf('0x5f')]['filename'];return db['ChatWebsite'][_0x5fcf('0x47')]({'where':{'id':_0x32526c[_0x5fcf('0x46')]['id']}})['then'](handleEntityNotFound(_0x269838,null))[_0x5fcf('0x24')](saveUpdates(_0x32526c[_0x5fcf('0x49')],null))[_0x5fcf('0x24')](respondWithResult(_0x269838,null))[_0x5fcf('0x1a')](handleError(_0x269838,null));};exports[_0x5fcf('0x66')]=function(_0x2faf81,_0x52aa25){var _0x45d21f=path[_0x5fcf('0x67')](config[_0x5fcf('0x68')],_0x5fcf('0x69'));var _0x4bbb23={'where':{'id':_0x2faf81[_0x5fcf('0x46')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x2a15cb=![];return require('../../config/license/util')[_0x5fcf('0x6a')]()[_0x5fcf('0x24')](function(_0x12c0cc){if(_0x12c0cc){_0x2a15cb=_0x12c0cc[_0x5fcf('0x6b')];}})[_0x5fcf('0x24')](function(){return db[_0x5fcf('0x2e')][_0x5fcf('0x47')](_0x4bbb23);})[_0x5fcf('0x24')](handleEntityNotFound(_0x52aa25,null))[_0x5fcf('0x24')](function(_0x21786c){if(_0x21786c){if(!_[_0x5fcf('0x6c')](_0x21786c['sitepic'])){if(fs[_0x5fcf('0x6d')](path['join'](config[_0x5fcf('0x68')],_0x5fcf('0x6e'),_0x21786c[_0x5fcf('0x5e')]))&&_0x2a15cb){_0x45d21f=path['join'](config[_0x5fcf('0x68')],_0x5fcf('0x6e'),_0x21786c[_0x5fcf('0x5e')]);}}return _0x52aa25[_0x5fcf('0x6f')](_0x45d21f);}})[_0x5fcf('0x1a')](handleError(_0x52aa25,null));};exports[_0x5fcf('0x70')]=function(_0x454f48,_0x19f638){var _0x157a52=path['join'](config[_0x5fcf('0x68')],_0x5fcf('0x71'));var _0x2d7da1={'where':{'id':_0x454f48[_0x5fcf('0x46')]['id']},'attributes':['id',_0x5fcf('0x61')],'raw':!![]};return db[_0x5fcf('0x2e')][_0x5fcf('0x47')](_0x2d7da1)[_0x5fcf('0x24')](handleEntityNotFound(_0x19f638,null))[_0x5fcf('0x24')](function(_0xcb36fb){if(_0xcb36fb){if(!_[_0x5fcf('0x6c')](_0xcb36fb[_0x5fcf('0x61')])){if(fs['existsSync'](path['join'](config[_0x5fcf('0x68')],_0x5fcf('0x72'),_0xcb36fb['agentAvatar']))){_0x157a52=path[_0x5fcf('0x67')](config[_0x5fcf('0x68')],_0x5fcf('0x72'),_0xcb36fb['agentAvatar']);}}return _0x19f638['download'](_0x157a52);}})[_0x5fcf('0x1a')](handleError(_0x19f638,null));};exports[_0x5fcf('0x73')]=function(_0x4311be,_0x1b436b){var _0x555045=path[_0x5fcf('0x67')](config[_0x5fcf('0x68')],_0x5fcf('0x74'));var _0x4a7dad={'where':{'id':_0x4311be[_0x5fcf('0x46')]['id']},'attributes':['id',_0x5fcf('0x63'),_0x5fcf('0x75')],'raw':!![]};return db['ChatWebsite'][_0x5fcf('0x47')](_0x4a7dad)[_0x5fcf('0x24')](handleEntityNotFound(_0x1b436b,null))[_0x5fcf('0x24')](function(_0x2b255a){if(_0x2b255a){if(!_['isNil'](_0x2b255a[_0x5fcf('0x63')])){if(fs[_0x5fcf('0x6d')](path[_0x5fcf('0x67')](config[_0x5fcf('0x68')],_0x5fcf('0x72'),_0x2b255a[_0x5fcf('0x63')]))&&_0x2b255a['showCustomerAvatar']){_0x555045=path['join'](config[_0x5fcf('0x68')],_0x5fcf('0x72'),_0x2b255a[_0x5fcf('0x63')]);}}return _0x1b436b[_0x5fcf('0x6f')](_0x555045);}})['catch'](handleError(_0x1b436b,null));};exports[_0x5fcf('0x76')]=function(_0x1ffddc,_0x3b6117){var _0x211a5f=path[_0x5fcf('0x67')](config[_0x5fcf('0x68')],_0x5fcf('0x77'));var _0x148fbe={'where':{'id':_0x1ffddc['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0x5fcf('0x47')](_0x148fbe)[_0x5fcf('0x24')](handleEntityNotFound(_0x3b6117,null))[_0x5fcf('0x24')](function(_0x201e5a){if(_0x201e5a){if(!_['isNil'](_0x201e5a['systemAvatar'])){if(fs['existsSync'](path['join'](config[_0x5fcf('0x68')],_0x5fcf('0x72'),_0x201e5a['systemAvatar']))){_0x211a5f=path['join'](config[_0x5fcf('0x68')],_0x5fcf('0x72'),_0x201e5a[_0x5fcf('0x65')]);}}return _0x3b6117[_0x5fcf('0x6f')](_0x211a5f);}})['catch'](handleError(_0x3b6117,null));};exports[_0x5fcf('0x78')]=function(_0x2766b8,_0x30aad0){var _0x52357c=require('user-agent-parser');var _0x3c1cc4=new _0x52357c();var _0x261c3f=_0x3c1cc4[_0x5fcf('0x79')](_0x2766b8['headers'][_0x5fcf('0x7a')])[_0x5fcf('0x7b')]();var _0x4ece82={'body':_0x2766b8[_0x5fcf('0x49')],'channel':_0x5fcf('0x7c')};var _0x43b1fa=[];var _0x1b12dc=[];var _0x2f7c56={};var _0x11bb18=![];return db[_0x5fcf('0x7d')][_0x5fcf('0x50')]()[_0x5fcf('0x24')](function(_0x4fc379){if(!_0x4fc379){throw new db['Sequelize'][(_0x5fcf('0x7e'))](_0x5fcf('0x7f'));}_0x43b1fa=_[_0x5fcf('0x80')](_['keys'](_0x4fc379),['createdAt',_0x5fcf('0x81')]);_0x1b12dc=_[_0x5fcf('0x80')](_[_0x5fcf('0x33')](_0x4fc379),[_0x5fcf('0x82'),_0x5fcf('0x81'),_0x5fcf('0x83'),_0x5fcf('0x84')]);if(_0x2766b8[_0x5fcf('0x49')]['id']){delete _0x2766b8[_0x5fcf('0x49')]['id'];}if(_['isNil'](_0x2766b8['body'][_0x5fcf('0x85')])){throw new db[(_0x5fcf('0x86'))][(_0x5fcf('0x7e'))](_0x5fcf('0x87'));}if(_[_0x5fcf('0x6c')](_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0x49')])||_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0x49')]===''){throw new db[(_0x5fcf('0x86'))]['ValidationError'](_0x5fcf('0x88'));}if(_[_0x5fcf('0x6c')](_0x2766b8[_0x5fcf('0x49')]['mapKey'])){throw new db['Sequelize'][(_0x5fcf('0x7e'))](_0x5fcf('0x89')+_0x1b12dc);}if(!_[_0x5fcf('0x8a')](_0x1b12dc,_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0x8b')])){throw new db['Sequelize'][(_0x5fcf('0x7e'))](_0x5fcf('0x8c')+_0x1b12dc);}_0x2f7c56[_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0x8b')]]=_0x2766b8['body'][_0x5fcf('0x85')];})['then'](function(){return db['ChatWebsite'][_0x5fcf('0x47')]({'where':{'id':_0x2766b8[_0x5fcf('0x46')]['id']},'include':[{'model':db[_0x5fcf('0x8d')],'as':_0x5fcf('0x8e'),'include':[{'model':db[_0x5fcf('0x7d')],'as':_0x5fcf('0x8f'),'where':_0x2f7c56,'limit':0x1,'order':[[_0x5fcf('0x81'),_0x5fcf('0x90')]]}]},{'model':db[_0x5fcf('0x91')],'as':_0x5fcf('0x92')}]});})[_0x5fcf('0x24')](handleEntityNotFound(_0x30aad0,null))[_0x5fcf('0x24')](function(_0x5b92d4){if(_0x5b92d4&&_0x5b92d4[_0x5fcf('0x8e')]){_0x4ece82[_0x5fcf('0x93')]=_0x5b92d4;_0x4ece82['applications']=_0x5b92d4[_0x5fcf('0x92')];_0x4ece82[_0x5fcf('0x94')]=_0x5b92d4['List'];_0x4ece82[_0x5fcf('0x95')]=_[_0x5fcf('0x96')](_0x4ece82['applications'],[_0x5fcf('0x97')],[_0x5fcf('0x98')]);if(_0x4ece82[_0x5fcf('0x93')][_0x5fcf('0x92')]){delete _0x4ece82[_0x5fcf('0x93')][_0x5fcf('0x92')];}if(_0x4ece82[_0x5fcf('0x93')][_0x5fcf('0x8e')]&&_0x4ece82[_0x5fcf('0x93')][_0x5fcf('0x8e')][_0x5fcf('0x8f')]['length']){return _0x4ece82[_0x5fcf('0x93')][_0x5fcf('0x8e')][_0x5fcf('0x8f')][0x0];}var _0x1c22b7=_[_0x5fcf('0xb')](_0x2766b8[_0x5fcf('0x49')],{'firstName':_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0x85')],'ListId':_0x5b92d4[_0x5fcf('0x84')]});_0x1c22b7[_0x2766b8['body'][_0x5fcf('0x8b')]]=_0x2766b8[_0x5fcf('0x49')]['from'];return db[_0x5fcf('0x7d')]['create'](_0x1c22b7,{'fields':_0x43b1fa,'raw':!![]});}})[_0x5fcf('0x24')](handleEntityNotFound(_0x30aad0,null))['then'](function(_0x29d1e9){_0x4ece82['contact']=_0x29d1e9;var _0x4d98c0=_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0x99')];if(_0x2766b8[_0x5fcf('0x9a')][_0x5fcf('0x9b')]){_0x4d98c0=_0x2766b8[_0x5fcf('0x9a')]['cf-connecting-ip'];}else if(_0x2766b8[_0x5fcf('0x9a')][_0x5fcf('0x9c')]){_0x4d98c0=_[_0x5fcf('0x9d')](_0x2766b8[_0x5fcf('0x9a')][_0x5fcf('0x9c')][_0x5fcf('0x9e')](','));}if(_0x29d1e9){var _0x1ecffc={'ContactId':_0x29d1e9['id'],'ChatWebsiteId':_0x2766b8[_0x5fcf('0x46')]['id'],'from':(_0x29d1e9['firstName']||'')+'\x20'+(_0x29d1e9[_0x5fcf('0x9f')]||''),'customerIp':_0x4d98c0,'customerPort':_0x2766b8['headers'][_0x5fcf('0xa0')]?_0x2766b8[_0x5fcf('0x9a')][_0x5fcf('0xa0')]:null,'referer':_0x2766b8[_0x5fcf('0x49')]['referer'],'browserName':_0x261c3f[_0x5fcf('0xa1')][_0x5fcf('0x29')]&&_0x261c3f[_0x5fcf('0xa1')][_0x5fcf('0xa2')]?util['format'](_0x5fcf('0xa3'),_0x261c3f[_0x5fcf('0xa1')][_0x5fcf('0x29')],_0x261c3f[_0x5fcf('0xa1')]['version']):_0x5fcf('0xa4'),'browserVersion':_0x261c3f[_0x5fcf('0xa1')]['version']||_0x5fcf('0xa4'),'osName':util['format'](_0x5fcf('0xa3'),_0x261c3f['os'][_0x5fcf('0x29')],_0x261c3f['os'][_0x5fcf('0xa2')]),'osVersion':_0x261c3f['os'][_0x5fcf('0xa2')],'deviceModel':_0x261c3f['device'][_0x5fcf('0x36')]&&_0x261c3f['device']['vendor']?util['format']('%s\x20%s\x20%s',_0x261c3f[_0x5fcf('0xa5')][_0x5fcf('0x36')],_0x261c3f['device']['vendor'],_0x261c3f[_0x5fcf('0xa5')][_0x5fcf('0x30')]):null,'deviceVendor':_0x261c3f[_0x5fcf('0xa5')]['vendor'],'deviceType':_0x261c3f[_0x5fcf('0xa5')]['type'],'formData':JSON[_0x5fcf('0x16')](_0x2766b8[_0x5fcf('0x49')])};var _0x2d7caa={'ChatWebsiteId':_0x2766b8['params']['id'],'closed':![]};if(_0x2766b8[_0x5fcf('0x49')]['threadId']){_0x2d7caa[_0x5fcf('0xa6')]=_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0xa6')];return db['ChatInteraction'][_0x5fcf('0x47')]({'where':_0x2d7caa})[_0x5fcf('0x24')](function(_0x2164b7){if(_0x2164b7){return[_0x2164b7,![]];}_0x1ecffc[_0x5fcf('0xa6')]=_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0xa6')];_0x1ecffc['externalUrl']=_0x2766b8['body'][_0x5fcf('0xa7')];return db[_0x5fcf('0xa8')][_0x5fcf('0x48')](_0x1ecffc)[_0x5fcf('0x24')](function(_0x68fa9d){return[_0x68fa9d,!![]];});});}_0x2d7caa[_0x5fcf('0xa9')]=_0x29d1e9['id'];if(_0x2766b8[_0x5fcf('0x49')]['interaction']&&_0x2766b8[_0x5fcf('0x49')]['interaction']['id']){_0x2d7caa['id']=_0x2766b8['body']['interaction']['id'];return db[_0x5fcf('0xa8')]['find']({'where':_0x2d7caa})[_0x5fcf('0x24')](function(_0x1ed2e9){if(_0x1ed2e9){return[_0x1ed2e9,![]];}return db[_0x5fcf('0xa8')][_0x5fcf('0x48')](_0x1ecffc)[_0x5fcf('0x24')](function(_0x53bec5){return[_0x53bec5,!![]];});});}return db['ChatInteraction']['create'](_0x1ecffc)[_0x5fcf('0x24')](function(_0x180d20){return[_0x180d20,!![]];});}})[_0x5fcf('0xaa')](function(_0x3181b7,_0x47ca52){if(_0x3181b7){_0x11bb18=_0x47ca52;if(!_0x47ca52){var _0x5e4290={'from':(_0x4ece82['contact'][_0x5fcf('0xab')]||'')+'\x20'+(_0x4ece82[_0x5fcf('0xac')][_0x5fcf('0x9f')]||'')};if(_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0xa6')]&&_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0xad')]&&_0x2766b8['body'][_0x5fcf('0xa6')]!=_0x2766b8[_0x5fcf('0x49')]['messageId']){_0x5e4290[_0x5fcf('0xa6')]=_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0xad')];}return _0x3181b7['update'](_0x5e4290);}else{return _0x3181b7;}}})[_0x5fcf('0x24')](function(_0x311ac9){_0x4ece82[_0x5fcf('0xae')]=_0x311ac9['get']({'plain':!![]});_0x4ece82[_0x5fcf('0xae')]['created']=_0x11bb18;if(_0x4ece82[_0x5fcf('0xae')][_0x5fcf('0xaf')]){if(_0x4ece82[_0x5fcf('0x93')][_0x5fcf('0xb0')]){_0x4ece82['applications']['push']({'id':0x0,'priority':_0x4ece82['applications'][_0x5fcf('0x54')]+0x1,'app':_0x5fcf('0xb1'),'appdata':_0x5fcf('0xb2'),'interval':_0x5fcf('0xb3')});}}return db['ChatMessage'][_0x5fcf('0x48')]({'body':_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0x49')],'ChatWebsiteId':_0x2766b8[_0x5fcf('0x46')]['id'],'ChatInteractionId':_0x311ac9['id'],'direction':'in','ContactId':_0x4ece82[_0x5fcf('0xac')]['id'],'AttachmentId':_0x2766b8[_0x5fcf('0x49')][_0x5fcf('0xb4')]});})[_0x5fcf('0x24')](function(_0x38c353){_0x4ece82['message']=_0x38c353;if(_0x4ece82['interaction'][_0x5fcf('0xb5')]){return db[_0x5fcf('0xb6')][_0x5fcf('0x47')]({'attributes':['id',_0x5fcf('0x29')],'where':{'id':_0x4ece82[_0x5fcf('0xae')][_0x5fcf('0xb5')]}})[_0x5fcf('0x24')](function(_0x5d6472){if(_0x5d6472){_0x4ece82[_0x5fcf('0x95')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5d6472[_0x5fcf('0x29')]+','+(_0x4ece82[_0x5fcf('0x93')][_0x5fcf('0xb7')]||0xa),'interval':_0x5fcf('0xb3')});_0x4ece82['forcedOwnership']=!![];}return respondWithRpcPromise(_0x5fcf('0xb8'),_0x5fcf('0xb9'),_0x4ece82);});}return respondWithRpcPromise(_0x5fcf('0xb8'),_0x5fcf('0xb9'),_0x4ece82);})[_0x5fcf('0x24')](function(_0x294808){respondWithRpcPromise(_0x5fcf('0xba'),'EventManager',{'event':_0x5fcf('0x78'),'message':_0x294808},client9002);return _0x294808;})['then'](respondWithResult(_0x30aad0,null))[_0x5fcf('0x1a')](handleError(_0x30aad0,null));};exports['offline']=function(_0x21ac75,_0x4c317a){var _0x3ebb82,_0x40a279,_0x193825;var _0x2e550f=[];var _0x73961f={};var _0x80b963=_0x21ac75[_0x5fcf('0xbb')]||[];var _0x7b2bc8=[];var _0x2b8d00;return db[_0x5fcf('0x7d')][_0x5fcf('0x50')]()[_0x5fcf('0x24')](function(_0x227033){if(!_0x227033){throw new db[(_0x5fcf('0x86'))]['ValidationError'](_0x5fcf('0x7f'));}_0x2e550f=_[_0x5fcf('0x80')](_[_0x5fcf('0x33')](_0x227033),[_0x5fcf('0x82'),'updatedAt','CompanyId',_0x5fcf('0x84')]);if(_0x21ac75['body']['id']){delete _0x21ac75['body']['id'];}if(_[_0x5fcf('0x6c')](_0x21ac75[_0x5fcf('0x49')][_0x5fcf('0x85')])){throw _0x4c317a['status'](0x1f4)[_0x5fcf('0xbc')](new db[(_0x5fcf('0x86'))][(_0x5fcf('0x7e'))](_0x5fcf('0x87')));}if(_[_0x5fcf('0x6c')](_0x21ac75['body']['body'])||_0x21ac75['body'][_0x5fcf('0x49')]===''){throw _0x4c317a[_0x5fcf('0x1c')](0x1f4)[_0x5fcf('0xbc')](new db['Sequelize'][(_0x5fcf('0x7e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x5fcf('0x6c')](_0x21ac75[_0x5fcf('0x49')][_0x5fcf('0xbd')])){throw _0x4c317a[_0x5fcf('0x1c')](0x1f4)[_0x5fcf('0xbc')](new db[(_0x5fcf('0x86'))][(_0x5fcf('0x7e'))](_0x5fcf('0xbe')+_0x2e550f));}if(!_[_0x5fcf('0x8a')](_0x2e550f,_0x21ac75[_0x5fcf('0x49')][_0x5fcf('0xbd')])){throw _0x4c317a[_0x5fcf('0x1c')](0x1f4)[_0x5fcf('0xbc')](new db[(_0x5fcf('0x86'))][(_0x5fcf('0x7e'))](_0x5fcf('0xbf')+_0x2e550f));}_0x73961f[_0x21ac75[_0x5fcf('0x49')][_0x5fcf('0xbd')]]=_0x21ac75['body'][_0x5fcf('0x85')];})['then'](function(){return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x21ac75[_0x5fcf('0x46')]['id']},'include':[{'model':db['CmList'],'as':_0x5fcf('0x8e')},{'model':db['MailAccount'],'as':_0x5fcf('0xc0')}]});})[_0x5fcf('0x24')](handleEntityNotFound(_0x4c317a,null))[_0x5fcf('0x24')](function(_0xda7f31){if(_0xda7f31&&_0xda7f31['List']){_0x40a279=_0xda7f31;var _0x5383c6=_[_0x5fcf('0xb')](_0x21ac75[_0x5fcf('0x49')],{'firstName':_0x21ac75[_0x5fcf('0x49')][_0x5fcf('0x85')],'phone':_0x21ac75['body'][_0x5fcf('0x85')],'ListId':_0xda7f31['ListId']});_0x5383c6[_0x21ac75[_0x5fcf('0x49')][_0x5fcf('0xbd')]]=_0x21ac75['body'][_0x5fcf('0x85')];return db[_0x5fcf('0x7d')]['findOrCreate']({'where':_0x73961f,'defaults':_0x5383c6});}})[_0x5fcf('0xaa')](function(_0x3aec69){if(_0x3aec69){_0x193825=_0x3aec69;var _0x3bfee5=fs[_0x5fcf('0xc1')](path[_0x5fcf('0x67')](config['root'],_0x5fcf('0xc2')),_0x5fcf('0xc3'));var _0x457c63=ejs['render'](_0x3bfee5,{'body':_[_0x5fcf('0xc4')](_0x21ac75[_0x5fcf('0x49')][_0x5fcf('0x49')]),'bodyTitle':_0x40a279['offlineMessageBody']});return db['ChatOfflineMessage'][_0x5fcf('0x48')]({'body':_0x457c63,'ContactId':_0x3aec69['id'],'ChatWebsiteId':_0x40a279['id']});}})[_0x5fcf('0x24')](function(_0x3bc1e9){_0x2b8d00=_0x3bc1e9;if(_0x80b963[_0x5fcf('0x54')]){var _0x81cc45=_0x80b963[_0x5fcf('0x2d')](function(_0x3c4d8e){return{'name':_0x3c4d8e[_0x5fcf('0xc5')],'basename':_0x3c4d8e['filename'],'type':_0x3c4d8e[_0x5fcf('0xc6')],'ChatOfflineMessageId':_0x3bc1e9['id']};});_0x7b2bc8=_0x81cc45[_0x5fcf('0x2d')](_0x5cd716=>{var _0x37e475={'filename':_0x5cd716['name'],'path':path['join'](config[_0x5fcf('0x68')],'server',_0x5fcf('0xbb'),_0x5fcf('0xc7'),'offline-chat',_0x5cd716[_0x5fcf('0xc8')])};return _0x37e475;});if(!_0x40a279['openNewInteraction']){return db[_0x5fcf('0xc9')][_0x5fcf('0xca')](function(_0x5183c1){return db[_0x5fcf('0xcb')]['bulkCreate'](_0x81cc45,{'transaction':_0x5183c1});});}}})[_0x5fcf('0x24')](function(){if(_0x2b8d00){_0x3ebb82=_0x2b8d00;return db[_0x5fcf('0xc0')][_0x5fcf('0x53')]({'where':{'active':!![]},'include':[{'model':db[_0x5fcf('0xcc')],'as':_0x5fcf('0xcd'),'raw':!![]}]});}})[_0x5fcf('0x24')](function(_0x31d956){if(_0x31d956&&_0x31d956[_0x5fcf('0xcd')]&&_0x40a279[_0x5fcf('0xce')]&&_0x40a279[_0x5fcf('0xcf')]){var _0x48a823={'tls':{'rejectUnauthorized':![]}};if(_0x31d956['Smtp'][_0x5fcf('0xd0')]){_0x48a823[_0x5fcf('0xd0')]=_0x31d956['Smtp'][_0x5fcf('0xd0')];}else{_0x48a823[_0x5fcf('0xd1')]=_0x31d956['Smtp'][_0x5fcf('0xd1')];_0x48a823['port']=_0x31d956[_0x5fcf('0xcd')][_0x5fcf('0xd2')];_0x48a823['secure']=_0x31d956[_0x5fcf('0xcd')][_0x5fcf('0xd3')];}if(_0x31d956[_0x5fcf('0xcd')][_0x5fcf('0xd4')]){_0x48a823[_0x5fcf('0xd5')]={'user':_0x31d956[_0x5fcf('0xcd')][_0x5fcf('0x4a')],'pass':_0x31d956[_0x5fcf('0xcd')][_0x5fcf('0xd6')]};}return respondWithRpcPromise(_0x5fcf('0xd7'),_0x5fcf('0xd8'),{'account':_0x48a823,'message':{'from':util['format'](_0x5fcf('0xd9'),_0x31d956[_0x5fcf('0x29')],_0x31d956[_0x5fcf('0xda')]||_0x31d956['Smtp']['user']),'to':_0x40a279[_0x5fcf('0xcf')],'subject':_0x40a279[_0x5fcf('0xdb')],'html':_0x3ebb82[_0x5fcf('0x49')],'attachments':_0x7b2bc8}},client9003)[_0x5fcf('0x24')](function(){return _0x3ebb82;})[_0x5fcf('0x1a')](function(_0x1e1fb7){console[_0x5fcf('0x17')](_0x1e1fb7);});}})[_0x5fcf('0x24')](function(){if(_0x40a279&&_0x40a279['openNewInteraction']&&_0x40a279[_0x5fcf('0xdc')]){var _0x95bac1=[];if(_0x80b963[_0x5fcf('0x54')]){_0x95bac1=_0x80b963[_0x5fcf('0x2d')](function(_0xcbd9ad){return{'name':_0xcbd9ad[_0x5fcf('0xc5')],'basename':_0xcbd9ad[_0x5fcf('0x60')],'type':_0xcbd9ad[_0x5fcf('0xc6')],'ChatOfflineMessageId':_0x2b8d00['id']};});}var _0x3a6014;if(!_[_0x5fcf('0x6c')](_0x40a279[_0x5fcf('0xdd')])){var _0x47a8b2=_[_0x5fcf('0x2d')](_0x21ac75[_0x5fcf('0x49')],function(_0x1f8f89){return _0x1f8f89;});var _0x5462b2=_[_0x5fcf('0xde')](_0x47a8b2)[0x0];var _0x5068e1=_['mapValues'](_0x5462b2,function(_0xba6abf){return _0xba6abf;});_0x3a6014=_0x5068e1[0x1][_0x40a279['subjectOffline']];}var _0x18cf34={'from':_0x193825[_0x5fcf('0xda')],'firstName':_0x193825[_0x5fcf('0xab')],'lastName':_0x193825[_0x5fcf('0x9f')],'mapKey':_0x5fcf('0xda'),'message':{'from':_0x193825['email'],'to':_0x40a279[_0x5fcf('0xc0')][_0x5fcf('0xda')],'cc':'','subject':_['isNil'](_0x3a6014)?_0x40a279['offlineMessageSubject']:_0x3a6014,'messageId':'','sentAt':new Date(),'attach':_0x95bac1[_0x5fcf('0x54')],'attachments':_0x95bac1,'originChannel':_0x5fcf('0xdf'),'ChatWebsiteId':_0x40a279['id'],'ChatOfflineMessageId':_0x3ebb82['id'],'originTo':_0x40a279[_0x5fcf('0xc0')][_0x5fcf('0xda')]},'body':_0x3ebb82['body']};var _0xc8c72f={'account':{'id':_0x40a279[_0x5fcf('0xdc')]},'body':_0x18cf34,'log':_0x5fcf('0xe0')};return respondWithRpcPromise(_0x5fcf('0xe0'),_0x5fcf('0xe1'),_0xc8c72f,client9001)[_0x5fcf('0x24')](function(){return _0x3ebb82;})[_0x5fcf('0x1a')](function(_0x387f52){console[_0x5fcf('0x17')](_0x387f52);});}return;})['then'](function(){if(_0x3ebb82){return _0x3ebb82;}})[_0x5fcf('0x24')](respondWithResult(_0x4c317a,null))[_0x5fcf('0x1a')](function(_0xccbca1){console['error']('catch',_0xccbca1);for(var _0x188b58 of _0x80b963){var _0x1eefc7=path[_0x5fcf('0x67')](config['root'],_0x5fcf('0xe2'),_0x5fcf('0xbb'),_0x5fcf('0xc7'),_0x5fcf('0xe3'),_0x188b58[_0x5fcf('0x60')]);fs_extra[_0x5fcf('0xe4')](_0x1eefc7)[_0x5fcf('0x1a')](function(_0x403c57){console['error'](_0x5fcf('0xe5'),_0x1eefc7,_0x403c57);});}});};exports[_0x5fcf('0xe6')]=function(_0x1eaadc,_0x225b90){return db[_0x5fcf('0xa8')][_0x5fcf('0x47')]({'where':{'id':_0x1eaadc[_0x5fcf('0x46')]['id']}})['then'](handleEntityNotFound(_0x225b90,null))[_0x5fcf('0x24')](function(_0x33337f){if(_0x33337f){return _0x33337f[_0x5fcf('0xe6')](_0x1eaadc[_0x5fcf('0x49')][_0x5fcf('0x58')],_[_0x5fcf('0xe7')](_0x1eaadc[_0x5fcf('0x49')],[_0x5fcf('0x58'),'id'])||{});}})['then'](respondWithResult(_0x225b90,null))['catch'](handleError(_0x225b90,null));};exports['getInteractions']=function(_0x254e06,_0x217ff7){var _0x165f4f={'raw':![],'where':{}};var _0x276334={};var _0x38345a={'count':0x0,'rows':[]};return db[_0x5fcf('0x2e')][_0x5fcf('0x53')]({'where':{'id':_0x254e06[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x217ff7,null))['then'](function(_0x163c6e){if(_0x163c6e){_0x276334['model']=_[_0x5fcf('0x33')](db['ChatInteraction'][_0x5fcf('0x2f')]);_0x276334[_0x5fcf('0x32')]=_[_0x5fcf('0x33')](_0x254e06[_0x5fcf('0x32')]);_0x276334[_0x5fcf('0x34')]=_[_0x5fcf('0x35')](_0x276334[_0x5fcf('0x36')],_0x276334[_0x5fcf('0x32')]);_0x165f4f['attributes']=_[_0x5fcf('0x35')](_0x276334[_0x5fcf('0x36')],qs['fields'](_0x254e06[_0x5fcf('0x32')][_0x5fcf('0x37')]));_0x165f4f['attributes']=_0x165f4f[_0x5fcf('0x38')]['length']?_0x165f4f[_0x5fcf('0x38')]:_0x276334[_0x5fcf('0x36')];if(!_0x254e06[_0x5fcf('0x32')][_0x5fcf('0x39')](_0x5fcf('0x3a'))){_0x165f4f[_0x5fcf('0x1f')]=qs['limit'](_0x254e06[_0x5fcf('0x32')][_0x5fcf('0x1f')]);_0x165f4f['offset']=qs['offset'](_0x254e06[_0x5fcf('0x32')][_0x5fcf('0x1e')]);}_0x165f4f[_0x5fcf('0x55')]=qs[_0x5fcf('0x3b')](_0x254e06['query']['sort']);_0x165f4f[_0x5fcf('0x3e')]=qs[_0x5fcf('0x34')](_[_0x5fcf('0x3c')](_0x254e06[_0x5fcf('0x32')],_0x276334['filters']));_0x165f4f['where'][_0x5fcf('0x56')]=_0x163c6e['id'];if(_0x254e06[_0x5fcf('0x32')][_0x5fcf('0x3d')]){_0x165f4f['where']=_['merge'](_0x165f4f['where'],{'$or':_[_0x5fcf('0x2d')](_0x165f4f[_0x5fcf('0x38')],function(_0x496d27){var _0x15f42b={};_0x15f42b[_0x496d27]={'$like':'%'+_0x254e06[_0x5fcf('0x32')][_0x5fcf('0x3d')]+'%'};return _0x15f42b;})});}_0x165f4f=_['merge']({},_0x165f4f,_0x254e06[_0x5fcf('0x41')]);return db['ChatInteraction']['count']({'where':_0x165f4f['where']})[_0x5fcf('0x24')](function(_0x3ed1f8){_0x38345a['count']=_0x3ed1f8;if(_0x254e06[_0x5fcf('0x32')]['includeAll']){_0x165f4f[_0x5fcf('0x43')]=[{'model':db[_0x5fcf('0x7d')],'as':_0x5fcf('0xe8'),'required':![]},{'model':db[_0x5fcf('0xb6')],'as':_0x5fcf('0xe9'),'attributes':[_0x5fcf('0x29'),_0x5fcf('0xea'),_0x5fcf('0xeb')],'required':![]},{'model':db[_0x5fcf('0xec')],'as':'Tags','attributes':['id',_0x5fcf('0x29'),_0x5fcf('0xed')],'where':_0x254e06[_0x5fcf('0x32')][_0x5fcf('0xee')]?{'id':_0x254e06[_0x5fcf('0x32')][_0x5fcf('0xee')]}:undefined,'required':_0x254e06['query'][_0x5fcf('0xee')]?!![]:![]}];}return db[_0x5fcf('0xa8')][_0x5fcf('0x44')](_0x165f4f);})[_0x5fcf('0x24')](function(_0x240b9d){_0x38345a[_0x5fcf('0x5b')]=_0x240b9d;return _0x38345a;});}})[_0x5fcf('0x24')](respondWithFilteredResult(_0x217ff7,_0x165f4f))[_0x5fcf('0x1a')](handleError(_0x217ff7,null));};function iftimePromise(_0x3d76e1,_0x115cf8){return respondWithRpcPromise(_0x5fcf('0xef'),_0x5fcf('0xf0'),{'command':_0x115cf8[_0x5fcf('0xf1')]?util[_0x5fcf('0xf2')]('iftime\x20%s,%s',_0x3d76e1[_0x5fcf('0xf3')],_0x115cf8[_0x5fcf('0xf1')]):util[_0x5fcf('0xf2')](_0x5fcf('0xf4'),_0x3d76e1[_0x5fcf('0xf3')])},client9002)[_0x5fcf('0x24')](function(_0x1f19ce){var _0x3bd061=_0x1f19ce&&_0x1f19ce[_0x5fcf('0xf5')](_0x5fcf('0xf6'))>=0x0?!![]:![];logger[_0x5fcf('0x12')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x115cf8['id'],_0x3d76e1['id'],_0x3d76e1['interval'],_0x3bd061?_0x5fcf('0xf7'):'OFFLINE',_0x115cf8[_0x5fcf('0xf1')]?_0x115cf8['timezone']:'No\x20timezone');return _0x3bd061;})['catch'](function(_0x24427d){logger[_0x5fcf('0x17')](_0x5fcf('0xf8'),_0x115cf8['id'],_0x3d76e1['id'],_0x3d76e1['interval'],util[_0x5fcf('0xf9')](_0x24427d,{'showHidden':![],'depth':null}),_0x115cf8[_0x5fcf('0xf1')]?_0x115cf8[_0x5fcf('0xf1')]:'No\x20timezone');return![];});}exports[_0x5fcf('0xf0')]=function(_0x578991,_0x1d87fd){var _0x5bfa85=0x0;var _0x59487d=0x0;var _0x5ca3c7=![];var _0x4a878c;var _0x3eaaa1;return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x578991['params']['id']},'include':[{'model':db[_0x5fcf('0xfa')],'as':_0x5fcf('0xfa'),'include':[{'model':db[_0x5fcf('0xfa')],'as':'Intervals','attributes':['id',_0x5fcf('0xf3')],'raw':!![]}]}]})[_0x5fcf('0x24')](handleEntityNotFound(_0x1d87fd,null))[_0x5fcf('0x24')](function(_0x487189){if(_0x487189){_0x4a878c=_0x487189;return _0x487189[_0x5fcf('0xfb')]({'raw':!![]});}})[_0x5fcf('0x24')](function(_0x144d48){if(_0x4a878c){if(_0x144d48){_0x3eaaa1=_0x144d48;}}return require(_0x5fcf('0xfc'))['getLicense']();})[_0x5fcf('0x24')](function(_0x13a58b){if(_0x13a58b){_0x59487d=_0x13a58b[_0x5fcf('0xfd')];_0x5ca3c7=_0x13a58b[_0x5fcf('0x6b')];}})['then'](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0x5fcf('0x24')](function(_0x8bdd22){_0x5bfa85=_0x8bdd22;if(_0x59487d&&_0x8bdd22>_0x59487d){return db[_0x5fcf('0xfe')][_0x5fcf('0x53')]({'where':{'id':0x1}})[_0x5fcf('0x24')](function(_0x1d23e0){if(_0x1d23e0){_0x1d23e0['increment']('chatLicenseExceeded');}});}})[_0x5fcf('0x24')](function(){if(_0x4a878c[_0x5fcf('0xfa')]&&_0x4a878c[_0x5fcf('0xfa')]['Intervals']){var _0x5b4e48=[];for(var _0x246351=0x0;_0x246351<_0x4a878c[_0x5fcf('0xfa')][_0x5fcf('0xff')][_0x5fcf('0x54')];_0x246351++){var _0x33e477=_0x4a878c[_0x5fcf('0xfa')][_0x5fcf('0xff')][_0x246351]['get']({'plain':!![]});_0x5b4e48[_0x5fcf('0x100')](iftimePromise(_0x33e477,_0x4a878c));}return BPromise[_0x5fcf('0x101')](_0x5b4e48)[_0x5fcf('0x24')](function(_0x20a0fb){return _['some'](_0x20a0fb);});}else{return!![];}})[_0x5fcf('0x24')](function(_0x51dffd){var _0x5b102a=fs['readFileSync'](path[_0x5fcf('0x67')](config[_0x5fcf('0x68')],_0x5fcf('0x102')),_0x5fcf('0xc3'));var _0x3fe408={'remote':_0x4a878c[_0x5fcf('0x103')],'query':querystring[_0x5fcf('0x16')](_[_0x5fcf('0x40')](_0x4a878c[_0x5fcf('0x26')]({'plain':!![]}),{'customerIp':_0x578991[_0x5fcf('0x9a')][_0x5fcf('0x9c')]||_0x578991[_0x5fcf('0x9a')][_0x5fcf('0x104')]||_0x578991[_0x5fcf('0x105')][_0x5fcf('0x106')]||_0x578991['ip'],'referer':_0x578991[_0x5fcf('0x9a')][_0x5fcf('0x107')],'openedInteractions':_0x5bfa85,'maxInteractions':_0x59487d,'virtual':_0x5ca3c7[_0x5fcf('0xfd')],'online':_0x51dffd,'custom':_0x5ca3c7}))['replace'](/'/g,'\x5c\x27')};_0x1d87fd[_0x5fcf('0xbc')](ejs['render'](Mustache[_0x5fcf('0x108')](_0x5b102a,_0x3fe408),{'proactiveActions':_0x3eaaa1,'alignment':_0x4a878c['alignment'],'verticalAlignment':_0x4a878c[_0x5fcf('0x109')],'div_color':_0x4a878c['color'],'text_color':_0x4a878c[_0x5fcf('0x10a')],'button_color':_0x4a878c[_0x5fcf('0x10b')],'background_color':_0x4a878c[_0x5fcf('0x10c')]}));})['catch'](handleError(_0x1d87fd,null));};exports[_0x5fcf('0x10d')]=function(_0x4b98b2,_0x200efc){var _0x1646b5=_0x4b98b2['params']['id'];var _0x3e429c=_0x4b98b2[_0x5fcf('0x49')];var _0x965101=0xc8;var _0x3570a0=null;return db[_0x5fcf('0xc9')][_0x5fcf('0xca')]({'isolationLevel':db[_0x5fcf('0xc9')][_0x5fcf('0x10e')][_0x5fcf('0x10f')][_0x5fcf('0x110')]},function(_0x117876){return db[_0x5fcf('0x2e')]['findOne']({'where':{'id':_0x1646b5},'transaction':_0x117876})['then'](function(_0x12c8e6){if(_0x12c8e6){return db[_0x5fcf('0x91')][_0x5fcf('0x25')]({'where':{'ChatWebsiteId':_0x1646b5},'transaction':_0x117876})[_0x5fcf('0x24')](function(){var _0x367b64=_[_0x5fcf('0x2d')](_0x3e429c,function(_0x5885af){_0x5885af[_0x5fcf('0x56')]=_0x1646b5;return _0x5885af;});return db[_0x5fcf('0x91')][_0x5fcf('0x111')](_0x367b64,{'transaction':_0x117876});});}else{_0x965101=0x194;_0x3570a0=[];}});})[_0x5fcf('0x24')](function(){if(_0x965101!==0x194){return db['ChatApplication'][_0x5fcf('0x112')]({'where':{'ChatWebsiteId':_0x1646b5},'order':_0x5fcf('0x97')})['then'](function(_0xfc132f){_0x3570a0=_0xfc132f;});}})[_0x5fcf('0x1a')](function(_0x1df6af){_0x965101=0x1f4;logger[_0x5fcf('0x17')](_0x1df6af[_0x5fcf('0x28')]);if(_0x1df6af[_0x5fcf('0x29')]){delete _0x1df6af[_0x5fcf('0x29')];}_0x3570a0=_0x1df6af;})['finally'](function(){if(_0x3570a0===null){_0x200efc['sendStatus'](_0x965101);}else{if(_0x965101===0x1f4){_0x200efc[_0x5fcf('0x1c')](_0x965101)[_0x5fcf('0xbc')](_0x3570a0);}else{_0x200efc[_0x5fcf('0x1c')](_0x965101)[_0x5fcf('0x113')](_0x3570a0);}}});};exports[_0x5fcf('0x114')]=function(_0x4668c0,_0xcc65f6){var _0x5c75a9={};var _0x6851f6={};var _0xc87789;var _0x28d503;return db['ChatWebsite'][_0x5fcf('0x53')]({'where':{'id':_0x4668c0[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0xcc65f6,null))[_0x5fcf('0x24')](function(_0x23f783){if(_0x23f783){_0xc87789=_0x23f783;_0x6851f6['model']=_[_0x5fcf('0x33')](db[_0x5fcf('0x91')][_0x5fcf('0x2f')]);_0x6851f6['query']=_[_0x5fcf('0x33')](_0x4668c0['query']);_0x6851f6[_0x5fcf('0x34')]=_['intersection'](_0x6851f6[_0x5fcf('0x36')],_0x6851f6[_0x5fcf('0x32')]);_0x5c75a9['attributes']=_[_0x5fcf('0x35')](_0x6851f6[_0x5fcf('0x36')],qs[_0x5fcf('0x37')](_0x4668c0[_0x5fcf('0x32')]['fields']));_0x5c75a9[_0x5fcf('0x38')]=_0x5c75a9[_0x5fcf('0x38')][_0x5fcf('0x54')]?_0x5c75a9[_0x5fcf('0x38')]:_0x6851f6[_0x5fcf('0x36')];_0x5c75a9[_0x5fcf('0x55')]=qs[_0x5fcf('0x3b')](_0x4668c0[_0x5fcf('0x32')][_0x5fcf('0x3b')]);_0x5c75a9['where']=qs[_0x5fcf('0x34')](_[_0x5fcf('0x3c')](_0x4668c0[_0x5fcf('0x32')],_0x6851f6[_0x5fcf('0x34')]));if(_0x4668c0['query'][_0x5fcf('0x3d')]){_0x5c75a9[_0x5fcf('0x3e')]=_[_0x5fcf('0x40')](_0x5c75a9['where'],{'$or':_[_0x5fcf('0x2d')](_0x5c75a9[_0x5fcf('0x38')],function(_0x10a795){var _0x4f7b73={};_0x4f7b73[_0x10a795]={'$like':'%'+_0x4668c0[_0x5fcf('0x32')][_0x5fcf('0x3d')]+'%'};return _0x4f7b73;})});}_0x5c75a9=_[_0x5fcf('0x40')]({},_0x5c75a9,_0x4668c0[_0x5fcf('0x41')]);return _0xc87789[_0x5fcf('0x114')](_0x5c75a9);}})['then'](function(_0x339a63){if(_0x339a63){_0x28d503=_0x339a63['length'];if(!_0x4668c0[_0x5fcf('0x32')]['hasOwnProperty'](_0x5fcf('0x3a'))){_0x5c75a9[_0x5fcf('0x1f')]=qs[_0x5fcf('0x1f')](_0x4668c0['query'][_0x5fcf('0x1f')]);_0x5c75a9[_0x5fcf('0x1e')]=qs[_0x5fcf('0x1e')](_0x4668c0[_0x5fcf('0x32')][_0x5fcf('0x1e')]);}return _0xc87789['getApplications'](_0x5c75a9);}})[_0x5fcf('0x24')](function(_0x42e6b9){if(_0x42e6b9){return _0x42e6b9?{'count':_0x28d503,'rows':_0x42e6b9}:null;}})[_0x5fcf('0x24')](respondWithResult(_0xcc65f6,null))[_0x5fcf('0x1a')](handleError(_0xcc65f6,null));};exports[_0x5fcf('0x115')]=function(_0x50c7c0,_0x19d9b2){return db[_0x5fcf('0x116')][_0x5fcf('0x47')]({'where':{'id':_0x50c7c0[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x19d9b2,null))['then'](function(_0x56d47e){if(_0x56d47e){return _0x56d47e['addProactiveActions'](_0x50c7c0[_0x5fcf('0x49')][_0x5fcf('0x58')],_[_0x5fcf('0xe7')](_0x50c7c0[_0x5fcf('0x49')],[_0x5fcf('0x58'),'id'])||{});}})[_0x5fcf('0x24')](respondWithResult(_0x19d9b2,null))['catch'](handleError(_0x19d9b2,null));};exports[_0x5fcf('0xfb')]=function(_0x32f43f,_0x2c08d8){var _0x1ee450={};var _0x2f80b7={};var _0x18bfbe;var _0x11595d;return db['ChatWebsite'][_0x5fcf('0x53')]({'where':{'id':_0x32f43f[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x2c08d8,null))[_0x5fcf('0x24')](function(_0x44d4fa){if(_0x44d4fa){_0x18bfbe=_0x44d4fa;_0x2f80b7[_0x5fcf('0x36')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x2f80b7[_0x5fcf('0x32')]=_[_0x5fcf('0x33')](_0x32f43f['query']);_0x2f80b7['filters']=_[_0x5fcf('0x35')](_0x2f80b7['model'],_0x2f80b7['query']);_0x1ee450['attributes']=_[_0x5fcf('0x35')](_0x2f80b7['model'],qs['fields'](_0x32f43f['query']['fields']));_0x1ee450['attributes']=_0x1ee450['attributes'][_0x5fcf('0x54')]?_0x1ee450[_0x5fcf('0x38')]:_0x2f80b7[_0x5fcf('0x36')];_0x1ee450[_0x5fcf('0x55')]=qs[_0x5fcf('0x3b')](_0x32f43f['query']['sort']);_0x1ee450[_0x5fcf('0x3e')]=qs[_0x5fcf('0x34')](_[_0x5fcf('0x3c')](_0x32f43f[_0x5fcf('0x32')],_0x2f80b7[_0x5fcf('0x34')]));if(_0x32f43f[_0x5fcf('0x32')]['filter']){_0x1ee450['where']=_[_0x5fcf('0x40')](_0x1ee450['where'],{'$or':_['map'](_0x1ee450[_0x5fcf('0x38')],function(_0x46ee58){var _0xbfbd39={};_0xbfbd39[_0x46ee58]={'$like':'%'+_0x32f43f[_0x5fcf('0x32')][_0x5fcf('0x3d')]+'%'};return _0xbfbd39;})});}_0x1ee450=_[_0x5fcf('0x40')]({},_0x1ee450,_0x32f43f[_0x5fcf('0x41')]);return _0x18bfbe[_0x5fcf('0xfb')](_0x1ee450);}})[_0x5fcf('0x24')](function(_0xe3e1ef){if(_0xe3e1ef){_0x11595d=_0xe3e1ef[_0x5fcf('0x54')];if(!_0x32f43f[_0x5fcf('0x32')]['hasOwnProperty'](_0x5fcf('0x3a'))){_0x1ee450[_0x5fcf('0x1f')]=qs[_0x5fcf('0x1f')](_0x32f43f[_0x5fcf('0x32')][_0x5fcf('0x1f')]);_0x1ee450[_0x5fcf('0x1e')]=qs['offset'](_0x32f43f[_0x5fcf('0x32')]['offset']);}return _0x18bfbe[_0x5fcf('0xfb')](_0x1ee450);}})[_0x5fcf('0x24')](function(_0x2b084d){if(_0x2b084d){return _0x2b084d?{'count':_0x11595d,'rows':_0x2b084d}:null;}})['then'](respondWithResult(_0x2c08d8,null))['catch'](handleError(_0x2c08d8,null));};exports['getFields']=function(_0x1bede0,_0x18dc0f){var _0x3cdb79=_0x1bede0['query'][_0x5fcf('0x117')]==='false'?_0x5fcf('0x118'):'onlineForm';return db['ChatWebsite'][_0x5fcf('0x47')]({'attributes':['id',_0x3cdb79],'where':{'id':_0x1bede0[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x18dc0f,null))[_0x5fcf('0x24')](function(_0x1fd757){if(_0x1fd757){var _0x2b148f=_0x1fd757[_0x3cdb79];var _0x8b0a9e=_0x2b148f&&_0x2b148f[_0x5fcf('0x119')]?_0x2b148f[_0x5fcf('0x119')]:[];_0x18dc0f[_0x5fcf('0xbc')]({'fromKey':_[_0x5fcf('0x6c')](_0x2b148f[_0x5fcf('0x11a')])?undefined:_0x2b148f[_0x5fcf('0x11a')],'count':_0x8b0a9e[_0x5fcf('0x54')],'rows':_0x8b0a9e});}})['catch'](handleError(_0x18dc0f,null));};exports['getOfflineMessages']=function(_0x3bef50,_0x553e2d){var _0x26bae1={'raw':![],'where':{}};var _0x12a9f0={};var _0x29d7c8={'count':0x0,'rows':[]};return db[_0x5fcf('0x2e')][_0x5fcf('0x53')]({'where':{'id':_0x3bef50[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x553e2d,null))[_0x5fcf('0x24')](function(_0x3c2b66){if(_0x3c2b66){_0x12a9f0[_0x5fcf('0x36')]=_['keys'](db[_0x5fcf('0x11b')]['rawAttributes']);_0x12a9f0[_0x5fcf('0x32')]=_[_0x5fcf('0x33')](_0x3bef50[_0x5fcf('0x32')]);_0x12a9f0[_0x5fcf('0x34')]=_[_0x5fcf('0x35')](_0x12a9f0['model'],_0x12a9f0[_0x5fcf('0x32')]);_0x26bae1[_0x5fcf('0x38')]=_[_0x5fcf('0x35')](_0x12a9f0[_0x5fcf('0x36')],qs[_0x5fcf('0x37')](_0x3bef50['query'][_0x5fcf('0x37')]));_0x26bae1[_0x5fcf('0x38')]=_0x26bae1[_0x5fcf('0x38')][_0x5fcf('0x54')]?_0x26bae1[_0x5fcf('0x38')]:_0x12a9f0[_0x5fcf('0x36')];if(!_0x3bef50[_0x5fcf('0x32')]['hasOwnProperty'](_0x5fcf('0x3a'))){_0x26bae1[_0x5fcf('0x1f')]=qs[_0x5fcf('0x1f')](_0x3bef50['query'][_0x5fcf('0x1f')]);_0x26bae1[_0x5fcf('0x1e')]=qs['offset'](_0x3bef50[_0x5fcf('0x32')][_0x5fcf('0x1e')]);}_0x26bae1[_0x5fcf('0x55')]=qs[_0x5fcf('0x3b')](_0x3bef50['query'][_0x5fcf('0x3b')]);_0x26bae1[_0x5fcf('0x3e')]=qs[_0x5fcf('0x34')](_[_0x5fcf('0x3c')](_0x3bef50[_0x5fcf('0x32')],_0x12a9f0[_0x5fcf('0x34')]));_0x26bae1[_0x5fcf('0x3e')][_0x5fcf('0x56')]=_0x3c2b66['id'];if(_0x3bef50[_0x5fcf('0x32')][_0x5fcf('0x3d')]){_0x26bae1['where']=_['merge'](_0x26bae1[_0x5fcf('0x3e')],{'$or':_[_0x5fcf('0x2d')](_0x26bae1[_0x5fcf('0x38')],function(_0x46a313){var _0x4e6093={};_0x4e6093[_0x46a313]={'$like':'%'+_0x3bef50[_0x5fcf('0x32')][_0x5fcf('0x3d')]+'%'};return _0x4e6093;})});}_0x26bae1=_['merge']({},_0x26bae1,_0x3bef50[_0x5fcf('0x41')]);return db[_0x5fcf('0x11b')][_0x5fcf('0x21')]({'where':_0x26bae1[_0x5fcf('0x3e')]})[_0x5fcf('0x24')](function(_0xf8a193){_0x29d7c8[_0x5fcf('0x21')]=_0xf8a193;if(_0x3bef50[_0x5fcf('0x32')][_0x5fcf('0x42')]){_0x26bae1['include']=[{'all':!![]}];}else{_0x26bae1['include']=[{'model':db[_0x5fcf('0x7d')],'as':_0x5fcf('0xe8'),'required':![]},{'model':db['Attachment'],'as':_0x5fcf('0x11c'),'required':![]}];}return db[_0x5fcf('0x11b')][_0x5fcf('0x44')](_0x26bae1);})['then'](function(_0x2662a){_0x29d7c8[_0x5fcf('0x5b')]=_0x2662a;return _0x29d7c8;});}})['then'](respondWithFilteredResult(_0x553e2d,_0x26bae1))[_0x5fcf('0x1a')](handleError(_0x553e2d,null));};exports['addAgents']=function(_0x134940,_0x201e90){return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x134940[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x201e90,null))[_0x5fcf('0x24')](function(_0x5ed376){if(_0x5ed376){return _0x5ed376[_0x5fcf('0x11d')](_0x134940[_0x5fcf('0x49')]['ids'],_[_0x5fcf('0xe7')](_0x134940[_0x5fcf('0x49')],['ids','id'])||{})[_0x5fcf('0xaa')](function(_0x2aeb60){for(var _0x1106c3=0x0;_0x1106c3<_0x134940[_0x5fcf('0x49')][_0x5fcf('0x58')]['length'];_0x1106c3+=0x1){socket[_0x5fcf('0x11e')](_0x5fcf('0x11f'),{'UserId':Number(_0x134940[_0x5fcf('0x49')][_0x5fcf('0x58')][_0x1106c3]),'ChatWebsiteId':Number(_0x134940['params']['id'])});}return _0x2aeb60;});}})[_0x5fcf('0x24')](respondWithResult(_0x201e90,null))[_0x5fcf('0x1a')](handleError(_0x201e90,null));};exports[_0x5fcf('0x120')]=function(_0x5408ee,_0x56b609){return db[_0x5fcf('0x2e')][_0x5fcf('0x47')]({'where':{'id':_0x5408ee[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x56b609,null))[_0x5fcf('0x24')](function(_0xf7700b){if(_0xf7700b){return _0xf7700b[_0x5fcf('0x120')](_0x5408ee[_0x5fcf('0x32')]['ids'])['then'](function(){if(_[_0x5fcf('0x121')](_0x5408ee[_0x5fcf('0x32')][_0x5fcf('0x58')])){for(var _0x5f2780=0x0;_0x5f2780<_0x5408ee[_0x5fcf('0x32')][_0x5fcf('0x58')][_0x5fcf('0x54')];_0x5f2780+=0x1){socket[_0x5fcf('0x11e')](_0x5fcf('0x122'),{'UserId':Number(_0x5408ee[_0x5fcf('0x32')][_0x5fcf('0x58')][_0x5f2780]),'ChatWebsiteId':Number(_0x5408ee[_0x5fcf('0x46')]['id'])});}}else{socket[_0x5fcf('0x11e')](_0x5fcf('0x122'),{'UserId':Number(_0x5408ee[_0x5fcf('0x32')][_0x5fcf('0x58')]),'ChatWebsiteId':Number(_0x5408ee['params']['id'])});}});}})[_0x5fcf('0x24')](respondWithStatusCode(_0x56b609,null))['catch'](handleError(_0x56b609,null));};exports['getAgents']=function(_0x345922,_0x280764){var _0x284bc5={};var _0x1ccce0={};var _0x408874;var _0x6af59;return db[_0x5fcf('0x2e')][_0x5fcf('0x53')]({'where':{'id':_0x345922[_0x5fcf('0x46')]['id']}})[_0x5fcf('0x24')](handleEntityNotFound(_0x280764,null))[_0x5fcf('0x24')](function(_0x4254f0){if(_0x4254f0){_0x408874=_0x4254f0;_0x1ccce0[_0x5fcf('0x36')]=_[_0x5fcf('0x33')](db[_0x5fcf('0xb6')][_0x5fcf('0x2f')]);_0x1ccce0[_0x5fcf('0x32')]=_['keys'](_0x345922[_0x5fcf('0x32')]);_0x1ccce0['filters']=_['intersection'](_0x1ccce0[_0x5fcf('0x36')],_0x1ccce0[_0x5fcf('0x32')]);_0x284bc5[_0x5fcf('0x38')]=_[_0x5fcf('0x35')](_0x1ccce0[_0x5fcf('0x36')],qs[_0x5fcf('0x37')](_0x345922[_0x5fcf('0x32')][_0x5fcf('0x37')]));_0x284bc5[_0x5fcf('0x38')]=_0x284bc5[_0x5fcf('0x38')]['length']?_0x284bc5['attributes']:_0x1ccce0[_0x5fcf('0x36')];_0x284bc5['order']=qs[_0x5fcf('0x3b')](_0x345922['query'][_0x5fcf('0x3b')]);_0x284bc5[_0x5fcf('0x3e')]=qs[_0x5fcf('0x34')](_['pick'](_0x345922[_0x5fcf('0x32')],_0x1ccce0[_0x5fcf('0x34')]));if(_0x345922[_0x5fcf('0x32')][_0x5fcf('0x3d')]){_0x284bc5[_0x5fcf('0x3e')]=_[_0x5fcf('0x40')](_0x284bc5['where'],{'$or':_['map'](_0x284bc5[_0x5fcf('0x38')],function(_0xbd75fd){var _0xe17709={};_0xe17709[_0xbd75fd]={'$like':'%'+_0x345922[_0x5fcf('0x32')][_0x5fcf('0x3d')]+'%'};return _0xe17709;})});}_0x284bc5=_['merge']({},_0x284bc5,_0x345922[_0x5fcf('0x41')]);return _0x408874[_0x5fcf('0x123')](_0x284bc5);}})[_0x5fcf('0x24')](function(_0x3f4cc5){if(_0x3f4cc5){_0x6af59=_0x3f4cc5[_0x5fcf('0x54')];if(!_0x345922[_0x5fcf('0x32')][_0x5fcf('0x39')]('nolimit')){_0x284bc5['limit']=qs[_0x5fcf('0x1f')](_0x345922['query'][_0x5fcf('0x1f')]);_0x284bc5[_0x5fcf('0x1e')]=qs[_0x5fcf('0x1e')](_0x345922[_0x5fcf('0x32')]['offset']);}return _0x408874[_0x5fcf('0x123')](_0x284bc5);}})[_0x5fcf('0x24')](function(_0x4fe559){if(_0x4fe559){return _0x4fe559?{'count':_0x6af59,'rows':_0x4fe559}:null;}})[_0x5fcf('0x24')](respondWithResult(_0x280764,null))[_0x5fcf('0x1a')](handleError(_0x280764,null));};
\ No newline at end of file
+var _0x7d3c=['removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','user-agent','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','Contacts','DESC','account','applications','list','orderBy','priority','asc','Applications','ListId','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','version','%s\x20%s','browser','unknown','format','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','contact','lastName','messageId','update','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','Start','startRouting','EventManager','offline','files','send','mapKeyOffline','includes','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','server','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','SendMail','\x22%s\x22\x20<%s>','email','mimetype','subjectOffline','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','attachments','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Contact','fullname','Tag','Tags','color','tag','findAll','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','some','server/files/chat/iframe.ejs','x-real-ip','connection','remoteAddress','referer','virtual','replace','alignment','verticalAlignment','textColor','backgroundColor','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','getApplications','addProactiveActions','online','false','offlineForm','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','omit','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','destroy','get','stack','name','index','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','Pause','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','findOne','hasOwnProperty'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x7d3c,0xcc));var _0xc7d3=function(_0x5f1c73,_0x4f9432){_0x5f1c73=_0x5f1c73-0x0;var _0x3c1fa4=_0x7d3c[_0x5f1c73];return _0x3c1fa4;};'use strict';var BPromise=require(_0xc7d3('0x0'));var Mustache=require(_0xc7d3('0x1'));var util=require(_0xc7d3('0x2'));var path=require(_0xc7d3('0x3'));var ejs=require(_0xc7d3('0x4'));var fs=require('fs');var fs_extra=require(_0xc7d3('0x5'));var _=require(_0xc7d3('0x6'));var querystring=require(_0xc7d3('0x7'));var Redis=require(_0xc7d3('0x8'));var qs=require(_0xc7d3('0x9'));var logger=require(_0xc7d3('0xa'))(_0xc7d3('0xb'));var config=require('../../config/environment');var db=require(_0xc7d3('0xc'))['db'];config[_0xc7d3('0xd')]=_[_0xc7d3('0xe')](config[_0xc7d3('0xd')],{'host':_0xc7d3('0xf'),'port':0x18eb});var socket=require(_0xc7d3('0x10'))(new Redis(config[_0xc7d3('0xd')]));require(_0xc7d3('0x11'))['register'](socket);var jayson=require(_0xc7d3('0x12'));var client=jayson[_0xc7d3('0x13')][_0xc7d3('0x14')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0xc7d3('0x13')][_0xc7d3('0x14')]({'port':0x232b});var client9001=jayson[_0xc7d3('0x13')][_0xc7d3('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x3bb6ba,_0x951740,_0x10fcca,_0x5516f0){return new BPromise(function(_0x7824dc,_0x395d8e){var _0x17f1e0=_0x5516f0||client;return _0x17f1e0[_0xc7d3('0x15')](_0x3bb6ba,_0x10fcca)[_0xc7d3('0x16')](function(_0x19a1bc){logger[_0xc7d3('0x17')](_0xc7d3('0x18'),_0x951740,'request\x20sent');logger[_0xc7d3('0x19')](_0xc7d3('0x1a'),_0x951740,_0xc7d3('0x1b'),JSON[_0xc7d3('0x1c')](_0x19a1bc));if(_0x19a1bc['error']){if(_0x19a1bc[_0xc7d3('0x1d')][_0xc7d3('0x1e')]===0x1f4){logger[_0xc7d3('0x1d')](_0xc7d3('0x18'),_0x951740,_0x19a1bc[_0xc7d3('0x1d')][_0xc7d3('0x1f')]);return _0x395d8e(_0x19a1bc[_0xc7d3('0x1d')]['message']);}logger[_0xc7d3('0x1d')](_0xc7d3('0x18'),_0x951740,_0x19a1bc[_0xc7d3('0x1d')]['message']);return _0x7824dc(_0x19a1bc[_0xc7d3('0x1d')][_0xc7d3('0x1f')]);}else{logger[_0xc7d3('0x17')](_0xc7d3('0x18'),_0x951740,_0xc7d3('0x1b'));_0x7824dc(_0x19a1bc[_0xc7d3('0x20')]['message']);}})[_0xc7d3('0x21')](function(_0x4a644a){logger[_0xc7d3('0x1d')](_0xc7d3('0x18'),_0x951740,_0x4a644a);_0x395d8e(_0x4a644a);});});}function respondWithStatusCode(_0xf3300f,_0x2e0d48){_0x2e0d48=_0x2e0d48||0xcc;return function(_0x59eb80){if(_0x59eb80){return _0xf3300f[_0xc7d3('0x22')](_0x2e0d48);}return _0xf3300f['status'](_0x2e0d48)[_0xc7d3('0x23')]();};}function respondWithResult(_0x1ccf10,_0x30e785){_0x30e785=_0x30e785||0xc8;return function(_0x12cc69){if(_0x12cc69){return _0x1ccf10[_0xc7d3('0x24')](_0x30e785)[_0xc7d3('0x25')](_0x12cc69);}};}function respondWithFilteredResult(_0x2d7fe9,_0x5888dc){return function(_0x3173ae){if(_0x3173ae){var _0x5e40b7=typeof _0x5888dc[_0xc7d3('0x26')]===_0xc7d3('0x27')&&typeof _0x5888dc[_0xc7d3('0x28')]===_0xc7d3('0x27');var _0x45899c=_0x3173ae[_0xc7d3('0x29')];var _0x29b02b=_0x5e40b7?0x0:_0x5888dc[_0xc7d3('0x26')];var _0x23cb73=_0x5e40b7?_0x3173ae[_0xc7d3('0x29')]:_0x5888dc[_0xc7d3('0x26')]+_0x5888dc[_0xc7d3('0x28')];var _0x23d57f;if(_0x23cb73>=_0x45899c){_0x23cb73=_0x45899c;_0x23d57f=0xc8;}else{_0x23d57f=0xce;}_0x2d7fe9[_0xc7d3('0x24')](_0x23d57f);return _0x2d7fe9['set'](_0xc7d3('0x2a'),_0x29b02b+'-'+_0x23cb73+'/'+_0x45899c)[_0xc7d3('0x25')](_0x3173ae);}return null;};}function saveUpdates(_0x220479){return function(_0x11b703){if(_0x11b703){return _0x11b703['update'](_0x220479)[_0xc7d3('0x16')](function(_0xbc43d8){return _0xbc43d8;});}return null;};}function removeEntity(_0x9f915e){return function(_0x203a17){if(_0x203a17){return _0x203a17[_0xc7d3('0x2b')]()[_0xc7d3('0x16')](function(){var _0x3df0f8=_0x203a17[_0xc7d3('0x2c')]({'plain':!![]});var _0x553f5f='ChatWebsites';return db['UserProfileResource']['destroy']({'where':{'type':_0x553f5f,'resourceId':_0x3df0f8['id']}})['then'](function(){return _0x203a17;});})['then'](function(){_0x9f915e[_0xc7d3('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32808e){return function(_0x1df41e){if(!_0x1df41e){_0x32808e[_0xc7d3('0x22')](0x194);}return _0x1df41e;};}function handleError(_0x20fd9c,_0x3e72d6){_0x3e72d6=_0x3e72d6||0x1f4;return function(_0x3b0f87){logger[_0xc7d3('0x1d')](_0x3b0f87[_0xc7d3('0x2d')]);if(_0x3b0f87[_0xc7d3('0x2e')]){delete _0x3b0f87['name'];}_0x20fd9c['status'](_0x3e72d6)['send'](_0x3b0f87);};}exports[_0xc7d3('0x2f')]=function(_0x221539,_0x111567){var _0x4a3808={'include':[{'model':db['Pause'],'as':_0xc7d3('0x30')}]},_0x345f59={},_0x3cb421={'count':0x0,'rows':[]};var _0x141b47=_[_0xc7d3('0x31')](db[_0xc7d3('0x32')]['rawAttributes'],function(_0x2ad7c8){return{'name':_0x2ad7c8[_0xc7d3('0x33')],'type':_0x2ad7c8[_0xc7d3('0x34')][_0xc7d3('0x35')]};});_0x345f59[_0xc7d3('0x36')]=_[_0xc7d3('0x31')](_0x141b47,'name');_0x345f59['query']=_[_0xc7d3('0x37')](_0x221539[_0xc7d3('0x38')]);_0x345f59[_0xc7d3('0x39')]=_[_0xc7d3('0x3a')](_0x345f59[_0xc7d3('0x36')],_0x345f59[_0xc7d3('0x38')]);_0x4a3808[_0xc7d3('0x3b')]=_['intersection'](_0x345f59[_0xc7d3('0x36')],qs[_0xc7d3('0x3c')](_0x221539[_0xc7d3('0x38')]['fields']));_0x4a3808['attributes']=_0x4a3808[_0xc7d3('0x3b')][_0xc7d3('0x3d')]?_0x4a3808[_0xc7d3('0x3b')]:_0x345f59[_0xc7d3('0x36')];if(!_0x221539[_0xc7d3('0x38')]['hasOwnProperty'](_0xc7d3('0x3e'))){_0x4a3808[_0xc7d3('0x28')]=qs[_0xc7d3('0x28')](_0x221539[_0xc7d3('0x38')][_0xc7d3('0x28')]);_0x4a3808[_0xc7d3('0x26')]=qs[_0xc7d3('0x26')](_0x221539[_0xc7d3('0x38')][_0xc7d3('0x26')]);}_0x4a3808[_0xc7d3('0x3f')]=qs[_0xc7d3('0x40')](_0x221539[_0xc7d3('0x38')][_0xc7d3('0x40')]);_0x4a3808[_0xc7d3('0x41')]=qs[_0xc7d3('0x39')](_[_0xc7d3('0x42')](_0x221539['query'],_0x345f59['filters']),_0x141b47);if(_0x221539[_0xc7d3('0x38')][_0xc7d3('0x43')]){_0x4a3808[_0xc7d3('0x41')]=_[_0xc7d3('0x44')](_0x4a3808[_0xc7d3('0x41')],{'$or':_[_0xc7d3('0x31')](_0x141b47,function(_0xc3319d){if(_0xc3319d['type']!==_0xc7d3('0x45')){var _0x2caab7={};_0x2caab7[_0xc3319d['name']]={'$like':'%'+_0x221539[_0xc7d3('0x38')][_0xc7d3('0x43')]+'%'};return _0x2caab7;}})});}_0x4a3808=_[_0xc7d3('0x44')]({},_0x4a3808,_0x221539[_0xc7d3('0x46')]);var _0x41fd77={'where':_0x4a3808[_0xc7d3('0x41')]};return db['ChatWebsite'][_0xc7d3('0x29')](_0x41fd77)[_0xc7d3('0x16')](function(_0x418751){_0x3cb421[_0xc7d3('0x29')]=_0x418751;if(_0x221539['query'][_0xc7d3('0x47')]){_0x4a3808['include']=[{'all':!![]}];}return db[_0xc7d3('0x32')]['findAll'](_0x4a3808);})[_0xc7d3('0x16')](function(_0x223468){_0x3cb421[_0xc7d3('0x48')]=_0x223468;return _0x3cb421;})['then'](respondWithFilteredResult(_0x111567,_0x4a3808))[_0xc7d3('0x21')](handleError(_0x111567,null));};exports[_0xc7d3('0x49')]=function(_0x6c4198,_0x26cdca){var _0x5f3dc2={'raw':![],'where':{'id':_0x6c4198[_0xc7d3('0x4a')]['id']},'include':[{'model':db[_0xc7d3('0x4b')],'as':_0xc7d3('0x30')}]},_0xfa7609={};_0xfa7609['model']=_[_0xc7d3('0x37')](db['ChatWebsite'][_0xc7d3('0x4c')]);_0xfa7609[_0xc7d3('0x38')]=_[_0xc7d3('0x37')](_0x6c4198[_0xc7d3('0x38')]);_0xfa7609[_0xc7d3('0x39')]=_['intersection'](_0xfa7609['model'],_0xfa7609[_0xc7d3('0x38')]);_0x5f3dc2['attributes']=_[_0xc7d3('0x3a')](_0xfa7609[_0xc7d3('0x36')],qs[_0xc7d3('0x3c')](_0x6c4198['query']['fields']));_0x5f3dc2['attributes']=_0x5f3dc2[_0xc7d3('0x3b')][_0xc7d3('0x3d')]?_0x5f3dc2[_0xc7d3('0x3b')]:_0xfa7609[_0xc7d3('0x36')];if(_0x6c4198[_0xc7d3('0x38')][_0xc7d3('0x47')]){_0x5f3dc2[_0xc7d3('0x4d')]=[{'all':!![]}];}_0x5f3dc2=_['merge']({},_0x5f3dc2,_0x6c4198[_0xc7d3('0x46')]);return db['ChatWebsite'][_0xc7d3('0x4e')](_0x5f3dc2)[_0xc7d3('0x16')](handleEntityNotFound(_0x26cdca,null))[_0xc7d3('0x16')](respondWithResult(_0x26cdca,null))[_0xc7d3('0x21')](handleError(_0x26cdca,null));};exports[_0xc7d3('0x4f')]=function(_0x5b24d0,_0x284aeb){return db[_0xc7d3('0x32')][_0xc7d3('0x4f')](_0x5b24d0[_0xc7d3('0x50')],{})[_0xc7d3('0x16')](function(_0x24c087){var _0x5bea05=_0x5b24d0[_0xc7d3('0x51')]['get']({'plain':!![]});if(!_0x5bea05)throw new Error(_0xc7d3('0x52'));if(_0x5bea05['role']===_0xc7d3('0x51')){var _0x1dd8ad=_0x24c087['get']({'plain':!![]});var _0x50cf41=_0xc7d3('0x53');return db[_0xc7d3('0x54')][_0xc7d3('0x4e')]({'where':{'name':_0x50cf41,'userProfileId':_0x5bea05[_0xc7d3('0x55')]},'raw':!![]})[_0xc7d3('0x16')](function(_0x38594e){if(_0x38594e&&_0x38594e['autoAssociation']===0x0){return db[_0xc7d3('0x56')][_0xc7d3('0x4f')]({'name':_0x1dd8ad['name'],'resourceId':_0x1dd8ad['id'],'type':_0x38594e[_0xc7d3('0x2e')],'sectionId':_0x38594e['id']},{})[_0xc7d3('0x16')](function(){return _0x24c087;});}else{return _0x24c087;}})[_0xc7d3('0x21')](function(_0x3ff73d){logger[_0xc7d3('0x1d')](_0xc7d3('0x57'),_0x3ff73d);throw _0x3ff73d;});}return _0x24c087;})[_0xc7d3('0x16')](respondWithResult(_0x284aeb,0xc9))[_0xc7d3('0x21')](handleError(_0x284aeb,null));};exports['update']=function(_0x25b675,_0xd2fa72){if(_0x25b675[_0xc7d3('0x50')]['id']){delete _0x25b675[_0xc7d3('0x50')]['id'];}return db[_0xc7d3('0x32')]['find']({'where':{'id':_0x25b675[_0xc7d3('0x4a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xc7d3('0x16')](handleEntityNotFound(_0xd2fa72,null))[_0xc7d3('0x16')](saveUpdates(_0x25b675[_0xc7d3('0x50')],null))[_0xc7d3('0x16')](respondWithResult(_0xd2fa72,null))[_0xc7d3('0x21')](handleError(_0xd2fa72,null));};exports['destroy']=function(_0xddc856,_0x3e44ef){return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0xddc856['params']['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x3e44ef,null))[_0xc7d3('0x16')](removeEntity(_0x3e44ef,null))[_0xc7d3('0x21')](handleError(_0x3e44ef,null));};exports['describe']=function(_0x58d195,_0x5b4e67){return db[_0xc7d3('0x32')][_0xc7d3('0x58')]()[_0xc7d3('0x16')](respondWithResult(_0x5b4e67,null))[_0xc7d3('0x21')](handleError(_0x5b4e67,null));};exports[_0xc7d3('0x59')]=function(_0x506c95,_0x239cde){if(_0x506c95[_0xc7d3('0x50')]['id']){delete _0x506c95[_0xc7d3('0x50')]['id'];}return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0x506c95[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x239cde,null))[_0xc7d3('0x16')](function(_0x337500){if(_0x337500){_0x506c95['body'][_0xc7d3('0x5a')]=_0x337500['id'];return db[_0xc7d3('0x5b')]['create'](_0x506c95[_0xc7d3('0x50')]);}})['then'](respondWithResult(_0x239cde,null))['catch'](handleError(_0x239cde,null));};exports['getDispositions']=function(_0x3d84ef,_0x5f5693){var _0x2fe299={'raw':![],'where':{}};var _0x284bdc={};var _0x342ae2={'count':0x0,'rows':[]};return db[_0xc7d3('0x32')][_0xc7d3('0x5c')]({'where':{'id':_0x3d84ef['params']['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x5f5693,null))['then'](function(_0x274e76){if(_0x274e76){_0x284bdc[_0xc7d3('0x36')]=_['keys'](db[_0xc7d3('0x5b')][_0xc7d3('0x4c')]);_0x284bdc[_0xc7d3('0x38')]=_[_0xc7d3('0x37')](_0x3d84ef[_0xc7d3('0x38')]);_0x284bdc[_0xc7d3('0x39')]=_[_0xc7d3('0x3a')](_0x284bdc['model'],_0x284bdc[_0xc7d3('0x38')]);_0x2fe299[_0xc7d3('0x3b')]=_[_0xc7d3('0x3a')](_0x284bdc[_0xc7d3('0x36')],qs[_0xc7d3('0x3c')](_0x3d84ef[_0xc7d3('0x38')]['fields']));_0x2fe299[_0xc7d3('0x3b')]=_0x2fe299[_0xc7d3('0x3b')]['length']?_0x2fe299[_0xc7d3('0x3b')]:_0x284bdc['model'];if(!_0x3d84ef[_0xc7d3('0x38')][_0xc7d3('0x5d')](_0xc7d3('0x3e'))){_0x2fe299[_0xc7d3('0x28')]=qs['limit'](_0x3d84ef[_0xc7d3('0x38')][_0xc7d3('0x28')]);_0x2fe299[_0xc7d3('0x26')]=qs[_0xc7d3('0x26')](_0x3d84ef[_0xc7d3('0x38')][_0xc7d3('0x26')]);}_0x2fe299[_0xc7d3('0x3f')]=qs[_0xc7d3('0x40')](_0x3d84ef[_0xc7d3('0x38')][_0xc7d3('0x40')]);_0x2fe299[_0xc7d3('0x41')]=qs['filters'](_[_0xc7d3('0x42')](_0x3d84ef[_0xc7d3('0x38')],_0x284bdc[_0xc7d3('0x39')]));_0x2fe299['where'][_0xc7d3('0x5a')]=_0x274e76['id'];if(_0x3d84ef[_0xc7d3('0x38')][_0xc7d3('0x43')]){_0x2fe299[_0xc7d3('0x41')]=_[_0xc7d3('0x44')](_0x2fe299[_0xc7d3('0x41')],{'$or':_[_0xc7d3('0x31')](_0x2fe299[_0xc7d3('0x3b')],function(_0x3a9d9d){var _0x10d11b={};_0x10d11b[_0x3a9d9d]={'$like':'%'+_0x3d84ef[_0xc7d3('0x38')][_0xc7d3('0x43')]+'%'};return _0x10d11b;})});}_0x2fe299=_[_0xc7d3('0x44')]({},_0x2fe299,_0x3d84ef[_0xc7d3('0x46')]);return db[_0xc7d3('0x5b')][_0xc7d3('0x29')]({'where':_0x2fe299[_0xc7d3('0x41')]})['then'](function(_0xa84bfa){_0x342ae2[_0xc7d3('0x29')]=_0xa84bfa;if(_0x3d84ef[_0xc7d3('0x38')][_0xc7d3('0x47')]){_0x2fe299[_0xc7d3('0x4d')]=[{'all':!![]}];}return db[_0xc7d3('0x5b')]['findAll'](_0x2fe299);})['then'](function(_0x27a24b){_0x342ae2[_0xc7d3('0x48')]=_0x27a24b;return _0x342ae2;});}})[_0xc7d3('0x16')](respondWithFilteredResult(_0x5f5693,_0x2fe299))[_0xc7d3('0x21')](handleError(_0x5f5693,null));};exports[_0xc7d3('0x5e')]=function(_0x27188d,_0x383149){return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0x27188d[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x383149,null))[_0xc7d3('0x16')](function(_0x2b8105){if(_0x2b8105){return _0x2b8105[_0xc7d3('0x5e')](_0x27188d[_0xc7d3('0x38')][_0xc7d3('0x5f')]);}})['then'](respondWithStatusCode(_0x383149,null))[_0xc7d3('0x21')](handleError(_0x383149,null));};exports[_0xc7d3('0x60')]=function(_0x4efab6,_0x59e469){if(_0x4efab6['body']['id']){delete _0x4efab6[_0xc7d3('0x50')]['id'];}return db[_0xc7d3('0x32')]['find']({'where':{'id':_0x4efab6[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x59e469,null))['then'](function(_0x2d5629){if(_0x2d5629){_0x4efab6[_0xc7d3('0x50')][_0xc7d3('0x5a')]=_0x2d5629['id'];return db[_0xc7d3('0x61')][_0xc7d3('0x4f')](_0x4efab6[_0xc7d3('0x50')]);}})[_0xc7d3('0x16')](respondWithResult(_0x59e469,null))[_0xc7d3('0x21')](handleError(_0x59e469,null));};exports[_0xc7d3('0x62')]=function(_0x25d307,_0x13cb52){var _0x21cf22={'raw':![],'where':{}};var _0x3ad56e={};var _0x2af176={'count':0x0,'rows':[]};return db[_0xc7d3('0x32')]['findOne']({'where':{'id':_0x25d307['params']['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x13cb52,null))['then'](function(_0x4f539f){if(_0x4f539f){_0x3ad56e['model']=_['keys'](db[_0xc7d3('0x61')]['rawAttributes']);_0x3ad56e[_0xc7d3('0x38')]=_[_0xc7d3('0x37')](_0x25d307[_0xc7d3('0x38')]);_0x3ad56e[_0xc7d3('0x39')]=_[_0xc7d3('0x3a')](_0x3ad56e[_0xc7d3('0x36')],_0x3ad56e[_0xc7d3('0x38')]);_0x21cf22[_0xc7d3('0x3b')]=_[_0xc7d3('0x3a')](_0x3ad56e['model'],qs['fields'](_0x25d307['query'][_0xc7d3('0x3c')]));_0x21cf22[_0xc7d3('0x3b')]=_0x21cf22['attributes'][_0xc7d3('0x3d')]?_0x21cf22[_0xc7d3('0x3b')]:_0x3ad56e['model'];if(!_0x25d307[_0xc7d3('0x38')]['hasOwnProperty'](_0xc7d3('0x3e'))){_0x21cf22[_0xc7d3('0x28')]=qs[_0xc7d3('0x28')](_0x25d307['query'][_0xc7d3('0x28')]);_0x21cf22[_0xc7d3('0x26')]=qs[_0xc7d3('0x26')](_0x25d307['query']['offset']);}_0x21cf22[_0xc7d3('0x3f')]=qs[_0xc7d3('0x40')](_0x25d307['query'][_0xc7d3('0x40')]);_0x21cf22[_0xc7d3('0x41')]=qs['filters'](_[_0xc7d3('0x42')](_0x25d307[_0xc7d3('0x38')],_0x3ad56e['filters']));_0x21cf22[_0xc7d3('0x41')]['ChatWebsiteId']=_0x4f539f['id'];if(_0x25d307[_0xc7d3('0x38')][_0xc7d3('0x43')]){_0x21cf22[_0xc7d3('0x41')]=_[_0xc7d3('0x44')](_0x21cf22[_0xc7d3('0x41')],{'$or':_[_0xc7d3('0x31')](_0x21cf22[_0xc7d3('0x3b')],function(_0x380b33){var _0x408a75={};_0x408a75[_0x380b33]={'$like':'%'+_0x25d307['query']['filter']+'%'};return _0x408a75;})});}_0x21cf22=_[_0xc7d3('0x44')]({},_0x21cf22,_0x25d307[_0xc7d3('0x46')]);return db[_0xc7d3('0x61')][_0xc7d3('0x29')]({'where':_0x21cf22[_0xc7d3('0x41')]})[_0xc7d3('0x16')](function(_0x51e7ba){_0x2af176['count']=_0x51e7ba;if(_0x25d307[_0xc7d3('0x38')][_0xc7d3('0x47')]){_0x21cf22[_0xc7d3('0x4d')]=[{'all':!![]}];}return db[_0xc7d3('0x61')]['findAll'](_0x21cf22);})[_0xc7d3('0x16')](function(_0x310dab){_0x2af176[_0xc7d3('0x48')]=_0x310dab;return _0x2af176;});}})[_0xc7d3('0x16')](respondWithFilteredResult(_0x13cb52,_0x21cf22))['catch'](handleError(_0x13cb52,null));};exports['removeAnswers']=function(_0x266c36,_0x427428){return db[_0xc7d3('0x32')]['find']({'where':{'id':_0x266c36[_0xc7d3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x427428,null))[_0xc7d3('0x16')](function(_0x398ab7){if(_0x398ab7){return _0x398ab7[_0xc7d3('0x63')](_0x266c36[_0xc7d3('0x38')]['ids']);}})[_0xc7d3('0x16')](respondWithStatusCode(_0x427428,null))[_0xc7d3('0x21')](handleError(_0x427428,null));};exports[_0xc7d3('0x64')]=function(_0x4176f6,_0x27c18a){_0x4176f6[_0xc7d3('0x50')]['sitepic']=_0x4176f6[_0xc7d3('0x65')][_0xc7d3('0x66')];return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0x4176f6['params']['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x27c18a,null))['then'](saveUpdates(_0x4176f6[_0xc7d3('0x50')],null))[_0xc7d3('0x16')](respondWithResult(_0x27c18a,null))[_0xc7d3('0x21')](handleError(_0x27c18a,null));};exports['addAvatar']=function(_0x2bd9f1,_0x25932d){_0x2bd9f1[_0xc7d3('0x50')][_0xc7d3('0x67')]=_0x2bd9f1[_0xc7d3('0x65')]['filename'];return db[_0xc7d3('0x32')]['find']({'where':{'id':_0x2bd9f1[_0xc7d3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x25932d,null))[_0xc7d3('0x16')](saveUpdates(_0x2bd9f1[_0xc7d3('0x50')],null))[_0xc7d3('0x16')](respondWithResult(_0x25932d,null))[_0xc7d3('0x21')](handleError(_0x25932d,null));};exports[_0xc7d3('0x68')]=function(_0x4926f0,_0x10f79c){_0x4926f0[_0xc7d3('0x50')][_0xc7d3('0x69')]=_0x4926f0[_0xc7d3('0x65')][_0xc7d3('0x66')];return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0x4926f0['params']['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x10f79c,null))[_0xc7d3('0x16')](saveUpdates(_0x4926f0[_0xc7d3('0x50')],null))['then'](respondWithResult(_0x10f79c,null))['catch'](handleError(_0x10f79c,null));};exports['addSystemAvatar']=function(_0x28ea91,_0x29ddf9){_0x28ea91[_0xc7d3('0x50')]['systemAvatar']=_0x28ea91[_0xc7d3('0x65')][_0xc7d3('0x66')];return db['ChatWebsite']['find']({'where':{'id':_0x28ea91[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x29ddf9,null))['then'](saveUpdates(_0x28ea91[_0xc7d3('0x50')],null))['then'](respondWithResult(_0x29ddf9,null))[_0xc7d3('0x21')](handleError(_0x29ddf9,null));};exports[_0xc7d3('0x6a')]=function(_0x445ee5,_0x360021){var _0x2cbcf2=path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x6d'));var _0x3ff852={'where':{'id':_0x445ee5[_0xc7d3('0x4a')]['id']},'attributes':['id',_0xc7d3('0x6e')],'raw':!![]};var _0x2f7d29=![];return require(_0xc7d3('0x6f'))[_0xc7d3('0x70')]()['then'](function(_0x189799){if(_0x189799){_0x2f7d29=_0x189799[_0xc7d3('0x71')];}})[_0xc7d3('0x16')](function(){return db[_0xc7d3('0x32')][_0xc7d3('0x4e')](_0x3ff852);})[_0xc7d3('0x16')](handleEntityNotFound(_0x360021,null))[_0xc7d3('0x16')](function(_0x223c6f){if(_0x223c6f){if(!_[_0xc7d3('0x72')](_0x223c6f[_0xc7d3('0x6e')])){if(fs['existsSync'](path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x73'),_0x223c6f[_0xc7d3('0x6e')]))&&_0x2f7d29){_0x2cbcf2=path['join'](config[_0xc7d3('0x6c')],'server/files/images/logos/',_0x223c6f[_0xc7d3('0x6e')]);}}return _0x360021[_0xc7d3('0x74')](_0x2cbcf2);}})[_0xc7d3('0x21')](handleError(_0x360021,null));};exports['getAvatar']=function(_0x533a2b,_0x28565e){var _0x5a6a55=path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x75'));var _0x324b94={'where':{'id':_0x533a2b[_0xc7d3('0x4a')]['id']},'attributes':['id',_0xc7d3('0x67')],'raw':!![]};return db[_0xc7d3('0x32')][_0xc7d3('0x4e')](_0x324b94)[_0xc7d3('0x16')](handleEntityNotFound(_0x28565e,null))[_0xc7d3('0x16')](function(_0x366f40){if(_0x366f40){if(!_[_0xc7d3('0x72')](_0x366f40[_0xc7d3('0x67')])){if(fs['existsSync'](path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x76'),_0x366f40[_0xc7d3('0x67')]))){_0x5a6a55=path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],'server/files/images/avatars/',_0x366f40['agentAvatar']);}}return _0x28565e[_0xc7d3('0x74')](_0x5a6a55);}})[_0xc7d3('0x21')](handleError(_0x28565e,null));};exports[_0xc7d3('0x77')]=function(_0x19ea7b,_0x4f1a68){var _0x2d642e=path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x78'));var _0x1be6a3={'where':{'id':_0x19ea7b['params']['id']},'attributes':['id',_0xc7d3('0x69'),_0xc7d3('0x79')],'raw':!![]};return db[_0xc7d3('0x32')][_0xc7d3('0x4e')](_0x1be6a3)[_0xc7d3('0x16')](handleEntityNotFound(_0x4f1a68,null))['then'](function(_0x4b22c2){if(_0x4b22c2){if(!_['isNil'](_0x4b22c2['customerAvatar'])){if(fs[_0xc7d3('0x7a')](path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x76'),_0x4b22c2[_0xc7d3('0x69')]))&&_0x4b22c2[_0xc7d3('0x79')]){_0x2d642e=path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x76'),_0x4b22c2[_0xc7d3('0x69')]);}}return _0x4f1a68[_0xc7d3('0x74')](_0x2d642e);}})['catch'](handleError(_0x4f1a68,null));};exports[_0xc7d3('0x7b')]=function(_0x4ccbe2,_0x42aef0){var _0x490642=path[_0xc7d3('0x6b')](config['root'],_0xc7d3('0x7c'));var _0x3276f1={'where':{'id':_0x4ccbe2[_0xc7d3('0x4a')]['id']},'attributes':['id',_0xc7d3('0x7d')],'raw':!![]};return db['ChatWebsite'][_0xc7d3('0x4e')](_0x3276f1)[_0xc7d3('0x16')](handleEntityNotFound(_0x42aef0,null))[_0xc7d3('0x16')](function(_0xb6cf5f){if(_0xb6cf5f){if(!_[_0xc7d3('0x72')](_0xb6cf5f[_0xc7d3('0x7d')])){if(fs[_0xc7d3('0x7a')](path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x76'),_0xb6cf5f['systemAvatar']))){_0x490642=path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x76'),_0xb6cf5f[_0xc7d3('0x7d')]);}}return _0x42aef0[_0xc7d3('0x74')](_0x490642);}})[_0xc7d3('0x21')](handleError(_0x42aef0,null));};exports[_0xc7d3('0x7e')]=function(_0x5d2df8,_0x1b59a3){var _0x371382=require(_0xc7d3('0x7f'));var _0x5a02f0=new _0x371382();var _0x5d4532=_0x5a02f0[_0xc7d3('0x80')](_0x5d2df8['headers'][_0xc7d3('0x81')])['getResult']();var _0x2d23f4={'body':_0x5d2df8[_0xc7d3('0x50')],'channel':_0xc7d3('0x82')};var _0x1b8839=[];var _0x1b9f8b=[];var _0x217f4b={};var _0x37cf4=![];return db['CmContact'][_0xc7d3('0x58')]()[_0xc7d3('0x16')](function(_0x569fa8){if(!_0x569fa8){throw new db[(_0xc7d3('0x83'))][(_0xc7d3('0x84'))](_0xc7d3('0x85'));}_0x1b8839=_[_0xc7d3('0x86')](_[_0xc7d3('0x37')](_0x569fa8),[_0xc7d3('0x87'),'updatedAt']);_0x1b9f8b=_[_0xc7d3('0x86')](_[_0xc7d3('0x37')](_0x569fa8),[_0xc7d3('0x87'),_0xc7d3('0x88'),_0xc7d3('0x89'),'ListId']);if(_0x5d2df8[_0xc7d3('0x50')]['id']){delete _0x5d2df8['body']['id'];}if(_[_0xc7d3('0x72')](_0x5d2df8[_0xc7d3('0x50')]['from'])){throw new db[(_0xc7d3('0x83'))]['ValidationError'](_0xc7d3('0x8a'));}if(_[_0xc7d3('0x72')](_0x5d2df8['body']['body'])||_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0x50')]===''){throw new db['Sequelize']['ValidationError'](_0xc7d3('0x8b'));}if(_[_0xc7d3('0x72')](_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0x8c')])){throw new db[(_0xc7d3('0x83'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1b9f8b);}if(!_['includes'](_0x1b9f8b,_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0x8c')])){throw new db[(_0xc7d3('0x83'))]['ValidationError'](_0xc7d3('0x8d')+_0x1b9f8b);}_0x217f4b[_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0x8c')]]=_0x5d2df8['body'][_0xc7d3('0x8e')];})[_0xc7d3('0x16')](function(){return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0x5d2df8['params']['id']},'include':[{'model':db[_0xc7d3('0x8f')],'as':_0xc7d3('0x90'),'include':[{'model':db[_0xc7d3('0x91')],'as':_0xc7d3('0x92'),'where':_0x217f4b,'limit':0x1,'order':[[_0xc7d3('0x88'),_0xc7d3('0x93')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x1b59a3,null))[_0xc7d3('0x16')](function(_0x77810e){if(_0x77810e&&_0x77810e['List']){_0x2d23f4[_0xc7d3('0x94')]=_0x77810e;_0x2d23f4[_0xc7d3('0x95')]=_0x77810e['Applications'];_0x2d23f4[_0xc7d3('0x96')]=_0x77810e[_0xc7d3('0x90')];_0x2d23f4['applications']=_[_0xc7d3('0x97')](_0x2d23f4[_0xc7d3('0x95')],[_0xc7d3('0x98')],[_0xc7d3('0x99')]);if(_0x2d23f4[_0xc7d3('0x94')][_0xc7d3('0x9a')]){delete _0x2d23f4[_0xc7d3('0x94')]['Applications'];}if(_0x2d23f4[_0xc7d3('0x94')]['List']&&_0x2d23f4[_0xc7d3('0x94')]['List'][_0xc7d3('0x92')]['length']){return _0x2d23f4[_0xc7d3('0x94')][_0xc7d3('0x90')][_0xc7d3('0x92')][0x0];}var _0x5e6107=_[_0xc7d3('0xe')](_0x5d2df8[_0xc7d3('0x50')],{'firstName':_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0x8e')],'ListId':_0x77810e[_0xc7d3('0x9b')]});_0x5e6107[_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0x8c')]]=_0x5d2df8['body']['from'];return db[_0xc7d3('0x91')]['create'](_0x5e6107,{'fields':_0x1b8839,'raw':!![]});}})[_0xc7d3('0x16')](handleEntityNotFound(_0x1b59a3,null))[_0xc7d3('0x16')](function(_0x51971f){_0x2d23f4['contact']=_0x51971f;var _0x5108df=_0x5d2df8['body'][_0xc7d3('0x9c')];if(_0x5d2df8[_0xc7d3('0x9d')][_0xc7d3('0x9e')]){_0x5108df=_0x5d2df8['headers'][_0xc7d3('0x9e')];}else if(_0x5d2df8['headers'][_0xc7d3('0x9f')]){_0x5108df=_[_0xc7d3('0xa0')](_0x5d2df8['headers'][_0xc7d3('0x9f')]['split'](','));}if(_0x51971f){var _0x594227={'ContactId':_0x51971f['id'],'ChatWebsiteId':_0x5d2df8[_0xc7d3('0x4a')]['id'],'from':(_0x51971f[_0xc7d3('0xa1')]||'')+'\x20'+(_0x51971f['lastName']||''),'customerIp':_0x5108df,'customerPort':_0x5d2df8[_0xc7d3('0x9d')][_0xc7d3('0xa2')]?_0x5d2df8['headers']['x-real-port']:null,'referer':_0x5d2df8[_0xc7d3('0x50')]['referer'],'browserName':_0x5d4532['browser'][_0xc7d3('0x2e')]&&_0x5d4532['browser'][_0xc7d3('0xa3')]?util['format'](_0xc7d3('0xa4'),_0x5d4532[_0xc7d3('0xa5')][_0xc7d3('0x2e')],_0x5d4532[_0xc7d3('0xa5')]['version']):_0xc7d3('0xa6'),'browserVersion':_0x5d4532[_0xc7d3('0xa5')]['version']||'unknown','osName':util[_0xc7d3('0xa7')](_0xc7d3('0xa4'),_0x5d4532['os'][_0xc7d3('0x2e')],_0x5d4532['os'][_0xc7d3('0xa3')]),'osVersion':_0x5d4532['os'][_0xc7d3('0xa3')],'deviceModel':_0x5d4532[_0xc7d3('0xa8')][_0xc7d3('0x36')]&&_0x5d4532[_0xc7d3('0xa8')]['vendor']?util['format'](_0xc7d3('0xa9'),_0x5d4532[_0xc7d3('0xa8')]['model'],_0x5d4532[_0xc7d3('0xa8')][_0xc7d3('0xaa')],_0x5d4532[_0xc7d3('0xa8')][_0xc7d3('0x34')]):null,'deviceVendor':_0x5d4532['device'][_0xc7d3('0xaa')],'deviceType':_0x5d4532[_0xc7d3('0xa8')][_0xc7d3('0x34')],'formData':JSON[_0xc7d3('0x1c')](_0x5d2df8['body'])};var _0x184afb={'ChatWebsiteId':_0x5d2df8['params']['id'],'closed':![]};if(_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xab')]){_0x184afb['threadId']=_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xab')];return db[_0xc7d3('0xac')][_0xc7d3('0x4e')]({'where':_0x184afb})[_0xc7d3('0x16')](function(_0x3c3dd1){if(_0x3c3dd1){return[_0x3c3dd1,![]];}_0x594227[_0xc7d3('0xab')]=_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xab')];_0x594227['externalUrl']=_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xad')];return db['ChatInteraction'][_0xc7d3('0x4f')](_0x594227)[_0xc7d3('0x16')](function(_0x2dda52){return[_0x2dda52,!![]];});});}_0x184afb[_0xc7d3('0xae')]=_0x51971f['id'];if(_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xaf')]&&_0x5d2df8[_0xc7d3('0x50')]['interaction']['id']){_0x184afb['id']=_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xaf')]['id'];return db['ChatInteraction'][_0xc7d3('0x4e')]({'where':_0x184afb})[_0xc7d3('0x16')](function(_0x43ef89){if(_0x43ef89){return[_0x43ef89,![]];}return db[_0xc7d3('0xac')][_0xc7d3('0x4f')](_0x594227)['then'](function(_0x143f5c){return[_0x143f5c,!![]];});});}return db[_0xc7d3('0xac')][_0xc7d3('0x4f')](_0x594227)['then'](function(_0x4ef1d1){return[_0x4ef1d1,!![]];});}})['spread'](function(_0x18f459,_0x5219fd){if(_0x18f459){_0x37cf4=_0x5219fd;if(!_0x5219fd){var _0x56f6d={'from':(_0x2d23f4[_0xc7d3('0xb0')][_0xc7d3('0xa1')]||'')+'\x20'+(_0x2d23f4[_0xc7d3('0xb0')][_0xc7d3('0xb1')]||'')};if(_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xab')]&&_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xb2')]&&_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xab')]!=_0x5d2df8['body'][_0xc7d3('0xb2')]){_0x56f6d['threadId']=_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xb2')];}return _0x18f459[_0xc7d3('0xb3')](_0x56f6d);}else{return _0x18f459;}}})[_0xc7d3('0x16')](function(_0x462f8e){_0x2d23f4['interaction']=_0x462f8e[_0xc7d3('0x2c')]({'plain':!![]});_0x2d23f4[_0xc7d3('0xaf')][_0xc7d3('0xb4')]=_0x37cf4;if(_0x2d23f4[_0xc7d3('0xaf')]['created']){if(_0x2d23f4[_0xc7d3('0x94')][_0xc7d3('0xb5')]){_0x2d23f4[_0xc7d3('0x95')][_0xc7d3('0xb6')]({'id':0x0,'priority':_0x2d23f4[_0xc7d3('0x95')][_0xc7d3('0x3d')]+0x1,'app':_0xc7d3('0xb7'),'appdata':_0xc7d3('0xb8'),'interval':_0xc7d3('0xb9')});}}return db[_0xc7d3('0xba')][_0xc7d3('0x4f')]({'body':_0x5d2df8['body'][_0xc7d3('0x50')],'ChatWebsiteId':_0x5d2df8[_0xc7d3('0x4a')]['id'],'ChatInteractionId':_0x462f8e['id'],'direction':'in','ContactId':_0x2d23f4['contact']['id'],'AttachmentId':_0x5d2df8[_0xc7d3('0x50')][_0xc7d3('0xbb')]});})['then'](function(_0x1cbf52){_0x2d23f4['message']=_0x1cbf52;if(_0x2d23f4['interaction'][_0xc7d3('0xbc')]){return db[_0xc7d3('0xbd')][_0xc7d3('0x4e')]({'attributes':['id','name'],'where':{'id':_0x2d23f4[_0xc7d3('0xaf')][_0xc7d3('0xbc')]}})[_0xc7d3('0x16')](function(_0x368b01){if(_0x368b01){_0x2d23f4[_0xc7d3('0x95')][_0xc7d3('0xbe')]({'id':0x0,'priority':0x0,'app':_0xc7d3('0xbf'),'appdata':_0x368b01[_0xc7d3('0x2e')]+','+(_0x2d23f4[_0xc7d3('0x94')]['waitForTheAssignedAgent']||0xa),'interval':_0xc7d3('0xb9')});_0x2d23f4['forcedOwnership']=!![];}return respondWithRpcPromise(_0xc7d3('0xc0'),'startRouting',_0x2d23f4);});}return respondWithRpcPromise(_0xc7d3('0xc0'),_0xc7d3('0xc1'),_0x2d23f4);})[_0xc7d3('0x16')](function(_0x28f84c){respondWithRpcPromise('EventManager',_0xc7d3('0xc2'),{'event':_0xc7d3('0x7e'),'message':_0x28f84c},client9002);return _0x28f84c;})[_0xc7d3('0x16')](respondWithResult(_0x1b59a3,null))[_0xc7d3('0x21')](handleError(_0x1b59a3,null));};exports[_0xc7d3('0xc3')]=function(_0x6b9b0f,_0x301bd9){var _0xbc6246,_0x4b9aff,_0x5dda8d;var _0x19c11c=[];var _0x49714f={};var _0x416352=_0x6b9b0f[_0xc7d3('0xc4')]||[];var _0x4c9f67=[];var _0x399e02;return db[_0xc7d3('0x91')][_0xc7d3('0x58')]()[_0xc7d3('0x16')](function(_0x3fd0f9){if(!_0x3fd0f9){throw new db[(_0xc7d3('0x83'))][(_0xc7d3('0x84'))](_0xc7d3('0x85'));}_0x19c11c=_[_0xc7d3('0x86')](_[_0xc7d3('0x37')](_0x3fd0f9),[_0xc7d3('0x87'),_0xc7d3('0x88'),_0xc7d3('0x89'),_0xc7d3('0x9b')]);if(_0x6b9b0f['body']['id']){delete _0x6b9b0f[_0xc7d3('0x50')]['id'];}if(_[_0xc7d3('0x72')](_0x6b9b0f[_0xc7d3('0x50')]['from'])){throw _0x301bd9[_0xc7d3('0x24')](0x1f4)[_0xc7d3('0xc5')](new db[(_0xc7d3('0x83'))]['ValidationError'](_0xc7d3('0x8a')));}if(_['isNil'](_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0x50')])||_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0x50')]===''){throw _0x301bd9[_0xc7d3('0x24')](0x1f4)['send'](new db[(_0xc7d3('0x83'))][(_0xc7d3('0x84'))](_0xc7d3('0x8b')));}if(_[_0xc7d3('0x72')](_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0xc6')])){throw _0x301bd9[_0xc7d3('0x24')](0x1f4)['send'](new db[(_0xc7d3('0x83'))][(_0xc7d3('0x84'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x19c11c));}if(!_[_0xc7d3('0xc7')](_0x19c11c,_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0xc6')])){throw _0x301bd9[_0xc7d3('0x24')](0x1f4)['send'](new db[(_0xc7d3('0x83'))][(_0xc7d3('0x84'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x19c11c));}_0x49714f[_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0xc6')]]=_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0x8e')];})[_0xc7d3('0x16')](function(){return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0x6b9b0f[_0xc7d3('0x4a')]['id']},'include':[{'model':db[_0xc7d3('0x8f')],'as':_0xc7d3('0x90')},{'model':db['MailAccount'],'as':_0xc7d3('0xc8')}]});})[_0xc7d3('0x16')](handleEntityNotFound(_0x301bd9,null))['then'](function(_0x13bedb){if(_0x13bedb&&_0x13bedb[_0xc7d3('0x90')]){_0x4b9aff=_0x13bedb;var _0x37839c=_['defaults'](_0x6b9b0f[_0xc7d3('0x50')],{'firstName':_0x6b9b0f[_0xc7d3('0x50')]['from'],'phone':_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0x8e')],'ListId':_0x13bedb['ListId']});_0x37839c[_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0xc6')]]=_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0x8e')];return db[_0xc7d3('0x91')][_0xc7d3('0xc9')]({'where':_0x49714f,'defaults':_0x37839c});}})[_0xc7d3('0xca')](function(_0x37947b){if(_0x37947b){_0x5dda8d=_0x37947b;var _0x178649=fs[_0xc7d3('0xcb')](path[_0xc7d3('0x6b')](config['root'],_0xc7d3('0xcc')),_0xc7d3('0xcd'));var _0x1056b3=ejs[_0xc7d3('0xce')](_0x178649,{'body':_[_0xc7d3('0xcf')](_0x6b9b0f[_0xc7d3('0x50')][_0xc7d3('0x50')]),'bodyTitle':_0x4b9aff[_0xc7d3('0xd0')]});return db['ChatOfflineMessage']['create']({'body':_0x1056b3,'ContactId':_0x37947b['id'],'ChatWebsiteId':_0x4b9aff['id']});}})[_0xc7d3('0x16')](function(_0x413810){_0x399e02=_0x413810;if(_0x416352[_0xc7d3('0x3d')]){var _0x53b38f=_0x416352[_0xc7d3('0x31')](function(_0x559f2e){return{'name':_0x559f2e[_0xc7d3('0xd1')],'basename':_0x559f2e[_0xc7d3('0x66')],'type':_0x559f2e['mimetype'],'ChatOfflineMessageId':_0x413810['id']};});_0x4c9f67=_0x53b38f[_0xc7d3('0x31')](_0x31140f=>{var _0x340738={'filename':_0x31140f[_0xc7d3('0x2e')],'path':path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0xd2'),_0xc7d3('0xc4'),'attachments',_0xc7d3('0xd3'),_0x31140f[_0xc7d3('0xd4')])};return _0x340738;});if(!_0x4b9aff[_0xc7d3('0xd5')]){return db['sequelize'][_0xc7d3('0xd6')](function(_0x298451){return db[_0xc7d3('0xd7')][_0xc7d3('0xd8')](_0x53b38f,{'transaction':_0x298451});});}}})[_0xc7d3('0x16')](function(){if(_0x399e02){_0xbc6246=_0x399e02;return db[_0xc7d3('0xc8')][_0xc7d3('0x5c')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xc7d3('0xd9'),'raw':!![]}]});}})[_0xc7d3('0x16')](function(_0x1bf9dc){if(_0x1bf9dc&&_0x1bf9dc[_0xc7d3('0xd9')]&&_0x4b9aff[_0xc7d3('0xda')]&&_0x4b9aff[_0xc7d3('0xdb')]){var _0x1adbf7={'tls':{'rejectUnauthorized':![]}};if(_0x1bf9dc[_0xc7d3('0xd9')][_0xc7d3('0xdc')]){_0x1adbf7[_0xc7d3('0xdc')]=_0x1bf9dc[_0xc7d3('0xd9')][_0xc7d3('0xdc')];}else{_0x1adbf7[_0xc7d3('0xdd')]=_0x1bf9dc[_0xc7d3('0xd9')][_0xc7d3('0xdd')];_0x1adbf7[_0xc7d3('0xde')]=_0x1bf9dc[_0xc7d3('0xd9')][_0xc7d3('0xde')];_0x1adbf7[_0xc7d3('0xdf')]=_0x1bf9dc[_0xc7d3('0xd9')][_0xc7d3('0xdf')];}if(_0x1bf9dc['Smtp'][_0xc7d3('0xe0')]){_0x1adbf7[_0xc7d3('0xe1')]={'user':_0x1bf9dc[_0xc7d3('0xd9')][_0xc7d3('0x51')],'pass':_0x1bf9dc['Smtp']['pass']};}return respondWithRpcPromise(_0xc7d3('0xe2'),'sendMail',{'account':_0x1adbf7,'message':{'from':util['format'](_0xc7d3('0xe3'),_0x1bf9dc['name'],_0x1bf9dc[_0xc7d3('0xe4')]||_0x1bf9dc[_0xc7d3('0xd9')]['user']),'to':_0x4b9aff[_0xc7d3('0xdb')],'subject':_0x4b9aff['offlineMessageSubject'],'html':_0xbc6246[_0xc7d3('0x50')],'attachments':_0x4c9f67}},client9003)[_0xc7d3('0x16')](function(){return _0xbc6246;})[_0xc7d3('0x21')](function(_0x48afae){console['error'](_0x48afae);});}})['then'](function(){if(_0x4b9aff&&_0x4b9aff['openNewInteraction']&&_0x4b9aff['MailAccountId']){var _0x126c79=[];if(_0x416352['length']){_0x126c79=_0x416352['map'](function(_0x43d4bd){return{'name':_0x43d4bd[_0xc7d3('0xd1')],'basename':_0x43d4bd[_0xc7d3('0x66')],'type':_0x43d4bd[_0xc7d3('0xe5')],'ChatOfflineMessageId':_0x399e02['id']};});}var _0x4abc97;if(!_[_0xc7d3('0x72')](_0x4b9aff[_0xc7d3('0xe6')])){var _0x38afc6=_[_0xc7d3('0x31')](_0x6b9b0f['body'],function(_0x28a10e){return _0x28a10e;});var _0x51e298=_['toPairsIn'](_0x38afc6)[0x0];var _0x275e78=_[_0xc7d3('0xe7')](_0x51e298,function(_0x1325d0){return _0x1325d0;});_0x4abc97=_0x275e78[0x1][_0x4b9aff['subjectOffline']];}var _0x16c1a9={'from':_0x5dda8d[_0xc7d3('0xe4')],'firstName':_0x5dda8d[_0xc7d3('0xa1')],'lastName':_0x5dda8d[_0xc7d3('0xb1')],'mapKey':_0xc7d3('0xe4'),'message':{'from':_0x5dda8d[_0xc7d3('0xe4')],'to':_0x4b9aff[_0xc7d3('0xc8')][_0xc7d3('0xe4')],'cc':'','subject':_[_0xc7d3('0x72')](_0x4abc97)?_0x4b9aff[_0xc7d3('0xe8')]:_0x4abc97,'messageId':'','sentAt':new Date(),'attach':_0x126c79[_0xc7d3('0x3d')],'attachments':_0x126c79,'originChannel':_0xc7d3('0xe9'),'ChatWebsiteId':_0x4b9aff['id'],'ChatOfflineMessageId':_0xbc6246['id'],'originTo':_0x4b9aff['MailAccount'][_0xc7d3('0xe4')]},'body':_0xbc6246[_0xc7d3('0x50')]};var _0x1f1670={'account':{'id':_0x4b9aff['MailAccountId']},'body':_0x16c1a9,'log':_0xc7d3('0xea')};return respondWithRpcPromise('NotifyMailAccount',_0xc7d3('0xeb'),_0x1f1670,client9001)['then'](function(){return _0xbc6246;})['catch'](function(_0x3acab2){console['error'](_0x3acab2);});}return;})[_0xc7d3('0x16')](function(){if(_0xbc6246){return _0xbc6246;}})['then'](respondWithResult(_0x301bd9,null))[_0xc7d3('0x21')](function(_0x2ac673){console['error']('catch',_0x2ac673);for(var _0x1b91f0 of _0x416352){var _0x1d18fb=path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0xd2'),_0xc7d3('0xc4'),_0xc7d3('0xec'),_0xc7d3('0xd3'),_0x1b91f0[_0xc7d3('0x66')]);fs_extra['remove'](_0x1d18fb)['catch'](function(_0x5781ec){console[_0xc7d3('0x1d')](_0xc7d3('0xed'),_0x1d18fb,_0x5781ec);});}});};exports[_0xc7d3('0xee')]=function(_0x15229c,_0x22c0e7){return db['ChatInteraction']['find']({'where':{'id':_0x15229c[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x22c0e7,null))['then'](function(_0x3a6720){if(_0x3a6720){return _0x3a6720[_0xc7d3('0xee')](_0x15229c[_0xc7d3('0x50')][_0xc7d3('0x5f')],_['omit'](_0x15229c[_0xc7d3('0x50')],[_0xc7d3('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x22c0e7,null))[_0xc7d3('0x21')](handleError(_0x22c0e7,null));};exports['getInteractions']=function(_0x1d86dd,_0x228a69){var _0x83456a={'raw':![],'where':{}};var _0x462c1d={};var _0x49ff2e={'count':0x0,'rows':[]};return db[_0xc7d3('0x32')][_0xc7d3('0x5c')]({'where':{'id':_0x1d86dd['params']['id']}})['then'](handleEntityNotFound(_0x228a69,null))[_0xc7d3('0x16')](function(_0x59fd36){if(_0x59fd36){_0x462c1d[_0xc7d3('0x36')]=_['keys'](db[_0xc7d3('0xac')][_0xc7d3('0x4c')]);_0x462c1d['query']=_[_0xc7d3('0x37')](_0x1d86dd[_0xc7d3('0x38')]);_0x462c1d[_0xc7d3('0x39')]=_[_0xc7d3('0x3a')](_0x462c1d[_0xc7d3('0x36')],_0x462c1d[_0xc7d3('0x38')]);_0x83456a[_0xc7d3('0x3b')]=_['intersection'](_0x462c1d[_0xc7d3('0x36')],qs[_0xc7d3('0x3c')](_0x1d86dd[_0xc7d3('0x38')][_0xc7d3('0x3c')]));_0x83456a['attributes']=_0x83456a[_0xc7d3('0x3b')][_0xc7d3('0x3d')]?_0x83456a[_0xc7d3('0x3b')]:_0x462c1d[_0xc7d3('0x36')];if(!_0x1d86dd['query']['hasOwnProperty'](_0xc7d3('0x3e'))){_0x83456a[_0xc7d3('0x28')]=qs[_0xc7d3('0x28')](_0x1d86dd[_0xc7d3('0x38')][_0xc7d3('0x28')]);_0x83456a[_0xc7d3('0x26')]=qs[_0xc7d3('0x26')](_0x1d86dd[_0xc7d3('0x38')][_0xc7d3('0x26')]);}_0x83456a[_0xc7d3('0x3f')]=qs[_0xc7d3('0x40')](_0x1d86dd['query'][_0xc7d3('0x40')]);_0x83456a[_0xc7d3('0x41')]=qs[_0xc7d3('0x39')](_['pick'](_0x1d86dd[_0xc7d3('0x38')],_0x462c1d[_0xc7d3('0x39')]));_0x83456a['where'][_0xc7d3('0x5a')]=_0x59fd36['id'];if(_0x1d86dd[_0xc7d3('0x38')][_0xc7d3('0x43')]){_0x83456a[_0xc7d3('0x41')]=_[_0xc7d3('0x44')](_0x83456a[_0xc7d3('0x41')],{'$or':_[_0xc7d3('0x31')](_0x83456a[_0xc7d3('0x3b')],function(_0x51969a){var _0x484791={};_0x484791[_0x51969a]={'$like':'%'+_0x1d86dd[_0xc7d3('0x38')][_0xc7d3('0x43')]+'%'};return _0x484791;})});}_0x83456a=_[_0xc7d3('0x44')]({},_0x83456a,_0x1d86dd[_0xc7d3('0x46')]);return db[_0xc7d3('0xac')][_0xc7d3('0x29')]({'where':_0x83456a[_0xc7d3('0x41')]})['then'](function(_0x5b8068){_0x49ff2e[_0xc7d3('0x29')]=_0x5b8068;if(_0x1d86dd[_0xc7d3('0x38')][_0xc7d3('0x47')]){_0x83456a[_0xc7d3('0x4d')]=[{'model':db[_0xc7d3('0x91')],'as':_0xc7d3('0xef'),'required':![]},{'model':db[_0xc7d3('0xbd')],'as':'Owner','attributes':[_0xc7d3('0x2e'),_0xc7d3('0xf0'),'internal'],'required':![]},{'model':db[_0xc7d3('0xf1')],'as':_0xc7d3('0xf2'),'attributes':['id',_0xc7d3('0x2e'),_0xc7d3('0xf3')],'where':_0x1d86dd['query'][_0xc7d3('0xf4')]?{'id':_0x1d86dd[_0xc7d3('0x38')][_0xc7d3('0xf4')]}:undefined,'required':_0x1d86dd['query'][_0xc7d3('0xf4')]?!![]:![]}];}return db[_0xc7d3('0xac')][_0xc7d3('0xf5')](_0x83456a);})[_0xc7d3('0x16')](function(_0xe8abc0){_0x49ff2e[_0xc7d3('0x48')]=_0xe8abc0;return _0x49ff2e;});}})[_0xc7d3('0x16')](respondWithFilteredResult(_0x228a69,_0x83456a))[_0xc7d3('0x21')](handleError(_0x228a69,null));};function iftimePromise(_0x2db96a,_0xfb8db8){return respondWithRpcPromise('Command',_0xc7d3('0xf6'),{'command':_0xfb8db8[_0xc7d3('0xf7')]?util[_0xc7d3('0xa7')]('iftime\x20%s,%s',_0x2db96a[_0xc7d3('0xf8')],_0xfb8db8['timezone']):util[_0xc7d3('0xa7')](_0xc7d3('0xf9'),_0x2db96a[_0xc7d3('0xf8')])},client9002)[_0xc7d3('0x16')](function(_0x13670a){var _0x268060=_0x13670a&&_0x13670a[_0xc7d3('0xfa')](_0xc7d3('0xfb'))>=0x0?!![]:![];logger[_0xc7d3('0x17')](_0xc7d3('0xfc'),_0xfb8db8['id'],_0x2db96a['id'],_0x2db96a[_0xc7d3('0xf8')],_0x268060?_0xc7d3('0xfd'):_0xc7d3('0xfe'),_0xfb8db8['timezone']?_0xfb8db8[_0xc7d3('0xf7')]:'No\x20timezone');return _0x268060;})['catch'](function(_0x29b515){logger[_0xc7d3('0x1d')](_0xc7d3('0xfc'),_0xfb8db8['id'],_0x2db96a['id'],_0x2db96a[_0xc7d3('0xf8')],util[_0xc7d3('0xff')](_0x29b515,{'showHidden':![],'depth':null}),_0xfb8db8[_0xc7d3('0xf7')]?_0xfb8db8[_0xc7d3('0xf7')]:_0xc7d3('0x100'));return![];});}exports[_0xc7d3('0xf6')]=function(_0x564d90,_0x65f739){var _0x2ea6a9=0x0;var _0x424ce4=0x0;var _0x22b5e3=![];var _0x48e2a0;var _0x3be01d;return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0x564d90[_0xc7d3('0x4a')]['id']},'include':[{'model':db[_0xc7d3('0x101')],'as':'Interval','include':[{'model':db[_0xc7d3('0x101')],'as':_0xc7d3('0x102'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xc7d3('0x16')](handleEntityNotFound(_0x65f739,null))[_0xc7d3('0x16')](function(_0x1dbc79){if(_0x1dbc79){_0x48e2a0=_0x1dbc79;return _0x1dbc79[_0xc7d3('0x103')]({'raw':!![]});}})[_0xc7d3('0x16')](function(_0x59b25e){if(_0x48e2a0){if(_0x59b25e){_0x3be01d=_0x59b25e;}}return require(_0xc7d3('0x6f'))[_0xc7d3('0x70')]();})[_0xc7d3('0x16')](function(_0x4d13cc){if(_0x4d13cc){_0x424ce4=_0x4d13cc['virtual'];_0x22b5e3=_0x4d13cc[_0xc7d3('0x71')];}})[_0xc7d3('0x16')](function(){return db[_0xc7d3('0xac')][_0xc7d3('0x29')]({'where':{'closed':![]}});})['then'](function(_0xa75fc6){_0x2ea6a9=_0xa75fc6;if(_0x424ce4&&_0xa75fc6>_0x424ce4){return db[_0xc7d3('0x104')][_0xc7d3('0x5c')]({'where':{'id':0x1}})[_0xc7d3('0x16')](function(_0x5a62db){if(_0x5a62db){_0x5a62db[_0xc7d3('0x105')](_0xc7d3('0x106'));}});}})[_0xc7d3('0x16')](function(){if(_0x48e2a0[_0xc7d3('0x101')]&&_0x48e2a0[_0xc7d3('0x101')]['Intervals']){var _0x2adff0=[];for(var _0x1eb873=0x0;_0x1eb873<_0x48e2a0[_0xc7d3('0x101')][_0xc7d3('0x102')][_0xc7d3('0x3d')];_0x1eb873++){var _0x860648=_0x48e2a0['Interval'][_0xc7d3('0x102')][_0x1eb873]['get']({'plain':!![]});_0x2adff0[_0xc7d3('0xb6')](iftimePromise(_0x860648,_0x48e2a0));}return BPromise['all'](_0x2adff0)[_0xc7d3('0x16')](function(_0x294582){return _[_0xc7d3('0x107')](_0x294582);});}else{return!![];}})['then'](function(_0x39acbb){var _0x154003=fs[_0xc7d3('0xcb')](path[_0xc7d3('0x6b')](config[_0xc7d3('0x6c')],_0xc7d3('0x108')),_0xc7d3('0xcd'));var _0x461156={'remote':_0x48e2a0['remote'],'query':querystring[_0xc7d3('0x1c')](_[_0xc7d3('0x44')](_0x48e2a0[_0xc7d3('0x2c')]({'plain':!![]}),{'customerIp':_0x564d90[_0xc7d3('0x9d')]['x-forwarded-for']||_0x564d90[_0xc7d3('0x9d')][_0xc7d3('0x109')]||_0x564d90[_0xc7d3('0x10a')][_0xc7d3('0x10b')]||_0x564d90['ip'],'referer':_0x564d90[_0xc7d3('0x9d')][_0xc7d3('0x10c')],'openedInteractions':_0x2ea6a9,'maxInteractions':_0x424ce4,'virtual':_0x22b5e3[_0xc7d3('0x10d')],'online':_0x39acbb,'custom':_0x22b5e3}))[_0xc7d3('0x10e')](/'/g,'\x5c\x27')};_0x65f739[_0xc7d3('0xc5')](ejs['render'](Mustache[_0xc7d3('0xce')](_0x154003,_0x461156),{'proactiveActions':_0x3be01d,'alignment':_0x48e2a0[_0xc7d3('0x10f')],'verticalAlignment':_0x48e2a0[_0xc7d3('0x110')],'div_color':_0x48e2a0['color'],'text_color':_0x48e2a0[_0xc7d3('0x111')],'button_color':_0x48e2a0['color_button'],'background_color':_0x48e2a0[_0xc7d3('0x112')]}));})['catch'](handleError(_0x65f739,null));};exports[_0xc7d3('0x113')]=function(_0x5b2a02,_0x427880){var _0x2e8a86=_0x5b2a02[_0xc7d3('0x4a')]['id'];var _0x4d4d7a=_0x5b2a02['body'];var _0x185131=0xc8;var _0x974d13=null;return db[_0xc7d3('0x114')][_0xc7d3('0xd6')]({'isolationLevel':db['sequelize'][_0xc7d3('0x115')][_0xc7d3('0x116')][_0xc7d3('0x117')]},function(_0x19e728){return db[_0xc7d3('0x32')][_0xc7d3('0x5c')]({'where':{'id':_0x2e8a86},'transaction':_0x19e728})[_0xc7d3('0x16')](function(_0x14f63e){if(_0x14f63e){return db[_0xc7d3('0x118')]['destroy']({'where':{'ChatWebsiteId':_0x2e8a86},'transaction':_0x19e728})[_0xc7d3('0x16')](function(){var _0x4b8af4=_['map'](_0x4d4d7a,function(_0x34b83a){_0x34b83a[_0xc7d3('0x5a')]=_0x2e8a86;return _0x34b83a;});return db[_0xc7d3('0x118')]['bulkCreate'](_0x4b8af4,{'transaction':_0x19e728});});}else{_0x185131=0x194;_0x974d13=[];}});})[_0xc7d3('0x16')](function(){if(_0x185131!==0x194){return db[_0xc7d3('0x118')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x2e8a86},'order':_0xc7d3('0x98')})[_0xc7d3('0x16')](function(_0x7a2e84){_0x974d13=_0x7a2e84;});}})[_0xc7d3('0x21')](function(_0x4e5e2b){_0x185131=0x1f4;logger['error'](_0x4e5e2b['stack']);if(_0x4e5e2b[_0xc7d3('0x2e')]){delete _0x4e5e2b[_0xc7d3('0x2e')];}_0x974d13=_0x4e5e2b;})['finally'](function(){if(_0x974d13===null){_0x427880['sendStatus'](_0x185131);}else{if(_0x185131===0x1f4){_0x427880[_0xc7d3('0x24')](_0x185131)[_0xc7d3('0xc5')](_0x974d13);}else{_0x427880[_0xc7d3('0x24')](_0x185131)[_0xc7d3('0x25')](_0x974d13);}}});};exports[_0xc7d3('0x119')]=function(_0x77c62d,_0x2bd357){var _0x325ebe={};var _0x5cf3ec={};var _0x38b02e;var _0x1c31ba;return db['ChatWebsite'][_0xc7d3('0x5c')]({'where':{'id':_0x77c62d['params']['id']}})['then'](handleEntityNotFound(_0x2bd357,null))[_0xc7d3('0x16')](function(_0x3f9fc2){if(_0x3f9fc2){_0x38b02e=_0x3f9fc2;_0x5cf3ec[_0xc7d3('0x36')]=_[_0xc7d3('0x37')](db['ChatApplication'][_0xc7d3('0x4c')]);_0x5cf3ec[_0xc7d3('0x38')]=_[_0xc7d3('0x37')](_0x77c62d['query']);_0x5cf3ec[_0xc7d3('0x39')]=_[_0xc7d3('0x3a')](_0x5cf3ec[_0xc7d3('0x36')],_0x5cf3ec[_0xc7d3('0x38')]);_0x325ebe['attributes']=_['intersection'](_0x5cf3ec['model'],qs[_0xc7d3('0x3c')](_0x77c62d['query'][_0xc7d3('0x3c')]));_0x325ebe[_0xc7d3('0x3b')]=_0x325ebe[_0xc7d3('0x3b')][_0xc7d3('0x3d')]?_0x325ebe['attributes']:_0x5cf3ec[_0xc7d3('0x36')];_0x325ebe[_0xc7d3('0x3f')]=qs[_0xc7d3('0x40')](_0x77c62d[_0xc7d3('0x38')]['sort']);_0x325ebe['where']=qs[_0xc7d3('0x39')](_[_0xc7d3('0x42')](_0x77c62d[_0xc7d3('0x38')],_0x5cf3ec['filters']));if(_0x77c62d[_0xc7d3('0x38')][_0xc7d3('0x43')]){_0x325ebe['where']=_[_0xc7d3('0x44')](_0x325ebe[_0xc7d3('0x41')],{'$or':_[_0xc7d3('0x31')](_0x325ebe[_0xc7d3('0x3b')],function(_0x6b7cc8){var _0x421c21={};_0x421c21[_0x6b7cc8]={'$like':'%'+_0x77c62d[_0xc7d3('0x38')][_0xc7d3('0x43')]+'%'};return _0x421c21;})});}_0x325ebe=_[_0xc7d3('0x44')]({},_0x325ebe,_0x77c62d[_0xc7d3('0x46')]);return _0x38b02e['getApplications'](_0x325ebe);}})[_0xc7d3('0x16')](function(_0x5edc8b){if(_0x5edc8b){_0x1c31ba=_0x5edc8b[_0xc7d3('0x3d')];if(!_0x77c62d[_0xc7d3('0x38')][_0xc7d3('0x5d')](_0xc7d3('0x3e'))){_0x325ebe[_0xc7d3('0x28')]=qs[_0xc7d3('0x28')](_0x77c62d['query']['limit']);_0x325ebe[_0xc7d3('0x26')]=qs[_0xc7d3('0x26')](_0x77c62d[_0xc7d3('0x38')][_0xc7d3('0x26')]);}return _0x38b02e[_0xc7d3('0x119')](_0x325ebe);}})[_0xc7d3('0x16')](function(_0x34ff8a){if(_0x34ff8a){return _0x34ff8a?{'count':_0x1c31ba,'rows':_0x34ff8a}:null;}})[_0xc7d3('0x16')](respondWithResult(_0x2bd357,null))[_0xc7d3('0x21')](handleError(_0x2bd357,null));};exports[_0xc7d3('0x11a')]=function(_0x764a1e,_0x3fd815){return db['chatProactiveAction']['find']({'where':{'id':_0x764a1e[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x3fd815,null))[_0xc7d3('0x16')](function(_0x37a4f6){if(_0x37a4f6){return _0x37a4f6['addProactiveActions'](_0x764a1e[_0xc7d3('0x50')][_0xc7d3('0x5f')],_['omit'](_0x764a1e[_0xc7d3('0x50')],[_0xc7d3('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x3fd815,null))[_0xc7d3('0x21')](handleError(_0x3fd815,null));};exports[_0xc7d3('0x103')]=function(_0x47d417,_0x54fa9a){var _0x3420ac={};var _0x2ecf23={};var _0x5bf6c2;var _0x39cf2b;return db[_0xc7d3('0x32')]['findOne']({'where':{'id':_0x47d417[_0xc7d3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x54fa9a,null))[_0xc7d3('0x16')](function(_0x1e494a){if(_0x1e494a){_0x5bf6c2=_0x1e494a;_0x2ecf23[_0xc7d3('0x36')]=_[_0xc7d3('0x37')](db['ChatProactiveAction'][_0xc7d3('0x4c')]);_0x2ecf23[_0xc7d3('0x38')]=_[_0xc7d3('0x37')](_0x47d417[_0xc7d3('0x38')]);_0x2ecf23[_0xc7d3('0x39')]=_[_0xc7d3('0x3a')](_0x2ecf23[_0xc7d3('0x36')],_0x2ecf23[_0xc7d3('0x38')]);_0x3420ac[_0xc7d3('0x3b')]=_['intersection'](_0x2ecf23['model'],qs[_0xc7d3('0x3c')](_0x47d417[_0xc7d3('0x38')][_0xc7d3('0x3c')]));_0x3420ac[_0xc7d3('0x3b')]=_0x3420ac['attributes'][_0xc7d3('0x3d')]?_0x3420ac[_0xc7d3('0x3b')]:_0x2ecf23['model'];_0x3420ac[_0xc7d3('0x3f')]=qs[_0xc7d3('0x40')](_0x47d417[_0xc7d3('0x38')]['sort']);_0x3420ac[_0xc7d3('0x41')]=qs['filters'](_['pick'](_0x47d417[_0xc7d3('0x38')],_0x2ecf23[_0xc7d3('0x39')]));if(_0x47d417[_0xc7d3('0x38')][_0xc7d3('0x43')]){_0x3420ac[_0xc7d3('0x41')]=_[_0xc7d3('0x44')](_0x3420ac[_0xc7d3('0x41')],{'$or':_[_0xc7d3('0x31')](_0x3420ac[_0xc7d3('0x3b')],function(_0x34ff1f){var _0x51ee76={};_0x51ee76[_0x34ff1f]={'$like':'%'+_0x47d417['query']['filter']+'%'};return _0x51ee76;})});}_0x3420ac=_[_0xc7d3('0x44')]({},_0x3420ac,_0x47d417['options']);return _0x5bf6c2[_0xc7d3('0x103')](_0x3420ac);}})[_0xc7d3('0x16')](function(_0x419b73){if(_0x419b73){_0x39cf2b=_0x419b73['length'];if(!_0x47d417['query'][_0xc7d3('0x5d')](_0xc7d3('0x3e'))){_0x3420ac[_0xc7d3('0x28')]=qs[_0xc7d3('0x28')](_0x47d417[_0xc7d3('0x38')][_0xc7d3('0x28')]);_0x3420ac[_0xc7d3('0x26')]=qs[_0xc7d3('0x26')](_0x47d417[_0xc7d3('0x38')][_0xc7d3('0x26')]);}return _0x5bf6c2[_0xc7d3('0x103')](_0x3420ac);}})[_0xc7d3('0x16')](function(_0x46a695){if(_0x46a695){return _0x46a695?{'count':_0x39cf2b,'rows':_0x46a695}:null;}})[_0xc7d3('0x16')](respondWithResult(_0x54fa9a,null))[_0xc7d3('0x21')](handleError(_0x54fa9a,null));};exports['getFields']=function(_0x407ec7,_0x277b32){var _0x59f994=_0x407ec7[_0xc7d3('0x38')][_0xc7d3('0x11b')]===_0xc7d3('0x11c')?_0xc7d3('0x11d'):'onlineForm';return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'attributes':['id',_0x59f994],'where':{'id':_0x407ec7[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x277b32,null))[_0xc7d3('0x16')](function(_0x43afc4){if(_0x43afc4){var _0x298090=_0x43afc4[_0x59f994];var _0x569feb=_0x298090&&_0x298090['items']?_0x298090['items']:[];_0x277b32[_0xc7d3('0xc5')]({'fromKey':_[_0xc7d3('0x72')](_0x298090[_0xc7d3('0x11e')])?undefined:_0x298090['fromKey'],'count':_0x569feb['length'],'rows':_0x569feb});}})[_0xc7d3('0x21')](handleError(_0x277b32,null));};exports[_0xc7d3('0x11f')]=function(_0x3968e6,_0x332f2c){var _0x4c808b={'raw':![],'where':{}};var _0x1d23c9={};var _0x49c8e6={'count':0x0,'rows':[]};return db[_0xc7d3('0x32')][_0xc7d3('0x5c')]({'where':{'id':_0x3968e6[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x332f2c,null))[_0xc7d3('0x16')](function(_0x5d8804){if(_0x5d8804){_0x1d23c9[_0xc7d3('0x36')]=_['keys'](db[_0xc7d3('0x120')][_0xc7d3('0x4c')]);_0x1d23c9['query']=_[_0xc7d3('0x37')](_0x3968e6[_0xc7d3('0x38')]);_0x1d23c9[_0xc7d3('0x39')]=_[_0xc7d3('0x3a')](_0x1d23c9[_0xc7d3('0x36')],_0x1d23c9['query']);_0x4c808b[_0xc7d3('0x3b')]=_[_0xc7d3('0x3a')](_0x1d23c9[_0xc7d3('0x36')],qs[_0xc7d3('0x3c')](_0x3968e6['query'][_0xc7d3('0x3c')]));_0x4c808b[_0xc7d3('0x3b')]=_0x4c808b[_0xc7d3('0x3b')]['length']?_0x4c808b['attributes']:_0x1d23c9[_0xc7d3('0x36')];if(!_0x3968e6[_0xc7d3('0x38')][_0xc7d3('0x5d')](_0xc7d3('0x3e'))){_0x4c808b[_0xc7d3('0x28')]=qs[_0xc7d3('0x28')](_0x3968e6[_0xc7d3('0x38')]['limit']);_0x4c808b[_0xc7d3('0x26')]=qs['offset'](_0x3968e6[_0xc7d3('0x38')][_0xc7d3('0x26')]);}_0x4c808b[_0xc7d3('0x3f')]=qs[_0xc7d3('0x40')](_0x3968e6[_0xc7d3('0x38')][_0xc7d3('0x40')]);_0x4c808b[_0xc7d3('0x41')]=qs[_0xc7d3('0x39')](_[_0xc7d3('0x42')](_0x3968e6[_0xc7d3('0x38')],_0x1d23c9['filters']));_0x4c808b['where'][_0xc7d3('0x5a')]=_0x5d8804['id'];if(_0x3968e6['query']['filter']){_0x4c808b['where']=_[_0xc7d3('0x44')](_0x4c808b[_0xc7d3('0x41')],{'$or':_['map'](_0x4c808b[_0xc7d3('0x3b')],function(_0x3d7952){var _0x3efcb7={};_0x3efcb7[_0x3d7952]={'$like':'%'+_0x3968e6[_0xc7d3('0x38')][_0xc7d3('0x43')]+'%'};return _0x3efcb7;})});}_0x4c808b=_['merge']({},_0x4c808b,_0x3968e6[_0xc7d3('0x46')]);return db[_0xc7d3('0x120')][_0xc7d3('0x29')]({'where':_0x4c808b[_0xc7d3('0x41')]})[_0xc7d3('0x16')](function(_0x49a93a){_0x49c8e6[_0xc7d3('0x29')]=_0x49a93a;if(_0x3968e6[_0xc7d3('0x38')][_0xc7d3('0x47')]){_0x4c808b[_0xc7d3('0x4d')]=[{'all':!![]}];}else{_0x4c808b['include']=[{'model':db[_0xc7d3('0x91')],'as':_0xc7d3('0xef'),'required':![]},{'model':db[_0xc7d3('0xd7')],'as':_0xc7d3('0x121'),'required':![]}];}return db[_0xc7d3('0x120')][_0xc7d3('0xf5')](_0x4c808b);})[_0xc7d3('0x16')](function(_0x287ff3){_0x49c8e6[_0xc7d3('0x48')]=_0x287ff3;return _0x49c8e6;});}})[_0xc7d3('0x16')](respondWithFilteredResult(_0x332f2c,_0x4c808b))[_0xc7d3('0x21')](handleError(_0x332f2c,null));};exports[_0xc7d3('0x122')]=function(_0x3c3ad8,_0x3ff930){return db[_0xc7d3('0x32')][_0xc7d3('0x4e')]({'where':{'id':_0x3c3ad8['params']['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x3ff930,null))[_0xc7d3('0x16')](function(_0x23c781){if(_0x23c781){return _0x23c781[_0xc7d3('0x122')](_0x3c3ad8[_0xc7d3('0x50')][_0xc7d3('0x5f')],_[_0xc7d3('0x123')](_0x3c3ad8['body'],['ids','id'])||{})[_0xc7d3('0xca')](function(_0x552219){for(var _0x163460=0x0;_0x163460<_0x3c3ad8[_0xc7d3('0x50')][_0xc7d3('0x5f')][_0xc7d3('0x3d')];_0x163460+=0x1){socket[_0xc7d3('0x124')](_0xc7d3('0x125'),{'UserId':Number(_0x3c3ad8[_0xc7d3('0x50')][_0xc7d3('0x5f')][_0x163460]),'ChatWebsiteId':Number(_0x3c3ad8[_0xc7d3('0x4a')]['id'])});}return _0x552219;});}})[_0xc7d3('0x16')](respondWithResult(_0x3ff930,null))[_0xc7d3('0x21')](handleError(_0x3ff930,null));};exports[_0xc7d3('0x126')]=function(_0x3c97f4,_0xe0c856){return db[_0xc7d3('0x32')]['find']({'where':{'id':_0x3c97f4[_0xc7d3('0x4a')]['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0xe0c856,null))[_0xc7d3('0x16')](function(_0x1440ab){if(_0x1440ab){return _0x1440ab['removeAgents'](_0x3c97f4[_0xc7d3('0x38')][_0xc7d3('0x5f')])[_0xc7d3('0x16')](function(){if(_[_0xc7d3('0x127')](_0x3c97f4[_0xc7d3('0x38')][_0xc7d3('0x5f')])){for(var _0xb1c21=0x0;_0xb1c21<_0x3c97f4[_0xc7d3('0x38')][_0xc7d3('0x5f')][_0xc7d3('0x3d')];_0xb1c21+=0x1){socket[_0xc7d3('0x124')](_0xc7d3('0x128'),{'UserId':Number(_0x3c97f4[_0xc7d3('0x38')]['ids'][_0xb1c21]),'ChatWebsiteId':Number(_0x3c97f4[_0xc7d3('0x4a')]['id'])});}}else{socket['emit'](_0xc7d3('0x128'),{'UserId':Number(_0x3c97f4['query'][_0xc7d3('0x5f')]),'ChatWebsiteId':Number(_0x3c97f4['params']['id'])});}});}})['then'](respondWithStatusCode(_0xe0c856,null))['catch'](handleError(_0xe0c856,null));};exports[_0xc7d3('0x129')]=function(_0x5a4bdc,_0x373825){var _0x3e4b4e={};var _0x537635={};var _0x644262;var _0x35a826;return db['ChatWebsite']['findOne']({'where':{'id':_0x5a4bdc['params']['id']}})[_0xc7d3('0x16')](handleEntityNotFound(_0x373825,null))[_0xc7d3('0x16')](function(_0x455c25){if(_0x455c25){_0x644262=_0x455c25;_0x537635[_0xc7d3('0x36')]=_['keys'](db[_0xc7d3('0xbd')]['rawAttributes']);_0x537635[_0xc7d3('0x38')]=_[_0xc7d3('0x37')](_0x5a4bdc[_0xc7d3('0x38')]);_0x537635[_0xc7d3('0x39')]=_['intersection'](_0x537635[_0xc7d3('0x36')],_0x537635['query']);_0x3e4b4e[_0xc7d3('0x3b')]=_[_0xc7d3('0x3a')](_0x537635[_0xc7d3('0x36')],qs[_0xc7d3('0x3c')](_0x5a4bdc[_0xc7d3('0x38')][_0xc7d3('0x3c')]));_0x3e4b4e[_0xc7d3('0x3b')]=_0x3e4b4e[_0xc7d3('0x3b')][_0xc7d3('0x3d')]?_0x3e4b4e[_0xc7d3('0x3b')]:_0x537635[_0xc7d3('0x36')];_0x3e4b4e[_0xc7d3('0x3f')]=qs['sort'](_0x5a4bdc[_0xc7d3('0x38')][_0xc7d3('0x40')]);_0x3e4b4e[_0xc7d3('0x41')]=qs[_0xc7d3('0x39')](_[_0xc7d3('0x42')](_0x5a4bdc['query'],_0x537635[_0xc7d3('0x39')]));if(_0x5a4bdc[_0xc7d3('0x38')][_0xc7d3('0x43')]){_0x3e4b4e[_0xc7d3('0x41')]=_['merge'](_0x3e4b4e['where'],{'$or':_['map'](_0x3e4b4e[_0xc7d3('0x3b')],function(_0x4b05bc){var _0x31051a={};_0x31051a[_0x4b05bc]={'$like':'%'+_0x5a4bdc['query'][_0xc7d3('0x43')]+'%'};return _0x31051a;})});}_0x3e4b4e=_[_0xc7d3('0x44')]({},_0x3e4b4e,_0x5a4bdc[_0xc7d3('0x46')]);return _0x644262['getAgents'](_0x3e4b4e);}})[_0xc7d3('0x16')](function(_0x5106e1){if(_0x5106e1){_0x35a826=_0x5106e1['length'];if(!_0x5a4bdc['query'][_0xc7d3('0x5d')](_0xc7d3('0x3e'))){_0x3e4b4e[_0xc7d3('0x28')]=qs['limit'](_0x5a4bdc[_0xc7d3('0x38')][_0xc7d3('0x28')]);_0x3e4b4e[_0xc7d3('0x26')]=qs[_0xc7d3('0x26')](_0x5a4bdc[_0xc7d3('0x38')][_0xc7d3('0x26')]);}return _0x644262[_0xc7d3('0x129')](_0x3e4b4e);}})[_0xc7d3('0x16')](function(_0x3e995f){if(_0x3e995f){return _0x3e995f?{'count':_0x35a826,'rows':_0x3e995f}:null;}})['then'](respondWithResult(_0x373825,null))[_0xc7d3('0x21')](handleError(_0x373825,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index c3d6e90..7b5401d 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 _0x891b=['setMaxListeners','update','remove','emit','hasOwnProperty','ChatWebsite'];(function(_0x1bc7ac,_0x1eed0e){var _0x5a35d7=function(_0x1496c6){while(--_0x1496c6){_0x1bc7ac['push'](_0x1bc7ac['shift']());}};_0x5a35d7(++_0x1eed0e);}(_0x891b,0xc5));var _0xb891=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x891b[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0xb891('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb891('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb891('0x2'),'afterDestroy':_0xb891('0x3')};function emitEvent(_0x1c519f){return function(_0x467558,_0x587bf1,_0x379509){ChatWebsiteEvents[_0xb891('0x4')](_0x1c519f+':'+_0x467558['id'],_0x467558);ChatWebsiteEvents['emit'](_0x1c519f,_0x467558);_0x379509(null);};}for(var e in events){if(events[_0xb891('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x5183=['remove','emit','hasOwnProperty','events','../../mysqldb','ChatWebsite','update'];(function(_0x59e8ab,_0x5333ce){var _0x22d0f6=function(_0x3126e1){while(--_0x3126e1){_0x59e8ab['push'](_0x59e8ab['shift']());}};_0x22d0f6(++_0x5333ce);}(_0x5183,0x13e));var _0x3518=function(_0xd7f264,_0x3d3a65){_0xd7f264=_0xd7f264-0x0;var _0x53efd3=_0x5183[_0xd7f264];return _0x53efd3;};'use strict';var EventEmitter=require(_0x3518('0x0'));var ChatWebsite=require(_0x3518('0x1'))['db'][_0x3518('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3518('0x3'),'afterDestroy':_0x3518('0x4')};function emitEvent(_0x178571){return function(_0x421ab5,_0x5a38df,_0x54eb64){ChatWebsiteEvents[_0x3518('0x5')](_0x178571+':'+_0x421ab5['id'],_0x421ab5);ChatWebsiteEvents[_0x3518('0x5')](_0x178571,_0x421ab5);_0x54eb64(null);};}for(var e in events){if(events[_0x3518('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 903ec0a..418f188 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 _0x955f=['exports','define','ChatWebsite','chat_websites','util','bluebird','path','../../config/environment'];(function(_0x48620e,_0x4bac8d){var _0x5ddd2a=function(_0x390b40){while(--_0x390b40){_0x48620e['push'](_0x48620e['shift']());}};_0x5ddd2a(++_0x4bac8d);}(_0x955f,0x9c));var _0xf955=function(_0x13ee3a,_0x9837f9){_0x13ee3a=_0x13ee3a-0x0;var _0x28b2df=_0x955f[_0x13ee3a];return _0x28b2df;};'use strict';var _=require('lodash');var util=require(_0xf955('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf955('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf955('0x2'));var rimraf=require('rimraf');var config=require(_0xf955('0x3'));var attributes=require('./chatWebsite.attributes');module[_0xf955('0x4')]=function(_0x3208e1,_0x22e4c5){return _0x3208e1[_0xf955('0x5')](_0xf955('0x6'),attributes,{'tableName':_0xf955('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xccb6=['../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3b6e73,_0x42744e){var _0x4fbbe3=function(_0x47c0d8){while(--_0x47c0d8){_0x3b6e73['push'](_0x3b6e73['shift']());}};_0x4fbbe3(++_0x42744e);}(_0xccb6,0x125));var _0x6ccb=function(_0x3b918b,_0x2edc55){_0x3b918b=_0x3b918b-0x0;var _0x57d988=_0xccb6[_0x3b918b];return _0x57d988;};'use strict';var _=require('lodash');var util=require(_0x6ccb('0x0'));var logger=require(_0x6ccb('0x1'))('api');var moment=require(_0x6ccb('0x2'));var BPromise=require(_0x6ccb('0x3'));var rp=require(_0x6ccb('0x4'));var fs=require('fs');var path=require(_0x6ccb('0x5'));var rimraf=require(_0x6ccb('0x6'));var config=require(_0x6ccb('0x7'));var attributes=require(_0x6ccb('0x8'));module[_0x6ccb('0x9')]=function(_0xcaf6c6,_0x24b5b5){return _0xcaf6c6[_0x6ccb('0xa')]('ChatWebsite',attributes,{'tableName':_0x6ccb('0xb'),'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 f70ce0f..8bedf0a 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 _0xa945=['then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request'];(function(_0x5213b5,_0x4cbf42){var _0x2f4eae=function(_0x16caaf){while(--_0x16caaf){_0x5213b5['push'](_0x5213b5['shift']());}};_0x2f4eae(++_0x4cbf42);}(_0xa945,0x1ba));var _0x5a94=function(_0x40ea21,_0x352839){_0x40ea21=_0x40ea21-0x0;var _0x52d643=_0xa945[_0x40ea21];return _0x52d643;};'use strict';var _=require(_0x5a94('0x0'));var util=require(_0x5a94('0x1'));var moment=require(_0x5a94('0x2'));var BPromise=require('bluebird');var rs=require(_0x5a94('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5a94('0x4'));var logger=require(_0x5a94('0x5'))(_0x5a94('0x6'));var config=require(_0x5a94('0x7'));var jayson=require(_0x5a94('0x8'));var client=jayson['client'][_0x5a94('0x9')]({'port':0x232a});config[_0x5a94('0xa')]=_[_0x5a94('0xb')](config['redis'],{'host':_0x5a94('0xc'),'port':0x18eb});var socket=require(_0x5a94('0xd'))(new Redis(config[_0x5a94('0xa')]));require(_0x5a94('0xe'))[_0x5a94('0xf')](socket);function respondWithRpcPromise(_0x492761,_0x43abc1,_0x5e69e3){return new BPromise(function(_0x2b66a5,_0x34d4ca){return client[_0x5a94('0x10')](_0x492761,_0x5e69e3)[_0x5a94('0x11')](function(_0x4ba1ff){logger[_0x5a94('0x12')](_0x5a94('0x13'),_0x43abc1,_0x5a94('0x14'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x43abc1,'request\x20sent',JSON[_0x5a94('0x15')](_0x4ba1ff));if(_0x4ba1ff[_0x5a94('0x16')]){if(_0x4ba1ff[_0x5a94('0x16')][_0x5a94('0x17')]===0x1f4){logger['error'](_0x5a94('0x13'),_0x43abc1,_0x4ba1ff[_0x5a94('0x16')][_0x5a94('0x18')]);return _0x34d4ca(_0x4ba1ff[_0x5a94('0x16')][_0x5a94('0x18')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x43abc1,_0x4ba1ff[_0x5a94('0x16')]['message']);return _0x2b66a5(_0x4ba1ff[_0x5a94('0x16')][_0x5a94('0x18')]);}else{logger[_0x5a94('0x12')](_0x5a94('0x13'),_0x43abc1,_0x5a94('0x14'));_0x2b66a5(_0x4ba1ff[_0x5a94('0x19')][_0x5a94('0x18')]);}})[_0x5a94('0x1a')](function(_0x188694){logger[_0x5a94('0x16')](_0x5a94('0x13'),_0x43abc1,_0x188694);_0x34d4ca(_0x188694);});});}
\ No newline at end of file
+var _0xb64c=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xdbf272,_0x2ba789){var _0x236b25=function(_0x3c2606){while(--_0x3c2606){_0xdbf272['push'](_0xdbf272['shift']());}};_0x236b25(++_0x2ba789);}(_0xb64c,0x75));var _0xcb64=function(_0x19a631,_0x2bcdbe){_0x19a631=_0x19a631-0x0;var _0x590361=_0xb64c[_0x19a631];return _0x590361;};'use strict';var _=require('lodash');var util=require(_0xcb64('0x0'));var moment=require(_0xcb64('0x1'));var BPromise=require(_0xcb64('0x2'));var rs=require(_0xcb64('0x3'));var fs=require('fs');var Redis=require(_0xcb64('0x4'));var db=require(_0xcb64('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb64('0x6'))(_0xcb64('0x7'));var config=require(_0xcb64('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcb64('0x9')]['http']({'port':0x232a});config[_0xcb64('0xa')]=_[_0xcb64('0xb')](config[_0xcb64('0xa')],{'host':_0xcb64('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcb64('0xa')]));require(_0xcb64('0xd'))[_0xcb64('0xe')](socket);function respondWithRpcPromise(_0x950ff,_0x2f85ce,_0xae8bc){return new BPromise(function(_0x231bc1,_0x1dc1d1){return client[_0xcb64('0xf')](_0x950ff,_0xae8bc)[_0xcb64('0x10')](function(_0x3abac0){logger[_0xcb64('0x11')](_0xcb64('0x12'),_0x2f85ce,_0xcb64('0x13'));logger[_0xcb64('0x14')](_0xcb64('0x15'),_0x2f85ce,_0xcb64('0x13'),JSON[_0xcb64('0x16')](_0x3abac0));if(_0x3abac0[_0xcb64('0x17')]){if(_0x3abac0[_0xcb64('0x17')][_0xcb64('0x18')]===0x1f4){logger[_0xcb64('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x2f85ce,_0x3abac0['error'][_0xcb64('0x19')]);return _0x1dc1d1(_0x3abac0[_0xcb64('0x17')]['message']);}logger[_0xcb64('0x17')](_0xcb64('0x12'),_0x2f85ce,_0x3abac0['error'][_0xcb64('0x19')]);return _0x231bc1(_0x3abac0['error'][_0xcb64('0x19')]);}else{logger[_0xcb64('0x11')](_0xcb64('0x12'),_0x2f85ce,_0xcb64('0x13'));_0x231bc1(_0x3abac0[_0xcb64('0x1a')][_0xcb64('0x19')]);}})[_0xcb64('0x1b')](function(_0x4e505c){logger[_0xcb64('0x17')](_0xcb64('0x12'),_0x2f85ce,_0x4e505c);_0x1dc1d1(_0x4e505c);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 8fdcf96..49169c8 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 _0x91f7=['save','remove','update','emit','removeListener','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x91f7,0x9c));var _0x791f=function(_0x2b0ed8,_0x49660c){_0x2b0ed8=_0x2b0ed8-0x0;var _0x5a8d39=_0x91f7[_0x2b0ed8];return _0x5a8d39;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x791f('0x0'),_0x791f('0x1'),_0x791f('0x2')];function createListener(_0x15068b,_0x4239c3){return function(_0x115937){_0x4239c3[_0x791f('0x3')](_0x15068b,_0x115937);};}function removeListener(_0x68e73d,_0x1732d8){return function(){ChatWebsiteEvents[_0x791f('0x4')](_0x68e73d,_0x1732d8);};}exports['register']=function(_0x33d9d8){for(var _0x5ebe4d=0x0,_0x6723cb=events[_0x791f('0x5')];_0x5ebe4d<_0x6723cb;_0x5ebe4d++){var _0x830ae5=events[_0x5ebe4d];var _0xe00e1c=createListener('chatWebsite:'+_0x830ae5,_0x33d9d8);ChatWebsiteEvents['on'](_0x830ae5,_0xe00e1c);}};
\ No newline at end of file
+var _0x583e=['update','emit','removeListener','register','length','./chatWebsite.events'];(function(_0x5c4bd8,_0x26e6f1){var _0x211e99=function(_0x376641){while(--_0x376641){_0x5c4bd8['push'](_0x5c4bd8['shift']());}};_0x211e99(++_0x26e6f1);}(_0x583e,0x9b));var _0xe583=function(_0x4eceba,_0x235451){_0x4eceba=_0x4eceba-0x0;var _0x13a23c=_0x583e[_0x4eceba];return _0x13a23c;};'use strict';var ChatWebsiteEvents=require(_0xe583('0x0'));var events=['save','remove',_0xe583('0x1')];function createListener(_0x88e2a0,_0x1b559a){return function(_0x429a43){_0x1b559a[_0xe583('0x2')](_0x88e2a0,_0x429a43);};}function removeListener(_0x2b86e4,_0x4eb10c){return function(){ChatWebsiteEvents[_0xe583('0x3')](_0x2b86e4,_0x4eb10c);};}exports[_0xe583('0x4')]=function(_0x519fe7){for(var _0x37918a=0x0,_0x49c4c1=events[_0xe583('0x5')];_0x37918a<_0x49c4c1;_0x37918a++){var _0x1ad8f5=events[_0x37918a];var _0x46fcba=createListener('chatWebsite:'+_0x1ad8f5,_0x519fe7);ChatWebsiteEvents['on'](_0x1ad8f5,_0x46fcba);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 0fb02d1..b607fe2 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 _0xc779=['/:id/logo','single','file','addLogo','diskStorage','server/files/images/avatars/','format','addCustomerAvatar','notify','replace','extname','/:id/offline','any','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','removeAnswers','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','join','root','%s-%s','now','originalname'];(function(_0x3b9693,_0x5c73cb){var _0x21f552=function(_0xea0cb5){while(--_0xea0cb5){_0x3b9693['push'](_0x3b9693['shift']());}};_0x21f552(++_0x5c73cb);}(_0xc779,0x166));var _0x9c77=function(_0x445125,_0x1b7870){_0x445125=_0x445125-0x0;var _0x17b5a5=_0xc779[_0x445125];return _0x17b5a5;};'use strict';var multer=require(_0x9c77('0x0'));var util=require(_0x9c77('0x1'));var path=require('path');var timeout=require(_0x9c77('0x2'));var express=require(_0x9c77('0x3'));var router=express['Router']();var fs_extra=require(_0x9c77('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9c77('0x5'));var config=require(_0x9c77('0x6'));var controller=require(_0x9c77('0x7'));router['get']('/',auth[_0x9c77('0x8')](),controller[_0x9c77('0x9')]);router[_0x9c77('0xa')]('/describe',auth[_0x9c77('0x8')](),controller[_0x9c77('0xb')]);router[_0x9c77('0xa')](_0x9c77('0xc'),auth[_0x9c77('0x8')](),controller[_0x9c77('0xd')]);router[_0x9c77('0xa')](_0x9c77('0xe'),auth[_0x9c77('0x8')](),controller[_0x9c77('0xf')]);router[_0x9c77('0xa')](_0x9c77('0x10'),auth['isAuthenticated'](),controller[_0x9c77('0x11')]);router[_0x9c77('0xa')]('/:id/logo',controller[_0x9c77('0x12')]);router[_0x9c77('0xa')]('/:id/avatar',controller[_0x9c77('0x13')]);router[_0x9c77('0xa')](_0x9c77('0x14'),controller[_0x9c77('0x15')]);router[_0x9c77('0xa')](_0x9c77('0x16'),controller['getSystemAvatar']);router[_0x9c77('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x9c77('0x17')]);router['get'](_0x9c77('0x18'),controller[_0x9c77('0x19')]);router[_0x9c77('0xa')](_0x9c77('0x1a'),auth[_0x9c77('0x8')](),controller['getApplications']);router[_0x9c77('0xa')](_0x9c77('0x1b'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x1c')]);router[_0x9c77('0xa')](_0x9c77('0x1d'),controller[_0x9c77('0x1e')]);router[_0x9c77('0xa')](_0x9c77('0x1f'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x20')]);router[_0x9c77('0xa')](_0x9c77('0x21'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x22')]);router[_0x9c77('0x23')]('/',auth[_0x9c77('0x8')](),controller[_0x9c77('0x24')]);router['post'](_0x9c77('0xe'),auth['isAuthenticated'](),controller[_0x9c77('0x25')]);router['post'](_0x9c77('0x10'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3311a3,_0x418bfd,_0x248b25){_0x248b25(null,path[_0x9c77('0x27')](config[_0x9c77('0x28')],'server/files/images/logos/'));},'filename':function(_0x4bce16,_0x5b7224,_0x22a070){_0x22a070(null,util['format'](_0x9c77('0x29'),Date[_0x9c77('0x2a')](),_0x5b7224[_0x9c77('0x2b')]));}})});router['post'](_0x9c77('0x2c'),upload[_0x9c77('0x2d')](_0x9c77('0x2e')),controller[_0x9c77('0x2f')]);var upload=multer({'storage':multer[_0x9c77('0x30')]({'destination':function(_0x5c5ef5,_0x447b52,_0x46701e){_0x46701e(null,path[_0x9c77('0x27')](config[_0x9c77('0x28')],_0x9c77('0x31')));},'filename':function(_0x56bde7,_0x5106c5,_0x53e9f8){_0x53e9f8(null,util[_0x9c77('0x32')]('%s-%s',Date[_0x9c77('0x2a')](),_0x5106c5[_0x9c77('0x2b')]));}})});router[_0x9c77('0x23')]('/:id/avatar',upload[_0x9c77('0x2d')](_0x9c77('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer[_0x9c77('0x30')]({'destination':function(_0xdcd221,_0x1cf518,_0x4c8a7f){_0x4c8a7f(null,path['join'](config[_0x9c77('0x28')],_0x9c77('0x31')));},'filename':function(_0x567f52,_0x312e3e,_0x127614){_0x127614(null,util[_0x9c77('0x32')](_0x9c77('0x29'),Date[_0x9c77('0x2a')](),_0x312e3e[_0x9c77('0x2b')]));}})});router[_0x9c77('0x23')]('/:id/customer_avatar',upload[_0x9c77('0x2d')](_0x9c77('0x2e')),controller[_0x9c77('0x33')]);var upload=multer({'storage':multer[_0x9c77('0x30')]({'destination':function(_0x590d8a,_0x34bc4f,_0x5c2b30){_0x5c2b30(null,path[_0x9c77('0x27')](config[_0x9c77('0x28')],_0x9c77('0x31')));},'filename':function(_0x5be64b,_0x5a7c32,_0x5a789b){_0x5a789b(null,util[_0x9c77('0x32')](_0x9c77('0x29'),Date['now'](),_0x5a7c32['originalname']));}})});router[_0x9c77('0x23')](_0x9c77('0x16'),upload[_0x9c77('0x2d')](_0x9c77('0x2e')),controller['addSystemAvatar']);router[_0x9c77('0x23')]('/:id/notify',controller[_0x9c77('0x34')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x1f9836,_0x4ea3db,_0x21406a){const _0x3b1bda=path[_0x9c77('0x27')](config['root'],'server/files','attachments','offline-chat');fs_extra['ensureDir'](_0x3b1bda,function(){_0x21406a(null,_0x3b1bda);});},'filename':function(_0x3ef3cc,_0x151d83,_0x3744b7){const _0x544717=_0x151d83[_0x9c77('0x2b')][_0x9c77('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x47bc10=path[_0x9c77('0x36')](_0x544717);const _0x543046=Date['now']()+'-'+_0x544717[_0x9c77('0x35')](_0x47bc10,'')+_0x47bc10;_0x3744b7(null,_0x543046);}})});router[_0x9c77('0x23')](_0x9c77('0x37'),offlineUploadMulter[_0x9c77('0x38')](),controller['offline']);router[_0x9c77('0x23')](_0x9c77('0x39'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x3a')]);router[_0x9c77('0x23')](_0x9c77('0x1a'),auth['isAuthenticated'](),controller[_0x9c77('0x3b')]);router['post'](_0x9c77('0x1b'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x3c')]);router[_0x9c77('0x23')](_0x9c77('0x21'),auth['isAuthenticated'](),controller[_0x9c77('0x3d')]);router[_0x9c77('0x3e')](_0x9c77('0xc'),auth['isAuthenticated'](),controller[_0x9c77('0x3f')]);router[_0x9c77('0x40')](_0x9c77('0xc'),auth[_0x9c77('0x8')](),controller['destroy']);router[_0x9c77('0x40')](_0x9c77('0xe'),auth[_0x9c77('0x8')](),controller['removeDispositions']);router['delete'](_0x9c77('0x10'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x41')]);router[_0x9c77('0x40')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x9c77('0x42')]=router;
\ No newline at end of file
+var _0xcef0=['exports','util','path','connect-timeout','Router','../../config/environment','./chatWebsite.controller','get','isAuthenticated','describe','/:id','/:id/dispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','addLogo','server/files/images/avatars/','single','addAvatar','file','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents'];(function(_0x3e330a,_0x11bf04){var _0x451dee=function(_0x1074b7){while(--_0x1074b7){_0x3e330a['push'](_0x3e330a['shift']());}};_0x451dee(++_0x11bf04);}(_0xcef0,0x193));var _0x0cef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcef0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x0cef('0x0'));var path=require(_0x0cef('0x1'));var timeout=require(_0x0cef('0x2'));var express=require('express');var router=express[_0x0cef('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0cef('0x4'));var controller=require(_0x0cef('0x5'));router[_0x0cef('0x6')]('/',auth[_0x0cef('0x7')](),controller['index']);router[_0x0cef('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x0cef('0x8')]);router[_0x0cef('0x6')](_0x0cef('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x0cef('0x6')](_0x0cef('0xa'),auth[_0x0cef('0x7')](),controller['getDispositions']);router[_0x0cef('0x6')]('/:id/canned_answers',auth[_0x0cef('0x7')](),controller[_0x0cef('0xb')]);router['get']('/:id/logo',controller[_0x0cef('0xc')]);router['get'](_0x0cef('0xd'),controller[_0x0cef('0xe')]);router[_0x0cef('0x6')](_0x0cef('0xf'),controller[_0x0cef('0x10')]);router[_0x0cef('0x6')](_0x0cef('0x11'),controller[_0x0cef('0x12')]);router[_0x0cef('0x6')](_0x0cef('0x13'),auth[_0x0cef('0x7')](),controller['getInteractions']);router[_0x0cef('0x6')]('/:id/snippet',controller[_0x0cef('0x14')]);router[_0x0cef('0x6')](_0x0cef('0x15'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x16')]);router[_0x0cef('0x6')](_0x0cef('0x17'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x18')]);router['get'](_0x0cef('0x19'),controller[_0x0cef('0x1a')]);router['get'](_0x0cef('0x1b'),auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0x0cef('0x6')](_0x0cef('0x1c'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0cef('0x1d')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0cef('0x1d')](_0x0cef('0xa'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x1e')]);router[_0x0cef('0x1d')](_0x0cef('0x1f'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x20')]);var upload=multer({'storage':multer[_0x0cef('0x21')]({'destination':function(_0x458a1d,_0x15f85b,_0x42a09d){_0x42a09d(null,path[_0x0cef('0x22')](config[_0x0cef('0x23')],_0x0cef('0x24')));},'filename':function(_0xb868a9,_0x4d3626,_0x539d34){_0x539d34(null,util[_0x0cef('0x25')](_0x0cef('0x26'),Date[_0x0cef('0x27')](),_0x4d3626[_0x0cef('0x28')]));}})});router['post'](_0x0cef('0x29'),upload['single']('file'),controller[_0x0cef('0x2a')]);var upload=multer({'storage':multer[_0x0cef('0x21')]({'destination':function(_0x41c63c,_0x12e22d,_0x455103){_0x455103(null,path[_0x0cef('0x22')](config[_0x0cef('0x23')],_0x0cef('0x2b')));},'filename':function(_0x5d9928,_0x46b39f,_0x20b4a2){_0x20b4a2(null,util[_0x0cef('0x25')](_0x0cef('0x26'),Date['now'](),_0x46b39f[_0x0cef('0x28')]));}})});router[_0x0cef('0x1d')](_0x0cef('0xd'),upload[_0x0cef('0x2c')]('file'),controller[_0x0cef('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x26344e,_0x4e1312,_0x81fd62){_0x81fd62(null,path[_0x0cef('0x22')](config[_0x0cef('0x23')],_0x0cef('0x2b')));},'filename':function(_0x31150d,_0x314db8,_0x4bc5ff){_0x4bc5ff(null,util[_0x0cef('0x25')](_0x0cef('0x26'),Date['now'](),_0x314db8[_0x0cef('0x28')]));}})});router[_0x0cef('0x1d')](_0x0cef('0xf'),upload['single'](_0x0cef('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x11b414,_0xff0506,_0x11f520){_0x11f520(null,path[_0x0cef('0x22')](config[_0x0cef('0x23')],'server/files/images/avatars/'));},'filename':function(_0x5a940a,_0x48b708,_0x78c274){_0x78c274(null,util['format'](_0x0cef('0x26'),Date[_0x0cef('0x27')](),_0x48b708[_0x0cef('0x28')]));}})});router[_0x0cef('0x1d')](_0x0cef('0x11'),upload[_0x0cef('0x2c')](_0x0cef('0x2e')),controller[_0x0cef('0x2f')]);router[_0x0cef('0x1d')](_0x0cef('0x30'),controller[_0x0cef('0x31')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x18f3fa,_0x3fc15e,_0x1b8487){const _0x4efa74=path[_0x0cef('0x22')](config[_0x0cef('0x23')],'server/files',_0x0cef('0x32'),_0x0cef('0x33'));fs_extra[_0x0cef('0x34')](_0x4efa74,function(){_0x1b8487(null,_0x4efa74);});},'filename':function(_0x39fe0b,_0x97201d,_0x519cf7){const _0x2754fb=_0x97201d[_0x0cef('0x28')][_0x0cef('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x10f8fe=path[_0x0cef('0x36')](_0x2754fb);const _0x3816e8=Date[_0x0cef('0x27')]()+'-'+_0x2754fb[_0x0cef('0x35')](_0x10f8fe,'')+_0x10f8fe;_0x519cf7(null,_0x3816e8);}})});router[_0x0cef('0x1d')](_0x0cef('0x37'),offlineUploadMulter[_0x0cef('0x38')](),controller[_0x0cef('0x39')]);router[_0x0cef('0x1d')](_0x0cef('0x13'),auth[_0x0cef('0x7')](),controller['addInteraction']);router[_0x0cef('0x1d')](_0x0cef('0x15'),auth['isAuthenticated'](),controller['addApplications']);router[_0x0cef('0x1d')](_0x0cef('0x17'),auth[_0x0cef('0x7')](),controller['addProactiveActions']);router[_0x0cef('0x1d')](_0x0cef('0x1c'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x3a')]);router[_0x0cef('0x3b')](_0x0cef('0x9'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x3c')]);router[_0x0cef('0x3d')]('/:id',auth[_0x0cef('0x7')](),controller[_0x0cef('0x3e')]);router[_0x0cef('0x3d')](_0x0cef('0xa'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x3f')]);router['delete'](_0x0cef('0x1f'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x40')]);router['delete'](_0x0cef('0x1c'),auth[_0x0cef('0x7')](),controller[_0x0cef('0x41')]);module[_0x0cef('0x42')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 838c23e..8a396bb 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 _0xf1c6=['STRING','ENUM','AmazonAWS','Google','sequelize','exports'];(function(_0x4a1c82,_0x3cff45){var _0x5eaa64=function(_0x57e43f){while(--_0x57e43f){_0x4a1c82['push'](_0x4a1c82['shift']());}};_0x5eaa64(++_0x3cff45);}(_0xf1c6,0xf4));var _0x6f1c=function(_0x3fbcab,_0x32ed19){_0x3fbcab=_0x3fbcab-0x0;var _0x203045=_0xf1c6[_0x3fbcab];return _0x203045;};'use strict';var Sequelize=require(_0x6f1c('0x0'));module[_0x6f1c('0x1')]={'name':{'type':Sequelize[_0x6f1c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6f1c('0x3')](_0x6f1c('0x4'),_0x6f1c('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x6f1c('0x2')]},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x00e0=['exports','STRING','AmazonAWS','sequelize'];(function(_0x50a004,_0x193d84){var _0x5e9992=function(_0x3c8c37){while(--_0x3c8c37){_0x50a004['push'](_0x50a004['shift']());}};_0x5e9992(++_0x193d84);}(_0x00e0,0x1e3));var _0x000e=function(_0x4fc888,_0x5ad3e7){_0x4fc888=_0x4fc888-0x0;var _0xf688d1=_0x00e0[_0x4fc888];return _0xf688d1;};'use strict';var Sequelize=require(_0x000e('0x0'));module[_0x000e('0x1')]={'name':{'type':Sequelize[_0x000e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x000e('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x000e('0x2')]},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index bf911db..429dbba 100644
--- a/server/api/cloudProvider/cloudProvider.controller.js
+++ b/server/api/cloudProvider/cloudProvider.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['update','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','CloudProvider','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x1f715a,_0x32cffb){var _0x2a752b=function(_0x38d64a){while(--_0x38d64a){_0x1f715a['push'](_0x1f715a['shift']());}};_0x2a752b(++_0x32cffb);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['CloudProvider'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};
\ No newline at end of file
+var _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x4defb9,_0x4c8461){var _0x3fd54e=function(_0x4d57ed){while(--_0x4d57ed){_0x4defb9['push'](_0x4defb9['shift']());}};_0x3fd54e(++_0x4c8461);}(_0xdb28,0x106));var _0x8db2=function(_0x2b72a3,_0x46dc84){_0x2b72a3=_0x2b72a3-0x0;var _0x17ed95=_0xdb28[_0x2b72a3];return _0x17ed95;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index f4c8314..0a8d3b5 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 _0x61ed=['../../config/environment','./cloudProvider.attributes','exports','define','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x998c5,_0x241ce8){var _0x5d9e81=function(_0x12294c){while(--_0x12294c){_0x998c5['push'](_0x998c5['shift']());}};_0x5d9e81(++_0x241ce8);}(_0x61ed,0x1ee));var _0xd61e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x61ed[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xd61e('0x0'));var logger=require(_0xd61e('0x1'))('api');var moment=require(_0xd61e('0x2'));var BPromise=require(_0xd61e('0x3'));var rp=require(_0xd61e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd61e('0x5'));var config=require(_0xd61e('0x6'));var attributes=require(_0xd61e('0x7'));module[_0xd61e('0x8')]=function(_0x25d9d0,_0x362b39){return _0x25d9d0[_0xd61e('0x9')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x16a2=['../../config/logger','request-promise','rimraf','../../config/environment','define','CloudProvider','cloud_providers','lodash','util'];(function(_0xc971a4,_0x5b381c){var _0x4ebd6b=function(_0x371149){while(--_0x371149){_0xc971a4['push'](_0xc971a4['shift']());}};_0x4ebd6b(++_0x5b381c);}(_0x16a2,0x6a));var _0x216a=function(_0x271537,_0x8b7b3b){_0x271537=_0x271537-0x0;var _0x19dc22=_0x16a2[_0x271537];return _0x19dc22;};'use strict';var _=require(_0x216a('0x0'));var util=require(_0x216a('0x1'));var logger=require(_0x216a('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x216a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x216a('0x4'));var config=require(_0x216a('0x5'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x3339b9,_0x502753){return _0x3339b9[_0x216a('0x6')](_0x216a('0x7'),attributes,{'tableName':_0x216a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 1e074d2..c86d1ad 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 _0xcf2f=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0xa20507,_0x194ad9){var _0x2b0948=function(_0x574175){while(--_0x574175){_0xa20507['push'](_0xa20507['shift']());}};_0x2b0948(++_0x194ad9);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x562c5f,_0x247419){_0x562c5f=_0x562c5f-0x0;var _0x495c5b=_0xcf2f[_0x562c5f];return _0x495c5b;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var moment=require(_0xfcf2('0x2'));var BPromise=require(_0xfcf2('0x3'));var rs=require(_0xfcf2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcf2('0x5'))['db'];var utils=require(_0xfcf2('0x6'));var logger=require(_0xfcf2('0x7'))(_0xfcf2('0x8'));var config=require(_0xfcf2('0x9'));var jayson=require(_0xfcf2('0xa'));var client=jayson[_0xfcf2('0xb')][_0xfcf2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41d4bd,_0x157f48,_0x16b6b2){return new BPromise(function(_0x34f444,_0xb4c510){return client[_0xfcf2('0xd')](_0x41d4bd,_0x16b6b2)['then'](function(_0x575f33){logger['info'](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));logger['debug'](_0xfcf2('0x10'),_0x157f48,_0xfcf2('0xf'),JSON[_0xfcf2('0x11')](_0x575f33));if(_0x575f33[_0xfcf2('0x12')]){if(_0x575f33['error']['code']===0x1f4){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x575f33[_0xfcf2('0x12')][_0xfcf2('0x13')]);return _0xb4c510(_0x575f33['error'][_0xfcf2('0x13')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x157f48,_0x575f33['error'][_0xfcf2('0x13')]);return _0x34f444(_0x575f33['error'][_0xfcf2('0x13')]);}else{logger[_0xfcf2('0x14')](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));_0x34f444(_0x575f33[_0xfcf2('0x15')][_0xfcf2('0x13')]);}})[_0xfcf2('0x16')](function(_0x4d64ce){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x4d64ce);_0xb4c510(_0x4d64ce);});});}
\ No newline at end of file
+var _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CloudProvider,\x20%s,\x20%s','message','catch','lodash'];(function(_0xce417f,_0x4e9230){var _0x50c2e9=function(_0x3d3dd3){while(--_0x3d3dd3){_0xce417f['push'](_0xce417f['shift']());}};_0x50c2e9(++_0x4e9230);}(_0x66fa,0x117));var _0xa66f=function(_0x2d4fb2,_0x468359){_0x2d4fb2=_0x2d4fb2-0x0;var _0x2cd0a5=_0x66fa[_0x2d4fb2];return _0x2cd0a5;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('CloudProvider,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('CloudProvider,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 27702c7..e8d8d27 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 _0xdbcd=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','create','delete','destroy'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xdbcd,0x67));var _0xddbc=function(_0x2d4ab1,_0xd0fc03){_0x2d4ab1=_0x2d4ab1-0x0;var _0x2b4fe0=_0xdbcd[_0x2d4ab1];return _0x2b4fe0;};'use strict';var multer=require('multer');var util=require(_0xddbc('0x0'));var path=require(_0xddbc('0x1'));var timeout=require(_0xddbc('0x2'));var express=require('express');var router=express[_0xddbc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xddbc('0x4'));var interaction=require(_0xddbc('0x5'));var config=require(_0xddbc('0x6'));var controller=require(_0xddbc('0x7'));router[_0xddbc('0x8')]('/',auth[_0xddbc('0x9')](),controller['index']);router[_0xddbc('0x8')](_0xddbc('0xa'),auth['isAuthenticated'](),controller[_0xddbc('0xb')]);router[_0xddbc('0xc')]('/',auth[_0xddbc('0x9')](),controller[_0xddbc('0xd')]);router['put']('/:id',auth[_0xddbc('0x9')](),controller['update']);router[_0xddbc('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xddbc('0xf')]);module[_0xddbc('0x10')]=router;
\ No newline at end of file
+var _0xa997=['show','post','create','put','update','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x3a2d01,_0x1b6051){var _0x3bcb4b=function(_0x4a68f5){while(--_0x4a68f5){_0x3a2d01['push'](_0x3a2d01['shift']());}};_0x3bcb4b(++_0x1b6051);}(_0xa997,0xea));var _0x7a99=function(_0x2cea58,_0x153c15){_0x2cea58=_0x2cea58-0x0;var _0x192933=_0xa997[_0x2cea58];return _0x192933;};'use strict';var multer=require(_0x7a99('0x0'));var util=require(_0x7a99('0x1'));var path=require(_0x7a99('0x2'));var timeout=require(_0x7a99('0x3'));var express=require('express');var router=express[_0x7a99('0x4')]();var fs_extra=require(_0x7a99('0x5'));var auth=require(_0x7a99('0x6'));var interaction=require(_0x7a99('0x7'));var config=require(_0x7a99('0x8'));var controller=require('./cloudProvider.controller');router[_0x7a99('0x9')]('/',auth[_0x7a99('0xa')](),controller[_0x7a99('0xb')]);router[_0x7a99('0x9')](_0x7a99('0xc'),auth['isAuthenticated'](),controller[_0x7a99('0xd')]);router[_0x7a99('0xe')]('/',auth['isAuthenticated'](),controller[_0x7a99('0xf')]);router[_0x7a99('0x10')]('/:id',auth[_0x7a99('0xa')](),controller[_0x7a99('0x11')]);router['delete'](_0x7a99('0xc'),auth[_0x7a99('0xa')](),controller[_0x7a99('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 167e447..fa12ab8 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 _0xf13e=['STRING','name','sequelize','exports'];(function(_0x565faf,_0x5f3718){var _0x42292f=function(_0x514b49){while(--_0x514b49){_0x565faf['push'](_0x565faf['shift']());}};_0x42292f(++_0x5f3718);}(_0xf13e,0x6a));var _0xef13=function(_0x4cde1f,_0x3c72bf){_0x4cde1f=_0x4cde1f-0x0;var _0x46afba=_0xf13e[_0x4cde1f];return _0x46afba;};'use strict';var Sequelize=require(_0xef13('0x0'));module[_0xef13('0x1')]={'name':{'type':Sequelize[_0xef13('0x2')],'unique':_0xef13('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xef13('0x2')]},'companyId':{'type':Sequelize[_0xef13('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xef13('0x2')]},'type':{'type':Sequelize[_0xef13('0x2')]},'street':{'type':Sequelize[_0xef13('0x2')]},'postalCode':{'type':Sequelize[_0xef13('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xef13('0x2')]},'email':{'type':Sequelize[_0xef13('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xef13('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xef13('0x2')]},'description':{'type':Sequelize[_0xef13('0x2')]}};
\ No newline at end of file
+var _0x2c37=['STRING','exports'];(function(_0x4a6ba2,_0x4504a2){var _0x27ee9e=function(_0x4fe7ae){while(--_0x4fe7ae){_0x4a6ba2['push'](_0x4a6ba2['shift']());}};_0x27ee9e(++_0x4504a2);}(_0x2c37,0x175));var _0x72c3=function(_0x1c02d9,_0x342afd){_0x1c02d9=_0x1c02d9-0x0;var _0x21b6cb=_0x2c37[_0x1c02d9];return _0x21b6cb;};'use strict';var Sequelize=require('sequelize');module[_0x72c3('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x72c3('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x72c3('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x72c3('0x1')]},'type':{'type':Sequelize[_0x72c3('0x1')]},'street':{'type':Sequelize[_0x72c3('0x1')]},'postalCode':{'type':Sequelize[_0x72c3('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x72c3('0x1')]},'email':{'type':Sequelize[_0x72c3('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x72c3('0x1')]},'sStreet':{'type':Sequelize[_0x72c3('0x1')]},'sPostalCode':{'type':Sequelize[_0x72c3('0x1')]},'sCity':{'type':Sequelize[_0x72c3('0x1')]},'sCountry':{'type':Sequelize[_0x72c3('0x1')]},'description':{'type':Sequelize[_0x72c3('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index fe3fc00..d01c909 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 _0x7383=['undefined','limit','count','set','json','reject','save','update','then','destroy','get','Companies','error','stack','name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','options','includeAll','include','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','omit','rawAttributes','pick','getContacts','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset'];(function(_0x2d26bd,_0x30ebac){var _0x3eccc3=function(_0x5021df){while(--_0x5021df){_0x2d26bd['push'](_0x2d26bd['shift']());}};_0x3eccc3(++_0x30ebac);}(_0x7383,0x18d));var _0x3738=function(_0x3b9eb9,_0x15088d){_0x3b9eb9=_0x3b9eb9-0x0;var _0x4f6d1d=_0x7383[_0x3b9eb9];return _0x4f6d1d;};'use strict';var emlformat=require(_0x3738('0x0'));var rimraf=require(_0x3738('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3738('0x2'));var rp=require(_0x3738('0x3'));var moment=require('moment');var BPromise=require(_0x3738('0x4'));var Mustache=require(_0x3738('0x5'));var util=require(_0x3738('0x6'));var path=require('path');var sox=require(_0x3738('0x7'));var csv=require(_0x3738('0x8'));var ejs=require(_0x3738('0x9'));var fs=require('fs');var fs_extra=require(_0x3738('0xa'));var _=require(_0x3738('0xb'));var squel=require(_0x3738('0xc'));var crypto=require(_0x3738('0xd'));var jsforce=require(_0x3738('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3738('0x8'));var querystring=require('querystring');var Papa=require(_0x3738('0xf'));var Redis=require(_0x3738('0x10'));var authService=require(_0x3738('0x11'));var qs=require(_0x3738('0x12'));var as=require(_0x3738('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3738('0x14'));var utils=require(_0x3738('0x15'));var config=require(_0x3738('0x16'));var licenseUtil=require(_0x3738('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57b984,_0x2db9ef){_0x2db9ef=_0x2db9ef||0xcc;return function(_0x341745){if(_0x341745){return _0x57b984[_0x3738('0x18')](_0x2db9ef);}return _0x57b984[_0x3738('0x19')](_0x2db9ef)[_0x3738('0x1a')]();};}function respondWithResult(_0x2df558,_0x1a9e49){_0x1a9e49=_0x1a9e49||0xc8;return function(_0x114c82){if(_0x114c82){return _0x2df558[_0x3738('0x19')](_0x1a9e49)['json'](_0x114c82);}};}function respondWithFilteredResult(_0x1f6557,_0x553916){return function(_0x524bbd){if(_0x524bbd){var _0xa9c0c9=typeof _0x553916[_0x3738('0x1b')]===_0x3738('0x1c')&&typeof _0x553916[_0x3738('0x1d')]===_0x3738('0x1c');var _0x51ea31=_0x524bbd[_0x3738('0x1e')];var _0x570fbb=_0xa9c0c9?0x0:_0x553916[_0x3738('0x1b')];var _0x10cfa5=_0xa9c0c9?_0x524bbd[_0x3738('0x1e')]:_0x553916['offset']+_0x553916[_0x3738('0x1d')];var _0x212d00;if(_0x10cfa5>=_0x51ea31){_0x10cfa5=_0x51ea31;_0x212d00=0xc8;}else{_0x212d00=0xce;}_0x1f6557[_0x3738('0x19')](_0x212d00);return _0x1f6557[_0x3738('0x1f')]('Content-Range',_0x570fbb+'-'+_0x10cfa5+'/'+_0x51ea31)[_0x3738('0x20')](_0x524bbd);}return null;};}function patchUpdates(_0x52eab4){return function(_0x56baa1){try{jsonpatch['apply'](_0x56baa1,_0x52eab4,!![]);}catch(_0x58c036){return BPromise[_0x3738('0x21')](_0x58c036);}return _0x56baa1[_0x3738('0x22')]();};}function saveUpdates(_0x409340,_0x49b90f){return function(_0x52b180){if(_0x52b180){return _0x52b180[_0x3738('0x23')](_0x409340)[_0x3738('0x24')](function(_0x3287d3){return _0x3287d3;});}return null;};}function removeEntity(_0x3c3feb,_0x4122eb){return function(_0x2c00da){if(_0x2c00da){return _0x2c00da[_0x3738('0x25')]()['then'](function(){var _0x4ed034=_0x2c00da[_0x3738('0x26')]({'plain':!![]});var _0xae3599=_0x3738('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0xae3599,'resourceId':_0x4ed034['id']}})['then'](function(){return _0x2c00da;});})['then'](function(){_0x3c3feb[_0x3738('0x19')](0xcc)[_0x3738('0x1a')]();});}};}function handleEntityNotFound(_0x2fc010,_0x4b7a6e){return function(_0x1821c2){if(!_0x1821c2){_0x2fc010['sendStatus'](0x194);}return _0x1821c2;};}function handleError(_0x42dbb7,_0x2010f3){_0x2010f3=_0x2010f3||0x1f4;return function(_0x4a7359){logger[_0x3738('0x28')](_0x4a7359[_0x3738('0x29')]);if(_0x4a7359['name']){delete _0x4a7359[_0x3738('0x2a')];}_0x42dbb7['status'](_0x2010f3)[_0x3738('0x2b')](_0x4a7359);};}exports[_0x3738('0x2c')]=function(_0x260bde,_0x16a1e3){var _0x1269ed={},_0x38260d={},_0x5bc594={'count':0x0,'rows':[]};return db[_0x3738('0x2d')]['describe']()['then'](function(_0x3b3594){_0x38260d[_0x3738('0x2e')]=_[_0x3738('0x2f')](_0x3b3594);_0x38260d['query']=_[_0x3738('0x2f')](_0x260bde[_0x3738('0x30')]);_0x38260d[_0x3738('0x31')]=_[_0x3738('0x32')](_0x38260d['model'],_0x38260d['query']);_0x1269ed[_0x3738('0x33')]=_['intersection'](_0x38260d[_0x3738('0x2e')],qs[_0x3738('0x34')](_0x260bde[_0x3738('0x30')][_0x3738('0x34')]));_0x1269ed[_0x3738('0x33')]=_0x1269ed[_0x3738('0x33')][_0x3738('0x35')]?_0x1269ed['attributes']:_0x38260d[_0x3738('0x2e')];if(!_0x260bde['query']['hasOwnProperty'](_0x3738('0x36'))){_0x1269ed[_0x3738('0x1d')]=qs[_0x3738('0x1d')](_0x260bde['query']['limit']);_0x1269ed['offset']=qs[_0x3738('0x1b')](_0x260bde[_0x3738('0x30')]['offset']);}_0x1269ed[_0x3738('0x37')]=qs[_0x3738('0x38')](_0x260bde[_0x3738('0x30')][_0x3738('0x38')]);_0x1269ed[_0x3738('0x39')]=qs[_0x3738('0x31')](_['pick'](_0x260bde[_0x3738('0x30')],_0x38260d[_0x3738('0x31')]),_0x3b3594);if(_0x260bde[_0x3738('0x30')][_0x3738('0x3a')]){_0x1269ed[_0x3738('0x39')]=_[_0x3738('0x3b')](_0x1269ed[_0x3738('0x39')],{'$or':_[_0x3738('0x3c')](_0x1269ed['attributes'],function(_0x4760f8){var _0x5171ae={};_0x5171ae[_0x4760f8]={'$like':'%'+_0x260bde[_0x3738('0x30')]['filter']+'%'};return _0x5171ae;})});}_0x1269ed=_[_0x3738('0x3b')]({},_0x1269ed,_0x260bde[_0x3738('0x3d')]);var _0x46cc8d={'where':_0x1269ed['where']};return db[_0x3738('0x2d')]['count'](_0x46cc8d)['then'](function(_0x1b0bf8){_0x5bc594[_0x3738('0x1e')]=_0x1b0bf8;if(_0x260bde[_0x3738('0x30')][_0x3738('0x3e')]){_0x1269ed[_0x3738('0x3f')]=[{'all':!![]}];}return db[_0x3738('0x2d')]['findAll'](_0x1269ed);})[_0x3738('0x24')](function(_0x1c6577){_0x5bc594['rows']=_0x1c6577;return _0x5bc594;})['then'](respondWithFilteredResult(_0x16a1e3,_0x1269ed))[_0x3738('0x40')](handleError(_0x16a1e3,null));})['catch'](handleError(_0x16a1e3,null));};exports['show']=function(_0x1cb381,_0x260b1e){var _0x1de5e0={'raw':![],'where':{'id':_0x1cb381[_0x3738('0x41')]['id']}},_0x28d47a={};_0x28d47a[_0x3738('0x2e')]=_[_0x3738('0x2f')](db[_0x3738('0x2d')]['rawAttributes']);_0x28d47a[_0x3738('0x30')]=_[_0x3738('0x2f')](_0x1cb381['query']);_0x28d47a[_0x3738('0x31')]=_[_0x3738('0x32')](_0x28d47a[_0x3738('0x2e')],_0x28d47a[_0x3738('0x30')]);_0x1de5e0['attributes']=_[_0x3738('0x32')](_0x28d47a[_0x3738('0x2e')],qs[_0x3738('0x34')](_0x1cb381['query']['fields']));_0x1de5e0[_0x3738('0x33')]=_0x1de5e0[_0x3738('0x33')][_0x3738('0x35')]?_0x1de5e0['attributes']:_0x28d47a[_0x3738('0x2e')];if(_0x1cb381['query'][_0x3738('0x3e')]){_0x1de5e0[_0x3738('0x3f')]=[{'all':!![]}];}_0x1de5e0=_[_0x3738('0x3b')]({},_0x1de5e0,_0x1cb381['options']);return db[_0x3738('0x2d')][_0x3738('0x42')](_0x1de5e0)[_0x3738('0x24')](handleEntityNotFound(_0x260b1e,null))[_0x3738('0x24')](respondWithResult(_0x260b1e,null))['catch'](handleError(_0x260b1e,null));};exports['create']=function(_0x29c2b1,_0x10078c){return db[_0x3738('0x2d')][_0x3738('0x43')](_0x29c2b1[_0x3738('0x44')],{})[_0x3738('0x24')](function(_0x2fb3fa){var _0x561c11=_0x29c2b1['user'][_0x3738('0x26')]({'plain':!![]});if(!_0x561c11)throw new Error(_0x3738('0x45'));if(_0x561c11[_0x3738('0x46')]===_0x3738('0x47')){var _0x10e1cc=_0x2fb3fa[_0x3738('0x26')]({'plain':!![]});var _0x17a5e1='Companies';return db[_0x3738('0x48')][_0x3738('0x42')]({'where':{'name':_0x17a5e1,'userProfileId':_0x561c11[_0x3738('0x49')]},'raw':!![]})[_0x3738('0x24')](function(_0x2f3728){if(_0x2f3728&&_0x2f3728['autoAssociation']===0x0){return db[_0x3738('0x4a')]['create']({'name':_0x10e1cc[_0x3738('0x2a')],'resourceId':_0x10e1cc['id'],'type':_0x2f3728['name'],'sectionId':_0x2f3728['id']},{})[_0x3738('0x24')](function(){return _0x2fb3fa;});}else{return _0x2fb3fa;}})['catch'](function(_0xbe1f81){logger['error'](_0x3738('0x4b'),_0xbe1f81);throw _0xbe1f81;});}return _0x2fb3fa;})[_0x3738('0x24')](respondWithResult(_0x10078c,0xc9))['catch'](handleError(_0x10078c,null));};exports[_0x3738('0x23')]=function(_0x4d8890,_0x463b9d){if(_0x4d8890[_0x3738('0x44')]['id']){delete _0x4d8890[_0x3738('0x44')]['id'];}return db[_0x3738('0x2d')][_0x3738('0x42')]({'where':{'id':_0x4d8890[_0x3738('0x41')]['id']}})[_0x3738('0x24')](handleEntityNotFound(_0x463b9d,null))[_0x3738('0x24')](saveUpdates(_0x4d8890[_0x3738('0x44')],null))[_0x3738('0x24')](respondWithResult(_0x463b9d,null))[_0x3738('0x40')](handleError(_0x463b9d,null));};exports[_0x3738('0x25')]=function(_0x310a8f,_0x4a3c82){return db[_0x3738('0x2d')]['find']({'where':{'id':_0x310a8f[_0x3738('0x41')]['id']}})['then'](handleEntityNotFound(_0x4a3c82,null))['then'](removeEntity(_0x4a3c82,null))[_0x3738('0x40')](handleError(_0x4a3c82,null));};exports[_0x3738('0x4c')]=function(_0x470aaf,_0x210c3d){return db['CmCompany'][_0x3738('0x4c')]()[_0x3738('0x24')](respondWithResult(_0x210c3d,null))[_0x3738('0x40')](handleError(_0x210c3d,null));};exports[_0x3738('0x4d')]=function(_0x240629,_0x46b859,_0x54c414){return db[_0x3738('0x4e')][_0x3738('0x42')]({'where':{'id':_0x240629['params']['id']}})[_0x3738('0x24')](handleEntityNotFound(_0x46b859,null))[_0x3738('0x24')](function(_0x45a547){if(_0x45a547){return _0x45a547[_0x3738('0x4d')](_0x240629[_0x3738('0x44')][_0x3738('0x4f')],_[_0x3738('0x50')](_0x240629[_0x3738('0x44')],[_0x3738('0x4f'),'id'])||{});}})[_0x3738('0x24')](respondWithResult(_0x46b859,null))['catch'](handleError(_0x46b859,null));};exports['getContacts']=function(_0x5978cc,_0x5c96bc,_0x1111a6){var _0x4ce982={};var _0x87845={};var _0x2f6fca;var _0x183f81;return db[_0x3738('0x2d')]['findOne']({'where':{'id':_0x5978cc['params']['id']}})[_0x3738('0x24')](handleEntityNotFound(_0x5c96bc,null))[_0x3738('0x24')](function(_0x18fb60){if(_0x18fb60){_0x2f6fca=_0x18fb60;_0x87845[_0x3738('0x2e')]=_[_0x3738('0x2f')](db[_0x3738('0x4e')][_0x3738('0x51')]);_0x87845['query']=_[_0x3738('0x2f')](_0x5978cc[_0x3738('0x30')]);_0x87845['filters']=_[_0x3738('0x32')](_0x87845[_0x3738('0x2e')],_0x87845['query']);_0x4ce982[_0x3738('0x33')]=_[_0x3738('0x32')](_0x87845[_0x3738('0x2e')],qs[_0x3738('0x34')](_0x5978cc[_0x3738('0x30')][_0x3738('0x34')]));_0x4ce982[_0x3738('0x33')]=_0x4ce982['attributes'][_0x3738('0x35')]?_0x4ce982[_0x3738('0x33')]:_0x87845[_0x3738('0x2e')];_0x4ce982['order']=qs[_0x3738('0x38')](_0x5978cc['query']['sort']);_0x4ce982[_0x3738('0x39')]=qs[_0x3738('0x31')](_[_0x3738('0x52')](_0x5978cc[_0x3738('0x30')],_0x87845[_0x3738('0x31')]));if(_0x5978cc[_0x3738('0x30')][_0x3738('0x3a')]){_0x4ce982[_0x3738('0x39')]=_[_0x3738('0x3b')](_0x4ce982['where'],{'$or':_[_0x3738('0x3c')](_0x4ce982[_0x3738('0x33')],function(_0x3b8d19){var _0x273e24={};_0x273e24[_0x3b8d19]={'$like':'%'+_0x5978cc['query'][_0x3738('0x3a')]+'%'};return _0x273e24;})});}_0x4ce982=_[_0x3738('0x3b')]({},_0x4ce982,_0x5978cc[_0x3738('0x3d')]);return _0x2f6fca[_0x3738('0x53')](_0x4ce982);}})[_0x3738('0x24')](function(_0x8f9074){if(_0x8f9074){_0x183f81=_0x8f9074[_0x3738('0x35')];if(!_0x5978cc[_0x3738('0x30')][_0x3738('0x54')]('nolimit')){_0x4ce982[_0x3738('0x1d')]=qs[_0x3738('0x1d')](_0x5978cc[_0x3738('0x30')][_0x3738('0x1d')]);_0x4ce982[_0x3738('0x1b')]=qs[_0x3738('0x1b')](_0x5978cc[_0x3738('0x30')][_0x3738('0x1b')]);}return _0x2f6fca[_0x3738('0x53')](_0x4ce982);}})[_0x3738('0x24')](function(_0x5b77d6){if(_0x5b77d6){return _0x5b77d6?{'count':_0x183f81,'rows':_0x5b77d6}:null;}})[_0x3738('0x24')](respondWithResult(_0x5c96bc,null))['catch'](handleError(_0x5c96bc,null));};
\ No newline at end of file
+var _0x51b5=['undefined','limit','count','set','Content-Range','apply','save','then','get','Companies','UserProfileResource','destroy','sendStatus','error','name','CmCompany','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','includeAll','include','rows','show','rawAttributes','find','create','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','catch','addContacts','CmContact','ids','omit','options','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x51b5,0x17f));var _0x551b=function(_0x43b5c2,_0x5cd7c7){_0x43b5c2=_0x43b5c2-0x0;var _0x14943a=_0x51b5[_0x43b5c2];return _0x14943a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x551b('0x0'));var zipdir=require(_0x551b('0x1'));var jsonpatch=require(_0x551b('0x2'));var rp=require(_0x551b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x551b('0x4'));var util=require(_0x551b('0x5'));var path=require(_0x551b('0x6'));var sox=require(_0x551b('0x7'));var csv=require(_0x551b('0x8'));var ejs=require(_0x551b('0x9'));var fs=require('fs');var fs_extra=require(_0x551b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x551b('0xb'));var jsforce=require(_0x551b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x551b('0xd'));var Papa=require(_0x551b('0xe'));var Redis=require(_0x551b('0xf'));var authService=require(_0x551b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x551b('0x11'));var hardwareService=require(_0x551b('0x12'));var logger=require('../../config/logger')(_0x551b('0x13'));var utils=require(_0x551b('0x14'));var config=require(_0x551b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x551b('0x16'))['db'];function respondWithStatusCode(_0x936de,_0xf5bc99){_0xf5bc99=_0xf5bc99||0xcc;return function(_0x4f6b0b){if(_0x4f6b0b){return _0x936de['sendStatus'](_0xf5bc99);}return _0x936de['status'](_0xf5bc99)[_0x551b('0x17')]();};}function respondWithResult(_0x260ddd,_0x4e17e9){_0x4e17e9=_0x4e17e9||0xc8;return function(_0x424e87){if(_0x424e87){return _0x260ddd[_0x551b('0x18')](_0x4e17e9)[_0x551b('0x19')](_0x424e87);}};}function respondWithFilteredResult(_0x1e54dc,_0x232a7d){return function(_0x1e2959){if(_0x1e2959){var _0x27642e=typeof _0x232a7d[_0x551b('0x1a')]===_0x551b('0x1b')&&typeof _0x232a7d[_0x551b('0x1c')]===_0x551b('0x1b');var _0x44959e=_0x1e2959[_0x551b('0x1d')];var _0x138982=_0x27642e?0x0:_0x232a7d[_0x551b('0x1a')];var _0x58a7ea=_0x27642e?_0x1e2959['count']:_0x232a7d['offset']+_0x232a7d[_0x551b('0x1c')];var _0x326b8c;if(_0x58a7ea>=_0x44959e){_0x58a7ea=_0x44959e;_0x326b8c=0xc8;}else{_0x326b8c=0xce;}_0x1e54dc[_0x551b('0x18')](_0x326b8c);return _0x1e54dc[_0x551b('0x1e')](_0x551b('0x1f'),_0x138982+'-'+_0x58a7ea+'/'+_0x44959e)[_0x551b('0x19')](_0x1e2959);}return null;};}function patchUpdates(_0x1c60d6){return function(_0x4c7d0f){try{jsonpatch[_0x551b('0x20')](_0x4c7d0f,_0x1c60d6,!![]);}catch(_0x3f97ea){return BPromise['reject'](_0x3f97ea);}return _0x4c7d0f[_0x551b('0x21')]();};}function saveUpdates(_0x1fad8a,_0x312c94){return function(_0x34f19){if(_0x34f19){return _0x34f19['update'](_0x1fad8a)['then'](function(_0x81aec5){return _0x81aec5;});}return null;};}function removeEntity(_0x38e453,_0x2f9e66){return function(_0x2198b9){if(_0x2198b9){return _0x2198b9['destroy']()[_0x551b('0x22')](function(){var _0x3b521b=_0x2198b9[_0x551b('0x23')]({'plain':!![]});var _0x3f01b3=_0x551b('0x24');return db[_0x551b('0x25')][_0x551b('0x26')]({'where':{'type':_0x3f01b3,'resourceId':_0x3b521b['id']}})[_0x551b('0x22')](function(){return _0x2198b9;});})['then'](function(){_0x38e453[_0x551b('0x18')](0xcc)[_0x551b('0x17')]();});}};}function handleEntityNotFound(_0x406f31,_0x49af8b){return function(_0xdb3e47){if(!_0xdb3e47){_0x406f31[_0x551b('0x27')](0x194);}return _0xdb3e47;};}function handleError(_0x292bc3,_0x1cbe6c){_0x1cbe6c=_0x1cbe6c||0x1f4;return function(_0x911d2f){logger[_0x551b('0x28')](_0x911d2f['stack']);if(_0x911d2f[_0x551b('0x29')]){delete _0x911d2f[_0x551b('0x29')];}_0x292bc3[_0x551b('0x18')](_0x1cbe6c)['send'](_0x911d2f);};}exports['index']=function(_0x46150c,_0x2ab726){var _0x4e2689={},_0x41ea53={},_0x2675cc={'count':0x0,'rows':[]};return db[_0x551b('0x2a')][_0x551b('0x2b')]()['then'](function(_0x5c9a19){_0x41ea53[_0x551b('0x2c')]=_[_0x551b('0x2d')](_0x5c9a19);_0x41ea53[_0x551b('0x2e')]=_[_0x551b('0x2d')](_0x46150c[_0x551b('0x2e')]);_0x41ea53[_0x551b('0x2f')]=_[_0x551b('0x30')](_0x41ea53[_0x551b('0x2c')],_0x41ea53[_0x551b('0x2e')]);_0x4e2689['attributes']=_[_0x551b('0x30')](_0x41ea53[_0x551b('0x2c')],qs[_0x551b('0x31')](_0x46150c[_0x551b('0x2e')]['fields']));_0x4e2689[_0x551b('0x32')]=_0x4e2689[_0x551b('0x32')][_0x551b('0x33')]?_0x4e2689[_0x551b('0x32')]:_0x41ea53[_0x551b('0x2c')];if(!_0x46150c[_0x551b('0x2e')][_0x551b('0x34')](_0x551b('0x35'))){_0x4e2689['limit']=qs[_0x551b('0x1c')](_0x46150c[_0x551b('0x2e')][_0x551b('0x1c')]);_0x4e2689[_0x551b('0x1a')]=qs['offset'](_0x46150c[_0x551b('0x2e')][_0x551b('0x1a')]);}_0x4e2689[_0x551b('0x36')]=qs[_0x551b('0x37')](_0x46150c[_0x551b('0x2e')][_0x551b('0x37')]);_0x4e2689[_0x551b('0x38')]=qs[_0x551b('0x2f')](_[_0x551b('0x39')](_0x46150c[_0x551b('0x2e')],_0x41ea53['filters']),_0x5c9a19);if(_0x46150c[_0x551b('0x2e')][_0x551b('0x3a')]){_0x4e2689[_0x551b('0x38')]=_[_0x551b('0x3b')](_0x4e2689[_0x551b('0x38')],{'$or':_[_0x551b('0x3c')](_0x4e2689[_0x551b('0x32')],function(_0x20e9e9){var _0x486f2b={};_0x486f2b[_0x20e9e9]={'$like':'%'+_0x46150c[_0x551b('0x2e')]['filter']+'%'};return _0x486f2b;})});}_0x4e2689=_['merge']({},_0x4e2689,_0x46150c['options']);var _0x26ca63={'where':_0x4e2689['where']};return db[_0x551b('0x2a')][_0x551b('0x1d')](_0x26ca63)[_0x551b('0x22')](function(_0x103f9a){_0x2675cc[_0x551b('0x1d')]=_0x103f9a;if(_0x46150c[_0x551b('0x2e')][_0x551b('0x3d')]){_0x4e2689[_0x551b('0x3e')]=[{'all':!![]}];}return db[_0x551b('0x2a')]['findAll'](_0x4e2689);})[_0x551b('0x22')](function(_0x106d71){_0x2675cc[_0x551b('0x3f')]=_0x106d71;return _0x2675cc;})[_0x551b('0x22')](respondWithFilteredResult(_0x2ab726,_0x4e2689))['catch'](handleError(_0x2ab726,null));})['catch'](handleError(_0x2ab726,null));};exports[_0x551b('0x40')]=function(_0x569c90,_0x5d5625){var _0x1890cb={'raw':![],'where':{'id':_0x569c90['params']['id']}},_0x362ef1={};_0x362ef1[_0x551b('0x2c')]=_['keys'](db[_0x551b('0x2a')][_0x551b('0x41')]);_0x362ef1['query']=_[_0x551b('0x2d')](_0x569c90[_0x551b('0x2e')]);_0x362ef1[_0x551b('0x2f')]=_[_0x551b('0x30')](_0x362ef1[_0x551b('0x2c')],_0x362ef1['query']);_0x1890cb[_0x551b('0x32')]=_[_0x551b('0x30')](_0x362ef1[_0x551b('0x2c')],qs['fields'](_0x569c90[_0x551b('0x2e')]['fields']));_0x1890cb['attributes']=_0x1890cb['attributes'][_0x551b('0x33')]?_0x1890cb[_0x551b('0x32')]:_0x362ef1[_0x551b('0x2c')];if(_0x569c90[_0x551b('0x2e')][_0x551b('0x3d')]){_0x1890cb[_0x551b('0x3e')]=[{'all':!![]}];}_0x1890cb=_[_0x551b('0x3b')]({},_0x1890cb,_0x569c90['options']);return db[_0x551b('0x2a')][_0x551b('0x42')](_0x1890cb)[_0x551b('0x22')](handleEntityNotFound(_0x5d5625,null))['then'](respondWithResult(_0x5d5625,null))['catch'](handleError(_0x5d5625,null));};exports['create']=function(_0x24ba05,_0x15abb1){return db['CmCompany'][_0x551b('0x43')](_0x24ba05['body'],{})[_0x551b('0x22')](function(_0x29e549){var _0x20d1a8=_0x24ba05['user']['get']({'plain':!![]});if(!_0x20d1a8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20d1a8[_0x551b('0x44')]===_0x551b('0x45')){var _0x55279a=_0x29e549[_0x551b('0x23')]({'plain':!![]});var _0x54f85b='Companies';return db[_0x551b('0x46')]['find']({'where':{'name':_0x54f85b,'userProfileId':_0x20d1a8[_0x551b('0x47')]},'raw':!![]})[_0x551b('0x22')](function(_0x2d3db9){if(_0x2d3db9&&_0x2d3db9['autoAssociation']===0x0){return db[_0x551b('0x25')][_0x551b('0x43')]({'name':_0x55279a[_0x551b('0x29')],'resourceId':_0x55279a['id'],'type':_0x2d3db9[_0x551b('0x29')],'sectionId':_0x2d3db9['id']},{})[_0x551b('0x22')](function(){return _0x29e549;});}else{return _0x29e549;}})['catch'](function(_0x4f42f0){logger[_0x551b('0x28')](_0x551b('0x48'),_0x4f42f0);throw _0x4f42f0;});}return _0x29e549;})[_0x551b('0x22')](respondWithResult(_0x15abb1,0xc9))['catch'](handleError(_0x15abb1,null));};exports['update']=function(_0x5420d7,_0x175a9b){if(_0x5420d7['body']['id']){delete _0x5420d7[_0x551b('0x49')]['id'];}return db[_0x551b('0x2a')]['find']({'where':{'id':_0x5420d7[_0x551b('0x4a')]['id']}})[_0x551b('0x22')](handleEntityNotFound(_0x175a9b,null))[_0x551b('0x22')](saveUpdates(_0x5420d7[_0x551b('0x49')],null))[_0x551b('0x22')](respondWithResult(_0x175a9b,null))[_0x551b('0x4b')](handleError(_0x175a9b,null));};exports[_0x551b('0x26')]=function(_0xd6cea5,_0x29c17c){return db['CmCompany'][_0x551b('0x42')]({'where':{'id':_0xd6cea5[_0x551b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x29c17c,null))['then'](removeEntity(_0x29c17c,null))[_0x551b('0x4b')](handleError(_0x29c17c,null));};exports[_0x551b('0x2b')]=function(_0x294844,_0x9ec691){return db[_0x551b('0x2a')][_0x551b('0x2b')]()[_0x551b('0x22')](respondWithResult(_0x9ec691,null))[_0x551b('0x4b')](handleError(_0x9ec691,null));};exports[_0x551b('0x4c')]=function(_0x3e359b,_0x2b6402,_0x4816a3){return db[_0x551b('0x4d')][_0x551b('0x42')]({'where':{'id':_0x3e359b[_0x551b('0x4a')]['id']}})[_0x551b('0x22')](handleEntityNotFound(_0x2b6402,null))[_0x551b('0x22')](function(_0x5bad8a){if(_0x5bad8a){return _0x5bad8a[_0x551b('0x4c')](_0x3e359b[_0x551b('0x49')][_0x551b('0x4e')],_[_0x551b('0x4f')](_0x3e359b['body'],[_0x551b('0x4e'),'id'])||{});}})[_0x551b('0x22')](respondWithResult(_0x2b6402,null))[_0x551b('0x4b')](handleError(_0x2b6402,null));};exports['getContacts']=function(_0x30a17f,_0x5561fd,_0x4f9347){var _0x55d586={};var _0x4ae4b3={};var _0xb552e5;var _0x3731d0;return db[_0x551b('0x2a')]['findOne']({'where':{'id':_0x30a17f[_0x551b('0x4a')]['id']}})[_0x551b('0x22')](handleEntityNotFound(_0x5561fd,null))[_0x551b('0x22')](function(_0x4fef9e){if(_0x4fef9e){_0xb552e5=_0x4fef9e;_0x4ae4b3[_0x551b('0x2c')]=_[_0x551b('0x2d')](db[_0x551b('0x4d')][_0x551b('0x41')]);_0x4ae4b3[_0x551b('0x2e')]=_[_0x551b('0x2d')](_0x30a17f[_0x551b('0x2e')]);_0x4ae4b3['filters']=_[_0x551b('0x30')](_0x4ae4b3['model'],_0x4ae4b3[_0x551b('0x2e')]);_0x55d586[_0x551b('0x32')]=_[_0x551b('0x30')](_0x4ae4b3[_0x551b('0x2c')],qs[_0x551b('0x31')](_0x30a17f[_0x551b('0x2e')][_0x551b('0x31')]));_0x55d586[_0x551b('0x32')]=_0x55d586[_0x551b('0x32')]['length']?_0x55d586[_0x551b('0x32')]:_0x4ae4b3['model'];_0x55d586['order']=qs['sort'](_0x30a17f[_0x551b('0x2e')][_0x551b('0x37')]);_0x55d586[_0x551b('0x38')]=qs[_0x551b('0x2f')](_['pick'](_0x30a17f[_0x551b('0x2e')],_0x4ae4b3[_0x551b('0x2f')]));if(_0x30a17f['query'][_0x551b('0x3a')]){_0x55d586[_0x551b('0x38')]=_[_0x551b('0x3b')](_0x55d586['where'],{'$or':_[_0x551b('0x3c')](_0x55d586[_0x551b('0x32')],function(_0x781ddb){var _0x2987ee={};_0x2987ee[_0x781ddb]={'$like':'%'+_0x30a17f[_0x551b('0x2e')][_0x551b('0x3a')]+'%'};return _0x2987ee;})});}_0x55d586=_[_0x551b('0x3b')]({},_0x55d586,_0x30a17f[_0x551b('0x50')]);return _0xb552e5[_0x551b('0x51')](_0x55d586);}})[_0x551b('0x22')](function(_0x53e3f4){if(_0x53e3f4){_0x3731d0=_0x53e3f4[_0x551b('0x33')];if(!_0x30a17f[_0x551b('0x2e')]['hasOwnProperty']('nolimit')){_0x55d586[_0x551b('0x1c')]=qs[_0x551b('0x1c')](_0x30a17f[_0x551b('0x2e')][_0x551b('0x1c')]);_0x55d586['offset']=qs[_0x551b('0x1a')](_0x30a17f[_0x551b('0x2e')]['offset']);}return _0xb552e5[_0x551b('0x51')](_0x55d586);}})[_0x551b('0x22')](function(_0x55a782){if(_0x55a782){return _0x55a782?{'count':_0x3731d0,'rows':_0x55a782}:null;}})['then'](respondWithResult(_0x5561fd,null))[_0x551b('0x4b')](handleError(_0x5561fd,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 3f3abfe..f194581 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 _0x5c53=['bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','cm_companies','lodash','util','../../config/logger','api','moment'];(function(_0x16b6ea,_0x20248c){var _0xb288b7=function(_0x12ea4d){while(--_0x12ea4d){_0x16b6ea['push'](_0x16b6ea['shift']());}};_0xb288b7(++_0x20248c);}(_0x5c53,0x7d));var _0x35c5=function(_0x3965ae,_0x6847f7){_0x3965ae=_0x3965ae-0x0;var _0x491c04=_0x5c53[_0x3965ae];return _0x491c04;};'use strict';var _=require(_0x35c5('0x0'));var util=require(_0x35c5('0x1'));var logger=require(_0x35c5('0x2'))(_0x35c5('0x3'));var moment=require(_0x35c5('0x4'));var BPromise=require(_0x35c5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x35c5('0x6'));var rimraf=require(_0x35c5('0x7'));var config=require(_0x35c5('0x8'));var attributes=require(_0x35c5('0x9'));module[_0x35c5('0xa')]=function(_0x255819,_0x507d9b){return _0x255819[_0x35c5('0xb')]('CmCompany',attributes,{'tableName':_0x35c5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xafc6=['../../config/logger','api','moment','request-promise','path','../../config/environment','exports','CmCompany','lodash','util'];(function(_0x10efc1,_0x5d580d){var _0x122514=function(_0x444e90){while(--_0x444e90){_0x10efc1['push'](_0x10efc1['shift']());}};_0x122514(++_0x5d580d);}(_0xafc6,0x10c));var _0x6afc=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xafc6[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0x6afc('0x0'));var util=require(_0x6afc('0x1'));var logger=require(_0x6afc('0x2'))(_0x6afc('0x3'));var moment=require(_0x6afc('0x4'));var BPromise=require('bluebird');var rp=require(_0x6afc('0x5'));var fs=require('fs');var path=require(_0x6afc('0x6'));var rimraf=require('rimraf');var config=require(_0x6afc('0x7'));var attributes=require('./cmCompany.attributes');module[_0x6afc('0x8')]=function(_0x2f02a1,_0x5aa1e8){return _0x2f02a1['define'](_0x6afc('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 2d35924..a94ca5a 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 _0xcb37=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment'];(function(_0x9b03cc,_0x97006){var _0x27c284=function(_0x4e32e3){while(--_0x4e32e3){_0x9b03cc['push'](_0x9b03cc['shift']());}};_0x27c284(++_0x97006);}(_0xcb37,0x1cc));var _0x7cb3=function(_0x2c786e,_0x53b114){_0x2c786e=_0x2c786e-0x0;var _0x2b1c59=_0xcb37[_0x2c786e];return _0x2b1c59;};'use strict';var _=require('lodash');var util=require(_0x7cb3('0x0'));var moment=require(_0x7cb3('0x1'));var BPromise=require(_0x7cb3('0x2'));var rs=require(_0x7cb3('0x3'));var fs=require('fs');var Redis=require(_0x7cb3('0x4'));var db=require(_0x7cb3('0x5'))['db'];var utils=require(_0x7cb3('0x6'));var logger=require(_0x7cb3('0x7'))(_0x7cb3('0x8'));var config=require(_0x7cb3('0x9'));var jayson=require(_0x7cb3('0xa'));var client=jayson['client'][_0x7cb3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e66b3,_0x43aaec,_0x4f0099){return new BPromise(function(_0x44a3a2,_0x42ee5a){return client['request'](_0x3e66b3,_0x4f0099)['then'](function(_0x3ecfd6){logger[_0x7cb3('0xc')](_0x7cb3('0xd'),_0x43aaec,'request\x20sent');logger[_0x7cb3('0xe')](_0x7cb3('0xf'),_0x43aaec,_0x7cb3('0x10'),JSON[_0x7cb3('0x11')](_0x3ecfd6));if(_0x3ecfd6[_0x7cb3('0x12')]){if(_0x3ecfd6[_0x7cb3('0x12')][_0x7cb3('0x13')]===0x1f4){logger[_0x7cb3('0x12')](_0x7cb3('0xd'),_0x43aaec,_0x3ecfd6[_0x7cb3('0x12')][_0x7cb3('0x14')]);return _0x42ee5a(_0x3ecfd6[_0x7cb3('0x12')]['message']);}logger[_0x7cb3('0x12')](_0x7cb3('0xd'),_0x43aaec,_0x3ecfd6[_0x7cb3('0x12')]['message']);return _0x44a3a2(_0x3ecfd6[_0x7cb3('0x12')][_0x7cb3('0x14')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x43aaec,_0x7cb3('0x10'));_0x44a3a2(_0x3ecfd6[_0x7cb3('0x15')][_0x7cb3('0x14')]);}})['catch'](function(_0x3f076a){logger[_0x7cb3('0x12')]('CmCompany,\x20%s,\x20%s',_0x43aaec,_0x3f076a);_0x42ee5a(_0x3f076a);});});}
\ No newline at end of file
+var _0x70e8=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird'];(function(_0x2c2838,_0x334032){var _0x24899a=function(_0x1a6b48){while(--_0x1a6b48){_0x2c2838['push'](_0x2c2838['shift']());}};_0x24899a(++_0x334032);}(_0x70e8,0xab));var _0x870e=function(_0x22ecf6,_0x487db5){_0x22ecf6=_0x22ecf6-0x0;var _0x47cf2d=_0x70e8[_0x22ecf6];return _0x47cf2d;};'use strict';var _=require(_0x870e('0x0'));var util=require(_0x870e('0x1'));var moment=require(_0x870e('0x2'));var BPromise=require(_0x870e('0x3'));var rs=require(_0x870e('0x4'));var fs=require('fs');var Redis=require(_0x870e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x870e('0x6'));var logger=require(_0x870e('0x7'))(_0x870e('0x8'));var config=require(_0x870e('0x9'));var jayson=require(_0x870e('0xa'));var client=jayson[_0x870e('0xb')][_0x870e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55581d,_0x2befe3,_0x2bcb42){return new BPromise(function(_0xea28f7,_0x35fee7){return client[_0x870e('0xd')](_0x55581d,_0x2bcb42)[_0x870e('0xe')](function(_0x414bde){logger['info'](_0x870e('0xf'),_0x2befe3,'request\x20sent');logger[_0x870e('0x10')](_0x870e('0x11'),_0x2befe3,_0x870e('0x12'),JSON[_0x870e('0x13')](_0x414bde));if(_0x414bde[_0x870e('0x14')]){if(_0x414bde[_0x870e('0x14')][_0x870e('0x15')]===0x1f4){logger[_0x870e('0x14')](_0x870e('0xf'),_0x2befe3,_0x414bde[_0x870e('0x14')][_0x870e('0x16')]);return _0x35fee7(_0x414bde[_0x870e('0x14')][_0x870e('0x16')]);}logger['error'](_0x870e('0xf'),_0x2befe3,_0x414bde[_0x870e('0x14')][_0x870e('0x16')]);return _0xea28f7(_0x414bde[_0x870e('0x14')][_0x870e('0x16')]);}else{logger[_0x870e('0x17')](_0x870e('0xf'),_0x2befe3,_0x870e('0x12'));_0xea28f7(_0x414bde['result'][_0x870e('0x16')]);}})[_0x870e('0x18')](function(_0xdafee){logger[_0x870e('0x14')](_0x870e('0xf'),_0x2befe3,_0xdafee);_0x35fee7(_0xdafee);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index b5d9fbc..c350314 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 _0xe144=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','show','getContacts','create','post','/:id/contacts','addContacts','put','update','destroy','exports'];(function(_0x57a733,_0x4a4360){var _0x4816b0=function(_0xf62b54){while(--_0xf62b54){_0x57a733['push'](_0x57a733['shift']());}};_0x4816b0(++_0x4a4360);}(_0xe144,0x168));var _0x4e14=function(_0x39628c,_0x2eb8c4){_0x39628c=_0x39628c-0x0;var _0x2b0532=_0xe144[_0x39628c];return _0x2b0532;};'use strict';var multer=require(_0x4e14('0x0'));var util=require('util');var path=require(_0x4e14('0x1'));var timeout=require(_0x4e14('0x2'));var express=require(_0x4e14('0x3'));var router=express[_0x4e14('0x4')]();var fs_extra=require(_0x4e14('0x5'));var auth=require(_0x4e14('0x6'));var interaction=require(_0x4e14('0x7'));var config=require(_0x4e14('0x8'));var controller=require(_0x4e14('0x9'));router[_0x4e14('0xa')]('/',auth[_0x4e14('0xb')](),controller[_0x4e14('0xc')]);router[_0x4e14('0xa')]('/describe',auth[_0x4e14('0xb')](),controller[_0x4e14('0xd')]);router['get']('/:id',auth[_0x4e14('0xb')](),controller[_0x4e14('0xe')]);router[_0x4e14('0xa')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x4e14('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4e14('0x10')]);router[_0x4e14('0x11')](_0x4e14('0x12'),auth[_0x4e14('0xb')](),controller[_0x4e14('0x13')]);router[_0x4e14('0x14')]('/:id',auth[_0x4e14('0xb')](),controller[_0x4e14('0x15')]);router['delete']('/:id',auth[_0x4e14('0xb')](),controller[_0x4e14('0x16')]);module[_0x4e14('0x17')]=router;
\ No newline at end of file
+var _0xc672=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','/:id/contacts','post','create','update','delete','/:id','destroy','exports','util','connect-timeout','express','Router'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0xc672,0x13f));var _0x2c67=function(_0x39f9a4,_0x7e8513){_0x39f9a4=_0x39f9a4-0x0;var _0x3bd8fa=_0xc672[_0x39f9a4];return _0x3bd8fa;};'use strict';var multer=require('multer');var util=require(_0x2c67('0x0'));var path=require('path');var timeout=require(_0x2c67('0x1'));var express=require(_0x2c67('0x2'));var router=express[_0x2c67('0x3')]();var fs_extra=require(_0x2c67('0x4'));var auth=require(_0x2c67('0x5'));var interaction=require(_0x2c67('0x6'));var config=require(_0x2c67('0x7'));var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2c67('0x8')]);router[_0x2c67('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x2c67('0x9')]('/:id',auth[_0x2c67('0xa')](),controller['show']);router[_0x2c67('0x9')](_0x2c67('0xb'),auth[_0x2c67('0xa')](),controller['getContacts']);router[_0x2c67('0xc')]('/',auth[_0x2c67('0xa')](),controller[_0x2c67('0xd')]);router[_0x2c67('0xc')](_0x2c67('0xb'),auth[_0x2c67('0xa')](),controller['addContacts']);router['put']('/:id',auth[_0x2c67('0xa')](),controller[_0x2c67('0xe')]);router[_0x2c67('0xf')](_0x2c67('0x10'),auth[_0x2c67('0xa')](),controller[_0x2c67('0x11')]);module[_0x2c67('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 5a1f6db..b40916c 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 _0xcf74=['TEXT','INTEGER','UNSIGNED','DATE','NOW','sequelize','exports','STRING'];(function(_0x31a3eb,_0x365c03){var _0x38410a=function(_0x28a7a9){while(--_0x28a7a9){_0x31a3eb['push'](_0x31a3eb['shift']());}};_0x38410a(++_0x365c03);}(_0xcf74,0x125));var _0x4cf7=function(_0x2203f2,_0x474c4c){_0x2203f2=_0x2203f2-0x0;var _0x3ee091=_0xcf74[_0x2203f2];return _0x3ee091;};'use strict';var _=require('lodash');var Sequelize=require(_0x4cf7('0x0'));module[_0x4cf7('0x1')]={'firstName':{'type':Sequelize[_0x4cf7('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x4cf7('0x2')]},'postalCode':{'type':Sequelize[_0x4cf7('0x2')]},'city':{'type':Sequelize[_0x4cf7('0x2')]},'country':{'type':Sequelize[_0x4cf7('0x2')]},'dateOfBirth':{'type':Sequelize[_0x4cf7('0x2')]},'description':{'type':Sequelize[_0x4cf7('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x4cf7('0x2')]},'email':{'type':Sequelize[_0x4cf7('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x4cf7('0x2')]},'fb_data':{'type':Sequelize[_0x4cf7('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x4cf7('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x4cf7('0x2')]},'line':{'type':Sequelize[_0x4cf7('0x2')]},'wechat':{'type':Sequelize[_0x4cf7('0x2')]},'telegram':{'type':Sequelize[_0x4cf7('0x2')]},'UserId':{'type':Sequelize[_0x4cf7('0x4')]},'priority':{'type':Sequelize[_0x4cf7('0x4')](0x2)[_0x4cf7('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4cf7('0x6')],'defaultValue':Sequelize[_0x4cf7('0x7')]}};
\ No newline at end of file
+var _0x56c4=['DATE','NOW','lodash','sequelize','STRING','INTEGER','UNSIGNED'];(function(_0x14a4d0,_0x4c7068){var _0x18c8ab=function(_0x10bd3b){while(--_0x10bd3b){_0x14a4d0['push'](_0x14a4d0['shift']());}};_0x18c8ab(++_0x4c7068);}(_0x56c4,0x72));var _0x456c=function(_0x399895,_0x52e3e2){_0x399895=_0x399895-0x0;var _0xa8818e=_0x56c4[_0x399895];return _0xa8818e;};'use strict';var _=require(_0x456c('0x0'));var Sequelize=require(_0x456c('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x456c('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x456c('0x2')]},'street':{'type':Sequelize[_0x456c('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x456c('0x2')]},'country':{'type':Sequelize[_0x456c('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x456c('0x2')]},'fax':{'type':Sequelize[_0x456c('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x456c('0x2')]},'facebook':{'type':Sequelize[_0x456c('0x2')]},'fb_data':{'type':Sequelize[_0x456c('0x2')]},'twitter':{'type':Sequelize[_0x456c('0x2')]},'skype':{'type':Sequelize[_0x456c('0x2')]},'teams':{'type':Sequelize[_0x456c('0x2')]},'viber':{'type':Sequelize[_0x456c('0x2')]},'line':{'type':Sequelize[_0x456c('0x2')]},'wechat':{'type':Sequelize[_0x456c('0x2')]},'telegram':{'type':Sequelize[_0x456c('0x2')]},'UserId':{'type':Sequelize[_0x456c('0x3')]},'priority':{'type':Sequelize[_0x456c('0x3')](0x2)[_0x456c('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x456c('0x5')],'defaultValue':Sequelize[_0x456c('0x6')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index a5e62b8..ede667a 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 _0x7101=['left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','parseSearch','search','sqlOperator','conditions','field','Tag','value','split','map','forEach','union','User','dateOfBirth','fieldType','castTo','DATE','buildExpression','type','text','hasOwnProperty','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','filter','replace','getFullTextValue','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','Sequelize','SELECT','clone','c.id','DESC','having','t.id\x20IN\x20?','resolve','user','role','some','getLists','c.ListId\x20IS\x20NULL','agent','sequelize','toString','count','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','find','tags','columnName','displayName','findAll','values','body','get','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','MailQueueReport','SmsQueueReport','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','findOrCreate','spread','show','$and','isNil','omit','format','pickBy','cf_%d','table','cm_contacts','setFields','id\x20=\x20?','params','toParam','phone','getTags','rawAttributes','pick','ContactId','includeAll','include','getHopperHistories','getHopperFinals','options','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','0777','fork','binding_keys','CompanyId','createReadStream','file','meta','import','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','stringify','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','getJourney','mail','sms','whatsapp','voice','-createdAt','includes','channel','toLowerCase','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','userDisposition','userThirdDisposition','fullname','alias','createdAt','findAndCountAll','Account','closedAt','disposition','secondDisposition','thirdDisposition','UserId','key','chat','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','startCase','Interaction','Owner','flatten','sortBy','reverse','bluebird','util','path','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','redis','socket.io-emitter','./cmContact.socket','register','status','offset','undefined','limit','set','Content-Range','json','update','destroy','then','end','sendStatus','stack','name','send','index','CmContact','describe','keys','length','startsWith','push','CmCustomField','findOne','trimStart','cf_','all','query','filters','intersection','attributes','model','fields','nolimit','order','sort','where','color','from','tools_tags','select','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id'];(function(_0x5a83ef,_0xfe8300){var _0x3913cd=function(_0xcb8a24){while(--_0xcb8a24){_0x5a83ef['push'](_0x5a83ef['shift']());}};_0x3913cd(++_0xfe8300);}(_0x7101,0xdf));var _0x1710=function(_0x383627,_0x5be16e){_0x383627=_0x383627-0x0;var _0x2c16a0=_0x7101[_0x383627];return _0x2c16a0;};'use strict';var moment=require('moment');var BPromise=require(_0x1710('0x0'));var util=require(_0x1710('0x1'));var path=require(_0x1710('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1710('0x3'));var Papa=require(_0x1710('0x4'));var Redis=require(_0x1710('0x5'));var qs=require(_0x1710('0x6'));var as=require(_0x1710('0x7'));var logger=require(_0x1710('0x8'))('api');var config=require(_0x1710('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x1710('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1710('0xb'))(new Redis(config[_0x1710('0xa')]));require(_0x1710('0xc'))[_0x1710('0xd')](socket);function respondWithResult(_0x4d1602,_0x4e501c){_0x4e501c=_0x4e501c||0xc8;return function(_0x2992be){if(_0x2992be){return _0x4d1602[_0x1710('0xe')](_0x4e501c)['json'](_0x2992be);}};}function respondWithFilteredResult(_0xf927c7,_0x36b1bc){return function(_0x156bd1){if(_0x156bd1){var _0x24a0aa=typeof _0x36b1bc[_0x1710('0xf')]===_0x1710('0x10')&&typeof _0x36b1bc[_0x1710('0x11')]===_0x1710('0x10');var _0x1cb371=_0x156bd1['count'];var _0x31e98c=_0x24a0aa?0x0:_0x36b1bc['offset'];var _0xad654f=_0x24a0aa?_0x156bd1['count']:_0x36b1bc[_0x1710('0xf')]+_0x36b1bc['limit'];var _0x4ef516;if(_0xad654f>=_0x1cb371){_0xad654f=_0x1cb371;_0x4ef516=0xc8;}else{_0x4ef516=0xce;}_0xf927c7['status'](_0x4ef516);return _0xf927c7[_0x1710('0x12')](_0x1710('0x13'),_0x31e98c+'-'+_0xad654f+'/'+_0x1cb371)[_0x1710('0x14')](_0x156bd1);}return null;};}function saveUpdates(_0x3de4d5){return function(_0x1bfb08){if(_0x1bfb08){return _0x1bfb08[_0x1710('0x15')](_0x3de4d5)['then'](function(_0x27cabb){return _0x27cabb;});}return null;};}function removeEntity(_0x31352d){return function(_0x32e480){if(_0x32e480){return _0x32e480[_0x1710('0x16')]()[_0x1710('0x17')](function(){_0x31352d['status'](0xcc)[_0x1710('0x18')]();});}};}function handleEntityNotFound(_0x4d870d){return function(_0x325f07){if(!_0x325f07){_0x4d870d[_0x1710('0x19')](0x194);}return _0x325f07;};}function handleError(_0x289d9b,_0x3eb05c){_0x3eb05c=_0x3eb05c||0x1f4;return function(_0x32b890){logger['error'](_0x32b890[_0x1710('0x1a')]);if(_0x32b890[_0x1710('0x1b')]){delete _0x32b890[_0x1710('0x1b')];}_0x289d9b[_0x1710('0xe')](_0x3eb05c)[_0x1710('0x1c')](_0x32b890);};}exports[_0x1710('0x1d')]=function(_0x394e8d,_0x3b9e08){var _0xe4fd79={},_0x3fe3b2={},_0x2c07a3={'count':0x0,'rows':[]};return db[_0x1710('0x1e')][_0x1710('0x1f')]()[_0x1710('0x17')](function(_0x47964b){var _0x5740e5=[];for(var _0xff1975=0x0;_0xff1975
','Attachments','gmail','imap.gmail.com','yahoo'];(function(_0x426ff4,_0x6cd359){var _0x4a6ddc=function(_0x3a9211){while(--_0x3a9211){_0x426ff4['push'](_0x426ff4['shift']());}};_0x4a6ddc(++_0x6cd359);}(_0x0c3a,0x171));var _0xa0c3=function(_0x16cb49,_0x531ce8){_0x16cb49=_0x16cb49-0x0;var _0x53d3e0=_0x0c3a[_0x16cb49];return _0x53d3e0;};'use strict';var _=require(_0xa0c3('0x0'));var moment=require(_0xa0c3('0x1'));var random=require(_0xa0c3('0x2'));var fs=require('fs');var path=require(_0xa0c3('0x3'));var util=require(_0xa0c3('0x4'));var tnef=require(_0xa0c3('0x5'));var logger=require(_0xa0c3('0x6'))('email');var config=require(_0xa0c3('0x7'));function getAddress(_0x11e5d4){var _0x5d79bc=_[_0xa0c3('0x8')](_0x11e5d4[_0xa0c3('0x9')]);return _0x5d79bc&&_0x5d79bc['address']?_0x5d79bc[_0xa0c3('0xa')]:'anonymous'+random['generate'](0x6)+_0xa0c3('0xb');}function getFirstName(_0x109c9a){var _0x3b524a=_[_0xa0c3('0x8')](_0x109c9a['value']);if(_0x3b524a&&_0x3b524a[_0xa0c3('0xc')]){if(_0x3b524a[_0xa0c3('0xc')]==_0x3b524a['address']){return _0x3b524a['name'][_0xa0c3('0xd')](0x0,_0x3b524a[_0xa0c3('0xc')]['indexOf']('@'));}var _0x30522f=_0x3b524a[_0xa0c3('0xc')][_0xa0c3('0xe')](/\s+/);return _0x30522f['length']>0x1?_0x30522f[_0xa0c3('0xf')](0x0,-0x1)[_0xa0c3('0x10')]('\x20'):_0x3b524a['name'];}return'Anonymous';}function getLastName(_0x2de54f){var _0x2452d8=_[_0xa0c3('0x8')](_0x2de54f[_0xa0c3('0x9')]);if(_0x2452d8&&_0x2452d8[_0xa0c3('0xc')]){var _0x4bbfcf=_0x2452d8[_0xa0c3('0xc')]['split'](/\s+/);return _0x4bbfcf[_0xa0c3('0x11')]>0x1?_0x4bbfcf['pop']():'';}return'';}function getMails(_0x49983c,_0x4d5c8a){var _0xd70a2b='';for(var _0x474695=0x0;_0x474695<_0x4d5c8a[_0xa0c3('0x9')]['length'];_0x474695+=0x1){if(_0x4d5c8a[_0xa0c3('0x9')][_0x474695][_0xa0c3('0xa')]!==_0x49983c){if(!_[_0xa0c3('0x12')](_0xd70a2b)){_0xd70a2b+=',';}_0xd70a2b+=_0x4d5c8a[_0xa0c3('0x9')][_0x474695][_0xa0c3('0xc')]||_0x4d5c8a[_0xa0c3('0x9')][_0x474695][_0xa0c3('0xa')]||'';_0xd70a2b+='\x20<';_0xd70a2b+=_0x4d5c8a['value'][_0x474695][_0xa0c3('0xa')]?_0x4d5c8a['value'][_0x474695][_0xa0c3('0xa')]:_0xa0c3('0x13')+random[_0xa0c3('0x14')](0x6)+_0xa0c3('0xb');_0xd70a2b+='>';}}return _0xd70a2b;}function parseEmail(_0x53111d,_0x91fd9f,_0x2be9eb){if(_0x91fd9f[_0xa0c3('0x15')]){var _0x1a1c0b=/