From: Andrea Bianco
Date: Mon, 26 Jul 2021 16:23:48 +0000 (+0200)
Subject: Built motion from commit (unavailable).|2.6.0
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=348f4998a270994f4fc2c377de677e0adf9ee2b5;p=motion2.git
Built motion from commit (unavailable).|2.6.0
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 867e70e..b7ca8d2 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-07-22T20:54:17.192Z",
+ "time": "2021-07-26T16:16:30.348Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 9110cb3..6e0d862 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-07-22T20:54:17.192Z",
+ "time": "2021-07-26T16:16:30.348Z",
"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 7873102..0f392d6 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 _0x0c67=['getDataValue','action','STRING','contactManager','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','exports'];(function(_0x235fc5,_0xac5c59){var _0x43e315=function(_0x5b8d91){while(--_0x5b8d91){_0x235fc5['push'](_0x235fc5['shift']());}};_0x43e315(++_0xac5c59);}(_0x0c67,0xd7));var _0x70c6=function(_0x37c43c,_0x2bfc5b){_0x37c43c=_0x37c43c-0x0;var _0x5964b7=_0x0c67[_0x37c43c];return _0x5964b7;};'use strict';var Sequelize=require('sequelize');module[_0x70c6('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x35f429){return this[_0x70c6('0x1')](_0x70c6('0x2'));}},'action':{'type':Sequelize[_0x70c6('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x70c6('0x4'),'integration','motionbar',_0x70c6('0x5'),'urlForward',_0x70c6('0x6'),'bot',_0x70c6('0x7')]],'msg':_0x70c6('0x8')}},'comment':_0x70c6('0x8')},'data1':{'type':Sequelize[_0x70c6('0x3')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0x70c6('0x3')](0x1000),'comment':_0x70c6('0x9')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x70c6('0xa')},'data4':{'type':Sequelize[_0x70c6('0x3')](0x1000)},'data5':{'type':Sequelize[_0x70c6('0x3')](0x1000)},'data6':{'type':Sequelize[_0x70c6('0x3')]},'data7':{'type':Sequelize[_0x70c6('0xb')]}};
\ No newline at end of file
+var _0x6004=['bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','browser'];(function(_0x2e852e,_0x5150b2){var _0x4439a2=function(_0x28b482){while(--_0x28b482){_0x2e852e['push'](_0x2e852e['shift']());}};_0x4439a2(++_0x5150b2);}(_0x6004,0x9b));var _0x4600=function(_0x406459,_0x2a5eae){_0x406459=_0x406459-0x0;var _0x6895c3=_0x6004[_0x406459];return _0x6895c3;};'use strict';var Sequelize=require(_0x4600('0x0'));module[_0x4600('0x1')]={'name':{'type':Sequelize[_0x4600('0x2')],'get':function(_0x3ccc58){return this[_0x4600('0x3')](_0x4600('0x4'));}},'action':{'type':Sequelize[_0x4600('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x4600('0x6'),_0x4600('0x7'),_0x4600('0x8'),'jscripty','urlForward',_0x4600('0x9'),_0x4600('0xa'),_0x4600('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x4600('0xc')},'data1':{'type':Sequelize[_0x4600('0x5')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0x4600('0x5')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x4600('0xd')},'data4':{'type':Sequelize[_0x4600('0x5')](0x1000)},'data5':{'type':Sequelize[_0x4600('0x5')](0x1000)},'data6':{'type':Sequelize[_0x4600('0x5')]},'data7':{'type':Sequelize[_0x4600('0xe')]}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index ca9e85c..3351876 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 _0x861a=['undefined','offset','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','body','Action','find','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit'];(function(_0x4f293a,_0x29666d){var _0x2a7f60=function(_0x2f8dcd){while(--_0x2f8dcd){_0x4f293a['push'](_0x4f293a['shift']());}};_0x2a7f60(++_0x29666d);}(_0x861a,0x194));var _0xa861=function(_0x2411f9,_0x39a0f5){_0x2411f9=_0x2411f9-0x0;var _0x5ab105=_0x861a[_0x2411f9];return _0x5ab105;};'use strict';var emlformat=require(_0xa861('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa861('0x1'));var jsonpatch=require(_0xa861('0x2'));var rp=require(_0xa861('0x3'));var moment=require(_0xa861('0x4'));var BPromise=require(_0xa861('0x5'));var Mustache=require(_0xa861('0x6'));var util=require('util');var path=require(_0xa861('0x7'));var sox=require(_0xa861('0x8'));var csv=require(_0xa861('0x9'));var ejs=require(_0xa861('0xa'));var fs=require('fs');var fs_extra=require(_0xa861('0xb'));var _=require('lodash');var squel=require(_0xa861('0xc'));var crypto=require(_0xa861('0xd'));var jsforce=require(_0xa861('0xe'));var deskjs=require(_0xa861('0xf'));var toCsv=require(_0xa861('0x9'));var querystring=require(_0xa861('0x10'));var Papa=require(_0xa861('0x11'));var Redis=require(_0xa861('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa861('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa861('0x14'));var utils=require(_0xa861('0x15'));var config=require(_0xa861('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa861('0x17'))['db'];function respondWithStatusCode(_0xf01095,_0x44c425){_0x44c425=_0x44c425||0xcc;return function(_0x35f59b){if(_0x35f59b){return _0xf01095[_0xa861('0x18')](_0x44c425);}return _0xf01095['status'](_0x44c425)['end']();};}function respondWithResult(_0x8b05bd,_0x4df9aa){_0x4df9aa=_0x4df9aa||0xc8;return function(_0x4a7f27){if(_0x4a7f27){return _0x8b05bd[_0xa861('0x19')](_0x4df9aa)[_0xa861('0x1a')](_0x4a7f27);}};}function respondWithFilteredResult(_0x405e23,_0xb5ce78){return function(_0x4792d3){if(_0x4792d3){var _0x2e69c1=typeof _0xb5ce78['offset']==='undefined'&&typeof _0xb5ce78[_0xa861('0x1b')]===_0xa861('0x1c');var _0x18c897=_0x4792d3['count'];var _0xc85eb3=_0x2e69c1?0x0:_0xb5ce78[_0xa861('0x1d')];var _0x2cbdae=_0x2e69c1?_0x4792d3[_0xa861('0x1e')]:_0xb5ce78[_0xa861('0x1d')]+_0xb5ce78['limit'];var _0x20e465;if(_0x2cbdae>=_0x18c897){_0x2cbdae=_0x18c897;_0x20e465=0xc8;}else{_0x20e465=0xce;}_0x405e23[_0xa861('0x19')](_0x20e465);return _0x405e23[_0xa861('0x1f')](_0xa861('0x20'),_0xc85eb3+'-'+_0x2cbdae+'/'+_0x18c897)[_0xa861('0x1a')](_0x4792d3);}return null;};}function patchUpdates(_0x52ca65){return function(_0x398e49){try{jsonpatch[_0xa861('0x21')](_0x398e49,_0x52ca65,!![]);}catch(_0x2437ad){return BPromise['reject'](_0x2437ad);}return _0x398e49[_0xa861('0x22')]();};}function saveUpdates(_0x353299,_0x58270d){return function(_0x24e305){if(_0x24e305){return _0x24e305[_0xa861('0x23')](_0x353299)[_0xa861('0x24')](function(_0x53d561){return _0x53d561;});}return null;};}function removeEntity(_0x3fd022,_0x225d1f){return function(_0x59bc73){if(_0x59bc73){return _0x59bc73[_0xa861('0x25')]()[_0xa861('0x24')](function(){_0x3fd022['status'](0xcc)[_0xa861('0x26')]();});}};}function handleEntityNotFound(_0x133c81,_0x1653a1){return function(_0x598b72){if(!_0x598b72){_0x133c81[_0xa861('0x18')](0x194);}return _0x598b72;};}function handleError(_0x358915,_0x364589){_0x364589=_0x364589||0x1f4;return function(_0x2176d3){logger[_0xa861('0x27')](_0x2176d3[_0xa861('0x28')]);if(_0x2176d3[_0xa861('0x29')]){delete _0x2176d3['name'];}_0x358915[_0xa861('0x19')](_0x364589)[_0xa861('0x2a')](_0x2176d3);};}exports[_0xa861('0x23')]=function(_0x58a58c,_0x332f41){if(_0x58a58c[_0xa861('0x2b')]['id']){delete _0x58a58c[_0xa861('0x2b')]['id'];}return db[_0xa861('0x2c')][_0xa861('0x2d')]({'where':{'id':_0x58a58c[_0xa861('0x2e')]['id']}})['then'](handleEntityNotFound(_0x332f41,null))['then'](saveUpdates(_0x58a58c['body'],null))[_0xa861('0x24')](respondWithResult(_0x332f41,null))['catch'](handleError(_0x332f41,null));};exports[_0xa861('0x25')]=function(_0x31481a,_0x22ae63){return db[_0xa861('0x2c')]['find']({'where':{'id':_0x31481a[_0xa861('0x2e')]['id']}})[_0xa861('0x24')](handleEntityNotFound(_0x22ae63,null))[_0xa861('0x24')](removeEntity(_0x22ae63,null))[_0xa861('0x2f')](handleError(_0x22ae63,null));};
\ No newline at end of file
+var _0x43e4=['error','stack','name','send','body','Action','find','then','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus'];(function(_0x59e821,_0x86c723){var _0x5333f6=function(_0x5dc2c9){while(--_0x5dc2c9){_0x59e821['push'](_0x59e821['shift']());}};_0x5333f6(++_0x86c723);}(_0x43e4,0x15a));var _0x443e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x43e4[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x443e('0x0'));var rimraf=require(_0x443e('0x1'));var zipdir=require(_0x443e('0x2'));var jsonpatch=require(_0x443e('0x3'));var rp=require(_0x443e('0x4'));var moment=require(_0x443e('0x5'));var BPromise=require(_0x443e('0x6'));var Mustache=require(_0x443e('0x7'));var util=require(_0x443e('0x8'));var path=require(_0x443e('0x9'));var sox=require(_0x443e('0xa'));var csv=require(_0x443e('0xb'));var ejs=require(_0x443e('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x443e('0xd'));var squel=require(_0x443e('0xe'));var crypto=require(_0x443e('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x443e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x443e('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x443e('0x12'));var qs=require(_0x443e('0x13'));var as=require(_0x443e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x443e('0x15'));var utils=require(_0x443e('0x16'));var config=require(_0x443e('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39503a,_0x54f36a){_0x54f36a=_0x54f36a||0xcc;return function(_0x35e86f){if(_0x35e86f){return _0x39503a['sendStatus'](_0x54f36a);}return _0x39503a['status'](_0x54f36a)[_0x443e('0x18')]();};}function respondWithResult(_0x5d929c,_0x3af126){_0x3af126=_0x3af126||0xc8;return function(_0xc02f11){if(_0xc02f11){return _0x5d929c[_0x443e('0x19')](_0x3af126)['json'](_0xc02f11);}};}function respondWithFilteredResult(_0x4fb024,_0x4f2c8a){return function(_0x1143e4){if(_0x1143e4){var _0x5e1160=typeof _0x4f2c8a[_0x443e('0x1a')]===_0x443e('0x1b')&&typeof _0x4f2c8a[_0x443e('0x1c')]===_0x443e('0x1b');var _0x13167f=_0x1143e4[_0x443e('0x1d')];var _0x53bc15=_0x5e1160?0x0:_0x4f2c8a[_0x443e('0x1a')];var _0x510247=_0x5e1160?_0x1143e4[_0x443e('0x1d')]:_0x4f2c8a['offset']+_0x4f2c8a[_0x443e('0x1c')];var _0x41aba0;if(_0x510247>=_0x13167f){_0x510247=_0x13167f;_0x41aba0=0xc8;}else{_0x41aba0=0xce;}_0x4fb024['status'](_0x41aba0);return _0x4fb024[_0x443e('0x1e')](_0x443e('0x1f'),_0x53bc15+'-'+_0x510247+'/'+_0x13167f)['json'](_0x1143e4);}return null;};}function patchUpdates(_0x267e9c){return function(_0x23e5cc){try{jsonpatch[_0x443e('0x20')](_0x23e5cc,_0x267e9c,!![]);}catch(_0x5f197f){return BPromise[_0x443e('0x21')](_0x5f197f);}return _0x23e5cc[_0x443e('0x22')]();};}function saveUpdates(_0x43a9c6,_0x464cd2){return function(_0x4f67f8){if(_0x4f67f8){return _0x4f67f8[_0x443e('0x23')](_0x43a9c6)['then'](function(_0x33cc04){return _0x33cc04;});}return null;};}function removeEntity(_0x50471a,_0x5bc94f){return function(_0x39aff7){if(_0x39aff7){return _0x39aff7[_0x443e('0x24')]()['then'](function(){_0x50471a[_0x443e('0x19')](0xcc)[_0x443e('0x18')]();});}};}function handleEntityNotFound(_0x3f45b1,_0x315ebe){return function(_0x4664b1){if(!_0x4664b1){_0x3f45b1[_0x443e('0x25')](0x194);}return _0x4664b1;};}function handleError(_0x4dfa7b,_0x195bbb){_0x195bbb=_0x195bbb||0x1f4;return function(_0x10525a){logger[_0x443e('0x26')](_0x10525a[_0x443e('0x27')]);if(_0x10525a[_0x443e('0x28')]){delete _0x10525a[_0x443e('0x28')];}_0x4dfa7b[_0x443e('0x19')](_0x195bbb)[_0x443e('0x29')](_0x10525a);};}exports[_0x443e('0x23')]=function(_0x30b6d0,_0x4d7882){if(_0x30b6d0['body']['id']){delete _0x30b6d0[_0x443e('0x2a')]['id'];}return db[_0x443e('0x2b')][_0x443e('0x2c')]({'where':{'id':_0x30b6d0['params']['id']}})[_0x443e('0x2d')](handleEntityNotFound(_0x4d7882,null))[_0x443e('0x2d')](saveUpdates(_0x30b6d0[_0x443e('0x2a')],null))[_0x443e('0x2d')](respondWithResult(_0x4d7882,null))[_0x443e('0x2e')](handleError(_0x4d7882,null));};exports[_0x443e('0x24')]=function(_0x2fe1f7,_0x2ab526){return db[_0x443e('0x2b')][_0x443e('0x2c')]({'where':{'id':_0x2fe1f7[_0x443e('0x2f')]['id']}})[_0x443e('0x2d')](handleEntityNotFound(_0x2ab526,null))[_0x443e('0x2d')](removeEntity(_0x2ab526,null))['catch'](handleError(_0x2ab526,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 438c51f..03d82f0 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 _0x29e5=['exports','define','Action','tools_actions','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x11a6c2,_0x501fdf){var _0x46f007=function(_0x59104e){while(--_0x59104e){_0x11a6c2['push'](_0x11a6c2['shift']());}};_0x46f007(++_0x501fdf);}(_0x29e5,0xb8));var _0x529e=function(_0x86d5c,_0x4f0973){_0x86d5c=_0x86d5c-0x0;var _0xf88676=_0x29e5[_0x86d5c];return _0xf88676;};'use strict';var _=require(_0x529e('0x0'));var util=require(_0x529e('0x1'));var logger=require('../../config/logger')(_0x529e('0x2'));var moment=require(_0x529e('0x3'));var BPromise=require('bluebird');var rp=require(_0x529e('0x4'));var fs=require('fs');var path=require(_0x529e('0x5'));var rimraf=require(_0x529e('0x6'));var config=require(_0x529e('0x7'));var attributes=require('./action.attributes');module[_0x529e('0x8')]=function(_0xa53f8f,_0x42c228){return _0xa53f8f[_0x529e('0x9')](_0x529e('0xa'),attributes,{'tableName':_0x529e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3941=['rimraf','../../config/environment','exports','define','Action','tools_actions','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x329c4b,_0x5a3104){var _0x410817=function(_0x175c1f){while(--_0x175c1f){_0x329c4b['push'](_0x329c4b['shift']());}};_0x410817(++_0x5a3104);}(_0x3941,0x165));var _0x1394=function(_0x2c8304,_0x4c2201){_0x2c8304=_0x2c8304-0x0;var _0x3d458a=_0x3941[_0x2c8304];return _0x3d458a;};'use strict';var _=require('lodash');var util=require(_0x1394('0x0'));var logger=require(_0x1394('0x1'))(_0x1394('0x2'));var moment=require(_0x1394('0x3'));var BPromise=require(_0x1394('0x4'));var rp=require(_0x1394('0x5'));var fs=require('fs');var path=require(_0x1394('0x6'));var rimraf=require(_0x1394('0x7'));var config=require(_0x1394('0x8'));var attributes=require('./action.attributes');module[_0x1394('0x9')]=function(_0x185371,_0x3ebaf5){return _0x185371[_0x1394('0xa')](_0x1394('0xb'),attributes,{'tableName':_0x1394('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 2a4ae5c..b7c1b1a 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 _0x0713=['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/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1249fe,_0x1d03b3){var _0x8e5a5c=function(_0x1f792c){while(--_0x1f792c){_0x1249fe['push'](_0x1249fe['shift']());}};_0x8e5a5c(++_0x1d03b3);}(_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 moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
+var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s'];(function(_0x208af4,_0x363ee5){var _0x4b53c5=function(_0x27e40d){while(--_0x27e40d){_0x208af4['push'](_0x208af4['shift']());}};_0x4b53c5(++_0x363ee5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0xcb91[_0x5756c6];return _0x4b5806;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('Action,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 7832de4..e17365b 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 _0xbd5c=['../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4193d2,_0x4a3447){var _0x53db9a=function(_0x170a9b){while(--_0x170a9b){_0x4193d2['push'](_0x4193d2['shift']());}};_0x53db9a(++_0x4a3447);}(_0xbd5c,0x19d));var _0xcbd5=function(_0x3b6c3a,_0x19ab5e){_0x3b6c3a=_0x3b6c3a-0x0;var _0x2d9586=_0xbd5c[_0x3b6c3a];return _0x2d9586;};'use strict';var multer=require(_0xcbd5('0x0'));var util=require(_0xcbd5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcbd5('0x2'));var router=express[_0xcbd5('0x3')]();var fs_extra=require(_0xcbd5('0x4'));var auth=require(_0xcbd5('0x5'));var interaction=require(_0xcbd5('0x6'));var config=require(_0xcbd5('0x7'));var controller=require(_0xcbd5('0x8'));router[_0xcbd5('0x9')](_0xcbd5('0xa'),auth[_0xcbd5('0xb')](),controller['update']);router[_0xcbd5('0xc')](_0xcbd5('0xa'),auth[_0xcbd5('0xb')](),controller[_0xcbd5('0xd')]);module[_0xcbd5('0xe')]=router;
\ No newline at end of file
+var _0x71a6=['delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','update'];(function(_0x2dffd7,_0x50e766){var _0x55e83f=function(_0x1cf727){while(--_0x1cf727){_0x2dffd7['push'](_0x2dffd7['shift']());}};_0x55e83f(++_0x50e766);}(_0x71a6,0xa8));var _0x671a=function(_0x470e67,_0x4a596d){_0x470e67=_0x470e67-0x0;var _0x28bbde=_0x71a6[_0x470e67];return _0x28bbde;};'use strict';var multer=require(_0x671a('0x0'));var util=require(_0x671a('0x1'));var path=require(_0x671a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x671a('0x3')]();var fs_extra=require(_0x671a('0x4'));var auth=require(_0x671a('0x5'));var interaction=require(_0x671a('0x6'));var config=require('../../config/environment');var controller=require(_0x671a('0x7'));router[_0x671a('0x8')](_0x671a('0x9'),auth[_0x671a('0xa')](),controller[_0x671a('0xb')]);router[_0x671a('0xc')]('/:id',auth[_0x671a('0xa')](),controller[_0x671a('0xd')]);module[_0x671a('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index e5ed772..ff439be 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 _0x264c=['TEXT','sequelize','exports','STRING'];(function(_0x40ce01,_0x1e39c8){var _0xa0f16e=function(_0x2356ad){while(--_0x2356ad){_0x40ce01['push'](_0x40ce01['shift']());}};_0xa0f16e(++_0x1e39c8);}(_0x264c,0x9d));var _0xc264=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x264c[_0x2283dc];return _0x16db90;};'use strict';var Sequelize=require(_0xc264('0x0'));module[_0xc264('0x1')]={'name':{'type':Sequelize[_0xc264('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc264('0x2')]},'parent':{'type':Sequelize[_0xc264('0x2')]},'table':{'type':Sequelize[_0xc264('0x2')]},'conditions':{'type':Sequelize[_0xc264('0x3')]},'joins':{'type':Sequelize[_0xc264('0x3')]}};
\ No newline at end of file
+var _0x83a8=['exports','STRING','TEXT','sequelize'];(function(_0x438470,_0x2e1585){var _0x550434=function(_0x48dad5){while(--_0x48dad5){_0x438470['push'](_0x438470['shift']());}};_0x550434(++_0x2e1585);}(_0x83a8,0xb7));var _0x883a=function(_0x1c333d,_0x530ffc){_0x1c333d=_0x1c333d-0x0;var _0x2aa0ba=_0x83a8[_0x1c333d];return _0x2aa0ba;};'use strict';var Sequelize=require(_0x883a('0x0'));module[_0x883a('0x1')]={'name':{'type':Sequelize[_0x883a('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x883a('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x883a('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index b5dee2e..2a28faa 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 _0xb10b=['offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','CustomReports','UserProfileResource','sendStatus','error','stack','name','send','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','catch','params','keys','find','create','body','user','role','get','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','table','MetricId','metric','function','replace','format','orderBy','order','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','AVG(%s)','GROUP_CONCAT(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','value','getFields','from','groupBy','fullPath','%s-%s.%s','generate','output','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','select','findAll','debug','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','dbH','status','end','json'];(function(_0x267a2d,_0x4f46e9){var _0x42057c=function(_0x5a56c9){while(--_0x5a56c9){_0x267a2d['push'](_0x267a2d['shift']());}};_0x42057c(++_0x4f46e9);}(_0xb10b,0x12a));var _0xbb10=function(_0x1db153,_0x1ab5d){_0x1db153=_0x1db153-0x0;var _0x530cbe=_0xb10b[_0x1db153];return _0x530cbe;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];var dbH=require(_0xbb10('0x17'))[_0xbb10('0x18')];function respondWithStatusCode(_0x193a27,_0x442548){_0x442548=_0x442548||0xcc;return function(_0x147230){if(_0x147230){return _0x193a27['sendStatus'](_0x442548);}return _0x193a27[_0xbb10('0x19')](_0x442548)[_0xbb10('0x1a')]();};}function respondWithResult(_0x45b9d6,_0x17fd46){_0x17fd46=_0x17fd46||0xc8;return function(_0x3df17b){if(_0x3df17b){return _0x45b9d6[_0xbb10('0x19')](_0x17fd46)[_0xbb10('0x1b')](_0x3df17b);}};}function respondWithFilteredResult(_0x36b5e8,_0x3e26f4){return function(_0x2b184e){if(_0x2b184e){var _0x4a2bfc=typeof _0x3e26f4[_0xbb10('0x1c')]===_0xbb10('0x1d')&&typeof _0x3e26f4[_0xbb10('0x1e')]===_0xbb10('0x1d');var _0x378da8=_0x2b184e[_0xbb10('0x1f')];var _0x575cca=_0x4a2bfc?0x0:_0x3e26f4[_0xbb10('0x1c')];var _0xbf2906=_0x4a2bfc?_0x2b184e[_0xbb10('0x1f')]:_0x3e26f4['offset']+_0x3e26f4[_0xbb10('0x1e')];var _0x19f48d;if(_0xbf2906>=_0x378da8){_0xbf2906=_0x378da8;_0x19f48d=0xc8;}else{_0x19f48d=0xce;}_0x36b5e8[_0xbb10('0x19')](_0x19f48d);return _0x36b5e8[_0xbb10('0x20')](_0xbb10('0x21'),_0x575cca+'-'+_0xbf2906+'/'+_0x378da8)[_0xbb10('0x1b')](_0x2b184e);}return null;};}function patchUpdates(_0x4deb49){return function(_0x12f888){try{jsonpatch[_0xbb10('0x22')](_0x12f888,_0x4deb49,!![]);}catch(_0x50aea1){return BPromise['reject'](_0x50aea1);}return _0x12f888[_0xbb10('0x23')]();};}function saveUpdates(_0x311abe,_0x2e911d){return function(_0x317da4){if(_0x317da4){return _0x317da4[_0xbb10('0x24')](_0x311abe)[_0xbb10('0x25')](function(_0x407cb4){return _0x407cb4;});}return null;};}function removeEntity(_0x436104,_0x7f2377){return function(_0x395404){if(_0x395404){return _0x395404[_0xbb10('0x26')]()[_0xbb10('0x25')](function(){var _0x537898=_0x395404['get']({'plain':!![]});var _0x4fb5e0=_0xbb10('0x27');return db[_0xbb10('0x28')][_0xbb10('0x26')]({'where':{'type':_0x4fb5e0,'resourceId':_0x537898['id']}})['then'](function(){return _0x395404;});})[_0xbb10('0x25')](function(){_0x436104[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1d5e95,_0x1acce9){return function(_0x20d946){if(!_0x20d946){_0x1d5e95[_0xbb10('0x29')](0x194);}return _0x20d946;};}function handleError(_0x4aabb9,_0x3796c7){_0x3796c7=_0x3796c7||0x1f4;return function(_0x21ac54){logger[_0xbb10('0x2a')](_0x21ac54[_0xbb10('0x2b')]);if(_0x21ac54[_0xbb10('0x2c')]){delete _0x21ac54[_0xbb10('0x2c')];}_0x4aabb9['status'](_0x3796c7)[_0xbb10('0x2d')](_0x21ac54);};}exports['index']=function(_0x448d5c,_0x56f2da){var _0x16ad2a={},_0x1dcc9c={},_0x1b59f9={'count':0x0,'rows':[]};var _0x491db4=_['map'](db[_0xbb10('0x2e')][_0xbb10('0x2f')],function(_0x4f590d){return{'name':_0x4f590d[_0xbb10('0x30')],'type':_0x4f590d[_0xbb10('0x31')][_0xbb10('0x32')]};});_0x1dcc9c[_0xbb10('0x33')]=_[_0xbb10('0x34')](_0x491db4,_0xbb10('0x2c'));_0x1dcc9c[_0xbb10('0x35')]=_['keys'](_0x448d5c[_0xbb10('0x35')]);_0x1dcc9c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x1dcc9c[_0xbb10('0x33')],_0x1dcc9c[_0xbb10('0x35')]);_0x16ad2a[_0xbb10('0x38')]=_[_0xbb10('0x37')](_0x1dcc9c[_0xbb10('0x33')],qs[_0xbb10('0x39')](_0x448d5c['query'][_0xbb10('0x39')]));_0x16ad2a[_0xbb10('0x38')]=_0x16ad2a[_0xbb10('0x38')][_0xbb10('0x3a')]?_0x16ad2a['attributes']:_0x1dcc9c[_0xbb10('0x33')];if(!_0x448d5c['query']['hasOwnProperty'](_0xbb10('0x3b'))){_0x16ad2a[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x448d5c[_0xbb10('0x35')][_0xbb10('0x1e')]);_0x16ad2a[_0xbb10('0x1c')]=qs['offset'](_0x448d5c[_0xbb10('0x35')][_0xbb10('0x1c')]);}_0x16ad2a['order']=qs['sort'](_0x448d5c['query'][_0xbb10('0x3c')]);_0x16ad2a[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x448d5c[_0xbb10('0x35')],_0x1dcc9c[_0xbb10('0x36')]),_0x491db4);if(_0x448d5c[_0xbb10('0x35')]['filter']){_0x16ad2a[_0xbb10('0x3d')]=_[_0xbb10('0x3e')](_0x16ad2a[_0xbb10('0x3d')],{'$or':_[_0xbb10('0x34')](_0x491db4,function(_0x4f1cdd){if(_0x4f1cdd[_0xbb10('0x31')]!==_0xbb10('0x3f')){var _0x5835fd={};_0x5835fd[_0x4f1cdd[_0xbb10('0x2c')]]={'$like':'%'+_0x448d5c[_0xbb10('0x35')][_0xbb10('0x40')]+'%'};return _0x5835fd;}})});}_0x16ad2a=_[_0xbb10('0x3e')]({},_0x16ad2a,_0x448d5c[_0xbb10('0x41')]);var _0x185a52={'where':_0x16ad2a['where']};return db[_0xbb10('0x2e')][_0xbb10('0x1f')](_0x185a52)[_0xbb10('0x25')](function(_0x3d3c41){_0x1b59f9['count']=_0x3d3c41;if(_0x448d5c[_0xbb10('0x35')][_0xbb10('0x42')]){_0x16ad2a[_0xbb10('0x43')]=[{'all':!![]}];}return db[_0xbb10('0x2e')]['findAll'](_0x16ad2a);})[_0xbb10('0x25')](function(_0x202c60){_0x1b59f9['rows']=_0x202c60;return _0x1b59f9;})['then'](respondWithFilteredResult(_0x56f2da,_0x16ad2a))[_0xbb10('0x44')](handleError(_0x56f2da,null));};exports['show']=function(_0x318984,_0x180933){var _0x4c66d8={'raw':![],'where':{'id':_0x318984[_0xbb10('0x45')]['id']}},_0x366608={};_0x366608[_0xbb10('0x33')]=_['keys'](db[_0xbb10('0x2e')][_0xbb10('0x2f')]);_0x366608[_0xbb10('0x35')]=_[_0xbb10('0x46')](_0x318984[_0xbb10('0x35')]);_0x366608[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x366608[_0xbb10('0x33')],_0x366608[_0xbb10('0x35')]);_0x4c66d8[_0xbb10('0x38')]=_[_0xbb10('0x37')](_0x366608[_0xbb10('0x33')],qs['fields'](_0x318984[_0xbb10('0x35')][_0xbb10('0x39')]));_0x4c66d8['attributes']=_0x4c66d8[_0xbb10('0x38')][_0xbb10('0x3a')]?_0x4c66d8[_0xbb10('0x38')]:_0x366608[_0xbb10('0x33')];if(_0x318984[_0xbb10('0x35')][_0xbb10('0x42')]){_0x4c66d8[_0xbb10('0x43')]=[{'all':!![]}];}_0x4c66d8=_['merge']({},_0x4c66d8,_0x318984['options']);return db[_0xbb10('0x2e')][_0xbb10('0x47')](_0x4c66d8)[_0xbb10('0x25')](handleEntityNotFound(_0x180933,null))['then'](respondWithResult(_0x180933,null))['catch'](handleError(_0x180933,null));};exports[_0xbb10('0x48')]=function(_0x34cf4e,_0x1bd054){return db[_0xbb10('0x2e')][_0xbb10('0x48')](_0x34cf4e[_0xbb10('0x49')],{})[_0xbb10('0x25')](function(_0x460788){var _0x2626d8=_0x34cf4e[_0xbb10('0x4a')]['get']({'plain':!![]});if(!_0x2626d8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2626d8[_0xbb10('0x4b')]===_0xbb10('0x4a')){var _0x36ab7d=_0x460788[_0xbb10('0x4c')]({'plain':!![]});var _0x36aa7d=_0xbb10('0x4d');return db[_0xbb10('0x4e')][_0xbb10('0x47')]({'where':{'name':_0x36aa7d,'userProfileId':_0x2626d8[_0xbb10('0x4f')]},'raw':!![]})[_0xbb10('0x25')](function(_0x19ca3e){if(_0x19ca3e&&_0x19ca3e[_0xbb10('0x50')]===0x0){return db[_0xbb10('0x28')][_0xbb10('0x48')]({'name':_0x36ab7d[_0xbb10('0x2c')],'resourceId':_0x36ab7d['id'],'type':'CustomReports','sectionId':_0x19ca3e['id']},{})[_0xbb10('0x25')](function(){return _0x460788;});}else{return _0x460788;}})['catch'](function(_0x33d60a){logger[_0xbb10('0x2a')](_0xbb10('0x51'),_0x33d60a);throw _0x33d60a;});}return _0x460788;})[_0xbb10('0x25')](respondWithResult(_0x1bd054,0xc9))[_0xbb10('0x44')](handleError(_0x1bd054,null));};exports[_0xbb10('0x24')]=function(_0x2e3326,_0x44eec1){if(_0x2e3326[_0xbb10('0x49')]['id']){delete _0x2e3326[_0xbb10('0x49')]['id'];}return db[_0xbb10('0x2e')][_0xbb10('0x47')]({'where':{'id':_0x2e3326[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x44eec1,null))[_0xbb10('0x25')](saveUpdates(_0x2e3326['body'],null))[_0xbb10('0x25')](respondWithResult(_0x44eec1,null))[_0xbb10('0x44')](handleError(_0x44eec1,null));};exports[_0xbb10('0x26')]=function(_0x4ce8e7,_0xbffa3c){return db[_0xbb10('0x2e')]['find']({'where':{'id':_0x4ce8e7[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0xbffa3c,null))[_0xbb10('0x25')](removeEntity(_0xbffa3c,null))[_0xbb10('0x44')](handleError(_0xbffa3c,null));};exports[_0xbb10('0x52')]=function(_0x22de7f,_0x175872){var _0x12ec18=0xa;var _0x205e01=[_0xbb10('0x53'),_0xbb10('0x54'),_0xbb10('0x55'),_0xbb10('0x56')];var _0x4e7fac={'SUM':'SUM(%s)','COUNT':_0xbb10('0x57'),'COUNT DISTINCT':_0xbb10('0x58'),'MAX':_0xbb10('0x59'),'MIN':_0xbb10('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbb10('0x5b'),'GROUP_CONCAT DESC':_0xbb10('0x5c')};var _0x410bef={'SEC_TO_TIME':_0xbb10('0x5d'),'DATE':_0xbb10('0x5e'),'HOUR':_0xbb10('0x5f'),'ROUND':_0xbb10('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x117e84=function(_0x216cff){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xbb10('0x61'),_0xbb10('0x62')],_0x216cff);};var _0x155dc5=function(_0x5bd1c0){if(!_0x5bd1c0||!_0x5bd1c0['rules']['length']){return'';}for(var _0x3ebc5f='(',_0x249b33=0x0;_0x249b33<_0x5bd1c0[_0xbb10('0x63')]['length'];_0x249b33+=0x1){_0x249b33>0x0&&(_0x3ebc5f+='\x20'+_0x5bd1c0[_0xbb10('0x64')]+'\x20');_0x3ebc5f+=_0x5bd1c0[_0xbb10('0x63')][_0x249b33]['group']?_0x155dc5(_0x5bd1c0['rules'][_0x249b33][_0xbb10('0x65')]):_0x5bd1c0[_0xbb10('0x63')][_0x249b33][_0xbb10('0x66')]+'\x20'+_0x5bd1c0[_0xbb10('0x63')][_0x249b33]['condition']+(_0x117e84(_0x5bd1c0[_0xbb10('0x63')][_0x249b33][_0xbb10('0x67')])?'\x20'+_0x5bd1c0[_0xbb10('0x63')][_0x249b33]['value']:'');}return _0x3ebc5f+')';};var _0x402a01={'where':{'id':_0x22de7f[_0xbb10('0x45')]['id']}},_0x2f05bc,_0x3e3617,_0x5b2bd4,_0x2ca491,_0x31e85e;_0x402a01=_[_0xbb10('0x3e')]({},_0x402a01,_0x22de7f['options']);return db[_0xbb10('0x2e')][_0xbb10('0x47')](_0x402a01)[_0xbb10('0x25')](function(_0x2d0f4b){if(_0x2d0f4b){_0x2f05bc=_0x2d0f4b;return _0x2d0f4b['getFields']();}return null;})[_0xbb10('0x25')](function(_0x277fe7){if(_0x277fe7){if(!_0x277fe7[_0xbb10('0x3a')]){throw new db[(_0xbb10('0x68'))][(_0xbb10('0x69'))](_0xbb10('0x6a'),0x193);}_0x3e3617=_0x277fe7;return db[_0xbb10('0x6b')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x5acd5e){if(_0x5acd5e){_0x5b2bd4=_[_0xbb10('0x6c')](_0x5acd5e,'id');var _0x9c672d;var _0x3eda96=squel['select']();_0x3eda96['from'](_0x2f05bc[_0xbb10('0x6d')]);for(var _0x1b11c0=0x0;_0x1b11c0<_0x3e3617[_0xbb10('0x3a')];_0x1b11c0+=0x1){_0x9c672d=_0x3e3617[_0x1b11c0][_0xbb10('0x6e')]?_0x5b2bd4[_0x3e3617[_0x1b11c0][_0xbb10('0x6e')]][_0xbb10('0x6f')]:_0x3e3617[_0x1b11c0]['field'];_0x9c672d=_0x3e3617[_0x1b11c0][_0xbb10('0x70')]?_[_0xbb10('0x71')](_0x4e7fac[_0x3e3617[_0x1b11c0][_0xbb10('0x70')]],'%s',_0x9c672d):_0x9c672d;_0x9c672d=_0x3e3617[_0x1b11c0][_0xbb10('0x72')]?_[_0xbb10('0x71')](_0x410bef[_0x3e3617[_0x1b11c0]['format']],'%s',_0x9c672d):_0x9c672d;if(_0x3e3617[_0x1b11c0]['groupBy']){_0x3eda96['group'](_0x9c672d);}_0x3e3617[_0x1b11c0][_0xbb10('0x73')]&&_0x3eda96[_0xbb10('0x74')](_0x9c672d,_0x3e3617[_0x1b11c0][_0xbb10('0x73')]===_0xbb10('0x75')?![]:!![]);_0x3eda96[_0xbb10('0x66')](_0x9c672d,_0x3e3617[_0x1b11c0][_0xbb10('0x76')]||_0x9c672d);}if(_0x2f05bc['joins']){_0x2f05bc[_0xbb10('0x77')]=JSON['parse'](_0x2f05bc['joins']);for(var _0x519a54=0x0;_0x519a54<_0x2f05bc[_0xbb10('0x77')][_0xbb10('0x3a')];_0x519a54+=0x1){if(_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x31')]&&_['includes'](_0x205e01,_0x2f05bc[_0xbb10('0x77')][_0x519a54]['type'])&&_0x2f05bc['joins'][_0x519a54][_0xbb10('0x78')]&&_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x79')]&&_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x7a')]){_0x3eda96[_0x2f05bc['joins'][_0x519a54][_0xbb10('0x31')]](_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x79')],null,util[_0xbb10('0x72')](_0xbb10('0x7b'),_0x2f05bc[_0xbb10('0x6d')],_0x2f05bc[_0xbb10('0x77')][_0x519a54]['parentKey'],_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x79')],_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x7a')]));}}}if(_0x2f05bc[_0xbb10('0x7c')]){_0x2f05bc[_0xbb10('0x7c')]=JSON[_0xbb10('0x7d')](_0x2f05bc[_0xbb10('0x7c')]);_0x3eda96['where'](_0x155dc5(_0x2f05bc[_0xbb10('0x7c')][_0xbb10('0x65')]));}_0x31e85e=_0x3eda96[_0xbb10('0x7e')]();_0x3eda96['limit'](_0x12ec18);_0x3eda96['offset'](0x0);logger['debug'](_0xbb10('0x7f'),_0x3eda96['toString']());return dbH['sequelize'][_0xbb10('0x35')](_0x3eda96[_0xbb10('0x80')](),{'type':dbH[_0xbb10('0x81')][_0xbb10('0x82')][_0xbb10('0x83')]});}})[_0xbb10('0x25')](respondWithResult(_0x175872,null))[_0xbb10('0x44')](handleError(_0x175872,null));};function runReport(_0x417304,_0x188b97,_0x5206e1){var _0x318a14=_0x188b97[_0xbb10('0x2c')];var _0x46b6d2=0xa;var _0x35b811=['join','left_join',_0xbb10('0x55'),_0xbb10('0x56')];var _0x30f0a4={'SUM':_0xbb10('0x84'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xbb10('0x58'),'MAX':_0xbb10('0x59'),'MIN':_0xbb10('0x5a'),'AVG':_0xbb10('0x85'),'GROUP_CONCAT':_0xbb10('0x86'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x372636={'SEC_TO_TIME':_0xbb10('0x5d'),'DATE':_0xbb10('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0xbb10('0x60'),'UNIX_TIMESTAMP':_0xbb10('0x87')};var _0x50bcc9=function(_0x5caa06){return!_[_0xbb10('0x88')]([_0xbb10('0x89'),_0xbb10('0x8a'),'IS\x20EMPTY',_0xbb10('0x62')],_0x5caa06);};var _0x3a17fc=function(_0xfbb365){if(!_0xfbb365||!_0xfbb365[_0xbb10('0x63')][_0xbb10('0x3a')]){return'';}for(var _0x5de006='(',_0x45bd4e=0x0;_0x45bd4e<_0xfbb365[_0xbb10('0x63')][_0xbb10('0x3a')];_0x45bd4e+=0x1){_0x45bd4e>0x0&&(_0x5de006+='\x20'+_0xfbb365['operator']+'\x20');_0x5de006+=_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x65')]?_0x3a17fc(_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x65')]):_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x66')]+'\x20'+_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x67')]+(_0x50bcc9(_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x67')])?'\x20'+_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x8b')]:'');}return _0x5de006+')';};var _0x59e985={'where':{'id':_0x417304['id']}},_0x51f106,_0xe1fc51,_0x3fa344,_0x458615,_0x3fd367;_0x59e985=_[_0xbb10('0x3e')]({},_0x59e985,_0x5206e1);return db['AnalyticCustomReport'][_0xbb10('0x47')](_0x59e985)[_0xbb10('0x25')](function(_0x3b4d0b){if(_0x3b4d0b){_0x51f106=_0x3b4d0b;return _0x3b4d0b[_0xbb10('0x8c')]();}return null;})[_0xbb10('0x25')](function(_0x379d49){if(_0x379d49){if(!_0x379d49['length']){throw new db[(_0xbb10('0x68'))][(_0xbb10('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xe1fc51=_0x379d49;return db[_0xbb10('0x6b')]['findAll']({'raw':!![]});}return null;})[_0xbb10('0x25')](function(_0x28bd76){if(_0x28bd76){_0x3fa344=_[_0xbb10('0x6c')](_0x28bd76,'id');var _0xa99bf5;var _0x3a4a6e=squel['select']();_0x3a4a6e[_0xbb10('0x8d')](_0x51f106['table']);for(var _0x3fcc55=0x0;_0x3fcc55<_0xe1fc51[_0xbb10('0x3a')];_0x3fcc55+=0x1){_0xa99bf5=_0xe1fc51[_0x3fcc55]['MetricId']?_0x3fa344[_0xe1fc51[_0x3fcc55]['MetricId']][_0xbb10('0x6f')]:_0xe1fc51[_0x3fcc55][_0xbb10('0x66')];_0xa99bf5=_0xe1fc51[_0x3fcc55][_0xbb10('0x70')]?_[_0xbb10('0x71')](_0x30f0a4[_0xe1fc51[_0x3fcc55][_0xbb10('0x70')]],'%s',_0xa99bf5):_0xa99bf5;_0xa99bf5=_0xe1fc51[_0x3fcc55][_0xbb10('0x72')]?_[_0xbb10('0x71')](_0x372636[_0xe1fc51[_0x3fcc55][_0xbb10('0x72')]],'%s',_0xa99bf5):_0xa99bf5;if(_0xe1fc51[_0x3fcc55][_0xbb10('0x8e')]){_0x3a4a6e[_0xbb10('0x65')](_0xa99bf5);}_0xe1fc51[_0x3fcc55][_0xbb10('0x73')]&&_0x3a4a6e['order'](_0xa99bf5,_0xe1fc51[_0x3fcc55][_0xbb10('0x73')]===_0xbb10('0x75')?![]:!![]);_0x3a4a6e[_0xbb10('0x66')](_0xa99bf5,_0xe1fc51[_0x3fcc55][_0xbb10('0x76')]||_0xa99bf5);}if(_0x51f106[_0xbb10('0x77')]){_0x51f106[_0xbb10('0x77')]=JSON[_0xbb10('0x7d')](_0x51f106[_0xbb10('0x77')]);for(var _0x3e6fe2=0x0;_0x3e6fe2<_0x51f106[_0xbb10('0x77')][_0xbb10('0x3a')];_0x3e6fe2+=0x1){if(_0x51f106[_0xbb10('0x77')][_0x3e6fe2]['type']&&_[_0xbb10('0x88')](_0x35b811,_0x51f106['joins'][_0x3e6fe2][_0xbb10('0x31')])&&_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x78')]&&_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x79')]&&_0x51f106['joins'][_0x3e6fe2][_0xbb10('0x7a')]){_0x3a4a6e[_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x31')]](_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x79')],null,util[_0xbb10('0x72')]('%s.%s\x20=\x20%s.%s',_0x51f106['table'],_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x78')],_0x51f106[_0xbb10('0x77')][_0x3e6fe2]['foreignTable'],_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x7a')]));}}}if(_0x51f106['conditions']){_0x51f106[_0xbb10('0x7c')]=JSON[_0xbb10('0x7d')](_0x51f106['conditions']);_0x3a4a6e[_0xbb10('0x3d')](_0x3a17fc(_0x51f106['conditions'][_0xbb10('0x65')]));}_0x3fd367=_0x3a4a6e[_0xbb10('0x7e')]();_0x3a4a6e['limit'](_0x46b6d2);_0x3a4a6e[_0xbb10('0x1c')](0x0);return;}})[_0xbb10('0x25')](function(){if(_0x188b97['output']==='web'){return null;}var _0xea6bf2=_[_0xbb10('0x3e')](_0x188b97,{'name':_0x188b97[_0xbb10('0x8f')]||_0x188b97[_0xbb10('0x2c')]||_0x51f106[_0xbb10('0x2c')],'basename':_0x318a14,'savename':util['format'](_0xbb10('0x90'),_0x188b97[_0xbb10('0x2c')]||_0x51f106[_0xbb10('0x2c')],require('randomstring')[_0xbb10('0x91')](0x4),_0x188b97[_0xbb10('0x92')]||_0xbb10('0x93')),'reportId':_0x51f106['id'],'reportType':_0xbb10('0x94')});return db[_0xbb10('0x95')][_0xbb10('0x48')](_0xea6bf2,{'raw':!![]});})[_0xbb10('0x25')](function(_0x189f07){if(_0x51f106[_0xbb10('0x6d')]==='cdr'){_0x3fd367['where'](_0x51f106[_0xbb10('0x6d')]+_0xbb10('0x96'),_0x188b97[_0xbb10('0x97')],_0x188b97[_0xbb10('0x98')]);}else{_0x3fd367[_0xbb10('0x3d')](_0x51f106[_0xbb10('0x6d')]+_0xbb10('0x99'),_0x188b97[_0xbb10('0x97')],_0x188b97[_0xbb10('0x98')]);}if(_0x189f07){logger[_0xbb10('0x9a')](_0xbb10('0x9b'),_0x3fd367[_0xbb10('0x80')]());require(_0xbb10('0x9c'))['fork'](path[_0xbb10('0x53')](__dirname,_0xbb10('0x9d'),_0x189f07[_0xbb10('0x92')]),[_0x189f07['id'],_0x3fd367[_0xbb10('0x80')](),path[_0xbb10('0x53')](__dirname,_0xbb10('0x9e'),_0x189f07[_0xbb10('0x9f')]),_0x318a14]);return _0x189f07;}else{var _0x1421e2=squel[_0xbb10('0xa0')]();_0x1421e2[_0xbb10('0x8d')]('('+_0x3fd367[_0xbb10('0x80')]()+')','countTable');_0x1421e2[_0xbb10('0x66')]('COUNT(*)',_0xbb10('0x1f'));_0x3fd367[_0xbb10('0x1e')](_0x188b97[_0xbb10('0x1e')]||_0x46b6d2);_0x3fd367[_0xbb10('0x1c')](_0x188b97[_0xbb10('0x1c')]||0x0);return dbH[_0xbb10('0x81')]['query'](_0x1421e2[_0xbb10('0x80')](),{'type':dbH['sequelize'][_0xbb10('0x82')][_0xbb10('0x83')]})[_0xbb10('0x25')](function(_0x576bb6){if(!_0x576bb6[_0xbb10('0x3a')]){_0x458615=0x0;}else{_0x458615=_0x576bb6[0x0][_0xbb10('0x1f')]||0x0;}return dbH[_0xbb10('0x81')][_0xbb10('0x35')](_0x3fd367[_0xbb10('0x80')](),{'type':dbH[_0xbb10('0x81')][_0xbb10('0x82')][_0xbb10('0x83')]});})['then'](function(_0x3696b3){return{'rows':_0x3696b3||[],'count':_0x458615};});}});}exports['run']=function(_0xe70161,_0x36e9b0){return runReport(_0xe70161[_0xbb10('0x45')],_0xe70161[_0xbb10('0x35')],_0xe70161[_0xbb10('0x41')])[_0xbb10('0x25')](respondWithResult(_0x36e9b0,null))[_0xbb10('0x44')](handleError(_0x36e9b0,null));};exports['runReport']=runReport;exports[_0xbb10('0x35')]=function(_0x5ca9a0,_0x51063a){var _0x1513e0=0xa;var _0x35cbb9=[_0xbb10('0x53'),_0xbb10('0x54'),_0xbb10('0x55'),_0xbb10('0x56')];var _0x5d1077={'SUM':_0xbb10('0x84'),'COUNT':_0xbb10('0x57'),'COUNT DISTINCT':_0xbb10('0x58'),'MAX':_0xbb10('0x59'),'MIN':_0xbb10('0x5a'),'AVG':_0xbb10('0x85'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbb10('0x5b'),'GROUP_CONCAT DESC':_0xbb10('0x5c')};var _0xb7c454={'SEC_TO_TIME':_0xbb10('0x5d'),'DATE':_0xbb10('0x5e'),'HOUR':_0xbb10('0x5f'),'ROUND':_0xbb10('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x33a43e=function(_0x5e4ae9){return!_[_0xbb10('0x88')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xbb10('0x61'),_0xbb10('0x62')],_0x5e4ae9);};var _0x24edcb=function(_0x3b7552){if(!_0x3b7552||!_0x3b7552[_0xbb10('0x63')]['length']){return'';}for(var _0xa42b80='(',_0x565ddf=0x0;_0x565ddf<_0x3b7552['rules']['length'];_0x565ddf+=0x1){_0x565ddf>0x0&&(_0xa42b80+='\x20'+_0x3b7552[_0xbb10('0x64')]+'\x20');_0xa42b80+=_0x3b7552[_0xbb10('0x63')][_0x565ddf][_0xbb10('0x65')]?_0x24edcb(_0x3b7552[_0xbb10('0x63')][_0x565ddf][_0xbb10('0x65')]):_0x3b7552['rules'][_0x565ddf][_0xbb10('0x66')]+'\x20'+_0x3b7552[_0xbb10('0x63')][_0x565ddf][_0xbb10('0x67')]+(_0x33a43e(_0x3b7552[_0xbb10('0x63')][_0x565ddf][_0xbb10('0x67')])?'\x20'+_0x3b7552[_0xbb10('0x63')][_0x565ddf][_0xbb10('0x8b')]:'');}return _0xa42b80+')';};var _0x485c1a={'where':{'id':_0x5ca9a0[_0xbb10('0x45')]['id']}},_0x4c95c2,_0x584a62,_0x386eac,_0x1581ef,_0x2ae3c6;_0x485c1a=_[_0xbb10('0x3e')]({},_0x485c1a,_0x5ca9a0[_0xbb10('0x41')]);return db[_0xbb10('0x2e')][_0xbb10('0x47')](_0x485c1a)[_0xbb10('0x25')](function(_0x3b1131){if(_0x3b1131){_0x4c95c2=_0x3b1131;return _0x3b1131['getFields']();}return null;})['then'](function(_0x4dce53){if(_0x4dce53){if(!_0x4dce53[_0xbb10('0x3a')]){throw new db[(_0xbb10('0x68'))][(_0xbb10('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x584a62=_0x4dce53;return db[_0xbb10('0x6b')][_0xbb10('0xa1')]({'raw':!![]});}return null;})[_0xbb10('0x25')](function(_0x290280){if(_0x290280){_0x386eac=_[_0xbb10('0x6c')](_0x290280,'id');var _0x11279d;var _0x485f46=squel['select']();_0x485f46[_0xbb10('0x8d')](_0x4c95c2['table']);for(var _0x370215=0x0;_0x370215<_0x584a62[_0xbb10('0x3a')];_0x370215+=0x1){_0x11279d=_0x584a62[_0x370215][_0xbb10('0x6e')]?_0x386eac[_0x584a62[_0x370215][_0xbb10('0x6e')]][_0xbb10('0x6f')]:_0x584a62[_0x370215][_0xbb10('0x66')];_0x11279d=_0x584a62[_0x370215][_0xbb10('0x70')]?_[_0xbb10('0x71')](_0x5d1077[_0x584a62[_0x370215][_0xbb10('0x70')]],'%s',_0x11279d):_0x11279d;_0x11279d=_0x584a62[_0x370215][_0xbb10('0x72')]?_['replace'](_0xb7c454[_0x584a62[_0x370215][_0xbb10('0x72')]],'%s',_0x11279d):_0x11279d;if(_0x584a62[_0x370215]['groupBy']){_0x485f46[_0xbb10('0x65')](_0x11279d);}_0x584a62[_0x370215]['orderBy']&&_0x485f46[_0xbb10('0x74')](_0x11279d,_0x584a62[_0x370215][_0xbb10('0x73')]===_0xbb10('0x75')?![]:!![]);_0x485f46[_0xbb10('0x66')](_0x11279d,_0x584a62[_0x370215]['alias']||_0x11279d);}if(_0x4c95c2[_0xbb10('0x77')]){_0x4c95c2['joins']=JSON[_0xbb10('0x7d')](_0x4c95c2[_0xbb10('0x77')]);for(var _0xcdaf04=0x0;_0xcdaf04<_0x4c95c2['joins'][_0xbb10('0x3a')];_0xcdaf04+=0x1){if(_0x4c95c2[_0xbb10('0x77')][_0xcdaf04][_0xbb10('0x31')]&&_[_0xbb10('0x88')](_0x35cbb9,_0x4c95c2[_0xbb10('0x77')][_0xcdaf04][_0xbb10('0x31')])&&_0x4c95c2['joins'][_0xcdaf04]['parentKey']&&_0x4c95c2['joins'][_0xcdaf04][_0xbb10('0x79')]&&_0x4c95c2['joins'][_0xcdaf04][_0xbb10('0x7a')]){_0x485f46[_0x4c95c2['joins'][_0xcdaf04][_0xbb10('0x31')]](_0x4c95c2[_0xbb10('0x77')][_0xcdaf04][_0xbb10('0x79')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4c95c2[_0xbb10('0x6d')],_0x4c95c2[_0xbb10('0x77')][_0xcdaf04][_0xbb10('0x78')],_0x4c95c2['joins'][_0xcdaf04][_0xbb10('0x79')],_0x4c95c2[_0xbb10('0x77')][_0xcdaf04][_0xbb10('0x7a')]));}}}if(_0x4c95c2['conditions']){_0x4c95c2['conditions']=JSON['parse'](_0x4c95c2[_0xbb10('0x7c')]);_0x485f46['where'](_0x24edcb(_0x4c95c2[_0xbb10('0x7c')][_0xbb10('0x65')]));}_0x2ae3c6=_0x485f46[_0xbb10('0x7e')]();_0x485f46[_0xbb10('0x1e')](_0x1513e0);_0x485f46[_0xbb10('0x1c')](0x0);logger[_0xbb10('0xa2')](_0xbb10('0x7f'),_0x485f46[_0xbb10('0x80')]());return dbH[_0xbb10('0x81')][_0xbb10('0x35')](_0x485f46[_0xbb10('0x80')](),{'type':dbH['sequelize'][_0xbb10('0x82')][_0xbb10('0x83')]});}})['then'](function(){return{'sql':_0x2ae3c6[_0xbb10('0x80')]()};})['then'](respondWithResult(_0x51063a,null))['catch'](handleError(_0x51063a,null));};
\ No newline at end of file
+var _0xb10b=['offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','CustomReports','UserProfileResource','sendStatus','error','stack','name','send','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','catch','params','keys','find','create','body','user','role','get','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','table','MetricId','metric','function','replace','format','orderBy','order','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','AVG(%s)','GROUP_CONCAT(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','value','getFields','from','groupBy','fullPath','%s-%s.%s','generate','output','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','select','findAll','debug','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','dbH','status','end','json'];(function(_0xd4ccbc,_0x34fd43){var _0x16576a=function(_0x4bfcfc){while(--_0x4bfcfc){_0xd4ccbc['push'](_0xd4ccbc['shift']());}};_0x16576a(++_0x34fd43);}(_0xb10b,0x12a));var _0xbb10=function(_0x789179,_0x455e5f){_0x789179=_0x789179-0x0;var _0x10878f=_0xb10b[_0x789179];return _0x10878f;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];var dbH=require(_0xbb10('0x17'))[_0xbb10('0x18')];function respondWithStatusCode(_0x193a27,_0x442548){_0x442548=_0x442548||0xcc;return function(_0x147230){if(_0x147230){return _0x193a27['sendStatus'](_0x442548);}return _0x193a27[_0xbb10('0x19')](_0x442548)[_0xbb10('0x1a')]();};}function respondWithResult(_0x45b9d6,_0x17fd46){_0x17fd46=_0x17fd46||0xc8;return function(_0x3df17b){if(_0x3df17b){return _0x45b9d6[_0xbb10('0x19')](_0x17fd46)[_0xbb10('0x1b')](_0x3df17b);}};}function respondWithFilteredResult(_0x36b5e8,_0x3e26f4){return function(_0x2b184e){if(_0x2b184e){var _0x4a2bfc=typeof _0x3e26f4[_0xbb10('0x1c')]===_0xbb10('0x1d')&&typeof _0x3e26f4[_0xbb10('0x1e')]===_0xbb10('0x1d');var _0x378da8=_0x2b184e[_0xbb10('0x1f')];var _0x575cca=_0x4a2bfc?0x0:_0x3e26f4[_0xbb10('0x1c')];var _0xbf2906=_0x4a2bfc?_0x2b184e[_0xbb10('0x1f')]:_0x3e26f4['offset']+_0x3e26f4[_0xbb10('0x1e')];var _0x19f48d;if(_0xbf2906>=_0x378da8){_0xbf2906=_0x378da8;_0x19f48d=0xc8;}else{_0x19f48d=0xce;}_0x36b5e8[_0xbb10('0x19')](_0x19f48d);return _0x36b5e8[_0xbb10('0x20')](_0xbb10('0x21'),_0x575cca+'-'+_0xbf2906+'/'+_0x378da8)[_0xbb10('0x1b')](_0x2b184e);}return null;};}function patchUpdates(_0x4deb49){return function(_0x12f888){try{jsonpatch[_0xbb10('0x22')](_0x12f888,_0x4deb49,!![]);}catch(_0x50aea1){return BPromise['reject'](_0x50aea1);}return _0x12f888[_0xbb10('0x23')]();};}function saveUpdates(_0x311abe,_0x2e911d){return function(_0x317da4){if(_0x317da4){return _0x317da4[_0xbb10('0x24')](_0x311abe)[_0xbb10('0x25')](function(_0x407cb4){return _0x407cb4;});}return null;};}function removeEntity(_0x436104,_0x7f2377){return function(_0x395404){if(_0x395404){return _0x395404[_0xbb10('0x26')]()[_0xbb10('0x25')](function(){var _0x537898=_0x395404['get']({'plain':!![]});var _0x4fb5e0=_0xbb10('0x27');return db[_0xbb10('0x28')][_0xbb10('0x26')]({'where':{'type':_0x4fb5e0,'resourceId':_0x537898['id']}})['then'](function(){return _0x395404;});})[_0xbb10('0x25')](function(){_0x436104[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1d5e95,_0x1acce9){return function(_0x20d946){if(!_0x20d946){_0x1d5e95[_0xbb10('0x29')](0x194);}return _0x20d946;};}function handleError(_0x4aabb9,_0x3796c7){_0x3796c7=_0x3796c7||0x1f4;return function(_0x21ac54){logger[_0xbb10('0x2a')](_0x21ac54[_0xbb10('0x2b')]);if(_0x21ac54[_0xbb10('0x2c')]){delete _0x21ac54[_0xbb10('0x2c')];}_0x4aabb9['status'](_0x3796c7)[_0xbb10('0x2d')](_0x21ac54);};}exports['index']=function(_0x448d5c,_0x56f2da){var _0x16ad2a={},_0x1dcc9c={},_0x1b59f9={'count':0x0,'rows':[]};var _0x491db4=_['map'](db[_0xbb10('0x2e')][_0xbb10('0x2f')],function(_0x4f590d){return{'name':_0x4f590d[_0xbb10('0x30')],'type':_0x4f590d[_0xbb10('0x31')][_0xbb10('0x32')]};});_0x1dcc9c[_0xbb10('0x33')]=_[_0xbb10('0x34')](_0x491db4,_0xbb10('0x2c'));_0x1dcc9c[_0xbb10('0x35')]=_['keys'](_0x448d5c[_0xbb10('0x35')]);_0x1dcc9c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x1dcc9c[_0xbb10('0x33')],_0x1dcc9c[_0xbb10('0x35')]);_0x16ad2a[_0xbb10('0x38')]=_[_0xbb10('0x37')](_0x1dcc9c[_0xbb10('0x33')],qs[_0xbb10('0x39')](_0x448d5c['query'][_0xbb10('0x39')]));_0x16ad2a[_0xbb10('0x38')]=_0x16ad2a[_0xbb10('0x38')][_0xbb10('0x3a')]?_0x16ad2a['attributes']:_0x1dcc9c[_0xbb10('0x33')];if(!_0x448d5c['query']['hasOwnProperty'](_0xbb10('0x3b'))){_0x16ad2a[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x448d5c[_0xbb10('0x35')][_0xbb10('0x1e')]);_0x16ad2a[_0xbb10('0x1c')]=qs['offset'](_0x448d5c[_0xbb10('0x35')][_0xbb10('0x1c')]);}_0x16ad2a['order']=qs['sort'](_0x448d5c['query'][_0xbb10('0x3c')]);_0x16ad2a[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x448d5c[_0xbb10('0x35')],_0x1dcc9c[_0xbb10('0x36')]),_0x491db4);if(_0x448d5c[_0xbb10('0x35')]['filter']){_0x16ad2a[_0xbb10('0x3d')]=_[_0xbb10('0x3e')](_0x16ad2a[_0xbb10('0x3d')],{'$or':_[_0xbb10('0x34')](_0x491db4,function(_0x4f1cdd){if(_0x4f1cdd[_0xbb10('0x31')]!==_0xbb10('0x3f')){var _0x5835fd={};_0x5835fd[_0x4f1cdd[_0xbb10('0x2c')]]={'$like':'%'+_0x448d5c[_0xbb10('0x35')][_0xbb10('0x40')]+'%'};return _0x5835fd;}})});}_0x16ad2a=_[_0xbb10('0x3e')]({},_0x16ad2a,_0x448d5c[_0xbb10('0x41')]);var _0x185a52={'where':_0x16ad2a['where']};return db[_0xbb10('0x2e')][_0xbb10('0x1f')](_0x185a52)[_0xbb10('0x25')](function(_0x3d3c41){_0x1b59f9['count']=_0x3d3c41;if(_0x448d5c[_0xbb10('0x35')][_0xbb10('0x42')]){_0x16ad2a[_0xbb10('0x43')]=[{'all':!![]}];}return db[_0xbb10('0x2e')]['findAll'](_0x16ad2a);})[_0xbb10('0x25')](function(_0x202c60){_0x1b59f9['rows']=_0x202c60;return _0x1b59f9;})['then'](respondWithFilteredResult(_0x56f2da,_0x16ad2a))[_0xbb10('0x44')](handleError(_0x56f2da,null));};exports['show']=function(_0x318984,_0x180933){var _0x4c66d8={'raw':![],'where':{'id':_0x318984[_0xbb10('0x45')]['id']}},_0x366608={};_0x366608[_0xbb10('0x33')]=_['keys'](db[_0xbb10('0x2e')][_0xbb10('0x2f')]);_0x366608[_0xbb10('0x35')]=_[_0xbb10('0x46')](_0x318984[_0xbb10('0x35')]);_0x366608[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x366608[_0xbb10('0x33')],_0x366608[_0xbb10('0x35')]);_0x4c66d8[_0xbb10('0x38')]=_[_0xbb10('0x37')](_0x366608[_0xbb10('0x33')],qs['fields'](_0x318984[_0xbb10('0x35')][_0xbb10('0x39')]));_0x4c66d8['attributes']=_0x4c66d8[_0xbb10('0x38')][_0xbb10('0x3a')]?_0x4c66d8[_0xbb10('0x38')]:_0x366608[_0xbb10('0x33')];if(_0x318984[_0xbb10('0x35')][_0xbb10('0x42')]){_0x4c66d8[_0xbb10('0x43')]=[{'all':!![]}];}_0x4c66d8=_['merge']({},_0x4c66d8,_0x318984['options']);return db[_0xbb10('0x2e')][_0xbb10('0x47')](_0x4c66d8)[_0xbb10('0x25')](handleEntityNotFound(_0x180933,null))['then'](respondWithResult(_0x180933,null))['catch'](handleError(_0x180933,null));};exports[_0xbb10('0x48')]=function(_0x34cf4e,_0x1bd054){return db[_0xbb10('0x2e')][_0xbb10('0x48')](_0x34cf4e[_0xbb10('0x49')],{})[_0xbb10('0x25')](function(_0x460788){var _0x2626d8=_0x34cf4e[_0xbb10('0x4a')]['get']({'plain':!![]});if(!_0x2626d8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2626d8[_0xbb10('0x4b')]===_0xbb10('0x4a')){var _0x36ab7d=_0x460788[_0xbb10('0x4c')]({'plain':!![]});var _0x36aa7d=_0xbb10('0x4d');return db[_0xbb10('0x4e')][_0xbb10('0x47')]({'where':{'name':_0x36aa7d,'userProfileId':_0x2626d8[_0xbb10('0x4f')]},'raw':!![]})[_0xbb10('0x25')](function(_0x19ca3e){if(_0x19ca3e&&_0x19ca3e[_0xbb10('0x50')]===0x0){return db[_0xbb10('0x28')][_0xbb10('0x48')]({'name':_0x36ab7d[_0xbb10('0x2c')],'resourceId':_0x36ab7d['id'],'type':'CustomReports','sectionId':_0x19ca3e['id']},{})[_0xbb10('0x25')](function(){return _0x460788;});}else{return _0x460788;}})['catch'](function(_0x33d60a){logger[_0xbb10('0x2a')](_0xbb10('0x51'),_0x33d60a);throw _0x33d60a;});}return _0x460788;})[_0xbb10('0x25')](respondWithResult(_0x1bd054,0xc9))[_0xbb10('0x44')](handleError(_0x1bd054,null));};exports[_0xbb10('0x24')]=function(_0x2e3326,_0x44eec1){if(_0x2e3326[_0xbb10('0x49')]['id']){delete _0x2e3326[_0xbb10('0x49')]['id'];}return db[_0xbb10('0x2e')][_0xbb10('0x47')]({'where':{'id':_0x2e3326[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x44eec1,null))[_0xbb10('0x25')](saveUpdates(_0x2e3326['body'],null))[_0xbb10('0x25')](respondWithResult(_0x44eec1,null))[_0xbb10('0x44')](handleError(_0x44eec1,null));};exports[_0xbb10('0x26')]=function(_0x4ce8e7,_0xbffa3c){return db[_0xbb10('0x2e')]['find']({'where':{'id':_0x4ce8e7[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0xbffa3c,null))[_0xbb10('0x25')](removeEntity(_0xbffa3c,null))[_0xbb10('0x44')](handleError(_0xbffa3c,null));};exports[_0xbb10('0x52')]=function(_0x22de7f,_0x175872){var _0x12ec18=0xa;var _0x205e01=[_0xbb10('0x53'),_0xbb10('0x54'),_0xbb10('0x55'),_0xbb10('0x56')];var _0x4e7fac={'SUM':'SUM(%s)','COUNT':_0xbb10('0x57'),'COUNT DISTINCT':_0xbb10('0x58'),'MAX':_0xbb10('0x59'),'MIN':_0xbb10('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbb10('0x5b'),'GROUP_CONCAT DESC':_0xbb10('0x5c')};var _0x410bef={'SEC_TO_TIME':_0xbb10('0x5d'),'DATE':_0xbb10('0x5e'),'HOUR':_0xbb10('0x5f'),'ROUND':_0xbb10('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x117e84=function(_0x216cff){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xbb10('0x61'),_0xbb10('0x62')],_0x216cff);};var _0x155dc5=function(_0x5bd1c0){if(!_0x5bd1c0||!_0x5bd1c0['rules']['length']){return'';}for(var _0x3ebc5f='(',_0x249b33=0x0;_0x249b33<_0x5bd1c0[_0xbb10('0x63')]['length'];_0x249b33+=0x1){_0x249b33>0x0&&(_0x3ebc5f+='\x20'+_0x5bd1c0[_0xbb10('0x64')]+'\x20');_0x3ebc5f+=_0x5bd1c0[_0xbb10('0x63')][_0x249b33]['group']?_0x155dc5(_0x5bd1c0['rules'][_0x249b33][_0xbb10('0x65')]):_0x5bd1c0[_0xbb10('0x63')][_0x249b33][_0xbb10('0x66')]+'\x20'+_0x5bd1c0[_0xbb10('0x63')][_0x249b33]['condition']+(_0x117e84(_0x5bd1c0[_0xbb10('0x63')][_0x249b33][_0xbb10('0x67')])?'\x20'+_0x5bd1c0[_0xbb10('0x63')][_0x249b33]['value']:'');}return _0x3ebc5f+')';};var _0x402a01={'where':{'id':_0x22de7f[_0xbb10('0x45')]['id']}},_0x2f05bc,_0x3e3617,_0x5b2bd4,_0x2ca491,_0x31e85e;_0x402a01=_[_0xbb10('0x3e')]({},_0x402a01,_0x22de7f['options']);return db[_0xbb10('0x2e')][_0xbb10('0x47')](_0x402a01)[_0xbb10('0x25')](function(_0x2d0f4b){if(_0x2d0f4b){_0x2f05bc=_0x2d0f4b;return _0x2d0f4b['getFields']();}return null;})[_0xbb10('0x25')](function(_0x277fe7){if(_0x277fe7){if(!_0x277fe7[_0xbb10('0x3a')]){throw new db[(_0xbb10('0x68'))][(_0xbb10('0x69'))](_0xbb10('0x6a'),0x193);}_0x3e3617=_0x277fe7;return db[_0xbb10('0x6b')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x5acd5e){if(_0x5acd5e){_0x5b2bd4=_[_0xbb10('0x6c')](_0x5acd5e,'id');var _0x9c672d;var _0x3eda96=squel['select']();_0x3eda96['from'](_0x2f05bc[_0xbb10('0x6d')]);for(var _0x1b11c0=0x0;_0x1b11c0<_0x3e3617[_0xbb10('0x3a')];_0x1b11c0+=0x1){_0x9c672d=_0x3e3617[_0x1b11c0][_0xbb10('0x6e')]?_0x5b2bd4[_0x3e3617[_0x1b11c0][_0xbb10('0x6e')]][_0xbb10('0x6f')]:_0x3e3617[_0x1b11c0]['field'];_0x9c672d=_0x3e3617[_0x1b11c0][_0xbb10('0x70')]?_[_0xbb10('0x71')](_0x4e7fac[_0x3e3617[_0x1b11c0][_0xbb10('0x70')]],'%s',_0x9c672d):_0x9c672d;_0x9c672d=_0x3e3617[_0x1b11c0][_0xbb10('0x72')]?_[_0xbb10('0x71')](_0x410bef[_0x3e3617[_0x1b11c0]['format']],'%s',_0x9c672d):_0x9c672d;if(_0x3e3617[_0x1b11c0]['groupBy']){_0x3eda96['group'](_0x9c672d);}_0x3e3617[_0x1b11c0][_0xbb10('0x73')]&&_0x3eda96[_0xbb10('0x74')](_0x9c672d,_0x3e3617[_0x1b11c0][_0xbb10('0x73')]===_0xbb10('0x75')?![]:!![]);_0x3eda96[_0xbb10('0x66')](_0x9c672d,_0x3e3617[_0x1b11c0][_0xbb10('0x76')]||_0x9c672d);}if(_0x2f05bc['joins']){_0x2f05bc[_0xbb10('0x77')]=JSON['parse'](_0x2f05bc['joins']);for(var _0x519a54=0x0;_0x519a54<_0x2f05bc[_0xbb10('0x77')][_0xbb10('0x3a')];_0x519a54+=0x1){if(_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x31')]&&_['includes'](_0x205e01,_0x2f05bc[_0xbb10('0x77')][_0x519a54]['type'])&&_0x2f05bc['joins'][_0x519a54][_0xbb10('0x78')]&&_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x79')]&&_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x7a')]){_0x3eda96[_0x2f05bc['joins'][_0x519a54][_0xbb10('0x31')]](_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x79')],null,util[_0xbb10('0x72')](_0xbb10('0x7b'),_0x2f05bc[_0xbb10('0x6d')],_0x2f05bc[_0xbb10('0x77')][_0x519a54]['parentKey'],_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x79')],_0x2f05bc[_0xbb10('0x77')][_0x519a54][_0xbb10('0x7a')]));}}}if(_0x2f05bc[_0xbb10('0x7c')]){_0x2f05bc[_0xbb10('0x7c')]=JSON[_0xbb10('0x7d')](_0x2f05bc[_0xbb10('0x7c')]);_0x3eda96['where'](_0x155dc5(_0x2f05bc[_0xbb10('0x7c')][_0xbb10('0x65')]));}_0x31e85e=_0x3eda96[_0xbb10('0x7e')]();_0x3eda96['limit'](_0x12ec18);_0x3eda96['offset'](0x0);logger['debug'](_0xbb10('0x7f'),_0x3eda96['toString']());return dbH['sequelize'][_0xbb10('0x35')](_0x3eda96[_0xbb10('0x80')](),{'type':dbH[_0xbb10('0x81')][_0xbb10('0x82')][_0xbb10('0x83')]});}})[_0xbb10('0x25')](respondWithResult(_0x175872,null))[_0xbb10('0x44')](handleError(_0x175872,null));};function runReport(_0x417304,_0x188b97,_0x5206e1){var _0x318a14=_0x188b97[_0xbb10('0x2c')];var _0x46b6d2=0xa;var _0x35b811=['join','left_join',_0xbb10('0x55'),_0xbb10('0x56')];var _0x30f0a4={'SUM':_0xbb10('0x84'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xbb10('0x58'),'MAX':_0xbb10('0x59'),'MIN':_0xbb10('0x5a'),'AVG':_0xbb10('0x85'),'GROUP_CONCAT':_0xbb10('0x86'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x372636={'SEC_TO_TIME':_0xbb10('0x5d'),'DATE':_0xbb10('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0xbb10('0x60'),'UNIX_TIMESTAMP':_0xbb10('0x87')};var _0x50bcc9=function(_0x5caa06){return!_[_0xbb10('0x88')]([_0xbb10('0x89'),_0xbb10('0x8a'),'IS\x20EMPTY',_0xbb10('0x62')],_0x5caa06);};var _0x3a17fc=function(_0xfbb365){if(!_0xfbb365||!_0xfbb365[_0xbb10('0x63')][_0xbb10('0x3a')]){return'';}for(var _0x5de006='(',_0x45bd4e=0x0;_0x45bd4e<_0xfbb365[_0xbb10('0x63')][_0xbb10('0x3a')];_0x45bd4e+=0x1){_0x45bd4e>0x0&&(_0x5de006+='\x20'+_0xfbb365['operator']+'\x20');_0x5de006+=_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x65')]?_0x3a17fc(_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x65')]):_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x66')]+'\x20'+_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x67')]+(_0x50bcc9(_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x67')])?'\x20'+_0xfbb365[_0xbb10('0x63')][_0x45bd4e][_0xbb10('0x8b')]:'');}return _0x5de006+')';};var _0x59e985={'where':{'id':_0x417304['id']}},_0x51f106,_0xe1fc51,_0x3fa344,_0x458615,_0x3fd367;_0x59e985=_[_0xbb10('0x3e')]({},_0x59e985,_0x5206e1);return db['AnalyticCustomReport'][_0xbb10('0x47')](_0x59e985)[_0xbb10('0x25')](function(_0x3b4d0b){if(_0x3b4d0b){_0x51f106=_0x3b4d0b;return _0x3b4d0b[_0xbb10('0x8c')]();}return null;})[_0xbb10('0x25')](function(_0x379d49){if(_0x379d49){if(!_0x379d49['length']){throw new db[(_0xbb10('0x68'))][(_0xbb10('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xe1fc51=_0x379d49;return db[_0xbb10('0x6b')]['findAll']({'raw':!![]});}return null;})[_0xbb10('0x25')](function(_0x28bd76){if(_0x28bd76){_0x3fa344=_[_0xbb10('0x6c')](_0x28bd76,'id');var _0xa99bf5;var _0x3a4a6e=squel['select']();_0x3a4a6e[_0xbb10('0x8d')](_0x51f106['table']);for(var _0x3fcc55=0x0;_0x3fcc55<_0xe1fc51[_0xbb10('0x3a')];_0x3fcc55+=0x1){_0xa99bf5=_0xe1fc51[_0x3fcc55]['MetricId']?_0x3fa344[_0xe1fc51[_0x3fcc55]['MetricId']][_0xbb10('0x6f')]:_0xe1fc51[_0x3fcc55][_0xbb10('0x66')];_0xa99bf5=_0xe1fc51[_0x3fcc55][_0xbb10('0x70')]?_[_0xbb10('0x71')](_0x30f0a4[_0xe1fc51[_0x3fcc55][_0xbb10('0x70')]],'%s',_0xa99bf5):_0xa99bf5;_0xa99bf5=_0xe1fc51[_0x3fcc55][_0xbb10('0x72')]?_[_0xbb10('0x71')](_0x372636[_0xe1fc51[_0x3fcc55][_0xbb10('0x72')]],'%s',_0xa99bf5):_0xa99bf5;if(_0xe1fc51[_0x3fcc55][_0xbb10('0x8e')]){_0x3a4a6e[_0xbb10('0x65')](_0xa99bf5);}_0xe1fc51[_0x3fcc55][_0xbb10('0x73')]&&_0x3a4a6e['order'](_0xa99bf5,_0xe1fc51[_0x3fcc55][_0xbb10('0x73')]===_0xbb10('0x75')?![]:!![]);_0x3a4a6e[_0xbb10('0x66')](_0xa99bf5,_0xe1fc51[_0x3fcc55][_0xbb10('0x76')]||_0xa99bf5);}if(_0x51f106[_0xbb10('0x77')]){_0x51f106[_0xbb10('0x77')]=JSON[_0xbb10('0x7d')](_0x51f106[_0xbb10('0x77')]);for(var _0x3e6fe2=0x0;_0x3e6fe2<_0x51f106[_0xbb10('0x77')][_0xbb10('0x3a')];_0x3e6fe2+=0x1){if(_0x51f106[_0xbb10('0x77')][_0x3e6fe2]['type']&&_[_0xbb10('0x88')](_0x35b811,_0x51f106['joins'][_0x3e6fe2][_0xbb10('0x31')])&&_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x78')]&&_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x79')]&&_0x51f106['joins'][_0x3e6fe2][_0xbb10('0x7a')]){_0x3a4a6e[_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x31')]](_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x79')],null,util[_0xbb10('0x72')]('%s.%s\x20=\x20%s.%s',_0x51f106['table'],_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x78')],_0x51f106[_0xbb10('0x77')][_0x3e6fe2]['foreignTable'],_0x51f106[_0xbb10('0x77')][_0x3e6fe2][_0xbb10('0x7a')]));}}}if(_0x51f106['conditions']){_0x51f106[_0xbb10('0x7c')]=JSON[_0xbb10('0x7d')](_0x51f106['conditions']);_0x3a4a6e[_0xbb10('0x3d')](_0x3a17fc(_0x51f106['conditions'][_0xbb10('0x65')]));}_0x3fd367=_0x3a4a6e[_0xbb10('0x7e')]();_0x3a4a6e['limit'](_0x46b6d2);_0x3a4a6e[_0xbb10('0x1c')](0x0);return;}})[_0xbb10('0x25')](function(){if(_0x188b97['output']==='web'){return null;}var _0xea6bf2=_[_0xbb10('0x3e')](_0x188b97,{'name':_0x188b97[_0xbb10('0x8f')]||_0x188b97[_0xbb10('0x2c')]||_0x51f106[_0xbb10('0x2c')],'basename':_0x318a14,'savename':util['format'](_0xbb10('0x90'),_0x188b97[_0xbb10('0x2c')]||_0x51f106[_0xbb10('0x2c')],require('randomstring')[_0xbb10('0x91')](0x4),_0x188b97[_0xbb10('0x92')]||_0xbb10('0x93')),'reportId':_0x51f106['id'],'reportType':_0xbb10('0x94')});return db[_0xbb10('0x95')][_0xbb10('0x48')](_0xea6bf2,{'raw':!![]});})[_0xbb10('0x25')](function(_0x189f07){if(_0x51f106[_0xbb10('0x6d')]==='cdr'){_0x3fd367['where'](_0x51f106[_0xbb10('0x6d')]+_0xbb10('0x96'),_0x188b97[_0xbb10('0x97')],_0x188b97[_0xbb10('0x98')]);}else{_0x3fd367[_0xbb10('0x3d')](_0x51f106[_0xbb10('0x6d')]+_0xbb10('0x99'),_0x188b97[_0xbb10('0x97')],_0x188b97[_0xbb10('0x98')]);}if(_0x189f07){logger[_0xbb10('0x9a')](_0xbb10('0x9b'),_0x3fd367[_0xbb10('0x80')]());require(_0xbb10('0x9c'))['fork'](path[_0xbb10('0x53')](__dirname,_0xbb10('0x9d'),_0x189f07[_0xbb10('0x92')]),[_0x189f07['id'],_0x3fd367[_0xbb10('0x80')](),path[_0xbb10('0x53')](__dirname,_0xbb10('0x9e'),_0x189f07[_0xbb10('0x9f')]),_0x318a14]);return _0x189f07;}else{var _0x1421e2=squel[_0xbb10('0xa0')]();_0x1421e2[_0xbb10('0x8d')]('('+_0x3fd367[_0xbb10('0x80')]()+')','countTable');_0x1421e2[_0xbb10('0x66')]('COUNT(*)',_0xbb10('0x1f'));_0x3fd367[_0xbb10('0x1e')](_0x188b97[_0xbb10('0x1e')]||_0x46b6d2);_0x3fd367[_0xbb10('0x1c')](_0x188b97[_0xbb10('0x1c')]||0x0);return dbH[_0xbb10('0x81')]['query'](_0x1421e2[_0xbb10('0x80')](),{'type':dbH['sequelize'][_0xbb10('0x82')][_0xbb10('0x83')]})[_0xbb10('0x25')](function(_0x576bb6){if(!_0x576bb6[_0xbb10('0x3a')]){_0x458615=0x0;}else{_0x458615=_0x576bb6[0x0][_0xbb10('0x1f')]||0x0;}return dbH[_0xbb10('0x81')][_0xbb10('0x35')](_0x3fd367[_0xbb10('0x80')](),{'type':dbH[_0xbb10('0x81')][_0xbb10('0x82')][_0xbb10('0x83')]});})['then'](function(_0x3696b3){return{'rows':_0x3696b3||[],'count':_0x458615};});}});}exports['run']=function(_0xe70161,_0x36e9b0){return runReport(_0xe70161[_0xbb10('0x45')],_0xe70161[_0xbb10('0x35')],_0xe70161[_0xbb10('0x41')])[_0xbb10('0x25')](respondWithResult(_0x36e9b0,null))[_0xbb10('0x44')](handleError(_0x36e9b0,null));};exports['runReport']=runReport;exports[_0xbb10('0x35')]=function(_0x5ca9a0,_0x51063a){var _0x1513e0=0xa;var _0x35cbb9=[_0xbb10('0x53'),_0xbb10('0x54'),_0xbb10('0x55'),_0xbb10('0x56')];var _0x5d1077={'SUM':_0xbb10('0x84'),'COUNT':_0xbb10('0x57'),'COUNT DISTINCT':_0xbb10('0x58'),'MAX':_0xbb10('0x59'),'MIN':_0xbb10('0x5a'),'AVG':_0xbb10('0x85'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbb10('0x5b'),'GROUP_CONCAT DESC':_0xbb10('0x5c')};var _0xb7c454={'SEC_TO_TIME':_0xbb10('0x5d'),'DATE':_0xbb10('0x5e'),'HOUR':_0xbb10('0x5f'),'ROUND':_0xbb10('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x33a43e=function(_0x5e4ae9){return!_[_0xbb10('0x88')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xbb10('0x61'),_0xbb10('0x62')],_0x5e4ae9);};var _0x24edcb=function(_0x3b7552){if(!_0x3b7552||!_0x3b7552[_0xbb10('0x63')]['length']){return'';}for(var _0xa42b80='(',_0x565ddf=0x0;_0x565ddf<_0x3b7552['rules']['length'];_0x565ddf+=0x1){_0x565ddf>0x0&&(_0xa42b80+='\x20'+_0x3b7552[_0xbb10('0x64')]+'\x20');_0xa42b80+=_0x3b7552[_0xbb10('0x63')][_0x565ddf][_0xbb10('0x65')]?_0x24edcb(_0x3b7552[_0xbb10('0x63')][_0x565ddf][_0xbb10('0x65')]):_0x3b7552['rules'][_0x565ddf][_0xbb10('0x66')]+'\x20'+_0x3b7552[_0xbb10('0x63')][_0x565ddf][_0xbb10('0x67')]+(_0x33a43e(_0x3b7552[_0xbb10('0x63')][_0x565ddf][_0xbb10('0x67')])?'\x20'+_0x3b7552[_0xbb10('0x63')][_0x565ddf][_0xbb10('0x8b')]:'');}return _0xa42b80+')';};var _0x485c1a={'where':{'id':_0x5ca9a0[_0xbb10('0x45')]['id']}},_0x4c95c2,_0x584a62,_0x386eac,_0x1581ef,_0x2ae3c6;_0x485c1a=_[_0xbb10('0x3e')]({},_0x485c1a,_0x5ca9a0[_0xbb10('0x41')]);return db[_0xbb10('0x2e')][_0xbb10('0x47')](_0x485c1a)[_0xbb10('0x25')](function(_0x3b1131){if(_0x3b1131){_0x4c95c2=_0x3b1131;return _0x3b1131['getFields']();}return null;})['then'](function(_0x4dce53){if(_0x4dce53){if(!_0x4dce53[_0xbb10('0x3a')]){throw new db[(_0xbb10('0x68'))][(_0xbb10('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x584a62=_0x4dce53;return db[_0xbb10('0x6b')][_0xbb10('0xa1')]({'raw':!![]});}return null;})[_0xbb10('0x25')](function(_0x290280){if(_0x290280){_0x386eac=_[_0xbb10('0x6c')](_0x290280,'id');var _0x11279d;var _0x485f46=squel['select']();_0x485f46[_0xbb10('0x8d')](_0x4c95c2['table']);for(var _0x370215=0x0;_0x370215<_0x584a62[_0xbb10('0x3a')];_0x370215+=0x1){_0x11279d=_0x584a62[_0x370215][_0xbb10('0x6e')]?_0x386eac[_0x584a62[_0x370215][_0xbb10('0x6e')]][_0xbb10('0x6f')]:_0x584a62[_0x370215][_0xbb10('0x66')];_0x11279d=_0x584a62[_0x370215][_0xbb10('0x70')]?_[_0xbb10('0x71')](_0x5d1077[_0x584a62[_0x370215][_0xbb10('0x70')]],'%s',_0x11279d):_0x11279d;_0x11279d=_0x584a62[_0x370215][_0xbb10('0x72')]?_['replace'](_0xb7c454[_0x584a62[_0x370215][_0xbb10('0x72')]],'%s',_0x11279d):_0x11279d;if(_0x584a62[_0x370215]['groupBy']){_0x485f46[_0xbb10('0x65')](_0x11279d);}_0x584a62[_0x370215]['orderBy']&&_0x485f46[_0xbb10('0x74')](_0x11279d,_0x584a62[_0x370215][_0xbb10('0x73')]===_0xbb10('0x75')?![]:!![]);_0x485f46[_0xbb10('0x66')](_0x11279d,_0x584a62[_0x370215]['alias']||_0x11279d);}if(_0x4c95c2[_0xbb10('0x77')]){_0x4c95c2['joins']=JSON[_0xbb10('0x7d')](_0x4c95c2[_0xbb10('0x77')]);for(var _0xcdaf04=0x0;_0xcdaf04<_0x4c95c2['joins'][_0xbb10('0x3a')];_0xcdaf04+=0x1){if(_0x4c95c2[_0xbb10('0x77')][_0xcdaf04][_0xbb10('0x31')]&&_[_0xbb10('0x88')](_0x35cbb9,_0x4c95c2[_0xbb10('0x77')][_0xcdaf04][_0xbb10('0x31')])&&_0x4c95c2['joins'][_0xcdaf04]['parentKey']&&_0x4c95c2['joins'][_0xcdaf04][_0xbb10('0x79')]&&_0x4c95c2['joins'][_0xcdaf04][_0xbb10('0x7a')]){_0x485f46[_0x4c95c2['joins'][_0xcdaf04][_0xbb10('0x31')]](_0x4c95c2[_0xbb10('0x77')][_0xcdaf04][_0xbb10('0x79')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4c95c2[_0xbb10('0x6d')],_0x4c95c2[_0xbb10('0x77')][_0xcdaf04][_0xbb10('0x78')],_0x4c95c2['joins'][_0xcdaf04][_0xbb10('0x79')],_0x4c95c2[_0xbb10('0x77')][_0xcdaf04][_0xbb10('0x7a')]));}}}if(_0x4c95c2['conditions']){_0x4c95c2['conditions']=JSON['parse'](_0x4c95c2[_0xbb10('0x7c')]);_0x485f46['where'](_0x24edcb(_0x4c95c2[_0xbb10('0x7c')][_0xbb10('0x65')]));}_0x2ae3c6=_0x485f46[_0xbb10('0x7e')]();_0x485f46[_0xbb10('0x1e')](_0x1513e0);_0x485f46[_0xbb10('0x1c')](0x0);logger[_0xbb10('0xa2')](_0xbb10('0x7f'),_0x485f46[_0xbb10('0x80')]());return dbH[_0xbb10('0x81')][_0xbb10('0x35')](_0x485f46[_0xbb10('0x80')](),{'type':dbH['sequelize'][_0xbb10('0x82')][_0xbb10('0x83')]});}})['then'](function(){return{'sql':_0x2ae3c6[_0xbb10('0x80')]()};})['then'](respondWithResult(_0x51063a,null))['catch'](handleError(_0x51063a,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 910969a..8a44d0a 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 _0x3913=['AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','moment','path','./analyticCustomReport.attributes','exports','define'];(function(_0x3601e8,_0x26e6c6){var _0x39382a=function(_0x2abaff){while(--_0x2abaff){_0x3601e8['push'](_0x3601e8['shift']());}};_0x39382a(++_0x26e6c6);}(_0x3913,0x110));var _0x3391=function(_0x54b5c1,_0x272a6e){_0x54b5c1=_0x54b5c1-0x0;var _0x51936c=_0x3913[_0x54b5c1];return _0x51936c;};'use strict';var _=require(_0x3391('0x0'));var util=require('util');var logger=require(_0x3391('0x1'))('api');var moment=require(_0x3391('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3391('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3391('0x4'));module[_0x3391('0x5')]=function(_0x301cea,_0x51fe5e){return _0x301cea[_0x3391('0x6')](_0x3391('0x7'),attributes,{'tableName':_0x3391('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0348=['analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0xd64ea1,_0x5a40d9){var _0x11a857=function(_0x32b046){while(--_0x32b046){_0xd64ea1['push'](_0xd64ea1['shift']());}};_0x11a857(++_0x5a40d9);}(_0x0348,0x1ed));var _0x8034=function(_0xe3025,_0x686182){_0xe3025=_0xe3025-0x0;var _0x592d0b=_0x0348[_0xe3025];return _0x592d0b;};'use strict';var _=require(_0x8034('0x0'));var util=require(_0x8034('0x1'));var logger=require(_0x8034('0x2'))(_0x8034('0x3'));var moment=require(_0x8034('0x4'));var BPromise=require(_0x8034('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8034('0x6'));var attributes=require(_0x8034('0x7'));module[_0x8034('0x8')]=function(_0x4e6f0e,_0x297990){return _0x4e6f0e[_0x8034('0x9')](_0x8034('0xa'),attributes,{'tableName':_0x8034('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 481be16..0167128 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 _0x1e3c=['then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x21cefb,_0x12aa66){var _0x1a7dc6=function(_0xa69318){while(--_0xa69318){_0x21cefb['push'](_0x21cefb['shift']());}};_0x1a7dc6(++_0x12aa66);}(_0x1e3c,0x73));var _0xc1e3=function(_0x7e142c,_0x1f24bb){_0x7e142c=_0x7e142c-0x0;var _0x3e7610=_0x1e3c[_0x7e142c];return _0x3e7610;};'use strict';var _=require('lodash');var util=require(_0xc1e3('0x0'));var moment=require(_0xc1e3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1e3('0x2'));var db=require(_0xc1e3('0x3'))['db'];var utils=require(_0xc1e3('0x4'));var logger=require(_0xc1e3('0x5'))('rpc');var config=require(_0xc1e3('0x6'));var jayson=require(_0xc1e3('0x7'));var client=jayson[_0xc1e3('0x8')][_0xc1e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c3ee1,_0x2e09e6,_0x1b2b25){return new BPromise(function(_0xb0f69a,_0xc361b1){return client[_0xc1e3('0xa')](_0x4c3ee1,_0x1b2b25)[_0xc1e3('0xb')](function(_0x55c98e){logger[_0xc1e3('0xc')](_0xc1e3('0xd'),_0x2e09e6,_0xc1e3('0xe'));logger[_0xc1e3('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x2e09e6,_0xc1e3('0xe'),JSON[_0xc1e3('0x10')](_0x55c98e));if(_0x55c98e[_0xc1e3('0x11')]){if(_0x55c98e['error']['code']===0x1f4){logger['error'](_0xc1e3('0xd'),_0x2e09e6,_0x55c98e[_0xc1e3('0x11')][_0xc1e3('0x12')]);return _0xc361b1(_0x55c98e[_0xc1e3('0x11')][_0xc1e3('0x12')]);}logger['error'](_0xc1e3('0xd'),_0x2e09e6,_0x55c98e[_0xc1e3('0x11')]['message']);return _0xb0f69a(_0x55c98e[_0xc1e3('0x11')][_0xc1e3('0x12')]);}else{logger['info'](_0xc1e3('0xd'),_0x2e09e6,_0xc1e3('0xe'));_0xb0f69a(_0x55c98e[_0xc1e3('0x13')][_0xc1e3('0x12')]);}})[_0xc1e3('0x14')](function(_0x155c4d){logger['error'](_0xc1e3('0xd'),_0x2e09e6,_0x155c4d);_0xc361b1(_0x155c4d);});});}
\ No newline at end of file
+var _0x9896=['jayson/promise','client','http','request','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x41c3a7,_0x181c60){var _0x4869b4=function(_0x5bbef1){while(--_0x5bbef1){_0x41c3a7['push'](_0x41c3a7['shift']());}};_0x4869b4(++_0x181c60);}(_0x9896,0xaf));var _0x6989=function(_0x40eedb,_0x490ce4){_0x40eedb=_0x40eedb-0x0;var _0x84b950=_0x9896[_0x40eedb];return _0x84b950;};'use strict';var _=require(_0x6989('0x0'));var util=require(_0x6989('0x1'));var moment=require(_0x6989('0x2'));var BPromise=require(_0x6989('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6989('0x4'));var db=require(_0x6989('0x5'))['db'];var utils=require(_0x6989('0x6'));var logger=require(_0x6989('0x7'))(_0x6989('0x8'));var config=require('../../config/environment');var jayson=require(_0x6989('0x9'));var client=jayson[_0x6989('0xa')][_0x6989('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x380482,_0x259497,_0x57a078){return new BPromise(function(_0x540a68,_0x4fdf66){return client[_0x6989('0xc')](_0x380482,_0x57a078)['then'](function(_0x2eff04){logger['info'](_0x6989('0xd'),_0x259497,_0x6989('0xe'));logger[_0x6989('0xf')](_0x6989('0x10'),_0x259497,'request\x20sent',JSON[_0x6989('0x11')](_0x2eff04));if(_0x2eff04[_0x6989('0x12')]){if(_0x2eff04['error'][_0x6989('0x13')]===0x1f4){logger[_0x6989('0x12')](_0x6989('0xd'),_0x259497,_0x2eff04[_0x6989('0x12')][_0x6989('0x14')]);return _0x4fdf66(_0x2eff04[_0x6989('0x12')][_0x6989('0x14')]);}logger[_0x6989('0x12')](_0x6989('0xd'),_0x259497,_0x2eff04[_0x6989('0x12')][_0x6989('0x14')]);return _0x540a68(_0x2eff04[_0x6989('0x12')]['message']);}else{logger['info'](_0x6989('0xd'),_0x259497,_0x6989('0xe'));_0x540a68(_0x2eff04[_0x6989('0x15')]['message']);}})[_0x6989('0x16')](function(_0x456f85){logger[_0x6989('0x12')](_0x6989('0xd'),_0x259497,_0x456f85);_0x4fdf66(_0x456f85);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 5e532f9..8720cdf 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 _0x0a39=['isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x0a39,0x176));var _0x90a3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0a39[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x90a3('0x0'));var util=require('util');var path=require(_0x90a3('0x1'));var timeout=require(_0x90a3('0x2'));var express=require('express');var router=express[_0x90a3('0x3')]();var fs_extra=require(_0x90a3('0x4'));var auth=require(_0x90a3('0x5'));var interaction=require(_0x90a3('0x6'));var config=require(_0x90a3('0x7'));var controller=require(_0x90a3('0x8'));router[_0x90a3('0x9')]('/',auth[_0x90a3('0xa')](),controller[_0x90a3('0xb')]);router[_0x90a3('0x9')](_0x90a3('0xc'),auth[_0x90a3('0xa')](),controller[_0x90a3('0xd')]);router['get'](_0x90a3('0xe'),auth[_0x90a3('0xa')](),controller[_0x90a3('0xf')]);router[_0x90a3('0x9')](_0x90a3('0x10'),auth['isAuthenticated'](),controller['run']);router[_0x90a3('0x9')](_0x90a3('0x11'),auth[_0x90a3('0xa')](),controller['query']);router['post']('/',auth[_0x90a3('0xa')](),controller[_0x90a3('0x12')]);router[_0x90a3('0x13')](_0x90a3('0xc'),auth[_0x90a3('0xa')](),controller[_0x90a3('0x14')]);router[_0x90a3('0x15')](_0x90a3('0xc'),auth[_0x90a3('0xa')](),controller[_0x90a3('0x16')]);module[_0x90a3('0x17')]=router;
\ No newline at end of file
+var _0x40d2=['get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','query','post','create','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller'];(function(_0x51741b,_0x4968d6){var _0xa566c=function(_0x51acfd){while(--_0x51acfd){_0x51741b['push'](_0x51741b['shift']());}};_0xa566c(++_0x4968d6);}(_0x40d2,0x17d));var _0x240d=function(_0x156d7c,_0x3a24c4){_0x156d7c=_0x156d7c-0x0;var _0x11f755=_0x40d2[_0x156d7c];return _0x11f755;};'use strict';var multer=require(_0x240d('0x0'));var util=require('util');var path=require(_0x240d('0x1'));var timeout=require(_0x240d('0x2'));var express=require(_0x240d('0x3'));var router=express[_0x240d('0x4')]();var fs_extra=require(_0x240d('0x5'));var auth=require(_0x240d('0x6'));var interaction=require(_0x240d('0x7'));var config=require(_0x240d('0x8'));var controller=require(_0x240d('0x9'));router[_0x240d('0xa')]('/',auth[_0x240d('0xb')](),controller[_0x240d('0xc')]);router[_0x240d('0xa')](_0x240d('0xd'),auth[_0x240d('0xb')](),controller[_0x240d('0xe')]);router['get'](_0x240d('0xf'),auth['isAuthenticated'](),controller['preview']);router[_0x240d('0xa')](_0x240d('0x10'),auth[_0x240d('0xb')](),controller['run']);router['get']('/:id/query',auth['isAuthenticated'](),controller[_0x240d('0x11')]);router[_0x240d('0x12')]('/',auth[_0x240d('0xb')](),controller[_0x240d('0x13')]);router[_0x240d('0x14')]('/:id',auth[_0x240d('0xb')](),controller[_0x240d('0x15')]);router['delete'](_0x240d('0xd'),auth[_0x240d('0xb')](),controller['destroy']);module[_0x240d('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 9e383b0..2021f96 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 _0x53e0=['STRING','TEXT','sequelize'];(function(_0x709af9,_0x13238f){var _0x594410=function(_0x3bcffd){while(--_0x3bcffd){_0x709af9['push'](_0x709af9['shift']());}};_0x594410(++_0x13238f);}(_0x53e0,0x1a0));var _0x053e=function(_0x317cc5,_0x3b6179){_0x317cc5=_0x317cc5-0x0;var _0x44fe81=_0x53e0[_0x317cc5];return _0x44fe81;};'use strict';var Sequelize=require(_0x053e('0x0'));module['exports']={'name':{'type':Sequelize[_0x053e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x053e('0x1')]},'parent':{'type':Sequelize[_0x053e('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x053e('0x2')]}};
\ No newline at end of file
+var _0x5353=['TEXT','sequelize','STRING'];(function(_0x3cc7e2,_0x1bb39c){var _0x15a6b7=function(_0x420ca5){while(--_0x420ca5){_0x3cc7e2['push'](_0x3cc7e2['shift']());}};_0x15a6b7(++_0x1bb39c);}(_0x5353,0x1e1));var _0x3535=function(_0x330fa2,_0x591ee0){_0x330fa2=_0x330fa2-0x0;var _0xe73cb6=_0x5353[_0x330fa2];return _0xe73cb6;};'use strict';var Sequelize=require(_0x3535('0x0'));module['exports']={'name':{'type':Sequelize[_0x3535('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3535('0x1')]},'parent':{'type':Sequelize[_0x3535('0x1')]},'table':{'type':Sequelize[_0x3535('0x1')]},'conditions':{'type':Sequelize[_0x3535('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 35cf045..7b927fe 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 _0xbd7f=['SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','select','from','table','MetricId','metric','function','replace','format','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','cross_join','COUNT(DISTINCT\x20%s)','includes','AnalyticMetric','groupBy','%s.%s\x20=\x20%s.%s','clone','fullPath','%s-%s.%s','randomstring','generate','output','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','SELECT','run','SEC_TO_TIME(%s)','operator','keyBy','DESC','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','DefaultReports','UserProfileResource','then','sendStatus','error','stack','name','send','map','AnalyticDefaultReport','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','left_join','right_join'];(function(_0x3a5bd5,_0xd52a42){var _0x3d7e7f=function(_0x50603a){while(--_0x50603a){_0x3a5bd5['push'](_0x3a5bd5['shift']());}};_0x3d7e7f(++_0xd52a42);}(_0xbd7f,0x1a7));var _0xfbd7=function(_0x2041ba,_0x449294){_0x2041ba=_0x2041ba-0x0;var _0x169e20=_0xbd7f[_0x2041ba];return _0x169e20;};'use strict';var emlformat=require(_0xfbd7('0x0'));var rimraf=require(_0xfbd7('0x1'));var zipdir=require(_0xfbd7('0x2'));var jsonpatch=require(_0xfbd7('0x3'));var rp=require(_0xfbd7('0x4'));var moment=require(_0xfbd7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfbd7('0x6'));var util=require(_0xfbd7('0x7'));var path=require(_0xfbd7('0x8'));var sox=require(_0xfbd7('0x9'));var csv=require(_0xfbd7('0xa'));var ejs=require(_0xfbd7('0xb'));var fs=require('fs');var fs_extra=require(_0xfbd7('0xc'));var _=require(_0xfbd7('0xd'));var squel=require(_0xfbd7('0xe'));var crypto=require(_0xfbd7('0xf'));var jsforce=require(_0xfbd7('0x10'));var deskjs=require(_0xfbd7('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfbd7('0x12'));var Redis=require(_0xfbd7('0x13'));var authService=require(_0xfbd7('0x14'));var qs=require(_0xfbd7('0x15'));var as=require(_0xfbd7('0x16'));var hardwareService=require(_0xfbd7('0x17'));var logger=require(_0xfbd7('0x18'))(_0xfbd7('0x19'));var utils=require(_0xfbd7('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfbd7('0x1b'))['db'];var dbH=require(_0xfbd7('0x1b'))[_0xfbd7('0x1c')];function respondWithStatusCode(_0x16486e,_0x3682fc){_0x3682fc=_0x3682fc||0xcc;return function(_0x57f73c){if(_0x57f73c){return _0x16486e['sendStatus'](_0x3682fc);}return _0x16486e[_0xfbd7('0x1d')](_0x3682fc)[_0xfbd7('0x1e')]();};}function respondWithResult(_0xc0e741,_0x327206){_0x327206=_0x327206||0xc8;return function(_0x2ec439){if(_0x2ec439){return _0xc0e741[_0xfbd7('0x1d')](_0x327206)[_0xfbd7('0x1f')](_0x2ec439);}};}function respondWithFilteredResult(_0x277c9f,_0x3e9941){return function(_0x222a60){if(_0x222a60){var _0x3fb1fe=typeof _0x3e9941[_0xfbd7('0x20')]===_0xfbd7('0x21')&&typeof _0x3e9941[_0xfbd7('0x22')]==='undefined';var _0x4926c2=_0x222a60[_0xfbd7('0x23')];var _0x21471f=_0x3fb1fe?0x0:_0x3e9941[_0xfbd7('0x20')];var _0x51052c=_0x3fb1fe?_0x222a60[_0xfbd7('0x23')]:_0x3e9941['offset']+_0x3e9941[_0xfbd7('0x22')];var _0x8d135f;if(_0x51052c>=_0x4926c2){_0x51052c=_0x4926c2;_0x8d135f=0xc8;}else{_0x8d135f=0xce;}_0x277c9f[_0xfbd7('0x1d')](_0x8d135f);return _0x277c9f[_0xfbd7('0x24')](_0xfbd7('0x25'),_0x21471f+'-'+_0x51052c+'/'+_0x4926c2)[_0xfbd7('0x1f')](_0x222a60);}return null;};}function patchUpdates(_0x54e6c6){return function(_0x4ca4c7){try{jsonpatch[_0xfbd7('0x26')](_0x4ca4c7,_0x54e6c6,!![]);}catch(_0x103d8b){return BPromise[_0xfbd7('0x27')](_0x103d8b);}return _0x4ca4c7[_0xfbd7('0x28')]();};}function saveUpdates(_0x4386b8,_0x4ff740){return function(_0x471804){if(_0x471804){return _0x471804[_0xfbd7('0x29')](_0x4386b8)['then'](function(_0x1f5e02){return _0x1f5e02;});}return null;};}function removeEntity(_0x33db45,_0x5418fa){return function(_0x5aafb0){if(_0x5aafb0){return _0x5aafb0[_0xfbd7('0x2a')]()['then'](function(){var _0x2d9e4b=_0x5aafb0[_0xfbd7('0x2b')]({'plain':!![]});var _0x479fdd=_0xfbd7('0x2c');return db[_0xfbd7('0x2d')][_0xfbd7('0x2a')]({'where':{'type':_0x479fdd,'resourceId':_0x2d9e4b['id']}})[_0xfbd7('0x2e')](function(){return _0x5aafb0;});})[_0xfbd7('0x2e')](function(){_0x33db45[_0xfbd7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17be58,_0x57e708){return function(_0x30471c){if(!_0x30471c){_0x17be58[_0xfbd7('0x2f')](0x194);}return _0x30471c;};}function handleError(_0x3210ab,_0x330d51){_0x330d51=_0x330d51||0x1f4;return function(_0x16fdb8){logger[_0xfbd7('0x30')](_0x16fdb8[_0xfbd7('0x31')]);if(_0x16fdb8[_0xfbd7('0x32')]){delete _0x16fdb8[_0xfbd7('0x32')];}_0x3210ab['status'](_0x330d51)[_0xfbd7('0x33')](_0x16fdb8);};}exports['index']=function(_0x4b4761,_0x4529dd){var _0x1f24c9={},_0x37aa67={},_0x1a00b3={'count':0x0,'rows':[]};var _0x4795b6=_[_0xfbd7('0x34')](db[_0xfbd7('0x35')]['rawAttributes'],function(_0x4ff3e3){return{'name':_0x4ff3e3[_0xfbd7('0x36')],'type':_0x4ff3e3['type'][_0xfbd7('0x37')]};});_0x37aa67[_0xfbd7('0x38')]=_['map'](_0x4795b6,_0xfbd7('0x32'));_0x37aa67[_0xfbd7('0x39')]=_[_0xfbd7('0x3a')](_0x4b4761[_0xfbd7('0x39')]);_0x37aa67[_0xfbd7('0x3b')]=_[_0xfbd7('0x3c')](_0x37aa67['model'],_0x37aa67[_0xfbd7('0x39')]);_0x1f24c9[_0xfbd7('0x3d')]=_[_0xfbd7('0x3c')](_0x37aa67['model'],qs['fields'](_0x4b4761[_0xfbd7('0x39')]['fields']));_0x1f24c9['attributes']=_0x1f24c9[_0xfbd7('0x3d')][_0xfbd7('0x3e')]?_0x1f24c9[_0xfbd7('0x3d')]:_0x37aa67['model'];if(!_0x4b4761[_0xfbd7('0x39')][_0xfbd7('0x3f')](_0xfbd7('0x40'))){_0x1f24c9[_0xfbd7('0x22')]=qs[_0xfbd7('0x22')](_0x4b4761[_0xfbd7('0x39')][_0xfbd7('0x22')]);_0x1f24c9[_0xfbd7('0x20')]=qs[_0xfbd7('0x20')](_0x4b4761['query']['offset']);}_0x1f24c9[_0xfbd7('0x41')]=qs[_0xfbd7('0x42')](_0x4b4761[_0xfbd7('0x39')][_0xfbd7('0x42')]);_0x1f24c9[_0xfbd7('0x43')]=qs[_0xfbd7('0x3b')](_[_0xfbd7('0x44')](_0x4b4761[_0xfbd7('0x39')],_0x37aa67['filters']),_0x4795b6);if(_0x4b4761[_0xfbd7('0x39')][_0xfbd7('0x45')]){_0x1f24c9[_0xfbd7('0x43')]=_['merge'](_0x1f24c9['where'],{'$or':_[_0xfbd7('0x34')](_0x4795b6,function(_0x2b39ac){if(_0x2b39ac[_0xfbd7('0x46')]!==_0xfbd7('0x47')){var _0xebb764={};_0xebb764[_0x2b39ac[_0xfbd7('0x32')]]={'$like':'%'+_0x4b4761[_0xfbd7('0x39')][_0xfbd7('0x45')]+'%'};return _0xebb764;}})});}_0x1f24c9=_[_0xfbd7('0x48')]({},_0x1f24c9,_0x4b4761[_0xfbd7('0x49')]);var _0x3c266e={'where':_0x1f24c9[_0xfbd7('0x43')]};return db[_0xfbd7('0x35')]['count'](_0x3c266e)[_0xfbd7('0x2e')](function(_0xb4104d){_0x1a00b3[_0xfbd7('0x23')]=_0xb4104d;if(_0x4b4761[_0xfbd7('0x39')][_0xfbd7('0x4a')]){_0x1f24c9['include']=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0xfbd7('0x4b')](_0x1f24c9);})[_0xfbd7('0x2e')](function(_0x429ba5){_0x1a00b3[_0xfbd7('0x4c')]=_0x429ba5;return _0x1a00b3;})[_0xfbd7('0x2e')](respondWithFilteredResult(_0x4529dd,_0x1f24c9))[_0xfbd7('0x4d')](handleError(_0x4529dd,null));};exports[_0xfbd7('0x4e')]=function(_0x37ddd6,_0x4db891){var _0x586615={'raw':!![],'where':{'id':_0x37ddd6[_0xfbd7('0x4f')]['id']}},_0x3143ec={};_0x3143ec[_0xfbd7('0x38')]=_[_0xfbd7('0x3a')](db[_0xfbd7('0x35')][_0xfbd7('0x50')]);_0x3143ec[_0xfbd7('0x39')]=_[_0xfbd7('0x3a')](_0x37ddd6[_0xfbd7('0x39')]);_0x3143ec[_0xfbd7('0x3b')]=_[_0xfbd7('0x3c')](_0x3143ec[_0xfbd7('0x38')],_0x3143ec['query']);_0x586615[_0xfbd7('0x3d')]=_[_0xfbd7('0x3c')](_0x3143ec[_0xfbd7('0x38')],qs['fields'](_0x37ddd6[_0xfbd7('0x39')]['fields']));_0x586615[_0xfbd7('0x3d')]=_0x586615[_0xfbd7('0x3d')][_0xfbd7('0x3e')]?_0x586615[_0xfbd7('0x3d')]:_0x3143ec['model'];if(_0x37ddd6[_0xfbd7('0x39')][_0xfbd7('0x4a')]){_0x586615[_0xfbd7('0x51')]=[{'all':!![]}];}_0x586615=_['merge']({},_0x586615,_0x37ddd6[_0xfbd7('0x49')]);return db[_0xfbd7('0x35')][_0xfbd7('0x52')](_0x586615)[_0xfbd7('0x2e')](handleEntityNotFound(_0x4db891,null))[_0xfbd7('0x2e')](respondWithResult(_0x4db891,null))[_0xfbd7('0x4d')](handleError(_0x4db891,null));};exports[_0xfbd7('0x53')]=function(_0x30b3e0,_0x18d574){return db[_0xfbd7('0x35')][_0xfbd7('0x53')](_0x30b3e0['body'],{})[_0xfbd7('0x2e')](function(_0x5a4197){var _0x2a120d=_0x30b3e0[_0xfbd7('0x54')][_0xfbd7('0x2b')]({'plain':!![]});if(!_0x2a120d)throw new Error(_0xfbd7('0x55'));if(_0x2a120d[_0xfbd7('0x56')]===_0xfbd7('0x54')){var _0x50739e=_0x5a4197[_0xfbd7('0x2b')]({'plain':!![]});var _0x21dbe7=_0xfbd7('0x57');return db[_0xfbd7('0x58')][_0xfbd7('0x52')]({'where':{'name':_0x21dbe7,'userProfileId':_0x2a120d[_0xfbd7('0x59')]},'raw':!![]})['then'](function(_0x52ad75){if(_0x52ad75&&_0x52ad75[_0xfbd7('0x5a')]===0x0){return db[_0xfbd7('0x2d')]['create']({'name':_0x50739e[_0xfbd7('0x32')],'resourceId':_0x50739e['id'],'type':_0xfbd7('0x2c'),'sectionId':_0x52ad75['id']},{})['then'](function(){return _0x5a4197;});}else{return _0x5a4197;}})[_0xfbd7('0x4d')](function(_0x2fb0d6){logger[_0xfbd7('0x30')](_0xfbd7('0x5b'),_0x2fb0d6);throw _0x2fb0d6;});}return _0x5a4197;})[_0xfbd7('0x2e')](respondWithResult(_0x18d574,0xc9))[_0xfbd7('0x4d')](handleError(_0x18d574,null));};exports[_0xfbd7('0x29')]=function(_0x3f9a3b,_0x2cbf42){if(_0x3f9a3b[_0xfbd7('0x5c')]['id']){delete _0x3f9a3b['body']['id'];}return db[_0xfbd7('0x35')][_0xfbd7('0x52')]({'where':{'id':_0x3f9a3b[_0xfbd7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2cbf42,null))[_0xfbd7('0x2e')](saveUpdates(_0x3f9a3b[_0xfbd7('0x5c')],null))['then'](respondWithResult(_0x2cbf42,null))[_0xfbd7('0x4d')](handleError(_0x2cbf42,null));};exports['destroy']=function(_0x53322d,_0x5ef480){return db[_0xfbd7('0x35')]['find']({'where':{'id':_0x53322d[_0xfbd7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5ef480,null))[_0xfbd7('0x2e')](removeEntity(_0x5ef480,null))[_0xfbd7('0x4d')](handleError(_0x5ef480,null));};exports['preview']=function(_0x2a6c77,_0x3d301b){var _0x9c473b=0xa;var _0x9e0cea=[_0xfbd7('0x5d'),_0xfbd7('0x5e'),_0xfbd7('0x5f'),'cross_join'];var _0x4f446c={'SUM':_0xfbd7('0x60'),'COUNT':_0xfbd7('0x61'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfbd7('0x62'),'MIN':_0xfbd7('0x63'),'AVG':_0xfbd7('0x64'),'GROUP_CONCAT':_0xfbd7('0x65'),'GROUP_CONCAT ASC':_0xfbd7('0x66'),'GROUP_CONCAT DESC':_0xfbd7('0x67')};var _0x3fd6c4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfbd7('0x68'),'HOUR':_0xfbd7('0x69'),'ROUND':_0xfbd7('0x6a'),'UNIX_TIMESTAMP':_0xfbd7('0x6b')};var _0x2e576f=function(_0x268faa){return!_['includes']([_0xfbd7('0x6c'),_0xfbd7('0x6d'),_0xfbd7('0x6e'),_0xfbd7('0x6f')],_0x268faa);};var _0x15ed60=function(_0x5f2be1){if(!_0x5f2be1||!_0x5f2be1[_0xfbd7('0x70')][_0xfbd7('0x3e')]){return'';}for(var _0xcec721='(',_0x5106fd=0x0;_0x5106fd<_0x5f2be1[_0xfbd7('0x70')]['length'];_0x5106fd+=0x1){_0x5106fd>0x0&&(_0xcec721+='\x20'+_0x5f2be1['operator']+'\x20');_0xcec721+=_0x5f2be1[_0xfbd7('0x70')][_0x5106fd][_0xfbd7('0x71')]?_0x15ed60(_0x5f2be1[_0xfbd7('0x70')][_0x5106fd][_0xfbd7('0x71')]):_0x5f2be1[_0xfbd7('0x70')][_0x5106fd][_0xfbd7('0x72')]+'\x20'+_0x5f2be1[_0xfbd7('0x70')][_0x5106fd][_0xfbd7('0x73')]+(_0x2e576f(_0x5f2be1[_0xfbd7('0x70')][_0x5106fd][_0xfbd7('0x73')])?'\x20'+_0x5f2be1[_0xfbd7('0x70')][_0x5106fd][_0xfbd7('0x74')]:'');}return _0xcec721+')';};var _0x4cabbc={'where':{'id':_0x2a6c77[_0xfbd7('0x4f')]['id']}},_0xccf496,_0x3a62b7,_0x11388d,_0xc9e1bb,_0x5b5175;_0x4cabbc=_['merge']({},_0x4cabbc,_0x2a6c77[_0xfbd7('0x49')]);return db[_0xfbd7('0x35')][_0xfbd7('0x52')](_0x4cabbc)['then'](function(_0x3fa8be){if(_0x3fa8be){_0xccf496=_0x3fa8be;return _0x3fa8be[_0xfbd7('0x75')]();}return null;})['then'](function(_0x1256ee){if(_0x1256ee){if(!_0x1256ee[_0xfbd7('0x3e')]){throw new db[(_0xfbd7('0x76'))][(_0xfbd7('0x77'))](_0xfbd7('0x78'),0x193);}_0x3a62b7=_0x1256ee;return db['AnalyticMetric'][_0xfbd7('0x4b')]({'raw':!![]});}return null;})[_0xfbd7('0x2e')](function(_0x316bc3){if(_0x316bc3){_0x11388d=_['keyBy'](_0x316bc3,'id');var _0x29c3b4;var _0x22cddb=squel[_0xfbd7('0x79')]();_0x22cddb[_0xfbd7('0x7a')](_0xccf496[_0xfbd7('0x7b')]);for(var _0x3cea8d=0x0;_0x3cea8d<_0x3a62b7[_0xfbd7('0x3e')];_0x3cea8d+=0x1){_0x29c3b4=_0x3a62b7[_0x3cea8d]['MetricId']?_0x11388d[_0x3a62b7[_0x3cea8d][_0xfbd7('0x7c')]][_0xfbd7('0x7d')]:_0x3a62b7[_0x3cea8d][_0xfbd7('0x72')];_0x29c3b4=_0x3a62b7[_0x3cea8d][_0xfbd7('0x7e')]?_['replace'](_0x4f446c[_0x3a62b7[_0x3cea8d]['function']],'%s',_0x29c3b4):_0x29c3b4;_0x29c3b4=_0x3a62b7[_0x3cea8d]['format']?_[_0xfbd7('0x7f')](_0x3fd6c4[_0x3a62b7[_0x3cea8d][_0xfbd7('0x80')]],'%s',_0x29c3b4):_0x29c3b4;if(_0x3a62b7[_0x3cea8d]['groupBy']){_0x22cddb[_0xfbd7('0x71')](_0x29c3b4);}_0x3a62b7[_0x3cea8d]['orderBy']&&_0x22cddb['order'](_0x29c3b4,_0x3a62b7[_0x3cea8d][_0xfbd7('0x81')]==='DESC'?![]:!![]);_0x22cddb[_0xfbd7('0x72')](_0x29c3b4,_0x3a62b7[_0x3cea8d][_0xfbd7('0x82')]||_0x29c3b4);}if(_0xccf496['joins']){_0xccf496[_0xfbd7('0x83')]=JSON[_0xfbd7('0x84')](_0xccf496[_0xfbd7('0x83')]);for(var _0x81290f=0x0;_0x81290f<_0xccf496[_0xfbd7('0x83')][_0xfbd7('0x3e')];_0x81290f+=0x1){if(_0xccf496[_0xfbd7('0x83')][_0x81290f]['type']&&_['includes'](_0x9e0cea,_0xccf496[_0xfbd7('0x83')][_0x81290f][_0xfbd7('0x46')])&&_0xccf496[_0xfbd7('0x83')][_0x81290f][_0xfbd7('0x85')]&&_0xccf496['joins'][_0x81290f][_0xfbd7('0x86')]&&_0xccf496[_0xfbd7('0x83')][_0x81290f][_0xfbd7('0x87')]){_0x22cddb[_0xccf496[_0xfbd7('0x83')][_0x81290f][_0xfbd7('0x46')]](_0xccf496['joins'][_0x81290f][_0xfbd7('0x86')],null,util[_0xfbd7('0x80')]('%s.%s\x20=\x20%s.%s',_0xccf496['table'],_0xccf496[_0xfbd7('0x83')][_0x81290f][_0xfbd7('0x85')],_0xccf496[_0xfbd7('0x83')][_0x81290f]['foreignTable'],_0xccf496['joins'][_0x81290f][_0xfbd7('0x87')]));}}}if(_0xccf496['conditions']){_0xccf496[_0xfbd7('0x88')]=JSON[_0xfbd7('0x84')](_0xccf496[_0xfbd7('0x88')]);_0x22cddb[_0xfbd7('0x43')](_0x15ed60(_0xccf496[_0xfbd7('0x88')]['group']));}_0x5b5175=_0x22cddb['clone']();_0x22cddb['limit'](_0x9c473b);_0x22cddb[_0xfbd7('0x20')](0x0);logger[_0xfbd7('0x89')](_0xfbd7('0x8a'),_0x22cddb[_0xfbd7('0x8b')]());return dbH[_0xfbd7('0x8c')]['query'](_0x22cddb['toString'](),{'type':dbH[_0xfbd7('0x8c')][_0xfbd7('0x8d')]['SELECT']});}})[_0xfbd7('0x2e')](respondWithResult(_0x3d301b,null))[_0xfbd7('0x4d')](handleError(_0x3d301b,null));};function runReport(_0x459dbb,_0x283e63,_0x36cbf8){var _0x29bdb3=_0x283e63[_0xfbd7('0x32')];var _0x2474e2=0xa;var _0x16cfff=[_0xfbd7('0x5d'),'left_join',_0xfbd7('0x5f'),_0xfbd7('0x8e')];var _0x251b66={'SUM':_0xfbd7('0x60'),'COUNT':_0xfbd7('0x61'),'COUNT DISTINCT':_0xfbd7('0x8f'),'MAX':'MAX(%s)','MIN':_0xfbd7('0x63'),'AVG':_0xfbd7('0x64'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xfbd7('0x66'),'GROUP_CONCAT DESC':_0xfbd7('0x67')};var _0x1cdaa0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xfbd7('0x69'),'ROUND':_0xfbd7('0x6a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x8c89f2=function(_0x51a086){return!_[_0xfbd7('0x90')]([_0xfbd7('0x6c'),_0xfbd7('0x6d'),_0xfbd7('0x6e'),_0xfbd7('0x6f')],_0x51a086);};var _0x343061=function(_0x2aca90){if(!_0x2aca90||!_0x2aca90[_0xfbd7('0x70')][_0xfbd7('0x3e')]){return'';}for(var _0x18c341='(',_0x1cf8bc=0x0;_0x1cf8bc<_0x2aca90['rules'][_0xfbd7('0x3e')];_0x1cf8bc+=0x1){_0x1cf8bc>0x0&&(_0x18c341+='\x20'+_0x2aca90['operator']+'\x20');_0x18c341+=_0x2aca90[_0xfbd7('0x70')][_0x1cf8bc][_0xfbd7('0x71')]?_0x343061(_0x2aca90[_0xfbd7('0x70')][_0x1cf8bc]['group']):_0x2aca90[_0xfbd7('0x70')][_0x1cf8bc][_0xfbd7('0x72')]+'\x20'+_0x2aca90[_0xfbd7('0x70')][_0x1cf8bc]['condition']+(_0x8c89f2(_0x2aca90[_0xfbd7('0x70')][_0x1cf8bc]['condition'])?'\x20'+_0x2aca90[_0xfbd7('0x70')][_0x1cf8bc][_0xfbd7('0x74')]:'');}return _0x18c341+')';};var _0x121d28={'where':{'id':_0x459dbb['id']}},_0x2c592e,_0x1edc0c,_0x19affe,_0xc6ba85,_0x4be463;_0x121d28=_['merge']({},_0x121d28,_0x36cbf8);return db['AnalyticDefaultReport'][_0xfbd7('0x52')](_0x121d28)['then'](function(_0x67b7f){if(_0x67b7f){_0x2c592e=_0x67b7f;return _0x67b7f[_0xfbd7('0x75')]();}return null;})[_0xfbd7('0x2e')](function(_0x20b3ae){if(_0x20b3ae){if(!_0x20b3ae[_0xfbd7('0x3e')]){throw new db['Sequelize'][(_0xfbd7('0x77'))](_0xfbd7('0x78'),0x193);}_0x1edc0c=_0x20b3ae;return db[_0xfbd7('0x91')][_0xfbd7('0x4b')]({'raw':!![]});}return null;})['then'](function(_0x58cac2){if(_0x58cac2){_0x19affe=_['keyBy'](_0x58cac2,'id');var _0x54897a;var _0x563a0f=squel['select']();_0x563a0f[_0xfbd7('0x7a')](_0x2c592e[_0xfbd7('0x7b')]);for(var _0x1e89e3=0x0;_0x1e89e3<_0x1edc0c['length'];_0x1e89e3+=0x1){_0x54897a=_0x1edc0c[_0x1e89e3][_0xfbd7('0x7c')]?_0x19affe[_0x1edc0c[_0x1e89e3][_0xfbd7('0x7c')]][_0xfbd7('0x7d')]:_0x1edc0c[_0x1e89e3][_0xfbd7('0x72')];_0x54897a=_0x1edc0c[_0x1e89e3][_0xfbd7('0x7e')]?_[_0xfbd7('0x7f')](_0x251b66[_0x1edc0c[_0x1e89e3]['function']],'%s',_0x54897a):_0x54897a;_0x54897a=_0x1edc0c[_0x1e89e3][_0xfbd7('0x80')]?_[_0xfbd7('0x7f')](_0x1cdaa0[_0x1edc0c[_0x1e89e3][_0xfbd7('0x80')]],'%s',_0x54897a):_0x54897a;if(_0x1edc0c[_0x1e89e3][_0xfbd7('0x92')]){_0x563a0f[_0xfbd7('0x71')](_0x54897a);}_0x1edc0c[_0x1e89e3]['orderBy']&&_0x563a0f[_0xfbd7('0x41')](_0x54897a,_0x1edc0c[_0x1e89e3][_0xfbd7('0x81')]==='DESC'?![]:!![]);_0x563a0f[_0xfbd7('0x72')](_0x54897a,_0x1edc0c[_0x1e89e3][_0xfbd7('0x82')]||_0x54897a);}if(_0x2c592e[_0xfbd7('0x83')]){_0x2c592e[_0xfbd7('0x83')]=JSON[_0xfbd7('0x84')](_0x2c592e[_0xfbd7('0x83')]);for(var _0x5260cb=0x0;_0x5260cb<_0x2c592e['joins']['length'];_0x5260cb+=0x1){if(_0x2c592e[_0xfbd7('0x83')][_0x5260cb][_0xfbd7('0x46')]&&_[_0xfbd7('0x90')](_0x16cfff,_0x2c592e[_0xfbd7('0x83')][_0x5260cb]['type'])&&_0x2c592e['joins'][_0x5260cb][_0xfbd7('0x85')]&&_0x2c592e[_0xfbd7('0x83')][_0x5260cb]['foreignTable']&&_0x2c592e[_0xfbd7('0x83')][_0x5260cb][_0xfbd7('0x87')]){_0x563a0f[_0x2c592e[_0xfbd7('0x83')][_0x5260cb]['type']](_0x2c592e['joins'][_0x5260cb][_0xfbd7('0x86')],null,util[_0xfbd7('0x80')](_0xfbd7('0x93'),_0x2c592e[_0xfbd7('0x7b')],_0x2c592e[_0xfbd7('0x83')][_0x5260cb][_0xfbd7('0x85')],_0x2c592e[_0xfbd7('0x83')][_0x5260cb][_0xfbd7('0x86')],_0x2c592e['joins'][_0x5260cb][_0xfbd7('0x87')]));}}}if(_0x2c592e[_0xfbd7('0x88')]){_0x2c592e['conditions']=JSON[_0xfbd7('0x84')](_0x2c592e[_0xfbd7('0x88')]);_0x563a0f[_0xfbd7('0x43')](_0x343061(_0x2c592e[_0xfbd7('0x88')][_0xfbd7('0x71')]));}_0x4be463=_0x563a0f[_0xfbd7('0x94')]();_0x563a0f[_0xfbd7('0x22')](_0x2474e2);_0x563a0f[_0xfbd7('0x20')](0x0);return;}})['then'](function(){if(_0x283e63['output']==='web'){return null;}var _0xf033b5=_[_0xfbd7('0x48')](_0x283e63,{'name':_0x283e63[_0xfbd7('0x95')]||_0x283e63['name']||_0x2c592e['name'],'basename':_0x29bdb3,'savename':util[_0xfbd7('0x80')](_0xfbd7('0x96'),_0x283e63['name']||_0x2c592e[_0xfbd7('0x32')],require(_0xfbd7('0x97'))[_0xfbd7('0x98')](0x4),_0x283e63[_0xfbd7('0x99')]||'csv'),'reportId':_0x2c592e['id'],'reportType':_0xfbd7('0x9a')});return db['AnalyticExtractedReport'][_0xfbd7('0x53')](_0xf033b5,{'raw':!![]});})[_0xfbd7('0x2e')](function(_0xf5394){if(_0x2c592e[_0xfbd7('0x7b')]===_0xfbd7('0x9b')){_0x4be463[_0xfbd7('0x43')](_0x2c592e[_0xfbd7('0x7b')]+_0xfbd7('0x9c'),_0x283e63['startDate'],_0x283e63[_0xfbd7('0x9d')]);}else{_0x4be463[_0xfbd7('0x43')](_0x2c592e[_0xfbd7('0x7b')]+_0xfbd7('0x9e'),_0x283e63[_0xfbd7('0x9f')],_0x283e63[_0xfbd7('0x9d')]);}if(_0xf5394){logger['info'](_0xfbd7('0xa0'),_0x4be463[_0xfbd7('0x8b')]());require(_0xfbd7('0xa1'))[_0xfbd7('0xa2')](path[_0xfbd7('0x5d')](__dirname,_0xfbd7('0xa3'),_0xf5394[_0xfbd7('0x99')]),[_0xf5394['id'],_0x4be463[_0xfbd7('0x8b')](),path[_0xfbd7('0x5d')](__dirname,'../../files/reports',_0xf5394[_0xfbd7('0xa4')]),_0x29bdb3]);return _0xf5394;}else{var _0x23f61d=squel[_0xfbd7('0x79')]();_0x23f61d[_0xfbd7('0x7a')]('('+_0x4be463[_0xfbd7('0x8b')]()+')',_0xfbd7('0xa5'));_0x23f61d[_0xfbd7('0x72')](_0xfbd7('0xa6'),_0xfbd7('0x23'));_0x4be463[_0xfbd7('0x22')](_0x283e63[_0xfbd7('0x22')]||_0x2474e2);_0x4be463[_0xfbd7('0x20')](_0x283e63['offset']||0x0);return dbH[_0xfbd7('0x8c')][_0xfbd7('0x39')](_0x23f61d[_0xfbd7('0x8b')](),{'type':dbH[_0xfbd7('0x8c')][_0xfbd7('0x8d')][_0xfbd7('0xa7')]})[_0xfbd7('0x2e')](function(_0x155a5c){if(!_0x155a5c[_0xfbd7('0x3e')]){_0xc6ba85=0x0;}else{_0xc6ba85=_0x155a5c[0x0]['count']||0x0;}return dbH[_0xfbd7('0x8c')][_0xfbd7('0x39')](_0x4be463[_0xfbd7('0x8b')](),{'type':dbH[_0xfbd7('0x8c')]['QueryTypes'][_0xfbd7('0xa7')]});})[_0xfbd7('0x2e')](function(_0x4d271b){return{'rows':_0x4d271b||[],'count':_0xc6ba85};});}});}exports[_0xfbd7('0xa8')]=function(_0x13b7c3,_0x4ae5ca){return runReport(_0x13b7c3[_0xfbd7('0x4f')],_0x13b7c3[_0xfbd7('0x39')],_0x13b7c3['options'])[_0xfbd7('0x2e')](respondWithResult(_0x4ae5ca,null))[_0xfbd7('0x4d')](handleError(_0x4ae5ca,null));};exports['runReport']=runReport;exports['query']=function(_0x52b29c,_0x36eb59){var _0x201946=0xa;var _0x3ba007=[_0xfbd7('0x5d'),_0xfbd7('0x5e'),_0xfbd7('0x5f'),_0xfbd7('0x8e')];var _0x1e97a4={'SUM':_0xfbd7('0x60'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfbd7('0x8f'),'MAX':_0xfbd7('0x62'),'MIN':'MIN(%s)','AVG':_0xfbd7('0x64'),'GROUP_CONCAT':_0xfbd7('0x65'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xfbd7('0x67')};var _0x2363d2={'SEC_TO_TIME':_0xfbd7('0xa9'),'DATE':_0xfbd7('0x68'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4cffaf=function(_0x2d830c){return!_['includes']([_0xfbd7('0x6c'),_0xfbd7('0x6d'),_0xfbd7('0x6e'),'IS\x20NOT\x20EMPTY'],_0x2d830c);};var _0x5958be=function(_0x44d264){if(!_0x44d264||!_0x44d264['rules'][_0xfbd7('0x3e')]){return'';}for(var _0x416d86='(',_0x652ee6=0x0;_0x652ee6<_0x44d264[_0xfbd7('0x70')][_0xfbd7('0x3e')];_0x652ee6+=0x1){_0x652ee6>0x0&&(_0x416d86+='\x20'+_0x44d264[_0xfbd7('0xaa')]+'\x20');_0x416d86+=_0x44d264[_0xfbd7('0x70')][_0x652ee6][_0xfbd7('0x71')]?_0x5958be(_0x44d264[_0xfbd7('0x70')][_0x652ee6]['group']):_0x44d264[_0xfbd7('0x70')][_0x652ee6][_0xfbd7('0x72')]+'\x20'+_0x44d264[_0xfbd7('0x70')][_0x652ee6][_0xfbd7('0x73')]+(_0x4cffaf(_0x44d264[_0xfbd7('0x70')][_0x652ee6][_0xfbd7('0x73')])?'\x20'+_0x44d264[_0xfbd7('0x70')][_0x652ee6][_0xfbd7('0x74')]:'');}return _0x416d86+')';};var _0x1e334f={'where':{'id':_0x52b29c[_0xfbd7('0x4f')]['id']}},_0x506c3e,_0x28db38,_0x345ea5,_0x2b717c,_0x338de4;_0x1e334f=_[_0xfbd7('0x48')]({},_0x1e334f,_0x52b29c[_0xfbd7('0x49')]);return db['AnalyticDefaultReport']['find'](_0x1e334f)[_0xfbd7('0x2e')](function(_0x28d0b3){if(_0x28d0b3){_0x506c3e=_0x28d0b3;return _0x28d0b3[_0xfbd7('0x75')]();}return null;})[_0xfbd7('0x2e')](function(_0x222e9c){if(_0x222e9c){if(!_0x222e9c[_0xfbd7('0x3e')]){throw new db[(_0xfbd7('0x76'))]['ValidationErrorItem'](_0xfbd7('0x78'),0x193);}_0x28db38=_0x222e9c;return db[_0xfbd7('0x91')][_0xfbd7('0x4b')]({'raw':!![]});}return null;})[_0xfbd7('0x2e')](function(_0x1bb907){if(_0x1bb907){_0x345ea5=_[_0xfbd7('0xab')](_0x1bb907,'id');var _0x21d603;var _0x1167d5=squel[_0xfbd7('0x79')]();_0x1167d5[_0xfbd7('0x7a')](_0x506c3e['table']);for(var _0x19ffe9=0x0;_0x19ffe9<_0x28db38['length'];_0x19ffe9+=0x1){_0x21d603=_0x28db38[_0x19ffe9][_0xfbd7('0x7c')]?_0x345ea5[_0x28db38[_0x19ffe9][_0xfbd7('0x7c')]]['metric']:_0x28db38[_0x19ffe9][_0xfbd7('0x72')];_0x21d603=_0x28db38[_0x19ffe9][_0xfbd7('0x7e')]?_[_0xfbd7('0x7f')](_0x1e97a4[_0x28db38[_0x19ffe9][_0xfbd7('0x7e')]],'%s',_0x21d603):_0x21d603;_0x21d603=_0x28db38[_0x19ffe9][_0xfbd7('0x80')]?_[_0xfbd7('0x7f')](_0x2363d2[_0x28db38[_0x19ffe9][_0xfbd7('0x80')]],'%s',_0x21d603):_0x21d603;if(_0x28db38[_0x19ffe9][_0xfbd7('0x92')]){_0x1167d5[_0xfbd7('0x71')](_0x21d603);}_0x28db38[_0x19ffe9][_0xfbd7('0x81')]&&_0x1167d5[_0xfbd7('0x41')](_0x21d603,_0x28db38[_0x19ffe9][_0xfbd7('0x81')]===_0xfbd7('0xac')?![]:!![]);_0x1167d5[_0xfbd7('0x72')](_0x21d603,_0x28db38[_0x19ffe9][_0xfbd7('0x82')]||_0x21d603);}if(_0x506c3e['joins']){_0x506c3e[_0xfbd7('0x83')]=JSON[_0xfbd7('0x84')](_0x506c3e[_0xfbd7('0x83')]);for(var _0xe64b9f=0x0;_0xe64b9f<_0x506c3e[_0xfbd7('0x83')][_0xfbd7('0x3e')];_0xe64b9f+=0x1){if(_0x506c3e[_0xfbd7('0x83')][_0xe64b9f]['type']&&_[_0xfbd7('0x90')](_0x3ba007,_0x506c3e[_0xfbd7('0x83')][_0xe64b9f][_0xfbd7('0x46')])&&_0x506c3e[_0xfbd7('0x83')][_0xe64b9f][_0xfbd7('0x85')]&&_0x506c3e['joins'][_0xe64b9f][_0xfbd7('0x86')]&&_0x506c3e[_0xfbd7('0x83')][_0xe64b9f][_0xfbd7('0x87')]){_0x1167d5[_0x506c3e[_0xfbd7('0x83')][_0xe64b9f][_0xfbd7('0x46')]](_0x506c3e[_0xfbd7('0x83')][_0xe64b9f][_0xfbd7('0x86')],null,util[_0xfbd7('0x80')](_0xfbd7('0x93'),_0x506c3e['table'],_0x506c3e[_0xfbd7('0x83')][_0xe64b9f][_0xfbd7('0x85')],_0x506c3e[_0xfbd7('0x83')][_0xe64b9f][_0xfbd7('0x86')],_0x506c3e['joins'][_0xe64b9f][_0xfbd7('0x87')]));}}}if(_0x506c3e['conditions']){_0x506c3e[_0xfbd7('0x88')]=JSON[_0xfbd7('0x84')](_0x506c3e[_0xfbd7('0x88')]);_0x1167d5[_0xfbd7('0x43')](_0x5958be(_0x506c3e[_0xfbd7('0x88')][_0xfbd7('0x71')]));}_0x338de4=_0x1167d5[_0xfbd7('0x94')]();_0x1167d5[_0xfbd7('0x22')](_0x201946);_0x1167d5['offset'](0x0);logger[_0xfbd7('0x89')](_0xfbd7('0x8a'),_0x1167d5['toString']());return dbH['sequelize']['query'](_0x1167d5['toString'](),{'type':dbH[_0xfbd7('0x8c')]['QueryTypes'][_0xfbd7('0xa7')]});}})[_0xfbd7('0x2e')](function(){return{'sql':_0x338de4[_0xfbd7('0x8b')]()};})[_0xfbd7('0x2e')](respondWithResult(_0x36eb59,null))['catch'](handleError(_0x36eb59,null));};
\ No newline at end of file
+var _0x86d8=['AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','AVG(%s)','metric','eml-format','rimraf','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','DefaultReports','UserProfileResource','then','end','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','AnalyticDefaultReport','findAll','catch','show','rawAttributes','options','find','create','body','user','Reports','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','select','table','MetricId','function','format','groupBy','orderBy','DESC','field','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','IS\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','replace','alias','foreignKey','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','default'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x86d8,0xb8));var _0x886d=function(_0x126c0d,_0x1644a5){_0x126c0d=_0x126c0d-0x0;var _0x299c58=_0x86d8[_0x126c0d];return _0x299c58;};'use strict';var emlformat=require(_0x886d('0x0'));var rimraf=require(_0x886d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x886d('0x2'));var BPromise=require(_0x886d('0x3'));var Mustache=require('mustache');var util=require(_0x886d('0x4'));var path=require('path');var sox=require(_0x886d('0x5'));var csv=require(_0x886d('0x6'));var ejs=require(_0x886d('0x7'));var fs=require('fs');var fs_extra=require(_0x886d('0x8'));var _=require(_0x886d('0x9'));var squel=require('squel');var crypto=require(_0x886d('0xa'));var jsforce=require(_0x886d('0xb'));var deskjs=require(_0x886d('0xc'));var toCsv=require(_0x886d('0x6'));var querystring=require(_0x886d('0xd'));var Papa=require(_0x886d('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x886d('0xf'));var as=require(_0x886d('0x10'));var hardwareService=require(_0x886d('0x11'));var logger=require(_0x886d('0x12'))('api');var utils=require(_0x886d('0x13'));var config=require(_0x886d('0x14'));var licenseUtil=require(_0x886d('0x15'));var db=require(_0x886d('0x16'))['db'];var dbH=require(_0x886d('0x16'))['dbH'];function respondWithStatusCode(_0x256dd3,_0x3792fb){_0x3792fb=_0x3792fb||0xcc;return function(_0xe2c474){if(_0xe2c474){return _0x256dd3[_0x886d('0x17')](_0x3792fb);}return _0x256dd3[_0x886d('0x18')](_0x3792fb)['end']();};}function respondWithResult(_0x27be85,_0x34a8ee){_0x34a8ee=_0x34a8ee||0xc8;return function(_0x57447f){if(_0x57447f){return _0x27be85[_0x886d('0x18')](_0x34a8ee)['json'](_0x57447f);}};}function respondWithFilteredResult(_0x5d5601,_0x5e590e){return function(_0x39d857){if(_0x39d857){var _0x2a2380=typeof _0x5e590e['offset']===_0x886d('0x19')&&typeof _0x5e590e[_0x886d('0x1a')]===_0x886d('0x19');var _0x4be275=_0x39d857[_0x886d('0x1b')];var _0x40fa6d=_0x2a2380?0x0:_0x5e590e['offset'];var _0x422207=_0x2a2380?_0x39d857[_0x886d('0x1b')]:_0x5e590e['offset']+_0x5e590e[_0x886d('0x1a')];var _0xef89ef;if(_0x422207>=_0x4be275){_0x422207=_0x4be275;_0xef89ef=0xc8;}else{_0xef89ef=0xce;}_0x5d5601[_0x886d('0x18')](_0xef89ef);return _0x5d5601[_0x886d('0x1c')](_0x886d('0x1d'),_0x40fa6d+'-'+_0x422207+'/'+_0x4be275)[_0x886d('0x1e')](_0x39d857);}return null;};}function patchUpdates(_0x1acee9){return function(_0x307e10){try{jsonpatch[_0x886d('0x1f')](_0x307e10,_0x1acee9,!![]);}catch(_0x508383){return BPromise[_0x886d('0x20')](_0x508383);}return _0x307e10[_0x886d('0x21')]();};}function saveUpdates(_0x2d10e3,_0x49a34b){return function(_0x27a9cc){if(_0x27a9cc){return _0x27a9cc[_0x886d('0x22')](_0x2d10e3)['then'](function(_0x31b433){return _0x31b433;});}return null;};}function removeEntity(_0x2824fb,_0x3c8d6f){return function(_0x311a34){if(_0x311a34){return _0x311a34[_0x886d('0x23')]()['then'](function(){var _0x4359bb=_0x311a34[_0x886d('0x24')]({'plain':!![]});var _0x8942df=_0x886d('0x25');return db[_0x886d('0x26')][_0x886d('0x23')]({'where':{'type':_0x8942df,'resourceId':_0x4359bb['id']}})[_0x886d('0x27')](function(){return _0x311a34;});})['then'](function(){_0x2824fb[_0x886d('0x18')](0xcc)[_0x886d('0x28')]();});}};}function handleEntityNotFound(_0x6eee28,_0xc65bb4){return function(_0x320596){if(!_0x320596){_0x6eee28[_0x886d('0x17')](0x194);}return _0x320596;};}function handleError(_0x5ef38d,_0x8cd3cc){_0x8cd3cc=_0x8cd3cc||0x1f4;return function(_0x1756cf){logger[_0x886d('0x29')](_0x1756cf[_0x886d('0x2a')]);if(_0x1756cf[_0x886d('0x2b')]){delete _0x1756cf['name'];}_0x5ef38d[_0x886d('0x18')](_0x8cd3cc)[_0x886d('0x2c')](_0x1756cf);};}exports[_0x886d('0x2d')]=function(_0x2682d7,_0x2b5cf3){var _0x2ece66={},_0x4161da={},_0x5d1620={'count':0x0,'rows':[]};var _0x54fb76=_[_0x886d('0x2e')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x331f74){return{'name':_0x331f74[_0x886d('0x2f')],'type':_0x331f74[_0x886d('0x30')][_0x886d('0x31')]};});_0x4161da[_0x886d('0x32')]=_[_0x886d('0x2e')](_0x54fb76,_0x886d('0x2b'));_0x4161da[_0x886d('0x33')]=_[_0x886d('0x34')](_0x2682d7['query']);_0x4161da[_0x886d('0x35')]=_['intersection'](_0x4161da['model'],_0x4161da[_0x886d('0x33')]);_0x2ece66[_0x886d('0x36')]=_[_0x886d('0x37')](_0x4161da[_0x886d('0x32')],qs[_0x886d('0x38')](_0x2682d7['query']['fields']));_0x2ece66[_0x886d('0x36')]=_0x2ece66[_0x886d('0x36')][_0x886d('0x39')]?_0x2ece66[_0x886d('0x36')]:_0x4161da[_0x886d('0x32')];if(!_0x2682d7[_0x886d('0x33')][_0x886d('0x3a')](_0x886d('0x3b'))){_0x2ece66[_0x886d('0x1a')]=qs[_0x886d('0x1a')](_0x2682d7[_0x886d('0x33')][_0x886d('0x1a')]);_0x2ece66[_0x886d('0x3c')]=qs['offset'](_0x2682d7[_0x886d('0x33')][_0x886d('0x3c')]);}_0x2ece66[_0x886d('0x3d')]=qs[_0x886d('0x3e')](_0x2682d7[_0x886d('0x33')]['sort']);_0x2ece66[_0x886d('0x3f')]=qs[_0x886d('0x35')](_[_0x886d('0x40')](_0x2682d7[_0x886d('0x33')],_0x4161da[_0x886d('0x35')]),_0x54fb76);if(_0x2682d7[_0x886d('0x33')][_0x886d('0x41')]){_0x2ece66[_0x886d('0x3f')]=_[_0x886d('0x42')](_0x2ece66[_0x886d('0x3f')],{'$or':_['map'](_0x54fb76,function(_0x1f75ee){if(_0x1f75ee[_0x886d('0x30')]!==_0x886d('0x43')){var _0x273be9={};_0x273be9[_0x1f75ee['name']]={'$like':'%'+_0x2682d7[_0x886d('0x33')][_0x886d('0x41')]+'%'};return _0x273be9;}})});}_0x2ece66=_[_0x886d('0x42')]({},_0x2ece66,_0x2682d7['options']);var _0x21e7e6={'where':_0x2ece66[_0x886d('0x3f')]};return db['AnalyticDefaultReport'][_0x886d('0x1b')](_0x21e7e6)['then'](function(_0x10ac69){_0x5d1620[_0x886d('0x1b')]=_0x10ac69;if(_0x2682d7['query'][_0x886d('0x44')]){_0x2ece66[_0x886d('0x45')]=[{'all':!![]}];}return db[_0x886d('0x46')][_0x886d('0x47')](_0x2ece66);})['then'](function(_0x2438a3){_0x5d1620['rows']=_0x2438a3;return _0x5d1620;})[_0x886d('0x27')](respondWithFilteredResult(_0x2b5cf3,_0x2ece66))[_0x886d('0x48')](handleError(_0x2b5cf3,null));};exports[_0x886d('0x49')]=function(_0x46fb73,_0x3b88aa){var _0x4292c7={'raw':!![],'where':{'id':_0x46fb73['params']['id']}},_0x3545bc={};_0x3545bc[_0x886d('0x32')]=_[_0x886d('0x34')](db[_0x886d('0x46')][_0x886d('0x4a')]);_0x3545bc[_0x886d('0x33')]=_[_0x886d('0x34')](_0x46fb73[_0x886d('0x33')]);_0x3545bc[_0x886d('0x35')]=_['intersection'](_0x3545bc[_0x886d('0x32')],_0x3545bc[_0x886d('0x33')]);_0x4292c7[_0x886d('0x36')]=_[_0x886d('0x37')](_0x3545bc['model'],qs['fields'](_0x46fb73[_0x886d('0x33')]['fields']));_0x4292c7['attributes']=_0x4292c7['attributes']['length']?_0x4292c7[_0x886d('0x36')]:_0x3545bc['model'];if(_0x46fb73[_0x886d('0x33')][_0x886d('0x44')]){_0x4292c7[_0x886d('0x45')]=[{'all':!![]}];}_0x4292c7=_[_0x886d('0x42')]({},_0x4292c7,_0x46fb73[_0x886d('0x4b')]);return db[_0x886d('0x46')][_0x886d('0x4c')](_0x4292c7)[_0x886d('0x27')](handleEntityNotFound(_0x3b88aa,null))[_0x886d('0x27')](respondWithResult(_0x3b88aa,null))[_0x886d('0x48')](handleError(_0x3b88aa,null));};exports['create']=function(_0x210c5c,_0x4b4471){return db[_0x886d('0x46')][_0x886d('0x4d')](_0x210c5c[_0x886d('0x4e')],{})[_0x886d('0x27')](function(_0x5c9000){var _0x209bc5=_0x210c5c[_0x886d('0x4f')][_0x886d('0x24')]({'plain':!![]});if(!_0x209bc5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x209bc5['role']===_0x886d('0x4f')){var _0x14e8da=_0x5c9000[_0x886d('0x24')]({'plain':!![]});var _0x45d7f5=_0x886d('0x50');return db[_0x886d('0x51')][_0x886d('0x4c')]({'where':{'name':_0x45d7f5,'userProfileId':_0x209bc5['userProfileId']},'raw':!![]})['then'](function(_0x5b5309){if(_0x5b5309&&_0x5b5309['autoAssociation']===0x0){return db[_0x886d('0x26')][_0x886d('0x4d')]({'name':_0x14e8da['name'],'resourceId':_0x14e8da['id'],'type':_0x886d('0x25'),'sectionId':_0x5b5309['id']},{})[_0x886d('0x27')](function(){return _0x5c9000;});}else{return _0x5c9000;}})[_0x886d('0x48')](function(_0x1625c1){logger[_0x886d('0x29')](_0x886d('0x52'),_0x1625c1);throw _0x1625c1;});}return _0x5c9000;})[_0x886d('0x27')](respondWithResult(_0x4b4471,0xc9))[_0x886d('0x48')](handleError(_0x4b4471,null));};exports[_0x886d('0x22')]=function(_0x38dcc6,_0x1f8f2d){if(_0x38dcc6[_0x886d('0x4e')]['id']){delete _0x38dcc6[_0x886d('0x4e')]['id'];}return db[_0x886d('0x46')][_0x886d('0x4c')]({'where':{'id':_0x38dcc6[_0x886d('0x53')]['id']}})['then'](handleEntityNotFound(_0x1f8f2d,null))[_0x886d('0x27')](saveUpdates(_0x38dcc6[_0x886d('0x4e')],null))['then'](respondWithResult(_0x1f8f2d,null))[_0x886d('0x48')](handleError(_0x1f8f2d,null));};exports['destroy']=function(_0x4b2073,_0x121c0c){return db[_0x886d('0x46')][_0x886d('0x4c')]({'where':{'id':_0x4b2073[_0x886d('0x53')]['id']}})[_0x886d('0x27')](handleEntityNotFound(_0x121c0c,null))[_0x886d('0x27')](removeEntity(_0x121c0c,null))[_0x886d('0x48')](handleError(_0x121c0c,null));};exports[_0x886d('0x54')]=function(_0x56580c,_0x59a06d){var _0x1591ee=0xa;var _0x41bf33=['join',_0x886d('0x55'),_0x886d('0x56'),_0x886d('0x57')];var _0x435c57={'SUM':_0x886d('0x58'),'COUNT':_0x886d('0x59'),'COUNT DISTINCT':_0x886d('0x5a'),'MAX':_0x886d('0x5b'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x886d('0x5c'),'GROUP_CONCAT ASC':_0x886d('0x5d'),'GROUP_CONCAT DESC':_0x886d('0x5e')};var _0x33a86c={'SEC_TO_TIME':_0x886d('0x5f'),'DATE':_0x886d('0x60'),'HOUR':_0x886d('0x61'),'ROUND':_0x886d('0x62'),'UNIX_TIMESTAMP':_0x886d('0x63')};var _0x2ce82e=function(_0x11e847){return!_[_0x886d('0x64')](['IS\x20NULL',_0x886d('0x65'),_0x886d('0x66'),'IS\x20NOT\x20EMPTY'],_0x11e847);};var _0x1453e8=function(_0x42f455){if(!_0x42f455||!_0x42f455[_0x886d('0x67')][_0x886d('0x39')]){return'';}for(var _0x41fdd4='(',_0x399354=0x0;_0x399354<_0x42f455['rules'][_0x886d('0x39')];_0x399354+=0x1){_0x399354>0x0&&(_0x41fdd4+='\x20'+_0x42f455['operator']+'\x20');_0x41fdd4+=_0x42f455[_0x886d('0x67')][_0x399354][_0x886d('0x68')]?_0x1453e8(_0x42f455['rules'][_0x399354]['group']):_0x42f455[_0x886d('0x67')][_0x399354]['field']+'\x20'+_0x42f455[_0x886d('0x67')][_0x399354][_0x886d('0x69')]+(_0x2ce82e(_0x42f455[_0x886d('0x67')][_0x399354][_0x886d('0x69')])?'\x20'+_0x42f455['rules'][_0x399354][_0x886d('0x6a')]:'');}return _0x41fdd4+')';};var _0x474200={'where':{'id':_0x56580c[_0x886d('0x53')]['id']}},_0x38e758,_0x3a0804,_0x2f9600,_0x12bd96,_0x164932;_0x474200=_[_0x886d('0x42')]({},_0x474200,_0x56580c[_0x886d('0x4b')]);return db[_0x886d('0x46')][_0x886d('0x4c')](_0x474200)[_0x886d('0x27')](function(_0x3623cd){if(_0x3623cd){_0x38e758=_0x3623cd;return _0x3623cd[_0x886d('0x6b')]();}return null;})[_0x886d('0x27')](function(_0x68b4ec){if(_0x68b4ec){if(!_0x68b4ec['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x886d('0x6c'),0x193);}_0x3a0804=_0x68b4ec;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x886d('0x27')](function(_0x283708){if(_0x283708){_0x2f9600=_['keyBy'](_0x283708,'id');var _0x4deea8;var _0xaf6ace=squel[_0x886d('0x6d')]();_0xaf6ace['from'](_0x38e758[_0x886d('0x6e')]);for(var _0xf4a6bd=0x0;_0xf4a6bd<_0x3a0804[_0x886d('0x39')];_0xf4a6bd+=0x1){_0x4deea8=_0x3a0804[_0xf4a6bd][_0x886d('0x6f')]?_0x2f9600[_0x3a0804[_0xf4a6bd][_0x886d('0x6f')]]['metric']:_0x3a0804[_0xf4a6bd]['field'];_0x4deea8=_0x3a0804[_0xf4a6bd][_0x886d('0x70')]?_['replace'](_0x435c57[_0x3a0804[_0xf4a6bd][_0x886d('0x70')]],'%s',_0x4deea8):_0x4deea8;_0x4deea8=_0x3a0804[_0xf4a6bd][_0x886d('0x71')]?_['replace'](_0x33a86c[_0x3a0804[_0xf4a6bd][_0x886d('0x71')]],'%s',_0x4deea8):_0x4deea8;if(_0x3a0804[_0xf4a6bd][_0x886d('0x72')]){_0xaf6ace[_0x886d('0x68')](_0x4deea8);}_0x3a0804[_0xf4a6bd][_0x886d('0x73')]&&_0xaf6ace[_0x886d('0x3d')](_0x4deea8,_0x3a0804[_0xf4a6bd]['orderBy']===_0x886d('0x74')?![]:!![]);_0xaf6ace[_0x886d('0x75')](_0x4deea8,_0x3a0804[_0xf4a6bd]['alias']||_0x4deea8);}if(_0x38e758[_0x886d('0x76')]){_0x38e758[_0x886d('0x76')]=JSON[_0x886d('0x77')](_0x38e758[_0x886d('0x76')]);for(var _0x2349fb=0x0;_0x2349fb<_0x38e758[_0x886d('0x76')][_0x886d('0x39')];_0x2349fb+=0x1){if(_0x38e758[_0x886d('0x76')][_0x2349fb][_0x886d('0x30')]&&_[_0x886d('0x64')](_0x41bf33,_0x38e758[_0x886d('0x76')][_0x2349fb][_0x886d('0x30')])&&_0x38e758[_0x886d('0x76')][_0x2349fb][_0x886d('0x78')]&&_0x38e758['joins'][_0x2349fb][_0x886d('0x79')]&&_0x38e758[_0x886d('0x76')][_0x2349fb]['foreignKey']){_0xaf6ace[_0x38e758[_0x886d('0x76')][_0x2349fb][_0x886d('0x30')]](_0x38e758[_0x886d('0x76')][_0x2349fb][_0x886d('0x79')],null,util[_0x886d('0x71')](_0x886d('0x7a'),_0x38e758[_0x886d('0x6e')],_0x38e758[_0x886d('0x76')][_0x2349fb][_0x886d('0x78')],_0x38e758['joins'][_0x2349fb][_0x886d('0x79')],_0x38e758[_0x886d('0x76')][_0x2349fb]['foreignKey']));}}}if(_0x38e758['conditions']){_0x38e758[_0x886d('0x7b')]=JSON[_0x886d('0x77')](_0x38e758[_0x886d('0x7b')]);_0xaf6ace[_0x886d('0x3f')](_0x1453e8(_0x38e758[_0x886d('0x7b')][_0x886d('0x68')]));}_0x164932=_0xaf6ace[_0x886d('0x7c')]();_0xaf6ace[_0x886d('0x1a')](_0x1591ee);_0xaf6ace[_0x886d('0x3c')](0x0);logger[_0x886d('0x7d')](_0x886d('0x7e'),_0xaf6ace[_0x886d('0x7f')]());return dbH['sequelize'][_0x886d('0x33')](_0xaf6ace[_0x886d('0x7f')](),{'type':dbH[_0x886d('0x80')][_0x886d('0x81')][_0x886d('0x82')]});}})[_0x886d('0x27')](respondWithResult(_0x59a06d,null))[_0x886d('0x48')](handleError(_0x59a06d,null));};function runReport(_0x26ef7e,_0x24aef3,_0x849f99){var _0x3d486b=_0x24aef3[_0x886d('0x2b')];var _0x3cc5b6=0xa;var _0x27851c=[_0x886d('0x83'),_0x886d('0x55'),_0x886d('0x56'),'cross_join'];var _0x36f4d7={'SUM':_0x886d('0x58'),'COUNT':_0x886d('0x59'),'COUNT DISTINCT':_0x886d('0x5a'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x886d('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x886d('0x5e')};var _0x2e91e1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x886d('0x60'),'HOUR':_0x886d('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x886d('0x63')};var _0x29f14b=function(_0x3617ba){return!_[_0x886d('0x64')]([_0x886d('0x84'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x886d('0x85')],_0x3617ba);};var _0x1cbbc8=function(_0x443dc6){if(!_0x443dc6||!_0x443dc6[_0x886d('0x67')]['length']){return'';}for(var _0x1da850='(',_0x403ffd=0x0;_0x403ffd<_0x443dc6[_0x886d('0x67')][_0x886d('0x39')];_0x403ffd+=0x1){_0x403ffd>0x0&&(_0x1da850+='\x20'+_0x443dc6['operator']+'\x20');_0x1da850+=_0x443dc6[_0x886d('0x67')][_0x403ffd][_0x886d('0x68')]?_0x1cbbc8(_0x443dc6[_0x886d('0x67')][_0x403ffd]['group']):_0x443dc6[_0x886d('0x67')][_0x403ffd][_0x886d('0x75')]+'\x20'+_0x443dc6[_0x886d('0x67')][_0x403ffd][_0x886d('0x69')]+(_0x29f14b(_0x443dc6['rules'][_0x403ffd][_0x886d('0x69')])?'\x20'+_0x443dc6[_0x886d('0x67')][_0x403ffd][_0x886d('0x6a')]:'');}return _0x1da850+')';};var _0x43bc3b={'where':{'id':_0x26ef7e['id']}},_0x19ebaa,_0x9169cf,_0x3bc680,_0x309fbc,_0x17f0ad;_0x43bc3b=_[_0x886d('0x42')]({},_0x43bc3b,_0x849f99);return db['AnalyticDefaultReport'][_0x886d('0x4c')](_0x43bc3b)[_0x886d('0x27')](function(_0x388a26){if(_0x388a26){_0x19ebaa=_0x388a26;return _0x388a26[_0x886d('0x6b')]();}return null;})['then'](function(_0xf210b){if(_0xf210b){if(!_0xf210b[_0x886d('0x39')]){throw new db[(_0x886d('0x86'))][(_0x886d('0x87'))](_0x886d('0x6c'),0x193);}_0x9169cf=_0xf210b;return db[_0x886d('0x88')][_0x886d('0x47')]({'raw':!![]});}return null;})['then'](function(_0x2e3e6a){if(_0x2e3e6a){_0x3bc680=_[_0x886d('0x89')](_0x2e3e6a,'id');var _0x4ded18;var _0x5d2a1c=squel[_0x886d('0x6d')]();_0x5d2a1c[_0x886d('0x8a')](_0x19ebaa[_0x886d('0x6e')]);for(var _0x4561aa=0x0;_0x4561aa<_0x9169cf[_0x886d('0x39')];_0x4561aa+=0x1){_0x4ded18=_0x9169cf[_0x4561aa][_0x886d('0x6f')]?_0x3bc680[_0x9169cf[_0x4561aa][_0x886d('0x6f')]]['metric']:_0x9169cf[_0x4561aa]['field'];_0x4ded18=_0x9169cf[_0x4561aa][_0x886d('0x70')]?_[_0x886d('0x8b')](_0x36f4d7[_0x9169cf[_0x4561aa]['function']],'%s',_0x4ded18):_0x4ded18;_0x4ded18=_0x9169cf[_0x4561aa]['format']?_[_0x886d('0x8b')](_0x2e91e1[_0x9169cf[_0x4561aa][_0x886d('0x71')]],'%s',_0x4ded18):_0x4ded18;if(_0x9169cf[_0x4561aa][_0x886d('0x72')]){_0x5d2a1c[_0x886d('0x68')](_0x4ded18);}_0x9169cf[_0x4561aa][_0x886d('0x73')]&&_0x5d2a1c[_0x886d('0x3d')](_0x4ded18,_0x9169cf[_0x4561aa][_0x886d('0x73')]===_0x886d('0x74')?![]:!![]);_0x5d2a1c['field'](_0x4ded18,_0x9169cf[_0x4561aa][_0x886d('0x8c')]||_0x4ded18);}if(_0x19ebaa['joins']){_0x19ebaa[_0x886d('0x76')]=JSON[_0x886d('0x77')](_0x19ebaa[_0x886d('0x76')]);for(var _0x1396b6=0x0;_0x1396b6<_0x19ebaa[_0x886d('0x76')]['length'];_0x1396b6+=0x1){if(_0x19ebaa['joins'][_0x1396b6][_0x886d('0x30')]&&_[_0x886d('0x64')](_0x27851c,_0x19ebaa[_0x886d('0x76')][_0x1396b6][_0x886d('0x30')])&&_0x19ebaa['joins'][_0x1396b6][_0x886d('0x78')]&&_0x19ebaa[_0x886d('0x76')][_0x1396b6]['foreignTable']&&_0x19ebaa['joins'][_0x1396b6][_0x886d('0x8d')]){_0x5d2a1c[_0x19ebaa[_0x886d('0x76')][_0x1396b6]['type']](_0x19ebaa['joins'][_0x1396b6]['foreignTable'],null,util[_0x886d('0x71')]('%s.%s\x20=\x20%s.%s',_0x19ebaa[_0x886d('0x6e')],_0x19ebaa[_0x886d('0x76')][_0x1396b6][_0x886d('0x78')],_0x19ebaa[_0x886d('0x76')][_0x1396b6][_0x886d('0x79')],_0x19ebaa['joins'][_0x1396b6][_0x886d('0x8d')]));}}}if(_0x19ebaa['conditions']){_0x19ebaa[_0x886d('0x7b')]=JSON['parse'](_0x19ebaa[_0x886d('0x7b')]);_0x5d2a1c[_0x886d('0x3f')](_0x1cbbc8(_0x19ebaa[_0x886d('0x7b')][_0x886d('0x68')]));}_0x17f0ad=_0x5d2a1c[_0x886d('0x7c')]();_0x5d2a1c['limit'](_0x3cc5b6);_0x5d2a1c[_0x886d('0x3c')](0x0);return;}})[_0x886d('0x27')](function(){if(_0x24aef3['output']===_0x886d('0x8e')){return null;}var _0x2f7a52=_[_0x886d('0x42')](_0x24aef3,{'name':_0x24aef3[_0x886d('0x8f')]||_0x24aef3['name']||_0x19ebaa[_0x886d('0x2b')],'basename':_0x3d486b,'savename':util[_0x886d('0x71')](_0x886d('0x90'),_0x24aef3[_0x886d('0x2b')]||_0x19ebaa[_0x886d('0x2b')],require(_0x886d('0x91'))[_0x886d('0x92')](0x4),_0x24aef3[_0x886d('0x93')]||_0x886d('0x94')),'reportId':_0x19ebaa['id'],'reportType':_0x886d('0x95')});return db[_0x886d('0x96')][_0x886d('0x4d')](_0x2f7a52,{'raw':!![]});})[_0x886d('0x27')](function(_0xa35a9c){if(_0x19ebaa[_0x886d('0x6e')]===_0x886d('0x97')){_0x17f0ad[_0x886d('0x3f')](_0x19ebaa['table']+_0x886d('0x98'),_0x24aef3[_0x886d('0x99')],_0x24aef3[_0x886d('0x9a')]);}else{_0x17f0ad[_0x886d('0x3f')](_0x19ebaa[_0x886d('0x6e')]+_0x886d('0x9b'),_0x24aef3[_0x886d('0x99')],_0x24aef3[_0x886d('0x9a')]);}if(_0xa35a9c){logger[_0x886d('0x9c')]('Run\x20Query:',_0x17f0ad[_0x886d('0x7f')]());require(_0x886d('0x9d'))[_0x886d('0x9e')](path[_0x886d('0x83')](__dirname,_0x886d('0x9f'),_0xa35a9c[_0x886d('0x93')]),[_0xa35a9c['id'],_0x17f0ad[_0x886d('0x7f')](),path[_0x886d('0x83')](__dirname,_0x886d('0xa0'),_0xa35a9c['savename']),_0x3d486b]);return _0xa35a9c;}else{var _0x2dc7cb=squel[_0x886d('0x6d')]();_0x2dc7cb[_0x886d('0x8a')]('('+_0x17f0ad[_0x886d('0x7f')]()+')',_0x886d('0xa1'));_0x2dc7cb[_0x886d('0x75')](_0x886d('0xa2'),_0x886d('0x1b'));_0x17f0ad[_0x886d('0x1a')](_0x24aef3[_0x886d('0x1a')]||_0x3cc5b6);_0x17f0ad[_0x886d('0x3c')](_0x24aef3['offset']||0x0);return dbH[_0x886d('0x80')][_0x886d('0x33')](_0x2dc7cb[_0x886d('0x7f')](),{'type':dbH[_0x886d('0x80')][_0x886d('0x81')]['SELECT']})['then'](function(_0x3c519a){if(!_0x3c519a[_0x886d('0x39')]){_0x309fbc=0x0;}else{_0x309fbc=_0x3c519a[0x0][_0x886d('0x1b')]||0x0;}return dbH[_0x886d('0x80')][_0x886d('0x33')](_0x17f0ad[_0x886d('0x7f')](),{'type':dbH['sequelize'][_0x886d('0x81')][_0x886d('0x82')]});})[_0x886d('0x27')](function(_0x5a3428){return{'rows':_0x5a3428||[],'count':_0x309fbc};});}});}exports[_0x886d('0xa3')]=function(_0x53f189,_0x171750){return runReport(_0x53f189['params'],_0x53f189[_0x886d('0x33')],_0x53f189[_0x886d('0x4b')])[_0x886d('0x27')](respondWithResult(_0x171750,null))[_0x886d('0x48')](handleError(_0x171750,null));};exports[_0x886d('0xa4')]=runReport;exports['query']=function(_0x3aac40,_0x27cf0f){var _0x256924=0xa;var _0x3584e7=['join','left_join',_0x886d('0x56'),_0x886d('0x57')];var _0x5a33fe={'SUM':'SUM(%s)','COUNT':_0x886d('0x59'),'COUNT DISTINCT':_0x886d('0x5a'),'MAX':_0x886d('0x5b'),'MIN':'MIN(%s)','AVG':_0x886d('0xa5'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x886d('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5684f8={'SEC_TO_TIME':_0x886d('0x5f'),'DATE':_0x886d('0x60'),'HOUR':_0x886d('0x61'),'ROUND':_0x886d('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x44f5b6=function(_0x1dde4e){return!_[_0x886d('0x64')]([_0x886d('0x84'),'IS\x20NOT\x20NULL',_0x886d('0x66'),'IS\x20NOT\x20EMPTY'],_0x1dde4e);};var _0x2ef3bf=function(_0x43ee02){if(!_0x43ee02||!_0x43ee02['rules'][_0x886d('0x39')]){return'';}for(var _0x1997da='(',_0x10f3d4=0x0;_0x10f3d4<_0x43ee02[_0x886d('0x67')]['length'];_0x10f3d4+=0x1){_0x10f3d4>0x0&&(_0x1997da+='\x20'+_0x43ee02['operator']+'\x20');_0x1997da+=_0x43ee02[_0x886d('0x67')][_0x10f3d4][_0x886d('0x68')]?_0x2ef3bf(_0x43ee02[_0x886d('0x67')][_0x10f3d4][_0x886d('0x68')]):_0x43ee02['rules'][_0x10f3d4][_0x886d('0x75')]+'\x20'+_0x43ee02[_0x886d('0x67')][_0x10f3d4][_0x886d('0x69')]+(_0x44f5b6(_0x43ee02[_0x886d('0x67')][_0x10f3d4]['condition'])?'\x20'+_0x43ee02[_0x886d('0x67')][_0x10f3d4][_0x886d('0x6a')]:'');}return _0x1997da+')';};var _0x20e239={'where':{'id':_0x3aac40[_0x886d('0x53')]['id']}},_0x4e21a5,_0xa23b3,_0x249dca,_0x2bb55e,_0x4014e2;_0x20e239=_['merge']({},_0x20e239,_0x3aac40[_0x886d('0x4b')]);return db[_0x886d('0x46')][_0x886d('0x4c')](_0x20e239)['then'](function(_0x1f106d){if(_0x1f106d){_0x4e21a5=_0x1f106d;return _0x1f106d['getFields']();}return null;})[_0x886d('0x27')](function(_0x1b376e){if(_0x1b376e){if(!_0x1b376e[_0x886d('0x39')]){throw new db[(_0x886d('0x86'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xa23b3=_0x1b376e;return db[_0x886d('0x88')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x3bd6f9){if(_0x3bd6f9){_0x249dca=_[_0x886d('0x89')](_0x3bd6f9,'id');var _0x4005de;var _0x3aa81a=squel[_0x886d('0x6d')]();_0x3aa81a[_0x886d('0x8a')](_0x4e21a5[_0x886d('0x6e')]);for(var _0x37fc35=0x0;_0x37fc35<_0xa23b3[_0x886d('0x39')];_0x37fc35+=0x1){_0x4005de=_0xa23b3[_0x37fc35][_0x886d('0x6f')]?_0x249dca[_0xa23b3[_0x37fc35][_0x886d('0x6f')]][_0x886d('0xa6')]:_0xa23b3[_0x37fc35][_0x886d('0x75')];_0x4005de=_0xa23b3[_0x37fc35]['function']?_[_0x886d('0x8b')](_0x5a33fe[_0xa23b3[_0x37fc35][_0x886d('0x70')]],'%s',_0x4005de):_0x4005de;_0x4005de=_0xa23b3[_0x37fc35][_0x886d('0x71')]?_[_0x886d('0x8b')](_0x5684f8[_0xa23b3[_0x37fc35][_0x886d('0x71')]],'%s',_0x4005de):_0x4005de;if(_0xa23b3[_0x37fc35][_0x886d('0x72')]){_0x3aa81a[_0x886d('0x68')](_0x4005de);}_0xa23b3[_0x37fc35][_0x886d('0x73')]&&_0x3aa81a[_0x886d('0x3d')](_0x4005de,_0xa23b3[_0x37fc35][_0x886d('0x73')]===_0x886d('0x74')?![]:!![]);_0x3aa81a[_0x886d('0x75')](_0x4005de,_0xa23b3[_0x37fc35][_0x886d('0x8c')]||_0x4005de);}if(_0x4e21a5[_0x886d('0x76')]){_0x4e21a5[_0x886d('0x76')]=JSON[_0x886d('0x77')](_0x4e21a5[_0x886d('0x76')]);for(var _0x4b3ba5=0x0;_0x4b3ba5<_0x4e21a5[_0x886d('0x76')][_0x886d('0x39')];_0x4b3ba5+=0x1){if(_0x4e21a5['joins'][_0x4b3ba5]['type']&&_[_0x886d('0x64')](_0x3584e7,_0x4e21a5[_0x886d('0x76')][_0x4b3ba5][_0x886d('0x30')])&&_0x4e21a5[_0x886d('0x76')][_0x4b3ba5]['parentKey']&&_0x4e21a5[_0x886d('0x76')][_0x4b3ba5][_0x886d('0x79')]&&_0x4e21a5[_0x886d('0x76')][_0x4b3ba5][_0x886d('0x8d')]){_0x3aa81a[_0x4e21a5[_0x886d('0x76')][_0x4b3ba5][_0x886d('0x30')]](_0x4e21a5['joins'][_0x4b3ba5][_0x886d('0x79')],null,util[_0x886d('0x71')](_0x886d('0x7a'),_0x4e21a5[_0x886d('0x6e')],_0x4e21a5['joins'][_0x4b3ba5][_0x886d('0x78')],_0x4e21a5[_0x886d('0x76')][_0x4b3ba5][_0x886d('0x79')],_0x4e21a5[_0x886d('0x76')][_0x4b3ba5][_0x886d('0x8d')]));}}}if(_0x4e21a5[_0x886d('0x7b')]){_0x4e21a5[_0x886d('0x7b')]=JSON[_0x886d('0x77')](_0x4e21a5[_0x886d('0x7b')]);_0x3aa81a[_0x886d('0x3f')](_0x2ef3bf(_0x4e21a5[_0x886d('0x7b')][_0x886d('0x68')]));}_0x4014e2=_0x3aa81a[_0x886d('0x7c')]();_0x3aa81a[_0x886d('0x1a')](_0x256924);_0x3aa81a[_0x886d('0x3c')](0x0);logger[_0x886d('0x7d')](_0x886d('0x7e'),_0x3aa81a[_0x886d('0x7f')]());return dbH[_0x886d('0x80')][_0x886d('0x33')](_0x3aa81a['toString'](),{'type':dbH[_0x886d('0x80')][_0x886d('0x81')][_0x886d('0x82')]});}})['then'](function(){return{'sql':_0x4014e2[_0x886d('0x7f')]()};})[_0x886d('0x27')](respondWithResult(_0x27cf0f,null))['catch'](handleError(_0x27cf0f,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 17cadc1..06f7ecc 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 _0x34ab=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x11c331,_0x523ccf){var _0x1b89e1=function(_0x33d7b6){while(--_0x33d7b6){_0x11c331['push'](_0x11c331['shift']());}};_0x1b89e1(++_0x523ccf);}(_0x34ab,0xf1));var _0xb34a=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x34ab[_0xda464c];return _0x19e222;};'use strict';var _=require(_0xb34a('0x0'));var util=require(_0xb34a('0x1'));var logger=require(_0xb34a('0x2'))(_0xb34a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb34a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb34a('0x5'));var config=require(_0xb34a('0x6'));var attributes=require(_0xb34a('0x7'));module['exports']=function(_0x6e669,_0x1f6df3){return _0x6e669[_0xb34a('0x8')](_0xb34a('0x9'),attributes,{'tableName':_0xb34a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xddbb=['AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','bluebird','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x1aa57b,_0x5c8b9b){var _0xfff9e5=function(_0x2f3527){while(--_0x2f3527){_0x1aa57b['push'](_0x1aa57b['shift']());}};_0xfff9e5(++_0x5c8b9b);}(_0xddbb,0xbf));var _0xbddb=function(_0x5e5fc7,_0x41c450){_0x5e5fc7=_0x5e5fc7-0x0;var _0x7e6791=_0xddbb[_0x5e5fc7];return _0x7e6791;};'use strict';var _=require(_0xbddb('0x0'));var util=require(_0xbddb('0x1'));var logger=require('../../config/logger')(_0xbddb('0x2'));var moment=require(_0xbddb('0x3'));var BPromise=require(_0xbddb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbddb('0x5'));var attributes=require(_0xbddb('0x6'));module['exports']=function(_0x3379a2,_0x2bc377){return _0x3379a2['define'](_0xbddb('0x7'),attributes,{'tableName':_0xbddb('0x8'),'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 b1a7aaa..7ac0f05 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 _0x195e=['info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x131be9,_0x5c8e73){var _0x4ed332=function(_0x179b05){while(--_0x179b05){_0x131be9['push'](_0x131be9['shift']());}};_0x4ed332(++_0x5c8e73);}(_0x195e,0xfb));var _0xe195=function(_0x30361e,_0x2c6205){_0x30361e=_0x30361e-0x0;var _0x35be38=_0x195e[_0x30361e];return _0x35be38;};'use strict';var _=require(_0xe195('0x0'));var util=require(_0xe195('0x1'));var moment=require(_0xe195('0x2'));var BPromise=require(_0xe195('0x3'));var rs=require(_0xe195('0x4'));var fs=require('fs');var Redis=require(_0xe195('0x5'));var db=require(_0xe195('0x6'))['db'];var utils=require(_0xe195('0x7'));var logger=require(_0xe195('0x8'))(_0xe195('0x9'));var config=require(_0xe195('0xa'));var jayson=require(_0xe195('0xb'));var client=jayson[_0xe195('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a1acc,_0x663106,_0x2ead59){return new BPromise(function(_0x28c1a9,_0x3164c3){return client['request'](_0x2a1acc,_0x2ead59)['then'](function(_0x5f333b){logger[_0xe195('0xd')](_0xe195('0xe'),_0x663106,_0xe195('0xf'));logger[_0xe195('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x663106,_0xe195('0xf'),JSON[_0xe195('0x11')](_0x5f333b));if(_0x5f333b[_0xe195('0x12')]){if(_0x5f333b['error'][_0xe195('0x13')]===0x1f4){logger[_0xe195('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x663106,_0x5f333b[_0xe195('0x12')][_0xe195('0x14')]);return _0x3164c3(_0x5f333b[_0xe195('0x12')][_0xe195('0x14')]);}logger['error'](_0xe195('0xe'),_0x663106,_0x5f333b[_0xe195('0x12')]['message']);return _0x28c1a9(_0x5f333b['error'][_0xe195('0x14')]);}else{logger['info'](_0xe195('0xe'),_0x663106,'request\x20sent');_0x28c1a9(_0x5f333b['result'][_0xe195('0x14')]);}})[_0xe195('0x15')](function(_0x277362){logger[_0xe195('0x12')](_0xe195('0xe'),_0x663106,_0x277362);_0x3164c3(_0x277362);});});}
\ No newline at end of file
+var _0x9efc=['http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9efc,0x19c));var _0xc9ef=function(_0x5cf3c0,_0x4363c1){_0x5cf3c0=_0x5cf3c0-0x0;var _0x39a680=_0x9efc[_0x5cf3c0];return _0x39a680;};'use strict';var _=require(_0xc9ef('0x0'));var util=require(_0xc9ef('0x1'));var moment=require(_0xc9ef('0x2'));var BPromise=require(_0xc9ef('0x3'));var rs=require(_0xc9ef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc9ef('0x5'));var logger=require('../../config/logger')(_0xc9ef('0x6'));var config=require('../../config/environment');var jayson=require(_0xc9ef('0x7'));var client=jayson['client'][_0xc9ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb3be8b,_0x99562e,_0xb1af3a){return new BPromise(function(_0x45cc54,_0x3a6fe6){return client[_0xc9ef('0x9')](_0xb3be8b,_0xb1af3a)[_0xc9ef('0xa')](function(_0x418b6b){logger[_0xc9ef('0xb')](_0xc9ef('0xc'),_0x99562e,'request\x20sent');logger['debug'](_0xc9ef('0xd'),_0x99562e,'request\x20sent',JSON[_0xc9ef('0xe')](_0x418b6b));if(_0x418b6b['error']){if(_0x418b6b[_0xc9ef('0xf')]['code']===0x1f4){logger['error'](_0xc9ef('0xc'),_0x99562e,_0x418b6b[_0xc9ef('0xf')][_0xc9ef('0x10')]);return _0x3a6fe6(_0x418b6b[_0xc9ef('0xf')][_0xc9ef('0x10')]);}logger[_0xc9ef('0xf')](_0xc9ef('0xc'),_0x99562e,_0x418b6b[_0xc9ef('0xf')][_0xc9ef('0x10')]);return _0x45cc54(_0x418b6b[_0xc9ef('0xf')][_0xc9ef('0x10')]);}else{logger['info'](_0xc9ef('0xc'),_0x99562e,_0xc9ef('0x11'));_0x45cc54(_0x418b6b[_0xc9ef('0x12')][_0xc9ef('0x10')]);}})[_0xc9ef('0x13')](function(_0x54e2c3){logger[_0xc9ef('0xf')](_0xc9ef('0xc'),_0x99562e,_0x54e2c3);_0x3a6fe6(_0x54e2c3);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index ea9c30b..809c705 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 _0xcc4f=['get','isAuthenticated','index','/:id/preview','preview','run','/:id/query','query','put','update','delete','/:id','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x4e6444,_0x11cd1d){var _0x4cb105=function(_0x1b3778){while(--_0x1b3778){_0x4e6444['push'](_0x4e6444['shift']());}};_0x4cb105(++_0x11cd1d);}(_0xcc4f,0x90));var _0xfcc4=function(_0x7d8b5e,_0x6a7253){_0x7d8b5e=_0x7d8b5e-0x0;var _0x40c789=_0xcc4f[_0x7d8b5e];return _0x40c789;};'use strict';var multer=require(_0xfcc4('0x0'));var util=require(_0xfcc4('0x1'));var path=require(_0xfcc4('0x2'));var timeout=require(_0xfcc4('0x3'));var express=require(_0xfcc4('0x4'));var router=express[_0xfcc4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfcc4('0x6'));var interaction=require(_0xfcc4('0x7'));var config=require(_0xfcc4('0x8'));var controller=require(_0xfcc4('0x9'));router[_0xfcc4('0xa')]('/',auth[_0xfcc4('0xb')](),controller[_0xfcc4('0xc')]);router[_0xfcc4('0xa')]('/:id',auth[_0xfcc4('0xb')](),controller['show']);router[_0xfcc4('0xa')](_0xfcc4('0xd'),auth[_0xfcc4('0xb')](),controller[_0xfcc4('0xe')]);router[_0xfcc4('0xa')]('/:id/run',auth['isAuthenticated'](),controller[_0xfcc4('0xf')]);router[_0xfcc4('0xa')](_0xfcc4('0x10'),auth['isAuthenticated'](),controller[_0xfcc4('0x11')]);router['post']('/',auth[_0xfcc4('0xb')](),controller['create']);router[_0xfcc4('0x12')]('/:id',auth[_0xfcc4('0xb')](),controller[_0xfcc4('0x13')]);router[_0xfcc4('0x14')](_0xfcc4('0x15'),auth[_0xfcc4('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x3ec5=['put','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/run','query','post','create'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x3ec5,0x192));var _0x53ec=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x3ec5[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x53ec('0x0'));var util=require(_0x53ec('0x1'));var path=require(_0x53ec('0x2'));var timeout=require('connect-timeout');var express=require(_0x53ec('0x3'));var router=express['Router']();var fs_extra=require(_0x53ec('0x4'));var auth=require(_0x53ec('0x5'));var interaction=require(_0x53ec('0x6'));var config=require('../../config/environment');var controller=require(_0x53ec('0x7'));router[_0x53ec('0x8')]('/',auth[_0x53ec('0x9')](),controller[_0x53ec('0xa')]);router[_0x53ec('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x53ec('0xb')]);router[_0x53ec('0x8')]('/:id/preview',auth[_0x53ec('0x9')](),controller['preview']);router[_0x53ec('0x8')](_0x53ec('0xc'),auth[_0x53ec('0x9')](),controller['run']);router[_0x53ec('0x8')]('/:id/query',auth[_0x53ec('0x9')](),controller[_0x53ec('0xd')]);router[_0x53ec('0xe')]('/',auth[_0x53ec('0x9')](),controller[_0x53ec('0xf')]);router[_0x53ec('0x10')](_0x53ec('0x11'),auth[_0x53ec('0x9')](),controller[_0x53ec('0x12')]);router[_0x53ec('0x13')](_0x53ec('0x11'),auth[_0x53ec('0x9')](),controller[_0x53ec('0x14')]);module[_0x53ec('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 56e3f5a..f0fb78b 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 _0x6b7d=['moment','exports','STRING','csv','DATE','ENUM','scheduled','manual','INTEGER','UNSIGNED'];(function(_0x5aaf8a,_0x11cb3f){var _0x12a226=function(_0x239b14){while(--_0x239b14){_0x5aaf8a['push'](_0x5aaf8a['shift']());}};_0x12a226(++_0x11cb3f);}(_0x6b7d,0xb4));var _0xd6b7=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x6b7d[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd6b7('0x0'));module[_0xd6b7('0x1')]={'name':{'type':Sequelize[_0xd6b7('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xd6b7('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xd6b7('0x3'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0xd6b7('0x3')},'savename':{'type':Sequelize[_0xd6b7('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd6b7('0x4')]},'endDate':{'type':Sequelize[_0xd6b7('0x4')]},'status':{'type':Sequelize[_0xd6b7('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xd6b7('0x5')]('manual',_0xd6b7('0x6')),'allowNull':![],'defaultValue':_0xd6b7('0x7')},'reportId':{'type':Sequelize[_0xd6b7('0x8')](0xb)[_0xd6b7('0x9')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3373=['csv','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','pdf','xlsx'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3373,0xfe));var _0x3337=function(_0xad57d4,_0x3a8c8e){_0xad57d4=_0xad57d4-0x0;var _0x1a1a6e=_0x3373[_0xad57d4];return _0x1a1a6e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3337('0x0'));module[_0x3337('0x1')]={'name':{'type':Sequelize[_0x3337('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x3337('0x3')]('csv',_0x3337('0x4'),_0x3337('0x5')),'allowNull':![],'defaultValue':_0x3337('0x6')},'savename':{'type':Sequelize[_0x3337('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x3337('0x7')]},'status':{'type':Sequelize[_0x3337('0x2')],'defaultValue':_0x3337('0x8')},'type':{'type':Sequelize['ENUM'](_0x3337('0x9'),_0x3337('0xa')),'allowNull':![],'defaultValue':_0x3337('0x9')},'reportId':{'type':Sequelize[_0x3337('0xb')](0xb)[_0x3337('0xc')]},'reportType':{'type':Sequelize[_0x3337('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 76a7fa5..7ddf5d8 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 _0x9354=['get','ExtractedReports','UserProfileResource','error','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','map','VIRTUAL','filter','merge','options','AnalyticExtractedReport','include','findAll','catch','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','format','%s.%s','toLowerCase','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','apply','reject','save','update','then','destroy'];(function(_0x531e37,_0x4c86dd){var _0x2a48ab=function(_0x48f769){while(--_0x48f769){_0x531e37['push'](_0x531e37['shift']());}};_0x2a48ab(++_0x4c86dd);}(_0x9354,0x96));var _0x4935=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x9354[_0x513aa5];return _0x1a1a7c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4935('0x0'));var zipdir=require(_0x4935('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4935('0x2'));var moment=require(_0x4935('0x3'));var BPromise=require(_0x4935('0x4'));var Mustache=require(_0x4935('0x5'));var util=require('util');var path=require(_0x4935('0x6'));var sox=require(_0x4935('0x7'));var csv=require(_0x4935('0x8'));var ejs=require(_0x4935('0x9'));var fs=require('fs');var fs_extra=require(_0x4935('0xa'));var _=require(_0x4935('0xb'));var squel=require(_0x4935('0xc'));var crypto=require(_0x4935('0xd'));var jsforce=require(_0x4935('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4935('0x8'));var querystring=require('querystring');var Papa=require(_0x4935('0xf'));var Redis=require(_0x4935('0x10'));var authService=require(_0x4935('0x11'));var qs=require(_0x4935('0x12'));var as=require(_0x4935('0x13'));var hardwareService=require(_0x4935('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4935('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4935('0x16'))['db'];function respondWithStatusCode(_0x32916f,_0x3bb388){_0x3bb388=_0x3bb388||0xcc;return function(_0x1c6c22){if(_0x1c6c22){return _0x32916f[_0x4935('0x17')](_0x3bb388);}return _0x32916f[_0x4935('0x18')](_0x3bb388)[_0x4935('0x19')]();};}function respondWithResult(_0x3a7c30,_0x57549f){_0x57549f=_0x57549f||0xc8;return function(_0x237e28){if(_0x237e28){return _0x3a7c30[_0x4935('0x18')](_0x57549f)[_0x4935('0x1a')](_0x237e28);}};}function respondWithFilteredResult(_0xa41961,_0x3652c4){return function(_0x24cc99){if(_0x24cc99){var _0x395a43=typeof _0x3652c4['offset']===_0x4935('0x1b')&&typeof _0x3652c4[_0x4935('0x1c')]===_0x4935('0x1b');var _0x123300=_0x24cc99[_0x4935('0x1d')];var _0x429ef3=_0x395a43?0x0:_0x3652c4['offset'];var _0xd70eff=_0x395a43?_0x24cc99[_0x4935('0x1d')]:_0x3652c4['offset']+_0x3652c4[_0x4935('0x1c')];var _0x10407f;if(_0xd70eff>=_0x123300){_0xd70eff=_0x123300;_0x10407f=0xc8;}else{_0x10407f=0xce;}_0xa41961[_0x4935('0x18')](_0x10407f);return _0xa41961['set']('Content-Range',_0x429ef3+'-'+_0xd70eff+'/'+_0x123300)[_0x4935('0x1a')](_0x24cc99);}return null;};}function patchUpdates(_0x6b849f){return function(_0x1ae059){try{jsonpatch[_0x4935('0x1e')](_0x1ae059,_0x6b849f,!![]);}catch(_0x41d76e){return BPromise[_0x4935('0x1f')](_0x41d76e);}return _0x1ae059[_0x4935('0x20')]();};}function saveUpdates(_0xe482a5,_0x58b2f3){return function(_0x2f520a){if(_0x2f520a){return _0x2f520a[_0x4935('0x21')](_0xe482a5)[_0x4935('0x22')](function(_0x2c701f){return _0x2c701f;});}return null;};}function removeEntity(_0x52c65a,_0x53530f){return function(_0x4dc1f5){if(_0x4dc1f5){return _0x4dc1f5[_0x4935('0x23')]()[_0x4935('0x22')](function(){var _0x3786ff=_0x4dc1f5[_0x4935('0x24')]({'plain':!![]});var _0x344e51=_0x4935('0x25');return db[_0x4935('0x26')][_0x4935('0x23')]({'where':{'type':_0x344e51,'resourceId':_0x3786ff['id']}})[_0x4935('0x22')](function(){return _0x4dc1f5;});})[_0x4935('0x22')](function(){_0x52c65a[_0x4935('0x18')](0xcc)[_0x4935('0x19')]();});}};}function handleEntityNotFound(_0x2c47ab,_0xbb00d6){return function(_0x359522){if(!_0x359522){_0x2c47ab['sendStatus'](0x194);}return _0x359522;};}function handleError(_0x5c3aaa,_0x5cec4d){_0x5cec4d=_0x5cec4d||0x1f4;return function(_0x1fc218){logger[_0x4935('0x27')](_0x1fc218['stack']);if(_0x1fc218[_0x4935('0x28')]){delete _0x1fc218[_0x4935('0x28')];}_0x5c3aaa[_0x4935('0x18')](_0x5cec4d)[_0x4935('0x29')](_0x1fc218);};}exports[_0x4935('0x2a')]=function(_0x24262e,_0x28afc2){var _0x2fe6da={},_0x5b3c8e={},_0xb7fe2a={'count':0x0,'rows':[]};var _0x2dcb0b=_['map'](db['AnalyticExtractedReport'][_0x4935('0x2b')],function(_0x479d28){return{'name':_0x479d28[_0x4935('0x2c')],'type':_0x479d28[_0x4935('0x2d')][_0x4935('0x2e')]};});_0x5b3c8e['model']=_['map'](_0x2dcb0b,_0x4935('0x28'));_0x5b3c8e[_0x4935('0x2f')]=_['keys'](_0x24262e[_0x4935('0x2f')]);_0x5b3c8e[_0x4935('0x30')]=_[_0x4935('0x31')](_0x5b3c8e[_0x4935('0x32')],_0x5b3c8e[_0x4935('0x2f')]);_0x2fe6da['attributes']=_['intersection'](_0x5b3c8e[_0x4935('0x32')],qs[_0x4935('0x33')](_0x24262e['query']['fields']));_0x2fe6da[_0x4935('0x34')]=_0x2fe6da['attributes'][_0x4935('0x35')]?_0x2fe6da[_0x4935('0x34')]:_0x5b3c8e[_0x4935('0x32')];if(!_0x24262e[_0x4935('0x2f')][_0x4935('0x36')](_0x4935('0x37'))){_0x2fe6da['limit']=qs[_0x4935('0x1c')](_0x24262e['query'][_0x4935('0x1c')]);_0x2fe6da['offset']=qs[_0x4935('0x38')](_0x24262e['query'][_0x4935('0x38')]);}_0x2fe6da[_0x4935('0x39')]=qs[_0x4935('0x3a')](_0x24262e[_0x4935('0x2f')][_0x4935('0x3a')]);_0x2fe6da[_0x4935('0x3b')]=qs[_0x4935('0x30')](_['pick'](_0x24262e['query'],_0x5b3c8e[_0x4935('0x30')]),_0x2dcb0b);if(_0x24262e['query']['filter']){_0x2fe6da[_0x4935('0x3b')]=_['merge'](_0x2fe6da[_0x4935('0x3b')],{'$or':_[_0x4935('0x3c')](_0x2dcb0b,function(_0x2d67e3){if(_0x2d67e3[_0x4935('0x2d')]!==_0x4935('0x3d')){var _0x53aac5={};_0x53aac5[_0x2d67e3['name']]={'$like':'%'+_0x24262e[_0x4935('0x2f')][_0x4935('0x3e')]+'%'};return _0x53aac5;}})});}_0x2fe6da=_[_0x4935('0x3f')]({},_0x2fe6da,_0x24262e[_0x4935('0x40')]);var _0x4d9436={'where':_0x2fe6da[_0x4935('0x3b')]};return db[_0x4935('0x41')][_0x4935('0x1d')](_0x4d9436)['then'](function(_0x4e94f6){_0xb7fe2a[_0x4935('0x1d')]=_0x4e94f6;if(_0x24262e[_0x4935('0x2f')]['includeAll']){_0x2fe6da[_0x4935('0x42')]=[{'all':!![]}];}return db[_0x4935('0x41')][_0x4935('0x43')](_0x2fe6da);})[_0x4935('0x22')](function(_0x52ab0c){_0xb7fe2a['rows']=_0x52ab0c;return _0xb7fe2a;})[_0x4935('0x22')](respondWithFilteredResult(_0x28afc2,_0x2fe6da))[_0x4935('0x44')](handleError(_0x28afc2,null));};exports['show']=function(_0x1eaa47,_0x40f5ff){var _0x2195da={'raw':!![],'where':{'id':_0x1eaa47[_0x4935('0x45')]['id']}},_0x5135fd={};_0x5135fd[_0x4935('0x32')]=_[_0x4935('0x46')](db[_0x4935('0x41')][_0x4935('0x2b')]);_0x5135fd[_0x4935('0x2f')]=_[_0x4935('0x46')](_0x1eaa47[_0x4935('0x2f')]);_0x5135fd[_0x4935('0x30')]=_[_0x4935('0x31')](_0x5135fd[_0x4935('0x32')],_0x5135fd[_0x4935('0x2f')]);_0x2195da[_0x4935('0x34')]=_[_0x4935('0x31')](_0x5135fd[_0x4935('0x32')],qs[_0x4935('0x33')](_0x1eaa47[_0x4935('0x2f')][_0x4935('0x33')]));_0x2195da['attributes']=_0x2195da[_0x4935('0x34')]['length']?_0x2195da[_0x4935('0x34')]:_0x5135fd[_0x4935('0x32')];if(_0x1eaa47[_0x4935('0x2f')][_0x4935('0x47')]){_0x2195da['include']=[{'all':!![]}];}_0x2195da=_[_0x4935('0x3f')]({},_0x2195da,_0x1eaa47[_0x4935('0x40')]);return db[_0x4935('0x41')][_0x4935('0x48')](_0x2195da)[_0x4935('0x22')](handleEntityNotFound(_0x40f5ff,null))[_0x4935('0x22')](respondWithResult(_0x40f5ff,null))[_0x4935('0x44')](handleError(_0x40f5ff,null));};exports[_0x4935('0x49')]=function(_0x29b932,_0x392cba){return db['AnalyticExtractedReport'][_0x4935('0x49')](_0x29b932[_0x4935('0x4a')],{})['then'](function(_0x447a64){var _0x2636f4=_0x29b932[_0x4935('0x4b')][_0x4935('0x24')]({'plain':!![]});if(!_0x2636f4)throw new Error(_0x4935('0x4c'));if(_0x2636f4[_0x4935('0x4d')]===_0x4935('0x4b')){var _0x471fb1=_0x447a64['get']({'plain':!![]});var _0x57d0d9='ExtractedReports';return db['UserProfileSection'][_0x4935('0x48')]({'where':{'name':_0x57d0d9,'userProfileId':_0x2636f4[_0x4935('0x4e')]},'raw':!![]})[_0x4935('0x22')](function(_0x2072df){if(_0x2072df&&_0x2072df[_0x4935('0x4f')]===0x0){return db['UserProfileResource'][_0x4935('0x49')]({'name':_0x471fb1[_0x4935('0x28')],'resourceId':_0x471fb1['id'],'type':_0x2072df[_0x4935('0x28')],'sectionId':_0x2072df['id']},{})[_0x4935('0x22')](function(){return _0x447a64;});}else{return _0x447a64;}})[_0x4935('0x44')](function(_0x8196b4){logger[_0x4935('0x27')](_0x4935('0x50'),_0x8196b4);throw _0x8196b4;});}return _0x447a64;})[_0x4935('0x22')](respondWithResult(_0x392cba,0xc9))[_0x4935('0x44')](handleError(_0x392cba,null));};exports['update']=function(_0x24b83b,_0x4e99bb){if(_0x24b83b[_0x4935('0x4a')]['id']){delete _0x24b83b[_0x4935('0x4a')]['id'];}return db['AnalyticExtractedReport'][_0x4935('0x48')]({'where':{'id':_0x24b83b['params']['id']}})['then'](handleEntityNotFound(_0x4e99bb,null))['then'](saveUpdates(_0x24b83b[_0x4935('0x4a')],null))[_0x4935('0x22')](respondWithResult(_0x4e99bb,null))[_0x4935('0x44')](handleError(_0x4e99bb,null));};exports[_0x4935('0x23')]=function(_0xd5a489,_0x56db7f){return db['AnalyticExtractedReport'][_0x4935('0x48')]({'where':{'id':_0xd5a489[_0x4935('0x45')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x56db7f,null))['then'](removeEntity(_0x56db7f,null))[_0x4935('0x44')](handleError(_0x56db7f,null));};exports[_0x4935('0x51')]=function(_0x24141a,_0xc92288,_0x5009c9){return db[_0x4935('0x41')]['find']({'where':{'id':_0x24141a['params']['id']},'attributes':['name',_0x4935('0x52'),_0x4935('0x53'),'output'],'raw':!![]})[_0x4935('0x22')](handleEntityNotFound(_0xc92288,null))[_0x4935('0x22')](function(_0x57b448){if(_0x57b448){if(!fs[_0x4935('0x54')](path[_0x4935('0x55')](config[_0x4935('0x56')],_0x4935('0x57'),_0x57b448[_0x4935('0x53')]))){throw new db[(_0x4935('0x58'))][(_0x4935('0x59'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x24141a[_0x4935('0x2f')]['exists']){return _0xc92288['sendStatus'](0xc8);}return _0xc92288[_0x4935('0x51')](path[_0x4935('0x55')](config['root'],'server/files/reports',_0x57b448[_0x4935('0x53')]),util[_0x4935('0x5a')](_0x4935('0x5b'),_0x57b448['basename']||_0x57b448[_0x4935('0x28')],_0x57b448['output'][_0x4935('0x5c')]()));}})[_0x4935('0x44')](handleError(_0xc92288,null));};
\ No newline at end of file
+var _0x3423=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','download','basename','savename','output','existsSync','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','%s.%s','toLowerCase','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','ExtractedReports','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','role','user','get','UserProfileSection','userProfileId','UserProfileResource'];(function(_0x268423,_0x1a5788){var _0x30ee05=function(_0x56df4d){while(--_0x56df4d){_0x268423['push'](_0x268423['shift']());}};_0x30ee05(++_0x1a5788);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3342('0x0'));var jsonpatch=require(_0x3342('0x1'));var rp=require(_0x3342('0x2'));var moment=require(_0x3342('0x3'));var BPromise=require(_0x3342('0x4'));var Mustache=require(_0x3342('0x5'));var util=require(_0x3342('0x6'));var path=require(_0x3342('0x7'));var sox=require(_0x3342('0x8'));var csv=require(_0x3342('0x9'));var ejs=require(_0x3342('0xa'));var fs=require('fs');var fs_extra=require(_0x3342('0xb'));var _=require(_0x3342('0xc'));var squel=require(_0x3342('0xd'));var crypto=require(_0x3342('0xe'));var jsforce=require(_0x3342('0xf'));var deskjs=require(_0x3342('0x10'));var toCsv=require(_0x3342('0x9'));var querystring=require(_0x3342('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3342('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3342('0x13'));var utils=require(_0x3342('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3342('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x716d80,_0x36e1f4){_0x36e1f4=_0x36e1f4||0xcc;return function(_0x592ba8){if(_0x592ba8){return _0x716d80[_0x3342('0x16')](_0x36e1f4);}return _0x716d80[_0x3342('0x17')](_0x36e1f4)[_0x3342('0x18')]();};}function respondWithResult(_0xe4689e,_0x61fcc0){_0x61fcc0=_0x61fcc0||0xc8;return function(_0x104077){if(_0x104077){return _0xe4689e[_0x3342('0x17')](_0x61fcc0)['json'](_0x104077);}};}function respondWithFilteredResult(_0x3e44f3,_0x19bd71){return function(_0x49afe3){if(_0x49afe3){var _0x40d609=typeof _0x19bd71[_0x3342('0x19')]==='undefined'&&typeof _0x19bd71['limit']===_0x3342('0x1a');var _0x143cf1=_0x49afe3[_0x3342('0x1b')];var _0x2075cb=_0x40d609?0x0:_0x19bd71[_0x3342('0x19')];var _0x156c24=_0x40d609?_0x49afe3[_0x3342('0x1b')]:_0x19bd71[_0x3342('0x19')]+_0x19bd71[_0x3342('0x1c')];var _0x4f4c2a;if(_0x156c24>=_0x143cf1){_0x156c24=_0x143cf1;_0x4f4c2a=0xc8;}else{_0x4f4c2a=0xce;}_0x3e44f3[_0x3342('0x17')](_0x4f4c2a);return _0x3e44f3[_0x3342('0x1d')](_0x3342('0x1e'),_0x2075cb+'-'+_0x156c24+'/'+_0x143cf1)['json'](_0x49afe3);}return null;};}function patchUpdates(_0x3cb86f){return function(_0x463324){try{jsonpatch['apply'](_0x463324,_0x3cb86f,!![]);}catch(_0xe774b7){return BPromise[_0x3342('0x1f')](_0xe774b7);}return _0x463324['save']();};}function saveUpdates(_0x4e1b19,_0x5a0658){return function(_0x3f271c){if(_0x3f271c){return _0x3f271c[_0x3342('0x20')](_0x4e1b19)[_0x3342('0x21')](function(_0x2dbad1){return _0x2dbad1;});}return null;};}function removeEntity(_0xd2b87d,_0x2925a2){return function(_0x26eb87){if(_0x26eb87){return _0x26eb87[_0x3342('0x22')]()['then'](function(){var _0x30ffc9=_0x26eb87['get']({'plain':!![]});var _0x51cf45=_0x3342('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x51cf45,'resourceId':_0x30ffc9['id']}})[_0x3342('0x21')](function(){return _0x26eb87;});})['then'](function(){_0xd2b87d[_0x3342('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x524286,_0x55cddd){return function(_0x1497d9){if(!_0x1497d9){_0x524286[_0x3342('0x16')](0x194);}return _0x1497d9;};}function handleError(_0x1dd607,_0x5eef2b){_0x5eef2b=_0x5eef2b||0x1f4;return function(_0xc275a1){logger[_0x3342('0x24')](_0xc275a1[_0x3342('0x25')]);if(_0xc275a1[_0x3342('0x26')]){delete _0xc275a1['name'];}_0x1dd607[_0x3342('0x17')](_0x5eef2b)[_0x3342('0x27')](_0xc275a1);};}exports[_0x3342('0x28')]=function(_0x301114,_0xf82530){var _0x2cc691={},_0x135760={},_0x47b2a0={'count':0x0,'rows':[]};var _0x2e0bde=_['map'](db[_0x3342('0x29')][_0x3342('0x2a')],function(_0x508f87){return{'name':_0x508f87[_0x3342('0x2b')],'type':_0x508f87[_0x3342('0x2c')][_0x3342('0x2d')]};});_0x135760[_0x3342('0x2e')]=_['map'](_0x2e0bde,_0x3342('0x26'));_0x135760[_0x3342('0x2f')]=_[_0x3342('0x30')](_0x301114[_0x3342('0x2f')]);_0x135760[_0x3342('0x31')]=_[_0x3342('0x32')](_0x135760[_0x3342('0x2e')],_0x135760[_0x3342('0x2f')]);_0x2cc691[_0x3342('0x33')]=_[_0x3342('0x32')](_0x135760[_0x3342('0x2e')],qs[_0x3342('0x34')](_0x301114['query']['fields']));_0x2cc691[_0x3342('0x33')]=_0x2cc691['attributes'][_0x3342('0x35')]?_0x2cc691[_0x3342('0x33')]:_0x135760[_0x3342('0x2e')];if(!_0x301114[_0x3342('0x2f')][_0x3342('0x36')](_0x3342('0x37'))){_0x2cc691[_0x3342('0x1c')]=qs['limit'](_0x301114[_0x3342('0x2f')][_0x3342('0x1c')]);_0x2cc691[_0x3342('0x19')]=qs[_0x3342('0x19')](_0x301114[_0x3342('0x2f')]['offset']);}_0x2cc691[_0x3342('0x38')]=qs['sort'](_0x301114[_0x3342('0x2f')][_0x3342('0x39')]);_0x2cc691[_0x3342('0x3a')]=qs[_0x3342('0x31')](_['pick'](_0x301114[_0x3342('0x2f')],_0x135760['filters']),_0x2e0bde);if(_0x301114[_0x3342('0x2f')][_0x3342('0x3b')]){_0x2cc691[_0x3342('0x3a')]=_[_0x3342('0x3c')](_0x2cc691[_0x3342('0x3a')],{'$or':_[_0x3342('0x3d')](_0x2e0bde,function(_0x32ef9a){if(_0x32ef9a['type']!==_0x3342('0x3e')){var _0x355e83={};_0x355e83[_0x32ef9a['name']]={'$like':'%'+_0x301114[_0x3342('0x2f')][_0x3342('0x3b')]+'%'};return _0x355e83;}})});}_0x2cc691=_['merge']({},_0x2cc691,_0x301114[_0x3342('0x3f')]);var _0x29f0a0={'where':_0x2cc691['where']};return db['AnalyticExtractedReport']['count'](_0x29f0a0)[_0x3342('0x21')](function(_0x41e727){_0x47b2a0['count']=_0x41e727;if(_0x301114[_0x3342('0x2f')][_0x3342('0x40')]){_0x2cc691[_0x3342('0x41')]=[{'all':!![]}];}return db[_0x3342('0x29')][_0x3342('0x42')](_0x2cc691);})[_0x3342('0x21')](function(_0x34de7b){_0x47b2a0[_0x3342('0x43')]=_0x34de7b;return _0x47b2a0;})['then'](respondWithFilteredResult(_0xf82530,_0x2cc691))['catch'](handleError(_0xf82530,null));};exports[_0x3342('0x44')]=function(_0x7341fa,_0x474196){var _0xee717e={'raw':!![],'where':{'id':_0x7341fa[_0x3342('0x45')]['id']}},_0x717946={};_0x717946['model']=_[_0x3342('0x30')](db[_0x3342('0x29')][_0x3342('0x2a')]);_0x717946[_0x3342('0x2f')]=_[_0x3342('0x30')](_0x7341fa[_0x3342('0x2f')]);_0x717946['filters']=_[_0x3342('0x32')](_0x717946['model'],_0x717946[_0x3342('0x2f')]);_0xee717e[_0x3342('0x33')]=_[_0x3342('0x32')](_0x717946[_0x3342('0x2e')],qs['fields'](_0x7341fa[_0x3342('0x2f')][_0x3342('0x34')]));_0xee717e['attributes']=_0xee717e[_0x3342('0x33')][_0x3342('0x35')]?_0xee717e[_0x3342('0x33')]:_0x717946[_0x3342('0x2e')];if(_0x7341fa['query'][_0x3342('0x40')]){_0xee717e[_0x3342('0x41')]=[{'all':!![]}];}_0xee717e=_['merge']({},_0xee717e,_0x7341fa[_0x3342('0x3f')]);return db['AnalyticExtractedReport']['find'](_0xee717e)[_0x3342('0x21')](handleEntityNotFound(_0x474196,null))[_0x3342('0x21')](respondWithResult(_0x474196,null))[_0x3342('0x46')](handleError(_0x474196,null));};exports[_0x3342('0x47')]=function(_0x23925e,_0x171387){return db[_0x3342('0x29')]['create'](_0x23925e['body'],{})[_0x3342('0x21')](function(_0x5a9e40){var _0x26251c=_0x23925e['user']['get']({'plain':!![]});if(!_0x26251c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26251c[_0x3342('0x48')]===_0x3342('0x49')){var _0x29ccb6=_0x5a9e40[_0x3342('0x4a')]({'plain':!![]});var _0x5176d7=_0x3342('0x23');return db[_0x3342('0x4b')]['find']({'where':{'name':_0x5176d7,'userProfileId':_0x26251c[_0x3342('0x4c')]},'raw':!![]})[_0x3342('0x21')](function(_0x43c27a){if(_0x43c27a&&_0x43c27a['autoAssociation']===0x0){return db[_0x3342('0x4d')][_0x3342('0x47')]({'name':_0x29ccb6[_0x3342('0x26')],'resourceId':_0x29ccb6['id'],'type':_0x43c27a[_0x3342('0x26')],'sectionId':_0x43c27a['id']},{})[_0x3342('0x21')](function(){return _0x5a9e40;});}else{return _0x5a9e40;}})['catch'](function(_0x2699d2){logger[_0x3342('0x24')](_0x3342('0x4e'),_0x2699d2);throw _0x2699d2;});}return _0x5a9e40;})[_0x3342('0x21')](respondWithResult(_0x171387,0xc9))[_0x3342('0x46')](handleError(_0x171387,null));};exports[_0x3342('0x20')]=function(_0x3db07c,_0x47cf76){if(_0x3db07c[_0x3342('0x4f')]['id']){delete _0x3db07c['body']['id'];}return db[_0x3342('0x29')]['find']({'where':{'id':_0x3db07c[_0x3342('0x45')]['id']}})['then'](handleEntityNotFound(_0x47cf76,null))['then'](saveUpdates(_0x3db07c['body'],null))['then'](respondWithResult(_0x47cf76,null))[_0x3342('0x46')](handleError(_0x47cf76,null));};exports[_0x3342('0x22')]=function(_0x3cd098,_0x476973){return db[_0x3342('0x29')][_0x3342('0x50')]({'where':{'id':_0x3cd098[_0x3342('0x45')]['id']}})[_0x3342('0x21')](handleEntityNotFound(_0x476973,null))[_0x3342('0x21')](removeEntity(_0x476973,null))[_0x3342('0x46')](handleError(_0x476973,null));};exports[_0x3342('0x51')]=function(_0x561812,_0x47d138,_0x11719c){return db['AnalyticExtractedReport'][_0x3342('0x50')]({'where':{'id':_0x561812['params']['id']},'attributes':['name',_0x3342('0x52'),_0x3342('0x53'),_0x3342('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x47d138,null))['then'](function(_0x54b41d){if(_0x54b41d){if(!fs[_0x3342('0x55')](path['join'](config[_0x3342('0x56')],_0x3342('0x57'),_0x54b41d[_0x3342('0x53')]))){throw new db['Sequelize'][(_0x3342('0x58'))](_0x3342('0x59'));}if(_0x561812[_0x3342('0x2f')][_0x3342('0x5a')]){return _0x47d138[_0x3342('0x16')](0xc8);}return _0x47d138[_0x3342('0x51')](path[_0x3342('0x5b')](config['root'],'server/files/reports',_0x54b41d[_0x3342('0x53')]),util['format'](_0x3342('0x5c'),_0x54b41d[_0x3342('0x52')]||_0x54b41d[_0x3342('0x26')],_0x54b41d[_0x3342('0x54')][_0x3342('0x5d')]()));}})['catch'](handleError(_0x47d138,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 7421095..033013a 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 _0x43c6=['util','../../config/logger','api','bluebird','rimraf','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x3ff204,_0x46a3c4){var _0x2afc80=function(_0x28a464){while(--_0x28a464){_0x3ff204['push'](_0x3ff204['shift']());}};_0x2afc80(++_0x46a3c4);}(_0x43c6,0xa1));var _0x643c=function(_0xe15ae0,_0x3ff30c){_0xe15ae0=_0xe15ae0-0x0;var _0x5c77ad=_0x43c6[_0xe15ae0];return _0x5c77ad;};'use strict';var _=require(_0x643c('0x0'));var util=require(_0x643c('0x1'));var logger=require(_0x643c('0x2'))(_0x643c('0x3'));var moment=require('moment');var BPromise=require(_0x643c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x643c('0x5'));var config=require('../../config/environment');var attributes=require(_0x643c('0x6'));module['exports']=function(_0x1dadc4,_0x4ebce3){return _0x1dadc4['define'](_0x643c('0x7'),attributes,{'tableName':_0x643c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x424a=['request-promise','path','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird'];(function(_0x311dc8,_0x21c4be){var _0x3daad5=function(_0x2dfd16){while(--_0x2dfd16){_0x311dc8['push'](_0x311dc8['shift']());}};_0x3daad5(++_0x21c4be);}(_0x424a,0x1f3));var _0xa424=function(_0x2ff56b,_0x5df44a){_0x2ff56b=_0x2ff56b-0x0;var _0x44a7d7=_0x424a[_0x2ff56b];return _0x44a7d7;};'use strict';var _=require(_0xa424('0x0'));var util=require(_0xa424('0x1'));var logger=require('../../config/logger')(_0xa424('0x2'));var moment=require(_0xa424('0x3'));var BPromise=require(_0xa424('0x4'));var rp=require(_0xa424('0x5'));var fs=require('fs');var path=require(_0xa424('0x6'));var rimraf=require('rimraf');var config=require(_0xa424('0x7'));var attributes=require(_0xa424('0x8'));module['exports']=function(_0x55e9b5,_0x5bce1c){return _0x55e9b5[_0xa424('0x9')](_0xa424('0xa'),attributes,{'tableName':_0xa424('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 038bf2d..759d8db 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 _0x436f=['lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','info','result','catch'];(function(_0x5b8317,_0x5e89cb){var _0x5ed04f=function(_0x1fe5bb){while(--_0x1fe5bb){_0x5b8317['push'](_0x5b8317['shift']());}};_0x5ed04f(++_0x5e89cb);}(_0x436f,0xbd));var _0xf436=function(_0x5948b5,_0x39dd07){_0x5948b5=_0x5948b5-0x0;var _0x534f6e=_0x436f[_0x5948b5];return _0x534f6e;};'use strict';var _=require(_0xf436('0x0'));var util=require('util');var moment=require(_0xf436('0x1'));var BPromise=require('bluebird');var rs=require(_0xf436('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf436('0x3'))['db'];var utils=require(_0xf436('0x4'));var logger=require(_0xf436('0x5'))('rpc');var config=require(_0xf436('0x6'));var jayson=require(_0xf436('0x7'));var client=jayson['client'][_0xf436('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x298375,_0x268769,_0x591819){return new BPromise(function(_0x401dbb,_0x1b53ea){return client[_0xf436('0x9')](_0x298375,_0x591819)[_0xf436('0xa')](function(_0x5693ce){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x268769,_0xf436('0xb'));logger[_0xf436('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x268769,_0xf436('0xb'),JSON[_0xf436('0xd')](_0x5693ce));if(_0x5693ce['error']){if(_0x5693ce[_0xf436('0xe')][_0xf436('0xf')]===0x1f4){logger['error'](_0xf436('0x10'),_0x268769,_0x5693ce['error'][_0xf436('0x11')]);return _0x1b53ea(_0x5693ce[_0xf436('0xe')][_0xf436('0x11')]);}logger[_0xf436('0xe')](_0xf436('0x10'),_0x268769,_0x5693ce[_0xf436('0xe')][_0xf436('0x11')]);return _0x401dbb(_0x5693ce[_0xf436('0xe')][_0xf436('0x11')]);}else{logger[_0xf436('0x12')](_0xf436('0x10'),_0x268769,'request\x20sent');_0x401dbb(_0x5693ce[_0xf436('0x13')][_0xf436('0x11')]);}})[_0xf436('0x14')](function(_0x458648){logger[_0xf436('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x268769,_0x458648);_0x1b53ea(_0x458648);});});}
\ No newline at end of file
+var _0x9095=['util','bluebird','randomstring','../../mysqldb','../../config/logger','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x3f00b9,_0x7b6cf){var _0x3c7e2c=function(_0x3d3128){while(--_0x3d3128){_0x3f00b9['push'](_0x3f00b9['shift']());}};_0x3c7e2c(++_0x7b6cf);}(_0x9095,0x155));var _0x5909=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0x9095[_0x35af23];return _0x340506;};'use strict';var _=require(_0x5909('0x0'));var util=require(_0x5909('0x1'));var moment=require('moment');var BPromise=require(_0x5909('0x2'));var rs=require(_0x5909('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5909('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5909('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5909('0x6')][_0x5909('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4cdf1b,_0x39c728,_0x3cd72d){return new BPromise(function(_0xba7a2d,_0x73054d){return client[_0x5909('0x8')](_0x4cdf1b,_0x3cd72d)[_0x5909('0x9')](function(_0x1e869e){logger[_0x5909('0xa')](_0x5909('0xb'),_0x39c728,_0x5909('0xc'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x39c728,_0x5909('0xc'),JSON['stringify'](_0x1e869e));if(_0x1e869e['error']){if(_0x1e869e[_0x5909('0xd')][_0x5909('0xe')]===0x1f4){logger[_0x5909('0xd')](_0x5909('0xb'),_0x39c728,_0x1e869e[_0x5909('0xd')][_0x5909('0xf')]);return _0x73054d(_0x1e869e[_0x5909('0xd')][_0x5909('0xf')]);}logger[_0x5909('0xd')](_0x5909('0xb'),_0x39c728,_0x1e869e[_0x5909('0xd')][_0x5909('0xf')]);return _0xba7a2d(_0x1e869e[_0x5909('0xd')]['message']);}else{logger[_0x5909('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x39c728,_0x5909('0xc'));_0xba7a2d(_0x1e869e[_0x5909('0x10')]['message']);}})[_0x5909('0x11')](function(_0x4a520c){logger[_0x5909('0xd')](_0x5909('0xb'),_0x39c728,_0x4a520c);_0x73054d(_0x4a520c);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 71b6154..5aed301 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 _0xaafc=['/:id','show','/:id/download','download','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','index','get'];(function(_0x1b4b7b,_0x31ca72){var _0x40ca6a=function(_0x4a058c){while(--_0x4a058c){_0x1b4b7b['push'](_0x1b4b7b['shift']());}};_0x40ca6a(++_0x31ca72);}(_0xaafc,0xb4));var _0xcaaf=function(_0x14650b,_0x4e7e56){_0x14650b=_0x14650b-0x0;var _0x58bf19=_0xaafc[_0x14650b];return _0x58bf19;};'use strict';var multer=require(_0xcaaf('0x0'));var util=require(_0xcaaf('0x1'));var path=require(_0xcaaf('0x2'));var timeout=require(_0xcaaf('0x3'));var express=require(_0xcaaf('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcaaf('0x5'));var config=require('../../config/environment');var controller=require(_0xcaaf('0x6'));router['get']('/',auth[_0xcaaf('0x7')](),controller[_0xcaaf('0x8')]);router[_0xcaaf('0x9')](_0xcaaf('0xa'),auth[_0xcaaf('0x7')](),controller[_0xcaaf('0xb')]);router[_0xcaaf('0x9')](_0xcaaf('0xc'),auth[_0xcaaf('0x7')](),controller[_0xcaaf('0xd')]);router['post']('/',auth[_0xcaaf('0x7')](),controller[_0xcaaf('0xe')]);router[_0xcaaf('0xf')](_0xcaaf('0xa'),auth[_0xcaaf('0x7')](),controller[_0xcaaf('0x10')]);router['delete'](_0xcaaf('0xa'),auth[_0xcaaf('0x7')](),controller[_0xcaaf('0x11')]);module[_0xcaaf('0x12')]=router;
\ No newline at end of file
+var _0xeef2=['multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','show','/:id/download','isAuthenticated','download','post','create','update','delete','destroy','exports'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xeef2,0xfc));var _0x2eef=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xeef2[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x2eef('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2eef('0x1'));var express=require(_0x2eef('0x2'));var router=express[_0x2eef('0x3')]();var fs_extra=require(_0x2eef('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2eef('0x5'));var config=require(_0x2eef('0x6'));var controller=require(_0x2eef('0x7'));router[_0x2eef('0x8')]('/',auth['isAuthenticated'](),controller[_0x2eef('0x9')]);router[_0x2eef('0x8')](_0x2eef('0xa'),auth['isAuthenticated'](),controller[_0x2eef('0xb')]);router[_0x2eef('0x8')](_0x2eef('0xc'),auth[_0x2eef('0xd')](),controller[_0x2eef('0xe')]);router[_0x2eef('0xf')]('/',auth[_0x2eef('0xd')](),controller[_0x2eef('0x10')]);router['put'](_0x2eef('0xa'),auth[_0x2eef('0xd')](),controller[_0x2eef('0x11')]);router[_0x2eef('0x12')]('/:id',auth[_0x2eef('0xd')](),controller[_0x2eef('0x13')]);module[_0x2eef('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 116870c..cf40f85 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 _0x814b=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x11bf38,_0x213d7f){var _0x202699=function(_0x33659f){while(--_0x33659f){_0x11bf38['push'](_0x11bf38['shift']());}};_0x202699(++_0x213d7f);}(_0x814b,0x1a2));var _0xb814=function(_0x51d129,_0x175d7d){_0x51d129=_0x51d129-0x0;var _0x44c377=_0x814b[_0x51d129];return _0x44c377;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'field':{'type':Sequelize[_0xb814('0x2')]},'alias':{'type':Sequelize[_0xb814('0x3')]},'function':{'type':Sequelize[_0xb814('0x3')]},'format':{'type':Sequelize[_0xb814('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb814('0x3')]},'custom':{'type':Sequelize[_0xb814('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7a54=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x11d253,_0x384676){var _0x5c1aa5=function(_0x2aa1e3){while(--_0x2aa1e3){_0x11d253['push'](_0x11d253['shift']());}};_0x5c1aa5(++_0x384676);}(_0x7a54,0x106));var _0x47a5=function(_0x460653,_0x2367ed){_0x460653=_0x460653-0x0;var _0x3aaddf=_0x7a54[_0x460653];return _0x3aaddf;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'field':{'type':Sequelize[_0x47a5('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x47a5('0x3')]},'format':{'type':Sequelize[_0x47a5('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x47a5('0x3')]},'custom':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 152ad6e..5443115 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 _0xa9e0=['util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','options','includeAll','include','findAll','catch','show','params','find','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','eml-format','rimraf','zip-dir','moment','mustache'];(function(_0x33b259,_0x2036be){var _0xf95548=function(_0x5b3424){while(--_0x5b3424){_0x33b259['push'](_0x33b259['shift']());}};_0xf95548(++_0x2036be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x45')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x28')]['bulkCreate'](_0x45c845[_0x0a9e('0x44')],{'raw':![],'individualHooks':!![]})[_0x0a9e('0x22')](respondWithResult(_0x37be73,0xc9))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x21')]=function(_0x409789,_0x992c77){if(_0x409789[_0x0a9e('0x44')]['id']){delete _0x409789[_0x0a9e('0x44')]['id'];}return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x409789[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x992c77,null))['then'](saveUpdates(_0x409789['body'],null))['then'](respondWithResult(_0x992c77,null))[_0x0a9e('0x40')](handleError(_0x992c77,null));};exports[_0x0a9e('0x23')]=function(_0x37edaa,_0x11545a){return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x37edaa[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x11545a,null))['then'](removeEntity(_0x11545a,null))['catch'](handleError(_0x11545a,null));};exports['bulkDestroy']=function(_0x39d77d,_0x204173){return db[_0x0a9e('0x28')]['destroy']({'where':{'id':_0x39d77d[_0x0a9e('0x2e')][_0x0a9e('0x46')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x204173,0xcc))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x47')]=function(_0x59c6ff,_0x443e72,_0x4c3845){return db[_0x0a9e('0x48')][_0x0a9e('0x49')]({'where':{'id':_0x59c6ff[_0x0a9e('0x42')]['id']}})['then'](handleEntityNotFound(_0x443e72,null))[_0x0a9e('0x22')](function(_0x1bf38a){if(_0x1bf38a){return db['sequelize']['transaction'](function(_0x128aa6){return db[_0x0a9e('0x28')]['destroy']({'where':{'CustomReportId':_0x59c6ff[_0x0a9e('0x42')]['id']},'transaction':_0x128aa6})['then'](function(_0x211ef9){var _0x523cd2=_[_0x0a9e('0x2d')](_0x59c6ff['body'],function(_0x5da27d){delete _0x5da27d['id'];_0x5da27d['CustomReportId']=_0x59c6ff[_0x0a9e('0x42')]['id'];return _0x5da27d;});return db['AnalyticFieldReport'][_0x0a9e('0x45')](_0x523cd2,{'transaction':_0x128aa6});});})[_0x0a9e('0x22')](function(){return db[_0x0a9e('0x28')][_0x0a9e('0x3f')]({'where':{'CustomReportId':_0x59c6ff[_0x0a9e('0x42')]['id']}});});}})[_0x0a9e('0x22')](respondWithResult(_0x443e72,null))[_0x0a9e('0x40')](handleError(_0x443e72,null));};
\ No newline at end of file
+var _0xa9e0=['util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','options','includeAll','include','findAll','catch','show','params','find','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','eml-format','rimraf','zip-dir','moment','mustache'];(function(_0x397f37,_0x3cf86d){var _0x31cae6=function(_0x5cddb9){while(--_0x5cddb9){_0x397f37['push'](_0x397f37['shift']());}};_0x31cae6(++_0x3cf86d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x45')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x28')]['bulkCreate'](_0x45c845[_0x0a9e('0x44')],{'raw':![],'individualHooks':!![]})[_0x0a9e('0x22')](respondWithResult(_0x37be73,0xc9))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x21')]=function(_0x409789,_0x992c77){if(_0x409789[_0x0a9e('0x44')]['id']){delete _0x409789[_0x0a9e('0x44')]['id'];}return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x409789[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x992c77,null))['then'](saveUpdates(_0x409789['body'],null))['then'](respondWithResult(_0x992c77,null))[_0x0a9e('0x40')](handleError(_0x992c77,null));};exports[_0x0a9e('0x23')]=function(_0x37edaa,_0x11545a){return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x37edaa[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x11545a,null))['then'](removeEntity(_0x11545a,null))['catch'](handleError(_0x11545a,null));};exports['bulkDestroy']=function(_0x39d77d,_0x204173){return db[_0x0a9e('0x28')]['destroy']({'where':{'id':_0x39d77d[_0x0a9e('0x2e')][_0x0a9e('0x46')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x204173,0xcc))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x47')]=function(_0x59c6ff,_0x443e72,_0x4c3845){return db[_0x0a9e('0x48')][_0x0a9e('0x49')]({'where':{'id':_0x59c6ff[_0x0a9e('0x42')]['id']}})['then'](handleEntityNotFound(_0x443e72,null))[_0x0a9e('0x22')](function(_0x1bf38a){if(_0x1bf38a){return db['sequelize']['transaction'](function(_0x128aa6){return db[_0x0a9e('0x28')]['destroy']({'where':{'CustomReportId':_0x59c6ff[_0x0a9e('0x42')]['id']},'transaction':_0x128aa6})['then'](function(_0x211ef9){var _0x523cd2=_[_0x0a9e('0x2d')](_0x59c6ff['body'],function(_0x5da27d){delete _0x5da27d['id'];_0x5da27d['CustomReportId']=_0x59c6ff[_0x0a9e('0x42')]['id'];return _0x5da27d;});return db['AnalyticFieldReport'][_0x0a9e('0x45')](_0x523cd2,{'transaction':_0x128aa6});});})[_0x0a9e('0x22')](function(){return db[_0x0a9e('0x28')][_0x0a9e('0x3f')]({'where':{'CustomReportId':_0x59c6ff[_0x0a9e('0x42')]['id']}});});}})[_0x0a9e('0x22')](respondWithResult(_0x443e72,null))[_0x0a9e('0x40')](handleError(_0x443e72,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 35ce82d..4926891 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 _0x769e=['AnalyticFieldReport','analytics_report_fields','moment','bluebird','request-promise','path','../../config/environment','define'];(function(_0x4ca12c,_0x1dfdbb){var _0x2350b2=function(_0x13cc5f){while(--_0x13cc5f){_0x4ca12c['push'](_0x4ca12c['shift']());}};_0x2350b2(++_0x1dfdbb);}(_0x769e,0x1e2));var _0xe769=function(_0x40b329,_0x5ead1f){_0x40b329=_0x40b329-0x0;var _0x309a2b=_0x769e[_0x40b329];return _0x309a2b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe769('0x0'));var BPromise=require(_0xe769('0x1'));var rp=require(_0xe769('0x2'));var fs=require('fs');var path=require(_0xe769('0x3'));var rimraf=require('rimraf');var config=require(_0xe769('0x4'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x573489,_0x43210a){return _0x573489[_0xe769('0x5')](_0xe769('0x6'),attributes,{'tableName':_0xe769('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa3dc=['AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','define'];(function(_0x4eaec6,_0x1ce76c){var _0x292be7=function(_0x5c5d66){while(--_0x5c5d66){_0x4eaec6['push'](_0x4eaec6['shift']());}};_0x292be7(++_0x1ce76c);}(_0xa3dc,0xd3));var _0xca3d=function(_0x554e16,_0x38f6a3){_0x554e16=_0x554e16-0x0;var _0x494c86=_0xa3dc[_0x554e16];return _0x494c86;};'use strict';var _=require(_0xca3d('0x0'));var util=require('util');var logger=require(_0xca3d('0x1'))('api');var moment=require(_0xca3d('0x2'));var BPromise=require(_0xca3d('0x3'));var rp=require(_0xca3d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca3d('0x5'));var config=require(_0xca3d('0x6'));var attributes=require(_0xca3d('0x7'));module['exports']=function(_0x329506,_0x32e69c){return _0x329506[_0xca3d('0x8')](_0xca3d('0x9'),attributes,{'tableName':_0xca3d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 31f1a40..ce08290 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 _0x290a=['error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x370d15,_0x31ef09){var _0x2304d1=function(_0x14b7cc){while(--_0x14b7cc){_0x370d15['push'](_0x370d15['shift']());}};_0x2304d1(++_0x31ef09);}(_0x290a,0x1e6));var _0xa290=function(_0x5b8b31,_0x14b4c4){_0x5b8b31=_0x5b8b31-0x0;var _0x995533=_0x290a[_0x5b8b31];return _0x995533;};'use strict';var _=require('lodash');var util=require(_0xa290('0x0'));var moment=require(_0xa290('0x1'));var BPromise=require(_0xa290('0x2'));var rs=require(_0xa290('0x3'));var fs=require('fs');var Redis=require(_0xa290('0x4'));var db=require(_0xa290('0x5'))['db'];var utils=require(_0xa290('0x6'));var logger=require(_0xa290('0x7'))(_0xa290('0x8'));var config=require(_0xa290('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa290('0xa')][_0xa290('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5759bc,_0x321c7d,_0x2e3a76){return new BPromise(function(_0x55216c,_0xc2b41a){return client[_0xa290('0xc')](_0x5759bc,_0x2e3a76)[_0xa290('0xd')](function(_0x52f4ad){logger['info'](_0xa290('0xe'),_0x321c7d,_0xa290('0xf'));logger[_0xa290('0x10')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x321c7d,_0xa290('0xf'),JSON[_0xa290('0x11')](_0x52f4ad));if(_0x52f4ad[_0xa290('0x12')]){if(_0x52f4ad['error'][_0xa290('0x13')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x321c7d,_0x52f4ad['error'][_0xa290('0x14')]);return _0xc2b41a(_0x52f4ad[_0xa290('0x12')][_0xa290('0x14')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x321c7d,_0x52f4ad[_0xa290('0x12')][_0xa290('0x14')]);return _0x55216c(_0x52f4ad['error'][_0xa290('0x14')]);}else{logger[_0xa290('0x15')](_0xa290('0xe'),_0x321c7d,_0xa290('0xf'));_0x55216c(_0x52f4ad[_0xa290('0x16')][_0xa290('0x14')]);}})[_0xa290('0x17')](function(_0x106124){logger['error'](_0xa290('0xe'),_0x321c7d,_0x106124);_0xc2b41a(_0x106124);});});}
\ No newline at end of file
+var _0xbfe6=['message','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3bd6e5,_0x247f2c){var _0x111da7=function(_0x41222c){while(--_0x41222c){_0x3bd6e5['push'](_0x3bd6e5['shift']());}};_0x111da7(++_0x247f2c);}(_0xbfe6,0x158));var _0x6bfe=function(_0x33ff0c,_0x448c2a){_0x33ff0c=_0x33ff0c-0x0;var _0x44bdc2=_0xbfe6[_0x33ff0c];return _0x44bdc2;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6bfe('0x0'));var rs=require(_0x6bfe('0x1'));var fs=require('fs');var Redis=require(_0x6bfe('0x2'));var db=require(_0x6bfe('0x3'))['db'];var utils=require(_0x6bfe('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x6bfe('0x5'));var jayson=require(_0x6bfe('0x6'));var client=jayson[_0x6bfe('0x7')][_0x6bfe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x37ef92,_0x4fc926,_0x14689c){return new BPromise(function(_0x27e9f9,_0x11c0d6){return client[_0x6bfe('0x9')](_0x37ef92,_0x14689c)[_0x6bfe('0xa')](function(_0x2d2844){logger[_0x6bfe('0xb')](_0x6bfe('0xc'),_0x4fc926,_0x6bfe('0xd'));logger[_0x6bfe('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4fc926,'request\x20sent',JSON[_0x6bfe('0xf')](_0x2d2844));if(_0x2d2844[_0x6bfe('0x10')]){if(_0x2d2844[_0x6bfe('0x10')]['code']===0x1f4){logger['error'](_0x6bfe('0xc'),_0x4fc926,_0x2d2844['error'][_0x6bfe('0x11')]);return _0x11c0d6(_0x2d2844[_0x6bfe('0x10')]['message']);}logger[_0x6bfe('0x10')](_0x6bfe('0xc'),_0x4fc926,_0x2d2844['error'][_0x6bfe('0x11')]);return _0x27e9f9(_0x2d2844[_0x6bfe('0x10')][_0x6bfe('0x11')]);}else{logger[_0x6bfe('0xb')](_0x6bfe('0xc'),_0x4fc926,_0x6bfe('0xd'));_0x27e9f9(_0x2d2844[_0x6bfe('0x12')][_0x6bfe('0x11')]);}})['catch'](function(_0x45684b){logger[_0x6bfe('0x10')](_0x6bfe('0xc'),_0x4fc926,_0x45684b);_0x11c0d6(_0x45684b);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 4d9344b..41ec6f4 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 _0xcca6=['update','delete','bulkDestroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','create','/create_many','bulkCreate','addFields'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xcca6,0xcc));var _0x6cca=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0xcca6[_0x382c73];return _0x1dd0bf;};'use strict';var multer=require(_0x6cca('0x0'));var util=require(_0x6cca('0x1'));var path=require(_0x6cca('0x2'));var timeout=require('connect-timeout');var express=require(_0x6cca('0x3'));var router=express[_0x6cca('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6cca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6cca('0x6'));var controller=require('./analyticFieldReport.controller');router['get']('/',auth[_0x6cca('0x7')](),controller[_0x6cca('0x8')]);router[_0x6cca('0x9')](_0x6cca('0xa'),auth[_0x6cca('0x7')](),controller[_0x6cca('0xb')]);router['post']('/',auth[_0x6cca('0x7')](),controller[_0x6cca('0xc')]);router['post'](_0x6cca('0xd'),auth[_0x6cca('0x7')](),controller[_0x6cca('0xe')]);router['post']('/:id/create_many',auth['isAuthenticated'](),controller[_0x6cca('0xf')]);router['put'](_0x6cca('0xa'),auth[_0x6cca('0x7')](),controller[_0x6cca('0x10')]);router[_0x6cca('0x11')]('/destroy_many',auth['isAuthenticated'](),controller[_0x6cca('0x12')]);router[_0x6cca('0x11')](_0x6cca('0xa'),auth[_0x6cca('0x7')](),controller['destroy']);module[_0x6cca('0x13')]=router;
\ No newline at end of file
+var _0x3c94=['get','isAuthenticated','index','show','post','create','/create_many','/:id/create_many','put','/:id','bulkDestroy','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./analyticFieldReport.controller'];(function(_0x4eb6a5,_0x2e9070){var _0x7e2ece=function(_0x43e10b){while(--_0x43e10b){_0x4eb6a5['push'](_0x4eb6a5['shift']());}};_0x7e2ece(++_0x2e9070);}(_0x3c94,0x19a));var _0x43c9=function(_0x2dd628,_0x3c22e4){_0x2dd628=_0x2dd628-0x0;var _0x2e138c=_0x3c94[_0x2dd628];return _0x2e138c;};'use strict';var multer=require(_0x43c9('0x0'));var util=require(_0x43c9('0x1'));var path=require(_0x43c9('0x2'));var timeout=require(_0x43c9('0x3'));var express=require(_0x43c9('0x4'));var router=express[_0x43c9('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x43c9('0x6'));var config=require('../../config/environment');var controller=require(_0x43c9('0x7'));router[_0x43c9('0x8')]('/',auth[_0x43c9('0x9')](),controller[_0x43c9('0xa')]);router['get']('/:id',auth[_0x43c9('0x9')](),controller[_0x43c9('0xb')]);router[_0x43c9('0xc')]('/',auth[_0x43c9('0x9')](),controller[_0x43c9('0xd')]);router[_0x43c9('0xc')](_0x43c9('0xe'),auth[_0x43c9('0x9')](),controller['bulkCreate']);router[_0x43c9('0xc')](_0x43c9('0xf'),auth[_0x43c9('0x9')](),controller['addFields']);router[_0x43c9('0x10')](_0x43c9('0x11'),auth[_0x43c9('0x9')](),controller['update']);router['delete']('/destroy_many',auth['isAuthenticated'](),controller[_0x43c9('0x12')]);router[_0x43c9('0x13')](_0x43c9('0x11'),auth['isAuthenticated'](),controller[_0x43c9('0x14')]);module[_0x43c9('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 91b59b4..81e1482 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 _0xc771=['STRING','name','TEXT','sequelize','exports'];(function(_0x5ae642,_0x3bd071){var _0x29a019=function(_0xebe837){while(--_0xebe837){_0x5ae642['push'](_0x5ae642['shift']());}};_0x29a019(++_0x3bd071);}(_0xc771,0x1d9));var _0x1c77=function(_0xa33a79,_0xa8021e){_0xa33a79=_0xa33a79-0x0;var _0xcd2c61=_0xc771[_0xa33a79];return _0xcd2c61;};'use strict';var Sequelize=require(_0x1c77('0x0'));module[_0x1c77('0x1')]={'name':{'type':Sequelize[_0x1c77('0x2')],'allowNull':![],'unique':_0x1c77('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x1c77('0x4')]},'description':{'type':Sequelize[_0x1c77('0x2')]}};
\ No newline at end of file
+var _0x854f=['STRING','name','TEXT','sequelize','exports'];(function(_0x5b731c,_0x14118b){var _0x3c3ae2=function(_0x402ad0){while(--_0x402ad0){_0x5b731c['push'](_0x5b731c['shift']());}};_0x3c3ae2(++_0x14118b);}(_0x854f,0xc1));var _0xf854=function(_0x1e1d87,_0x567a72){_0x1e1d87=_0x1e1d87-0x0;var _0x571e5b=_0x854f[_0x1e1d87];return _0x571e5b;};'use strict';var Sequelize=require(_0xf854('0x0'));module[_0xf854('0x1')]={'name':{'type':Sequelize[_0xf854('0x2')],'allowNull':![],'unique':_0xf854('0x3')},'table':{'type':Sequelize[_0xf854('0x2')]},'metric':{'type':Sequelize[_0xf854('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 b138536..ce53ccc 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 _0x55e9=['error','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','limit','where','filter','VIRTUAL','options','includeAll','include','findAll','catch','keys','merge','create','body','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','then','destroy','get','Metrics','UserProfileResource'];(function(_0x373eaa,_0x24f131){var _0x5a1b12=function(_0x39eb52){while(--_0x39eb52){_0x373eaa['push'](_0x373eaa['shift']());}};_0x5a1b12(++_0x24f131);}(_0x55e9,0xcd));var _0x955e=function(_0x2d36a6,_0x2f8cd0){_0x2d36a6=_0x2d36a6-0x0;var _0x59cec0=_0x55e9[_0x2d36a6];return _0x59cec0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x955e('0x0'));var zipdir=require(_0x955e('0x1'));var jsonpatch=require(_0x955e('0x2'));var rp=require(_0x955e('0x3'));var moment=require(_0x955e('0x4'));var BPromise=require(_0x955e('0x5'));var Mustache=require(_0x955e('0x6'));var util=require(_0x955e('0x7'));var path=require(_0x955e('0x8'));var sox=require(_0x955e('0x9'));var csv=require('to-csv');var ejs=require(_0x955e('0xa'));var fs=require('fs');var fs_extra=require(_0x955e('0xb'));var _=require(_0x955e('0xc'));var squel=require('squel');var crypto=require(_0x955e('0xd'));var jsforce=require(_0x955e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x955e('0xf'));var querystring=require(_0x955e('0x10'));var Papa=require(_0x955e('0x11'));var Redis=require(_0x955e('0x12'));var authService=require(_0x955e('0x13'));var qs=require(_0x955e('0x14'));var as=require(_0x955e('0x15'));var hardwareService=require(_0x955e('0x16'));var logger=require(_0x955e('0x17'))(_0x955e('0x18'));var utils=require(_0x955e('0x19'));var config=require(_0x955e('0x1a'));var licenseUtil=require(_0x955e('0x1b'));var db=require(_0x955e('0x1c'))['db'];function respondWithStatusCode(_0x30d3c6,_0x301f48){_0x301f48=_0x301f48||0xcc;return function(_0xe8132){if(_0xe8132){return _0x30d3c6[_0x955e('0x1d')](_0x301f48);}return _0x30d3c6[_0x955e('0x1e')](_0x301f48)['end']();};}function respondWithResult(_0x588ac5,_0x5acfca){_0x5acfca=_0x5acfca||0xc8;return function(_0x683fa4){if(_0x683fa4){return _0x588ac5[_0x955e('0x1e')](_0x5acfca)[_0x955e('0x1f')](_0x683fa4);}};}function respondWithFilteredResult(_0xe8a9eb,_0x14b2bc){return function(_0xb24016){if(_0xb24016){var _0xc464d2=typeof _0x14b2bc[_0x955e('0x20')]===_0x955e('0x21')&&typeof _0x14b2bc['limit']===_0x955e('0x21');var _0x207ba2=_0xb24016[_0x955e('0x22')];var _0x53973a=_0xc464d2?0x0:_0x14b2bc[_0x955e('0x20')];var _0xdc8e5e=_0xc464d2?_0xb24016[_0x955e('0x22')]:_0x14b2bc[_0x955e('0x20')]+_0x14b2bc['limit'];var _0x598d12;if(_0xdc8e5e>=_0x207ba2){_0xdc8e5e=_0x207ba2;_0x598d12=0xc8;}else{_0x598d12=0xce;}_0xe8a9eb[_0x955e('0x1e')](_0x598d12);return _0xe8a9eb['set'](_0x955e('0x23'),_0x53973a+'-'+_0xdc8e5e+'/'+_0x207ba2)['json'](_0xb24016);}return null;};}function patchUpdates(_0x56f826){return function(_0x56c0ec){try{jsonpatch[_0x955e('0x24')](_0x56c0ec,_0x56f826,!![]);}catch(_0x109bd0){return BPromise[_0x955e('0x25')](_0x109bd0);}return _0x56c0ec[_0x955e('0x26')]();};}function saveUpdates(_0xb604e7,_0x1593bb){return function(_0x3add7e){if(_0x3add7e){return _0x3add7e['update'](_0xb604e7)[_0x955e('0x27')](function(_0x153389){return _0x153389;});}return null;};}function removeEntity(_0x226e57,_0x5743a3){return function(_0x53b382){if(_0x53b382){return _0x53b382[_0x955e('0x28')]()[_0x955e('0x27')](function(){var _0x1548cc=_0x53b382[_0x955e('0x29')]({'plain':!![]});var _0x3cc7b7=_0x955e('0x2a');return db[_0x955e('0x2b')][_0x955e('0x28')]({'where':{'type':_0x3cc7b7,'resourceId':_0x1548cc['id']}})[_0x955e('0x27')](function(){return _0x53b382;});})['then'](function(){_0x226e57[_0x955e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x574cb8,_0x233c51){return function(_0x33e992){if(!_0x33e992){_0x574cb8['sendStatus'](0x194);}return _0x33e992;};}function handleError(_0x400941,_0x27e25d){_0x27e25d=_0x27e25d||0x1f4;return function(_0xfd897c){logger[_0x955e('0x2c')](_0xfd897c['stack']);if(_0xfd897c[_0x955e('0x2d')]){delete _0xfd897c[_0x955e('0x2d')];}_0x400941[_0x955e('0x1e')](_0x27e25d)[_0x955e('0x2e')](_0xfd897c);};}exports[_0x955e('0x2f')]=function(_0x3c693d,_0x2cba54){var _0x467349={},_0x1fc846={},_0x305868={'count':0x0,'rows':[]};var _0x39490a=_[_0x955e('0x30')](db[_0x955e('0x31')][_0x955e('0x32')],function(_0x30d311){return{'name':_0x30d311[_0x955e('0x33')],'type':_0x30d311[_0x955e('0x34')][_0x955e('0x35')]};});_0x1fc846['model']=_[_0x955e('0x30')](_0x39490a,_0x955e('0x2d'));_0x1fc846[_0x955e('0x36')]=_['keys'](_0x3c693d[_0x955e('0x36')]);_0x1fc846[_0x955e('0x37')]=_[_0x955e('0x38')](_0x1fc846[_0x955e('0x39')],_0x1fc846[_0x955e('0x36')]);_0x467349[_0x955e('0x3a')]=_[_0x955e('0x38')](_0x1fc846[_0x955e('0x39')],qs[_0x955e('0x3b')](_0x3c693d[_0x955e('0x36')][_0x955e('0x3b')]));_0x467349['attributes']=_0x467349[_0x955e('0x3a')][_0x955e('0x3c')]?_0x467349[_0x955e('0x3a')]:_0x1fc846['model'];if(!_0x3c693d['query']['hasOwnProperty'](_0x955e('0x3d'))){_0x467349[_0x955e('0x3e')]=qs['limit'](_0x3c693d[_0x955e('0x36')][_0x955e('0x3e')]);_0x467349['offset']=qs[_0x955e('0x20')](_0x3c693d[_0x955e('0x36')]['offset']);}_0x467349['order']=qs['sort'](_0x3c693d[_0x955e('0x36')]['sort']);_0x467349[_0x955e('0x3f')]=qs[_0x955e('0x37')](_['pick'](_0x3c693d[_0x955e('0x36')],_0x1fc846['filters']),_0x39490a);if(_0x3c693d[_0x955e('0x36')][_0x955e('0x40')]){_0x467349[_0x955e('0x3f')]=_['merge'](_0x467349['where'],{'$or':_[_0x955e('0x30')](_0x39490a,function(_0x56aa01){if(_0x56aa01['type']!==_0x955e('0x41')){var _0x40ce5a={};_0x40ce5a[_0x56aa01[_0x955e('0x2d')]]={'$like':'%'+_0x3c693d['query'][_0x955e('0x40')]+'%'};return _0x40ce5a;}})});}_0x467349=_['merge']({},_0x467349,_0x3c693d[_0x955e('0x42')]);var _0x2f8382={'where':_0x467349[_0x955e('0x3f')]};return db[_0x955e('0x31')][_0x955e('0x22')](_0x2f8382)[_0x955e('0x27')](function(_0x93644d){_0x305868['count']=_0x93644d;if(_0x3c693d[_0x955e('0x36')][_0x955e('0x43')]){_0x467349[_0x955e('0x44')]=[{'all':!![]}];}return db[_0x955e('0x31')][_0x955e('0x45')](_0x467349);})['then'](function(_0xa6e85f){_0x305868['rows']=_0xa6e85f;return _0x305868;})[_0x955e('0x27')](respondWithFilteredResult(_0x2cba54,_0x467349))[_0x955e('0x46')](handleError(_0x2cba54,null));};exports['show']=function(_0x27a173,_0x4c8f74){var _0x59d887={'raw':!![],'where':{'id':_0x27a173['params']['id']}},_0x59be84={};_0x59be84[_0x955e('0x39')]=_[_0x955e('0x47')](db[_0x955e('0x31')][_0x955e('0x32')]);_0x59be84[_0x955e('0x36')]=_[_0x955e('0x47')](_0x27a173[_0x955e('0x36')]);_0x59be84[_0x955e('0x37')]=_[_0x955e('0x38')](_0x59be84[_0x955e('0x39')],_0x59be84[_0x955e('0x36')]);_0x59d887[_0x955e('0x3a')]=_[_0x955e('0x38')](_0x59be84[_0x955e('0x39')],qs[_0x955e('0x3b')](_0x27a173[_0x955e('0x36')]['fields']));_0x59d887['attributes']=_0x59d887[_0x955e('0x3a')][_0x955e('0x3c')]?_0x59d887[_0x955e('0x3a')]:_0x59be84[_0x955e('0x39')];if(_0x27a173[_0x955e('0x36')][_0x955e('0x43')]){_0x59d887[_0x955e('0x44')]=[{'all':!![]}];}_0x59d887=_[_0x955e('0x48')]({},_0x59d887,_0x27a173[_0x955e('0x42')]);return db[_0x955e('0x31')]['find'](_0x59d887)[_0x955e('0x27')](handleEntityNotFound(_0x4c8f74,null))[_0x955e('0x27')](respondWithResult(_0x4c8f74,null))['catch'](handleError(_0x4c8f74,null));};exports[_0x955e('0x49')]=function(_0x5d7f28,_0x738a9a){return db[_0x955e('0x31')][_0x955e('0x49')](_0x5d7f28[_0x955e('0x4a')],{})['then'](function(_0x2b2ec9){var _0x1dd30e=_0x5d7f28['user']['get']({'plain':!![]});if(!_0x1dd30e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1dd30e[_0x955e('0x4b')]==='user'){var _0x4864d8=_0x2b2ec9['get']({'plain':!![]});var _0xddc753=_0x955e('0x2a');return db[_0x955e('0x4c')][_0x955e('0x4d')]({'where':{'name':_0xddc753,'userProfileId':_0x1dd30e[_0x955e('0x4e')]},'raw':!![]})[_0x955e('0x27')](function(_0x537867){if(_0x537867&&_0x537867[_0x955e('0x4f')]===0x0){return db['UserProfileResource'][_0x955e('0x49')]({'name':_0x4864d8[_0x955e('0x2d')],'resourceId':_0x4864d8['id'],'type':_0x537867[_0x955e('0x2d')],'sectionId':_0x537867['id']},{})[_0x955e('0x27')](function(){return _0x2b2ec9;});}else{return _0x2b2ec9;}})['catch'](function(_0x2c5fa9){logger['error'](_0x955e('0x50'),_0x2c5fa9);throw _0x2c5fa9;});}return _0x2b2ec9;})[_0x955e('0x27')](respondWithResult(_0x738a9a,0xc9))[_0x955e('0x46')](handleError(_0x738a9a,null));};exports[_0x955e('0x51')]=function(_0x4ba5aa,_0x31bc32){if(_0x4ba5aa[_0x955e('0x4a')]['id']){delete _0x4ba5aa[_0x955e('0x4a')]['id'];}return db[_0x955e('0x31')][_0x955e('0x4d')]({'where':{'id':_0x4ba5aa[_0x955e('0x52')]['id']}})[_0x955e('0x27')](handleEntityNotFound(_0x31bc32,null))['then'](saveUpdates(_0x4ba5aa[_0x955e('0x4a')],null))[_0x955e('0x27')](respondWithResult(_0x31bc32,null))['catch'](handleError(_0x31bc32,null));};exports[_0x955e('0x28')]=function(_0x11609d,_0x3e897d){return db[_0x955e('0x31')][_0x955e('0x4d')]({'where':{'id':_0x11609d[_0x955e('0x52')]['id']}})[_0x955e('0x27')](handleEntityNotFound(_0x3e897d,null))[_0x955e('0x27')](removeEntity(_0x3e897d,null))[_0x955e('0x46')](handleError(_0x3e897d,null));};
\ No newline at end of file
+var _0x3b61=['status','error','name','send','index','AnalyticMetric','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','merge','where','VIRTUAL','options','findAll','show','params','include','catch','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','set','json','apply','reject','update','then','destroy','get','Metrics'];(function(_0x379b1f,_0x2bf2f8){var _0x4c663c=function(_0x21b99d){while(--_0x21b99d){_0x379b1f['push'](_0x379b1f['shift']());}};_0x4c663c(++_0x2bf2f8);}(_0x3b61,0xd2));var _0x13b6=function(_0x391c01,_0x8a4737){_0x391c01=_0x391c01-0x0;var _0x21b62a=_0x3b61[_0x391c01];return _0x21b62a;};'use strict';var emlformat=require(_0x13b6('0x0'));var rimraf=require(_0x13b6('0x1'));var zipdir=require(_0x13b6('0x2'));var jsonpatch=require(_0x13b6('0x3'));var rp=require(_0x13b6('0x4'));var moment=require(_0x13b6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x13b6('0x6'));var util=require(_0x13b6('0x7'));var path=require(_0x13b6('0x8'));var sox=require(_0x13b6('0x9'));var csv=require(_0x13b6('0xa'));var ejs=require(_0x13b6('0xb'));var fs=require('fs');var fs_extra=require(_0x13b6('0xc'));var _=require(_0x13b6('0xd'));var squel=require(_0x13b6('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x13b6('0xf'));var toCsv=require(_0x13b6('0xa'));var querystring=require(_0x13b6('0x10'));var Papa=require(_0x13b6('0x11'));var Redis=require('ioredis');var authService=require(_0x13b6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x13b6('0x13'));var hardwareService=require(_0x13b6('0x14'));var logger=require(_0x13b6('0x15'))(_0x13b6('0x16'));var utils=require(_0x13b6('0x17'));var config=require(_0x13b6('0x18'));var licenseUtil=require(_0x13b6('0x19'));var db=require(_0x13b6('0x1a'))['db'];function respondWithStatusCode(_0x1cebd1,_0x47f523){_0x47f523=_0x47f523||0xcc;return function(_0x507898){if(_0x507898){return _0x1cebd1[_0x13b6('0x1b')](_0x47f523);}return _0x1cebd1['status'](_0x47f523)[_0x13b6('0x1c')]();};}function respondWithResult(_0x33f9b9,_0x5e027b){_0x5e027b=_0x5e027b||0xc8;return function(_0x364791){if(_0x364791){return _0x33f9b9['status'](_0x5e027b)['json'](_0x364791);}};}function respondWithFilteredResult(_0x14b6c1,_0x1b7833){return function(_0x2c45f2){if(_0x2c45f2){var _0x2f6558=typeof _0x1b7833[_0x13b6('0x1d')]===_0x13b6('0x1e')&&typeof _0x1b7833[_0x13b6('0x1f')]==='undefined';var _0x390088=_0x2c45f2[_0x13b6('0x20')];var _0x514eb9=_0x2f6558?0x0:_0x1b7833[_0x13b6('0x1d')];var _0xc68255=_0x2f6558?_0x2c45f2[_0x13b6('0x20')]:_0x1b7833[_0x13b6('0x1d')]+_0x1b7833[_0x13b6('0x1f')];var _0x1e755a;if(_0xc68255>=_0x390088){_0xc68255=_0x390088;_0x1e755a=0xc8;}else{_0x1e755a=0xce;}_0x14b6c1['status'](_0x1e755a);return _0x14b6c1[_0x13b6('0x21')]('Content-Range',_0x514eb9+'-'+_0xc68255+'/'+_0x390088)[_0x13b6('0x22')](_0x2c45f2);}return null;};}function patchUpdates(_0x4567a5){return function(_0x44cc93){try{jsonpatch[_0x13b6('0x23')](_0x44cc93,_0x4567a5,!![]);}catch(_0x1c258a){return BPromise[_0x13b6('0x24')](_0x1c258a);}return _0x44cc93['save']();};}function saveUpdates(_0x5b4ce8,_0x2cf692){return function(_0x5618fa){if(_0x5618fa){return _0x5618fa[_0x13b6('0x25')](_0x5b4ce8)[_0x13b6('0x26')](function(_0x5bb90f){return _0x5bb90f;});}return null;};}function removeEntity(_0x53eb32,_0x18afc8){return function(_0x47ca44){if(_0x47ca44){return _0x47ca44[_0x13b6('0x27')]()['then'](function(){var _0x7f601c=_0x47ca44[_0x13b6('0x28')]({'plain':!![]});var _0x58543c=_0x13b6('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x58543c,'resourceId':_0x7f601c['id']}})[_0x13b6('0x26')](function(){return _0x47ca44;});})[_0x13b6('0x26')](function(){_0x53eb32[_0x13b6('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x536edb,_0x24ca47){return function(_0x2e78ee){if(!_0x2e78ee){_0x536edb[_0x13b6('0x1b')](0x194);}return _0x2e78ee;};}function handleError(_0x2fd32b,_0x48f91d){_0x48f91d=_0x48f91d||0x1f4;return function(_0x5d76d3){logger[_0x13b6('0x2b')](_0x5d76d3['stack']);if(_0x5d76d3[_0x13b6('0x2c')]){delete _0x5d76d3[_0x13b6('0x2c')];}_0x2fd32b[_0x13b6('0x2a')](_0x48f91d)[_0x13b6('0x2d')](_0x5d76d3);};}exports[_0x13b6('0x2e')]=function(_0x1d5a66,_0x17e39d){var _0x61cd2d={},_0x1f7208={},_0x1f0d95={'count':0x0,'rows':[]};var _0x2626e3=_['map'](db[_0x13b6('0x2f')][_0x13b6('0x30')],function(_0x2774d7){return{'name':_0x2774d7[_0x13b6('0x31')],'type':_0x2774d7[_0x13b6('0x32')][_0x13b6('0x33')]};});_0x1f7208[_0x13b6('0x34')]=_[_0x13b6('0x35')](_0x2626e3,_0x13b6('0x2c'));_0x1f7208[_0x13b6('0x36')]=_[_0x13b6('0x37')](_0x1d5a66[_0x13b6('0x36')]);_0x1f7208[_0x13b6('0x38')]=_[_0x13b6('0x39')](_0x1f7208[_0x13b6('0x34')],_0x1f7208[_0x13b6('0x36')]);_0x61cd2d[_0x13b6('0x3a')]=_[_0x13b6('0x39')](_0x1f7208[_0x13b6('0x34')],qs['fields'](_0x1d5a66[_0x13b6('0x36')][_0x13b6('0x3b')]));_0x61cd2d[_0x13b6('0x3a')]=_0x61cd2d[_0x13b6('0x3a')][_0x13b6('0x3c')]?_0x61cd2d['attributes']:_0x1f7208['model'];if(!_0x1d5a66[_0x13b6('0x36')]['hasOwnProperty'](_0x13b6('0x3d'))){_0x61cd2d[_0x13b6('0x1f')]=qs['limit'](_0x1d5a66['query'][_0x13b6('0x1f')]);_0x61cd2d['offset']=qs[_0x13b6('0x1d')](_0x1d5a66['query'][_0x13b6('0x1d')]);}_0x61cd2d[_0x13b6('0x3e')]=qs[_0x13b6('0x3f')](_0x1d5a66[_0x13b6('0x36')][_0x13b6('0x3f')]);_0x61cd2d['where']=qs['filters'](_['pick'](_0x1d5a66['query'],_0x1f7208[_0x13b6('0x38')]),_0x2626e3);if(_0x1d5a66[_0x13b6('0x36')][_0x13b6('0x40')]){_0x61cd2d['where']=_[_0x13b6('0x41')](_0x61cd2d[_0x13b6('0x42')],{'$or':_['map'](_0x2626e3,function(_0x5d27c6){if(_0x5d27c6[_0x13b6('0x32')]!==_0x13b6('0x43')){var _0x437231={};_0x437231[_0x5d27c6['name']]={'$like':'%'+_0x1d5a66[_0x13b6('0x36')][_0x13b6('0x40')]+'%'};return _0x437231;}})});}_0x61cd2d=_[_0x13b6('0x41')]({},_0x61cd2d,_0x1d5a66[_0x13b6('0x44')]);var _0x34c2a7={'where':_0x61cd2d[_0x13b6('0x42')]};return db[_0x13b6('0x2f')][_0x13b6('0x20')](_0x34c2a7)[_0x13b6('0x26')](function(_0x1b6483){_0x1f0d95[_0x13b6('0x20')]=_0x1b6483;if(_0x1d5a66[_0x13b6('0x36')]['includeAll']){_0x61cd2d['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0x13b6('0x45')](_0x61cd2d);})[_0x13b6('0x26')](function(_0x1ac257){_0x1f0d95['rows']=_0x1ac257;return _0x1f0d95;})[_0x13b6('0x26')](respondWithFilteredResult(_0x17e39d,_0x61cd2d))['catch'](handleError(_0x17e39d,null));};exports[_0x13b6('0x46')]=function(_0x1080eb,_0x287445){var _0x319039={'raw':!![],'where':{'id':_0x1080eb[_0x13b6('0x47')]['id']}},_0x305ddd={};_0x305ddd[_0x13b6('0x34')]=_[_0x13b6('0x37')](db[_0x13b6('0x2f')][_0x13b6('0x30')]);_0x305ddd[_0x13b6('0x36')]=_['keys'](_0x1080eb['query']);_0x305ddd[_0x13b6('0x38')]=_[_0x13b6('0x39')](_0x305ddd['model'],_0x305ddd[_0x13b6('0x36')]);_0x319039[_0x13b6('0x3a')]=_[_0x13b6('0x39')](_0x305ddd[_0x13b6('0x34')],qs['fields'](_0x1080eb[_0x13b6('0x36')][_0x13b6('0x3b')]));_0x319039[_0x13b6('0x3a')]=_0x319039['attributes'][_0x13b6('0x3c')]?_0x319039[_0x13b6('0x3a')]:_0x305ddd[_0x13b6('0x34')];if(_0x1080eb['query']['includeAll']){_0x319039[_0x13b6('0x48')]=[{'all':!![]}];}_0x319039=_[_0x13b6('0x41')]({},_0x319039,_0x1080eb['options']);return db['AnalyticMetric']['find'](_0x319039)['then'](handleEntityNotFound(_0x287445,null))[_0x13b6('0x26')](respondWithResult(_0x287445,null))[_0x13b6('0x49')](handleError(_0x287445,null));};exports['create']=function(_0x1b0bae,_0x4112d8){return db[_0x13b6('0x2f')]['create'](_0x1b0bae[_0x13b6('0x4a')],{})['then'](function(_0x567946){var _0x3d02da=_0x1b0bae['user'][_0x13b6('0x28')]({'plain':!![]});if(!_0x3d02da)throw new Error(_0x13b6('0x4b'));if(_0x3d02da[_0x13b6('0x4c')]===_0x13b6('0x4d')){var _0x5d3c88=_0x567946[_0x13b6('0x28')]({'plain':!![]});var _0x543c93=_0x13b6('0x29');return db[_0x13b6('0x4e')][_0x13b6('0x4f')]({'where':{'name':_0x543c93,'userProfileId':_0x3d02da[_0x13b6('0x50')]},'raw':!![]})[_0x13b6('0x26')](function(_0x5451db){if(_0x5451db&&_0x5451db[_0x13b6('0x51')]===0x0){return db['UserProfileResource'][_0x13b6('0x52')]({'name':_0x5d3c88[_0x13b6('0x2c')],'resourceId':_0x5d3c88['id'],'type':_0x5451db[_0x13b6('0x2c')],'sectionId':_0x5451db['id']},{})['then'](function(){return _0x567946;});}else{return _0x567946;}})[_0x13b6('0x49')](function(_0x4f1670){logger[_0x13b6('0x2b')](_0x13b6('0x53'),_0x4f1670);throw _0x4f1670;});}return _0x567946;})[_0x13b6('0x26')](respondWithResult(_0x4112d8,0xc9))[_0x13b6('0x49')](handleError(_0x4112d8,null));};exports[_0x13b6('0x25')]=function(_0x26ba0c,_0xb89e34){if(_0x26ba0c['body']['id']){delete _0x26ba0c[_0x13b6('0x4a')]['id'];}return db[_0x13b6('0x2f')][_0x13b6('0x4f')]({'where':{'id':_0x26ba0c['params']['id']}})[_0x13b6('0x26')](handleEntityNotFound(_0xb89e34,null))['then'](saveUpdates(_0x26ba0c[_0x13b6('0x4a')],null))[_0x13b6('0x26')](respondWithResult(_0xb89e34,null))[_0x13b6('0x49')](handleError(_0xb89e34,null));};exports[_0x13b6('0x27')]=function(_0x580e80,_0x203952){return db[_0x13b6('0x2f')][_0x13b6('0x4f')]({'where':{'id':_0x580e80[_0x13b6('0x47')]['id']}})[_0x13b6('0x26')](handleEntityNotFound(_0x203952,null))[_0x13b6('0x26')](removeEntity(_0x203952,null))[_0x13b6('0x49')](handleError(_0x203952,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 44e05c4..b54fa9a 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 _0x43b7=['request-promise','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','api','moment'];(function(_0x38a74f,_0x338460){var _0x346506=function(_0x1f4b03){while(--_0x1f4b03){_0x38a74f['push'](_0x38a74f['shift']());}};_0x346506(++_0x338460);}(_0x43b7,0x13c));var _0x743b=function(_0x13fe48,_0x437d73){_0x13fe48=_0x13fe48-0x0;var _0x160e83=_0x43b7[_0x13fe48];return _0x160e83;};'use strict';var _=require(_0x743b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x743b('0x1'));var moment=require(_0x743b('0x2'));var BPromise=require('bluebird');var rp=require(_0x743b('0x3'));var fs=require('fs');var path=require(_0x743b('0x4'));var rimraf=require(_0x743b('0x5'));var config=require('../../config/environment');var attributes=require(_0x743b('0x6'));module[_0x743b('0x7')]=function(_0x1eecd8,_0x559368){return _0x1eecd8[_0x743b('0x8')](_0x743b('0x9'),attributes,{'tableName':_0x743b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb785=['moment','bluebird','request-promise','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api'];(function(_0xd6e779,_0x16fdf6){var _0x1bf584=function(_0x318f65){while(--_0x318f65){_0xd6e779['push'](_0xd6e779['shift']());}};_0x1bf584(++_0x16fdf6);}(_0xb785,0x195));var _0x5b78=function(_0x2b5bd8,_0x2479e2){_0x2b5bd8=_0x2b5bd8-0x0;var _0x18b545=_0xb785[_0x2b5bd8];return _0x18b545;};'use strict';var _=require(_0x5b78('0x0'));var util=require('util');var logger=require(_0x5b78('0x1'))(_0x5b78('0x2'));var moment=require(_0x5b78('0x3'));var BPromise=require(_0x5b78('0x4'));var rp=require(_0x5b78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5b78('0x6'));var config=require('../../config/environment');var attributes=require(_0x5b78('0x7'));module[_0x5b78('0x8')]=function(_0x4e2932,_0x334a7e){return _0x4e2932[_0x5b78('0x9')](_0x5b78('0xa'),attributes,{'tableName':_0x5b78('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index a0513e9..fc0d805 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 _0xbaf3=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xbaf3,0xd7));var _0x3baf=function(_0x4858b0,_0x9dea28){_0x4858b0=_0x4858b0-0x0;var _0x5b05b5=_0xbaf3[_0x4858b0];return _0x5b05b5;};'use strict';var _=require(_0x3baf('0x0'));var util=require('util');var moment=require(_0x3baf('0x1'));var BPromise=require(_0x3baf('0x2'));var rs=require(_0x3baf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3baf('0x4'))['db'];var utils=require(_0x3baf('0x5'));var logger=require(_0x3baf('0x6'))(_0x3baf('0x7'));var config=require(_0x3baf('0x8'));var jayson=require(_0x3baf('0x9'));var client=jayson[_0x3baf('0xa')][_0x3baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x92c93,_0x236365,_0x524aa7){return new BPromise(function(_0xc932c6,_0x49ae51){return client['request'](_0x92c93,_0x524aa7)[_0x3baf('0xc')](function(_0x172fdf){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x236365,_0x3baf('0xd'));logger[_0x3baf('0xe')](_0x3baf('0xf'),_0x236365,'request\x20sent',JSON['stringify'](_0x172fdf));if(_0x172fdf[_0x3baf('0x10')]){if(_0x172fdf['error'][_0x3baf('0x11')]===0x1f4){logger[_0x3baf('0x10')](_0x3baf('0x12'),_0x236365,_0x172fdf['error'][_0x3baf('0x13')]);return _0x49ae51(_0x172fdf['error'][_0x3baf('0x13')]);}logger[_0x3baf('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x236365,_0x172fdf['error'][_0x3baf('0x13')]);return _0xc932c6(_0x172fdf[_0x3baf('0x10')]['message']);}else{logger['info'](_0x3baf('0x12'),_0x236365,_0x3baf('0xd'));_0xc932c6(_0x172fdf[_0x3baf('0x14')][_0x3baf('0x13')]);}})[_0x3baf('0x15')](function(_0xa98715){logger[_0x3baf('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x236365,_0xa98715);_0x49ae51(_0xa98715);});});}
\ No newline at end of file
+var _0x43d3=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','info','result'];(function(_0x44dfb7,_0x70cde4){var _0x410fda=function(_0x364a0a){while(--_0x364a0a){_0x44dfb7['push'](_0x44dfb7['shift']());}};_0x410fda(++_0x70cde4);}(_0x43d3,0x181));var _0x343d=function(_0x30fbd1,_0x49cb8b){_0x30fbd1=_0x30fbd1-0x0;var _0x3492f5=_0x43d3[_0x30fbd1];return _0x3492f5;};'use strict';var _=require(_0x343d('0x0'));var util=require(_0x343d('0x1'));var moment=require('moment');var BPromise=require(_0x343d('0x2'));var rs=require(_0x343d('0x3'));var fs=require('fs');var Redis=require(_0x343d('0x4'));var db=require(_0x343d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x343d('0x6'))(_0x343d('0x7'));var config=require(_0x343d('0x8'));var jayson=require(_0x343d('0x9'));var client=jayson[_0x343d('0xa')][_0x343d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcea011,_0x45a58f,_0x5990ad){return new BPromise(function(_0x4b4355,_0x30a81b){return client[_0x343d('0xc')](_0xcea011,_0x5990ad)[_0x343d('0xd')](function(_0x156c47){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x45a58f,_0x343d('0xe'));logger[_0x343d('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x45a58f,_0x343d('0xe'),JSON[_0x343d('0x10')](_0x156c47));if(_0x156c47[_0x343d('0x11')]){if(_0x156c47[_0x343d('0x11')][_0x343d('0x12')]===0x1f4){logger['error'](_0x343d('0x13'),_0x45a58f,_0x156c47[_0x343d('0x11')]['message']);return _0x30a81b(_0x156c47[_0x343d('0x11')][_0x343d('0x14')]);}logger['error'](_0x343d('0x13'),_0x45a58f,_0x156c47[_0x343d('0x11')][_0x343d('0x14')]);return _0x4b4355(_0x156c47[_0x343d('0x11')][_0x343d('0x14')]);}else{logger[_0x343d('0x15')](_0x343d('0x13'),_0x45a58f,_0x343d('0xe'));_0x4b4355(_0x156c47[_0x343d('0x16')][_0x343d('0x14')]);}})[_0x343d('0x17')](function(_0x2b3966){logger[_0x343d('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x45a58f,_0x2b3966);_0x30a81b(_0x2b3966);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 1ed9c4d..ac31869 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 _0xbdb7=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','index','get','show','post','put','/:id','isAuthenticated','update'];(function(_0x5427c8,_0x18f384){var _0x33a129=function(_0x1940e8){while(--_0x1940e8){_0x5427c8['push'](_0x5427c8['shift']());}};_0x33a129(++_0x18f384);}(_0xbdb7,0x12e));var _0x7bdb=function(_0xc8a02c,_0x4809d3){_0xc8a02c=_0xc8a02c-0x0;var _0x3d89da=_0xbdb7[_0xc8a02c];return _0x3d89da;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7bdb('0xe')](_0x7bdb('0xf'),auth[_0x7bdb('0x10')](),controller[_0x7bdb('0x11')]);router[_0x7bdb('0x12')](_0x7bdb('0xf'),auth[_0x7bdb('0x10')](),controller[_0x7bdb('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xea28=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xea28,0x13a));var _0x8ea2=function(_0x17d94d,_0x1bc515){_0x17d94d=_0x17d94d-0x0;var _0x5c170d=_0xea28[_0x17d94d];return _0x5c170d;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xf')]('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0x11')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x12')]);router['delete']('/:id',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);module[_0x8ea2('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index fb067f8..49e81bf 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 _0xf3ff=['sequelize','exports','TEXT'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xf3ff,0x10b));var _0xff3f=function(_0x541665,_0x334c41){_0x541665=_0x541665-0x0;var _0x3b6923=_0xf3ff[_0x541665];return _0x3b6923;};'use strict';var Sequelize=require(_0xff3f('0x0'));module[_0xff3f('0x1')]={'tree':{'type':Sequelize[_0xff3f('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xc9e1=['exports','TEXT','sequelize'];(function(_0xbfd9c3,_0xa9451d){var _0x3c2992=function(_0x2e24f1){while(--_0x2e24f1){_0xbfd9c3['push'](_0xbfd9c3['shift']());}};_0x3c2992(++_0xa9451d);}(_0xc9e1,0x74));var _0x1c9e=function(_0x225535,_0x16132c){_0x225535=_0x225535-0x0;var _0x1a7328=_0xc9e1[_0x225535];return _0x1a7328;};'use strict';var Sequelize=require(_0x1c9e('0x0'));module[_0x1c9e('0x1')]={'tree':{'type':Sequelize[_0x1c9e('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 64cedd0..1939e17 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 _0x67b1=['end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x67b1,0x15d));var _0x167b=function(_0x28e74e,_0x53fdf1){_0x28e74e=_0x28e74e-0x0;var _0xb45ac1=_0x67b1[_0x28e74e];return _0xb45ac1;};'use strict';var emlformat=require(_0x167b('0x0'));var rimraf=require(_0x167b('0x1'));var zipdir=require(_0x167b('0x2'));var jsonpatch=require(_0x167b('0x3'));var rp=require(_0x167b('0x4'));var moment=require(_0x167b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x167b('0x6'));var util=require(_0x167b('0x7'));var path=require(_0x167b('0x8'));var sox=require(_0x167b('0x9'));var csv=require(_0x167b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x167b('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x167b('0xc'));var jsforce=require(_0x167b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x167b('0xa'));var querystring=require(_0x167b('0xe'));var Papa=require(_0x167b('0xf'));var Redis=require('ioredis');var authService=require(_0x167b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x167b('0x11'));var hardwareService=require(_0x167b('0x12'));var logger=require(_0x167b('0x13'))(_0x167b('0x14'));var utils=require(_0x167b('0x15'));var config=require(_0x167b('0x16'));var licenseUtil=require(_0x167b('0x17'));var db=require(_0x167b('0x18'))['db'];function respondWithStatusCode(_0x508988,_0x1c4c72){_0x1c4c72=_0x1c4c72||0xcc;return function(_0x557ed2){if(_0x557ed2){return _0x508988['sendStatus'](_0x1c4c72);}return _0x508988[_0x167b('0x19')](_0x1c4c72)[_0x167b('0x1a')]();};}function respondWithResult(_0x28f869,_0x59cc38){_0x59cc38=_0x59cc38||0xc8;return function(_0x441d52){if(_0x441d52){return _0x28f869['status'](_0x59cc38)[_0x167b('0x1b')](_0x441d52);}};}function respondWithFilteredResult(_0x52d387,_0x27dae6){return function(_0x4e6198){if(_0x4e6198){var _0x45b52e=typeof _0x27dae6[_0x167b('0x1c')]===_0x167b('0x1d')&&typeof _0x27dae6['limit']===_0x167b('0x1d');var _0x1133f2=_0x4e6198['count'];var _0x126300=_0x45b52e?0x0:_0x27dae6[_0x167b('0x1c')];var _0x377be5=_0x45b52e?_0x4e6198[_0x167b('0x1e')]:_0x27dae6['offset']+_0x27dae6[_0x167b('0x1f')];var _0x20a340;if(_0x377be5>=_0x1133f2){_0x377be5=_0x1133f2;_0x20a340=0xc8;}else{_0x20a340=0xce;}_0x52d387[_0x167b('0x19')](_0x20a340);return _0x52d387[_0x167b('0x20')](_0x167b('0x21'),_0x126300+'-'+_0x377be5+'/'+_0x1133f2)[_0x167b('0x1b')](_0x4e6198);}return null;};}function patchUpdates(_0x262806){return function(_0x732f43){try{jsonpatch[_0x167b('0x22')](_0x732f43,_0x262806,!![]);}catch(_0xcc14a5){return BPromise['reject'](_0xcc14a5);}return _0x732f43['save']();};}function saveUpdates(_0x14e381,_0x526289){return function(_0x3216a3){if(_0x3216a3){return _0x3216a3[_0x167b('0x23')](_0x14e381)[_0x167b('0x24')](function(_0x4f3160){return _0x4f3160;});}return null;};}function removeEntity(_0x254ab,_0x39a6bc){return function(_0xae0bc0){if(_0xae0bc0){return _0xae0bc0[_0x167b('0x25')]()[_0x167b('0x24')](function(){_0x254ab[_0x167b('0x19')](0xcc)[_0x167b('0x1a')]();});}};}function handleEntityNotFound(_0x4271fb,_0x4e279c){return function(_0xc7aba2){if(!_0xc7aba2){_0x4271fb['sendStatus'](0x194);}return _0xc7aba2;};}function handleError(_0x2589ee,_0x41bebc){_0x41bebc=_0x41bebc||0x1f4;return function(_0x25ce81){logger[_0x167b('0x26')](_0x25ce81[_0x167b('0x27')]);if(_0x25ce81[_0x167b('0x28')]){delete _0x25ce81[_0x167b('0x28')];}_0x2589ee[_0x167b('0x19')](_0x41bebc)[_0x167b('0x29')](_0x25ce81);};}exports[_0x167b('0x2a')]=function(_0x4ba2a2,_0x48aef4){var _0x18cc4c={},_0x593c77={},_0x3a4b70={'count':0x0,'rows':[]};var _0xf91dc7=_[_0x167b('0x2b')](db[_0x167b('0x2c')][_0x167b('0x2d')],function(_0x4f6c64){return{'name':_0x4f6c64[_0x167b('0x2e')],'type':_0x4f6c64['type'][_0x167b('0x2f')]};});_0x593c77[_0x167b('0x30')]=_[_0x167b('0x2b')](_0xf91dc7,'name');_0x593c77[_0x167b('0x31')]=_[_0x167b('0x32')](_0x4ba2a2[_0x167b('0x31')]);_0x593c77[_0x167b('0x33')]=_[_0x167b('0x34')](_0x593c77[_0x167b('0x30')],_0x593c77[_0x167b('0x31')]);_0x18cc4c[_0x167b('0x35')]=_[_0x167b('0x34')](_0x593c77[_0x167b('0x30')],qs[_0x167b('0x36')](_0x4ba2a2['query']['fields']));_0x18cc4c[_0x167b('0x35')]=_0x18cc4c[_0x167b('0x35')][_0x167b('0x37')]?_0x18cc4c[_0x167b('0x35')]:_0x593c77[_0x167b('0x30')];if(!_0x4ba2a2[_0x167b('0x31')][_0x167b('0x38')](_0x167b('0x39'))){_0x18cc4c['limit']=qs['limit'](_0x4ba2a2['query'][_0x167b('0x1f')]);_0x18cc4c['offset']=qs[_0x167b('0x1c')](_0x4ba2a2[_0x167b('0x31')]['offset']);}_0x18cc4c[_0x167b('0x3a')]=qs[_0x167b('0x3b')](_0x4ba2a2[_0x167b('0x31')][_0x167b('0x3b')]);_0x18cc4c[_0x167b('0x3c')]=qs[_0x167b('0x33')](_[_0x167b('0x3d')](_0x4ba2a2[_0x167b('0x31')],_0x593c77['filters']),_0xf91dc7);if(_0x4ba2a2[_0x167b('0x31')]['filter']){_0x18cc4c[_0x167b('0x3c')]=_[_0x167b('0x3e')](_0x18cc4c['where'],{'$or':_['map'](_0xf91dc7,function(_0x3484f4){if(_0x3484f4['type']!=='VIRTUAL'){var _0xa2c8dd={};_0xa2c8dd[_0x3484f4[_0x167b('0x28')]]={'$like':'%'+_0x4ba2a2[_0x167b('0x31')][_0x167b('0x3f')]+'%'};return _0xa2c8dd;}})});}_0x18cc4c=_[_0x167b('0x3e')]({},_0x18cc4c,_0x4ba2a2[_0x167b('0x40')]);var _0x400208={'where':_0x18cc4c[_0x167b('0x3c')]};return db['AnalyticTreeReport'][_0x167b('0x1e')](_0x400208)[_0x167b('0x24')](function(_0x35fea8){_0x3a4b70[_0x167b('0x1e')]=_0x35fea8;if(_0x4ba2a2[_0x167b('0x31')][_0x167b('0x41')]){_0x18cc4c[_0x167b('0x42')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x167b('0x43')](_0x18cc4c);})['then'](function(_0x22acc4){_0x3a4b70[_0x167b('0x44')]=_0x22acc4;return _0x3a4b70;})['then'](respondWithFilteredResult(_0x48aef4,_0x18cc4c))[_0x167b('0x45')](handleError(_0x48aef4,null));};exports[_0x167b('0x46')]=function(_0x53b046,_0x3e9456){var _0x26427e={'raw':!![],'where':{'id':_0x53b046['params']['id']}},_0x1647d2={};_0x1647d2['model']=_['keys'](db[_0x167b('0x2c')][_0x167b('0x2d')]);_0x1647d2['query']=_['keys'](_0x53b046['query']);_0x1647d2[_0x167b('0x33')]=_[_0x167b('0x34')](_0x1647d2[_0x167b('0x30')],_0x1647d2['query']);_0x26427e[_0x167b('0x35')]=_[_0x167b('0x34')](_0x1647d2[_0x167b('0x30')],qs['fields'](_0x53b046[_0x167b('0x31')][_0x167b('0x36')]));_0x26427e['attributes']=_0x26427e[_0x167b('0x35')][_0x167b('0x37')]?_0x26427e[_0x167b('0x35')]:_0x1647d2['model'];if(_0x53b046[_0x167b('0x31')][_0x167b('0x41')]){_0x26427e[_0x167b('0x42')]=[{'all':!![]}];}_0x26427e=_['merge']({},_0x26427e,_0x53b046[_0x167b('0x40')]);return db[_0x167b('0x2c')][_0x167b('0x47')](_0x26427e)[_0x167b('0x24')](handleEntityNotFound(_0x3e9456,null))[_0x167b('0x24')](respondWithResult(_0x3e9456,null))['catch'](handleError(_0x3e9456,null));};exports[_0x167b('0x48')]=function(_0x1e7671,_0x24e422){return db[_0x167b('0x2c')][_0x167b('0x48')](_0x1e7671[_0x167b('0x49')],{})[_0x167b('0x24')](respondWithResult(_0x24e422,0xc9))[_0x167b('0x45')](handleError(_0x24e422,null));};exports['update']=function(_0x2ce8e6,_0x2de1a8){if(_0x2ce8e6[_0x167b('0x49')]['id']){delete _0x2ce8e6[_0x167b('0x49')]['id'];}return db[_0x167b('0x2c')]['find']({'where':{'id':_0x2ce8e6['params']['id']}})[_0x167b('0x24')](handleEntityNotFound(_0x2de1a8,null))[_0x167b('0x24')](saveUpdates(_0x2ce8e6['body'],null))[_0x167b('0x24')](respondWithResult(_0x2de1a8,null))[_0x167b('0x45')](handleError(_0x2de1a8,null));};exports['destroy']=function(_0x310a9a,_0x56ae12){return db[_0x167b('0x2c')][_0x167b('0x47')]({'where':{'id':_0x310a9a[_0x167b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x56ae12,null))[_0x167b('0x24')](removeEntity(_0x56ae12,null))[_0x167b('0x45')](handleError(_0x56ae12,null));};
\ No newline at end of file
+var _0x45e1=['undefined','count','limit','apply','reject','save','update','then','destroy','error','name','send','index','map','AnalyticTreeReport','fieldName','type','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x118691,_0x55b350){var _0x389e3d=function(_0x48b649){while(--_0x48b649){_0x118691['push'](_0x118691['shift']());}};_0x389e3d(++_0x55b350);}(_0x45e1,0x1ee));var _0x145e=function(_0xded12b,_0xecfb8e){_0xded12b=_0xded12b-0x0;var _0x572384=_0x45e1[_0xded12b];return _0x572384;};'use strict';var emlformat=require(_0x145e('0x0'));var rimraf=require(_0x145e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x145e('0x2'));var rp=require(_0x145e('0x3'));var moment=require(_0x145e('0x4'));var BPromise=require(_0x145e('0x5'));var Mustache=require(_0x145e('0x6'));var util=require(_0x145e('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x145e('0x8'));var ejs=require(_0x145e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x145e('0xa'));var squel=require(_0x145e('0xb'));var crypto=require(_0x145e('0xc'));var jsforce=require(_0x145e('0xd'));var deskjs=require(_0x145e('0xe'));var toCsv=require(_0x145e('0x8'));var querystring=require(_0x145e('0xf'));var Papa=require(_0x145e('0x10'));var Redis=require(_0x145e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x145e('0x12'));var as=require(_0x145e('0x13'));var hardwareService=require(_0x145e('0x14'));var logger=require(_0x145e('0x15'))('api');var utils=require(_0x145e('0x16'));var config=require(_0x145e('0x17'));var licenseUtil=require(_0x145e('0x18'));var db=require(_0x145e('0x19'))['db'];function respondWithStatusCode(_0x236137,_0x3d72f1){_0x3d72f1=_0x3d72f1||0xcc;return function(_0x25d135){if(_0x25d135){return _0x236137[_0x145e('0x1a')](_0x3d72f1);}return _0x236137[_0x145e('0x1b')](_0x3d72f1)[_0x145e('0x1c')]();};}function respondWithResult(_0x2298c2,_0x41ac3e){_0x41ac3e=_0x41ac3e||0xc8;return function(_0x251fb4){if(_0x251fb4){return _0x2298c2[_0x145e('0x1b')](_0x41ac3e)[_0x145e('0x1d')](_0x251fb4);}};}function respondWithFilteredResult(_0x2c48d3,_0x1a4544){return function(_0xd98314){if(_0xd98314){var _0x337d76=typeof _0x1a4544[_0x145e('0x1e')]==='undefined'&&typeof _0x1a4544['limit']===_0x145e('0x1f');var _0x2df9bf=_0xd98314[_0x145e('0x20')];var _0x5ac533=_0x337d76?0x0:_0x1a4544[_0x145e('0x1e')];var _0x5217f0=_0x337d76?_0xd98314['count']:_0x1a4544['offset']+_0x1a4544[_0x145e('0x21')];var _0x592977;if(_0x5217f0>=_0x2df9bf){_0x5217f0=_0x2df9bf;_0x592977=0xc8;}else{_0x592977=0xce;}_0x2c48d3[_0x145e('0x1b')](_0x592977);return _0x2c48d3['set']('Content-Range',_0x5ac533+'-'+_0x5217f0+'/'+_0x2df9bf)[_0x145e('0x1d')](_0xd98314);}return null;};}function patchUpdates(_0x5b82f6){return function(_0x475e27){try{jsonpatch[_0x145e('0x22')](_0x475e27,_0x5b82f6,!![]);}catch(_0x3e2b07){return BPromise[_0x145e('0x23')](_0x3e2b07);}return _0x475e27[_0x145e('0x24')]();};}function saveUpdates(_0x2ba20e,_0x350fd6){return function(_0xa97dba){if(_0xa97dba){return _0xa97dba[_0x145e('0x25')](_0x2ba20e)[_0x145e('0x26')](function(_0x53c0d8){return _0x53c0d8;});}return null;};}function removeEntity(_0x2ec0b7,_0x30c958){return function(_0x2bee79){if(_0x2bee79){return _0x2bee79[_0x145e('0x27')]()[_0x145e('0x26')](function(){_0x2ec0b7[_0x145e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bc92a,_0x44a0f8){return function(_0x1a21c0){if(!_0x1a21c0){_0x4bc92a[_0x145e('0x1a')](0x194);}return _0x1a21c0;};}function handleError(_0x109259,_0x3e79df){_0x3e79df=_0x3e79df||0x1f4;return function(_0x46fa62){logger[_0x145e('0x28')](_0x46fa62['stack']);if(_0x46fa62[_0x145e('0x29')]){delete _0x46fa62[_0x145e('0x29')];}_0x109259['status'](_0x3e79df)[_0x145e('0x2a')](_0x46fa62);};}exports[_0x145e('0x2b')]=function(_0x2c328b,_0x1883e1){var _0x363eba={},_0x43f238={},_0x2babee={'count':0x0,'rows':[]};var _0x446482=_[_0x145e('0x2c')](db[_0x145e('0x2d')]['rawAttributes'],function(_0x1f8715){return{'name':_0x1f8715[_0x145e('0x2e')],'type':_0x1f8715[_0x145e('0x2f')]['key']};});_0x43f238[_0x145e('0x30')]=_[_0x145e('0x2c')](_0x446482,'name');_0x43f238['query']=_[_0x145e('0x31')](_0x2c328b[_0x145e('0x32')]);_0x43f238['filters']=_[_0x145e('0x33')](_0x43f238[_0x145e('0x30')],_0x43f238[_0x145e('0x32')]);_0x363eba[_0x145e('0x34')]=_[_0x145e('0x33')](_0x43f238[_0x145e('0x30')],qs['fields'](_0x2c328b[_0x145e('0x32')][_0x145e('0x35')]));_0x363eba[_0x145e('0x34')]=_0x363eba[_0x145e('0x34')][_0x145e('0x36')]?_0x363eba['attributes']:_0x43f238['model'];if(!_0x2c328b[_0x145e('0x32')]['hasOwnProperty'](_0x145e('0x37'))){_0x363eba['limit']=qs['limit'](_0x2c328b[_0x145e('0x32')][_0x145e('0x21')]);_0x363eba['offset']=qs[_0x145e('0x1e')](_0x2c328b[_0x145e('0x32')][_0x145e('0x1e')]);}_0x363eba['order']=qs[_0x145e('0x38')](_0x2c328b[_0x145e('0x32')]['sort']);_0x363eba[_0x145e('0x39')]=qs['filters'](_[_0x145e('0x3a')](_0x2c328b['query'],_0x43f238[_0x145e('0x3b')]),_0x446482);if(_0x2c328b[_0x145e('0x32')][_0x145e('0x3c')]){_0x363eba['where']=_[_0x145e('0x3d')](_0x363eba[_0x145e('0x39')],{'$or':_[_0x145e('0x2c')](_0x446482,function(_0x17d8b5){if(_0x17d8b5[_0x145e('0x2f')]!==_0x145e('0x3e')){var _0x11a6b3={};_0x11a6b3[_0x17d8b5[_0x145e('0x29')]]={'$like':'%'+_0x2c328b[_0x145e('0x32')][_0x145e('0x3c')]+'%'};return _0x11a6b3;}})});}_0x363eba=_[_0x145e('0x3d')]({},_0x363eba,_0x2c328b[_0x145e('0x3f')]);var _0x53272d={'where':_0x363eba[_0x145e('0x39')]};return db[_0x145e('0x2d')][_0x145e('0x20')](_0x53272d)['then'](function(_0x3bc77e){_0x2babee[_0x145e('0x20')]=_0x3bc77e;if(_0x2c328b[_0x145e('0x32')]['includeAll']){_0x363eba[_0x145e('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x145e('0x41')](_0x363eba);})[_0x145e('0x26')](function(_0x1fde03){_0x2babee[_0x145e('0x42')]=_0x1fde03;return _0x2babee;})[_0x145e('0x26')](respondWithFilteredResult(_0x1883e1,_0x363eba))[_0x145e('0x43')](handleError(_0x1883e1,null));};exports[_0x145e('0x44')]=function(_0x502660,_0x5d39f0){var _0x1517d0={'raw':!![],'where':{'id':_0x502660[_0x145e('0x45')]['id']}},_0x238c91={};_0x238c91[_0x145e('0x30')]=_[_0x145e('0x31')](db[_0x145e('0x2d')][_0x145e('0x46')]);_0x238c91[_0x145e('0x32')]=_['keys'](_0x502660[_0x145e('0x32')]);_0x238c91[_0x145e('0x3b')]=_[_0x145e('0x33')](_0x238c91[_0x145e('0x30')],_0x238c91['query']);_0x1517d0[_0x145e('0x34')]=_[_0x145e('0x33')](_0x238c91[_0x145e('0x30')],qs[_0x145e('0x35')](_0x502660[_0x145e('0x32')][_0x145e('0x35')]));_0x1517d0['attributes']=_0x1517d0['attributes'][_0x145e('0x36')]?_0x1517d0[_0x145e('0x34')]:_0x238c91['model'];if(_0x502660[_0x145e('0x32')][_0x145e('0x47')]){_0x1517d0[_0x145e('0x40')]=[{'all':!![]}];}_0x1517d0=_[_0x145e('0x3d')]({},_0x1517d0,_0x502660[_0x145e('0x3f')]);return db[_0x145e('0x2d')][_0x145e('0x48')](_0x1517d0)[_0x145e('0x26')](handleEntityNotFound(_0x5d39f0,null))[_0x145e('0x26')](respondWithResult(_0x5d39f0,null))[_0x145e('0x43')](handleError(_0x5d39f0,null));};exports[_0x145e('0x49')]=function(_0x28f689,_0x511bb8){return db[_0x145e('0x2d')]['create'](_0x28f689['body'],{})[_0x145e('0x26')](respondWithResult(_0x511bb8,0xc9))[_0x145e('0x43')](handleError(_0x511bb8,null));};exports[_0x145e('0x25')]=function(_0x671abe,_0x2d0883){if(_0x671abe['body']['id']){delete _0x671abe['body']['id'];}return db[_0x145e('0x2d')][_0x145e('0x48')]({'where':{'id':_0x671abe[_0x145e('0x45')]['id']}})[_0x145e('0x26')](handleEntityNotFound(_0x2d0883,null))[_0x145e('0x26')](saveUpdates(_0x671abe[_0x145e('0x4a')],null))['then'](respondWithResult(_0x2d0883,null))['catch'](handleError(_0x2d0883,null));};exports['destroy']=function(_0x5cdf7f,_0xb3f0ee){return db[_0x145e('0x2d')]['find']({'where':{'id':_0x5cdf7f['params']['id']}})[_0x145e('0x26')](handleEntityNotFound(_0xb3f0ee,null))[_0x145e('0x26')](removeEntity(_0xb3f0ee,null))[_0x145e('0x43')](handleError(_0xb3f0ee,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index b024232..13e41b1 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 _0x0e56=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0xf61c79,_0x43c6fa){var _0x127d26=function(_0x598bf6){while(--_0x598bf6){_0xf61c79['push'](_0xf61c79['shift']());}};_0x127d26(++_0x43c6fa);}(_0x0e56,0xf5));var _0x60e5=function(_0x486f67,_0x31a5ba){_0x486f67=_0x486f67-0x0;var _0x51e075=_0x0e56[_0x486f67];return _0x51e075;};'use strict';var _=require(_0x60e5('0x0'));var util=require(_0x60e5('0x1'));var logger=require('../../config/logger')(_0x60e5('0x2'));var moment=require(_0x60e5('0x3'));var BPromise=require('bluebird');var rp=require(_0x60e5('0x4'));var fs=require('fs');var path=require(_0x60e5('0x5'));var rimraf=require(_0x60e5('0x6'));var config=require(_0x60e5('0x7'));var attributes=require(_0x60e5('0x8'));module[_0x60e5('0x9')]=function(_0x25b3a4,_0x54422a){return _0x25b3a4[_0x60e5('0xa')](_0x60e5('0xb'),attributes,{'tableName':_0x60e5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0adf=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0x50180c,_0x3fc232){var _0x5eaa41=function(_0x24fe64){while(--_0x24fe64){_0x50180c['push'](_0x50180c['shift']());}};_0x5eaa41(++_0x3fc232);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x9cd5e3,_0x2ce524){_0x9cd5e3=_0x9cd5e3-0x0;var _0x2bcf1d=_0x0adf[_0x9cd5e3];return _0x2bcf1d;};'use strict';var _=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var logger=require(_0xf0ad('0x2'))('api');var moment=require(_0xf0ad('0x3'));var BPromise=require(_0xf0ad('0x4'));var rp=require(_0xf0ad('0x5'));var fs=require('fs');var path=require(_0xf0ad('0x6'));var rimraf=require(_0xf0ad('0x7'));var config=require(_0xf0ad('0x8'));var attributes=require(_0xf0ad('0x9'));module['exports']=function(_0x3bbf85,_0x53221f){return _0x3bbf85[_0xf0ad('0xa')](_0xf0ad('0xb'),attributes,{'tableName':_0xf0ad('0xc'),'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 128d19f..9548975 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 _0xeb85=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util'];(function(_0x76f5bd,_0xe83ddb){var _0x59c523=function(_0x71947c){while(--_0x71947c){_0x76f5bd['push'](_0x76f5bd['shift']());}};_0x59c523(++_0xe83ddb);}(_0xeb85,0xb6));var _0x5eb8=function(_0x387580,_0x4e8c53){_0x387580=_0x387580-0x0;var _0x244aa0=_0xeb85[_0x387580];return _0x244aa0;};'use strict';var _=require(_0x5eb8('0x0'));var util=require(_0x5eb8('0x1'));var moment=require(_0x5eb8('0x2'));var BPromise=require(_0x5eb8('0x3'));var rs=require(_0x5eb8('0x4'));var fs=require('fs');var Redis=require(_0x5eb8('0x5'));var db=require(_0x5eb8('0x6'))['db'];var utils=require(_0x5eb8('0x7'));var logger=require('../../config/logger')(_0x5eb8('0x8'));var config=require(_0x5eb8('0x9'));var jayson=require(_0x5eb8('0xa'));var client=jayson[_0x5eb8('0xb')][_0x5eb8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e5dd6,_0x2ca7c8,_0x377d45){return new BPromise(function(_0x395d00,_0x5e47ee){return client[_0x5eb8('0xd')](_0x1e5dd6,_0x377d45)['then'](function(_0x231bcc){logger['info'](_0x5eb8('0xe'),_0x2ca7c8,_0x5eb8('0xf'));logger[_0x5eb8('0x10')](_0x5eb8('0x11'),_0x2ca7c8,'request\x20sent',JSON[_0x5eb8('0x12')](_0x231bcc));if(_0x231bcc['error']){if(_0x231bcc['error'][_0x5eb8('0x13')]===0x1f4){logger['error'](_0x5eb8('0xe'),_0x2ca7c8,_0x231bcc[_0x5eb8('0x14')][_0x5eb8('0x15')]);return _0x5e47ee(_0x231bcc[_0x5eb8('0x14')][_0x5eb8('0x15')]);}logger[_0x5eb8('0x14')](_0x5eb8('0xe'),_0x2ca7c8,_0x231bcc['error'][_0x5eb8('0x15')]);return _0x395d00(_0x231bcc[_0x5eb8('0x14')]['message']);}else{logger['info'](_0x5eb8('0xe'),_0x2ca7c8,_0x5eb8('0xf'));_0x395d00(_0x231bcc['result'][_0x5eb8('0x15')]);}})[_0x5eb8('0x16')](function(_0x1568a9){logger[_0x5eb8('0x14')](_0x5eb8('0xe'),_0x2ca7c8,_0x1568a9);_0x5e47ee(_0x1568a9);});});}
\ No newline at end of file
+var _0xddac=['stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s'];(function(_0x24805a,_0x57dd68){var _0x30fb56=function(_0x4c9178){while(--_0x4c9178){_0x24805a['push'](_0x24805a['shift']());}};_0x30fb56(++_0x57dd68);}(_0xddac,0x19e));var _0xcdda=function(_0x24bfaf,_0x532a2c){_0x24bfaf=_0x24bfaf-0x0;var _0x195db3=_0xddac[_0x24bfaf];return _0x195db3;};'use strict';var _=require(_0xcdda('0x0'));var util=require(_0xcdda('0x1'));var moment=require(_0xcdda('0x2'));var BPromise=require(_0xcdda('0x3'));var rs=require(_0xcdda('0x4'));var fs=require('fs');var Redis=require(_0xcdda('0x5'));var db=require(_0xcdda('0x6'))['db'];var utils=require(_0xcdda('0x7'));var logger=require(_0xcdda('0x8'))('rpc');var config=require(_0xcdda('0x9'));var jayson=require(_0xcdda('0xa'));var client=jayson[_0xcdda('0xb')][_0xcdda('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a0245,_0x25c898,_0x304f1e){return new BPromise(function(_0x3c7cff,_0x55fb32){return client[_0xcdda('0xd')](_0x3a0245,_0x304f1e)[_0xcdda('0xe')](function(_0x5a74e4){logger['info'](_0xcdda('0xf'),_0x25c898,_0xcdda('0x10'));logger['debug'](_0xcdda('0x11'),_0x25c898,_0xcdda('0x10'),JSON[_0xcdda('0x12')](_0x5a74e4));if(_0x5a74e4[_0xcdda('0x13')]){if(_0x5a74e4[_0xcdda('0x13')][_0xcdda('0x14')]===0x1f4){logger[_0xcdda('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x25c898,_0x5a74e4[_0xcdda('0x13')][_0xcdda('0x15')]);return _0x55fb32(_0x5a74e4[_0xcdda('0x13')][_0xcdda('0x15')]);}logger[_0xcdda('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x25c898,_0x5a74e4[_0xcdda('0x13')][_0xcdda('0x15')]);return _0x3c7cff(_0x5a74e4[_0xcdda('0x13')][_0xcdda('0x15')]);}else{logger[_0xcdda('0x16')](_0xcdda('0xf'),_0x25c898,_0xcdda('0x10'));_0x3c7cff(_0x5a74e4['result'][_0xcdda('0x15')]);}})[_0xcdda('0x17')](function(_0x1569b6){logger[_0xcdda('0x13')](_0xcdda('0xf'),_0x25c898,_0x1569b6);_0x55fb32(_0x1569b6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index d24b06c..f76d1f2 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 _0x44d9=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44d9,0x155));var _0x944d=function(_0x531d65,_0x489f0a){_0x531d65=_0x531d65-0x0;var _0x3b65ce=_0x44d9[_0x531d65];return _0x3b65ce;};'use strict';var multer=require(_0x944d('0x0'));var util=require(_0x944d('0x1'));var path=require(_0x944d('0x2'));var timeout=require(_0x944d('0x3'));var express=require(_0x944d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x944d('0x5'));var interaction=require(_0x944d('0x6'));var config=require('../../config/environment');var controller=require(_0x944d('0x7'));router['get']('/',auth[_0x944d('0x8')](),controller[_0x944d('0x9')]);router[_0x944d('0xa')](_0x944d('0xb'),auth[_0x944d('0x8')](),controller[_0x944d('0xc')]);router[_0x944d('0xd')]('/',auth['isAuthenticated'](),controller[_0x944d('0xe')]);router[_0x944d('0xf')](_0x944d('0xb'),auth['isAuthenticated'](),controller[_0x944d('0x10')]);router[_0x944d('0x11')](_0x944d('0xb'),auth[_0x944d('0x8')](),controller[_0x944d('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x1c4d=['destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete'];(function(_0x31a8e2,_0x4b3edf){var _0x65ffbf=function(_0x1c7a53){while(--_0x1c7a53){_0x31a8e2['push'](_0x31a8e2['shift']());}};_0x65ffbf(++_0x4b3edf);}(_0x1c4d,0x19f));var _0xd1c4=function(_0x100984,_0xbdb18d){_0x100984=_0x100984-0x0;var _0x240a30=_0x1c4d[_0x100984];return _0x240a30;};'use strict';var multer=require(_0xd1c4('0x0'));var util=require(_0xd1c4('0x1'));var path=require('path');var timeout=require(_0xd1c4('0x2'));var express=require('express');var router=express[_0xd1c4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd1c4('0x4'));var interaction=require(_0xd1c4('0x5'));var config=require('../../config/environment');var controller=require(_0xd1c4('0x6'));router[_0xd1c4('0x7')]('/',auth['isAuthenticated'](),controller[_0xd1c4('0x8')]);router[_0xd1c4('0x7')](_0xd1c4('0x9'),auth[_0xd1c4('0xa')](),controller[_0xd1c4('0xb')]);router[_0xd1c4('0xc')]('/',auth['isAuthenticated'](),controller[_0xd1c4('0xd')]);router[_0xd1c4('0xe')](_0xd1c4('0x9'),auth[_0xd1c4('0xa')](),controller[_0xd1c4('0xf')]);router[_0xd1c4('0x10')]('/:id',auth[_0xd1c4('0xa')](),controller[_0xd1c4('0x11')]);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 f8777b6..d544cd1 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 _0x0cb1=['STRING','exports'];(function(_0xf59e56,_0x57960a){var _0x42e155=function(_0xbd1f91){while(--_0xbd1f91){_0xf59e56['push'](_0xf59e56['shift']());}};_0x42e155(++_0x57960a);}(_0x0cb1,0x18b));var _0x10cb=function(_0x41271c,_0x2e505b){_0x41271c=_0x41271c-0x0;var _0x22c7a0=_0x0cb1[_0x41271c];return _0x22c7a0;};'use strict';var Sequelize=require('sequelize');module[_0x10cb('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x10cb('0x1')]},'type':{'type':Sequelize[_0x10cb('0x1')]}};
\ No newline at end of file
+var _0x3c97=['STRING','sequelize','exports'];(function(_0x1c0c50,_0xd5c125){var _0x2db011=function(_0x526e69){while(--_0x526e69){_0x1c0c50['push'](_0x1c0c50['shift']());}};_0x2db011(++_0xd5c125);}(_0x3c97,0x163));var _0x73c9=function(_0x2d1b30,_0x3e9eae){_0x2d1b30=_0x2d1b30-0x0;var _0x164d07=_0x3c97[_0x2d1b30];return _0x164d07;};'use strict';var Sequelize=require(_0x73c9('0x0'));module[_0x73c9('0x1')]={'name':{'type':Sequelize[_0x73c9('0x2')]},'basename':{'type':Sequelize[_0x73c9('0x2')]},'type':{'type':Sequelize[_0x73c9('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 74fe4d2..ef2f409 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 _0x37f8=['query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Attachment','includeAll','findAll','rows','params','include','find','catch','omit','updatedAt','body','createdAt','update','create','originalname','basename','file','filename','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','reject','then','destroy','stack','name','send','index','rawAttributes','fieldName','key','map','keys'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x37f8,0x1d2));var _0x837f=function(_0x43c92a,_0x7292bb){_0x43c92a=_0x43c92a-0x0;var _0x584e28=_0x37f8[_0x43c92a];return _0x584e28;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x837f('0x0'));var zipdir=require(_0x837f('0x1'));var jsonpatch=require(_0x837f('0x2'));var rp=require(_0x837f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x837f('0x4'));var util=require('util');var path=require('path');var sox=require(_0x837f('0x5'));var csv=require(_0x837f('0x6'));var ejs=require(_0x837f('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x837f('0x8'));var squel=require(_0x837f('0x9'));var crypto=require(_0x837f('0xa'));var jsforce=require(_0x837f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x837f('0x6'));var querystring=require(_0x837f('0xc'));var Papa=require(_0x837f('0xd'));var Redis=require(_0x837f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x837f('0xf'));var hardwareService=require(_0x837f('0x10'));var logger=require(_0x837f('0x11'))('api');var utils=require(_0x837f('0x12'));var config=require(_0x837f('0x13'));var licenseUtil=require(_0x837f('0x14'));var db=require(_0x837f('0x15'))['db'];function respondWithStatusCode(_0x23df85,_0x278d16){_0x278d16=_0x278d16||0xcc;return function(_0x49b3d2){if(_0x49b3d2){return _0x23df85[_0x837f('0x16')](_0x278d16);}return _0x23df85['status'](_0x278d16)[_0x837f('0x17')]();};}function respondWithResult(_0x403df2,_0x4cd961){_0x4cd961=_0x4cd961||0xc8;return function(_0x155aff){if(_0x155aff){return _0x403df2[_0x837f('0x18')](_0x4cd961)[_0x837f('0x19')](_0x155aff);}};}function respondWithFilteredResult(_0x4ca7a0,_0x5cc388){return function(_0x4cc7db){if(_0x4cc7db){var _0x56c127=typeof _0x5cc388['offset']===_0x837f('0x1a')&&typeof _0x5cc388['limit']===_0x837f('0x1a');var _0x43061f=_0x4cc7db['count'];var _0x50ae29=_0x56c127?0x0:_0x5cc388['offset'];var _0x26d02e=_0x56c127?_0x4cc7db[_0x837f('0x1b')]:_0x5cc388[_0x837f('0x1c')]+_0x5cc388[_0x837f('0x1d')];var _0x597952;if(_0x26d02e>=_0x43061f){_0x26d02e=_0x43061f;_0x597952=0xc8;}else{_0x597952=0xce;}_0x4ca7a0[_0x837f('0x18')](_0x597952);return _0x4ca7a0[_0x837f('0x1e')](_0x837f('0x1f'),_0x50ae29+'-'+_0x26d02e+'/'+_0x43061f)[_0x837f('0x19')](_0x4cc7db);}return null;};}function patchUpdates(_0xda5609){return function(_0x2cdf4d){try{jsonpatch['apply'](_0x2cdf4d,_0xda5609,!![]);}catch(_0x302858){return BPromise[_0x837f('0x20')](_0x302858);}return _0x2cdf4d['save']();};}function saveUpdates(_0x3cd873,_0x1c699e){return function(_0x22c85c){if(_0x22c85c){return _0x22c85c['update'](_0x3cd873)[_0x837f('0x21')](function(_0x39b770){return _0x39b770;});}return null;};}function removeEntity(_0x510af3,_0x595ac3){return function(_0x12439d){if(_0x12439d){return _0x12439d[_0x837f('0x22')]()['then'](function(){_0x510af3[_0x837f('0x18')](0xcc)[_0x837f('0x17')]();});}};}function handleEntityNotFound(_0xe24b7d,_0xa9dd13){return function(_0x474028){if(!_0x474028){_0xe24b7d[_0x837f('0x16')](0x194);}return _0x474028;};}function handleError(_0x12bc75,_0x17d5fe){_0x17d5fe=_0x17d5fe||0x1f4;return function(_0x2df407){logger['error'](_0x2df407[_0x837f('0x23')]);if(_0x2df407['name']){delete _0x2df407[_0x837f('0x24')];}_0x12bc75[_0x837f('0x18')](_0x17d5fe)[_0x837f('0x25')](_0x2df407);};}exports[_0x837f('0x26')]=function(_0x435468,_0x43b35c){var _0xf19e0a={},_0x40a7e9={},_0x505559={'count':0x0,'rows':[]};var _0x47d3a9=_['map'](db['Attachment'][_0x837f('0x27')],function(_0x280776){return{'name':_0x280776[_0x837f('0x28')],'type':_0x280776['type'][_0x837f('0x29')]};});_0x40a7e9['model']=_[_0x837f('0x2a')](_0x47d3a9,_0x837f('0x24'));_0x40a7e9['query']=_[_0x837f('0x2b')](_0x435468[_0x837f('0x2c')]);_0x40a7e9[_0x837f('0x2d')]=_[_0x837f('0x2e')](_0x40a7e9[_0x837f('0x2f')],_0x40a7e9[_0x837f('0x2c')]);_0xf19e0a[_0x837f('0x30')]=_[_0x837f('0x2e')](_0x40a7e9[_0x837f('0x2f')],qs['fields'](_0x435468[_0x837f('0x2c')][_0x837f('0x31')]));_0xf19e0a[_0x837f('0x30')]=_0xf19e0a[_0x837f('0x30')][_0x837f('0x32')]?_0xf19e0a['attributes']:_0x40a7e9[_0x837f('0x2f')];if(!_0x435468[_0x837f('0x2c')][_0x837f('0x33')]('nolimit')){_0xf19e0a['limit']=qs['limit'](_0x435468[_0x837f('0x2c')][_0x837f('0x1d')]);_0xf19e0a[_0x837f('0x1c')]=qs['offset'](_0x435468[_0x837f('0x2c')][_0x837f('0x1c')]);}_0xf19e0a[_0x837f('0x34')]=qs['sort'](_0x435468[_0x837f('0x2c')][_0x837f('0x35')]);_0xf19e0a[_0x837f('0x36')]=qs['filters'](_[_0x837f('0x37')](_0x435468['query'],_0x40a7e9[_0x837f('0x2d')]),_0x47d3a9);if(_0x435468[_0x837f('0x2c')][_0x837f('0x38')]){_0xf19e0a[_0x837f('0x36')]=_[_0x837f('0x39')](_0xf19e0a[_0x837f('0x36')],{'$or':_[_0x837f('0x2a')](_0x47d3a9,function(_0x31dde0){if(_0x31dde0[_0x837f('0x3a')]!==_0x837f('0x3b')){var _0x10b5c7={};_0x10b5c7[_0x31dde0[_0x837f('0x24')]]={'$like':'%'+_0x435468[_0x837f('0x2c')][_0x837f('0x38')]+'%'};return _0x10b5c7;}})});}_0xf19e0a=_[_0x837f('0x39')]({},_0xf19e0a,_0x435468[_0x837f('0x3c')]);var _0x224c4b={'where':_0xf19e0a[_0x837f('0x36')]};return db[_0x837f('0x3d')][_0x837f('0x1b')](_0x224c4b)['then'](function(_0x591c9a){_0x505559[_0x837f('0x1b')]=_0x591c9a;if(_0x435468['query'][_0x837f('0x3e')]){_0xf19e0a['include']=[{'all':!![]}];}return db['Attachment'][_0x837f('0x3f')](_0xf19e0a);})['then'](function(_0xdf0b56){_0x505559[_0x837f('0x40')]=_0xdf0b56;return _0x505559;})['then'](respondWithFilteredResult(_0x43b35c,_0xf19e0a))['catch'](handleError(_0x43b35c,null));};exports['show']=function(_0x5f32cb,_0x50102d){var _0x279d52={'raw':!![],'where':{'id':_0x5f32cb[_0x837f('0x41')]['id']}},_0x22564b={};_0x22564b['model']=_[_0x837f('0x2b')](db['Attachment']['rawAttributes']);_0x22564b[_0x837f('0x2c')]=_[_0x837f('0x2b')](_0x5f32cb[_0x837f('0x2c')]);_0x22564b[_0x837f('0x2d')]=_[_0x837f('0x2e')](_0x22564b['model'],_0x22564b[_0x837f('0x2c')]);_0x279d52['attributes']=_[_0x837f('0x2e')](_0x22564b[_0x837f('0x2f')],qs[_0x837f('0x31')](_0x5f32cb[_0x837f('0x2c')][_0x837f('0x31')]));_0x279d52[_0x837f('0x30')]=_0x279d52[_0x837f('0x30')][_0x837f('0x32')]?_0x279d52[_0x837f('0x30')]:_0x22564b[_0x837f('0x2f')];if(_0x5f32cb['query'][_0x837f('0x3e')]){_0x279d52[_0x837f('0x42')]=[{'all':!![]}];}_0x279d52=_[_0x837f('0x39')]({},_0x279d52,_0x5f32cb[_0x837f('0x3c')]);return db[_0x837f('0x3d')][_0x837f('0x43')](_0x279d52)[_0x837f('0x21')](handleEntityNotFound(_0x50102d,null))[_0x837f('0x21')](respondWithResult(_0x50102d,null))[_0x837f('0x44')](handleError(_0x50102d,null));};exports['clone']=function(_0x272d9a,_0x54a312){var _0x4eafb9={'where':{'id':_0x272d9a[_0x837f('0x41')]['id']}},_0x2e1075={};_0x2e1075[_0x837f('0x2f')]=_[_0x837f('0x2b')](db[_0x837f('0x3d')][_0x837f('0x27')]);_0x4eafb9['attributes']=_[_0x837f('0x2e')](_0x2e1075[_0x837f('0x2f')],qs['fields'](_0x272d9a[_0x837f('0x2c')]['fields']));_0x4eafb9[_0x837f('0x30')]=_0x4eafb9[_0x837f('0x30')]['length']?_0x4eafb9[_0x837f('0x30')]:_0x2e1075[_0x837f('0x2f')];if(_0x272d9a['query'][_0x837f('0x3e')]){_0x4eafb9['include']=[{'all':!![]}];}_0x4eafb9=_[_0x837f('0x39')]({},_0x4eafb9,_0x272d9a[_0x837f('0x3c')]);return db[_0x837f('0x3d')][_0x837f('0x43')](_0x4eafb9)['then'](handleEntityNotFound(_0x54a312,null))['then'](function(_0x537d5b){if(_0x537d5b){var _0x141e4a=_0x537d5b['get']({'plain':!![]});_0x141e4a=qs[_0x837f('0x45')](_0x141e4a,['id','createdAt',_0x837f('0x46')]);_0x272d9a['body']=_[_0x837f('0x45')](_0x272d9a[_0x837f('0x47')],['id',_0x837f('0x48'),_0x837f('0x46')]);return db[_0x837f('0x3d')]['create'](_['merge'](_0x141e4a,_0x272d9a[_0x837f('0x47')]),{'include':_0x272d9a['query'][_0x837f('0x3e')]?[{'all':!![]}]:undefined});}})[_0x837f('0x21')](respondWithResult(_0x54a312,0xc9))['catch'](handleError(_0x54a312,null));};exports[_0x837f('0x49')]=function(_0x45b4f9,_0x260f63){if(_0x45b4f9[_0x837f('0x47')]['id']){delete _0x45b4f9[_0x837f('0x47')]['id'];}return db[_0x837f('0x3d')][_0x837f('0x43')]({'where':{'id':_0x45b4f9[_0x837f('0x41')]['id']}})[_0x837f('0x21')](handleEntityNotFound(_0x260f63,null))[_0x837f('0x21')](saveUpdates(_0x45b4f9[_0x837f('0x47')],null))['then'](respondWithResult(_0x260f63,null))['catch'](handleError(_0x260f63,null));};exports['destroy']=function(_0x4b403f,_0x12a79d){return db[_0x837f('0x3d')][_0x837f('0x43')]({'where':{'id':_0x4b403f[_0x837f('0x41')]['id']}})['then'](handleEntityNotFound(_0x12a79d,null))[_0x837f('0x21')](removeEntity(_0x12a79d,null))[_0x837f('0x44')](handleError(_0x12a79d,null));};exports[_0x837f('0x4a')]=function(_0x4ee8dd,_0x3e2eb6,_0x2b113f){_0x4ee8dd['body']['name']=_0x4ee8dd['file'][_0x837f('0x4b')];_0x4ee8dd[_0x837f('0x47')][_0x837f('0x4c')]=_0x4ee8dd[_0x837f('0x4d')][_0x837f('0x4e')];_0x4ee8dd[_0x837f('0x47')]['type']=_0x4ee8dd[_0x837f('0x4d')]['mimetype'];return db[_0x837f('0x3d')]['create'](_0x4ee8dd['body'])[_0x837f('0x21')](respondWithResult(_0x3e2eb6,0xc9))[_0x837f('0x44')](handleError(_0x3e2eb6,null));};exports['download']=function(_0x421f12,_0x22ee2e,_0x40cbe6){return db[_0x837f('0x3d')][_0x837f('0x4f')]({'where':{'id':_0x421f12[_0x837f('0x41')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x22ee2e,null))[_0x837f('0x21')](function(_0x2bd8d8){if(_0x2bd8d8){var _0x14b4a8=_0x2bd8d8[_0x837f('0x50')]!==null;var _0xdfabda=path[_0x837f('0x51')](config[_0x837f('0x52')],_0x837f('0x53'));if(_0x14b4a8){_0xdfabda=path[_0x837f('0x51')](_0xdfabda,_0x837f('0x54'));}var _0xf2a463=path[_0x837f('0x51')](_0xdfabda,_0x2bd8d8['basename']);return _0x22ee2e['download'](_0xf2a463);}})[_0x837f('0x44')](handleError(_0x22ee2e,null));};
\ No newline at end of file
+var _0xf9da=['body','updatedAt','create','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','error','stack','name','map','Attachment','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','find','clone','params','omit','createdAt'];(function(_0x1f0679,_0x53d43c){var _0x3dc3a4=function(_0x49ba8f){while(--_0x49ba8f){_0x1f0679['push'](_0x1f0679['shift']());}};_0x3dc3a4(++_0x53d43c);}(_0xf9da,0x1bc));var _0xaf9d=function(_0x505099,_0xb10ee1){_0x505099=_0x505099-0x0;var _0x577eba=_0xf9da[_0x505099];return _0x577eba;};'use strict';var emlformat=require(_0xaf9d('0x0'));var rimraf=require(_0xaf9d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaf9d('0x2'));var rp=require(_0xaf9d('0x3'));var moment=require(_0xaf9d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaf9d('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaf9d('0x6'));var fs=require('fs');var fs_extra=require(_0xaf9d('0x7'));var _=require('lodash');var squel=require(_0xaf9d('0x8'));var crypto=require(_0xaf9d('0x9'));var jsforce=require(_0xaf9d('0xa'));var deskjs=require(_0xaf9d('0xb'));var toCsv=require(_0xaf9d('0xc'));var querystring=require('querystring');var Papa=require(_0xaf9d('0xd'));var Redis=require(_0xaf9d('0xe'));var authService=require(_0xaf9d('0xf'));var qs=require(_0xaf9d('0x10'));var as=require(_0xaf9d('0x11'));var hardwareService=require(_0xaf9d('0x12'));var logger=require(_0xaf9d('0x13'))(_0xaf9d('0x14'));var utils=require(_0xaf9d('0x15'));var config=require(_0xaf9d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xaf9d('0x17'))['db'];function respondWithStatusCode(_0x4bfb02,_0x53102e){_0x53102e=_0x53102e||0xcc;return function(_0x116e61){if(_0x116e61){return _0x4bfb02[_0xaf9d('0x18')](_0x53102e);}return _0x4bfb02[_0xaf9d('0x19')](_0x53102e)[_0xaf9d('0x1a')]();};}function respondWithResult(_0x408e3c,_0xedb40b){_0xedb40b=_0xedb40b||0xc8;return function(_0x4c12dc){if(_0x4c12dc){return _0x408e3c[_0xaf9d('0x19')](_0xedb40b)[_0xaf9d('0x1b')](_0x4c12dc);}};}function respondWithFilteredResult(_0x297b81,_0x578a97){return function(_0x285f1d){if(_0x285f1d){var _0x1c6385=typeof _0x578a97[_0xaf9d('0x1c')]===_0xaf9d('0x1d')&&typeof _0x578a97[_0xaf9d('0x1e')]==='undefined';var _0xc3d085=_0x285f1d[_0xaf9d('0x1f')];var _0x2830ce=_0x1c6385?0x0:_0x578a97[_0xaf9d('0x1c')];var _0x1cbc0a=_0x1c6385?_0x285f1d['count']:_0x578a97['offset']+_0x578a97[_0xaf9d('0x1e')];var _0x2de5bb;if(_0x1cbc0a>=_0xc3d085){_0x1cbc0a=_0xc3d085;_0x2de5bb=0xc8;}else{_0x2de5bb=0xce;}_0x297b81[_0xaf9d('0x19')](_0x2de5bb);return _0x297b81[_0xaf9d('0x20')](_0xaf9d('0x21'),_0x2830ce+'-'+_0x1cbc0a+'/'+_0xc3d085)[_0xaf9d('0x1b')](_0x285f1d);}return null;};}function patchUpdates(_0x325a2d){return function(_0x41ffe4){try{jsonpatch['apply'](_0x41ffe4,_0x325a2d,!![]);}catch(_0x5f34bc){return BPromise[_0xaf9d('0x22')](_0x5f34bc);}return _0x41ffe4['save']();};}function saveUpdates(_0x10df00,_0x3b76c5){return function(_0x1273da){if(_0x1273da){return _0x1273da[_0xaf9d('0x23')](_0x10df00)['then'](function(_0x4388cd){return _0x4388cd;});}return null;};}function removeEntity(_0x1464a0,_0x12430f){return function(_0x858b1f){if(_0x858b1f){return _0x858b1f['destroy']()[_0xaf9d('0x24')](function(){_0x1464a0[_0xaf9d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a10b2,_0x3e22f1){return function(_0x120a99){if(!_0x120a99){_0x4a10b2[_0xaf9d('0x18')](0x194);}return _0x120a99;};}function handleError(_0x17ba70,_0x17ab74){_0x17ab74=_0x17ab74||0x1f4;return function(_0x534305){logger[_0xaf9d('0x25')](_0x534305[_0xaf9d('0x26')]);if(_0x534305[_0xaf9d('0x27')]){delete _0x534305[_0xaf9d('0x27')];}_0x17ba70[_0xaf9d('0x19')](_0x17ab74)['send'](_0x534305);};}exports['index']=function(_0x3853e3,_0x57ffe3){var _0x4d96ab={},_0xe9929d={},_0x50179c={'count':0x0,'rows':[]};var _0x51136d=_[_0xaf9d('0x28')](db[_0xaf9d('0x29')]['rawAttributes'],function(_0x28b116){return{'name':_0x28b116['fieldName'],'type':_0x28b116[_0xaf9d('0x2a')]['key']};});_0xe9929d[_0xaf9d('0x2b')]=_[_0xaf9d('0x28')](_0x51136d,_0xaf9d('0x27'));_0xe9929d[_0xaf9d('0x2c')]=_[_0xaf9d('0x2d')](_0x3853e3['query']);_0xe9929d[_0xaf9d('0x2e')]=_[_0xaf9d('0x2f')](_0xe9929d[_0xaf9d('0x2b')],_0xe9929d[_0xaf9d('0x2c')]);_0x4d96ab[_0xaf9d('0x30')]=_[_0xaf9d('0x2f')](_0xe9929d['model'],qs['fields'](_0x3853e3[_0xaf9d('0x2c')][_0xaf9d('0x31')]));_0x4d96ab[_0xaf9d('0x30')]=_0x4d96ab[_0xaf9d('0x30')][_0xaf9d('0x32')]?_0x4d96ab['attributes']:_0xe9929d[_0xaf9d('0x2b')];if(!_0x3853e3[_0xaf9d('0x2c')][_0xaf9d('0x33')](_0xaf9d('0x34'))){_0x4d96ab['limit']=qs[_0xaf9d('0x1e')](_0x3853e3[_0xaf9d('0x2c')][_0xaf9d('0x1e')]);_0x4d96ab['offset']=qs[_0xaf9d('0x1c')](_0x3853e3['query']['offset']);}_0x4d96ab[_0xaf9d('0x35')]=qs['sort'](_0x3853e3[_0xaf9d('0x2c')][_0xaf9d('0x36')]);_0x4d96ab[_0xaf9d('0x37')]=qs['filters'](_[_0xaf9d('0x38')](_0x3853e3[_0xaf9d('0x2c')],_0xe9929d[_0xaf9d('0x2e')]),_0x51136d);if(_0x3853e3[_0xaf9d('0x2c')][_0xaf9d('0x39')]){_0x4d96ab[_0xaf9d('0x37')]=_[_0xaf9d('0x3a')](_0x4d96ab['where'],{'$or':_['map'](_0x51136d,function(_0x24bed4){if(_0x24bed4[_0xaf9d('0x2a')]!==_0xaf9d('0x3b')){var _0x58c221={};_0x58c221[_0x24bed4[_0xaf9d('0x27')]]={'$like':'%'+_0x3853e3[_0xaf9d('0x2c')][_0xaf9d('0x39')]+'%'};return _0x58c221;}})});}_0x4d96ab=_['merge']({},_0x4d96ab,_0x3853e3[_0xaf9d('0x3c')]);var _0x47757a={'where':_0x4d96ab['where']};return db[_0xaf9d('0x29')][_0xaf9d('0x1f')](_0x47757a)[_0xaf9d('0x24')](function(_0x11fc72){_0x50179c[_0xaf9d('0x1f')]=_0x11fc72;if(_0x3853e3[_0xaf9d('0x2c')][_0xaf9d('0x3d')]){_0x4d96ab[_0xaf9d('0x3e')]=[{'all':!![]}];}return db['Attachment'][_0xaf9d('0x3f')](_0x4d96ab);})[_0xaf9d('0x24')](function(_0x2b4c6a){_0x50179c[_0xaf9d('0x40')]=_0x2b4c6a;return _0x50179c;})[_0xaf9d('0x24')](respondWithFilteredResult(_0x57ffe3,_0x4d96ab))[_0xaf9d('0x41')](handleError(_0x57ffe3,null));};exports['show']=function(_0x5a88b1,_0x1975e8){var _0x24ead8={'raw':!![],'where':{'id':_0x5a88b1['params']['id']}},_0x5bc442={};_0x5bc442[_0xaf9d('0x2b')]=_[_0xaf9d('0x2d')](db[_0xaf9d('0x29')][_0xaf9d('0x42')]);_0x5bc442[_0xaf9d('0x2c')]=_['keys'](_0x5a88b1[_0xaf9d('0x2c')]);_0x5bc442[_0xaf9d('0x2e')]=_['intersection'](_0x5bc442[_0xaf9d('0x2b')],_0x5bc442['query']);_0x24ead8[_0xaf9d('0x30')]=_[_0xaf9d('0x2f')](_0x5bc442['model'],qs[_0xaf9d('0x31')](_0x5a88b1['query'][_0xaf9d('0x31')]));_0x24ead8['attributes']=_0x24ead8[_0xaf9d('0x30')][_0xaf9d('0x32')]?_0x24ead8['attributes']:_0x5bc442['model'];if(_0x5a88b1['query'][_0xaf9d('0x3d')]){_0x24ead8[_0xaf9d('0x3e')]=[{'all':!![]}];}_0x24ead8=_[_0xaf9d('0x3a')]({},_0x24ead8,_0x5a88b1[_0xaf9d('0x3c')]);return db[_0xaf9d('0x29')][_0xaf9d('0x43')](_0x24ead8)[_0xaf9d('0x24')](handleEntityNotFound(_0x1975e8,null))[_0xaf9d('0x24')](respondWithResult(_0x1975e8,null))[_0xaf9d('0x41')](handleError(_0x1975e8,null));};exports[_0xaf9d('0x44')]=function(_0xef4863,_0x4c148d){var _0x4bec8f={'where':{'id':_0xef4863[_0xaf9d('0x45')]['id']}},_0x3140dc={};_0x3140dc[_0xaf9d('0x2b')]=_['keys'](db[_0xaf9d('0x29')]['rawAttributes']);_0x4bec8f[_0xaf9d('0x30')]=_[_0xaf9d('0x2f')](_0x3140dc[_0xaf9d('0x2b')],qs[_0xaf9d('0x31')](_0xef4863[_0xaf9d('0x2c')][_0xaf9d('0x31')]));_0x4bec8f[_0xaf9d('0x30')]=_0x4bec8f[_0xaf9d('0x30')][_0xaf9d('0x32')]?_0x4bec8f[_0xaf9d('0x30')]:_0x3140dc[_0xaf9d('0x2b')];if(_0xef4863['query'][_0xaf9d('0x3d')]){_0x4bec8f[_0xaf9d('0x3e')]=[{'all':!![]}];}_0x4bec8f=_['merge']({},_0x4bec8f,_0xef4863[_0xaf9d('0x3c')]);return db[_0xaf9d('0x29')][_0xaf9d('0x43')](_0x4bec8f)['then'](handleEntityNotFound(_0x4c148d,null))[_0xaf9d('0x24')](function(_0x5121f9){if(_0x5121f9){var _0x4441cd=_0x5121f9['get']({'plain':!![]});_0x4441cd=qs[_0xaf9d('0x46')](_0x4441cd,['id',_0xaf9d('0x47'),'updatedAt']);_0xef4863[_0xaf9d('0x48')]=_['omit'](_0xef4863[_0xaf9d('0x48')],['id',_0xaf9d('0x47'),_0xaf9d('0x49')]);return db[_0xaf9d('0x29')]['create'](_['merge'](_0x4441cd,_0xef4863[_0xaf9d('0x48')]),{'include':_0xef4863[_0xaf9d('0x2c')][_0xaf9d('0x3d')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x4c148d,0xc9))['catch'](handleError(_0x4c148d,null));};exports[_0xaf9d('0x23')]=function(_0x3b4d3b,_0x4f3216){if(_0x3b4d3b[_0xaf9d('0x48')]['id']){delete _0x3b4d3b[_0xaf9d('0x48')]['id'];}return db[_0xaf9d('0x29')][_0xaf9d('0x43')]({'where':{'id':_0x3b4d3b[_0xaf9d('0x45')]['id']}})[_0xaf9d('0x24')](handleEntityNotFound(_0x4f3216,null))[_0xaf9d('0x24')](saveUpdates(_0x3b4d3b[_0xaf9d('0x48')],null))[_0xaf9d('0x24')](respondWithResult(_0x4f3216,null))[_0xaf9d('0x41')](handleError(_0x4f3216,null));};exports['destroy']=function(_0x36bfde,_0x4a7af0){return db[_0xaf9d('0x29')]['find']({'where':{'id':_0x36bfde['params']['id']}})[_0xaf9d('0x24')](handleEntityNotFound(_0x4a7af0,null))['then'](removeEntity(_0x4a7af0,null))[_0xaf9d('0x41')](handleError(_0x4a7af0,null));};exports[_0xaf9d('0x4a')]=function(_0x23fd0c,_0x326527,_0x39c37c){_0x23fd0c['body']['name']=_0x23fd0c[_0xaf9d('0x4b')][_0xaf9d('0x4c')];_0x23fd0c[_0xaf9d('0x48')][_0xaf9d('0x4d')]=_0x23fd0c[_0xaf9d('0x4b')][_0xaf9d('0x4e')];_0x23fd0c[_0xaf9d('0x48')][_0xaf9d('0x2a')]=_0x23fd0c[_0xaf9d('0x4b')][_0xaf9d('0x4f')];return db[_0xaf9d('0x29')]['create'](_0x23fd0c[_0xaf9d('0x48')])[_0xaf9d('0x24')](respondWithResult(_0x326527,0xc9))[_0xaf9d('0x41')](handleError(_0x326527,null));};exports[_0xaf9d('0x50')]=function(_0x1b2d0b,_0x4542c7,_0x48626b){return db[_0xaf9d('0x29')]['findOne']({'where':{'id':_0x1b2d0b[_0xaf9d('0x45')]['id']},'raw':!![]})[_0xaf9d('0x24')](handleEntityNotFound(_0x4542c7,null))[_0xaf9d('0x24')](function(_0x19141a){if(_0x19141a){var _0x5aafd5=_0x19141a[_0xaf9d('0x51')]!==null;var _0x4a4124=path[_0xaf9d('0x52')](config[_0xaf9d('0x53')],_0xaf9d('0x54'));if(_0x5aafd5){_0x4a4124=path[_0xaf9d('0x52')](_0x4a4124,_0xaf9d('0x55'));}var _0x34c52d=path[_0xaf9d('0x52')](_0x4a4124,_0x19141a[_0xaf9d('0x4d')]);return _0x4542c7[_0xaf9d('0x50')](_0x34c52d);}})['catch'](handleError(_0x4542c7,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 5d1f514..b1cd34c 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 _0x6b72=['../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x5ee4c1,_0x431ce9){var _0x5537e0=function(_0x42048a){while(--_0x42048a){_0x5ee4c1['push'](_0x5ee4c1['shift']());}};_0x5537e0(++_0x431ce9);}(_0x6b72,0x19d));var _0x26b7=function(_0x3bac35,_0x532607){_0x3bac35=_0x3bac35-0x0;var _0x3c956f=_0x6b72[_0x3bac35];return _0x3c956f;};'use strict';var _=require(_0x26b7('0x0'));var util=require('util');var logger=require(_0x26b7('0x1'))(_0x26b7('0x2'));var moment=require('moment');var BPromise=require(_0x26b7('0x3'));var rp=require(_0x26b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x26b7('0x5'));var attributes=require(_0x26b7('0x6'));module[_0x26b7('0x7')]=function(_0x5bf038,_0x26ac11){return _0x5bf038[_0x26b7('0x8')](_0x26b7('0x9'),attributes,{'tableName':_0x26b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ccd=['attachments','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0xca5e0d,_0x3348e1){var _0x44f445=function(_0x433937){while(--_0x433937){_0xca5e0d['push'](_0xca5e0d['shift']());}};_0x44f445(++_0x3348e1);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ccd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd9cc('0x0'));var util=require('util');var logger=require(_0xd9cc('0x1'))(_0xd9cc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd9cc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd9cc('0x4'));var config=require(_0xd9cc('0x5'));var attributes=require(_0xd9cc('0x6'));module[_0xd9cc('0x7')]=function(_0x126f77,_0x113744){return _0x126f77[_0xd9cc('0x8')](_0xd9cc('0x9'),attributes,{'tableName':_0xd9cc('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 3b1e2fd..bc17dce 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 _0xa964=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','Attachment,\x20%s,\x20%s','message','result','catch','Attachment','create','body','options','CreateAttachment','lodash'];(function(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0xa964,0x144));var _0x4a96=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0xa964[_0x568a61];return _0x334c3b;};'use strict';var _=require(_0x4a96('0x0'));var util=require('util');var moment=require(_0x4a96('0x1'));var BPromise=require('bluebird');var rs=require(_0x4a96('0x2'));var fs=require('fs');var Redis=require(_0x4a96('0x3'));var db=require(_0x4a96('0x4'))['db'];var utils=require(_0x4a96('0x5'));var logger=require('../../config/logger')(_0x4a96('0x6'));var config=require('../../config/environment');var jayson=require(_0x4a96('0x7'));var client=jayson[_0x4a96('0x8')][_0x4a96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4182b5,_0x2ae66e,_0x3a3b18){return new BPromise(function(_0x1079c6,_0x4cbc49){return client['request'](_0x4182b5,_0x3a3b18)[_0x4a96('0xa')](function(_0x188c4b){logger[_0x4a96('0xb')]('Attachment,\x20%s,\x20%s',_0x2ae66e,_0x4a96('0xc'));logger[_0x4a96('0xd')]('Attachment,\x20%s,\x20%s,\x20%s',_0x2ae66e,_0x4a96('0xc'),JSON[_0x4a96('0xe')](_0x188c4b));if(_0x188c4b['error']){if(_0x188c4b[_0x4a96('0xf')]['code']===0x1f4){logger[_0x4a96('0xf')](_0x4a96('0x10'),_0x2ae66e,_0x188c4b[_0x4a96('0xf')][_0x4a96('0x11')]);return _0x4cbc49(_0x188c4b[_0x4a96('0xf')][_0x4a96('0x11')]);}logger[_0x4a96('0xf')](_0x4a96('0x10'),_0x2ae66e,_0x188c4b[_0x4a96('0xf')]['message']);return _0x1079c6(_0x188c4b[_0x4a96('0xf')][_0x4a96('0x11')]);}else{logger[_0x4a96('0xb')](_0x4a96('0x10'),_0x2ae66e,_0x4a96('0xc'));_0x1079c6(_0x188c4b[_0x4a96('0x12')][_0x4a96('0x11')]);}})[_0x4a96('0x13')](function(_0x3b1c21){logger[_0x4a96('0xf')](_0x4a96('0x10'),_0x2ae66e,_0x3b1c21);_0x4cbc49(_0x3b1c21);});});}exports['CreateAttachment']=function(_0x59a128){var _0x4e6272=this;return new Promise(function(_0x31fef7,_0x10b05c){return db[_0x4a96('0x14')][_0x4a96('0x15')](_0x59a128[_0x4a96('0x16')],{'raw':_0x59a128[_0x4a96('0x17')]?_0x59a128[_0x4a96('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x4a96('0xa')](function(_0x2e6c5d){logger[_0x4a96('0xb')](_0x4a96('0x18'),_0x59a128);logger[_0x4a96('0xd')]('CreateAttachment',_0x59a128,JSON[_0x4a96('0xe')](_0x2e6c5d));_0x31fef7(_0x2e6c5d);})[_0x4a96('0x13')](function(_0x4e4b94){logger['error'](_0x4a96('0x18'),_0x4e4b94[_0x4a96('0x11')],_0x59a128);_0x10b05c(_0x4e6272[_0x4a96('0xf')](0x1f4,_0x4e4b94[_0x4a96('0x11')]));});});};
\ No newline at end of file
+var _0x8763=['util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','http','request','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Attachment,\x20%s,\x20%s','CreateAttachment','create','body','options','raw','then','info','lodash'];(function(_0x15306a,_0x5617d9){var _0x316f0c=function(_0x5a718a){while(--_0x5a718a){_0x15306a['push'](_0x15306a['shift']());}};_0x316f0c(++_0x5617d9);}(_0x8763,0x81));var _0x3876=function(_0x59e2a1,_0x37b2e7){_0x59e2a1=_0x59e2a1-0x0;var _0x383f36=_0x8763[_0x59e2a1];return _0x383f36;};'use strict';var _=require(_0x3876('0x0'));var util=require(_0x3876('0x1'));var moment=require('moment');var BPromise=require(_0x3876('0x2'));var rs=require(_0x3876('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3876('0x4'))['db'];var utils=require(_0x3876('0x5'));var logger=require('../../config/logger')(_0x3876('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3876('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x199660,_0x470869,_0x4bca69){return new BPromise(function(_0x1019bb,_0x4d4c09){return client[_0x3876('0x8')](_0x199660,_0x4bca69)['then'](function(_0x3d6192){logger['info']('Attachment,\x20%s,\x20%s',_0x470869,_0x3876('0x9'));logger[_0x3876('0xa')](_0x3876('0xb'),_0x470869,_0x3876('0x9'),JSON[_0x3876('0xc')](_0x3d6192));if(_0x3d6192[_0x3876('0xd')]){if(_0x3d6192[_0x3876('0xd')][_0x3876('0xe')]===0x1f4){logger[_0x3876('0xd')]('Attachment,\x20%s,\x20%s',_0x470869,_0x3d6192[_0x3876('0xd')][_0x3876('0xf')]);return _0x4d4c09(_0x3d6192['error'][_0x3876('0xf')]);}logger[_0x3876('0xd')]('Attachment,\x20%s,\x20%s',_0x470869,_0x3d6192['error'][_0x3876('0xf')]);return _0x1019bb(_0x3d6192[_0x3876('0xd')][_0x3876('0xf')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x470869,_0x3876('0x9'));_0x1019bb(_0x3d6192[_0x3876('0x10')][_0x3876('0xf')]);}})[_0x3876('0x11')](function(_0x1e9389){logger['error'](_0x3876('0x12'),_0x470869,_0x1e9389);_0x4d4c09(_0x1e9389);});});}exports[_0x3876('0x13')]=function(_0x461b07){var _0x24fd48=this;return new Promise(function(_0x46a2e3,_0x528c9f){return db['Attachment'][_0x3876('0x14')](_0x461b07[_0x3876('0x15')],{'raw':_0x461b07['options']?_0x461b07[_0x3876('0x16')][_0x3876('0x17')]===undefined?!![]:![]:!![]})[_0x3876('0x18')](function(_0x3fd7ae){logger[_0x3876('0x19')]('CreateAttachment',_0x461b07);logger['debug']('CreateAttachment',_0x461b07,JSON[_0x3876('0xc')](_0x3fd7ae));_0x46a2e3(_0x3fd7ae);})[_0x3876('0x11')](function(_0x3cdd51){logger[_0x3876('0xd')]('CreateAttachment',_0x3cdd51[_0x3876('0xf')],_0x461b07);_0x528c9f(_0x24fd48[_0x3876('0xd')](0x1f4,_0x3cdd51[_0x3876('0xf')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 42b0bdd..f64fc19 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 _0x9e6b=['update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','post','/:id/clone','clone','diskStorage','join','server/files/attachments/','%s-%s','now','single','file','create'];(function(_0xf8e76d,_0x12c182){var _0x2ee23e=function(_0x1092e9){while(--_0x1092e9){_0xf8e76d['push'](_0xf8e76d['shift']());}};_0x2ee23e(++_0x12c182);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x9e6b[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0xb9e6('0x0'));var util=require(_0xb9e6('0x1'));var path=require('path');var timeout=require(_0xb9e6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb9e6('0x3'));var auth=require(_0xb9e6('0x4'));var interaction=require(_0xb9e6('0x5'));var config=require(_0xb9e6('0x6'));var controller=require('./attachment.controller');router[_0xb9e6('0x7')]('/',auth[_0xb9e6('0x8')](),controller[_0xb9e6('0x9')]);router['get'](_0xb9e6('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0xb9e6('0xb'),auth['isAuthenticated'](),controller[_0xb9e6('0xc')]);router[_0xb9e6('0xd')](_0xb9e6('0xe'),auth[_0xb9e6('0x8')](),controller[_0xb9e6('0xf')]);var upload=multer({'storage':multer[_0xb9e6('0x10')]({'destination':function(_0xe8c995,_0x2e0081,_0x165903){_0x165903(null,path[_0xb9e6('0x11')](config['root'],_0xb9e6('0x12')));},'filename':function(_0x21ee09,_0x1229a8,_0x1eac5e){_0x1eac5e(null,util['format'](_0xb9e6('0x13'),Date[_0xb9e6('0x14')](),_0x1229a8['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb9e6('0xd')]('/',upload[_0xb9e6('0x15')](_0xb9e6('0x16')),controller[_0xb9e6('0x17')]);router['put'](_0xb9e6('0xa'),auth[_0xb9e6('0x8')](),controller[_0xb9e6('0x18')]);router[_0xb9e6('0x19')](_0xb9e6('0xa'),auth[_0xb9e6('0x8')](),controller[_0xb9e6('0x1a')]);module[_0xb9e6('0x1b')]=router;
\ No newline at end of file
+var _0x49f8=['update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','./attachment.controller','isAuthenticated','index','get','/:id','show','download','post','/:id/clone','clone','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','replace','file','put'];(function(_0x32ad2d,_0x188218){var _0x2e5aa2=function(_0x550366){while(--_0x550366){_0x32ad2d['push'](_0x32ad2d['shift']());}};_0x2e5aa2(++_0x188218);}(_0x49f8,0xff));var _0x849f=function(_0x298b53,_0x3f830d){_0x298b53=_0x298b53-0x0;var _0x370c14=_0x49f8[_0x298b53];return _0x370c14;};'use strict';var multer=require(_0x849f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x849f('0x1'));var express=require(_0x849f('0x2'));var router=express['Router']();var fs_extra=require(_0x849f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x849f('0x4'));var config=require('../../config/environment');var controller=require(_0x849f('0x5'));router['get']('/',auth[_0x849f('0x6')](),controller[_0x849f('0x7')]);router[_0x849f('0x8')](_0x849f('0x9'),auth[_0x849f('0x6')](),controller[_0x849f('0xa')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x849f('0xb')]);router[_0x849f('0xc')](_0x849f('0xd'),auth[_0x849f('0x6')](),controller[_0x849f('0xe')]);var upload=multer({'storage':multer[_0x849f('0xf')]({'destination':function(_0x415d08,_0x4c4467,_0x14976e){_0x14976e(null,path['join'](config[_0x849f('0x10')],_0x849f('0x11')));},'filename':function(_0x401480,_0x23c0ef,_0x58dede){_0x58dede(null,util[_0x849f('0x12')](_0x849f('0x13'),Date[_0x849f('0x14')](),_0x23c0ef[_0x849f('0x15')][_0x849f('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload['single'](_0x849f('0x17')),controller['create']);router[_0x849f('0x18')](_0x849f('0x9'),auth[_0x849f('0x6')](),controller[_0x849f('0x19')]);router[_0x849f('0x1a')](_0x849f('0x9'),auth[_0x849f('0x6')](),controller['destroy']);module[_0x849f('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 12943bf..d2ca7a6 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 _0x757c=['../../components/auth/service','../../config/utils','login','authenticate','/login','profile','callback','google','use','clientID','secret','callbackURL','findOne','allowedLoginAttempts','User','find','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment'];(function(_0x1f92bb,_0x8fe53a){var _0x4678d2=function(_0x175fc2){while(--_0x175fc2){_0x1f92bb['push'](_0x1f92bb['shift']());}};_0x4678d2(++_0x8fe53a);}(_0x757c,0xf5));var _0xc757=function(_0x3d426d,_0x131f72){_0x3d426d=_0x3d426d-0x0;var _0x2e6d48=_0x757c[_0x3d426d];return _0x2e6d48;};'use strict';var _=require(_0xc757('0x0'));var passport=require(_0xc757('0x1'));var GoogleStrategy=require(_0xc757('0x2'))[_0xc757('0x3')];var moment=require(_0xc757('0x4'));var db=require(_0xc757('0x5'))['db'];var config=require(_0xc757('0x6'));var signToken=require(_0xc757('0x7'))['signToken'];var utils=require(_0xc757('0x8'));exports[_0xc757('0x9')]=passport[_0xc757('0xa')]('google',{'failureRedirect':_0xc757('0xb'),'scope':[_0xc757('0xc'),'email'],'session':![]});exports[_0xc757('0xd')]=passport[_0xc757('0xa')](_0xc757('0xe'),{'failureRedirect':_0xc757('0xb'),'session':![]});passport[_0xc757('0xf')](new GoogleStrategy({'clientID':config[_0xc757('0xe')]?config[_0xc757('0xe')][_0xc757('0x10')]:'id','clientSecret':config[_0xc757('0xe')]?config[_0xc757('0xe')]['clientSecret']:_0xc757('0x11'),'callbackURL':config[_0xc757('0xe')]?config[_0xc757('0xe')][_0xc757('0x12')]:''},function(_0x5b394f,_0x302d2b,_0x5818e0,_0x53e826){var _0x116519,_0x33617e;return db['Setting'][_0xc757('0x13')]({'where':{'id':0x1},'attributes':[_0xc757('0x14'),'blockDuration'],'raw':!![]})['then'](function(_0x17e5e6){_0x116519=_0x17e5e6;return db[_0xc757('0x15')][_0xc757('0x16')]({'where':{'email':_['map'](_0x5818e0['emails'],_0xc757('0x17')),'role':{'$or':[_0xc757('0x18'),_0xc757('0x19'),'agent']}}});})[_0xc757('0x1a')](function(_0x12c6f3){_0x33617e=_0x12c6f3;if(_0x33617e){if(_0x33617e[_0xc757('0x1b')]){return _0x53e826(_0xc757('0x1c'));}else if(_0x116519[_0xc757('0x1d')]>0x0){if(_0x33617e[_0xc757('0x1e')]){if(moment(_0x33617e['blockedAt'])[_0xc757('0x1f')](_0x116519['blockDuration'],_0xc757('0x20'))>moment()){return _0x53e826('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0xc757('0x21')](_0x33617e,0x0,![],null)[_0xc757('0x1a')](function(){return utils['getLicense'](_0x33617e);})[_0xc757('0x1a')](function(){return _0x53e826(null,_0x33617e);});}}else{return utils[_0xc757('0x22')](_0x33617e)[_0xc757('0x1a')](function(){return _0x53e826(null,_0x33617e);});}}else{return utils[_0xc757('0x22')](_0x33617e)[_0xc757('0x1a')](function(){return _0x53e826(null,_0x33617e);});}}return _0x53e826(_0xc757('0x1c'));})[_0xc757('0x23')](function(_0x245a7c){_0x53e826(_0x245a7c);});}));
\ No newline at end of file
+var _0xd58e=['blocked','blockedAt','minutes','getLicense','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../components/auth/service','/login','profile','email','callback','authenticate','google','use','clientID','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','disabled'];(function(_0x125135,_0x19736b){var _0x166e38=function(_0x47aada){while(--_0x47aada){_0x125135['push'](_0x125135['shift']());}};_0x166e38(++_0x19736b);}(_0xd58e,0x96));var _0xed58=function(_0x2d0fb3,_0x451981){_0x2d0fb3=_0x2d0fb3-0x0;var _0x1eab20=_0xd58e[_0x2d0fb3];return _0x1eab20;};'use strict';var _=require(_0xed58('0x0'));var passport=require(_0xed58('0x1'));var GoogleStrategy=require(_0xed58('0x2'))[_0xed58('0x3')];var moment=require(_0xed58('0x4'));var db=require(_0xed58('0x5'))['db'];var config=require('../../config/environment');var signToken=require(_0xed58('0x6'))['signToken'];var utils=require('../../config/utils');exports['login']=passport['authenticate']('google',{'failureRedirect':_0xed58('0x7'),'scope':[_0xed58('0x8'),_0xed58('0x9')],'session':![]});exports[_0xed58('0xa')]=passport[_0xed58('0xb')](_0xed58('0xc'),{'failureRedirect':_0xed58('0x7'),'session':![]});passport[_0xed58('0xd')](new GoogleStrategy({'clientID':config['google']?config['google'][_0xed58('0xe')]:'id','clientSecret':config[_0xed58('0xc')]?config[_0xed58('0xc')]['clientSecret']:_0xed58('0xf'),'callbackURL':config[_0xed58('0xc')]?config['google'][_0xed58('0x10')]:''},function(_0x333bab,_0x3e88c1,_0x3fbe82,_0x5c9bca){var _0x45a2a7,_0x29abbf;return db[_0xed58('0x11')][_0xed58('0x12')]({'where':{'id':0x1},'attributes':[_0xed58('0x13'),_0xed58('0x14')],'raw':!![]})[_0xed58('0x15')](function(_0x161f57){_0x45a2a7=_0x161f57;return db[_0xed58('0x16')][_0xed58('0x17')]({'where':{'email':_[_0xed58('0x18')](_0x3fbe82['emails'],_0xed58('0x19')),'role':{'$or':[_0xed58('0x1a'),_0xed58('0x1b'),_0xed58('0x1c')]}}});})[_0xed58('0x15')](function(_0x2b0a02){_0x29abbf=_0x2b0a02;if(_0x29abbf){if(_0x29abbf[_0xed58('0x1d')]){return _0x5c9bca('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x45a2a7[_0xed58('0x14')]>0x0){if(_0x29abbf[_0xed58('0x1e')]){if(moment(_0x29abbf[_0xed58('0x1f')])['add'](_0x45a2a7[_0xed58('0x14')],_0xed58('0x20'))>moment()){return _0x5c9bca('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x29abbf,0x0,![],null)[_0xed58('0x15')](function(){return utils[_0xed58('0x21')](_0x29abbf);})[_0xed58('0x15')](function(){return _0x5c9bca(null,_0x29abbf);});}}else{return utils[_0xed58('0x21')](_0x29abbf)[_0xed58('0x15')](function(){return _0x5c9bca(null,_0x29abbf);});}}else{return utils[_0xed58('0x21')](_0x29abbf)[_0xed58('0x15')](function(){return _0x5c9bca(null,_0x29abbf);});}}return _0x5c9bca(_0xed58('0x22'));})[_0xed58('0x23')](function(_0x581517){_0x5c9bca(_0x581517);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 09e5c11..f993453 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 _0x4c4e=['get','login','callback','setTokenCookie','exports','express','Router','./authGoogle.controller','../user/user.controller.js'];(function(_0x4a2de2,_0x4918fc){var _0x284bd0=function(_0x37c989){while(--_0x37c989){_0x4a2de2['push'](_0x4a2de2['shift']());}};_0x284bd0(++_0x4918fc);}(_0x4c4e,0x152));var _0xe4c4=function(_0x290bf7,_0x493301){_0x290bf7=_0x290bf7-0x0;var _0x475f0f=_0x4c4e[_0x290bf7];return _0x475f0f;};'use strict';var express=require(_0xe4c4('0x0'));var passport=require('passport');var router=express[_0xe4c4('0x1')]();var controller=require(_0xe4c4('0x2'));var userController=require(_0xe4c4('0x3'));var authService=require('../../components/auth/service');router[_0xe4c4('0x4')]('/',controller[_0xe4c4('0x5')]);router[_0xe4c4('0x4')]('/callback',controller[_0xe4c4('0x6')],authService['isMiddleware'],userController[_0xe4c4('0x5')],authService[_0xe4c4('0x7')]);module[_0xe4c4('0x8')]=router;
\ No newline at end of file
+var _0xa7dc=['login','/callback','callback','isMiddleware','setTokenCookie','express','passport','Router','../user/user.controller.js','get'];(function(_0x2b6176,_0x18f079){var _0x427d25=function(_0x46f75f){while(--_0x46f75f){_0x2b6176['push'](_0x2b6176['shift']());}};_0x427d25(++_0x18f079);}(_0xa7dc,0x11d));var _0xca7d=function(_0x4d3d04,_0x2a4139){_0x4d3d04=_0x4d3d04-0x0;var _0x4a6e8c=_0xa7dc[_0x4d3d04];return _0x4a6e8c;};'use strict';var express=require(_0xca7d('0x0'));var passport=require(_0xca7d('0x1'));var router=express[_0xca7d('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xca7d('0x3'));var authService=require('../../components/auth/service');router[_0xca7d('0x4')]('/',controller[_0xca7d('0x5')]);router[_0xca7d('0x4')](_0xca7d('0x6'),controller[_0xca7d('0x7')],authService[_0xca7d('0x8')],userController[_0xca7d('0x5')],authService[_0xca7d('0x9')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 3d8dadc..fb94e9a 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 _0x77d4=['passport','Strategy','lodash','randomstring','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','blocked','blockedAt','user','agent','authenticate','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','disabled','getLicense','catch','MailAccount','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','message','stringify','status','send','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use'];(function(_0x2219a2,_0x37d194){var _0x3e4a29=function(_0x1da431){while(--_0x1da431){_0x2219a2['push'](_0x2219a2['shift']());}};_0x3e4a29(++_0x37d194);}(_0x77d4,0x108));var _0x477d=function(_0x49b446,_0x2e7a57){_0x49b446=_0x49b446-0x0;var _0x41875c=_0x77d4[_0x49b446];return _0x41875c;};'use strict';var util=require('util');var passport=require(_0x477d('0x0'));var LocalStrategy=require('passport-local')[_0x477d('0x1')];var jayson=require('jayson/promise');var _=require(_0x477d('0x2'));var rs=require(_0x477d('0x3'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0x477d('0x4'));var utils=require(_0x477d('0x5'));var client=jayson[_0x477d('0x6')][_0x477d('0x7')]({'port':0x232b});function localAuthenticate(_0x2545e5,_0x45ca2d,_0x5153df,_0x4f4fb4){var _0x2dd5d2,_0x579859;return db['Setting'][_0x477d('0x8')]({'where':{'id':0x1},'attributes':[_0x477d('0x9'),_0x477d('0xa')],'raw':!![]})[_0x477d('0xb')](function(_0x1cef1c){_0x2dd5d2=_0x1cef1c;return _0x2545e5['findOne']({'attributes':['id',_0x477d('0xc'),'password',_0x477d('0xd'),_0x477d('0xe'),'disabled',_0x477d('0xf'),_0x477d('0x10'),'loginAttempts'],'where':{'name':_0x45ca2d,'role':{'$or':['admin',_0x477d('0x11'),_0x477d('0x12')]}}});})['then'](function(_0x290d46){if(!_0x290d46||_0x290d46&&_0x290d46[_0x477d('0xc')]!==_0x45ca2d){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x579859=_0x290d46;return _0x579859;}})['then'](function(){_0x579859[_0x477d('0x13')](_0x5153df,function(_0x4bbfef,_0x30481f){var _0x234b99=_0x579859[_0x477d('0x14')]+0x1;if(_0x4bbfef){return _0x4f4fb4(_0x4bbfef);}else if(!_0x30481f){if(_0x579859['disabled']){return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});}else if(_0x2dd5d2[_0x477d('0x9')]>0x0){if(_0x579859[_0x477d('0xf')]){if(_0x2dd5d2[_0x477d('0xa')]>0x0){if(moment(_0x579859['blockedAt'])[_0x477d('0x16')](_0x2dd5d2['blockDuration'],_0x477d('0x17'))>moment()){return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});}else{return utils[_0x477d('0x18')](_0x579859,_0x234b99,![],null)[_0x477d('0xb')](function(){return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});});}}else{return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});}}else{if(_0x234b99>=_0x2dd5d2['allowedLoginAttempts']){return utils[_0x477d('0x18')](_0x579859,0x0,!![],moment())['then'](function(){return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});});}else{return utils[_0x477d('0x18')](_0x579859,_0x234b99,![],null)[_0x477d('0xb')](function(){return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});});}}}else{return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});}}else{if(_0x579859[_0x477d('0x19')]){return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});}else if(_0x2dd5d2[_0x477d('0x9')]>0x0){if(_0x579859[_0x477d('0xf')]){if(_0x2dd5d2[_0x477d('0xa')]>0x0){if(moment(_0x579859[_0x477d('0x10')])[_0x477d('0x16')](_0x2dd5d2[_0x477d('0xa')],_0x477d('0x17'))>moment()){return _0x4f4fb4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x477d('0x18')](_0x579859,0x0,![],null)['then'](function(){return utils[_0x477d('0x1a')](_0x579859);})[_0x477d('0xb')](function(){return _0x4f4fb4(null,_0x579859);});}}else{return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});}}else{return utils[_0x477d('0x18')](_0x579859,0x0,![],null)['then'](function(){return utils[_0x477d('0x1a')](_0x579859);})[_0x477d('0xb')](function(){return _0x4f4fb4(null,_0x579859);})[_0x477d('0x1b')](function(_0x48ee5e){return _0x4f4fb4(null,![],_0x48ee5e);});}}else{if(_0x579859['blocked']){return _0x4f4fb4(null,![],{'message':_0x477d('0x15')});}else{return utils[_0x477d('0x1a')](_0x579859)[_0x477d('0xb')](function(){return _0x4f4fb4(null,_0x579859);});}}}});})['catch'](function(_0x254141){return _0x4f4fb4(null,![],_0x254141);});}function sendServiceMail(_0x297d15){return db[_0x477d('0x1c')][_0x477d('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x477d('0xc'),'email'],'include':[{'model':db[_0x477d('0x1e')],'as':_0x477d('0x1f')}]})[_0x477d('0xb')](function(_0x25a329){if(!_0x25a329){throw new Error(_0x477d('0x20'));}var _0x385eb4={'tls':{'rejectUnauthorized':![]}};if(_0x25a329[_0x477d('0x1f')][_0x477d('0x21')]){_0x385eb4[_0x477d('0x21')]=_0x25a329[_0x477d('0x1f')][_0x477d('0x21')];}else{_0x385eb4[_0x477d('0x22')]=_0x25a329[_0x477d('0x1f')][_0x477d('0x22')];_0x385eb4[_0x477d('0x23')]=_0x25a329[_0x477d('0x1f')][_0x477d('0x23')];_0x385eb4[_0x477d('0x24')]=_0x25a329[_0x477d('0x1f')][_0x477d('0x24')];}if(_0x25a329['Smtp'][_0x477d('0x25')]){_0x385eb4['auth']={'user':_0x25a329[_0x477d('0x1f')][_0x477d('0x11')],'pass':_0x25a329[_0x477d('0x1f')]['pass']};}var _0x117c97={'account':_0x385eb4,'message':_[_0x477d('0x26')]({'from':util[_0x477d('0x27')](_0x477d('0x28'),_0x25a329[_0x477d('0xc')],_0x25a329[_0x477d('0x29')]||_0x25a329[_0x477d('0x1f')][_0x477d('0x11')])},_0x297d15)};return client[_0x477d('0x2a')](_0x477d('0x2b'),_0x117c97);})['then'](function(_0x36a247){if(_0x36a247[_0x477d('0x2c')]){throw new Error(util[_0x477d('0x27')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x36a247[_0x477d('0x2c')][_0x477d('0x2d')]||JSON[_0x477d('0x2e')](_0x36a247['error'])));}return!![];});}function handleError(_0x5ecbc3,_0x21de5c,_0x3f818d){return _0x5ecbc3[_0x477d('0x2f')](_0x21de5c||0x1f4)[_0x477d('0x30')]({'message':_0x3f818d?_0x3f818d[_0x477d('0x2d')]||_0x3f818d:''});}exports['login']=function(_0x304055,_0x59ad77,_0x7b73b9){passport[_0x477d('0x13')](_0x477d('0x31'),function(_0x54355a,_0x5170fe,_0x184d50){var _0x2c7089=_0x54355a||_0x184d50;if(_0x2c7089){return handleError(_0x59ad77,0x191,_0x2c7089);}if(!_0x5170fe){return handleError(_0x59ad77,0x194,{'message':_0x477d('0x32')});}else{var _0x4758a5={'payload':{'id':_0x5170fe['id'],'role':_0x5170fe['role']},'options':{'expiresIn':0x15180}};return authService[_0x477d('0x33')](_0x4758a5)[_0x477d('0xb')](function(_0x40fdc0){_0x59ad77[_0x477d('0x34')]({'id':_0x5170fe['id'],'token':_0x40fdc0,'statusCall':'','isAlreadyLogged':_0x5170fe[_0x477d('0x35')]});});}})(_0x304055,_0x59ad77,_0x7b73b9);};exports['forgot']=function(_0x472149,_0x3142d5,_0x4d1c8e){if(!_0x472149[_0x477d('0x36')]['email']){return handleError(_0x3142d5,0x1f4,{'message':_0x477d('0x37')});}var _0x7a5a47=rs[_0x477d('0x38')]();_0x472149[_0x477d('0x36')][_0x477d('0x29')]=_0x472149[_0x477d('0x36')][_0x477d('0x29')][_0x477d('0x39')]()[_0x477d('0x3a')]();var _0x4c22f5;return db[_0x477d('0x3b')][_0x477d('0x8')]({'where':{'id':0x1},'attributes':[_0x477d('0x9'),_0x477d('0xa')],'raw':!![]})['then'](function(_0x4e0db1){_0x4c22f5=_0x4e0db1;return db[_0x477d('0x3c')][_0x477d('0x1d')]({'where':{'email':_0x472149['body'][_0x477d('0x29')]}});})['then'](function(_0x51ec10){if(!_0x51ec10){throw new Error(_0x477d('0x3d'));}if(_0x51ec10[_0x477d('0x19')]){throw new Error(_0x477d('0x3e'));}if(_0x51ec10[_0x477d('0xf')]){if(moment(_0x51ec10[_0x477d('0x10')])[_0x477d('0x16')](_0x4c22f5['blockDuration'],_0x477d('0x17'))>moment()){throw new Error(_0x477d('0x3f'));}else{_0x51ec10[_0x477d('0xf')]=![];_0x51ec10[_0x477d('0x10')]=null;}}_0x51ec10[_0x477d('0x40')]=_0x7a5a47;_0x51ec10['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x51ec10[_0x477d('0x41')]();})[_0x477d('0xb')](function(){return sendServiceMail({'to':_0x472149[_0x477d('0x36')]['email'],'subject':_0x477d('0x42'),'text':_0x477d('0x43')+_0x477d('0x44')+_0x477d('0x45')+_0x472149[_0x477d('0x46')][_0x477d('0x22')]+_0x477d('0x47')+_0x7a5a47+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x477d('0xb')](function(){_0x3142d5[_0x477d('0x2f')](0xc8)[_0x477d('0x30')]({'message':_0x477d('0x48')});})[_0x477d('0x1b')](function(_0x32b430){return handleError(_0x3142d5,0x1f4,_0x32b430);});};exports[_0x477d('0x49')]=function(_0x30e474,_0x113162,_0x33df7f){return db[_0x477d('0x3c')][_0x477d('0x1d')]({'where':{'resetPasswordToken':_0x30e474[_0x477d('0x4a')][_0x477d('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x477d('0x4c')]()}}})['then'](function(_0xa20d0b){if(!_0xa20d0b){throw new Error(_0x477d('0x4d'));}return db['Setting']['findOne']({'attributes':['id','securePassword',_0x477d('0x4e'),_0x477d('0x4f')]})[_0x477d('0xb')](function(_0x6c7541){if(_0x6c7541[_0x477d('0x50')])authService[_0x477d('0x51')](_0x30e474[_0x477d('0x36')][_0x477d('0x52')]);if(!_0x6c7541['enforcePasswordHistory']||!_0xa20d0b[_0x477d('0x53')])return _0xa20d0b;authService[_0x477d('0x54')](_0x30e474[_0x477d('0x36')][_0x477d('0x52')],_0xa20d0b[_0x477d('0x53')],_0x6c7541[_0x477d('0x4f')]);return _0xa20d0b;})[_0x477d('0xb')](function(){_0xa20d0b[_0x477d('0x52')]=_0x30e474['body'][_0x477d('0x52')];_0xa20d0b[_0x477d('0x40')]=null;_0xa20d0b[_0x477d('0x55')]=null;return _0xa20d0b[_0x477d('0x41')]();});})[_0x477d('0xb')](function(){_0x113162['status'](0xc8)[_0x477d('0x30')]({'message':_0x477d('0x56')});})[_0x477d('0x1b')](function(_0x239ece){return handleError(_0x113162,0x1f4,_0x239ece);});};passport[_0x477d('0x57')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x3b287f,_0xb175d1,_0x95f9e0){return localAuthenticate(db[_0x477d('0x3c')],_0x3b287f,_0xb175d1,_0x95f9e0);}));
\ No newline at end of file
+var _0x326f=['user','request','error','stringify','send','message','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','find','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','token','now','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','util','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','allowedLoginAttempts','blockDuration','then','findOne','password','role','blocked','loginAttempts','admin','agent','name','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','blockedAt','getLicense','catch','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>'];(function(_0x4f9339,_0x257cd7){var _0x43d640=function(_0x29d9e9){while(--_0x29d9e9){_0x4f9339['push'](_0x4f9339['shift']());}};_0x43d640(++_0x257cd7);}(_0x326f,0xd1));var _0xf326=function(_0x271f9d,_0x23728c){_0x271f9d=_0x271f9d-0x0;var _0x82016e=_0x326f[_0x271f9d];return _0x82016e;};'use strict';var util=require(_0xf326('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xf326('0x1')];var jayson=require(_0xf326('0x2'));var _=require(_0xf326('0x3'));var rs=require(_0xf326('0x4'));var moment=require(_0xf326('0x5'));var db=require(_0xf326('0x6'))['db'];var authService=require(_0xf326('0x7'));var utils=require(_0xf326('0x8'));var client=jayson[_0xf326('0x9')][_0xf326('0xa')]({'port':0x232b});function localAuthenticate(_0x4c2249,_0x3c254d,_0x3851eb,_0x165f95){var _0x1e7b8a,_0x515bfa;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xf326('0xb'),_0xf326('0xc')],'raw':!![]})[_0xf326('0xd')](function(_0x2686e1){_0x1e7b8a=_0x2686e1;return _0x4c2249[_0xf326('0xe')]({'attributes':['id','name',_0xf326('0xf'),'salt',_0xf326('0x10'),'disabled',_0xf326('0x11'),'blockedAt',_0xf326('0x12')],'where':{'name':_0x3c254d,'role':{'$or':[_0xf326('0x13'),'user',_0xf326('0x14')]}}});})[_0xf326('0xd')](function(_0x3504eb){if(!_0x3504eb||_0x3504eb&&_0x3504eb[_0xf326('0x15')]!==_0x3c254d){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x515bfa=_0x3504eb;return _0x515bfa;}})[_0xf326('0xd')](function(){_0x515bfa['authenticate'](_0x3851eb,function(_0x54bd1a,_0xdf21d9){var _0x11f6d2=_0x515bfa[_0xf326('0x12')]+0x1;if(_0x54bd1a){return _0x165f95(_0x54bd1a);}else if(!_0xdf21d9){if(_0x515bfa[_0xf326('0x16')]){return _0x165f95(null,![],{'message':_0xf326('0x17')});}else if(_0x1e7b8a[_0xf326('0xb')]>0x0){if(_0x515bfa[_0xf326('0x11')]){if(_0x1e7b8a[_0xf326('0xc')]>0x0){if(moment(_0x515bfa['blockedAt'])[_0xf326('0x18')](_0x1e7b8a[_0xf326('0xc')],_0xf326('0x19'))>moment()){return _0x165f95(null,![],{'message':_0xf326('0x17')});}else{return utils[_0xf326('0x1a')](_0x515bfa,_0x11f6d2,![],null)[_0xf326('0xd')](function(){return _0x165f95(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x165f95(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x11f6d2>=_0x1e7b8a['allowedLoginAttempts']){return utils[_0xf326('0x1a')](_0x515bfa,0x0,!![],moment())[_0xf326('0xd')](function(){return _0x165f95(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x515bfa,_0x11f6d2,![],null)[_0xf326('0xd')](function(){return _0x165f95(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x165f95(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x515bfa[_0xf326('0x16')]){return _0x165f95(null,![],{'message':_0xf326('0x17')});}else if(_0x1e7b8a['allowedLoginAttempts']>0x0){if(_0x515bfa['blocked']){if(_0x1e7b8a[_0xf326('0xc')]>0x0){if(moment(_0x515bfa[_0xf326('0x1b')])['add'](_0x1e7b8a[_0xf326('0xc')],_0xf326('0x19'))>moment()){return _0x165f95(null,![],{'message':_0xf326('0x17')});}else{return utils[_0xf326('0x1a')](_0x515bfa,0x0,![],null)[_0xf326('0xd')](function(){return utils[_0xf326('0x1c')](_0x515bfa);})['then'](function(){return _0x165f95(null,_0x515bfa);});}}else{return _0x165f95(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x515bfa,0x0,![],null)[_0xf326('0xd')](function(){return utils[_0xf326('0x1c')](_0x515bfa);})[_0xf326('0xd')](function(){return _0x165f95(null,_0x515bfa);})[_0xf326('0x1d')](function(_0x148953){return _0x165f95(null,![],_0x148953);});}}else{if(_0x515bfa[_0xf326('0x11')]){return _0x165f95(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf326('0x1c')](_0x515bfa)[_0xf326('0xd')](function(){return _0x165f95(null,_0x515bfa);});}}}});})[_0xf326('0x1d')](function(_0x581531){return _0x165f95(null,![],_0x581531);});}function sendServiceMail(_0x1617d2){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0xf326('0x15'),_0xf326('0x1e')],'include':[{'model':db[_0xf326('0x1f')],'as':'Smtp'}]})[_0xf326('0xd')](function(_0x292500){if(!_0x292500){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x225776={'tls':{'rejectUnauthorized':![]}};if(_0x292500[_0xf326('0x20')][_0xf326('0x21')]){_0x225776[_0xf326('0x21')]=_0x292500[_0xf326('0x20')][_0xf326('0x21')];}else{_0x225776[_0xf326('0x22')]=_0x292500[_0xf326('0x20')][_0xf326('0x22')];_0x225776[_0xf326('0x23')]=_0x292500['Smtp'][_0xf326('0x23')];_0x225776[_0xf326('0x24')]=_0x292500[_0xf326('0x20')]['secure'];}if(_0x292500[_0xf326('0x20')][_0xf326('0x25')]){_0x225776[_0xf326('0x26')]={'user':_0x292500['Smtp']['user'],'pass':_0x292500[_0xf326('0x20')][_0xf326('0x27')]};}var _0x9c3039={'account':_0x225776,'message':_[_0xf326('0x28')]({'from':util[_0xf326('0x29')](_0xf326('0x2a'),_0x292500[_0xf326('0x15')],_0x292500[_0xf326('0x1e')]||_0x292500['Smtp'][_0xf326('0x2b')])},_0x1617d2)};return client[_0xf326('0x2c')]('SendMail',_0x9c3039);})[_0xf326('0xd')](function(_0x4e5d7c){if(_0x4e5d7c[_0xf326('0x2d')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x4e5d7c[_0xf326('0x2d')]['message']||JSON[_0xf326('0x2e')](_0x4e5d7c['error'])));}return!![];});}function handleError(_0x310dbb,_0x409260,_0x2750ae){return _0x310dbb['status'](_0x409260||0x1f4)[_0xf326('0x2f')]({'message':_0x2750ae?_0x2750ae[_0xf326('0x30')]||_0x2750ae:''});}exports['login']=function(_0x13932b,_0xf64dd0,_0x40fa7a){passport[_0xf326('0x31')]('local',function(_0x2c4416,_0xb1ef35,_0x1e69b1){var _0x47188b=_0x2c4416||_0x1e69b1;if(_0x47188b){return handleError(_0xf64dd0,0x191,_0x47188b);}if(!_0xb1ef35){return handleError(_0xf64dd0,0x194,{'message':_0xf326('0x32')});}else{var _0x5f02b5={'payload':{'id':_0xb1ef35['id'],'role':_0xb1ef35[_0xf326('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xf326('0x33')](_0x5f02b5)['then'](function(_0x4dd361){_0xf64dd0[_0xf326('0x34')]({'id':_0xb1ef35['id'],'token':_0x4dd361,'statusCall':'','isAlreadyLogged':_0xb1ef35['online']});});}})(_0x13932b,_0xf64dd0,_0x40fa7a);};exports['forgot']=function(_0x22d462,_0x5d6ae2,_0x3e1e8c){if(!_0x22d462[_0xf326('0x35')][_0xf326('0x1e')]){return handleError(_0x5d6ae2,0x1f4,{'message':_0xf326('0x36')});}var _0x49112d=rs[_0xf326('0x37')]();_0x22d462[_0xf326('0x35')][_0xf326('0x1e')]=_0x22d462[_0xf326('0x35')][_0xf326('0x1e')][_0xf326('0x38')]()[_0xf326('0x39')]();var _0x224a32;return db[_0xf326('0x3a')][_0xf326('0xe')]({'where':{'id':0x1},'attributes':[_0xf326('0xb'),_0xf326('0xc')],'raw':!![]})['then'](function(_0x1b6126){_0x224a32=_0x1b6126;return db[_0xf326('0x3b')][_0xf326('0x3c')]({'where':{'email':_0x22d462[_0xf326('0x35')][_0xf326('0x1e')]}});})[_0xf326('0xd')](function(_0x4f4c51){if(!_0x4f4c51){throw new Error(_0xf326('0x3d'));}if(_0x4f4c51[_0xf326('0x16')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x4f4c51[_0xf326('0x11')]){if(moment(_0x4f4c51[_0xf326('0x1b')])[_0xf326('0x18')](_0x224a32[_0xf326('0xc')],_0xf326('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4f4c51['blocked']=![];_0x4f4c51[_0xf326('0x1b')]=null;}}_0x4f4c51[_0xf326('0x3e')]=_0x49112d;_0x4f4c51['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x4f4c51[_0xf326('0x3f')]();})[_0xf326('0xd')](function(){return sendServiceMail({'to':_0x22d462[_0xf326('0x35')]['email'],'subject':_0xf326('0x40'),'text':_0xf326('0x41')+_0xf326('0x42')+_0xf326('0x43')+_0x22d462[_0xf326('0x44')][_0xf326('0x22')]+_0xf326('0x45')+_0x49112d+'\x0a\x0a'+_0xf326('0x46')});})[_0xf326('0xd')](function(){_0x5d6ae2[_0xf326('0x47')](0xc8)[_0xf326('0x2f')]({'message':_0xf326('0x48')});})[_0xf326('0x1d')](function(_0x395b1e){return handleError(_0x5d6ae2,0x1f4,_0x395b1e);});};exports[_0xf326('0x49')]=function(_0x59f9a7,_0x199f8b,_0x1b0e03){return db[_0xf326('0x3b')][_0xf326('0x3c')]({'where':{'resetPasswordToken':_0x59f9a7['params'][_0xf326('0x4a')],'resetPasswordExpires':{'$gt':Date[_0xf326('0x4b')]()}}})[_0xf326('0xd')](function(_0x46fe85){if(!_0x46fe85){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xf326('0x3a')][_0xf326('0xe')]({'attributes':['id',_0xf326('0x4c'),_0xf326('0x4d'),_0xf326('0x4e')]})['then'](function(_0x5d312d){if(_0x5d312d[_0xf326('0x4c')])authService[_0xf326('0x4f')](_0x59f9a7[_0xf326('0x35')]['password']);if(!_0x5d312d[_0xf326('0x4d')]||!_0x46fe85[_0xf326('0x50')])return _0x46fe85;authService[_0xf326('0x51')](_0x59f9a7['body']['password'],_0x46fe85[_0xf326('0x50')],_0x5d312d['passwordHistoryLimit']);return _0x46fe85;})[_0xf326('0xd')](function(){_0x46fe85['password']=_0x59f9a7[_0xf326('0x35')][_0xf326('0xf')];_0x46fe85[_0xf326('0x3e')]=null;_0x46fe85[_0xf326('0x52')]=null;return _0x46fe85[_0xf326('0x3f')]();});})[_0xf326('0xd')](function(){_0x199f8b[_0xf326('0x47')](0xc8)['send']({'message':_0xf326('0x53')});})[_0xf326('0x1d')](function(_0x424d24){return handleError(_0x199f8b,0x1f4,_0x424d24);});};passport['use'](new LocalStrategy({'usernameField':_0xf326('0x15'),'passwordField':_0xf326('0xf')},function(_0x3b8635,_0x16c578,_0x1159e){return localAuthenticate(db['User'],_0x3b8635,_0x16c578,_0x1159e);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index a71be82..9b0bab9 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 _0x9380=['Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports','express'];(function(_0xcb5438,_0x56cc82){var _0x2f8738=function(_0x5e0c2f){while(--_0x5e0c2f){_0xcb5438['push'](_0xcb5438['shift']());}};_0x2f8738(++_0x56cc82);}(_0x9380,0x117));var _0x0938=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x9380[_0x1203f];return _0x365f0a;};'use strict';var express=require(_0x0938('0x0'));var router=express[_0x0938('0x1')]();var controller=require(_0x0938('0x2'));router[_0x0938('0x3')]('/',controller[_0x0938('0x4')]);router[_0x0938('0x3')](_0x0938('0x5'),controller[_0x0938('0x6')]);router[_0x0938('0x3')](_0x0938('0x7'),controller[_0x0938('0x8')]);module[_0x0938('0x9')]=router;
\ No newline at end of file
+var _0x7ca5=['exports','express','Router','post','login','/forgot','reset'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7ca5,0x1f2));var _0x57ca=function(_0x43f5a3,_0x58ed44){_0x43f5a3=_0x43f5a3-0x0;var _0x3c5e13=_0x7ca5[_0x43f5a3];return _0x3c5e13;};'use strict';var express=require(_0x57ca('0x0'));var router=express[_0x57ca('0x1')]();var controller=require('./authLocal.controller');router[_0x57ca('0x2')]('/',controller[_0x57ca('0x3')]);router['post'](_0x57ca('0x4'),controller['forgot']);router[_0x57ca('0x2')]('/reset/:token',controller[_0x57ca('0x5')]);module[_0x57ca('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index c8dc609..440f4f9 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 _0x7c30=['BOOLEAN','INTEGER','STRING'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x7c30,0x125));var _0x07c3=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7c30[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x07c3('0x0')]},'status':{'type':Sequelize[_0x07c3('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x07c3('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x372e=['exports','STRING','INTEGER'];(function(_0x165e7e,_0x5bcf8e){var _0x38a1ff=function(_0x468f7e){while(--_0x468f7e){_0x165e7e['push'](_0x165e7e['shift']());}};_0x38a1ff(++_0x5bcf8e);}(_0x372e,0x117));var _0xe372=function(_0x50d199,_0x29e353){_0x50d199=_0x50d199-0x0;var _0x57c7d5=_0x372e[_0x50d199];return _0x57c7d5;};'use strict';var Sequelize=require('sequelize');module[_0xe372('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xe372('0x1')]},'description':{'type':Sequelize[_0xe372('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe372('0x2')],'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 61b0c8c..005b859 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 _0xbe26=['length','options','create','body','catch','find','addConditions','Condition','ids','order','getConditions','addActions','Action','omit','getActions','findOne','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','merge','includeAll','include','rows','show','params','fields'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xbe26,0x175));var _0x6be2=function(_0x12c93d,_0xf99032){_0x12c93d=_0x12c93d-0x0;var _0x21eadb=_0xbe26[_0x12c93d];return _0x21eadb;};'use strict';var emlformat=require(_0x6be2('0x0'));var rimraf=require(_0x6be2('0x1'));var zipdir=require(_0x6be2('0x2'));var jsonpatch=require(_0x6be2('0x3'));var rp=require(_0x6be2('0x4'));var moment=require(_0x6be2('0x5'));var BPromise=require(_0x6be2('0x6'));var Mustache=require(_0x6be2('0x7'));var util=require(_0x6be2('0x8'));var path=require(_0x6be2('0x9'));var sox=require(_0x6be2('0xa'));var csv=require(_0x6be2('0xb'));var ejs=require(_0x6be2('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6be2('0xd'));var squel=require(_0x6be2('0xe'));var crypto=require(_0x6be2('0xf'));var jsforce=require(_0x6be2('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x6be2('0xb'));var querystring=require('querystring');var Papa=require(_0x6be2('0x11'));var Redis=require(_0x6be2('0x12'));var authService=require(_0x6be2('0x13'));var qs=require(_0x6be2('0x14'));var as=require(_0x6be2('0x15'));var hardwareService=require(_0x6be2('0x16'));var logger=require(_0x6be2('0x17'))(_0x6be2('0x18'));var utils=require(_0x6be2('0x19'));var config=require(_0x6be2('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x6be2('0x1b'))['db'];function respondWithStatusCode(_0x2e8b69,_0x26cc31){_0x26cc31=_0x26cc31||0xcc;return function(_0x51462d){if(_0x51462d){return _0x2e8b69[_0x6be2('0x1c')](_0x26cc31);}return _0x2e8b69[_0x6be2('0x1d')](_0x26cc31)[_0x6be2('0x1e')]();};}function respondWithResult(_0x8f4829,_0x2a9697){_0x2a9697=_0x2a9697||0xc8;return function(_0x558d96){if(_0x558d96){return _0x8f4829[_0x6be2('0x1d')](_0x2a9697)[_0x6be2('0x1f')](_0x558d96);}};}function respondWithFilteredResult(_0x51f509,_0x2c20ef){return function(_0x2a09a6){if(_0x2a09a6){var _0x4474f1=typeof _0x2c20ef[_0x6be2('0x20')]===_0x6be2('0x21')&&typeof _0x2c20ef[_0x6be2('0x22')]==='undefined';var _0x3282fa=_0x2a09a6[_0x6be2('0x23')];var _0x2e886a=_0x4474f1?0x0:_0x2c20ef['offset'];var _0x12a399=_0x4474f1?_0x2a09a6[_0x6be2('0x23')]:_0x2c20ef[_0x6be2('0x20')]+_0x2c20ef['limit'];var _0x20e01b;if(_0x12a399>=_0x3282fa){_0x12a399=_0x3282fa;_0x20e01b=0xc8;}else{_0x20e01b=0xce;}_0x51f509['status'](_0x20e01b);return _0x51f509[_0x6be2('0x24')](_0x6be2('0x25'),_0x2e886a+'-'+_0x12a399+'/'+_0x3282fa)[_0x6be2('0x1f')](_0x2a09a6);}return null;};}function patchUpdates(_0x5da352){return function(_0x5d6402){try{jsonpatch[_0x6be2('0x26')](_0x5d6402,_0x5da352,!![]);}catch(_0x26a7b8){return BPromise[_0x6be2('0x27')](_0x26a7b8);}return _0x5d6402['save']();};}function saveUpdates(_0x4ef9f8,_0x493bd3){return function(_0x1af414){if(_0x1af414){return _0x1af414['update'](_0x4ef9f8)[_0x6be2('0x28')](function(_0x1103ba){return _0x1103ba;});}return null;};}function removeEntity(_0x59e79e,_0x260e53){return function(_0x20588d){if(_0x20588d){return _0x20588d[_0x6be2('0x29')]()[_0x6be2('0x28')](function(){_0x59e79e[_0x6be2('0x1d')](0xcc)[_0x6be2('0x1e')]();});}};}function handleEntityNotFound(_0x387336,_0x1ab724){return function(_0x2ecdd8){if(!_0x2ecdd8){_0x387336[_0x6be2('0x1c')](0x194);}return _0x2ecdd8;};}function handleError(_0x1a0b3a,_0x45de49){_0x45de49=_0x45de49||0x1f4;return function(_0x34204b){logger[_0x6be2('0x2a')](_0x34204b[_0x6be2('0x2b')]);if(_0x34204b[_0x6be2('0x2c')]){delete _0x34204b[_0x6be2('0x2c')];}_0x1a0b3a['status'](_0x45de49)[_0x6be2('0x2d')](_0x34204b);};}exports[_0x6be2('0x2e')]=function(_0x45449f,_0xe8e21){var _0x4f3900={},_0x357fa4={},_0x1467a8={'count':0x0,'rows':[]};var _0x534740=_[_0x6be2('0x2f')](db[_0x6be2('0x30')][_0x6be2('0x31')],function(_0x1c8678){return{'name':_0x1c8678[_0x6be2('0x32')],'type':_0x1c8678['type'][_0x6be2('0x33')]};});_0x357fa4[_0x6be2('0x34')]=_[_0x6be2('0x2f')](_0x534740,'name');_0x357fa4[_0x6be2('0x35')]=_[_0x6be2('0x36')](_0x45449f[_0x6be2('0x35')]);_0x357fa4[_0x6be2('0x37')]=_[_0x6be2('0x38')](_0x357fa4[_0x6be2('0x34')],_0x357fa4[_0x6be2('0x35')]);_0x4f3900['attributes']=_[_0x6be2('0x38')](_0x357fa4[_0x6be2('0x34')],qs['fields'](_0x45449f[_0x6be2('0x35')]['fields']));_0x4f3900[_0x6be2('0x39')]=_0x4f3900[_0x6be2('0x39')]['length']?_0x4f3900[_0x6be2('0x39')]:_0x357fa4[_0x6be2('0x34')];if(!_0x45449f[_0x6be2('0x35')][_0x6be2('0x3a')](_0x6be2('0x3b'))){_0x4f3900[_0x6be2('0x22')]=qs[_0x6be2('0x22')](_0x45449f['query'][_0x6be2('0x22')]);_0x4f3900['offset']=qs[_0x6be2('0x20')](_0x45449f[_0x6be2('0x35')][_0x6be2('0x20')]);}_0x4f3900['order']=qs[_0x6be2('0x3c')](_0x45449f[_0x6be2('0x35')]['sort']);_0x4f3900[_0x6be2('0x3d')]=qs['filters'](_['pick'](_0x45449f[_0x6be2('0x35')],_0x357fa4['filters']),_0x534740);if(_0x45449f[_0x6be2('0x35')][_0x6be2('0x3e')]){_0x4f3900[_0x6be2('0x3d')]=_['merge'](_0x4f3900[_0x6be2('0x3d')],{'$or':_['map'](_0x534740,function(_0x234452){if(_0x234452[_0x6be2('0x3f')]!==_0x6be2('0x40')){var _0x174325={};_0x174325[_0x234452[_0x6be2('0x2c')]]={'$like':'%'+_0x45449f[_0x6be2('0x35')]['filter']+'%'};return _0x174325;}})});}_0x4f3900=_[_0x6be2('0x41')]({},_0x4f3900,_0x45449f['options']);var _0x50ef20={'where':_0x4f3900['where']};return db[_0x6be2('0x30')]['count'](_0x50ef20)[_0x6be2('0x28')](function(_0x33b2d4){_0x1467a8[_0x6be2('0x23')]=_0x33b2d4;if(_0x45449f[_0x6be2('0x35')][_0x6be2('0x42')]){_0x4f3900[_0x6be2('0x43')]=[{'all':!![]}];}return db[_0x6be2('0x30')]['findAll'](_0x4f3900);})[_0x6be2('0x28')](function(_0x43f494){_0x1467a8[_0x6be2('0x44')]=_0x43f494;return _0x1467a8;})['then'](respondWithFilteredResult(_0xe8e21,_0x4f3900))['catch'](handleError(_0xe8e21,null));};exports[_0x6be2('0x45')]=function(_0x510bb7,_0xe23509){var _0x2e90ba={'raw':![],'where':{'id':_0x510bb7[_0x6be2('0x46')]['id']}},_0xf8c504={};_0xf8c504['model']=_[_0x6be2('0x36')](db[_0x6be2('0x30')][_0x6be2('0x31')]);_0xf8c504['query']=_[_0x6be2('0x36')](_0x510bb7[_0x6be2('0x35')]);_0xf8c504[_0x6be2('0x37')]=_[_0x6be2('0x38')](_0xf8c504[_0x6be2('0x34')],_0xf8c504[_0x6be2('0x35')]);_0x2e90ba['attributes']=_[_0x6be2('0x38')](_0xf8c504[_0x6be2('0x34')],qs[_0x6be2('0x47')](_0x510bb7[_0x6be2('0x35')][_0x6be2('0x47')]));_0x2e90ba[_0x6be2('0x39')]=_0x2e90ba[_0x6be2('0x39')][_0x6be2('0x48')]?_0x2e90ba[_0x6be2('0x39')]:_0xf8c504[_0x6be2('0x34')];if(_0x510bb7[_0x6be2('0x35')][_0x6be2('0x42')]){_0x2e90ba[_0x6be2('0x43')]=[{'all':!![]}];}_0x2e90ba=_['merge']({},_0x2e90ba,_0x510bb7[_0x6be2('0x49')]);return db['Automation']['find'](_0x2e90ba)[_0x6be2('0x28')](handleEntityNotFound(_0xe23509,null))[_0x6be2('0x28')](respondWithResult(_0xe23509,null))['catch'](handleError(_0xe23509,null));};exports['create']=function(_0x27ed4e,_0x2b95db){return db[_0x6be2('0x30')][_0x6be2('0x4a')](_0x27ed4e[_0x6be2('0x4b')],{})[_0x6be2('0x28')](respondWithResult(_0x2b95db,0xc9))[_0x6be2('0x4c')](handleError(_0x2b95db,null));};exports['update']=function(_0x4dd29b,_0x5eef99){if(_0x4dd29b[_0x6be2('0x4b')]['id']){delete _0x4dd29b[_0x6be2('0x4b')]['id'];}return db[_0x6be2('0x30')][_0x6be2('0x4d')]({'where':{'id':_0x4dd29b[_0x6be2('0x46')]['id']}})[_0x6be2('0x28')](handleEntityNotFound(_0x5eef99,null))[_0x6be2('0x28')](saveUpdates(_0x4dd29b[_0x6be2('0x4b')],null))['then'](respondWithResult(_0x5eef99,null))[_0x6be2('0x4c')](handleError(_0x5eef99,null));};exports[_0x6be2('0x29')]=function(_0x4dae47,_0x2ed683){return db['Automation'][_0x6be2('0x4d')]({'where':{'id':_0x4dae47[_0x6be2('0x46')]['id']}})[_0x6be2('0x28')](handleEntityNotFound(_0x2ed683,null))['then'](removeEntity(_0x2ed683,null))['catch'](handleError(_0x2ed683,null));};exports[_0x6be2('0x4e')]=function(_0x4baa3c,_0x57b4ef,_0x4a6687){return db[_0x6be2('0x4f')][_0x6be2('0x4d')]({'where':{'id':_0x4baa3c[_0x6be2('0x46')]['id']}})[_0x6be2('0x28')](handleEntityNotFound(_0x57b4ef,null))[_0x6be2('0x28')](function(_0x280c9f){if(_0x280c9f){return _0x280c9f[_0x6be2('0x4e')](_0x4baa3c[_0x6be2('0x4b')][_0x6be2('0x50')],_['omit'](_0x4baa3c['body'],[_0x6be2('0x50'),'id'])||{});}})[_0x6be2('0x28')](respondWithResult(_0x57b4ef,null))[_0x6be2('0x4c')](handleError(_0x57b4ef,null));};exports['getConditions']=function(_0x21ddc6,_0x164622,_0x236cb7){var _0x27b0df={};var _0x4fec25={};var _0x3e3f73;var _0x4b2f59;return db['Automation']['findOne']({'where':{'id':_0x21ddc6[_0x6be2('0x46')]['id']}})[_0x6be2('0x28')](handleEntityNotFound(_0x164622,null))[_0x6be2('0x28')](function(_0x83569){if(_0x83569){_0x3e3f73=_0x83569;_0x4fec25[_0x6be2('0x34')]=_[_0x6be2('0x36')](db['Condition'][_0x6be2('0x31')]);_0x4fec25['query']=_[_0x6be2('0x36')](_0x21ddc6[_0x6be2('0x35')]);_0x4fec25[_0x6be2('0x37')]=_[_0x6be2('0x38')](_0x4fec25[_0x6be2('0x34')],_0x4fec25[_0x6be2('0x35')]);_0x27b0df[_0x6be2('0x39')]=_[_0x6be2('0x38')](_0x4fec25['model'],qs['fields'](_0x21ddc6[_0x6be2('0x35')][_0x6be2('0x47')]));_0x27b0df['attributes']=_0x27b0df[_0x6be2('0x39')]['length']?_0x27b0df[_0x6be2('0x39')]:_0x4fec25[_0x6be2('0x34')];_0x27b0df[_0x6be2('0x51')]=qs[_0x6be2('0x3c')](_0x21ddc6['query'][_0x6be2('0x3c')]);_0x27b0df['where']=qs[_0x6be2('0x37')](_['pick'](_0x21ddc6[_0x6be2('0x35')],_0x4fec25[_0x6be2('0x37')]));if(_0x21ddc6[_0x6be2('0x35')][_0x6be2('0x3e')]){_0x27b0df[_0x6be2('0x3d')]=_[_0x6be2('0x41')](_0x27b0df[_0x6be2('0x3d')],{'$or':_[_0x6be2('0x2f')](_0x27b0df[_0x6be2('0x39')],function(_0x2a05ee){var _0x4787c7={};_0x4787c7[_0x2a05ee]={'$like':'%'+_0x21ddc6[_0x6be2('0x35')]['filter']+'%'};return _0x4787c7;})});}_0x27b0df=_[_0x6be2('0x41')]({},_0x27b0df,_0x21ddc6[_0x6be2('0x49')]);return _0x3e3f73[_0x6be2('0x52')](_0x27b0df);}})[_0x6be2('0x28')](function(_0x191749){if(_0x191749){_0x4b2f59=_0x191749[_0x6be2('0x48')];if(!_0x21ddc6[_0x6be2('0x35')][_0x6be2('0x3a')]('nolimit')){_0x27b0df[_0x6be2('0x22')]=qs[_0x6be2('0x22')](_0x21ddc6['query'][_0x6be2('0x22')]);_0x27b0df[_0x6be2('0x20')]=qs[_0x6be2('0x20')](_0x21ddc6[_0x6be2('0x35')][_0x6be2('0x20')]);}return _0x3e3f73[_0x6be2('0x52')](_0x27b0df);}})['then'](function(_0x396632){if(_0x396632){return _0x396632?{'count':_0x4b2f59,'rows':_0x396632}:null;}})['then'](respondWithResult(_0x164622,null))[_0x6be2('0x4c')](handleError(_0x164622,null));};exports[_0x6be2('0x53')]=function(_0x5e9a5f,_0x2f3180,_0x4e572e){return db[_0x6be2('0x54')][_0x6be2('0x4d')]({'where':{'id':_0x5e9a5f[_0x6be2('0x46')]['id']}})[_0x6be2('0x28')](handleEntityNotFound(_0x2f3180,null))[_0x6be2('0x28')](function(_0x14442f){if(_0x14442f){return _0x14442f['addActions'](_0x5e9a5f[_0x6be2('0x4b')][_0x6be2('0x50')],_[_0x6be2('0x55')](_0x5e9a5f[_0x6be2('0x4b')],[_0x6be2('0x50'),'id'])||{});}})['then'](respondWithResult(_0x2f3180,null))[_0x6be2('0x4c')](handleError(_0x2f3180,null));};exports[_0x6be2('0x56')]=function(_0x50caab,_0x388024,_0x5d1cb9){var _0x893a31={};var _0x39eded={};var _0x9f514e;var _0x2af0b3;return db[_0x6be2('0x30')][_0x6be2('0x57')]({'where':{'id':_0x50caab[_0x6be2('0x46')]['id']}})['then'](handleEntityNotFound(_0x388024,null))[_0x6be2('0x28')](function(_0x3f368e){if(_0x3f368e){_0x9f514e=_0x3f368e;_0x39eded['model']=_['keys'](db[_0x6be2('0x54')][_0x6be2('0x31')]);_0x39eded[_0x6be2('0x35')]=_[_0x6be2('0x36')](_0x50caab['query']);_0x39eded[_0x6be2('0x37')]=_[_0x6be2('0x38')](_0x39eded[_0x6be2('0x34')],_0x39eded[_0x6be2('0x35')]);_0x893a31[_0x6be2('0x39')]=_['intersection'](_0x39eded['model'],qs[_0x6be2('0x47')](_0x50caab['query'][_0x6be2('0x47')]));_0x893a31[_0x6be2('0x39')]=_0x893a31['attributes'][_0x6be2('0x48')]?_0x893a31[_0x6be2('0x39')]:_0x39eded[_0x6be2('0x34')];_0x893a31[_0x6be2('0x51')]=qs[_0x6be2('0x3c')](_0x50caab['query'][_0x6be2('0x3c')]);_0x893a31[_0x6be2('0x3d')]=qs[_0x6be2('0x37')](_[_0x6be2('0x58')](_0x50caab[_0x6be2('0x35')],_0x39eded[_0x6be2('0x37')]));if(_0x50caab['query'][_0x6be2('0x3e')]){_0x893a31['where']=_[_0x6be2('0x41')](_0x893a31[_0x6be2('0x3d')],{'$or':_[_0x6be2('0x2f')](_0x893a31['attributes'],function(_0x67ac24){var _0x25a55c={};_0x25a55c[_0x67ac24]={'$like':'%'+_0x50caab[_0x6be2('0x35')]['filter']+'%'};return _0x25a55c;})});}_0x893a31=_['merge']({},_0x893a31,_0x50caab[_0x6be2('0x49')]);return _0x9f514e[_0x6be2('0x56')](_0x893a31);}})['then'](function(_0xaedc){if(_0xaedc){_0x2af0b3=_0xaedc['length'];if(!_0x50caab[_0x6be2('0x35')]['hasOwnProperty'](_0x6be2('0x3b'))){_0x893a31[_0x6be2('0x22')]=qs[_0x6be2('0x22')](_0x50caab[_0x6be2('0x35')][_0x6be2('0x22')]);_0x893a31[_0x6be2('0x20')]=qs[_0x6be2('0x20')](_0x50caab[_0x6be2('0x35')][_0x6be2('0x20')]);}return _0x9f514e[_0x6be2('0x56')](_0x893a31);}})['then'](function(_0x1620f8){if(_0x1620f8){return _0x1620f8?{'count':_0x2af0b3,'rows':_0x1620f8}:null;}})[_0x6be2('0x28')](respondWithResult(_0x388024,null))[_0x6be2('0x4c')](handleError(_0x388024,null));};
\ No newline at end of file
+var _0x8876=['addConditions','Condition','omit','ids','sort','getConditions','hasOwnProperty','Action','addActions','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','apply','then','destroy','end','error','stack','name','send','index','Automation','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','update','find'];(function(_0x3eee4d,_0x4a63dd){var _0x249144=function(_0x15051b){while(--_0x15051b){_0x3eee4d['push'](_0x3eee4d['shift']());}};_0x249144(++_0x4a63dd);}(_0x8876,0x196));var _0x6887=function(_0x22eff9,_0x4cf231){_0x22eff9=_0x22eff9-0x0;var _0x439892=_0x8876[_0x22eff9];return _0x439892;};'use strict';var emlformat=require(_0x6887('0x0'));var rimraf=require(_0x6887('0x1'));var zipdir=require(_0x6887('0x2'));var jsonpatch=require(_0x6887('0x3'));var rp=require(_0x6887('0x4'));var moment=require('moment');var BPromise=require(_0x6887('0x5'));var Mustache=require(_0x6887('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6887('0x7'));var csv=require(_0x6887('0x8'));var ejs=require(_0x6887('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6887('0xa'));var squel=require(_0x6887('0xb'));var crypto=require(_0x6887('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6887('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6887('0xe'));var Papa=require(_0x6887('0xf'));var Redis=require(_0x6887('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6887('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6887('0x12'));var utils=require('../../config/utils');var config=require(_0x6887('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6887('0x14'))['db'];function respondWithStatusCode(_0x2bb80c,_0xfde742){_0xfde742=_0xfde742||0xcc;return function(_0x36c283){if(_0x36c283){return _0x2bb80c[_0x6887('0x15')](_0xfde742);}return _0x2bb80c[_0x6887('0x16')](_0xfde742)['end']();};}function respondWithResult(_0x324dd4,_0x49b2c4){_0x49b2c4=_0x49b2c4||0xc8;return function(_0x4594cd){if(_0x4594cd){return _0x324dd4[_0x6887('0x16')](_0x49b2c4)['json'](_0x4594cd);}};}function respondWithFilteredResult(_0x117d6d,_0x551ce7){return function(_0x20f785){if(_0x20f785){var _0x4fbc26=typeof _0x551ce7['offset']===_0x6887('0x17')&&typeof _0x551ce7[_0x6887('0x18')]==='undefined';var _0x4ff47a=_0x20f785[_0x6887('0x19')];var _0x117762=_0x4fbc26?0x0:_0x551ce7[_0x6887('0x1a')];var _0x3fe277=_0x4fbc26?_0x20f785[_0x6887('0x19')]:_0x551ce7['offset']+_0x551ce7[_0x6887('0x18')];var _0x4b74ad;if(_0x3fe277>=_0x4ff47a){_0x3fe277=_0x4ff47a;_0x4b74ad=0xc8;}else{_0x4b74ad=0xce;}_0x117d6d['status'](_0x4b74ad);return _0x117d6d[_0x6887('0x1b')]('Content-Range',_0x117762+'-'+_0x3fe277+'/'+_0x4ff47a)['json'](_0x20f785);}return null;};}function patchUpdates(_0x152e3f){return function(_0x3cae93){try{jsonpatch[_0x6887('0x1c')](_0x3cae93,_0x152e3f,!![]);}catch(_0x3f44e7){return BPromise['reject'](_0x3f44e7);}return _0x3cae93['save']();};}function saveUpdates(_0x5d5670,_0x5bac45){return function(_0x36d7f5){if(_0x36d7f5){return _0x36d7f5['update'](_0x5d5670)[_0x6887('0x1d')](function(_0x87f04b){return _0x87f04b;});}return null;};}function removeEntity(_0x533f93,_0x415418){return function(_0x348dab){if(_0x348dab){return _0x348dab[_0x6887('0x1e')]()[_0x6887('0x1d')](function(){_0x533f93['status'](0xcc)[_0x6887('0x1f')]();});}};}function handleEntityNotFound(_0x4e56a7,_0x15126f){return function(_0x3712d5){if(!_0x3712d5){_0x4e56a7[_0x6887('0x15')](0x194);}return _0x3712d5;};}function handleError(_0x2ccb90,_0x491b11){_0x491b11=_0x491b11||0x1f4;return function(_0x2cd1eb){logger[_0x6887('0x20')](_0x2cd1eb[_0x6887('0x21')]);if(_0x2cd1eb[_0x6887('0x22')]){delete _0x2cd1eb[_0x6887('0x22')];}_0x2ccb90[_0x6887('0x16')](_0x491b11)[_0x6887('0x23')](_0x2cd1eb);};}exports[_0x6887('0x24')]=function(_0x60c1d3,_0x976032){var _0x55cbca={},_0x575399={},_0x3816f1={'count':0x0,'rows':[]};var _0x299b86=_['map'](db[_0x6887('0x25')]['rawAttributes'],function(_0x353d21){return{'name':_0x353d21[_0x6887('0x26')],'type':_0x353d21[_0x6887('0x27')]['key']};});_0x575399['model']=_[_0x6887('0x28')](_0x299b86,_0x6887('0x22'));_0x575399[_0x6887('0x29')]=_[_0x6887('0x2a')](_0x60c1d3['query']);_0x575399[_0x6887('0x2b')]=_[_0x6887('0x2c')](_0x575399[_0x6887('0x2d')],_0x575399['query']);_0x55cbca[_0x6887('0x2e')]=_[_0x6887('0x2c')](_0x575399[_0x6887('0x2d')],qs[_0x6887('0x2f')](_0x60c1d3[_0x6887('0x29')]['fields']));_0x55cbca[_0x6887('0x2e')]=_0x55cbca['attributes'][_0x6887('0x30')]?_0x55cbca[_0x6887('0x2e')]:_0x575399[_0x6887('0x2d')];if(!_0x60c1d3[_0x6887('0x29')]['hasOwnProperty'](_0x6887('0x31'))){_0x55cbca[_0x6887('0x18')]=qs['limit'](_0x60c1d3[_0x6887('0x29')][_0x6887('0x18')]);_0x55cbca[_0x6887('0x1a')]=qs[_0x6887('0x1a')](_0x60c1d3['query']['offset']);}_0x55cbca[_0x6887('0x32')]=qs['sort'](_0x60c1d3[_0x6887('0x29')]['sort']);_0x55cbca[_0x6887('0x33')]=qs[_0x6887('0x2b')](_[_0x6887('0x34')](_0x60c1d3[_0x6887('0x29')],_0x575399[_0x6887('0x2b')]),_0x299b86);if(_0x60c1d3['query'][_0x6887('0x35')]){_0x55cbca[_0x6887('0x33')]=_['merge'](_0x55cbca[_0x6887('0x33')],{'$or':_[_0x6887('0x28')](_0x299b86,function(_0x87f2b4){if(_0x87f2b4[_0x6887('0x27')]!==_0x6887('0x36')){var _0x5d4744={};_0x5d4744[_0x87f2b4[_0x6887('0x22')]]={'$like':'%'+_0x60c1d3[_0x6887('0x29')][_0x6887('0x35')]+'%'};return _0x5d4744;}})});}_0x55cbca=_[_0x6887('0x37')]({},_0x55cbca,_0x60c1d3[_0x6887('0x38')]);var _0xf04b31={'where':_0x55cbca[_0x6887('0x33')]};return db[_0x6887('0x25')][_0x6887('0x19')](_0xf04b31)['then'](function(_0x1d222c){_0x3816f1[_0x6887('0x19')]=_0x1d222c;if(_0x60c1d3[_0x6887('0x29')][_0x6887('0x39')]){_0x55cbca[_0x6887('0x3a')]=[{'all':!![]}];}return db[_0x6887('0x25')][_0x6887('0x3b')](_0x55cbca);})[_0x6887('0x1d')](function(_0x55e03d){_0x3816f1['rows']=_0x55e03d;return _0x3816f1;})[_0x6887('0x1d')](respondWithFilteredResult(_0x976032,_0x55cbca))[_0x6887('0x3c')](handleError(_0x976032,null));};exports[_0x6887('0x3d')]=function(_0xb7b1df,_0x37d16f){var _0x4bad0d={'raw':![],'where':{'id':_0xb7b1df[_0x6887('0x3e')]['id']}},_0x409b91={};_0x409b91[_0x6887('0x2d')]=_['keys'](db[_0x6887('0x25')][_0x6887('0x3f')]);_0x409b91['query']=_[_0x6887('0x2a')](_0xb7b1df[_0x6887('0x29')]);_0x409b91[_0x6887('0x2b')]=_[_0x6887('0x2c')](_0x409b91['model'],_0x409b91['query']);_0x4bad0d[_0x6887('0x2e')]=_[_0x6887('0x2c')](_0x409b91[_0x6887('0x2d')],qs[_0x6887('0x2f')](_0xb7b1df[_0x6887('0x29')][_0x6887('0x2f')]));_0x4bad0d[_0x6887('0x2e')]=_0x4bad0d['attributes'][_0x6887('0x30')]?_0x4bad0d[_0x6887('0x2e')]:_0x409b91[_0x6887('0x2d')];if(_0xb7b1df[_0x6887('0x29')][_0x6887('0x39')]){_0x4bad0d[_0x6887('0x3a')]=[{'all':!![]}];}_0x4bad0d=_[_0x6887('0x37')]({},_0x4bad0d,_0xb7b1df['options']);return db['Automation']['find'](_0x4bad0d)['then'](handleEntityNotFound(_0x37d16f,null))[_0x6887('0x1d')](respondWithResult(_0x37d16f,null))[_0x6887('0x3c')](handleError(_0x37d16f,null));};exports[_0x6887('0x40')]=function(_0x141c90,_0x3c3d73){return db[_0x6887('0x25')][_0x6887('0x40')](_0x141c90[_0x6887('0x41')],{})['then'](respondWithResult(_0x3c3d73,0xc9))['catch'](handleError(_0x3c3d73,null));};exports[_0x6887('0x42')]=function(_0x482b97,_0xa511ba){if(_0x482b97[_0x6887('0x41')]['id']){delete _0x482b97[_0x6887('0x41')]['id'];}return db[_0x6887('0x25')][_0x6887('0x43')]({'where':{'id':_0x482b97[_0x6887('0x3e')]['id']}})['then'](handleEntityNotFound(_0xa511ba,null))['then'](saveUpdates(_0x482b97['body'],null))[_0x6887('0x1d')](respondWithResult(_0xa511ba,null))[_0x6887('0x3c')](handleError(_0xa511ba,null));};exports['destroy']=function(_0x228a98,_0x396a70){return db['Automation'][_0x6887('0x43')]({'where':{'id':_0x228a98[_0x6887('0x3e')]['id']}})['then'](handleEntityNotFound(_0x396a70,null))[_0x6887('0x1d')](removeEntity(_0x396a70,null))[_0x6887('0x3c')](handleError(_0x396a70,null));};exports[_0x6887('0x44')]=function(_0x98763c,_0x159daf,_0x276938){return db[_0x6887('0x45')]['find']({'where':{'id':_0x98763c[_0x6887('0x3e')]['id']}})[_0x6887('0x1d')](handleEntityNotFound(_0x159daf,null))[_0x6887('0x1d')](function(_0x3708f8){if(_0x3708f8){return _0x3708f8[_0x6887('0x44')](_0x98763c['body']['ids'],_[_0x6887('0x46')](_0x98763c[_0x6887('0x41')],[_0x6887('0x47'),'id'])||{});}})[_0x6887('0x1d')](respondWithResult(_0x159daf,null))[_0x6887('0x3c')](handleError(_0x159daf,null));};exports['getConditions']=function(_0x3fac47,_0x2f9894,_0x57c5fc){var _0x4c67bc={};var _0x5bb4d4={};var _0x56003a;var _0x2dc370;return db[_0x6887('0x25')]['findOne']({'where':{'id':_0x3fac47[_0x6887('0x3e')]['id']}})[_0x6887('0x1d')](handleEntityNotFound(_0x2f9894,null))[_0x6887('0x1d')](function(_0x201224){if(_0x201224){_0x56003a=_0x201224;_0x5bb4d4['model']=_['keys'](db[_0x6887('0x45')]['rawAttributes']);_0x5bb4d4[_0x6887('0x29')]=_['keys'](_0x3fac47[_0x6887('0x29')]);_0x5bb4d4[_0x6887('0x2b')]=_['intersection'](_0x5bb4d4['model'],_0x5bb4d4['query']);_0x4c67bc['attributes']=_['intersection'](_0x5bb4d4[_0x6887('0x2d')],qs[_0x6887('0x2f')](_0x3fac47['query'][_0x6887('0x2f')]));_0x4c67bc['attributes']=_0x4c67bc[_0x6887('0x2e')][_0x6887('0x30')]?_0x4c67bc[_0x6887('0x2e')]:_0x5bb4d4[_0x6887('0x2d')];_0x4c67bc[_0x6887('0x32')]=qs[_0x6887('0x48')](_0x3fac47[_0x6887('0x29')]['sort']);_0x4c67bc[_0x6887('0x33')]=qs[_0x6887('0x2b')](_[_0x6887('0x34')](_0x3fac47[_0x6887('0x29')],_0x5bb4d4[_0x6887('0x2b')]));if(_0x3fac47[_0x6887('0x29')][_0x6887('0x35')]){_0x4c67bc['where']=_['merge'](_0x4c67bc[_0x6887('0x33')],{'$or':_['map'](_0x4c67bc[_0x6887('0x2e')],function(_0x468560){var _0x1c4f21={};_0x1c4f21[_0x468560]={'$like':'%'+_0x3fac47['query'][_0x6887('0x35')]+'%'};return _0x1c4f21;})});}_0x4c67bc=_[_0x6887('0x37')]({},_0x4c67bc,_0x3fac47[_0x6887('0x38')]);return _0x56003a[_0x6887('0x49')](_0x4c67bc);}})[_0x6887('0x1d')](function(_0x230ed1){if(_0x230ed1){_0x2dc370=_0x230ed1[_0x6887('0x30')];if(!_0x3fac47[_0x6887('0x29')][_0x6887('0x4a')](_0x6887('0x31'))){_0x4c67bc[_0x6887('0x18')]=qs[_0x6887('0x18')](_0x3fac47[_0x6887('0x29')]['limit']);_0x4c67bc['offset']=qs[_0x6887('0x1a')](_0x3fac47[_0x6887('0x29')][_0x6887('0x1a')]);}return _0x56003a[_0x6887('0x49')](_0x4c67bc);}})[_0x6887('0x1d')](function(_0x297b0d){if(_0x297b0d){return _0x297b0d?{'count':_0x2dc370,'rows':_0x297b0d}:null;}})[_0x6887('0x1d')](respondWithResult(_0x2f9894,null))[_0x6887('0x3c')](handleError(_0x2f9894,null));};exports['addActions']=function(_0x28912a,_0x1cc5aa,_0x2279c8){return db[_0x6887('0x4b')][_0x6887('0x43')]({'where':{'id':_0x28912a[_0x6887('0x3e')]['id']}})[_0x6887('0x1d')](handleEntityNotFound(_0x1cc5aa,null))[_0x6887('0x1d')](function(_0x2251d8){if(_0x2251d8){return _0x2251d8[_0x6887('0x4c')](_0x28912a[_0x6887('0x41')][_0x6887('0x47')],_['omit'](_0x28912a[_0x6887('0x41')],[_0x6887('0x47'),'id'])||{});}})[_0x6887('0x1d')](respondWithResult(_0x1cc5aa,null))[_0x6887('0x3c')](handleError(_0x1cc5aa,null));};exports[_0x6887('0x4d')]=function(_0x1111ac,_0x43babe,_0x5eab19){var _0x441106={};var _0x1378ef={};var _0x238f79;var _0x3f9ea1;return db[_0x6887('0x25')][_0x6887('0x4e')]({'where':{'id':_0x1111ac[_0x6887('0x3e')]['id']}})[_0x6887('0x1d')](handleEntityNotFound(_0x43babe,null))[_0x6887('0x1d')](function(_0xf2ace){if(_0xf2ace){_0x238f79=_0xf2ace;_0x1378ef[_0x6887('0x2d')]=_[_0x6887('0x2a')](db['Action'][_0x6887('0x3f')]);_0x1378ef[_0x6887('0x29')]=_[_0x6887('0x2a')](_0x1111ac[_0x6887('0x29')]);_0x1378ef['filters']=_['intersection'](_0x1378ef[_0x6887('0x2d')],_0x1378ef[_0x6887('0x29')]);_0x441106['attributes']=_['intersection'](_0x1378ef['model'],qs[_0x6887('0x2f')](_0x1111ac[_0x6887('0x29')][_0x6887('0x2f')]));_0x441106[_0x6887('0x2e')]=_0x441106[_0x6887('0x2e')][_0x6887('0x30')]?_0x441106[_0x6887('0x2e')]:_0x1378ef[_0x6887('0x2d')];_0x441106[_0x6887('0x32')]=qs[_0x6887('0x48')](_0x1111ac[_0x6887('0x29')][_0x6887('0x48')]);_0x441106[_0x6887('0x33')]=qs['filters'](_[_0x6887('0x34')](_0x1111ac[_0x6887('0x29')],_0x1378ef[_0x6887('0x2b')]));if(_0x1111ac[_0x6887('0x29')][_0x6887('0x35')]){_0x441106[_0x6887('0x33')]=_[_0x6887('0x37')](_0x441106[_0x6887('0x33')],{'$or':_[_0x6887('0x28')](_0x441106['attributes'],function(_0x50a69f){var _0x2692e9={};_0x2692e9[_0x50a69f]={'$like':'%'+_0x1111ac[_0x6887('0x29')][_0x6887('0x35')]+'%'};return _0x2692e9;})});}_0x441106=_[_0x6887('0x37')]({},_0x441106,_0x1111ac[_0x6887('0x38')]);return _0x238f79[_0x6887('0x4d')](_0x441106);}})[_0x6887('0x1d')](function(_0x56c6a3){if(_0x56c6a3){_0x3f9ea1=_0x56c6a3['length'];if(!_0x1111ac[_0x6887('0x29')][_0x6887('0x4a')](_0x6887('0x31'))){_0x441106[_0x6887('0x18')]=qs[_0x6887('0x18')](_0x1111ac[_0x6887('0x29')][_0x6887('0x18')]);_0x441106[_0x6887('0x1a')]=qs[_0x6887('0x1a')](_0x1111ac['query'][_0x6887('0x1a')]);}return _0x238f79[_0x6887('0x4d')](_0x441106);}})['then'](function(_0x5247c0){if(_0x5247c0){return _0x5247c0?{'count':_0x3f9ea1,'rows':_0x5247c0}:null;}})[_0x6887('0x1d')](respondWithResult(_0x43babe,null))[_0x6887('0x3c')](handleError(_0x43babe,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 9934e4b..b4714ae 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 _0xd8fb=['lodash','util','api','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xd8fb,0x79));var _0xbd8f=function(_0x42d98d,_0x147db9){_0x42d98d=_0x42d98d-0x0;var _0x295ce9=_0xd8fb[_0x42d98d];return _0x295ce9;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require('../../config/logger')(_0xbd8f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbd8f('0x3'));var fs=require('fs');var path=require(_0xbd8f('0x4'));var rimraf=require(_0xbd8f('0x5'));var config=require(_0xbd8f('0x6'));var attributes=require(_0xbd8f('0x7'));module[_0xbd8f('0x8')]=function(_0x2a0d0e,_0x5a8676){return _0x2a0d0e['define'](_0xbd8f('0x9'),attributes,{'tableName':_0xbd8f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf8d0=['../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x482c55,_0x1fb933){var _0x1c6691=function(_0x14be4c){while(--_0x14be4c){_0x482c55['push'](_0x482c55['shift']());}};_0x1c6691(++_0x1fb933);}(_0xf8d0,0x199));var _0x0f8d=function(_0x192f1b,_0x537544){_0x192f1b=_0x192f1b-0x0;var _0x568a41=_0xf8d0[_0x192f1b];return _0x568a41;};'use strict';var _=require(_0x0f8d('0x0'));var util=require(_0x0f8d('0x1'));var logger=require('../../config/logger')(_0x0f8d('0x2'));var moment=require(_0x0f8d('0x3'));var BPromise=require('bluebird');var rp=require(_0x0f8d('0x4'));var fs=require('fs');var path=require(_0x0f8d('0x5'));var rimraf=require(_0x0f8d('0x6'));var config=require(_0x0f8d('0x7'));var attributes=require(_0x0f8d('0x8'));module[_0x0f8d('0x9')]=function(_0x3bcad3,_0x1a26b7){return _0x3bcad3[_0x0f8d('0xa')](_0x0f8d('0xb'),attributes,{'tableName':_0x0f8d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index d84693f..dd782b3 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 _0x8733=['code','Automation,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','error'];(function(_0x40b909,_0x11f814){var _0x5e220f=function(_0x3d87e8){while(--_0x3d87e8){_0x40b909['push'](_0x40b909['shift']());}};_0x5e220f(++_0x11f814);}(_0x8733,0xd7));var _0x3873=function(_0x5e7692,_0x1caa40){_0x5e7692=_0x5e7692-0x0;var _0x120367=_0x8733[_0x5e7692];return _0x120367;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3873('0x0'));var BPromise=require(_0x3873('0x1'));var rs=require(_0x3873('0x2'));var fs=require('fs');var Redis=require(_0x3873('0x3'));var db=require(_0x3873('0x4'))['db'];var utils=require(_0x3873('0x5'));var logger=require(_0x3873('0x6'))(_0x3873('0x7'));var config=require('../../config/environment');var jayson=require(_0x3873('0x8'));var client=jayson[_0x3873('0x9')][_0x3873('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c37e1,_0x2b303a,_0x2fa708){return new BPromise(function(_0x37af67,_0x3fba92){return client[_0x3873('0xb')](_0x4c37e1,_0x2fa708)[_0x3873('0xc')](function(_0x3b9423){logger[_0x3873('0xd')]('Automation,\x20%s,\x20%s',_0x2b303a,'request\x20sent');logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x2b303a,_0x3873('0xe'),JSON['stringify'](_0x3b9423));if(_0x3b9423[_0x3873('0xf')]){if(_0x3b9423['error'][_0x3873('0x10')]===0x1f4){logger[_0x3873('0xf')](_0x3873('0x11'),_0x2b303a,_0x3b9423['error'][_0x3873('0x12')]);return _0x3fba92(_0x3b9423[_0x3873('0xf')]['message']);}logger[_0x3873('0xf')]('Automation,\x20%s,\x20%s',_0x2b303a,_0x3b9423['error']['message']);return _0x37af67(_0x3b9423[_0x3873('0xf')]['message']);}else{logger[_0x3873('0xd')]('Automation,\x20%s,\x20%s',_0x2b303a,_0x3873('0xe'));_0x37af67(_0x3b9423[_0x3873('0x13')][_0x3873('0x12')]);}})[_0x3873('0x14')](function(_0x58c5d6){logger[_0x3873('0xf')]('Automation,\x20%s,\x20%s',_0x2b303a,_0x58c5d6);_0x3fba92(_0x58c5d6);});});}
\ No newline at end of file
+var _0xb1f7=['result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5581ba,_0x268887){var _0x1e927f=function(_0x1803b2){while(--_0x1803b2){_0x5581ba['push'](_0x5581ba['shift']());}};_0x1e927f(++_0x268887);}(_0xb1f7,0xba));var _0x7b1f=function(_0x4b25bd,_0x581088){_0x4b25bd=_0x4b25bd-0x0;var _0x29a4d9=_0xb1f7[_0x4b25bd];return _0x29a4d9;};'use strict';var _=require('lodash');var util=require(_0x7b1f('0x0'));var moment=require(_0x7b1f('0x1'));var BPromise=require(_0x7b1f('0x2'));var rs=require(_0x7b1f('0x3'));var fs=require('fs');var Redis=require(_0x7b1f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b1f('0x5'));var logger=require(_0x7b1f('0x6'))(_0x7b1f('0x7'));var config=require(_0x7b1f('0x8'));var jayson=require(_0x7b1f('0x9'));var client=jayson[_0x7b1f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c3f94,_0x2bfa33,_0x30dd32){return new BPromise(function(_0x3904f4,_0x17c587){return client[_0x7b1f('0xb')](_0x4c3f94,_0x30dd32)['then'](function(_0x3278b2){logger[_0x7b1f('0xc')](_0x7b1f('0xd'),_0x2bfa33,_0x7b1f('0xe'));logger[_0x7b1f('0xf')](_0x7b1f('0x10'),_0x2bfa33,_0x7b1f('0xe'),JSON[_0x7b1f('0x11')](_0x3278b2));if(_0x3278b2[_0x7b1f('0x12')]){if(_0x3278b2['error'][_0x7b1f('0x13')]===0x1f4){logger[_0x7b1f('0x12')](_0x7b1f('0xd'),_0x2bfa33,_0x3278b2[_0x7b1f('0x12')]['message']);return _0x17c587(_0x3278b2['error'][_0x7b1f('0x14')]);}logger['error'](_0x7b1f('0xd'),_0x2bfa33,_0x3278b2['error'][_0x7b1f('0x14')]);return _0x3904f4(_0x3278b2[_0x7b1f('0x12')][_0x7b1f('0x14')]);}else{logger['info'](_0x7b1f('0xd'),_0x2bfa33,'request\x20sent');_0x3904f4(_0x3278b2[_0x7b1f('0x15')][_0x7b1f('0x14')]);}})[_0x7b1f('0x16')](function(_0x176bc8){logger[_0x7b1f('0x12')]('Automation,\x20%s,\x20%s',_0x2bfa33,_0x176bc8);_0x17c587(_0x176bc8);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 0855455..b0ab233 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 _0x84ec=['/:id/actions','getActions','post','create','addConditions','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','/:id','show','/:id/conditions'];(function(_0x36cd80,_0x41e617){var _0x3ac5a1=function(_0x2c06b2){while(--_0x2c06b2){_0x36cd80['push'](_0x36cd80['shift']());}};_0x3ac5a1(++_0x41e617);}(_0x84ec,0xe4));var _0xc84e=function(_0x8199b8,_0x124bbe){_0x8199b8=_0x8199b8-0x0;var _0x2a3185=_0x84ec[_0x8199b8];return _0x2a3185;};'use strict';var multer=require(_0xc84e('0x0'));var util=require(_0xc84e('0x1'));var path=require(_0xc84e('0x2'));var timeout=require(_0xc84e('0x3'));var express=require('express');var router=express[_0xc84e('0x4')]();var fs_extra=require(_0xc84e('0x5'));var auth=require(_0xc84e('0x6'));var interaction=require(_0xc84e('0x7'));var config=require('../../config/environment');var controller=require(_0xc84e('0x8'));router[_0xc84e('0x9')]('/',auth[_0xc84e('0xa')](),controller['index']);router[_0xc84e('0x9')](_0xc84e('0xb'),auth[_0xc84e('0xa')](),controller[_0xc84e('0xc')]);router[_0xc84e('0x9')](_0xc84e('0xd'),auth['isAuthenticated'](),controller['getConditions']);router['get'](_0xc84e('0xe'),auth[_0xc84e('0xa')](),controller[_0xc84e('0xf')]);router[_0xc84e('0x10')]('/',auth['isAuthenticated'](),controller[_0xc84e('0x11')]);router[_0xc84e('0x10')](_0xc84e('0xd'),auth['isAuthenticated'](),controller[_0xc84e('0x12')]);router[_0xc84e('0x10')](_0xc84e('0xe'),auth[_0xc84e('0xa')](),controller['addActions']);router[_0xc84e('0x13')](_0xc84e('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xc84e('0x14')](_0xc84e('0xb'),auth[_0xc84e('0xa')](),controller[_0xc84e('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x8073=['../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','show','/:id/conditions','isAuthenticated','getConditions','/:id/actions','getActions','post','create','addActions','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x12e306,_0x2f0806){var _0x4c8b1e=function(_0x8765fd){while(--_0x8765fd){_0x12e306['push'](_0x12e306['shift']());}};_0x4c8b1e(++_0x2f0806);}(_0x8073,0x7c));var _0x3807=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x8073[_0x42245d];return _0x4b211a;};'use strict';var multer=require('multer');var util=require(_0x3807('0x0'));var path=require(_0x3807('0x1'));var timeout=require(_0x3807('0x2'));var express=require(_0x3807('0x3'));var router=express['Router']();var fs_extra=require(_0x3807('0x4'));var auth=require(_0x3807('0x5'));var interaction=require(_0x3807('0x6'));var config=require(_0x3807('0x7'));var controller=require(_0x3807('0x8'));router[_0x3807('0x9')]('/',auth['isAuthenticated'](),controller[_0x3807('0xa')]);router[_0x3807('0x9')](_0x3807('0xb'),auth['isAuthenticated'](),controller[_0x3807('0xc')]);router[_0x3807('0x9')](_0x3807('0xd'),auth[_0x3807('0xe')](),controller[_0x3807('0xf')]);router['get'](_0x3807('0x10'),auth[_0x3807('0xe')](),controller[_0x3807('0x11')]);router[_0x3807('0x12')]('/',auth[_0x3807('0xe')](),controller[_0x3807('0x13')]);router[_0x3807('0x12')](_0x3807('0xd'),auth[_0x3807('0xe')](),controller['addConditions']);router[_0x3807('0x12')](_0x3807('0x10'),auth[_0x3807('0xe')](),controller[_0x3807('0x14')]);router[_0x3807('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x3807('0x16')]);router[_0x3807('0x17')](_0x3807('0xb'),auth[_0x3807('0xe')](),controller[_0x3807('0x18')]);module[_0x3807('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 223dde9..c9d4556 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 _0x517c=['never','onlyIfOpen','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','STRING','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always'];(function(_0x7eecb4,_0x38dbc7){var _0x10bddf=function(_0x539133){while(--_0x539133){_0x7eecb4['push'](_0x7eecb4['shift']());}};_0x10bddf(++_0x38dbc7);}(_0x517c,0x187));var _0xc517=function(_0x313903,_0x338dc6){_0x313903=_0x313903-0x0;var _0x4c6d4b=_0x517c[_0x313903];return _0x4c6d4b;};'use strict';var Sequelize=require(_0xc517('0x0'));module[_0xc517('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc517('0x2')]('ivr'),'allowNull':![],'defaultValue':_0xc517('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xc517('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xc517('0x5')](0x4)[_0xc517('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc517('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc517('0x8')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xc517('0x5')](0x3)[_0xc517('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xc517('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc517('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc517('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xc517('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc517('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc517('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc517('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc517('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xc517('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc517('0x5')](0x5)[_0xc517('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc517('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc517('0x5')](0x3)[_0xc517('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc517('0xe')},'dialTimezone':{'type':Sequelize[_0xc517('0x8')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xc517('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xc517('0x2')](_0xc517('0x10'),_0xc517('0x11'),_0xc517('0x12')),'defaultValue':_0xc517('0x10')},'dialAMDActive':{'type':Sequelize[_0xc517('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xc517('0x5')](0x9)[_0xc517('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xc517('0x5')](0x9)[_0xc517('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc517('0x5')](0x9)[_0xc517('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc517('0x5')](0x9)[_0xc517('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xc517('0x5')](0x9)[_0xc517('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc517('0x5')](0x9)[_0xc517('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc517('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc517('0x5')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc517('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc517('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc517('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc517('0x5')](0x9)[_0xc517('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xc517('0x2')](_0xc517('0x16'),_0xc517('0x17')),'defaultValue':_0xc517('0x16')},'dialPrefix':{'type':Sequelize[_0xc517('0x8')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc517('0x5')](0x3)[_0xc517('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc517('0x18')},'dialCutDigit':{'type':Sequelize[_0xc517('0x5')](0x3)[_0xc517('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc517('0x5')](0x3)[_0xc517('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc517('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc517('0x5')](0x5)[_0xc517('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc517('0x1a')},'dialDropMaxRetry':{'type':Sequelize[_0xc517('0x5')](0x3)[_0xc517('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc517('0x1b')},'dialDropRetryFrequency':{'type':Sequelize[_0xc517('0x5')](0x5)[_0xc517('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc517('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc517('0x5')](0x3)[_0xc517('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc517('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc517('0x5')](0x5)[_0xc517('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc517('0x1e')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc517('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc517('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc517('0x5')](0x5)[_0xc517('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc517('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc517('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc517('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc517('0x5')](0x5)[_0xc517('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x0721=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)'];(function(_0x3c5d8c,_0x1c7b6c){var _0x5e382a=function(_0x54b058){while(--_0x54b058){_0x3c5d8c['push'](_0x3c5d8c['shift']());}};_0x5e382a(++_0x1c7b6c);}(_0x0721,0x9d));var _0x1072=function(_0x42b8f5,_0x4b9730){_0x42b8f5=_0x42b8f5-0x0;var _0x31ca50=_0x0721[_0x42b8f5];return _0x31ca50;};'use strict';var Sequelize=require('sequelize');module[_0x1072('0x0')]={'name':{'type':Sequelize[_0x1072('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1072('0x2')](_0x1072('0x3')),'allowNull':![],'defaultValue':_0x1072('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x1072('0x4')],'defaultValue':0x0,'comment':_0x1072('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x1072('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1072('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1072('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1072('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1072('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1072('0x8')](0x3)[_0x1072('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1072('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1072('0x8')](0x5)[_0x1072('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1072('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x1072('0x8')](0x3)[_0x1072('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1072('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1072('0x8')](0x5)[_0x1072('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1072('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1072('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x1072('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1072('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1072('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1072('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1072('0xf')},'dialTimezone':{'type':Sequelize[_0x1072('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1072('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x1072('0x2')]('always',_0x1072('0x10'),_0x1072('0x11')),'defaultValue':_0x1072('0x12')},'dialAMDActive':{'type':Sequelize[_0x1072('0x4')],'defaultValue':0x0,'comment':_0x1072('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x1072('0x8')](0x9)[_0x1072('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1072('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x1072('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1072('0x8')](0x9)[_0x1072('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1072('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1072('0x8')](0x9)[_0x1072('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1072('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x1072('0x8')](0x9)[_0x1072('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1072('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1072('0x8')](0x9)[_0x1072('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1072('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1072('0x8')](0x5)[_0x1072('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1072('0x8')](0x9)[_0x1072('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1072('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1072('0x2')](_0x1072('0x1a'),_0x1072('0x1b')),'defaultValue':_0x1072('0x1a')},'dialPrefix':{'type':Sequelize[_0x1072('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1072('0x8')](0x3)[_0x1072('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1072('0x1c')},'dialCutDigit':{'type':Sequelize[_0x1072('0x8')](0x3)[_0x1072('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1072('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1072('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1072('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1072('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x1072('0x8')](0x3)[_0x1072('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1072('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x1072('0x8')](0x5)[_0x1072('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1072('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1072('0x8')](0x3)[_0x1072('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1072('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1072('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1072('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x1072('0x8')](0x3)[_0x1072('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1072('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1072('0x8')](0x5)[_0x1072('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1072('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1072('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1072('0x8')](0x5)[_0x1072('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1072('0x26')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 4de41c4..10118e2 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 _0xdca3=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','order','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','NOW()','field','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','cm_contacts','COALESCE(phone,\x27\x27)','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','fieldName','key','model','query'];(function(_0x4987ca,_0x521560){var _0x18dca4=function(_0x9a579f){while(--_0x9a579f){_0x4987ca['push'](_0x4987ca['shift']());}};_0x18dca4(++_0x521560);}(_0xdca3,0x64));var _0x3dca=function(_0x2a69c3,_0x2ac376){_0x2a69c3=_0x2a69c3-0x0;var _0x5eb837=_0xdca3[_0x2a69c3];return _0x5eb837;};'use strict';var emlformat=require(_0x3dca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3dca('0x1'));var jsonpatch=require(_0x3dca('0x2'));var rp=require(_0x3dca('0x3'));var moment=require(_0x3dca('0x4'));var BPromise=require(_0x3dca('0x5'));var Mustache=require(_0x3dca('0x6'));var util=require(_0x3dca('0x7'));var path=require(_0x3dca('0x8'));var sox=require(_0x3dca('0x9'));var csv=require(_0x3dca('0xa'));var ejs=require(_0x3dca('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3dca('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3dca('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3dca('0xa'));var querystring=require(_0x3dca('0xe'));var Papa=require(_0x3dca('0xf'));var Redis=require(_0x3dca('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3dca('0x11'));var as=require(_0x3dca('0x12'));var hardwareService=require(_0x3dca('0x13'));var logger=require(_0x3dca('0x14'))(_0x3dca('0x15'));var utils=require(_0x3dca('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3dca('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bfeda,_0x24c6c9){_0x24c6c9=_0x24c6c9||0xcc;return function(_0x11f54e){if(_0x11f54e){return _0x5bfeda[_0x3dca('0x18')](_0x24c6c9);}return _0x5bfeda[_0x3dca('0x19')](_0x24c6c9)[_0x3dca('0x1a')]();};}function respondWithResult(_0x344892,_0xa4149a){_0xa4149a=_0xa4149a||0xc8;return function(_0xf1350d){if(_0xf1350d){return _0x344892[_0x3dca('0x19')](_0xa4149a)[_0x3dca('0x1b')](_0xf1350d);}};}function respondWithFilteredResult(_0x3d1154,_0x911042){return function(_0x1b5906){if(_0x1b5906){var _0x5dc428=typeof _0x911042['offset']===_0x3dca('0x1c')&&typeof _0x911042[_0x3dca('0x1d')]===_0x3dca('0x1c');var _0x1a4ee=_0x1b5906[_0x3dca('0x1e')];var _0x8c046c=_0x5dc428?0x0:_0x911042['offset'];var _0x3a16b4=_0x5dc428?_0x1b5906[_0x3dca('0x1e')]:_0x911042[_0x3dca('0x1f')]+_0x911042[_0x3dca('0x1d')];var _0x4a3cd1;if(_0x3a16b4>=_0x1a4ee){_0x3a16b4=_0x1a4ee;_0x4a3cd1=0xc8;}else{_0x4a3cd1=0xce;}_0x3d1154[_0x3dca('0x19')](_0x4a3cd1);return _0x3d1154[_0x3dca('0x20')](_0x3dca('0x21'),_0x8c046c+'-'+_0x3a16b4+'/'+_0x1a4ee)['json'](_0x1b5906);}return null;};}function patchUpdates(_0x501201){return function(_0x4399ba){try{jsonpatch['apply'](_0x4399ba,_0x501201,!![]);}catch(_0x5f1ad3){return BPromise[_0x3dca('0x22')](_0x5f1ad3);}return _0x4399ba['save']();};}function saveUpdates(_0x4316b7,_0x592459){return function(_0x5b0dee){if(_0x5b0dee){return _0x5b0dee[_0x3dca('0x23')](_0x4316b7)[_0x3dca('0x24')](function(_0x439b6a){return _0x439b6a;});}return null;};}function removeEntity(_0x25f8e7,_0x59be49){return function(_0x18a452){if(_0x18a452){return _0x18a452[_0x3dca('0x25')]()[_0x3dca('0x24')](function(){var _0x4ab095=_0x18a452[_0x3dca('0x26')]({'plain':!![]});var _0x3148ce='IvrCampaigns';return db[_0x3dca('0x27')][_0x3dca('0x25')]({'where':{'type':_0x3148ce,'resourceId':_0x4ab095['id']}})[_0x3dca('0x24')](function(){return _0x18a452;});})[_0x3dca('0x24')](function(){_0x25f8e7[_0x3dca('0x19')](0xcc)[_0x3dca('0x1a')]();});}};}function handleEntityNotFound(_0x212be2,_0x218a56){return function(_0x21973a){if(!_0x21973a){_0x212be2[_0x3dca('0x18')](0x194);}return _0x21973a;};}function handleError(_0x1e277f,_0x225a40){_0x225a40=_0x225a40||0x1f4;return function(_0xa14500){logger[_0x3dca('0x28')](_0xa14500[_0x3dca('0x29')]);if(_0xa14500[_0x3dca('0x2a')]){delete _0xa14500[_0x3dca('0x2a')];}_0x1e277f[_0x3dca('0x19')](_0x225a40)[_0x3dca('0x2b')](_0xa14500);};}exports['index']=function(_0x2cddce,_0x3f064a){var _0x424c41={},_0x2b07c4={},_0x420367={'count':0x0,'rows':[]};var _0x45f346=_[_0x3dca('0x2c')](db['Campaign']['rawAttributes'],function(_0x59b102){return{'name':_0x59b102[_0x3dca('0x2d')],'type':_0x59b102['type'][_0x3dca('0x2e')]};});_0x2b07c4[_0x3dca('0x2f')]=_[_0x3dca('0x2c')](_0x45f346,_0x3dca('0x2a'));_0x2b07c4[_0x3dca('0x30')]=_[_0x3dca('0x31')](_0x2cddce[_0x3dca('0x30')]);_0x2b07c4[_0x3dca('0x32')]=_[_0x3dca('0x33')](_0x2b07c4[_0x3dca('0x2f')],_0x2b07c4[_0x3dca('0x30')]);_0x424c41['attributes']=_[_0x3dca('0x33')](_0x2b07c4[_0x3dca('0x2f')],qs[_0x3dca('0x34')](_0x2cddce[_0x3dca('0x30')]['fields']));_0x424c41[_0x3dca('0x35')]=_0x424c41['attributes'][_0x3dca('0x36')]?_0x424c41[_0x3dca('0x35')]:_0x2b07c4[_0x3dca('0x2f')];if(!_0x2cddce[_0x3dca('0x30')][_0x3dca('0x37')](_0x3dca('0x38'))){_0x424c41[_0x3dca('0x1d')]=qs['limit'](_0x2cddce[_0x3dca('0x30')][_0x3dca('0x1d')]);_0x424c41[_0x3dca('0x1f')]=qs[_0x3dca('0x1f')](_0x2cddce[_0x3dca('0x30')][_0x3dca('0x1f')]);}_0x424c41['order']=qs[_0x3dca('0x39')](_0x2cddce[_0x3dca('0x30')][_0x3dca('0x39')]);_0x424c41[_0x3dca('0x3a')]=qs[_0x3dca('0x32')](_[_0x3dca('0x3b')](_0x2cddce['query'],_0x2b07c4[_0x3dca('0x32')]),_0x45f346);if(_0x2cddce[_0x3dca('0x30')][_0x3dca('0x3c')]){_0x424c41[_0x3dca('0x3a')]=_[_0x3dca('0x3d')](_0x424c41[_0x3dca('0x3a')],{'$or':_[_0x3dca('0x2c')](_0x45f346,function(_0xa20ef4){if(_0xa20ef4[_0x3dca('0x3e')]!==_0x3dca('0x3f')){var _0x232b77={};_0x232b77[_0xa20ef4[_0x3dca('0x2a')]]={'$like':'%'+_0x2cddce[_0x3dca('0x30')][_0x3dca('0x3c')]+'%'};return _0x232b77;}})});}_0x424c41=_[_0x3dca('0x3d')]({},_0x424c41,_0x2cddce[_0x3dca('0x40')]);var _0x27e241={'where':_0x424c41['where']};return db[_0x3dca('0x41')][_0x3dca('0x1e')](_0x27e241)['then'](function(_0x184588){_0x420367[_0x3dca('0x1e')]=_0x184588;if(_0x2cddce[_0x3dca('0x30')][_0x3dca('0x42')]){_0x424c41[_0x3dca('0x43')]=[{'all':!![]}];}return db[_0x3dca('0x41')][_0x3dca('0x44')](_0x424c41);})[_0x3dca('0x24')](function(_0x299567){_0x420367[_0x3dca('0x45')]=_0x299567;return _0x420367;})['then'](respondWithFilteredResult(_0x3f064a,_0x424c41))[_0x3dca('0x46')](handleError(_0x3f064a,null));};exports[_0x3dca('0x47')]=function(_0x3d9c9c,_0x4060ab){var _0x1f9012={'raw':![],'where':{'id':_0x3d9c9c[_0x3dca('0x48')]['id']}},_0x57b2e7={};_0x57b2e7['model']=_['keys'](db['Campaign']['rawAttributes']);_0x57b2e7[_0x3dca('0x30')]=_[_0x3dca('0x31')](_0x3d9c9c[_0x3dca('0x30')]);_0x57b2e7[_0x3dca('0x32')]=_['intersection'](_0x57b2e7[_0x3dca('0x2f')],_0x57b2e7[_0x3dca('0x30')]);_0x1f9012[_0x3dca('0x35')]=_[_0x3dca('0x33')](_0x57b2e7['model'],qs[_0x3dca('0x34')](_0x3d9c9c[_0x3dca('0x30')][_0x3dca('0x34')]));_0x1f9012['attributes']=_0x1f9012[_0x3dca('0x35')][_0x3dca('0x36')]?_0x1f9012[_0x3dca('0x35')]:_0x57b2e7[_0x3dca('0x2f')];if(_0x3d9c9c[_0x3dca('0x30')][_0x3dca('0x42')]){_0x1f9012[_0x3dca('0x43')]=[{'all':!![]}];}_0x1f9012=_['merge']({},_0x1f9012,_0x3d9c9c['options']);return db['Campaign']['find'](_0x1f9012)[_0x3dca('0x24')](handleEntityNotFound(_0x4060ab,null))[_0x3dca('0x24')](respondWithResult(_0x4060ab,null))[_0x3dca('0x46')](handleError(_0x4060ab,null));};exports[_0x3dca('0x49')]=function(_0x1ea5ac,_0x5af8cd){return db[_0x3dca('0x41')][_0x3dca('0x49')](_0x1ea5ac[_0x3dca('0x4a')],{})[_0x3dca('0x24')](function(_0x4252b6){var _0x3fe52f=_0x1ea5ac[_0x3dca('0x4b')][_0x3dca('0x26')]({'plain':!![]});if(!_0x3fe52f)throw new Error(_0x3dca('0x4c'));if(_0x3fe52f[_0x3dca('0x4d')]==='user'){var _0x212544=_0x4252b6[_0x3dca('0x26')]({'plain':!![]});var _0x1c1ef9=_0x3dca('0x4e');return db[_0x3dca('0x4f')][_0x3dca('0x50')]({'where':{'name':_0x1c1ef9,'userProfileId':_0x3fe52f[_0x3dca('0x51')]},'raw':!![]})[_0x3dca('0x24')](function(_0x31831f){if(_0x31831f&&_0x31831f[_0x3dca('0x52')]===0x0){return db['UserProfileResource'][_0x3dca('0x49')]({'name':_0x212544[_0x3dca('0x2a')],'resourceId':_0x212544['id'],'type':_0x31831f[_0x3dca('0x2a')],'sectionId':_0x31831f['id']},{})[_0x3dca('0x24')](function(){return _0x4252b6;});}else{return _0x4252b6;}})[_0x3dca('0x46')](function(_0x24d58f){logger['error'](_0x3dca('0x53'),_0x24d58f);throw _0x24d58f;});}return _0x4252b6;})[_0x3dca('0x24')](respondWithResult(_0x5af8cd,0xc9))['catch'](handleError(_0x5af8cd,null));};exports[_0x3dca('0x54')]=function(_0x32f3f1,_0x5ee396){var _0x47ab1e={'where':{'id':_0x32f3f1[_0x3dca('0x48')]['id']}},_0x5ad335={};_0x5ad335[_0x3dca('0x2f')]=_[_0x3dca('0x31')](db[_0x3dca('0x41')][_0x3dca('0x55')]);_0x47ab1e[_0x3dca('0x35')]=_[_0x3dca('0x33')](_0x5ad335[_0x3dca('0x2f')],qs['fields'](_0x32f3f1[_0x3dca('0x30')][_0x3dca('0x34')]));_0x47ab1e[_0x3dca('0x35')]=_0x47ab1e[_0x3dca('0x35')][_0x3dca('0x36')]?_0x47ab1e[_0x3dca('0x35')]:_0x5ad335['model'];if(_0x32f3f1[_0x3dca('0x30')][_0x3dca('0x42')]){_0x47ab1e[_0x3dca('0x43')]=[{'all':!![]}];}_0x47ab1e=_[_0x3dca('0x3d')]({},_0x47ab1e,_0x32f3f1[_0x3dca('0x40')]);return db[_0x3dca('0x41')][_0x3dca('0x50')](_0x47ab1e)[_0x3dca('0x24')](handleEntityNotFound(_0x5ee396,null))[_0x3dca('0x24')](function(_0x380cd9){if(_0x380cd9){var _0x2d100e=_0x380cd9[_0x3dca('0x26')]({'plain':!![]});_0x2d100e=qs[_0x3dca('0x56')](_0x2d100e,['id','createdAt','updatedAt']);_0x32f3f1['body']=_[_0x3dca('0x56')](_0x32f3f1[_0x3dca('0x4a')],['id',_0x3dca('0x57'),_0x3dca('0x58')]);return db[_0x3dca('0x41')][_0x3dca('0x49')](_[_0x3dca('0x3d')](_0x2d100e,_0x32f3f1[_0x3dca('0x4a')]),{'include':_0x32f3f1[_0x3dca('0x30')][_0x3dca('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x2063a4){var _0x468a9b=_0x32f3f1[_0x3dca('0x4b')][_0x3dca('0x26')]({'plain':!![]});if(!_0x468a9b)throw new Error(_0x3dca('0x4c'));if(_0x468a9b[_0x3dca('0x4d')]===_0x3dca('0x4b')){var _0x45e010=_0x2063a4[_0x3dca('0x26')]({'plain':!![]});var _0xf14197=_0x3dca('0x4e');return db[_0x3dca('0x4f')][_0x3dca('0x50')]({'where':{'name':_0xf14197,'userProfileId':_0x468a9b[_0x3dca('0x51')]},'raw':!![]})['then'](function(_0x40e717){if(_0x40e717&&_0x40e717['autoAssociation']===0x0){return db[_0x3dca('0x27')]['create']({'name':_0x45e010['name'],'resourceId':_0x45e010['id'],'type':_0x40e717[_0x3dca('0x2a')],'sectionId':_0x40e717['id']},{})['then'](function(){return _0x2063a4;});}else{return _0x2063a4;}})[_0x3dca('0x46')](function(_0x2f4189){logger[_0x3dca('0x28')](_0x3dca('0x53'),_0x2f4189);throw _0x2f4189;});}return _0x2063a4;});}})['then'](respondWithResult(_0x5ee396,0xc9))[_0x3dca('0x46')](handleError(_0x5ee396,null));};exports[_0x3dca('0x23')]=function(_0x51c7ec,_0x53aacf){if(_0x51c7ec['body']['id']){delete _0x51c7ec[_0x3dca('0x4a')]['id'];}return db[_0x3dca('0x41')][_0x3dca('0x50')]({'where':{'id':_0x51c7ec[_0x3dca('0x48')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x53aacf,null))[_0x3dca('0x24')](saveUpdates(_0x51c7ec['body'],null))[_0x3dca('0x24')](respondWithResult(_0x53aacf,null))[_0x3dca('0x46')](handleError(_0x53aacf,null));};exports['destroy']=function(_0x4af7c4,_0x25cd75){return db[_0x3dca('0x41')][_0x3dca('0x50')]({'where':{'id':_0x4af7c4[_0x3dca('0x48')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x25cd75,null))[_0x3dca('0x24')](removeEntity(_0x25cd75,null))[_0x3dca('0x46')](handleError(_0x25cd75,null));};exports[_0x3dca('0x59')]=function(_0x2020a3,_0x40551d,_0xf4c30){var _0x2a5b45={'raw':!![],'where':{}};var _0x450c8b={};var _0x44f216={'count':0x0,'rows':[]};return db['Campaign'][_0x3dca('0x5a')]({'where':{'id':_0x2020a3[_0x3dca('0x48')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x40551d,null))['then'](function(_0x104a0e){if(_0x104a0e){_0x450c8b['model']=_[_0x3dca('0x31')](db[_0x3dca('0x5b')][_0x3dca('0x55')]);_0x450c8b[_0x3dca('0x30')]=_[_0x3dca('0x31')](_0x2020a3['query']);_0x450c8b[_0x3dca('0x32')]=_[_0x3dca('0x33')](_0x450c8b[_0x3dca('0x2f')],_0x450c8b[_0x3dca('0x30')]);_0x2a5b45[_0x3dca('0x35')]=_['intersection'](_0x450c8b[_0x3dca('0x2f')],qs['fields'](_0x2020a3[_0x3dca('0x30')][_0x3dca('0x34')]));_0x2a5b45[_0x3dca('0x35')]=_0x2a5b45[_0x3dca('0x35')][_0x3dca('0x36')]?_0x2a5b45[_0x3dca('0x35')]:_0x450c8b[_0x3dca('0x2f')];if(!_0x2020a3['query']['hasOwnProperty'](_0x3dca('0x38'))){_0x2a5b45[_0x3dca('0x1d')]=qs[_0x3dca('0x1d')](_0x2020a3[_0x3dca('0x30')][_0x3dca('0x1d')]);_0x2a5b45[_0x3dca('0x1f')]=qs['offset'](_0x2020a3['query'][_0x3dca('0x1f')]);}_0x2a5b45[_0x3dca('0x5c')]=qs[_0x3dca('0x39')](_0x2020a3[_0x3dca('0x30')][_0x3dca('0x39')]);_0x2a5b45[_0x3dca('0x3a')]=qs['filters'](_[_0x3dca('0x3b')](_0x2020a3['query'],_0x450c8b['filters']));_0x2a5b45[_0x3dca('0x3a')][_0x3dca('0x5d')]=_0x104a0e['id'];if(_0x2020a3[_0x3dca('0x30')][_0x3dca('0x3c')]){_0x2a5b45[_0x3dca('0x3a')]=_[_0x3dca('0x3d')](_0x2a5b45[_0x3dca('0x3a')],{'$or':_['map'](_0x2a5b45['attributes'],function(_0x4fe483){var _0x3dfae0={};_0x3dfae0[_0x4fe483]={'$like':'%'+_0x2020a3[_0x3dca('0x30')][_0x3dca('0x3c')]+'%'};return _0x3dfae0;})});}_0x2a5b45=_[_0x3dca('0x3d')]({},_0x2a5b45,_0x2020a3[_0x3dca('0x40')]);return db[_0x3dca('0x5b')][_0x3dca('0x1e')]({'where':_0x2a5b45[_0x3dca('0x3a')]})[_0x3dca('0x24')](function(_0x2acdbd){_0x44f216[_0x3dca('0x1e')]=_0x2acdbd;if(_0x2020a3['query'][_0x3dca('0x42')]){_0x2a5b45[_0x3dca('0x43')]=[{'all':!![]}];}return db[_0x3dca('0x5b')][_0x3dca('0x44')](_0x2a5b45);})[_0x3dca('0x24')](function(_0x5650f7){_0x44f216[_0x3dca('0x45')]=_0x5650f7;return _0x44f216;});}})[_0x3dca('0x24')](respondWithFilteredResult(_0x40551d,_0x2a5b45))[_0x3dca('0x46')](handleError(_0x40551d,null));};exports[_0x3dca('0x5e')]=function(_0x298b94,_0x5647eb,_0x109dbf){var _0x2f631d={'raw':!![],'where':{}};var _0x1f3390={};var _0x16f946={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x298b94['params']['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x5647eb,null))[_0x3dca('0x24')](function(_0x6b6b41){if(_0x6b6b41){_0x1f3390['model']=_[_0x3dca('0x31')](db[_0x3dca('0x5f')][_0x3dca('0x55')]);_0x1f3390[_0x3dca('0x30')]=_[_0x3dca('0x31')](_0x298b94[_0x3dca('0x30')]);_0x1f3390[_0x3dca('0x32')]=_[_0x3dca('0x33')](_0x1f3390[_0x3dca('0x2f')],_0x1f3390[_0x3dca('0x30')]);_0x2f631d['attributes']=_[_0x3dca('0x33')](_0x1f3390[_0x3dca('0x2f')],qs[_0x3dca('0x34')](_0x298b94[_0x3dca('0x30')][_0x3dca('0x34')]));_0x2f631d['attributes']=_0x2f631d[_0x3dca('0x35')][_0x3dca('0x36')]?_0x2f631d[_0x3dca('0x35')]:_0x1f3390[_0x3dca('0x2f')];if(!_0x298b94['query'][_0x3dca('0x37')](_0x3dca('0x38'))){_0x2f631d[_0x3dca('0x1d')]=qs[_0x3dca('0x1d')](_0x298b94[_0x3dca('0x30')][_0x3dca('0x1d')]);_0x2f631d[_0x3dca('0x1f')]=qs[_0x3dca('0x1f')](_0x298b94[_0x3dca('0x30')]['offset']);}_0x2f631d['order']=qs[_0x3dca('0x39')](_0x298b94[_0x3dca('0x30')][_0x3dca('0x39')]);_0x2f631d[_0x3dca('0x3a')]=qs['filters'](_[_0x3dca('0x3b')](_0x298b94[_0x3dca('0x30')],_0x1f3390['filters']));_0x2f631d[_0x3dca('0x3a')][_0x3dca('0x5d')]=_0x6b6b41['id'];if(_0x298b94[_0x3dca('0x30')][_0x3dca('0x3c')]){_0x2f631d[_0x3dca('0x3a')]=_[_0x3dca('0x3d')](_0x2f631d[_0x3dca('0x3a')],{'$or':_[_0x3dca('0x2c')](_0x2f631d['attributes'],function(_0x2ded82){var _0x510b21={};_0x510b21[_0x2ded82]={'$like':'%'+_0x298b94[_0x3dca('0x30')][_0x3dca('0x3c')]+'%'};return _0x510b21;})});}_0x2f631d=_[_0x3dca('0x3d')]({},_0x2f631d,_0x298b94[_0x3dca('0x40')]);return db['CmHopperHistory'][_0x3dca('0x1e')]({'where':_0x2f631d['where']})[_0x3dca('0x24')](function(_0x933518){_0x16f946[_0x3dca('0x1e')]=_0x933518;if(_0x298b94[_0x3dca('0x30')][_0x3dca('0x42')]){_0x2f631d[_0x3dca('0x43')]=[{'all':!![]}];}return db[_0x3dca('0x5f')][_0x3dca('0x44')](_0x2f631d);})[_0x3dca('0x24')](function(_0x659e94){_0x16f946['rows']=_0x659e94;return _0x16f946;});}})['then'](respondWithFilteredResult(_0x5647eb,_0x2f631d))[_0x3dca('0x46')](handleError(_0x5647eb,null));};exports[_0x3dca('0x60')]=function(_0x57dd8b,_0x4fd410,_0x18d6c1){var _0x4688cf={'raw':!![],'where':{}};var _0x22bd9e={};var _0x1b354d={'count':0x0,'rows':[]};return db[_0x3dca('0x41')][_0x3dca('0x5a')]({'where':{'id':_0x57dd8b['params']['id']}})['then'](handleEntityNotFound(_0x4fd410,null))[_0x3dca('0x24')](function(_0x116ca9){if(_0x116ca9){_0x22bd9e[_0x3dca('0x2f')]=_[_0x3dca('0x31')](db[_0x3dca('0x61')][_0x3dca('0x55')]);_0x22bd9e['query']=_[_0x3dca('0x31')](_0x57dd8b[_0x3dca('0x30')]);_0x22bd9e[_0x3dca('0x32')]=_[_0x3dca('0x33')](_0x22bd9e[_0x3dca('0x2f')],_0x22bd9e[_0x3dca('0x30')]);_0x4688cf[_0x3dca('0x35')]=_['intersection'](_0x22bd9e['model'],qs[_0x3dca('0x34')](_0x57dd8b[_0x3dca('0x30')][_0x3dca('0x34')]));_0x4688cf[_0x3dca('0x35')]=_0x4688cf[_0x3dca('0x35')][_0x3dca('0x36')]?_0x4688cf[_0x3dca('0x35')]:_0x22bd9e[_0x3dca('0x2f')];if(!_0x57dd8b[_0x3dca('0x30')][_0x3dca('0x37')](_0x3dca('0x38'))){_0x4688cf[_0x3dca('0x1d')]=qs[_0x3dca('0x1d')](_0x57dd8b['query']['limit']);_0x4688cf[_0x3dca('0x1f')]=qs[_0x3dca('0x1f')](_0x57dd8b[_0x3dca('0x30')][_0x3dca('0x1f')]);}_0x4688cf[_0x3dca('0x5c')]=qs['sort'](_0x57dd8b[_0x3dca('0x30')][_0x3dca('0x39')]);_0x4688cf[_0x3dca('0x3a')]=qs[_0x3dca('0x32')](_[_0x3dca('0x3b')](_0x57dd8b[_0x3dca('0x30')],_0x22bd9e[_0x3dca('0x32')]));_0x4688cf['where']['CampaignId']=_0x116ca9['id'];if(_0x57dd8b[_0x3dca('0x30')][_0x3dca('0x3c')]){_0x4688cf[_0x3dca('0x3a')]=_[_0x3dca('0x3d')](_0x4688cf['where'],{'$or':_[_0x3dca('0x2c')](_0x4688cf['attributes'],function(_0x5d1361){var _0x5dc558={};_0x5dc558[_0x5d1361]={'$like':'%'+_0x57dd8b[_0x3dca('0x30')][_0x3dca('0x3c')]+'%'};return _0x5dc558;})});}_0x4688cf=_['merge']({},_0x4688cf,_0x57dd8b[_0x3dca('0x40')]);return db[_0x3dca('0x61')][_0x3dca('0x1e')]({'where':_0x4688cf[_0x3dca('0x3a')]})['then'](function(_0x5069d7){_0x1b354d[_0x3dca('0x1e')]=_0x5069d7;if(_0x57dd8b[_0x3dca('0x30')][_0x3dca('0x42')]){_0x4688cf[_0x3dca('0x43')]=[{'all':!![]}];}return db[_0x3dca('0x61')][_0x3dca('0x44')](_0x4688cf);})[_0x3dca('0x24')](function(_0x5914d4){_0x1b354d[_0x3dca('0x45')]=_0x5914d4;return _0x1b354d;});}})['then'](respondWithFilteredResult(_0x4fd410,_0x4688cf))['catch'](handleError(_0x4fd410,null));};exports['getHopperBlacks']=function(_0x320c87,_0x5641fe,_0x4eb2ad){var _0x3b4b51={'raw':!![],'where':{}};var _0x2e8d04={};var _0x3289e8={'count':0x0,'rows':[]};return db['Campaign'][_0x3dca('0x5a')]({'where':{'id':_0x320c87[_0x3dca('0x48')]['id']}})['then'](handleEntityNotFound(_0x5641fe,null))['then'](function(_0x4325a7){if(_0x4325a7){_0x2e8d04[_0x3dca('0x2f')]=_['keys'](db['CmHopperBlack'][_0x3dca('0x55')]);_0x2e8d04['query']=_[_0x3dca('0x31')](_0x320c87[_0x3dca('0x30')]);_0x2e8d04[_0x3dca('0x32')]=_[_0x3dca('0x33')](_0x2e8d04['model'],_0x2e8d04['query']);_0x3b4b51[_0x3dca('0x35')]=_['intersection'](_0x2e8d04[_0x3dca('0x2f')],qs[_0x3dca('0x34')](_0x320c87[_0x3dca('0x30')]['fields']));_0x3b4b51['attributes']=_0x3b4b51['attributes'][_0x3dca('0x36')]?_0x3b4b51[_0x3dca('0x35')]:_0x2e8d04[_0x3dca('0x2f')];if(!_0x320c87['query']['hasOwnProperty']('nolimit')){_0x3b4b51[_0x3dca('0x1d')]=qs[_0x3dca('0x1d')](_0x320c87[_0x3dca('0x30')][_0x3dca('0x1d')]);_0x3b4b51[_0x3dca('0x1f')]=qs[_0x3dca('0x1f')](_0x320c87[_0x3dca('0x30')][_0x3dca('0x1f')]);}_0x3b4b51[_0x3dca('0x5c')]=qs['sort'](_0x320c87[_0x3dca('0x30')][_0x3dca('0x39')]);_0x3b4b51['where']=qs['filters'](_[_0x3dca('0x3b')](_0x320c87[_0x3dca('0x30')],_0x2e8d04[_0x3dca('0x32')]));_0x3b4b51[_0x3dca('0x3a')]['CampaignId']=_0x4325a7['id'];if(_0x320c87[_0x3dca('0x30')]['filter']){_0x3b4b51[_0x3dca('0x3a')]=_[_0x3dca('0x3d')](_0x3b4b51[_0x3dca('0x3a')],{'$or':_['map'](_0x3b4b51['attributes'],function(_0x450a14){var _0x347c36={};_0x347c36[_0x450a14]={'$like':'%'+_0x320c87[_0x3dca('0x30')][_0x3dca('0x3c')]+'%'};return _0x347c36;})});}_0x3b4b51=_[_0x3dca('0x3d')]({},_0x3b4b51,_0x320c87['options']);return db[_0x3dca('0x62')][_0x3dca('0x1e')]({'where':_0x3b4b51['where']})['then'](function(_0x1b927f){_0x3289e8[_0x3dca('0x1e')]=_0x1b927f;if(_0x320c87['query'][_0x3dca('0x42')]){_0x3b4b51[_0x3dca('0x43')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x3b4b51);})[_0x3dca('0x24')](function(_0x12fa9b){_0x3289e8['rows']=_0x12fa9b;return _0x3289e8;});}})[_0x3dca('0x24')](respondWithFilteredResult(_0x5641fe,_0x3b4b51))[_0x3dca('0x46')](handleError(_0x5641fe,null));};exports[_0x3dca('0x63')]=function(_0x1f4dde,_0x485c16,_0x2528b2){var _0x145094={};var _0x583668={};var _0x5b514f;var _0x480b1e;return db[_0x3dca('0x41')][_0x3dca('0x5a')]({'where':{'id':_0x1f4dde[_0x3dca('0x48')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x485c16,null))[_0x3dca('0x24')](function(_0xc1c26f){if(_0xc1c26f){_0x5b514f=_0xc1c26f;_0x583668[_0x3dca('0x2f')]=_[_0x3dca('0x31')](db[_0x3dca('0x64')][_0x3dca('0x55')]);_0x583668['query']=_['keys'](_0x1f4dde['query']);_0x583668[_0x3dca('0x32')]=_['intersection'](_0x583668['model'],_0x583668[_0x3dca('0x30')]);_0x145094['attributes']=_[_0x3dca('0x33')](_0x583668['model'],qs[_0x3dca('0x34')](_0x1f4dde[_0x3dca('0x30')]['fields']));_0x145094[_0x3dca('0x35')]=_0x145094[_0x3dca('0x35')][_0x3dca('0x36')]?_0x145094['attributes']:_0x583668[_0x3dca('0x2f')];_0x145094['order']=qs['sort'](_0x1f4dde['query'][_0x3dca('0x39')]);_0x145094[_0x3dca('0x3a')]=qs['filters'](_['pick'](_0x1f4dde['query'],_0x583668[_0x3dca('0x32')]));if(_0x1f4dde[_0x3dca('0x30')][_0x3dca('0x3c')]){_0x145094[_0x3dca('0x3a')]=_['merge'](_0x145094['where'],{'$or':_[_0x3dca('0x2c')](_0x145094[_0x3dca('0x35')],function(_0x9c01fc){var _0x428081={};_0x428081[_0x9c01fc]={'$like':'%'+_0x1f4dde[_0x3dca('0x30')]['filter']+'%'};return _0x428081;})});}_0x145094=_[_0x3dca('0x3d')]({},_0x145094,_0x1f4dde['options']);return _0x5b514f[_0x3dca('0x63')](_0x145094);}})['then'](function(_0x2e38d4){if(_0x2e38d4){_0x480b1e=_0x2e38d4[_0x3dca('0x36')];if(!_0x1f4dde['query'][_0x3dca('0x37')](_0x3dca('0x38'))){_0x145094[_0x3dca('0x1d')]=qs[_0x3dca('0x1d')](_0x1f4dde[_0x3dca('0x30')][_0x3dca('0x1d')]);_0x145094[_0x3dca('0x1f')]=qs['offset'](_0x1f4dde[_0x3dca('0x30')]['offset']);}return _0x5b514f[_0x3dca('0x63')](_0x145094);}})[_0x3dca('0x24')](function(_0x304e65){if(_0x304e65){return _0x304e65?{'count':_0x480b1e,'rows':_0x304e65}:null;}})['then'](respondWithResult(_0x485c16,null))[_0x3dca('0x46')](handleError(_0x485c16,null));};exports[_0x3dca('0x65')]=function(_0x2e4f2c,_0x460820,_0x240dd4){var _0xa2dca0,_0x1db782;var _0x155884=[];var _0x476188=moment()['format'](_0x3dca('0x66'));return db[_0x3dca('0x41')][_0x3dca('0x50')]({'where':{'id':_0x2e4f2c[_0x3dca('0x48')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x460820,null))[_0x3dca('0x24')](function(_0x5681e5){if(_0x5681e5){_0x1db782=_0x5681e5;return _0x5681e5[_0x3dca('0x65')](_0x2e4f2c[_0x3dca('0x4a')][_0x3dca('0x67')],_[_0x3dca('0x56')](_0x2e4f2c['body'],[_0x3dca('0x67'),'id'])||{});}return null;})[_0x3dca('0x68')](function(_0xa440c4){var _0x44f882;var _0x542293;_0xa2dca0=_0xa440c4||[];var _0x4f7768=[];if(_0xa440c4){for(var _0x34e4cb=0x0;_0x34e4cb<_0xa440c4['length'];_0x34e4cb+=0x1){var _0x592be8=_0xa440c4[_0x34e4cb][_0x3dca('0x26')]({'plain':!![]});_0x1db782[_0x3dca('0x69')]=_0x2e4f2c[_0x3dca('0x4a')][_0x3dca('0x69')]?_0x2e4f2c[_0x3dca('0x4a')][_0x3dca('0x69')]:_0x1db782['dialCheckDuplicateType'];switch(_0x1db782[_0x3dca('0x69')]){case _0x3dca('0x6a'):_0x44f882=squel[_0x3dca('0x6b')]()[_0x3dca('0x6c')](_0x3dca('0x6d'))['fromQuery']([_0x3dca('0x6e'),_0x3dca('0x6f'),_0x3dca('0x70'),_0x3dca('0x71'),_0x3dca('0x5d'),_0x3dca('0x57'),_0x3dca('0x58')],squel[_0x3dca('0x72')]()['field']('phone',_0x3dca('0x6e'))['field'](_0x3dca('0x73'),_0x3dca('0x6f'))[_0x3dca('0x74')]('id','ContactId')[_0x3dca('0x74')](_0x592be8[_0x3dca('0x75')]['toString'](),_0x3dca('0x71'))[_0x3dca('0x74')](_0x2e4f2c[_0x3dca('0x48')]['id'][_0x3dca('0x76')](),_0x3dca('0x5d'))['field']('\x27'+_0x476188+'\x27',_0x3dca('0x57'))[_0x3dca('0x74')]('\x27'+_0x476188+'\x27',_0x3dca('0x58'))[_0x3dca('0x77')]('cm_contacts')['where'](_0x3dca('0x78'))[_0x3dca('0x3a')](_0x3dca('0x79'),_0x592be8['CmListId'][_0x3dca('0x76')]())['where'](_0x3dca('0x7a'))[_0x3dca('0x3a')](_0x3dca('0x7b'),squel['select']()[_0x3dca('0x74')](_0x3dca('0x7c'))['from']('cm_hopper_final')[_0x3dca('0x3a')](_0x3dca('0x7d'),_0x2e4f2c[_0x3dca('0x48')]['id']['toString']()))[_0x3dca('0x3a')](_0x3dca('0x7b'),squel[_0x3dca('0x72')]()[_0x3dca('0x74')]('COALESCE(phone,\x27\x27)')[_0x3dca('0x77')](_0x3dca('0x6d'))[_0x3dca('0x3a')](_0x3dca('0x7d'),_0x2e4f2c[_0x3dca('0x48')]['id'][_0x3dca('0x76')]())))['toString']();break;case _0x3dca('0x7e'):_0x44f882=squel[_0x3dca('0x6b')]()[_0x3dca('0x6c')](_0x3dca('0x6d'))[_0x3dca('0x7f')](['phone',_0x3dca('0x6f'),_0x3dca('0x70'),_0x3dca('0x71'),_0x3dca('0x5d'),_0x3dca('0x57'),_0x3dca('0x58')],squel[_0x3dca('0x72')]()[_0x3dca('0x74')](_0x3dca('0x6e'),'phone')[_0x3dca('0x74')](_0x3dca('0x73'),'scheduledAt')[_0x3dca('0x74')]('id',_0x3dca('0x70'))[_0x3dca('0x74')](_0x592be8[_0x3dca('0x75')][_0x3dca('0x76')](),_0x3dca('0x71'))[_0x3dca('0x74')](_0x2e4f2c[_0x3dca('0x48')]['id']['toString'](),_0x3dca('0x5d'))[_0x3dca('0x74')]('\x27'+_0x476188+'\x27',_0x3dca('0x57'))['field']('\x27'+_0x476188+'\x27',_0x3dca('0x58'))[_0x3dca('0x77')](_0x3dca('0x80'))[_0x3dca('0x3a')](_0x3dca('0x78'))[_0x3dca('0x3a')](_0x3dca('0x79'),_0x592be8[_0x3dca('0x75')][_0x3dca('0x76')]())[_0x3dca('0x3a')](_0x3dca('0x7a'))['where'](_0x3dca('0x7b'),squel['select']()['field'](_0x3dca('0x81'))[_0x3dca('0x77')]('cm_hopper')[_0x3dca('0x3a')](_0x3dca('0x7d'),_0x2e4f2c[_0x3dca('0x48')]['id'][_0x3dca('0x76')]())))[_0x3dca('0x76')]();break;default:_0x44f882=squel[_0x3dca('0x6b')]()[_0x3dca('0x6c')](_0x3dca('0x6d'))[_0x3dca('0x7f')](['phone',_0x3dca('0x6f'),_0x3dca('0x70'),_0x3dca('0x71'),_0x3dca('0x5d'),'createdAt',_0x3dca('0x58')],squel[_0x3dca('0x72')]()['field'](_0x3dca('0x6e'),_0x3dca('0x6e'))[_0x3dca('0x74')](_0x3dca('0x73'),_0x3dca('0x6f'))[_0x3dca('0x74')]('id',_0x3dca('0x70'))[_0x3dca('0x74')](_0x592be8['CmListId']['toString'](),'ListId')[_0x3dca('0x74')](_0x2e4f2c[_0x3dca('0x48')]['id'][_0x3dca('0x76')](),_0x3dca('0x5d'))[_0x3dca('0x74')]('\x27'+_0x476188+'\x27','createdAt')['field']('\x27'+_0x476188+'\x27',_0x3dca('0x58'))[_0x3dca('0x77')](_0x3dca('0x80'))[_0x3dca('0x3a')](_0x3dca('0x78'))[_0x3dca('0x3a')]('ListId\x20=\x20?',_0x592be8[_0x3dca('0x75')]['toString']())[_0x3dca('0x3a')](_0x3dca('0x7a')))['toString']();}_0x542293=squel[_0x3dca('0x6b')]()['into']('cm_hopper_additional_phones')['fromQuery']([_0x3dca('0x82'),_0x3dca('0x6f'),'phone',_0x3dca('0x83'),_0x3dca('0x57'),_0x3dca('0x58')],squel[_0x3dca('0x72')]()[_0x3dca('0x74')](_0x3dca('0x84'),'id')[_0x3dca('0x74')](_0x3dca('0x73'),_0x3dca('0x6f'))[_0x3dca('0x74')](_0x3dca('0x85'),_0x3dca('0x6e'))[_0x3dca('0x74')](_0x3dca('0x86'),'OrderBy')[_0x3dca('0x74')]('\x27'+_0x476188+'\x27','createdAt')[_0x3dca('0x74')]('\x27'+_0x476188+'\x27',_0x3dca('0x58'))['from'](_0x3dca('0x87'),'ci')[_0x3dca('0x88')](_0x3dca('0x6d'),'h',_0x3dca('0x89'))[_0x3dca('0x3a')]('h.ListId\x20=\x20?',_0x592be8['CmListId'][_0x3dca('0x76')]())[_0x3dca('0x3a')](_0x3dca('0x8a'),_0x2e4f2c['params']['id']['toString']())[_0x3dca('0x3a')](_0x3dca('0x8b'),_0x476188))[_0x3dca('0x76')]();_0x4f7768[_0x3dca('0x8c')](db[_0x3dca('0x8d')][_0x3dca('0x30')](_0x44f882));_0x155884['push'](db[_0x3dca('0x8d')][_0x3dca('0x30')](_0x542293));}return BPromise['all'](_0x4f7768);}})[_0x3dca('0x24')](function(){return BPromise[_0x3dca('0x8e')](_0x155884);})[_0x3dca('0x24')](function(){return _0xa2dca0;})[_0x3dca('0x24')](respondWithResult(_0x460820,null))[_0x3dca('0x46')](handleError(_0x460820,null));};exports[_0x3dca('0x8f')]=function(_0x1424c5,_0x49806e,_0x1689d6){return db['Campaign']['find']({'where':{'id':_0x1424c5[_0x3dca('0x48')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x49806e,null))[_0x3dca('0x24')](function(_0x3c2a75){if(_0x3c2a75){return _0x3c2a75[_0x3dca('0x8f')](_0x1424c5['query'][_0x3dca('0x67')]);}})[_0x3dca('0x24')](function(_0x32685f){if(_0x32685f){return db[_0x3dca('0x5b')][_0x3dca('0x25')]({'where':{'ListId':_0x1424c5[_0x3dca('0x30')][_0x3dca('0x67')],'CampaignId':_0x1424c5['params']['id']}})['then'](function(){return _0x32685f;});}})[_0x3dca('0x24')](respondWithStatusCode(_0x49806e,null))[_0x3dca('0x46')](handleError(_0x49806e,null));};exports['getBlackLists']=function(_0x30e788,_0x32a051,_0x4cf13a){var _0x581ca8={};var _0x183bca={};var _0x5bcc67;var _0x2e387f;return db[_0x3dca('0x41')][_0x3dca('0x5a')]({'where':{'id':_0x30e788['params']['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x32a051,null))[_0x3dca('0x24')](function(_0x599cfc){if(_0x599cfc){_0x5bcc67=_0x599cfc;_0x183bca['model']=_['keys'](db['CmList'][_0x3dca('0x55')]);_0x183bca[_0x3dca('0x30')]=_[_0x3dca('0x31')](_0x30e788['query']);_0x183bca['filters']=_[_0x3dca('0x33')](_0x183bca[_0x3dca('0x2f')],_0x183bca[_0x3dca('0x30')]);_0x581ca8['attributes']=_[_0x3dca('0x33')](_0x183bca[_0x3dca('0x2f')],qs['fields'](_0x30e788['query'][_0x3dca('0x34')]));_0x581ca8['attributes']=_0x581ca8[_0x3dca('0x35')][_0x3dca('0x36')]?_0x581ca8[_0x3dca('0x35')]:_0x183bca['model'];_0x581ca8['order']=qs['sort'](_0x30e788[_0x3dca('0x30')][_0x3dca('0x39')]);_0x581ca8[_0x3dca('0x3a')]=qs[_0x3dca('0x32')](_[_0x3dca('0x3b')](_0x30e788['query'],_0x183bca[_0x3dca('0x32')]));if(_0x30e788[_0x3dca('0x30')]['filter']){_0x581ca8[_0x3dca('0x3a')]=_[_0x3dca('0x3d')](_0x581ca8[_0x3dca('0x3a')],{'$or':_['map'](_0x581ca8['attributes'],function(_0x2c2406){var _0x37fab5={};_0x37fab5[_0x2c2406]={'$like':'%'+_0x30e788[_0x3dca('0x30')][_0x3dca('0x3c')]+'%'};return _0x37fab5;})});}_0x581ca8=_[_0x3dca('0x3d')]({},_0x581ca8,_0x30e788[_0x3dca('0x40')]);return _0x5bcc67[_0x3dca('0x90')](_0x581ca8);}})[_0x3dca('0x24')](function(_0x283d21){if(_0x283d21){_0x2e387f=_0x283d21['length'];if(!_0x30e788['query'][_0x3dca('0x37')](_0x3dca('0x38'))){_0x581ca8[_0x3dca('0x1d')]=qs[_0x3dca('0x1d')](_0x30e788['query']['limit']);_0x581ca8[_0x3dca('0x1f')]=qs['offset'](_0x30e788[_0x3dca('0x30')]['offset']);}return _0x5bcc67['getBlackLists'](_0x581ca8);}})[_0x3dca('0x24')](function(_0x48edb2){if(_0x48edb2){return _0x48edb2?{'count':_0x2e387f,'rows':_0x48edb2}:null;}})['then'](respondWithResult(_0x32a051,null))[_0x3dca('0x46')](handleError(_0x32a051,null));};exports[_0x3dca('0x91')]=function(_0xb29b5,_0x5c701e,_0x1f4515){var _0x4be4f9,_0x2ee861;var _0x454a6e=[];var _0x591bbf=moment()[_0x3dca('0x92')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x3dca('0x41')][_0x3dca('0x50')]({'where':{'id':_0xb29b5['params']['id']}})['then'](handleEntityNotFound(_0x5c701e,null))[_0x3dca('0x24')](function(_0x552c11){if(_0x552c11){_0x2ee861=_0x552c11;return _0x552c11[_0x3dca('0x91')](_0xb29b5[_0x3dca('0x4a')]['ids'],_['omit'](_0xb29b5['body'],[_0x3dca('0x67'),'id'])||{});}return null;})['spread'](function(_0x1ad506){var _0xa421cf;var _0x511153;_0x4be4f9=_0x1ad506||[];var _0x525ece=[];if(_0x1ad506){for(var _0x3d2e5a=0x0;_0x3d2e5a<_0x1ad506[_0x3dca('0x36')];_0x3d2e5a+=0x1){var _0x1229a5=_0x1ad506[_0x3d2e5a][_0x3dca('0x26')]({'plain':!![]});_0xa421cf=squel[_0x3dca('0x6b')]()['into'](_0x3dca('0x93'))['fromQuery']([_0x3dca('0x6e'),_0x3dca('0x70'),_0x3dca('0x71'),_0x3dca('0x5d'),'createdAt',_0x3dca('0x58')],squel[_0x3dca('0x72')]()[_0x3dca('0x74')](_0x3dca('0x6e'),'phone')['field']('id',_0x3dca('0x70'))[_0x3dca('0x74')](_0x1229a5[_0x3dca('0x75')]['toString'](),_0x3dca('0x71'))[_0x3dca('0x74')](_0xb29b5[_0x3dca('0x48')]['id']['toString'](),_0x3dca('0x5d'))[_0x3dca('0x74')]('NOW()',_0x3dca('0x57'))['field']('NOW()',_0x3dca('0x58'))[_0x3dca('0x77')]('cm_contacts')[_0x3dca('0x3a')]('deletedAt\x20IS\x20NULL')[_0x3dca('0x3a')](_0x3dca('0x79'),_0x1229a5[_0x3dca('0x75')][_0x3dca('0x76')]())[_0x3dca('0x3a')](_0x3dca('0x7a')))[_0x3dca('0x76')]();_0x525ece[_0x3dca('0x8c')](db[_0x3dca('0x8d')][_0x3dca('0x30')](_0xa421cf));}return BPromise['all'](_0x525ece);}})[_0x3dca('0x24')](function(){return _0x4be4f9;})['then'](respondWithResult(_0x5c701e,null))[_0x3dca('0x46')](handleError(_0x5c701e,null));};exports[_0x3dca('0x94')]=function(_0x2e1aa0,_0x5a05e6,_0x273843){return db['Campaign'][_0x3dca('0x50')]({'where':{'id':_0x2e1aa0[_0x3dca('0x48')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x5a05e6,null))[_0x3dca('0x24')](function(_0x16176b){if(_0x16176b){return _0x16176b[_0x3dca('0x94')](_0x2e1aa0[_0x3dca('0x30')][_0x3dca('0x67')]);}})[_0x3dca('0x24')](function(_0x1ac89a){if(_0x1ac89a){return db['CmHopperBlack'][_0x3dca('0x25')]({'where':{'ListId':_0x2e1aa0[_0x3dca('0x30')][_0x3dca('0x67')],'CampaignId':_0x2e1aa0[_0x3dca('0x48')]['id']}})['then'](function(){return _0x1ac89a;});}})['then'](respondWithStatusCode(_0x5a05e6,null))[_0x3dca('0x46')](handleError(_0x5a05e6,null));};
\ No newline at end of file
+var _0x66d3=['status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','destroy','get','IvrCampaigns','then','error','stack','send','index','map','rawAttributes','fieldName','key','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Campaign','includeAll','include','findAll','rows','show','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','params','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','phone','scheduledAt','ListId','select','field','NOW()','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','into','fromQuery','cm_hopper_additional_phones','ci.OrderBY','OrderBy','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x4db0e2,_0xcb988f){var _0x288567=function(_0x845b53){while(--_0x845b53){_0x4db0e2['push'](_0x4db0e2['shift']());}};_0x288567(++_0xcb988f);}(_0x66d3,0x10f));var _0x366d=function(_0x37c146,_0x2e05ef){_0x37c146=_0x37c146-0x0;var _0x485e66=_0x66d3[_0x37c146];return _0x485e66;};'use strict';var emlformat=require(_0x366d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x366d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x366d('0x2'));var moment=require(_0x366d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x366d('0x4'));var util=require('util');var path=require(_0x366d('0x5'));var sox=require('sox');var csv=require(_0x366d('0x6'));var ejs=require(_0x366d('0x7'));var fs=require('fs');var fs_extra=require(_0x366d('0x8'));var _=require(_0x366d('0x9'));var squel=require(_0x366d('0xa'));var crypto=require(_0x366d('0xb'));var jsforce=require(_0x366d('0xc'));var deskjs=require(_0x366d('0xd'));var toCsv=require(_0x366d('0x6'));var querystring=require(_0x366d('0xe'));var Papa=require(_0x366d('0xf'));var Redis=require('ioredis');var authService=require(_0x366d('0x10'));var qs=require(_0x366d('0x11'));var as=require(_0x366d('0x12'));var hardwareService=require(_0x366d('0x13'));var logger=require(_0x366d('0x14'))(_0x366d('0x15'));var utils=require(_0x366d('0x16'));var config=require(_0x366d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x210ed0,_0x797ee){_0x797ee=_0x797ee||0xcc;return function(_0x3dd776){if(_0x3dd776){return _0x210ed0[_0x366d('0x18')](_0x797ee);}return _0x210ed0[_0x366d('0x19')](_0x797ee)[_0x366d('0x1a')]();};}function respondWithResult(_0x4fa003,_0x265292){_0x265292=_0x265292||0xc8;return function(_0x2a3fdb){if(_0x2a3fdb){return _0x4fa003['status'](_0x265292)[_0x366d('0x1b')](_0x2a3fdb);}};}function respondWithFilteredResult(_0x287d17,_0x54a1bb){return function(_0x3da66f){if(_0x3da66f){var _0x309dc6=typeof _0x54a1bb[_0x366d('0x1c')]==='undefined'&&typeof _0x54a1bb[_0x366d('0x1d')]==='undefined';var _0xbc2286=_0x3da66f[_0x366d('0x1e')];var _0x5a1c0a=_0x309dc6?0x0:_0x54a1bb[_0x366d('0x1c')];var _0x235ff2=_0x309dc6?_0x3da66f[_0x366d('0x1e')]:_0x54a1bb[_0x366d('0x1c')]+_0x54a1bb[_0x366d('0x1d')];var _0x4ce0c6;if(_0x235ff2>=_0xbc2286){_0x235ff2=_0xbc2286;_0x4ce0c6=0xc8;}else{_0x4ce0c6=0xce;}_0x287d17[_0x366d('0x19')](_0x4ce0c6);return _0x287d17['set'](_0x366d('0x1f'),_0x5a1c0a+'-'+_0x235ff2+'/'+_0xbc2286)['json'](_0x3da66f);}return null;};}function patchUpdates(_0x5cbe3b){return function(_0x219106){try{jsonpatch[_0x366d('0x20')](_0x219106,_0x5cbe3b,!![]);}catch(_0x5a4a75){return BPromise[_0x366d('0x21')](_0x5a4a75);}return _0x219106[_0x366d('0x22')]();};}function saveUpdates(_0x1ed99c,_0x58d16f){return function(_0x3b5c89){if(_0x3b5c89){return _0x3b5c89[_0x366d('0x23')](_0x1ed99c)['then'](function(_0x3d4941){return _0x3d4941;});}return null;};}function removeEntity(_0x47ebf4,_0x1c9ee9){return function(_0x1326c9){if(_0x1326c9){return _0x1326c9[_0x366d('0x24')]()['then'](function(){var _0x3d3d12=_0x1326c9[_0x366d('0x25')]({'plain':!![]});var _0x2a1d96=_0x366d('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x2a1d96,'resourceId':_0x3d3d12['id']}})[_0x366d('0x27')](function(){return _0x1326c9;});})[_0x366d('0x27')](function(){_0x47ebf4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x10628b,_0x1a593e){return function(_0x31957c){if(!_0x31957c){_0x10628b[_0x366d('0x18')](0x194);}return _0x31957c;};}function handleError(_0x552c86,_0x413307){_0x413307=_0x413307||0x1f4;return function(_0x5dc954){logger[_0x366d('0x28')](_0x5dc954[_0x366d('0x29')]);if(_0x5dc954['name']){delete _0x5dc954['name'];}_0x552c86[_0x366d('0x19')](_0x413307)[_0x366d('0x2a')](_0x5dc954);};}exports[_0x366d('0x2b')]=function(_0x53ea53,_0x2c2517){var _0x2cb209={},_0x460e4c={},_0x2474a2={'count':0x0,'rows':[]};var _0x2950db=_[_0x366d('0x2c')](db['Campaign'][_0x366d('0x2d')],function(_0x546a3e){return{'name':_0x546a3e[_0x366d('0x2e')],'type':_0x546a3e['type'][_0x366d('0x2f')]};});_0x460e4c[_0x366d('0x30')]=_[_0x366d('0x2c')](_0x2950db,_0x366d('0x31'));_0x460e4c['query']=_[_0x366d('0x32')](_0x53ea53[_0x366d('0x33')]);_0x460e4c[_0x366d('0x34')]=_[_0x366d('0x35')](_0x460e4c[_0x366d('0x30')],_0x460e4c[_0x366d('0x33')]);_0x2cb209['attributes']=_['intersection'](_0x460e4c[_0x366d('0x30')],qs[_0x366d('0x36')](_0x53ea53[_0x366d('0x33')][_0x366d('0x36')]));_0x2cb209['attributes']=_0x2cb209[_0x366d('0x37')][_0x366d('0x38')]?_0x2cb209[_0x366d('0x37')]:_0x460e4c[_0x366d('0x30')];if(!_0x53ea53[_0x366d('0x33')][_0x366d('0x39')](_0x366d('0x3a'))){_0x2cb209[_0x366d('0x1d')]=qs[_0x366d('0x1d')](_0x53ea53['query'][_0x366d('0x1d')]);_0x2cb209[_0x366d('0x1c')]=qs[_0x366d('0x1c')](_0x53ea53['query'][_0x366d('0x1c')]);}_0x2cb209[_0x366d('0x3b')]=qs[_0x366d('0x3c')](_0x53ea53[_0x366d('0x33')][_0x366d('0x3c')]);_0x2cb209[_0x366d('0x3d')]=qs['filters'](_[_0x366d('0x3e')](_0x53ea53[_0x366d('0x33')],_0x460e4c[_0x366d('0x34')]),_0x2950db);if(_0x53ea53[_0x366d('0x33')]['filter']){_0x2cb209[_0x366d('0x3d')]=_[_0x366d('0x3f')](_0x2cb209[_0x366d('0x3d')],{'$or':_[_0x366d('0x2c')](_0x2950db,function(_0xe0a188){if(_0xe0a188['type']!==_0x366d('0x40')){var _0x193726={};_0x193726[_0xe0a188[_0x366d('0x31')]]={'$like':'%'+_0x53ea53[_0x366d('0x33')][_0x366d('0x41')]+'%'};return _0x193726;}})});}_0x2cb209=_[_0x366d('0x3f')]({},_0x2cb209,_0x53ea53[_0x366d('0x42')]);var _0x4814b5={'where':_0x2cb209[_0x366d('0x3d')]};return db[_0x366d('0x43')][_0x366d('0x1e')](_0x4814b5)[_0x366d('0x27')](function(_0x1e1081){_0x2474a2[_0x366d('0x1e')]=_0x1e1081;if(_0x53ea53[_0x366d('0x33')][_0x366d('0x44')]){_0x2cb209[_0x366d('0x45')]=[{'all':!![]}];}return db[_0x366d('0x43')][_0x366d('0x46')](_0x2cb209);})[_0x366d('0x27')](function(_0x53c654){_0x2474a2[_0x366d('0x47')]=_0x53c654;return _0x2474a2;})[_0x366d('0x27')](respondWithFilteredResult(_0x2c2517,_0x2cb209))['catch'](handleError(_0x2c2517,null));};exports[_0x366d('0x48')]=function(_0x585a72,_0x1373cb){var _0x5f212e={'raw':![],'where':{'id':_0x585a72['params']['id']}},_0x619931={};_0x619931[_0x366d('0x30')]=_[_0x366d('0x32')](db[_0x366d('0x43')][_0x366d('0x2d')]);_0x619931[_0x366d('0x33')]=_[_0x366d('0x32')](_0x585a72[_0x366d('0x33')]);_0x619931['filters']=_[_0x366d('0x35')](_0x619931[_0x366d('0x30')],_0x619931[_0x366d('0x33')]);_0x5f212e[_0x366d('0x37')]=_[_0x366d('0x35')](_0x619931[_0x366d('0x30')],qs[_0x366d('0x36')](_0x585a72[_0x366d('0x33')][_0x366d('0x36')]));_0x5f212e[_0x366d('0x37')]=_0x5f212e[_0x366d('0x37')]['length']?_0x5f212e[_0x366d('0x37')]:_0x619931[_0x366d('0x30')];if(_0x585a72[_0x366d('0x33')]['includeAll']){_0x5f212e[_0x366d('0x45')]=[{'all':!![]}];}_0x5f212e=_['merge']({},_0x5f212e,_0x585a72[_0x366d('0x42')]);return db[_0x366d('0x43')][_0x366d('0x49')](_0x5f212e)['then'](handleEntityNotFound(_0x1373cb,null))['then'](respondWithResult(_0x1373cb,null))[_0x366d('0x4a')](handleError(_0x1373cb,null));};exports[_0x366d('0x4b')]=function(_0x21a5b4,_0x68ba99){return db[_0x366d('0x43')][_0x366d('0x4b')](_0x21a5b4[_0x366d('0x4c')],{})['then'](function(_0x18f82a){var _0x26153c=_0x21a5b4[_0x366d('0x4d')]['get']({'plain':!![]});if(!_0x26153c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26153c[_0x366d('0x4e')]===_0x366d('0x4d')){var _0x18e206=_0x18f82a[_0x366d('0x25')]({'plain':!![]});var _0xfffa10=_0x366d('0x26');return db[_0x366d('0x4f')]['find']({'where':{'name':_0xfffa10,'userProfileId':_0x26153c[_0x366d('0x50')]},'raw':!![]})[_0x366d('0x27')](function(_0x3b92a8){if(_0x3b92a8&&_0x3b92a8[_0x366d('0x51')]===0x0){return db[_0x366d('0x52')][_0x366d('0x4b')]({'name':_0x18e206[_0x366d('0x31')],'resourceId':_0x18e206['id'],'type':_0x3b92a8[_0x366d('0x31')],'sectionId':_0x3b92a8['id']},{})[_0x366d('0x27')](function(){return _0x18f82a;});}else{return _0x18f82a;}})[_0x366d('0x4a')](function(_0x39d546){logger['error'](_0x366d('0x53'),_0x39d546);throw _0x39d546;});}return _0x18f82a;})[_0x366d('0x27')](respondWithResult(_0x68ba99,0xc9))['catch'](handleError(_0x68ba99,null));};exports[_0x366d('0x54')]=function(_0x207afe,_0x5d02a0){var _0x3c1a44={'where':{'id':_0x207afe['params']['id']}},_0x129654={};_0x129654[_0x366d('0x30')]=_[_0x366d('0x32')](db[_0x366d('0x43')][_0x366d('0x2d')]);_0x3c1a44['attributes']=_[_0x366d('0x35')](_0x129654['model'],qs[_0x366d('0x36')](_0x207afe[_0x366d('0x33')]['fields']));_0x3c1a44[_0x366d('0x37')]=_0x3c1a44['attributes'][_0x366d('0x38')]?_0x3c1a44[_0x366d('0x37')]:_0x129654[_0x366d('0x30')];if(_0x207afe['query'][_0x366d('0x44')]){_0x3c1a44[_0x366d('0x45')]=[{'all':!![]}];}_0x3c1a44=_[_0x366d('0x3f')]({},_0x3c1a44,_0x207afe[_0x366d('0x42')]);return db['Campaign'][_0x366d('0x49')](_0x3c1a44)[_0x366d('0x27')](handleEntityNotFound(_0x5d02a0,null))[_0x366d('0x27')](function(_0x11b3ef){if(_0x11b3ef){var _0x340705=_0x11b3ef[_0x366d('0x25')]({'plain':!![]});_0x340705=qs[_0x366d('0x55')](_0x340705,['id',_0x366d('0x56'),_0x366d('0x57')]);_0x207afe[_0x366d('0x4c')]=_['omit'](_0x207afe[_0x366d('0x4c')],['id',_0x366d('0x56'),_0x366d('0x57')]);return db[_0x366d('0x43')][_0x366d('0x4b')](_[_0x366d('0x3f')](_0x340705,_0x207afe[_0x366d('0x4c')]),{'include':_0x207afe['query'][_0x366d('0x44')]?[{'all':!![]}]:undefined})[_0x366d('0x27')](function(_0x1da9a1){var _0x3505d7=_0x207afe[_0x366d('0x4d')][_0x366d('0x25')]({'plain':!![]});if(!_0x3505d7)throw new Error(_0x366d('0x58'));if(_0x3505d7[_0x366d('0x4e')]===_0x366d('0x4d')){var _0x4e36ba=_0x1da9a1[_0x366d('0x25')]({'plain':!![]});var _0x398f15='IvrCampaigns';return db[_0x366d('0x4f')][_0x366d('0x49')]({'where':{'name':_0x398f15,'userProfileId':_0x3505d7[_0x366d('0x50')]},'raw':!![]})[_0x366d('0x27')](function(_0x2ac178){if(_0x2ac178&&_0x2ac178[_0x366d('0x51')]===0x0){return db[_0x366d('0x52')][_0x366d('0x4b')]({'name':_0x4e36ba[_0x366d('0x31')],'resourceId':_0x4e36ba['id'],'type':_0x2ac178[_0x366d('0x31')],'sectionId':_0x2ac178['id']},{})['then'](function(){return _0x1da9a1;});}else{return _0x1da9a1;}})[_0x366d('0x4a')](function(_0x55f363){logger[_0x366d('0x28')](_0x366d('0x53'),_0x55f363);throw _0x55f363;});}return _0x1da9a1;});}})['then'](respondWithResult(_0x5d02a0,0xc9))[_0x366d('0x4a')](handleError(_0x5d02a0,null));};exports[_0x366d('0x23')]=function(_0x278ca2,_0x3acf63){if(_0x278ca2['body']['id']){delete _0x278ca2[_0x366d('0x4c')]['id'];}return db[_0x366d('0x43')][_0x366d('0x49')]({'where':{'id':_0x278ca2[_0x366d('0x59')]['id']}})[_0x366d('0x27')](handleEntityNotFound(_0x3acf63,null))['then'](saveUpdates(_0x278ca2[_0x366d('0x4c')],null))[_0x366d('0x27')](respondWithResult(_0x3acf63,null))[_0x366d('0x4a')](handleError(_0x3acf63,null));};exports[_0x366d('0x24')]=function(_0x32f95e,_0x363861){return db[_0x366d('0x43')][_0x366d('0x49')]({'where':{'id':_0x32f95e[_0x366d('0x59')]['id']}})[_0x366d('0x27')](handleEntityNotFound(_0x363861,null))[_0x366d('0x27')](removeEntity(_0x363861,null))['catch'](handleError(_0x363861,null));};exports[_0x366d('0x5a')]=function(_0x3fa363,_0x3122f2,_0x559df7){var _0x4e932b={'raw':!![],'where':{}};var _0x3c0a7f={};var _0x15d796={'count':0x0,'rows':[]};return db[_0x366d('0x43')][_0x366d('0x5b')]({'where':{'id':_0x3fa363[_0x366d('0x59')]['id']}})[_0x366d('0x27')](handleEntityNotFound(_0x3122f2,null))[_0x366d('0x27')](function(_0x49944d){if(_0x49944d){_0x3c0a7f[_0x366d('0x30')]=_['keys'](db[_0x366d('0x5c')][_0x366d('0x2d')]);_0x3c0a7f[_0x366d('0x33')]=_[_0x366d('0x32')](_0x3fa363['query']);_0x3c0a7f['filters']=_[_0x366d('0x35')](_0x3c0a7f[_0x366d('0x30')],_0x3c0a7f[_0x366d('0x33')]);_0x4e932b[_0x366d('0x37')]=_['intersection'](_0x3c0a7f[_0x366d('0x30')],qs[_0x366d('0x36')](_0x3fa363[_0x366d('0x33')][_0x366d('0x36')]));_0x4e932b[_0x366d('0x37')]=_0x4e932b['attributes'][_0x366d('0x38')]?_0x4e932b[_0x366d('0x37')]:_0x3c0a7f[_0x366d('0x30')];if(!_0x3fa363['query'][_0x366d('0x39')](_0x366d('0x3a'))){_0x4e932b[_0x366d('0x1d')]=qs['limit'](_0x3fa363[_0x366d('0x33')][_0x366d('0x1d')]);_0x4e932b['offset']=qs[_0x366d('0x1c')](_0x3fa363[_0x366d('0x33')][_0x366d('0x1c')]);}_0x4e932b[_0x366d('0x3b')]=qs[_0x366d('0x3c')](_0x3fa363[_0x366d('0x33')][_0x366d('0x3c')]);_0x4e932b[_0x366d('0x3d')]=qs[_0x366d('0x34')](_['pick'](_0x3fa363[_0x366d('0x33')],_0x3c0a7f[_0x366d('0x34')]));_0x4e932b[_0x366d('0x3d')]['CampaignId']=_0x49944d['id'];if(_0x3fa363[_0x366d('0x33')][_0x366d('0x41')]){_0x4e932b[_0x366d('0x3d')]=_[_0x366d('0x3f')](_0x4e932b[_0x366d('0x3d')],{'$or':_[_0x366d('0x2c')](_0x4e932b[_0x366d('0x37')],function(_0x358543){var _0xb01d1a={};_0xb01d1a[_0x358543]={'$like':'%'+_0x3fa363[_0x366d('0x33')]['filter']+'%'};return _0xb01d1a;})});}_0x4e932b=_['merge']({},_0x4e932b,_0x3fa363['options']);return db[_0x366d('0x5c')][_0x366d('0x1e')]({'where':_0x4e932b[_0x366d('0x3d')]})[_0x366d('0x27')](function(_0x97595f){_0x15d796[_0x366d('0x1e')]=_0x97595f;if(_0x3fa363[_0x366d('0x33')][_0x366d('0x44')]){_0x4e932b[_0x366d('0x45')]=[{'all':!![]}];}return db[_0x366d('0x5c')][_0x366d('0x46')](_0x4e932b);})[_0x366d('0x27')](function(_0x398b7f){_0x15d796[_0x366d('0x47')]=_0x398b7f;return _0x15d796;});}})[_0x366d('0x27')](respondWithFilteredResult(_0x3122f2,_0x4e932b))[_0x366d('0x4a')](handleError(_0x3122f2,null));};exports[_0x366d('0x5d')]=function(_0x8e991d,_0x171647,_0x356ae5){var _0x1defa8={'raw':!![],'where':{}};var _0x48c84f={};var _0x190a73={'count':0x0,'rows':[]};return db[_0x366d('0x43')]['findOne']({'where':{'id':_0x8e991d[_0x366d('0x59')]['id']}})[_0x366d('0x27')](handleEntityNotFound(_0x171647,null))[_0x366d('0x27')](function(_0x3dba73){if(_0x3dba73){_0x48c84f['model']=_[_0x366d('0x32')](db[_0x366d('0x5e')]['rawAttributes']);_0x48c84f[_0x366d('0x33')]=_[_0x366d('0x32')](_0x8e991d[_0x366d('0x33')]);_0x48c84f[_0x366d('0x34')]=_[_0x366d('0x35')](_0x48c84f[_0x366d('0x30')],_0x48c84f[_0x366d('0x33')]);_0x1defa8[_0x366d('0x37')]=_[_0x366d('0x35')](_0x48c84f[_0x366d('0x30')],qs[_0x366d('0x36')](_0x8e991d['query']['fields']));_0x1defa8[_0x366d('0x37')]=_0x1defa8['attributes'][_0x366d('0x38')]?_0x1defa8[_0x366d('0x37')]:_0x48c84f['model'];if(!_0x8e991d[_0x366d('0x33')][_0x366d('0x39')](_0x366d('0x3a'))){_0x1defa8['limit']=qs[_0x366d('0x1d')](_0x8e991d[_0x366d('0x33')][_0x366d('0x1d')]);_0x1defa8[_0x366d('0x1c')]=qs[_0x366d('0x1c')](_0x8e991d[_0x366d('0x33')][_0x366d('0x1c')]);}_0x1defa8[_0x366d('0x3b')]=qs[_0x366d('0x3c')](_0x8e991d[_0x366d('0x33')][_0x366d('0x3c')]);_0x1defa8['where']=qs[_0x366d('0x34')](_[_0x366d('0x3e')](_0x8e991d[_0x366d('0x33')],_0x48c84f[_0x366d('0x34')]));_0x1defa8[_0x366d('0x3d')][_0x366d('0x5f')]=_0x3dba73['id'];if(_0x8e991d[_0x366d('0x33')][_0x366d('0x41')]){_0x1defa8['where']=_[_0x366d('0x3f')](_0x1defa8[_0x366d('0x3d')],{'$or':_[_0x366d('0x2c')](_0x1defa8[_0x366d('0x37')],function(_0x19bafd){var _0x52e563={};_0x52e563[_0x19bafd]={'$like':'%'+_0x8e991d['query'][_0x366d('0x41')]+'%'};return _0x52e563;})});}_0x1defa8=_[_0x366d('0x3f')]({},_0x1defa8,_0x8e991d[_0x366d('0x42')]);return db['CmHopperHistory'][_0x366d('0x1e')]({'where':_0x1defa8[_0x366d('0x3d')]})['then'](function(_0x4b9986){_0x190a73['count']=_0x4b9986;if(_0x8e991d[_0x366d('0x33')][_0x366d('0x44')]){_0x1defa8[_0x366d('0x45')]=[{'all':!![]}];}return db[_0x366d('0x5e')][_0x366d('0x46')](_0x1defa8);})[_0x366d('0x27')](function(_0x1cec0c){_0x190a73['rows']=_0x1cec0c;return _0x190a73;});}})[_0x366d('0x27')](respondWithFilteredResult(_0x171647,_0x1defa8))[_0x366d('0x4a')](handleError(_0x171647,null));};exports[_0x366d('0x60')]=function(_0x4e19d5,_0x425124,_0x590aef){var _0x4f1b7b={'raw':!![],'where':{}};var _0x389543={};var _0x3d7962={'count':0x0,'rows':[]};return db[_0x366d('0x43')]['findOne']({'where':{'id':_0x4e19d5['params']['id']}})[_0x366d('0x27')](handleEntityNotFound(_0x425124,null))['then'](function(_0x4563a0){if(_0x4563a0){_0x389543[_0x366d('0x30')]=_['keys'](db[_0x366d('0x61')][_0x366d('0x2d')]);_0x389543[_0x366d('0x33')]=_[_0x366d('0x32')](_0x4e19d5[_0x366d('0x33')]);_0x389543[_0x366d('0x34')]=_[_0x366d('0x35')](_0x389543[_0x366d('0x30')],_0x389543['query']);_0x4f1b7b[_0x366d('0x37')]=_[_0x366d('0x35')](_0x389543[_0x366d('0x30')],qs[_0x366d('0x36')](_0x4e19d5['query'][_0x366d('0x36')]));_0x4f1b7b[_0x366d('0x37')]=_0x4f1b7b[_0x366d('0x37')][_0x366d('0x38')]?_0x4f1b7b['attributes']:_0x389543[_0x366d('0x30')];if(!_0x4e19d5[_0x366d('0x33')][_0x366d('0x39')](_0x366d('0x3a'))){_0x4f1b7b[_0x366d('0x1d')]=qs['limit'](_0x4e19d5[_0x366d('0x33')][_0x366d('0x1d')]);_0x4f1b7b[_0x366d('0x1c')]=qs[_0x366d('0x1c')](_0x4e19d5[_0x366d('0x33')][_0x366d('0x1c')]);}_0x4f1b7b[_0x366d('0x3b')]=qs[_0x366d('0x3c')](_0x4e19d5[_0x366d('0x33')][_0x366d('0x3c')]);_0x4f1b7b[_0x366d('0x3d')]=qs[_0x366d('0x34')](_[_0x366d('0x3e')](_0x4e19d5[_0x366d('0x33')],_0x389543[_0x366d('0x34')]));_0x4f1b7b[_0x366d('0x3d')][_0x366d('0x5f')]=_0x4563a0['id'];if(_0x4e19d5[_0x366d('0x33')][_0x366d('0x41')]){_0x4f1b7b[_0x366d('0x3d')]=_[_0x366d('0x3f')](_0x4f1b7b['where'],{'$or':_['map'](_0x4f1b7b[_0x366d('0x37')],function(_0x505066){var _0xb86ee9={};_0xb86ee9[_0x505066]={'$like':'%'+_0x4e19d5[_0x366d('0x33')][_0x366d('0x41')]+'%'};return _0xb86ee9;})});}_0x4f1b7b=_[_0x366d('0x3f')]({},_0x4f1b7b,_0x4e19d5['options']);return db[_0x366d('0x61')][_0x366d('0x1e')]({'where':_0x4f1b7b[_0x366d('0x3d')]})[_0x366d('0x27')](function(_0x341cc8){_0x3d7962['count']=_0x341cc8;if(_0x4e19d5[_0x366d('0x33')][_0x366d('0x44')]){_0x4f1b7b[_0x366d('0x45')]=[{'all':!![]}];}return db[_0x366d('0x61')][_0x366d('0x46')](_0x4f1b7b);})[_0x366d('0x27')](function(_0x3aec2a){_0x3d7962['rows']=_0x3aec2a;return _0x3d7962;});}})[_0x366d('0x27')](respondWithFilteredResult(_0x425124,_0x4f1b7b))[_0x366d('0x4a')](handleError(_0x425124,null));};exports[_0x366d('0x62')]=function(_0x2e8973,_0xe0010d,_0x3efcae){var _0x19e5f8={'raw':!![],'where':{}};var _0x23e1bf={};var _0x293f51={'count':0x0,'rows':[]};return db[_0x366d('0x43')][_0x366d('0x5b')]({'where':{'id':_0x2e8973[_0x366d('0x59')]['id']}})[_0x366d('0x27')](handleEntityNotFound(_0xe0010d,null))['then'](function(_0x3f3ff8){if(_0x3f3ff8){_0x23e1bf['model']=_['keys'](db[_0x366d('0x63')]['rawAttributes']);_0x23e1bf['query']=_[_0x366d('0x32')](_0x2e8973[_0x366d('0x33')]);_0x23e1bf[_0x366d('0x34')]=_[_0x366d('0x35')](_0x23e1bf[_0x366d('0x30')],_0x23e1bf['query']);_0x19e5f8[_0x366d('0x37')]=_['intersection'](_0x23e1bf['model'],qs[_0x366d('0x36')](_0x2e8973[_0x366d('0x33')][_0x366d('0x36')]));_0x19e5f8[_0x366d('0x37')]=_0x19e5f8['attributes'][_0x366d('0x38')]?_0x19e5f8[_0x366d('0x37')]:_0x23e1bf[_0x366d('0x30')];if(!_0x2e8973[_0x366d('0x33')][_0x366d('0x39')](_0x366d('0x3a'))){_0x19e5f8[_0x366d('0x1d')]=qs[_0x366d('0x1d')](_0x2e8973[_0x366d('0x33')][_0x366d('0x1d')]);_0x19e5f8['offset']=qs[_0x366d('0x1c')](_0x2e8973[_0x366d('0x33')]['offset']);}_0x19e5f8['order']=qs[_0x366d('0x3c')](_0x2e8973[_0x366d('0x33')][_0x366d('0x3c')]);_0x19e5f8[_0x366d('0x3d')]=qs[_0x366d('0x34')](_[_0x366d('0x3e')](_0x2e8973[_0x366d('0x33')],_0x23e1bf[_0x366d('0x34')]));_0x19e5f8[_0x366d('0x3d')][_0x366d('0x5f')]=_0x3f3ff8['id'];if(_0x2e8973['query'][_0x366d('0x41')]){_0x19e5f8[_0x366d('0x3d')]=_[_0x366d('0x3f')](_0x19e5f8[_0x366d('0x3d')],{'$or':_[_0x366d('0x2c')](_0x19e5f8[_0x366d('0x37')],function(_0x3980a1){var _0x143ca1={};_0x143ca1[_0x3980a1]={'$like':'%'+_0x2e8973[_0x366d('0x33')][_0x366d('0x41')]+'%'};return _0x143ca1;})});}_0x19e5f8=_[_0x366d('0x3f')]({},_0x19e5f8,_0x2e8973[_0x366d('0x42')]);return db[_0x366d('0x63')][_0x366d('0x1e')]({'where':_0x19e5f8[_0x366d('0x3d')]})[_0x366d('0x27')](function(_0x1bbf92){_0x293f51[_0x366d('0x1e')]=_0x1bbf92;if(_0x2e8973['query'][_0x366d('0x44')]){_0x19e5f8[_0x366d('0x45')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x19e5f8);})[_0x366d('0x27')](function(_0xa423d8){_0x293f51[_0x366d('0x47')]=_0xa423d8;return _0x293f51;});}})[_0x366d('0x27')](respondWithFilteredResult(_0xe0010d,_0x19e5f8))[_0x366d('0x4a')](handleError(_0xe0010d,null));};exports['getLists']=function(_0x216d7e,_0x10686e,_0x5098b4){var _0x3ab5ac={};var _0x1e2b6d={};var _0xe79563;var _0x3eee42;return db[_0x366d('0x43')][_0x366d('0x5b')]({'where':{'id':_0x216d7e[_0x366d('0x59')]['id']}})[_0x366d('0x27')](handleEntityNotFound(_0x10686e,null))[_0x366d('0x27')](function(_0x252551){if(_0x252551){_0xe79563=_0x252551;_0x1e2b6d[_0x366d('0x30')]=_[_0x366d('0x32')](db[_0x366d('0x64')][_0x366d('0x2d')]);_0x1e2b6d['query']=_['keys'](_0x216d7e['query']);_0x1e2b6d[_0x366d('0x34')]=_['intersection'](_0x1e2b6d[_0x366d('0x30')],_0x1e2b6d[_0x366d('0x33')]);_0x3ab5ac[_0x366d('0x37')]=_[_0x366d('0x35')](_0x1e2b6d[_0x366d('0x30')],qs[_0x366d('0x36')](_0x216d7e[_0x366d('0x33')][_0x366d('0x36')]));_0x3ab5ac[_0x366d('0x37')]=_0x3ab5ac[_0x366d('0x37')][_0x366d('0x38')]?_0x3ab5ac[_0x366d('0x37')]:_0x1e2b6d[_0x366d('0x30')];_0x3ab5ac[_0x366d('0x3b')]=qs[_0x366d('0x3c')](_0x216d7e['query'][_0x366d('0x3c')]);_0x3ab5ac[_0x366d('0x3d')]=qs[_0x366d('0x34')](_[_0x366d('0x3e')](_0x216d7e[_0x366d('0x33')],_0x1e2b6d[_0x366d('0x34')]));if(_0x216d7e[_0x366d('0x33')][_0x366d('0x41')]){_0x3ab5ac[_0x366d('0x3d')]=_[_0x366d('0x3f')](_0x3ab5ac['where'],{'$or':_[_0x366d('0x2c')](_0x3ab5ac[_0x366d('0x37')],function(_0x393904){var _0x58f559={};_0x58f559[_0x393904]={'$like':'%'+_0x216d7e[_0x366d('0x33')][_0x366d('0x41')]+'%'};return _0x58f559;})});}_0x3ab5ac=_[_0x366d('0x3f')]({},_0x3ab5ac,_0x216d7e[_0x366d('0x42')]);return _0xe79563[_0x366d('0x65')](_0x3ab5ac);}})[_0x366d('0x27')](function(_0x20e6d0){if(_0x20e6d0){_0x3eee42=_0x20e6d0[_0x366d('0x38')];if(!_0x216d7e[_0x366d('0x33')]['hasOwnProperty'](_0x366d('0x3a'))){_0x3ab5ac['limit']=qs['limit'](_0x216d7e[_0x366d('0x33')][_0x366d('0x1d')]);_0x3ab5ac[_0x366d('0x1c')]=qs[_0x366d('0x1c')](_0x216d7e[_0x366d('0x33')][_0x366d('0x1c')]);}return _0xe79563[_0x366d('0x65')](_0x3ab5ac);}})[_0x366d('0x27')](function(_0x1165d6){if(_0x1165d6){return _0x1165d6?{'count':_0x3eee42,'rows':_0x1165d6}:null;}})[_0x366d('0x27')](respondWithResult(_0x10686e,null))[_0x366d('0x4a')](handleError(_0x10686e,null));};exports[_0x366d('0x66')]=function(_0x247747,_0xa127fc,_0x5016d3){var _0x1ea00e,_0x4d30dc;var _0x44ae83=[];var _0x5e7576=moment()['format'](_0x366d('0x67'));return db[_0x366d('0x43')][_0x366d('0x49')]({'where':{'id':_0x247747['params']['id']}})['then'](handleEntityNotFound(_0xa127fc,null))['then'](function(_0x2a3f9e){if(_0x2a3f9e){_0x4d30dc=_0x2a3f9e;return _0x2a3f9e[_0x366d('0x66')](_0x247747[_0x366d('0x4c')][_0x366d('0x68')],_[_0x366d('0x55')](_0x247747[_0x366d('0x4c')],['ids','id'])||{});}return null;})[_0x366d('0x69')](function(_0x3074d5){var _0xb7f9b2;var _0x30bbd2;_0x1ea00e=_0x3074d5||[];var _0xf87baa=[];if(_0x3074d5){for(var _0x11da0f=0x0;_0x11da0f<_0x3074d5['length'];_0x11da0f+=0x1){var _0x198056=_0x3074d5[_0x11da0f][_0x366d('0x25')]({'plain':!![]});_0x4d30dc[_0x366d('0x6a')]=_0x247747['body'][_0x366d('0x6a')]?_0x247747[_0x366d('0x4c')][_0x366d('0x6a')]:_0x4d30dc['dialCheckDuplicateType'];switch(_0x4d30dc[_0x366d('0x6a')]){case'always':_0xb7f9b2=squel[_0x366d('0x6b')]()['into']('cm_hopper')['fromQuery']([_0x366d('0x6c'),_0x366d('0x6d'),'ContactId',_0x366d('0x6e'),_0x366d('0x5f'),'createdAt','updatedAt'],squel[_0x366d('0x6f')]()[_0x366d('0x70')](_0x366d('0x6c'),'phone')[_0x366d('0x70')](_0x366d('0x71'),'scheduledAt')[_0x366d('0x70')]('id',_0x366d('0x72'))[_0x366d('0x70')](_0x198056[_0x366d('0x73')][_0x366d('0x74')](),_0x366d('0x6e'))[_0x366d('0x70')](_0x247747[_0x366d('0x59')]['id'][_0x366d('0x74')](),_0x366d('0x5f'))[_0x366d('0x70')]('\x27'+_0x5e7576+'\x27',_0x366d('0x56'))[_0x366d('0x70')]('\x27'+_0x5e7576+'\x27',_0x366d('0x57'))[_0x366d('0x75')](_0x366d('0x76'))[_0x366d('0x3d')](_0x366d('0x77'))[_0x366d('0x3d')](_0x366d('0x78'),_0x198056[_0x366d('0x73')][_0x366d('0x74')]())[_0x366d('0x3d')](_0x366d('0x79'))[_0x366d('0x3d')](_0x366d('0x7a'),squel['select']()['field'](_0x366d('0x7b'))[_0x366d('0x75')](_0x366d('0x7c'))[_0x366d('0x3d')](_0x366d('0x7d'),_0x247747[_0x366d('0x59')]['id'][_0x366d('0x74')]()))[_0x366d('0x3d')](_0x366d('0x7a'),squel[_0x366d('0x6f')]()[_0x366d('0x70')](_0x366d('0x7e'))['from'](_0x366d('0x7f'))['where'](_0x366d('0x7d'),_0x247747['params']['id'][_0x366d('0x74')]())))[_0x366d('0x74')]();break;case _0x366d('0x80'):_0xb7f9b2=squel[_0x366d('0x6b')]()[_0x366d('0x81')](_0x366d('0x7f'))[_0x366d('0x82')]([_0x366d('0x6c'),_0x366d('0x6d'),_0x366d('0x72'),_0x366d('0x6e'),'CampaignId','createdAt','updatedAt'],squel[_0x366d('0x6f')]()[_0x366d('0x70')]('phone',_0x366d('0x6c'))[_0x366d('0x70')]('NOW()',_0x366d('0x6d'))[_0x366d('0x70')]('id','ContactId')[_0x366d('0x70')](_0x198056['CmListId'][_0x366d('0x74')](),'ListId')[_0x366d('0x70')](_0x247747['params']['id'][_0x366d('0x74')](),_0x366d('0x5f'))['field']('\x27'+_0x5e7576+'\x27',_0x366d('0x56'))['field']('\x27'+_0x5e7576+'\x27',_0x366d('0x57'))['from'](_0x366d('0x76'))['where'](_0x366d('0x77'))[_0x366d('0x3d')](_0x366d('0x78'),_0x198056['CmListId'][_0x366d('0x74')]())[_0x366d('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0x366d('0x3d')](_0x366d('0x7a'),squel['select']()[_0x366d('0x70')](_0x366d('0x7e'))[_0x366d('0x75')](_0x366d('0x7f'))[_0x366d('0x3d')](_0x366d('0x7d'),_0x247747[_0x366d('0x59')]['id']['toString']())))[_0x366d('0x74')]();break;default:_0xb7f9b2=squel[_0x366d('0x6b')]()[_0x366d('0x81')]('cm_hopper')[_0x366d('0x82')]([_0x366d('0x6c'),_0x366d('0x6d'),_0x366d('0x72'),_0x366d('0x6e'),_0x366d('0x5f'),'createdAt',_0x366d('0x57')],squel[_0x366d('0x6f')]()[_0x366d('0x70')](_0x366d('0x6c'),'phone')[_0x366d('0x70')](_0x366d('0x71'),'scheduledAt')[_0x366d('0x70')]('id',_0x366d('0x72'))['field'](_0x198056['CmListId'][_0x366d('0x74')](),_0x366d('0x6e'))[_0x366d('0x70')](_0x247747[_0x366d('0x59')]['id'][_0x366d('0x74')](),'CampaignId')['field']('\x27'+_0x5e7576+'\x27',_0x366d('0x56'))[_0x366d('0x70')]('\x27'+_0x5e7576+'\x27',_0x366d('0x57'))[_0x366d('0x75')]('cm_contacts')[_0x366d('0x3d')](_0x366d('0x77'))[_0x366d('0x3d')](_0x366d('0x78'),_0x198056[_0x366d('0x73')][_0x366d('0x74')]())[_0x366d('0x3d')]('phone\x20IS\x20NOT\x20NULL'))[_0x366d('0x74')]();}_0x30bbd2=squel[_0x366d('0x6b')]()[_0x366d('0x81')](_0x366d('0x83'))[_0x366d('0x82')](['cmHopperId',_0x366d('0x6d'),_0x366d('0x6c'),'OrderBy',_0x366d('0x56'),_0x366d('0x57')],squel[_0x366d('0x6f')]()[_0x366d('0x70')]('h.id','id')[_0x366d('0x70')](_0x366d('0x71'),_0x366d('0x6d'))['field']('ci.item','phone')[_0x366d('0x70')](_0x366d('0x84'),_0x366d('0x85'))[_0x366d('0x70')]('\x27'+_0x5e7576+'\x27',_0x366d('0x56'))[_0x366d('0x70')]('\x27'+_0x5e7576+'\x27',_0x366d('0x57'))['from'](_0x366d('0x86'),'ci')['join'](_0x366d('0x7f'),'h',_0x366d('0x87'))[_0x366d('0x3d')](_0x366d('0x88'),_0x198056[_0x366d('0x73')][_0x366d('0x74')]())[_0x366d('0x3d')](_0x366d('0x89'),_0x247747[_0x366d('0x59')]['id'][_0x366d('0x74')]())[_0x366d('0x3d')](_0x366d('0x8a'),_0x5e7576))[_0x366d('0x74')]();_0xf87baa['push'](db[_0x366d('0x8b')][_0x366d('0x33')](_0xb7f9b2));_0x44ae83[_0x366d('0x8c')](db[_0x366d('0x8b')][_0x366d('0x33')](_0x30bbd2));}return BPromise['all'](_0xf87baa);}})[_0x366d('0x27')](function(){return BPromise[_0x366d('0x8d')](_0x44ae83);})['then'](function(){return _0x1ea00e;})[_0x366d('0x27')](respondWithResult(_0xa127fc,null))['catch'](handleError(_0xa127fc,null));};exports['removeLists']=function(_0x1b1c86,_0x5a20e1,_0x3ed328){return db[_0x366d('0x43')][_0x366d('0x49')]({'where':{'id':_0x1b1c86[_0x366d('0x59')]['id']}})['then'](handleEntityNotFound(_0x5a20e1,null))['then'](function(_0x511f96){if(_0x511f96){return _0x511f96[_0x366d('0x8e')](_0x1b1c86['query'][_0x366d('0x68')]);}})[_0x366d('0x27')](function(_0x24dfb7){if(_0x24dfb7){return db['CmHopper']['destroy']({'where':{'ListId':_0x1b1c86[_0x366d('0x33')][_0x366d('0x68')],'CampaignId':_0x1b1c86[_0x366d('0x59')]['id']}})[_0x366d('0x27')](function(){return _0x24dfb7;});}})[_0x366d('0x27')](respondWithStatusCode(_0x5a20e1,null))[_0x366d('0x4a')](handleError(_0x5a20e1,null));};exports[_0x366d('0x8f')]=function(_0x3681a1,_0x1978b6,_0x398dc8){var _0x5d75c4={};var _0x49d5cc={};var _0x57d8fc;var _0x27a519;return db[_0x366d('0x43')][_0x366d('0x5b')]({'where':{'id':_0x3681a1['params']['id']}})[_0x366d('0x27')](handleEntityNotFound(_0x1978b6,null))[_0x366d('0x27')](function(_0x18bc04){if(_0x18bc04){_0x57d8fc=_0x18bc04;_0x49d5cc['model']=_[_0x366d('0x32')](db['CmList'][_0x366d('0x2d')]);_0x49d5cc[_0x366d('0x33')]=_[_0x366d('0x32')](_0x3681a1[_0x366d('0x33')]);_0x49d5cc[_0x366d('0x34')]=_['intersection'](_0x49d5cc['model'],_0x49d5cc[_0x366d('0x33')]);_0x5d75c4[_0x366d('0x37')]=_[_0x366d('0x35')](_0x49d5cc[_0x366d('0x30')],qs[_0x366d('0x36')](_0x3681a1[_0x366d('0x33')]['fields']));_0x5d75c4[_0x366d('0x37')]=_0x5d75c4[_0x366d('0x37')][_0x366d('0x38')]?_0x5d75c4[_0x366d('0x37')]:_0x49d5cc[_0x366d('0x30')];_0x5d75c4[_0x366d('0x3b')]=qs[_0x366d('0x3c')](_0x3681a1['query']['sort']);_0x5d75c4['where']=qs[_0x366d('0x34')](_['pick'](_0x3681a1[_0x366d('0x33')],_0x49d5cc['filters']));if(_0x3681a1[_0x366d('0x33')][_0x366d('0x41')]){_0x5d75c4[_0x366d('0x3d')]=_[_0x366d('0x3f')](_0x5d75c4[_0x366d('0x3d')],{'$or':_[_0x366d('0x2c')](_0x5d75c4[_0x366d('0x37')],function(_0x30df27){var _0x4d34d9={};_0x4d34d9[_0x30df27]={'$like':'%'+_0x3681a1[_0x366d('0x33')][_0x366d('0x41')]+'%'};return _0x4d34d9;})});}_0x5d75c4=_[_0x366d('0x3f')]({},_0x5d75c4,_0x3681a1['options']);return _0x57d8fc[_0x366d('0x8f')](_0x5d75c4);}})['then'](function(_0x319c30){if(_0x319c30){_0x27a519=_0x319c30[_0x366d('0x38')];if(!_0x3681a1['query'][_0x366d('0x39')](_0x366d('0x3a'))){_0x5d75c4['limit']=qs['limit'](_0x3681a1[_0x366d('0x33')][_0x366d('0x1d')]);_0x5d75c4[_0x366d('0x1c')]=qs[_0x366d('0x1c')](_0x3681a1[_0x366d('0x33')][_0x366d('0x1c')]);}return _0x57d8fc['getBlackLists'](_0x5d75c4);}})[_0x366d('0x27')](function(_0x64bcc6){if(_0x64bcc6){return _0x64bcc6?{'count':_0x27a519,'rows':_0x64bcc6}:null;}})[_0x366d('0x27')](respondWithResult(_0x1978b6,null))['catch'](handleError(_0x1978b6,null));};exports[_0x366d('0x90')]=function(_0x4b76c1,_0x396603,_0x2faacc){var _0x392576,_0x41a73d;var _0x206e35=[];var _0x1f450a=moment()[_0x366d('0x91')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x366d('0x43')][_0x366d('0x49')]({'where':{'id':_0x4b76c1[_0x366d('0x59')]['id']}})[_0x366d('0x27')](handleEntityNotFound(_0x396603,null))['then'](function(_0x18bd29){if(_0x18bd29){_0x41a73d=_0x18bd29;return _0x18bd29['addBlackLists'](_0x4b76c1[_0x366d('0x4c')][_0x366d('0x68')],_[_0x366d('0x55')](_0x4b76c1[_0x366d('0x4c')],[_0x366d('0x68'),'id'])||{});}return null;})['spread'](function(_0x4f4707){var _0x57f69f;var _0x4c0dc7;_0x392576=_0x4f4707||[];var _0x425447=[];if(_0x4f4707){for(var _0x23bddf=0x0;_0x23bddf<_0x4f4707[_0x366d('0x38')];_0x23bddf+=0x1){var _0x4e2d85=_0x4f4707[_0x23bddf][_0x366d('0x25')]({'plain':!![]});_0x57f69f=squel[_0x366d('0x6b')]()[_0x366d('0x81')](_0x366d('0x92'))[_0x366d('0x82')]([_0x366d('0x6c'),_0x366d('0x72'),_0x366d('0x6e'),_0x366d('0x5f'),_0x366d('0x56'),'updatedAt'],squel[_0x366d('0x6f')]()[_0x366d('0x70')](_0x366d('0x6c'),_0x366d('0x6c'))[_0x366d('0x70')]('id',_0x366d('0x72'))['field'](_0x4e2d85['CmListId'][_0x366d('0x74')](),_0x366d('0x6e'))['field'](_0x4b76c1[_0x366d('0x59')]['id'][_0x366d('0x74')](),_0x366d('0x5f'))[_0x366d('0x70')](_0x366d('0x71'),_0x366d('0x56'))[_0x366d('0x70')](_0x366d('0x71'),_0x366d('0x57'))[_0x366d('0x75')]('cm_contacts')['where'](_0x366d('0x77'))[_0x366d('0x3d')]('ListId\x20=\x20?',_0x4e2d85[_0x366d('0x73')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x366d('0x74')]();_0x425447[_0x366d('0x8c')](db[_0x366d('0x8b')][_0x366d('0x33')](_0x57f69f));}return BPromise[_0x366d('0x8d')](_0x425447);}})[_0x366d('0x27')](function(){return _0x392576;})[_0x366d('0x27')](respondWithResult(_0x396603,null))['catch'](handleError(_0x396603,null));};exports[_0x366d('0x93')]=function(_0x49b7e8,_0x279b98,_0x5aa334){return db['Campaign'][_0x366d('0x49')]({'where':{'id':_0x49b7e8[_0x366d('0x59')]['id']}})[_0x366d('0x27')](handleEntityNotFound(_0x279b98,null))[_0x366d('0x27')](function(_0x5ce27d){if(_0x5ce27d){return _0x5ce27d['removeBlackLists'](_0x49b7e8[_0x366d('0x33')][_0x366d('0x68')]);}})[_0x366d('0x27')](function(_0x349cfa){if(_0x349cfa){return db[_0x366d('0x63')][_0x366d('0x24')]({'where':{'ListId':_0x49b7e8[_0x366d('0x33')][_0x366d('0x68')],'CampaignId':_0x49b7e8[_0x366d('0x59')]['id']}})[_0x366d('0x27')](function(){return _0x349cfa;});}})[_0x366d('0x27')](respondWithStatusCode(_0x279b98,null))[_0x366d('0x4a')](handleError(_0x279b98,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 858891b..0bfde30 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 _0x7c97=['./campaign.attributes','exports','define','Campaign','campaigns','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3f19ff,_0x28033e){var _0x261c33=function(_0x11feac){while(--_0x11feac){_0x3f19ff['push'](_0x3f19ff['shift']());}};_0x261c33(++_0x28033e);}(_0x7c97,0x17e));var _0x77c9=function(_0x1328de,_0x3a1f2d){_0x1328de=_0x1328de-0x0;var _0x535a22=_0x7c97[_0x1328de];return _0x535a22;};'use strict';var _=require('lodash');var util=require(_0x77c9('0x0'));var logger=require(_0x77c9('0x1'))(_0x77c9('0x2'));var moment=require('moment');var BPromise=require(_0x77c9('0x3'));var rp=require(_0x77c9('0x4'));var fs=require('fs');var path=require(_0x77c9('0x5'));var rimraf=require(_0x77c9('0x6'));var config=require(_0x77c9('0x7'));var attributes=require(_0x77c9('0x8'));module[_0x77c9('0x9')]=function(_0xf0586,_0x3a93b5){return _0xf0586[_0x77c9('0xa')](_0x77c9('0xb'),attributes,{'tableName':_0x77c9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa020=['moment','bluebird','path','rimraf','../../config/environment','exports','campaigns','lodash','util','../../config/logger','api'];(function(_0x102efb,_0x55f73b){var _0x445892=function(_0x20c108){while(--_0x20c108){_0x102efb['push'](_0x102efb['shift']());}};_0x445892(++_0x55f73b);}(_0xa020,0x80));var _0x0a02=function(_0x18964b,_0x1470a2){_0x18964b=_0x18964b-0x0;var _0x52aceb=_0xa020[_0x18964b];return _0x52aceb;};'use strict';var _=require(_0x0a02('0x0'));var util=require(_0x0a02('0x1'));var logger=require(_0x0a02('0x2'))(_0x0a02('0x3'));var moment=require(_0x0a02('0x4'));var BPromise=require(_0x0a02('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a02('0x6'));var rimraf=require(_0x0a02('0x7'));var config=require(_0x0a02('0x8'));var attributes=require('./campaign.attributes');module[_0x0a02('0x9')]=function(_0x64a323,_0x5474e9){return _0x64a323['define']('Campaign',attributes,{'tableName':_0x0a02('0xa'),'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 d38efa4..62c8927 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 _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x5ec354,_0x4a0d56){var _0xbbaf7f=function(_0xf3f7aa){while(--_0xf3f7aa){_0x5ec354['push'](_0x5ec354['shift']());}};_0xbbaf7f(++_0x4a0d56);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};
\ No newline at end of file
+var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x35b5c4,_0xea8588){var _0x50551f=function(_0x59741a){while(--_0x59741a){_0x35b5c4['push'](_0x35b5c4['shift']());}};_0x50551f(++_0xea8588);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 9ac5ff5..b93bb96 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 _0xf410=['delete','destroy','removeLists','removeBlackLists','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','/:id/blacklists','addBlackLists','update'];(function(_0x45b9b3,_0x509426){var _0x313cff=function(_0xbff450){while(--_0xbff450){_0x45b9b3['push'](_0x45b9b3['shift']());}};_0x313cff(++_0x509426);}(_0xf410,0x8c));var _0x0f41=function(_0x2aa818,_0x53b9ce){_0x2aa818=_0x2aa818-0x0;var _0x284a5b=_0xf410[_0x2aa818];return _0x284a5b;};'use strict';var multer=require(_0x0f41('0x0'));var util=require(_0x0f41('0x1'));var path=require('path');var timeout=require(_0x0f41('0x2'));var express=require(_0x0f41('0x3'));var router=express['Router']();var fs_extra=require(_0x0f41('0x4'));var auth=require(_0x0f41('0x5'));var interaction=require(_0x0f41('0x6'));var config=require(_0x0f41('0x7'));var controller=require(_0x0f41('0x8'));router[_0x0f41('0x9')]('/',auth[_0x0f41('0xa')](),controller[_0x0f41('0xb')]);router[_0x0f41('0x9')](_0x0f41('0xc'),auth[_0x0f41('0xa')](),controller[_0x0f41('0xd')]);router['get'](_0x0f41('0xe'),auth['isAuthenticated'](),controller['getHoppers']);router[_0x0f41('0x9')](_0x0f41('0xf'),auth[_0x0f41('0xa')](),controller[_0x0f41('0x10')]);router[_0x0f41('0x9')](_0x0f41('0x11'),auth[_0x0f41('0xa')](),controller['getHopperFinals']);router['get'](_0x0f41('0x12'),auth['isAuthenticated'](),controller[_0x0f41('0x13')]);router[_0x0f41('0x9')](_0x0f41('0x14'),auth[_0x0f41('0xa')](),controller[_0x0f41('0x15')]);router[_0x0f41('0x9')]('/:id/blacklists',auth[_0x0f41('0xa')](),controller[_0x0f41('0x16')]);router[_0x0f41('0x17')]('/',auth[_0x0f41('0xa')](),controller[_0x0f41('0x18')]);router['post'](_0x0f41('0x19'),auth['isAuthenticated'](),controller[_0x0f41('0x1a')]);router[_0x0f41('0x17')](_0x0f41('0x14'),auth[_0x0f41('0xa')](),controller['addLists']);router[_0x0f41('0x17')](_0x0f41('0x1b'),auth[_0x0f41('0xa')](),controller[_0x0f41('0x1c')]);router['put'](_0x0f41('0xc'),auth['isAuthenticated'](),controller[_0x0f41('0x1d')]);router[_0x0f41('0x1e')]('/:id',auth[_0x0f41('0xa')](),controller[_0x0f41('0x1f')]);router[_0x0f41('0x1e')](_0x0f41('0x14'),auth[_0x0f41('0xa')](),controller[_0x0f41('0x20')]);router[_0x0f41('0x1e')](_0x0f41('0x1b'),auth['isAuthenticated'](),controller[_0x0f41('0x21')]);module['exports']=router;
\ No newline at end of file
+var _0xb641=['getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','/:id/clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','../../components/interaction/service','./campaign.controller','get','isAuthenticated','/:id','show','getHoppers','getHopperHistories'];(function(_0x232965,_0x21fcfc){var _0x8567ab=function(_0x1640ee){while(--_0x1640ee){_0x232965['push'](_0x232965['shift']());}};_0x8567ab(++_0x21fcfc);}(_0xb641,0x116));var _0x1b64=function(_0x3d7e8e,_0x5a396a){_0x3d7e8e=_0x3d7e8e-0x0;var _0x22ae39=_0xb641[_0x3d7e8e];return _0x22ae39;};'use strict';var multer=require(_0x1b64('0x0'));var util=require(_0x1b64('0x1'));var path=require('path');var timeout=require(_0x1b64('0x2'));var express=require(_0x1b64('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1b64('0x4'));var config=require('../../config/environment');var controller=require(_0x1b64('0x5'));router[_0x1b64('0x6')]('/',auth[_0x1b64('0x7')](),controller['index']);router[_0x1b64('0x6')](_0x1b64('0x8'),auth[_0x1b64('0x7')](),controller[_0x1b64('0x9')]);router['get']('/:id/hoppers',auth[_0x1b64('0x7')](),controller[_0x1b64('0xa')]);router['get']('/:id/hopper_histories',auth[_0x1b64('0x7')](),controller[_0x1b64('0xb')]);router[_0x1b64('0x6')]('/:id/hopper_finals',auth[_0x1b64('0x7')](),controller[_0x1b64('0xc')]);router['get'](_0x1b64('0xd'),auth['isAuthenticated'](),controller[_0x1b64('0xe')]);router['get'](_0x1b64('0xf'),auth['isAuthenticated'](),controller[_0x1b64('0x10')]);router[_0x1b64('0x6')](_0x1b64('0x11'),auth[_0x1b64('0x7')](),controller['getBlackLists']);router[_0x1b64('0x12')]('/',auth[_0x1b64('0x7')](),controller['create']);router[_0x1b64('0x12')](_0x1b64('0x13'),auth['isAuthenticated'](),controller['clone']);router['post']('/:id/lists',auth[_0x1b64('0x7')](),controller[_0x1b64('0x14')]);router['post']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x1b64('0x15')]);router[_0x1b64('0x16')](_0x1b64('0x8'),auth[_0x1b64('0x7')](),controller[_0x1b64('0x17')]);router[_0x1b64('0x18')](_0x1b64('0x8'),auth['isAuthenticated'](),controller[_0x1b64('0x19')]);router[_0x1b64('0x18')](_0x1b64('0xf'),auth[_0x1b64('0x7')](),controller[_0x1b64('0x1a')]);router[_0x1b64('0x18')](_0x1b64('0x11'),auth[_0x1b64('0x7')](),controller[_0x1b64('0x1b')]);module[_0x1b64('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 3d770c4..4165bf7 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 _0xcff0=['getDataValue','sequelize','STRING','VIRTUAL'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xcff0,0x1dd));var _0x0cff=function(_0x21311f,_0x29dc32){_0x21311f=_0x21311f-0x0;var _0x5b0e1e=_0xcff0[_0x21311f];return _0x5b0e1e;};'use strict';var Sequelize=require(_0x0cff('0x0'));module['exports']={'key':{'type':Sequelize[_0x0cff('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x0cff('0x1')]},'name':{'type':Sequelize[_0x0cff('0x2')],'get':function(){return this[_0x0cff('0x3')]('key');}}};
\ No newline at end of file
+var _0xf7a8=['sequelize','exports','STRING','TEXT','getDataValue','key'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xf7a8,0x1c2));var _0x8f7a=function(_0x431cd3,_0x64ef51){_0x431cd3=_0x431cd3-0x0;var _0x1d1851=_0xf7a8[_0x431cd3];return _0x1d1851;};'use strict';var Sequelize=require(_0x8f7a('0x0'));module[_0x8f7a('0x1')]={'key':{'type':Sequelize[_0x8f7a('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x8f7a('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x8f7a('0x4')](_0x8f7a('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index ab486b2..caf9c2a 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 _0x287f=['attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','options','CannedAnswer','includeAll','include','rows','catch','params','body','find','create','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','CannedAnswers','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query'];(function(_0x120b1e,_0x4d2bec){var _0x186859=function(_0xed22d){while(--_0xed22d){_0x120b1e['push'](_0x120b1e['shift']());}};_0x186859(++_0x4d2bec);}(_0x287f,0xc7));var _0xf287=function(_0xc0af27,_0x506cbb){_0xc0af27=_0xc0af27-0x0;var _0x2b224c=_0x287f[_0xc0af27];return _0x2b224c;};'use strict';var emlformat=require(_0xf287('0x0'));var rimraf=require(_0xf287('0x1'));var zipdir=require(_0xf287('0x2'));var jsonpatch=require(_0xf287('0x3'));var rp=require(_0xf287('0x4'));var moment=require(_0xf287('0x5'));var BPromise=require(_0xf287('0x6'));var Mustache=require(_0xf287('0x7'));var util=require('util');var path=require(_0xf287('0x8'));var sox=require(_0xf287('0x9'));var csv=require(_0xf287('0xa'));var ejs=require(_0xf287('0xb'));var fs=require('fs');var fs_extra=require(_0xf287('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf287('0xd'));var jsforce=require(_0xf287('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf287('0xf'));var authService=require(_0xf287('0x10'));var qs=require(_0xf287('0x11'));var as=require(_0xf287('0x12'));var hardwareService=require(_0xf287('0x13'));var logger=require(_0xf287('0x14'))(_0xf287('0x15'));var utils=require(_0xf287('0x16'));var config=require(_0xf287('0x17'));var licenseUtil=require(_0xf287('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57335b,_0x523a59){_0x523a59=_0x523a59||0xcc;return function(_0x5bd95d){if(_0x5bd95d){return _0x57335b[_0xf287('0x19')](_0x523a59);}return _0x57335b[_0xf287('0x1a')](_0x523a59)[_0xf287('0x1b')]();};}function respondWithResult(_0x1320ff,_0x46ad0e){_0x46ad0e=_0x46ad0e||0xc8;return function(_0x501c3f){if(_0x501c3f){return _0x1320ff[_0xf287('0x1a')](_0x46ad0e)['json'](_0x501c3f);}};}function respondWithFilteredResult(_0x14ac1d,_0x4292d3){return function(_0x3b52ee){if(_0x3b52ee){var _0x143769=typeof _0x4292d3['offset']===_0xf287('0x1c')&&typeof _0x4292d3['limit']===_0xf287('0x1c');var _0x1dc8e3=_0x3b52ee[_0xf287('0x1d')];var _0x144a8e=_0x143769?0x0:_0x4292d3[_0xf287('0x1e')];var _0x3e78e6=_0x143769?_0x3b52ee['count']:_0x4292d3[_0xf287('0x1e')]+_0x4292d3[_0xf287('0x1f')];var _0x34857e;if(_0x3e78e6>=_0x1dc8e3){_0x3e78e6=_0x1dc8e3;_0x34857e=0xc8;}else{_0x34857e=0xce;}_0x14ac1d['status'](_0x34857e);return _0x14ac1d[_0xf287('0x20')](_0xf287('0x21'),_0x144a8e+'-'+_0x3e78e6+'/'+_0x1dc8e3)[_0xf287('0x22')](_0x3b52ee);}return null;};}function patchUpdates(_0x3f844c){return function(_0x4879eb){try{jsonpatch[_0xf287('0x23')](_0x4879eb,_0x3f844c,!![]);}catch(_0x3e3289){return BPromise[_0xf287('0x24')](_0x3e3289);}return _0x4879eb[_0xf287('0x25')]();};}function saveUpdates(_0x3461cc,_0x20855f){return function(_0x77d199){if(_0x77d199){return _0x77d199[_0xf287('0x26')](_0x3461cc)[_0xf287('0x27')](function(_0xb360de){return _0xb360de;});}return null;};}function removeEntity(_0x3c9cfd,_0x3501d2){return function(_0x18ee11){if(_0x18ee11){return _0x18ee11['destroy']()[_0xf287('0x27')](function(){var _0x55fe79=_0x18ee11['get']({'plain':!![]});var _0x42b4d8=_0xf287('0x28');return db[_0xf287('0x29')]['destroy']({'where':{'type':_0x42b4d8,'resourceId':_0x55fe79['id']}})[_0xf287('0x27')](function(){return _0x18ee11;});})[_0xf287('0x27')](function(){_0x3c9cfd[_0xf287('0x1a')](0xcc)[_0xf287('0x1b')]();});}};}function handleEntityNotFound(_0x45af85,_0x590721){return function(_0x55e04d){if(!_0x55e04d){_0x45af85[_0xf287('0x19')](0x194);}return _0x55e04d;};}function handleError(_0x2cab99,_0x3b91b7){_0x3b91b7=_0x3b91b7||0x1f4;return function(_0x15ad7d){logger[_0xf287('0x2a')](_0x15ad7d[_0xf287('0x2b')]);if(_0x15ad7d['name']){delete _0x15ad7d[_0xf287('0x2c')];}_0x2cab99[_0xf287('0x1a')](_0x3b91b7)['send'](_0x15ad7d);};}exports[_0xf287('0x2d')]=function(_0x71e850,_0x211002){var _0x2c3d92={},_0x2ddff4={},_0x586c77={'count':0x0,'rows':[]};var _0x528052=_[_0xf287('0x2e')](db['CannedAnswer'][_0xf287('0x2f')],function(_0x5e3206){return{'name':_0x5e3206[_0xf287('0x30')],'type':_0x5e3206[_0xf287('0x31')][_0xf287('0x32')]};});_0x2ddff4['model']=_[_0xf287('0x2e')](_0x528052,_0xf287('0x2c'));_0x2ddff4['query']=_[_0xf287('0x33')](_0x71e850['query']);_0x2ddff4[_0xf287('0x34')]=_[_0xf287('0x35')](_0x2ddff4[_0xf287('0x36')],_0x2ddff4[_0xf287('0x37')]);_0x2c3d92[_0xf287('0x38')]=_[_0xf287('0x35')](_0x2ddff4[_0xf287('0x36')],qs['fields'](_0x71e850[_0xf287('0x37')][_0xf287('0x39')]));_0x2c3d92['attributes']=_0x2c3d92['attributes'][_0xf287('0x3a')]?_0x2c3d92['attributes']:_0x2ddff4[_0xf287('0x36')];if(!_0x71e850[_0xf287('0x37')][_0xf287('0x3b')]('nolimit')){_0x2c3d92[_0xf287('0x1f')]=qs['limit'](_0x71e850[_0xf287('0x37')][_0xf287('0x1f')]);_0x2c3d92[_0xf287('0x1e')]=qs[_0xf287('0x1e')](_0x71e850['query'][_0xf287('0x1e')]);}_0x2c3d92['order']=qs[_0xf287('0x3c')](_0x71e850[_0xf287('0x37')][_0xf287('0x3c')]);_0x2c3d92['where']=qs[_0xf287('0x34')](_[_0xf287('0x3d')](_0x71e850[_0xf287('0x37')],_0x2ddff4[_0xf287('0x34')]),_0x528052);if(_0x71e850['query'][_0xf287('0x3e')]){_0x2c3d92['where']=_[_0xf287('0x3f')](_0x2c3d92[_0xf287('0x40')],{'$or':[{'key':{'$like':'%'+_0x71e850['query'][_0xf287('0x3e')]+'%'}},{'value':{'$like':'%'+_0x71e850['query'][_0xf287('0x3e')]+'%'}}]});}_0x2c3d92=_['merge']({},_0x2c3d92,_0x71e850[_0xf287('0x41')]);var _0x35662d={'where':_0x2c3d92[_0xf287('0x40')]};return db[_0xf287('0x42')][_0xf287('0x1d')](_0x35662d)['then'](function(_0x4754b9){_0x586c77['count']=_0x4754b9;if(_0x71e850[_0xf287('0x37')][_0xf287('0x43')]){_0x2c3d92[_0xf287('0x44')]=[{'all':!![]}];}return db[_0xf287('0x42')]['findAll'](_0x2c3d92);})['then'](function(_0x1aafdc){_0x586c77[_0xf287('0x45')]=_0x1aafdc;return _0x586c77;})[_0xf287('0x27')](respondWithFilteredResult(_0x211002,_0x2c3d92))[_0xf287('0x46')](handleError(_0x211002,null));};exports['show']=function(_0x52e2cf,_0x3a1889){var _0x57441e={'raw':!![],'where':{'id':_0x52e2cf[_0xf287('0x47')]['id']}},_0x433952={};_0x433952[_0xf287('0x36')]=_[_0xf287('0x33')](db['CannedAnswer'][_0xf287('0x2f')]);_0x433952[_0xf287('0x37')]=_[_0xf287('0x33')](_0x52e2cf[_0xf287('0x37')]);_0x433952['filters']=_[_0xf287('0x35')](_0x433952[_0xf287('0x36')],_0x433952['query']);_0x57441e['attributes']=_['intersection'](_0x433952[_0xf287('0x36')],qs[_0xf287('0x39')](_0x52e2cf[_0xf287('0x37')][_0xf287('0x39')]));_0x57441e[_0xf287('0x38')]=_0x57441e['attributes'][_0xf287('0x3a')]?_0x57441e[_0xf287('0x38')]:_0x433952[_0xf287('0x36')];if(_0x52e2cf[_0xf287('0x37')][_0xf287('0x43')]){_0x57441e[_0xf287('0x44')]=[{'all':!![]}];}_0x57441e=_[_0xf287('0x3f')]({},_0x57441e,_0x52e2cf[_0xf287('0x41')]);return db[_0xf287('0x42')]['find'](_0x57441e)[_0xf287('0x27')](handleEntityNotFound(_0x3a1889,null))[_0xf287('0x27')](respondWithResult(_0x3a1889,null))['catch'](handleError(_0x3a1889,null));};exports['update']=function(_0x24cf7b,_0x445b75){if(_0x24cf7b[_0xf287('0x48')]['id']){delete _0x24cf7b['body']['id'];}return db[_0xf287('0x42')][_0xf287('0x49')]({'where':{'id':_0x24cf7b['params']['id']}})[_0xf287('0x27')](handleEntityNotFound(_0x445b75,null))[_0xf287('0x27')](saveUpdates(_0x24cf7b[_0xf287('0x48')],null))['then'](respondWithResult(_0x445b75,null))[_0xf287('0x46')](handleError(_0x445b75,null));};exports['destroy']=function(_0x3668e5,_0x2ad7c7){return db[_0xf287('0x42')][_0xf287('0x49')]({'where':{'id':_0x3668e5[_0xf287('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ad7c7,null))[_0xf287('0x27')](removeEntity(_0x2ad7c7,null))[_0xf287('0x46')](handleError(_0x2ad7c7,null));};exports[_0xf287('0x4a')]=function(_0x6837f0,_0x3f1df5){var _0x3593fa={'key':_0x6837f0['body'][_0xf287('0x32')]};if(_0x6837f0[_0xf287('0x48')]['MailAccountId']){_0x3593fa['MailAccountId']=_0x6837f0['body']['MailAccountId'];}else if(_0x6837f0[_0xf287('0x48')][_0xf287('0x4b')]){_0x3593fa[_0xf287('0x4b')]=_0x6837f0[_0xf287('0x48')][_0xf287('0x4b')];}else if(_0x6837f0['body'][_0xf287('0x4c')]){_0x3593fa[_0xf287('0x4c')]=_0x6837f0[_0xf287('0x48')][_0xf287('0x4c')];}else if(_0x6837f0[_0xf287('0x48')][_0xf287('0x4d')]){_0x3593fa[_0xf287('0x4d')]=_0x6837f0[_0xf287('0x48')][_0xf287('0x4d')];}return db[_0xf287('0x42')]['find']({'where':_0x3593fa})['then'](function(_0x580bc3){if(_0x580bc3){throw new db['Sequelize'][(_0xf287('0x4e'))](_0xf287('0x4f'));}return db[_0xf287('0x42')][_0xf287('0x4a')](_0x6837f0['body']);})[_0xf287('0x27')](function(_0x51eaa7){var _0x49724b=_0x6837f0[_0xf287('0x50')]['get']({'plain':!![]});if(!_0x49724b)throw new Error(_0xf287('0x51'));if(_0x49724b['role']===_0xf287('0x50')){var _0xd25a12=_0x51eaa7[_0xf287('0x52')]({'plain':!![]});return db[_0xf287('0x53')][_0xf287('0x49')]({'where':{'name':_0xf287('0x28'),'userProfileId':_0x49724b['userProfileId']},'raw':!![]})['then'](function(_0x5a3b7d){if(_0x5a3b7d&&_0x5a3b7d[_0xf287('0x54')]===0x0){return db[_0xf287('0x29')]['create']({'name':_0xd25a12['name'],'resourceId':_0xd25a12['id'],'type':_0x5a3b7d['name'],'sectionId':_0x5a3b7d['id']},{})[_0xf287('0x27')](function(){return _0x51eaa7;});}else{return _0x51eaa7;}})[_0xf287('0x46')](function(_0x142e60){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x142e60);throw _0x142e60;});}return _0x51eaa7;})[_0xf287('0x27')](respondWithResult(_0x3f1df5,0xc9))['catch'](handleError(_0x3f1df5,null));};
\ No newline at end of file
+var _0x8ae2=['find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','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','../../config/logger','api','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','filter','merge','where','options','includeAll','include','findAll','rows','catch','show','params','length'];(function(_0x25bd47,_0x463f2a){var _0x636690=function(_0x11c096){while(--_0x11c096){_0x25bd47['push'](_0x25bd47['shift']());}};_0x636690(++_0x463f2a);}(_0x8ae2,0x121));var _0x28ae=function(_0x50bb58,_0xd8849e){_0x50bb58=_0x50bb58-0x0;var _0x34798c=_0x8ae2[_0x50bb58];return _0x34798c;};'use strict';var emlformat=require(_0x28ae('0x0'));var rimraf=require(_0x28ae('0x1'));var zipdir=require(_0x28ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28ae('0x3'));var moment=require('moment');var BPromise=require(_0x28ae('0x4'));var Mustache=require(_0x28ae('0x5'));var util=require(_0x28ae('0x6'));var path=require(_0x28ae('0x7'));var sox=require(_0x28ae('0x8'));var csv=require(_0x28ae('0x9'));var ejs=require(_0x28ae('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x28ae('0xb'));var squel=require(_0x28ae('0xc'));var crypto=require(_0x28ae('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x28ae('0xe'));var toCsv=require(_0x28ae('0x9'));var querystring=require(_0x28ae('0xf'));var Papa=require(_0x28ae('0x10'));var Redis=require(_0x28ae('0x11'));var authService=require(_0x28ae('0x12'));var qs=require(_0x28ae('0x13'));var as=require(_0x28ae('0x14'));var hardwareService=require(_0x28ae('0x15'));var logger=require(_0x28ae('0x16'))(_0x28ae('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x28ae('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c29f7,_0x135676){_0x135676=_0x135676||0xcc;return function(_0x2b7a6a){if(_0x2b7a6a){return _0x2c29f7[_0x28ae('0x19')](_0x135676);}return _0x2c29f7['status'](_0x135676)[_0x28ae('0x1a')]();};}function respondWithResult(_0x3acb99,_0x2ace5e){_0x2ace5e=_0x2ace5e||0xc8;return function(_0x46ad23){if(_0x46ad23){return _0x3acb99[_0x28ae('0x1b')](_0x2ace5e)[_0x28ae('0x1c')](_0x46ad23);}};}function respondWithFilteredResult(_0x1425c4,_0x3c7788){return function(_0x3871e7){if(_0x3871e7){var _0x5d4f9b=typeof _0x3c7788['offset']===_0x28ae('0x1d')&&typeof _0x3c7788[_0x28ae('0x1e')]===_0x28ae('0x1d');var _0x40ed17=_0x3871e7[_0x28ae('0x1f')];var _0x5e6927=_0x5d4f9b?0x0:_0x3c7788[_0x28ae('0x20')];var _0x43e0d1=_0x5d4f9b?_0x3871e7[_0x28ae('0x1f')]:_0x3c7788[_0x28ae('0x20')]+_0x3c7788[_0x28ae('0x1e')];var _0x23e690;if(_0x43e0d1>=_0x40ed17){_0x43e0d1=_0x40ed17;_0x23e690=0xc8;}else{_0x23e690=0xce;}_0x1425c4['status'](_0x23e690);return _0x1425c4[_0x28ae('0x21')](_0x28ae('0x22'),_0x5e6927+'-'+_0x43e0d1+'/'+_0x40ed17)[_0x28ae('0x1c')](_0x3871e7);}return null;};}function patchUpdates(_0xc3ed9c){return function(_0x3ff6bc){try{jsonpatch[_0x28ae('0x23')](_0x3ff6bc,_0xc3ed9c,!![]);}catch(_0x1ab61f){return BPromise[_0x28ae('0x24')](_0x1ab61f);}return _0x3ff6bc[_0x28ae('0x25')]();};}function saveUpdates(_0x28dd4e,_0x2bd125){return function(_0x582db1){if(_0x582db1){return _0x582db1[_0x28ae('0x26')](_0x28dd4e)[_0x28ae('0x27')](function(_0x1bd2d6){return _0x1bd2d6;});}return null;};}function removeEntity(_0x5550d7,_0x4f6c1d){return function(_0x3b70a6){if(_0x3b70a6){return _0x3b70a6[_0x28ae('0x28')]()[_0x28ae('0x27')](function(){var _0x1e5607=_0x3b70a6[_0x28ae('0x29')]({'plain':!![]});var _0x22a48a=_0x28ae('0x2a');return db[_0x28ae('0x2b')][_0x28ae('0x28')]({'where':{'type':_0x22a48a,'resourceId':_0x1e5607['id']}})[_0x28ae('0x27')](function(){return _0x3b70a6;});})[_0x28ae('0x27')](function(){_0x5550d7[_0x28ae('0x1b')](0xcc)[_0x28ae('0x1a')]();});}};}function handleEntityNotFound(_0x2eef56,_0x5c42e2){return function(_0x505298){if(!_0x505298){_0x2eef56[_0x28ae('0x19')](0x194);}return _0x505298;};}function handleError(_0x5afd82,_0x4c0672){_0x4c0672=_0x4c0672||0x1f4;return function(_0x306df3){logger[_0x28ae('0x2c')](_0x306df3[_0x28ae('0x2d')]);if(_0x306df3['name']){delete _0x306df3[_0x28ae('0x2e')];}_0x5afd82['status'](_0x4c0672)[_0x28ae('0x2f')](_0x306df3);};}exports[_0x28ae('0x30')]=function(_0x143bec,_0x518ec8){var _0x30cb9e={},_0x91fac8={},_0x469913={'count':0x0,'rows':[]};var _0x509f23=_[_0x28ae('0x31')](db[_0x28ae('0x32')][_0x28ae('0x33')],function(_0x122659){return{'name':_0x122659[_0x28ae('0x34')],'type':_0x122659['type']['key']};});_0x91fac8[_0x28ae('0x35')]=_[_0x28ae('0x31')](_0x509f23,_0x28ae('0x2e'));_0x91fac8[_0x28ae('0x36')]=_[_0x28ae('0x37')](_0x143bec[_0x28ae('0x36')]);_0x91fac8[_0x28ae('0x38')]=_[_0x28ae('0x39')](_0x91fac8[_0x28ae('0x35')],_0x91fac8[_0x28ae('0x36')]);_0x30cb9e[_0x28ae('0x3a')]=_[_0x28ae('0x39')](_0x91fac8['model'],qs[_0x28ae('0x3b')](_0x143bec['query'][_0x28ae('0x3b')]));_0x30cb9e['attributes']=_0x30cb9e[_0x28ae('0x3a')]['length']?_0x30cb9e[_0x28ae('0x3a')]:_0x91fac8['model'];if(!_0x143bec[_0x28ae('0x36')][_0x28ae('0x3c')](_0x28ae('0x3d'))){_0x30cb9e['limit']=qs[_0x28ae('0x1e')](_0x143bec[_0x28ae('0x36')][_0x28ae('0x1e')]);_0x30cb9e[_0x28ae('0x20')]=qs[_0x28ae('0x20')](_0x143bec['query'][_0x28ae('0x20')]);}_0x30cb9e[_0x28ae('0x3e')]=qs['sort'](_0x143bec[_0x28ae('0x36')]['sort']);_0x30cb9e['where']=qs[_0x28ae('0x38')](_['pick'](_0x143bec[_0x28ae('0x36')],_0x91fac8['filters']),_0x509f23);if(_0x143bec['query'][_0x28ae('0x3f')]){_0x30cb9e['where']=_[_0x28ae('0x40')](_0x30cb9e[_0x28ae('0x41')],{'$or':[{'key':{'$like':'%'+_0x143bec[_0x28ae('0x36')][_0x28ae('0x3f')]+'%'}},{'value':{'$like':'%'+_0x143bec[_0x28ae('0x36')][_0x28ae('0x3f')]+'%'}}]});}_0x30cb9e=_[_0x28ae('0x40')]({},_0x30cb9e,_0x143bec[_0x28ae('0x42')]);var _0x3d4d4d={'where':_0x30cb9e[_0x28ae('0x41')]};return db[_0x28ae('0x32')][_0x28ae('0x1f')](_0x3d4d4d)[_0x28ae('0x27')](function(_0x510608){_0x469913['count']=_0x510608;if(_0x143bec['query'][_0x28ae('0x43')]){_0x30cb9e[_0x28ae('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0x28ae('0x45')](_0x30cb9e);})[_0x28ae('0x27')](function(_0x327b31){_0x469913[_0x28ae('0x46')]=_0x327b31;return _0x469913;})['then'](respondWithFilteredResult(_0x518ec8,_0x30cb9e))[_0x28ae('0x47')](handleError(_0x518ec8,null));};exports[_0x28ae('0x48')]=function(_0x2d81d6,_0x6a7a27){var _0x59588d={'raw':!![],'where':{'id':_0x2d81d6[_0x28ae('0x49')]['id']}},_0x19e722={};_0x19e722[_0x28ae('0x35')]=_[_0x28ae('0x37')](db['CannedAnswer'][_0x28ae('0x33')]);_0x19e722[_0x28ae('0x36')]=_['keys'](_0x2d81d6[_0x28ae('0x36')]);_0x19e722[_0x28ae('0x38')]=_['intersection'](_0x19e722['model'],_0x19e722[_0x28ae('0x36')]);_0x59588d[_0x28ae('0x3a')]=_[_0x28ae('0x39')](_0x19e722[_0x28ae('0x35')],qs['fields'](_0x2d81d6[_0x28ae('0x36')][_0x28ae('0x3b')]));_0x59588d[_0x28ae('0x3a')]=_0x59588d[_0x28ae('0x3a')][_0x28ae('0x4a')]?_0x59588d[_0x28ae('0x3a')]:_0x19e722[_0x28ae('0x35')];if(_0x2d81d6['query'][_0x28ae('0x43')]){_0x59588d['include']=[{'all':!![]}];}_0x59588d=_['merge']({},_0x59588d,_0x2d81d6[_0x28ae('0x42')]);return db[_0x28ae('0x32')][_0x28ae('0x4b')](_0x59588d)[_0x28ae('0x27')](handleEntityNotFound(_0x6a7a27,null))[_0x28ae('0x27')](respondWithResult(_0x6a7a27,null))[_0x28ae('0x47')](handleError(_0x6a7a27,null));};exports[_0x28ae('0x26')]=function(_0xc2011,_0x5a4e39){if(_0xc2011[_0x28ae('0x4c')]['id']){delete _0xc2011[_0x28ae('0x4c')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0xc2011[_0x28ae('0x49')]['id']}})[_0x28ae('0x27')](handleEntityNotFound(_0x5a4e39,null))[_0x28ae('0x27')](saveUpdates(_0xc2011[_0x28ae('0x4c')],null))[_0x28ae('0x27')](respondWithResult(_0x5a4e39,null))['catch'](handleError(_0x5a4e39,null));};exports['destroy']=function(_0x5268a3,_0x17f523){return db[_0x28ae('0x32')][_0x28ae('0x4b')]({'where':{'id':_0x5268a3[_0x28ae('0x49')]['id']}})[_0x28ae('0x27')](handleEntityNotFound(_0x17f523,null))[_0x28ae('0x27')](removeEntity(_0x17f523,null))[_0x28ae('0x47')](handleError(_0x17f523,null));};exports[_0x28ae('0x4d')]=function(_0x1e118b,_0x2e4bbd){var _0x5db9c8={'key':_0x1e118b['body']['key']};if(_0x1e118b[_0x28ae('0x4c')][_0x28ae('0x4e')]){_0x5db9c8[_0x28ae('0x4e')]=_0x1e118b['body'][_0x28ae('0x4e')];}else if(_0x1e118b[_0x28ae('0x4c')][_0x28ae('0x4f')]){_0x5db9c8[_0x28ae('0x4f')]=_0x1e118b[_0x28ae('0x4c')][_0x28ae('0x4f')];}else if(_0x1e118b[_0x28ae('0x4c')][_0x28ae('0x50')]){_0x5db9c8['OpenchannelAccountId']=_0x1e118b[_0x28ae('0x4c')][_0x28ae('0x50')];}else if(_0x1e118b[_0x28ae('0x4c')][_0x28ae('0x51')]){_0x5db9c8[_0x28ae('0x51')]=_0x1e118b['body'][_0x28ae('0x51')];}return db[_0x28ae('0x32')][_0x28ae('0x4b')]({'where':_0x5db9c8})[_0x28ae('0x27')](function(_0x1715bc){if(_0x1715bc){throw new db[(_0x28ae('0x52'))][(_0x28ae('0x53'))](_0x28ae('0x54'));}return db[_0x28ae('0x32')][_0x28ae('0x4d')](_0x1e118b[_0x28ae('0x4c')]);})['then'](function(_0x29a172){var _0x26e836=_0x1e118b['user'][_0x28ae('0x29')]({'plain':!![]});if(!_0x26e836)throw new Error(_0x28ae('0x55'));if(_0x26e836[_0x28ae('0x56')]===_0x28ae('0x57')){var _0x1c0f69=_0x29a172[_0x28ae('0x29')]({'plain':!![]});return db[_0x28ae('0x58')][_0x28ae('0x4b')]({'where':{'name':_0x28ae('0x2a'),'userProfileId':_0x26e836['userProfileId']},'raw':!![]})[_0x28ae('0x27')](function(_0x2141bc){if(_0x2141bc&&_0x2141bc[_0x28ae('0x59')]===0x0){return db[_0x28ae('0x2b')][_0x28ae('0x4d')]({'name':_0x1c0f69[_0x28ae('0x2e')],'resourceId':_0x1c0f69['id'],'type':_0x2141bc[_0x28ae('0x2e')],'sectionId':_0x2141bc['id']},{})[_0x28ae('0x27')](function(){return _0x29a172;});}else{return _0x29a172;}})[_0x28ae('0x47')](function(_0x1d91ca){logger[_0x28ae('0x2c')](_0x28ae('0x5a'),_0x1d91ca);throw _0x1d91ca;});}return _0x29a172;})[_0x28ae('0x27')](respondWithResult(_0x2e4bbd,0xc9))[_0x28ae('0x47')](handleError(_0x2e4bbd,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index f36ed34..78ca424 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 _0xa4e3=['CannedAnswer','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xa4e3,0x17c));var _0x3a4e=function(_0x5637ab,_0x38755b){_0x5637ab=_0x5637ab-0x0;var _0x50b5a7=_0xa4e3[_0x5637ab];return _0x50b5a7;};'use strict';var _=require(_0x3a4e('0x0'));var util=require(_0x3a4e('0x1'));var logger=require('../../config/logger')(_0x3a4e('0x2'));var moment=require(_0x3a4e('0x3'));var BPromise=require(_0x3a4e('0x4'));var rp=require(_0x3a4e('0x5'));var fs=require('fs');var path=require(_0x3a4e('0x6'));var rimraf=require(_0x3a4e('0x7'));var config=require(_0x3a4e('0x8'));var attributes=require(_0x3a4e('0x9'));module[_0x3a4e('0xa')]=function(_0xfbe0e5,_0x1f26be){return _0xfbe0e5[_0x3a4e('0xb')](_0x3a4e('0xc'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3a4e('0xd')});};
\ No newline at end of file
+var _0x74ce=['util','../../config/logger','moment','request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4b75e4,_0x2d5621){var _0x3e2178=function(_0x492872){while(--_0x492872){_0x4b75e4['push'](_0x4b75e4['shift']());}};_0x3e2178(++_0x2d5621);}(_0x74ce,0x8e));var _0xe74c=function(_0x103c0d,_0x2c37d0){_0x103c0d=_0x103c0d-0x0;var _0x1b2578=_0x74ce[_0x103c0d];return _0x1b2578;};'use strict';var _=require(_0xe74c('0x0'));var util=require(_0xe74c('0x1'));var logger=require(_0xe74c('0x2'))('api');var moment=require(_0xe74c('0x3'));var BPromise=require('bluebird');var rp=require(_0xe74c('0x4'));var fs=require('fs');var path=require(_0xe74c('0x5'));var rimraf=require('rimraf');var config=require(_0xe74c('0x6'));var attributes=require(_0xe74c('0x7'));module[_0xe74c('0x8')]=function(_0x5a19f8,_0x1d436b){return _0x5a19f8[_0xe74c('0x9')]('CannedAnswer',attributes,{'tableName':_0xe74c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe74c('0xb'),'collate':_0xe74c('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 6d5326f..1cc2011 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 _0xdb62=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','then','CannedAnswer,\x20%s,\x20%s','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','moment'];(function(_0x43466a,_0x7d42ef){var _0x4a7f49=function(_0xbfa96b){while(--_0xbfa96b){_0x43466a['push'](_0x43466a['shift']());}};_0x4a7f49(++_0x7d42ef);}(_0xdb62,0x83));var _0x2db6=function(_0x37de50,_0x27f82a){_0x37de50=_0x37de50-0x0;var _0x2c37dc=_0xdb62[_0x37de50];return _0x2c37dc;};'use strict';var _=require(_0x2db6('0x0'));var util=require('util');var moment=require(_0x2db6('0x1'));var BPromise=require('bluebird');var rs=require(_0x2db6('0x2'));var fs=require('fs');var Redis=require(_0x2db6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2db6('0x4'));var logger=require(_0x2db6('0x5'))(_0x2db6('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2db6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xc3e21f,_0x3f8e06,_0x588f8c){return new BPromise(function(_0x20bf52,_0x1aa213){return client[_0x2db6('0x8')](_0xc3e21f,_0x588f8c)[_0x2db6('0x9')](function(_0x3c08a4){logger['info'](_0x2db6('0xa'),_0x3f8e06,'request\x20sent');logger[_0x2db6('0xb')](_0x2db6('0xc'),_0x3f8e06,_0x2db6('0xd'),JSON[_0x2db6('0xe')](_0x3c08a4));if(_0x3c08a4[_0x2db6('0xf')]){if(_0x3c08a4['error'][_0x2db6('0x10')]===0x1f4){logger[_0x2db6('0xf')](_0x2db6('0xa'),_0x3f8e06,_0x3c08a4['error'][_0x2db6('0x11')]);return _0x1aa213(_0x3c08a4[_0x2db6('0xf')][_0x2db6('0x11')]);}logger['error'](_0x2db6('0xa'),_0x3f8e06,_0x3c08a4[_0x2db6('0xf')]['message']);return _0x20bf52(_0x3c08a4[_0x2db6('0xf')]['message']);}else{logger[_0x2db6('0x12')]('CannedAnswer,\x20%s,\x20%s',_0x3f8e06,_0x2db6('0xd'));_0x20bf52(_0x3c08a4['result'][_0x2db6('0x11')]);}})['catch'](function(_0x59a20b){logger[_0x2db6('0xf')](_0x2db6('0xa'),_0x3f8e06,_0x59a20b);_0x1aa213(_0x59a20b);});});}
\ No newline at end of file
+var _0xdcb1=['client','http','request','then','info','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','CannedAnswer,\x20%s,\x20%s','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x5767ef,_0x5cb686){var _0x17f376=function(_0x249cb6){while(--_0x249cb6){_0x5767ef['push'](_0x5767ef['shift']());}};_0x17f376(++_0x5cb686);}(_0xdcb1,0x1c6));var _0x1dcb=function(_0x391415,_0x342c56){_0x391415=_0x391415-0x0;var _0x229fa4=_0xdcb1[_0x391415];return _0x229fa4;};'use strict';var _=require(_0x1dcb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1dcb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1dcb('0x2'));var db=require(_0x1dcb('0x3'))['db'];var utils=require(_0x1dcb('0x4'));var logger=require('../../config/logger')(_0x1dcb('0x5'));var config=require(_0x1dcb('0x6'));var jayson=require(_0x1dcb('0x7'));var client=jayson[_0x1dcb('0x8')][_0x1dcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x109372,_0x48f7c3,_0x2261f2){return new BPromise(function(_0x45df2a,_0x4ed973){return client[_0x1dcb('0xa')](_0x109372,_0x2261f2)[_0x1dcb('0xb')](function(_0x245314){logger[_0x1dcb('0xc')]('CannedAnswer,\x20%s,\x20%s',_0x48f7c3,'request\x20sent');logger[_0x1dcb('0xd')](_0x1dcb('0xe'),_0x48f7c3,'request\x20sent',JSON[_0x1dcb('0xf')](_0x245314));if(_0x245314[_0x1dcb('0x10')]){if(_0x245314[_0x1dcb('0x10')][_0x1dcb('0x11')]===0x1f4){logger[_0x1dcb('0x10')](_0x1dcb('0x12'),_0x48f7c3,_0x245314[_0x1dcb('0x10')]['message']);return _0x4ed973(_0x245314[_0x1dcb('0x10')][_0x1dcb('0x13')]);}logger[_0x1dcb('0x10')](_0x1dcb('0x12'),_0x48f7c3,_0x245314[_0x1dcb('0x10')][_0x1dcb('0x13')]);return _0x45df2a(_0x245314[_0x1dcb('0x10')][_0x1dcb('0x13')]);}else{logger[_0x1dcb('0xc')](_0x1dcb('0x12'),_0x48f7c3,'request\x20sent');_0x45df2a(_0x245314[_0x1dcb('0x14')][_0x1dcb('0x13')]);}})[_0x1dcb('0x15')](function(_0x2ee89b){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x48f7c3,_0x2ee89b);_0x4ed973(_0x2ee89b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index d33d4ee..9a6fa6b 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 _0xc872=['delete','destroy','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0xc872,0x1f2));var _0x2c87=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0xc872[_0xe15270];return _0x1e813b;};'use strict';var multer=require('multer');var util=require(_0x2c87('0x0'));var path=require(_0x2c87('0x1'));var timeout=require('connect-timeout');var express=require(_0x2c87('0x2'));var router=express['Router']();var fs_extra=require(_0x2c87('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2c87('0x4'));var config=require(_0x2c87('0x5'));var controller=require(_0x2c87('0x6'));router[_0x2c87('0x7')]('/',auth[_0x2c87('0x8')](),controller['index']);router[_0x2c87('0x7')](_0x2c87('0x9'),auth['isAuthenticated'](),controller[_0x2c87('0xa')]);router[_0x2c87('0xb')]('/',auth[_0x2c87('0x8')](),controller['create']);router['put'](_0x2c87('0x9'),auth[_0x2c87('0x8')](),controller['update']);router[_0x2c87('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x2c87('0xd')]);module[_0x2c87('0xe')]=router;
\ No newline at end of file
+var _0xa13a=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','create','put','/:id','update','delete'];(function(_0x5332a8,_0x2643a3){var _0x3b03f1=function(_0x334b38){while(--_0x334b38){_0x5332a8['push'](_0x5332a8['shift']());}};_0x3b03f1(++_0x2643a3);}(_0xa13a,0x80));var _0xaa13=function(_0x35f8e0,_0x77f00d){_0x35f8e0=_0x35f8e0-0x0;var _0x94c4f9=_0xa13a[_0x35f8e0];return _0x94c4f9;};'use strict';var multer=require(_0xaa13('0x0'));var util=require(_0xaa13('0x1'));var path=require(_0xaa13('0x2'));var timeout=require(_0xaa13('0x3'));var express=require('express');var router=express[_0xaa13('0x4')]();var fs_extra=require(_0xaa13('0x5'));var auth=require(_0xaa13('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xaa13('0x7'));var controller=require('./cannedAnswer.controller');router[_0xaa13('0x8')]('/',auth[_0xaa13('0x9')](),controller['index']);router[_0xaa13('0x8')]('/:id',auth[_0xaa13('0x9')](),controller[_0xaa13('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaa13('0xb')]);router[_0xaa13('0xc')](_0xaa13('0xd'),auth[_0xaa13('0x9')](),controller[_0xaa13('0xe')]);router[_0xaa13('0xf')]('/:id',auth[_0xaa13('0x9')](),controller[_0xaa13('0x10')]);module[_0xaa13('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index a5dfa01..9e2386a 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 _0x5c26=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x56bad9,_0x32f618){var _0x296e15=function(_0x32214d){while(--_0x32214d){_0x56bad9['push'](_0x56bad9['shift']());}};_0x296e15(++_0x32f618);}(_0x5c26,0xf0));var _0x65c2=function(_0x38c62a,_0x30022c){_0x38c62a=_0x38c62a-0x0;var _0xe4f41f=_0x5c26[_0x38c62a];return _0xe4f41f;};'use strict';var Sequelize=require('sequelize');module[_0x65c2('0x0')]={'calldate':{'type':Sequelize[_0x65c2('0x1')],'allowNull':![],'defaultValue':_0x65c2('0x2')},'clid':{'type':Sequelize[_0x65c2('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x65c2('0x3')]},'channel':{'type':Sequelize[_0x65c2('0x3')]},'dstchannel':{'type':Sequelize[_0x65c2('0x3')]},'lastapp':{'type':Sequelize[_0x65c2('0x3')]},'lastdata':{'type':Sequelize[_0x65c2('0x3')]},'duration':{'type':Sequelize[_0x65c2('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x65c2('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x65c2('0x3')]},'amaflags':{'type':Sequelize[_0x65c2('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x65c2('0x3')]},'userfield':{'type':Sequelize[_0x65c2('0x3')]},'uniqueid':{'type':Sequelize[_0x65c2('0x3')]},'linkedid':{'type':Sequelize[_0x65c2('0x3')]},'sequence':{'type':Sequelize[_0x65c2('0x3')]},'peeraccount':{'type':Sequelize[_0x65c2('0x3')]},'type':{'type':Sequelize[_0x65c2('0x3')]},'tag':{'type':Sequelize[_0x65c2('0x3')]}};
\ No newline at end of file
+var _0x6260=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x43a979,_0x1fdec3){var _0xb5001=function(_0x3b32c1){while(--_0x3b32c1){_0x43a979['push'](_0x43a979['shift']());}};_0xb5001(++_0x1fdec3);}(_0x6260,0xce));var _0x0626=function(_0xd02bb,_0x26e2d0){_0xd02bb=_0xd02bb-0x0;var _0x1cdf23=_0x6260[_0xd02bb];return _0x1cdf23;};'use strict';var Sequelize=require(_0x0626('0x0'));module[_0x0626('0x1')]={'calldate':{'type':Sequelize[_0x0626('0x2')],'allowNull':![],'defaultValue':_0x0626('0x3')},'clid':{'type':Sequelize[_0x0626('0x4')]},'src':{'type':Sequelize[_0x0626('0x4')]},'dst':{'type':Sequelize[_0x0626('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x0626('0x4')]},'lastapp':{'type':Sequelize[_0x0626('0x4')]},'lastdata':{'type':Sequelize[_0x0626('0x4')]},'duration':{'type':Sequelize[_0x0626('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0626('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0626('0x4')]},'amaflags':{'type':Sequelize[_0x0626('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x0626('0x4')]},'uniqueid':{'type':Sequelize[_0x0626('0x4')]},'linkedid':{'type':Sequelize[_0x0626('0x4')]},'sequence':{'type':Sequelize[_0x0626('0x4')]},'peeraccount':{'type':Sequelize[_0x0626('0x4')]},'type':{'type':Sequelize[_0x0626('0x4')]},'tag':{'type':Sequelize[_0x0626('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index f18786a..4888708 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 _0xb10b=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','Cdr','includeAll','include','rows','show','params','find','catch','create','body','describe','eml-format','zip-dir'];(function(_0x201fac,_0x197176){var _0x435913=function(_0x33d9ad){while(--_0x33d9ad){_0x201fac['push'](_0x201fac['shift']());}};_0x435913(++_0x197176);}(_0xb10b,0x12a));var _0xbb10=function(_0x65f140,_0x45cbc7){_0x65f140=_0x65f140-0x0;var _0x18fbda=_0xb10b[_0x65f140];return _0x18fbda;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['Cdr'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'all':!![]}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x1c7fae){_0x2e0249[_0xbb10('0x43')]=_0x1c7fae;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x44')]=function(_0x331751,_0x23dc18){var _0x403beb={'raw':!![],'where':{'id':_0x331751[_0xbb10('0x45')]['id']}},_0x5e2cfa={};_0x5e2cfa[_0xbb10('0x2f')]=_['keys'](db['Cdr'][_0xbb10('0x2c')]);_0x5e2cfa['query']=_[_0xbb10('0x30')](_0x331751[_0xbb10('0x31')]);_0x5e2cfa['filters']=_[_0xbb10('0x32')](_0x5e2cfa[_0xbb10('0x2f')],_0x5e2cfa[_0xbb10('0x31')]);_0x403beb['attributes']=_[_0xbb10('0x32')](_0x5e2cfa[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x331751[_0xbb10('0x31')][_0xbb10('0x34')]));_0x403beb[_0xbb10('0x33')]=_0x403beb[_0xbb10('0x33')][_0xbb10('0x35')]?_0x403beb[_0xbb10('0x33')]:_0x5e2cfa[_0xbb10('0x2f')];if(_0x331751[_0xbb10('0x31')][_0xbb10('0x41')]){_0x403beb['include']=[{'all':!![]}];}_0x403beb=_[_0xbb10('0x3e')]({},_0x403beb,_0x331751[_0xbb10('0x3f')]);return db['Cdr'][_0xbb10('0x46')](_0x403beb)[_0xbb10('0x23')](handleEntityNotFound(_0x23dc18,null))[_0xbb10('0x23')](respondWithResult(_0x23dc18,null))[_0xbb10('0x47')](handleError(_0x23dc18,null));};exports[_0xbb10('0x48')]=function(_0x39f0de,_0x3e06b0){return db['Cdr']['create'](_0x39f0de[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x3e06b0,0xc9))[_0xbb10('0x47')](handleError(_0x3e06b0,null));};exports['update']=function(_0x5f0c12,_0x3cd6f3){if(_0x5f0c12[_0xbb10('0x49')]['id']){delete _0x5f0c12[_0xbb10('0x49')]['id'];}return db[_0xbb10('0x40')][_0xbb10('0x46')]({'where':{'id':_0x5f0c12[_0xbb10('0x45')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x3cd6f3,null))[_0xbb10('0x23')](saveUpdates(_0x5f0c12[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x3cd6f3,null))['catch'](handleError(_0x3cd6f3,null));};exports['destroy']=function(_0x412e13,_0x467dba){return db[_0xbb10('0x40')][_0xbb10('0x46')]({'where':{'id':_0x412e13[_0xbb10('0x45')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x467dba,null))[_0xbb10('0x23')](removeEntity(_0x467dba,null))[_0xbb10('0x47')](handleError(_0x467dba,null));};exports[_0xbb10('0x4a')]=function(_0x1214f7,_0x19ca3e){return db[_0xbb10('0x40')][_0xbb10('0x4a')]()[_0xbb10('0x23')](respondWithResult(_0x19ca3e,null))[_0xbb10('0x47')](handleError(_0x19ca3e,null));};
\ No newline at end of file
+var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','Cdr','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['Cdr'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':!![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 69dc8a6..0577450 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 _0xf494=['disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','define','accountcode','calldate'];(function(_0x559060,_0x38a41c){var _0x9b469e=function(_0x1ed735){while(--_0x1ed735){_0x559060['push'](_0x559060['shift']());}};_0x9b469e(++_0x38a41c);}(_0xf494,0x1c6));var _0x4f49=function(_0x4daa0e,_0x31698c){_0x4daa0e=_0x4daa0e-0x0;var _0x384c04=_0xf494[_0x4daa0e];return _0x384c04;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Cdr',attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]},{'name':_0x4f49('0xd'),'fields':[_0x4f49('0xd')]},{'name':_0x4f49('0xe'),'fields':[_0x4f49('0xe')]},{'name':_0x4f49('0xf'),'fields':[_0x4f49('0xf')]},{'name':'src','fields':[_0x4f49('0x10')]},{'name':_0x4f49('0x11'),'fields':['uniqueid']}],'timestamps':![]});};
\ No newline at end of file
+var _0x7c09=['accountcode','calldate','disposition','dst','src','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','define','Cdr','cdr'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c09,0x102));var _0x97c0=function(_0x4a9dcf,_0x2c4627){_0x4a9dcf=_0x4a9dcf-0x0;var _0xc9ee5d=_0x7c09[_0x4a9dcf];return _0xc9ee5d;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var logger=require(_0x97c0('0x1'))('api');var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var attributes=require(_0x97c0('0x8'));module['exports']=function(_0x4b2f81,_0x590368){return _0x4b2f81[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'paranoid':![],'indexes':[{'name':_0x97c0('0xc'),'fields':[_0x97c0('0xc')]},{'name':'calldate','fields':[_0x97c0('0xd')]},{'name':'disposition','fields':[_0x97c0('0xe')]},{'name':_0x97c0('0xf'),'fields':['dst']},{'name':'src','fields':[_0x97c0('0x10')]},{'name':_0x97c0('0x11'),'fields':[_0x97c0('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 179fbd3..4904b51 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 _0xe159=['info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xe159,0x16f));var _0x9e15=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe159[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x9e15('0x0'));var util=require(_0x9e15('0x1'));var moment=require(_0x9e15('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e15('0x3'))['db'];var utils=require(_0x9e15('0x4'));var logger=require(_0x9e15('0x5'))(_0x9e15('0x6'));var config=require(_0x9e15('0x7'));var jayson=require(_0x9e15('0x8'));var client=jayson[_0x9e15('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1595d1,_0x251158,_0x64d057){return new BPromise(function(_0xc55082,_0x16ad3a){return client[_0x9e15('0xa')](_0x1595d1,_0x64d057)['then'](function(_0xd938a){logger[_0x9e15('0xb')](_0x9e15('0xc'),_0x251158,_0x9e15('0xd'));logger[_0x9e15('0xe')](_0x9e15('0xf'),_0x251158,_0x9e15('0xd'),JSON[_0x9e15('0x10')](_0xd938a));if(_0xd938a[_0x9e15('0x11')]){if(_0xd938a['error'][_0x9e15('0x12')]===0x1f4){logger[_0x9e15('0x11')]('Cdr,\x20%s,\x20%s',_0x251158,_0xd938a[_0x9e15('0x11')][_0x9e15('0x13')]);return _0x16ad3a(_0xd938a[_0x9e15('0x11')][_0x9e15('0x13')]);}logger['error'](_0x9e15('0xc'),_0x251158,_0xd938a[_0x9e15('0x11')][_0x9e15('0x13')]);return _0xc55082(_0xd938a[_0x9e15('0x11')][_0x9e15('0x13')]);}else{logger['info'](_0x9e15('0xc'),_0x251158,_0x9e15('0xd'));_0xc55082(_0xd938a['result'][_0x9e15('0x13')]);}})[_0x9e15('0x14')](function(_0x58b15d){logger['error']('Cdr,\x20%s,\x20%s',_0x251158,_0x58b15d);_0x16ad3a(_0x58b15d);});});}
\ No newline at end of file
+var _0xe43f=['message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s'];(function(_0x4500ad,_0x43cc22){var _0x1c5add=function(_0xdd5f99){while(--_0xdd5f99){_0x4500ad['push'](_0x4500ad['shift']());}};_0x1c5add(++_0x43cc22);}(_0xe43f,0x17c));var _0xfe43=function(_0x16b992,_0x43d74c){_0x16b992=_0x16b992-0x0;var _0x385c78=_0xe43f[_0x16b992];return _0x385c78;};'use strict';var _=require('lodash');var util=require(_0xfe43('0x0'));var moment=require('moment');var BPromise=require(_0xfe43('0x1'));var rs=require(_0xfe43('0x2'));var fs=require('fs');var Redis=require(_0xfe43('0x3'));var db=require(_0xfe43('0x4'))['db'];var utils=require(_0xfe43('0x5'));var logger=require(_0xfe43('0x6'))('rpc');var config=require(_0xfe43('0x7'));var jayson=require(_0xfe43('0x8'));var client=jayson[_0xfe43('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c76ca,_0x3b98c6,_0xb45177){return new BPromise(function(_0x5b22c0,_0x26b6f5){return client[_0xfe43('0xa')](_0x4c76ca,_0xb45177)['then'](function(_0x44c80d){logger[_0xfe43('0xb')]('Cdr,\x20%s,\x20%s',_0x3b98c6,_0xfe43('0xc'));logger[_0xfe43('0xd')](_0xfe43('0xe'),_0x3b98c6,_0xfe43('0xc'),JSON[_0xfe43('0xf')](_0x44c80d));if(_0x44c80d[_0xfe43('0x10')]){if(_0x44c80d['error'][_0xfe43('0x11')]===0x1f4){logger[_0xfe43('0x10')](_0xfe43('0x12'),_0x3b98c6,_0x44c80d[_0xfe43('0x10')][_0xfe43('0x13')]);return _0x26b6f5(_0x44c80d['error'][_0xfe43('0x13')]);}logger[_0xfe43('0x10')](_0xfe43('0x12'),_0x3b98c6,_0x44c80d[_0xfe43('0x10')][_0xfe43('0x13')]);return _0x5b22c0(_0x44c80d[_0xfe43('0x10')][_0xfe43('0x13')]);}else{logger[_0xfe43('0xb')](_0xfe43('0x12'),_0x3b98c6,_0xfe43('0xc'));_0x5b22c0(_0x44c80d[_0xfe43('0x14')]['message']);}})['catch'](function(_0x38e38){logger['error'](_0xfe43('0x12'),_0x3b98c6,_0x38e38);_0x26b6f5(_0x38e38);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 302c471..67c911f 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 _0x5f7b=['create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cdr.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x4d421c,_0x84ccf0){var _0x28bb3d=function(_0x32df55){while(--_0x32df55){_0x4d421c['push'](_0x4d421c['shift']());}};_0x28bb3d(++_0x84ccf0);}(_0x5f7b,0x1b9));var _0xb5f7=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x5f7b[_0x819464];return _0x49dcc0;};'use strict';var multer=require(_0xb5f7('0x0'));var util=require(_0xb5f7('0x1'));var path=require(_0xb5f7('0x2'));var timeout=require(_0xb5f7('0x3'));var express=require(_0xb5f7('0x4'));var router=express[_0xb5f7('0x5')]();var fs_extra=require(_0xb5f7('0x6'));var auth=require(_0xb5f7('0x7'));var interaction=require(_0xb5f7('0x8'));var config=require('../../config/environment');var controller=require(_0xb5f7('0x9'));router[_0xb5f7('0xa')]('/',auth[_0xb5f7('0xb')](),controller['index']);router[_0xb5f7('0xa')]('/describe',auth[_0xb5f7('0xb')](),controller[_0xb5f7('0xc')]);router[_0xb5f7('0xa')](_0xb5f7('0xd'),auth[_0xb5f7('0xb')](),controller[_0xb5f7('0xe')]);router['post']('/',auth[_0xb5f7('0xb')](),controller[_0xb5f7('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb5f7('0x10')]);router[_0xb5f7('0x11')](_0xb5f7('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xb5f7('0x12')]=router;
\ No newline at end of file
+var _0x3d5d=['../../components/auth/service','get','isAuthenticated','/describe','describe','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3d5d,0x173));var _0xd3d5=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0x3d5d[_0xcd0918];return _0x250704;};'use strict';var multer=require(_0xd3d5('0x0'));var util=require(_0xd3d5('0x1'));var path=require(_0xd3d5('0x2'));var timeout=require(_0xd3d5('0x3'));var express=require(_0xd3d5('0x4'));var router=express[_0xd3d5('0x5')]();var fs_extra=require(_0xd3d5('0x6'));var auth=require(_0xd3d5('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cdr.controller');router[_0xd3d5('0x8')]('/',auth[_0xd3d5('0x9')](),controller['index']);router[_0xd3d5('0x8')](_0xd3d5('0xa'),auth[_0xd3d5('0x9')](),controller[_0xd3d5('0xb')]);router[_0xd3d5('0x8')]('/:id',auth[_0xd3d5('0x9')](),controller[_0xd3d5('0xc')]);router[_0xd3d5('0xd')]('/',auth[_0xd3d5('0x9')](),controller[_0xd3d5('0xe')]);router[_0xd3d5('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd3d5('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd3d5('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 939983b..b0850c1 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 _0xfebd=['TEXT','exports','INTEGER','STRING'];(function(_0x276c01,_0x32fad2){var _0x3e87f7=function(_0x4680cc){while(--_0x4680cc){_0x276c01['push'](_0x276c01['shift']());}};_0x3e87f7(++_0x32fad2);}(_0xfebd,0xb5));var _0xdfeb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfebd[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0xdfeb('0x0')]={'priority':{'type':Sequelize[_0xdfeb('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xdfeb('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xdfeb('0x3')]()},'description':{'type':Sequelize[_0xdfeb('0x2')]},'interval':{'type':Sequelize[_0xdfeb('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x93d8=['noop','TEXT','*,*,*,*','INTEGER','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x93d8,0x8f));var _0x893d=function(_0x1b2232,_0x52f48f){_0x1b2232=_0x1b2232-0x0;var _0xa97379=_0x93d8[_0x1b2232];return _0xa97379;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x893d('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x893d('0x1')],'allowNull':![],'defaultValue':_0x893d('0x2')},'appdata':{'type':Sequelize[_0x893d('0x3')]()},'description':{'type':Sequelize[_0x893d('0x1')]},'interval':{'type':Sequelize[_0x893d('0x1')],'defaultValue':_0x893d('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index e6569a2..934fb61 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 _0xaa10=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x4e1c00,_0x4418ea){var _0x45ae12=function(_0xce8803){while(--_0xce8803){_0x4e1c00['push'](_0x4e1c00['shift']());}};_0x45ae12(++_0x4418ea);}(_0xaa10,0xd9));var _0x0aa1=function(_0xcc3e08,_0x50407e){_0xcc3e08=_0xcc3e08-0x0;var _0xc9ca9e=_0xaa10[_0xcc3e08];return _0xc9ca9e;};'use strict';var emlformat=require(_0x0aa1('0x0'));var rimraf=require(_0x0aa1('0x1'));var zipdir=require(_0x0aa1('0x2'));var jsonpatch=require(_0x0aa1('0x3'));var rp=require(_0x0aa1('0x4'));var moment=require(_0x0aa1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0aa1('0x6'));var util=require('util');var path=require(_0x0aa1('0x7'));var sox=require(_0x0aa1('0x8'));var csv=require(_0x0aa1('0x9'));var ejs=require(_0x0aa1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0aa1('0xb'));var squel=require(_0x0aa1('0xc'));var crypto=require(_0x0aa1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0aa1('0xe'));var toCsv=require(_0x0aa1('0x9'));var querystring=require(_0x0aa1('0xf'));var Papa=require(_0x0aa1('0x10'));var Redis=require('ioredis');var authService=require(_0x0aa1('0x11'));var qs=require(_0x0aa1('0x12'));var as=require(_0x0aa1('0x13'));var hardwareService=require(_0x0aa1('0x14'));var logger=require(_0x0aa1('0x15'))(_0x0aa1('0x16'));var utils=require(_0x0aa1('0x17'));var config=require(_0x0aa1('0x18'));var licenseUtil=require(_0x0aa1('0x19'));var db=require(_0x0aa1('0x1a'))['db'];function respondWithStatusCode(_0x2a828d,_0x3bc50a){_0x3bc50a=_0x3bc50a||0xcc;return function(_0x264d8b){if(_0x264d8b){return _0x2a828d[_0x0aa1('0x1b')](_0x3bc50a);}return _0x2a828d[_0x0aa1('0x1c')](_0x3bc50a)[_0x0aa1('0x1d')]();};}function respondWithResult(_0x2318b0,_0x89e590){_0x89e590=_0x89e590||0xc8;return function(_0x3b2d97){if(_0x3b2d97){return _0x2318b0[_0x0aa1('0x1c')](_0x89e590)[_0x0aa1('0x1e')](_0x3b2d97);}};}function respondWithFilteredResult(_0x33a7a0,_0x2894d7){return function(_0xda6b55){if(_0xda6b55){var _0x574490=typeof _0x2894d7[_0x0aa1('0x1f')]===_0x0aa1('0x20')&&typeof _0x2894d7[_0x0aa1('0x21')]===_0x0aa1('0x20');var _0x1b11df=_0xda6b55[_0x0aa1('0x22')];var _0x34a191=_0x574490?0x0:_0x2894d7[_0x0aa1('0x1f')];var _0x1dd3c3=_0x574490?_0xda6b55[_0x0aa1('0x22')]:_0x2894d7[_0x0aa1('0x1f')]+_0x2894d7['limit'];var _0x56777e;if(_0x1dd3c3>=_0x1b11df){_0x1dd3c3=_0x1b11df;_0x56777e=0xc8;}else{_0x56777e=0xce;}_0x33a7a0[_0x0aa1('0x1c')](_0x56777e);return _0x33a7a0['set'](_0x0aa1('0x23'),_0x34a191+'-'+_0x1dd3c3+'/'+_0x1b11df)[_0x0aa1('0x1e')](_0xda6b55);}return null;};}function patchUpdates(_0x5a83b1){return function(_0x41e454){try{jsonpatch[_0x0aa1('0x24')](_0x41e454,_0x5a83b1,!![]);}catch(_0x59441c){return BPromise[_0x0aa1('0x25')](_0x59441c);}return _0x41e454[_0x0aa1('0x26')]();};}function saveUpdates(_0x5d55ee,_0x45d13f){return function(_0x39a6b8){if(_0x39a6b8){return _0x39a6b8[_0x0aa1('0x27')](_0x5d55ee)[_0x0aa1('0x28')](function(_0x5963a6){return _0x5963a6;});}return null;};}function removeEntity(_0x76dcc0,_0x2d90a5){return function(_0x193d2c){if(_0x193d2c){return _0x193d2c[_0x0aa1('0x29')]()[_0x0aa1('0x28')](function(){_0x76dcc0[_0x0aa1('0x1c')](0xcc)[_0x0aa1('0x1d')]();});}};}function handleEntityNotFound(_0x2fb783,_0x34a5d6){return function(_0x3cb2a9){if(!_0x3cb2a9){_0x2fb783['sendStatus'](0x194);}return _0x3cb2a9;};}function handleError(_0x3558f3,_0x30a17b){_0x30a17b=_0x30a17b||0x1f4;return function(_0x1d76ad){logger[_0x0aa1('0x2a')](_0x1d76ad[_0x0aa1('0x2b')]);if(_0x1d76ad[_0x0aa1('0x2c')]){delete _0x1d76ad[_0x0aa1('0x2c')];}_0x3558f3[_0x0aa1('0x1c')](_0x30a17b)['send'](_0x1d76ad);};}exports['show']=function(_0x4a6260,_0x41d199){var _0x40d605={'raw':!![],'where':{'id':_0x4a6260[_0x0aa1('0x2d')]['id']}},_0x6281b9={};_0x6281b9[_0x0aa1('0x2e')]=_[_0x0aa1('0x2f')](db[_0x0aa1('0x30')][_0x0aa1('0x31')]);_0x6281b9[_0x0aa1('0x32')]=_[_0x0aa1('0x2f')](_0x4a6260[_0x0aa1('0x32')]);_0x6281b9[_0x0aa1('0x33')]=_[_0x0aa1('0x34')](_0x6281b9['model'],_0x6281b9[_0x0aa1('0x32')]);_0x40d605[_0x0aa1('0x35')]=_[_0x0aa1('0x34')](_0x6281b9[_0x0aa1('0x2e')],qs[_0x0aa1('0x36')](_0x4a6260[_0x0aa1('0x32')][_0x0aa1('0x36')]));_0x40d605['attributes']=_0x40d605[_0x0aa1('0x35')][_0x0aa1('0x37')]?_0x40d605[_0x0aa1('0x35')]:_0x6281b9[_0x0aa1('0x2e')];if(_0x4a6260[_0x0aa1('0x32')][_0x0aa1('0x38')]){_0x40d605[_0x0aa1('0x39')]=[{'all':!![]}];}_0x40d605=_[_0x0aa1('0x3a')]({},_0x40d605,_0x4a6260[_0x0aa1('0x3b')]);return db[_0x0aa1('0x30')][_0x0aa1('0x3c')](_0x40d605)[_0x0aa1('0x28')](handleEntityNotFound(_0x41d199,null))[_0x0aa1('0x28')](respondWithResult(_0x41d199,null))[_0x0aa1('0x3d')](handleError(_0x41d199,null));};exports[_0x0aa1('0x27')]=function(_0x5be116,_0x281785){if(_0x5be116[_0x0aa1('0x3e')]['id']){delete _0x5be116[_0x0aa1('0x3e')]['id'];}return db[_0x0aa1('0x30')][_0x0aa1('0x3c')]({'where':{'id':_0x5be116[_0x0aa1('0x2d')]['id']}})[_0x0aa1('0x28')](handleEntityNotFound(_0x281785,null))[_0x0aa1('0x28')](saveUpdates(_0x5be116[_0x0aa1('0x3e')],null))[_0x0aa1('0x28')](respondWithResult(_0x281785,null))[_0x0aa1('0x3d')](handleError(_0x281785,null));};exports[_0x0aa1('0x29')]=function(_0x5ac938,_0x140f76){return db[_0x0aa1('0x30')][_0x0aa1('0x3c')]({'where':{'id':_0x5ac938[_0x0aa1('0x2d')]['id']}})[_0x0aa1('0x28')](handleEntityNotFound(_0x140f76,null))[_0x0aa1('0x28')](removeEntity(_0x140f76,null))[_0x0aa1('0x3d')](handleError(_0x140f76,null));};
\ No newline at end of file
+var _0x585f=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','show','params','model','keys','ChatApplication','rawAttributes','intersection','query','attributes','fields','length','includeAll','include','merge','options','find','body','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x28a245,_0x1d817a){var _0x1bfce6=function(_0x41558a){while(--_0x41558a){_0x28a245['push'](_0x28a245['shift']());}};_0x1bfce6(++_0x1d817a);}(_0x585f,0x96));var _0xf585=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x585f[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xf585('0x0'));var rimraf=require(_0xf585('0x1'));var zipdir=require(_0xf585('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf585('0x3'));var moment=require('moment');var BPromise=require(_0xf585('0x4'));var Mustache=require(_0xf585('0x5'));var util=require(_0xf585('0x6'));var path=require(_0xf585('0x7'));var sox=require('sox');var csv=require(_0xf585('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf585('0x9'));var _=require('lodash');var squel=require(_0xf585('0xa'));var crypto=require(_0xf585('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf585('0xc'));var toCsv=require(_0xf585('0x8'));var querystring=require(_0xf585('0xd'));var Papa=require(_0xf585('0xe'));var Redis=require(_0xf585('0xf'));var authService=require(_0xf585('0x10'));var qs=require(_0xf585('0x11'));var as=require(_0xf585('0x12'));var hardwareService=require(_0xf585('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf585('0x14'));var db=require(_0xf585('0x15'))['db'];function respondWithStatusCode(_0x3b8587,_0x363eab){_0x363eab=_0x363eab||0xcc;return function(_0x445d3f){if(_0x445d3f){return _0x3b8587[_0xf585('0x16')](_0x363eab);}return _0x3b8587[_0xf585('0x17')](_0x363eab)['end']();};}function respondWithResult(_0x352c4c,_0x522783){_0x522783=_0x522783||0xc8;return function(_0x34ff75){if(_0x34ff75){return _0x352c4c[_0xf585('0x17')](_0x522783)[_0xf585('0x18')](_0x34ff75);}};}function respondWithFilteredResult(_0x2dc83e,_0x2eab7b){return function(_0xe55866){if(_0xe55866){var _0xdb7e30=typeof _0x2eab7b[_0xf585('0x19')]===_0xf585('0x1a')&&typeof _0x2eab7b[_0xf585('0x1b')]==='undefined';var _0x147393=_0xe55866[_0xf585('0x1c')];var _0x515944=_0xdb7e30?0x0:_0x2eab7b[_0xf585('0x19')];var _0x10d044=_0xdb7e30?_0xe55866[_0xf585('0x1c')]:_0x2eab7b['offset']+_0x2eab7b[_0xf585('0x1b')];var _0x3c151e;if(_0x10d044>=_0x147393){_0x10d044=_0x147393;_0x3c151e=0xc8;}else{_0x3c151e=0xce;}_0x2dc83e[_0xf585('0x17')](_0x3c151e);return _0x2dc83e[_0xf585('0x1d')](_0xf585('0x1e'),_0x515944+'-'+_0x10d044+'/'+_0x147393)[_0xf585('0x18')](_0xe55866);}return null;};}function patchUpdates(_0x255d2f){return function(_0x1e290f){try{jsonpatch[_0xf585('0x1f')](_0x1e290f,_0x255d2f,!![]);}catch(_0x59b81c){return BPromise[_0xf585('0x20')](_0x59b81c);}return _0x1e290f[_0xf585('0x21')]();};}function saveUpdates(_0x4199f6,_0x750e5f){return function(_0x1b65b7){if(_0x1b65b7){return _0x1b65b7[_0xf585('0x22')](_0x4199f6)[_0xf585('0x23')](function(_0x3f7f6a){return _0x3f7f6a;});}return null;};}function removeEntity(_0x56e1ca,_0x28477e){return function(_0x107ad3){if(_0x107ad3){return _0x107ad3['destroy']()[_0xf585('0x23')](function(){_0x56e1ca[_0xf585('0x17')](0xcc)[_0xf585('0x24')]();});}};}function handleEntityNotFound(_0xaa2629,_0x393ad3){return function(_0x56f301){if(!_0x56f301){_0xaa2629[_0xf585('0x16')](0x194);}return _0x56f301;};}function handleError(_0x2008eb,_0x1c3aed){_0x1c3aed=_0x1c3aed||0x1f4;return function(_0x38b43a){logger[_0xf585('0x25')](_0x38b43a[_0xf585('0x26')]);if(_0x38b43a[_0xf585('0x27')]){delete _0x38b43a[_0xf585('0x27')];}_0x2008eb[_0xf585('0x17')](_0x1c3aed)['send'](_0x38b43a);};}exports[_0xf585('0x28')]=function(_0x4f4d2c,_0x1ba99b){var _0x4f75e4={'raw':!![],'where':{'id':_0x4f4d2c[_0xf585('0x29')]['id']}},_0x20a66e={};_0x20a66e[_0xf585('0x2a')]=_[_0xf585('0x2b')](db[_0xf585('0x2c')][_0xf585('0x2d')]);_0x20a66e['query']=_[_0xf585('0x2b')](_0x4f4d2c['query']);_0x20a66e['filters']=_[_0xf585('0x2e')](_0x20a66e[_0xf585('0x2a')],_0x20a66e[_0xf585('0x2f')]);_0x4f75e4[_0xf585('0x30')]=_['intersection'](_0x20a66e[_0xf585('0x2a')],qs['fields'](_0x4f4d2c[_0xf585('0x2f')][_0xf585('0x31')]));_0x4f75e4[_0xf585('0x30')]=_0x4f75e4[_0xf585('0x30')][_0xf585('0x32')]?_0x4f75e4['attributes']:_0x20a66e['model'];if(_0x4f4d2c['query'][_0xf585('0x33')]){_0x4f75e4[_0xf585('0x34')]=[{'all':!![]}];}_0x4f75e4=_[_0xf585('0x35')]({},_0x4f75e4,_0x4f4d2c[_0xf585('0x36')]);return db[_0xf585('0x2c')][_0xf585('0x37')](_0x4f75e4)[_0xf585('0x23')](handleEntityNotFound(_0x1ba99b,null))[_0xf585('0x23')](respondWithResult(_0x1ba99b,null))['catch'](handleError(_0x1ba99b,null));};exports[_0xf585('0x22')]=function(_0x586f82,_0x5a3d2f){if(_0x586f82[_0xf585('0x38')]['id']){delete _0x586f82[_0xf585('0x38')]['id'];}return db[_0xf585('0x2c')][_0xf585('0x37')]({'where':{'id':_0x586f82['params']['id']}})[_0xf585('0x23')](handleEntityNotFound(_0x5a3d2f,null))[_0xf585('0x23')](saveUpdates(_0x586f82[_0xf585('0x38')],null))[_0xf585('0x23')](respondWithResult(_0x5a3d2f,null))['catch'](handleError(_0x5a3d2f,null));};exports[_0xf585('0x39')]=function(_0x3a8dbe,_0xb73eec){return db[_0xf585('0x2c')]['find']({'where':{'id':_0x3a8dbe[_0xf585('0x29')]['id']}})['then'](handleEntityNotFound(_0xb73eec,null))[_0xf585('0x23')](removeEntity(_0xb73eec,null))['catch'](handleError(_0xb73eec,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 1ba7c1b..ec641f9 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 _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
+var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 02dd22f..bf3c30a 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 _0x858e=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x4df1e3,_0x2d211a){var _0x4b7236=function(_0x404339){while(--_0x404339){_0x4df1e3['push'](_0x4df1e3['shift']());}};_0x4b7236(++_0x2d211a);}(_0x858e,0x1c8));var _0xe858=function(_0x322752,_0x1ab149){_0x322752=_0x322752-0x0;var _0x2a6840=_0x858e[_0x322752];return _0x2a6840;};'use strict';var _=require(_0xe858('0x0'));var util=require(_0xe858('0x1'));var moment=require(_0xe858('0x2'));var BPromise=require(_0xe858('0x3'));var rs=require(_0xe858('0x4'));var fs=require('fs');var Redis=require(_0xe858('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe858('0x6'));var logger=require(_0xe858('0x7'))(_0xe858('0x8'));var config=require(_0xe858('0x9'));var jayson=require(_0xe858('0xa'));var client=jayson[_0xe858('0xb')][_0xe858('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22a553,_0x263875,_0x147627){return new BPromise(function(_0x107e52,_0x45d31f){return client[_0xe858('0xd')](_0x22a553,_0x147627)[_0xe858('0xe')](function(_0x1e9634){logger[_0xe858('0xf')](_0xe858('0x10'),_0x263875,_0xe858('0x11'));logger[_0xe858('0x12')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x263875,_0xe858('0x11'),JSON[_0xe858('0x13')](_0x1e9634));if(_0x1e9634[_0xe858('0x14')]){if(_0x1e9634[_0xe858('0x14')]['code']===0x1f4){logger[_0xe858('0x14')]('ChatApplication,\x20%s,\x20%s',_0x263875,_0x1e9634[_0xe858('0x14')][_0xe858('0x15')]);return _0x45d31f(_0x1e9634['error'][_0xe858('0x15')]);}logger[_0xe858('0x14')](_0xe858('0x10'),_0x263875,_0x1e9634[_0xe858('0x14')][_0xe858('0x15')]);return _0x107e52(_0x1e9634['error'][_0xe858('0x15')]);}else{logger[_0xe858('0xf')](_0xe858('0x10'),_0x263875,'request\x20sent');_0x107e52(_0x1e9634[_0xe858('0x16')][_0xe858('0x15')]);}})[_0xe858('0x17')](function(_0xccf10b){logger[_0xe858('0x14')](_0xe858('0x10'),_0x263875,_0xccf10b);_0x45d31f(_0xccf10b);});});}
\ No newline at end of file
+var _0x4a93=['request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x4a93,0xc9));var _0x34a9=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x4a93[_0x1928c9];return _0x51b5fb;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x34a9('0x0'));var rs=require(_0x34a9('0x1'));var fs=require('fs');var Redis=require(_0x34a9('0x2'));var db=require(_0x34a9('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x34a9('0x4'));var config=require(_0x34a9('0x5'));var jayson=require(_0x34a9('0x6'));var client=jayson['client'][_0x34a9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d9a2a,_0x2d364f,_0xe70f60){return new BPromise(function(_0x26e7db,_0x29c1d3){return client[_0x34a9('0x8')](_0x2d9a2a,_0xe70f60)[_0x34a9('0x9')](function(_0x260562){logger[_0x34a9('0xa')](_0x34a9('0xb'),_0x2d364f,_0x34a9('0xc'));logger[_0x34a9('0xd')](_0x34a9('0xe'),_0x2d364f,_0x34a9('0xc'),JSON[_0x34a9('0xf')](_0x260562));if(_0x260562[_0x34a9('0x10')]){if(_0x260562[_0x34a9('0x10')]['code']===0x1f4){logger[_0x34a9('0x10')]('ChatApplication,\x20%s,\x20%s',_0x2d364f,_0x260562[_0x34a9('0x10')]['message']);return _0x29c1d3(_0x260562[_0x34a9('0x10')][_0x34a9('0x11')]);}logger[_0x34a9('0x10')]('ChatApplication,\x20%s,\x20%s',_0x2d364f,_0x260562['error'][_0x34a9('0x11')]);return _0x26e7db(_0x260562[_0x34a9('0x10')][_0x34a9('0x11')]);}else{logger['info'](_0x34a9('0xb'),_0x2d364f,'request\x20sent');_0x26e7db(_0x260562[_0x34a9('0x12')]['message']);}})['catch'](function(_0x33075f){logger['error'](_0x34a9('0xb'),_0x2d364f,_0x33075f);_0x29c1d3(_0x33075f);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 9300718..cc5b5a6 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 _0xda1d=['./chatApplication.controller','/:id','isAuthenticated','show','put','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5c89a3,_0x501c9f){var _0x17a382=function(_0x313f2b){while(--_0x313f2b){_0x5c89a3['push'](_0x5c89a3['shift']());}};_0x17a382(++_0x501c9f);}(_0xda1d,0x1f2));var _0xdda1=function(_0x4788ca,_0x5cda70){_0x4788ca=_0x4788ca-0x0;var _0x28a6f5=_0xda1d[_0x4788ca];return _0x28a6f5;};'use strict';var multer=require(_0xdda1('0x0'));var util=require('util');var path=require(_0xdda1('0x1'));var timeout=require('connect-timeout');var express=require(_0xdda1('0x2'));var router=express['Router']();var fs_extra=require(_0xdda1('0x3'));var auth=require(_0xdda1('0x4'));var interaction=require(_0xdda1('0x5'));var config=require('../../config/environment');var controller=require(_0xdda1('0x6'));router['get'](_0xdda1('0x7'),auth[_0xdda1('0x8')](),controller[_0xdda1('0x9')]);router[_0xdda1('0xa')](_0xdda1('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xdda1('0x7'),auth[_0xdda1('0x8')](),controller['destroy']);module[_0xdda1('0xb')]=router;
\ No newline at end of file
+var _0x1c41=['../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4d6bfa,_0x55fb07){var _0xb95789=function(_0x264726){while(--_0x264726){_0x4d6bfa['push'](_0x4d6bfa['shift']());}};_0xb95789(++_0x55fb07);}(_0x1c41,0x81));var _0x11c4=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0x1c41[_0x587fb5];return _0x551105;};'use strict';var multer=require(_0x11c4('0x0'));var util=require(_0x11c4('0x1'));var path=require(_0x11c4('0x2'));var timeout=require(_0x11c4('0x3'));var express=require(_0x11c4('0x4'));var router=express[_0x11c4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x11c4('0x6'));var interaction=require(_0x11c4('0x7'));var config=require(_0x11c4('0x8'));var controller=require(_0x11c4('0x9'));router['get'](_0x11c4('0xa'),auth[_0x11c4('0xb')](),controller[_0x11c4('0xc')]);router[_0x11c4('0xd')](_0x11c4('0xa'),auth[_0x11c4('0xb')](),controller[_0x11c4('0xe')]);router[_0x11c4('0xf')](_0x11c4('0xa'),auth[_0x11c4('0xb')](),controller[_0x11c4('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index d462bd2..50136e3 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 _0x4ff6=['BOOLEAN','sequelize','exports','STRING'];(function(_0x36fe2e,_0x3f47c0){var _0x4d5f3e=function(_0x474a92){while(--_0x474a92){_0x36fe2e['push'](_0x36fe2e['shift']());}};_0x4d5f3e(++_0x3f47c0);}(_0x4ff6,0xe9));var _0x64ff=function(_0x2088e6,_0x40bb23){_0x2088e6=_0x2088e6-0x0;var _0x22819f=_0x4ff6[_0x2088e6];return _0x22819f;};'use strict';var Sequelize=require(_0x64ff('0x0'));module[_0x64ff('0x1')]={'name':{'type':Sequelize[_0x64ff('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x64ff('0x2')]},'write':{'type':Sequelize[_0x64ff('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x0772=['sequelize','STRING','BOOLEAN'];(function(_0x326863,_0x48bc96){var _0x3cc1e9=function(_0x54cd54){while(--_0x54cd54){_0x326863['push'](_0x326863['shift']());}};_0x3cc1e9(++_0x48bc96);}(_0x0772,0x66));var _0x2077=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x0772[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require(_0x2077('0x0'));module['exports']={'name':{'type':Sequelize[_0x2077('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x2077('0x1')]},'write':{'type':Sequelize[_0x2077('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 82aa7f7..d8ded48 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 _0xe0fd=['options','ChatGroup','includeAll','include','findAll','rows','params','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','nolimit','getMembers','removeMembers','addMessage','ChatGroupId','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','./chatGroup.socket','jayson/promise','client','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL'];(function(_0x3d060f,_0x107628){var _0x50dfd3=function(_0x13c656){while(--_0x13c656){_0x3d060f['push'](_0x3d060f['shift']());}};_0x50dfd3(++_0x107628);}(_0xe0fd,0x15e));var _0xde0f=function(_0x33722e,_0xb4360){_0x33722e=_0x33722e-0x0;var _0x42878b=_0xe0fd[_0x33722e];return _0x42878b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xde0f('0x0'));var jsonpatch=require(_0xde0f('0x1'));var rp=require(_0xde0f('0x2'));var moment=require(_0xde0f('0x3'));var BPromise=require(_0xde0f('0x4'));var Mustache=require(_0xde0f('0x5'));var util=require(_0xde0f('0x6'));var path=require(_0xde0f('0x7'));var sox=require(_0xde0f('0x8'));var csv=require(_0xde0f('0x9'));var ejs=require(_0xde0f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde0f('0xb'));var squel=require('squel');var crypto=require(_0xde0f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xde0f('0xd'));var toCsv=require(_0xde0f('0x9'));var querystring=require('querystring');var Papa=require(_0xde0f('0xe'));var Redis=require(_0xde0f('0xf'));var authService=require(_0xde0f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xde0f('0x11'));var hardwareService=require(_0xde0f('0x12'));var logger=require(_0xde0f('0x13'))(_0xde0f('0x14'));var utils=require(_0xde0f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xde0f('0x16'));var db=require('../../mysqldb')['db'];config[_0xde0f('0x17')]=_['defaults'](config[_0xde0f('0x17')],{'host':_0xde0f('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xde0f('0x17')]));require(_0xde0f('0x19'))['register'](socket);var jayson=require(_0xde0f('0x1a'));var client=jayson[_0xde0f('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33b4ff,_0x3e0c52,_0x5ad970,_0x1463ad){return new BPromise(function(_0x36455f,_0xc448d8){var _0x524cf3=_0x1463ad||client;return _0x524cf3[_0xde0f('0x1c')](_0x33b4ff,_0x5ad970)[_0xde0f('0x1d')](function(_0x2c0b1f){logger[_0xde0f('0x1e')](_0xde0f('0x1f'),_0x3e0c52,_0xde0f('0x20'));logger['debug'](_0xde0f('0x21'),_0x3e0c52,_0xde0f('0x20'),JSON[_0xde0f('0x22')](_0x2c0b1f));if(_0x2c0b1f[_0xde0f('0x23')]){if(_0x2c0b1f['error'][_0xde0f('0x24')]===0x1f4){logger[_0xde0f('0x23')](_0xde0f('0x1f'),_0x3e0c52,_0x2c0b1f['error'][_0xde0f('0x25')]);return _0xc448d8(_0x2c0b1f[_0xde0f('0x23')][_0xde0f('0x25')]);}logger[_0xde0f('0x23')]('ChatGroup,\x20%s,\x20%s',_0x3e0c52,_0x2c0b1f[_0xde0f('0x23')][_0xde0f('0x25')]);return _0x36455f(_0x2c0b1f[_0xde0f('0x23')]['message']);}else{logger[_0xde0f('0x1e')](_0xde0f('0x1f'),_0x3e0c52,'request\x20sent');_0x36455f(_0x2c0b1f[_0xde0f('0x26')]['message']);}})['catch'](function(_0x2b59a1){logger[_0xde0f('0x23')](_0xde0f('0x1f'),_0x3e0c52,_0x2b59a1);_0xc448d8(_0x2b59a1);});});}function respondWithStatusCode(_0x22dfb1,_0x364a8d){_0x364a8d=_0x364a8d||0xcc;return function(_0x2ef0bd){if(_0x2ef0bd){return _0x22dfb1[_0xde0f('0x27')](_0x364a8d);}return _0x22dfb1[_0xde0f('0x28')](_0x364a8d)[_0xde0f('0x29')]();};}function respondWithResult(_0x5c427d,_0x444f78){_0x444f78=_0x444f78||0xc8;return function(_0x2981b6){if(_0x2981b6){return _0x5c427d['status'](_0x444f78)['json'](_0x2981b6);}};}function respondWithFilteredResult(_0x33e288,_0x55f501){return function(_0x20fee1){if(_0x20fee1){var _0x198db7=typeof _0x55f501[_0xde0f('0x2a')]==='undefined'&&typeof _0x55f501[_0xde0f('0x2b')]==='undefined';var _0x211f2a=_0x20fee1[_0xde0f('0x2c')];var _0x2b4d87=_0x198db7?0x0:_0x55f501[_0xde0f('0x2a')];var _0x1a257d=_0x198db7?_0x20fee1['count']:_0x55f501[_0xde0f('0x2a')]+_0x55f501[_0xde0f('0x2b')];var _0x360dc1;if(_0x1a257d>=_0x211f2a){_0x1a257d=_0x211f2a;_0x360dc1=0xc8;}else{_0x360dc1=0xce;}_0x33e288[_0xde0f('0x28')](_0x360dc1);return _0x33e288[_0xde0f('0x2d')](_0xde0f('0x2e'),_0x2b4d87+'-'+_0x1a257d+'/'+_0x211f2a)[_0xde0f('0x2f')](_0x20fee1);}return null;};}function patchUpdates(_0x5ae8fb){return function(_0x28e6a4){try{jsonpatch[_0xde0f('0x30')](_0x28e6a4,_0x5ae8fb,!![]);}catch(_0x4a5746){return BPromise[_0xde0f('0x31')](_0x4a5746);}return _0x28e6a4[_0xde0f('0x32')]();};}function saveUpdates(_0x3e5c59,_0x64a02e){return function(_0x10f97a){if(_0x10f97a){return _0x10f97a[_0xde0f('0x33')](_0x3e5c59)[_0xde0f('0x1d')](function(_0x49676a){return _0x49676a;});}return null;};}function removeEntity(_0x16e547,_0x1e196a){return function(_0x4044e4){if(_0x4044e4){return _0x4044e4[_0xde0f('0x34')]()[_0xde0f('0x1d')](function(){_0x16e547[_0xde0f('0x28')](0xcc)[_0xde0f('0x29')]();});}};}function handleEntityNotFound(_0x4f4c5d,_0x21af0a){return function(_0x1c113b){if(!_0x1c113b){_0x4f4c5d['sendStatus'](0x194);}return _0x1c113b;};}function handleError(_0x4c736b,_0x59b171){_0x59b171=_0x59b171||0x1f4;return function(_0x892962){logger[_0xde0f('0x23')](_0x892962[_0xde0f('0x35')]);if(_0x892962[_0xde0f('0x36')]){delete _0x892962[_0xde0f('0x36')];}_0x4c736b[_0xde0f('0x28')](_0x59b171)[_0xde0f('0x37')](_0x892962);};}exports[_0xde0f('0x38')]=function(_0x5d5788,_0x408b86){var _0x40a629={},_0x30d8da={},_0x5d0bb0={'count':0x0,'rows':[]};var _0x14e936=_[_0xde0f('0x39')](db['ChatGroup'][_0xde0f('0x3a')],function(_0x2cd343){return{'name':_0x2cd343[_0xde0f('0x3b')],'type':_0x2cd343[_0xde0f('0x3c')][_0xde0f('0x3d')]};});_0x30d8da[_0xde0f('0x3e')]=_[_0xde0f('0x39')](_0x14e936,_0xde0f('0x36'));_0x30d8da['query']=_[_0xde0f('0x3f')](_0x5d5788[_0xde0f('0x40')]);_0x30d8da['filters']=_[_0xde0f('0x41')](_0x30d8da[_0xde0f('0x3e')],_0x30d8da[_0xde0f('0x40')]);_0x40a629[_0xde0f('0x42')]=_[_0xde0f('0x41')](_0x30d8da['model'],qs[_0xde0f('0x43')](_0x5d5788[_0xde0f('0x40')][_0xde0f('0x43')]));_0x40a629[_0xde0f('0x42')]=_0x40a629['attributes'][_0xde0f('0x44')]?_0x40a629['attributes']:_0x30d8da[_0xde0f('0x3e')];if(!_0x5d5788['query'][_0xde0f('0x45')]('nolimit')){_0x40a629['limit']=qs['limit'](_0x5d5788[_0xde0f('0x40')]['limit']);_0x40a629[_0xde0f('0x2a')]=qs['offset'](_0x5d5788['query']['offset']);}_0x40a629[_0xde0f('0x46')]=qs[_0xde0f('0x47')](_0x5d5788[_0xde0f('0x40')][_0xde0f('0x47')]);_0x40a629[_0xde0f('0x48')]=qs['filters'](_[_0xde0f('0x49')](_0x5d5788[_0xde0f('0x40')],_0x30d8da[_0xde0f('0x4a')]),_0x14e936);if(_0x5d5788[_0xde0f('0x40')][_0xde0f('0x4b')]){_0x40a629[_0xde0f('0x48')]=_[_0xde0f('0x4c')](_0x40a629[_0xde0f('0x48')],{'$or':_[_0xde0f('0x39')](_0x14e936,function(_0x155140){if(_0x155140['type']!==_0xde0f('0x4d')){var _0xa037b9={};_0xa037b9[_0x155140[_0xde0f('0x36')]]={'$like':'%'+_0x5d5788[_0xde0f('0x40')][_0xde0f('0x4b')]+'%'};return _0xa037b9;}})});}_0x40a629=_[_0xde0f('0x4c')]({},_0x40a629,_0x5d5788[_0xde0f('0x4e')]);var _0x3f6d59={'where':_0x40a629[_0xde0f('0x48')]};return db[_0xde0f('0x4f')][_0xde0f('0x2c')](_0x3f6d59)[_0xde0f('0x1d')](function(_0x5456bb){_0x5d0bb0[_0xde0f('0x2c')]=_0x5456bb;if(_0x5d5788['query'][_0xde0f('0x50')]){_0x40a629[_0xde0f('0x51')]=[{'all':!![]}];}return db[_0xde0f('0x4f')][_0xde0f('0x52')](_0x40a629);})[_0xde0f('0x1d')](function(_0x1bd9a1){_0x5d0bb0[_0xde0f('0x53')]=_0x1bd9a1;return _0x5d0bb0;})[_0xde0f('0x1d')](respondWithFilteredResult(_0x408b86,_0x40a629))['catch'](handleError(_0x408b86,null));};exports['show']=function(_0x3a6ae9,_0x12df8f){var _0x3ea14c={'raw':!![],'where':{'id':_0x3a6ae9[_0xde0f('0x54')]['id']}},_0x1c262b={};_0x1c262b['model']=_[_0xde0f('0x3f')](db[_0xde0f('0x4f')][_0xde0f('0x3a')]);_0x1c262b[_0xde0f('0x40')]=_[_0xde0f('0x3f')](_0x3a6ae9[_0xde0f('0x40')]);_0x1c262b['filters']=_[_0xde0f('0x41')](_0x1c262b['model'],_0x1c262b[_0xde0f('0x40')]);_0x3ea14c[_0xde0f('0x42')]=_[_0xde0f('0x41')](_0x1c262b['model'],qs[_0xde0f('0x43')](_0x3a6ae9[_0xde0f('0x40')]['fields']));_0x3ea14c['attributes']=_0x3ea14c[_0xde0f('0x42')]['length']?_0x3ea14c[_0xde0f('0x42')]:_0x1c262b['model'];if(_0x3a6ae9[_0xde0f('0x40')][_0xde0f('0x50')]){_0x3ea14c['include']=[{'all':!![]}];}_0x3ea14c=_[_0xde0f('0x4c')]({},_0x3ea14c,_0x3a6ae9[_0xde0f('0x4e')]);return db[_0xde0f('0x4f')][_0xde0f('0x55')](_0x3ea14c)[_0xde0f('0x1d')](handleEntityNotFound(_0x12df8f,null))['then'](respondWithResult(_0x12df8f,null))[_0xde0f('0x56')](handleError(_0x12df8f,null));};exports[_0xde0f('0x57')]=function(_0x489fce,_0x6887e3){return db['ChatGroup']['create'](_0x489fce[_0xde0f('0x58')],{})[_0xde0f('0x1d')](respondWithResult(_0x6887e3,0xc9))[_0xde0f('0x56')](handleError(_0x6887e3,null));};exports[_0xde0f('0x33')]=function(_0x47627c,_0x40c48f){if(_0x47627c['body']['id']){delete _0x47627c[_0xde0f('0x58')]['id'];}return db[_0xde0f('0x4f')][_0xde0f('0x55')]({'where':{'id':_0x47627c[_0xde0f('0x54')]['id']}})['then'](handleEntityNotFound(_0x40c48f,null))[_0xde0f('0x1d')](saveUpdates(_0x47627c[_0xde0f('0x58')],null))[_0xde0f('0x1d')](respondWithResult(_0x40c48f,null))[_0xde0f('0x56')](handleError(_0x40c48f,null));};exports[_0xde0f('0x34')]=function(_0x1280b5,_0x6bfdad){return db['ChatGroup']['find']({'where':{'id':_0x1280b5[_0xde0f('0x54')]['id']}})['then'](handleEntityNotFound(_0x6bfdad,null))[_0xde0f('0x1d')](removeEntity(_0x6bfdad,null))[_0xde0f('0x56')](handleError(_0x6bfdad,null));};exports[_0xde0f('0x59')]=function(_0x490ec7,_0x45b064){return db[_0xde0f('0x4f')][_0xde0f('0x59')]()[_0xde0f('0x1d')](respondWithResult(_0x45b064,null))['catch'](handleError(_0x45b064,null));};exports[_0xde0f('0x5a')]=function(_0x3632e0,_0x3b637c,_0x5f1d07){return db[_0xde0f('0x5b')][_0xde0f('0x2c')]({'where':{'ChatGroupId':_0x3632e0[_0xde0f('0x54')]['id'],'ToId':_0x3632e0[_0xde0f('0x5c')]['id'],'read':![]}})[_0xde0f('0x1d')](function(_0x58366d){return{'id':_['toInteger'](_0x3632e0[_0xde0f('0x54')]['id']),'count':_0x58366d};})['then'](respondWithResult(_0x3b637c,null))['catch'](handleError(_0x3b637c,null));};exports[_0xde0f('0x5d')]=function(_0x1703dd,_0x540c52,_0x110a19){return db[_0xde0f('0x4f')][_0xde0f('0x55')]({'where':{'id':_0x1703dd[_0xde0f('0x54')]['id']}})[_0xde0f('0x1d')](handleEntityNotFound(_0x540c52,null))[_0xde0f('0x1d')](function(_0x295e26){if(_0x295e26){return _0x295e26['addMembers'](_0x1703dd['body'][_0xde0f('0x5e')],_[_0xde0f('0x5f')](_0x1703dd['body'],[_0xde0f('0x5e'),'id'])||{});}})[_0xde0f('0x1d')](respondWithResult(_0x540c52,null))[_0xde0f('0x56')](handleError(_0x540c52,null));};exports['getMembers']=function(_0x2d4870,_0x466ad3,_0x383c45){var _0x543fcd={};var _0x4e477a={};var _0xcef59e;var _0x309780;return db[_0xde0f('0x4f')]['findOne']({'where':{'id':_0x2d4870[_0xde0f('0x54')]['id']}})[_0xde0f('0x1d')](handleEntityNotFound(_0x466ad3,null))['then'](function(_0x59f56d){if(_0x59f56d){_0xcef59e=_0x59f56d;_0x4e477a[_0xde0f('0x3e')]=_['keys'](db['User'][_0xde0f('0x3a')]);_0x4e477a[_0xde0f('0x40')]=_[_0xde0f('0x3f')](_0x2d4870[_0xde0f('0x40')]);_0x4e477a[_0xde0f('0x4a')]=_[_0xde0f('0x41')](_0x4e477a['model'],_0x4e477a[_0xde0f('0x40')]);_0x543fcd[_0xde0f('0x42')]=_['intersection'](_0x4e477a[_0xde0f('0x3e')],qs[_0xde0f('0x43')](_0x2d4870['query'][_0xde0f('0x43')]));_0x543fcd['attributes']=_0x543fcd[_0xde0f('0x42')][_0xde0f('0x44')]?_0x543fcd[_0xde0f('0x42')]:_0x4e477a[_0xde0f('0x3e')];_0x543fcd['order']=qs['sort'](_0x2d4870['query'][_0xde0f('0x47')]);_0x543fcd[_0xde0f('0x48')]=qs['filters'](_['pick'](_0x2d4870[_0xde0f('0x40')],_0x4e477a[_0xde0f('0x4a')]));if(_0x2d4870[_0xde0f('0x40')][_0xde0f('0x4b')]){_0x543fcd[_0xde0f('0x48')]=_[_0xde0f('0x4c')](_0x543fcd['where'],{'$or':_[_0xde0f('0x39')](_0x543fcd[_0xde0f('0x42')],function(_0x16f08b){var _0x361f8a={};_0x361f8a[_0x16f08b]={'$like':'%'+_0x2d4870[_0xde0f('0x40')]['filter']+'%'};return _0x361f8a;})});}_0x543fcd=_[_0xde0f('0x4c')]({},_0x543fcd,_0x2d4870['options']);return _0xcef59e['getMembers'](_0x543fcd);}})[_0xde0f('0x1d')](function(_0x2561e5){if(_0x2561e5){_0x309780=_0x2561e5[_0xde0f('0x44')];if(!_0x2d4870[_0xde0f('0x40')][_0xde0f('0x45')](_0xde0f('0x60'))){_0x543fcd[_0xde0f('0x2b')]=qs[_0xde0f('0x2b')](_0x2d4870[_0xde0f('0x40')][_0xde0f('0x2b')]);_0x543fcd[_0xde0f('0x2a')]=qs[_0xde0f('0x2a')](_0x2d4870[_0xde0f('0x40')]['offset']);}return _0xcef59e[_0xde0f('0x61')](_0x543fcd);}})[_0xde0f('0x1d')](function(_0x96113a){if(_0x96113a){return _0x96113a?{'count':_0x309780,'rows':_0x96113a}:null;}})[_0xde0f('0x1d')](respondWithResult(_0x466ad3,null))[_0xde0f('0x56')](handleError(_0x466ad3,null));};exports[_0xde0f('0x62')]=function(_0x29725b,_0x49f888,_0x59e6fb){return db[_0xde0f('0x4f')]['find']({'where':{'id':_0x29725b[_0xde0f('0x54')]['id']}})[_0xde0f('0x1d')](handleEntityNotFound(_0x49f888,null))[_0xde0f('0x1d')](function(_0x42db09){if(_0x42db09){return _0x42db09[_0xde0f('0x62')](_0x29725b[_0xde0f('0x40')][_0xde0f('0x5e')]);}})['then'](respondWithStatusCode(_0x49f888,null))['catch'](handleError(_0x49f888,null));};exports[_0xde0f('0x63')]=function(_0x5f1067,_0x4a42f8,_0x1bca7f){if(_0x5f1067[_0xde0f('0x58')]['id']){delete _0x5f1067[_0xde0f('0x58')]['id'];}return db[_0xde0f('0x4f')][_0xde0f('0x55')]({'where':{'id':_0x5f1067[_0xde0f('0x54')]['id']}})['then'](handleEntityNotFound(_0x4a42f8,null))[_0xde0f('0x1d')](function(_0x43f613){if(_0x43f613){_0x5f1067[_0xde0f('0x58')][_0xde0f('0x64')]=_0x43f613['id'];return db['ChatInternalMessage'][_0xde0f('0x57')](_0x5f1067[_0xde0f('0x58')]);}})['then'](respondWithResult(_0x4a42f8,null))[_0xde0f('0x56')](handleError(_0x4a42f8,null));};exports['getMessages']=function(_0xb9ed1,_0x54cdc6,_0x289edf){var _0xe8495a={};var _0x30c174={};var _0x1106eb;var _0x4cd728;return db[_0xde0f('0x4f')][_0xde0f('0x65')]({'where':{'id':_0xb9ed1[_0xde0f('0x54')]['id']}})['then'](handleEntityNotFound(_0x54cdc6,null))[_0xde0f('0x1d')](function(_0x252d08){if(_0x252d08){_0x1106eb=_0x252d08;_0x30c174[_0xde0f('0x3e')]=_[_0xde0f('0x3f')](db[_0xde0f('0x5b')]['rawAttributes']);_0x30c174[_0xde0f('0x40')]=_[_0xde0f('0x3f')](_0xb9ed1[_0xde0f('0x40')]);_0x30c174[_0xde0f('0x4a')]=_['intersection'](_0x30c174[_0xde0f('0x3e')],_0x30c174[_0xde0f('0x40')]);_0xe8495a['attributes']=_[_0xde0f('0x41')](_0x30c174[_0xde0f('0x3e')],qs[_0xde0f('0x43')](_0xb9ed1[_0xde0f('0x40')][_0xde0f('0x43')]));_0xe8495a[_0xde0f('0x42')]=_0xe8495a[_0xde0f('0x42')][_0xde0f('0x44')]?_0xe8495a['attributes']:_0x30c174[_0xde0f('0x3e')];_0xe8495a[_0xde0f('0x46')]=qs[_0xde0f('0x47')](_0xb9ed1[_0xde0f('0x40')][_0xde0f('0x47')]);_0xe8495a[_0xde0f('0x48')]=qs[_0xde0f('0x4a')](_['pick'](_0xb9ed1['query'],_0x30c174['filters']));if(_0xb9ed1[_0xde0f('0x40')][_0xde0f('0x4b')]){_0xe8495a[_0xde0f('0x48')]=_[_0xde0f('0x4c')](_0xe8495a[_0xde0f('0x48')],{'$or':_['map'](_0xe8495a[_0xde0f('0x42')],function(_0x12649c){var _0x1ccca4={};_0x1ccca4[_0x12649c]={'$like':'%'+_0xb9ed1[_0xde0f('0x40')][_0xde0f('0x4b')]+'%'};return _0x1ccca4;})});}if(_0xb9ed1[_0xde0f('0x40')][_0xde0f('0x66')]){var _0x24eb0b=_0xb9ed1['query'][_0xde0f('0x66')][_0xde0f('0x67')](',');var _0x571c53={};_0x571c53[_0x24eb0b[0x0]]={'$gte':moment(_0x24eb0b[0x1])[_0xde0f('0x68')](_0xde0f('0x69'))};_0xe8495a[_0xde0f('0x48')]=_[_0xde0f('0x4c')](_0xe8495a[_0xde0f('0x48')],_0x571c53);}_0xe8495a=_[_0xde0f('0x4c')]({},_0xe8495a,_0xb9ed1[_0xde0f('0x4e')]);return _0x1106eb[_0xde0f('0x6a')](_0xe8495a);}})[_0xde0f('0x1d')](function(_0x1e5933){if(_0x1e5933){_0x4cd728=_0x1e5933['length'];if(!_0xb9ed1['query'][_0xde0f('0x45')](_0xde0f('0x60'))){_0xe8495a['limit']=qs[_0xde0f('0x2b')](_0xb9ed1[_0xde0f('0x40')][_0xde0f('0x2b')]);_0xe8495a[_0xde0f('0x2a')]=qs['offset'](_0xb9ed1[_0xde0f('0x40')][_0xde0f('0x2a')]);}return _0x1106eb[_0xde0f('0x6a')](_0xe8495a);}})['then'](function(_0x5d2566){if(_0x5d2566){return _0x5d2566?{'count':_0x4cd728,'rows':_0x5d2566}:null;}})['then'](respondWithResult(_0x54cdc6,null))['catch'](handleError(_0x54cdc6,null));};
\ No newline at end of file
+var _0x0e23=['query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','options','includeAll','findAll','rows','catch','show','params','keys','merge','create','body','find','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','User','hasOwnProperty','removeMembers','addMessage','ChatGroupId','findOne','order','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','error','code','ChatGroup,\x20%s,\x20%s','message','result','status','end','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','model','map'];(function(_0x149902,_0x544173){var _0x5a41a0=function(_0x3ec8cd){while(--_0x3ec8cd){_0x149902['push'](_0x149902['shift']());}};_0x5a41a0(++_0x544173);}(_0x0e23,0xfd));var _0x30e2=function(_0x3b330e,_0x350e11){_0x3b330e=_0x3b330e-0x0;var _0xa61a79=_0x0e23[_0x3b330e];return _0xa61a79;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x30e2('0x0'));var jsonpatch=require(_0x30e2('0x1'));var rp=require(_0x30e2('0x2'));var moment=require(_0x30e2('0x3'));var BPromise=require(_0x30e2('0x4'));var Mustache=require(_0x30e2('0x5'));var util=require('util');var path=require('path');var sox=require(_0x30e2('0x6'));var csv=require('to-csv');var ejs=require(_0x30e2('0x7'));var fs=require('fs');var fs_extra=require(_0x30e2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x30e2('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x30e2('0xa'));var toCsv=require(_0x30e2('0xb'));var querystring=require(_0x30e2('0xc'));var Papa=require(_0x30e2('0xd'));var Redis=require(_0x30e2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x30e2('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x30e2('0x10'))(_0x30e2('0x11'));var utils=require(_0x30e2('0x12'));var config=require(_0x30e2('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x30e2('0x14')]=_[_0x30e2('0x15')](config[_0x30e2('0x14')],{'host':_0x30e2('0x16'),'port':0x18eb});var socket=require(_0x30e2('0x17'))(new Redis(config[_0x30e2('0x14')]));require(_0x30e2('0x18'))[_0x30e2('0x19')](socket);var jayson=require(_0x30e2('0x1a'));var client=jayson[_0x30e2('0x1b')][_0x30e2('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3c6058,_0x3094ea,_0x37c657,_0x57207e){return new BPromise(function(_0x5d8e5b,_0xcea097){var _0xf61f6c=_0x57207e||client;return _0xf61f6c[_0x30e2('0x1d')](_0x3c6058,_0x37c657)[_0x30e2('0x1e')](function(_0x565a3e){logger[_0x30e2('0x1f')]('ChatGroup,\x20%s,\x20%s',_0x3094ea,_0x30e2('0x20'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3094ea,_0x30e2('0x20'),JSON['stringify'](_0x565a3e));if(_0x565a3e[_0x30e2('0x21')]){if(_0x565a3e[_0x30e2('0x21')][_0x30e2('0x22')]===0x1f4){logger[_0x30e2('0x21')](_0x30e2('0x23'),_0x3094ea,_0x565a3e[_0x30e2('0x21')]['message']);return _0xcea097(_0x565a3e[_0x30e2('0x21')][_0x30e2('0x24')]);}logger['error'](_0x30e2('0x23'),_0x3094ea,_0x565a3e[_0x30e2('0x21')][_0x30e2('0x24')]);return _0x5d8e5b(_0x565a3e[_0x30e2('0x21')][_0x30e2('0x24')]);}else{logger[_0x30e2('0x1f')]('ChatGroup,\x20%s,\x20%s',_0x3094ea,_0x30e2('0x20'));_0x5d8e5b(_0x565a3e[_0x30e2('0x25')][_0x30e2('0x24')]);}})['catch'](function(_0x488eb9){logger[_0x30e2('0x21')](_0x30e2('0x23'),_0x3094ea,_0x488eb9);_0xcea097(_0x488eb9);});});}function respondWithStatusCode(_0xa992b5,_0xc30703){_0xc30703=_0xc30703||0xcc;return function(_0x5809a5){if(_0x5809a5){return _0xa992b5['sendStatus'](_0xc30703);}return _0xa992b5[_0x30e2('0x26')](_0xc30703)[_0x30e2('0x27')]();};}function respondWithResult(_0x393241,_0x2d84d0){_0x2d84d0=_0x2d84d0||0xc8;return function(_0x4196de){if(_0x4196de){return _0x393241[_0x30e2('0x26')](_0x2d84d0)['json'](_0x4196de);}};}function respondWithFilteredResult(_0x5821e6,_0xbd8671){return function(_0x2a3c2d){if(_0x2a3c2d){var _0x5d596b=typeof _0xbd8671[_0x30e2('0x28')]===_0x30e2('0x29')&&typeof _0xbd8671['limit']===_0x30e2('0x29');var _0x50879e=_0x2a3c2d[_0x30e2('0x2a')];var _0x538045=_0x5d596b?0x0:_0xbd8671['offset'];var _0x561627=_0x5d596b?_0x2a3c2d[_0x30e2('0x2a')]:_0xbd8671[_0x30e2('0x28')]+_0xbd8671[_0x30e2('0x2b')];var _0xa3c94e;if(_0x561627>=_0x50879e){_0x561627=_0x50879e;_0xa3c94e=0xc8;}else{_0xa3c94e=0xce;}_0x5821e6[_0x30e2('0x26')](_0xa3c94e);return _0x5821e6['set'](_0x30e2('0x2c'),_0x538045+'-'+_0x561627+'/'+_0x50879e)['json'](_0x2a3c2d);}return null;};}function patchUpdates(_0x20f89d){return function(_0x244138){try{jsonpatch[_0x30e2('0x2d')](_0x244138,_0x20f89d,!![]);}catch(_0x1f3dab){return BPromise[_0x30e2('0x2e')](_0x1f3dab);}return _0x244138[_0x30e2('0x2f')]();};}function saveUpdates(_0x383327,_0x50aa26){return function(_0x557c23){if(_0x557c23){return _0x557c23[_0x30e2('0x30')](_0x383327)[_0x30e2('0x1e')](function(_0x1db543){return _0x1db543;});}return null;};}function removeEntity(_0x56cf62,_0xfdd003){return function(_0xe486b9){if(_0xe486b9){return _0xe486b9[_0x30e2('0x31')]()[_0x30e2('0x1e')](function(){_0x56cf62['status'](0xcc)[_0x30e2('0x27')]();});}};}function handleEntityNotFound(_0x5dfdf8,_0x19496e){return function(_0x96433c){if(!_0x96433c){_0x5dfdf8[_0x30e2('0x32')](0x194);}return _0x96433c;};}function handleError(_0x34f500,_0x6b0b10){_0x6b0b10=_0x6b0b10||0x1f4;return function(_0x2678b8){logger[_0x30e2('0x21')](_0x2678b8[_0x30e2('0x33')]);if(_0x2678b8[_0x30e2('0x34')]){delete _0x2678b8[_0x30e2('0x34')];}_0x34f500[_0x30e2('0x26')](_0x6b0b10)[_0x30e2('0x35')](_0x2678b8);};}exports[_0x30e2('0x36')]=function(_0x4ad25d,_0x5d1816){var _0x2ea1a={},_0x10c231={},_0x1c943a={'count':0x0,'rows':[]};var _0x3114e8=_['map'](db[_0x30e2('0x37')][_0x30e2('0x38')],function(_0x2b24a8){return{'name':_0x2b24a8[_0x30e2('0x39')],'type':_0x2b24a8[_0x30e2('0x3a')][_0x30e2('0x3b')]};});_0x10c231[_0x30e2('0x3c')]=_[_0x30e2('0x3d')](_0x3114e8,_0x30e2('0x34'));_0x10c231[_0x30e2('0x3e')]=_['keys'](_0x4ad25d['query']);_0x10c231[_0x30e2('0x3f')]=_[_0x30e2('0x40')](_0x10c231[_0x30e2('0x3c')],_0x10c231['query']);_0x2ea1a[_0x30e2('0x41')]=_[_0x30e2('0x40')](_0x10c231[_0x30e2('0x3c')],qs[_0x30e2('0x42')](_0x4ad25d['query']['fields']));_0x2ea1a[_0x30e2('0x41')]=_0x2ea1a['attributes'][_0x30e2('0x43')]?_0x2ea1a[_0x30e2('0x41')]:_0x10c231[_0x30e2('0x3c')];if(!_0x4ad25d[_0x30e2('0x3e')]['hasOwnProperty'](_0x30e2('0x44'))){_0x2ea1a[_0x30e2('0x2b')]=qs['limit'](_0x4ad25d['query'][_0x30e2('0x2b')]);_0x2ea1a['offset']=qs[_0x30e2('0x28')](_0x4ad25d['query'][_0x30e2('0x28')]);}_0x2ea1a['order']=qs[_0x30e2('0x45')](_0x4ad25d['query'][_0x30e2('0x45')]);_0x2ea1a[_0x30e2('0x46')]=qs[_0x30e2('0x3f')](_[_0x30e2('0x47')](_0x4ad25d[_0x30e2('0x3e')],_0x10c231[_0x30e2('0x3f')]),_0x3114e8);if(_0x4ad25d[_0x30e2('0x3e')][_0x30e2('0x48')]){_0x2ea1a['where']=_['merge'](_0x2ea1a[_0x30e2('0x46')],{'$or':_[_0x30e2('0x3d')](_0x3114e8,function(_0x18f167){if(_0x18f167[_0x30e2('0x3a')]!=='VIRTUAL'){var _0x3345ef={};_0x3345ef[_0x18f167['name']]={'$like':'%'+_0x4ad25d[_0x30e2('0x3e')]['filter']+'%'};return _0x3345ef;}})});}_0x2ea1a=_['merge']({},_0x2ea1a,_0x4ad25d[_0x30e2('0x49')]);var _0xd5b4f={'where':_0x2ea1a[_0x30e2('0x46')]};return db['ChatGroup']['count'](_0xd5b4f)[_0x30e2('0x1e')](function(_0x58b594){_0x1c943a['count']=_0x58b594;if(_0x4ad25d[_0x30e2('0x3e')][_0x30e2('0x4a')]){_0x2ea1a['include']=[{'all':!![]}];}return db[_0x30e2('0x37')][_0x30e2('0x4b')](_0x2ea1a);})['then'](function(_0x5eee06){_0x1c943a[_0x30e2('0x4c')]=_0x5eee06;return _0x1c943a;})[_0x30e2('0x1e')](respondWithFilteredResult(_0x5d1816,_0x2ea1a))[_0x30e2('0x4d')](handleError(_0x5d1816,null));};exports[_0x30e2('0x4e')]=function(_0x5b9eab,_0x349361){var _0x3957e5={'raw':!![],'where':{'id':_0x5b9eab[_0x30e2('0x4f')]['id']}},_0x173cbf={};_0x173cbf[_0x30e2('0x3c')]=_['keys'](db[_0x30e2('0x37')]['rawAttributes']);_0x173cbf['query']=_[_0x30e2('0x50')](_0x5b9eab['query']);_0x173cbf[_0x30e2('0x3f')]=_[_0x30e2('0x40')](_0x173cbf[_0x30e2('0x3c')],_0x173cbf[_0x30e2('0x3e')]);_0x3957e5['attributes']=_[_0x30e2('0x40')](_0x173cbf[_0x30e2('0x3c')],qs[_0x30e2('0x42')](_0x5b9eab[_0x30e2('0x3e')][_0x30e2('0x42')]));_0x3957e5[_0x30e2('0x41')]=_0x3957e5[_0x30e2('0x41')][_0x30e2('0x43')]?_0x3957e5[_0x30e2('0x41')]:_0x173cbf[_0x30e2('0x3c')];if(_0x5b9eab[_0x30e2('0x3e')]['includeAll']){_0x3957e5['include']=[{'all':!![]}];}_0x3957e5=_[_0x30e2('0x51')]({},_0x3957e5,_0x5b9eab[_0x30e2('0x49')]);return db[_0x30e2('0x37')]['find'](_0x3957e5)[_0x30e2('0x1e')](handleEntityNotFound(_0x349361,null))[_0x30e2('0x1e')](respondWithResult(_0x349361,null))[_0x30e2('0x4d')](handleError(_0x349361,null));};exports[_0x30e2('0x52')]=function(_0x1f3a46,_0x202997){return db[_0x30e2('0x37')][_0x30e2('0x52')](_0x1f3a46[_0x30e2('0x53')],{})['then'](respondWithResult(_0x202997,0xc9))[_0x30e2('0x4d')](handleError(_0x202997,null));};exports[_0x30e2('0x30')]=function(_0x2978e4,_0x5ddd54){if(_0x2978e4[_0x30e2('0x53')]['id']){delete _0x2978e4['body']['id'];}return db['ChatGroup'][_0x30e2('0x54')]({'where':{'id':_0x2978e4['params']['id']}})[_0x30e2('0x1e')](handleEntityNotFound(_0x5ddd54,null))[_0x30e2('0x1e')](saveUpdates(_0x2978e4['body'],null))[_0x30e2('0x1e')](respondWithResult(_0x5ddd54,null))['catch'](handleError(_0x5ddd54,null));};exports[_0x30e2('0x31')]=function(_0x4a499e,_0xc00fb7){return db['ChatGroup'][_0x30e2('0x54')]({'where':{'id':_0x4a499e[_0x30e2('0x4f')]['id']}})['then'](handleEntityNotFound(_0xc00fb7,null))[_0x30e2('0x1e')](removeEntity(_0xc00fb7,null))['catch'](handleError(_0xc00fb7,null));};exports['describe']=function(_0x5955e4,_0x5ced8a){return db[_0x30e2('0x37')][_0x30e2('0x55')]()[_0x30e2('0x1e')](respondWithResult(_0x5ced8a,null))[_0x30e2('0x4d')](handleError(_0x5ced8a,null));};exports[_0x30e2('0x56')]=function(_0x52f203,_0x28ba10,_0x473806){return db[_0x30e2('0x57')]['count']({'where':{'ChatGroupId':_0x52f203[_0x30e2('0x4f')]['id'],'ToId':_0x52f203['user']['id'],'read':![]}})[_0x30e2('0x1e')](function(_0x4d8025){return{'id':_[_0x30e2('0x58')](_0x52f203[_0x30e2('0x4f')]['id']),'count':_0x4d8025};})[_0x30e2('0x1e')](respondWithResult(_0x28ba10,null))[_0x30e2('0x4d')](handleError(_0x28ba10,null));};exports[_0x30e2('0x59')]=function(_0x17376b,_0x44b05c,_0x615ab0){return db[_0x30e2('0x37')]['find']({'where':{'id':_0x17376b['params']['id']}})[_0x30e2('0x1e')](handleEntityNotFound(_0x44b05c,null))['then'](function(_0x2d104e){if(_0x2d104e){return _0x2d104e[_0x30e2('0x59')](_0x17376b[_0x30e2('0x53')][_0x30e2('0x5a')],_[_0x30e2('0x5b')](_0x17376b[_0x30e2('0x53')],[_0x30e2('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x44b05c,null))[_0x30e2('0x4d')](handleError(_0x44b05c,null));};exports[_0x30e2('0x5c')]=function(_0x243924,_0xee50bd,_0x5837c7){var _0x1dd359={};var _0x2638a7={};var _0x511d0c;var _0x43d2cf;return db[_0x30e2('0x37')]['findOne']({'where':{'id':_0x243924[_0x30e2('0x4f')]['id']}})[_0x30e2('0x1e')](handleEntityNotFound(_0xee50bd,null))[_0x30e2('0x1e')](function(_0xaf46ce){if(_0xaf46ce){_0x511d0c=_0xaf46ce;_0x2638a7[_0x30e2('0x3c')]=_[_0x30e2('0x50')](db[_0x30e2('0x5d')][_0x30e2('0x38')]);_0x2638a7[_0x30e2('0x3e')]=_[_0x30e2('0x50')](_0x243924[_0x30e2('0x3e')]);_0x2638a7[_0x30e2('0x3f')]=_['intersection'](_0x2638a7[_0x30e2('0x3c')],_0x2638a7[_0x30e2('0x3e')]);_0x1dd359[_0x30e2('0x41')]=_[_0x30e2('0x40')](_0x2638a7[_0x30e2('0x3c')],qs['fields'](_0x243924[_0x30e2('0x3e')][_0x30e2('0x42')]));_0x1dd359[_0x30e2('0x41')]=_0x1dd359['attributes']['length']?_0x1dd359[_0x30e2('0x41')]:_0x2638a7['model'];_0x1dd359['order']=qs['sort'](_0x243924[_0x30e2('0x3e')][_0x30e2('0x45')]);_0x1dd359[_0x30e2('0x46')]=qs['filters'](_[_0x30e2('0x47')](_0x243924[_0x30e2('0x3e')],_0x2638a7[_0x30e2('0x3f')]));if(_0x243924['query']['filter']){_0x1dd359[_0x30e2('0x46')]=_[_0x30e2('0x51')](_0x1dd359[_0x30e2('0x46')],{'$or':_[_0x30e2('0x3d')](_0x1dd359[_0x30e2('0x41')],function(_0x3aec9b){var _0x41d5d5={};_0x41d5d5[_0x3aec9b]={'$like':'%'+_0x243924['query']['filter']+'%'};return _0x41d5d5;})});}_0x1dd359=_[_0x30e2('0x51')]({},_0x1dd359,_0x243924['options']);return _0x511d0c[_0x30e2('0x5c')](_0x1dd359);}})[_0x30e2('0x1e')](function(_0x411f63){if(_0x411f63){_0x43d2cf=_0x411f63['length'];if(!_0x243924['query'][_0x30e2('0x5e')]('nolimit')){_0x1dd359[_0x30e2('0x2b')]=qs[_0x30e2('0x2b')](_0x243924[_0x30e2('0x3e')][_0x30e2('0x2b')]);_0x1dd359[_0x30e2('0x28')]=qs['offset'](_0x243924['query']['offset']);}return _0x511d0c[_0x30e2('0x5c')](_0x1dd359);}})[_0x30e2('0x1e')](function(_0x52aee2){if(_0x52aee2){return _0x52aee2?{'count':_0x43d2cf,'rows':_0x52aee2}:null;}})[_0x30e2('0x1e')](respondWithResult(_0xee50bd,null))['catch'](handleError(_0xee50bd,null));};exports[_0x30e2('0x5f')]=function(_0x2b6d79,_0x29251c,_0x252370){return db['ChatGroup'][_0x30e2('0x54')]({'where':{'id':_0x2b6d79[_0x30e2('0x4f')]['id']}})[_0x30e2('0x1e')](handleEntityNotFound(_0x29251c,null))['then'](function(_0x275ed3){if(_0x275ed3){return _0x275ed3[_0x30e2('0x5f')](_0x2b6d79['query'][_0x30e2('0x5a')]);}})[_0x30e2('0x1e')](respondWithStatusCode(_0x29251c,null))[_0x30e2('0x4d')](handleError(_0x29251c,null));};exports[_0x30e2('0x60')]=function(_0x406974,_0x281959,_0x555c01){if(_0x406974['body']['id']){delete _0x406974[_0x30e2('0x53')]['id'];}return db['ChatGroup'][_0x30e2('0x54')]({'where':{'id':_0x406974['params']['id']}})[_0x30e2('0x1e')](handleEntityNotFound(_0x281959,null))[_0x30e2('0x1e')](function(_0xcadd43){if(_0xcadd43){_0x406974[_0x30e2('0x53')][_0x30e2('0x61')]=_0xcadd43['id'];return db[_0x30e2('0x57')]['create'](_0x406974['body']);}})[_0x30e2('0x1e')](respondWithResult(_0x281959,null))[_0x30e2('0x4d')](handleError(_0x281959,null));};exports['getMessages']=function(_0x5c515e,_0x53056c,_0x6f0c48){var _0x519cd5={};var _0x6b1077={};var _0x49771d;var _0x15b9e0;return db[_0x30e2('0x37')][_0x30e2('0x62')]({'where':{'id':_0x5c515e['params']['id']}})[_0x30e2('0x1e')](handleEntityNotFound(_0x53056c,null))[_0x30e2('0x1e')](function(_0x47c93b){if(_0x47c93b){_0x49771d=_0x47c93b;_0x6b1077['model']=_[_0x30e2('0x50')](db[_0x30e2('0x57')][_0x30e2('0x38')]);_0x6b1077[_0x30e2('0x3e')]=_[_0x30e2('0x50')](_0x5c515e[_0x30e2('0x3e')]);_0x6b1077[_0x30e2('0x3f')]=_['intersection'](_0x6b1077[_0x30e2('0x3c')],_0x6b1077[_0x30e2('0x3e')]);_0x519cd5['attributes']=_[_0x30e2('0x40')](_0x6b1077['model'],qs[_0x30e2('0x42')](_0x5c515e[_0x30e2('0x3e')][_0x30e2('0x42')]));_0x519cd5[_0x30e2('0x41')]=_0x519cd5['attributes'][_0x30e2('0x43')]?_0x519cd5[_0x30e2('0x41')]:_0x6b1077[_0x30e2('0x3c')];_0x519cd5[_0x30e2('0x63')]=qs[_0x30e2('0x45')](_0x5c515e['query']['sort']);_0x519cd5[_0x30e2('0x46')]=qs[_0x30e2('0x3f')](_[_0x30e2('0x47')](_0x5c515e['query'],_0x6b1077['filters']));if(_0x5c515e[_0x30e2('0x3e')]['filter']){_0x519cd5[_0x30e2('0x46')]=_[_0x30e2('0x51')](_0x519cd5[_0x30e2('0x46')],{'$or':_['map'](_0x519cd5[_0x30e2('0x41')],function(_0x170b8a){var _0x59e687={};_0x59e687[_0x170b8a]={'$like':'%'+_0x5c515e[_0x30e2('0x3e')][_0x30e2('0x48')]+'%'};return _0x59e687;})});}if(_0x5c515e[_0x30e2('0x3e')]['$gte']){var _0x2fa785=_0x5c515e[_0x30e2('0x3e')][_0x30e2('0x64')][_0x30e2('0x65')](',');var _0x546483={};_0x546483[_0x2fa785[0x0]]={'$gte':moment(_0x2fa785[0x1])[_0x30e2('0x66')](_0x30e2('0x67'))};_0x519cd5['where']=_[_0x30e2('0x51')](_0x519cd5[_0x30e2('0x46')],_0x546483);}_0x519cd5=_['merge']({},_0x519cd5,_0x5c515e['options']);return _0x49771d['getMessages'](_0x519cd5);}})[_0x30e2('0x1e')](function(_0x5616d6){if(_0x5616d6){_0x15b9e0=_0x5616d6['length'];if(!_0x5c515e['query'][_0x30e2('0x5e')](_0x30e2('0x44'))){_0x519cd5['limit']=qs[_0x30e2('0x2b')](_0x5c515e[_0x30e2('0x3e')]['limit']);_0x519cd5[_0x30e2('0x28')]=qs['offset'](_0x5c515e[_0x30e2('0x3e')][_0x30e2('0x28')]);}return _0x49771d[_0x30e2('0x68')](_0x519cd5);}})['then'](function(_0x22066d){if(_0x22066d){return _0x22066d?{'count':_0x15b9e0,'rows':_0x22066d}:null;}})[_0x30e2('0x1e')](respondWithResult(_0x53056c,null))[_0x30e2('0x4d')](handleError(_0x53056c,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index eb77c1c..37f4bb6 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 _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x32ea4c,_0x2d84a1){var _0x1861b4=function(_0x310ab4){while(--_0x310ab4){_0x32ea4c['push'](_0x32ea4c['shift']());}};_0x1861b4(++_0x2d84a1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x39d532,_0x4a561e){_0x39d532=_0x39d532-0x0;var _0x56cdf8=_0x5f2f[_0x39d532];return _0x56cdf8;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatGroup=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatGroupEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatGroupEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatGroup[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatGroupEvents;
\ No newline at end of file
+var _0x0b0e=['ChatGroup','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x5d02c4,_0x1bbd82){var _0x1e74ba=function(_0x36325){while(--_0x36325){_0x5d02c4['push'](_0x5d02c4['shift']());}};_0x1e74ba(++_0x1bbd82);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0x0b0e[_0x5b5cde];return _0x364ad2;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xe0b0('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){ChatGroupEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);ChatGroupEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];ChatGroup[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 84e3c89..3c45168 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 _0x9485=['request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash','util','../../config/logger','api','bluebird'];(function(_0x1defa0,_0x373af5){var _0x36798c=function(_0x296b33){while(--_0x296b33){_0x1defa0['push'](_0x1defa0['shift']());}};_0x36798c(++_0x373af5);}(_0x9485,0x8b));var _0x5948=function(_0x3ddfd5,_0x56c373){_0x3ddfd5=_0x3ddfd5-0x0;var _0x44855e=_0x9485[_0x3ddfd5];return _0x44855e;};'use strict';var _=require(_0x5948('0x0'));var util=require(_0x5948('0x1'));var logger=require(_0x5948('0x2'))(_0x5948('0x3'));var moment=require('moment');var BPromise=require(_0x5948('0x4'));var rp=require(_0x5948('0x5'));var fs=require('fs');var path=require(_0x5948('0x6'));var rimraf=require('rimraf');var config=require(_0x5948('0x7'));var attributes=require(_0x5948('0x8'));module[_0x5948('0x9')]=function(_0x4312a8,_0x19ccdd){return _0x4312a8[_0x5948('0xa')]('ChatGroup',attributes,{'tableName':_0x5948('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1f75=['ChatGroup','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define'];(function(_0x1efd69,_0x3c925f){var _0x257a69=function(_0x5a2279){while(--_0x5a2279){_0x1efd69['push'](_0x1efd69['shift']());}};_0x257a69(++_0x3c925f);}(_0x1f75,0x12c));var _0x51f7=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x1f75[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0x51f7('0x0'));var util=require(_0x51f7('0x1'));var logger=require(_0x51f7('0x2'))('api');var moment=require(_0x51f7('0x3'));var BPromise=require(_0x51f7('0x4'));var rp=require(_0x51f7('0x5'));var fs=require('fs');var path=require(_0x51f7('0x6'));var rimraf=require(_0x51f7('0x7'));var config=require(_0x51f7('0x8'));var attributes=require(_0x51f7('0x9'));module[_0x51f7('0xa')]=function(_0x292480,_0x22fc29){return _0x292480[_0x51f7('0xb')](_0x51f7('0xc'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 5241ba4..141f565 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 _0xf25e=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','./chatGroup.socket','register','request','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3ffcb2,_0x35e65f){var _0xe5182d=function(_0x56e779){while(--_0x56e779){_0x3ffcb2['push'](_0x3ffcb2['shift']());}};_0xe5182d(++_0x35e65f);}(_0xf25e,0xf6));var _0xef25=function(_0x3a2777,_0x4f1968){_0x3a2777=_0x3a2777-0x0;var _0x173fff=_0xf25e[_0x3a2777];return _0x173fff;};'use strict';var _=require(_0xef25('0x0'));var util=require(_0xef25('0x1'));var moment=require('moment');var BPromise=require(_0xef25('0x2'));var rs=require(_0xef25('0x3'));var fs=require('fs');var Redis=require(_0xef25('0x4'));var db=require(_0xef25('0x5'))['db'];var utils=require(_0xef25('0x6'));var logger=require('../../config/logger')(_0xef25('0x7'));var config=require(_0xef25('0x8'));var jayson=require(_0xef25('0x9'));var client=jayson[_0xef25('0xa')][_0xef25('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xef25('0xc'),'port':0x18eb});var socket=require(_0xef25('0xd'))(new Redis(config[_0xef25('0xe')]));require(_0xef25('0xf'))[_0xef25('0x10')](socket);function respondWithRpcPromise(_0x34fe9a,_0x3fbc59,_0x2565b0){return new BPromise(function(_0x150145,_0x317882){return client[_0xef25('0x11')](_0x34fe9a,_0x2565b0)['then'](function(_0x31ea2e){logger[_0xef25('0x12')]('ChatGroup,\x20%s,\x20%s',_0x3fbc59,_0xef25('0x13'));logger[_0xef25('0x14')](_0xef25('0x15'),_0x3fbc59,_0xef25('0x13'),JSON[_0xef25('0x16')](_0x31ea2e));if(_0x31ea2e['error']){if(_0x31ea2e[_0xef25('0x17')]['code']===0x1f4){logger['error'](_0xef25('0x18'),_0x3fbc59,_0x31ea2e[_0xef25('0x17')]['message']);return _0x317882(_0x31ea2e[_0xef25('0x17')][_0xef25('0x19')]);}logger['error'](_0xef25('0x18'),_0x3fbc59,_0x31ea2e['error'][_0xef25('0x19')]);return _0x150145(_0x31ea2e['error'][_0xef25('0x19')]);}else{logger[_0xef25('0x12')](_0xef25('0x18'),_0x3fbc59,_0xef25('0x13'));_0x150145(_0x31ea2e[_0xef25('0x1a')][_0xef25('0x19')]);}})[_0xef25('0x1b')](function(_0x541369){logger['error']('ChatGroup,\x20%s,\x20%s',_0x3fbc59,_0x541369);_0x317882(_0x541369);});});}
\ No newline at end of file
+var _0xe5d3=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','localhost','redis','./chatGroup.socket','request','then','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x54defc,_0x627178){var _0x1955d3=function(_0x299afe){while(--_0x299afe){_0x54defc['push'](_0x54defc['shift']());}};_0x1955d3(++_0x627178);}(_0xe5d3,0x1ad));var _0x3e5d=function(_0x515f78,_0x3b69be){_0x515f78=_0x515f78-0x0;var _0x506f6c=_0xe5d3[_0x515f78];return _0x506f6c;};'use strict';var _=require(_0x3e5d('0x0'));var util=require(_0x3e5d('0x1'));var moment=require(_0x3e5d('0x2'));var BPromise=require(_0x3e5d('0x3'));var rs=require(_0x3e5d('0x4'));var fs=require('fs');var Redis=require(_0x3e5d('0x5'));var db=require(_0x3e5d('0x6'))['db'];var utils=require(_0x3e5d('0x7'));var logger=require(_0x3e5d('0x8'))(_0x3e5d('0x9'));var config=require('../../config/environment');var jayson=require(_0x3e5d('0xa'));var client=jayson['client'][_0x3e5d('0xb')]({'port':0x232a});config['redis']=_[_0x3e5d('0xc')](config['redis'],{'host':_0x3e5d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3e5d('0xe')]));require(_0x3e5d('0xf'))['register'](socket);function respondWithRpcPromise(_0x15b7f8,_0x1c4af4,_0x581419){return new BPromise(function(_0x23f528,_0x2d116c){return client[_0x3e5d('0x10')](_0x15b7f8,_0x581419)[_0x3e5d('0x11')](function(_0x766299){logger['info']('ChatGroup,\x20%s,\x20%s',_0x1c4af4,_0x3e5d('0x12'));logger[_0x3e5d('0x13')](_0x3e5d('0x14'),_0x1c4af4,_0x3e5d('0x12'),JSON[_0x3e5d('0x15')](_0x766299));if(_0x766299[_0x3e5d('0x16')]){if(_0x766299['error'][_0x3e5d('0x17')]===0x1f4){logger['error'](_0x3e5d('0x18'),_0x1c4af4,_0x766299[_0x3e5d('0x16')][_0x3e5d('0x19')]);return _0x2d116c(_0x766299[_0x3e5d('0x16')][_0x3e5d('0x19')]);}logger[_0x3e5d('0x16')](_0x3e5d('0x18'),_0x1c4af4,_0x766299['error']['message']);return _0x23f528(_0x766299['error']['message']);}else{logger[_0x3e5d('0x1a')](_0x3e5d('0x18'),_0x1c4af4,_0x3e5d('0x12'));_0x23f528(_0x766299[_0x3e5d('0x1b')][_0x3e5d('0x19')]);}})[_0x3e5d('0x1c')](function(_0x5d3b00){logger[_0x3e5d('0x16')](_0x3e5d('0x18'),_0x1c4af4,_0x5d3b00);_0x2d116c(_0x5d3b00);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 60b10d1..e3e7390 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 _0x29bb=['length','chatGroup:','remove','update','emit','removeListener','register'];(function(_0x6b7c2f,_0x293d2a){var _0x3cef8d=function(_0xd2ab1){while(--_0xd2ab1){_0x6b7c2f['push'](_0x6b7c2f['shift']());}};_0x3cef8d(++_0x293d2a);}(_0x29bb,0x113));var _0xb29b=function(_0x112bd0,_0x210742){_0x112bd0=_0x112bd0-0x0;var _0xcf89bf=_0x29bb[_0x112bd0];return _0xcf89bf;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0xb29b('0x0'),_0xb29b('0x1')];function createListener(_0x2a51fe,_0x2728c8){return function(_0x30dcbf){_0x2728c8[_0xb29b('0x2')](_0x2a51fe,_0x30dcbf);};}function removeListener(_0x173ee4,_0x5594e4){return function(){ChatGroupEvents[_0xb29b('0x3')](_0x173ee4,_0x5594e4);};}exports[_0xb29b('0x4')]=function(_0x5892f0){for(var _0x34fc91=0x0,_0xe77214=events[_0xb29b('0x5')];_0x34fc91<_0xe77214;_0x34fc91++){var _0x143990=events[_0x34fc91];var _0x40925e=createListener(_0xb29b('0x6')+_0x143990,_0x5892f0);ChatGroupEvents['on'](_0x143990,_0x40925e);}};
\ No newline at end of file
+var _0x9587=['save','remove','update','emit','register','length','chatGroup:'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x9587,0x1d5));var _0x7958=function(_0x1d4eb5,_0xa3107b){_0x1d4eb5=_0x1d4eb5-0x0;var _0x395c26=_0x9587[_0x1d4eb5];return _0x395c26;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x7958('0x0'),_0x7958('0x1'),_0x7958('0x2')];function createListener(_0x5c11d5,_0x3c0e48){return function(_0x19b0ba){_0x3c0e48[_0x7958('0x3')](_0x5c11d5,_0x19b0ba);};}function removeListener(_0x5e75e8,_0x197075){return function(){ChatGroupEvents['removeListener'](_0x5e75e8,_0x197075);};}exports[_0x7958('0x4')]=function(_0x2aa691){for(var _0x44b4e0=0x0,_0x156e68=events[_0x7958('0x5')];_0x44b4e0<_0x156e68;_0x44b4e0++){var _0x66fc17=events[_0x44b4e0];var _0x4c1e63=createListener(_0x7958('0x6')+_0x66fc17,_0x2aa691);ChatGroupEvents['on'](_0x66fc17,_0x4c1e63);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 52e48b7..369481e 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 _0x68a5=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getUnread','/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','put','update','delete','removeMembers','exports'];(function(_0x58a09c,_0x1548ba){var _0x4bfc32=function(_0x2aaec1){while(--_0x2aaec1){_0x58a09c['push'](_0x58a09c['shift']());}};_0x4bfc32(++_0x1548ba);}(_0x68a5,0xfc));var _0x568a=function(_0x231dcb,_0x55410){_0x231dcb=_0x231dcb-0x0;var _0x1867ef=_0x68a5[_0x231dcb];return _0x1867ef;};'use strict';var multer=require(_0x568a('0x0'));var util=require('util');var path=require(_0x568a('0x1'));var timeout=require(_0x568a('0x2'));var express=require('express');var router=express[_0x568a('0x3')]();var fs_extra=require(_0x568a('0x4'));var auth=require(_0x568a('0x5'));var interaction=require(_0x568a('0x6'));var config=require('../../config/environment');var controller=require(_0x568a('0x7'));router['get']('/',auth[_0x568a('0x8')](),controller[_0x568a('0x9')]);router[_0x568a('0xa')](_0x568a('0xb'),auth['isAuthenticated'](),controller[_0x568a('0xc')]);router['get'](_0x568a('0xd'),auth[_0x568a('0x8')](),controller[_0x568a('0xe')]);router[_0x568a('0xa')]('/:id/unread',auth['isAuthenticated'](),controller[_0x568a('0xf')]);router[_0x568a('0xa')]('/:id/members',auth[_0x568a('0x8')](),controller['getMembers']);router[_0x568a('0xa')](_0x568a('0x10'),auth[_0x568a('0x8')](),controller[_0x568a('0x11')]);router[_0x568a('0x12')]('/',auth[_0x568a('0x8')](),controller[_0x568a('0x13')]);router[_0x568a('0x12')](_0x568a('0x14'),auth[_0x568a('0x8')](),controller[_0x568a('0x15')]);router[_0x568a('0x12')](_0x568a('0x10'),auth[_0x568a('0x8')](),controller[_0x568a('0x16')]);router[_0x568a('0x17')](_0x568a('0xd'),auth['isAuthenticated'](),controller[_0x568a('0x18')]);router['delete'](_0x568a('0xd'),auth[_0x568a('0x8')](),controller['destroy']);router[_0x568a('0x19')]('/:id/members',auth[_0x568a('0x8')](),controller[_0x568a('0x1a')]);module[_0x568a('0x1b')]=router;
\ No newline at end of file
+var _0x4213=['addMembers','addMessage','put','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/messages','post','create'];(function(_0x388f1b,_0x1b6254){var _0x36ac35=function(_0x18a203){while(--_0x18a203){_0x388f1b['push'](_0x388f1b['shift']());}};_0x36ac35(++_0x1b6254);}(_0x4213,0x77));var _0x3421=function(_0x14e010,_0x220f30){_0x14e010=_0x14e010-0x0;var _0x322072=_0x4213[_0x14e010];return _0x322072;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var fs_extra=require(_0x3421('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3421('0x7'));var config=require('../../config/environment');var controller=require(_0x3421('0x8'));router[_0x3421('0x9')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0xb')]);router['get'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0xd')]);router[_0x3421('0x9')](_0x3421('0xe'),auth['isAuthenticated'](),controller[_0x3421('0xf')]);router['get']('/:id/unread',auth[_0x3421('0xa')](),controller['getUnread']);router[_0x3421('0x9')](_0x3421('0x10'),auth[_0x3421('0xa')](),controller[_0x3421('0x11')]);router[_0x3421('0x9')](_0x3421('0x12'),auth[_0x3421('0xa')](),controller['getMessages']);router[_0x3421('0x13')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0x14')]);router[_0x3421('0x13')](_0x3421('0x10'),auth[_0x3421('0xa')](),controller[_0x3421('0x15')]);router['post'](_0x3421('0x12'),auth['isAuthenticated'](),controller[_0x3421('0x16')]);router[_0x3421('0x17')]('/:id',auth[_0x3421('0xa')](),controller['update']);router[_0x3421('0x18')](_0x3421('0xe'),auth['isAuthenticated'](),controller[_0x3421('0x19')]);router[_0x3421('0x18')](_0x3421('0x10'),auth[_0x3421('0xa')](),controller[_0x3421('0x1a')]);module[_0x3421('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 63dc671..ba421f8 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 _0x775d=['ENUM','star','thumb','TEXT','STRING','DATE','long','out','exports','INTEGER'];(function(_0x3d26da,_0x57e7f0){var _0x3dfb46=function(_0x452fdd){while(--_0x452fdd){_0x3d26da['push'](_0x3d26da['shift']());}};_0x3dfb46(++_0x57e7f0);}(_0x775d,0x18e));var _0xd775=function(_0x5c593f,_0x46358e){_0x5c593f=_0x5c593f-0x0;var _0x1d5b52=_0x775d[_0x5c593f];return _0x1d5b52;};'use strict';var Sequelize=require('sequelize');module[_0xd775('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd775('0x1')]},'ratingType':{'type':Sequelize[_0xd775('0x2')](_0xd775('0x3'),_0xd775('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xd775('0x5')]},'pathTranscript':{'type':Sequelize[_0xd775('0x5')]},'mailTranscript':{'type':Sequelize[_0xd775('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd775('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd775('0x6')]},'thirdDisposition':{'type':Sequelize[_0xd775('0x6')]},'note':{'type':Sequelize[_0xd775('0x6')]},'browserName':{'type':Sequelize[_0xd775('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xd775('0x6')]},'osVersion':{'type':Sequelize[_0xd775('0x6')]},'deviceModel':{'type':Sequelize[_0xd775('0x6')]},'deviceVendor':{'type':Sequelize[_0xd775('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xd775('0x5')]},'customerIp':{'type':Sequelize[_0xd775('0x6')]},'formData':{'type':Sequelize[_0xd775('0x5')](_0xd775('0x8'))},'read1stAt':{'type':Sequelize[_0xd775('0x7')]},'lastMsgAt':{'type':Sequelize[_0xd775('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xd775('0x2')]('in',_0xd775('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd775('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xd775('0x5')]}};
\ No newline at end of file
+var _0x7956=['DATE','TEXT','long','sequelize','exports','INTEGER','ENUM','star','STRING'];(function(_0x4b1012,_0x1415eb){var _0x23d715=function(_0x25f330){while(--_0x25f330){_0x4b1012['push'](_0x4b1012['shift']());}};_0x23d715(++_0x1415eb);}(_0x7956,0x1bc));var _0x6795=function(_0xac6ab7,_0x514106){_0xac6ab7=_0xac6ab7-0x0;var _0x1ed1c4=_0x7956[_0xac6ab7];return _0x1ed1c4;};'use strict';var Sequelize=require(_0x6795('0x0'));module[_0x6795('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x6795('0x2')]},'ratingType':{'type':Sequelize[_0x6795('0x3')](_0x6795('0x4'),'thumb'),'defaultValue':_0x6795('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x6795('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x6795('0x6')]},'disposition':{'type':Sequelize[_0x6795('0x5')]},'secondDisposition':{'type':Sequelize[_0x6795('0x5')]},'thirdDisposition':{'type':Sequelize[_0x6795('0x5')]},'note':{'type':Sequelize[_0x6795('0x5')]},'browserName':{'type':Sequelize[_0x6795('0x5')]},'browserVersion':{'type':Sequelize[_0x6795('0x5')]},'osName':{'type':Sequelize[_0x6795('0x5')]},'osVersion':{'type':Sequelize[_0x6795('0x5')]},'deviceModel':{'type':Sequelize[_0x6795('0x5')]},'deviceVendor':{'type':Sequelize[_0x6795('0x5')]},'deviceType':{'type':Sequelize[_0x6795('0x5')]},'referer':{'type':Sequelize[_0x6795('0x7')]},'customerIp':{'type':Sequelize[_0x6795('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x6795('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x6795('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x6795('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6795('0x5')]},'customerPort':{'type':Sequelize[_0x6795('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x6795('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index eb0adc6..9f393a2 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 _0xbc53=['alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','appendFileSync','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','secret','includeAgent','includeAll','findAll','setTags','omit','chatInteractionTags:save','removeTags','unix','server','files','transcript-%d-%s.zip','firstName','lastName','attachments','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.html','.pdf','createPdfFromHTML','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','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','result','catch','status','end','json','offset','undefined','limit','set','apply','reject','save','update','sendStatus','stack','name','merge','body','contact','agent','interaction','account','map','Tags','TagIds','split','forEach','push','index','ChatInteraction','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\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','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','start','some','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','$gte','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','contactName','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','count','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.email','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ChatInteractionId','all','rows','params','rawAttributes','include','options','create','destroy','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','ChatWebsite','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias'];(function(_0x2c9e03,_0x3f8cc1){var _0x36c756=function(_0x53116a){while(--_0x53116a){_0x2c9e03['push'](_0x2c9e03['shift']());}};_0x36c756(++_0x3f8cc1);}(_0xbc53,0x180));var _0x3bc5=function(_0x52dcbc,_0x19e173){_0x52dcbc=_0x52dcbc-0x0;var _0x39b16a=_0xbc53[_0x52dcbc];return _0x39b16a;};'use strict';var emlformat=require(_0x3bc5('0x0'));var rimraf=require(_0x3bc5('0x1'));var zipdir=require(_0x3bc5('0x2'));var jsonpatch=require(_0x3bc5('0x3'));var rp=require(_0x3bc5('0x4'));var moment=require(_0x3bc5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3bc5('0x6'));var util=require(_0x3bc5('0x7'));var path=require(_0x3bc5('0x8'));var sox=require(_0x3bc5('0x9'));var csv=require(_0x3bc5('0xa'));var ejs=require(_0x3bc5('0xb'));var fs=require('fs');var fs_extra=require(_0x3bc5('0xc'));var _=require(_0x3bc5('0xd'));var squel=require(_0x3bc5('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3bc5('0xf'));var Papa=require(_0x3bc5('0x10'));var Redis=require(_0x3bc5('0x11'));var authService=require(_0x3bc5('0x12'));var qs=require(_0x3bc5('0x13'));var as=require(_0x3bc5('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x3bc5('0x15'));var logger=require(_0x3bc5('0x16'))(_0x3bc5('0x17'));var utils=require(_0x3bc5('0x18'));var config=require(_0x3bc5('0x19'));var licenseUtil=require(_0x3bc5('0x1a'));var db=require('../../mysqldb')['db'];config[_0x3bc5('0x1b')]=_[_0x3bc5('0x1c')](config[_0x3bc5('0x1b')],{'host':_0x3bc5('0x1d'),'port':0x18eb});var socket=require(_0x3bc5('0x1e'))(new Redis(config['redis']));require(_0x3bc5('0x1f'))[_0x3bc5('0x20')](socket);var jayson=require(_0x3bc5('0x21'));var client=jayson[_0x3bc5('0x22')][_0x3bc5('0x23')]({'port':0x232b});var client9004=jayson[_0x3bc5('0x22')][_0x3bc5('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x4110e5,_0x59ac99,_0x26b648,_0x1cf18){return new BPromise(function(_0x11dff1,_0x266875){var _0x346e1a=_0x1cf18||client;return _0x346e1a[_0x3bc5('0x24')](_0x4110e5,_0x26b648)[_0x3bc5('0x25')](function(_0x3c9c1e){logger[_0x3bc5('0x26')](_0x3bc5('0x27'),_0x59ac99,_0x3bc5('0x28'));logger[_0x3bc5('0x29')](_0x3bc5('0x2a'),_0x59ac99,'request\x20sent',JSON[_0x3bc5('0x2b')](_0x3c9c1e));if(_0x3c9c1e['error']){if(_0x3c9c1e[_0x3bc5('0x2c')][_0x3bc5('0x2d')]===0x1f4){logger[_0x3bc5('0x2c')](_0x3bc5('0x27'),_0x59ac99,_0x3c9c1e[_0x3bc5('0x2c')][_0x3bc5('0x2e')]);return _0x266875(_0x3c9c1e['error']['message']);}logger['error'](_0x3bc5('0x27'),_0x59ac99,_0x3c9c1e['error'][_0x3bc5('0x2e')]);return _0x11dff1(_0x3c9c1e[_0x3bc5('0x2c')][_0x3bc5('0x2e')]);}else{logger[_0x3bc5('0x26')](_0x3bc5('0x27'),_0x59ac99,'request\x20sent');_0x11dff1(_0x3c9c1e[_0x3bc5('0x2f')][_0x3bc5('0x2e')]);}})[_0x3bc5('0x30')](function(_0x1627f7){logger['error'](_0x3bc5('0x27'),_0x59ac99,_0x1627f7);_0x266875(_0x1627f7);});});}function respondWithStatusCode(_0x441866,_0x30f611){_0x30f611=_0x30f611||0xcc;return function(_0x3bbcd6){if(_0x3bbcd6){return _0x441866['sendStatus'](_0x30f611);}return _0x441866[_0x3bc5('0x31')](_0x30f611)[_0x3bc5('0x32')]();};}function respondWithResult(_0x5e0b64,_0x191822){_0x191822=_0x191822||0xc8;return function(_0x2c5307){if(_0x2c5307){return _0x5e0b64[_0x3bc5('0x31')](_0x191822)[_0x3bc5('0x33')](_0x2c5307);}};}function respondWithFilteredResult(_0x1cf02a,_0x5b6590){return function(_0x209479){if(_0x209479){var _0x429681=typeof _0x5b6590[_0x3bc5('0x34')]===_0x3bc5('0x35')&&typeof _0x5b6590[_0x3bc5('0x36')]===_0x3bc5('0x35');var _0x9a2c9c=_0x209479['count'];var _0x24b7f8=_0x429681?0x0:_0x5b6590[_0x3bc5('0x34')];var _0x1ef2e9=_0x429681?_0x209479['count']:_0x5b6590[_0x3bc5('0x34')]+_0x5b6590['limit'];var _0x12a896;if(_0x1ef2e9>=_0x9a2c9c){_0x1ef2e9=_0x9a2c9c;_0x12a896=0xc8;}else{_0x12a896=0xce;}_0x1cf02a[_0x3bc5('0x31')](_0x12a896);return _0x1cf02a[_0x3bc5('0x37')]('Content-Range',_0x24b7f8+'-'+_0x1ef2e9+'/'+_0x9a2c9c)[_0x3bc5('0x33')](_0x209479);}return null;};}function patchUpdates(_0x154eb8){return function(_0x101476){try{jsonpatch[_0x3bc5('0x38')](_0x101476,_0x154eb8,!![]);}catch(_0x20ca4e){return BPromise[_0x3bc5('0x39')](_0x20ca4e);}return _0x101476[_0x3bc5('0x3a')]();};}function saveUpdates(_0x3abf8e,_0x1f3356){return function(_0x4576a5){if(_0x4576a5){return _0x4576a5[_0x3bc5('0x3b')](_0x3abf8e)['then'](function(_0x566db7){return _0x566db7;});}return null;};}function removeEntity(_0x2168ca,_0x29f8fe){return function(_0x39df21){if(_0x39df21){return _0x39df21['destroy']()['then'](function(){_0x2168ca[_0x3bc5('0x31')](0xcc)[_0x3bc5('0x32')]();});}};}function handleEntityNotFound(_0x33aaef,_0x2ac9c8){return function(_0x206eb2){if(!_0x206eb2){_0x33aaef[_0x3bc5('0x3c')](0x194);}return _0x206eb2;};}function handleError(_0x13a56f,_0xf0f0d4){_0xf0f0d4=_0xf0f0d4||0x1f4;return function(_0x2d5eed){logger['error'](_0x2d5eed[_0x3bc5('0x3d')]);if(_0x2d5eed['name']){delete _0x2d5eed[_0x3bc5('0x3e')];}_0x13a56f['status'](_0xf0f0d4)['send'](_0x2d5eed);};}function getMustacheRender(_0x2278b3,_0x49800d){return Mustache['render'](_0x2278b3,_[_0x3bc5('0x3f')](_0x49800d[_0x3bc5('0x40')],{'contact':_0x49800d[_0x3bc5('0x41')],'message':_0x49800d['message'],'agent':_0x49800d[_0x3bc5('0x42')],'interaction':_0x49800d[_0x3bc5('0x43')],'account':_0x49800d[_0x3bc5('0x44')]}))||'';}function getInteractionUsers(_0x148cd8,_0x1f38aa){return new BPromise(function(_0x2f8b5a,_0x3ac30c){try{if(_0x1f38aa[_0x148cd8['id']]){_0x148cd8['Users']=_[_0x3bc5('0x45')](_0x1f38aa[_0x148cd8['id']],function(_0x686b0f){return{'id':_0x686b0f['id'],'fullname':_0x686b0f['fullname']};});}}catch(_0x159c3f){_0x3ac30c(_0x159c3f);}_0x2f8b5a(_0x148cd8);});}function getInteractionTags(_0x2f967c,_0x4b6ad3){return new BPromise(function(_0x1ce7bc,_0x4932c8){try{if(_0x2f967c['TagIds']){_0x2f967c[_0x3bc5('0x46')]=[];_0x2f967c[_0x3bc5('0x47')][_0x3bc5('0x48')](',')[_0x3bc5('0x49')](function(_0x261919){_0x2f967c[_0x3bc5('0x46')][_0x3bc5('0x4a')](_0x4b6ad3[_0x261919]);});}delete _0x2f967c[_0x3bc5('0x47')];}catch(_0x5457a4){_0x4932c8(_0x5457a4);}_0x1ce7bc(_0x2f967c);});}function updateChatInteraction(_0x16e8a0,_0x28432c,_0xa955e){return new BPromise(function(_0xe84986,_0x489af3){return getInteractionUsers(_0x16e8a0,_0xa955e)[_0x3bc5('0x25')](function(_0x4bc361){return getInteractionTags(_0x4bc361,_0x28432c);})[_0x3bc5('0x25')](function(_0x2c090b){_0xe84986(_0x2c090b);})['catch'](function(_0x351c71){_0x489af3(_0x351c71);});});}exports[_0x3bc5('0x4b')]=function(_0x5e8be3,_0x43f4a4){var _0x521e93={},_0x38ad75={},_0xec2117={'count':0x0,'rows':[]};var _0x5e69d0=_['map'](db[_0x3bc5('0x4c')]['rawAttributes'],function(_0x48834b){return{'name':_0x48834b[_0x3bc5('0x4d')],'type':_0x48834b[_0x3bc5('0x4e')]['key']};});_0x38ad75['model']=_['map'](_0x5e69d0,'name');_0x38ad75[_0x3bc5('0x4f')]=_[_0x3bc5('0x50')](_0x5e8be3[_0x3bc5('0x4f')]);_0x38ad75[_0x3bc5('0x51')]=_[_0x3bc5('0x52')](_0x38ad75[_0x3bc5('0x53')],_0x38ad75['query']);_0x521e93[_0x3bc5('0x54')]=_[_0x3bc5('0x52')](_0x38ad75[_0x3bc5('0x53')],qs[_0x3bc5('0x55')](_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x55')]));_0x521e93[_0x3bc5('0x54')]=_0x521e93[_0x3bc5('0x54')][_0x3bc5('0x56')]?_0x521e93[_0x3bc5('0x54')]:_0x38ad75['model'];if(!_0x5e8be3[_0x3bc5('0x4f')]['hasOwnProperty'](_0x3bc5('0x57'))){_0x521e93['limit']=qs[_0x3bc5('0x36')](_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x36')]);_0x521e93[_0x3bc5('0x34')]=qs['offset'](_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x34')]);}_0x521e93[_0x3bc5('0x58')]=qs['sort'](_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x59')]);_0x521e93['where']=qs[_0x3bc5('0x51')](_[_0x3bc5('0x5a')](_0x5e8be3[_0x3bc5('0x4f')],_0x38ad75['filters']),_0x5e69d0);var _0x677036=[];var _0x4184d7=squel[_0x3bc5('0x5b')]()[_0x3bc5('0x5c')]('id')[_0x3bc5('0x5c')](_0x3bc5('0x3e'))['field'](_0x3bc5('0x5d'))[_0x3bc5('0x5e')]('tools_tags');var _0x54d46b=squel[_0x3bc5('0x5b')]()[_0x3bc5('0x5c')](_0x3bc5('0x5f'))[_0x3bc5('0x5c')](_0x3bc5('0x60'))[_0x3bc5('0x5c')](_0x3bc5('0x61'))[_0x3bc5('0x5e')](_0x3bc5('0x62'),'ui')[_0x3bc5('0x63')](_0x3bc5('0x64'),'u',_0x3bc5('0x65'));var _0xdba4ca=squel['select']()[_0x3bc5('0x5e')](_0x3bc5('0x66'),'i')[_0x3bc5('0x63')](_0x3bc5('0x67'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x3bc5('0x63')]('users','o',_0x3bc5('0x68'))[_0x3bc5('0x63')](_0x3bc5('0x69'),'a',_0x3bc5('0x6a'))[_0x3bc5('0x63')](_0x3bc5('0x6b'),'me',_0x3bc5('0x6c'))[_0x3bc5('0x63')](_0x3bc5('0x6d'),'it',_0x3bc5('0x6e'))[_0x3bc5('0x63')](_0x3bc5('0x6f'),'t',_0x3bc5('0x70'));var _0x4c9946=squel[_0x3bc5('0x71')]();var _0x50a42c=[];var _0x1ac212=squel[_0x3bc5('0x71')]();var _0x3001c2;if(_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x72')]){_0x3001c2=as[_0x3bc5('0x73')](_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x72')]);var _0x2b5b21=_0x3001c2[_0x3bc5('0x74')];for(var _0x33bb80=0x0;_0x33bb80<_0x3001c2[_0x3bc5('0x75')]['length'];_0x33bb80++){var _0x3dd7cf=_0x3001c2['conditions'][_0x33bb80];var _0x583cfb='i';var _0x4cfcba=_[_0x3bc5('0x76')](_0x5e69d0,[_0x3bc5('0x3e'),_0x3dd7cf[_0x3bc5('0x5c')]]);if(!_0x4cfcba){switch(_0x3dd7cf[_0x3bc5('0x5c')]){case _0x3bc5('0x77'):if(_0x3dd7cf[_0x3bc5('0x78')]==0x1){_0xdba4ca[_0x3bc5('0x79')]('`'+_0x3dd7cf[_0x3bc5('0x5c')]+_0x3bc5('0x7a'));}else{_0xdba4ca[_0x3bc5('0x79')]('`'+_0x3dd7cf[_0x3bc5('0x5c')]+'`\x20>\x200');}break;case _0x3bc5('0x7b'):if(_0x3dd7cf[_0x3bc5('0x7c')]===_0x3bc5('0x7d')){if(_0x3dd7cf[_0x3bc5('0x78')][_0x3bc5('0x48')]('\x20')[_0x3bc5('0x56')]>0x1){_0x4c9946[_0x2b5b21](_0x3bc5('0x7e'),qs[_0x3bc5('0x7f')](_0x3dd7cf[_0x3bc5('0x78')]),null);}else{var _0x395b31='%'+_0x3dd7cf['value']+'%';_0x4c9946[_0x2b5b21](_0x3bc5('0x80'),_0x395b31,_0x395b31,_0x395b31);}}else{_0x4cfcba=_['find'](_0x5e69d0,[_0x3bc5('0x3e'),_0x3bc5('0x81')]);_0x3dd7cf[_0x3bc5('0x5c')]=_0x3bc5('0x81');_0x51699e=as['buildExpression'](_0x583cfb,_0x4cfcba[_0x3bc5('0x4e')],_0x3dd7cf);_0x4c9946[_0x2b5b21](_0x51699e[_0x3bc5('0x82')],_0x51699e[_0x3bc5('0x78')]['start'],_0x51699e[_0x3bc5('0x78')]['end']);}break;case _0x3bc5('0x83'):var _0x40f0ac=_0x3dd7cf[_0x3bc5('0x78')][_0x3bc5('0x48')](',')['map'](function(_0x4a2fe9){return Number(_0x4a2fe9);});_0x40f0ac[_0x3bc5('0x49')](function(_0x400166){_0x1ac212['or'](_0x3bc5('0x84'),'%,'+_0x400166+',%');});_0x50a42c=_[_0x3bc5('0x85')](_0x50a42c,_0x40f0ac);break;case _0x3bc5('0x86'):if(_0x3dd7cf[_0x3bc5('0x7c')]===_0x3bc5('0x7d')){_0x4c9946[_0x2b5b21](_0x3bc5('0x87'),'%'+_0x3dd7cf[_0x3bc5('0x78')]+'%',null);}else{_0x4cfcba=_['find'](_0x5e69d0,[_0x3bc5('0x3e'),_0x3bc5('0x88')]);_0x3dd7cf[_0x3bc5('0x5c')]='UserId';_0x51699e=as[_0x3bc5('0x89')](_0x583cfb,_0x4cfcba[_0x3bc5('0x4e')],_0x3dd7cf);_0x4c9946[_0x2b5b21](_0x51699e[_0x3bc5('0x82')],_0x51699e[_0x3bc5('0x78')][_0x3bc5('0x8a')],_0x51699e[_0x3bc5('0x78')][_0x3bc5('0x32')]);}break;case'body':_0x51699e=as[_0x3bc5('0x89')]('me',null,_0x3dd7cf);_0x4c9946[_0x2b5b21](_0x51699e[_0x3bc5('0x82')],_0x51699e[_0x3bc5('0x78')][_0x3bc5('0x8a')],_0x51699e[_0x3bc5('0x78')]['end']);break;}}else{var _0x51699e=as['buildExpression'](_0x583cfb,_0x4cfcba[_0x3bc5('0x4e')],_0x3dd7cf);_0x4c9946[_0x2b5b21](_0x51699e[_0x3bc5('0x82')],_0x51699e[_0x3bc5('0x78')][_0x3bc5('0x8a')],_0x51699e[_0x3bc5('0x78')][_0x3bc5('0x32')]);}}}else{var _0x2b8c9e=_(_0x5e8be3[_0x3bc5('0x4f')])[_0x3bc5('0x50')]()[_0x3bc5('0x45')](function(_0x76fc0){return _[_0x3bc5('0x8b')](_0x5e69d0,['name',_0x76fc0])?_0x76fc0:undefined;})['compact']()[_0x3bc5('0x78')]();if(!_[_0x3bc5('0x8c')](_0x2b8c9e)){_0x2b8c9e[_0x3bc5('0x49')](function(_0x4e1cd1){if(_0x4e1cd1==='ChatWebsiteId'){_0xdba4ca['where'](_0x3bc5('0x8d'),[][_0x3bc5('0x8e')](_0x5e8be3[_0x3bc5('0x4f')][_0x4e1cd1]));}else if(_0x4e1cd1==='createdAt'){var _0x40e284=JSON['parse'](_0x5e8be3['query'][_0x4e1cd1])[_0x3bc5('0x8f')];var _0x41d385=JSON[_0x3bc5('0x90')](_0x5e8be3['query'][_0x4e1cd1])[_0x3bc5('0x91')];_0xdba4ca[_0x3bc5('0x92')](_0x3bc5('0x93'),_0x40e284,_0x41d385);}else{if(_0x5e8be3['query'][_0x4e1cd1]===_0x3bc5('0x94')){_0xdba4ca[_0x3bc5('0x92')]('i.'+_0x4e1cd1+_0x3bc5('0x95'));}else{_0xdba4ca['where']('i.'+_0x4e1cd1+_0x3bc5('0x96'),_0x5e8be3['query'][_0x4e1cd1]);}}});}if(_0x5e8be3['query'][_0x3bc5('0x97')]){if(_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x97')]==0x1){_0xdba4ca[_0x3bc5('0x79')]('`unreadMessages`\x20=\x200');}else{_0xdba4ca[_0x3bc5('0x79')](_0x3bc5('0x98'));}}if(_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x99')]){_0x50a42c=_[_0x3bc5('0x9a')](_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x99')])?_0x5e8be3['query'][_0x3bc5('0x99')]:new Array(_0x5e8be3[_0x3bc5('0x4f')]['tag']);_0x50a42c['forEach'](function(_0xac2bea){_0x1ac212['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xac2bea+',%');});}if(_0x5e8be3['query']['filter']){var _0x469f49=_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x9b')]['replace']('\x5c','\x5c\x5c')[_0x3bc5('0x9c')](/'/g,'\x27\x27');if(qs[_0x3bc5('0x9d')](_0x469f49)){_0x4c9946['or'](_0x3bc5('0x9e'),_0x469f49+'%');}else{_0x4c9946['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3bc5('0x7f')](_0x469f49))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x469f49+'%');}}}_0xdba4ca[_0x3bc5('0x92')](_0x4c9946);_0xdba4ca['group'](_0x3bc5('0x9f'));var _0x367436={'type':db[_0x3bc5('0xa0')][_0x3bc5('0xa1')][_0x3bc5('0xa2')],'raw':!![]};var _0x51e8b5=_0xdba4ca['clone']();_0x51e8b5[_0x3bc5('0x5c')](_0x3bc5('0x9f'));_0x51e8b5[_0x3bc5('0x5c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3bc5('0x77'));if(_0x521e93[_0x3bc5('0x58')]){_0x521e93[_0x3bc5('0x58')][_0x3bc5('0x49')](function(_0x17f6f7){var _0x11a4e2=_0x17f6f7[0x0]===_0x3bc5('0xa3')?_0x17f6f7[0x0]:'i.'+_0x17f6f7[0x0];_0xdba4ca[_0x3bc5('0x58')](_0x11a4e2,_0x17f6f7[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x50a42c)){_0xdba4ca[_0x3bc5('0x79')](_0x1ac212);_0x51e8b5[_0x3bc5('0x92')](_0x3bc5('0xa4'),_0x50a42c);}BPromise[_0x3bc5('0xa5')]()['then'](function(){if(!_0x3001c2){if(_0x5e8be3[_0x3bc5('0x4f')]['ChatWebsiteId'])return;_0x51e8b5[_0x3bc5('0x92')](_0x3bc5('0xa6'));_0xdba4ca[_0x3bc5('0x92')](_0x3bc5('0xa6'));return;}if(_0x5e8be3[_0x3bc5('0xa7')]['role']!==_0x3bc5('0x42'))return;return _0x5e8be3[_0x3bc5('0xa7')][_0x3bc5('0xa8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x306079){if(_[_0x3bc5('0x8c')](_0x306079)){_0x51e8b5['where'](_0x3bc5('0xa9'));_0xdba4ca[_0x3bc5('0x92')](_0x3bc5('0xa9'));}else{_0x51e8b5[_0x3bc5('0x92')](_0x3bc5('0x8d'),_[_0x3bc5('0x45')](_0x306079,'id'));_0xdba4ca[_0x3bc5('0x92')](_0x3bc5('0x8d'),_[_0x3bc5('0x45')](_0x306079,'id'));}});})[_0x3bc5('0x25')](function(){if(_0x5e8be3[_0x3bc5('0xa7')][_0x3bc5('0xaa')]==='agent'&&!_0x3001c2&&!_0x5e8be3[_0x3bc5('0x4f')]['ChatWebsiteId'])return[];return db[_0x3bc5('0xab')]['query'](_0x51e8b5['toString'](),_0x367436);})[_0x3bc5('0x25')](function(_0x1a90f2){_0xec2117[_0x3bc5('0xac')]=_0x1a90f2[_0x3bc5('0x56')];if(_0xec2117[_0x3bc5('0xac')]===0x0)return[];return db[_0x3bc5('0xab')][_0x3bc5('0x4f')](_0x4184d7[_0x3bc5('0xad')](),_0x367436)[_0x3bc5('0x25')](function(_0x1f3154){_0x677036=_[_0x3bc5('0xae')](_0x1f3154,'id');_0x367436=_[_0x3bc5('0x3f')](_0x367436,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5e8be3[_0x3bc5('0x4f')][_0x3bc5('0x55')]){_0x521e93[_0x3bc5('0x54')]['forEach'](function(_0x23da13){_0xdba4ca[_0x3bc5('0x5c')]('i.'+_0x23da13);});}else{_0xdba4ca[_0x3bc5('0x5c')](_0x3bc5('0xaf'),_0x3bc5('0x77'));_0xdba4ca['field']('a.key','Account.key');_0xdba4ca[_0x3bc5('0x5c')](_0x3bc5('0xb0'),_0x3bc5('0xb1'));_0xdba4ca[_0x3bc5('0x5c')](_0x3bc5('0xb2'),_0x3bc5('0xa3'));_0xdba4ca[_0x3bc5('0x5c')]('i.*');_0xdba4ca['field'](_0x3bc5('0xb3'),_0x3bc5('0xb4'));_0xdba4ca['field'](_0x3bc5('0xb5'),'Contact.lastName');_0xdba4ca['field']('c.email',_0x3bc5('0xb6'));_0xdba4ca[_0x3bc5('0x5c')]('c.phone','Contact.phone');_0xdba4ca[_0x3bc5('0x5c')](_0x3bc5('0xb7'),_0x3bc5('0xb8'));_0xdba4ca[_0x3bc5('0x5c')]('c.fax','Contact.fax');_0xdba4ca[_0x3bc5('0x5c')](_0x3bc5('0xb9'),_0x3bc5('0xba'));_0xdba4ca[_0x3bc5('0x5c')](_0x3bc5('0xbb'),_0x3bc5('0xbc'));_0xdba4ca[_0x3bc5('0x5c')](_0x3bc5('0xbd'),'TagIds');}if(_0x521e93['limit'])_0xdba4ca['limit'](_0x521e93[_0x3bc5('0x36')]);if(_0x521e93[_0x3bc5('0x34')])_0xdba4ca[_0x3bc5('0x34')](_0x521e93[_0x3bc5('0x34')]);return db[_0x3bc5('0xab')][_0x3bc5('0x4f')](_0xdba4ca[_0x3bc5('0xad')](),_0x367436);})[_0x3bc5('0x25')](function(_0x50ce64){if(_0x50ce64[_0x3bc5('0x56')]>0x0)_0x54d46b[_0x3bc5('0x92')]('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x50ce64,'id'));return db['sequelize']['query'](_0x54d46b[_0x3bc5('0xad')](),_0x367436)[_0x3bc5('0x25')](function(_0x5a59fb){var _0x10c9c5=_['groupBy'](_0x5a59fb,_0x3bc5('0xbe'));var _0x254c27=[];_0x50ce64[_0x3bc5('0x49')](function(_0x35d9a5){_0x254c27[_0x3bc5('0x4a')](updateChatInteraction(_0x35d9a5,_0x677036,_0x10c9c5));});return BPromise[_0x3bc5('0xbf')](_0x254c27);});});})['then'](function(_0x5a8141){_0xec2117[_0x3bc5('0xc0')]=_0x5a8141;return _0xec2117;})[_0x3bc5('0x25')](respondWithFilteredResult(_0x43f4a4,_0x521e93))[_0x3bc5('0x30')](handleError(_0x43f4a4,null));};exports['show']=function(_0x11dbd5,_0x3c0cbf){var _0x11c6f6={'raw':![],'where':{'id':_0x11dbd5[_0x3bc5('0xc1')]['id']}},_0x434035={};_0x434035['model']=_[_0x3bc5('0x50')](db[_0x3bc5('0x4c')][_0x3bc5('0xc2')]);_0x434035['query']=_[_0x3bc5('0x50')](_0x11dbd5['query']);_0x434035[_0x3bc5('0x51')]=_[_0x3bc5('0x52')](_0x434035[_0x3bc5('0x53')],_0x434035['query']);_0x11c6f6['attributes']=_['intersection'](_0x434035[_0x3bc5('0x53')],qs[_0x3bc5('0x55')](_0x11dbd5[_0x3bc5('0x4f')][_0x3bc5('0x55')]));_0x11c6f6[_0x3bc5('0x54')]=_0x11c6f6[_0x3bc5('0x54')][_0x3bc5('0x56')]?_0x11c6f6[_0x3bc5('0x54')]:_0x434035[_0x3bc5('0x53')];if(_0x11dbd5['query']['includeAll']){_0x11c6f6[_0x3bc5('0xc3')]=[{'all':!![]}];}_0x11c6f6=_[_0x3bc5('0x3f')]({},_0x11c6f6,_0x11dbd5[_0x3bc5('0xc4')]);return db[_0x3bc5('0x4c')][_0x3bc5('0x76')](_0x11c6f6)[_0x3bc5('0x25')](handleEntityNotFound(_0x3c0cbf,null))['then'](respondWithResult(_0x3c0cbf,null))[_0x3bc5('0x30')](handleError(_0x3c0cbf,null));};exports[_0x3bc5('0xc5')]=function(_0x32d4cc,_0x29add5){return db[_0x3bc5('0x4c')][_0x3bc5('0xc5')](_0x32d4cc[_0x3bc5('0x40')],{})[_0x3bc5('0x25')](respondWithResult(_0x29add5,0xc9))['catch'](handleError(_0x29add5,null));};exports[_0x3bc5('0x3b')]=function(_0x52991d,_0x243d8f){if(_0x52991d[_0x3bc5('0x40')]['id']){delete _0x52991d[_0x3bc5('0x40')]['id'];}return db[_0x3bc5('0x4c')]['find']({'where':{'id':_0x52991d[_0x3bc5('0xc1')]['id']}})[_0x3bc5('0x25')](handleEntityNotFound(_0x243d8f,null))['then'](saveUpdates(_0x52991d[_0x3bc5('0x40')],null))[_0x3bc5('0x25')](respondWithResult(_0x243d8f,null))[_0x3bc5('0x30')](handleError(_0x243d8f,null));};exports[_0x3bc5('0xc6')]=function(_0x776df1,_0x24fb86){return db[_0x3bc5('0x4c')][_0x3bc5('0x76')]({'where':{'id':_0x776df1['params']['id']}})[_0x3bc5('0x25')](handleEntityNotFound(_0x24fb86,null))[_0x3bc5('0x25')](removeEntity(_0x24fb86,null))['catch'](handleError(_0x24fb86,null));};exports[_0x3bc5('0xc7')]=function(_0x1e6e5f,_0x41e335){return db['ChatInteraction']['describe']()['then'](respondWithResult(_0x41e335,null))[_0x3bc5('0x30')](handleError(_0x41e335,null));};exports[_0x3bc5('0xc8')]=function(_0x7a12cf,_0xc32eb0){var _0x380cb5=_0x7a12cf[_0x3bc5('0xc1')]['id'];var _0x137593;var _0xaeb537;var _0x5b607f;return db[_0x3bc5('0x4c')][_0x3bc5('0xc9')]({'where':{'id':_0x380cb5}})[_0x3bc5('0x25')](function(_0x57baec){_0x137593=_0x57baec;return db['ChatWebsite'][_0x3bc5('0xc9')]({'where':{'id':_0x57baec[_0x3bc5('0xca')]},'attributes':['id',_0x3bc5('0xcb'),_0x3bc5('0xcc'),_0x3bc5('0xcd'),_0x3bc5('0xce'),_0x3bc5('0xcf')],'raw':!![]});})['then'](function(_0x33183c){if(_0x33183c&&_0x33183c[_0x3bc5('0xcb')]&&_0x33183c[_0x3bc5('0xcc')]){_0xaeb537=_0x33183c;var _0x477cae={'interaction':{'id':_0x380cb5},'agent':{'id':_0x7a12cf[_0x3bc5('0xa7')]['id'],'name':_0x7a12cf[_0x3bc5('0xa7')][_0x3bc5('0x3e')],'fullname':_0x7a12cf[_0x3bc5('0xa7')][_0x3bc5('0xd0')],'email':_0x7a12cf[_0x3bc5('0xa7')][_0x3bc5('0xd1')]},'contact':_0x7a12cf['body'][_0x3bc5('0x41')],'account':_0x7a12cf[_0x3bc5('0x40')][_0x3bc5('0x44')]};var _0x161cb7={'rejectUnauthorized':![],'method':'POST','url':_0x3bc5('0xd2'),'headers':{'X-APIKEY':_0x33183c[_0x3bc5('0xcb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x7a12cf[_0x3bc5('0xa7')][_0x3bc5('0xd1')]],'buttons':null,'topic':_0xaeb537[_0x3bc5('0xcd')],'note':_[_0x3bc5('0xd3')](_0xaeb537[_0x3bc5('0xce')])?null:getMustacheRender(_0xaeb537[_0x3bc5('0xce')],_0x477cae),'metadata':null},'redirect':_0x3bc5('0xd4'),'json':!![]};try{if(!_[_0x3bc5('0xd3')](_0xaeb537['vidaooMetadata'])){var _0x3e3bc6=getMustacheRender(_0xaeb537[_0x3bc5('0xcf')],_0x477cae);var _0x59f816=JSON[_0x3bc5('0x90')](_0x3e3bc6);_0x161cb7['body'][_0x3bc5('0xd5')]=_0x59f816;}}catch(_0x2b5fa0){throw new db[(_0x3bc5('0xa0'))][(_0x3bc5('0xd6'))](_0x3bc5('0xd7'));}return rp(_0x161cb7);}else{throw new db['Sequelize'][(_0x3bc5('0xd6'))](_0x3bc5('0xd8'));}})[_0x3bc5('0x25')](function(_0x2393e3){_0x5b607f=_0x2393e3;if(_0x5b607f['id']){var _0x2a951d={'body':_0x5b607f[_0x3bc5('0xd9')],'ChatWebsiteId':_0xaeb537['id'],'ChatInteractionId':_0x137593['id'],'direction':_0x3bc5('0xda'),'UserId':_0x7a12cf[_0x3bc5('0xa7')]['id']};return db[_0x3bc5('0xdb')][_0x3bc5('0xc5')](_0x2a951d,{});}else{throw new db['Sequelize'][(_0x3bc5('0xd6'))](_0x3bc5('0xdc'));}})['then'](function(){return _0x137593[_0x3bc5('0xdd')]({'vidaooSessionId':_0x5b607f['id']});})['then'](respondWithResult(_0xc32eb0,null))[_0x3bc5('0x30')](handleError(_0xc32eb0,null));};exports[_0x3bc5('0xde')]=function(_0x4d65af,_0x44206f){if(_0x4d65af[_0x3bc5('0x40')]['id']){delete _0x4d65af[_0x3bc5('0x40')]['id'];}return db[_0x3bc5('0x4c')][_0x3bc5('0x76')]({'where':{'id':_0x4d65af[_0x3bc5('0xc1')]['id']},'include':[{'model':db[_0x3bc5('0xdf')],'as':_0x3bc5('0x7b')}]})[_0x3bc5('0x25')](handleEntityNotFound(_0x44206f,null))[_0x3bc5('0x25')](saveUpdates(_0x4d65af[_0x3bc5('0x40')],null))[_0x3bc5('0x25')](respondWithResult(_0x44206f,null))[_0x3bc5('0x30')](handleError(_0x44206f,null));};exports[_0x3bc5('0xe0')]=function(_0x1edbf0,_0x382a1a,_0x5e6a43){if(_0x1edbf0[_0x3bc5('0x40')]['id']){delete _0x1edbf0[_0x3bc5('0x40')]['id'];}return db[_0x3bc5('0x4c')][_0x3bc5('0x76')]({'where':{'id':_0x1edbf0[_0x3bc5('0xc1')]['id']}})[_0x3bc5('0x25')](function(_0x117665){if(!_0x117665){logger[_0x3bc5('0x2c')](_0x3bc5('0xe1'),_0x3bc5('0xe0'),0x194,_0x3bc5('0xe2'));_0x382a1a[_0x3bc5('0x3c')](0x194);}else{if(_0x117665[_0x3bc5('0x88')]){throw new db['Sequelize'][(_0x3bc5('0xd6'))]('Interaction\x20already\x20assigned');}}return _0x117665;})[_0x3bc5('0x25')](function(_0x20ee63){if(_0x20ee63){return _0x20ee63[_0x3bc5('0x3b')]({'closed':_0x1edbf0[_0x3bc5('0x40')]['closed'],'disposition':_0x1edbf0[_0x3bc5('0x40')][_0x3bc5('0xe3')]})[_0x3bc5('0x25')](function(_0x1413c8){return _0x1413c8;});}})[_0x3bc5('0x25')](function(_0x17a0de){return respondWithRpcPromise(_0x3bc5('0xe4'),_0x3bc5('0xe0'),_0x1edbf0[_0x3bc5('0x40')],client9004);})[_0x3bc5('0x25')](respondWithResult(_0x382a1a,null))[_0x3bc5('0x30')](handleError(_0x382a1a,null));};exports[_0x3bc5('0xe5')]=function(_0x280341,_0x3e7793,_0x14f0af){_0x280341['body']['name']=_0x280341[_0x3bc5('0xe6')][_0x3bc5('0xe7')];_0x280341[_0x3bc5('0x40')][_0x3bc5('0xe8')]=_0x280341['file'][_0x3bc5('0xe9')];_0x280341[_0x3bc5('0x40')][_0x3bc5('0x4e')]=_0x280341[_0x3bc5('0xe6')][_0x3bc5('0xea')];return db[_0x3bc5('0xeb')][_0x3bc5('0xc5')](_0x280341[_0x3bc5('0x40')])[_0x3bc5('0x25')](respondWithResult(_0x3e7793,0xc9))[_0x3bc5('0x30')](handleError(_0x3e7793,null));};exports[_0x3bc5('0xec')]=function(_0x21bae9,_0x5cf5da,_0x36d903){return db['ChatInteraction'][_0x3bc5('0xc9')]({'where':{'id':_0x21bae9[_0x3bc5('0xc1')]['id']},'raw':!![]})[_0x3bc5('0x25')](handleEntityNotFound(_0x5cf5da,null))[_0x3bc5('0x25')](function(_0xddb16f){if(_0xddb16f){if(_0xddb16f[_0x3bc5('0xed')]){return _0x5cf5da['status'](0x193)[_0x3bc5('0x33')]({'status':0x193,'message':_0x3bc5('0xee')});}return db['Attachment']['findOne']({'where':{'id':_0x21bae9['query'][_0x3bc5('0xef')]},'raw':!![]})[_0x3bc5('0x25')](handleEntityNotFound(_0x5cf5da,null));}})[_0x3bc5('0x25')](function(_0x376dae){if(_0x376dae){var _0x3b6977=_0x376dae[_0x3bc5('0xf0')]!==null;var _0x3ad93b=path['join'](config[_0x3bc5('0xf1')],_0x3bc5('0xf2'));if(_0x3b6977){_0x3ad93b=path[_0x3bc5('0xf3')](_0x3ad93b,_0x3bc5('0xf4'));}var _0x5820da=path['join'](_0x3ad93b,_0x376dae[_0x3bc5('0xe8')]);return _0x5cf5da[_0x3bc5('0xf5')](_0x5820da);}})[_0x3bc5('0x30')](handleError(_0x5cf5da,null));};exports[_0x3bc5('0xf6')]=function(_0x46017f,_0x189118){var _0x3f29b3=null;var _0x464a2a=null;var _0x464c50=null;var _0x49873d=null;if(_0x46017f['body']['id']){delete _0x46017f[_0x3bc5('0x40')]['id'];}if(_0x46017f[_0x3bc5('0x40')]['mailTranscript']){_0x49873d=path[_0x3bc5('0xf3')](config['root'],_0x3bc5('0xf7'),util[_0x3bc5('0xf8')](_0x3bc5('0xf9'),Date[_0x3bc5('0xfa')]()));_0x46017f[_0x3bc5('0x40')]['pathTranscript']=_0x49873d;}return db[_0x3bc5('0x4c')][_0x3bc5('0x76')]({'where':{'id':_0x46017f[_0x3bc5('0xc1')]['id']},'include':[{'model':db[_0x3bc5('0xdb')],'as':_0x3bc5('0xfb'),'include':[{'model':db[_0x3bc5('0x86')],'as':'User'}]}]})[_0x3bc5('0x25')](handleEntityNotFound(_0x189118,null))[_0x3bc5('0x25')](saveUpdates(_0x46017f[_0x3bc5('0x40')],null))[_0x3bc5('0x25')](function(_0x4f2039){if(_0x4f2039){_0x3f29b3=_0x4f2039;return db[_0x3bc5('0xfc')][_0x3bc5('0x76')]({'where':{'id':_0x3f29b3['ChatWebsiteId']}});}})[_0x3bc5('0x25')](function(_0x5ce872){if(_0x5ce872){_0x464c50=_0x5ce872;return db['CmContact'][_0x3bc5('0x76')]({'where':{'id':_0x3f29b3[_0x3bc5('0x81')]}});}})[_0x3bc5('0x25')](function(_0x515dd9){if(_0x515dd9){_0x464a2a=_0x515dd9;if(_0x49873d){var _0x340673=null;for(var _0xfea989=0x1;_0xfea989<_0x3f29b3[_0x3bc5('0xfb')][_0x3bc5('0x56')];++_0xfea989){_0x340673=_0x3f29b3['Messages'][_0xfea989];var _0x491326=_0x340673['UserId']?util[_0x3bc5('0xf8')](_0x3bc5('0xfd'),_0x464c50[_0x3bc5('0xfe')],_0x340673['UserId']):_0x3bc5('0xff');var _0x6a38c5=_0x46017f['body'][_0x3bc5('0x100')]||util[_0x3bc5('0xf8')](_0x3bc5('0xfd'),_0x3bc5('0x101'),_0x340673['ContactId']);switch(_0x464c50[_0x3bc5('0x102')]){case _0x3bc5('0x103'):_0x491326=_0x340673['UserId']?util[_0x3bc5('0xf8')](_0x3bc5('0xfd'),_0x464c50[_0x3bc5('0xfe')],_0x340673[_0x3bc5('0x88')]):_0x3bc5('0xff');break;case'agent_alias':_0x491326=_0x340673[_0x3bc5('0x88')]?_0x340673[_0x3bc5('0x86')][_0x3bc5('0x104')]||_0x340673['User'][_0x3bc5('0xd0')]:_0x3bc5('0xff');break;case _0x3bc5('0x105'):_0x491326=_0x340673[_0x3bc5('0x88')]?_0x340673[_0x3bc5('0x86')][_0x3bc5('0xd0')]:_0x3bc5('0xff');break;default:_0x491326=_0x340673['UserId']?util[_0x3bc5('0xf8')](_0x3bc5('0xfd'),_0x464c50[_0x3bc5('0xfe')],_0x340673[_0x3bc5('0x88')]):_0x3bc5('0xff');}var _0x4aa51f=util['format'](_0x3bc5('0x106'),moment(_0x340673[_0x3bc5('0x107')])[_0x3bc5('0xf8')]('MM/DD/YYYY\x20HH:mm:ss'),_0x340673[_0x3bc5('0x108')]==='in'?_0x6a38c5:_0x491326,_0x340673['body']);if(!_0x340673['secret']){fs[_0x3bc5('0x109')](_0x49873d,_0x4aa51f);}}return db['MailAccount'][_0x3bc5('0xc9')]({'where':{'service':!![]},'include':[{'model':db[_0x3bc5('0x10a')],'as':_0x3bc5('0x10b'),'raw':!![]}]});}}})[_0x3bc5('0x25')](function(_0x313875){if(_0x313875&&_0x313875['Smtp']&&_0x46017f[_0x3bc5('0x40')]){var _0x19266a={'tls':{'rejectUnauthorized':![]}};if(_0x313875[_0x3bc5('0x10b')]['service']){_0x19266a[_0x3bc5('0x10c')]=_0x313875[_0x3bc5('0x10b')][_0x3bc5('0x10c')];}else{_0x19266a[_0x3bc5('0x10d')]=_0x313875[_0x3bc5('0x10b')][_0x3bc5('0x10d')];_0x19266a[_0x3bc5('0x10e')]=_0x313875['Smtp']['port'];_0x19266a[_0x3bc5('0x10f')]=_0x313875[_0x3bc5('0x10b')][_0x3bc5('0x10f')];}if(_0x313875[_0x3bc5('0x10b')][_0x3bc5('0x110')]){_0x19266a[_0x3bc5('0x111')]={'user':_0x313875[_0x3bc5('0x10b')][_0x3bc5('0xa7')],'pass':_0x313875[_0x3bc5('0x10b')]['pass']};}return respondWithRpcPromise(_0x3bc5('0x112'),_0x3bc5('0x113'),{'account':_0x19266a,'message':{'from':util[_0x3bc5('0xf8')](_0x3bc5('0x114'),_0x313875[_0x3bc5('0x3e')],_0x313875[_0x3bc5('0xd1')]||_0x313875[_0x3bc5('0x10b')]['user']),'to':_0x46017f['body'][_0x3bc5('0x115')],'subject':'Mail\x20Transcript','text':util['format'](_0x3bc5('0x116'),_0x46017f[_0x3bc5('0x40')][_0x3bc5('0x115')]),'attachments':[{'path':_0x49873d}]}})['then'](function(){return _0x3f29b3;})[_0x3bc5('0x30')](function(_0x3a7d6a){console['error'](_0x3a7d6a);});}else{return _0x3f29b3;}})[_0x3bc5('0x25')](respondWithStatusCode(_0x189118,0xc8))['catch'](handleError(_0x189118,null));};exports[_0x3bc5('0x117')]=function(_0x25a7cb,_0x33f858,_0x3557){return db['ChatMessage'][_0x3bc5('0x76')]({'where':{'id':_0x25a7cb['params']['id']}})[_0x3bc5('0x25')](handleEntityNotFound(_0x33f858,null))[_0x3bc5('0x25')](function(_0x14a154){if(_0x14a154){return _0x14a154[_0x3bc5('0x117')](_0x25a7cb[_0x3bc5('0x40')][_0x3bc5('0x118')],_['omit'](_0x25a7cb['body'],[_0x3bc5('0x118'),'id'])||{});}})[_0x3bc5('0x25')](respondWithResult(_0x33f858,null))[_0x3bc5('0x30')](handleError(_0x33f858,null));};exports[_0x3bc5('0x119')]=function(_0x1f71fc,_0x1d1ed5,_0x3005a3){var _0x178bf6={'raw':![],'where':{}};var _0xa52da5={};var _0x103c4d={'count':0x0,'rows':[]};return db[_0x3bc5('0x4c')][_0x3bc5('0xc9')]({'where':{'id':_0x1f71fc['params']['id']}})[_0x3bc5('0x25')](handleEntityNotFound(_0x1d1ed5,null))[_0x3bc5('0x25')](function(_0x435ab0){if(_0x435ab0){_0xa52da5[_0x3bc5('0x53')]=_['keys'](db['ChatMessage'][_0x3bc5('0xc2')]);_0xa52da5[_0x3bc5('0x4f')]=_['keys'](_0x1f71fc[_0x3bc5('0x4f')]);_0xa52da5['filters']=_['intersection'](_0xa52da5[_0x3bc5('0x53')],_0xa52da5['query']);_0x178bf6[_0x3bc5('0x54')]=_['intersection'](_0xa52da5['model'],qs[_0x3bc5('0x55')](_0x1f71fc['query']['fields']));_0x178bf6[_0x3bc5('0x54')]=_0x178bf6[_0x3bc5('0x54')]['length']?_0x178bf6[_0x3bc5('0x54')]:_0xa52da5[_0x3bc5('0x53')];if(!_0x1f71fc[_0x3bc5('0x4f')][_0x3bc5('0x11a')](_0x3bc5('0x57'))){_0x178bf6[_0x3bc5('0x36')]=qs['limit'](_0x1f71fc[_0x3bc5('0x4f')][_0x3bc5('0x36')]);_0x178bf6[_0x3bc5('0x34')]=qs[_0x3bc5('0x34')](_0x1f71fc[_0x3bc5('0x4f')][_0x3bc5('0x34')]);}_0x178bf6[_0x3bc5('0x58')]=qs[_0x3bc5('0x59')](_0x1f71fc['query'][_0x3bc5('0x59')]);_0x178bf6[_0x3bc5('0x92')]=qs['filters'](_[_0x3bc5('0x5a')](_0x1f71fc[_0x3bc5('0x4f')],_0xa52da5[_0x3bc5('0x51')]));_0x178bf6['where'][_0x3bc5('0xbe')]=_0x435ab0['id'];if(_0x1f71fc[_0x3bc5('0x4f')][_0x3bc5('0x9b')]){_0x178bf6[_0x3bc5('0x92')]=_['merge'](_0x178bf6[_0x3bc5('0x92')],{'$or':_[_0x3bc5('0x45')](_0x178bf6['attributes'],function(_0x1de556){var _0x25e305={};_0x25e305[_0x1de556]={'$like':'%'+_0x1f71fc['query'][_0x3bc5('0x9b')]+'%'};return _0x25e305;})});}if(_0x1f71fc[_0x3bc5('0x4f')][_0x3bc5('0x8f')]){var _0x612909=_0x1f71fc[_0x3bc5('0x4f')][_0x3bc5('0x8f')]['split'](',');var _0x1fa9b6={};_0x1fa9b6[_0x612909[0x0]]={'$gte':moment(_0x612909[0x1])[_0x3bc5('0xf8')](_0x3bc5('0x11b'))};_0x178bf6['where']=_[_0x3bc5('0x3f')](_0x178bf6[_0x3bc5('0x92')],_0x1fa9b6);}_0x178bf6=_[_0x3bc5('0x3f')]({},_0x178bf6,_0x1f71fc[_0x3bc5('0xc4')]);return db[_0x3bc5('0xdb')][_0x3bc5('0xac')]({'where':_0x178bf6[_0x3bc5('0x92')]})['then'](function(_0xb7b3d){_0x103c4d['count']=_0xb7b3d;if(_0x1f71fc[_0x3bc5('0x4f')]['includeAll']){_0x178bf6[_0x3bc5('0xc3')]=[{'all':!![]}];}return db[_0x3bc5('0xdb')]['findAll'](_0x178bf6);})[_0x3bc5('0x25')](function(_0x318196){_0x103c4d['rows']=_0x318196;return _0x103c4d;});}})['then'](respondWithFilteredResult(_0x1d1ed5,_0x178bf6))[_0x3bc5('0x30')](handleError(_0x1d1ed5,null));};exports[_0x3bc5('0x11c')]=function(_0x19ab6f,_0x217b20,_0x551774){var _0x1d4bd1={'where':{}},_0x206e5e={},_0x12f78c={'count':0x0,'rows':[]};return db[_0x3bc5('0x4c')][_0x3bc5('0xc9')]({'where':{'id':_0x19ab6f[_0x3bc5('0xc1')]['id']}})['then'](handleEntityNotFound(_0x217b20,null))['then'](function(_0x51ec25){if(_0x51ec25){_0x206e5e['model']=_['keys'](db[_0x3bc5('0xdb')][_0x3bc5('0xc2')]);_0x206e5e['query']=_[_0x3bc5('0x50')](_0x19ab6f['query']);_0x206e5e[_0x3bc5('0x51')]=_['intersection'](_0x206e5e[_0x3bc5('0x53')],_0x206e5e[_0x3bc5('0x4f')]);_0x1d4bd1[_0x3bc5('0x54')]=_[_0x3bc5('0x52')](_0x206e5e[_0x3bc5('0x53')],qs[_0x3bc5('0x55')](_0x19ab6f[_0x3bc5('0x4f')][_0x3bc5('0x55')]));_0x1d4bd1[_0x3bc5('0x54')]=_0x1d4bd1[_0x3bc5('0x54')]['length']?_0x1d4bd1[_0x3bc5('0x54')]:_0x206e5e[_0x3bc5('0x53')];if(!_0x19ab6f[_0x3bc5('0x4f')][_0x3bc5('0x11a')]('nolimit')){_0x1d4bd1[_0x3bc5('0x36')]=qs['limit'](_0x19ab6f[_0x3bc5('0x4f')]['limit']);_0x1d4bd1['offset']=qs[_0x3bc5('0x34')](_0x19ab6f[_0x3bc5('0x4f')][_0x3bc5('0x34')]);}_0x1d4bd1[_0x3bc5('0x58')]=qs[_0x3bc5('0x59')](_0x19ab6f['query'][_0x3bc5('0x59')]);_0x1d4bd1[_0x3bc5('0x92')]=qs[_0x3bc5('0x51')](_[_0x3bc5('0x5a')](_0x19ab6f[_0x3bc5('0x4f')],_0x206e5e[_0x3bc5('0x51')]));_0x1d4bd1[_0x3bc5('0x92')]['ChatInteractionId']=_0x51ec25['id'];if(_0x19ab6f[_0x3bc5('0x4f')][_0x3bc5('0x9b')]){_0x1d4bd1[_0x3bc5('0x92')]=_[_0x3bc5('0x3f')](_0x1d4bd1[_0x3bc5('0x92')],{'$or':_[_0x3bc5('0x45')](_0x1d4bd1[_0x3bc5('0x54')],function(_0x89858e){var _0x2d2847={};_0x2d2847[_0x89858e]={'$like':'%'+_0x19ab6f[_0x3bc5('0x4f')]['filter']+'%'};return _0x2d2847;})});}_0x1d4bd1[_0x3bc5('0x92')][_0x3bc5('0x11d')]=![];if(_0x19ab6f[_0x3bc5('0x4f')]['id']){_0x1d4bd1[_0x3bc5('0x92')]['id']={'$gt':_0x19ab6f[_0x3bc5('0x4f')]['id']};}_0x1d4bd1=_[_0x3bc5('0x3f')]({},_0x1d4bd1,_0x19ab6f[_0x3bc5('0xc4')]);return db[_0x3bc5('0xdb')][_0x3bc5('0xac')]({'where':_0x1d4bd1['where']})['then'](function(_0x3767f4){_0x12f78c['count']=_0x3767f4;_0x1d4bd1[_0x3bc5('0xc3')]=[];if(_0x19ab6f[_0x3bc5('0x4f')][_0x3bc5('0x11e')]){_0x1d4bd1['include'][_0x3bc5('0x4a')]({'model':db[_0x3bc5('0x86')],'as':'User','attributes':['id','fullname',_0x3bc5('0x104')]});}if(_0x19ab6f[_0x3bc5('0x4f')][_0x3bc5('0x11f')]){_0x1d4bd1[_0x3bc5('0xc3')]=[{'all':!![]}];}return db[_0x3bc5('0xdb')][_0x3bc5('0x120')](_0x1d4bd1);})[_0x3bc5('0x25')](function(_0x5241eb){_0x12f78c[_0x3bc5('0xc0')]=_0x5241eb;return _0x12f78c;});}})[_0x3bc5('0x25')](respondWithFilteredResult(_0x217b20,_0x1d4bd1))[_0x3bc5('0x30')](handleError(_0x217b20,null));};exports['addTags']=function(_0x438d93,_0x53986e,_0x165d92){return db[_0x3bc5('0x4c')][_0x3bc5('0x76')]({'where':{'id':_0x438d93[_0x3bc5('0xc1')]['id']}})['then'](handleEntityNotFound(_0x53986e,null))['then'](function(_0x3162f3){if(_0x3162f3){return _0x3162f3[_0x3bc5('0x121')](_0x438d93[_0x3bc5('0x40')]['ids'],_[_0x3bc5('0x122')](_0x438d93[_0x3bc5('0x40')],[_0x3bc5('0x118'),'id'])||{})['spread'](function(){return db[_0x3bc5('0x83')][_0x3bc5('0x120')]({'attributes':['id','name',_0x3bc5('0x5d')],'where':{'id':_0x438d93[_0x3bc5('0x40')][_0x3bc5('0x118')]}});})[_0x3bc5('0x25')](function(_0x2662aa){socket['emit'](_0x3bc5('0x123'),{'id':Number(_0x438d93['params']['id']),'tags':_0x2662aa||[]});return{'id':Number(_0x438d93[_0x3bc5('0xc1')]['id']),'tags':_0x2662aa||[]};});}})['then'](respondWithResult(_0x53986e,null))['catch'](handleError(_0x53986e,null));};exports[_0x3bc5('0x124')]=function(_0x4ae836,_0x542d5f,_0x120e90){return db['ChatInteraction']['find']({'where':{'id':_0x4ae836['params']['id']}})[_0x3bc5('0x25')](handleEntityNotFound(_0x542d5f,null))[_0x3bc5('0x25')](function(_0x1faf0f){if(_0x1faf0f){return _0x1faf0f[_0x3bc5('0x124')](_0x4ae836[_0x3bc5('0x4f')]['ids']);}})['then'](respondWithStatusCode(_0x542d5f,null))[_0x3bc5('0x30')](handleError(_0x542d5f,null));};exports[_0x3bc5('0xf5')]=function(_0xa30e1,_0x49191b){var _0xf70245=moment()[_0x3bc5('0x125')]()['toString']();var _0x21df41=path[_0x3bc5('0xf3')](config[_0x3bc5('0xf1')],_0x3bc5('0x126'),_0x3bc5('0x127'),'tmp');var _0x1d00c6=path['join'](config[_0x3bc5('0xf1')],'server','files','attachments');var _0x2250bd=path[_0x3bc5('0xf3')](_0x21df41,_0xf70245);var _0x1fa948=util[_0x3bc5('0xf8')](_0x3bc5('0x128'),_0xa30e1[_0x3bc5('0xc1')]['id'],_0xf70245);var _0x2f88c3=path[_0x3bc5('0xf3')](_0x21df41,_0x1fa948);var _0x4a5519=[];_0x4a5519[_0x3bc5('0x4a')]({'model':db[_0x3bc5('0x86')],'as':_0x3bc5('0x86'),'attributes':['id','fullname'],'raw':!![]});_0x4a5519[_0x3bc5('0x4a')]({'model':db[_0x3bc5('0xdf')],'as':'Contact','attributes':['id',_0x3bc5('0x129'),_0x3bc5('0x12a')],'raw':!![]});if(_0xa30e1[_0x3bc5('0x4f')][_0x3bc5('0x12b')]){_0x4a5519[_0x3bc5('0x4a')]({'model':db[_0x3bc5('0xeb')],'as':_0x3bc5('0xeb'),'raw':!![]});}var _0x17f2ea=[{'model':db[_0x3bc5('0xdb')],'as':'Messages','attributes':['id',_0x3bc5('0x40'),_0x3bc5('0x107'),_0x3bc5('0x108'),_0x3bc5('0x11d'),_0x3bc5('0x97')],'include':_0x4a5519}];_0x17f2ea[_0x3bc5('0x4a')]({'model':db[_0x3bc5('0xfc')],'as':_0x3bc5('0x12c'),'attributes':['id',_0x3bc5('0x3e')]});_0x17f2ea[_0x3bc5('0x4a')]({'model':db[_0x3bc5('0x86')],'as':_0x3bc5('0x12d'),'attributes':['id',_0x3bc5('0xd0')]});return db[_0x3bc5('0x4c')][_0x3bc5('0x76')]({'where':{'id':_0xa30e1[_0x3bc5('0xc1')]['id']},'include':_0x17f2ea})[_0x3bc5('0x25')](handleEntityNotFound(_0x49191b,null))[_0x3bc5('0x25')](function(_0x584fdd){if(_0x584fdd){var _0x5114ed=_0x584fdd['get']({'plain':!![]});fs[_0x3bc5('0x12e')](_0x2250bd);var _0x5ed469={'channel':_0x3bc5('0x12f'),'account':_0x5114ed[_0x3bc5('0x12c')][_0x3bc5('0x3e')],'agent':_0x5114ed[_0x3bc5('0x12d')]?_0x5114ed[_0x3bc5('0x12d')][_0x3bc5('0xd0')]:_0x3bc5('0x130'),'createdAt':moment(_0x5114ed[_0x3bc5('0x107')])[_0x3bc5('0xf8')](_0x3bc5('0x11b'))[_0x3bc5('0xad')](),'closedAt':_0x5114ed[_0x3bc5('0xed')]?moment(_0x5114ed[_0x3bc5('0x131')])[_0x3bc5('0xf8')](_0x3bc5('0x11b'))[_0x3bc5('0xad')]():'','disposition':_0x5114ed[_0x3bc5('0xe3')],'chatInfo':{'browser':_0x5114ed[_0x3bc5('0x132')],'os':_0x5114ed[_0x3bc5('0x133')],'referer':_0x5114ed[_0x3bc5('0x134')],'customerIp':_0x5114ed[_0x3bc5('0x135')],'customerPort':_0x5114ed[_0x3bc5('0x136')]?_0x5114ed[_0x3bc5('0x136')]:'N.A.'},'messages':_(_0x5114ed[_0x3bc5('0xfb')])[_0x3bc5('0x137')]()['filter']({'secret':![]})[_0x3bc5('0x45')](function(_0x16e01a){if(_0x16e01a['Attachment']){var _0x284eac=path[_0x3bc5('0xf3')](_0x1d00c6,_0x16e01a[_0x3bc5('0xeb')][_0x3bc5('0xe8')]);if(fs[_0x3bc5('0x138')](_0x284eac)){fs[_0x3bc5('0x139')](_0x284eac)[_0x3bc5('0x13a')](fs[_0x3bc5('0x13b')](path[_0x3bc5('0xf3')](_0x2250bd,_0x16e01a[_0x3bc5('0xeb')][_0x3bc5('0xe8')])));}}return{'date':moment(_0x16e01a[_0x3bc5('0x107')])['format'](_0x3bc5('0x11b'))['toString'](),'sender':_0x16e01a[_0x3bc5('0x108')]===_0x3bc5('0xda')?_0x16e01a['User']?_0x16e01a[_0x3bc5('0x86')][_0x3bc5('0xd0')]:'System':_0x16e01a['Contact'][_0x3bc5('0x129')]+(_0x16e01a[_0x3bc5('0x7b')][_0x3bc5('0x12a')]?'\x20'+_0x16e01a[_0x3bc5('0x7b')][_0x3bc5('0x12a')]:''),'body':_0x16e01a[_0x3bc5('0xeb')]?_0x16e01a['Attachment']['basename']:_0x16e01a['body'],'direction':_0x16e01a[_0x3bc5('0x108')]===_0x3bc5('0xda')?'A':'C','secret':_0x16e01a[_0x3bc5('0x11d')],'read':_0x16e01a['read'],'attachment':_0x16e01a[_0x3bc5('0xeb')]};})['value']()};return ejs[_0x3bc5('0x13c')](path[_0x3bc5('0xf3')](config[_0x3bc5('0xf1')],_0x3bc5('0x126'),_0x3bc5('0x13d'),_0x3bc5('0x13e')),{'interaction':_0x5ed469})['then'](function(_0x2da83f){var _0xa25286=path[_0x3bc5('0xf3')](_0x2250bd,'transcript-'+_0x5114ed['id']+'-'+_0xf70245+_0x3bc5('0x13f'));var _0x1b202c={'path':_0xa25286,'channel':_0x3bc5('0x12f'),'interactionId':_0x5114ed['id']};return pdf[_0x3bc5('0x140')](_0x2da83f,_0x1b202c);})[_0x3bc5('0x25')](function(){return new BPromise(function(_0x5a7fb8,_0x4c5916){zipdir(_0x2250bd,{'saveTo':_0x2f88c3},function(_0x523083,_0x5da0b1){if(_0x523083)return _0x4c5916(_0x523083);return _0x5a7fb8(_0x5da0b1);});})['then'](function(){return new BPromise(function(_0x421a29,_0x445e70){rimraf(_0x2250bd,function(_0x380a75){if(_0x380a75)_0x445e70(_0x380a75);return _0x421a29();});});})[_0x3bc5('0x25')](function(){return _0x49191b['download'](_0x2f88c3,_0x1fa948,function(_0x377c8c){if(_0x377c8c){console['log']('err',_0x377c8c);}else{fs[_0x3bc5('0x141')](_0x2f88c3);}});});});}else{return _0x49191b[_0x3bc5('0x3c')](0xc8);}})[_0x3bc5('0x30')](handleError(_0x49191b,null));};
\ No newline at end of file
+var _0x9ad5=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','show','include','options','ChatInteraction','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','email','isNull','follow','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','closed','disposition','attachmentUpload','file','originalname','basename','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','agentAlias','System','customer','%s%d','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','getMyMessages','alias','findAll','addTags','setTags','omit','spread','emit','removeTags','unix','server','tmp','files','transcript-%d-%s.zip','lastName','attachments','Account','Owner','get','mkdirSync','N.A.','closedAt','browserName','osName','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','firstName','renderFile','views','downloadInteraction.html','transcript-','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','save','update','destroy','name','send','render','merge','body','contact','agent','interaction','account','map','fullname','TagIds','Tags','split','forEach','push','index','rawAttributes','fieldName','key','model','query','filters','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','chat_messages','tools_tags','t.id\x20=\x20it.TagId','search','parseSearch','sqlOperator','conditions','length','unreadMessages','`\x20=\x200','having','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','type','buildExpression','keys','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','attributes','a.key','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','contactName','i.*','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax'];(function(_0x2af1eb,_0x48f350){var _0x17a509=function(_0x35844b){while(--_0x35844b){_0x2af1eb['push'](_0x2af1eb['shift']());}};_0x17a509(++_0x48f350);}(_0x9ad5,0x7f));var _0x59ad=function(_0x3a6813,_0x51b88d){_0x3a6813=_0x3a6813-0x0;var _0x137ca6=_0x9ad5[_0x3a6813];return _0x137ca6;};'use strict';var emlformat=require(_0x59ad('0x0'));var rimraf=require(_0x59ad('0x1'));var zipdir=require(_0x59ad('0x2'));var jsonpatch=require(_0x59ad('0x3'));var rp=require('request-promise');var moment=require(_0x59ad('0x4'));var BPromise=require(_0x59ad('0x5'));var Mustache=require(_0x59ad('0x6'));var util=require('util');var path=require(_0x59ad('0x7'));var sox=require('sox');var csv=require(_0x59ad('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x59ad('0x9'));var jsforce=require(_0x59ad('0xa'));var deskjs=require(_0x59ad('0xb'));var toCsv=require(_0x59ad('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x59ad('0xc'));var qs=require(_0x59ad('0xd'));var as=require(_0x59ad('0xe'));var pdf=require(_0x59ad('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x59ad('0x10'))(_0x59ad('0x11'));var utils=require(_0x59ad('0x12'));var config=require(_0x59ad('0x13'));var licenseUtil=require(_0x59ad('0x14'));var db=require(_0x59ad('0x15'))['db'];config['redis']=_[_0x59ad('0x16')](config[_0x59ad('0x17')],{'host':_0x59ad('0x18'),'port':0x18eb});var socket=require(_0x59ad('0x19'))(new Redis(config['redis']));require(_0x59ad('0x1a'))[_0x59ad('0x1b')](socket);var jayson=require(_0x59ad('0x1c'));var client=jayson['client'][_0x59ad('0x1d')]({'port':0x232b});var client9004=jayson[_0x59ad('0x1e')][_0x59ad('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x24a873,_0x7a6256,_0x332344,_0x2efac0){return new BPromise(function(_0x195d93,_0x14e2bc){var _0x38645a=_0x2efac0||client;return _0x38645a[_0x59ad('0x1f')](_0x24a873,_0x332344)[_0x59ad('0x20')](function(_0x5103c1){logger['info'](_0x59ad('0x21'),_0x7a6256,_0x59ad('0x22'));logger[_0x59ad('0x23')](_0x59ad('0x24'),_0x7a6256,'request\x20sent',JSON[_0x59ad('0x25')](_0x5103c1));if(_0x5103c1[_0x59ad('0x26')]){if(_0x5103c1[_0x59ad('0x26')][_0x59ad('0x27')]===0x1f4){logger[_0x59ad('0x26')](_0x59ad('0x21'),_0x7a6256,_0x5103c1[_0x59ad('0x26')][_0x59ad('0x28')]);return _0x14e2bc(_0x5103c1[_0x59ad('0x26')][_0x59ad('0x28')]);}logger[_0x59ad('0x26')](_0x59ad('0x21'),_0x7a6256,_0x5103c1[_0x59ad('0x26')][_0x59ad('0x28')]);return _0x195d93(_0x5103c1[_0x59ad('0x26')][_0x59ad('0x28')]);}else{logger[_0x59ad('0x29')](_0x59ad('0x21'),_0x7a6256,_0x59ad('0x22'));_0x195d93(_0x5103c1[_0x59ad('0x2a')][_0x59ad('0x28')]);}})[_0x59ad('0x2b')](function(_0x4f8249){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x7a6256,_0x4f8249);_0x14e2bc(_0x4f8249);});});}function respondWithStatusCode(_0x4ace6a,_0x1bdd08){_0x1bdd08=_0x1bdd08||0xcc;return function(_0x20651d){if(_0x20651d){return _0x4ace6a[_0x59ad('0x2c')](_0x1bdd08);}return _0x4ace6a[_0x59ad('0x2d')](_0x1bdd08)[_0x59ad('0x2e')]();};}function respondWithResult(_0x4c9b58,_0x24058f){_0x24058f=_0x24058f||0xc8;return function(_0x42cbab){if(_0x42cbab){return _0x4c9b58['status'](_0x24058f)[_0x59ad('0x2f')](_0x42cbab);}};}function respondWithFilteredResult(_0x553287,_0x5ed25d){return function(_0xda5fc9){if(_0xda5fc9){var _0x12f035=typeof _0x5ed25d['offset']===_0x59ad('0x30')&&typeof _0x5ed25d['limit']==='undefined';var _0x4fafb1=_0xda5fc9[_0x59ad('0x31')];var _0x3693d6=_0x12f035?0x0:_0x5ed25d[_0x59ad('0x32')];var _0x17b559=_0x12f035?_0xda5fc9[_0x59ad('0x31')]:_0x5ed25d[_0x59ad('0x32')]+_0x5ed25d[_0x59ad('0x33')];var _0x399267;if(_0x17b559>=_0x4fafb1){_0x17b559=_0x4fafb1;_0x399267=0xc8;}else{_0x399267=0xce;}_0x553287[_0x59ad('0x2d')](_0x399267);return _0x553287['set'](_0x59ad('0x34'),_0x3693d6+'-'+_0x17b559+'/'+_0x4fafb1)[_0x59ad('0x2f')](_0xda5fc9);}return null;};}function patchUpdates(_0x207f8a){return function(_0x512767){try{jsonpatch[_0x59ad('0x35')](_0x512767,_0x207f8a,!![]);}catch(_0x54e326){return BPromise['reject'](_0x54e326);}return _0x512767[_0x59ad('0x36')]();};}function saveUpdates(_0x488307,_0xa1d797){return function(_0x5458e6){if(_0x5458e6){return _0x5458e6[_0x59ad('0x37')](_0x488307)[_0x59ad('0x20')](function(_0x3d4800){return _0x3d4800;});}return null;};}function removeEntity(_0x549c3f,_0x4f2b8b){return function(_0x53279b){if(_0x53279b){return _0x53279b[_0x59ad('0x38')]()[_0x59ad('0x20')](function(){_0x549c3f[_0x59ad('0x2d')](0xcc)[_0x59ad('0x2e')]();});}};}function handleEntityNotFound(_0x3e7c12,_0x3e61d1){return function(_0xb881ea){if(!_0xb881ea){_0x3e7c12['sendStatus'](0x194);}return _0xb881ea;};}function handleError(_0x5ca634,_0x596809){_0x596809=_0x596809||0x1f4;return function(_0x1bd45c){logger[_0x59ad('0x26')](_0x1bd45c['stack']);if(_0x1bd45c[_0x59ad('0x39')]){delete _0x1bd45c['name'];}_0x5ca634[_0x59ad('0x2d')](_0x596809)[_0x59ad('0x3a')](_0x1bd45c);};}function getMustacheRender(_0x1a11fb,_0x1e39e1){return Mustache[_0x59ad('0x3b')](_0x1a11fb,_[_0x59ad('0x3c')](_0x1e39e1[_0x59ad('0x3d')],{'contact':_0x1e39e1[_0x59ad('0x3e')],'message':_0x1e39e1['message'],'agent':_0x1e39e1[_0x59ad('0x3f')],'interaction':_0x1e39e1[_0x59ad('0x40')],'account':_0x1e39e1[_0x59ad('0x41')]}))||'';}function getInteractionUsers(_0x3b191a,_0x1cc0b6){return new BPromise(function(_0x438292,_0x24d419){try{if(_0x1cc0b6[_0x3b191a['id']]){_0x3b191a['Users']=_[_0x59ad('0x42')](_0x1cc0b6[_0x3b191a['id']],function(_0x288a0b){return{'id':_0x288a0b['id'],'fullname':_0x288a0b[_0x59ad('0x43')]};});}}catch(_0x4e893b){_0x24d419(_0x4e893b);}_0x438292(_0x3b191a);});}function getInteractionTags(_0x1f7dac,_0xc2a823){return new BPromise(function(_0x1b1a67,_0x47b8a1){try{if(_0x1f7dac[_0x59ad('0x44')]){_0x1f7dac[_0x59ad('0x45')]=[];_0x1f7dac['TagIds'][_0x59ad('0x46')](',')[_0x59ad('0x47')](function(_0x3a4543){_0x1f7dac['Tags'][_0x59ad('0x48')](_0xc2a823[_0x3a4543]);});}delete _0x1f7dac['TagIds'];}catch(_0x447dea){_0x47b8a1(_0x447dea);}_0x1b1a67(_0x1f7dac);});}function updateChatInteraction(_0x257336,_0x5e8c1f,_0x2a4cad){return new BPromise(function(_0x4aca8a,_0x4d1120){return getInteractionUsers(_0x257336,_0x2a4cad)[_0x59ad('0x20')](function(_0x1a31c5){return getInteractionTags(_0x1a31c5,_0x5e8c1f);})[_0x59ad('0x20')](function(_0x56a34b){_0x4aca8a(_0x56a34b);})[_0x59ad('0x2b')](function(_0x5ca871){_0x4d1120(_0x5ca871);});});}exports[_0x59ad('0x49')]=function(_0x3355d4,_0x5b7c08){var _0x470b7a={},_0x44ca79={},_0x3c10f1={'count':0x0,'rows':[]};var _0x51b34e=_[_0x59ad('0x42')](db['ChatInteraction'][_0x59ad('0x4a')],function(_0x59b01b){return{'name':_0x59b01b[_0x59ad('0x4b')],'type':_0x59b01b['type'][_0x59ad('0x4c')]};});_0x44ca79[_0x59ad('0x4d')]=_[_0x59ad('0x42')](_0x51b34e,_0x59ad('0x39'));_0x44ca79['query']=_['keys'](_0x3355d4[_0x59ad('0x4e')]);_0x44ca79[_0x59ad('0x4f')]=_[_0x59ad('0x50')](_0x44ca79['model'],_0x44ca79[_0x59ad('0x4e')]);_0x470b7a['attributes']=_[_0x59ad('0x50')](_0x44ca79[_0x59ad('0x4d')],qs[_0x59ad('0x51')](_0x3355d4['query'][_0x59ad('0x51')]));_0x470b7a['attributes']=_0x470b7a['attributes']['length']?_0x470b7a['attributes']:_0x44ca79['model'];if(!_0x3355d4[_0x59ad('0x4e')][_0x59ad('0x52')](_0x59ad('0x53'))){_0x470b7a[_0x59ad('0x33')]=qs[_0x59ad('0x33')](_0x3355d4[_0x59ad('0x4e')][_0x59ad('0x33')]);_0x470b7a['offset']=qs[_0x59ad('0x32')](_0x3355d4['query'][_0x59ad('0x32')]);}_0x470b7a[_0x59ad('0x54')]=qs[_0x59ad('0x55')](_0x3355d4[_0x59ad('0x4e')][_0x59ad('0x55')]);_0x470b7a[_0x59ad('0x56')]=qs[_0x59ad('0x4f')](_[_0x59ad('0x57')](_0x3355d4[_0x59ad('0x4e')],_0x44ca79[_0x59ad('0x4f')]),_0x51b34e);var _0xdf5240=[];var _0x3cc7e0=squel[_0x59ad('0x58')]()[_0x59ad('0x59')]('id')[_0x59ad('0x59')](_0x59ad('0x39'))[_0x59ad('0x59')](_0x59ad('0x5a'))[_0x59ad('0x5b')]('tools_tags');var _0x38caaf=squel['select']()[_0x59ad('0x59')]('u.id')[_0x59ad('0x59')]('u.fullname')[_0x59ad('0x59')](_0x59ad('0x5c'))[_0x59ad('0x5b')](_0x59ad('0x5d'),'ui')[_0x59ad('0x5e')](_0x59ad('0x5f'),'u',_0x59ad('0x60'));var _0x12f061=squel[_0x59ad('0x58')]()[_0x59ad('0x5b')](_0x59ad('0x61'),'i')[_0x59ad('0x5e')]('cm_contacts','c',_0x59ad('0x62'))['left_join'](_0x59ad('0x5f'),'o','o.id\x20=\x20i.UserId')[_0x59ad('0x5e')](_0x59ad('0x63'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x59ad('0x5e')](_0x59ad('0x64'),'me','me.ChatInteractionId\x20=\x20i.id')['left_join']('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')['left_join'](_0x59ad('0x65'),'t',_0x59ad('0x66'));var _0x51b03c=squel['expr']();var _0x22258c=[];var _0x2f4394=squel['expr']();var _0x2d64f9;if(_0x3355d4[_0x59ad('0x4e')][_0x59ad('0x67')]){_0x2d64f9=as[_0x59ad('0x68')](_0x3355d4[_0x59ad('0x4e')]['search']);var _0x34142b=_0x2d64f9[_0x59ad('0x69')];for(var _0x31c421=0x0;_0x31c421<_0x2d64f9[_0x59ad('0x6a')][_0x59ad('0x6b')];_0x31c421++){var _0x1f4118=_0x2d64f9[_0x59ad('0x6a')][_0x31c421];var _0x6d90e8='i';var _0x87d16=_['find'](_0x51b34e,[_0x59ad('0x39'),_0x1f4118[_0x59ad('0x59')]]);if(!_0x87d16){switch(_0x1f4118[_0x59ad('0x59')]){case _0x59ad('0x6c'):if(_0x1f4118['value']==0x1){_0x12f061['having']('`'+_0x1f4118['field']+_0x59ad('0x6d'));}else{_0x12f061[_0x59ad('0x6e')]('`'+_0x1f4118[_0x59ad('0x59')]+_0x59ad('0x6f'));}break;case _0x59ad('0x70'):if(_0x1f4118['operator']===_0x59ad('0x71')){if(_0x1f4118[_0x59ad('0x72')][_0x59ad('0x46')]('\x20')['length']>0x1){_0x51b03c[_0x34142b](_0x59ad('0x73'),qs[_0x59ad('0x74')](_0x1f4118[_0x59ad('0x72')]),null);}else{var _0x501358='%'+_0x1f4118[_0x59ad('0x72')]+'%';_0x51b03c[_0x34142b]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x501358,_0x501358,_0x501358);}}else{_0x87d16=_['find'](_0x51b34e,['name',_0x59ad('0x75')]);_0x1f4118[_0x59ad('0x59')]=_0x59ad('0x75');_0x52c036=as['buildExpression'](_0x6d90e8,_0x87d16['type'],_0x1f4118);_0x51b03c[_0x34142b](_0x52c036[_0x59ad('0x76')],_0x52c036[_0x59ad('0x72')][_0x59ad('0x77')],_0x52c036[_0x59ad('0x72')][_0x59ad('0x2e')]);}break;case _0x59ad('0x78'):var _0x2f2971=_0x1f4118[_0x59ad('0x72')][_0x59ad('0x46')](',')[_0x59ad('0x42')](function(_0x756460){return Number(_0x756460);});_0x2f2971[_0x59ad('0x47')](function(_0x2b6482){_0x2f4394['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2b6482+',%');});_0x22258c=_[_0x59ad('0x79')](_0x22258c,_0x2f2971);break;case _0x59ad('0x7a'):if(_0x1f4118[_0x59ad('0x7b')]===_0x59ad('0x71')){_0x51b03c[_0x34142b](_0x59ad('0x7c'),'%'+_0x1f4118[_0x59ad('0x72')]+'%',null);}else{_0x87d16=_[_0x59ad('0x7d')](_0x51b34e,[_0x59ad('0x39'),_0x59ad('0x7e')]);_0x1f4118[_0x59ad('0x59')]='UserId';_0x52c036=as['buildExpression'](_0x6d90e8,_0x87d16[_0x59ad('0x7f')],_0x1f4118);_0x51b03c[_0x34142b](_0x52c036[_0x59ad('0x76')],_0x52c036[_0x59ad('0x72')]['start'],_0x52c036[_0x59ad('0x72')][_0x59ad('0x2e')]);}break;case'body':_0x52c036=as['buildExpression']('me',null,_0x1f4118);_0x51b03c[_0x34142b](_0x52c036[_0x59ad('0x76')],_0x52c036[_0x59ad('0x72')]['start'],_0x52c036[_0x59ad('0x72')][_0x59ad('0x2e')]);break;}}else{var _0x52c036=as[_0x59ad('0x80')](_0x6d90e8,_0x87d16[_0x59ad('0x7f')],_0x1f4118);_0x51b03c[_0x34142b](_0x52c036['text'],_0x52c036[_0x59ad('0x72')][_0x59ad('0x77')],_0x52c036[_0x59ad('0x72')][_0x59ad('0x2e')]);}}}else{var _0xcc0c1c=_(_0x3355d4[_0x59ad('0x4e')])[_0x59ad('0x81')]()['map'](function(_0x581419){return _[_0x59ad('0x82')](_0x51b34e,['name',_0x581419])?_0x581419:undefined;})[_0x59ad('0x83')]()['value']();if(!_['isEmpty'](_0xcc0c1c)){_0xcc0c1c['forEach'](function(_0x2863a6){if(_0x2863a6===_0x59ad('0x84')){_0x12f061[_0x59ad('0x56')](_0x59ad('0x85'),[][_0x59ad('0x86')](_0x3355d4[_0x59ad('0x4e')][_0x2863a6]));}else if(_0x2863a6===_0x59ad('0x87')){var _0x9944f=JSON[_0x59ad('0x88')](_0x3355d4[_0x59ad('0x4e')][_0x2863a6])[_0x59ad('0x89')];var _0x5343a0=JSON['parse'](_0x3355d4['query'][_0x2863a6])[_0x59ad('0x8a')];_0x12f061[_0x59ad('0x56')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x9944f,_0x5343a0);}else{if(_0x3355d4[_0x59ad('0x4e')][_0x2863a6]==='null'){_0x12f061['where']('i.'+_0x2863a6+_0x59ad('0x8b'));}else{_0x12f061[_0x59ad('0x56')]('i.'+_0x2863a6+_0x59ad('0x8c'),_0x3355d4['query'][_0x2863a6]);}}});}if(_0x3355d4[_0x59ad('0x4e')][_0x59ad('0x8d')]){if(_0x3355d4['query'][_0x59ad('0x8d')]==0x1){_0x12f061['having'](_0x59ad('0x8e'));}else{_0x12f061['having']('`unreadMessages`\x20>\x200');}}if(_0x3355d4[_0x59ad('0x4e')][_0x59ad('0x8f')]){_0x22258c=_['isArray'](_0x3355d4['query'][_0x59ad('0x8f')])?_0x3355d4[_0x59ad('0x4e')][_0x59ad('0x8f')]:new Array(_0x3355d4[_0x59ad('0x4e')][_0x59ad('0x8f')]);_0x22258c[_0x59ad('0x47')](function(_0x1ded16){_0x2f4394['or'](_0x59ad('0x90'),'%,'+_0x1ded16+',%');});}if(_0x3355d4[_0x59ad('0x4e')][_0x59ad('0x91')]){var _0x3373d1=_0x3355d4[_0x59ad('0x4e')][_0x59ad('0x91')]['replace']('\x5c','\x5c\x5c')[_0x59ad('0x92')](/'/g,'\x27\x27');if(qs[_0x59ad('0x93')](_0x3373d1)){_0x51b03c['or'](_0x59ad('0x94'),_0x3373d1+'%');}else{_0x51b03c['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x59ad('0x74')](_0x3373d1))['or'](_0x59ad('0x95'),_0x3373d1+'%');}}}_0x12f061[_0x59ad('0x56')](_0x51b03c);_0x12f061['group'](_0x59ad('0x96'));var _0x55a282={'type':db['Sequelize'][_0x59ad('0x97')][_0x59ad('0x98')],'raw':!![]};var _0x4029ce=_0x12f061[_0x59ad('0x99')]();_0x4029ce[_0x59ad('0x59')](_0x59ad('0x96'));_0x4029ce[_0x59ad('0x59')](_0x59ad('0x9a'),'unreadMessages');if(_0x470b7a['order']){_0x470b7a[_0x59ad('0x54')]['forEach'](function(_0x43825d){var _0x2a05dc=_0x43825d[0x0]==='contactName'?_0x43825d[0x0]:'i.'+_0x43825d[0x0];_0x12f061[_0x59ad('0x54')](_0x2a05dc,_0x43825d[0x1]===_0x59ad('0x9b')?![]:!![]);});}if(!_['isEmpty'](_0x22258c)){_0x12f061[_0x59ad('0x6e')](_0x2f4394);_0x4029ce['where']('t.id\x20IN\x20?',_0x22258c);}BPromise[_0x59ad('0x9c')]()[_0x59ad('0x20')](function(){if(!_0x2d64f9){if(_0x3355d4['query'][_0x59ad('0x84')])return;_0x4029ce[_0x59ad('0x56')](_0x59ad('0x9d'));_0x12f061[_0x59ad('0x56')](_0x59ad('0x9d'));return;}if(_0x3355d4[_0x59ad('0x9e')][_0x59ad('0x9f')]!==_0x59ad('0x3f'))return;return _0x3355d4[_0x59ad('0x9e')][_0x59ad('0xa0')]({'attributes':['id'],'raw':!![]})[_0x59ad('0x20')](function(_0x69f4c2){if(_[_0x59ad('0xa1')](_0x69f4c2)){_0x4029ce[_0x59ad('0x56')](_0x59ad('0xa2'));_0x12f061[_0x59ad('0x56')](_0x59ad('0xa2'));}else{_0x4029ce[_0x59ad('0x56')](_0x59ad('0x85'),_[_0x59ad('0x42')](_0x69f4c2,'id'));_0x12f061[_0x59ad('0x56')]('i.ChatWebsiteId\x20IN\x20?',_[_0x59ad('0x42')](_0x69f4c2,'id'));}});})['then'](function(){if(_0x3355d4[_0x59ad('0x9e')]['role']===_0x59ad('0x3f')&&!_0x2d64f9&&!_0x3355d4[_0x59ad('0x4e')][_0x59ad('0x84')])return[];return db[_0x59ad('0xa3')][_0x59ad('0x4e')](_0x4029ce[_0x59ad('0xa4')](),_0x55a282);})[_0x59ad('0x20')](function(_0x37eae9){_0x3c10f1['count']=_0x37eae9[_0x59ad('0x6b')];if(_0x3c10f1[_0x59ad('0x31')]===0x0)return[];return db[_0x59ad('0xa3')][_0x59ad('0x4e')](_0x3cc7e0[_0x59ad('0xa4')](),_0x55a282)['then'](function(_0x4899cb){_0xdf5240=_[_0x59ad('0xa5')](_0x4899cb,'id');_0x55a282=_['merge'](_0x55a282,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3355d4[_0x59ad('0x4e')][_0x59ad('0x51')]){_0x470b7a[_0x59ad('0xa6')]['forEach'](function(_0x1f4c0c){_0x12f061['field']('i.'+_0x1f4c0c);});}else{_0x12f061[_0x59ad('0x59')](_0x59ad('0x9a'),_0x59ad('0x6c'));_0x12f061[_0x59ad('0x59')](_0x59ad('0xa7'),_0x59ad('0xa8'));_0x12f061[_0x59ad('0x59')]('a.mandatoryDisposition',_0x59ad('0xa9'));_0x12f061[_0x59ad('0x59')](_0x59ad('0xaa'),_0x59ad('0xab'));_0x12f061[_0x59ad('0x59')](_0x59ad('0xac'));_0x12f061[_0x59ad('0x59')]('c.firstName',_0x59ad('0xad'));_0x12f061[_0x59ad('0x59')](_0x59ad('0xae'),'Contact.lastName');_0x12f061[_0x59ad('0x59')](_0x59ad('0xaf'),_0x59ad('0xb0'));_0x12f061[_0x59ad('0x59')](_0x59ad('0xb1'),_0x59ad('0xb2'));_0x12f061[_0x59ad('0x59')](_0x59ad('0xb3'),'Contact.mobile');_0x12f061[_0x59ad('0x59')](_0x59ad('0xb4'),_0x59ad('0xb5'));_0x12f061[_0x59ad('0x59')]('o.fullname','Owner.fullname');_0x12f061['field'](_0x59ad('0xb6'),_0x59ad('0xb7'));_0x12f061[_0x59ad('0x59')](_0x59ad('0xb8'),_0x59ad('0x44'));}if(_0x470b7a[_0x59ad('0x33')])_0x12f061['limit'](_0x470b7a[_0x59ad('0x33')]);if(_0x470b7a[_0x59ad('0x32')])_0x12f061[_0x59ad('0x32')](_0x470b7a[_0x59ad('0x32')]);return db[_0x59ad('0xa3')][_0x59ad('0x4e')](_0x12f061['toString'](),_0x55a282);})[_0x59ad('0x20')](function(_0xf57e00){if(_0xf57e00[_0x59ad('0x6b')]>0x0)_0x38caaf[_0x59ad('0x56')](_0x59ad('0xb9'),_[_0x59ad('0x42')](_0xf57e00,'id'));return db[_0x59ad('0xa3')]['query'](_0x38caaf[_0x59ad('0xa4')](),_0x55a282)[_0x59ad('0x20')](function(_0x4d7b54){var _0x44190b=_['groupBy'](_0x4d7b54,_0x59ad('0xba'));var _0x7ce2d6=[];_0xf57e00[_0x59ad('0x47')](function(_0x33fa4e){_0x7ce2d6[_0x59ad('0x48')](updateChatInteraction(_0x33fa4e,_0xdf5240,_0x44190b));});return BPromise['all'](_0x7ce2d6);});});})[_0x59ad('0x20')](function(_0x3c1abc){_0x3c10f1['rows']=_0x3c1abc;return _0x3c10f1;})[_0x59ad('0x20')](respondWithFilteredResult(_0x5b7c08,_0x470b7a))['catch'](handleError(_0x5b7c08,null));};exports[_0x59ad('0xbb')]=function(_0x80505a,_0x41a645){var _0x1c711f={'raw':![],'where':{'id':_0x80505a['params']['id']}},_0x220798={};_0x220798[_0x59ad('0x4d')]=_[_0x59ad('0x81')](db['ChatInteraction'][_0x59ad('0x4a')]);_0x220798[_0x59ad('0x4e')]=_['keys'](_0x80505a[_0x59ad('0x4e')]);_0x220798[_0x59ad('0x4f')]=_['intersection'](_0x220798[_0x59ad('0x4d')],_0x220798['query']);_0x1c711f[_0x59ad('0xa6')]=_[_0x59ad('0x50')](_0x220798[_0x59ad('0x4d')],qs[_0x59ad('0x51')](_0x80505a[_0x59ad('0x4e')]['fields']));_0x1c711f['attributes']=_0x1c711f[_0x59ad('0xa6')][_0x59ad('0x6b')]?_0x1c711f[_0x59ad('0xa6')]:_0x220798['model'];if(_0x80505a['query']['includeAll']){_0x1c711f[_0x59ad('0xbc')]=[{'all':!![]}];}_0x1c711f=_[_0x59ad('0x3c')]({},_0x1c711f,_0x80505a[_0x59ad('0xbd')]);return db[_0x59ad('0xbe')][_0x59ad('0x7d')](_0x1c711f)['then'](handleEntityNotFound(_0x41a645,null))[_0x59ad('0x20')](respondWithResult(_0x41a645,null))[_0x59ad('0x2b')](handleError(_0x41a645,null));};exports[_0x59ad('0xbf')]=function(_0x4ebd1d,_0x819409){return db[_0x59ad('0xbe')][_0x59ad('0xbf')](_0x4ebd1d[_0x59ad('0x3d')],{})[_0x59ad('0x20')](respondWithResult(_0x819409,0xc9))[_0x59ad('0x2b')](handleError(_0x819409,null));};exports[_0x59ad('0x37')]=function(_0x430641,_0x41e50b){if(_0x430641[_0x59ad('0x3d')]['id']){delete _0x430641[_0x59ad('0x3d')]['id'];}return db[_0x59ad('0xbe')][_0x59ad('0x7d')]({'where':{'id':_0x430641[_0x59ad('0xc0')]['id']}})[_0x59ad('0x20')](handleEntityNotFound(_0x41e50b,null))[_0x59ad('0x20')](saveUpdates(_0x430641[_0x59ad('0x3d')],null))['then'](respondWithResult(_0x41e50b,null))[_0x59ad('0x2b')](handleError(_0x41e50b,null));};exports[_0x59ad('0x38')]=function(_0x3d43bd,_0xc852a6){return db[_0x59ad('0xbe')][_0x59ad('0x7d')]({'where':{'id':_0x3d43bd['params']['id']}})[_0x59ad('0x20')](handleEntityNotFound(_0xc852a6,null))['then'](removeEntity(_0xc852a6,null))['catch'](handleError(_0xc852a6,null));};exports[_0x59ad('0xc1')]=function(_0x387965,_0x283e7b){return db[_0x59ad('0xbe')][_0x59ad('0xc1')]()[_0x59ad('0x20')](respondWithResult(_0x283e7b,null))[_0x59ad('0x2b')](handleError(_0x283e7b,null));};exports[_0x59ad('0xc2')]=function(_0xb9763c,_0x405b02){var _0x525b2f=_0xb9763c[_0x59ad('0xc0')]['id'];var _0x460f4f;var _0x56711d;var _0x5d504a;return db[_0x59ad('0xbe')][_0x59ad('0xc3')]({'where':{'id':_0x525b2f}})[_0x59ad('0x20')](function(_0x4e0cae){_0x460f4f=_0x4e0cae;return db[_0x59ad('0xc4')][_0x59ad('0xc3')]({'where':{'id':_0x4e0cae['ChatWebsiteId']},'attributes':['id',_0x59ad('0xc5'),'vidaooEscalation',_0x59ad('0xc6'),_0x59ad('0xc7'),_0x59ad('0xc8')],'raw':!![]});})[_0x59ad('0x20')](function(_0x55b05f){if(_0x55b05f&&_0x55b05f[_0x59ad('0xc5')]&&_0x55b05f[_0x59ad('0xc9')]){_0x56711d=_0x55b05f;var _0xbfddb5={'interaction':{'id':_0x525b2f},'agent':{'id':_0xb9763c['user']['id'],'name':_0xb9763c[_0x59ad('0x9e')][_0x59ad('0x39')],'fullname':_0xb9763c[_0x59ad('0x9e')][_0x59ad('0x43')],'email':_0xb9763c[_0x59ad('0x9e')][_0x59ad('0xca')]},'contact':_0xb9763c[_0x59ad('0x3d')][_0x59ad('0x3e')],'account':_0xb9763c[_0x59ad('0x3d')][_0x59ad('0x41')]};var _0x3e00a9={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x55b05f[_0x59ad('0xc5')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xb9763c[_0x59ad('0x9e')][_0x59ad('0xca')]],'buttons':null,'topic':_0x56711d['vidaooTopic'],'note':_[_0x59ad('0xcb')](_0x56711d[_0x59ad('0xc7')])?null:getMustacheRender(_0x56711d[_0x59ad('0xc7')],_0xbfddb5),'metadata':null},'redirect':_0x59ad('0xcc'),'json':!![]};try{if(!_['isNull'](_0x56711d[_0x59ad('0xc8')])){var _0x46ec3c=getMustacheRender(_0x56711d[_0x59ad('0xc8')],_0xbfddb5);var _0x49d9b4=JSON[_0x59ad('0x88')](_0x46ec3c);_0x3e00a9['body'][_0x59ad('0xcd')]=_0x49d9b4;}}catch(_0x2aa1bc){throw new db['Sequelize']['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x3e00a9);}else{throw new db[(_0x59ad('0xce'))][(_0x59ad('0xcf'))](_0x59ad('0xd0'));}})[_0x59ad('0x20')](function(_0x412354){_0x5d504a=_0x412354;if(_0x5d504a['id']){var _0x2ea9de={'body':_0x5d504a[_0x59ad('0xd1')],'ChatWebsiteId':_0x56711d['id'],'ChatInteractionId':_0x460f4f['id'],'direction':_0x59ad('0xd2'),'UserId':_0xb9763c[_0x59ad('0x9e')]['id']};return db[_0x59ad('0xd3')][_0x59ad('0xbf')](_0x2ea9de,{});}else{throw new db['Sequelize']['ValidationError'](_0x59ad('0xd4'));}})[_0x59ad('0x20')](function(){return _0x460f4f[_0x59ad('0xd5')]({'vidaooSessionId':_0x5d504a['id']});})[_0x59ad('0x20')](respondWithResult(_0x405b02,null))[_0x59ad('0x2b')](handleError(_0x405b02,null));};exports[_0x59ad('0xd6')]=function(_0x37d4a8,_0x26120c){if(_0x37d4a8[_0x59ad('0x3d')]['id']){delete _0x37d4a8['body']['id'];}return db[_0x59ad('0xbe')][_0x59ad('0x7d')]({'where':{'id':_0x37d4a8[_0x59ad('0xc0')]['id']},'include':[{'model':db[_0x59ad('0xd7')],'as':_0x59ad('0x70')}]})[_0x59ad('0x20')](handleEntityNotFound(_0x26120c,null))[_0x59ad('0x20')](saveUpdates(_0x37d4a8[_0x59ad('0x3d')],null))[_0x59ad('0x20')](respondWithResult(_0x26120c,null))[_0x59ad('0x2b')](handleError(_0x26120c,null));};exports[_0x59ad('0xd8')]=function(_0x3cb1ba,_0x2f7f6a,_0x359623){if(_0x3cb1ba[_0x59ad('0x3d')]['id']){delete _0x3cb1ba[_0x59ad('0x3d')]['id'];}return db[_0x59ad('0xbe')][_0x59ad('0x7d')]({'where':{'id':_0x3cb1ba[_0x59ad('0xc0')]['id']}})['then'](function(_0x31a947){if(!_0x31a947){logger[_0x59ad('0x26')](_0x59ad('0xd9'),_0x59ad('0xd8'),0x194,'entity\x20not\x20found');_0x2f7f6a[_0x59ad('0x2c')](0x194);}else{if(_0x31a947[_0x59ad('0x7e')]){throw new db['Sequelize'][(_0x59ad('0xcf'))]('Interaction\x20already\x20assigned');}}return _0x31a947;})['then'](function(_0x269266){if(_0x269266){return _0x269266['update']({'closed':_0x3cb1ba[_0x59ad('0x3d')][_0x59ad('0xda')],'disposition':_0x3cb1ba[_0x59ad('0x3d')][_0x59ad('0xdb')]})['then'](function(_0x454ce8){return _0x454ce8;});}})[_0x59ad('0x20')](function(_0x26b4c9){return respondWithRpcPromise('AbandonInteraction',_0x59ad('0xd8'),_0x3cb1ba['body'],client9004);})[_0x59ad('0x20')](respondWithResult(_0x2f7f6a,null))[_0x59ad('0x2b')](handleError(_0x2f7f6a,null));};exports[_0x59ad('0xdc')]=function(_0xcb5685,_0x778177,_0x3bf8bc){_0xcb5685[_0x59ad('0x3d')][_0x59ad('0x39')]=_0xcb5685[_0x59ad('0xdd')][_0x59ad('0xde')];_0xcb5685[_0x59ad('0x3d')][_0x59ad('0xdf')]=_0xcb5685[_0x59ad('0xdd')]['filename'];_0xcb5685[_0x59ad('0x3d')][_0x59ad('0x7f')]=_0xcb5685['file'][_0x59ad('0xe0')];return db['Attachment'][_0x59ad('0xbf')](_0xcb5685[_0x59ad('0x3d')])[_0x59ad('0x20')](respondWithResult(_0x778177,0xc9))[_0x59ad('0x2b')](handleError(_0x778177,null));};exports[_0x59ad('0xe1')]=function(_0x1af6ad,_0x596c77,_0xd323b3){return db[_0x59ad('0xbe')][_0x59ad('0xc3')]({'where':{'id':_0x1af6ad['params']['id']},'raw':!![]})[_0x59ad('0x20')](handleEntityNotFound(_0x596c77,null))[_0x59ad('0x20')](function(_0x521a2f){if(_0x521a2f){if(_0x521a2f[_0x59ad('0xda')]){return _0x596c77['status'](0x193)['json']({'status':0x193,'message':_0x59ad('0xe2')});}return db[_0x59ad('0xe3')][_0x59ad('0xc3')]({'where':{'id':_0x1af6ad[_0x59ad('0x4e')][_0x59ad('0xe4')]},'raw':!![]})[_0x59ad('0x20')](handleEntityNotFound(_0x596c77,null));}})[_0x59ad('0x20')](function(_0x4d7991){if(_0x4d7991){var _0x5c66ed=_0x4d7991[_0x59ad('0xe5')]!==null;var _0x587f08=path[_0x59ad('0xe6')](config[_0x59ad('0xe7')],_0x59ad('0xe8'));if(_0x5c66ed){_0x587f08=path[_0x59ad('0xe6')](_0x587f08,_0x59ad('0xe9'));}var _0x28334c=path[_0x59ad('0xe6')](_0x587f08,_0x4d7991[_0x59ad('0xdf')]);return _0x596c77[_0x59ad('0xea')](_0x28334c);}})[_0x59ad('0x2b')](handleError(_0x596c77,null));};exports[_0x59ad('0xeb')]=function(_0x5d4d32,_0x179148){var _0x48fa61=null;var _0x363e1f=null;var _0xd4eabb=null;var _0x1d82cd=null;if(_0x5d4d32[_0x59ad('0x3d')]['id']){delete _0x5d4d32[_0x59ad('0x3d')]['id'];}if(_0x5d4d32[_0x59ad('0x3d')][_0x59ad('0xec')]){_0x1d82cd=path[_0x59ad('0xe6')](config['root'],_0x59ad('0xed'),util[_0x59ad('0xee')]('transcript-%s.txt',Date[_0x59ad('0xef')]()));_0x5d4d32[_0x59ad('0x3d')][_0x59ad('0xf0')]=_0x1d82cd;}return db['ChatInteraction']['find']({'where':{'id':_0x5d4d32[_0x59ad('0xc0')]['id']},'include':[{'model':db[_0x59ad('0xd3')],'as':_0x59ad('0xf1'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x59ad('0x20')](handleEntityNotFound(_0x179148,null))[_0x59ad('0x20')](saveUpdates(_0x5d4d32[_0x59ad('0x3d')],null))[_0x59ad('0x20')](function(_0x12bfd7){if(_0x12bfd7){_0x48fa61=_0x12bfd7;return db[_0x59ad('0xc4')][_0x59ad('0x7d')]({'where':{'id':_0x48fa61['ChatWebsiteId']}});}})['then'](function(_0x18dbac){if(_0x18dbac){_0xd4eabb=_0x18dbac;return db[_0x59ad('0xd7')][_0x59ad('0x7d')]({'where':{'id':_0x48fa61['ContactId']}});}})['then'](function(_0x20308c){if(_0x20308c){_0x363e1f=_0x20308c;if(_0x1d82cd){var _0x55a713=null;for(var _0x19786b=0x1;_0x19786b<_0x48fa61[_0x59ad('0xf1')][_0x59ad('0x6b')];++_0x19786b){_0x55a713=_0x48fa61['Messages'][_0x19786b];var _0x119c7f=_0x55a713['UserId']?util[_0x59ad('0xee')]('%s%d',_0xd4eabb[_0x59ad('0xf2')],_0x55a713[_0x59ad('0x7e')]):_0x59ad('0xf3');var _0x305611=_0x5d4d32[_0x59ad('0x3d')][_0x59ad('0xf4')]||util[_0x59ad('0xee')](_0x59ad('0xf5'),'Visitor',_0x55a713[_0x59ad('0x75')]);switch(_0xd4eabb[_0x59ad('0xf6')]){case _0x59ad('0xf7'):_0x119c7f=_0x55a713[_0x59ad('0x7e')]?util[_0x59ad('0xee')](_0x59ad('0xf5'),_0xd4eabb[_0x59ad('0xf2')],_0x55a713[_0x59ad('0x7e')]):_0x59ad('0xf3');break;case _0x59ad('0xf8'):_0x119c7f=_0x55a713['UserId']?_0x55a713['User']['alias']||_0x55a713['User'][_0x59ad('0x43')]:'System';break;case _0x59ad('0xf9'):_0x119c7f=_0x55a713['UserId']?_0x55a713['User'][_0x59ad('0x43')]:_0x59ad('0xf3');break;default:_0x119c7f=_0x55a713[_0x59ad('0x7e')]?util[_0x59ad('0xee')]('%s%d',_0xd4eabb['agentAlias'],_0x55a713[_0x59ad('0x7e')]):_0x59ad('0xf3');}var _0x12a231=util[_0x59ad('0xee')](_0x59ad('0xfa'),moment(_0x55a713[_0x59ad('0x87')])[_0x59ad('0xee')]('MM/DD/YYYY\x20HH:mm:ss'),_0x55a713[_0x59ad('0xfb')]==='in'?_0x305611:_0x119c7f,_0x55a713[_0x59ad('0x3d')]);if(!_0x55a713[_0x59ad('0xfc')]){fs['appendFileSync'](_0x1d82cd,_0x12a231);}}return db[_0x59ad('0xfd')][_0x59ad('0xc3')]({'where':{'service':!![]},'include':[{'model':db[_0x59ad('0xfe')],'as':'Smtp','raw':!![]}]});}}})[_0x59ad('0x20')](function(_0x1170db){if(_0x1170db&&_0x1170db[_0x59ad('0xff')]&&_0x5d4d32['body']){var _0x272de7={'tls':{'rejectUnauthorized':![]}};if(_0x1170db[_0x59ad('0xff')]['service']){_0x272de7[_0x59ad('0x100')]=_0x1170db[_0x59ad('0xff')][_0x59ad('0x100')];}else{_0x272de7[_0x59ad('0x101')]=_0x1170db[_0x59ad('0xff')][_0x59ad('0x101')];_0x272de7[_0x59ad('0x102')]=_0x1170db[_0x59ad('0xff')][_0x59ad('0x102')];_0x272de7[_0x59ad('0x103')]=_0x1170db['Smtp'][_0x59ad('0x103')];}if(_0x1170db['Smtp'][_0x59ad('0x104')]){_0x272de7[_0x59ad('0x105')]={'user':_0x1170db[_0x59ad('0xff')][_0x59ad('0x9e')],'pass':_0x1170db[_0x59ad('0xff')][_0x59ad('0x106')]};}return respondWithRpcPromise(_0x59ad('0x107'),'sendMail',{'account':_0x272de7,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x1170db[_0x59ad('0x39')],_0x1170db[_0x59ad('0xca')]||_0x1170db[_0x59ad('0xff')][_0x59ad('0x9e')]),'to':_0x5d4d32[_0x59ad('0x3d')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x59ad('0xee')](_0x59ad('0x108'),_0x5d4d32['body'][_0x59ad('0xec')]),'attachments':[{'path':_0x1d82cd}]}})[_0x59ad('0x20')](function(){return _0x48fa61;})[_0x59ad('0x2b')](function(_0x24c80d){console[_0x59ad('0x26')](_0x24c80d);});}else{return _0x48fa61;}})[_0x59ad('0x20')](respondWithStatusCode(_0x179148,0xc8))[_0x59ad('0x2b')](handleError(_0x179148,null));};exports[_0x59ad('0x109')]=function(_0x3b49b,_0x2a421b,_0x42c191){return db[_0x59ad('0xd3')]['find']({'where':{'id':_0x3b49b['params']['id']}})[_0x59ad('0x20')](handleEntityNotFound(_0x2a421b,null))[_0x59ad('0x20')](function(_0x3339b6){if(_0x3339b6){return _0x3339b6[_0x59ad('0x109')](_0x3b49b[_0x59ad('0x3d')][_0x59ad('0x10a')],_['omit'](_0x3b49b['body'],[_0x59ad('0x10a'),'id'])||{});}})['then'](respondWithResult(_0x2a421b,null))[_0x59ad('0x2b')](handleError(_0x2a421b,null));};exports['getMessages']=function(_0x2fd591,_0xe8c6c,_0x6334a2){var _0x4eb360={'raw':![],'where':{}};var _0xcbab48={};var _0x2d5bb0={'count':0x0,'rows':[]};return db[_0x59ad('0xbe')][_0x59ad('0xc3')]({'where':{'id':_0x2fd591[_0x59ad('0xc0')]['id']}})[_0x59ad('0x20')](handleEntityNotFound(_0xe8c6c,null))[_0x59ad('0x20')](function(_0x110f1e){if(_0x110f1e){_0xcbab48[_0x59ad('0x4d')]=_[_0x59ad('0x81')](db['ChatMessage'][_0x59ad('0x4a')]);_0xcbab48[_0x59ad('0x4e')]=_[_0x59ad('0x81')](_0x2fd591[_0x59ad('0x4e')]);_0xcbab48['filters']=_['intersection'](_0xcbab48[_0x59ad('0x4d')],_0xcbab48[_0x59ad('0x4e')]);_0x4eb360[_0x59ad('0xa6')]=_[_0x59ad('0x50')](_0xcbab48[_0x59ad('0x4d')],qs[_0x59ad('0x51')](_0x2fd591[_0x59ad('0x4e')][_0x59ad('0x51')]));_0x4eb360[_0x59ad('0xa6')]=_0x4eb360['attributes']['length']?_0x4eb360[_0x59ad('0xa6')]:_0xcbab48[_0x59ad('0x4d')];if(!_0x2fd591[_0x59ad('0x4e')][_0x59ad('0x52')](_0x59ad('0x53'))){_0x4eb360[_0x59ad('0x33')]=qs[_0x59ad('0x33')](_0x2fd591['query']['limit']);_0x4eb360[_0x59ad('0x32')]=qs['offset'](_0x2fd591[_0x59ad('0x4e')]['offset']);}_0x4eb360[_0x59ad('0x54')]=qs['sort'](_0x2fd591['query'][_0x59ad('0x55')]);_0x4eb360[_0x59ad('0x56')]=qs[_0x59ad('0x4f')](_[_0x59ad('0x57')](_0x2fd591['query'],_0xcbab48['filters']));_0x4eb360[_0x59ad('0x56')]['ChatInteractionId']=_0x110f1e['id'];if(_0x2fd591[_0x59ad('0x4e')][_0x59ad('0x91')]){_0x4eb360['where']=_[_0x59ad('0x3c')](_0x4eb360[_0x59ad('0x56')],{'$or':_[_0x59ad('0x42')](_0x4eb360[_0x59ad('0xa6')],function(_0x57e4dd){var _0x5f21e7={};_0x5f21e7[_0x57e4dd]={'$like':'%'+_0x2fd591['query'][_0x59ad('0x91')]+'%'};return _0x5f21e7;})});}if(_0x2fd591[_0x59ad('0x4e')][_0x59ad('0x89')]){var _0x269ba8=_0x2fd591[_0x59ad('0x4e')]['$gte'][_0x59ad('0x46')](',');var _0x460cd3={};_0x460cd3[_0x269ba8[0x0]]={'$gte':moment(_0x269ba8[0x1])[_0x59ad('0xee')](_0x59ad('0x10b'))};_0x4eb360[_0x59ad('0x56')]=_[_0x59ad('0x3c')](_0x4eb360[_0x59ad('0x56')],_0x460cd3);}_0x4eb360=_[_0x59ad('0x3c')]({},_0x4eb360,_0x2fd591['options']);return db[_0x59ad('0xd3')][_0x59ad('0x31')]({'where':_0x4eb360[_0x59ad('0x56')]})[_0x59ad('0x20')](function(_0x2689fd){_0x2d5bb0[_0x59ad('0x31')]=_0x2689fd;if(_0x2fd591['query'][_0x59ad('0x10c')]){_0x4eb360['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4eb360);})['then'](function(_0x240b9c){_0x2d5bb0[_0x59ad('0x10d')]=_0x240b9c;return _0x2d5bb0;});}})['then'](respondWithFilteredResult(_0xe8c6c,_0x4eb360))[_0x59ad('0x2b')](handleError(_0xe8c6c,null));};exports[_0x59ad('0x10e')]=function(_0x51c03b,_0x5e29cd,_0x375d7b){var _0x49dbdf={'where':{}},_0xbcca5a={},_0x247481={'count':0x0,'rows':[]};return db[_0x59ad('0xbe')][_0x59ad('0xc3')]({'where':{'id':_0x51c03b[_0x59ad('0xc0')]['id']}})[_0x59ad('0x20')](handleEntityNotFound(_0x5e29cd,null))[_0x59ad('0x20')](function(_0x28745a){if(_0x28745a){_0xbcca5a[_0x59ad('0x4d')]=_['keys'](db[_0x59ad('0xd3')][_0x59ad('0x4a')]);_0xbcca5a[_0x59ad('0x4e')]=_['keys'](_0x51c03b['query']);_0xbcca5a['filters']=_[_0x59ad('0x50')](_0xbcca5a[_0x59ad('0x4d')],_0xbcca5a[_0x59ad('0x4e')]);_0x49dbdf['attributes']=_[_0x59ad('0x50')](_0xbcca5a[_0x59ad('0x4d')],qs[_0x59ad('0x51')](_0x51c03b['query'][_0x59ad('0x51')]));_0x49dbdf[_0x59ad('0xa6')]=_0x49dbdf[_0x59ad('0xa6')][_0x59ad('0x6b')]?_0x49dbdf[_0x59ad('0xa6')]:_0xbcca5a['model'];if(!_0x51c03b['query'][_0x59ad('0x52')](_0x59ad('0x53'))){_0x49dbdf[_0x59ad('0x33')]=qs[_0x59ad('0x33')](_0x51c03b[_0x59ad('0x4e')]['limit']);_0x49dbdf[_0x59ad('0x32')]=qs[_0x59ad('0x32')](_0x51c03b[_0x59ad('0x4e')][_0x59ad('0x32')]);}_0x49dbdf[_0x59ad('0x54')]=qs[_0x59ad('0x55')](_0x51c03b[_0x59ad('0x4e')]['sort']);_0x49dbdf['where']=qs[_0x59ad('0x4f')](_['pick'](_0x51c03b[_0x59ad('0x4e')],_0xbcca5a[_0x59ad('0x4f')]));_0x49dbdf[_0x59ad('0x56')][_0x59ad('0xba')]=_0x28745a['id'];if(_0x51c03b['query']['filter']){_0x49dbdf['where']=_[_0x59ad('0x3c')](_0x49dbdf[_0x59ad('0x56')],{'$or':_[_0x59ad('0x42')](_0x49dbdf[_0x59ad('0xa6')],function(_0x225978){var _0x3bf9f2={};_0x3bf9f2[_0x225978]={'$like':'%'+_0x51c03b[_0x59ad('0x4e')][_0x59ad('0x91')]+'%'};return _0x3bf9f2;})});}_0x49dbdf['where'][_0x59ad('0xfc')]=![];if(_0x51c03b[_0x59ad('0x4e')]['id']){_0x49dbdf['where']['id']={'$gt':_0x51c03b[_0x59ad('0x4e')]['id']};}_0x49dbdf=_[_0x59ad('0x3c')]({},_0x49dbdf,_0x51c03b['options']);return db[_0x59ad('0xd3')][_0x59ad('0x31')]({'where':_0x49dbdf['where']})['then'](function(_0x2218cd){_0x247481[_0x59ad('0x31')]=_0x2218cd;_0x49dbdf['include']=[];if(_0x51c03b[_0x59ad('0x4e')]['includeAgent']){_0x49dbdf['include'][_0x59ad('0x48')]({'model':db[_0x59ad('0x7a')],'as':'User','attributes':['id',_0x59ad('0x43'),_0x59ad('0x10f')]});}if(_0x51c03b['query'][_0x59ad('0x10c')]){_0x49dbdf[_0x59ad('0xbc')]=[{'all':!![]}];}return db[_0x59ad('0xd3')][_0x59ad('0x110')](_0x49dbdf);})[_0x59ad('0x20')](function(_0x152f78){_0x247481['rows']=_0x152f78;return _0x247481;});}})['then'](respondWithFilteredResult(_0x5e29cd,_0x49dbdf))['catch'](handleError(_0x5e29cd,null));};exports[_0x59ad('0x111')]=function(_0x3917c3,_0x3ffc5a,_0x15042a){return db[_0x59ad('0xbe')]['find']({'where':{'id':_0x3917c3['params']['id']}})[_0x59ad('0x20')](handleEntityNotFound(_0x3ffc5a,null))[_0x59ad('0x20')](function(_0x46b709){if(_0x46b709){return _0x46b709[_0x59ad('0x112')](_0x3917c3['body']['ids'],_[_0x59ad('0x113')](_0x3917c3[_0x59ad('0x3d')],[_0x59ad('0x10a'),'id'])||{})[_0x59ad('0x114')](function(){return db[_0x59ad('0x78')][_0x59ad('0x110')]({'attributes':['id',_0x59ad('0x39'),'color'],'where':{'id':_0x3917c3[_0x59ad('0x3d')][_0x59ad('0x10a')]}});})[_0x59ad('0x20')](function(_0x36a70d){socket[_0x59ad('0x115')]('chatInteractionTags:save',{'id':Number(_0x3917c3['params']['id']),'tags':_0x36a70d||[]});return{'id':Number(_0x3917c3['params']['id']),'tags':_0x36a70d||[]};});}})['then'](respondWithResult(_0x3ffc5a,null))[_0x59ad('0x2b')](handleError(_0x3ffc5a,null));};exports[_0x59ad('0x116')]=function(_0x144fd4,_0x5b0801,_0x692a2e){return db[_0x59ad('0xbe')][_0x59ad('0x7d')]({'where':{'id':_0x144fd4['params']['id']}})['then'](handleEntityNotFound(_0x5b0801,null))[_0x59ad('0x20')](function(_0x42f584){if(_0x42f584){return _0x42f584[_0x59ad('0x116')](_0x144fd4['query'][_0x59ad('0x10a')]);}})['then'](respondWithStatusCode(_0x5b0801,null))[_0x59ad('0x2b')](handleError(_0x5b0801,null));};exports[_0x59ad('0xea')]=function(_0x5722da,_0x5835bd){var _0x405744=moment()[_0x59ad('0x117')]()[_0x59ad('0xa4')]();var _0x9e2ed6=path['join'](config[_0x59ad('0xe7')],_0x59ad('0x118'),'files',_0x59ad('0x119'));var _0x387db2=path[_0x59ad('0xe6')](config[_0x59ad('0xe7')],_0x59ad('0x118'),_0x59ad('0x11a'),'attachments');var _0x574131=path['join'](_0x9e2ed6,_0x405744);var _0x1ce472=util[_0x59ad('0xee')](_0x59ad('0x11b'),_0x5722da[_0x59ad('0xc0')]['id'],_0x405744);var _0x2bcd12=path['join'](_0x9e2ed6,_0x1ce472);var _0x4d38c1=[];_0x4d38c1[_0x59ad('0x48')]({'model':db[_0x59ad('0x7a')],'as':'User','attributes':['id',_0x59ad('0x43')],'raw':!![]});_0x4d38c1[_0x59ad('0x48')]({'model':db[_0x59ad('0xd7')],'as':_0x59ad('0x70'),'attributes':['id','firstName',_0x59ad('0x11c')],'raw':!![]});if(_0x5722da[_0x59ad('0x4e')][_0x59ad('0x11d')]){_0x4d38c1[_0x59ad('0x48')]({'model':db[_0x59ad('0xe3')],'as':_0x59ad('0xe3'),'raw':!![]});}var _0x4869f4=[{'model':db[_0x59ad('0xd3')],'as':'Messages','attributes':['id',_0x59ad('0x3d'),_0x59ad('0x87'),_0x59ad('0xfb'),_0x59ad('0xfc'),'read'],'include':_0x4d38c1}];_0x4869f4['push']({'model':db[_0x59ad('0xc4')],'as':_0x59ad('0x11e'),'attributes':['id',_0x59ad('0x39')]});_0x4869f4[_0x59ad('0x48')]({'model':db[_0x59ad('0x7a')],'as':_0x59ad('0x11f'),'attributes':['id',_0x59ad('0x43')]});return db[_0x59ad('0xbe')][_0x59ad('0x7d')]({'where':{'id':_0x5722da[_0x59ad('0xc0')]['id']},'include':_0x4869f4})[_0x59ad('0x20')](handleEntityNotFound(_0x5835bd,null))[_0x59ad('0x20')](function(_0x23542a){if(_0x23542a){var _0x1e66a8=_0x23542a[_0x59ad('0x120')]({'plain':!![]});fs[_0x59ad('0x121')](_0x574131);var _0x532b73={'channel':'Chat','account':_0x1e66a8[_0x59ad('0x11e')][_0x59ad('0x39')],'agent':_0x1e66a8[_0x59ad('0x11f')]?_0x1e66a8[_0x59ad('0x11f')]['fullname']:_0x59ad('0x122'),'createdAt':moment(_0x1e66a8['createdAt'])[_0x59ad('0xee')](_0x59ad('0x10b'))['toString'](),'closedAt':_0x1e66a8[_0x59ad('0xda')]?moment(_0x1e66a8[_0x59ad('0x123')])[_0x59ad('0xee')]('YYYY-MM-DD\x20HH:mm:ss')[_0x59ad('0xa4')]():'','disposition':_0x1e66a8[_0x59ad('0xdb')],'chatInfo':{'browser':_0x1e66a8[_0x59ad('0x124')],'os':_0x1e66a8[_0x59ad('0x125')],'referer':_0x1e66a8['referer'],'customerIp':_0x1e66a8[_0x59ad('0x126')],'customerPort':_0x1e66a8[_0x59ad('0x127')]?_0x1e66a8['customerPort']:_0x59ad('0x122')},'messages':_(_0x1e66a8['Messages'])['tail']()[_0x59ad('0x91')]({'secret':![]})['map'](function(_0x1a57dd){if(_0x1a57dd[_0x59ad('0xe3')]){var _0x258765=path[_0x59ad('0xe6')](_0x387db2,_0x1a57dd[_0x59ad('0xe3')][_0x59ad('0xdf')]);if(fs[_0x59ad('0x128')](_0x258765)){fs[_0x59ad('0x129')](_0x258765)[_0x59ad('0x12a')](fs[_0x59ad('0x12b')](path[_0x59ad('0xe6')](_0x574131,_0x1a57dd[_0x59ad('0xe3')]['basename'])));}}return{'date':moment(_0x1a57dd[_0x59ad('0x87')])[_0x59ad('0xee')](_0x59ad('0x10b'))[_0x59ad('0xa4')](),'sender':_0x1a57dd[_0x59ad('0xfb')]==='out'?_0x1a57dd['User']?_0x1a57dd[_0x59ad('0x7a')][_0x59ad('0x43')]:'System':_0x1a57dd[_0x59ad('0x70')][_0x59ad('0x12c')]+(_0x1a57dd['Contact'][_0x59ad('0x11c')]?'\x20'+_0x1a57dd[_0x59ad('0x70')][_0x59ad('0x11c')]:''),'body':_0x1a57dd[_0x59ad('0xe3')]?_0x1a57dd[_0x59ad('0xe3')][_0x59ad('0xdf')]:_0x1a57dd[_0x59ad('0x3d')],'direction':_0x1a57dd[_0x59ad('0xfb')]===_0x59ad('0xd2')?'A':'C','secret':_0x1a57dd[_0x59ad('0xfc')],'read':_0x1a57dd[_0x59ad('0x8d')],'attachment':_0x1a57dd['Attachment']};})[_0x59ad('0x72')]()};return ejs[_0x59ad('0x12d')](path[_0x59ad('0xe6')](config['root'],'server',_0x59ad('0x12e'),_0x59ad('0x12f')),{'interaction':_0x532b73})[_0x59ad('0x20')](function(_0x636456){var _0x4367d2=path[_0x59ad('0xe6')](_0x574131,_0x59ad('0x130')+_0x1e66a8['id']+'-'+_0x405744+'.pdf');var _0x3807dd={'path':_0x4367d2,'channel':'Chat','interactionId':_0x1e66a8['id']};return pdf[_0x59ad('0x131')](_0x636456,_0x3807dd);})['then'](function(){return new BPromise(function(_0x2016da,_0x3c5b13){zipdir(_0x574131,{'saveTo':_0x2bcd12},function(_0x580524,_0x1dd057){if(_0x580524)return _0x3c5b13(_0x580524);return _0x2016da(_0x1dd057);});})[_0x59ad('0x20')](function(){return new BPromise(function(_0x4444b5,_0x5b83b5){rimraf(_0x574131,function(_0x3f40cd){if(_0x3f40cd)_0x5b83b5(_0x3f40cd);return _0x4444b5();});});})[_0x59ad('0x20')](function(){return _0x5835bd['download'](_0x2bcd12,_0x1ce472,function(_0x4fd43e){if(_0x4fd43e){console[_0x59ad('0x132')](_0x59ad('0x133'),_0x4fd43e);}else{fs[_0x59ad('0x134')](_0x2bcd12);}});});});}else{return _0x5835bd['sendStatus'](0xc8);}})['catch'](handleError(_0x5835bd,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 8f64b22..e582a16 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 _0xf198=['ChatMessage','setMaxListeners','update','remove','then','setDataValue','Users','map','length','emit','catch','hook','exports','../../mysqldb'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf198,0xd1));var _0x8f19=function(_0x506565,_0x1cb75b){_0x506565=_0x506565-0x0;var _0x372967=_0xf198[_0x506565];return _0x372967;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x8f19('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x8f19('0x0'))['db'][_0x8f19('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8f19('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8f19('0x3'),'afterDestroy':_0x8f19('0x4')};function emitEvent(_0x3a7997){return function(_0x3d85ab,_0x38eb84,_0x2892e9){_0x3d85ab['getUsers']({'attributes':['id'],'raw':!![]})[_0x8f19('0x5')](function(_0x202eb1){_0x3d85ab[_0x8f19('0x6')](_0x8f19('0x7'),_0x202eb1[_0x8f19('0x8')](function(_0x1b5be2){return{'id':_0x1b5be2['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3d85ab['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8f19('0x5')](function(_0x26171d){_0x3d85ab[_0x8f19('0x6')]('unreadMessages',_0x26171d[_0x8f19('0x9')]);ChatInteractionEvents[_0x8f19('0xa')](_0x3a7997+':'+_0x3d85ab['id'],_0x3d85ab);ChatInteractionEvents[_0x8f19('0xa')](_0x3a7997,_0x3d85ab);_0x2892e9(null);})[_0x8f19('0xb')](_0x2892e9(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x8f19('0xc')](e,emitEvent(event));}}module[_0x8f19('0xd')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x9dbf=['map','findAll','length','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','save','remove','getUsers','then','setDataValue','Users'];(function(_0xdd8e36,_0x49d8ce){var _0x8fbbbd=function(_0x2c82e7){while(--_0x2c82e7){_0xdd8e36['push'](_0xdd8e36['shift']());}};_0x8fbbbd(++_0x49d8ce);}(_0x9dbf,0x1ab));var _0xf9db=function(_0x1b68f1,_0x5d58a6){_0x1b68f1=_0x1b68f1-0x0;var _0xad3c27=_0x9dbf[_0x1b68f1];return _0xad3c27;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xf9db('0x0'))['db'][_0xf9db('0x1')];var ChatMessage=require(_0xf9db('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf9db('0x2'),'afterUpdate':'update','afterDestroy':_0xf9db('0x3')};function emitEvent(_0x18a572){return function(_0x56f58c,_0x280518,_0x243935){_0x56f58c[_0xf9db('0x4')]({'attributes':['id'],'raw':!![]})[_0xf9db('0x5')](function(_0x6d3c3b){_0x56f58c[_0xf9db('0x6')](_0xf9db('0x7'),_0x6d3c3b[_0xf9db('0x8')](function(_0x31a2d5){return{'id':_0x31a2d5['id']};}));return ChatMessage[_0xf9db('0x9')]({'where':{'ChatInteractionId':_0x56f58c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x349139){_0x56f58c[_0xf9db('0x6')]('unreadMessages',_0x349139[_0xf9db('0xa')]);ChatInteractionEvents['emit'](_0x18a572+':'+_0x56f58c['id'],_0x56f58c);ChatInteractionEvents[_0xf9db('0xb')](_0x18a572,_0x56f58c);_0x243935(null);})['catch'](_0x243935(null));};}for(var e in events){if(events[_0xf9db('0xc')](e)){var event=events[e];ChatInteraction[_0xf9db('0xd')](e,emitEvent(event));}}module[_0xf9db('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index b0a2ba7..8851241 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 _0xbe78=['../../config/logger','api','bluebird','request-promise','path','rimraf','define','ChatInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x4e54a7,_0x3b444e){var _0x3ad0d2=function(_0x4b0dde){while(--_0x4b0dde){_0x4e54a7['push'](_0x4e54a7['shift']());}};_0x3ad0d2(++_0x3b444e);}(_0xbe78,0xee));var _0x8be7=function(_0x2a4a61,_0x3c3cae){_0x2a4a61=_0x2a4a61-0x0;var _0x308182=_0xbe78[_0x2a4a61];return _0x308182;};'use strict';var _=require(_0x8be7('0x0'));var util=require(_0x8be7('0x1'));var logger=require(_0x8be7('0x2'))(_0x8be7('0x3'));var moment=require('moment');var BPromise=require(_0x8be7('0x4'));var rp=require(_0x8be7('0x5'));var fs=require('fs');var path=require(_0x8be7('0x6'));var rimraf=require(_0x8be7('0x7'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x59f313,_0x2bdb8a){return _0x59f313[_0x8be7('0x8')](_0x8be7('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b4de0,_0x55123e,_0x2fca1a){if(_0x2b4de0[_0x8be7('0xa')](_0x8be7('0xb'))){_0x2b4de0['closedAt']=moment()[_0x8be7('0xc')](_0x8be7('0xd'));}_0x2fca1a(null,_0x2b4de0);}},'charset':_0x8be7('0xe'),'collate':_0x8be7('0xf')});};
\ No newline at end of file
+var _0x5ea3=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1f96b9,_0x2b4cae){var _0x15f12d=function(_0xcd47ff){while(--_0xcd47ff){_0x1f96b9['push'](_0x1f96b9['shift']());}};_0x15f12d(++_0x2b4cae);}(_0x5ea3,0x88));var _0x35ea=function(_0x263ecd,_0x4caef2){_0x263ecd=_0x263ecd-0x0;var _0x44d823=_0x5ea3[_0x263ecd];return _0x44d823;};'use strict';var _=require('lodash');var util=require(_0x35ea('0x0'));var logger=require(_0x35ea('0x1'))(_0x35ea('0x2'));var moment=require(_0x35ea('0x3'));var BPromise=require(_0x35ea('0x4'));var rp=require(_0x35ea('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x35ea('0x6'));var config=require(_0x35ea('0x7'));var attributes=require('./chatInteraction.attributes');module[_0x35ea('0x8')]=function(_0x49dca9,_0x5789d9){return _0x49dca9[_0x35ea('0x9')](_0x35ea('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x370e60,_0x4c35be,_0x28de0d){if(_0x370e60['changed'](_0x35ea('0xb'))){_0x370e60[_0x35ea('0xc')]=moment()[_0x35ea('0xd')](_0x35ea('0xe'));}_0x28de0d(null,_0x370e60);}},'charset':_0x35ea('0xf'),'collate':_0x35ea('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index f359f90..ff9b265 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 _0x9bd0=['find','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','AddTagsToChatInteraction'];(function(_0x5c711f,_0x222826){var _0x1300be=function(_0x4daa3c){while(--_0x4daa3c){_0x5c711f['push'](_0x5c711f['shift']());}};_0x1300be(++_0x222826);}(_0x9bd0,0x165));var _0x09bd=function(_0x24de1f,_0x437c83){_0x24de1f=_0x24de1f-0x0;var _0x15a3f=_0x9bd0[_0x24de1f];return _0x15a3f;};'use strict';var _=require('lodash');var util=require(_0x09bd('0x0'));var moment=require(_0x09bd('0x1'));var BPromise=require(_0x09bd('0x2'));var rs=require(_0x09bd('0x3'));var fs=require('fs');var Redis=require(_0x09bd('0x4'));var db=require(_0x09bd('0x5'))['db'];var utils=require(_0x09bd('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x09bd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x09bd('0x8')][_0x09bd('0x9')]({'port':0x232a});config[_0x09bd('0xa')]=_[_0x09bd('0xb')](config['redis'],{'host':_0x09bd('0xc'),'port':0x18eb});var socket=require(_0x09bd('0xd'))(new Redis(config['redis']));require(_0x09bd('0xe'))[_0x09bd('0xf')](socket);function respondWithRpcPromise(_0x1b13c1,_0x72391a,_0x212a8b){return new BPromise(function(_0x26dc4f,_0x17b476){return client[_0x09bd('0x10')](_0x1b13c1,_0x212a8b)[_0x09bd('0x11')](function(_0x3c9409){logger[_0x09bd('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x72391a,_0x09bd('0x13'));logger[_0x09bd('0x14')](_0x09bd('0x15'),_0x72391a,'request\x20sent',JSON[_0x09bd('0x16')](_0x3c9409));if(_0x3c9409[_0x09bd('0x17')]){if(_0x3c9409['error'][_0x09bd('0x18')]===0x1f4){logger[_0x09bd('0x17')](_0x09bd('0x19'),_0x72391a,_0x3c9409[_0x09bd('0x17')][_0x09bd('0x1a')]);return _0x17b476(_0x3c9409[_0x09bd('0x17')][_0x09bd('0x1a')]);}logger['error'](_0x09bd('0x19'),_0x72391a,_0x3c9409['error'][_0x09bd('0x1a')]);return _0x26dc4f(_0x3c9409[_0x09bd('0x17')][_0x09bd('0x1a')]);}else{logger[_0x09bd('0x12')](_0x09bd('0x19'),_0x72391a,_0x09bd('0x13'));_0x26dc4f(_0x3c9409[_0x09bd('0x1b')][_0x09bd('0x1a')]);}})[_0x09bd('0x1c')](function(_0x3df100){logger[_0x09bd('0x17')](_0x09bd('0x19'),_0x72391a,_0x3df100);_0x17b476(_0x3df100);});});}exports[_0x09bd('0x1d')]=function(_0x44704c){var _0x5d0867=this;return new Promise(function(_0x52a2b9,_0x3e5504){return db[_0x09bd('0x1e')][_0x09bd('0x1f')](_0x44704c[_0x09bd('0x20')],{'raw':_0x44704c['options']?_0x44704c[_0x09bd('0x21')][_0x09bd('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44704c['options']?_0x44704c[_0x09bd('0x21')][_0x09bd('0x23')]||null:null,'attributes':_0x44704c[_0x09bd('0x21')]?_0x44704c['options'][_0x09bd('0x24')]||null:null,'limit':_0x44704c[_0x09bd('0x21')]?_0x44704c['options'][_0x09bd('0x25')]||null:null})[_0x09bd('0x11')](function(_0x49a21b){logger[_0x09bd('0x12')](_0x09bd('0x1d'),_0x44704c);logger['debug']('UpdateChatInteraction',_0x44704c,JSON[_0x09bd('0x16')](_0x49a21b));_0x52a2b9(_0x49a21b);})[_0x09bd('0x1c')](function(_0x45ed9c){logger[_0x09bd('0x17')](_0x09bd('0x1d'),_0x45ed9c[_0x09bd('0x1a')],_0x44704c);_0x3e5504(_0x5d0867[_0x09bd('0x17')](0x1f4,_0x45ed9c[_0x09bd('0x1a')]));});});};exports[_0x09bd('0x26')]=function(_0x40b54c){return new Promise(function(_0x5df107,_0x23e454){return db[_0x09bd('0x1e')][_0x09bd('0x27')]({'where':_0x40b54c[_0x09bd('0x21')]?_0x40b54c[_0x09bd('0x21')]['where']||null:null})[_0x09bd('0x11')](function(_0x306ffe){if(_0x306ffe){return _0x306ffe['addTags'](_0x40b54c[_0x09bd('0x20')][_0x09bd('0x28')],_[_0x09bd('0x29')](_0x40b54c[_0x09bd('0x20')],[_0x09bd('0x28'),'id'])||{});}})[_0x09bd('0x2a')](function(_0x550505){logger[_0x09bd('0x12')](_0x09bd('0x2b'),_0x40b54c);logger[_0x09bd('0x14')](_0x09bd('0x2b'),_0x40b54c,JSON[_0x09bd('0x16')](_0x550505));_0x5df107(_0x550505);})[_0x09bd('0x1c')](function(_0x1ab2c5){logger[_0x09bd('0x17')](_0x09bd('0x2b'),_0x1ab2c5['message'],_0x40b54c);_0x23e454(_this[_0x09bd('0x17')](0x1f4,_0x1ab2c5[_0x09bd('0x1a')]));});});};
\ No newline at end of file
+var _0x44c5=['jayson/promise','client','http','defaults','redis','localhost','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','UpdateChatInteraction','ChatInteraction','update','body','raw','options','where','attributes','limit','AddTagsToChatInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x4ef40e,_0x55ff27){var _0x49a80e=function(_0x37d14){while(--_0x37d14){_0x4ef40e['push'](_0x4ef40e['shift']());}};_0x49a80e(++_0x55ff27);}(_0x44c5,0x1e4));var _0x544c=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x44c5[_0x39d544];return _0x5a5ff2;};'use strict';var _=require(_0x544c('0x0'));var util=require(_0x544c('0x1'));var moment=require(_0x544c('0x2'));var BPromise=require(_0x544c('0x3'));var rs=require(_0x544c('0x4'));var fs=require('fs');var Redis=require(_0x544c('0x5'));var db=require(_0x544c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x544c('0x7'));var config=require('../../config/environment');var jayson=require(_0x544c('0x8'));var client=jayson[_0x544c('0x9')][_0x544c('0xa')]({'port':0x232a});config['redis']=_[_0x544c('0xb')](config[_0x544c('0xc')],{'host':_0x544c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x544c('0xe'))[_0x544c('0xf')](socket);function respondWithRpcPromise(_0x3702c5,_0x320dd4,_0x5e4a72){return new BPromise(function(_0x10e2aa,_0x3596f8){return client[_0x544c('0x10')](_0x3702c5,_0x5e4a72)[_0x544c('0x11')](function(_0x3bca12){logger['info'](_0x544c('0x12'),_0x320dd4,_0x544c('0x13'));logger[_0x544c('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x320dd4,'request\x20sent',JSON[_0x544c('0x15')](_0x3bca12));if(_0x3bca12['error']){if(_0x3bca12[_0x544c('0x16')]['code']===0x1f4){logger[_0x544c('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x320dd4,_0x3bca12[_0x544c('0x16')][_0x544c('0x17')]);return _0x3596f8(_0x3bca12[_0x544c('0x16')]['message']);}logger[_0x544c('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x320dd4,_0x3bca12[_0x544c('0x16')][_0x544c('0x17')]);return _0x10e2aa(_0x3bca12['error'][_0x544c('0x17')]);}else{logger[_0x544c('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x320dd4,_0x544c('0x13'));_0x10e2aa(_0x3bca12['result'][_0x544c('0x17')]);}})[_0x544c('0x19')](function(_0x3efecd){logger['error'](_0x544c('0x12'),_0x320dd4,_0x3efecd);_0x3596f8(_0x3efecd);});});}exports[_0x544c('0x1a')]=function(_0x26eb18){var _0x15db2f=this;return new Promise(function(_0x17573d,_0x43254b){return db[_0x544c('0x1b')][_0x544c('0x1c')](_0x26eb18[_0x544c('0x1d')],{'raw':_0x26eb18['options']?_0x26eb18['options'][_0x544c('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26eb18[_0x544c('0x1f')]?_0x26eb18['options'][_0x544c('0x20')]||null:null,'attributes':_0x26eb18[_0x544c('0x1f')]?_0x26eb18[_0x544c('0x1f')][_0x544c('0x21')]||null:null,'limit':_0x26eb18['options']?_0x26eb18[_0x544c('0x1f')][_0x544c('0x22')]||null:null})[_0x544c('0x11')](function(_0x293eb2){logger['info'](_0x544c('0x1a'),_0x26eb18);logger[_0x544c('0x14')](_0x544c('0x1a'),_0x26eb18,JSON['stringify'](_0x293eb2));_0x17573d(_0x293eb2);})[_0x544c('0x19')](function(_0x2aa56c){logger[_0x544c('0x16')](_0x544c('0x1a'),_0x2aa56c[_0x544c('0x17')],_0x26eb18);_0x43254b(_0x15db2f[_0x544c('0x16')](0x1f4,_0x2aa56c[_0x544c('0x17')]));});});};exports[_0x544c('0x23')]=function(_0x424bf8){return new Promise(function(_0x275b1c,_0x49c44a){return db[_0x544c('0x1b')][_0x544c('0x24')]({'where':_0x424bf8[_0x544c('0x1f')]?_0x424bf8[_0x544c('0x1f')][_0x544c('0x20')]||null:null})[_0x544c('0x11')](function(_0x301f53){if(_0x301f53){return _0x301f53[_0x544c('0x25')](_0x424bf8[_0x544c('0x1d')][_0x544c('0x26')],_['omit'](_0x424bf8[_0x544c('0x1d')],[_0x544c('0x26'),'id'])||{});}})[_0x544c('0x27')](function(_0x9714fc){logger[_0x544c('0x18')](_0x544c('0x28'),_0x424bf8);logger[_0x544c('0x14')]('AddTags',_0x424bf8,JSON[_0x544c('0x15')](_0x9714fc));_0x275b1c(_0x9714fc);})[_0x544c('0x19')](function(_0x441494){logger[_0x544c('0x16')](_0x544c('0x28'),_0x441494['message'],_0x424bf8);_0x49c44a(_this[_0x544c('0x16')](0x1f4,_0x441494[_0x544c('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 0085efb..0013fa8 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 _0xa4e3=['./chatInteraction.events','save','remove','update','emit','removeListener','length','chatInteraction:'];(function(_0x42bf0b,_0x465c08){var _0x3e333f=function(_0xcc97b8){while(--_0xcc97b8){_0x42bf0b['push'](_0x42bf0b['shift']());}};_0x3e333f(++_0x465c08);}(_0xa4e3,0x1b0));var _0x3a4e=function(_0x10f344,_0x814dcd){_0x10f344=_0x10f344-0x0;var _0xcdf71f=_0xa4e3[_0x10f344];return _0xcdf71f;};'use strict';var ChatInteractionEvents=require(_0x3a4e('0x0'));var events=[_0x3a4e('0x1'),_0x3a4e('0x2'),_0x3a4e('0x3')];function createListener(_0x31d08e,_0x1a3e8f){return function(_0x1848a1){_0x1a3e8f[_0x3a4e('0x4')](_0x31d08e,_0x1848a1);};}function removeListener(_0x345993,_0x331847){return function(){ChatInteractionEvents[_0x3a4e('0x5')](_0x345993,_0x331847);};}exports['register']=function(_0x50559d){for(var _0x5a993c=0x0,_0x23d353=events[_0x3a4e('0x6')];_0x5a993c<_0x23d353;_0x5a993c++){var _0x14ae53=events[_0x5a993c];var _0x3b5196=createListener(_0x3a4e('0x7')+_0x14ae53,_0x50559d);ChatInteractionEvents['on'](_0x14ae53,_0x3b5196);}};
\ No newline at end of file
+var _0xdd8e=['removeListener','register','length','chatInteraction:','./chatInteraction.events','remove','update','emit'];(function(_0x290694,_0x281935){var _0x5a0f2e=function(_0x58d7d4){while(--_0x58d7d4){_0x290694['push'](_0x290694['shift']());}};_0x5a0f2e(++_0x281935);}(_0xdd8e,0x1f4));var _0xedd8=function(_0x3c8e36,_0x422420){_0x3c8e36=_0x3c8e36-0x0;var _0x31d8a5=_0xdd8e[_0x3c8e36];return _0x31d8a5;};'use strict';var ChatInteractionEvents=require(_0xedd8('0x0'));var events=['save',_0xedd8('0x1'),_0xedd8('0x2')];function createListener(_0x3414ea,_0x44e2c5){return function(_0x376cd9){_0x44e2c5[_0xedd8('0x3')](_0x3414ea,_0x376cd9);};}function removeListener(_0x367f69,_0x2213cd){return function(){ChatInteractionEvents[_0xedd8('0x4')](_0x367f69,_0x2213cd);};}exports[_0xedd8('0x5')]=function(_0x31da81){for(var _0x3d28bc=0x0,_0x11e499=events[_0xedd8('0x6')];_0x3d28bc<_0x11e499;_0x3d28bc++){var _0x5a9fdb=events[_0x3d28bc];var _0x1295c0=createListener(_0xedd8('0x7')+_0x5a9fdb,_0x31da81);ChatInteractionEvents['on'](_0x5a9fdb,_0x1295c0);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 034fd0a..5cbdf50 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 _0xe836=['single','file','attachmentUpload','/:id/messages','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload'];(function(_0x3dc9c3,_0x460eef){var _0x5b669e=function(_0x129e97){while(--_0x129e97){_0x3dc9c3['push'](_0x3dc9c3['shift']());}};_0x5b669e(++_0x460eef);}(_0xe836,0x10b));var _0x6e83=function(_0x37e967,_0xb3c159){_0x37e967=_0x37e967-0x0;var _0x259861=_0xe836[_0x37e967];return _0x259861;};'use strict';var multer=require(_0x6e83('0x0'));var util=require(_0x6e83('0x1'));var path=require(_0x6e83('0x2'));var timeout=require(_0x6e83('0x3'));var express=require(_0x6e83('0x4'));var router=express[_0x6e83('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6e83('0x6'));var config=require(_0x6e83('0x7'));var controller=require('./chatInteraction.controller');router[_0x6e83('0x8')]('/',auth[_0x6e83('0x9')](),controller[_0x6e83('0xa')]);router[_0x6e83('0x8')](_0x6e83('0xb'),auth[_0x6e83('0x9')](),controller[_0x6e83('0xc')]);router['get'](_0x6e83('0xd'),auth[_0x6e83('0xe')](),controller[_0x6e83('0xf')]);router['get']('/:id/attachment_download',auth[_0x6e83('0xe')](),controller[_0x6e83('0x10')]);router[_0x6e83('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6e83('0x11')]);router[_0x6e83('0x8')](_0x6e83('0x12'),auth[_0x6e83('0xe')](),controller[_0x6e83('0x13')]);router[_0x6e83('0x8')](_0x6e83('0x14'),auth[_0x6e83('0x9')](),controller[_0x6e83('0x15')]);router['post']('/',auth[_0x6e83('0x9')](),controller[_0x6e83('0x16')]);router[_0x6e83('0x17')](_0x6e83('0x18'),auth[_0x6e83('0x9')](),controller[_0x6e83('0x19')]);var upload=multer({'storage':multer[_0x6e83('0x1a')]({'destination':function(_0xbbef31,_0x1c85ae,_0x406f04){_0x406f04(null,path['join'](config['root'],_0x6e83('0x1b')));},'filename':function(_0x3d7ab5,_0x35e8b6,_0x333ece){_0x333ece(null,util[_0x6e83('0x1c')](_0x6e83('0x1d'),Date['now'](),_0x35e8b6[_0x6e83('0x1e')][_0x6e83('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6e83('0x17')](_0x6e83('0x20'),upload[_0x6e83('0x21')](_0x6e83('0x22')),controller[_0x6e83('0x23')]);router[_0x6e83('0x17')](_0x6e83('0x24'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x6e83('0x17')](_0x6e83('0x25'),auth[_0x6e83('0x9')](),interaction[_0x6e83('0x26')](_0x6e83('0x27'),_0x6e83('0x28')),controller[_0x6e83('0x29')]);router[_0x6e83('0x2a')]('/:id',auth[_0x6e83('0x9')](),interaction[_0x6e83('0x26')]('chat',_0x6e83('0x2b')),controller['update']);router[_0x6e83('0x2a')]('/:id/custom_update',controller[_0x6e83('0x2c')]);router[_0x6e83('0x2a')]('/:id/abandon',auth[_0x6e83('0xe')](),controller[_0x6e83('0x2d')]);router[_0x6e83('0x2a')](_0x6e83('0x2e'),controller[_0x6e83('0x2f')]);router[_0x6e83('0x30')](_0x6e83('0xd'),auth[_0x6e83('0x9')](),interaction[_0x6e83('0x26')](_0x6e83('0x27'),_0x6e83('0x31')),controller['destroy']);router[_0x6e83('0x30')](_0x6e83('0x25'),auth[_0x6e83('0x9')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0xd936=['download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','/:id/custom_update','abandon','close','delete','chatinteraction:destroy','removeTags','multer','util','connect-timeout','express','fs-extra','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download'];(function(_0x4855ce,_0x3fbf65){var _0x150377=function(_0x21555b){while(--_0x21555b){_0x4855ce['push'](_0x4855ce['shift']());}};_0x150377(++_0x3fbf65);}(_0xd936,0x7d));var _0x6d93=function(_0x5d6baf,_0xc44ec4){_0x5d6baf=_0x5d6baf-0x0;var _0x8d76ae=_0xd936[_0x5d6baf];return _0x8d76ae;};'use strict';var multer=require(_0x6d93('0x0'));var util=require(_0x6d93('0x1'));var path=require('path');var timeout=require(_0x6d93('0x2'));var express=require(_0x6d93('0x3'));var router=express['Router']();var fs_extra=require(_0x6d93('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6d93('0x5'));router[_0x6d93('0x6')]('/',auth[_0x6d93('0x7')](),controller['index']);router[_0x6d93('0x6')](_0x6d93('0x8'),auth[_0x6d93('0x7')](),controller[_0x6d93('0x9')]);router[_0x6d93('0x6')](_0x6d93('0xa'),auth[_0x6d93('0xb')](),controller[_0x6d93('0xc')]);router[_0x6d93('0x6')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x6d93('0xd')]);router['get'](_0x6d93('0xe'),auth['isAuthenticated'](),controller[_0x6d93('0xf')]);router[_0x6d93('0x6')](_0x6d93('0x10'),auth[_0x6d93('0xb')](),controller[_0x6d93('0x11')]);router[_0x6d93('0x6')](_0x6d93('0x12'),auth[_0x6d93('0x7')](),controller[_0x6d93('0x13')]);router['post']('/',auth[_0x6d93('0x7')](),controller[_0x6d93('0x14')]);router[_0x6d93('0x15')](_0x6d93('0x16'),auth[_0x6d93('0x7')](),controller[_0x6d93('0x17')]);var upload=multer({'storage':multer[_0x6d93('0x18')]({'destination':function(_0x176f9c,_0x4581c5,_0x1dbe6e){_0x1dbe6e(null,path[_0x6d93('0x19')](config[_0x6d93('0x1a')],_0x6d93('0x1b')));},'filename':function(_0x38c0aa,_0x2338bc,_0x2dac7e){_0x2dac7e(null,util[_0x6d93('0x1c')]('%s-%s',Date['now'](),_0x2338bc[_0x6d93('0x1d')][_0x6d93('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6d93('0x15')](_0x6d93('0x1f'),upload[_0x6d93('0x20')](_0x6d93('0x21')),controller[_0x6d93('0x22')]);router['post']('/:id/messages',auth[_0x6d93('0xb')](),controller[_0x6d93('0x23')]);router['post'](_0x6d93('0x24'),auth[_0x6d93('0x7')](),interaction[_0x6d93('0x25')](_0x6d93('0x26'),_0x6d93('0x27')),controller['addTags']);router[_0x6d93('0x28')](_0x6d93('0xa'),auth['isAuthenticated'](),interaction[_0x6d93('0x25')](_0x6d93('0x26'),_0x6d93('0x29')),controller['update']);router[_0x6d93('0x28')](_0x6d93('0x2a'),controller['customUpdate']);router[_0x6d93('0x28')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x6d93('0x2b')]);router['put']('/:id/close',controller[_0x6d93('0x2c')]);router[_0x6d93('0x2d')](_0x6d93('0xa'),auth[_0x6d93('0x7')](),interaction[_0x6d93('0x25')](_0x6d93('0x26'),_0x6d93('0x2e')),controller['destroy']);router[_0x6d93('0x2d')](_0x6d93('0x24'),auth[_0x6d93('0x7')](),controller[_0x6d93('0x2f')]);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 17c4c43..8f5de0e 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 _0x14a0=['BOOLEAN','INTEGER','exports','TEXT','medium'];(function(_0x4824f7,_0x56c0bb){var _0x2f56b7=function(_0x5452e7){while(--_0x5452e7){_0x4824f7['push'](_0x4824f7['shift']());}};_0x2f56b7(++_0x56c0bb);}(_0x14a0,0x8e));var _0x014a=function(_0x9f4785,_0x43fd4c){_0x9f4785=_0x9f4785-0x0;var _0x279349=_0x14a0[_0x9f4785];return _0x279349;};'use strict';var Sequelize=require('sequelize');module[_0x014a('0x0')]={'body':{'type':Sequelize[_0x014a('0x1')](_0x014a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x014a('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x014a('0x4')]}};
\ No newline at end of file
+var _0x14a0=['BOOLEAN','INTEGER','exports','TEXT','medium'];(function(_0xe3b6a3,_0x43d8fd){var _0xe1adf9=function(_0x4a4f40){while(--_0x4a4f40){_0xe3b6a3['push'](_0xe3b6a3['shift']());}};_0xe1adf9(++_0x43d8fd);}(_0x14a0,0x8e));var _0x014a=function(_0x20b82f,_0x1e15bb){_0x20b82f=_0x20b82f-0x0;var _0x8813c1=_0x14a0[_0x20b82f];return _0x8813c1;};'use strict';var Sequelize=require('sequelize');module[_0x014a('0x0')]={'body':{'type':Sequelize[_0x014a('0x1')](_0x014a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x014a('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x014a('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 1313927..b3caf77 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 _0xa6ed=['query','keys','filters','attributes','intersection','fields','length','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','params','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','user','role','userpic','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model'];(function(_0x4eac2f,_0x19eda1){var _0x739a1c=function(_0x240d08){while(--_0x240d08){_0x4eac2f['push'](_0x4eac2f['shift']());}};_0x739a1c(++_0x19eda1);}(_0xa6ed,0x111));var _0xda6e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xa6ed[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require(_0xda6e('0x0'));var rimraf=require(_0xda6e('0x1'));var zipdir=require(_0xda6e('0x2'));var jsonpatch=require(_0xda6e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xda6e('0x4'));var Mustache=require(_0xda6e('0x5'));var util=require(_0xda6e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xda6e('0x7'));var ejs=require(_0xda6e('0x8'));var fs=require('fs');var fs_extra=require(_0xda6e('0x9'));var _=require('lodash');var squel=require(_0xda6e('0xa'));var crypto=require(_0xda6e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xda6e('0xc'));var toCsv=require(_0xda6e('0x7'));var querystring=require(_0xda6e('0xd'));var Papa=require(_0xda6e('0xe'));var Redis=require(_0xda6e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xda6e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda6e('0x11'));var logger=require(_0xda6e('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xda6e('0x13'));var licenseUtil=require(_0xda6e('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xda6e('0x15')](config[_0xda6e('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xda6e('0x17'))(new Redis(config[_0xda6e('0x16')]));require(_0xda6e('0x18'))[_0xda6e('0x19')](socket);function respondWithStatusCode(_0x203b02,_0x2a3c6e){_0x2a3c6e=_0x2a3c6e||0xcc;return function(_0x55f160){if(_0x55f160){return _0x203b02['sendStatus'](_0x2a3c6e);}return _0x203b02[_0xda6e('0x1a')](_0x2a3c6e)[_0xda6e('0x1b')]();};}function respondWithResult(_0x11ff98,_0x197543){_0x197543=_0x197543||0xc8;return function(_0x152564){if(_0x152564){return _0x11ff98[_0xda6e('0x1a')](_0x197543)[_0xda6e('0x1c')](_0x152564);}};}function respondWithFilteredResult(_0x2d6486,_0x4c9603){return function(_0x2c031e){if(_0x2c031e){var _0x2f18d5=typeof _0x4c9603[_0xda6e('0x1d')]===_0xda6e('0x1e')&&typeof _0x4c9603['limit']===_0xda6e('0x1e');var _0x2d4baf=_0x2c031e[_0xda6e('0x1f')];var _0x4e0c2e=_0x2f18d5?0x0:_0x4c9603[_0xda6e('0x1d')];var _0x13c6f4=_0x2f18d5?_0x2c031e['count']:_0x4c9603[_0xda6e('0x1d')]+_0x4c9603['limit'];var _0x4b5cd5;if(_0x13c6f4>=_0x2d4baf){_0x13c6f4=_0x2d4baf;_0x4b5cd5=0xc8;}else{_0x4b5cd5=0xce;}_0x2d6486[_0xda6e('0x1a')](_0x4b5cd5);return _0x2d6486[_0xda6e('0x20')](_0xda6e('0x21'),_0x4e0c2e+'-'+_0x13c6f4+'/'+_0x2d4baf)[_0xda6e('0x1c')](_0x2c031e);}return null;};}function patchUpdates(_0x5917b9){return function(_0xaccf9){try{jsonpatch[_0xda6e('0x22')](_0xaccf9,_0x5917b9,!![]);}catch(_0x43ceaa){return BPromise[_0xda6e('0x23')](_0x43ceaa);}return _0xaccf9['save']();};}function saveUpdates(_0x43cf4e,_0xcc213e){return function(_0x18d26e){if(_0x18d26e){return _0x18d26e[_0xda6e('0x24')](_0x43cf4e)[_0xda6e('0x25')](function(_0x4d9a81){return _0x4d9a81;});}return null;};}function removeEntity(_0x3de347,_0x495983){return function(_0x5b738a){if(_0x5b738a){return _0x5b738a[_0xda6e('0x26')]()[_0xda6e('0x25')](function(){_0x3de347[_0xda6e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51c2f8,_0x27eb2a){return function(_0x2b83a3){if(!_0x2b83a3){_0x51c2f8[_0xda6e('0x27')](0x194);}return _0x2b83a3;};}function handleError(_0x5d1085,_0x2d3804){_0x2d3804=_0x2d3804||0x1f4;return function(_0x5d8c0c){logger[_0xda6e('0x28')](_0x5d8c0c[_0xda6e('0x29')]);if(_0x5d8c0c[_0xda6e('0x2a')]){delete _0x5d8c0c['name'];}_0x5d1085['status'](_0x2d3804)['send'](_0x5d8c0c);};}exports[_0xda6e('0x2b')]=function(_0x562e6f,_0x557470){var _0x96461d={},_0x56e00e={},_0x138ee9={'count':0x0,'rows':[]};var _0x5bfbd2=_[_0xda6e('0x2c')](db[_0xda6e('0x2d')][_0xda6e('0x2e')],function(_0x5a36a0){return{'name':_0x5a36a0[_0xda6e('0x2f')],'type':_0x5a36a0[_0xda6e('0x30')][_0xda6e('0x31')]};});_0x56e00e[_0xda6e('0x32')]=_[_0xda6e('0x2c')](_0x5bfbd2,_0xda6e('0x2a'));_0x56e00e[_0xda6e('0x33')]=_[_0xda6e('0x34')](_0x562e6f['query']);_0x56e00e[_0xda6e('0x35')]=_['intersection'](_0x56e00e[_0xda6e('0x32')],_0x56e00e['query']);_0x96461d[_0xda6e('0x36')]=_[_0xda6e('0x37')](_0x56e00e[_0xda6e('0x32')],qs[_0xda6e('0x38')](_0x562e6f['query'][_0xda6e('0x38')]));_0x96461d[_0xda6e('0x36')]=_0x96461d[_0xda6e('0x36')][_0xda6e('0x39')]?_0x96461d[_0xda6e('0x36')]:_0x56e00e['model'];if(!_0x562e6f['query']['hasOwnProperty'](_0xda6e('0x3a'))){_0x96461d[_0xda6e('0x3b')]=qs[_0xda6e('0x3b')](_0x562e6f[_0xda6e('0x33')][_0xda6e('0x3b')]);_0x96461d[_0xda6e('0x1d')]=qs[_0xda6e('0x1d')](_0x562e6f[_0xda6e('0x33')][_0xda6e('0x1d')]);}_0x96461d['order']=qs[_0xda6e('0x3c')](_0x562e6f[_0xda6e('0x33')][_0xda6e('0x3c')]);_0x96461d[_0xda6e('0x3d')]=qs[_0xda6e('0x35')](_[_0xda6e('0x3e')](_0x562e6f['query'],_0x56e00e[_0xda6e('0x35')]),_0x5bfbd2);if(_0x562e6f['query'][_0xda6e('0x3f')]){_0x96461d['where']=_[_0xda6e('0x40')](_0x96461d[_0xda6e('0x3d')],{'$or':_[_0xda6e('0x2c')](_0x5bfbd2,function(_0x8b34be){if(_0x8b34be[_0xda6e('0x30')]!==_0xda6e('0x41')){var _0x111c1f={};_0x111c1f[_0x8b34be[_0xda6e('0x2a')]]={'$like':'%'+_0x562e6f[_0xda6e('0x33')][_0xda6e('0x3f')]+'%'};return _0x111c1f;}})});}_0x96461d=_['merge']({},_0x96461d,_0x562e6f[_0xda6e('0x42')]);var _0x218ca5={'where':_0x96461d[_0xda6e('0x3d')]};return db[_0xda6e('0x2d')][_0xda6e('0x1f')](_0x218ca5)[_0xda6e('0x25')](function(_0x22b9f5){_0x138ee9[_0xda6e('0x1f')]=_0x22b9f5;if(_0x562e6f[_0xda6e('0x33')][_0xda6e('0x43')]){_0x96461d[_0xda6e('0x44')]=[{'all':!![]}];}return db[_0xda6e('0x2d')]['findAll'](_0x96461d);})['then'](function(_0x126c9e){_0x138ee9[_0xda6e('0x45')]=_0x126c9e;return _0x138ee9;})[_0xda6e('0x25')](respondWithFilteredResult(_0x557470,_0x96461d))[_0xda6e('0x46')](handleError(_0x557470,null));};exports[_0xda6e('0x47')]=function(_0x20c35c,_0x26a4e7){var _0x20fb9d={'raw':!![],'where':{'id':_0x20c35c['params']['id']}},_0x22c093={};_0x22c093['model']=_[_0xda6e('0x34')](db[_0xda6e('0x2d')]['rawAttributes']);_0x22c093[_0xda6e('0x33')]=_[_0xda6e('0x34')](_0x20c35c[_0xda6e('0x33')]);_0x22c093[_0xda6e('0x35')]=_[_0xda6e('0x37')](_0x22c093[_0xda6e('0x32')],_0x22c093[_0xda6e('0x33')]);_0x20fb9d[_0xda6e('0x36')]=_[_0xda6e('0x37')](_0x22c093[_0xda6e('0x32')],qs['fields'](_0x20c35c[_0xda6e('0x33')][_0xda6e('0x38')]));_0x20fb9d[_0xda6e('0x36')]=_0x20fb9d[_0xda6e('0x36')]['length']?_0x20fb9d[_0xda6e('0x36')]:_0x22c093['model'];if(_0x20c35c[_0xda6e('0x33')][_0xda6e('0x43')]){_0x20fb9d[_0xda6e('0x44')]=[{'all':!![]}];}_0x20fb9d=_[_0xda6e('0x40')]({},_0x20fb9d,_0x20c35c[_0xda6e('0x42')]);return db['ChatInternalMessage'][_0xda6e('0x48')](_0x20fb9d)['then'](handleEntityNotFound(_0x26a4e7,null))['then'](respondWithResult(_0x26a4e7,null))['catch'](handleError(_0x26a4e7,null));};exports[_0xda6e('0x49')]=function(_0x1732cf,_0x5c342d){return db['ChatInternalMessage'][_0xda6e('0x49')](_0x1732cf[_0xda6e('0x4a')],{})[_0xda6e('0x25')](respondWithResult(_0x5c342d,0xc9))[_0xda6e('0x46')](handleError(_0x5c342d,null));};exports[_0xda6e('0x24')]=function(_0x3764ad,_0x282fa3){if(_0x3764ad[_0xda6e('0x4a')]['id']){delete _0x3764ad['body']['id'];}return db[_0xda6e('0x2d')][_0xda6e('0x48')]({'where':{'id':_0x3764ad[_0xda6e('0x4b')]['id']}})[_0xda6e('0x25')](handleEntityNotFound(_0x282fa3,null))['then'](saveUpdates(_0x3764ad[_0xda6e('0x4a')],null))['then'](respondWithResult(_0x282fa3,null))[_0xda6e('0x46')](handleError(_0x282fa3,null));};exports['destroy']=function(_0xce9d97,_0x3a01ba){return db[_0xda6e('0x2d')][_0xda6e('0x48')]({'where':{'id':_0xce9d97['params']['id']}})[_0xda6e('0x25')](handleEntityNotFound(_0x3a01ba,null))[_0xda6e('0x25')](removeEntity(_0x3a01ba,null))[_0xda6e('0x46')](handleError(_0x3a01ba,null));};exports[_0xda6e('0x4c')]=function(_0x3fa49e,_0x3b4d79){return db['ChatInternalMessage'][_0xda6e('0x4c')]()[_0xda6e('0x25')](respondWithResult(_0x3b4d79,null))[_0xda6e('0x46')](handleError(_0x3b4d79,null));};function wrapUser(_0x45c36c){return function(_0x5eb94e){var _0x49cb92=_0x45c36c[_0xda6e('0x4d')]({'plain':!![]});_0x49cb92[_0xda6e('0x4e')]=[];if(_0x5eb94e){_0x49cb92['lastMessageAt']=_0x5eb94e[_0xda6e('0x4f')];_0x49cb92[_0xda6e('0x50')]=_0x5eb94e;}else{_0x49cb92[_0xda6e('0x51')]=moment(0x0)[_0xda6e('0x52')](_0xda6e('0x53'));_0x49cb92[_0xda6e('0x50')]={};}return _0x49cb92;};}exports[_0xda6e('0x54')]=function(_0x3ade11,_0x46f0fc,_0x16c5f4){var _0x57ac34=[];return db[_0xda6e('0x55')][_0xda6e('0x56')]({'where':{'role':[_0xda6e('0x57'),_0xda6e('0x58'),_0xda6e('0x59')]},'attributes':['id','fullname','name',_0xda6e('0x5a'),_0xda6e('0x5b'),'internal','online','lastLoginAt',_0xda6e('0x5c'),_0xda6e('0x5d')],'order':qs[_0xda6e('0x3c')]('-online'),'include':[{'model':db[_0xda6e('0x5e')],'as':_0xda6e('0x5f'),'attributes':['id',_0xda6e('0x2a'),_0xda6e('0x30')],'through':{'attributes':[]}}]})[_0xda6e('0x25')](function(_0xe2dde9){if(_0xe2dde9){var _0x1711b7=_0x3ade11[_0xda6e('0x59')][_0xda6e('0x4d')]({'plain':!![]});if(!_0x1711b7)throw new Error(_0xda6e('0x60'));if(_0x1711b7['role']===_0xda6e('0x59')){return db[_0xda6e('0x61')][_0xda6e('0x48')]({'where':{'name':'Agents','userProfileId':_0x1711b7[_0xda6e('0x62')]},'raw':!![]})[_0xda6e('0x25')](function(_0x13ae06){if(_0x13ae06){if(_0x13ae06[_0xda6e('0x63')]===0x0){return db[_0xda6e('0x64')][_0xda6e('0x56')]({'where':{'sectionId':_0x13ae06['id']},'raw':!![]})[_0xda6e('0x25')](function(_0x460139){var _0xaee8b2=[];if(_['isEmpty'](_0x460139)){_0xaee8b2=_[_0xda6e('0x3f')](_0xe2dde9,function(_0xffd7dd){if(_0xffd7dd[_0xda6e('0x5a')]!=='agent'){return _0xffd7dd;}});return _0xaee8b2;}else{for(var _0x27195a=0x0;_0x27195a<_0xe2dde9[_0xda6e('0x39')];_0x27195a++){var _0x3cf7ff=_0xe2dde9[_0x27195a];if(_0x3cf7ff[_0xda6e('0x5a')]===_0xda6e('0x57')){var _0x4133cd=_[_0xda6e('0x48')](_0x460139,function(_0x3461f8){return _0x3461f8[_0xda6e('0x65')]===_0x3cf7ff['id'];});if(_0x4133cd)_0xaee8b2[_0xda6e('0x66')](_0x3cf7ff);}else{_0xaee8b2[_0xda6e('0x66')](_0x3cf7ff);}}return _0xaee8b2;}});}else{return _0xe2dde9;}}else{var _0x11df34=_[_0xda6e('0x3f')](_0xe2dde9,function(_0x185deb){if(_0x185deb[_0xda6e('0x5a')]!==_0xda6e('0x57')){return _0x185deb;}});return _0x11df34;}});}else{return _0xe2dde9;}}})[_0xda6e('0x25')](function(_0x30dfac){var _0x5d4440=[];if(_0x30dfac){_0x57ac34=_0x30dfac;for(var _0x252ef3=0x0;_0x252ef3<_0x30dfac['length'];_0x252ef3+=0x1){_0x57ac34[_0x252ef3][_0xda6e('0x4e')]=[];_0x5d4440[_0xda6e('0x66')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x3ade11[_0xda6e('0x59')]['id'],_0x30dfac[_0x252ef3]['id']],'ToId':[_0x3ade11['user']['id'],_0x30dfac[_0x252ef3]['id']],'ChatGroupId':null},'attributes':['id',_0xda6e('0x4f'),_0xda6e('0x67'),_0xda6e('0x68'),_0xda6e('0x69'),_0xda6e('0x4a')],'order':qs[_0xda6e('0x3c')](_0xda6e('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xda6e('0x25')](wrapUser(_0x30dfac[_0x252ef3])));}return BPromise[_0xda6e('0x6b')](_0x5d4440);}return[];})[_0xda6e('0x25')](function(_0x506685){return{'rows':_0x506685,'count':_0x506685[_0xda6e('0x39')]};})[_0xda6e('0x25')](respondWithResult(_0x46f0fc,null))[_0xda6e('0x46')](handleError(_0x46f0fc,null));};
\ No newline at end of file
+var _0xd821=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','createdAt','format','getUsers','User','agent','admin','user','fullname','lastLoginAt','allowmessenger','-online','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3d4ec7,_0x268b16){var _0x610cb8=function(_0x14ed84){while(--_0x14ed84){_0x3d4ec7['push'](_0x3d4ec7['shift']());}};_0x610cb8(++_0x268b16);}(_0xd821,0xcb));var _0x1d82=function(_0x3d8a7d,_0x73e707){_0x3d8a7d=_0x3d8a7d-0x0;var _0x538358=_0xd821[_0x3d8a7d];return _0x538358;};'use strict';var emlformat=require(_0x1d82('0x0'));var rimraf=require(_0x1d82('0x1'));var zipdir=require(_0x1d82('0x2'));var jsonpatch=require(_0x1d82('0x3'));var rp=require(_0x1d82('0x4'));var moment=require('moment');var BPromise=require(_0x1d82('0x5'));var Mustache=require(_0x1d82('0x6'));var util=require(_0x1d82('0x7'));var path=require(_0x1d82('0x8'));var sox=require(_0x1d82('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d82('0xa'));var squel=require(_0x1d82('0xb'));var crypto=require(_0x1d82('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1d82('0xd'));var toCsv=require(_0x1d82('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1d82('0xf'));var authService=require(_0x1d82('0x10'));var qs=require(_0x1d82('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d82('0x12'));var logger=require(_0x1d82('0x13'))('api');var utils=require(_0x1d82('0x14'));var config=require(_0x1d82('0x15'));var licenseUtil=require(_0x1d82('0x16'));var db=require(_0x1d82('0x17'))['db'];config[_0x1d82('0x18')]=_[_0x1d82('0x19')](config[_0x1d82('0x18')],{'host':_0x1d82('0x1a'),'port':0x18eb});var socket=require(_0x1d82('0x1b'))(new Redis(config['redis']));require(_0x1d82('0x1c'))[_0x1d82('0x1d')](socket);function respondWithStatusCode(_0x5d85ff,_0x17d0fc){_0x17d0fc=_0x17d0fc||0xcc;return function(_0xc43935){if(_0xc43935){return _0x5d85ff[_0x1d82('0x1e')](_0x17d0fc);}return _0x5d85ff[_0x1d82('0x1f')](_0x17d0fc)['end']();};}function respondWithResult(_0x4df473,_0x29bda5){_0x29bda5=_0x29bda5||0xc8;return function(_0xbcfd34){if(_0xbcfd34){return _0x4df473[_0x1d82('0x1f')](_0x29bda5)['json'](_0xbcfd34);}};}function respondWithFilteredResult(_0x54eacf,_0x7e0b05){return function(_0x531993){if(_0x531993){var _0x465d58=typeof _0x7e0b05[_0x1d82('0x20')]==='undefined'&&typeof _0x7e0b05[_0x1d82('0x21')]===_0x1d82('0x22');var _0x5f44ce=_0x531993[_0x1d82('0x23')];var _0x415a82=_0x465d58?0x0:_0x7e0b05[_0x1d82('0x20')];var _0x35be34=_0x465d58?_0x531993[_0x1d82('0x23')]:_0x7e0b05[_0x1d82('0x20')]+_0x7e0b05[_0x1d82('0x21')];var _0x8dc20c;if(_0x35be34>=_0x5f44ce){_0x35be34=_0x5f44ce;_0x8dc20c=0xc8;}else{_0x8dc20c=0xce;}_0x54eacf['status'](_0x8dc20c);return _0x54eacf[_0x1d82('0x24')](_0x1d82('0x25'),_0x415a82+'-'+_0x35be34+'/'+_0x5f44ce)[_0x1d82('0x26')](_0x531993);}return null;};}function patchUpdates(_0x1d1453){return function(_0x20ec49){try{jsonpatch['apply'](_0x20ec49,_0x1d1453,!![]);}catch(_0x360b02){return BPromise[_0x1d82('0x27')](_0x360b02);}return _0x20ec49[_0x1d82('0x28')]();};}function saveUpdates(_0x159db4,_0x5108a3){return function(_0x1a4952){if(_0x1a4952){return _0x1a4952[_0x1d82('0x29')](_0x159db4)['then'](function(_0x3c888a){return _0x3c888a;});}return null;};}function removeEntity(_0x11b3ac,_0x40f5a9){return function(_0x105fd3){if(_0x105fd3){return _0x105fd3[_0x1d82('0x2a')]()[_0x1d82('0x2b')](function(){_0x11b3ac[_0x1d82('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a9a93,_0x553dd7){return function(_0x2f4c76){if(!_0x2f4c76){_0x4a9a93[_0x1d82('0x1e')](0x194);}return _0x2f4c76;};}function handleError(_0x44e2fb,_0x3aea2a){_0x3aea2a=_0x3aea2a||0x1f4;return function(_0x8a9c9d){logger[_0x1d82('0x2c')](_0x8a9c9d[_0x1d82('0x2d')]);if(_0x8a9c9d[_0x1d82('0x2e')]){delete _0x8a9c9d[_0x1d82('0x2e')];}_0x44e2fb[_0x1d82('0x1f')](_0x3aea2a)[_0x1d82('0x2f')](_0x8a9c9d);};}exports[_0x1d82('0x30')]=function(_0x1b9407,_0x18ce53){var _0x1c43ec={},_0x3058a1={},_0x3da57c={'count':0x0,'rows':[]};var _0x3179a3=_[_0x1d82('0x31')](db[_0x1d82('0x32')][_0x1d82('0x33')],function(_0x121dbc){return{'name':_0x121dbc[_0x1d82('0x34')],'type':_0x121dbc[_0x1d82('0x35')][_0x1d82('0x36')]};});_0x3058a1[_0x1d82('0x37')]=_[_0x1d82('0x31')](_0x3179a3,_0x1d82('0x2e'));_0x3058a1[_0x1d82('0x38')]=_[_0x1d82('0x39')](_0x1b9407[_0x1d82('0x38')]);_0x3058a1[_0x1d82('0x3a')]=_[_0x1d82('0x3b')](_0x3058a1[_0x1d82('0x37')],_0x3058a1[_0x1d82('0x38')]);_0x1c43ec[_0x1d82('0x3c')]=_[_0x1d82('0x3b')](_0x3058a1[_0x1d82('0x37')],qs[_0x1d82('0x3d')](_0x1b9407[_0x1d82('0x38')][_0x1d82('0x3d')]));_0x1c43ec[_0x1d82('0x3c')]=_0x1c43ec['attributes'][_0x1d82('0x3e')]?_0x1c43ec[_0x1d82('0x3c')]:_0x3058a1['model'];if(!_0x1b9407['query'][_0x1d82('0x3f')](_0x1d82('0x40'))){_0x1c43ec[_0x1d82('0x21')]=qs[_0x1d82('0x21')](_0x1b9407[_0x1d82('0x38')][_0x1d82('0x21')]);_0x1c43ec['offset']=qs[_0x1d82('0x20')](_0x1b9407[_0x1d82('0x38')][_0x1d82('0x20')]);}_0x1c43ec[_0x1d82('0x41')]=qs[_0x1d82('0x42')](_0x1b9407[_0x1d82('0x38')][_0x1d82('0x42')]);_0x1c43ec['where']=qs[_0x1d82('0x3a')](_[_0x1d82('0x43')](_0x1b9407['query'],_0x3058a1[_0x1d82('0x3a')]),_0x3179a3);if(_0x1b9407[_0x1d82('0x38')][_0x1d82('0x44')]){_0x1c43ec['where']=_[_0x1d82('0x45')](_0x1c43ec['where'],{'$or':_[_0x1d82('0x31')](_0x3179a3,function(_0x442e12){if(_0x442e12['type']!==_0x1d82('0x46')){var _0x1bea8d={};_0x1bea8d[_0x442e12[_0x1d82('0x2e')]]={'$like':'%'+_0x1b9407[_0x1d82('0x38')][_0x1d82('0x44')]+'%'};return _0x1bea8d;}})});}_0x1c43ec=_[_0x1d82('0x45')]({},_0x1c43ec,_0x1b9407[_0x1d82('0x47')]);var _0x4facdb={'where':_0x1c43ec['where']};return db[_0x1d82('0x32')][_0x1d82('0x23')](_0x4facdb)[_0x1d82('0x2b')](function(_0x3b563a){_0x3da57c[_0x1d82('0x23')]=_0x3b563a;if(_0x1b9407[_0x1d82('0x38')][_0x1d82('0x48')]){_0x1c43ec[_0x1d82('0x49')]=[{'all':!![]}];}return db[_0x1d82('0x32')][_0x1d82('0x4a')](_0x1c43ec);})[_0x1d82('0x2b')](function(_0x342ac2){_0x3da57c[_0x1d82('0x4b')]=_0x342ac2;return _0x3da57c;})[_0x1d82('0x2b')](respondWithFilteredResult(_0x18ce53,_0x1c43ec))[_0x1d82('0x4c')](handleError(_0x18ce53,null));};exports[_0x1d82('0x4d')]=function(_0x21925a,_0x2aa806){var _0x283db4={'raw':!![],'where':{'id':_0x21925a[_0x1d82('0x4e')]['id']}},_0x1a1190={};_0x1a1190[_0x1d82('0x37')]=_[_0x1d82('0x39')](db[_0x1d82('0x32')][_0x1d82('0x33')]);_0x1a1190[_0x1d82('0x38')]=_['keys'](_0x21925a[_0x1d82('0x38')]);_0x1a1190[_0x1d82('0x3a')]=_[_0x1d82('0x3b')](_0x1a1190[_0x1d82('0x37')],_0x1a1190['query']);_0x283db4[_0x1d82('0x3c')]=_[_0x1d82('0x3b')](_0x1a1190[_0x1d82('0x37')],qs[_0x1d82('0x3d')](_0x21925a[_0x1d82('0x38')][_0x1d82('0x3d')]));_0x283db4[_0x1d82('0x3c')]=_0x283db4['attributes'][_0x1d82('0x3e')]?_0x283db4[_0x1d82('0x3c')]:_0x1a1190[_0x1d82('0x37')];if(_0x21925a['query'][_0x1d82('0x48')]){_0x283db4[_0x1d82('0x49')]=[{'all':!![]}];}_0x283db4=_['merge']({},_0x283db4,_0x21925a[_0x1d82('0x47')]);return db['ChatInternalMessage'][_0x1d82('0x4f')](_0x283db4)[_0x1d82('0x2b')](handleEntityNotFound(_0x2aa806,null))[_0x1d82('0x2b')](respondWithResult(_0x2aa806,null))[_0x1d82('0x4c')](handleError(_0x2aa806,null));};exports[_0x1d82('0x50')]=function(_0x15e7e8,_0x9a29e1){return db[_0x1d82('0x32')][_0x1d82('0x50')](_0x15e7e8[_0x1d82('0x51')],{})[_0x1d82('0x2b')](respondWithResult(_0x9a29e1,0xc9))['catch'](handleError(_0x9a29e1,null));};exports[_0x1d82('0x29')]=function(_0x173119,_0x29ebfe){if(_0x173119[_0x1d82('0x51')]['id']){delete _0x173119[_0x1d82('0x51')]['id'];}return db['ChatInternalMessage'][_0x1d82('0x4f')]({'where':{'id':_0x173119[_0x1d82('0x4e')]['id']}})['then'](handleEntityNotFound(_0x29ebfe,null))[_0x1d82('0x2b')](saveUpdates(_0x173119['body'],null))['then'](respondWithResult(_0x29ebfe,null))[_0x1d82('0x4c')](handleError(_0x29ebfe,null));};exports[_0x1d82('0x2a')]=function(_0x1de462,_0x27a597){return db[_0x1d82('0x32')][_0x1d82('0x4f')]({'where':{'id':_0x1de462[_0x1d82('0x4e')]['id']}})[_0x1d82('0x2b')](handleEntityNotFound(_0x27a597,null))['then'](removeEntity(_0x27a597,null))['catch'](handleError(_0x27a597,null));};exports[_0x1d82('0x52')]=function(_0x253dce,_0x3a492e){return db[_0x1d82('0x32')]['describe']()[_0x1d82('0x2b')](respondWithResult(_0x3a492e,null))[_0x1d82('0x4c')](handleError(_0x3a492e,null));};function wrapUser(_0x20cac7){return function(_0x1a1c34){var _0x5989f4=_0x20cac7[_0x1d82('0x53')]({'plain':!![]});_0x5989f4[_0x1d82('0x54')]=[];if(_0x1a1c34){_0x5989f4[_0x1d82('0x55')]=_0x1a1c34[_0x1d82('0x56')];_0x5989f4['lastMessage']=_0x1a1c34;}else{_0x5989f4[_0x1d82('0x55')]=moment(0x0)[_0x1d82('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x5989f4['lastMessage']={};}return _0x5989f4;};}exports[_0x1d82('0x58')]=function(_0x5ac1d9,_0x5420f5,_0x1e4fb9){var _0x16b50a=[];return db[_0x1d82('0x59')][_0x1d82('0x4a')]({'where':{'role':[_0x1d82('0x5a'),_0x1d82('0x5b'),_0x1d82('0x5c')]},'attributes':['id',_0x1d82('0x5d'),_0x1d82('0x2e'),'role','userpic','internal','online',_0x1d82('0x5e'),_0x1d82('0x5f'),'showWebBar'],'order':qs['sort'](_0x1d82('0x60')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0x1d82('0x2e'),_0x1d82('0x35')],'through':{'attributes':[]}}]})[_0x1d82('0x2b')](function(_0x3fe7ab){if(_0x3fe7ab){var _0x33ffc5=_0x5ac1d9[_0x1d82('0x5c')][_0x1d82('0x53')]({'plain':!![]});if(!_0x33ffc5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33ffc5[_0x1d82('0x61')]===_0x1d82('0x5c')){return db[_0x1d82('0x62')][_0x1d82('0x4f')]({'where':{'name':_0x1d82('0x63'),'userProfileId':_0x33ffc5[_0x1d82('0x64')]},'raw':!![]})[_0x1d82('0x2b')](function(_0x4ba64c){if(_0x4ba64c){if(_0x4ba64c[_0x1d82('0x65')]===0x0){return db[_0x1d82('0x66')][_0x1d82('0x4a')]({'where':{'sectionId':_0x4ba64c['id']},'raw':!![]})[_0x1d82('0x2b')](function(_0x22ae3e){var _0x4ec797=[];if(_[_0x1d82('0x67')](_0x22ae3e)){_0x4ec797=_[_0x1d82('0x44')](_0x3fe7ab,function(_0x240aa9){if(_0x240aa9[_0x1d82('0x61')]!==_0x1d82('0x5a')){return _0x240aa9;}});return _0x4ec797;}else{for(var _0x231735=0x0;_0x231735<_0x3fe7ab['length'];_0x231735++){var _0x31b7bd=_0x3fe7ab[_0x231735];if(_0x31b7bd[_0x1d82('0x61')]===_0x1d82('0x5a')){var _0x40eeb1=_[_0x1d82('0x4f')](_0x22ae3e,function(_0x26a180){return _0x26a180[_0x1d82('0x68')]===_0x31b7bd['id'];});if(_0x40eeb1)_0x4ec797[_0x1d82('0x69')](_0x31b7bd);}else{_0x4ec797[_0x1d82('0x69')](_0x31b7bd);}}return _0x4ec797;}});}else{return _0x3fe7ab;}}else{var _0x52a74a=_['filter'](_0x3fe7ab,function(_0x5a76d7){if(_0x5a76d7[_0x1d82('0x61')]!==_0x1d82('0x5a')){return _0x5a76d7;}});return _0x52a74a;}});}else{return _0x3fe7ab;}}})[_0x1d82('0x2b')](function(_0x3fa56d){var _0x291603=[];if(_0x3fa56d){_0x16b50a=_0x3fa56d;for(var _0x362dc5=0x0;_0x362dc5<_0x3fa56d[_0x1d82('0x3e')];_0x362dc5+=0x1){_0x16b50a[_0x362dc5]['messages']=[];_0x291603['push'](db['ChatInternalMessage'][_0x1d82('0x4f')]({'where':{'FromId':[_0x5ac1d9['user']['id'],_0x3fa56d[_0x362dc5]['id']],'ToId':[_0x5ac1d9[_0x1d82('0x5c')]['id'],_0x3fa56d[_0x362dc5]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x1d82('0x6a'),_0x1d82('0x6b'),_0x1d82('0x6c'),_0x1d82('0x51')],'order':qs[_0x1d82('0x42')](_0x1d82('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x3fa56d[_0x362dc5])));}return BPromise[_0x1d82('0x6e')](_0x291603);}return[];})[_0x1d82('0x2b')](function(_0x1655d5){return{'rows':_0x1655d5,'count':_0x1655d5[_0x1d82('0x3e')]};})['then'](respondWithResult(_0x5420f5,null))['catch'](handleError(_0x5420f5,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 6b4e8e4..24344a9 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 _0xb2b5=['emit','hasOwnProperty','hook','save','update'];(function(_0x443b26,_0x198bff){var _0x277c86=function(_0x341176){while(--_0x341176){_0x443b26['push'](_0x443b26['shift']());}};_0x277c86(++_0x198bff);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xb2b5[_0x13e741];return _0x3f8bb3;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5b2b('0x0'),'afterUpdate':_0x5b2b('0x1'),'afterDestroy':'remove'};function emitEvent(_0x4eee87){return function(_0x31784d,_0x11fae1,_0x51e747){ChatInternalMessageEvents[_0x5b2b('0x2')](_0x4eee87+':'+_0x31784d['id'],_0x31784d);ChatInternalMessageEvents['emit'](_0x4eee87,_0x31784d);_0x51e747(null);};}for(var e in events){if(events[_0x5b2b('0x3')](e)){var event=events[e];ChatInternalMessage[_0x5b2b('0x4')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x5ad3=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x46d626,_0x492ea3){var _0x44af26=function(_0x4e25ee){while(--_0x4e25ee){_0x46d626['push'](_0x46d626['shift']());}};_0x44af26(++_0x492ea3);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x4b3300,_0x1137f1){_0x4b3300=_0x4b3300-0x0;var _0x2d26d3=_0x5ad3[_0x4b3300];return _0x2d26d3;};'use strict';var EventEmitter=require(_0x35ad('0x0'));var ChatInternalMessage=require(_0x35ad('0x1'))['db'][_0x35ad('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x35ad('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x35ad('0x4'),'afterDestroy':_0x35ad('0x5')};function emitEvent(_0xc77352){return function(_0x69a0b3,_0x450f55,_0x1fed0d){ChatInternalMessageEvents[_0x35ad('0x6')](_0xc77352+':'+_0x69a0b3['id'],_0x69a0b3);ChatInternalMessageEvents[_0x35ad('0x6')](_0xc77352,_0x69a0b3);_0x1fed0d(null);};}for(var e in events){if(events[_0x35ad('0x7')](e)){var event=events[e];ChatInternalMessage[_0x35ad('0x8')](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 f6adc2b..51270e7 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 _0xda3f=['../../config/environment','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','request-promise','rimraf'];(function(_0x409a1,_0x2742ca){var _0x7dcf8c=function(_0x519b45){while(--_0x519b45){_0x409a1['push'](_0x409a1['shift']());}};_0x7dcf8c(++_0x2742ca);}(_0xda3f,0xec));var _0xfda3=function(_0x43b583,_0x519b92){_0x43b583=_0x43b583-0x0;var _0x24104f=_0xda3f[_0x43b583];return _0x24104f;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfda3('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var attributes=require('./chatInternalMessage.attributes');module[_0xfda3('0x5')]=function(_0x43a010,_0x47e7e2){return _0x43a010['define'](_0xfda3('0x6'),attributes,{'tableName':_0xfda3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfda3('0x8'),'collate':_0xfda3('0x9')});};
\ No newline at end of file
+var _0x4fc2=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x372a5f,_0x460270){var _0x456617=function(_0x9a63b7){while(--_0x9a63b7){_0x372a5f['push'](_0x372a5f['shift']());}};_0x456617(++_0x460270);}(_0x4fc2,0x111));var _0x24fc=function(_0x3130be,_0x54990e){_0x3130be=_0x3130be-0x0;var _0x484c5b=_0x4fc2[_0x3130be];return _0x484c5b;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x24fc('0xb'),'collate':_0x24fc('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index cb6e0d0..e6c20a7 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 _0xf680=['../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xce201f,_0x3a0737){var _0xb052f4=function(_0x43fbee){while(--_0x43fbee){_0xce201f['push'](_0xce201f['shift']());}};_0xb052f4(++_0x3a0737);}(_0xf680,0xd7));var _0x0f68=function(_0x6dae5d,_0x204649){_0x6dae5d=_0x6dae5d-0x0;var _0x2350c9=_0xf680[_0x6dae5d];return _0x2350c9;};'use strict';var _=require(_0x0f68('0x0'));var util=require(_0x0f68('0x1'));var moment=require(_0x0f68('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f68('0x3'));var fs=require('fs');var Redis=require(_0x0f68('0x4'));var db=require(_0x0f68('0x5'))['db'];var utils=require(_0x0f68('0x6'));var logger=require(_0x0f68('0x7'))(_0x0f68('0x8'));var config=require(_0x0f68('0x9'));var jayson=require(_0x0f68('0xa'));var client=jayson[_0x0f68('0xb')]['http']({'port':0x232a});config[_0x0f68('0xc')]=_[_0x0f68('0xd')](config[_0x0f68('0xc')],{'host':_0x0f68('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f68('0xc')]));require(_0x0f68('0xf'))[_0x0f68('0x10')](socket);function respondWithRpcPromise(_0x577d27,_0x464bfa,_0x24da84){return new BPromise(function(_0x4856b5,_0x2993c4){return client[_0x0f68('0x11')](_0x577d27,_0x24da84)[_0x0f68('0x12')](function(_0x7136f2){logger[_0x0f68('0x13')](_0x0f68('0x14'),_0x464bfa,_0x0f68('0x15'));logger[_0x0f68('0x16')](_0x0f68('0x17'),_0x464bfa,_0x0f68('0x15'),JSON['stringify'](_0x7136f2));if(_0x7136f2[_0x0f68('0x18')]){if(_0x7136f2[_0x0f68('0x18')]['code']===0x1f4){logger[_0x0f68('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x464bfa,_0x7136f2[_0x0f68('0x18')][_0x0f68('0x19')]);return _0x2993c4(_0x7136f2[_0x0f68('0x18')]['message']);}logger[_0x0f68('0x18')](_0x0f68('0x14'),_0x464bfa,_0x7136f2[_0x0f68('0x18')][_0x0f68('0x19')]);return _0x4856b5(_0x7136f2['error'][_0x0f68('0x19')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x464bfa,_0x0f68('0x15'));_0x4856b5(_0x7136f2[_0x0f68('0x1a')]['message']);}})[_0x0f68('0x1b')](function(_0x24dac9){logger['error'](_0x0f68('0x14'),_0x464bfa,_0x24dac9);_0x2993c4(_0x24dac9);});});}
\ No newline at end of file
+var _0x3715=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3715,0x1c2));var _0x5371=function(_0x7fe935,_0xcc8046){_0x7fe935=_0x7fe935-0x0;var _0x488b08=_0x3715[_0x7fe935];return _0x488b08;};'use strict';var _=require(_0x5371('0x0'));var util=require(_0x5371('0x1'));var moment=require(_0x5371('0x2'));var BPromise=require('bluebird');var rs=require(_0x5371('0x3'));var fs=require('fs');var Redis=require(_0x5371('0x4'));var db=require(_0x5371('0x5'))['db'];var utils=require(_0x5371('0x6'));var logger=require(_0x5371('0x7'))('rpc');var config=require(_0x5371('0x8'));var jayson=require(_0x5371('0x9'));var client=jayson[_0x5371('0xa')]['http']({'port':0x232a});config['redis']=_[_0x5371('0xb')](config[_0x5371('0xc')],{'host':_0x5371('0xd'),'port':0x18eb});var socket=require(_0x5371('0xe'))(new Redis(config[_0x5371('0xc')]));require(_0x5371('0xf'))[_0x5371('0x10')](socket);function respondWithRpcPromise(_0x4081e3,_0x30d422,_0x1d3fee){return new BPromise(function(_0x22cfc3,_0x42c84c){return client[_0x5371('0x11')](_0x4081e3,_0x1d3fee)['then'](function(_0x300cc7){logger[_0x5371('0x12')](_0x5371('0x13'),_0x30d422,_0x5371('0x14'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x30d422,_0x5371('0x14'),JSON[_0x5371('0x15')](_0x300cc7));if(_0x300cc7[_0x5371('0x16')]){if(_0x300cc7[_0x5371('0x16')][_0x5371('0x17')]===0x1f4){logger[_0x5371('0x16')](_0x5371('0x13'),_0x30d422,_0x300cc7['error']['message']);return _0x42c84c(_0x300cc7['error'][_0x5371('0x18')]);}logger[_0x5371('0x16')](_0x5371('0x13'),_0x30d422,_0x300cc7[_0x5371('0x16')][_0x5371('0x18')]);return _0x22cfc3(_0x300cc7[_0x5371('0x16')][_0x5371('0x18')]);}else{logger['info'](_0x5371('0x13'),_0x30d422,_0x5371('0x14'));_0x22cfc3(_0x300cc7['result']['message']);}})['catch'](function(_0x20d3e5){logger[_0x5371('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x30d422,_0x20d3e5);_0x42c84c(_0x20d3e5);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 0c57c03..20be14e 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 _0x1306=['./chatInternalMessage.events','save','remove','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x9b8e79,_0x197724){var _0x17341f=function(_0x4e74d5){while(--_0x4e74d5){_0x9b8e79['push'](_0x9b8e79['shift']());}};_0x17341f(++_0x197724);}(_0x1306,0x17a));var _0x6130=function(_0x52d226,_0xe40310){_0x52d226=_0x52d226-0x0;var _0x16bc17=_0x1306[_0x52d226];return _0x16bc17;};'use strict';var ChatInternalMessageEvents=require(_0x6130('0x0'));var events=[_0x6130('0x1'),_0x6130('0x2'),_0x6130('0x3')];function createListener(_0x193b62,_0x31415c){return function(_0xdfa9cd){_0x31415c[_0x6130('0x4')](_0x193b62,_0xdfa9cd);};}function removeListener(_0x1c10f4,_0x33f042){return function(){ChatInternalMessageEvents[_0x6130('0x5')](_0x1c10f4,_0x33f042);};}exports[_0x6130('0x6')]=function(_0x213e6a){for(var _0x2b965d=0x0,_0x1db089=events[_0x6130('0x7')];_0x2b965d<_0x1db089;_0x2b965d++){var _0x354501=events[_0x2b965d];var _0x288b1d=createListener(_0x6130('0x8')+_0x354501,_0x213e6a);ChatInternalMessageEvents['on'](_0x354501,_0x288b1d);}};
\ No newline at end of file
+var _0x562d=['./chatInternalMessage.events','save','remove','emit','length'];(function(_0x5e0f59,_0x5d054f){var _0x28bf68=function(_0x33b05d){while(--_0x33b05d){_0x5e0f59['push'](_0x5e0f59['shift']());}};_0x28bf68(++_0x5d054f);}(_0x562d,0xe1));var _0xd562=function(_0x47de1c,_0x22e27d){_0x47de1c=_0x47de1c-0x0;var _0x129312=_0x562d[_0x47de1c];return _0x129312;};'use strict';var ChatInternalMessageEvents=require(_0xd562('0x0'));var events=[_0xd562('0x1'),_0xd562('0x2'),'update'];function createListener(_0x517c30,_0x3ea08c){return function(_0x29f939){_0x3ea08c[_0xd562('0x3')](_0x517c30,_0x29f939);};}function removeListener(_0x4c6430,_0xf71ee1){return function(){ChatInternalMessageEvents['removeListener'](_0x4c6430,_0xf71ee1);};}exports['register']=function(_0x1d05e9){for(var _0x46bf9b=0x0,_0x3e6465=events[_0xd562('0x4')];_0x46bf9b<_0x3e6465;_0x46bf9b++){var _0x21f82a=events[_0x46bf9b];var _0x38e1a7=createListener('chatInternalMessage:'+_0x21f82a,_0x1d05e9);ChatInternalMessageEvents['on'](_0x21f82a,_0x38e1a7);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index cec77be..2bc701c 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 _0xfaf0=['show','post','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','/:id'];(function(_0x2e7eed,_0x3e5943){var _0x532742=function(_0x51fc51){while(--_0x51fc51){_0x2e7eed['push'](_0x2e7eed['shift']());}};_0x532742(++_0x3e5943);}(_0xfaf0,0x6a));var _0x0faf=function(_0x1d6690,_0x1b7247){_0x1d6690=_0x1d6690-0x0;var _0x3cf294=_0xfaf0[_0x1d6690];return _0x3cf294;};'use strict';var multer=require(_0x0faf('0x0'));var util=require(_0x0faf('0x1'));var path=require('path');var timeout=require(_0x0faf('0x2'));var express=require(_0x0faf('0x3'));var router=express['Router']();var fs_extra=require(_0x0faf('0x4'));var auth=require(_0x0faf('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0faf('0x6'));router['get']('/',auth[_0x0faf('0x7')](),controller[_0x0faf('0x8')]);router[_0x0faf('0x9')](_0x0faf('0xa'),auth['isAuthenticated'](),controller[_0x0faf('0xb')]);router[_0x0faf('0x9')](_0x0faf('0xc'),auth['isAuthenticated'](),controller['getUsers']);router[_0x0faf('0x9')](_0x0faf('0xd'),auth[_0x0faf('0x7')](),controller[_0x0faf('0xe')]);router[_0x0faf('0xf')]('/',auth[_0x0faf('0x7')](),controller['create']);router[_0x0faf('0x10')](_0x0faf('0xd'),controller[_0x0faf('0x11')]);router['delete'](_0x0faf('0xd'),auth['isAuthenticated'](),controller[_0x0faf('0x12')]);module[_0x0faf('0x13')]=router;
\ No newline at end of file
+var _0x4e83=['connect-timeout','express','Router','fs-extra','get','isAuthenticated','/describe','/users','/:id','show','post','create','put','delete','destroy','exports','multer','path'];(function(_0x514c5e,_0x8c0875){var _0x34c3e6=function(_0x3d78d2){while(--_0x3d78d2){_0x514c5e['push'](_0x514c5e['shift']());}};_0x34c3e6(++_0x8c0875);}(_0x4e83,0x1ae));var _0x34e8=function(_0x6e51f1,_0x11371a){_0x6e51f1=_0x6e51f1-0x0;var _0x141b4c=_0x4e83[_0x6e51f1];return _0x141b4c;};'use strict';var multer=require(_0x34e8('0x0'));var util=require('util');var path=require(_0x34e8('0x1'));var timeout=require(_0x34e8('0x2'));var express=require(_0x34e8('0x3'));var router=express[_0x34e8('0x4')]();var fs_extra=require(_0x34e8('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x34e8('0x6')]('/',auth[_0x34e8('0x7')](),controller['index']);router[_0x34e8('0x6')](_0x34e8('0x8'),auth[_0x34e8('0x7')](),controller['describe']);router[_0x34e8('0x6')](_0x34e8('0x9'),auth[_0x34e8('0x7')](),controller['getUsers']);router[_0x34e8('0x6')](_0x34e8('0xa'),auth[_0x34e8('0x7')](),controller[_0x34e8('0xb')]);router[_0x34e8('0xc')]('/',auth[_0x34e8('0x7')](),controller[_0x34e8('0xd')]);router[_0x34e8('0xe')](_0x34e8('0xa'),controller['update']);router[_0x34e8('0xf')](_0x34e8('0xa'),auth['isAuthenticated'](),controller[_0x34e8('0x10')]);module[_0x34e8('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 6187b92..43cb3fe 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 _0x3c38=['DATE','STRING','sequelize','exports','TEXT','medium','ENUM','out'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3c38,0x8a));var _0x83c3=function(_0x558958,_0x98f5ca){_0x558958=_0x558958-0x0;var _0xef3c17=_0x3c38[_0x558958];return _0xef3c17;};'use strict';var Sequelize=require(_0x83c3('0x0'));module[_0x83c3('0x1')]={'body':{'type':Sequelize[_0x83c3('0x2')](_0x83c3('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x83c3('0x4')]('in',_0x83c3('0x5')),'defaultValue':_0x83c3('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x83c3('0x6')]},'providerName':{'type':Sequelize[_0x83c3('0x7')]},'providerResponse':{'type':Sequelize[_0x83c3('0x2')]}};
\ No newline at end of file
+var _0xe52f=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x4bd4c5,_0x376640){var _0x200e5e=function(_0xc99aec){while(--_0xc99aec){_0x4bd4c5['push'](_0x4bd4c5['shift']());}};_0x200e5e(++_0x376640);}(_0xe52f,0x170));var _0xfe52=function(_0xc11207,_0x19fbd0){_0xc11207=_0xc11207-0x0;var _0x6072e9=_0xe52f[_0xc11207];return _0x6072e9;};'use strict';var Sequelize=require(_0xfe52('0x0'));module[_0xfe52('0x1')]={'body':{'type':Sequelize[_0xfe52('0x2')](_0xfe52('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xfe52('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xfe52('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfe52('0x5')]('in',_0xfe52('0x6')),'defaultValue':_0xfe52('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xfe52('0x7')]},'providerResponse':{'type':Sequelize[_0xfe52('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 6d669d4..095c257 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 _0xd71e=['findAll','rows','show','params','include','find','create','body','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','Contact','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','interaction','get','role','null','AcceptMessage','acceptMessage','startsWith','cf_','push','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','manual','SIP/%s','channel','EventManager','parse','formData','info','RejectMessage','rejectMessage','CmContact','Sequelize','interface','event','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','name','send','index','ChatMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll'];(function(_0x32b773,_0x543dd8){var _0x554d59=function(_0x28e434){while(--_0x28e434){_0x32b773['push'](_0x32b773['shift']());}};_0x554d59(++_0x543dd8);}(_0xd71e,0x1c9));var _0xed71=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xd71e[_0x45d3f0];return _0x314b79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed71('0x0'));var zipdir=require(_0xed71('0x1'));var jsonpatch=require(_0xed71('0x2'));var rp=require(_0xed71('0x3'));var moment=require(_0xed71('0x4'));var BPromise=require(_0xed71('0x5'));var Mustache=require(_0xed71('0x6'));var util=require(_0xed71('0x7'));var path=require(_0xed71('0x8'));var sox=require(_0xed71('0x9'));var csv=require(_0xed71('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed71('0xb'));var crypto=require(_0xed71('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xed71('0xd'));var toCsv=require(_0xed71('0xa'));var querystring=require(_0xed71('0xe'));var Papa=require(_0xed71('0xf'));var Redis=require(_0xed71('0x10'));var authService=require(_0xed71('0x11'));var qs=require(_0xed71('0x12'));var as=require(_0xed71('0x13'));var hardwareService=require(_0xed71('0x14'));var logger=require(_0xed71('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xed71('0x16'));var licenseUtil=require(_0xed71('0x17'));var db=require(_0xed71('0x18'))['db'];config[_0xed71('0x19')]=_[_0xed71('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xed71('0x1b'))(new Redis(config[_0xed71('0x19')]));require(_0xed71('0x1c'))[_0xed71('0x1d')](socket);var jayson=require(_0xed71('0x1e'));var client=jayson[_0xed71('0x1f')][_0xed71('0x20')]({'port':0x232c});var client9002=jayson[_0xed71('0x1f')][_0xed71('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x21bff6,_0x30e93d,_0x462b25,_0x3b813f){return new BPromise(function(_0x30dc17,_0x360bce){var _0x3181db=_0x3b813f||client;return _0x3181db[_0xed71('0x21')](_0x21bff6,_0x462b25)[_0xed71('0x22')](function(_0x210e1c){logger['info'](_0xed71('0x23'),_0x30e93d,_0xed71('0x24'));logger['debug'](_0xed71('0x25'),_0x30e93d,_0xed71('0x24'),JSON[_0xed71('0x26')](_0x210e1c));if(_0x210e1c[_0xed71('0x27')]){if(_0x210e1c['error'][_0xed71('0x28')]===0x1f4){logger['error'](_0xed71('0x23'),_0x30e93d,_0x210e1c['error'][_0xed71('0x29')]);return _0x360bce(_0x210e1c['error']['message']);}logger[_0xed71('0x27')](_0xed71('0x23'),_0x30e93d,_0x210e1c[_0xed71('0x27')]['message']);return _0x30dc17(_0x210e1c[_0xed71('0x27')][_0xed71('0x29')]);}else{logger['info'](_0xed71('0x23'),_0x30e93d,_0xed71('0x24'));_0x30dc17(_0x210e1c[_0xed71('0x2a')][_0xed71('0x29')]);}})[_0xed71('0x2b')](function(_0x4b3d24){logger[_0xed71('0x27')](_0xed71('0x23'),_0x30e93d,_0x4b3d24);_0x360bce(_0x4b3d24);});});}function respondWithStatusCode(_0x29ffa,_0x223704){_0x223704=_0x223704||0xcc;return function(_0x117bf9){if(_0x117bf9){return _0x29ffa[_0xed71('0x2c')](_0x223704);}return _0x29ffa[_0xed71('0x2d')](_0x223704)[_0xed71('0x2e')]();};}function respondWithResult(_0x592c50,_0x3af03e){_0x3af03e=_0x3af03e||0xc8;return function(_0x1844e5){if(_0x1844e5){return _0x592c50[_0xed71('0x2d')](_0x3af03e)[_0xed71('0x2f')](_0x1844e5);}};}function respondWithFilteredResult(_0xfc6130,_0x5af9f3){return function(_0x296daf){if(_0x296daf){var _0xae50fb=typeof _0x5af9f3[_0xed71('0x30')]===_0xed71('0x31')&&typeof _0x5af9f3[_0xed71('0x32')]===_0xed71('0x31');var _0x1fc439=_0x296daf[_0xed71('0x33')];var _0x4c610e=_0xae50fb?0x0:_0x5af9f3[_0xed71('0x30')];var _0x2d2ca0=_0xae50fb?_0x296daf[_0xed71('0x33')]:_0x5af9f3[_0xed71('0x30')]+_0x5af9f3[_0xed71('0x32')];var _0x337fdd;if(_0x2d2ca0>=_0x1fc439){_0x2d2ca0=_0x1fc439;_0x337fdd=0xc8;}else{_0x337fdd=0xce;}_0xfc6130[_0xed71('0x2d')](_0x337fdd);return _0xfc6130['set'](_0xed71('0x34'),_0x4c610e+'-'+_0x2d2ca0+'/'+_0x1fc439)[_0xed71('0x2f')](_0x296daf);}return null;};}function patchUpdates(_0x5cc24e){return function(_0x5656a9){try{jsonpatch[_0xed71('0x35')](_0x5656a9,_0x5cc24e,!![]);}catch(_0x1a918b){return BPromise[_0xed71('0x36')](_0x1a918b);}return _0x5656a9[_0xed71('0x37')]();};}function saveUpdates(_0x4479da,_0x3e44c5){return function(_0x53274){if(_0x53274){return _0x53274[_0xed71('0x38')](_0x4479da)[_0xed71('0x22')](function(_0x3d5a9f){return _0x3d5a9f;});}return null;};}function removeEntity(_0x156a08,_0x2b0593){return function(_0x1e9588){if(_0x1e9588){return _0x1e9588[_0xed71('0x39')]()[_0xed71('0x22')](function(){_0x156a08[_0xed71('0x2d')](0xcc)[_0xed71('0x2e')]();});}};}function handleEntityNotFound(_0x4f86df,_0x115b2f){return function(_0x13ab0d){if(!_0x13ab0d){_0x4f86df[_0xed71('0x2c')](0x194);}return _0x13ab0d;};}function handleError(_0x3a29f8,_0x3d0d87){_0x3d0d87=_0x3d0d87||0x1f4;return function(_0x4a5498){logger[_0xed71('0x27')](_0x4a5498['stack']);if(_0x4a5498[_0xed71('0x3a')]){delete _0x4a5498[_0xed71('0x3a')];}_0x3a29f8[_0xed71('0x2d')](_0x3d0d87)[_0xed71('0x3b')](_0x4a5498);};}exports[_0xed71('0x3c')]=function(_0x2e82cc,_0xb29b44){var _0x5207cc={},_0x3d7b58={},_0x17c239={'count':0x0,'rows':[]};var _0x841e48=_['map'](db[_0xed71('0x3d')][_0xed71('0x3e')],function(_0x115f58){return{'name':_0x115f58[_0xed71('0x3f')],'type':_0x115f58['type'][_0xed71('0x40')]};});_0x3d7b58[_0xed71('0x41')]=_['map'](_0x841e48,'name');_0x3d7b58['query']=_[_0xed71('0x42')](_0x2e82cc[_0xed71('0x43')]);_0x3d7b58[_0xed71('0x44')]=_[_0xed71('0x45')](_0x3d7b58[_0xed71('0x41')],_0x3d7b58[_0xed71('0x43')]);_0x5207cc[_0xed71('0x46')]=_[_0xed71('0x45')](_0x3d7b58[_0xed71('0x41')],qs['fields'](_0x2e82cc['query'][_0xed71('0x47')]));_0x5207cc[_0xed71('0x46')]=_0x5207cc['attributes'][_0xed71('0x48')]?_0x5207cc[_0xed71('0x46')]:_0x3d7b58[_0xed71('0x41')];if(!_0x2e82cc[_0xed71('0x43')][_0xed71('0x49')]('nolimit')){_0x5207cc['limit']=qs[_0xed71('0x32')](_0x2e82cc[_0xed71('0x43')][_0xed71('0x32')]);_0x5207cc[_0xed71('0x30')]=qs[_0xed71('0x30')](_0x2e82cc[_0xed71('0x43')][_0xed71('0x30')]);}_0x5207cc[_0xed71('0x4a')]=qs[_0xed71('0x4b')](_0x2e82cc[_0xed71('0x43')]['sort']);_0x5207cc[_0xed71('0x4c')]=qs[_0xed71('0x44')](_[_0xed71('0x4d')](_0x2e82cc[_0xed71('0x43')],_0x3d7b58[_0xed71('0x44')]),_0x841e48);if(_0x2e82cc[_0xed71('0x43')][_0xed71('0x4e')]){_0x5207cc[_0xed71('0x4c')]=_[_0xed71('0x4f')](_0x5207cc[_0xed71('0x4c')],{'$or':_[_0xed71('0x50')](_0x841e48,function(_0x2bf9e9){if(_0x2bf9e9['type']!==_0xed71('0x51')){var _0x533223={};_0x533223[_0x2bf9e9['name']]={'$like':'%'+_0x2e82cc[_0xed71('0x43')][_0xed71('0x4e')]+'%'};return _0x533223;}})});}_0x5207cc=_[_0xed71('0x4f')]({},_0x5207cc,_0x2e82cc['options']);var _0x388d8b={'where':_0x5207cc[_0xed71('0x4c')]};return db[_0xed71('0x3d')][_0xed71('0x33')](_0x388d8b)[_0xed71('0x22')](function(_0x2e1be1){_0x17c239[_0xed71('0x33')]=_0x2e1be1;if(_0x2e82cc['query'][_0xed71('0x52')]){_0x5207cc['include']=[{'all':!![]}];}return db[_0xed71('0x3d')][_0xed71('0x53')](_0x5207cc);})[_0xed71('0x22')](function(_0xe436e0){_0x17c239[_0xed71('0x54')]=_0xe436e0;return _0x17c239;})[_0xed71('0x22')](respondWithFilteredResult(_0xb29b44,_0x5207cc))['catch'](handleError(_0xb29b44,null));};exports[_0xed71('0x55')]=function(_0x369b6a,_0x138ee1){var _0x1f3b53={'raw':!![],'where':{'id':_0x369b6a[_0xed71('0x56')]['id']}},_0xc5a87={};_0xc5a87[_0xed71('0x41')]=_[_0xed71('0x42')](db[_0xed71('0x3d')][_0xed71('0x3e')]);_0xc5a87[_0xed71('0x43')]=_[_0xed71('0x42')](_0x369b6a[_0xed71('0x43')]);_0xc5a87[_0xed71('0x44')]=_[_0xed71('0x45')](_0xc5a87[_0xed71('0x41')],_0xc5a87['query']);_0x1f3b53[_0xed71('0x46')]=_[_0xed71('0x45')](_0xc5a87[_0xed71('0x41')],qs[_0xed71('0x47')](_0x369b6a[_0xed71('0x43')][_0xed71('0x47')]));_0x1f3b53[_0xed71('0x46')]=_0x1f3b53[_0xed71('0x46')][_0xed71('0x48')]?_0x1f3b53['attributes']:_0xc5a87['model'];if(_0x369b6a['query'][_0xed71('0x52')]){_0x1f3b53[_0xed71('0x57')]=[{'all':!![]}];}_0x1f3b53=_['merge']({},_0x1f3b53,_0x369b6a['options']);return db[_0xed71('0x3d')][_0xed71('0x58')](_0x1f3b53)[_0xed71('0x22')](handleEntityNotFound(_0x138ee1,null))[_0xed71('0x22')](respondWithResult(_0x138ee1,null))['catch'](handleError(_0x138ee1,null));};exports[_0xed71('0x59')]=function(_0x2248d9,_0x1b8d32){return db[_0xed71('0x3d')][_0xed71('0x59')](_0x2248d9[_0xed71('0x5a')],{})[_0xed71('0x22')](respondWithResult(_0x1b8d32,0xc9))[_0xed71('0x2b')](handleError(_0x1b8d32,null));};exports[_0xed71('0x38')]=function(_0x1d5f99,_0x4bf3f1){if(_0x1d5f99[_0xed71('0x5a')]['id']){delete _0x1d5f99[_0xed71('0x5a')]['id'];}return db[_0xed71('0x3d')][_0xed71('0x58')]({'where':{'id':_0x1d5f99['params']['id']}})['then'](handleEntityNotFound(_0x4bf3f1,null))[_0xed71('0x22')](saveUpdates(_0x1d5f99[_0xed71('0x5a')],null))['then'](respondWithResult(_0x4bf3f1,null))[_0xed71('0x2b')](handleError(_0x4bf3f1,null));};exports[_0xed71('0x39')]=function(_0x566846,_0x579a4b){return db[_0xed71('0x3d')][_0xed71('0x58')]({'where':{'id':_0x566846[_0xed71('0x56')]['id']}})['then'](handleEntityNotFound(_0x579a4b,null))[_0xed71('0x22')](removeEntity(_0x579a4b,null))[_0xed71('0x2b')](handleError(_0x579a4b,null));};exports[_0xed71('0x5b')]=function(_0x4dca18,_0x97dc40){return db[_0xed71('0x3d')][_0xed71('0x5b')]()[_0xed71('0x22')](respondWithResult(_0x97dc40,null))['catch'](handleError(_0x97dc40,null));};var interaction_log=require(_0xed71('0x15'))(_0xed71('0x5c'));exports[_0xed71('0x5d')]=function(_0xa6ec89,_0x598b71,_0x66ab60){var _0x5279e9={'agent':{},'channel':_0xed71('0x5e')};if(_0xa6ec89[_0xed71('0x5a')]['id']){delete _0xa6ec89[_0xed71('0x5a')]['id'];}_0xa6ec89[_0xed71('0x5a')][_0xed71('0x5f')]=!![];_0xa6ec89[_0xed71('0x5a')][_0xed71('0x60')]=moment()['format'](_0xed71('0x61'));_0xa6ec89[_0xed71('0x5a')][_0xed71('0x62')]=_0xa6ec89[_0xed71('0x5a')]['UserId']||_0xa6ec89[_0xed71('0x63')]['id'];_0x5279e9[_0xed71('0x64')]['id']=_0xa6ec89[_0xed71('0x5a')][_0xed71('0x62')];return db['ChatMessage']['find']({'where':{'id':_0xa6ec89['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xed71('0x65')}]})[_0xed71('0x22')](handleEntityNotFound(_0x598b71,null))[_0xed71('0x22')](saveUpdates(_0xa6ec89[_0xed71('0x5a')],null))[_0xed71('0x22')](function(_0x7e7be1){if(_0x7e7be1){_0x5279e9['message']=_0x7e7be1['get']({'plain':!![]});return db[_0xed71('0x66')][_0xed71('0x58')]({'where':{'id':_0x7e7be1[_0xed71('0x67')]}});}return null;})[_0xed71('0x22')](handleEntityNotFound(_0x598b71,null))[_0xed71('0x22')](function(_0x233b4a){if(_0x233b4a){return _0x233b4a['update']({'UserId':_0xa6ec89[_0xed71('0x5a')][_0xed71('0x62')],'read1stAt':_[_0xed71('0x68')](_0x233b4a[_0xed71('0x69')])?moment()[_0xed71('0x6a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x2b8250){if(_0x2b8250){_0x5279e9[_0xed71('0x6b')]=_0x2b8250[_0xed71('0x6c')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xa6ec89[_0xed71('0x63')]['id'],_0xa6ec89[_0xed71('0x63')][_0xed71('0x3a')],_0xa6ec89[_0xed71('0x63')][_0xed71('0x6d')],_0x5279e9['interaction']['id'],_0xa6ec89[_0xed71('0x5a')]?JSON[_0xed71('0x26')](_0xa6ec89[_0xed71('0x5a')]):_0xed71('0x6e'));return respondWithRpcPromise(_0xed71('0x6f'),_0xed71('0x70'),_0x5279e9);}return null;})[_0xed71('0x22')](function(_0x1df1b9){return db['CmContact'][_0xed71('0x5b')]()[_0xed71('0x22')](function(_0x1e8872){var _0x1ad5f1=[];for(var _0x2bcd3c=0x0;_0x2bcd3c
','Attachments','Title','Data','getHost','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','randomstring','path','util','node-tnef'];(function(_0x1bdaf7,_0x49e4d3){var _0x1ca543=function(_0x39bdc5){while(--_0x39bdc5){_0x1bdaf7['push'](_0x1bdaf7['shift']());}};_0x1ca543(++_0x49e4d3);}(_0x4864,0x10c));var _0x4486=function(_0x3a7368,_0x185789){_0x3a7368=_0x3a7368-0x0;var _0x1aa883=_0x4864[_0x3a7368];return _0x1aa883;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0x4486('0x0'));var fs=require('fs');var path=require(_0x4486('0x1'));var util=require(_0x4486('0x2'));var tnef=require(_0x4486('0x3'));var logger=require(_0x4486('0x4'))(_0x4486('0x5'));var config=require('../../../config/environment');function getAddress(_0x2857e4){var _0x1503c0=_['head'](_0x2857e4[_0x4486('0x6')]);return _0x1503c0&&_0x1503c0[_0x4486('0x7')]?_0x1503c0[_0x4486('0x7')]:_0x4486('0x8')+random[_0x4486('0x9')](0x6)+_0x4486('0xa');}function getFirstName(_0x27f71f){var _0x158968=_[_0x4486('0xb')](_0x27f71f[_0x4486('0x6')]);if(_0x158968&&_0x158968['name']){var _0x55ac93=_0x158968[_0x4486('0xc')]['split'](/\s+/);return _0x55ac93[_0x4486('0xd')]?_0x55ac93[_0x4486('0xe')](0x0,-0x1)['join']('\x20'):_0x158968[_0x4486('0xc')];}return _0x4486('0xf');}function getLastName(_0x6f442d){var _0x2f5e56=_[_0x4486('0xb')](_0x6f442d[_0x4486('0x6')]);if(_0x2f5e56&&_0x2f5e56['name']){var _0x4be7c4=_0x2f5e56['name'][_0x4486('0x10')](/\s+/);return _0x4be7c4['length']>0x1?_0x4be7c4[_0x4486('0x11')]():'';}return'';}function getMails(_0x26f34c,_0x2a36a6){var _0xc0a139='';for(var _0x287b22=0x0;_0x287b22<_0x2a36a6[_0x4486('0x6')][_0x4486('0xd')];_0x287b22+=0x1){if(_0x2a36a6[_0x4486('0x6')][_0x287b22]['address']!==_0x26f34c){if(!_['isEmpty'](_0xc0a139)){_0xc0a139+=',';}_0xc0a139+=_0x2a36a6[_0x4486('0x6')][_0x287b22]['name']||_0x2a36a6[_0x4486('0x6')][_0x287b22][_0x4486('0x7')]||'';_0xc0a139+='\x20<';_0xc0a139+=_0x2a36a6['value'][_0x287b22][_0x4486('0x7')]?_0x2a36a6[_0x4486('0x6')][_0x287b22][_0x4486('0x7')]:'anonymous'+random[_0x4486('0x9')](0x6)+'@xcally.com';_0xc0a139+='>';}}return _0xc0a139;}function parseEmail(_0x32d5c4,_0x294772,_0x3914a9){if(_0x294772[_0x4486('0x12')]){var _0x21f1a8=/